






import io
import os
import unicodedata
from typing import Any, Dict, List, Optional, Tuple

import sentencepiece as spm

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


A        =   logging.get_logger(__name__)

A        =   '▁'

A        =   {'vocab_file': 'vocab.txt', 'sentencepiece_model_ckpt': 'sentencepiece.bpe.model'}

A        =   {
    'sentencepiece_model_file': 'sentencepiece.bpe.model',
    'vocab_file': 'vocab.txt',
}

A        =   {
    'vocab_file': {
        'ernie-m-base': 'https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/vocab.txt',
        'ernie-m-large': 'https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/vocab.txt',
    },
    'sentencepiece_model_file': {
        'ernie-m-base': 'https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/sentencepiece.bpe.model',
        'ernie-m-large': 'https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/sentencepiece.bpe.model',
    },
}

A        =   {
    'ernie-m-base': 514,
    'ernie-m-large': 514,
}

A        =   {
    'ernie-m-base': {'do_lower_case': False},
    'ernie-m-large': {'do_lower_case': False},
}


class 							__a							(  __A						):





		'''simple docstring'''



		UpperCAmelCase__      :				List[str]				    =						["input_ids"]

		UpperCAmelCase__      :				Dict				    =						VOCAB_FILES_NAMES
		UpperCAmelCase__      :				Tuple				    =						PRETRAINED_INIT_CONFIGURATION
		UpperCAmelCase__      :				List[str]				    =						PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
		UpperCAmelCase__      :				List[str]				    =						PRETRAINED_VOCAB_FILES_MAP
		UpperCAmelCase__      :				Tuple				    =						RESOURCE_FILES_NAMES


		def __init__(						self ,    UpperCamelCase__ ,    UpperCamelCase__=None ,    UpperCamelCase__=False ,    UpperCamelCase__="utf8" ,    UpperCamelCase__="[UNK]" ,    UpperCamelCase__="[SEP]" ,    UpperCamelCase__="[PAD]" ,    UpperCamelCase__="[CLS]" ,    UpperCamelCase__="[MASK]" ,    UpperCamelCase__ = None ,    **UpperCamelCase__ ,    ):
						# Mask token behave like a normal word, i.e. include the space before it and
						# is included in the raw text, there should be a match in a non-normalized sentence.

						SCREAMING_SNAKE_CASE_   :	Optional[int]													=   {} if sp_model_kwargs is None else sp_model_kwargs
						super().__init__(
						    do_lower_case=UpperCamelCase__ ,    unk_token=UpperCamelCase__ ,    sep_token=UpperCamelCase__ ,    pad_token=UpperCamelCase__ ,    cls_token=UpperCamelCase__ ,    mask_token=UpperCamelCase__ ,    vocab_file=UpperCamelCase__ ,    encoding=UpperCamelCase__ ,    sp_model_kwargs=self.sp_model_kwargs ,    **UpperCamelCase__ ,    )
						SCREAMING_SNAKE_CASE_   :	str													=   do_lower_case
						SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   sentencepiece_model_ckpt
						SCREAMING_SNAKE_CASE_   :	List[Any]													=   spm.SentencePieceProcessor(**self.sp_model_kwargs       )
						self.sp_model.Load(UpperCamelCase__       )

						# to mimic paddlenlp.transformers.ernie_m.tokenizer.ErnieMTokenizer functioning
						if vocab_file is not None:
										SCREAMING_SNAKE_CASE_   :	Optional[int]													=   self.load_vocab(filepath=UpperCamelCase__       )
						else:
										SCREAMING_SNAKE_CASE_   :	Dict													=   {self.sp_model.id_to_piece(UpperCamelCase__       ): id for id in range(self.sp_model.get_piece_size()       )}
						SCREAMING_SNAKE_CASE_   :	Tuple													=   {v: k for k, v in self.vocab.items()}


		def   __snake_case			(						self ,    UpperCamelCase__       ):
						if text is None:
										return None

						SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   self.tokenize(UpperCamelCase__       )
						SCREAMING_SNAKE_CASE_   :	Dict													=   '', []

						for i, ch in enumerate(UpperCamelCase__       ):
										if ch in self.SP_CHAR_MAPPING:
														SCREAMING_SNAKE_CASE_   :	Any													=   self.SP_CHAR_MAPPING.get(UpperCamelCase__       )
										else:
														SCREAMING_SNAKE_CASE_   :	Tuple													=   unicodedata.normalize('NFKC' ,    UpperCamelCase__       )
										if self.is_whitespace(UpperCamelCase__       ):
														continue
										normalized_text += ch
										char_mapping.extend([i] * len(UpperCamelCase__       )       )

						SCREAMING_SNAKE_CASE_   :	Tuple													=   normalized_text, [], 0

						if self.do_lower_case:
										SCREAMING_SNAKE_CASE_   :	int													=   text.lower()

						for token in split_tokens:
										if token[:1] == "▁":
														SCREAMING_SNAKE_CASE_   :	Dict													=   token[1:]
										SCREAMING_SNAKE_CASE_   :	List[str]													=   text[offset:].index(UpperCamelCase__       ) + offset
										SCREAMING_SNAKE_CASE_   :	Tuple													=   start + len(UpperCamelCase__       )

										token_mapping.append((char_mapping[start], char_mapping[end - 1] + 1)       )
										SCREAMING_SNAKE_CASE_   :	List[Any]													=   end
						return token_mapping


		@property
		def   __snake_case			(						self       ):
						return len(self.vocab       )


		def   __snake_case			(						self       ):
						return dict(self.vocab ,    **self.added_tokens_encoder       )


		def __getstate__(						self       ):
						SCREAMING_SNAKE_CASE_   :	Optional[int]													=   self.__dict__.copy()
						SCREAMING_SNAKE_CASE_   :	int													=   None
						return state


		def __setstate__(						self ,    UpperCamelCase__       ):
						SCREAMING_SNAKE_CASE_   :	List[Any]													=   d

						# for backward compatibility
						if not hasattr(self ,    'sp_model_kwargs'       ):
										SCREAMING_SNAKE_CASE_   :	Tuple													=   {}

						SCREAMING_SNAKE_CASE_   :	List[str]													=   spm.SentencePieceProcessor(**self.sp_model_kwargs       )
						self.sp_model.Load(self.sentencepiece_model_ckpt       )


		def   __snake_case			(						self ,    UpperCamelCase__       ):
						return "".join((self.SP_CHAR_MAPPING.get(UpperCamelCase__ ,    UpperCamelCase__       ) for c in text)       )


		def   __snake_case			(						self ,    UpperCamelCase__ ,    UpperCamelCase__=False ,    UpperCamelCase__=64 ,    UpperCamelCase__=0.1       ):

						if self.sp_model_kwargs.get('enable_sampling'       ) is True:
										SCREAMING_SNAKE_CASE_   :	int													=   True
						if self.sp_model_kwargs.get('alpha'       ) is not None:
										SCREAMING_SNAKE_CASE_   :	Tuple													=   self.sp_model_kwargs.get('alpha'       )
						if self.sp_model_kwargs.get('nbest_size'       ) is not None:
										SCREAMING_SNAKE_CASE_   :	Dict													=   self.sp_model_kwargs.get('nbest_size'       )

						if not enable_sampling:
										SCREAMING_SNAKE_CASE_   :	Optional[int]													=   self.sp_model.EncodeAsPieces(UpperCamelCase__       )
						else:
										SCREAMING_SNAKE_CASE_   :	Dict													=   self.sp_model.SampleEncodeAsPieces(UpperCamelCase__ ,    UpperCamelCase__ ,    UpperCamelCase__       )
						SCREAMING_SNAKE_CASE_   :	Any													=   []
						for pi, piece in enumerate(UpperCamelCase__       ):
										if piece == SPIECE_UNDERLINE:
														if not pieces[pi + 1].startswith(UpperCamelCase__       ) and pi != 0:
																		new_pieces.append(UpperCamelCase__       )
																		continue
														else:
																		continue
										SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   0
										for i, chunk in enumerate(UpperCamelCase__       ):
														if chunk == SPIECE_UNDERLINE:
																		continue
														if self.is_ch_char(UpperCamelCase__       ) or self.is_punct(UpperCamelCase__       ):
																		if i > lst_i and piece[lst_i:i] != SPIECE_UNDERLINE:
																						new_pieces.append(piece[lst_i:i]       )
																		new_pieces.append(UpperCamelCase__       )
																		SCREAMING_SNAKE_CASE_   :	List[Any]													=   i + 1
														elif chunk.isdigit() and i > 0 and not piece[i - 1].isdigit():
																		if i > lst_i and piece[lst_i:i] != SPIECE_UNDERLINE:
																						new_pieces.append(piece[lst_i:i]       )
																		SCREAMING_SNAKE_CASE_   :	str													=   i
														elif not chunk.isdigit() and i > 0 and piece[i - 1].isdigit():
																		if i > lst_i and piece[lst_i:i] != SPIECE_UNDERLINE:
																						new_pieces.append(piece[lst_i:i]       )
																		SCREAMING_SNAKE_CASE_   :	List[Any]													=   i
										if len(UpperCamelCase__       ) > lst_i:
														new_pieces.append(piece[lst_i:]       )
						return new_pieces


		def   __snake_case			(						self ,    UpperCamelCase__       ):
						SCREAMING_SNAKE_CASE_   :	Optional[int]													=   ''.join(UpperCamelCase__       ).replace(UpperCamelCase__ ,    ' '       ).strip()
						return out_string


		def   __snake_case			(						self ,    UpperCamelCase__       ):
						SCREAMING_SNAKE_CASE_   :	Dict													=   self.convert_ids_to_tokens(UpperCamelCase__       )
						SCREAMING_SNAKE_CASE_   :	int													=   ''.join(UpperCamelCase__       ).replace(UpperCamelCase__ ,    ' '       ).strip()
						return out_string


		def   __snake_case			(						self ,    UpperCamelCase__       ):
						return self.vocab.get(UpperCamelCase__ ,    self.vocab.get(self.unk_token       )       )


		def   __snake_case			(						self ,    UpperCamelCase__       ):
						return self.reverse_vocab.get(UpperCamelCase__ ,    self.unk_token       )


		def   __snake_case			(						self ,    UpperCamelCase__ ,    UpperCamelCase__=None       ):
						if token_ids_a is None:
										return [self.cls_token_id] + token_ids_a + [self.sep_token_id]
						SCREAMING_SNAKE_CASE_   :	Optional[int]													=   [self.cls_token_id]
						SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   [self.sep_token_id]
						return _cls + token_ids_a + _sep + _sep + token_ids_a + _sep


		def   __snake_case			(						self ,    UpperCamelCase__ ,    UpperCamelCase__=None       ):
						if offset_mapping_a is None:
										return [(0, 0)] + offset_mapping_a + [(0, 0)]

						return [(0, 0)] + offset_mapping_a + [(0, 0), (0, 0)] + offset_mapping_a + [(0, 0)]


		def   __snake_case			(						self ,    UpperCamelCase__ ,    UpperCamelCase__=None ,    UpperCamelCase__=False       ):

						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(UpperCamelCase__       )) + [1, 1] + ([0] * len(UpperCamelCase__       )) + [1]
						return [1] + ([0] * len(UpperCamelCase__       )) + [1]


		def   __snake_case			(						self ,    UpperCamelCase__ ,    UpperCamelCase__ = None       ):
						# called when `add_special_tokens` is True, so align with `build_inputs_with_special_tokens` method
						if token_ids_a is None:
										# [CLS] X [SEP]
										return (len(UpperCamelCase__       ) + 2) * [0]

						# [CLS] A [SEP] [SEP] B [SEP]
						return [0] * (len(UpperCamelCase__       ) + 1) + [1] * (len(UpperCamelCase__       ) + 3)


		def   __snake_case			(						self ,    UpperCamelCase__       ):
						if "\u4e00" <= char <= "\u9fff":
										return True
						return False


		def   __snake_case			(						self ,    UpperCamelCase__       ):
						if ("a" <= char <= "z") or ("A" <= char <= "Z"):
										return True
						return False


		def   __snake_case			(						self ,    UpperCamelCase__       ):
						if char in ",;:.?!~，；：。？！《》【】":
										return True
						return False


		def   __snake_case			(						self ,    UpperCamelCase__       ):
						if char == " " or char == "\t" or char == "\n" or char == "\r":
										return True
						if len(UpperCamelCase__       ) == 1:
										SCREAMING_SNAKE_CASE_   :	int													=   unicodedata.category(UpperCamelCase__       )
										if cat == "Zs":
														return True
						return False


		def   __snake_case			(						self ,    UpperCamelCase__       ):
						SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   {}
						with io.open(UpperCamelCase__ ,    'r' ,    encoding='utf-8'       ) as f:
										for index, line in enumerate(UpperCamelCase__       ):
														SCREAMING_SNAKE_CASE_   :	Union[str, Any]													=   line.rstrip('\n'       )
														SCREAMING_SNAKE_CASE_   :	Tuple													=   int(UpperCamelCase__       )

						return token_to_idx






		def   __snake_case			(						self ,    UpperCamelCase__ ,    UpperCamelCase__ = None       ):
						SCREAMING_SNAKE_CASE_   :	Union[str, Any]													=   0
						if os.path.isdir(UpperCamelCase__       ):
										SCREAMING_SNAKE_CASE_   :	int													=   os.path.join(
										    UpperCamelCase__ ,    (filename_prefix + '-' if filename_prefix else '') + VOCAB_FILES_NAMES['vocab_file']       )
						else:
										SCREAMING_SNAKE_CASE_   :	List[Any]													=   (filename_prefix + '-' if filename_prefix else '') + save_directory
						with open(UpperCamelCase__ ,    'w' ,    encoding='utf-8'       ) as writer:
										for token, token_index in sorted(self.vocab.items() ,    key=lambda UpperCamelCase__       : kv[1]       ):
														if index != token_index:
																		logger.warning(
																		    F'''Saving vocabulary to {vocab_file}: vocabulary indices are not consecutive.'''
																		    ' Please check that the vocabulary is not corrupted!'       )
																		SCREAMING_SNAKE_CASE_   :	str													=   token_index
														writer.write(token + '\n'       )
														index += 1

						SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   os.path.join(UpperCamelCase__ ,    'sentencepiece.bpe.model'       )
						with open(UpperCamelCase__ ,    'wb'       ) as fi:
										SCREAMING_SNAKE_CASE_   :	int													=   self.sp_model.serialized_model_proto()
										fi.write(UpperCamelCase__       )

						return (vocab_file,)







