import inspect


def keep_function_kwargs(function, kwargs):
    """ Keep the keys of a dictionary

    Example
    -------
    >>> function1 = lambda a, b: 1
    >>> keep_function_kwargs(function1, {'a': 1, 'c': 1})
    {'a': 1}"""

    return {key: kwargs[key] for key in kwargs if key in inspect.getfullargspec(function).args}