
import os
import tempfile
import unittest
from typing import List

from transformers.models.esm.tokenization_esm import VOCAB_FILES_NAMES, EsmTokenizer
from transformers.testing_utils import require_tokenizers
from transformers.tokenization_utils import PreTrainedTokenizer
from transformers.tokenization_utils_base import PreTrainedTokenizerBase


@require_tokenizers
class   __lowerCAmelCase		(		unittest.TestCase ):



      """simple docstring"""







      A__		:     List[str]       				=      EsmTokenizer




      def 						snake_case_     ( self						:    Union[str, Any]			):
          super().setUp()
          __lowercase						:     str		      =    tempfile.mkdtemp()
          # fmt: off
          __lowercase						:     List[str]		      =    ["<cls>", "<pad>", "<eos>", "<unk>", "L", "A", "G", "V", "S", "E", "R", "T", "I", "D", "P", "K", "Q", "N", "F", "Y", "M", "H", "W", "C", "X", "B", "U", "Z", "O", ".", "-", "<null_1>", "<mask>"]  # noqa: E501
          # fmt: on
          __lowercase						:     Optional[int]		      =    os.path.join(self.tmpdirname			,    VOCAB_FILES_NAMES['''vocab_file''']			)
          with open(self.vocab_file			,    '''w'''			,    encoding='''utf-8'''			) as vocab_writer:
              vocab_writer.write(''''''.join([x + '''\n''' for x in vocab_tokens]			)			)




      def 						snake_case_     ( self						:    Optional[Any]			,    **_snake_case						:    Tuple			):
          return [self.get_tokenizer(**_snake_case			)]




      def 						snake_case_     ( self						:    int			,    **_snake_case						:    List[str]			):
          return self.tokenizer_class.from_pretrained(self.tmpdirname			,    **_snake_case			)




      def 						snake_case_     ( self						:    Tuple			):
          __lowercase						:     List[str]		      =    self.tokenizer_class(self.vocab_file			)

          __lowercase						:     str		      =    tokenizer.tokenize('''LAGVS'''			)
          self.assertListEqual(_snake_case			,    ['''L''', '''A''', '''G''', '''V''', '''S''']			)
          self.assertListEqual(tokenizer.convert_tokens_to_ids(_snake_case			)			,    [4, 5, 6, 7, 8]			)




      def 						snake_case_     ( self						:    Tuple			):
          __lowercase						:     List[Any]		      =    self.tokenizer_class(self.vocab_file			)

          __lowercase						:     Dict		      =    '''LAGVS'''
          self.assertListEqual(tokenizer.encode(_snake_case			)			,    [0, 4, 5, 6, 7, 8, 2]			)




      def 						snake_case_     ( self						:    List[str]			):
          __lowercase						:     Tuple		      =    self.tokenizer_class(self.vocab_file			)

          __lowercase						:     int		      =    ['''LAGVS''', '''WCB''']
          __lowercase						:     Dict		      =    tokenizer(_snake_case			,    padding=_snake_case			)['''input_ids''']

          self.assertListEqual(_snake_case			,    [[0, 4, 5, 6, 7, 8, 2], [0, 22, 23, 25, 2]]			)




      def 						snake_case_     ( self						:    Dict			):
          __lowercase						:     Any		      =    self.tokenizer_class(self.vocab_file			)

          __lowercase						:     Optional[int]		      =    ['''LAGVS''', '''WCB''']
          __lowercase						:     List[Any]		      =    tokenizer(_snake_case			,    padding=_snake_case			)['''input_ids''']

          self.assertListEqual(_snake_case			,    [[0, 4, 5, 6, 7, 8, 2], [0, 22, 23, 25, 2, 1, 1]]			)




      def 						snake_case_     ( self						:    Optional[int]			):
          __lowercase						:     Dict		      =    self.get_tokenizers(fast=_snake_case			)
          for tokenizer in tokenizers:
              with self.subTest(F'{tokenizer.__class__.__name__}'			):
                  __lowercase						:     Union[str, Any]		      =    '''<unk>'''
                  __lowercase						:     Tuple		      =    '''<mask>'''

                  __lowercase						:     List[str]		      =    tokenizer.tokenize(_snake_case			)
                  __lowercase						:     List[Any]		      =    tokenizer.tokenize(_snake_case			)

                  self.assertEqual(len(_snake_case			)			,    1			)
                  self.assertEqual(len(_snake_case			)			,    1			)
                  self.assertEqual(token_a[0]			,    _snake_case			)
                  self.assertEqual(token_a[0]			,    _snake_case			)




from __future__ import annotations

from collections import Counter


def       UpperCAmelCase_					(  __lowerCAmelCase		)	->  list[int]:
    __lowercase						:     Any		      =    [True] * n
    __lowercase						:     str		      =    False
    __lowercase						:     int		      =    False
    __lowercase						:     List[Any]		      =    True

    for i in range(3		,   int(n**0.5 + 1		)		,   2		):
        __lowercase						:     List[str]		      =    i * 2
        while index < n:
            __lowercase						:     List[Any]		      =    False
            __lowercase						:     Dict		      =    index + i

    __lowercase						:     Tuple		      =    [2]

    for i in range(3		,   __lowerCAmelCase		,   2		):
        if is_prime[i]:
            primes.append(__lowerCAmelCase		)

    return primes


def       UpperCAmelCase_					(  __lowerCAmelCase		)	->  list[list[int]]:
    __lowercase						:     Optional[int]		      =    str(__lowerCAmelCase		)
    __lowercase						:     List[str]		      =    []
    __lowercase						:     int		      =    ['''0''', '''1''', '''2''', '''3''', '''4''', '''5''', '''6''', '''7''', '''8''', '''9''']

    for duplicate in Counter(__lowerCAmelCase		) - Counter(set(__lowerCAmelCase		)		):
        __lowercase						:     Union[str, Any]		      =    [int(number_str.replace(__lowerCAmelCase		,   __lowerCAmelCase		)		) for digit in digits]
        replacements.append(__lowerCAmelCase		)

    return replacements


def       UpperCAmelCase_					(  __lowerCAmelCase = 8		)	->  int:
    __lowercase						:     Tuple		      =    set()

    # Filter primes with less than 3 replaceable digits
    __lowercase						:     int		      =    {
        x for x in set(prime_sieve(1_000_000		)		) if len(str(__lowerCAmelCase		)		) - len(set(str(__lowerCAmelCase		)		)		) >= 3
    }

    for prime in primes:
        if prime in numbers_checked:
            continue

        __lowercase						:     str		      =    digit_replacements(__lowerCAmelCase		)

        for family in replacements:
            numbers_checked.update(__lowerCAmelCase		)
            __lowercase						:     List[Any]		      =    primes.intersection(__lowerCAmelCase		)

            if len(__lowerCAmelCase		) != family_length:
                continue

            return min(__lowerCAmelCase		)

    return -1


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


