code: def _estimators_has(attr):
      """Check if self.estimator or self.estimators_[0] has attr.
  
      If `self.estimators_[0]` has the attr, then its safe to assume that other
      values has it too. This function is used together with `avaliable_if`.
      """
      return lambda self: (
          hasattr(self.estimator, attr)
          or (
              hasattr(self, "estimators_")
              and hasattr(self.estimators_[0], attr)
          )
      )
  
imports: import array
  import itertools
  import warnings
  from numbers import Integral, Real
  import numpy
  import scipy.sparse
  from .base import BaseEstimator, ClassifierMixin, MetaEstimatorMixin, MultiOutputMixin, _fit_context, clone, is_classifier, is_regressor
  from .metrics.pairwise import pairwise_distances_argmin
  from .preprocessing import LabelBinarizer
  from .utils import check_random_state
  from .utils._param_validation import HasMethods, Interval
  from .utils._tags import _safe_tags
  from .utils.metadata_routing import MetadataRouter, MethodMapping, _raise_for_params, process_routing
  from .utils.metaestimators import _safe_split, available_if
  from .utils.multiclass import _check_partial_fit_first_call, _ovr_decision_function, check_classification_targets
  from .utils.parallel import Parallel, delayed
  from .utils.validation import _check_method_params, _num_samples, check_is_fitted
label_desc: Use image node_id 5 for calling a global function with example usage: _estimators_has(attr) and returns: function