code: def test_equal_opportunity_pandas():
      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, 1],
          }
      )
  
      X, y = (
          sensitive_classification_dataset.drop(columns="y"),
          sensitive_classification_dataset["y"],
      )
  
      mod_1 = types.SimpleNamespace()
  
      mod_1.predict = lambda X: np.array([1, 0, 1, 0, 1, 0, 1, 1])
      assert (
          equal_opportunity_score(sensitive_column="x2")(mod_1, X, y)
          == 0.75
      )
  
      mod_1.predict = lambda X: np.array([1, 0, 1, 0, 1, 0, 0, 1])
      assert (
          equal_opportunity_score(sensitive_column="x2")(mod_1, X, y)
          == 0.75
      )
  
      mod_1.predict = lambda X: np.array([1, 0, 1, 0, 1, 0, 0, 0])
      assert (
          equal_opportunity_score(sensitive_column="x2")(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 1 for calling a global function with example usage: test_equal_opportunity_pandas() without return types