





'''simple docstring'''

import json
from typing import List, Optional, Tuple

from tokenizers import normalizers
from tokenizers.pre_tokenizers import BertPreTokenizer, PreTokenizer

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_roformer import RoFormerTokenizer
from .tokenization_utils import JiebaPreTokenizer


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

__lowerCamelCase : Dict											=			{"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"}

__lowerCamelCase : List[str]											=			{
    "vocab_file": {
        "junnyu/roformer_chinese_small": "https://huggingface.co/junnyu/roformer_chinese_small/resolve/main/vocab.txt",
        "junnyu/roformer_chinese_base": "https://huggingface.co/junnyu/roformer_chinese_base/resolve/main/vocab.txt",
        "junnyu/roformer_chinese_char_small": (
            "https://huggingface.co/junnyu/roformer_chinese_char_small/resolve/main/vocab.txt"
        ),
        "junnyu/roformer_chinese_char_base": (
            "https://huggingface.co/junnyu/roformer_chinese_char_base/resolve/main/vocab.txt"
        ),
        "junnyu/roformer_small_discriminator": (
            "https://huggingface.co/junnyu/roformer_small_discriminator/resolve/main/vocab.txt"
        ),
        "junnyu/roformer_small_generator": (
            "https://huggingface.co/junnyu/roformer_small_generator/resolve/main/vocab.txt"
        ),
    }
}

__lowerCamelCase : Union[str, Any]											=			{
    "junnyu/roformer_chinese_small": 1536,
    "junnyu/roformer_chinese_base": 1536,
    "junnyu/roformer_chinese_char_small": 512,
    "junnyu/roformer_chinese_char_base": 512,
    "junnyu/roformer_small_discriminator": 128,
    "junnyu/roformer_small_generator": 128,
}


__lowerCamelCase : Tuple											=			{
    "junnyu/roformer_chinese_small": {"do_lower_case": True},
    "junnyu/roformer_chinese_base": {"do_lower_case": True},
    "junnyu/roformer_chinese_char_small": {"do_lower_case": True},
    "junnyu/roformer_chinese_char_base": {"do_lower_case": True},
    "junnyu/roformer_small_discriminator": {"do_lower_case": True},
    "junnyu/roformer_small_generator": {"do_lower_case": True},
}

class       UpperCAmelCase (						_lowercase  ):
		UpperCAmelCase					:	int 			=		VOCAB_FILES_NAMES
		UpperCAmelCase					:	List[Any] 			=		PRETRAINED_VOCAB_FILES_MAP
		UpperCAmelCase					:	List[str] 			=		PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
		UpperCAmelCase					:	Union[str, Any] 			=		PRETRAINED_INIT_CONFIGURATION
		UpperCAmelCase					:	Dict 			=		RoFormerTokenizer




		def __init__(self      :	Optional[Any]							,			A__      :	Union[str, Any]=None							,			A__      :	List[str]=None							,			A__      :	Dict=True							,			A__      :	str="[UNK]"							,			A__      :	Optional[Any]="[SEP]"							,			A__      :	List[str]="[PAD]"							,			A__      :	Union[str, Any]="[CLS]"							,			A__      :	str="[MASK]"							,			A__      :	Dict=True							,			A__      :	Optional[Any]=None							,			**A__      :	Dict							,			)					-> Tuple:
						super().__init__(
						    A__							,			tokenizer_file=A__							,			do_lower_case=A__							,			unk_token=A__							,			sep_token=A__							,			pad_token=A__							,			cls_token=A__							,			mask_token=A__							,			tokenize_chinese_chars=A__							,			strip_accents=A__							,			**A__							,			)

						lowercase         = json.loads(self.backend_tokenizer.normalizer.__getstate__()				)
						if (
						    pre_tok_state.get("lowercase"							,			A__				) != do_lower_case
						    or pre_tok_state.get("strip_accents"							,			A__				) != strip_accents
						):
										lowercase         = getattr(A__							,			pre_tok_state.pop("type"				)				)
										lowercase         = do_lower_case
										lowercase         = strip_accents
										lowercase         = pre_tok_class(**A__				)

						lowercase         = do_lower_case




		def __getstate__(self      :	str				)					-> Any:
						lowercase         = self.__dict__.copy()
						lowercase         = BertPreTokenizer()
						return state




		def __setstate__(self      :	List[str]							,			A__      :	int				)					-> int:
						lowercase         = d
						lowercase         = self.__dict__["_tokenizer"].get_vocab()
						lowercase         = PreTokenizer.custom(JiebaPreTokenizer(A__				)				)




		def 				UpperCAmelCase__   (self      :	Tuple							,			A__      :	int							,			A__      :	List[str]=None				)					-> str:
						lowercase         = [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 				UpperCAmelCase__   (self      :	Tuple							,			A__      :	List[int]							,			A__      :	Optional[List[int]] = None				)					-> List[int]:
						lowercase         = [self.sep_token_id]
						lowercase         = [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      :	Optional[Any]							,			A__      :	str							,			A__      :	Optional[str] = None				)					-> Tuple[str]:
						lowercase         = self._tokenizer.model.save(A__							,			name=A__				)
						return tuple(A__				)





		def 				UpperCAmelCase__   (self      :	Any							,			A__      :	List[Any]							,			A__      :	Any=None							,			A__      :	Union[str, Any]=None							,			A__      :	Optional[Any]=False							,			**A__      :	List[str]							,			)					-> List[Any]:
						lowercase         = BertPreTokenizer()
						return super().save_pretrained(A__							,			A__							,			A__							,			A__							,			**A__				)











'''simple docstring'''

from functools import lru_cache







def 							UpperCAmelCase_    (	lowerCAmelCase_							):

				"""simple docstring"""






				lowercase         = 2
				lowercase         = set()
				while i * i <= n:
								if n % i:
												i += 1
								else:
												n //= i
												factors.add(lowerCAmelCase_							)
				if n > 1:
								factors.add(lowerCAmelCase_							)
				return factors







@lru_cache
def 							UpperCAmelCase_    (	lowerCAmelCase_							):

				"""simple docstring"""






				return len(unique_prime_factors(lowerCAmelCase_							)							)







def 							UpperCAmelCase_    (	lowerCAmelCase_							):

				"""simple docstring"""






				return len(set(lowerCAmelCase_							)							) in (0, 1)







def 							UpperCAmelCase_    (	lowerCAmelCase_							):

				"""simple docstring"""






				lowercase         = 2

				while True:
								# Increment each value of a generated range
								lowercase         = [base + i for i in range(lowerCAmelCase_							)]

								# Run elements through out unique_prime_factors function
								# Append our target number to the end.
								lowercase         = [upf_len(lowerCAmelCase_							) for x in group]
								checker.append(lowerCAmelCase_							)

								# If all numbers in the list are equal, return the group variable.
								if equality(lowerCAmelCase_							):
												return group

								# Increment our base variable by 1
								base += 1







def 							UpperCAmelCase_    (	lowerCAmelCase_ = 4							):

				"""simple docstring"""






				lowercase         = run(lowerCAmelCase_							)
				return results[0] if len(lowerCAmelCase_							) else None


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




