code: def postorder_traversal(node, keys=None):
      """
      Do a postorder traversal of a tree.
  
      This generator recursively yields nodes that it has visited in a postorder
      fashion. That is, it descends through the tree depth-first to yield all of
      a node's children's postorder traversal before yielding the node itself.
  
      Parameters
      ==========
  
      node : SymPy expression
          The expression to traverse.
      keys : (default None) sort key(s)
          The key(s) used to sort args of Basic objects. When None, args of Basic
          objects are processed in arbitrary order. If key is defined, it will
          be passed along to ordered() as the only key(s) to use to sort the
          arguments; if ``key`` is simply True then the default keys of
          ``ordered`` will be used (node count and default_sort_key).
  
      Yields
      ======
      subtree : SymPy expression
          All of the subtrees in the tree.
  
      Examples
      ========
  
      >>> from sympy import postorder_traversal
      >>> from sympy.abc import w, x, y, z
  
      The nodes are returned in the order that they are encountered unless key
      is given; simply passing key=True will guarantee that the traversal is
      unique.
  
      >>> list(postorder_traversal(w + (x + y)*z)) # doctest: +SKIP
      [z, y, x, x + y, z*(x + y), w, w + z*(x + y)]
      >>> list(postorder_traversal(w + (x + y)*z, keys=True))
      [w, z, x, y, x + y, z*(x + y), w + z*(x + y)]
  
  
      """
      if isinstance(node, Basic):
          args = node.args
          if keys:
              if keys != True:
                  args = ordered(args, keys, default=False)
              else:
                  args = ordered(args)
          for arg in args:
              yield from postorder_traversal(arg, keys)
      elif iterable(node):
          for item in node:
              yield from postorder_traversal(item, keys)
      yield node
  
file_path: sympy/sympy/core/traversal.py
imports: from .basic import Basic
  from .sorting import ordered
  from .sympify import sympify
  from sympy.utilities.iterables import iterable
label_desc: Use image node_id 6 for calling a global function with example usage: postorder_traversal(node, keys) without return types