code: def main(unused_argv):
      logging.set_verbosity(logging.INFO)
  
      if FLAGS.data_l2_norm <= 0:
          raise ValueError("data_l2_norm must be positive.")
      if (
          FLAGS.dpsgd
          and FLAGS.learning_rate > 8 / FLAGS.data_l2_norm**2
      ):
          raise ValueError(
              "The amplification-by-iteration analysis requires"
              "learning_rate <= 2 / beta, where beta is the smoothness"
              "of the loss function and is upper bounded by ||x||^2 / 4"
              "with ||x|| being the largest L2 norm of the samples."
          )
  
      # Load training and test data.
      # Smoothness = ||x||^2 / 4 where ||x|| is the largest L2 norm of the samples.
      # To get bounded smoothness, we normalize the data such that each sample has a
      # bounded L2 norm.
      train_data, train_labels, test_data, test_labels = load_mnist(
          data_l2_norm=FLAGS.data_l2_norm
      )
  
      # Instantiate tf.Estimator.
      # pylint: disable=g-long-lambda
      model_fn = lambda features, labels, mode: lr_model_fn(
          features, labels, mode, nclasses=10, dim=train_data.shape[1:]
      )
      mnist_classifier = tf_estimator.Estimator(
          model_fn=model_fn, model_dir=FLAGS.model_dir
      )
  
      # Create tf.Estimator input functions for the training and test data.
      # To analyze the per-user privacy loss, we keep the same orders of samples in
      # each epoch by setting shuffle=False.
      train_input_fn = tf_compat_v1_estimator.inputs.numpy_input_fn(
          x={"x": train_data},
          y=train_labels,
          batch_size=FLAGS.batch_size,
          num_epochs=FLAGS.epochs,
          shuffle=False,
      )
      eval_input_fn = tf_compat_v1_estimator.inputs.numpy_input_fn(
          x={"x": test_data}, y=test_labels, num_epochs=1, shuffle=False
      )
  
      # Train the model.
      num_samples = train_data.shape[0]
      steps_per_epoch = num_samples // FLAGS.batch_size
  
      mnist_classifier.train(
          input_fn=train_input_fn, steps=steps_per_epoch * FLAGS.epochs
      )
  
      # Evaluate the model and print results.
      eval_results = mnist_classifier.evaluate(input_fn=eval_input_fn)
      print(
          "Test accuracy after {} epochs is: {:.2f}".format(
              FLAGS.epochs, eval_results["accuracy"]
          )
      )
  
      if FLAGS.dpsgd:
          print_privacy_guarantees(
              epochs=FLAGS.epochs,
              batch_size=FLAGS.batch_size,
              samples=num_samples,
              noise_multiplier=FLAGS.noise_multiplier,
          )
  
file_path: privacy/tutorials/mnist_lr_tutorial.py
imports: import math
  from absl import app
  from absl import flags
  from absl import logging
  import dp_accounting
  import numpy
  import tensorflow
  from tensorflow import estimator
  from tensorflow.compat.v1 import estimator
  from tensorflow_privacy.privacy.optimizers import dp_optimizer
label_desc: Use image node_id 5 for calling a global function with example usage: main(unused_argv) without return types