

def terminate(pid, sig, timeout):
    'Terminates process with PID `pid` and returns True if process finished\n    during `timeout`. Current user must have permission to access process\n    information.'
    os.kill(pid, _)
    start = time.time()
    while True:
        try:
            (_, status) = os.waitpid(pid, os.WNOHANG)
        except OSError as exc:
            if (exc.errno != errno.ECHILD):
                raise
        else:
            if status:
                return True
        if (not is_running(pid)):
            return True
        if ((time.time() - start) >= timeout):
            return False
        time.sleep(0.1)

dataset/ETHPy150Open SmartTeleMax/iktomi/iktomi/utils/system.py terminate/VarMisuse@22/76 `sig`->`_`