from math import sqrt



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ) and (
				    number >= 0
				), "'number' must been an int and positive"

				SCREAMING_SNAKE_CASE_   :	Dict													=   True

				# 0 and 1 are none primes.
				if number <= 1:
								SCREAMING_SNAKE_CASE_   :	Optional[int]													=   False

				for divisor in range(2    ,    int(round(sqrt(lowerCAmelCase__      )      )      ) + 1      ):
								# if 'number' divisible by 'divisor' then sets 'status'
								# of false and break up the loop.
								if number % divisor == 0:
												SCREAMING_SNAKE_CASE_   :	Dict													=   False
												break

    # precondition
				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ), "'status' must been from type bool"

				return status



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ) and (n > 2), "'N' must been an int and > 2"

				# beginList: contains all natural numbers from 2 up to N
				SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   list(range(2    ,    n + 1      )      )

				SCREAMING_SNAKE_CASE_   :	Any													=   []  # this list will be returns.

				# actual sieve of erathostenes
				for i in range(len(lowerCAmelCase__      )      ):
								for j in range(i + 1    ,    len(lowerCAmelCase__      )      ):
												if (begin_list[i] != 0) and (begin_list[j] % begin_list[i] == 0):
																SCREAMING_SNAKE_CASE_   :	str													=   0

    # filters actual prime numbers.
				SCREAMING_SNAKE_CASE_   :	int													=   [x for x in begin_list if x != 0]

				# precondition
				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ), "'ans' must been from type list"

				return ans



def 					_lowerCamelCase(			lowerCAmelCase__				:		List[str]      ):





				'''simple docstring'''







				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ) and (n > 2), "'N' must been an int and > 2"

				SCREAMING_SNAKE_CASE_   :	int													=   []

				# iterates over all numbers between 2 up to N+1
				# if a number is prime then appends to list 'ans'
				for number in range(2    ,    n + 1      ):
								if is_prime(lowerCAmelCase__      ):
												ans.append(lowerCAmelCase__      )

    # precondition
				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ), "'ans' must been from type list"

				return ans



def 					_lowerCamelCase(			lowerCAmelCase__				:		Union[str, Any]      ):





				'''simple docstring'''







				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ) and number >= 0, "'number' must been an int and >= 0"

				SCREAMING_SNAKE_CASE_   :	Optional[int]													=   []  # this list will be returns of the function.

				# potential prime number factors.

				SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   2

				SCREAMING_SNAKE_CASE_   :	List[Any]													=   number

				if number == 0 or number == 1:
								ans.append(lowerCAmelCase__      )

				# if 'number' not prime then builds the prime factorization of 'number'
				elif not is_prime(lowerCAmelCase__      ):
								while quotient != 1:
												if is_prime(lowerCAmelCase__      ) and (quotient % factor == 0):
																ans.append(lowerCAmelCase__      )
																quotient /= factor
												else:
																factor += 1

				else:
								ans.append(lowerCAmelCase__      )

				# precondition
				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ), "'ans' must been from type list"

				return ans



