code: def _extract_estimator_cls(estimator):
      if isinstance(estimator, partial):
          # is partialled
          return estimator.func
      if not isinstance(estimator, type):
          # is instance
          return estimator.__class__
      return estimator
  
imports: from functools import partial
  from importlib import import_module
  from itertools import chain
  import re
  import shlex
  import sys
  from sklearn.base import BaseEstimator
  from sklearn.pipeline import FeatureUnion
  from sklearn.pipeline import Pipeline
label_desc: Use image node_id 9 for calling a global function with example usage: _extract_estimator_cls(estimator) and returns: estimator, estimator, estimator