



'''simple docstring'''




from typing import Literal

UpperCamelCase__	:     Optional[int]		  =			"ABCDEFGHIJKLMNOPQRSTUVWXYZ"


def     lowerCAmelCase_       (     _lowerCamelCase:       str	,				_lowerCamelCase:       str	,				_lowerCamelCase:       Literal["encrypt", "decrypt"] ):
		__SCREAMING_SNAKE_CASE	:		Union[str, Any]   	=		LETTERS if mode == """decrypt""" else key
		__SCREAMING_SNAKE_CASE	:		List[str]   	=		key if mode == """decrypt""" else LETTERS
		__SCREAMING_SNAKE_CASE	:		List[str]   	=		""""""
		# loop through each symbol in the message
		for symbol in message:
				if symbol.upper() in chars_a:
						# encrypt/decrypt the symbol
						__SCREAMING_SNAKE_CASE	:		Optional[int]   	=		chars_a.find(symbol.upper() )
						if symbol.isupper():
								translated += chars_b[sym_index].upper()
						else:
								translated += chars_b[sym_index].lower()
				else:
						# symbol is not in LETTERS, just add it
						translated += symbol
		return translated


def     lowerCAmelCase_       (     _lowerCamelCase:       str	,				_lowerCamelCase:       str ):
		return translate_message(UpperCamelCase_	,				UpperCamelCase_	,				"""encrypt""" )


def     lowerCAmelCase_       (     _lowerCamelCase:       str	,				_lowerCamelCase:       str ):
		return translate_message(UpperCamelCase_	,				UpperCamelCase_	,				"""decrypt""" )


def     lowerCAmelCase_       (     ):
		__SCREAMING_SNAKE_CASE	:		int   	=		"""Hello World"""
		__SCREAMING_SNAKE_CASE	:		Optional[Any]   	=		"""QWERTYUIOPASDFGHJKLZXCVBNM"""
		__SCREAMING_SNAKE_CASE	:		List[str]   	=		"""decrypt"""  # set to 'encrypt' or 'decrypt'

		if mode == "encrypt":
				__SCREAMING_SNAKE_CASE	:		List[str]   	=		encrypt_message(UpperCamelCase_	,				UpperCamelCase_ )
		elif mode == "decrypt":
				__SCREAMING_SNAKE_CASE	:		Optional[Any]   	=		decrypt_message(UpperCamelCase_	,				UpperCamelCase_ )
		print(F"Using the key {key}, the {mode}ed message is: {translated}" )


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						main()




'''simple docstring'''




UpperCamelCase__	:     List[Any]    =			10_00


def     lowerCAmelCase_       (     _lowerCamelCase:       float ):
		return x * x


def     lowerCAmelCase_       (     _lowerCamelCase:       Any	,				_lowerCamelCase:       float	,				_lowerCamelCase:       float	,				_lowerCamelCase:       int = 4 ):
		assert callable(
		    _lowerCamelCase ), F"the function(object) passed should be callable your input : {function}"
		assert isinstance(_lowerCamelCase	,				(float, int) ), F"a should be float or integer your input : {a}"
		assert isinstance(function(_lowerCamelCase )	,				(float, int) ), (
		    "the function should return integer or float return type of your function, "
		    F"{type(_lowerCamelCase )}"
		)
		assert isinstance(_lowerCamelCase	,				(float, int) ), F"b should be float or integer your input : {b}"
		assert (
		    isinstance(_lowerCamelCase	,				_lowerCamelCase ) and precision > 0
		), F"precision should be positive integer your input : {precision}"

		# just applying the formula of simpson for approximate integration written in
		# mentioned article in first comment of this file and above this function

		__SCREAMING_SNAKE_CASE	:		List[Any]   	=		(b - a) / N_STEPS
		__SCREAMING_SNAKE_CASE	:		List[Any]   	=		function(_lowerCamelCase ) + function(_lowerCamelCase )

		for i in range(1	,				_lowerCamelCase ):
				__SCREAMING_SNAKE_CASE	:		Union[str, Any]   	=		a + h * i
				result += function(_lowerCamelCase ) * (4 if i % 2 else 2)

		result *= h / 3
		return round(_lowerCamelCase	,				_lowerCamelCase )


if __name__ == "__main__":
						import doctest

						doctest.testmod()