code: def teardown():
      try:
          time.sleep(1)
      except KeyboardInterrupt:
          return
      while launchers:
          p = launchers.pop()
          if p.poll() is None:
              try:
                  f = p.stop()
                  if f:
                      asyncio.run(f)
              except Exception as e:
                  print(e)
                  pass
          if p.poll() is None:
              try:
                  time.sleep(0.25)
              except KeyboardInterrupt:
                  return
          if p.poll() is None:
              try:
                  print("cleaning up test process...")
                  p.signal(SIGKILL)
              except:
                  print("couldn't shutdown process: ", p)
  
file_path: ipyparallel/ipyparallel/tests/__init__.py
imports: import asyncio
  import os
  import time
  from subprocess import Popen
  from IPython.paths import get_ipython_dir
  from ipyparallel import Client, error
  from ipyparallel.cluster.launcher import SIGKILL, LocalProcessLauncher, ProcessStateError, ipcontroller_cmd_argv, ipengine_cmd_argv
label_desc: Use image node_id 3 for calling a global function with example usage: teardown() without return types