code: def submit(args):
      worker_hosts = get_hosts_from_file(args.worker_hostfile)
      server_hosts = get_hosts_from_file(args.server_hostfile)
      num_worker = len(worker_hosts)
      num_server = len(server_hosts)
      assert num_worker >= 1
      assert num_server >= 1
      print(
          "Launch %d workers and %d servers" % (num_worker, num_server)
      )
  
      # common env
      pass_envs = preprocess_envs(args.env)
      pass_envs["DMLC_NUM_WORKER"] = str(num_worker)
      pass_envs["DMLC_NUM_SERVER"] = str(num_server)
      pass_envs["DMLC_INTERFACE"] = str(args.interface)
      pass_envs["DMLC_PS_ROOT_URI"] = str(args.scheduler_ip)
      pass_envs["DMLC_PS_ROOT_PORT"] = str(args.scheduler_port)
  
      username = ""
      if args.username is not None:
          username = args.username
  
      threads = []
      for node, port in [(args.scheduler_ip, args.scheduler_ssh_port)]:
          name = "scheduler"
          pass_envs["DMLC_ROLE"] = name
          prog = get_env(pass_envs) + (" ".join(args.command))
          threads.append(start_ssh(prog, node, port, username, name))
      for i, (node, port) in enumerate(worker_hosts):
          name = "worker"
          pass_envs["DMLC_ROLE"] = name
          pass_envs["DMLC_WORKER_ID"] = str(i)
          prog = get_env(pass_envs) + (" ".join(args.command))
          threads.append(
              start_ssh(prog, node, port, username, name + str(i))
          )
      for i, (node, port) in enumerate(server_hosts):
          name = "server"
          pass_envs["DMLC_ROLE"] = name
          prog = get_env(pass_envs) + (" ".join(args.command))
          threads.append(
              start_ssh(prog, node, port, username, name + str(i))
          )
  
      for t in threads:
          t.join()
  
file_path: byteps/launcher/dist_launcher.py
imports: import argparse
  import os, sys
  import signal
  import logging
  import subprocess
  from multiprocessing import Pool, Process
  from threading import Thread
label_desc: Use image node_id 5 for calling a global function with example usage: submit(args) without return types