

def child_pids(pid):
    'Return a list of direct child PIDs for the given PID.'
    pid = str(pid)
    tasks = LocalPath('/proc').join(pid, 'task').listdir()
    return set((int(child_pid) for task in tasks for child_pid in task.join('children').read().split()))

dataset/ETHPy150Open Yelp/dumb-init/tests/lib/testing.py child_pids/original