import inspect


def get_caller_frame(i=1):
    """Get the caller's frame (utilizing the inspect module).

    You can adjust `i` to find the i-th caller, default is 1.
    """
    # We can't use inspect.stack()[1 + i][1] for the file name because ST sets
    # that to a different value when inside a zip archive.
    return inspect.stack()[1 + i][0]