MCPcopy Create free account
hub / github.com/SwayStar123/SpeedrunDiT / is_top_level_function

Function is_top_level_function

preprocessing/dnnlib/util.py:299–301  ·  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

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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected