


lowerCAmelCase__						:List[Any]         =							(1, 1_5_3, 3_7_0, 3_7_1, 1_6_3_4, 2_4_6_7_8_0_5_1, 1_1_5_1_3_2_2_1_9_0_1_8_7_6_3_9_9_2_5_6_5_0_9_5_5_9_7_9_7_3_9_7_1_5_2_2_4_0_1)
lowerCAmelCase__						:tuple         =							(-1_5_3, -1, 0, 1.2, 2_0_0, "A", [], {}, None)

def  lowerCAmelCase__				(    a__:	int )						->	bool:


							'''simple docstring'''





							if not isinstance(a__    ,						a__ ) or n < 1:
														return False

							# Initialization of sum and number of digits.
							_UpperCAmelCase					=    0
							_UpperCAmelCase					=    0
							_UpperCAmelCase					=    n
							# Calculation of digits of the number
							while temp > 0:
														number_of_digits += 1
														temp //= 1_0
							# Dividing number into separate digits and find Armstrong number
							_UpperCAmelCase					=    n
							while temp > 0:
														_UpperCAmelCase					=    temp % 1_0
														total += rem**number_of_digits
														temp //= 1_0
							return n == total

def  lowerCAmelCase__				(    a__:	int )						->	bool:


							'''simple docstring'''





							if not isinstance(a__    ,						a__ ) or n < 1:
														return False

							# Init a "histogram" of the digits
							_UpperCAmelCase					=    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
							_UpperCAmelCase					=    0
							_UpperCAmelCase					=    0
							_UpperCAmelCase					=    n
							while temp > 0:
														_UpperCAmelCase	, _UpperCAmelCase					=    divmod(a__    ,						1_0 )
														digit_histogram[rem] += 1
														digit_total += 1

							for cnt, i in zip(a__    ,						range(len(a__ ) ) ):
														total += cnt * i**digit_total

							return n == total

def  lowerCAmelCase__				(    a__:	int )						->	bool:


							'''simple docstring'''





							if not isinstance(a__    ,						a__ ) or n < 1:
														return False
							_UpperCAmelCase					=    len(str(a__ ) )  # the power that all digits will be raised to
							# check if sum of each digit multiplied expo times is equal to number
							return n == sum(int(a__ ) ** expo for i in str(a__ ) )

def  lowerCAmelCase__				(    )						->	Optional[Any]:


							'''simple docstring'''





							_UpperCAmelCase					=    int(input('Enter an integer to see if it is an Armstrong number: ' ).strip() )
							print(F'''{num} is {"" if armstrong_number(a__ ) else "not "}an Armstrong number.''' )
							print(F'''{num} is {"" if narcissistic_number(a__ ) else "not "}an Armstrong number.''' )
							print(F'''{num} is {"" if pluperfect_number(a__ ) else "not "}an Armstrong number.''' )


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		main()




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

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


if is_sentencepiece_available():
		from .tokenization_deberta_va import DebertaVaTokenizer
else:
		lowerCAmelCase__						:int         =							None

lowerCAmelCase__						:List[str]         =							logging.get_logger(__name__)

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

lowerCAmelCase__						:List[str]         =							{
    '''vocab_file''': {
        '''microsoft/deberta-v2-xlarge''': '''https://huggingface.co/microsoft/deberta-v2-xlarge/resolve/main/spm.model''',
        '''microsoft/deberta-v2-xxlarge''': '''https://huggingface.co/microsoft/deberta-v2-xxlarge/resolve/main/spm.model''',
        '''microsoft/deberta-v2-xlarge-mnli''': (
            '''https://huggingface.co/microsoft/deberta-v2-xlarge-mnli/resolve/main/spm.model'''
        ),
        '''microsoft/deberta-v2-xxlarge-mnli''': (
            '''https://huggingface.co/microsoft/deberta-v2-xxlarge-mnli/resolve/main/spm.model'''
        ),
    }
}

lowerCAmelCase__						:List[str]         =							{
    '''microsoft/deberta-v2-xlarge''': 5_1_2,
    '''microsoft/deberta-v2-xxlarge''': 5_1_2,
    '''microsoft/deberta-v2-xlarge-mnli''': 5_1_2,
    '''microsoft/deberta-v2-xxlarge-mnli''': 5_1_2,
}

lowerCAmelCase__						:Any         =							{
    '''microsoft/deberta-v2-xlarge''': {'''do_lower_case''': False},
    '''microsoft/deberta-v2-xxlarge''': {'''do_lower_case''': False},
    '''microsoft/deberta-v2-xlarge-mnli''': {'''do_lower_case''': False},
    '''microsoft/deberta-v2-xxlarge-mnli''': {'''do_lower_case''': False},
}

class 	__a   (       UpperCAmelCase    ):
		_a			:						Tuple    			=			VOCAB_FILES_NAMES
		_a			:						int    			=			PRETRAINED_VOCAB_FILES_MAP
		_a			:						Optional[Any]    			=			PRETRAINED_INIT_CONFIGURATION
		_a			:						str    			=			PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
		_a			:						Optional[int]    			=			DebertaVaTokenizer
		def __init__(    self    ,					_SCREAMING_SNAKE_CASE=None    ,					_SCREAMING_SNAKE_CASE=None    ,					_SCREAMING_SNAKE_CASE=False    ,					_SCREAMING_SNAKE_CASE=False    ,					_SCREAMING_SNAKE_CASE="[CLS]"    ,					_SCREAMING_SNAKE_CASE="[SEP]"    ,					_SCREAMING_SNAKE_CASE="[UNK]"    ,					_SCREAMING_SNAKE_CASE="[SEP]"    ,					_SCREAMING_SNAKE_CASE="[PAD]"    ,					_SCREAMING_SNAKE_CASE="[CLS]"    ,					_SCREAMING_SNAKE_CASE="[MASK]"    ,					**_SCREAMING_SNAKE_CASE    ,					)				-> None:




									"""simple docstring"""





									super().__init__(
									    _SCREAMING_SNAKE_CASE    ,					tokenizer_file=_SCREAMING_SNAKE_CASE    ,					do_lower_case=_SCREAMING_SNAKE_CASE    ,					bos_token=_SCREAMING_SNAKE_CASE    ,					eos_token=_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    ,					split_by_punct=_SCREAMING_SNAKE_CASE    ,					**_SCREAMING_SNAKE_CASE    ,					)

									_UpperCAmelCase					=    do_lower_case
									_UpperCAmelCase					=    split_by_punct
									_UpperCAmelCase					=    vocab_file
									_UpperCAmelCase					=    False if not self.vocab_file else True
		def 			UpperCAmelCase__       (    self    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE=None		)				-> str:




									"""simple docstring"""





									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]
									return cls + token_ids_a + sep + token_ids_a + sep
		def 			UpperCAmelCase__       (    self    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE=None    ,					_SCREAMING_SNAKE_CASE=False		)				-> Any:




									"""simple docstring"""





									if already_has_special_tokens:
																return super().get_special_tokens_mask(
																    token_ids_a=_SCREAMING_SNAKE_CASE    ,					token_ids_a=_SCREAMING_SNAKE_CASE    ,					already_has_special_tokens=_SCREAMING_SNAKE_CASE		)

									if token_ids_a is not None:
																return [1] + ([0] * len(_SCREAMING_SNAKE_CASE		)) + [1] + ([0] * len(_SCREAMING_SNAKE_CASE		)) + [1]
									return [1] + ([0] * len(_SCREAMING_SNAKE_CASE		)) + [1]
		def 			UpperCAmelCase__       (    self    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE=None		)				-> Union[str, Any]:




									"""simple docstring"""





									_UpperCAmelCase					=    [self.sep_token_id]
									_UpperCAmelCase					=    [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 			UpperCAmelCase__       (    self    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE = None		)				-> Tuple[str]:




									"""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
									_UpperCAmelCase					=    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,)
