code: def test_feature_names_in(estimator):
      transformer = clone(estimator)
      X, y = test_df(categorical=True)
  
      if transformer.__class__.__name__ == "TargetMeanRegressor":
          # y needs to be continuous
          y = X["var_10"]
  
      varnames = list(X.columns)
  
      transformer.fit(X, y)
  
      assert transformer.feature_names_in_ == varnames
      assert transformer.n_features_in_ == len(varnames)
  
imports: import numpy
  import pandas
  import pytest
  from sklearn.base import clone
  from sklearn.exceptions import NotFittedError
  from sklearn.utils.estimator_checks import check_estimator
  from feature_engine._prediction.base_predictor import BaseTargetMeanEstimator
  from feature_engine._prediction.target_mean_classifier import TargetMeanClassifier
  from feature_engine._prediction.target_mean_regressor import TargetMeanRegressor
  from feature_engine.discretisation import EqualFrequencyDiscretiser, EqualWidthDiscretiser
  from feature_engine.encoding import MeanEncoder
  from tests.estimator_checks.dataframe_for_checks import test_df
  from tests.estimator_checks.fit_functionality_checks import check_error_if_y_not_passed
label_desc: Use image node_id 7 for calling a global function with example usage: test_feature_names_in(estimator) without return types