code: 
  '''simple docstring'''
  
  from .balanced_parentheses import balanced_parentheses
  from .stack import Stack
  
  
  def 	_UpperCAmelCase				(  _lowerCamelCase						:       str		)    ->						int:
    return {"+": 1, "-": 1, "*": 2, "/": 2, "^": 3}.get(_lowerCamelCase  ,      -1		)
  
  
  def 	_UpperCAmelCase				(  _lowerCamelCase						:       str		)    ->						str:
    if not balanced_parentheses(_lowerCamelCase		):
      raise ValueError("""Mismatched parentheses"""		)
    _lowerCAmelCase       :  Stack[str]   				=					Stack()
    _lowerCAmelCase       :  List[str]   				=					[]
    for char in expression_str:
      if char.isalpha() or char.isdigit():
        postfix.append(_lowerCamelCase		)
      elif char == "(":
        stack.push(_lowerCamelCase		)
      elif char == ")":
        while not stack.is_empty() and stack.peek() != "(":
          postfix.append(stack.pop()		)
        stack.pop()
      else:
        while not stack.is_empty() and precedence(_lowerCamelCase		) <= precedence(stack.peek()		):
          postfix.append(stack.pop()		)
        stack.push(_lowerCamelCase		)
    while not stack.is_empty():
      postfix.append(stack.pop()		)
    return " ".join(_lowerCamelCase		)
  
  
  if __name__ == "__main__":
       from doctest import testmod
  
       testmod()
       UpperCamelCase_     			=       """a+b*(c^d-e)^(f+g*h)-i"""
  
       print("""Infix to Postfix Notation demonstration:\n""")
       print("""Infix notation: """ + expression)
       print("""Postfix notation: """ + infix_to_postfix(expression))
  
  
  
style_context: 
  '''simple docstring'''
  
  def 	_UpperCAmelCase				(  _lowerCamelCase						:       int  ,      _lowerCamelCase						:       int  ,      _lowerCamelCase						:       int		)    ->						float:
    if common_ratio == 1:
      # Formula for sum if common ratio is 1
      return num_of_terms * first_term
  
    # Formula for finding sum of n terms of a GeometricProgression
    return (first_term / (1 - common_ratio)) * (1 - common_ratio**num_of_terms)
  
  
  