code: def kill_children():
      
      try:
          import psutil
      except ImportError:
          logger.warn(
              "missing psutil; --jobs may not properly terminate",
              extra="run 'pip install coconut[jobs]' to fix",
          )
      else:
          master = psutil.Process()
          children = master.children(recursive=True)
          while children:
              for child in children:
                  try:
                      child.terminate()
                  except psutil.NoSuchProcess:
                      pass  # process is already dead, so do nothing
              children = master.children(recursive=True)
docs: Terminate all child processes.