code: def replace_all_post_order(expression: Expression, rules: Iterable[ReplacementRule]) \
          -> Union[Expression, Sequence[Expression]]:
      
      return _replace_all_post_order(expression, rules)[0]
docs: Replace all occurrences of the patterns according to the replacement rules.
  
      A replacement rule consists of a *pattern*, that is matched against any subexpression
      of the expression. If a match is found, the *replacement* callback of the rule is called with
      the variables from the match substitution. Whatever the callback returns is used as a replacement for the
      matched subexpression. This can either be a single expression or a sequence of expressions, which is then
      integrated into the surrounding operation in place of the subexpression.
  
      Note that the pattern can therefore not be a single sequence variable/wildcard, because only single expressions
      will be matched.
  
      Args:
          expression:
              The expression to which the replacement rules are applied.
          rules:
              A collection of replacement rules that are applied to the expression.
          max_count:
              If given, at most *max_count* applications of the rules are performed. Otherwise, the rules
              are applied until there is no more match. If the set of replacement rules is not confluent,
              the replacement might not terminate without a *max_count* set.
  
      Returns:
          The resulting expression after the application of the replacement rules. This can also be a sequence of
          expressions, if the root expression is replaced with a sequence of expressions by a rule.