

'''simple docstring'''



from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding

class 			SCREAMING_SNAKE_CASE					(							lowercase_					):






      '''simple docstring'''






      SCREAMING_SNAKE_CASE__ :				List[str]    =				['''image_processor''', '''tokenizer''']
      SCREAMING_SNAKE_CASE__ :				str    =				'''EfficientNetImageProcessor'''
      SCREAMING_SNAKE_CASE__ :				List[str]    =				('''BertTokenizer''', '''BertTokenizerFast''')




      def __init__(					self :		Tuple     ,					snake_case :		List[str]     ,					snake_case :		Union[str, Any]   ):



          """simple docstring"""





          super().__init__(snake_case     ,					snake_case   )




      def __call__(					self :		List[Any]     ,					snake_case :		List[Any]=None     ,					snake_case :		Any=None     ,					snake_case :		Any="max_length"     ,					snake_case :		List[Any]=64     ,					snake_case :		Optional[Any]=None     ,					**snake_case :		List[str]   ):



          """simple docstring"""





          if text is None and images is None:
              raise ValueError('You have to specify either text or images. Both cannot be none.'   )

          if text is not None:
              _snake_case : Dict												=		self.tokenizer(
                  snake_case     ,					padding=snake_case     ,					max_length=snake_case     ,					return_tensors=snake_case     ,					**snake_case   )

          if images is not None:
              _snake_case : str												=		self.image_processor(snake_case     ,					return_tensors=snake_case     ,					**snake_case   )

          if text is not None and images is not None:
              _snake_case : Union[str, Any]												=		image_features.pixel_values
              return encoding
          elif text is not None:
              return encoding
          else:
              return BatchEncoding(data=dict(**snake_case   )     ,					tensor_type=snake_case   )




      def 	__UpperCAmelCase			(					self :		List[Any]     ,					*snake_case :		Optional[int]     ,					**snake_case :		Optional[int]   ):



          """simple docstring"""





          return self.tokenizer.batch_decode(*snake_case     ,					**snake_case   )




      def 	__UpperCAmelCase			(					self :		Optional[Any]     ,					*snake_case :		Tuple     ,					**snake_case :		Union[str, Any]   ):



          """simple docstring"""





          return self.tokenizer.decode(*snake_case     ,					**snake_case   )




      @property
      def 	__UpperCAmelCase			(					self :		Union[str, Any]   ):



          """simple docstring"""





          _snake_case : Optional[int]												=		self.tokenizer.model_input_names
          _snake_case : Optional[int]												=		self.image_processor.model_input_names
          return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names   )   )






'''simple docstring'''



from __future__ import annotations

from collections import Counter

def   lowerCamelCase__       (      a__)		->    list[int]:



    """simple docstring"""







    _snake_case : Optional[int]												=		[True] * n
    _snake_case : List[str]												=		False
    _snake_case : int												=		False
    _snake_case : Tuple												=		True

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

    _snake_case : List[str]												=		[2]

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

    return primes

def   lowerCamelCase__       (      a__)		->    list[list[int]]:



    """simple docstring"""







    _snake_case : Tuple												=		str(a__)
    _snake_case : str												=		[]
    _snake_case : Union[str, Any]												=		['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']

    for duplicate in Counter(a__) - Counter(set(a__)):
        _snake_case : List[Any]												=		[int(number_str.replace(a__			,      a__)) for digit in digits]
        replacements.append(a__)

    return replacements

def   lowerCamelCase__       (      a__ = 8)		->    int:



    """simple docstring"""







    _snake_case : Any												=		set()

    # Filter primes with less than 3 replaceable digits
    _snake_case : List[Any]												=		{
        x for x in set(prime_sieve(1_0_0_0_0_0_0)) if len(str(a__)) - len(set(str(a__))) >= 3
    }

    for prime in primes:
        if prime in numbers_checked:
            continue

        _snake_case : int												=		digit_replacements(a__)

        for family in replacements:
            numbers_checked.update(a__)
            _snake_case : Union[str, Any]												=		primes.intersection(a__)

            if len(a__) != family_length:
                continue

            return min(a__)

    return -1


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



