code: def test_meta_estimators_delegate_data_validation(estimator):
      # Check that meta-estimators delegate data validation to the inner
      # estimator(s).
      rng = np.random.RandomState(0)
      set_random_state(estimator)
  
      n_samples = 30
      X = rng.choice(
          np.array(["aa", "bb", "cc"], dtype=object), size=n_samples
      )
  
      if is_regressor(estimator):
          y = rng.normal(size=n_samples)
      else:
          y = rng.randint(3, size=n_samples)
  
      # We convert to lists to make sure it works on array-like
      X = _enforce_estimator_tags_X(estimator, X).tolist()
      y = _enforce_estimator_tags_y(estimator, y).tolist()
  
      # Calling fit should not raise any data validation exception since X is a
      # valid input datastructure for the first step of the pipeline passed as
      # base estimator to the meta estimator.
      estimator.fit(X, y)
  
      # n_features_in_ should not be defined since data is not tabular data.
      assert not hasattr(estimator, "n_features_in_")
  
imports: import functools
  from inspect import signature
  import numpy
  import pytest
  from sklearn.base import BaseEstimator, is_regressor
  from sklearn.datasets import make_classification
  from sklearn.ensemble import BaggingClassifier
  from sklearn.exceptions import NotFittedError
  from sklearn.feature_extraction.text import TfidfVectorizer
  from sklearn.feature_selection import RFE, RFECV
  from sklearn.linear_model import LogisticRegression, Ridge
  from sklearn.model_selection import GridSearchCV, RandomizedSearchCV
  from sklearn.pipeline import Pipeline, make_pipeline
  from sklearn.preprocessing import MaxAbsScaler, StandardScaler
  from sklearn.semi_supervised import SelfTrainingClassifier
  from sklearn.utils import all_estimators
  from sklearn.utils._testing import set_random_state
  from sklearn.utils.estimator_checks import _enforce_estimator_tags_X, _enforce_estimator_tags_y
  from sklearn.utils.validation import check_is_fitted
label_desc: Use image node_id 4 for calling a global function with example usage: test_meta_estimators_delegate_data_validation(estimator) without return types