code: def popen(*args, **kwargs):
      
      process = subprocess.Popen(*args, **kwargs)
      try:
          yield process.pid
      finally:
          os.kill(process.pid, signal.SIGTERM)
          os.waitpid(process.pid, 0)
docs: Run a process in background in a `with` context. Parameters given
      to this function are passed to `subprocess.Popen`. Process is kill
      when exiting the context.