






'''simple docstring'''






import os
from shutil import copyfile
from typing import List, Optional, Tuple

import sentencepiece as spm

from ...tokenization_utils import PreTrainedTokenizer
from ...utils import logging


__A    	=   logging.get_logger(__name__)

__A    	=   {'''vocab_file''': '''sentencepiece.model'''}

__A    	=   {
    '''vocab_file''': {
        '''google/rembert''': '''https://huggingface.co/google/rembert/resolve/main/sentencepiece.model''',
    },
}

__A    	=   {
    '''google/rembert''': 2_5_6,
}




class a_    (    UpperCamelCase_							):
   _snake_case        =							VOCAB_FILES_NAMES
   _snake_case        =							PRETRAINED_VOCAB_FILES_MAP
   _snake_case        =							PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES







   def __init__(self					,   __a					,   __a=False					,   __a=True					,   __a=True					,   __a="[CLS]"					,   __a="[SEP]"					,   __a="[UNK]"					,   __a="[SEP]"					,   __a="[PAD]"					,   __a="[CLS]"					,   __a="[MASK]"					,   **__a					,   )			->      Optional[Any]:
      """simple docstring"""






      super().__init__(
          do_lower_case=__a					,   remove_space=__a					,   keep_accents=__a					,   bos_token=__a					,   eos_token=__a					,   unk_token=__a					,   sep_token=__a					,   pad_token=__a					,   cls_token=__a					,   mask_token=__a					,   **__a					,   )

      __snake_case				:      Optional[int]     							= do_lower_case
      __snake_case				:      Tuple     							= remove_space
      __snake_case				:      Tuple     							= keep_accents
      __snake_case				:      List[str]     							= vocab_file

      __snake_case				:      List[str]     							= spm.SentencePieceProcessor()
      self.sp_model.Load(__a)







   @property
   def     SCREAMING_SNAKE_CASE__					(self)			->      Tuple:
      """simple docstring"""






      return len(self.sp_model)







   def     SCREAMING_SNAKE_CASE__					(self)			->      Optional[int]:
      """simple docstring"""






      __snake_case				:      Union[str, Any]     							= {self.convert_ids_to_tokens(__a): i for i in range(self.vocab_size)}
      vocab.update(self.added_tokens_encoder)
      return vocab







   def __getstate__(self)			->      List[Any]:
      """simple docstring"""






      __snake_case				:      Any     							= self.__dict__.copy()
      __snake_case				:      Optional[Any]     							= None
      return state







   def __setstate__(self					,   __a)			->      Dict:
      """simple docstring"""






      __snake_case				:      Any     							= d
      __snake_case				:      List[Any]     							= spm.SentencePieceProcessor()
      self.sp_model.Load(self.vocab_file)







   def     SCREAMING_SNAKE_CASE__					(self					,   __a					,   __a=False)			->      List[str]:
      """simple docstring"""






      __snake_case				:      List[str]     							= self.sp_model.EncodeAsPieces(__a)
      return pieces







   def     SCREAMING_SNAKE_CASE__					(self					,   __a)			->      List[str]:
      """simple docstring"""






      return self.sp_model.PieceToId(__a)







   def     SCREAMING_SNAKE_CASE__					(self					,   __a)			->      Tuple:
      """simple docstring"""






      return self.sp_model.IdToPiece(__a)







   def     SCREAMING_SNAKE_CASE__					(self					,   __a)			->      Union[str, Any]:
      """simple docstring"""






      __snake_case				:      Dict     							= self.sp_model.decode_pieces(__a)
      return out_string







   def     SCREAMING_SNAKE_CASE__					(self					,   __a					,   __a = None)			->      List[int]:
      """simple docstring"""






      __snake_case				:      Any     							= [self.sep_token_id]
      __snake_case				:      Union[str, Any]     							= [self.cls_token_id]
      if token_ids_a is None:
         return cls + token_ids_a + sep
      return cls + token_ids_a + sep + token_ids_a + sep







   def     SCREAMING_SNAKE_CASE__					(self					,   __a					,   __a = None					,   __a = False)			->      List[int]:
      """simple docstring"""






      if already_has_special_tokens:
         if token_ids_a is not None:
            raise ValueError(
                'You should not supply a second sequence if the provided sequence of '
                'ids is already formatted with special tokens for the model.')
         return [1 if x in [self.sep_token_id, self.cls_token_id] else 0 for x in token_ids_a]

      if token_ids_a is not None:
         return [1] + ([0] * len(__a)) + [1] + ([0] * len(__a)) + [1]
      return [1] + ([0] * len(__a)) + [1]







   def     SCREAMING_SNAKE_CASE__					(self					,   __a					,   __a = None)			->      List[int]:
      """simple docstring"""






      __snake_case				:      List[Any]     							= [self.sep_token_id]
      __snake_case				:      str     							= [self.cls_token_id]

      if token_ids_a is None:
         return len(cls + token_ids_a + sep) * [0]
      return len(cls + token_ids_a + sep) * [0] + len(token_ids_a + sep) * [1]







   def     SCREAMING_SNAKE_CASE__					(self					,   __a					,   __a = None)			->      Tuple[str]:
      """simple docstring"""






      if not os.path.isdir(__a):
         logger.error('Vocabulary path ({}) should be a directory'.format(__a))
         return
      __snake_case				:      Optional[Any]     							= os.path.join(
          __a					,   (filename_prefix + '-' if filename_prefix else '') + VOCAB_FILES_NAMES['vocab_file'])

      if os.path.abspath(self.vocab_file) != os.path.abspath(__a):
         copyfile(self.vocab_file					,   __a)

      return (out_vocab_file,)







'''simple docstring'''






__A    	=   {str(digit): digit**5 for digit in range(1_0)}




def        _SCREAMING_SNAKE_CASE  (				A  :       int  )    -> int:







   """simple docstring"""
   return sum(DIGITS_FIFTH_POWER[digit] for digit in str(A  )  )




def        _SCREAMING_SNAKE_CASE  (				)    -> int:







   """simple docstring"""
   return sum(
       number
       for number in range(10_00  ,		1_00_00_00  )
       if number == digits_fifth_powers_sum(A  )  )


if __name__ == "__main__":
      print(solution())