def get_culprit(omit_top_frames=1):
    """get the filename and line number calling this.

    Parameters
    ----------
    omit_top_frames: int, default=1
        omit n frames from top of stack stack. Purpose is to get the real
        culprit and not intermediate functions on the stack.
    Returns
    -------
    (filename: str, fileno: int)
    filename and line number of the culprit.
    """
    try:
        caller_stack = stack()[omit_top_frames:]
        while len(caller_stack) > 0:
            frame = caller_stack.pop(0)
            filename = frame[1]
            # skip callee frames if they are other decorators or this file(func)
            if '<decorator' in filename or __file__ in filename:
                continue
            else:
                break
        lineno = frame[2]
        # avoid cyclic references!
        del caller_stack, frame
    except OSError:  # eg. os.getcwd() fails in conda-test, since cwd gets deleted.
        filename = 'unknown'
        lineno = -1
    return filename, lineno
get the filename and line number calling this.

    Parameters
    ----------
    omit_top_frames: int, default=1
        omit n frames from top of stack stack. Purpose is to get the real
        culprit and not intermediate functions on the stack.
    Returns
    -------
    (filename: str, fileno: int)
    filename and line number of the culprit.