code: 
  
  import unittest
  
  from cer import CER
  
  
  _lowerCAmelCase     :			str    =CER()
  
  class __UpperCamelCase    (							unittest.TestCase		):
  
  
  
  
  
  
  					'''simple docstring'''
  
  
  
  					def       _UpperCAmelCase						(							self	):
  						UpperCAmelCase__:  Optional[int]		       =   ["White House"]
  						UpperCAmelCase__:  Dict		       =   ["white house"]
  						# S = 2, D = 0, I = 0, N = 11, CER = 2 / 11
  						UpperCAmelCase__:  List[str]		       =   cer.compute(predictions=lowerCamelCase__							,			references=lowerCamelCase__	)
  						self.assertTrue(abs(char_error_rate - 0.1_818_181_818	) < 1e-6	)
  
  
  
  
  
  					def       _UpperCAmelCase						(							self	):
  						UpperCAmelCase__:  int		       =   ["were wolf"]
  						UpperCAmelCase__:  Union[str, Any]		       =   ["werewolf"]
  						# S = 0, D = 0, I = 1, N = 9, CER = 1 / 9
  						UpperCAmelCase__:  str		       =   cer.compute(predictions=lowerCamelCase__							,			references=lowerCamelCase__	)
  						self.assertTrue(abs(char_error_rate - 0.1_111_111	) < 1e-6	)
  
  						UpperCAmelCase__:  Dict		       =   ["werewolf"]
  						UpperCAmelCase__:  List[str]		       =   ["weae     wolf"]
  						# S = 1, D = 1, I = 0, N = 8, CER = 0.25
  						UpperCAmelCase__:  List[str]		       =   cer.compute(predictions=lowerCamelCase__							,			references=lowerCamelCase__	)
  						self.assertTrue(abs(char_error_rate - 0.25	) < 1e-6	)
  
  						# consecutive whitespaces case 1
  						UpperCAmelCase__:  Optional[Any]		       =   ["were wolf"]
  						UpperCAmelCase__:  Tuple		       =   ["were               wolf"]
  						# S = 0, D = 0, I = 0, N = 9, CER = 0
  						UpperCAmelCase__:  Optional[Any]		       =   cer.compute(predictions=lowerCamelCase__							,			references=lowerCamelCase__	)
  						self.assertTrue(abs(char_error_rate - 0.0	) < 1e-6	)
  
  						# consecutive whitespaces case 2
  						UpperCAmelCase__:  List[Any]		       =   ["were   wolf"]
  						UpperCAmelCase__:  int		       =   ["were               wolf"]
  						# S = 0, D = 0, I = 0, N = 9, CER = 0
  						UpperCAmelCase__:  Optional[Any]		       =   cer.compute(predictions=lowerCamelCase__							,			references=lowerCamelCase__	)
  						self.assertTrue(abs(char_error_rate - 0.0	) < 1e-6	)
  
  
  
  
  
  					def       _UpperCAmelCase						(							self	):
  						UpperCAmelCase__:  str		       =   ["werewolf"]
  						UpperCAmelCase__:  List[Any]		       =   ["weaewolf"]
  						# S = 1, D = 0, I = 0, N = 8, CER = 0.125
  						UpperCAmelCase__:  Tuple		       =   cer.compute(predictions=lowerCamelCase__							,			references=lowerCamelCase__	)
  						self.assertTrue(abs(char_error_rate - 0.125	) < 1e-6	)
  
  
  
  
  
  					def       _UpperCAmelCase						(							self	):
  						UpperCAmelCase__:  Optional[int]		       =   ["werewolf"]
  						UpperCAmelCase__:  List[str]		       =   ["wereawolf"]
  						# S = 0, D = 1, I = 0, N = 8, CER = 0.125
  						UpperCAmelCase__:  List[str]		       =   cer.compute(predictions=lowerCamelCase__							,			references=lowerCamelCase__	)
  						self.assertTrue(abs(char_error_rate - 0.125	) < 1e-6	)
  
  
  
  
  
  					def       _UpperCAmelCase						(							self	):
  						UpperCAmelCase__:  List[Any]		       =   ["werewolf"]
  						UpperCAmelCase__:  Any		       =   ["wereolf"]
  						# S = 0, D = 0, I = 1, N = 8, CER = 0.125
  						UpperCAmelCase__:  List[str]		       =   cer.compute(predictions=lowerCamelCase__							,			references=lowerCamelCase__	)
  						self.assertTrue(abs(char_error_rate - 0.125	) < 1e-6	)
  
  
  
  
  
  					def       _UpperCAmelCase						(							self	):
  						UpperCAmelCase__:  Optional[Any]		       =   ["werewolf"]
  						UpperCAmelCase__:  str		       =   cer.compute(predictions=lowerCamelCase__							,			references=lowerCamelCase__	)
  						self.assertEqual(lowerCamelCase__							,			0.0	)
  
  
  
  
  
  					def       _UpperCAmelCase						(							self	):
  						UpperCAmelCase__:  Dict		       =   ["werewolf", "I am your father"]
  						UpperCAmelCase__:  Optional[Any]		       =   cer.compute(predictions=lowerCamelCase__							,			references=lowerCamelCase__	)
  						self.assertEqual(lowerCamelCase__							,			0.0	)
  
  						UpperCAmelCase__:  str		       =   ["werewolf", "I am your father", "doge"]
  						UpperCAmelCase__:  Tuple		       =   ["werxwolf", "I       am your father", "doge"]
  						# S = 1, D = 0, I = 0, N = 28, CER = 1 / 28
  						UpperCAmelCase__:  str		       =   cer.compute(predictions=lowerCamelCase__							,			references=lowerCamelCase__	)
  						self.assertTrue(abs(char_error_rate - 0.03_571_428	) < 1e-6	)
  
  
  
  
  
  					def       _UpperCAmelCase						(							self	):
  						UpperCAmelCase__:  List[str]		       =   ["My hovercraft", "is full of eels"]
  						UpperCAmelCase__:  Tuple		       =   ["My hovercraft is full", " of eels"]
  						# S = 0, D = 0, I = 2, N = 28, CER = 2 / 28
  						# whitespace at the front of " of eels" will be strip during preporcessing
  						# so need to insert 2 whitespaces
  						UpperCAmelCase__:  int		       =   cer.compute(predictions=lowerCamelCase__							,			references=lowerCamelCase__							,			concatenate_texts=lowerCamelCase__	)
  						self.assertTrue(abs(char_error_rate - 0.071_428	) < 1e-6	)
  
  
  
  
  
  					def       _UpperCAmelCase						(							self	):
  						UpperCAmelCase__:  Any		       =   ["我能吞下玻璃而不伤身体"]
  						UpperCAmelCase__:  List[str]		       =   [" 能吞虾玻璃而 不霜身体啦"]
  						# S = 3, D = 2, I = 0, N = 11, CER = 5 / 11
  						UpperCAmelCase__:  Optional[int]		       =   cer.compute(predictions=lowerCamelCase__							,			references=lowerCamelCase__	)
  						self.assertTrue(abs(char_error_rate - 0.4_545_454_545	) < 1e-6	)
  
  						UpperCAmelCase__:  Optional[int]		       =   ["我能吞下玻璃", "而不伤身体"]
  						UpperCAmelCase__:  Dict		       =   ["我    能 吞 下 玻 璃", "而不伤身体"]
  						# S = 0, D = 5, I = 0, N = 11, CER = 5 / 11
  						UpperCAmelCase__:  Tuple		       =   cer.compute(predictions=lowerCamelCase__							,			references=lowerCamelCase__	)
  						self.assertTrue(abs(char_error_rate - 0.454_545_454_545	) < 1e-6	)
  
  						UpperCAmelCase__:  Any		       =   ["我能吞下玻璃而不伤身体"]
  						UpperCAmelCase__:  Optional[int]		       =   cer.compute(predictions=lowerCamelCase__							,			references=lowerCamelCase__	)
  						self.assertFalse(lowerCamelCase__							,			0.0	)
  
  
  
  
  
  					def       _UpperCAmelCase						(							self	):
  						UpperCAmelCase__:  Optional[Any]		       =   [""]
  						UpperCAmelCase__:  str		       =   ["Hypothesis"]
  						with self.assertRaises(lowerCamelCase__	):
  							cer.compute(predictions=lowerCamelCase__							,			references=lowerCamelCase__	)
  
  
  if __name__ == "__main__":
  					unittest.main()
