code: def reverse_bintree(parents):
      """construct {parent:[children]} dict from {child:parent}
  
      keys are the nodes in the tree, and values are the lists of children
      of that node in the tree.
  
      reverse_tree[None] is the root node
  
      >>> tree = bintree(range(7))
      >>> reverse_bintree(tree)
      {None: 0, 0: [1, 4], 4: [5, 6], 1: [2, 3]}
      """
      children = {}
      for child, parent in parents.iteritems():
          if parent is None:
              children[None] = child
              continue
          elif parent not in children:
              children[parent] = []
          children[parent].append(child)
  
      return children
  
imports: import re
  import socket
  from functools import reduce
  import zmq
  from ipyparallel.serialize import deserialize_object, serialize_object
  from ipyparallel.util import disambiguate_url
label_desc: Use image node_id 2 for calling a global function with example usage: reverse_bintree(parents) and returns: children