code: def main(unused_argv):
      logging.set_verbosity(logging.INFO)
      if FLAGS.dpsgd and FLAGS.batch_size % FLAGS.microbatches != 0:
          raise ValueError(
              "Number of microbatches should divide evenly batch_size"
          )
  
      # Instantiate the tf.Estimator.
      run_config = tf_estimator.tpu.RunConfig(master=FLAGS.master)
      mnist_classifier = tf_estimator.tpu.TPUEstimator(
          train_batch_size=FLAGS.batch_size,
          eval_batch_size=FLAGS.batch_size,
          model_fn=cnn_model_fn,
          model_dir=FLAGS.model_dir,
          config=run_config,
      )
  
      # Training loop.
      steps_per_epoch = 60000 // FLAGS.batch_size
      eval_steps_per_epoch = 10000 // FLAGS.batch_size
      for epoch in range(1, FLAGS.epochs + 1):
          start_time = time.time()
          # Train the model for one epoch.
          mnist_classifier.train(
              input_fn=common.make_input_fn(
                  "train", FLAGS.batch_size / FLAGS.cores, tpu=True
              ),
              steps=steps_per_epoch,
          )
          end_time = time.time()
          logging.info(
              "Epoch %d time in seconds: %.2f",
              epoch,
              end_time - start_time,
          )
  
          # Evaluate the model and print results
          eval_results = mnist_classifier.evaluate(
              input_fn=common.make_input_fn(
                  "test", FLAGS.batch_size / FLAGS.cores, 1, tpu=True
              ),
              steps=eval_steps_per_epoch,
          )
          test_accuracy = eval_results["accuracy"]
          print(
              "Test accuracy after %d epochs is: %.3f"
              % (epoch, test_accuracy)
          )
  
          # Compute the privacy budget expended.
          if FLAGS.dpsgd:
              if FLAGS.noise_multiplier > 0.0:
                  # Due to the nature of Gaussian noise, the actual noise applied is
                  # equal to FLAGS.noise_multiplier * sqrt(number of cores).
                  (
                      eps,
                      _,
                  ) = compute_dp_sgd_privacy_lib.compute_dp_sgd_privacy(
                      60000,
                      FLAGS.batch_size,
                      FLAGS.noise_multiplier * math.sqrt(FLAGS.cores),
                      epoch,
                      1e-5,
                  )
                  print(
                      "For delta=1e-5, the current epsilon is: %.2f"
                      % eps
                  )
              else:
                  print("Trained with DP-SGD but with zero noise.")
          else:
              print("Trained with vanilla non-private SGD optimizer")
  
file_path: privacy/tutorials/mnist_dpsgd_tutorial_tpu.py
imports: import math
  import time
  from absl import app
  from absl import flags
  from absl import logging
  import tensorflow
  from tensorflow import estimator
  from tensorflow_privacy.privacy.analysis import compute_dp_sgd_privacy_lib
  from tensorflow_privacy.privacy.optimizers import dp_optimizer
  import mnist_dpsgd_tutorial_common
label_desc: Use image node_id 2 for calling a global function with example usage: main(unused_argv) without return types