code: def test_basic_metric_dict(transform_y_t, transform_y_p):
      # If there are failures here, other, more specific tests should also fail
      g_f = pd.DataFrame(data=g_4, columns=["My feature"])
      target = metrics.MetricFrame(
          metrics={"recall": skm.recall_score},
          y_true=transform_y_t(y_t),
          y_pred=transform_y_p(y_p),
          sensitive_features=g_f,
      )
      # Check on ci_quantiles
      assert target.ci_quantiles is None
  
      # Check on the indices properties
      assert target.control_levels is None
      assert isinstance(target.sensitive_levels, list)
      assert target.sensitive_levels == ["My feature"]
  
      # Check we have correct return types
      assert isinstance(target.overall, pd.Series)
      assert isinstance(target.by_group, pd.DataFrame)
  
      # Check we have expected number of elements
      assert len(target.overall) == 1
      assert target.by_group.shape == (2, 1)
      assert np.array_equal(target.by_group.index.names, ["My feature"])
  
      recall_overall = skm.recall_score(y_t, y_p)
      assert target.overall["recall"] == recall_overall
  
      mask_p = g_4 == "pp"
      mask_q = g_4 == "q"
      recall_p = skm.recall_score(y_t[mask_p], y_p[mask_p])
      recall_q = skm.recall_score(y_t[mask_q], y_p[mask_q])
      assert target.by_group["recall"]["pp"] == recall_p
      assert target.by_group["recall"]["q"] == recall_q
  
      target_mins = target.group_min()
      assert isinstance(target_mins, pd.Series)
      assert len(target_mins) == 1
      assert target_mins["recall"] == min(recall_p, recall_q)
  
      target_maxes = target.group_max()
      assert isinstance(target_mins, pd.Series)
      assert len(target_maxes) == 1
      assert target_maxes["recall"] == max(recall_p, recall_q)
  
file_path: fairlearn/test/unit/metrics/test_metricframe_smoke.py
imports: from test.unit.input_convertors import conversions_for_1d
  import numpy
  import pandas
  import pytest
  import sklearn.metrics
  import fairlearn.metrics
  from .data_for_test import g_1, g_2, g_3, g_4, s_w, y_p, y_t
label_desc: Use image node_id 2 for calling a global function with example usage: test_basic_metric_dict(transform_y_t, transform_y_p) without return types