def 					_lowerCamelCase(			lowerCAmelCase__				:		Any      ):





				'''simple docstring'''







				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ) and (
				    number >= 0
				), "'number' bust been an int and >= 0"

				SCREAMING_SNAKE_CASE_   :	int													=   0

				# prime factorization of 'number'
				SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   prime_factorization(lowerCAmelCase__      )

				SCREAMING_SNAKE_CASE_   :	Dict													=   max(lowerCAmelCase__      )

				# precondition
				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ), "'ans' must been from type int"

				return ans



def 					_lowerCamelCase(			lowerCAmelCase__				:		Optional[Any]      ):





				'''simple docstring'''







				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ) and (
				    number >= 0
				), "'number' bust been an int and >= 0"

				SCREAMING_SNAKE_CASE_   :	Optional[int]													=   0

				# prime factorization of 'number'
				SCREAMING_SNAKE_CASE_   :	Union[str, Any]													=   prime_factorization(lowerCAmelCase__      )

				SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   min(lowerCAmelCase__      )

				# precondition
				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ), "'ans' must been from type int"

				return ans



def 					_lowerCamelCase(			lowerCAmelCase__				:		Optional[int]      ):





				'''simple docstring'''







				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ), "'number' must been an int"
				assert isinstance(number % 2 == 0    ,    lowerCAmelCase__      ), "compare bust been from type bool"

				return number % 2 == 0



