from typing import Literal

__lowerCamelCase     :					Optional[int]				  =						'''ABCDEFGHIJKLMNOPQRSTUVWXYZ'''



def       __SCREAMING_SNAKE_CASE    (   __UpperCamelCase       :			str					,	__UpperCamelCase       :			str					,	__UpperCamelCase       :			Literal["encrypt", "decrypt"]      )				->   str:







  """simple docstring"""





  SCREAMING_SNAKE_CASE__     				= LETTERS if mode == """decrypt""" else key
  SCREAMING_SNAKE_CASE__     				= key if mode == """decrypt""" else LETTERS
  SCREAMING_SNAKE_CASE__     				= """"""
  # loop through each symbol in the message
  for symbol in message:
    if symbol.upper() in chars_a:
      # encrypt/decrypt the symbol
      SCREAMING_SNAKE_CASE__     				= 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       __SCREAMING_SNAKE_CASE    (   __UpperCamelCase       :			str					,	__UpperCamelCase       :			str      )				->   str:







  """simple docstring"""





  return translate_message(__UpperCamelCase					,	__UpperCamelCase					,	"""encrypt"""      )



def       __SCREAMING_SNAKE_CASE    (   __UpperCamelCase       :			str					,	__UpperCamelCase       :			str      )				->   str:







  """simple docstring"""





  return translate_message(__UpperCamelCase					,	__UpperCamelCase					,	"""decrypt"""      )



def       __SCREAMING_SNAKE_CASE    (   )				->   None:







  """simple docstring"""





  SCREAMING_SNAKE_CASE__     				= """Hello World"""
  SCREAMING_SNAKE_CASE__     				= """QWERTYUIOPASDFGHJKLZXCVBNM"""
  SCREAMING_SNAKE_CASE__     				= """decrypt"""  # set to 'encrypt' or 'decrypt'

  if mode == "encrypt":
    SCREAMING_SNAKE_CASE__     				= encrypt_message(__UpperCamelCase					,	__UpperCamelCase      )
  elif mode == "decrypt":
    SCREAMING_SNAKE_CASE__     				= decrypt_message(__UpperCamelCase					,	__UpperCamelCase      )
  print(f"""Using the key {key}, the {mode}ed message is: {translated}"""      )


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   main()

from __future__ import annotations



def       __SCREAMING_SNAKE_CASE    (   __UpperCamelCase       :			str      )				->   bool:







  """simple docstring"""





  SCREAMING_SNAKE_CASE__     				= 42
  SCREAMING_SNAKE_CASE__     				= list(__UpperCamelCase      )
  SCREAMING_SNAKE_CASE__				,	SCREAMING_SNAKE_CASE__     				= _vector[:-1], int(_vector[-1]      )
  SCREAMING_SNAKE_CASE__     				= [int(__UpperCamelCase      ) for digit in __vector]

  vector.reverse()
  for i, digit in enumerate(__UpperCamelCase      ):
    if i & 1 == 0:
      SCREAMING_SNAKE_CASE__     				= digit * 2
      if doubled > 9:
        doubled -= 9
      check_digit += doubled
    else:
      check_digit += digit

  return check_digit % 10 == 0


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   assert is_luhn('''79927398713''')
   assert not is_luhn('''79927398714''')
