code: def main(unused_argv):
      logging.set_verbosity(logging.INFO)
  
      if FLAGS.batch_size % FLAGS.microbatches != 0:
          raise ValueError(
              "Number of microbatches should divide evenly batch_size"
          )
  
      # Load training and test data.
      train_data, test_data = load_data()
  
      # Instantiate the tf.Estimator.
      conf = tf_estimator.RunConfig(save_summary_steps=1000)
      lm_classifier = tf_estimator.Estimator(
          model_fn=rnn_model_fn, model_dir=FLAGS.model_dir, config=conf
      )
  
      # Create tf.Estimator input functions for the training and test data.
      batch_len = FLAGS.batch_size * SEQ_LEN
      train_data_end = len(train_data) - len(train_data) % batch_len
      test_data_end = len(test_data) - len(test_data) % batch_len
      train_input_fn = tf_compat_v1_estimator.inputs.numpy_input_fn(
          x={"x": train_data[:train_data_end]},
          batch_size=batch_len,
          num_epochs=FLAGS.epochs,
          shuffle=False,
      )
      eval_input_fn = tf_compat_v1_estimator.inputs.numpy_input_fn(
          x={"x": test_data[:test_data_end]},
          batch_size=batch_len,
          num_epochs=1,
          shuffle=False,
      )
  
      # Training loop.
      steps_per_epoch = len(train_data) // batch_len
      for epoch in range(1, FLAGS.epochs + 1):
          print("epoch", epoch)
          # Train the model for one epoch.
          lm_classifier.train(
              input_fn=train_input_fn, steps=steps_per_epoch
          )
  
          if epoch % 5 == 0:
              name_input_fn = [
                  ("Train", train_input_fn),
                  ("Eval", eval_input_fn),
              ]
              for name, input_fn in name_input_fn:
                  # Evaluate the model and print results
                  eval_results = lm_classifier.evaluate(
                      input_fn=input_fn
                  )
                  result_tuple = (
                      epoch,
                      eval_results["accuracy"],
                      eval_results["loss"],
                  )
                  print(
                      name,
                      "accuracy after %d epochs is: %.3f (%.4f)"
                      % result_tuple,
                  )
  
          # Compute the privacy budget expended so far.
          if FLAGS.dpsgd:
              eps = compute_epsilon(epoch * steps_per_epoch)
              print(
                  "For delta=1e-5, the current epsilon is: %.2f" % eps
              )
          else:
              print("Trained with vanilla non-private SGD optimizer")
  
file_path: privacy/tutorials/lm_dpsgd_tutorial.py
imports: import os
  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
  import tensorflow_datasets
  from tensorflow_privacy.privacy.optimizers import dp_optimizer
label_desc: Use image node_id 4 for calling a global function with example usage: main(unused_argv) without return types