"""simple docstring"""


def   __UpperCAmelCase     (	_snake_case		:       float       ):
   return -num if num < 0 else num


def   __UpperCAmelCase     (	_snake_case		:       list[int]       ):
   if len(_snake_case       ) == 0:
      raise ValueError("abs_min() arg is an empty sequence"       )
   _lowercase							     =       x[0]
   for i in x:
      if abs_val(_snake_case       ) < abs_val(_snake_case       ):
         _lowercase							     =       i
   return j


def   __UpperCAmelCase     (	_snake_case		:       list[int]       ):
   if len(_snake_case       ) == 0:
      raise ValueError("abs_max() arg is an empty sequence"       )
   _lowercase							     =       x[0]
   for i in x:
      if abs(_snake_case       ) > abs(_snake_case       ):
         _lowercase							     =       i
   return j


def   __UpperCAmelCase     (	_snake_case		:       list[int]       ):
   if len(_snake_case       ) == 0:
      raise ValueError("abs_max_sort() arg is an empty sequence"       )
   return sorted(_snake_case,				key=_snake_case       )[-1]


def   __UpperCAmelCase     (	):
   assert abs_val(0       ) == 0
   assert abs_val(3_4       ) == 3_4
   assert abs_val(-1_0_0_0_0_0_0_0_0_0_0_0       ) == 1_0_0_0_0_0_0_0_0_0_0_0

   _lowercase							     =       [-3, -1, 2, -1_1]
   assert abs_max(_snake_case       ) == -1_1
   assert abs_max_sort(_snake_case       ) == -1_1
   assert abs_min(_snake_case       ) == -1


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  test_abs_val()
  print(abs_val(-3_4))  # --> 34
"""simple docstring"""


from typing import Literal

__UpperCamelCase       :    int         =		"ABCDEFGHIJKLMNOPQRSTUVWXYZ"


def   __UpperCAmelCase     (	_snake_case		:       str,				_snake_case		:       str,				_snake_case		:       Literal["encrypt", "decrypt"]       ):
   _lowercase							     =       LETTERS if mode == "decrypt" else key
   _lowercase							     =       key if mode == "decrypt" else LETTERS
   _lowercase							     =       ""
   # loop through each symbol in the message
   for symbol in message:
      if symbol.upper() in chars_a:
         # encrypt/decrypt the symbol
         _lowercase							     =       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   __UpperCAmelCase     (	_snake_case		:       str,				_snake_case		:       str       ):
   return translate_message(_snake_case,				_snake_case,				"encrypt"       )


def   __UpperCAmelCase     (	_snake_case		:       str,				_snake_case		:       str       ):
   return translate_message(_snake_case,				_snake_case,				"decrypt"       )


def   __UpperCAmelCase     (	):
   _lowercase							     =       "Hello World"
   _lowercase							     =       "QWERTYUIOPASDFGHJKLZXCVBNM"
   _lowercase							     =       "decrypt"  # set to 'encrypt' or 'decrypt'

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


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  main()