code: def create_tf_jobs(cluster_spec, prog, args):
      gpu_assignment = dict(
          (("worker", idx), gpu_idx)
          for (idx, gpu_idx) in enumerate(GPU_IDS)
      )
      for job_type in cluster_spec:
          for task_index in range(len(cluster_spec[job_type])):
              new_env = os.environ.copy()
              new_env.update(
                  {
                      "CUDA_VISIBLE_DEVICES": str(
                          gpu_assignment.get((job_type, task_index), "")
                      ),
                      "TF_CONFIG": json.dumps(
                          create_tf_config(
                              cluster_spec, job_type, task_index
                          )
                      ),
                  }
              )
              yield subprocess.Popen(
                  ["python3", prog] + args, env=new_env
              )
  
file_path: TensorLayer/tensorlayer/cli/train.py
imports: import argparse
  import json
  import multiprocessing
  import os
  import platform
  import re
  import subprocess
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: create_tf_jobs(cluster_spec, prog, args) without return types