def 					_lowerCamelCase(			lowerCAmelCase__				:		Optional[int]      ):





				'''simple docstring'''







				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ), "'number' must been an int"
				assert isinstance(number % 2 != 0    ,    lowerCAmelCase__      ), "compare bust been from type bool"

				return number % 2 != 0



def 					_lowerCamelCase(			lowerCAmelCase__				:		Optional[Any]      ):





				'''simple docstring'''







				assert (
				    isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ) and (number > 2) and is_even(lowerCAmelCase__      )
				), "'number' must been an int, even and > 2"

				SCREAMING_SNAKE_CASE_   :	Any													=   []  # this list will returned

				# creates a list of prime numbers between 2 up to 'number'
				SCREAMING_SNAKE_CASE_   :	int													=   get_prime_numbers(lowerCAmelCase__      )
				SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   len(lowerCAmelCase__      )

				# run variable for while-loops.
				SCREAMING_SNAKE_CASE_   :	Any													=   0
				SCREAMING_SNAKE_CASE_   :	List[str]													=   None

				# exit variable. for break up the loops
				SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   True

				while i < len_pn and loop:
								SCREAMING_SNAKE_CASE_   :	Optional[int]													=   i + 1

								while j < len_pn and loop:
												if prime_numbers[i] + prime_numbers[j] == number:
																SCREAMING_SNAKE_CASE_   :	List[str]													=   False
																ans.append(prime_numbers[i]      )
																ans.append(prime_numbers[j]      )

												j += 1

								i += 1

				# precondition
				assert (
				    isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      )
				    and (len(lowerCAmelCase__      ) == 2)
				    and (ans[0] + ans[1] == number)
				    and is_prime(ans[0]      )
				    and is_prime(ans[1]      )
				), "'ans' must contains two primes. And sum of elements must been eq 'number'"

				return ans



