human
Complete the below
def descendants(pid):

    ''''descendants(pid) -> dict
    Arguments:
    pid (int): PID of the process.
    Returns:
    Dictionary mapping the PID of each child of `pid` to it\'s descendants.'
    '''

Give me a the Python program you requested?
assistant
#Here is the Python program you requested.
    this_pid = pid
    allpids = all_pids()
    ppids = {}
    def _parent(pid):
        if (pid not in ppids):
            ppids[pid] = parent(pid)
        return ppids[pid]
    def _children(ppid):
        return [pid for pid in allpids if (_parent(pid) == ppid)]
    def _loop(ppid):
        return {pid: _loop(pid) for pid in _children(ppid)}
    return _loop(pid)