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