code: def test_roc_curve_hard(setup):
      # roc_curve for hard decisions
      y_true, pred, probas_pred = make_prediction(binary=True)
  
      # always predict one
      trivial_pred = np.ones(y_true.shape)
      fpr, tpr, thresholds = roc_curve(y_true, trivial_pred)
      roc_auc = auc(fpr, tpr).fetch()
      np.testing.assert_array_almost_equal(roc_auc, 0.50, decimal=2)
      assert fpr.shape == tpr.shape
      assert fpr.shape == thresholds.shape
  
      # always predict zero
      trivial_pred = np.zeros(y_true.shape)
      fpr, tpr, thresholds = roc_curve(y_true, trivial_pred)
      roc_auc = auc(fpr, tpr).fetch()
      np.testing.assert_array_almost_equal(roc_auc, 0.50, decimal=2)
      assert fpr.shape == tpr.shape
      assert fpr.shape == thresholds.shape
  
      # hard decisions
      fpr, tpr, thresholds = roc_curve(y_true, pred)
      roc_auc = auc(fpr, tpr).fetch()
      np.testing.assert_array_almost_equal(roc_auc, 0.78, 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 7 for calling a global function with example usage: test_roc_curve_hard(setup) without return types