def set_children(self, children):
    self.children = children
    for child in children:
        child.parent = self
def set_children(self, children):
    self.children = children
    for child in children:
        child.parent = self