<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def popen(*args, **kwargs):
 """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. """

    process = subprocess.Popen(*args, **kwargs)
    try:
        yield process.pid
    finally:
        os.kill(process.pid, signal.SIGTERM)
        os.waitpid(process.pid, 0)