code: def cleanup_proc(get_all_remote_pids, conn):
      """This process tries to clean up the remote training tasks."""
      print("cleanup process runs")
      # This process should not handle SIGINT.
      signal.signal(signal.SIGINT, signal.SIG_IGN)
  
      data = conn.recv()
      # If the launch process exits normally, this process doesn't need to do anything.
      if data == "exit":
          sys.exit(0)
      else:
          remote_pids = get_all_remote_pids()
          # Otherwise, we need to ssh to each machine and kill the training jobs.
          for (ip, port), pids in remote_pids.items():
              kill_process(ip, port, pids)
      print("cleanup process exits")
  
imports: import argparse
  import json
  import logging
  import multiprocessing
  import os
  import queue
  import re
  import signal
  import subprocess
  import sys
  import time
  from functools import partial
  from threading import Thread
  from typing import Optional
label_desc: Use image node_id 1 for calling a global function with example usage: cleanup_proc(get_all_remote_pids, conn) without return types