





'''simple docstring'''



import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_splinter import SplinterTokenizer


_SCREAMING_SNAKE_CASE    =			logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE    =			{'''vocab_file''': '''vocab.txt'''}

_SCREAMING_SNAKE_CASE    =			{
    '''vocab_file''': {
        '''tau/splinter-base''': '''https://huggingface.co/tau/splinter-base/resolve/main/vocab.txt''',
        '''tau/splinter-base-qass''': '''https://huggingface.co/tau/splinter-base-qass/resolve/main/vocab.txt''',
        '''tau/splinter-large''': '''https://huggingface.co/tau/splinter-large/resolve/main/vocab.txt''',
        '''tau/splinter-large-qass''': '''https://huggingface.co/tau/splinter-large-qass/resolve/main/vocab.txt''',
    }
}

_SCREAMING_SNAKE_CASE    =			{
    '''tau/splinter-base''': 5_1_2,
    '''tau/splinter-base-qass''': 5_1_2,
    '''tau/splinter-large''': 5_1_2,
    '''tau/splinter-large-qass''': 5_1_2,
}

_SCREAMING_SNAKE_CASE    =			{
    '''tau/splinter-base''': {'''do_lower_case''': False},
    '''tau/splinter-base-qass''': {'''do_lower_case''': False},
    '''tau/splinter-large''': {'''do_lower_case''': False},
    '''tau/splinter-large-qass''': {'''do_lower_case''': False},
}






class 							__lowercase				(					lowerCAmelCase__  ):







	'''simple docstring'''

	a			: Optional[Any]      =				VOCAB_FILES_NAMES
	a			: Dict      =				PRETRAINED_VOCAB_FILES_MAP
	a			: Optional[Any]      =				PRETRAINED_INIT_CONFIGURATION
	a			: Tuple      =				PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
	a			: Tuple      =				SplinterTokenizer


	def __init__(self   ,_lowerCamelCase=None   ,_lowerCamelCase=None   ,_lowerCamelCase=True   ,_lowerCamelCase="[UNK]"   ,_lowerCamelCase="[SEP]"   ,_lowerCamelCase="[PAD]"   ,_lowerCamelCase="[CLS]"   ,_lowerCamelCase="[MASK]"   ,_lowerCamelCase="[QUESTION]"   ,_lowerCamelCase=True   ,_lowerCamelCase=None   ,**_lowerCamelCase   ,)							->							List[Any]:







				'''simple docstring'''





				super().__init__(
				    _lowerCamelCase   ,tokenizer_file=_lowerCamelCase   ,do_lower_case=_lowerCamelCase   ,unk_token=_lowerCamelCase   ,sep_token=_lowerCamelCase   ,pad_token=_lowerCamelCase   ,cls_token=_lowerCamelCase   ,mask_token=_lowerCamelCase   ,tokenize_chinese_chars=_lowerCamelCase   ,strip_accents=_lowerCamelCase   ,additional_special_tokens=(question_token,)   ,**_lowerCamelCase   ,)

				__lowercase   =							json.loads(self.backend_tokenizer.normalizer.__getstate__()       )
				if (
				    pre_tok_state.get('''lowercase'''   ,_lowerCamelCase       ) != do_lower_case
				    or pre_tok_state.get('''strip_accents'''   ,_lowerCamelCase       ) != strip_accents
				):
							__lowercase   =							getattr(_lowerCamelCase   ,pre_tok_state.pop('''type'''       )       )
							__lowercase   =							do_lower_case
							__lowercase   =							strip_accents
							__lowercase   =							pre_tok_class(**_lowerCamelCase       )

				__lowercase   =							do_lower_case


	@property
	def   _UpperCAmelCase   (self       )							->							int:







				'''simple docstring'''





				return self.convert_tokens_to_ids(self.question_token       )


	def   _UpperCAmelCase   (self   ,_lowerCamelCase   ,_lowerCamelCase = None       )							->							List[int]:







				'''simple docstring'''





				if token_ids_a is None:
							return [self.cls_token_id] + token_ids_a + [self.sep_token_id]

				__lowercase   =							[self.cls_token_id]
				__lowercase   =							[self.sep_token_id]
				__lowercase   =							[self.question_token_id] + [self.convert_tokens_to_ids('''.'''       )]
				if self.padding_side == "right":
							# Input is question-then-context
							return cls + token_ids_a + question_suffix + sep + token_ids_a + sep
				else:
							# Input is context-then-question
							return cls + token_ids_a + sep + token_ids_a + question_suffix + sep


	def   _UpperCAmelCase   (self   ,_lowerCamelCase   ,_lowerCamelCase = None       )							->							List[int]:







				'''simple docstring'''





				__lowercase   =							[self.sep_token_id]
				__lowercase   =							[self.cls_token_id]
				__lowercase   =							[self.question_token_id] + [self.convert_tokens_to_ids('''.'''       )]
				if token_ids_a is None:
							return len(cls + token_ids_a + sep       ) * [0]

				if self.padding_side == "right":
							# Input is question-then-context
							return len(cls + token_ids_a + question_suffix + sep       ) * [0] + len(token_ids_a + sep       ) * [1]
				else:
							# Input is context-then-question
							return len(cls + token_ids_a + sep       ) * [0] + len(token_ids_a + question_suffix + sep       ) * [1]


	def   _UpperCAmelCase   (self   ,_lowerCamelCase   ,_lowerCamelCase = None       )							->							Tuple[str]:







				'''simple docstring'''





				__lowercase   =							self._tokenizer.model.save(_lowerCamelCase   ,name=_lowerCamelCase       )
				return tuple(_lowerCamelCase       )







"""simple docstring"""


def     _lowerCamelCase(__UpperCamelCase = 4000000       )				-> int:
	_lowerCAmelCase								=1
	_lowerCAmelCase								=2
	_lowerCAmelCase								=0
	while j <= n:
		if j % 2 == 0:
			total += j
		_lowerCAmelCase						,							_lowerCAmelCase								=j, i + j

	return total


if __name__ == "__main__":
			print(F"""{solution() = }""")



