





import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_convbert import ConvBertTokenizer


A   : str			=				logging.get_logger(__name__)

A   : str			=				{"""vocab_file""": """vocab.txt"""}

A   : Optional[int]			=				{
    """vocab_file""": {
        """YituTech/conv-bert-base""": """https://huggingface.co/YituTech/conv-bert-base/resolve/main/vocab.txt""",
        """YituTech/conv-bert-medium-small""": (
            """https://huggingface.co/YituTech/conv-bert-medium-small/resolve/main/vocab.txt"""
        ),
        """YituTech/conv-bert-small""": """https://huggingface.co/YituTech/conv-bert-small/resolve/main/vocab.txt""",
    }
}

A   : List[Any]			=				{
    """YituTech/conv-bert-base""": 5_1_2,
    """YituTech/conv-bert-medium-small""": 5_1_2,
    """YituTech/conv-bert-small""": 5_1_2,
}


A   : List[Any]			=				{
    """YituTech/conv-bert-base""": {"""do_lower_case""": True},
    """YituTech/conv-bert-medium-small""": {"""do_lower_case""": True},
    """YituTech/conv-bert-small""": {"""do_lower_case""": True},
}


class   A      (SCREAMING_SNAKE_CASE_   ):
			'''simple docstring'''




			__lowerCamelCase     :	List[str]          =   VOCAB_FILES_NAMES
			__lowerCamelCase     :	Tuple          =   PRETRAINED_VOCAB_FILES_MAP
			__lowerCamelCase     :	List[Any]          =   PRETRAINED_INIT_CONFIGURATION
			__lowerCamelCase     :	Any          =   PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
			__lowerCamelCase     :	Union[str, Any]          =   ConvBertTokenizer






			def __init__(      self       :   List[str]							,     __lowerCAmelCase       :   List[str]=None							,     __lowerCAmelCase       :   List[Any]=None							,     __lowerCAmelCase       :   str=True							,     __lowerCAmelCase       :   Optional[int]="[UNK]"							,     __lowerCAmelCase       :   Tuple="[SEP]"							,     __lowerCAmelCase       :   List[str]="[PAD]"							,     __lowerCAmelCase       :   List[Any]="[CLS]"							,     __lowerCAmelCase       :   List[str]="[MASK]"							,     __lowerCAmelCase       :   List[Any]=True							,     __lowerCAmelCase       :   int=None							,     **__lowerCAmelCase       :   List[str]							,     )     ->     str:







					"""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__							,     tokenize_chinese_chars=snake_case__							,     strip_accents=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        a_	(      self       :   Optional[int]							,     __lowerCAmelCase       :   str							,     __lowerCAmelCase       :   Optional[int]=None       )     ->     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        a_	(      self       :   Optional[Any]							,     __lowerCAmelCase       :   Optional[Any]							,     __lowerCAmelCase       :   Dict = None       )     ->     Optional[Any]:







					"""simple docstring"""






					A__  				=       [self.sep_token_id]
					A__  				=       [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        a_	(      self       :   List[str]							,     __lowerCAmelCase       :   str							,     __lowerCAmelCase       :   Any = None       )     ->     Tuple:







					"""simple docstring"""






					A__  				=       self._tokenizer.model.save(snake_case__							,     name=snake_case__       )
					return tuple(snake_case__       )













from string import ascii_uppercase

A   : List[str]			=				{str(ord(c) - 5_5): c for c in ascii_uppercase}







def        __lowerCamelCase (							__a       :int   ,					__a       :int   )		->    str:






		"""simple docstring"""

		if isinstance(__a   ,					__a   ):
				raise TypeError("""int() can't convert non-string with explicit base"""   )
		if num < 0:
				raise ValueError("""parameter must be positive int"""   )
		if isinstance(__a   ,					__a   ):
				raise TypeError("""'str' object cannot be interpreted as an integer"""   )
		if isinstance(__a   ,					__a   ):
				raise TypeError("""'float' object cannot be interpreted as an integer"""   )
		if base in (0, 1):
				raise ValueError("""base must be >= 2"""   )
		if base > 3_6:
				raise ValueError("""base must be <= 36"""   )
		A__  				=       """"""
		A__  				=       0
		A__  				=       0
		while div != 1:
				A__				,      A__  				=       divmod(__a   ,					__a   )
				if base >= 1_1 and 9 < mod < 3_6:
						A__  				=       ALPHABET_VALUES[str(__a   )]
				else:
						A__  				=       str(__a   )
				new_value += actual_value
				A__  				=       num // base
				A__  				=       div
				if div == 0:
						return str(new_value[::-1]   )
				elif div == 1:
						new_value += str(__a   )
						return str(new_value[::-1]   )

		return new_value[::-1]


if __name__ == "__main__":
					import doctest

					doctest.testmod()

					for base in range(2, 3_7):
										for num in range(1_0_0_0):
															assert int(decimal_to_any(num, base), base) == num, (
															    num,
															    base,
															    decimal_to_any(num, base),
															    int(decimal_to_any(num, base), base),
															)



