





'''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


UpperCAmelCase       :		Tuple		=				logging.get_logger(__name__)

UpperCAmelCase       :		str		=				{'vocab_file': 'vocab.txt'}

UpperCAmelCase       :		Union[str, Any]		=				{
    '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',
    }
}

UpperCAmelCase       :		List[Any]		=				{
    '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,
}

UpperCAmelCase       :		int		=				{
    '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 lowerCamelCase    (a__       ):
  _lowercase	:						Optional[Any]							       =					VOCAB_FILES_NAMES
  _lowercase	:						Union[str, Any]							       =					PRETRAINED_VOCAB_FILES_MAP
  _lowercase	:						Dict							       =					PRETRAINED_INIT_CONFIGURATION
  _lowercase	:						List[Any]							       =					PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  _lowercase	:						Union[str, Any]							       =					SplinterTokenizer







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






        """simple docstring"""





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

        _snake_case		:						Dict         =  json.loads(self.backend_tokenizer.normalizer.__getstate__()		)
        if (
            pre_tok_state.get('''lowercase'''  ,  lowercase__		) != do_lower_case
            or pre_tok_state.get('''strip_accents'''  ,  lowercase__		) != strip_accents
        ):
              _snake_case		:						Union[str, Any]         =  getattr(lowercase__  ,  pre_tok_state.pop('''type'''		)		)
              _snake_case		:						Any         =  do_lower_case
              _snake_case		:						str         =  strip_accents
              _snake_case		:						Optional[int]         =  pre_tok_class(**lowercase__		)

        _snake_case		:						List[str]         =  do_lower_case







  @property
  def 					UpperCAmelCase_					(		self		)		->    Tuple:






        """simple docstring"""





        return self.convert_tokens_to_ids(self.question_token		)







  def 					UpperCAmelCase_					(		self  ,  lowercase__  ,  lowercase__ = None		)		->    List[int]:






        """simple docstring"""





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

        _snake_case		:						Dict         =  [self.cls_token_id]
        _snake_case		:						Dict         =  [self.sep_token_id]
        _snake_case		:						List[Any]         =  [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  ,  lowercase__  ,  lowercase__ = None		)		->    List[int]:






        """simple docstring"""





        _snake_case		:						str         =  [self.sep_token_id]
        _snake_case		:						Union[str, Any]         =  [self.cls_token_id]
        _snake_case		:						Tuple         =  [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  ,  lowercase__  ,  lowercase__ = None		)		->    Tuple[str]:






        """simple docstring"""





        _snake_case		:						Optional[Any]         =  self._tokenizer.model.save(lowercase__  ,  name=lowercase__		)
        return tuple(lowercase__		)









'''simple docstring'''

def  _a     (				lowerCAmelCase_ = 4_000_000						):





      """simple docstring"""



      _snake_case		:						Optional[int]         =  1
      _snake_case		:						Tuple         =  2
      _snake_case		:						Optional[Any]         =  0
      while j <= n:
            if j % 2 == 0:
                  total += j
            _snake_case  ,				_snake_case		:						str         =  j, i + j

      return total


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


