code: def train_and_eval():
      """Trains and evaluates MeshTensorflow model without TPUEstimator.
  
      TODO(lehou): Pack everything nicely as a set of APIs.
      """
  
      mesh_context = None
      tf.logging.info("FLAGS.master: {}".format(FLAGS.master))
      resolver = tf.distribute.cluster_resolver.TPUClusterResolver(
          FLAGS.master
      )
      config = tf.ConfigProto()
      config.allow_soft_placement = True
      cluster_spec = resolver.cluster_spec()
      if cluster_spec:
          config.cluster_def.CopyFrom(cluster_spec.as_cluster_def())
      with tf.Session(target=resolver.master(), config=config) as sess:
          tf.tpu.experimental.initialize_tpu_system(resolver)
          mesh_context = MeshContext(
              sess, FLAGS.use_tpu, FLAGS.mesh_shape, unet.get_layout()
          )
  
      for _ in range(FLAGS.num_training_loops):
          _train_phase(mesh_context, config, resolver.get_master())
          _eval_phase(mesh_context, config, resolver.get_master())
  
      if FLAGS.use_tpu:
          with tf.Session(
              target=resolver.get_master(), config=config
          ) as sess:
              sess.run(tpu.shutdown_system())
  
      tf.logging.info("finished.")
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import re
  import mesh_tensorflow
  import numpy
  import six
  from six.moves import range
  from six.moves import zip
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  from mesh_tensorflow.experimental import input_reader
  from mesh_tensorflow.experimental import unet
  from tensorflow.contrib import summary
  from tensorflow.contrib import tpu
  from tensorflow.contrib.tpu.python.tpu import device_assignment
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.platform import flags
  from tensorflow.python.tpu.ops import tpu_ops
label_desc: Use image node_id 6 for calling a global function with example usage: train_and_eval() without return types