


from __future__ import annotations

UpperCAmelCase__   	=							[True] * 100_0001
UpperCAmelCase__   	=							2
while i * i <= 100_0000:
  if seive[i]:
    for j in range(i * i, 100_0001, i):
      UpperCAmelCase__   	=							False
  i += 1
def 				UpperCAmelCase_					(							__snake_case						)     ->			bool:







 """simple docstring"""


 return seive[n]
def 				UpperCAmelCase_					(							__snake_case						)     ->			bool:







 """simple docstring"""


 return any(digit in '''02468''' for digit in str(__snake_case						)						)
def 				UpperCAmelCase_					(							__snake_case = 1000000						)     ->			list[int]:







 """simple docstring"""


 _lowercase							      =[2]  # result already includes the number 2.
 for num in range(3     ,						limit + 1     ,						2						):
  if is_prime(__snake_case						) and not contains_an_even_digit(__snake_case						):
   _lowercase							      =str(__snake_case						)
   _lowercase							      =[int(str_num[j:] + str_num[:j]						) for j in range(len(__snake_case						)						)]
   if all(is_prime(__snake_case						) for i in list_nums						):
    result.append(__snake_case						)
 return result
def 				UpperCAmelCase_					(							)     ->			int:







 """simple docstring"""


 return len(find_circular_primes()						)


if __name__ == "__main__":
  print(f'''{len(find_circular_primes()) = }''')








"""simple docstring"""





from collections import OrderedDict
from typing import TYPE_CHECKING, Any, Mapping, Optional

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


if TYPE_CHECKING:
       from ... import FeatureExtractionMixin, TensorType

SCREAMING_SNAKE_CASE__					=   logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__					=   {
    "openai/imagegpt-small": "",
    "openai/imagegpt-medium": "",
    "openai/imagegpt-large": "",
}

class 		lowercase					(					_UpperCAmelCase					):
      _SCREAMING_SNAKE_CASE					=      'imagegpt'
      _SCREAMING_SNAKE_CASE					=      ['past_key_values']
      _SCREAMING_SNAKE_CASE					=      {
          'hidden_size': 'n_embd',
          'max_position_embeddings': 'n_positions',
          'num_attention_heads': 'n_head',
          'num_hidden_layers': 'n_layer',
      }





      def __init__(       self      ,						lowercase=512 + 1      ,						lowercase=32 * 32      ,						lowercase=512      ,						lowercase=24      ,						lowercase=8      ,						lowercase=None      ,						lowercase="quick_gelu"      ,						lowercase=0.1      ,						lowercase=0.1      ,						lowercase=0.1      ,						lowercase=1e-5      ,						lowercase=0.02      ,						lowercase=True      ,						lowercase=True      ,						lowercase=False      ,						lowercase=False      ,						lowercase=False      ,						**lowercase      ,						)		->     Any:
            lowerCAmelCase  						=       vocab_size
            lowerCAmelCase  						=       n_positions
            lowerCAmelCase  						=       n_embd
            lowerCAmelCase  						=       n_layer
            lowerCAmelCase  						=       n_head
            lowerCAmelCase  						=       n_inner
            lowerCAmelCase  						=       activation_function
            lowerCAmelCase  						=       resid_pdrop
            lowerCAmelCase  						=       embd_pdrop
            lowerCAmelCase  						=       attn_pdrop
            lowerCAmelCase  						=       layer_norm_epsilon
            lowerCAmelCase  						=       initializer_range
            lowerCAmelCase  						=       scale_attn_weights
            lowerCAmelCase  						=       use_cache
            lowerCAmelCase  						=       scale_attn_by_inverse_layer_idx
            lowerCAmelCase  						=       reorder_and_upcast_attn
            lowerCAmelCase  						=       tie_word_embeddings

            super().__init__(tie_word_embeddings=lowercase      ,						**lowercase )







class 		lowercase					(					_UpperCAmelCase					):





      @property
      def     _snake_case			(       self )		->     Mapping[str, Mapping[int, str]]:
            return OrderedDict(
                [
                    ("""input_ids""", {0: """batch""", 1: """sequence"""}),
                ] )





      def     _snake_case			(       self      ,						lowercase      ,						lowercase = 1      ,						lowercase = -1      ,						lowercase = False      ,						lowercase = None      ,						lowercase = 3      ,						lowercase = 32      ,						lowercase = 32      ,						)		->     Mapping[str, Any]:
            lowerCAmelCase  						=       self._generate_dummy_images(lowercase      ,						lowercase      ,						lowercase      ,						lowercase )
            lowerCAmelCase  						=       dict(preprocessor(images=lowercase      ,						return_tensors=lowercase ) )

            return inputs






