






"""simple docstring"""
import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
						import torch

if is_vision_available():
						from PIL import Image

						from transformers import ViTImageProcessor







class     UpperCamelCase_ (unittest.TestCase  ):





	def __init__(   self      :				Optional[int]			,			lowerCAmelCase_      :				Optional[int]			,			lowerCAmelCase_      :				List[str]=13			,			lowerCAmelCase_      :				Optional[Any]=3			,			lowerCAmelCase_      :				Optional[Any]=224			,			lowerCAmelCase_      :				str=30			,			lowerCAmelCase_      :				Optional[Any]=400			,			lowerCAmelCase_      :				List[Any]=True			,			lowerCAmelCase_      :				Any=None			,			lowerCAmelCase_      :				Union[str, Any]=True			,			lowerCAmelCase_      :				Dict=[0.5, 0.5, 0.5]			,			lowerCAmelCase_      :				str=[0.5, 0.5, 0.5]			,			)		->    Tuple:
				UpperCAmelCase_  :				Any      =      size if size is not None else {"height": 18, "width": 18}
				UpperCAmelCase_  :				Dict      =      parent
				UpperCAmelCase_  :				Optional[Any]      =      batch_size
				UpperCAmelCase_  :				List[Any]      =      num_channels
				UpperCAmelCase_  :				Union[str, Any]      =      image_size
				UpperCAmelCase_  :				Optional[int]      =      min_resolution
				UpperCAmelCase_  :				int      =      max_resolution
				UpperCAmelCase_  :				str      =      do_resize
				UpperCAmelCase_  :				Tuple      =      size
				UpperCAmelCase_  :				int      =      do_normalize
				UpperCAmelCase_  :				int      =      image_mean
				UpperCAmelCase_  :				Tuple      =      image_std





	def   _SCREAMING_SNAKE_CASE   (   self      :				str		)		->    str:
				return {
				    "image_mean": self.image_mean,
				    "image_std": self.image_std,
				    "do_normalize": self.do_normalize,
				    "do_resize": self.do_resize,
				    "size": self.size,
				}







