code: def main(unused_argv):
      logging.set_verbosity(logging.INFO)
  
      # Load training and test data.
      train_data, train_labels, test_data, test_labels = load_mnist()
  
      # Instantiate the tf.Estimator.
      mnist_classifier = tf_estimator.Estimator(model_fn=cnn_model_fn)
  
      # Create tf.Estimator input functions for the training and test data.
      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=True,
      )
      eval_input_fn = tf_compat_v1_estimator.inputs.numpy_input_fn(
          x={"x": test_data}, y=test_labels, num_epochs=1, shuffle=False
      )
  
      # Training loop.
      steps_per_epoch = 60000 // FLAGS.batch_size
      for epoch in range(1, FLAGS.epochs + 1):
          # Train the model for one epoch.
          mnist_classifier.train(
              input_fn=train_input_fn, steps=steps_per_epoch
          )
  
          # Evaluate the model and print results
          eval_results = mnist_classifier.evaluate(
              input_fn=eval_input_fn
          )
          test_accuracy = eval_results["accuracy"]
          print(
              "Test accuracy after %d epochs is: %.3f"
              % (epoch, test_accuracy)
          )
  
imports: from absl import logging
  import numpy
  import tensorflow
  from tensorflow import estimator
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 3 for calling a global function with example usage: main(unused_argv) without return types