


'''simple docstring'''







import os
import unittest

from transformers import LxmertTokenizer, LxmertTokenizerFast
from transformers.models.bert.tokenization_bert import VOCAB_FILES_NAMES
from transformers.testing_utils import require_tokenizers

from ...test_tokenization_common import TokenizerTesterMixin







@require_tokenizers
class A__       (						UpperCAmelCase__ ,     unittest.TestCase      ):
      __UpperCamelCase       :  Any	       =							LxmertTokenizer
      __UpperCamelCase       :  int	       =							LxmertTokenizerFast
      __UpperCamelCase       :  Optional[Any]	       =							True
      __UpperCamelCase       :  List[str]	       =							True






      def __UpperCAmelCase       ( self			:Optional[int]	)       ->					List[str]:




             '''simple docstring'''
             super().setUp()

             _a    : Dict     					=[
                 """[UNK]""",
                 """[CLS]""",
                 """[SEP]""",
                 """want""",
                 """##want""",
                 """##ed""",
                 """wa""",
                 """un""",
                 """runn""",
                 """##ing""",
                 """,""",
                 """low""",
                 """lowest""",
             ]
             _a    : Union[str, Any]     					=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			:Tuple     ,						SCREAMING_SNAKE_CASE			:Tuple	)       ->					Tuple:




             '''simple docstring'''
             _a    : Dict     					="""UNwant\u00E9d,running"""
             _a    : Dict     					="""unwanted, running"""
             return input_text, output_text






      def __UpperCAmelCase       ( self			:List[str]	)       ->					List[Any]:




             '''simple docstring'''
             _a    : Any     					=self.tokenizer_class(self.vocab_file	)

             _a    : Union[str, Any]     					=tokenizer.tokenize("""UNwant\u00E9d,running"""	)
             self.assertListEqual(SCREAMING_SNAKE_CASE     ,						["""un""", """##want""", """##ed""", """,""", """runn""", """##ing"""]	)
             self.assertListEqual(tokenizer.convert_tokens_to_ids(SCREAMING_SNAKE_CASE	)     ,						[7, 4, 5, 1_0, 8, 9]	)






      def __UpperCAmelCase       ( self			:Tuple	)       ->					int:




             '''simple docstring'''
             if not self.test_rust_tokenizer:
                    return

             _a    : int     					=self.get_tokenizer()
             _a    : Union[str, Any]     					=self.get_rust_tokenizer()

             _a    : Tuple     					="""I was born in 92000, and this is falsé."""

             _a    : str     					=tokenizer.tokenize(SCREAMING_SNAKE_CASE	)
             _a    : Optional[Any]     					=rust_tokenizer.tokenize(SCREAMING_SNAKE_CASE	)
             self.assertListEqual(SCREAMING_SNAKE_CASE     ,						SCREAMING_SNAKE_CASE	)

             _a    : Dict     					=tokenizer.encode(SCREAMING_SNAKE_CASE     ,						add_special_tokens=SCREAMING_SNAKE_CASE	)
             _a    : int     					=rust_tokenizer.encode(SCREAMING_SNAKE_CASE     ,						add_special_tokens=SCREAMING_SNAKE_CASE	)
             self.assertListEqual(SCREAMING_SNAKE_CASE     ,						SCREAMING_SNAKE_CASE	)

             _a    : List[Any]     					=self.get_rust_tokenizer()
             _a    : Dict     					=tokenizer.encode(SCREAMING_SNAKE_CASE	)
             _a    : Optional[int]     					=rust_tokenizer.encode(SCREAMING_SNAKE_CASE	)
             self.assertListEqual(SCREAMING_SNAKE_CASE     ,						SCREAMING_SNAKE_CASE	)






'''simple docstring'''







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


def 	SCREAMING_SNAKE_CASE_					(  _UpperCAmelCase	:	int    ,_UpperCAmelCase	:	int    ,_UpperCAmelCase	:	int  )  ->			str:
       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:
       _a    : List[str]     					=year // 100
       _a    : List[str]     					=(5 * (century % 4) + 2) % 7
       _a    : Optional[int]     					=year % 100
       _a    : Any     					=centurian % 12
       _a    : int     					=(
           (centurian // 12) + centurian_m + (centurian_m // 4) + century_anchor
       ) % 7
       _a    : Optional[Any]     					=(
           DOOMSDAY_NOT_LEAP[month - 1]
           if (year % 4 != 0) or (centurian == 0 and (year % 400) == 0)
           else DOOMSDAY_LEAP[month - 1]
       )
       _a    : str     					=(dooms_day + day - day_anchor) % 7
       return WEEK_DAY_NAMES[week_day]


if __name__ == "__main__":
   import doctest

   doctest.testmod()


