code: def test_roc_curve_one_label(setup):
      y_true = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
      y_pred = [0, 1, 0, 1, 0, 1, 0, 1, 0, 1]
      # assert there are warnings
      w = UndefinedMetricWarning
      with pytest.warns(w):
          fpr, tpr, thresholds = roc_curve(y_true, y_pred)
      # all true labels, all fpr should be nan
      np.testing.assert_array_equal(
          fpr.fetch(), np.full(len(thresholds), np.nan)
      )
      assert fpr.shape == tpr.shape
      assert fpr.shape == thresholds.shape
  
      # assert there are warnings
      with pytest.warns(w):
          fpr, tpr, thresholds = roc_curve(
              [1 - x for x in y_true], y_pred
          )
      # all negative labels, all tpr should be nan
      np.testing.assert_array_equal(
          tpr.fetch(), np.full(len(thresholds), np.nan)
      )
      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 8 for calling a global function with example usage: test_roc_curve_one_label(setup) without return types