





'''simple docstring'''




import itertools
import math






def        _lowerCAmelCase			(  __snake_case  : int			)     ->     bool:

     if 1 < number < 4:
          # 2 and 3 are primes
          return True
     elif number < 2 or number % 2 == 0 or number % 3 == 0:
          # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
          return False

     # All primes number are in format of 6k +/- 1
     for i in range(5 ,							int(math.sqrt(__snake_case			) + 1			) ,							6			):
          if number % i == 0 or number % (i + 2) == 0:
               return False
     return True






def        _lowerCAmelCase			(  )     ->     int:
     __A						: Optional[Any]      =       2
     while True:
          if is_prime(__snake_case			):
               yield num
          num += 1






def        _lowerCAmelCase			(  __snake_case  : int = 1_00_01			)     ->     int:
     return next(itertools.islice(prime_generator() ,							nth - 1 ,							__snake_case			)			)


if __name__ == "__main__":
  print(f"""{solution() = }""")






'''simple docstring'''




import json
from typing import Iterator, List, Union

from tokenizers import AddedToken, Regex, Tokenizer, decoders, normalizers, pre_tokenizers, trainers
from tokenizers.implementations.base_tokenizer import BaseTokenizer
from tokenizers.models import Unigram
from tokenizers.processors import TemplateProcessing


class  SCREAMING_SNAKE_CASE    (a__							):


     def __init__(						self						,	_UpperCAmelCase = "▁"						,	_UpperCAmelCase = True						,	_UpperCAmelCase = "<unk>"						,	_UpperCAmelCase = "</s>"						,	_UpperCAmelCase = "<pad>"						,	):

          '''simple docstring'''






          __A						: Dict      =       {
              'pad': {'id': 0, 'token': pad_token},
              'eos': {'id': 1, 'token': eos_token},
              'unk': {'id': 2, 'token': unk_token},
          }

          __A						: List[Any]      =       [None] * len(self.special_tokens)
          for token_dict in self.special_tokens.values():
               __A						: List[str]      =       token_dict['token']

          __A						: str      =       Tokenizer(Unigram())

          __A						: Dict      =       normalizers.Sequence(
              [
                  normalizers.Nmt(),
                  normalizers.NFKC(),
                  normalizers.Replace(Regex(' {2,}')						,	' '),
                  normalizers.Lowercase(),
              ])
          __A						: Union[str, Any]      =       pre_tokenizers.Sequence(
              [
                  pre_tokenizers.Metaspace(replacement=_UpperCAmelCase						,	add_prefix_space=_UpperCAmelCase),
                  pre_tokenizers.Digits(individual_digits=_UpperCAmelCase),
                  pre_tokenizers.Punctuation(),
              ])
          __A						: Any      =       decoders.Metaspace(replacement=_UpperCAmelCase						,	add_prefix_space=_UpperCAmelCase)

          __A						: Dict      =       TemplateProcessing(
              single=F'$A {self.special_tokens["eos"]["token"]}'						,	special_tokens=[(self.special_tokens['eos']['token'], self.special_tokens['eos']['id'])]						,	)

          __A						: Any      =       {
              'model': 'SentencePieceUnigram',
              'replacement': replacement,
              'add_prefix_space': add_prefix_space,
          }

          super().__init__(_UpperCAmelCase						,	_UpperCAmelCase)


     def 							SCREAMING_SNAKE_CASE  (						self						,	_UpperCAmelCase						,	_UpperCAmelCase = 8000						,	_UpperCAmelCase = True						,	):

          '''simple docstring'''






          __A						: str      =       trainers.UnigramTrainer(
              vocab_size=_UpperCAmelCase						,	special_tokens=self.special_tokens_list						,	show_progress=_UpperCAmelCase						,	)

          if isinstance(_UpperCAmelCase						,	_UpperCAmelCase):
               __A						: Union[str, Any]      =       [files]
          self._tokenizer.train(_UpperCAmelCase						,	trainer=_UpperCAmelCase)

          self.add_unk_id()


     def 							SCREAMING_SNAKE_CASE  (						self						,	_UpperCAmelCase						,	_UpperCAmelCase = 8000						,	_UpperCAmelCase = True						,	):

          '''simple docstring'''






          __A						: Dict      =       trainers.UnigramTrainer(
              vocab_size=_UpperCAmelCase						,	special_tokens=self.special_tokens_list						,	show_progress=_UpperCAmelCase						,	)

          self._tokenizer.train_from_iterator(_UpperCAmelCase						,	trainer=_UpperCAmelCase)

          self.add_unk_id()


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						: Any      =       json.loads(self._tokenizer.to_str())

          __A						: Union[str, Any]      =       self.special_tokens['unk']['id']

          __A						: str      =       Tokenizer.from_str(json.dumps(_UpperCAmelCase))