code: def test_auc_score_non_binary_class(setup):
      # Test that roc_auc_score function returns an error when trying
      # to compute AUC for non-binary class values.
      rng = check_random_state(404)
      y_pred = rng.rand(10)
      # y_true contains only one class value
      y_true = np.zeros(10, dtype="int")
      err_msg = "ROC AUC score is not defined"
      with pytest.raises(ValueError, match=err_msg):
          roc_auc_score(y_true, y_pred)
      y_true = np.ones(10, dtype="int")
      with pytest.raises(ValueError, match=err_msg):
          roc_auc_score(y_true, y_pred)
      y_true = np.full(10, -1, dtype="int")
      with pytest.raises(ValueError, match=err_msg):
          roc_auc_score(y_true, y_pred)
  
      with warnings.catch_warnings(record=True):
          rng = check_random_state(404)
          y_pred = rng.rand(10)
          # y_true contains only one class value
          y_true = np.zeros(10, dtype="int")
          with pytest.raises(ValueError, match=err_msg):
              roc_auc_score(y_true, y_pred)
          y_true = np.ones(10, dtype="int")
          with pytest.raises(ValueError, match=err_msg):
              roc_auc_score(y_true, y_pred)
          y_true = np.full(10, -1, dtype="int")
          with pytest.raises(ValueError, match=err_msg):
              roc_auc_score(y_true, y_pred)
  
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 19 for calling a global function with example usage: test_auc_score_non_binary_class(setup) without return types