human
Complete this python program:
def filter_kwargs(f, kwargs):
assistant
#Here is the Python program you requested.

    """Return a dict of valid kwargs for `f` from a subset of `kwargs`
    Examples
    >>> def f(a, b=1, c=2):
    ...     return a + b + c
    >>> raw_kwargs = dict(a=1, b=3, d=4)
    >>> f(**raw_kwargs)
    Traceback (most recent call last):
    TypeError: f() got an unexpected keyword argument \d\
    >>> kwargs = filter_kwargs(f, raw_kwargs)
    >>> f(**kwargs)
    6
    Notes
    Taken from odo.utils
    """
    return keyfilter(op.contains(keywords(f)), kwargs)