def pid_exists(pid):
    """Check whether pid exists in the current process table."""
    if pid < 0:
        return False
    try:
        os.kill(pid, 0)
    except __HOLE__ as e:
        return e.errno == errno.EPERM
    else:
        return True
dataset/ETHPy150Open limodou/uliweb/uliweb/utils/process.py/pid_exists