


import PIL.Image
import PIL.ImageOps
from packaging import version
from PIL import Image


if version.parse(version.parse(PIL.__version__).base_version) >= version.parse('9.1.0'):
   UpperCAmelCase_				:			int   =	{
       'linear': PIL.Image.Resampling.BILINEAR,
       'bilinear': PIL.Image.Resampling.BILINEAR,
       'bicubic': PIL.Image.Resampling.BICUBIC,
       'lanczos': PIL.Image.Resampling.LANCZOS,
       'nearest': PIL.Image.Resampling.NEAREST,
   }
else:
   UpperCAmelCase_				:			Optional[Any]   =	{
       'linear': PIL.Image.LINEAR,
       'bilinear': PIL.Image.BILINEAR,
       'bicubic': PIL.Image.BICUBIC,
       'lanczos': PIL.Image.LANCZOS,
       'nearest': PIL.Image.NEAREST,
   }







def 	SCREAMING_SNAKE_CASE_						(      __A			:      Optional[int]    )     ->		Union[str, Any]:

       """simple docstring"""

       a_ :		List[Any]							=  (images / 2 + 0.5).clamp(0  ,   1    )
       a_ :		Tuple							=  images.cpu().permute(0  ,   2  ,   3  ,   1    ).float().numpy()
       a_ :		Union[str, Any]							=  numpy_to_pil(__A    )
       return images







def 	SCREAMING_SNAKE_CASE_						(      __A			:      Dict    )     ->		Any:

       """simple docstring"""

       if images.ndim == 3:
              a_ :		Any							=  images[None, ...]
       a_ :		Optional[int]							=  (images * 2_55).round().astype('uint8'    )
       if images.shape[-1] == 1:
              # special case for grayscale (single channel) images
              a_ :		Any							=  [Image.fromarray(image.squeeze()  ,   mode='L'    ) for image in images]
       else:
              a_ :		Tuple							=  [Image.fromarray(__A    ) for image in images]

       return pil_images






from __future__ import annotations

UpperCAmelCase_				:			Dict   =	[True] * 100_0001
UpperCAmelCase_				:			Any   =	2
while i * i <= 100_0000:
   if seive[i]:
      for j in range(i * i, 100_0001, i):
         UpperCAmelCase_				:			Tuple   =	False
   i += 1







def 	SCREAMING_SNAKE_CASE_						(      __A			:      int    )     ->		bool:

       """simple docstring"""

       return seive[n]







def 	SCREAMING_SNAKE_CASE_						(      __A			:      int    )     ->		bool:

       """simple docstring"""

       return any(digit in '02468' for digit in str(__A    )    )







def 	SCREAMING_SNAKE_CASE_						(      __A			:      int = 1_00_00_00    )     ->		list[int]:

       """simple docstring"""

       a_ :		Dict							=  [2]  # result already includes the number 2.
       for num in range(3  ,   limit + 1  ,   2    ):
              if is_prime(__A    ) and not contains_an_even_digit(__A    ):
                     a_ :		Dict							=  str(__A    )
                     a_ :		Any							=  [int(str_num[j:] + str_num[:j]    ) for j in range(len(__A    )    )]
                     if all(is_prime(__A    ) for i in list_nums    ):
                            result.append(__A    )
       return result







def 	SCREAMING_SNAKE_CASE_						(      )     ->		int:

       """simple docstring"""

       return len(find_circular_primes()    )


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


