code: def test_one_vs_rest():
      ovr = one_vs_rest(
          statistical_parity_difference, y, y_pred, prot_attr="sex"
      )
      assert ovr[0] == -ovr[1]
      assert ovr[1] == statistical_parity_difference(
          y, y_pred, prot_attr="sex"
      )
  
      v, k = one_vs_rest(
          disparate_impact_ratio, y, y_pred, return_groups=True
      )
      assert len(v) == 4
      ovr = dict(zip(k, v))
      for i in range(2):
          for j in range(2):
              g = (i, j)
              assert (
                  disparate_impact_ratio(y, y_pred, priv_group=g)
                  == ovr[g]
              )
  
imports: from functools import partial
  import numpy
  import pandas
  import pytest
  from numpy.testing import assert_almost_equal
  from sklearn.linear_model import LogisticRegression
  from aif360.datasets import AdultDataset
  from aif360.sklearn.datasets import fetch_adult
  from aif360.metrics import ClassificationMetric
  from aif360.sklearn.metrics import consistency_score, specificity_score, selection_rate, base_rate, smoothed_base_rate, generalized_fpr, generalized_fnr, disparate_impact_ratio, statistical_parity_difference, equal_opportunity_difference, average_odds_difference, average_predictive_value_difference, average_odds_error, smoothed_edf, df_bias_amplification, generalized_entropy_error, between_group_generalized_entropy_error, class_imbalance, kl_divergence, conditional_demographic_disparity, intersection, one_vs_rest, make_scorer
label_desc: Use image node_id 24 for calling a global function with example usage: test_one_vs_rest() without return types