"""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       :    int         =		logging.get_logger(__name__)

__UpperCamelCase       :    Any         =		{"vocab_file": "vocab.txt"}

__UpperCamelCase       :    str         =		{
    "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       :    Optional[Any]         =		{
    "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   UpperCAmelCase_	(				_lowercase   ):
    snake_case_											=      VOCAB_FILES_NAMES
    snake_case_											=      PRETRAINED_VOCAB_FILES_MAP
    snake_case_											=      PRETRAINED_INIT_CONFIGURATION
    snake_case_											=      PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
    snake_case_											=      SplinterTokenizer
    def __init__(	self			:       List[Any]   ,						_lowercase			:       Dict=None   ,						_lowercase			:       Optional[Any]=None   ,						_lowercase			:       Any=True   ,						_lowercase			:       Any="[UNK]"   ,						_lowercase			:       str="[SEP]"   ,						_lowercase			:       Dict="[PAD]"   ,						_lowercase			:       int="[CLS]"   ,						_lowercase			:       int="[MASK]"   ,						_lowercase			:       Union[str, Any]="[QUESTION]"   ,						_lowercase			:       List[str]=True   ,						_lowercase			:       List[str]=None   ,						**_lowercase			:       List[str]   ,						)						->    Any:
       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 		_lowerCamelCase      (	self			:       Union[str, Any]		)						->    Tuple:
       return self.convert_tokens_to_ids(self.question_token		)
    def 		_lowerCamelCase      (	self			:       List[str]   ,						_lowercase			:       Union[str, Any]   ,						_lowercase			:       Optional[int] = None		)						->    List[int]:
       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 		_lowerCamelCase      (	self			:       str   ,						_lowercase			:       str   ,						_lowercase			:       Optional[Any] = None		)						->    List[int]:
       _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 		_lowerCamelCase      (	self			:       str   ,						_lowercase			:       Any   ,						_lowercase			:       Union[str, Any] = None		)						->    Tuple[str]:
       _lowercase							     =       self._tokenizer.model.save(__lowerCAmelCase   ,						name=__lowerCAmelCase		)
       return tuple(__lowerCAmelCase		)






def      a    (   _lowercase :  Dict			,    _lowercase :  List[str]							)  ->List[Any]:
		if len(str(_lowercase							)							) == 1 or len(str(_lowercase							)							) == 1:
				return a * b

		UpperCamelCase__								=						max(len(str(_lowercase							)							)			,    len(str(_lowercase							)							)							)
		UpperCamelCase__								=						ma // 2

		UpperCamelCase__	,      UpperCamelCase__								=						divmod(_lowercase			,    1_0**ma							)
		UpperCamelCase__	,      UpperCamelCase__								=						divmod(_lowercase			,    1_0**ma							)

		UpperCamelCase__								=						karatsuba(_lowercase			,    _lowercase							)
		UpperCamelCase__								=						karatsuba((aa + aa)			,    (ba + ba)							)
		UpperCamelCase__								=						karatsuba(_lowercase			,    _lowercase							)

		return (z * 1_0 ** (2 * ma)) + ((y - z - x) * 1_0 ** (ma)) + (x)

def      a    (   )  ->List[Any]:
		print(karatsuba(1_5_4_6_3			,    2_3_4_8_9							)							)


if __name__ == "__main__":
				main()