@require_torch
@require_vision
class     UpperCamelCase_ (_UpperCamelCase       ,		unittest.TestCase  ):
	__magic_name__			   =       ViTImageProcessor if is_vision_available() else None





	def   _SCREAMING_SNAKE_CASE   (   self      :				Union[str, Any]		)		->    Dict:
				UpperCAmelCase_  :				str      =      EfficientFormerImageProcessorTester(self		)





	@property
	def   _SCREAMING_SNAKE_CASE   (   self      :				List[str]		)		->    List[str]:
				return self.image_proc_tester.prepare_image_processor_dict()





	def   _SCREAMING_SNAKE_CASE   (   self      :				Union[str, Any]		)		->    str:
				UpperCAmelCase_  :				List[Any]      =      self.image_processing_class(**self.image_processor_dict		)
				self.assertTrue(hasattr(__a			,			"image_mean"		)		)
				self.assertTrue(hasattr(__a			,			"image_std"		)		)
				self.assertTrue(hasattr(__a			,			"do_normalize"		)		)
				self.assertTrue(hasattr(__a			,			"do_resize"		)		)
				self.assertTrue(hasattr(__a			,			"size"		)		)





	def   _SCREAMING_SNAKE_CASE   (   self      :				List[Any]		)		->    Optional[Any]:
				pass





	def   _SCREAMING_SNAKE_CASE   (   self      :				str		)		->    Dict:
				# Initialize image_processor
				UpperCAmelCase_  :				Tuple      =      self.image_processing_class(**self.image_processor_dict		)
				# create random PIL images
				UpperCAmelCase_  :				List[str]      =      prepare_image_inputs(self.image_proc_tester			,			equal_resolution=__a		)
				for image in image_inputs:
							self.assertIsInstance(__a			,			Image.Image		)

				# Test not batched input
				UpperCAmelCase_  :				Union[str, Any]      =      image_processor(image_inputs[0]			,			return_tensors="pt"		).pixel_values
				self.assertEqual(
				    encoded_images.shape			,			(
				        1,
				        self.image_proc_tester.num_channels,
				        self.image_proc_tester.size["height"],
				        self.image_proc_tester.size["width"],
				    )			,			)

				# Test batched
				UpperCAmelCase_  :				Any      =      image_processor(__a			,			return_tensors="pt"		).pixel_values
				self.assertEqual(
				    encoded_images.shape			,			(
				        self.image_proc_tester.batch_size,
				        self.image_proc_tester.num_channels,
				        self.image_proc_tester.size["height"],
				        self.image_proc_tester.size["width"],
				    )			,			)





	def   _SCREAMING_SNAKE_CASE   (   self      :				Union[str, Any]		)		->    Dict:
				# Initialize image_processor
				UpperCAmelCase_  :				Optional[Any]      =      self.image_processing_class(**self.image_processor_dict		)
				# create random numpy tensors
				UpperCAmelCase_  :				Union[str, Any]      =      prepare_image_inputs(self.image_proc_tester			,			equal_resolution=__a			,			numpify=__a		)
				for image in image_inputs:
							self.assertIsInstance(__a			,			np.ndarray		)

				# Test not batched input
				UpperCAmelCase_  :				Optional[Any]      =      image_processor(image_inputs[0]			,			return_tensors="pt"		).pixel_values
				self.assertEqual(
				    encoded_images.shape			,			(
				        1,
				        self.image_proc_tester.num_channels,
				        self.image_proc_tester.size["height"],
				        self.image_proc_tester.size["width"],
				    )			,			)

				# Test batched
				UpperCAmelCase_  :				Optional[Any]      =      image_processor(__a			,			return_tensors="pt"		).pixel_values
				self.assertEqual(
				    encoded_images.shape			,			(
				        self.image_proc_tester.batch_size,
				        self.image_proc_tester.num_channels,
				        self.image_proc_tester.size["height"],
				        self.image_proc_tester.size["width"],
				    )			,			)





	def   _SCREAMING_SNAKE_CASE   (   self      :				Union[str, Any]		)		->    Any:
				# Initialize image_processor
				UpperCAmelCase_  :				Optional[Any]      =      self.image_processing_class(**self.image_processor_dict		)
				# create random PyTorch tensors
				UpperCAmelCase_  :				Optional[int]      =      prepare_image_inputs(self.image_proc_tester			,			equal_resolution=__a			,			torchify=__a		)
				for image in image_inputs:
							self.assertIsInstance(__a			,			torch.Tensor		)

				# Test not batched input
				UpperCAmelCase_  :				List[Any]      =      image_processor(image_inputs[0]			,			return_tensors="pt"		).pixel_values
				self.assertEqual(
				    encoded_images.shape			,			(
				        1,
				        self.image_proc_tester.num_channels,
				        self.image_proc_tester.size["height"],
				        self.image_proc_tester.size["width"],
				    )			,			)

				# Test batched
				UpperCAmelCase_  :				Tuple      =      image_processor(__a			,			return_tensors="pt"		).pixel_values
				self.assertEqual(
				    encoded_images.shape			,			(
				        self.image_proc_tester.batch_size,
				        self.image_proc_tester.num_channels,
				        self.image_proc_tester.size["height"],
				        self.image_proc_tester.size["width"],
				    )			,			)











"""simple docstring"""
from __future__ import annotations

import math

def        snake_case   (     A__		):

			if 1 < number < 4:
						# 2 and 3 are primes
						return True
			elif number < 2 or number % 2 == 0 or number % 3 == 0:
						# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
						return False

			# All primes number are in format of 6k +/- 1
			for i in range(5			,int(math.sqrt(A__		) + 1		)			,6		):
						if number % i == 0 or number % (i + 2) == 0:
									return False
			return True


lowerCamelCase_       			=   [num for num in range(3, 10_0001, 2) if not is_prime(num)]

def        snake_case   (     A__		):
			if not isinstance(A__			,A__		):
						raise ValueError("n must be an integer"		)
			if n <= 0:
						raise ValueError("n must be >= 0"		)

			UpperCAmelCase_  :				List[str]      =      []
			for num in range(len(A__		)		):
						UpperCAmelCase_  :				Dict      =      0
						while 2 * i * i <= odd_composites[num]:
									UpperCAmelCase_  :				List[str]      =      odd_composites[num] - 2 * i * i
									if is_prime(A__		):
												break
									i += 1
						else:
									list_nums.append(odd_composites[num]		)
									if len(A__		) == n:
												return list_nums

			return []

def        snake_case   (     ):
			return compute_nums(1		)[0]


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



