code: def is_estimator(model):
      
      if inspect.isclass(model):
          return issubclass(model, BaseEstimator)
  
      return isinstance(model, BaseEstimator)
docs: Determines if a model is an estimator using issubclass and isinstance.
  
      Parameters
      ----------
      estimator : class or instance
          The object to test if it is a Scikit-Learn clusterer, especially a
          Scikit-Learn estimator or Yellowbrick visualizer