code: def test_all_ones(self):
      ones = np.ones(10)
  
      # should behave as if pos_label=1
      assert metrics.true_positive_rate(ones, ones) == 1
      assert metrics.false_positive_rate(ones, ones) == 0
      assert metrics.true_negative_rate(ones, ones) == 0
      assert metrics.false_negative_rate(ones, ones) == 0
  
      assert metrics.true_positive_rate(ones, ones, pos_label=1) == 1
      assert metrics.false_positive_rate(ones, ones, pos_label=1) == 0
      assert metrics.true_negative_rate(ones, ones, pos_label=1) == 0
      assert metrics.false_negative_rate(ones, ones, pos_label=1) == 0
  
      assert metrics.true_positive_rate(ones, ones, pos_label=0) == 0
      assert metrics.false_positive_rate(ones, ones, pos_label=0) == 0
      assert metrics.true_negative_rate(ones, ones, pos_label=0) == 1
      assert metrics.false_negative_rate(ones, ones, pos_label=0) == 0
  
imports: import numpy
  import pytest
  import sklearn.metrics
  import fairlearn.metrics
  from fairlearn.metrics._base_metrics import _get_labels_for_confusion_matrix
label_desc: Use image node_id 2 for calling the TestSingleValueArrays obj's underlying member method code with example usage: obj.test_all_ones() without return types