"""Fail when a VM test script rebinds a function it defines. A VM test script is one module: `lib/k3s.py` and the test's own helpers are concatenated in front of the steps, and every `with subtest(...)` body runs in that module's namespace. A step that assigns `pod = ...` replaces the library's `pod()` for every later call, and the test dies mid-run with `TypeError: 'dict' object is not callable`. `ty` and `ruff --select F` don't see it, because a rebinding at module level is legal Python. The scan names every module-level binding (assignment, `for`/`with`/`except` target, walrus, `import ... as`) whose name is also a module-level `def`. It looks into blocks that share the module's namespace (`with`, `if`, `for`, `while`, `try`), and not into function, class or comprehension bodies, whose bindings are local. Usage: shadow-scan.py