code: def init_process(rpc_config, mp_contexts):
      """Work loop in the worker"""
      try:
          _init_rpc(*rpc_config)
          keep_polling = True
          data_queue, task_queue, barrier = mp_contexts
          collate_fn_dict = {}
  
          while keep_polling:
              try:
                  # Follow https://github.com/pytorch/pytorch/blob/d57ce8cf8989c0b737e636d8d7abe16c1f08f70b/torch/utils/data/_utils/worker.py#L260
                  command, args = task_queue.get(timeout=5)
              except queue.Empty:
                  continue
              if command == MpCommand.SET_COLLATE_FN:
                  dataloader_name, func = args
                  collate_fn_dict[dataloader_name] = func
              elif command == MpCommand.CALL_BARRIER:
                  barrier.wait()
              elif command == MpCommand.DELETE_COLLATE_FN:
                  (dataloader_name,) = args
                  del collate_fn_dict[dataloader_name]
              elif command == MpCommand.CALL_COLLATE_FN:
                  dataloader_name, collate_args = args
                  data_queue.put(
                      (
                          dataloader_name,
                          collate_fn_dict[dataloader_name](
                              collate_args
                          ),
                      )
                  )
              elif command == MpCommand.CALL_FN_ALL_WORKERS:
                  func, func_args = args
                  func(func_args)
              elif command == MpCommand.FINALIZE_POOL:
                  _exit()
                  keep_polling = False
              else:
                  raise Exception("Unknown command")
      except Exception as e:
          traceback.print_exc()
          raise e
  
imports: import atexit
  import gc
  import multiprocessing
  import os
  import queue
  import sys
  import time
  import traceback
  from enum import Enum
  from ..None import utils
  from ..base import dgl_warning, DGLError
  from .None import rpc
  from .constants import MAX_QUEUE_SIZE
  from .kvstore import close_kvstore, init_kvstore
  from .role import init_role
  from .rpc_client import connect_to_server
label_desc: Use image node_id 4 for calling a global function with example usage: init_process(rpc_config, mp_contexts) without return types