





'''simple docstring'''


_lowerCamelCase					:						int					     =							{
    '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  __a			(  UpperCAmelCase     )   ->list[tuple[str, str]]:



	"""simple docstring"""







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




def  __a			(  UpperCAmelCase							,      UpperCAmelCase     )   ->str:



	"""simple docstring"""







	A					=   """"""
	A					=   0
	A					=   generate_table(UpperCAmelCase     )
	for char in words.upper():
		cipher += get_opponent(table[count]							,      UpperCAmelCase     )
		A					=   (count + 1) % len(UpperCAmelCase     )
	return cipher




def  __a			(  UpperCAmelCase							,      UpperCAmelCase     )   ->str:



	"""simple docstring"""







	return encrypt(UpperCAmelCase							,      UpperCAmelCase     )




def  __a			(  UpperCAmelCase							,      UpperCAmelCase     )   ->tuple[int, int]:



	"""simple docstring"""







	A					=   0 if char in table[0] else 1
	A					=   table[row].index(UpperCAmelCase     )
	return row, col




def  __a			(  UpperCAmelCase							,      UpperCAmelCase     )   ->str:



	"""simple docstring"""







	A	,     A					=   get_position(UpperCAmelCase							,      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					:						Dict					     =							input('Enter key: ').strip()
				_lowerCamelCase					:						Tuple					     =							input('Enter text to encrypt: ').strip()
				_lowerCamelCase					:						Dict					     =							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_torch_available, is_vision_available


_lowerCamelCase					:						Dict					     =							{
    'configuration_donut_swin': ['DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DonutSwinConfig'],
    'processing_donut': ['DonutProcessor'],
}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				_lowerCamelCase					:						List[str]					     =							[
				    'DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'DonutSwinModel',
				    'DonutSwinPreTrainedModel',
				]

try:
				if not is_vision_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				_lowerCamelCase					:						Any					     =							['DonutFeatureExtractor']
				_lowerCamelCase					:						Union[str, Any]					     =							['DonutImageProcessor']


if TYPE_CHECKING:
				from .configuration_donut_swin import DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, DonutSwinConfig
				from .processing_donut import DonutProcessor

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_donut_swin import (
								    DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
								    DonutSwinModel,
								    DonutSwinPreTrainedModel,
								)

				try:
								if not is_vision_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .feature_extraction_donut import DonutFeatureExtractor
								from .image_processing_donut import DonutImageProcessor

else:
				import sys

				_lowerCamelCase					:						Optional[int]					     =							_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

