code: def test_bgl_lagrange_specifications(A_two_dim):
      a0_count = 13
      a1_count = 4
  
      a0_label = 5
      a1_label = 3
  
      a0_factor = 1
      a1_factor = 16
  
      X, y, A = _simple_regression_data(
          a0_count,
          a1_count,
          a0_factor,
          a1_factor,
          a0_label,
          a1_label,
          A_two_dim,
      )
  
      estimator = LinearRegression()
  
      # Do the grid search with a zero Lagrange multiplier
      idx = pd.Index(sorted([a0_label, a1_label]))
      l0_series = pd.Series([2.0, 0.0], index=idx)
      l1_series = pd.Series([1.5, 0.5], index=idx)
      l2_series = pd.Series([1.0, 1.0], index=idx)
      l3_series = pd.Series([0.5, 1.5], index=idx)
      l4_series = pd.Series([0.0, 2.0], index=idx)
      grid_df = pd.concat(
          [l0_series, l1_series, l2_series, l3_series, l4_series],
          axis=1,
      )
  
      grid_search1 = GridSearch(
          copy.deepcopy(estimator),
          constraints=BoundedGroupLoss(ZeroOneLoss()),
          grid_size=5,
      )
  
      grid_search2 = GridSearch(
          copy.deepcopy(estimator),
          constraints=BoundedGroupLoss(ZeroOneLoss()),
          grid=grid_df,
      )
  
      tradeoffs = [0, 0.25, 0.5, 0.75, 1]
  
      grid_search1.fit(X, y, sensitive_features=A)
      grid_search2.fit(X, y, sensitive_features=A)
  
      assert_n_grid_search_results(len(tradeoffs), grid_search1)
      assert_n_grid_search_results(len(tradeoffs), grid_search2)
  
      # Check we generated the same multipliers
      for i in range(len(tradeoffs)):
          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(len(tradeoffs)):
          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_regression.py
imports: import copy
  from test.unit.reductions.grid_search.utilities import assert_n_grid_search_results
  from test.unit.utility_functions import logging_all_close
  import numpy
  import pandas
  import pytest
  from sklearn.linear_model import LinearRegression
  from fairlearn.reductions import BoundedGroupLoss, GridSearch, SquareLoss, ZeroOneLoss
label_desc: Use image node_id 4 for calling a global function with example usage: test_bgl_lagrange_specifications(A_two_dim) without return types