

import os
import unittest

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

from ...test_tokenization_common import TokenizerTesterMixin





class 			_SCREAMING_SNAKE_CASE (   __snake_case					,       unittest.TestCase		):







   '''simple docstring'''




   lowerCamelCase__				=      PhobertTokenizer
   lowerCamelCase__				=      False





   def      _snake_case		(       self					:			Tuple			):
       super().setUp()

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

       SCREAMING_SNAKE_CASE										=   os.path.join(self.tmpdirname     , VOCAB_FILES_NAMES["vocab_file"]			)
       SCREAMING_SNAKE_CASE										=   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      _snake_case		(       self					:			Dict     , **__lowerCamelCase					:			Optional[int]			):
       kwargs.update(self.special_tokens_map			)
       return PhobertTokenizer.from_pretrained(self.tmpdirname     , **__lowerCamelCase			)





   def      _snake_case		(       self					:			Any     , __lowerCamelCase					:			Optional[int]			):
       SCREAMING_SNAKE_CASE										=   "Tôi là VinAI Research"
       SCREAMING_SNAKE_CASE										=   "T<unk> i <unk> <unk> <unk> <unk> <unk> <unk> I Re<unk> e<unk> <unk> <unk> <unk>"
       return input_text, output_text





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

       SCREAMING_SNAKE_CASE										=   tokens + [tokenizer.unk_token]

       SCREAMING_SNAKE_CASE										=   [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			)



def     __SCREAMING_SNAKE_CASE							(       )		->     Optional[int]:




						'''simple docstring'''







						__UpperCAmelCase			:							str	    =	[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

						__UpperCAmelCase			:							Union[str, Any]	    =	6
						__UpperCAmelCase			:							Optional[Any]	    =	1
						__UpperCAmelCase			:							Tuple	    =	1901

						__UpperCAmelCase			:							Any	    =	0

						while year < 2001:
												day += 7

												if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
																		if day > days_per_month[month - 1] and month != 2:
																								month += 1
																								__UpperCAmelCase			:							Optional[int]	    =	day - days_per_month[month - 2]
																		elif day > 29 and month == 2:
																								month += 1
																								__UpperCAmelCase			:							Optional[Any]	    =	day - 29
												else:
																		if day > days_per_month[month - 1]:
																								month += 1
																								__UpperCAmelCase			:							Optional[Any]	    =	day - days_per_month[month - 2]

												if month > 12:
																		year += 1
																		__UpperCAmelCase			:							int	    =	1

												if year < 2001 and day == 1:
																		sundays += 1
						return sundays


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

