def AttachParents(self, tree, parent = None):
    """ Attach parents to the tree.
    Also create the cache at the each node, by exercising
    tree.GetFlattenedChildren()."""
    tree.SetParent(parent)
    for c in tree.GetFlattenedChildren():
      if c is not None:
        try:
          self.AttachParents(c, tree)
        except __HOLE__ as e:
          print(c, parent, tree)
          raise AttributeError(e)
    return
dataset/ETHPy150Open spranesh/Redhawk/redhawk/common/tree_converter.py/TreeConverter.AttachParents