code: def test_analyze_correct_all_clean(self):
      # perfect detection all data is actually clean:
      (
          errors_by_class,
          conf_matrix_json,
      ) = self.evaluator.analyze_correctness(
          self.is_clean_all_clean, self.is_clean_all_clean
      )
  
      json_object = json.loads(conf_matrix_json)
      self.assertEqual(len(json_object.keys()), self.n_classes)
      self.assertEqual(len(errors_by_class), self.n_classes)
  
      # print(json_object)
      for i in range(self.n_classes):
          res_class_i = json_object["class_" + str(i)]
          self.assertEqual(res_class_i["TruePositive"]["rate"], -1)
          self.assertEqual(res_class_i["TrueNegative"]["rate"], 100)
          self.assertEqual(res_class_i["FalseNegative"]["rate"], -1)
          self.assertEqual(res_class_i["FalsePositive"]["rate"], 0)
  
          self.assertEqual(res_class_i["TruePositive"]["numerator"], 0)
          self.assertEqual(
              res_class_i["TruePositive"]["denominator"], 0
          )
  
          self.assertEqual(
              res_class_i["TrueNegative"]["numerator"], self.n_dp
          )
          self.assertEqual(
              res_class_i["TrueNegative"]["denominator"], self.n_dp
          )
  
          self.assertEqual(res_class_i["FalseNegative"]["numerator"], 0)
          self.assertEqual(
              res_class_i["FalseNegative"]["denominator"], 0
          )
  
          self.assertEqual(res_class_i["FalsePositive"]["numerator"], 0)
          self.assertEqual(
              res_class_i["FalsePositive"]["denominator"], self.n_dp
          )
  
          # all errors_by_class should be 1 (errors_by_class[i] = 1 if marked clean, is clean)
          for item in errors_by_class[i]:
              self.assertEqual(item, 1)
  
file_path: adversarial-robustness-toolbox/tests/defences/detector/poison/test_ground_truth_evaluator.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import json
  import logging
  import pprint
  import unittest
  from art.defences.detector.poison import GroundTruthEvaluator
  from tests.utils import master_seed
label_desc: Use image node_id 3 for calling the TestGroundTruth obj's underlying member method code with example usage: obj.test_analyze_correct_all_clean() without return types