





"""simple docstring"""
from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


lowerCamelCase_          =	logging.get_logger(__name__)

lowerCamelCase_          =	{
    "facebook/convnext-tiny-224": "https://huggingface.co/facebook/convnext-tiny-224/resolve/main/config.json",
    # See all ConvNeXT models at https://huggingface.co/models?filter=convnext
}






class       _SCREAMING_SNAKE_CASE(     A					,			A						):
       SCREAMING_SNAKE_CASE_     :   Any					=						'''convnext'''




       def __init__(		self	,SCREAMING_SNAKE_CASE__=3	,SCREAMING_SNAKE_CASE__=4	,SCREAMING_SNAKE_CASE__=4	,SCREAMING_SNAKE_CASE__=None	,SCREAMING_SNAKE_CASE__=None	,SCREAMING_SNAKE_CASE__="gelu"	,SCREAMING_SNAKE_CASE__=0.0_2	,SCREAMING_SNAKE_CASE__=1E-12	,SCREAMING_SNAKE_CASE__=1E-6	,SCREAMING_SNAKE_CASE__=0.0	,SCREAMING_SNAKE_CASE__=2_24	,SCREAMING_SNAKE_CASE__=None	,SCREAMING_SNAKE_CASE__=None	,**SCREAMING_SNAKE_CASE__	,)    ->   Tuple:





             """simple docstring"""






             super().__init__(**SCREAMING_SNAKE_CASE__							)

             __SCREAMING_SNAKE_CASE     :Optional[int]	       =						num_channels
             __SCREAMING_SNAKE_CASE     :Any	       =						patch_size
             __SCREAMING_SNAKE_CASE     :int	       =						num_stages
             __SCREAMING_SNAKE_CASE     :str	       =						[96, 1_92, 3_84, 7_68] if hidden_sizes is None else hidden_sizes
             __SCREAMING_SNAKE_CASE     :Dict	       =						[3, 3, 9, 3] if depths is None else depths
             __SCREAMING_SNAKE_CASE     :Union[str, Any]	       =						hidden_act
             __SCREAMING_SNAKE_CASE     :str	       =						initializer_range
             __SCREAMING_SNAKE_CASE     :str	       =						layer_norm_eps
             __SCREAMING_SNAKE_CASE     :Tuple	       =						layer_scale_init_value
             __SCREAMING_SNAKE_CASE     :Any	       =						drop_path_rate
             __SCREAMING_SNAKE_CASE     :Tuple	       =						image_size
             __SCREAMING_SNAKE_CASE     :List[str]	       =						['''stem'''] + [f'''stage{idx}''' for idx in range(1	,len(self.depths							) + 1							)]
             __SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE     :Union[str, Any]	       =						get_aligned_output_features_output_indices(
                 out_features=SCREAMING_SNAKE_CASE__	,out_indices=SCREAMING_SNAKE_CASE__	,stage_names=self.stage_names							)






class       _SCREAMING_SNAKE_CASE(     A						):
       SCREAMING_SNAKE_CASE_     :   Dict					=						version.parse('''1.11'''						)




       @property
       def 					_UpperCamelCase  (		self							)    ->   Mapping[str, Mapping[int, str]]:





             """simple docstring"""






             return OrderedDict(
                 [
                     ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
                 ]							)




       @property
       def 					_UpperCamelCase  (		self							)    ->   float:





             """simple docstring"""






             return 1E-5






"""simple docstring"""
import math
from collections.abc import Generator



def   __lowerCamelCase     (							a_  :	int							)    ->   Generator[int, None, None]:
      __SCREAMING_SNAKE_CASE     :Generator	       =						(i for i in range(1				,     (max_n + 1)							))
      for i in (n for n in numbers if n > 1):
            for j in range(2				,     a_							):
                  if (i % j) == 0:
                        break
            else:
                  yield i



def   __lowerCamelCase     (							a_  :	int							)    ->   Generator[int, None, None]:
      __SCREAMING_SNAKE_CASE     :Generator	       =						(i for i in range(1				,     (max_n + 1)							))
      for i in (n for n in numbers if n > 1):
            # only need to check for factors up to sqrt(i)
            __SCREAMING_SNAKE_CASE     :Tuple	       =						int(math.sqrt(a_							)							) + 1
            for j in range(2				,     a_							):
                  if (i % j) == 0:
                        break
            else:
                  yield i



def   __lowerCamelCase     (							a_  :	int							)    ->   Generator[int, None, None]:
      __SCREAMING_SNAKE_CASE     :Generator	       =						(i for i in range(1				,     (max_n + 1)				,     2							))
      # It's useless to test even numbers as they will not be prime
      if max_n > 2:
            yield 2  # Because 2 will not be tested, it's necessary to yield it now
      for i in (n for n in numbers if n > 1):
            __SCREAMING_SNAKE_CASE     :int	       =						int(math.sqrt(a_							)							) + 1
            for j in range(3				,     a_				,     2							):
                  # As we removed the even numbers, we don't need them now
                  if (i % j) == 0:
                        break
            else:
                  yield i



def   __lowerCamelCase     (							)    ->   Union[str, Any]:
      from timeit import timeit

      __SCREAMING_SNAKE_CASE     :Optional[Any]	       =						'''from __main__ import slow_primes, primes, fast_primes'''
      print(timeit('''slow_primes(1_000_000_000_000)'''				,     setup=a_				,     number=1_00_00_00							)							)
      print(timeit('''primes(1_000_000_000_000)'''				,     setup=a_				,     number=1_00_00_00							)							)
      print(timeit('''fast_primes(1_000_000_000_000)'''				,     setup=a_				,     number=1_00_00_00							)							)


if __name__ == "__main__":
  lowerCamelCase_          =	int(input("Calculate primes up to:\n>> ").strip())
  for ret in primes(number):
    print(ret)
  benchmark()