



"""simple docstring"""





import os
import unittest

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

from ...test_tokenization_common import TokenizerTesterMixin
class  lowercase__  (       UpperCAmelCase_							,   unittest.TestCase ):







       '''simple docstring'''


       UpperCamelCase		=	PhobertTokenizer
       UpperCamelCase		=	False



       def 	lowercase__							(				self     :    List[Any]       )					->		Optional[Any]:


             '''simple docstring'''




             super().setUp()

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

             UpperCAmelCase_     					=				os.path.join(self.tmpdirname						,							VOCAB_FILES_NAMES["vocab_file"]       )
             UpperCAmelCase_     					=				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(__lowerCamelCase       )       )



       def 	lowercase__							(				self     :    Optional[int]						,							**_UpperCAmelCase     :    List[Any]       )					->		Optional[int]:


             '''simple docstring'''




             kwargs.update(self.special_tokens_map       )
             return PhobertTokenizer.from_pretrained(self.tmpdirname						,							**__lowerCamelCase       )



       def 	lowercase__							(				self     :    Tuple						,							_UpperCAmelCase     :    Union[str, Any]       )					->		str:


             '''simple docstring'''




             UpperCAmelCase_     					=				"Tôi là VinAI Research"
             UpperCAmelCase_     					=				"T<unk> i <unk> <unk> <unk> <unk> <unk> <unk> I Re<unk> e<unk> <unk> <unk> <unk>"
             return input_text, output_text







       def 	lowercase__							(				self     :    Any       )					->		Any:


             '''simple docstring'''




             UpperCAmelCase_     					=				PhobertTokenizer(self.vocab_file						,							self.merges_file						,							**self.special_tokens_map       )
             UpperCAmelCase_     					=				"Tôi là VinAI Research"
             UpperCAmelCase_     					=				"T@@ ô@@ i l@@ à V@@ i@@ n@@ A@@ I R@@ e@@ s@@ e@@ a@@ r@@ c@@ h".split()
             UpperCAmelCase_     					=				tokenizer.tokenize(__lowerCamelCase       )
             print(__lowerCamelCase       )
             self.assertListEqual(__lowerCamelCase						,							__lowerCamelCase       )

             UpperCAmelCase_     					=				tokens + [tokenizer.unk_token]

             UpperCAmelCase_     					=				[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(__lowerCamelCase       )						,							__lowerCamelCase       )











from math import factorial



def  SCREAMING_SNAKE_CASE				(      snake_case						,   snake_case							)		->    int:

		# If either of the conditions are true, the function is being asked
		# to calculate a factorial of a negative number, which is not possible
		if n < k or k < 0:
				raise ValueError('Please enter positive integers for n and k where n >= k'							)
		return factorial(snake_case							) // (factorial(snake_case							) * factorial(n - k							))


if __name__ == "__main__":
		print(
		    '''The number of five-card hands possible from a standard''',
		    F"""fifty-two card deck is: {combinations(52, 5)}\n""",
		)

		print(
		    '''If a class of 40 students must be arranged into groups of''',
		    F"""4 for group projects, there are {combinations(40, 4)} ways""",
		    '''to arrange them.\n''',
		)

		print(
		    '''If 10 teams are competing in a Formula One race, there''',
		    F"""are {combinations(10, 3)} ways that first, second and""",
		    '''third place can be awarded.''',
		)




