MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _python_local_import_names_uncached

Function _python_local_import_names_uncached

graphify/extractors/engine.py:3492–3507  ·  view source on GitHub ↗
(func_def_node, source: bytes)

Source from the content-addressed store, hash-verified

3490
3491
3492def _python_local_import_names_uncached(func_def_node, source: bytes) -> set[str]:
3493 bound: set[str] = set()
3494
3495 def walk(n) -> None:
3496 for child in n.children:
3497 t = child.type
3498 if t in ("function_definition", "class_definition", "lambda"):
3499 continue
3500 if t in ("import_statement", "import_from_statement"):
3501 bound.update(_python_import_bound_names(child, source))
3502 walk(child)
3503
3504 body = func_def_node.child_by_field_name("body")
3505 if body is not None:
3506 walk(body)
3507 return bound
3508
3509
3510def _python_call_shadowed_by_local_import(node, callee_name: str, source: bytes) -> bool:

Calls 1

walkFunction · 0.70