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

class 			UpperCAmelCase__    (							unittest.TestCase			):



    def __init__(						self   :							Any,__A   :							Union[str, Any],__A   :							Optional[int]=7,__A   :							Optional[Any]=3,__A   :							List[str]=1_8,__A   :							Any=3_0,__A   :							str=4_0_0,__A   :							str=True,__A   :							Tuple=None,__A   :							Tuple=True,__A   :							List[str]=None,__A   :							List[str]=True,):
          _lowerCamelCase					: List[str]		    = size if size is not None else {"shortest_edge": 2_0}
          _lowerCamelCase					: str		    = crop_size if crop_size is not None else {"height": 1_8, "width": 1_8}
          _lowerCamelCase					: Union[str, Any]		    = parent
          _lowerCamelCase					: Optional[Any]		    = batch_size
          _lowerCamelCase					: Tuple		    = num_channels
          _lowerCamelCase					: Optional[int]		    = image_size
          _lowerCamelCase					: Optional[Any]		    = min_resolution
          _lowerCamelCase					: List[Any]		    = max_resolution
          _lowerCamelCase					: Any		    = do_resize
          _lowerCamelCase					: int		    = size
          _lowerCamelCase					: Optional[Any]		    = do_center_crop
          _lowerCamelCase					: Optional[Any]		    = crop_size
          _lowerCamelCase					: List[Any]		    = do_flip_channel_order



    def 	lowerCamelCase_	(						self   :							List[Any]  ):
          return {
              "do_resize": self.do_resize,
              "size": self.size,
              "do_center_crop": self.do_center_crop,
              "crop_size": self.crop_size,
              "do_flip_channel_order": self.do_flip_channel_order,
          }


@require_torch
@require_vision
class 			UpperCAmelCase__    (							A    ,						unittest.TestCase			):
    lowerCAmelCase_					     =		MobileViTImageProcessor if is_vision_available() else None



    def 	lowerCamelCase_	(						self   :							List[Any]  ):
          _lowerCamelCase					: List[str]		    = MobileViTImageProcessingTester(self  )



    @property
    def 	lowerCamelCase_	(						self   :							List[str]  ):
          return self.image_processor_tester.prepare_image_processor_dict()



    def 	lowerCamelCase_	(						self   :							Any  ):
          _lowerCamelCase					: List[str]		    = self.image_processing_class(**self.image_processor_dict  )
          self.assertTrue(hasattr(__A,"do_resize"  )  )
          self.assertTrue(hasattr(__A,"size"  )  )
          self.assertTrue(hasattr(__A,"do_center_crop"  )  )
          self.assertTrue(hasattr(__A,"center_crop"  )  )
          self.assertTrue(hasattr(__A,"do_flip_channel_order"  )  )



    def 	lowerCamelCase_	(						self   :							Dict  ):
          _lowerCamelCase					: List[str]		    = self.image_processing_class.from_dict(self.image_processor_dict  )
          self.assertEqual(image_processor.size,{"shortest_edge": 2_0}  )
          self.assertEqual(image_processor.crop_size,{"height": 1_8, "width": 1_8}  )

          _lowerCamelCase					: Any		    = self.image_processing_class.from_dict(self.image_processor_dict,size=4_2,crop_size=8_4  )
          self.assertEqual(image_processor.size,{"shortest_edge": 4_2}  )
          self.assertEqual(image_processor.crop_size,{"height": 8_4, "width": 8_4}  )



    def 	lowerCamelCase_	(						self   :							Dict  ):
          pass



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

          # Test not batched input
          _lowerCamelCase					: 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
          _lowerCamelCase					: Optional[Any]		    = image_processing(__A,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   :							str  ):
          # Initialize image_processing
          _lowerCamelCase					: int		    = self.image_processing_class(**self.image_processor_dict  )
          # create random numpy tensors
          _lowerCamelCase					: Optional[int]		    = prepare_image_inputs(self.image_processor_tester,equal_resolution=__A,numpify=__A  )
          for image in image_inputs:
                self.assertIsInstance(__A,np.ndarray  )

          # Test not batched input
          _lowerCamelCase					: Dict		    = 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
          _lowerCamelCase					: Optional[Any]		    = image_processing(__A,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   :							Dict  ):
          # Initialize image_processing
          _lowerCamelCase					: Optional[int]		    = self.image_processing_class(**self.image_processor_dict  )
          # create random PyTorch tensors
          _lowerCamelCase					: Tuple		    = prepare_image_inputs(self.image_processor_tester,equal_resolution=__A,torchify=__A  )
          for image in image_inputs:
                self.assertIsInstance(__A,torch.Tensor  )

          # Test not batched input
          _lowerCamelCase					: str		    = 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
          _lowerCamelCase					: Optional[Any]		    = image_processing(__A,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 		_lowercase (SCREAMING_SNAKE_CASE							):




     '''simple docstring'''





     __A	:       List[str]      =							1
     __A	:       Union[str, Any]      =							2
     while i * i <= n:
          __A	:       List[Any]      =							0
          while n % i == 0:
               n //= i
               multiplicity += 1
          n_divisors *= multiplicity + 1
          i += 1
     if n > 1:
          n_divisors *= 2
     return n_divisors


def 		_lowercase ():




     '''simple docstring'''





     __A	:       Optional[Any]      =							1
     __A	:       Dict      =							1

     while True:
          i += 1
          t_num += i

          if count_divisors(SCREAMING_SNAKE_CASE							) > 500:
               break

     return t_num


if __name__ == "__main__":
      print(solution())

