code: def get_estimator_from_meta_estimator(estimator):
      """
      If ``estimator`` is a meta estimator, get estimator inside.
      Otherwise return ``estimator``. Will try to return the fitted
      estimator first.
      """
      # If estimator is not of type Meta Estimator, return as is
      if not isinstance(
          estimator,
          (
              TransformedTargetRegressor,
              CustomProbabilityThresholdClassifier,
          ),
      ):
          return estimator
  
      if hasattr(estimator, "regressor_"):
          return get_estimator_from_meta_estimator(estimator.regressor_)
      if hasattr(estimator, "classifier_"):
          return get_estimator_from_meta_estimator(
              estimator.classifier_
          )
      if hasattr(estimator, "regressor"):
          return get_estimator_from_meta_estimator(estimator.regressor)
      if hasattr(estimator, "classifier"):
          return get_estimator_from_meta_estimator(estimator.classifier)
      return estimator
  
imports: import sklearn.compose
  from sklearn.base import BaseEstimator, ClassifierMixin, clone
  from sklearn.compose import TransformedTargetRegressor
  from sklearn.preprocessing import PowerTransformer
  from sklearn.utils.validation import check_is_fitted
label_desc: Use image node_id 1 for calling a global function with example usage: get_estimator_from_meta_estimator(estimator) and returns: estimator, estimator, get_estimator_from_meta_estimator, get_estimator_from_meta_estimator, get_estimator_from_meta_estimator, get_estimator_from_meta_estimator