def caller_locals():
    # type: () -> Dict
    """Return the frame object for the caller's stack frame."""
    try:
        raise ValueError
    except ValueError:
        _, _, tb = sys.exc_info()
        assert tb, "Can't get traceback, this shouldn't happen"
        caller_frame = tb.tb_frame.f_back.f_back
        return caller_frame.f_locals