def has_locals(foo: str) -> Optional[FrameType]: bar = 'baz' # noqa - Needed to ensure non-argument locals are present in the returned frame return inspect.currentframe()