code: def test_detect_poison(self):
      _, clean_trust = self.defence_trust.detect_poison()
      _, clean_no_trust = self.defence_no_trust.detect_poison()
      real_clean = np.array(
          [
              1 if i < NB_TRAIN else 0
              for i in range(NB_TRAIN + NB_POISON)
          ]
      )
      pc_tp_trust = np.average(
          real_clean[:NB_TRAIN] == clean_trust[:NB_TRAIN]
      )
      pc_tn_trust = np.average(
          real_clean[NB_TRAIN:] == clean_trust[NB_TRAIN:]
      )
      self.assertGreaterEqual(pc_tn_trust, 0.7)
      self.assertGreaterEqual(pc_tp_trust, 0.7)
  
      pc_tp_no_trust = np.average(
          real_clean[:NB_TRAIN] == clean_no_trust[:NB_TRAIN]
      )
      pc_tn_no_trust = np.average(
          real_clean[NB_TRAIN:] == clean_no_trust[NB_TRAIN:]
      )
      self.assertGreaterEqual(pc_tn_no_trust, 0.7)
      self.assertGreaterEqual(pc_tp_no_trust, 0.7)
  
file_path: adversarial-robustness-toolbox/tests/defences/detector/poison/test_provenance_defence.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import unittest
  import numpy
  from sklearn.svm import SVC
  from art.attacks.poisoning.poisoning_attack_svm import PoisoningAttackSVM
  from art.estimators.classification.scikitlearn import SklearnClassifier, ScikitlearnSVC
  from art.defences.detector.poison.provenance_defense import ProvenanceDefense
  from art.utils import load_mnist
  from tests.utils import master_seed
label_desc: Use image node_id 7 for calling the TestProvenanceDefence obj's underlying member method code with example usage: obj.test_detect_poison() without return types