code: def _validate_rpn(rpn, expression):
      stack_size = 0
      for token in rpn:
          valence = 2 if token in OPERATORS else 0
          stack_size += 1 - valence
          if stack_size <= 0:
              raise ValueError(
                  'Invalid RPN {} for expression "{}"'.format(
                      rpn, expression
                  )
              )
      if stack_size != 1:
          raise ValueError(
              'Invalid RPN {} for expression "{}"'.format(
                  rpn, expression
              )
          )
  
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 4 for calling a global function with example usage: _validate_rpn(rpn, expression) without return types