


import json
from typing import List, Optional, Tuple

from tokenizers import pre_tokenizers, processors

from ...tokenization_utils_base import AddedToken, BatchEncoding
from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_mvp import MvpTokenizer


_A		:				Optional[int]									=       logging.get_logger(__name__)


_A		:				Any									=       {'''vocab_file''': '''vocab.json''', '''merges_file''': '''merges.txt''', '''tokenizer_file''': '''tokenizer.json'''}

# See all MVP models at https://huggingface.co/models?filter=mvp
_A		:				List[Any]									=       {
    '''vocab_file''': {
        '''RUCAIBox/mvp''': '''https://huggingface.co/RUCAIBox/mvp/resolve/main/vocab.json''',
    },
    '''added_tokens.json''': {
        '''RUCAIBox/mvp''': '''https://huggingface.co/RUCAIBox/mvp/resolve/main/added_tokens.json''',
    },
    '''merges_file''': {
        '''RUCAIBox/mvp''': '''https://huggingface.co/RUCAIBox/mvp/resolve/main/merges.txt''',
    },
    '''tokenizer_file''': {
        '''RUCAIBox/mvp''': '''https://huggingface.co/RUCAIBox/mvp/resolve/main/tokenizer.json''',
    },
}

_A		:				Any									=       {
    '''RUCAIBox/mvp''': 1_024,
}



