def is_process_alive(pid):
    """Sends null signal to a process to check if it's alive"""
    try:
        # Sending the null signal (sig. 0) to the process will check
        # pid's validity.
        os.kill(pid, 0)
    except __HOLE__, e:
        # Access denied, but process is alive
        return e.errno == errno.EPERM
    except:
        return False
    else:
        return True
dataset/ETHPy150Open YelpArchive/pushmanager/pushmanager/core/pid.py/is_process_alive