code: def run_gridsearch_classification(estimator, moment):
      """Run classification test with GridSearch."""
      X_train, Y_train, A_train, X_test, Y_test, A_test = fetch_adult()
      verification_moment = copy.deepcopy(moment)
  
      unmitigated = copy.deepcopy(estimator)
      unmitigated.fit(X_train, Y_train)
  
      num_predictors = 11
      gs = GridSearch(
          estimator, constraints=moment, grid_size=num_predictors
      )
      gs.fit(X_train, Y_train, sensitive_features=A_train)
  
      assert len(gs.predictors_) == num_predictors
  
      verification_moment.load_data(
          X_test, Y_test, sensitive_features=A_test
      )
      gamma_unmitigated = verification_moment.gamma(
          lambda x: unmitigated.predict(x)
      )
      gamma_mitigated = verification_moment.gamma(
          lambda x: gs.predict(x)
      )
  
      for idx in gamma_mitigated.index:
          assert abs(gamma_mitigated[idx]) <= abs(
              gamma_unmitigated[idx]
          ), "Checking {0}".format(idx)
  
file_path: fairlearn/test_othermlpackages/package_test_common.py
imports: import copy
  import pandas
  from numpy import mean, random, number
  from sklearn.model_selection import train_test_split
  from sklearn.preprocessing import LabelEncoder, StandardScaler, OneHotEncoder
  from sklearn.compose import make_column_selector, make_column_transformer
  import fairlearn.utils._compatibility
  import fairlearn.datasets
  from fairlearn.metrics import demographic_parity_difference
  from fairlearn.postprocessing import ThresholdOptimizer
  from fairlearn.reductions import ExponentiatedGradient, GridSearch
  import logging
label_desc: Use image node_id 3 for calling a global function with example usage: run_gridsearch_classification(estimator, moment) without return types