code: def walk(node, include_joined_str=False):
      # type: (AST, bool) -> Iterator[Union[Module, AstNode]]
      """
      Recursively yield all descendant nodes in the tree starting at ``node`` (including ``node``
      itself), using depth-first pre-order traversal (yieling parents before their children).
  
      This is similar to ``ast.walk()``, but with a different order, and it works for both ``ast`` and
      ``astroid`` trees. Also, as ``iter_children()``, it skips singleton nodes generated by ``ast``.
  
      By default, ``JoinedStr`` (f-string) nodes and their contents are skipped
      because they previously couldn't be handled. Set ``include_joined_str`` to True to include them.
      """
      iter_children = iter_children_func(node)
      done = set()
      stack = [node]
      while stack:
          current = stack.pop()
          assert (
              current not in done
          )  # protect againt infinite loop in case of a bad tree.
          done.add(current)
  
          yield current
  
          # Insert all children in reverse order (so that first child ends up on top of the stack).
          # This is faster than building a list and reversing it.
          ins = len(stack)
          for c in iter_children(current, include_joined_str):
              stack.insert(ins, c)
  
imports: import ast
  import collections
  import io
  import sys
  import token
  import tokenize
  from abc import ABCMeta
  from ast import Module, expr, AST
  from typing import Callable, Dict, Iterable, Iterator, List, Optional, Tuple, Union, cast, Any, TYPE_CHECKING
  from six import iteritems
label_desc: Use image node_id 16 for calling a global function with example usage: walk(node, include_joined_str) without return types