code: def _check_method(self, method):
          
          estimator = self._postfit_estimator
          if not hasattr(estimator, method):
              msg = "The wrapped estimator '{}' does not have a '{}' method.".format(
                  estimator, method
              )
              raise AttributeError(msg)
          return getattr(estimator, method)
docs: Check if self.estimator has 'method'.
  
          Raises
          ------
          AttributeError