MCPcopy Index your code
hub / github.com/ipython/ipython / extract_module_locals

Function extract_module_locals

IPython/utils/frame.py:92–97  ·  view source on GitHub ↗

Returns (module, locals) of the function `depth` frames away from the caller

(depth: int = 0)

Source from the content-addressed store, hash-verified

90
91
92def extract_module_locals(depth: int = 0) -> tuple[ModuleType, dict[str, Any]]:
93 """Returns (module, locals) of the function `depth` frames away from the caller"""
94 f = sys._getframe(depth + 1)
95 global_ns = f.f_globals
96 module = sys.modules[global_ns['__name__']]
97 return (module, f.f_locals)

Callers 1

embed_kernelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…