code: def test_random_state_exponentiated_gradient():
      """Test that the random_state argument works as expected.
  
      This test case reproduces the problem reported in issue 588 if the
      random_state does not work as intended within Exponentiated Gradient.
      https://github.com/fairlearn/fairlearn/issues/588
      """
      X_train, X_test, y_train, _, race_train, _ = _get_test_data()
  
      # Train a simple logistic regression model
      lr = LogisticRegression(max_iter=1000, random_state=0)
      lr.fit(X_train, y_train)
  
      # Train threshold optimizer
      expgrad = ExponentiatedGradient(
          estimator=lr, constraints=EqualizedOdds()
      )
      expgrad.fit(X_train, y_train, sensitive_features=race_train)
  
      # score groups
      y_pred_test = expgrad.predict(X_test, random_state=0)
      for _ in range(100):
          assert (
              y_pred_test == expgrad.predict(X_test, random_state=0)
          ).all()
      assert (
          y_pred_test != expgrad.predict(X_test, random_state=1)
      ).any()
  
file_path: fairlearn/test/unit/test_random_state.py
imports: import pandas
  from sklearn.datasets import fetch_openml
  from sklearn.linear_model import LogisticRegression
  from sklearn.model_selection import train_test_split
  from fairlearn.postprocessing import ThresholdOptimizer
  from fairlearn.reductions import EqualizedOdds, ExponentiatedGradient
label_desc: Use image node_id 2 for calling a global function with example usage: test_random_state_exponentiated_gradient() without return types