MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / find_root

Function find_root

tools/python-3.11.9-amd64/Lib/lib2to3/fixer_util.py:294–301  ·  view source on GitHub ↗

Find the top level namespace.

(node)

Source from the content-addressed store, hash-verified

292 return suite
293
294def find_root(node):
295 """Find the top level namespace."""
296 # Scamper up to the top level namespace
297 while node.type != syms.file_input:
298 node = node.parent
299 if not node:
300 raise ValueError("root found before file_input node was found.")
301 return node
302
303def does_tree_import(package, name, node):
304 """ Returns true if name is imported from package at the

Callers 3

does_tree_importFunction · 0.85
touch_importFunction · 0.85
refactor_treeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected