Modifies the provided function to support kwargs by only passing along kwargs for parameters it accepts

def auto_kwargs(function):
    """Modifies the provided function to support kwargs by only passing along kwargs for parameters it accepts"""
    supported = introspect.arguments(function)

    @wraps(function)
    def call_function(*args, **kwargs):
        return function(*args, **{key: value for key, value in kwargs.items() if key in supported})
    return call_function