




import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_funnel import FunnelTokenizer


lowercase__				:      Optional[int]	   = logging.get_logger(__name__)

lowercase__				:      str	   = {"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"}

lowercase__				:      Dict	   = [
    "small",
    "small-base",
    "medium",
    "medium-base",
    "intermediate",
    "intermediate-base",
    "large",
    "large-base",
    "xlarge",
    "xlarge-base",
]

lowercase__				:      int	   = {
    "vocab_file": {
        "funnel-transformer/small": "https://huggingface.co/funnel-transformer/small/resolve/main/vocab.txt",
        "funnel-transformer/small-base": "https://huggingface.co/funnel-transformer/small-base/resolve/main/vocab.txt",
        "funnel-transformer/medium": "https://huggingface.co/funnel-transformer/medium/resolve/main/vocab.txt",
        "funnel-transformer/medium-base": (
            "https://huggingface.co/funnel-transformer/medium-base/resolve/main/vocab.txt"
        ),
        "funnel-transformer/intermediate": (
            "https://huggingface.co/funnel-transformer/intermediate/resolve/main/vocab.txt"
        ),
        "funnel-transformer/intermediate-base": (
            "https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/vocab.txt"
        ),
        "funnel-transformer/large": "https://huggingface.co/funnel-transformer/large/resolve/main/vocab.txt",
        "funnel-transformer/large-base": "https://huggingface.co/funnel-transformer/large-base/resolve/main/vocab.txt",
        "funnel-transformer/xlarge": "https://huggingface.co/funnel-transformer/xlarge/resolve/main/vocab.txt",
        "funnel-transformer/xlarge-base": (
            "https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/vocab.txt"
        ),
    },
    "tokenizer_file": {
        "funnel-transformer/small": "https://huggingface.co/funnel-transformer/small/resolve/main/tokenizer.json",
        "funnel-transformer/small-base": (
            "https://huggingface.co/funnel-transformer/small-base/resolve/main/tokenizer.json"
        ),
        "funnel-transformer/medium": "https://huggingface.co/funnel-transformer/medium/resolve/main/tokenizer.json",
        "funnel-transformer/medium-base": (
            "https://huggingface.co/funnel-transformer/medium-base/resolve/main/tokenizer.json"
        ),
        "funnel-transformer/intermediate": (
            "https://huggingface.co/funnel-transformer/intermediate/resolve/main/tokenizer.json"
        ),
        "funnel-transformer/intermediate-base": (
            "https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/tokenizer.json"
        ),
        "funnel-transformer/large": "https://huggingface.co/funnel-transformer/large/resolve/main/tokenizer.json",
        "funnel-transformer/large-base": (
            "https://huggingface.co/funnel-transformer/large-base/resolve/main/tokenizer.json"
        ),
        "funnel-transformer/xlarge": "https://huggingface.co/funnel-transformer/xlarge/resolve/main/tokenizer.json",
        "funnel-transformer/xlarge-base": (
            "https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/tokenizer.json"
        ),
    },
}
lowercase__				:      Tuple	   = {F'funnel-transformer/{name}': 512 for name in _model_names}
lowercase__				:      Optional[Any]	   = {F'funnel-transformer/{name}': {"do_lower_case": True} for name in _model_names}




class       a__	( A__				):
     a		:      str		 =     VOCAB_FILES_NAMES
     a		:      Any		 =     PRETRAINED_VOCAB_FILES_MAP
     a		:      List[Any]		 =     PRETRAINED_INIT_CONFIGURATION
     a		:      Dict		 =     FunnelTokenizer
     a		:      List[Any]		 =     PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
     a		:      List[str]		 =     2







     def __init__(     self  ,		A=None  ,		A=None  ,		A=True  ,		A="<unk>"  ,		A="<sep>"  ,		A="<pad>"  ,		A="<cls>"  ,		A="<mask>"  ,		A="<s>"  ,		A="</s>"  ,		A=True  ,		A=True  ,		A=None  ,		A="##"  ,		**A  ,		)  ->   Optional[Any]:



          '''simple docstring'''



          super().__init__(
              __snake_case  ,		tokenizer_file=__snake_case  ,		do_lower_case=__snake_case  ,		unk_token=__snake_case  ,		sep_token=__snake_case  ,		pad_token=__snake_case  ,		cls_token=__snake_case  ,		mask_token=__snake_case  ,		bos_token=__snake_case  ,		eos_token=__snake_case  ,		clean_text=__snake_case  ,		tokenize_chinese_chars=__snake_case  ,		strip_accents=__snake_case  ,		wordpieces_prefix=__snake_case  ,		**__snake_case  ,		)

          a     =				json.loads(self.backend_tokenizer.normalizer.__getstate__()			)
          if (
              normalizer_state.get("lowercase"  ,		__snake_case			) != do_lower_case
              or normalizer_state.get("strip_accents"  ,		__snake_case			) != strip_accents
              or normalizer_state.get("handle_chinese_chars"  ,		__snake_case			) != tokenize_chinese_chars
          ):
               a     =				getattr(__snake_case  ,		normalizer_state.pop("type"			)			)
               a     =				do_lower_case
               a     =				strip_accents
               a     =				tokenize_chinese_chars
               a     =				normalizer_class(**__snake_case			)

          a     =				do_lower_case







     def       lowerCAmelCase_    (     self  ,		A  ,		A=None			)  ->   List[str]:



          '''simple docstring'''



          a     =				[self.cls_token_id] + token_ids_a + [self.sep_token_id]

          if token_ids_a:
               output += token_ids_a + [self.sep_token_id]

          return output







     def       lowerCAmelCase_    (     self  ,		A  ,		A = None			)  ->   List[int]:



          '''simple docstring'''



          a     =				[self.sep_token_id]
          a     =				[self.cls_token_id]
          if token_ids_a is None:
               return len(cls			) * [self.cls_token_type_id] + len(token_ids_a + sep			) * [0]
          return len(cls			) * [self.cls_token_type_id] + len(token_ids_a + sep			) * [0] + len(token_ids_a + sep			) * [1]







     def       lowerCAmelCase_    (     self  ,		A  ,		A = None			)  ->   Tuple[str]:



          '''simple docstring'''



          a     =				self._tokenizer.model.save(__snake_case  ,		name=__snake_case			)
          return tuple(__snake_case			)











def  SCREAMING_SNAKE_CASE							(       __UpperCamelCase)      ->					int:
     return 1 if digit in (0, 1) else (digit * factorial(digit - 1))

def  SCREAMING_SNAKE_CASE							(       __UpperCamelCase)      ->					bool:
     a     =				0
     a     =				number
     while duplicate > 0:
          a  ,				a     =				divmod(__UpperCamelCase		, 10)
          fact_sum += factorial(__UpperCamelCase)
     return fact_sum == number


if __name__ == "__main__":
   print("Program to check whether a number is a Krisnamurthy Number or not.")
   lowercase__				:      str	   = int(input("Enter number: ").strip())
   print(
       F'{number} is {"" if krishnamurthy(number) else "not "}a Krishnamurthy Number.'
   )

