MCPcopy Create free account
hub / github.com/Vchitect/Latte / is_top_level_function

Function is_top_level_function

tools/dnnlib/util.py:301–303  ·  view source on GitHub ↗

Determine whether the given object is a top-level function, i.e., defined at module scope using 'def'.

(obj: Any)

Source from the content-addressed store, hash-verified

299
300
301def is_top_level_function(obj: Any) -> bool:
302 """Determine whether the given object is a top-level function, i.e., defined at module scope using 'def'."""
303 return callable(obj) and obj.__name__ in sys.modules[obj.__module__].__dict__
304
305
306def get_top_level_function_name(obj: Any) -> str:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected