




from __future__ import annotations

import typing
from collections import Counter



def 					UpperCAmelCase__     (   lowerCamelCase      ):
  lowercase			:typing.Counter[int]							=  Counter()
  for base in range(1,	max_perimeter + 1      ):
    for perpendicular in range(lowerCamelCase,	max_perimeter + 1      ):
      lowercase			:Any							=  (base * base + perpendicular * perpendicular) ** 0.5
      if hypotenuse == int(lowerCamelCase      ):
        lowercase			:str							=  int(base + perpendicular + hypotenuse      )
        if perimeter > max_perimeter:
          continue
        triplets[perimeter] += 1
  return triplets



def 					UpperCAmelCase__     (   lowerCamelCase = 1000      ):
  lowercase			:int							=  pythagorean_triple(lowerCamelCase      )
  return triplets.most_common(1      )[0][0]


if __name__ == "__main__":
     print(f'''Perimeter {solution()} has maximum solutions''')









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 GLPNImageProcessor




class       __lowerCAmelCase				(							unittest.TestCase):






       def __init__(      self:    List[Any]				,    _lowerCAmelCase:    str				,    _lowerCAmelCase:    Dict=7				,    _lowerCAmelCase:    Optional[Any]=3				,    _lowerCAmelCase:    List[Any]=18				,    _lowerCAmelCase:    int=30				,    _lowerCAmelCase:    Union[str, Any]=4_00				,    _lowerCAmelCase:    Any=True				,    _lowerCAmelCase:    Union[str, Any]=32				,    _lowerCAmelCase:    int=True				,    ):
         lowercase			:Any							=  parent
         lowercase			:List[str]							=  batch_size
         lowercase			:Any							=  num_channels
         lowercase			:Optional[Any]							=  image_size
         lowercase			:Optional[Any]							=  min_resolution
         lowercase			:str							=  max_resolution
         lowercase			:str							=  do_resize
         lowercase			:Optional[int]							=  size_divisor
         lowercase			:Tuple							=  do_rescale






       def     SCREAMING_SNAKE_CASE			(      self:    Any ):
         return {
             "do_resize": self.do_resize,
             "size_divisor": self.size_divisor,
             "do_rescale": self.do_rescale,
         }







@require_torch
@require_vision
class       __lowerCAmelCase				(							lowerCAmelCase					,       unittest.TestCase):
       _a           =  GLPNImageProcessor if is_vision_available() else None






       def     SCREAMING_SNAKE_CASE			(      self:    List[str] ):
         lowercase			:int							=  GLPNImageProcessingTester(self )






       @property
       def     SCREAMING_SNAKE_CASE			(      self:    str ):
         return self.image_processor_tester.prepare_image_processor_dict()






       def     SCREAMING_SNAKE_CASE			(      self:    Optional[int] ):
         lowercase			:Optional[Any]							=  self.image_processing_class(**self.image_processor_dict )
         self.assertTrue(hasattr(_lowerCAmelCase				,    "do_resize" ) )
         self.assertTrue(hasattr(_lowerCAmelCase				,    "size_divisor" ) )
         self.assertTrue(hasattr(_lowerCAmelCase				,    "resample" ) )
         self.assertTrue(hasattr(_lowerCAmelCase				,    "do_rescale" ) )






       def     SCREAMING_SNAKE_CASE			(      self:    List[Any] ):
         pass






       def     SCREAMING_SNAKE_CASE			(      self:    Any ):
         # Initialize image_processing
         lowercase			:Union[str, Any]							=  self.image_processing_class(**self.image_processor_dict )
         # create random PIL images
         lowercase			:List[str]							=  prepare_image_inputs(self.image_processor_tester				,    equal_resolution=_lowerCAmelCase )
         for image in image_inputs:
           self.assertIsInstance(_lowerCAmelCase				,    Image.Image )

         # Test not batched input (GLPNImageProcessor doesn't support batching)
         lowercase			:str							=  image_processing(image_inputs[0]				,    return_tensors="pt" ).pixel_values
         self.assertTrue(encoded_images.shape[-1] % self.image_processor_tester.size_divisor == 0 )
         self.assertTrue(encoded_images.shape[-2] % self.image_processor_tester.size_divisor == 0 )






       def     SCREAMING_SNAKE_CASE			(      self:    Dict ):
         # Initialize image_processing
         lowercase			:Union[str, Any]							=  self.image_processing_class(**self.image_processor_dict )
         # create random numpy tensors
         lowercase			:Union[str, Any]							=  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 (GLPNImageProcessor doesn't support batching)
         lowercase			:Optional[int]							=  image_processing(image_inputs[0]				,    return_tensors="pt" ).pixel_values
         self.assertTrue(encoded_images.shape[-1] % self.image_processor_tester.size_divisor == 0 )
         self.assertTrue(encoded_images.shape[-2] % self.image_processor_tester.size_divisor == 0 )






       def     SCREAMING_SNAKE_CASE			(      self:    Tuple ):
         # Initialize image_processing
         lowercase			:Optional[Any]							=  self.image_processing_class(**self.image_processor_dict )
         # create random PyTorch tensors
         lowercase			:List[str]							=  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 (GLPNImageProcessor doesn't support batching)
         lowercase			:Dict							=  image_processing(image_inputs[0]				,    return_tensors="pt" ).pixel_values
         self.assertTrue(encoded_images.shape[-1] % self.image_processor_tester.size_divisor == 0 )
         self.assertTrue(encoded_images.shape[-2] % self.image_processor_tester.size_divisor == 0 )



