def process_state(pid):
    status = LocalPath('/proc').join(str(pid), 'status').read()
    m = re.search('^State:\s+[A-Z] \(([a-z]+)\)$', status, re.MULTILINE)
    return m.group(1)
Return a process' state, such as "stopped" or "running".
dataset/ETHPy150Open Yelp/dumb-init/tests/lib/testing.py/process_state