class_docstr: A Node instance is used for composing tree-based structures.
class_docstr_tok: ["A","Node","instance","is","used","for","composing","tree-based","structures","."]
docstr: Traverses the node in pre-order.
docstr_tok: ["Traverses","the","node","in","pre-order","."]
code: def pre_order(self) -> List[Node]:
      """Traverses the node in pre-order."""
  
      pre_order, stacked = [], [self]
  
      while len(stacked) > 0:
          node = stacked.pop()
          pre_order.append(node)
  
          if node.right is not None:
              stacked.append(node.right)
  
          if node.left is not None:
              stacked.append(node.left)
  
      return pre_order
  
imports: from __future__ import annotations
  from typing import Any, Dict, List, Optional, Union
  import numpy
  import opytimizer.utils.constant
  import opytimizer.utils.exception
label_desc: Use image node_id 24 for calling the Node obj's underlying member method code with example usage: obj.pre_order() and returns: pre_order