




'''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 OwlViTImageProcessor



class  A		(			unittest.TestCase		):




				'''simple docstring'''





				def __init__(self			,  _UpperCAmelCase			,  _UpperCAmelCase=7			,  _UpperCAmelCase=3			,  _UpperCAmelCase=1_8			,  _UpperCAmelCase=3_0			,  _UpperCAmelCase=4_0_0			,  _UpperCAmelCase=True			,  _UpperCAmelCase=None			,  _UpperCAmelCase=True			,  _UpperCAmelCase=None			,  _UpperCAmelCase=True			,  _UpperCAmelCase=[0.48_145_466, 0.4_578_275, 0.40_821_073]			,  _UpperCAmelCase=[0.26_862_954, 0.26_130_258, 0.27_577_711]			,  _UpperCAmelCase=True			,  )     ->	Tuple:
							__UpperCamelCase				:      str									=       parent
							__UpperCamelCase				:      List[str]									=       batch_size
							__UpperCamelCase				:      Optional[Any]									=       num_channels
							__UpperCamelCase				:      Optional[Any]									=       image_size
							__UpperCamelCase				:      List[str]									=       min_resolution
							__UpperCamelCase				:      Optional[Any]									=       max_resolution
							__UpperCamelCase				:      List[Any]									=       do_resize
							__UpperCamelCase				:      Union[str, Any]									=       size if size is not None else {"height": 1_8, "width": 1_8}
							__UpperCamelCase				:      Any									=       do_center_crop
							__UpperCamelCase				:      int									=       crop_size if crop_size is not None else {"height": 1_8, "width": 1_8}
							__UpperCamelCase				:      List[str]									=       do_normalize
							__UpperCamelCase				:      Optional[Any]									=       image_mean
							__UpperCamelCase				:      int									=       image_std
							__UpperCamelCase				:      int									=       do_convert_rgb





				def 	a_	(self      )     ->	Dict:
							return {
							    "do_resize": self.do_resize,
							    "size": self.size,
							    "do_center_crop": self.do_center_crop,
							    "crop_size": self.crop_size,
							    "do_normalize": self.do_normalize,
							    "image_mean": self.image_mean,
							    "image_std": self.image_std,
							    "do_convert_rgb": self.do_convert_rgb,
							}







@require_torch
@require_vision
class  A		(			SCREAMING_SNAKE_CASE__      ,							unittest.TestCase		):




				'''simple docstring'''





				A				     =    OwlViTImageProcessor if is_vision_available() else None
				def 	a_	(self      )     ->	Optional[int]:
							__UpperCamelCase				:      Optional[Any]									=       OwlViTImageProcessingTester(self      )
				@property
				def 	a_	(self      )     ->	Optional[int]:
							return self.image_processor_tester.prepare_image_processor_dict()
				def 	a_	(self      )     ->	Tuple:
							__UpperCamelCase				:      Tuple									=       self.image_processing_class(**self.image_processor_dict      )
							self.assertTrue(hasattr(_UpperCAmelCase			,  "do_resize"      )      )
							self.assertTrue(hasattr(_UpperCAmelCase			,  "size"      )      )
							self.assertTrue(hasattr(_UpperCAmelCase			,  "do_center_crop"      )      )
							self.assertTrue(hasattr(_UpperCAmelCase			,  "center_crop"      )      )
							self.assertTrue(hasattr(_UpperCAmelCase			,  "do_normalize"      )      )
							self.assertTrue(hasattr(_UpperCAmelCase			,  "image_mean"      )      )
							self.assertTrue(hasattr(_UpperCAmelCase			,  "image_std"      )      )
							self.assertTrue(hasattr(_UpperCAmelCase			,  "do_convert_rgb"      )      )
				def 	a_	(self      )     ->	Optional[Any]:
							__UpperCamelCase				:      Tuple									=       self.image_processing_class.from_dict(self.image_processor_dict      )
							self.assertEqual(image_processor.size			,  {"height": 1_8, "width": 1_8}      )
							self.assertEqual(image_processor.crop_size			,  {"height": 1_8, "width": 1_8}      )

							__UpperCamelCase				:      Dict									=       self.image_processing_class.from_dict(self.image_processor_dict			,  size=4_2			,  crop_size=8_4      )
							self.assertEqual(image_processor.size			,  {"height": 4_2, "width": 4_2}      )
							self.assertEqual(image_processor.crop_size			,  {"height": 8_4, "width": 8_4}      )
				def 	a_	(self      )     ->	str:
							# Initialize image_processing
							__UpperCamelCase				:      str									=       self.image_processing_class(**self.image_processor_dict      )
							# create random PIL images
							__UpperCamelCase				:      int									=       prepare_image_inputs(self.image_processor_tester			,  equal_resolution=_UpperCAmelCase      )

							for image in image_inputs:
										self.assertIsInstance(_UpperCAmelCase			,  Image.Image      )

							# Test not batched input
							__UpperCamelCase				:      Optional[int]									=       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.crop_size["height"],
							        self.image_processor_tester.crop_size["width"],
							    )			,  )

							# Test batched
							__UpperCamelCase				:      Dict									=       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.crop_size["height"],
							        self.image_processor_tester.crop_size["width"],
							    )			,  )
				def 	a_	(self      )     ->	List[Any]:
							# Initialize image_processing
							__UpperCamelCase				:      Tuple									=       self.image_processing_class(**self.image_processor_dict      )
							# create random numpy tensors
							__UpperCamelCase				:      Tuple									=       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
							__UpperCamelCase				:      List[Any]									=       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.crop_size["height"],
							        self.image_processor_tester.crop_size["width"],
							    )			,  )

							# Test batched
							__UpperCamelCase				:      Tuple									=       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.crop_size["height"],
							        self.image_processor_tester.crop_size["width"],
							    )			,  )





				def 	a_	(self      )     ->	List[str]:
							# Initialize image_processing
							__UpperCamelCase				:      Tuple									=       self.image_processing_class(**self.image_processor_dict      )
							# create random PyTorch tensors
							__UpperCamelCase				:      Any									=       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
							__UpperCamelCase				:      Union[str, Any]									=       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.crop_size["height"],
							        self.image_processor_tester.crop_size["width"],
							    )			,  )

							# Test batched
							__UpperCamelCase				:      List[Any]									=       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.crop_size["height"],
							        self.image_processor_tester.crop_size["width"],
							    )			,  )









'''simple docstring'''






def       __lowerCAmelCase (   snake_case__ = 4_000_000						):
			__UpperCamelCase				:      Tuple									=       1
			__UpperCamelCase				:      int									=       2
			__UpperCamelCase				:      str									=       0
			while j <= n:
						if j % 2 == 0:
									total += j
						__UpperCamelCase		, __UpperCamelCase				:      List[Any]									=       j, i + j

			return total


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



