





'''simple docstring'''



import os
import unittest

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

from ...test_tokenization_common import TokenizerTesterMixin






class 							__lowercase    ( _a	, unittest.TestCase  ):







	'''simple docstring'''

	a      :			List[str]     =    TransfoXLTokenizer
	a      :			Any     =    False
	a      :			Optional[int]     =    False


	def   _UpperCAmelCase       (self	)							->							Optional[Any]:







				'''simple docstring'''





				super().setUp()

				__lowercase			  =							[
				    """<unk>""",
				    """[CLS]""",
				    """[SEP]""",
				    """want""",
				    """unwanted""",
				    """wa""",
				    """un""",
				    """running""",
				    """,""",
				    """low""",
				    """l""",
				]
				__lowercase			  =							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   _UpperCAmelCase       (self       ,**_lowerCamelCase	)							->							Any:







				'''simple docstring'''





				__lowercase			  =							True
				return TransfoXLTokenizer.from_pretrained(self.tmpdirname       ,**__lowerCamelCase	)


	def   _UpperCAmelCase       (self       ,_lowerCamelCase	)							->							str:







				'''simple docstring'''





				__lowercase			  =							"""<unk> UNwanted , running"""
				__lowercase			  =							"""<unk> unwanted, running"""
				return input_text, output_text


	def   _UpperCAmelCase       (self	)							->							str:







				'''simple docstring'''





				__lowercase			  =							TransfoXLTokenizer(vocab_file=self.vocab_file       ,lower_case=__lowerCamelCase	)

				__lowercase			  =							tokenizer.tokenize('''<unk> UNwanted , running'''	)
				self.assertListEqual(__lowerCamelCase       ,['''<unk>''', '''unwanted''', ''',''', '''running''']	)

				self.assertListEqual(tokenizer.convert_tokens_to_ids(__lowerCamelCase	)       ,[0, 4, 8, 7]	)


	def   _UpperCAmelCase       (self	)							->							str:







				'''simple docstring'''





				__lowercase			  =							TransfoXLTokenizer(lower_case=__lowerCamelCase	)

				self.assertListEqual(
				    tokenizer.tokenize(''' \tHeLLo ! how  \n Are yoU ?  '''	)       ,['''hello''', '''!''', '''how''', '''are''', '''you''', '''?''']	)


	def   _UpperCAmelCase       (self	)							->							Optional[int]:







				'''simple docstring'''





				__lowercase			  =							TransfoXLTokenizer(lower_case=__lowerCamelCase	)

				self.assertListEqual(
				    tokenizer.tokenize(''' \tHeLLo ! how  \n Are yoU ?  '''	)       ,['''HeLLo''', '''!''', '''how''', '''Are''', '''yoU''', '''?''']	)


	def   _UpperCAmelCase       (self	)							->							List[str]:







				'''simple docstring'''





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

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

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


	def   _UpperCAmelCase       (self	)							->							Any:







				'''simple docstring'''





				__lowercase			  =							self.get_tokenizer()
				__lowercase			  =							len(__lowerCamelCase	)

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

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












'''simple docstring'''



def 				_lowerCAmelCase  (			lowerCamelCase_     :					Union[str, Any]			):
			__lowercase			  =							1
			__lowercase			  =							2
			while i * i <= n:
						__lowercase			  =							0
						while n % i == 0:
									n //= i
									multiplicity += 1
						n_divisors *= multiplicity + 1
						i += 1
			if n > 1:
						n_divisors *= 2
			return n_divisors




def 				_lowerCAmelCase  (			):
			__lowercase			  =							1
			__lowercase			  =							1

			while True:
						i += 1
						t_num += i

						if count_divisors(lowerCamelCase_			) > 5_0_0:
									break

			return t_num


if __name__ == "__main__":
	print(solution())





