

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


lowerCAmelCase__							=			logging.get_logger(__name__)

lowerCAmelCase__							=			{"vocab_file": "vocab.txt"}

lowerCAmelCase__							=			{
    "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",
    }
}

lowerCAmelCase__							=			{
    "tau/splinter-base": 512,
    "tau/splinter-base-qass": 512,
    "tau/splinter-large": 512,
    "tau/splinter-large-qass": 512,
}

lowerCAmelCase__							=			{
    "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     __magic_name__     (							_snake_case     ):
 UpperCAmelCase				     =    VOCAB_FILES_NAMES
 UpperCAmelCase				     =    PRETRAINED_VOCAB_FILES_MAP
 UpperCAmelCase				     =    PRETRAINED_INIT_CONFIGURATION
 UpperCAmelCase				     =    PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
 UpperCAmelCase				     =    SplinterTokenizer


 def __init__(    self		:			List[Any]      ,    lowerCAmelCase__		:			List[str]=None      ,    lowerCAmelCase__		:			List[Any]=None      ,    lowerCAmelCase__		:			Tuple=True      ,    lowerCAmelCase__		:			int="[UNK]"      ,    lowerCAmelCase__		:			Dict="[SEP]"      ,    lowerCAmelCase__		:			Optional[Any]="[PAD]"      ,    lowerCAmelCase__		:			Tuple="[CLS]"      ,    lowerCAmelCase__		:			Tuple="[MASK]"      ,    lowerCAmelCase__		:			Optional[int]="[QUESTION]"      ,    lowerCAmelCase__		:			Any=True      ,    lowerCAmelCase__		:			Tuple=None      ,    **lowerCAmelCase__		:			List[str]      ,    )     ->   int:
   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__      ,    )

   UpperCAmelCase          =	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
   ):
     UpperCAmelCase          =	getattr(lowerCAmelCase__      ,    pre_tok_state.pop("type"     )     )
     UpperCAmelCase          =	do_lower_case
     UpperCAmelCase          =	strip_accents
     UpperCAmelCase          =	pre_tok_class(**lowerCAmelCase__     )

   UpperCAmelCase          =	do_lower_case


 @property
 def _UpperCamelCase						(    self		:			Optional[int]     )     ->   Dict:
   return self.convert_tokens_to_ids(self.question_token     )


 def _UpperCamelCase						(    self		:			Optional[int]      ,    lowerCAmelCase__		:			List[int]      ,    lowerCAmelCase__		:			Optional[List[int]] = None     )     ->   List[int]:
   if token_ids_a is None:
     return [self.cls_token_id] + token_ids_a + [self.sep_token_id]

   UpperCAmelCase          =	[self.cls_token_id]
   UpperCAmelCase          =	[self.sep_token_id]
   UpperCAmelCase          =	[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		:			Optional[int]      ,    lowerCAmelCase__		:			List[int]      ,    lowerCAmelCase__		:			Optional[List[int]] = None     )     ->   List[int]:
   UpperCAmelCase          =	[self.sep_token_id]
   UpperCAmelCase          =	[self.cls_token_id]
   UpperCAmelCase          =	[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		:			Optional[int]      ,    lowerCAmelCase__		:			str      ,    lowerCAmelCase__		:			Optional[str] = None     )     ->   Tuple[str]:
   UpperCAmelCase          =	self._tokenizer.model.save(lowerCAmelCase__      ,    name=lowerCAmelCase__     )
   return tuple(lowerCAmelCase__     )






def   _lowerCAmelCase(						):

  for a in range(300      ):
    for b in range(a + 1 ,							400      ):
      for c in range(b + 1 ,							500      ):
        if (a + b + c) == 1000 and (a**2) + (b**2) == (c**2):
          return a * b * c

  return -1
def   _lowerCAmelCase(						):

  for a in range(300      ):
    for b in range(400      ):
      UpperCAmelCase          =	1000 - a - b
      if a < b < c and (a**2) + (b**2) == (c**2):
        return a * b * c

  return -1
def   _lowerCAmelCase(						):
  import timeit

  print(
      timeit.timeit("solution()" ,							setup="from __main__ import solution" ,							number=1000      )      )
  print(
      timeit.timeit(
          "solution_fast()" ,							setup="from __main__ import solution_fast" ,							number=1000      )      )


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



