code: def _check_for_invalid_keys(fname, kwargs, compat_args):
      """
      Checks whether 'kwargs' contains any keys that are not
      in 'compat_args' and raises a TypeError if there is one.
  
      """
      # set(dict) --> set of the dictionary's keys
      diff = set(kwargs) - set(compat_args)
  
      if diff:
          bad_arg = list(diff)[0]
          raise TypeError(
              (
                  "{fname}() got an unexpected "
                  "keyword argument '{arg}'".format(
                      fname=fname, arg=bad_arg
                  )
              )
          )
  
file_path: catboost/contrib/python/pandas/py2/pandas/util/_validators.py
imports: import warnings
  from pandas.core.dtypes.common import is_bool
label_desc: Use image node_id 4 for calling a global function with example usage: _check_for_invalid_keys(fname, kwargs, compat_args) without return types