def set_parent(self, parent):
    if (parent is not None):
        self.parent = parent
        self.parent.children.append(self)
def set_parent(self, parent):
    if (parent is not None):
        self.parent = parent
        self.parent.children.append(self)