import inspect


def outer_args(skip_self=True) -> dict:
    """Get the arguments of the func within which this function is called.

    Args:
        skip_self (bool):
            True: skip the argument named `self`
            False: doesn't skip the argument named `self`
    """
    currframe = inspect.currentframe()
    outerframe = inspect.getouterframes(currframe, 2)
    args, _, _, values = inspect.getargvalues(outerframe[1][0])
    if skip_self:  # pylint: disable=R1705
        return {
            key: value
            for key, value in values.items()
            if (key in args) and (key != 'self')
        }
    else:
        return {key: value for key, value in values.items() if key in args}