code: def main(argv):
      tf.logging.set_verbosity(tf.logging.INFO)
  
      usr_dir.import_usr_dir(FLAGS.t2t_usr_dir)
  
      # If we just have to print the registry, do that and exit early.
      maybe_log_registry_and_exit()
  
      # Create HParams.
      if argv:
          set_hparams_from_args(argv[1:])
      if FLAGS.schedule != "run_std_server":
          hparams = create_hparams()
      if FLAGS.gpu_automatic_mixed_precision:
          setattr(hparams, "gpu_automatic_mixed_precision", True)
  
      if (
          FLAGS.schedule == "train"
          or FLAGS.schedule == "train_eval_and_decode"
      ):
          mlperf_log.transformer_print(
              key=mlperf_log.RUN_START, hparams=hparams
          )
      if FLAGS.schedule == "run_std_server":
          run_std_server()
      mlperf_log.transformer_print(
          key=mlperf_log.RUN_SET_RANDOM_SEED,
          value=FLAGS.random_seed,
          hparams=hparams,
      )
      trainer_lib.set_random_seed(FLAGS.random_seed)
  
      if FLAGS.cloud_mlengine:
          cloud_mlengine.launch()
          return
  
      if FLAGS.generate_data:
          generate_data()
  
      if cloud_mlengine.job_dir():
          FLAGS.output_dir = cloud_mlengine.job_dir()
  
      exp_fn = create_experiment_fn()
      exp = exp_fn(create_run_config(hparams), hparams)
      if is_chief():
          save_metadata(hparams)
      execute_schedule(exp)
      if FLAGS.schedule != "train":
          mlperf_log.transformer_print(
              key=mlperf_log.RUN_FINAL, hparams=hparams
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import contextlib
  import os
  import sys
  from tensor2tensor import models
  from tensor2tensor import problems
  from tensor2tensor.data_generators import problem
  from tensor2tensor.utils import cloud_mlengine
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import decoding
  from tensor2tensor.utils import flags
  from tensor2tensor.utils import hparams_lib
  from tensor2tensor.utils import mlperf_log
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import trainer_lib
  from tensor2tensor.utils import usr_dir
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 12 for calling a global function with example usage: main(argv) without return types