human
I wrote the below code

    if isinstance(proc, list):
        for p in proc:
            ensure_proc_terminate(p)
        return
    def stop_proc_by_weak_ref(ref):
        proc = ref()
        if (proc is None):
            return
        if (not proc.is_alive()):
            return
        proc.terminate()
        proc.join()
    assert isinstance(proc, multiprocessing.Process)
    atexit.register(stop_proc_by_weak_ref, weakref.ref(proc))

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

def ensure_proc_terminate(proc):