



from typing import List, Optional

from tokenizers import ByteLevelBPETokenizer

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_blenderbot_small import BlenderbotSmallTokenizer


A_		:     List[Any]        =     logging.get_logger(__name__)

A_		:     List[Any]        =     {
    '''vocab_file''': '''vocab.json''',
    '''merges_file''': '''merges.txt''',
    '''tokenizer_config_file''': '''tokenizer_config.json''',
}

A_		:     List[str]        =     {
    '''vocab_file''': {
        '''facebook/blenderbot_small-90M''': '''https://huggingface.co/facebook/blenderbot_small-90M/resolve/main/vocab.json'''
    },
    '''merges_file''': {
        '''facebook/blenderbot_small-90M''': '''https://huggingface.co/facebook/blenderbot_small-90M/resolve/main/merges.txt'''
    },
    '''tokenizer_config_file''': {
        '''facebook/blenderbot_small-90M''': (
            '''https://huggingface.co/facebook/blenderbot_small-90M/resolve/main/tokenizer_config.json'''
        )
    },
}

A_		:     List[str]        =     {
    '''facebook/blenderbot_small-90M''': 5_12,
}



class 		_lowercase		(       UpperCAmelCase__	):
			_UpperCAmelCase     	=			VOCAB_FILES_NAMES
			_UpperCAmelCase     	=			PRETRAINED_VOCAB_FILES_MAP
			_UpperCAmelCase     	=			PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
			_UpperCAmelCase     	=			BlenderbotSmallTokenizer

			def __init__(      self			:       List[Any]							,   __lowerCAmelCase			:       Union[str, Any]=None							,   __lowerCAmelCase			:       Tuple=None							,   __lowerCAmelCase			:       Any="<|endoftext|>"							,   __lowerCAmelCase			:       Tuple="<|endoftext|>"							,   __lowerCAmelCase			:       str="<|endoftext|>"							,   __lowerCAmelCase			:       Any=False							,   __lowerCAmelCase			:       Union[str, Any]=True							,   **__lowerCAmelCase			:       int							,   )       ->				str:


				"""simple docstring"""






				super().__init__(
				    ByteLevelBPETokenizer(
				        vocab=__lowerCAmelCase							,   merges=__lowerCAmelCase							,   add_prefix_space=__lowerCAmelCase							,   trim_offsets=__lowerCAmelCase							,   )							,   bos_token=__lowerCAmelCase							,   eos_token=__lowerCAmelCase							,   unk_token=__lowerCAmelCase							,   **__lowerCAmelCase							,   )
				a						=		add_prefix_space

			def 		A							(      self			:       str							,   __lowerCAmelCase			:       List[Any]							,   __lowerCAmelCase			:       List[str]=None							)       ->				List[Any]:


				"""simple docstring"""






				a						=		[self.bos_token_id] + token_ids_a + [self.eos_token_id]
				if token_ids_a is None:
					return output

				return output + [self.eos_token_id] + token_ids_a + [self.eos_token_id]




			def 		A							(      self			:       int							,   __lowerCAmelCase			:       List[int]							,   __lowerCAmelCase			:       Optional[List[int]] = None							)       ->				List[int]:


				"""simple docstring"""






				a						=		[self.sep_token_id]
				a						=		[self.cls_token_id]

				if token_ids_a is None:
					return len(cls + token_ids_a + sep							) * [0]
				return len(cls + token_ids_a + sep + sep + token_ids_a + sep							) * [0]






A_		:     Any        =     [4, 1, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
A_		:     Tuple        =     [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 	UpperCAmelCase__      (      UpperCAmelCase__ :int ,					UpperCAmelCase__ :int ,					UpperCAmelCase__ :int					):






 '''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:
 a						=		year // 1_00
 a						=		(5 * (century % 4) + 2) % 7
 a						=		year % 1_00
 a						=		centurian % 12
 a						=		(
     (centurian // 12) + centurian_m + (centurian_m // 4) + century_anchor
 ) % 7
 a						=		(
     DOOMSDAY_NOT_LEAP[month - 1]
     if (year % 4 != 0) or (centurian == 0 and (year % 4_00) == 0)
     else DOOMSDAY_LEAP[month - 1]
 )
 a						=		(dooms_day + day - day_anchor) % 7
 return WEEK_DAY_NAMES[week_day]


if __name__ == "__main__":
     import doctest

     doctest.testmod()

