code: def test_p_percent_pandas_multiclass():
      sensitive_classification_dataset = pd.DataFrame(
          {
              "x1": [1, 0, 1, 0, 1, 0, 1, 1],
              "x2": [0, 0, 0, 0, 0, 1, 1, 1],
              "y": [1, 1, 1, 0, 1, 0, 0, 2],
          }
      )
  
      X, y = (
          sensitive_classification_dataset.drop(columns="y"),
          sensitive_classification_dataset["y"],
      )
  
      mod_1 = types.SimpleNamespace()
  
      mod_1.predict = lambda X: np.array([2, 0, 1, 0, 1, 0, 1, 2])
      assert (
          equal_opportunity_score(
              sensitive_column="x2", positive_target=2
          )(mod_1, X, np.array([2, 0, 1, 0, 1, 0, 1, 2]))
          == 1
      )
  
      mod_1.predict = lambda X: np.array([1, 0, 1, 0, 1, 0, 0, 1])
      assert (
          equal_opportunity_score(
              sensitive_column="x2", positive_target=2
          )(mod_1, X, y)
          == 0
      )
  
      mod_1.predict = lambda X: np.array([1, 0, 1, 0, 1, 0, 0, 0])
      assert (
          equal_opportunity_score(
              sensitive_column="x2", positive_target=2
          )(mod_1, X, y)
          == 0
      )
  
file_path: scikit-lego/tests/test_metrics/test_equal_opportunity.py
imports: import types
  import warnings
  import numpy
  import pandas
  from sklearn.linear_model import LogisticRegression
  from sklearn.pipeline import make_pipeline
  from sklego.metrics import equal_opportunity_score
  from sklego.preprocessing import ColumnSelector
label_desc: Use image node_id 2 for calling a global function with example usage: test_p_percent_pandas_multiclass() without return types