def __setstate__(self, state):
        super(VariableTree, self).__setstate__(state)
        if self._parent_ref is not None:
            self._parent_ref = weakref.ref(self._parent_ref)
Set state and set weakref to parent.
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/vartree.py/VariableTree.__setstate__