code: def check_feature_names_in(estimator):
      """Checks that transformers learn the variable names of the train set used
      during fit, as well as the number of variables.
  
      Should be applied to all transformers.
      """
      # the estimator learns the parameters from the train set
      X, y = test_df(categorical=True, datetime=True)
      varnames = list(X.columns)
      estimator = clone(estimator)
      estimator.fit(X, y)
      assert estimator.feature_names_in_ == varnames
      assert estimator.n_features_in_ == len(varnames)
  
imports: import pytest
  from sklearn import clone
  from tests.estimator_checks.dataframe_for_checks import test_df
label_desc: Use image node_id 1 for calling a global function with example usage: check_feature_names_in(estimator) without return types