code: def cleanup_subprocesses(strict=False):
      try:
          yield
      finally:
          children = get_child_processes()
          for p in children:
              if strict:
                  print(
                      "cleanup_subprocesses: found %r: %r"
                      % (p.name(), p.cmdline())
                  )
              p.terminate()
  
          _, alive = psutil.wait_procs(children, timeout=3)
          for p in alive:
              p.kill()
          _, alive = psutil.wait_procs(alive, timeout=3)
          if alive:
              raise RuntimeError("%i processes not killed" % len(alive))
  
          if children and strict:
              raise RuntimeError(
                  "%i processes did not exit when expected"
                  % len(children)
              )
  
imports: from contextlib import contextmanager
  import os
  import sys
  import time
  import unittest
  import psutil
  import requests
  import retrying
  import fiftyone
  import fiftyone.constants
  import fiftyone.core.service
  import fiftyone.service.util
label_desc: Use image node_id 7 for calling a global function with example usage: cleanup_subprocesses(strict) without return types