import inspect


def find_arg_names(fn) -> tuple:
    """
    Creates a dictionary mapping of the argument name to its index of a function

    :param fn: a callable function
    :return: a tuple with the first item being a dictionary of the argument name to index of the argument, the second
        argument being a dictionary mapping of the kwarg name to default value
    """
    arg_to_index = {}
    kwargs_to_default = {}
    for i, (name, value) in enumerate(inspect.signature(fn).parameters.items()):
        arg_to_index[name] = i
        if value.default is not value.empty:
            kwargs_to_default[name] = value.default

    return arg_to_index, kwargs_to_default