def 					_lowerCamelCase(			lowerCAmelCase__				:		str    ,    lowerCAmelCase__				:		List[Any]      ):





				'''simple docstring'''







				assert (
				    isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      )
				    and isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      )
				    and (numbera >= 0)
				    and (numbera >= 0)
				), "'number1' and 'number2' must been positive integer."

				SCREAMING_SNAKE_CASE_   :	int													=   0

				while numbera != 0:
								SCREAMING_SNAKE_CASE_   :	List[str]													=   numbera % numbera
								SCREAMING_SNAKE_CASE_   :	Optional[int]													=   numbera
								SCREAMING_SNAKE_CASE_   :	List[Any]													=   rest

				# precondition
				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ) and (
				    numbera >= 0
				), "'number' must been from type int and positive"

				return numbera



def 					_lowerCamelCase(			lowerCAmelCase__				:		int    ,    lowerCAmelCase__				:		Optional[Any]      ):





				'''simple docstring'''







				assert (
				    isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      )
				    and isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      )
				    and (numbera >= 1)
				    and (numbera >= 1)
				), "'number1' and 'number2' must been positive integer."

				SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   1  # actual answer that will be return.

				# for kgV (x,1)
				if numbera > 1 and numbera > 1:
								# builds the prime factorization of 'number1' and 'number2'
								SCREAMING_SNAKE_CASE_   :	Tuple													=   prime_factorization(lowerCAmelCase__      )
								SCREAMING_SNAKE_CASE_   :	List[Any]													=   prime_factorization(lowerCAmelCase__      )

				elif numbera == 1 or numbera == 1:
								SCREAMING_SNAKE_CASE_   :	List[Any]													=   []
								SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   []
								SCREAMING_SNAKE_CASE_   :	int													=   max(lowerCAmelCase__    ,    lowerCAmelCase__      )

				SCREAMING_SNAKE_CASE_   :	Union[str, Any]													=   0
				SCREAMING_SNAKE_CASE_   :	Any													=   0

				SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   []  # captured numbers int both 'primeFac1' and 'primeFac2'

				# iterates through primeFac1
				for n in prime_fac_a:
								if n not in done:
												if n in prime_fac_a:
																SCREAMING_SNAKE_CASE_   :	int													=   prime_fac_a.count(lowerCAmelCase__      )
																SCREAMING_SNAKE_CASE_   :	Tuple													=   prime_fac_a.count(lowerCAmelCase__      )

																for _ in range(max(lowerCAmelCase__    ,    lowerCAmelCase__      )      ):
																				ans *= n

												else:
																SCREAMING_SNAKE_CASE_   :	List[Any]													=   prime_fac_a.count(lowerCAmelCase__      )

																for _ in range(lowerCAmelCase__      ):
																				ans *= n

												done.append(lowerCAmelCase__      )

    # iterates through primeFac2
				for n in prime_fac_a:
								if n not in done:
												SCREAMING_SNAKE_CASE_   :	int													=   prime_fac_a.count(lowerCAmelCase__      )

												for _ in range(lowerCAmelCase__      ):
																ans *= n

												done.append(lowerCAmelCase__      )

    # precondition
				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ) and (
				    ans >= 0
				), "'ans' must been from type int and positive"

				return ans



def 					_lowerCamelCase(			lowerCAmelCase__				:		Any      ):





				'''simple docstring'''







				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ) and (n >= 0), "'number' must been a positive int"

				SCREAMING_SNAKE_CASE_   :	Optional[int]													=   0
				SCREAMING_SNAKE_CASE_   :	Optional[int]													=   2  # this variable holds the answer

				while index < n:
								index += 1

								ans += 1  # counts to the next number

								# if ans not prime then
								# runs to the next prime number.
								while not is_prime(lowerCAmelCase__      ):
												ans += 1

    # precondition
				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ) and is_prime(
				    lowerCAmelCase__      ), "'ans' must been a prime number and from type int"

				return ans



