def __kill_posix(pid):
    def __check_pid():
        try:
            os.kill(pid, 0)
            return True
        except __HOLE__:
            return False

    if __check_pid():
        for sig in [15, 9]:
            try:
                os.killpg(pid, sig)
            except OSError:
                return
            sleep(1)
            if not __check_pid():
                return
dataset/ETHPy150Open galaxyproject/pulsar/pulsar/managers/util/kill.py/__kill_posix