code: def test_input_X_unchanged(
      self, transformA, transformY, transformX, mocker
  ):
      # The purpose of this test is to ensure that X is passed to the underlying estimator
      # unchanged. For y and sample_weight ExponentiatedGradient makes certain transformations
      # which are required. They are expected as pandas.Series.
      X, y, A = _get_data()
  
      transformed_X = transformX(X)
      transformed_y = transformY(y)
      transformed_A = transformA(A)
  
      # Using a mocked estimator here since we don't actually want to fit one, but rather care
      # about having that object's fit method called exactly twice through the best_h calls.
      estimator = LeastSquaresBinaryClassifierLearner()
      estimator.predict = mocker.Mock(return_value=y)
      estimator.fit = mocker.MagicMock()
      # restrict ExponentiatedGradient to a single iteration
      expgrad = ExponentiatedGradient(
          estimator, constraints=DemographicParity(), max_iter=1
      )
      mocker.patch("copy.deepcopy", return_value=estimator)
      expgrad.fit(
          transformed_X, transformed_y, sensitive_features=transformed_A
      )
  
      # ensure that the input data wasn't changed by our mitigator before being passed to the
      # underlying estimator
      assert estimator.fit.call_count == 2
      args, kwargs = estimator.fit.call_args
      assert len(args) == 2  # X and y
      assert len(kwargs) == 1  # sample_weight
      assert isinstance(args[0], type(transformed_X))
      assert isinstance(args[1], pd.Series)
      assert isinstance(kwargs["sample_weight"], pd.Series)
  
file_path: fairlearn/test/unit/reductions/exponentiated_gradient/test_exponentiatedgradient_arguments.py
imports: from test.unit.input_convertors import _map_into_single_column, conversions_for_1d, ensure_dataframe, ensure_ndarray
  from test.unit.reductions.conftest import is_invalid_transformation
  import numpy
  import pandas
  import pytest
  from sklearn.linear_model import LogisticRegression
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import StandardScaler
  from fairlearn.reductions import DemographicParity, ErrorRate, ExponentiatedGradient
  from fairlearn.utils._input_validation import _LABELS_NOT_0_1_ERROR_MESSAGE
  from .simple_learners import LeastSquaresBinaryClassifierLearner
  from .test_utilities import _get_data
label_desc: Use image node_id 3 for calling the TestExponentiatedGradientArguments obj's underlying member method code with example usage: obj.test_input_X_unchanged(transformA, transformY, transformX, mocker) without return types