


import unittest

import numpy as np
import PIL
import torch

from diffusers.image_processor import VaeImageProcessor



class 							A					( unittest.TestCase							):
					'''simple docstring'''






					@property
					def 						lowerCamelCase__  (self					:		List[Any]	)		->     str:




							"""simple docstring"""


							lowercase__      =	1
							lowercase__      =	3
							lowercase__      =	8
							lowercase__      =	8

							lowercase__      =	torch.rand((batch_size, num_channels, height, width)	)

							return sample

					def 						lowerCamelCase__  (self					:		List[str]   ,      _UpperCAmelCase					:		Optional[Any]	)		->     str:




							"""simple docstring"""


							if isinstance(image[0]   ,      PIL.Image.Image	):
									return np.stack([np.array(_UpperCAmelCase	) for i in image]   ,      axis=0	)
							elif isinstance(_UpperCAmelCase   ,      torch.Tensor	):
									return image.cpu().numpy().transpose(0   ,      2   ,      3   ,      1	)
							return image

					def 						lowerCamelCase__  (self					:		Optional[Any]	)		->     List[str]:




							"""simple docstring"""


							lowercase__      =	VaeImageProcessor(do_resize=_UpperCAmelCase   ,      do_normalize=_UpperCAmelCase	)

							lowercase__      =	self.dummy_sample
							lowercase__      =	self.to_np(_UpperCAmelCase	)

							for output_type in ["pt", "np", "pil"]:
									lowercase__      =	image_processor.postprocess(
									    image_processor.preprocess(_UpperCAmelCase	)   ,      output_type=_UpperCAmelCase   ,      )
									lowercase__      =	self.to_np(_UpperCAmelCase	)
									lowercase__      =	(input_np * 255).round() if output_type == """pil""" else input_np
									assert (
									    np.abs(in_np - out_np	).max() < 1E-6
									), f'''decoded output does not match input for output_type {output_type}'''

					def 						lowerCamelCase__  (self					:		int	)		->     int:




							"""simple docstring"""


							lowercase__      =	VaeImageProcessor(do_resize=_UpperCAmelCase   ,      do_normalize=_UpperCAmelCase	)
							lowercase__      =	self.dummy_sample.cpu().numpy().transpose(0   ,      2   ,      3   ,      1	)

							for output_type in ["pt", "np", "pil"]:
									lowercase__      =	image_processor.postprocess(image_processor.preprocess(_UpperCAmelCase	)   ,      output_type=_UpperCAmelCase	)

									lowercase__      =	self.to_np(_UpperCAmelCase	)
									lowercase__      =	(input_np * 255).round() if output_type == """pil""" else input_np
									assert (
									    np.abs(in_np - out_np	).max() < 1E-6
									), f'''decoded output does not match input for output_type {output_type}'''

					def 						lowerCamelCase__  (self					:		Tuple	)		->     Tuple:




							"""simple docstring"""


							lowercase__      =	VaeImageProcessor(do_resize=_UpperCAmelCase   ,      do_normalize=_UpperCAmelCase	)

							lowercase__      =	self.dummy_sample.cpu().numpy().transpose(0   ,      2   ,      3   ,      1	)
							lowercase__      =	image_processor.numpy_to_pil(_UpperCAmelCase	)

							for output_type in ["pt", "np", "pil"]:
									lowercase__      =	image_processor.postprocess(image_processor.preprocess(_UpperCAmelCase	)   ,      output_type=_UpperCAmelCase	)
									for i, o in zip(_UpperCAmelCase   ,      _UpperCAmelCase	):
											lowercase__      =	np.array(_UpperCAmelCase	)
											lowercase__      =	self.to_np(_UpperCAmelCase	) if output_type == """pil""" else (self.to_np(_UpperCAmelCase	) * 255).round()
											assert (
											    np.abs(in_np - out_np	).max() < 1E-6
											), f'''decoded output does not match input for output_type {output_type}'''

					def 						lowerCamelCase__  (self					:		str	)		->     str:




							"""simple docstring"""


							lowercase__      =	VaeImageProcessor(do_resize=_UpperCAmelCase   ,      do_normalize=_UpperCAmelCase	)

							lowercase__      =	self.dummy_sample
							lowercase__      =	input_pt_ad.squeeze(0	)

							lowercase__      =	image_processor.postprocess(
							    image_processor.preprocess(_UpperCAmelCase	)   ,      output_type="""np"""   ,      )
							lowercase__      =	image_processor.postprocess(
							    image_processor.preprocess(_UpperCAmelCase	)   ,      output_type="""np"""   ,      )

							lowercase__      =	self.to_np(self.dummy_sample	)
							lowercase__      =	input_np_ad.squeeze(0	)

							lowercase__      =	image_processor.postprocess(
							    image_processor.preprocess(_UpperCAmelCase	)   ,      output_type="""np"""   ,      )
							lowercase__      =	image_processor.postprocess(
							    image_processor.preprocess(_UpperCAmelCase	)   ,      output_type="""np"""   ,      )

							assert np.abs(out_pt_ad - out_pt_ad	).max() < 1E-6
							assert np.abs(out_np_ad - out_np_ad	).max() < 1E-6


					def 						lowerCamelCase__  (self					:		Any	)		->     int:




							"""simple docstring"""


							lowercase__      =	VaeImageProcessor(do_resize=_UpperCAmelCase   ,      do_normalize=_UpperCAmelCase	)

							lowercase__      =	self.dummy_sample
							lowercase__      =	list(_UpperCAmelCase	)

							lowercase__      =	image_processor.postprocess(
							    image_processor.preprocess(_UpperCAmelCase	)   ,      output_type="""np"""   ,      )

							lowercase__      =	image_processor.postprocess(
							    image_processor.preprocess(_UpperCAmelCase	)   ,      output_type="""np"""   ,      )

							lowercase__      =	self.to_np(self.dummy_sample	)
							list(_UpperCAmelCase	)

							lowercase__      =	image_processor.postprocess(
							    image_processor.preprocess(_UpperCAmelCase	)   ,      output_type="""np"""   ,      )

							lowercase__      =	image_processor.postprocess(
							    image_processor.preprocess(_UpperCAmelCase	)   ,      output_type="""np"""   ,      )

							assert np.abs(out_pt_ad - out_pt_list	).max() < 1E-6
							assert np.abs(out_np_ad - out_np_list	).max() < 1E-6





import math






def 				UpperCamelCase      (			__magic_name__  :							int  )     ->						bool:
		"""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(__magic_name__  ) + 1  )					,					6  ):
				if number % i == 0 or number % (i + 2) == 0:
						return False
		return True






def 				UpperCamelCase      (			__magic_name__  :							int = 1000					,					__magic_name__  :							int = 1000  )     ->						int:
		"""simple docstring"""




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


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

