



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 		lowercase						( snake_case__):






	"""simple docstring"""


	a__      :					Dict		   =							VOCAB_FILES_NAMES
	a__      :					Any		   =							PRETRAINED_VOCAB_FILES_MAP
	a__      :					Optional[int]		   =							PRETRAINED_INIT_CONFIGURATION
	a__      :					Optional[Any]		   =							PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
	a__      :					Any		   =							SplinterTokenizer




	def __init__(	self	:						int						,  __UpperCAmelCase	:						Optional[int]=None						,  __UpperCAmelCase	:						Dict=None						,  __UpperCAmelCase	:						Any=True						,  __UpperCAmelCase	:						str="[UNK]"						,  __UpperCAmelCase	:						Optional[int]="[SEP]"						,  __UpperCAmelCase	:						Any="[PAD]"						,  __UpperCAmelCase	:						Any="[CLS]"						,  __UpperCAmelCase	:						Dict="[MASK]"						,  __UpperCAmelCase	:						Optional[Any]="[QUESTION]"						,  __UpperCAmelCase	:						str=True						,  __UpperCAmelCase	:						Optional[int]=None						,  **__UpperCAmelCase	:						Dict						,  )			-> Union[str, Any]:
							super().__init__(
							    __UpperCAmelCase						,  tokenizer_file=__UpperCAmelCase						,  do_lower_case=__UpperCAmelCase						,  unk_token=__UpperCAmelCase						,  sep_token=__UpperCAmelCase						,  pad_token=__UpperCAmelCase						,  cls_token=__UpperCAmelCase						,  mask_token=__UpperCAmelCase						,  tokenize_chinese_chars=__UpperCAmelCase						,  strip_accents=__UpperCAmelCase						,  additional_special_tokens=(question_token,)						,  **__UpperCAmelCase						,  )

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

							UpperCAmelCase_=   do_lower_case




	@property
	def   _SCREAMING_SNAKE_CASE		(	self	:						Union[str, Any]     )			-> int:
							return self.convert_tokens_to_ids(self.question_token     )




	def   _SCREAMING_SNAKE_CASE		(	self	:						Tuple						,  __UpperCAmelCase	:						List[int]						,  __UpperCAmelCase	:						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   _SCREAMING_SNAKE_CASE		(	self	:						Dict						,  __UpperCAmelCase	:						List[int]						,  __UpperCAmelCase	:						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   _SCREAMING_SNAKE_CASE		(	self	:						List[str]						,  __UpperCAmelCase	:						str						,  __UpperCAmelCase	:						Optional[str] = None     )			-> Tuple[str]:
							UpperCAmelCase_=   self._tokenizer.model.save(__UpperCAmelCase						,  name=__UpperCAmelCase     )
							return tuple(__UpperCAmelCase     )









def        __a     (    lowerCAmelCase_   :					int				)      -> int:






						'''simple docstring'''



						if number != int(lowerCAmelCase_				):
												raise ValueError("""factorial() only accepts integral values"""				)
						if number < 0:
												raise ValueError("""factorial() not defined for negative values"""				)
						UpperCAmelCase_=   1
						for i in range(1			,number + 1				):
												value *= i
						return value



def        __a     (    lowerCAmelCase_   :					int				)      -> int:






						'''simple docstring'''



						if not isinstance(lowerCAmelCase_			,lowerCAmelCase_				):
												raise ValueError("""factorial() only accepts integral values"""				)
						if n < 0:
												raise ValueError("""factorial() not defined for negative values"""				)
						return 1 if n == 0 or n == 1 else n * factorial(n - 1				)


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	__A				    =						int(input('''Enter a positive integer: ''').strip() or 0)
	print(f'factorial{n} is {factorial(n)}')




