code: def is_gridsearch(estimator):
      """
      Returns True if the given estimator is a clusterer.
  
      Parameters
      ----------
      estimator : class or instance
          The object to test if it is a Scikit-Learn clusterer, especially a
          Scikit-Learn estimator or Yellowbrick visualizer
      """
  
      from sklearn.model_selection import (
          GridSearchCV,
          RandomizedSearchCV,
      )
  
      if inspect.isclass(estimator):
          return issubclass(
              estimator, (GridSearchCV, RandomizedSearchCV)
          )
  
      return isinstance(estimator, (GridSearchCV, RandomizedSearchCV))
  
file_path: yellowbrick/yellowbrick/utils/types.py
imports: import inspect
  import numpy
  from sklearn.base import BaseEstimator
  from yellowbrick.contrib.wrapper import ContribEstimator
label_desc: Use image node_id 5 for calling a global function with example usage: is_gridsearch(estimator) and returns: isinstance, issubclass