def 					_lowerCamelCase(			lowerCAmelCase__				:		List[str]    ,    lowerCAmelCase__				:		Optional[int]      ):





				'''simple docstring'''







				assert (
				    is_prime(lowerCAmelCase__      ) and is_prime(lowerCAmelCase__      ) and (p_number_a < p_number_a)
				), "The arguments must been prime numbers and 'pNumber1' < 'pNumber2'"

				SCREAMING_SNAKE_CASE_   :	str													=   p_number_a + 1  # jump to the next number

				SCREAMING_SNAKE_CASE_   :	List[Any]													=   []  # this list will be returns.

				# if number is not prime then
				# fetch the next prime number.
				while not is_prime(lowerCAmelCase__      ):
								number += 1

				while number < p_number_a:
								ans.append(lowerCAmelCase__      )

								number += 1

								# fetch the next prime number.
								while not is_prime(lowerCAmelCase__      ):
												number += 1

    # precondition
				assert (
				    isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      )
				    and ans[0] != p_number_a
				    and ans[len(lowerCAmelCase__      ) - 1] != p_number_a
				), "'ans' must been a list without the arguments"

				# 'ans' contains not 'pNumber1' and 'pNumber2' !
				return ans



def 					_lowerCamelCase(			lowerCAmelCase__				:		Optional[Any]      ):





				'''simple docstring'''







				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ) and (n >= 1), "'n' must been int and >= 1"

				SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   []  # will be returned.

				for divisor in range(1    ,    n + 1      ):
								if n % divisor == 0:
												ans.append(lowerCAmelCase__      )

    # precondition
				assert ans[0] == 1 and ans[len(lowerCAmelCase__      ) - 1] == n, "Error in function getDivisiors(...)"

				return ans



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ) and (
				    number > 1
				), "'number' must been an int and >= 1"

				SCREAMING_SNAKE_CASE_   :	int													=   get_divisors(lowerCAmelCase__      )

				# precondition
				assert (
				    isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      )
				    and (divisors[0] == 1)
				    and (divisors[len(lowerCAmelCase__      ) - 1] == number)
				), "Error in help-function getDivisiors(...)"

				# summed all divisors up to 'number' (exclusive), hence [:-1]
				return sum(divisors[:-1]      ) == number



def 					_lowerCamelCase(			lowerCAmelCase__				:		Dict    ,    lowerCAmelCase__				:		str      ):





				'''simple docstring'''







				assert (
				    isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      )
				    and isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      )
				    and (denominator != 0)
				), "The arguments must been from type int and 'denominator' != 0"

				# build the greatest common divisor of numerator and denominator.
				SCREAMING_SNAKE_CASE_   :	str													=   gcd(abs(lowerCAmelCase__      )    ,    abs(lowerCAmelCase__      )      )

				# precondition
				assert (
				    isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      )
				    and (numerator % gcd_of_fraction == 0)
				    and (denominator % gcd_of_fraction == 0)
				), "Error in function gcd(...,...)"

				return (numerator // gcd_of_fraction, denominator // gcd_of_fraction)



def 					_lowerCamelCase(			lowerCAmelCase__				:		Tuple      ):





				'''simple docstring'''







				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ) and (n >= 0), "'n' must been a int and >= 0"

				SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   1  # this will be return.

				for factor in range(1    ,    n + 1      ):
								ans *= factor

				return ans



def 					_lowerCamelCase(			lowerCAmelCase__				:		Tuple      ):





				'''simple docstring'''







				assert isinstance(lowerCAmelCase__    ,    lowerCAmelCase__      ) and (n >= 0), "'n' must been an int and >= 0"

				SCREAMING_SNAKE_CASE_   :	List[Any]													=   0
				SCREAMING_SNAKE_CASE_   :	Union[str, Any]													=   1
				SCREAMING_SNAKE_CASE_   :	int													=   1  # this will be return

				for _ in range(n - 1      ):
								SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   ans
								ans += fiba
								SCREAMING_SNAKE_CASE_   :	List[str]													=   tmp

				return ans