




'''simple docstring'''


lowerCAmelCase_			:     Optional[Any]							    =     {
    'A': ('ABCDEFGHIJKLM', 'NOPQRSTUVWXYZ'),
    'B': ('ABCDEFGHIJKLM', 'NOPQRSTUVWXYZ'),
    'C': ('ABCDEFGHIJKLM', 'ZNOPQRSTUVWXY'),
    'D': ('ABCDEFGHIJKLM', 'ZNOPQRSTUVWXY'),
    'E': ('ABCDEFGHIJKLM', 'YZNOPQRSTUVWX'),
    'F': ('ABCDEFGHIJKLM', 'YZNOPQRSTUVWX'),
    'G': ('ABCDEFGHIJKLM', 'XYZNOPQRSTUVW'),
    'H': ('ABCDEFGHIJKLM', 'XYZNOPQRSTUVW'),
    'I': ('ABCDEFGHIJKLM', 'WXYZNOPQRSTUV'),
    'J': ('ABCDEFGHIJKLM', 'WXYZNOPQRSTUV'),
    'K': ('ABCDEFGHIJKLM', 'VWXYZNOPQRSTU'),
    'L': ('ABCDEFGHIJKLM', 'VWXYZNOPQRSTU'),
    'M': ('ABCDEFGHIJKLM', 'UVWXYZNOPQRST'),
    'N': ('ABCDEFGHIJKLM', 'UVWXYZNOPQRST'),
    'O': ('ABCDEFGHIJKLM', 'TUVWXYZNOPQRS'),
    'P': ('ABCDEFGHIJKLM', 'TUVWXYZNOPQRS'),
    'Q': ('ABCDEFGHIJKLM', 'STUVWXYZNOPQR'),
    'R': ('ABCDEFGHIJKLM', 'STUVWXYZNOPQR'),
    'S': ('ABCDEFGHIJKLM', 'RSTUVWXYZNOPQ'),
    'T': ('ABCDEFGHIJKLM', 'RSTUVWXYZNOPQ'),
    'U': ('ABCDEFGHIJKLM', 'QRSTUVWXYZNOP'),
    'V': ('ABCDEFGHIJKLM', 'QRSTUVWXYZNOP'),
    'W': ('ABCDEFGHIJKLM', 'PQRSTUVWXYZNO'),
    'X': ('ABCDEFGHIJKLM', 'PQRSTUVWXYZNO'),
    'Y': ('ABCDEFGHIJKLM', 'OPQRSTUVWXYZN'),
    'Z': ('ABCDEFGHIJKLM', 'OPQRSTUVWXYZN'),
}



def    _SCREAMING_SNAKE_CASE    (			UpperCamelCase__						:				str							):




     """simple docstring"""


     return [alphabet[char] for char in key.upper()]



def    _SCREAMING_SNAKE_CASE    (			UpperCamelCase__						:				str   ,						UpperCamelCase__						:				str							):




     """simple docstring"""


     a_    :       Any    	=     """"""
     a_    :       str    	=     0
     a_    :       str    	=     generate_table(__lowerCamelCase							)
     for char in words.upper():
          cipher += get_opponent(table[count]   ,						__lowerCamelCase							)
          a_    :       List[str]    	=     (count + 1) % len(__lowerCamelCase							)
     return cipher



def    _SCREAMING_SNAKE_CASE    (			UpperCamelCase__						:				str   ,						UpperCamelCase__						:				str							):




     """simple docstring"""


     return encrypt(__lowerCamelCase   ,						__lowerCamelCase							)



def    _SCREAMING_SNAKE_CASE    (			UpperCamelCase__						:				tuple[str, str]   ,						UpperCamelCase__						:				str							):




     """simple docstring"""


     a_    :       List[str]    	=     0 if char in table[0] else 1
     a_    :       List[str]    	=     table[row].index(__lowerCamelCase							)
     return row, col



def    _SCREAMING_SNAKE_CASE    (			UpperCamelCase__						:				tuple[str, str]   ,						UpperCamelCase__						:				str							):




     """simple docstring"""


     a_	,    a_    :       int    	=     get_position(__lowerCamelCase   ,						char.upper()							)
     if row == 1:
          return table[0][col]
     else:
          return table[1][col] if row == 0 else char


if __name__ == "__main__":
 import doctest

 doctest.testmod()  # Fist ensure that all our tests are passing...
 lowerCAmelCase_			:     List[str]							    =     input('Enter key: ').strip()
 lowerCAmelCase_			:     Tuple							    =     input('Enter text to encrypt: ').strip()
 lowerCAmelCase_			:     Any							    =     encrypt(key, text)

 print(f"Encrypted: {cipher_text}")
 print(f"Decrypted with key: {decrypt(key, cipher_text)}")






'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_tokenizers_available


lowerCAmelCase_			:     str							    =     {}

try:
 if not is_sentencepiece_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCAmelCase_			:     Optional[int]							    =     ['CpmTokenizer']

try:
 if not is_tokenizers_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCAmelCase_			:     Union[str, Any]							    =     ['CpmTokenizerFast']


if TYPE_CHECKING:
 try:
  if not is_sentencepiece_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_cpm import CpmTokenizer

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_cpm_fast import CpmTokenizerFast

else:
 import sys

 lowerCAmelCase_			:     Any							    =     _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
