code: def PreOrderTraversal(tree_node: NodeType) -> Iterator[NodeType]:
      """Iterate on a tree in a pre-order traversal fashion"""
      stack = [tree_node]
      while stack:
          node = stack.pop()
          yield node
          stack.extend(node.children[::-1])
  
imports: from __future__ import annotations
  from typing import Callable, Generic, Iterable, Iterator, Sequence, TypeVar
label_desc: Use image node_id 1 for calling a global function with example usage: PreOrderTraversal(tree_node) without return types