human
I wrote the below code

    def check_gone(proc, timeout):
        try:
            returncode = proc.wait(timeout=timeout)
        except TimeoutExpired:
            pass
        else:
            if ((returncode is not None) or (not proc.is_running())):
                proc.returncode = returncode
                gone.add(proc)
                if (callback is not None):
                    callback(proc)
    if ((timeout is not None) and (not (timeout >= 0))):
        msg = ('timeout    must    be    a    positive    integer,    got    %s' % timeout)
        raise ValueError(msg)
    gone = set()
    alive = set(procs)
    if ((callback is not None) and (not callable(callback))):
        raise TypeError(('callback    %r    is    not    a    callable' % callable))
    if (timeout is not None):
        deadline = (_timer() + timeout)
    while alive:
        if ((timeout is not None) and (timeout <= 0)):
            break
        for proc in alive:
            max_timeout = (1.0 / len(alive))
            if (timeout is not None):
                timeout = min((deadline - _timer()), max_timeout)
                if (timeout <= 0):
                    break
                check_gone(proc, timeout)
            else:
                check_gone(proc, max_timeout)
        alive = (alive - gone)
    if alive:
        for proc in alive:
            check_gone(proc, 0)
        alive = (alive - gone)
    return (list(gone), list(alive))

What's a good function header?

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

def wait_procs(procs, timeout=None, callback=None):