code: def _shunting_yard(expression):
      """
      Converts infix expression string into Reverse Polish Notation.
      https://en.wikipedia.org/wiki/Shunting-yard_algorithm
      """
      tokens = _get_tokens(expression)
      if len(tokens) > 0 and (tokens[0] == "-" or tokens[0] == "+"):
          tokens.insert(0, 0)
      op_precedence = {"+": 1, "-": 1, "*": 2, "/": 2}
      output = []
      op_stack = []
      for token in tokens:
          if token in OPERATORS:
              while (
                  len(op_stack) > 0
                  and op_stack[-1] != "("
                  and op_precedence[op_stack[-1]]
                  >= op_precedence[token]
              ):
                  output.append(op_stack.pop())
              op_stack.append(token)
          elif token == "(":
              op_stack.append(token)
          elif token == ")":
              while len(op_stack) > 0 and op_stack[-1] != "(":
                  output.append(op_stack.pop())
              assert op_stack[-1] == "("
              op_stack.pop()
          else:
              output.append(token)
      while len(op_stack) > 0:
          assert op_stack[-1] != "("
          output.append(op_stack.pop())
  
      _validate_rpn(output, expression)
      return output
  
file_path: AIX360/aix360/algorithms/rule_induction/trxf/core/feature.py
imports: import numbers
  import tokenize
  from io import BytesIO
  from typing import Dict, Any
label_desc: Use image node_id 2 for calling a global function with example usage: _shunting_yard(expression) and returns: output