parameters: (self, bench_name, test_bench_id)
return_statement: return test_bench_id, all_change_points
docstring: Runs one experimental alerting function for one TestBench entity.
  
      Args:
        bench_name: A string bench name.
        test_bench_id: Integer ID of a TestBench entity.
  
      Returns:
        A pair (TestBench ID, list of Anomaly dicts). But if the TestMetadata
        can't be gotten, this will return (None, None).
docstring_summary: Runs one experimental alerting function for one TestBench entity.
docstring_tokens: Runs one experimental alerting function for one TestBench entity .
function: def run(self, bench_name, test_bench_id):  # pylint: disable=invalid-name
      """Runs one experimental alerting function for one TestBench entity.
  
      Args:
        bench_name: A string bench name.
        test_bench_id: Integer ID of a TestBench entity.
  
      Returns:
        A pair (TestBench ID, list of Anomaly dicts). But if the TestMetadata
        can't be gotten, this will return (None, None).
      """
      all_change_points = []
      test_bench = TestBench.get_by_id(test_bench_id)
      test = test_bench.test.get()
      # If test doesn't exist anymore, just remove this TestBench entity.
      if not test:
        test_bench.key.delete()
        return None, None
  
      # Clear the last_alerted_function property because it will be used in
      # the experimental alerting function.
      test.last_alerted_revision = None
      data_series = test_bench.data_series
      for i in xrange(1, len(data_series)):
        find_change_points_func = _EXPERIMENTAL_FUNCTIONS[bench_name]
        change_points = find_change_points_func(test, data_series[0:i])
        change_points = [c for c in change_points if _IsRegression(c, test)]
        all_change_points.extend(change_points)
      logging.debug('Completed alert processing simulation task for bench_name: '
                    '%s, bench_id: %s.', bench_name, test_bench_id)
      return test_bench_id, all_change_points
function_tokens: def run ( self , bench_name , test_bench_id ) : # pylint: disable=invalid-name all_change_points = [ ] test_bench = TestBench . get_by_id ( test_bench_id ) test = test_bench . test . get ( ) # If test doesn't exist anymore, just remove this TestBench entity. if not test : test_bench . key . delete ( ) return None , None # Clear the last_alerted_function property because it will be used in # the experimental alerting function. test . last_alerted_revision = None data_series = test_bench . data_series for i in xrange ( 1 , len ( data_series ) ) : find_change_points_func = _EXPERIMENTAL_FUNCTIONS [ bench_name ] change_points = find_change_points_func ( test , data_series [ 0 : i ] ) change_points = [ c for c in change_points if _IsRegression ( c , test ) ] all_change_points . extend ( change_points ) logging . debug ( 'Completed alert processing simulation task for bench_name: ' '%s, bench_id: %s.' , bench_name , test_bench_id ) return test_bench_id , all_change_points