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

Function is_top_level_function

draggan/stylegan2/dnnlib/util.py:298–300  ·  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

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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected