

'''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 	lowerCAmelCase  (   unittest.TestCase ):







       def __init__(				self      :			Optional[int]    ,   __lowercase      :			int    ,   __lowercase      :			List[str]=13    ,   __lowercase      :			Tuple=3    ,   __lowercase      :			List[str]=224    ,   __lowercase      :			Dict=30    ,   __lowercase      :			Union[str, Any]=400    ,   __lowercase      :			Any=True    ,   __lowercase      :			Any=None    ,   __lowercase      :			Dict=True    ,   __lowercase      :			Dict=[0.5, 0.5, 0.5]    ,   __lowercase      :			Optional[Any]=[0.5, 0.5, 0.5]    ,   ):







            """simple docstring"""







            __lowercase      		=size if size is not None else {'height': 18, 'width': 18}
            __lowercase      		=parent
            __lowercase      		=batch_size
            __lowercase      		=num_channels
            __lowercase      		=image_size
            __lowercase      		=min_resolution
            __lowercase      		=max_resolution
            __lowercase      		=do_resize
            __lowercase      		=size
            __lowercase      		=do_normalize
            __lowercase      		=image_mean
            __lowercase      		=image_std







       def       snake_case (				self      :			Union[str, Any]   ):







            """simple docstring"""







            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_												=			ViTImageProcessor if is_vision_available() else None







       def       snake_case (				self      :			str   ):







            """simple docstring"""







            __lowercase      		=EfficientFormerImageProcessorTester(self   )







       @property
       def       snake_case (				self      :			Any   ):







            """simple docstring"""







            return self.image_proc_tester.prepare_image_processor_dict()







       def       snake_case (				self      :			Any   ):







            """simple docstring"""







            __lowercase      		=self.image_processing_class(**self.image_processor_dict   )
            self.assertTrue(hasattr(__lowercase    ,   'image_mean'   )   )
            self.assertTrue(hasattr(__lowercase    ,   'image_std'   )   )
            self.assertTrue(hasattr(__lowercase    ,   'do_normalize'   )   )
            self.assertTrue(hasattr(__lowercase    ,   'do_resize'   )   )
            self.assertTrue(hasattr(__lowercase    ,   'size'   )   )







       def       snake_case (				self      :			Optional[int]   ):







            """simple docstring"""







            pass







       def       snake_case (				self      :			str   ):







            """simple docstring"""







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

            # Test not batched input
            __lowercase      		=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
            __lowercase      		=image_processor(__lowercase    ,   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       snake_case (				self      :			List[Any]   ):







            """simple docstring"""







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

            # Test not batched input
            __lowercase      		=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
            __lowercase      		=image_processor(__lowercase    ,   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       snake_case (				self      :			Union[str, Any]   ):







            """simple docstring"""







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

            # Test not batched input
            __lowercase      		=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
            __lowercase      		=image_processor(__lowercase    ,   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 collections import defaultdict
from math import gcd

def 					__UpperCamelCase				(						lowercase__    :	int = 1_50_00_00			):






     '''simple docstring'''





     __lowercase      		=defaultdict(lowercase__			)
     __lowercase      		=2
     while 2 * euclid_m * (euclid_m + 1) <= limit:
          for euclid_n in range((euclid_m % 2) + 1,       lowercase__,       2			):
               if gcd(lowercase__,       lowercase__			) > 1:
                    continue
               __lowercase      		=2 * euclid_m * (euclid_m + euclid_n)
               for perimeter in range(lowercase__,       limit + 1,       lowercase__			):
                    frequencies[perimeter] += 1
          euclid_m += 1
     return sum(1 for frequency in frequencies.values() if frequency == 1			)


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


