code: def test_can_specify_and_generate_lambda_vecs(A_two_dim):
      score_threshold = 0.4
  
      number_a0 = 32
      number_a1 = 24
  
      a0_label = 11
      a1_label = 3
  
      X, y, A = _simple_threshold_data(
          number_a0,
          number_a1,
          score_threshold,
          score_threshold,
          a0_label,
          a1_label,
      )
  
      estimator = LogisticRegression(
          solver="liblinear", fit_intercept=True, random_state=97
      )
  
      iterables = [["+", "-"], ["all"], sorted([a0_label, a1_label])]
      midx = pd.MultiIndex.from_product(
          iterables, names=["sign", "event", "group_id"]
      )
      lagrange_negative_series = pd.Series(
          [0.0, 0.0, 0.0, 2.0], index=midx
      )
      lagrange_zero_series = pd.Series(np.zeros(4), index=midx)
      lagrange_positive_series = pd.Series(
          [0.0, 2.0, 0.0, 0.0], index=midx
      )
      grid_df = pd.concat(
          [
              lagrange_negative_series,
              lagrange_zero_series,
              lagrange_positive_series,
          ],
          axis=1,
      )
  
      grid_search1 = GridSearch(
          copy.deepcopy(estimator),
          constraints=DemographicParity(),
          grid_size=3,
      )
  
      grid_search2 = GridSearch(
          copy.deepcopy(estimator),
          constraints=DemographicParity(),
          grid=grid_df,
      )
  
      # Try both ways of specifying the Lagrange multipliers
      grid_search2.fit(X, y, sensitive_features=A)
      grid_search1.fit(X, y, sensitive_features=A)
  
      assert_n_grid_search_results(3, grid_search1)
      assert_n_grid_search_results(3, grid_search2)
  
      # Check we generated the same multipliers
      for i in range(3):
          lm1 = grid_search1.lambda_vecs_[i]
          lm2 = grid_search2.lambda_vecs_[i]
          assert lm1.equals(lm2)
  
      # Check the models are the same
      for i in range(3):
          coef1 = grid_search1.predictors_[i].coef_
          coef2 = grid_search2.predictors_[i].coef_
          assert np.array_equal(coef1, coef2)
  
file_path: fairlearn/test/unit/reductions/grid_search/test_grid_search_demographicparity.py
imports: import copy
  from test.unit.reductions.grid_search.utilities import assert_n_grid_search_results
  import numpy
  import pandas
  import pytest
  from sklearn.dummy import DummyClassifier
  from sklearn.linear_model import LogisticRegression
  from fairlearn.reductions import DemographicParity, GridSearch
label_desc: Use image node_id 5 for calling a global function with example usage: test_can_specify_and_generate_lambda_vecs(A_two_dim) without return types