def caller_frame(offset=0) -> FrameType:
    """
    Get the caller's (of this function) frame. See
    https://docs.python.org/3/reference/datamodel.html#frame-objects .
    """
    caller_frame = inspect.currentframe()
    for _ in range(offset + 1):
        if caller_frame is None:
            raise RuntimeError("No current frame found.")
        caller_frame = caller_frame.f_back

    if caller_frame is None:
        raise RuntimeError("No caller frame found.")

    return caller_frame

    Get the caller's (of this function) frame. See
    https://docs.python.org/3/reference/datamodel.html#frame-objects .
    
src/core/trulens/core/utils/python.py