code: def check_drop_original_variables(estimator):
      """
      Only for transformers with a parameter `drop_original`in init.
  
      Checks correct functionality of `drop_original`. If True, the original variables,
      that is, those stored in the attribute `variables_` are dropped from the
      transformed dataframe (after transform()). If False, original variables are
      returned in the transformed dataframe.
      """
      # Test df
      X, y = test_df(categorical=True, datetime=True)
  
      # when drop_original is true
      estimator = clone(estimator)
      estimator.set_params(drop_original=True)
      X_tr = estimator.fit_transform(X, y)
  
      vars = estimator.variables_
      if hasattr(estimator, "reference"):
          vars = vars + estimator.reference
  
      # Check that original variables are not in transformed dataframe
      assert set(vars).isdisjoint(set(X_tr.columns))
      # Check that remaining variables are in transformed dataframe
      remaining = [
          f for f in estimator.feature_names_in_ if f not in vars
      ]
      assert all([f in X_tr.columns for f in remaining])
  
      # when drop_original is False
      estimator = clone(estimator)
      estimator.set_params(drop_original=False)
      X_tr = estimator.fit_transform(X, y)
  
      vars = estimator.variables_
  
      # Check that original variables are in transformed dataframe
      assert len([f in X_tr.columns for f in vars])
      # Check that remaining variables are in transformed dataframe
      remaining = [
          f for f in estimator.feature_names_in_ if f not in vars
      ]
      assert all([f in X_tr.columns for f in remaining])
  
imports: import pytest
  from sklearn import clone
  from tests.estimator_checks.dataframe_for_checks import test_df
label_desc: Use image node_id 2 for calling a global function with example usage: check_drop_original_variables(estimator) without return types