


"""simple docstring"""


import os
import unittest

from transformers import FunnelTokenizer, FunnelTokenizerFast
from transformers.models.funnel.tokenization_funnel import VOCAB_FILES_NAMES
from transformers.testing_utils import require_tokenizers

from ...test_tokenization_common import TokenizerTesterMixin
@require_tokenizers
class 						_UpperCamelCase						(     lowerCAmelCase__ ,unittest.TestCase	):
							'''simple docstring'''







							__UpperCAmelCase		:					int          =FunnelTokenizer
							__UpperCAmelCase		:					Any          =FunnelTokenizerFast
							__UpperCAmelCase		:					Optional[Any]          =True
							__UpperCAmelCase		:					Any          =True

							def     snake_case       (  self			):
										super().setUp()

										__lowerCAmelCase       					=    [
										    "<unk>",
										    "<cls>",
										    "<sep>",
										    "want",
										    "##want",
										    "##ed",
										    "wa",
										    "un",
										    "runn",
										    "##ing",
										    ",",
										    "low",
										    "lowest",
										]
										__lowerCAmelCase       					=    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     snake_case       (  self					,     **__a			):
										return FunnelTokenizer.from_pretrained(self.tmpdirname					,     **__a			)

							def     snake_case       (  self					,     **__a			):
										return FunnelTokenizerFast.from_pretrained(self.tmpdirname					,     **__a			)

							def     snake_case       (  self					,     __a			):
										__lowerCAmelCase       					=    "UNwant\u00E9d,running"
										__lowerCAmelCase       					=    "unwanted, running"
										return input_text, output_text

							def     snake_case       (  self			):
										__lowerCAmelCase       					=    self.tokenizer_class(self.vocab_file			)

										__lowerCAmelCase       					=    tokenizer.tokenize("UNwant\u00E9d,running"			)
										self.assertListEqual(__a					,     ["un", "##want", "##ed", ",", "runn", "##ing"]			)
										self.assertListEqual(tokenizer.convert_tokens_to_ids(__a			)					,     [7, 4, 5, 10, 8, 9]			)



							def     snake_case       (  self			):
										__lowerCAmelCase       					=    self.get_tokenizers(do_lower_case=__a			)
										for tokenizer in tokenizers:
													__lowerCAmelCase       					=    tokenizer("UNwant\u00E9d,running"			)
													__lowerCAmelCase       					=    len(inputs["input_ids"]			) - 1
													self.assertListEqual(inputs["token_type_ids"]					,     [2] + [0] * sentence_len			)

													__lowerCAmelCase       					=    tokenizer("UNwant\u00E9d,running"					,     "UNwant\u00E9d,running"			)
													self.assertListEqual(inputs["token_type_ids"]					,     [2] + [0] * sentence_len + [1] * sentence_len			)








"""simple docstring"""


A  :     List[Any]    					=    [4, 1, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
A  :     Optional[int]    					=    [3, 7, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
A  :     Optional[int]    					=    {
    0: "Sunday",
    1: "Monday",
    2: "Tuesday",
    3: "Wednesday",
    4: "Thursday",
    5: "Friday",
    6: "Saturday",
}


def _lowerCamelCase			(	_UpperCamelCase					,				_UpperCamelCase					,				_UpperCamelCase   ):

			'''simple docstring'''




			assert len(str(_UpperCamelCase   )   ) > 2, "year should be in YYYY format"
			assert 1 <= month <= 12, "month should be between 1 to 12"
			assert 1 <= day <= 31, "day should be between 1 to 31"

			# Doomsday algorithm:
			__lowerCAmelCase       					=    year // 100
			__lowerCAmelCase       					=    (5 * (century % 4) + 2) % 7
			__lowerCAmelCase       					=    year % 100
			__lowerCAmelCase       					=    centurian % 12
			__lowerCAmelCase       					=    (
			    (centurian // 12) + centurian_m + (centurian_m // 4) + century_anchor
			) % 7
			__lowerCAmelCase       					=    (
			    DOOMSDAY_NOT_LEAP[month - 1]
			    if (year % 4 != 0) or (centurian == 0 and (year % 400) == 0)
			    else DOOMSDAY_LEAP[month - 1]
			)
			__lowerCAmelCase       					=    (dooms_day + day - day_anchor) % 7
			return WEEK_DAY_NAMES[week_day]


if __name__ == "__main__":
	import doctest

	doctest.testmod()




