code: 
  
  
  
  import random
  import sys
  
  __lowerCamelCase  				=					"""ABCDEFGHIJKLMNOPQRSTUVWXYZ"""
  
  
  
  
  def     UpperCAmelCase__ (							)   -> None:
    _A           =    input('''Enter message: '''							)
    _A           =    '''LFWOAYUISVKMNXPBDCRJTQEGHZ'''
    _A           =    input('''Encrypt/Decrypt [e/d]: '''							)
  
    check_valid_key(__snake_case							)
  
    if resp.lower().startswith('''e'''							):
      _A           =    '''encrypt'''
      _A           =    encrypt_message(__snake_case						,				__snake_case							)
    elif resp.lower().startswith('''d'''							):
      _A           =    '''decrypt'''
      _A           =    decrypt_message(__snake_case						,				__snake_case							)
  
    print(F'''\n{mode.title()}ion: \n{translated}'''							)
  
  
  
  
  def     UpperCAmelCase__ (							__snake_case							)   -> None:
    _A           =    list(__snake_case							)
    _A           =    list(__snake_case							)
    key_list.sort()
    letters_list.sort()
  
    if key_list != letters_list:
      sys.exit('''Error in the key or symbol set.'''							)
  
  
  
  
  def     UpperCAmelCase__ (							__snake_case						,				__snake_case							)   -> str:
    return translate_message(__snake_case						,				__snake_case						,				'''encrypt'''							)
  
  
  
  
  def     UpperCAmelCase__ (							__snake_case						,				__snake_case							)   -> str:
    return translate_message(__snake_case						,				__snake_case						,				'''decrypt'''							)
  
  
  
  
  def     UpperCAmelCase__ (							__snake_case						,				__snake_case						,				__snake_case							)   -> str:
    _A           =    ''''''
    _A           =    LETTERS
    _A           =    key
  
    if mode == "decrypt":
      _A    ,   _A           =    chars_b, chars_a
  
    for symbol in message:
      if symbol.upper() in chars_a:
        _A           =    chars_a.find(symbol.upper()							)
        if symbol.isupper():
          translated += chars_b[sym_index].upper()
        else:
          translated += chars_b[sym_index].lower()
      else:
        translated += symbol
  
    return translated
  
  
  
  
  def     UpperCAmelCase__ (							)   -> str:
    _A           =    list(__snake_case							)
    random.shuffle(__snake_case							)
    return "".join(__snake_case							)
  
  
  if __name__ == "__main__":
      main()
style_context: 
  
  
  
  from ..utils import requires_backends
  
  
  __lowerCamelCase  				=					None
  
  
  
  class 		_snake_case      :
  
  
  
  
  
   """simple docstring"""
  
  
  
   def __init__(						self	,    *a	,    **a					)	->							Tuple:
  
  
  
  
     """simple docstring"""
  
  
  
  
  
  
  
     requires_backends(self	,    ['''detectron2''']					)
  
  
  
   @classmethod
   def lowercase_		(						cls	,    *a	,    **a					)	->							Optional[int]:
  
  
  
  
     """simple docstring"""
  
  
  
  
  
  
  
     requires_backends(cls	,    ['''detectron2''']					)