human
Can you provide a the Python program you requested given the following:
Complete the below
def check_kwargs(kwargs, fun):

    ''''Helper for making functions with kwargs.  Checks whether the kwargs
    are empty after all of them have been popped off.  If they\'re
    not, raises an error describing which kwargs are invalid.
    Example::
    def foo(self, **kwargs):
    x = kwargs.pop(\'x\', None)
    y = kwargs.pop(\'y\', None)
    z = kwargs.pop(\'z\', None)
    check_kwargs(kwargs, self.foo)
    # This raises a TypeError:
    foo(w=\'bad kwarg\')'
    '''
assistant
#Here is the Python program you requested.
    if kwargs:
        raise TypeError(("'%s'    is    an    invalid    keyword    argument    for    function    %s()." % (next(kwargs.iterkeys()), fun.__name__)))