



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


a_								=   logging.get_logger(__name__)

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

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

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

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




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



    '''simple docstring'''
    super().__init__(
        SCREAMING_SNAKE_CASE_		,			tokenizer_file=SCREAMING_SNAKE_CASE_		,			do_lower_case=SCREAMING_SNAKE_CASE_		,			unk_token=SCREAMING_SNAKE_CASE_		,			sep_token=SCREAMING_SNAKE_CASE_		,			pad_token=SCREAMING_SNAKE_CASE_		,			cls_token=SCREAMING_SNAKE_CASE_		,			mask_token=SCREAMING_SNAKE_CASE_		,			tokenize_chinese_chars=SCREAMING_SNAKE_CASE_		,			strip_accents=SCREAMING_SNAKE_CASE_		,			additional_special_tokens=(question_token,)		,			**SCREAMING_SNAKE_CASE_		,			)

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

    __lowerCamelCase  							=      do_lower_case




 @property
 def     lowerCamelCase (  self			):



    '''simple docstring'''
    return self.convert_tokens_to_ids(self.question_token			)




 def     lowerCamelCase (  self		,			__UpperCAmelCase		,			__UpperCAmelCase = None			):



    '''simple docstring'''






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

    __lowerCamelCase  							=      [self.cls_token_id]
    __lowerCamelCase  							=      [self.sep_token_id]
    __lowerCamelCase  							=      [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		,			__UpperCAmelCase		,			__UpperCAmelCase = None			):



    '''simple docstring'''
    __lowerCamelCase  							=      [self.sep_token_id]
    __lowerCamelCase  							=      [self.cls_token_id]
    __lowerCamelCase  							=      [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		,			__UpperCAmelCase		,			__UpperCAmelCase = None			):



    '''simple docstring'''
    __lowerCamelCase  							=      self._tokenizer.model.save(SCREAMING_SNAKE_CASE_		,			name=SCREAMING_SNAKE_CASE_			)
    return tuple(SCREAMING_SNAKE_CASE_			)











def 						a__     (						_UpperCamelCase     :	list	,_UpperCamelCase     :	list	,_UpperCamelCase     :	list	,_UpperCamelCase     :	int	,_UpperCamelCase     :	int							):
   if target == 0:
      answer.append(path.copy()							)
   else:
      for index in range(_UpperCamelCase	,len(_UpperCamelCase							)							):
         if target >= candidates[index]:
            path.append(candidates[index]							)
            backtrack(_UpperCamelCase	,_UpperCamelCase	,_UpperCamelCase	,target - candidates[index]	,_UpperCamelCase							)
            path.pop(len(_UpperCamelCase							) - 1							)





def 						a__     (						_UpperCamelCase     :	list	,_UpperCamelCase     :	int							):
   __lowerCamelCase  							=      []  # type: list[int]
   __lowerCamelCase  							=      []  # type: list[int]
   backtrack(_UpperCamelCase	,_UpperCamelCase	,_UpperCamelCase	,_UpperCamelCase	,0							)
   return answer





def 						a__     (						):
   print(combination_sum([-8, 2.3, 0]	,1							)							)


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  main()






