MCPcopy Create free account
hub / github.com/XingangPan/DragGAN / is_top_level_function

Function is_top_level_function

dnnlib/util.py:312–314  ·  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

310
311
312def is_top_level_function(obj: Any) -> bool:
313 """Determine whether the given object is a top-level function, i.e., defined at module scope using 'def'."""
314 return callable(obj) and obj.__name__ in sys.modules[obj.__module__].__dict__
315
316
317def get_top_level_function_name(obj: Any) -> str:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected