




__UpperCamelCase   :			int          = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"





def 						__A						(      ) ->			None:
	a									=				input("""Enter message: """       )
	a									=				input("""Enter key [alphanumeric]: """       )
	a									=				input("""Encrypt/Decrypt [e/d]: """       )

	if mode.lower().startswith("""e"""       ):
		a									=				"""encrypt"""
		a									=				encrypt_message(__lowerCamelCase				,     __lowerCamelCase       )
	elif mode.lower().startswith("""d"""       ):
		a									=				"""decrypt"""
		a									=				decrypt_message(__lowerCamelCase				,     __lowerCamelCase       )

	print(f'\n{mode.title()}ed message:'       )
	print(__lowerCamelCase       )





def 						__A						(      __lowerCamelCase				,     __lowerCamelCase       ) ->			str:
	return translate_message(__lowerCamelCase				,     __lowerCamelCase				,     """encrypt"""       )





def 						__A						(      __lowerCamelCase				,     __lowerCamelCase       ) ->			str:
	return translate_message(__lowerCamelCase				,     __lowerCamelCase				,     """decrypt"""       )





def 						__A						(      __lowerCamelCase				,     __lowerCamelCase				,     __lowerCamelCase       ) ->			str:
	a									=				[]
	a									=				0
	a									=				key.upper()

	for symbol in message:
		a									=				LETTERS.find(symbol.upper()       )
		if num != -1:
			if mode == "encrypt":
				num += LETTERS.find(key[key_index]       )
			elif mode == "decrypt":
				num -= LETTERS.find(key[key_index]       )

			num %= len(__lowerCamelCase       )

			if symbol.isupper():
				translated.append(LETTERS[num]       )
			elif symbol.islower():
				translated.append(LETTERS[num].lower()       )

			key_index += 1
			if key_index == len(__lowerCamelCase       ):
				a									=				0
		else:
			translated.append(__lowerCamelCase       )
	return "".join(__lowerCamelCase       )


if __name__ == "__main__":
		main()







import os
import unittest

from transformers.models.transfo_xl.tokenization_transfo_xl import VOCAB_FILES_NAMES, TransfoXLTokenizer

from ...test_tokenization_common import TokenizerTesterMixin

class 						__lowerCAmelCase      (      __magic_name__ ,			unittest.TestCase					):
							UpperCamelCase__   	=    TransfoXLTokenizer
							UpperCamelCase__   	=    False
							UpperCamelCase__   	=    False
							def  lowerCamelCase__				(		self		:Optional[Any]							):







								'''simple docstring'''







								super().setUp()

								a									=				[
								    """<unk>""",
								    """[CLS]""",
								    """[SEP]""",
								    """want""",
								    """unwanted""",
								    """wa""",
								    """un""",
								    """running""",
								    """,""",
								    """low""",
								    """l""",
								]
								a									=				os.path.join(self.tmpdirname						, VOCAB_FILES_NAMES["""vocab_file"""]							)
								with open(self.vocab_file						, """w"""						, encoding="""utf-8"""							) as vocab_writer:
									vocab_writer.write("""""".join([x + """\n""" for x in vocab_tokens]							)							)
							def  lowerCamelCase__				(		self		:List[Any]						, **__magic_name__		:Optional[int]							):







								'''simple docstring'''







								a									=				True
								return TransfoXLTokenizer.from_pretrained(self.tmpdirname						, **__magic_name__							)
							def  lowerCamelCase__				(		self		:Union[str, Any]						, __magic_name__		:int							):







								'''simple docstring'''







								a									=				"""<unk> UNwanted , running"""
								a									=				"""<unk> unwanted, running"""
								return input_text, output_text
							def  lowerCamelCase__				(		self		:str							):







								'''simple docstring'''







								a									=				TransfoXLTokenizer(vocab_file=self.vocab_file						, lower_case=__magic_name__							)

								a									=				tokenizer.tokenize("""<unk> UNwanted , running"""							)
								self.assertListEqual(__magic_name__						, ["""<unk>""", """unwanted""", """,""", """running"""]							)

								self.assertListEqual(tokenizer.convert_tokens_to_ids(__magic_name__							)						, [0, 4, 8, 7]							)
							def  lowerCamelCase__				(		self		:int							):







								'''simple docstring'''







								a									=				TransfoXLTokenizer(lower_case=__magic_name__							)

								self.assertListEqual(
								    tokenizer.tokenize(""" \tHeLLo ! how  \n Are yoU ?  """							)						, ["""hello""", """!""", """how""", """are""", """you""", """?"""]							)
							def  lowerCamelCase__				(		self		:str							):







								'''simple docstring'''







								a									=				TransfoXLTokenizer(lower_case=__magic_name__							)

								self.assertListEqual(
								    tokenizer.tokenize(""" \tHeLLo ! how  \n Are yoU ?  """							)						, ["""HeLLo""", """!""", """how""", """Are""", """yoU""", """?"""]							)
							def  lowerCamelCase__				(		self		:Optional[int]							):







								'''simple docstring'''







								a									=				TransfoXLTokenizer(lower_case=__magic_name__							)
								a									=				"""Hello (bracket) and side-scrolled [and] Henry's $5,000 with 3.34 m. What's up!?"""
								a									=				[
								    """Hello""",
								    """(""",
								    """bracket""",
								    """)""",
								    """and""",
								    """side""",
								    """@-@""",
								    """scrolled""",
								    """[""",
								    """and""",
								    """]""",
								    """Henry""",
								    """'s""",
								    """$""",
								    """5""",
								    """@,@""",
								    """000""",
								    """with""",
								    """3""",
								    """@.@""",
								    """34""",
								    """m""",
								    """.""",
								    """What""",
								    """'s""",
								    """up""",
								    """!""",
								    """?""",
								]

								self.assertListEqual(tokenizer.tokenize(__magic_name__							)						, __magic_name__							)

								self.assertEqual(tokenizer.convert_tokens_to_string(__magic_name__							)						, __magic_name__							)





							def  lowerCamelCase__				(		self		:List[Any]							):







								'''simple docstring'''







								a									=				self.get_tokenizer()
								a									=				len(__magic_name__							)

								tokenizer.add_tokens(["""new1""", """new2"""]							)
								tokenizer.move_added_token("""new1"""						, 1							)

								# Check that moved token is not copied (duplicate)
								self.assertEqual(len(__magic_name__							)						, original_len + 2							)
								# Check that token is moved to specified id
								self.assertEqual(tokenizer.encode("""new1"""							)						, [1]							)
								self.assertEqual(tokenizer.decode([1]							)						, """new1"""							)

