def child_pids(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()
    )
Return a list of direct child PIDs for the given PID.
dataset/ETHPy150Open Yelp/dumb-init/tests/lib/testing.py/child_pids