code: def test_roc_returns_consistency(setup):
      # Test whether the returned threshold matches up with tpr
      # make small toy dataset
      y_true, _, probas_pred = make_prediction(binary=True)
      fpr, tpr, thresholds = roc_curve(y_true, probas_pred).fetch()
  
      # use the given thresholds to determine the tpr
      tpr_correct = []
      for t in thresholds:
          tp = np.sum((probas_pred >= t) & y_true)
          p = np.sum(y_true)
          tpr_correct.append(1.0 * tp / p)
  
      # compare tpr and tpr_correct to see if the thresholds' order was correct
      np.testing.assert_array_almost_equal(tpr, tpr_correct, decimal=2)
      assert fpr.shape == tpr.shape
      assert fpr.shape == thresholds.shape
  
imports: import re
  import warnings
  import numpy
  import pandas
  import pytest
  from sklearn.metrics import roc_curve, auc, accuracy_score
  from sklearn.metrics.tests.test_ranking import make_prediction, _auc
  from sklearn.exceptions import UndefinedMetricWarning
  from sklearn.utils import check_random_state
  from sklearn.utils._testing import assert_almost_equal, assert_array_almost_equal
  from ....None import dataframe
  from ....None import tensor
  from ...utils.extmath import softmax
  from ..None import roc_curve, auc, accuracy_score, roc_auc_score
label_desc: Use image node_id 4 for calling a global function with example usage: test_roc_returns_consistency(setup) without return types