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