code: def set_params(self, **params):
          
          if not params:
              # Simple optimization to gain speed (inspect is slow)
              return self
  
          for key, value in params.items():
              if hasattr(self, key):
                  setattr(self, key, value)
              else:
                  self.kwargs[key] = value
  
          return self
docs: Set the parameters of this estimator.
          Modification of the sklearn method to allow unknown kwargs. This allows using
          the full range of xgboost parameters that are not defined as member variables
          in sklearn grid search.
          Returns
          -------
          self