original_docstring: 
          Returns poison detected and a report.
  
          :param kwargs: A dictionary of detection-specific parameters.
          :return: (report, is_clean_lst):
                  where a report is a dict object that contains information specified by the provenance detection method
                  where is_clean is a list, where is_clean_lst[i]=1 means that x_train[i]
                  there is clean and is_clean_lst[i]=0, means that x_train[i] was classified as poison.
          
docstring: Returns poison detected and a report.
docstring_tokens: Returns poison detected and a report .
code: def detect_poison(self, **kwargs) -> Tuple[dict, List[int]]:
          """
          Returns poison detected and a report.
  
          :param kwargs: A dictionary of detection-specific parameters.
          :return: (report, is_clean_lst):
                  where a report is a dict object that contains information specified by the provenance detection method
                  where is_clean is a list, where is_clean_lst[i]=1 means that x_train[i]
                  there is clean and is_clean_lst[i]=0, means that x_train[i] was classified as poison.
          """
          self.set_params(**kwargs)
  
          x_suspect = self.x_train
          y_suspect = self.y_train
          x_trusted = self.x_val
          y_trusted = self.y_val
  
          self.is_clean_lst = [1 for _ in range(len(x_suspect))]
          report = {}
  
          before_classifier = deepcopy(self.classifier)
          before_classifier.fit(x_suspect, y_suspect)
  
          for idx in np.random.permutation(len(x_suspect)):
              x_i = x_suspect[idx]
              y_i = y_suspect[idx]
  
              after_classifier = deepcopy(before_classifier)
              after_classifier.fit(x=np.vstack([x_trusted, x_i]), y=np.vstack([y_trusted, y_i]))
              acc_shift = performance_diff(
                  before_classifier,
                  after_classifier,
                  self.x_quiz,
                  self.y_quiz,
                  perf_function=self.perf_func,
              )
              # print(acc_shift, median, std_dev)
              if self.is_suspicious(before_classifier, acc_shift):
                  self.is_clean_lst[idx] = 0
                  report[idx] = acc_shift
              else:
                  before_classifier = after_classifier
                  x_trusted = np.vstack([x_trusted, x_i])
                  y_trusted = np.vstack([y_trusted, y_i])
  
          return report, self.is_clean_lst
code_tokens: def detect_poison ( self , ** kwargs ) -> Tuple [ dict , List [ int ] ] : self . set_params ( ** kwargs ) x_suspect = self . x_train y_suspect = self . y_train x_trusted = self . x_val y_trusted = self . y_val self . is_clean_lst = [ 1 for _ in range ( len ( x_suspect ) ) ] report = { } before_classifier = deepcopy ( self . classifier ) before_classifier . fit ( x_suspect , y_suspect ) for idx in np . random . permutation ( len ( x_suspect ) ) : x_i = x_suspect [ idx ] y_i = y_suspect [ idx ] after_classifier = deepcopy ( before_classifier ) after_classifier . fit ( x = np . vstack ( [ x_trusted , x_i ] ) , y = np . vstack ( [ y_trusted , y_i ] ) ) acc_shift = performance_diff ( before_classifier , after_classifier , self . x_quiz , self . y_quiz , perf_function = self . perf_func , ) if self . is_suspicious ( before_classifier , acc_shift ) : self . is_clean_lst [ idx ] = 0 report [ idx ] = acc_shift else : before_classifier = after_classifier x_trusted = np . vstack ( [ x_trusted , x_i ] ) y_trusted = np . vstack ( [ y_trusted , y_i ] ) return report , self . is_clean_lst
short_docstring: Returns poison detected and a report.
short_docstring_tokens: Returns poison detected and a report .
comment: """
          Returns poison detected and a report.
  
          :param kwargs: A dictionary of detection-specific parameters.
          :return: (report, is_clean_lst):
                  where a report is a dict object that contains information specified by the provenance detection method
                  where is_clean is a list, where is_clean_lst[i]=1 means that x_train[i]
                  there is clean and is_clean_lst[i]=0, means that x_train[i] was classified as poison.
          """$SEP$# print(acc_shift, median, std_dev)