






"""simple docstring"""



import os
import unittest

from transformers.models.phobert.tokenization_phobert import VOCAB_FILES_NAMES, PhobertTokenizer

from ...test_tokenization_common import TokenizerTesterMixin





class 					_UpperCAmelCase       ( _A   ,						unittest.TestCase							):
					SCREAMING_SNAKE_CASE_		:				Optional[Any]							    =   PhobertTokenizer
					SCREAMING_SNAKE_CASE_		:				Any							    =   False




					def   A  (				self     :						Dict   )  ->  List[Any]:
							super().setUp()

							# Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
							lowercase_ : Optional[Any]							       =   ['''T@@''', '''i''', '''I''', '''R@@''', '''r''', '''e@@''']
							lowercase_ : Tuple							       =   dict(zip(A    ,						range(len(A   )   )   )   )
							lowercase_ : str							       =   ['''#version: 0.2''', '''l à</w>''']
							lowercase_ : List[Any]							       =   {'''unk_token''': '''<unk>'''}

							lowercase_ : Dict							       =   os.path.join(self.tmpdirname    ,						VOCAB_FILES_NAMES['''vocab_file''']   )
							lowercase_ : Optional[Any]							       =   os.path.join(self.tmpdirname    ,						VOCAB_FILES_NAMES['''merges_file''']   )

							with open(self.vocab_file    ,						'''w'''    ,						encoding='''utf-8'''   ) as fp:
									for token in vocab_tokens:
											fp.write(F'''{token} {vocab_tokens[token]}\n'''   )
							with open(self.merges_file    ,						'''w'''    ,						encoding='''utf-8'''   ) as fp:
									fp.write('''\n'''.join(A   )   )




					def   A  (				self     :						List[str]    ,						**A     :						List[str]   )  ->  Optional[int]:
							kwargs.update(self.special_tokens_map   )
							return PhobertTokenizer.from_pretrained(self.tmpdirname    ,						**A   )




					def   A  (				self     :						Optional[int]    ,						A     :						Union[str, Any]   )  ->  Optional[int]:
							lowercase_ : List[str]							       =   '''Tôi là VinAI Research'''
							lowercase_ : Dict							       =   '''T<unk> i <unk> <unk> <unk> <unk> <unk> <unk> I Re<unk> e<unk> <unk> <unk> <unk>'''
							return input_text, output_text






					def   A  (				self     :						Optional[int]   )  ->  Optional[Any]:
							lowercase_ : Any							       =   PhobertTokenizer(self.vocab_file    ,						self.merges_file    ,						**self.special_tokens_map   )
							lowercase_ : Optional[Any]							       =   '''Tôi là VinAI Research'''
							lowercase_ : Dict							       =   '''T@@ ô@@ i l@@ à V@@ i@@ n@@ A@@ I R@@ e@@ s@@ e@@ a@@ r@@ c@@ h'''.split()
							lowercase_ : List[Any]							       =   tokenizer.tokenize(A   )
							print(A   )
							self.assertListEqual(A    ,						A   )

							lowercase_ : str							       =   tokens + [tokenizer.unk_token]

							lowercase_ : List[Any]							       =   [4, 3, 5, 3, 3, 3, 3, 3, 3, 6, 7, 9, 3, 9, 3, 3, 3, 3, 3]
							self.assertListEqual(tokenizer.convert_tokens_to_ids(A   )    ,						A   )









_UpperCAmelCase		:  Tuple	=   {str(digit): digit**5 for digit in range(10)}



def 					UpperCAmelCase__     (   lowerCamelCase      ):
  return sum(DIGITS_FIFTH_POWER[digit] for digit in str(lowerCamelCase      )      )



def 					UpperCAmelCase__     (   ):
  return sum(
      number
      for number in range(1000,	1000000      )
      if number == digits_fifth_powers_sum(lowerCamelCase      )      )


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



