code: def test_precision_recall_f_binary_single_class(setup):
      # Test precision, recall and F-scores behave with a single positive or
      # negative class
      # Such a case may occur with non-stratified cross-validation
      assert 1.0 == fetch(execute(precision_score([1, 1], [1, 1])))
      assert 1.0 == fetch(execute(recall_score([1, 1], [1, 1])))
      assert 1.0 == fetch(execute(f1_score([1, 1], [1, 1])))
      assert 1.0 == fetch(execute(fbeta_score([1, 1], [1, 1], beta=0)))
  
      assert 0.0 == fetch(execute(precision_score([-1, -1], [-1, -1])))
      assert 0.0 == fetch(execute(recall_score([-1, -1], [-1, -1])))
      assert 0.0 == fetch(execute(f1_score([-1, -1], [-1, -1])))
      assert 0.0 == fetch(
          execute(fbeta_score([-1, -1], [-1, -1], beta=float("inf")))
      )
      assert fetch(
          execute(fbeta_score([-1, -1], [-1, -1], beta=float("inf")))
      ) == pytest.approx(
          fetch(execute(fbeta_score([-1, -1], [-1, -1], beta=1e5)))
      )
  
imports: import numpy
  import pytest
  from sklearn import datasets, svm
  from sklearn.exceptions import UndefinedMetricWarning
  from sklearn.metrics import accuracy_score
  from sklearn.utils import check_random_state
  from sklearn.utils._testing import assert_almost_equal, assert_array_equal, assert_array_almost_equal
  from sklearn.utils._mocking import MockDataFrame
  from ....None import execute, fetch
  from ....None import tensor
  from ....lib.sparse import SparseNDArray
  from ..None import accuracy_score, log_loss
  from .._classification import _check_targets, multilabel_confusion_matrix, precision_recall_fscore_support, precision_score, recall_score, f1_score, fbeta_score
label_desc: Use image node_id 15 for calling a global function with example usage: test_precision_recall_f_binary_single_class(setup) without return types