class        a					(			_UpperCAmelCase   ):
     UpperCAmelCase__ :  Tuple						      =	VOCAB_FILES_NAMES
     UpperCAmelCase__ :  str						      =	PRETRAINED_VOCAB_FILES_MAP
     UpperCAmelCase__ :  Optional[int]						      =	PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
     UpperCAmelCase__ :  List[Any]						      =	["input_ids", "attention_mask"]
     UpperCAmelCase__ :  str						      =	MvpTokenizer





     def __init__(    self					:				Union[str, Any]    ,	SCREAMING_SNAKE_CASE_					:				Dict=None    ,	SCREAMING_SNAKE_CASE_					:				Any=None    ,	SCREAMING_SNAKE_CASE_					:				str=None    ,	SCREAMING_SNAKE_CASE_					:				Optional[Any]="replace"    ,	SCREAMING_SNAKE_CASE_					:				Tuple="<s>"    ,	SCREAMING_SNAKE_CASE_					:				Union[str, Any]="</s>"    ,	SCREAMING_SNAKE_CASE_					:				Optional[int]="</s>"    ,	SCREAMING_SNAKE_CASE_					:				List[Any]="<s>"    ,	SCREAMING_SNAKE_CASE_					:				Union[str, Any]="<unk>"    ,	SCREAMING_SNAKE_CASE_					:				Optional[Any]="<pad>"    ,	SCREAMING_SNAKE_CASE_					:				int="<mask>"    ,	SCREAMING_SNAKE_CASE_					:				List[str]=False    ,	SCREAMING_SNAKE_CASE_					:				List[str]=True    ,	**SCREAMING_SNAKE_CASE_					:				List[Any]    ,	):
        super().__init__(
            SCREAMING_SNAKE_CASE_    ,	SCREAMING_SNAKE_CASE_    ,	tokenizer_file=SCREAMING_SNAKE_CASE_    ,	errors=SCREAMING_SNAKE_CASE_    ,	bos_token=SCREAMING_SNAKE_CASE_    ,	eos_token=SCREAMING_SNAKE_CASE_    ,	sep_token=SCREAMING_SNAKE_CASE_    ,	cls_token=SCREAMING_SNAKE_CASE_    ,	unk_token=SCREAMING_SNAKE_CASE_    ,	pad_token=SCREAMING_SNAKE_CASE_    ,	mask_token=SCREAMING_SNAKE_CASE_    ,	add_prefix_space=SCREAMING_SNAKE_CASE_    ,	trim_offsets=SCREAMING_SNAKE_CASE_    ,	**SCREAMING_SNAKE_CASE_    ,	)

        __lowerCamelCase:				Optional[Any]     =	json.loads(self.backend_tokenizer.pre_tokenizer.__getstate__()							)
        if pre_tok_state.get("""add_prefix_space"""    ,	SCREAMING_SNAKE_CASE_							) != add_prefix_space:
           __lowerCamelCase:				List[Any]     =	getattr(SCREAMING_SNAKE_CASE_    ,	pre_tok_state.pop("""type"""							)							)
           __lowerCamelCase:				Any     =	add_prefix_space
           __lowerCamelCase:				str     =	pre_tok_class(**SCREAMING_SNAKE_CASE_							)

        __lowerCamelCase:				Union[str, Any]     =	add_prefix_space

        # the pre_tokenizer is already updated in the GPT2TokenizerFast `__init__`
        __lowerCamelCase:				str     =	"""post_processor"""
        __lowerCamelCase:				str     =	getattr(self.backend_tokenizer    ,	SCREAMING_SNAKE_CASE_    ,	SCREAMING_SNAKE_CASE_							)
        if tokenizer_component_instance:
           __lowerCamelCase:				Optional[int]     =	json.loads(tokenizer_component_instance.__getstate__()							)

           # The lists 'sep' and 'cls' must be cased in tuples for the object `post_processor_class`
           if "sep" in state:
              __lowerCamelCase:				str     =	tuple(state["""sep"""]							)
           if "cls" in state:
              __lowerCamelCase:				int     =	tuple(state["""cls"""]							)

           __lowerCamelCase:				List[Any]     =	False

           if state.get("""add_prefix_space"""    ,	SCREAMING_SNAKE_CASE_							) != add_prefix_space:
              __lowerCamelCase:				Any     =	add_prefix_space
              __lowerCamelCase:				Tuple     =	True

           if state.get("""trim_offsets"""    ,	SCREAMING_SNAKE_CASE_							) != trim_offsets:
              __lowerCamelCase:				Optional[Any]     =	trim_offsets
              __lowerCamelCase:				Optional[Any]     =	True

           if changes_to_apply:
              __lowerCamelCase:				Tuple     =	getattr(SCREAMING_SNAKE_CASE_    ,	state.pop("""type"""							)							)
              __lowerCamelCase:				List[Any]     =	component_class(**SCREAMING_SNAKE_CASE_							)
              setattr(self.backend_tokenizer    ,	SCREAMING_SNAKE_CASE_    ,	SCREAMING_SNAKE_CASE_							)





     @property
     def  SCREAMING_SNAKE_CASE__       (    self					:				Optional[Any]							):
        if self._mask_token is None:
           if self.verbose:
              logger.error("""Using mask_token, but it is not set yet."""							)
           return None
        return str(self._mask_token							)





     @mask_token.setter
     def  SCREAMING_SNAKE_CASE__       (    self					:				Optional[int]    ,	SCREAMING_SNAKE_CASE_					:				List[Any]							):
        __lowerCamelCase:				List[Any]     =	AddedToken(SCREAMING_SNAKE_CASE_    ,	lstrip=SCREAMING_SNAKE_CASE_    ,	rstrip=SCREAMING_SNAKE_CASE_							) if isinstance(SCREAMING_SNAKE_CASE_    ,	SCREAMING_SNAKE_CASE_							) else value
        __lowerCamelCase:				int     =	value





     def  SCREAMING_SNAKE_CASE__       (    self					:				List[Any]    ,	*SCREAMING_SNAKE_CASE_					:				Optional[int]    ,	**SCREAMING_SNAKE_CASE_					:				Dict							):
        __lowerCamelCase:				Union[str, Any]     =	kwargs.get("""is_split_into_words"""    ,	SCREAMING_SNAKE_CASE_							)

        if is_split_into_words and not self.add_prefix_space:
           raise ValueError(
               F'You need to instantiate {self.__class__.__name__} with add_prefix_space=True '
               """to use it with pretokenized inputs."""							)

        return super()._batch_encode_plus(*SCREAMING_SNAKE_CASE_    ,	**SCREAMING_SNAKE_CASE_							)





     def  SCREAMING_SNAKE_CASE__       (    self					:				Tuple    ,	*SCREAMING_SNAKE_CASE_					:				Union[str, Any]    ,	**SCREAMING_SNAKE_CASE_					:				Tuple							):
        __lowerCamelCase:				Union[str, Any]     =	kwargs.get("""is_split_into_words"""    ,	SCREAMING_SNAKE_CASE_							)

        if is_split_into_words and not self.add_prefix_space:
           raise ValueError(
               F'You need to instantiate {self.__class__.__name__} with add_prefix_space=True '
               """to use it with pretokenized inputs."""							)

        return super()._encode_plus(*SCREAMING_SNAKE_CASE_    ,	**SCREAMING_SNAKE_CASE_							)





     def  SCREAMING_SNAKE_CASE__       (    self					:				List[str]    ,	SCREAMING_SNAKE_CASE_					:				str    ,	SCREAMING_SNAKE_CASE_					:				Optional[str] = None							):
        __lowerCamelCase:				Any     =	self._tokenizer.model.save(SCREAMING_SNAKE_CASE_    ,	name=SCREAMING_SNAKE_CASE_							)
        return tuple(SCREAMING_SNAKE_CASE_							)





     def  SCREAMING_SNAKE_CASE__       (    self					:				Union[str, Any]    ,	SCREAMING_SNAKE_CASE_					:				str    ,	SCREAMING_SNAKE_CASE_					:				Tuple=None							):
        __lowerCamelCase:				Union[str, Any]     =	[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  SCREAMING_SNAKE_CASE__       (    self					:				Tuple    ,	SCREAMING_SNAKE_CASE_					:				List[int]    ,	SCREAMING_SNAKE_CASE_					:				Optional[List[int]] = None							):
        __lowerCamelCase:				int     =	[self.sep_token_id]
        __lowerCamelCase:				List[str]     =	[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]






def     __lowerCAmelCase						(							)       ->							Optional[Any]:
   __lowerCamelCase:				List[str]     =	[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

   __lowerCamelCase:				List[str]     =	6
   __lowerCamelCase:				Optional[int]     =	1
   __lowerCamelCase:				int     =	1901

   __lowerCamelCase:				Tuple     =	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
            __lowerCamelCase:				Union[str, Any]     =	day - days_per_month[month - 2]
         elif day > 29 and month == 2:
            month += 1
            __lowerCamelCase:				List[Any]     =	day - 29
      else:
         if day > days_per_month[month - 1]:
            month += 1
            __lowerCamelCase:				Any     =	day - days_per_month[month - 2]

      if month > 12:
         year += 1
         __lowerCamelCase:				Dict     =	1

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


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


