code: def ipreorder(self):
          '''Depth-first pre-order iteration of tree nodes'''
          children = deque((self, ))
          while children:
              cur_node = children.pop()
              children.extend(reversed(cur_node.children))
              yield cur_nodf ipreorder(self):
          '''Depth-first pre-order iteration of tree nodes'''
          children = deque((self, ))
          while children:
              cur_node = children.pop()
              children.extend(reversed(cur_node.children))
              yield cur_node
docs: Depth-first pre-order iteration of tree nodes