code: def test_1m_1sf_1cf():
      target = metrics.MetricFrame(
          metrics=skm.confusion_matrix,
          y_true=y_t,
          y_pred=y_p,
          sensitive_features=g_1,
          control_features=g_2,
      )
  
      for cf in np.unique(g_2):
          mask_c = g_2 == cf
          overall = skm.confusion_matrix(y_t[mask_c], y_p[mask_c])
          actual = target.overall[cf]
          assert np.array_equal(overall, actual)
  
          for sf in np.unique(g_1):
              mask_s = g_1 == sf
              mask = np.logical_and(mask_c, mask_s)
              expected = skm.confusion_matrix(y_t[mask], y_p[mask])
              actual = target.by_group[(cf, sf)]
              assert np.array_equal(expected, actual)
  
file_path: fairlearn/test/unit/metrics/test_metricframe_nonscalar.py
imports: import functools
  import numpy
  import sklearn.metrics
  import fairlearn.metrics
  from .data_for_test import g_1, g_2, y_p, y_t
label_desc: Use image node_id 2 for calling a global function with example usage: test_1m_1sf_1cf() without return types