code: def main(unused_argv):
      del unused_argv
      # Load training and test data.
      np.random.seed(0)
  
      x, y = gen_data(1 + FLAGS.batch_size, FLAGS.d)
  
      auditor = audit.AuditAttack(x, y, train_and_score)
  
      # we will instrument the auditor to simply bkdr the last feature
      pois_x1, pois_x2 = x[:-1].copy(), x[:-1].copy()
      pois_x1[-1] = x[-1]
      pois_y = y[:-1]
      target_x = x[-1][None, :]
      assert np.unique(np.nonzero(pois_x1 - pois_x2)[0]).size == 1
  
      pois_data = (
          (pois_x1, pois_y),
          (pois_x2, pois_y),
          (target_x, y[-1]),
      )
      poisoning = {}
      poisoning["data"] = (pois_data[0], pois_data[1])
      poisoning["pois"] = pois_data[2]
      auditor.poisoning = poisoning
  
      thresh, _, _ = auditor.run(
          1, None, FLAGS.num_trials, alpha=FLAGS.alpha
      )
  
      _, eps, acc = auditor.run(
          1, None, FLAGS.num_trials, alpha=FLAGS.alpha, threshold=thresh
      )
  
      epsilon_upper_bound = compute_epsilon(FLAGS.batch_size)
  
      print("Analysis epsilon is {}.".format(epsilon_upper_bound))
      print("At threshold={}, epsilon={}.".format(thresh, eps))
      print(
          "The best accuracy at distinguishing poisoning is {}.".format(
              acc
          )
      )
  
file_path: privacy/research/audit_2020/mean_audit.py
imports: import numpy
  import tensorflow.compat.v1
  from tensorflow_privacy.privacy.analysis.rdp_accountant import compute_rdp
  from tensorflow_privacy.privacy.analysis.rdp_accountant import get_privacy_spent
  from tensorflow_privacy.privacy.optimizers import dp_optimizer_vectorized
  from absl import app
  from absl import flags
  import audit
label_desc: Use image node_id 7 for calling a global function with example usage: main(unused_argv) without return types