code: def _validate_func_args(func, kwargs):
      
  
      args, varargs, varkw, defaults = inspect.getargspec(func)
      if set(kwargs.keys()) != set(args[1:]): # chop off self
          raise TypeError("decorator kwargs do not match %s()'s kwargs"
                          % func.__name__)
docs: Validate decorator args when used to decorate a function.