Determine whether the given object is a top-level function, i.e., defined at module scope using 'def'.
(obj: Any)
| 299 | |
| 300 | |
| 301 | def 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 | |
| 306 | def get_top_level_function_name(obj: Any) -> str: |
no outgoing calls
no test coverage detected