code: def train_func_distributed():
      per_worker_batch_size = 64
      # This environment variable will be set by Ray Train.
      tf_config = json.loads(os.environ["TF_CONFIG"])
      num_workers = len(tf_config["cluster"]["worker"])
  
      strategy = tf.distribute.MultiWorkerMirroredStrategy()
  
      global_batch_size = per_worker_batch_size * num_workers
      multi_worker_dataset = mnist_dataset(global_batch_size)
  
      with strategy.scope():
          # Model building/compiling need to be within `strategy.scope()`.
          multi_worker_model = build_and_compile_cnn_model()
  
      multi_worker_model.fit(
          multi_worker_dataset, epochs=3, steps_per_epoch=70
      )
  
file_path: ray/python/ray/train/examples/tf/tensorflow_quick_start.py
imports: import numpy
  import tensorflow
  import json
  import os
label_desc: Use image node_id 4 for calling a global function with example usage: train_func_distributed() without return types