code: def exit_client():
      """Trainer exits
  
      This function is called automatically when a Python process exits. Normally,
      the training script does not need to invoke this function at the end.
  
      In the case that the training script needs to initialize the distributed module
      multiple times (so far, this is needed in the unit tests), the training script
      needs to call `exit_client` before calling `initialize` again.
      """
      # Only client with rank_0 will send shutdown request to servers.
      print(
          "Client[{}] in group[{}] is exiting...".format(
              rpc.get_rank(), rpc.get_group_id()
          )
      )
      finalize_worker()  # finalize workers should be earilier than barrier, and non-blocking
      # collect data such as DistTensor before exit
      gc.collect()
      if os.environ.get("DGL_DIST_MODE", "standalone") != "standalone":
          rpc.client_barrier()
          _shutdown_servers()
      finalize_client()
      join_finalize_worker()
      close_kvstore()
      atexit.unregister(exit_client)
  
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 12 for calling a global function with example usage: exit_client() without return types