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


class 						__UpperCAmelCase      (					unittest.TestCase						):


							def __init__(       self    ,   lowerCAmelCase_    ,   lowerCAmelCase_=7    ,   lowerCAmelCase_=3    ,   lowerCAmelCase_=30    ,   lowerCAmelCase_=4_00    ,   lowerCAmelCase_=True    ,   lowerCAmelCase_=None    ,   lowerCAmelCase_=0.9    ,   lowerCAmelCase_=None    ,   lowerCAmelCase_=True    ,   lowerCAmelCase_=[0.5, 0.5, 0.5]    ,   lowerCAmelCase_=[0.5, 0.5, 0.5]    ,   ):





								"""simple docstring"""






								_snake_case   						=		size if size is not None else {'shortest_edge': 30}
								_snake_case   						=		crop_size if crop_size is not None else {'height': 30, 'width': 30}
								_snake_case   						=		parent
								_snake_case   						=		batch_size
								_snake_case   						=		num_channels
								_snake_case   						=		min_resolution
								_snake_case   						=		max_resolution
								_snake_case   						=		do_resize_and_center_crop
								_snake_case   						=		size
								_snake_case   						=		crop_pct
								_snake_case   						=		crop_size
								_snake_case   						=		do_normalize
								_snake_case   						=		image_mean
								_snake_case   						=		image_std




							def  lowerCamelCase				(       self  ):





								"""simple docstring"""






								return {
								    "size": self.size,
								    "do_resize_and_center_crop": self.do_resize_and_center_crop,
								    "crop_pct": self.crop_pct,
								    "crop_size": self.crop_size,
								    "do_normalize": self.do_normalize,
								    "image_mean": self.image_mean,
								    "image_std": self.image_std,
								}


@require_torch
@require_vision
class 						__UpperCAmelCase      (					_lowerCamelCase						,   unittest.TestCase						):
							__lowercase      		=       PoolFormerImageProcessor if is_vision_available() else None


							def  lowerCamelCase				(       self  ):





								"""simple docstring"""






								_snake_case   						=		PoolFormerImageProcessingTester(self  )


							@property
							def  lowerCamelCase				(       self  ):





								"""simple docstring"""






								return self.image_processor_tester.prepare_image_processor_dict()


							def  lowerCamelCase				(       self  ):





								"""simple docstring"""






								_snake_case   						=		self.image_processing_class(**self.image_processor_dict  )
								self.assertTrue(hasattr(lowerCAmelCase_    ,   'do_resize_and_center_crop'  )  )
								self.assertTrue(hasattr(lowerCAmelCase_    ,   'size'  )  )
								self.assertTrue(hasattr(lowerCAmelCase_    ,   'crop_pct'  )  )
								self.assertTrue(hasattr(lowerCAmelCase_    ,   'do_normalize'  )  )
								self.assertTrue(hasattr(lowerCAmelCase_    ,   'image_mean'  )  )
								self.assertTrue(hasattr(lowerCAmelCase_    ,   'image_std'  )  )


							def  lowerCamelCase				(       self  ):





								"""simple docstring"""






								_snake_case   						=		self.image_processing_class.from_dict(self.image_processor_dict  )
								self.assertEqual(image_processor.size    ,   {'shortest_edge': 30}  )
								self.assertEqual(image_processor.crop_size    ,   {'height': 30, 'width': 30}  )

								_snake_case   						=		self.image_processing_class.from_dict(self.image_processor_dict    ,   size=42    ,   crop_size=84  )
								self.assertEqual(image_processor.size    ,   {'shortest_edge': 42}  )
								self.assertEqual(image_processor.crop_size    ,   {'height': 84, 'width': 84}  )


							def  lowerCamelCase				(       self  ):





								"""simple docstring"""






								pass


							def  lowerCamelCase				(       self  ):





								"""simple docstring"""






								_snake_case   						=		self.image_processing_class(**self.image_processor_dict  )
								# create random PIL images
								_snake_case   						=		prepare_image_inputs(self.image_processor_tester    ,   equal_resolution=lowerCAmelCase_  )
								for image in image_inputs:
									self.assertIsInstance(lowerCAmelCase_    ,   Image.Image  )

								# Test not batched input
								_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.crop_size['height'],
								        self.image_processor_tester.crop_size['width'],
								    )    ,   )

								# Test batched
								_snake_case   						=		image_processing(lowerCAmelCase_    ,   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  lowerCamelCase				(       self  ):





								"""simple docstring"""






								_snake_case   						=		self.image_processing_class(**self.image_processor_dict  )
								# create random numpy tensors
								_snake_case   						=		prepare_image_inputs(self.image_processor_tester    ,   equal_resolution=lowerCAmelCase_    ,   numpify=lowerCAmelCase_  )
								for image in image_inputs:
									self.assertIsInstance(lowerCAmelCase_    ,   np.ndarray  )

								# Test not batched input
								_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.crop_size['height'],
								        self.image_processor_tester.crop_size['width'],
								    )    ,   )

								# Test batched
								_snake_case   						=		image_processing(lowerCAmelCase_    ,   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  lowerCamelCase				(       self  ):





								"""simple docstring"""






								_snake_case   						=		self.image_processing_class(**self.image_processor_dict  )
								# create random PyTorch tensors
								_snake_case   						=		prepare_image_inputs(self.image_processor_tester    ,   equal_resolution=lowerCAmelCase_    ,   torchify=lowerCAmelCase_  )
								for image in image_inputs:
									self.assertIsInstance(lowerCAmelCase_    ,   torch.Tensor  )

								# Test not batched input
								_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.crop_size['height'],
								        self.image_processor_tester.crop_size['width'],
								    )    ,   )

								# Test batched
								_snake_case   						=		image_processing(lowerCAmelCase_    ,   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'''







from collections import defaultdict
from math import gcd







def 				SCREAMING_SNAKE_CASE__	(   __A = 1_500_000	)       ->	int:
	_snake_case   						=		defaultdict(__A	)
	_snake_case   						=		2
	while 2 * euclid_m * (euclid_m + 1) <= limit:
		for euclid_n in range((euclid_m % 2) + 1			,				__A			,				2	):
			if gcd(__A			,				__A	) > 1:
				continue
			_snake_case   						=		2 * euclid_m * (euclid_m + euclid_n)
			for perimeter in range(__A			,				limit + 1			,				__A	):
				frequencies[perimeter] += 1
		euclid_m += 1
	return sum(1 for frequency in frequencies.values() if frequency == 1	)


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

