

"""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 EfficientNetImageProcessor





class 				lowerCamelCase  (unittest.TestCase     ):

			def __init__(   self			:  str      ,			__UpperCAmelCase			:  Tuple      ,			__UpperCAmelCase			:  Dict=1_3      ,			__UpperCAmelCase			:  Dict=3      ,			__UpperCAmelCase			:  Optional[int]=1_8      ,			__UpperCAmelCase			:  List[Any]=3_0      ,			__UpperCAmelCase			:  List[Any]=4_0_0      ,			__UpperCAmelCase			:  Tuple=True      ,			__UpperCAmelCase			:  List[Any]=None      ,			__UpperCAmelCase			:  List[Any]=True      ,			__UpperCAmelCase			:  List[str]=[0.5, 0.5, 0.5]      ,			__UpperCAmelCase			:  int=[0.5, 0.5, 0.5]      ,			)				->      List[Any]:
						SCREAMING_SNAKE_CASE__									= size if size is not None else {"""height""": 1_8, """width""": 1_8}
						SCREAMING_SNAKE_CASE__									= parent
						SCREAMING_SNAKE_CASE__									= batch_size
						SCREAMING_SNAKE_CASE__									= num_channels
						SCREAMING_SNAKE_CASE__									= image_size
						SCREAMING_SNAKE_CASE__									= min_resolution
						SCREAMING_SNAKE_CASE__									= max_resolution
						SCREAMING_SNAKE_CASE__									= do_resize
						SCREAMING_SNAKE_CASE__									= size
						SCREAMING_SNAKE_CASE__									= do_normalize
						SCREAMING_SNAKE_CASE__									= image_mean
						SCREAMING_SNAKE_CASE__									= image_std





			def    SCREAMING_SNAKE_CASE			(   self			:  Any    )				->      List[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 				lowerCamelCase  (A__     ,unittest.TestCase     ):
			lowerCamelCase__				:						List[str]   						=							EfficientNetImageProcessor if is_vision_available() else None

			def    SCREAMING_SNAKE_CASE			(   self			:  List[str]    )				->      List[Any]:
						SCREAMING_SNAKE_CASE__									= EfficientNetImageProcessorTester(self    )

			@property
			def    SCREAMING_SNAKE_CASE			(   self			:  Tuple    )				->      Dict:
						return self.image_processor_tester.prepare_image_processor_dict()

			def    SCREAMING_SNAKE_CASE			(   self			:  Any    )				->      str:
						SCREAMING_SNAKE_CASE__									= self.image_processing_class(**self.image_processor_dict    )
						self.assertTrue(hasattr(__UpperCAmelCase      ,			"""image_mean"""    )    )
						self.assertTrue(hasattr(__UpperCAmelCase      ,			"""image_std"""    )    )
						self.assertTrue(hasattr(__UpperCAmelCase      ,			"""do_normalize"""    )    )
						self.assertTrue(hasattr(__UpperCAmelCase      ,			"""do_resize"""    )    )
						self.assertTrue(hasattr(__UpperCAmelCase      ,			"""size"""    )    )

			def    SCREAMING_SNAKE_CASE			(   self			:  Any    )				->      List[Any]:
						SCREAMING_SNAKE_CASE__									= self.image_processing_class.from_dict(self.image_processor_dict    )
						self.assertEqual(image_processor.size      ,			{"""height""": 1_8, """width""": 1_8}    )

						SCREAMING_SNAKE_CASE__									= self.image_processing_class.from_dict(self.image_processor_dict      ,			size=4_2    )
						self.assertEqual(image_processor.size      ,			{"""height""": 4_2, """width""": 4_2}    )

			def    SCREAMING_SNAKE_CASE			(   self			:  Optional[Any]    )				->      Any:
						# Initialize image_processing
						SCREAMING_SNAKE_CASE__									= self.image_processing_class(**self.image_processor_dict    )
						# create random PIL images
						SCREAMING_SNAKE_CASE__									= prepare_image_inputs(self.image_processor_tester      ,			equal_resolution=__UpperCAmelCase    )
						for image in image_inputs:
									self.assertIsInstance(__UpperCAmelCase      ,			Image.Image    )

						# Test not batched input
						SCREAMING_SNAKE_CASE__									= image_processing(image_inputs[0]      ,			return_tensors="""pt"""    ).pixel_values
						self.assertEqual(
						    encoded_images.shape      ,			(
						        1,
						        self.image_processor_tester.num_channels,
						        self.image_processor_tester.size["""height"""],
						        self.image_processor_tester.size["""width"""],
						    )      ,			)

						# Test batched
						SCREAMING_SNAKE_CASE__									= image_processing(__UpperCAmelCase      ,			return_tensors="""pt"""    ).pixel_values
						self.assertEqual(
						    encoded_images.shape      ,			(
						        self.image_processor_tester.batch_size,
						        self.image_processor_tester.num_channels,
						        self.image_processor_tester.size["""height"""],
						        self.image_processor_tester.size["""width"""],
						    )      ,			)

			def    SCREAMING_SNAKE_CASE			(   self			:  Optional[int]    )				->      Optional[Any]:
						# Initialize image_processing
						SCREAMING_SNAKE_CASE__									= self.image_processing_class(**self.image_processor_dict    )
						# create random numpy tensors
						SCREAMING_SNAKE_CASE__									= prepare_image_inputs(self.image_processor_tester      ,			equal_resolution=__UpperCAmelCase      ,			numpify=__UpperCAmelCase    )
						for image in image_inputs:
									self.assertIsInstance(__UpperCAmelCase      ,			np.ndarray    )

						# Test not batched input
						SCREAMING_SNAKE_CASE__									= image_processing(image_inputs[0]      ,			return_tensors="""pt"""    ).pixel_values
						self.assertEqual(
						    encoded_images.shape      ,			(
						        1,
						        self.image_processor_tester.num_channels,
						        self.image_processor_tester.size["""height"""],
						        self.image_processor_tester.size["""width"""],
						    )      ,			)

						# Test batched
						SCREAMING_SNAKE_CASE__									= image_processing(__UpperCAmelCase      ,			return_tensors="""pt"""    ).pixel_values
						self.assertEqual(
						    encoded_images.shape      ,			(
						        self.image_processor_tester.batch_size,
						        self.image_processor_tester.num_channels,
						        self.image_processor_tester.size["""height"""],
						        self.image_processor_tester.size["""width"""],
						    )      ,			)





			def    SCREAMING_SNAKE_CASE			(   self			:  Optional[int]    )				->      str:
						# Initialize image_processing
						SCREAMING_SNAKE_CASE__									= self.image_processing_class(**self.image_processor_dict    )
						# create random PyTorch tensors
						SCREAMING_SNAKE_CASE__									= prepare_image_inputs(self.image_processor_tester      ,			equal_resolution=__UpperCAmelCase      ,			torchify=__UpperCAmelCase    )
						for image in image_inputs:
									self.assertIsInstance(__UpperCAmelCase      ,			torch.Tensor    )

						# Test not batched input
						SCREAMING_SNAKE_CASE__									= image_processing(image_inputs[0]      ,			return_tensors="""pt"""    ).pixel_values
						self.assertEqual(
						    encoded_images.shape      ,			(
						        1,
						        self.image_processor_tester.num_channels,
						        self.image_processor_tester.size["""height"""],
						        self.image_processor_tester.size["""width"""],
						    )      ,			)

						# Test batched
						SCREAMING_SNAKE_CASE__									= image_processing(__UpperCAmelCase      ,			return_tensors="""pt"""    ).pixel_values
						self.assertEqual(
						    encoded_images.shape      ,			(
						        self.image_processor_tester.batch_size,
						        self.image_processor_tester.num_channels,
						        self.image_processor_tester.size["""height"""],
						        self.image_processor_tester.size["""width"""],
						    )      ,			)





"""simple docstring"""




import math

def 		A    (       snake_case__      ):




			'''simple docstring'''


			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(snake_case__      ) + 1      )						,			6      ):
						if number % i == 0 or number % (i + 2) == 0:
									return False
			return True

def 		A    (       snake_case__ = 10_00						,			snake_case__ = 10_00      ):




			'''simple docstring'''


			SCREAMING_SNAKE_CASE__									= [0, 0, 0]  # length, a, b
			for a in range((a_limit * -1) + 1						,			snake_case__      ):
						for b in range(2						,			snake_case__      ):
									if is_prime(snake_case__      ):
												SCREAMING_SNAKE_CASE__									= 0
												SCREAMING_SNAKE_CASE__									= 0
												while is_prime((n**2) + (a * n) + b      ):
															count += 1
															n += 1
												if count > longest[0]:
															SCREAMING_SNAKE_CASE__									= [count, a, b]
			SCREAMING_SNAKE_CASE__									= longest[1] * longest[2]
			return ans


if __name__ == "__main__":
						print(solution(1_000, 1_000))


