parameters: (kwargs, allowed_kwargs,
                      error_message='Keyword argument not understood:')
docstring: Checks that all keyword arguments are in the set of allowed keys.
docstring_summary: Checks that all keyword arguments are in the set of allowed keys.
docstring_tokens: Checks that all keyword arguments are in the set of allowed keys .
function: def validate_kwargs(kwargs, allowed_kwargs,
                      error_message='Keyword argument not understood:'):
    """Checks that all keyword arguments are in the set of allowed keys."""
    for kwarg in kwargs:
      if kwarg not in allowed_kwargs:
        raise TypeError(error_message, kwarg)
function_tokens: def validate_kwargs ( kwargs , allowed_kwargs , error_message = 'Keyword argument not understood:' ) : for kwarg in kwargs : if kwarg not in allowed_kwargs : raise TypeError ( error_message , kwarg )