code: def test_rej_opt_clf_predict_proba(new_adult, log_reg_probs, new_ROC):
      """Test RejectOptionClassifier predict_proba + threshold matches predict."""
      _, y, _ = new_adult
      y_pred = pd.DataFrame(log_reg_probs, index=y.index)
      y_postpred = new_ROC.predict(y_pred)
      y_postproba = new_ROC.predict_proba(y_pred)[:, 1]
  
      threshold = new_ROC.best_estimator_.threshold
      assert all((y_postproba > threshold).astype(int) == y_postpred)
  
      # test pos_label=0
      y_pred = pd.DataFrame(log_reg_probs[:, ::-1], index=y.index)
      new_ROC.fit(y_pred, 1 - y, pos_label=0)
  
      assert threshold == new_ROC.best_estimator_.threshold
      assert all(y_postpred == 1 - new_ROC.predict(y_pred))
      assert all(y_postproba == new_ROC.predict_proba(y_pred)[:, 0])
  
file_path: AIF360/tests/sklearn/test_reject_option_classification.py
imports: from itertools import product
  import numpy
  import pandas
  import pytest
  from sklearn.linear_model import LogisticRegression
  from sklearn.model_selection import train_test_split
  from sklearn.metrics import make_scorer
  from aif360.algorithms.postprocessing import RejectOptionClassification
  from aif360.sklearn.postprocessing import RejectOptionClassifier, RejectOptionClassifierCV, PostProcessingMeta
  from aif360.sklearn.metrics import generalized_entropy_error
label_desc: Use image node_id 6 for calling a global function with example usage: test_rej_opt_clf_predict_proba(new_adult, log_reg_probs, new_ROC) without return types