code: def reap_process_group(*args):
      def sigterm_handler(*args):
          # Give a one-second grace period for other processes to clean up.
          time.sleep(SIGTERM_GRACE_PERIOD_SECONDS)
          # SIGKILL the pgroup (including ourselves) as a last-resort.
          if sys.platform == "win32":
              atexit.unregister(sigterm_handler)
              os.kill(0, signal.CTRL_BREAK_EVENT)
          else:
              os.killpg(0, signal.SIGKILL)
  
      # Set a SIGTERM handler to handle SIGTERMing ourselves with the group.
      if sys.platform == "win32":
          atexit.register(sigterm_handler)
      else:
          signal.signal(signal.SIGTERM, sigterm_handler)
  
      # Our parent must have died, SIGTERM the group (including ourselves).
      if sys.platform == "win32":
          os.kill(0, signal.CTRL_C_EVENT)
      else:
          os.killpg(0, signal.SIGTERM)
  
imports: import atexit
  import os
  import signal
  import sys
  import time
label_desc: Use image node_id 1 for calling a global function with example usage: reap_process_group() without return types