

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

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import is_sentencepiece_available, logging


if is_sentencepiece_available():
			from .tokenization_reformer import ReformerTokenizer
else:
			lowerCAmelCase__	:  Tuple 		=None


lowerCAmelCase__	:  Optional[Any] 		=logging.get_logger(__name__)


lowerCAmelCase__	:  List[Any] 		='''▁'''

lowerCAmelCase__	:  List[str] 		={'''vocab_file''': '''spiece.model''', '''tokenizer_file''': '''tokenizer.json'''}

lowerCAmelCase__	:  Union[str, Any] 		={
    '''vocab_file''': {
        '''google/reformer-crime-and-punishment''': (
            '''https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/spiece.model'''
        )
    },
    '''tokenizer_file''': {
        '''google/reformer-crime-and-punishment''': (
            '''https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/tokenizer.json'''
        )
    },
}

lowerCAmelCase__	:  Optional[int] 		={
    '''google/reformer-crime-and-punishment''': 524288,
}

class      UpperCAmelCase_						(     a__ ):

						'''simple docstring'''




						UpperCamelCase__    :				int       						=						VOCAB_FILES_NAMES
						UpperCamelCase__    :				List[Any]       						=						PRETRAINED_VOCAB_FILES_MAP
						UpperCamelCase__    :				List[Any]       						=						PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
						UpperCamelCase__    :				Union[str, Any]       						=						["input_ids", "attention_mask"]
						UpperCamelCase__    :				Optional[int]       						=						ReformerTokenizer






						def __init__(					self   ,							_A=None   ,							_A=None   ,							_A="</s>"   ,							_A="<unk>"   ,							_A=[]   ,							**_A   ,							):







													'''simple docstring'''

													super().__init__(
													    SCREAMING_SNAKE_CASE_   ,							tokenizer_file=SCREAMING_SNAKE_CASE_   ,							eos_token=SCREAMING_SNAKE_CASE_   ,							unk_token=SCREAMING_SNAKE_CASE_   ,							additional_special_tokens=SCREAMING_SNAKE_CASE_   ,							**SCREAMING_SNAKE_CASE_   ,							)

													__SCREAMING_SNAKE_CASE								=      vocab_file
													__SCREAMING_SNAKE_CASE								=      False if not self.vocab_file else True






						def  _A			(					self   ,							_A   ,							_A = None	):







													'''simple docstring'''

													if not self.can_save_slow_tokenizer:
																				raise ValueError(
																				    'Your fast tokenizer does not have the necessary information to save the vocabulary for a slow '
																				    'tokenizer.'	)

													if not os.path.isdir(SCREAMING_SNAKE_CASE_	):
																				logger.error(f"""Vocabulary path ({save_directory}) should be a directory"""	)
																				return
													__SCREAMING_SNAKE_CASE								=      os.path.join(
													    SCREAMING_SNAKE_CASE_   ,							(filename_prefix + '-' if filename_prefix else '') + VOCAB_FILES_NAMES['vocab_file']	)

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

													return (out_vocab_file,)











def 			__lowercase     (				a__							,     a__     )       ->				List[str]:
							if n == 0:
														return 1

							elif n % 2 == 1:
														return binary_exponentiation(a__							,     n - 1     ) * a

							else:
														__SCREAMING_SNAKE_CASE								=      binary_exponentiation(a__							,     n / 2     )
														return b * b


if __name__ == "__main__":
			try:
						lowerCAmelCase__	:  str 		=int(input('''Enter Base : ''').strip())
						lowerCAmelCase__	:  Optional[int] 		=int(input('''Enter Power : ''').strip())
			except ValueError:
						print('''Invalid literal for integer''')

			lowerCAmelCase__	:  Any 		=binary_exponentiation(BASE, POWER)
			print(F'''{BASE}^({POWER}) : {RESULT}''')