style_context: 
  
  _lowerCAmelCase     :			Optional[int]    ={
      """+""": lambda x, y: x + y,
      """-""": lambda x, y: x - y,
      """*""": lambda x, y: x * y,
      """/""": lambda x, y: x / y,
  }
  
  
  
  def  _A  (			SCREAMING_SNAKE_CASE			):
  	return c.isdigit()
  
  
  
  def  _A  (			SCREAMING_SNAKE_CASE			):
  	UpperCAmelCase__:  str		       =   []
  
  	# iterate over the string in reverse order
  	for c in expression.split()[::-1]:
  		# push operand to stack
  		if is_operand(SCREAMING_SNAKE_CASE			):
  			stack.append(int(SCREAMING_SNAKE_CASE			)			)
  
  		else:
  			# pop values from stack can calculate the result
  			# push the result onto the stack again
  			UpperCAmelCase__:  Any		       =   stack.pop()
  			UpperCAmelCase__:  int		       =   stack.pop()
  			stack.append(calc[c](SCREAMING_SNAKE_CASE  ,SCREAMING_SNAKE_CASE			)			)
  
  	return stack.pop()
  
  
  # Driver code
  if __name__ == "__main__":
  					_lowerCAmelCase     :			Optional[int]    ="""+ 9 * 2 6"""
  					print(evaluate(test_expression))
  
  					_lowerCAmelCase     :			Optional[Any]    ="""/ * 10 2 + 4 1 """
  					print(evaluate(test_expression))