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