




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






       def __init__(      self:    Optional[Any]				,    _lowerCAmelCase:    Any				,    _lowerCAmelCase:    Any=7				,    _lowerCAmelCase:    Union[str, Any]=3				,    _lowerCAmelCase:    List[Any]=18				,    _lowerCAmelCase:    int=30				,    _lowerCAmelCase:    Dict=4_00				,    _lowerCAmelCase:    Optional[Any]=True				,    _lowerCAmelCase:    List[Any]=None				,    _lowerCAmelCase:    List[str]=True				,    _lowerCAmelCase:    Optional[int]=None				,    _lowerCAmelCase:    Optional[Any]=True				,    ):
         lowercase			:Optional[Any]							=  size if size is not None else {"shortest_edge": 20}
         lowercase			:Union[str, Any]							=  crop_size if crop_size is not None else {"height": 18, "width": 18}
         lowercase			:Optional[int]							=  parent
         lowercase			:Tuple							=  batch_size
         lowercase			:List[Any]							=  num_channels
         lowercase			:Optional[int]							=  image_size
         lowercase			:Any							=  min_resolution
         lowercase			:List[Any]							=  max_resolution
         lowercase			:List[str]							=  do_resize
         lowercase			:List[str]							=  size
         lowercase			:Any							=  do_center_crop
         lowercase			:Optional[int]							=  crop_size
         lowercase			:Dict							=  do_flip_channel_order






       def     SCREAMING_SNAKE_CASE			(      self:    Dict ):
         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       __lowerCAmelCase				(							lowerCAmelCase					,       unittest.TestCase):
       _a           =  MobileViTImageProcessor if is_vision_available() else None






       def     SCREAMING_SNAKE_CASE			(      self:    Optional[Any] ):
         lowercase			:str							=  MobileViTImageProcessingTester(self )






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






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






       def     SCREAMING_SNAKE_CASE			(      self:    Optional[Any] ):
         lowercase			:Tuple							=  self.image_processing_class.from_dict(self.image_processor_dict )
         self.assertEqual(image_processor.size				,    {"shortest_edge": 20} )
         self.assertEqual(image_processor.crop_size				,    {"height": 18, "width": 18} )

         lowercase			:List[str]							=  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     SCREAMING_SNAKE_CASE			(      self:    int ):
         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			:Dict							=  prepare_image_inputs(self.image_processor_tester				,    equal_resolution=_lowerCAmelCase )
         for image in image_inputs:
           self.assertIsInstance(_lowerCAmelCase				,    Image.Image )

         # Test not batched input
         lowercase			: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
         lowercase			:Optional[Any]							=  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     SCREAMING_SNAKE_CASE			(      self:    Optional[int] ):
         # Initialize image_processing
         lowercase			:Tuple							=  self.image_processing_class(**self.image_processor_dict )
         # create random numpy tensors
         lowercase			:Dict							=  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
         lowercase			:Tuple							=  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
         lowercase			:List[str]							=  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     SCREAMING_SNAKE_CASE			(      self:    Any ):
         # Initialize image_processing
         lowercase			:Dict							=  self.image_processing_class(**self.image_processor_dict )
         # create random PyTorch tensors
         lowercase			:Tuple							=  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
         lowercase			: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
         lowercase			:Optional[int]							=  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"],
             )				,    )









_UpperCAmelCase		:  Tuple	=   {str(digit): digit**5 for digit in range(10)}



def 					UpperCAmelCase__     (   lowerCamelCase      ):
  return sum(DIGITS_FIFTH_POWER[digit] for digit in str(lowerCamelCase      )      )



def 					UpperCAmelCase__     (   ):
  return sum(
      number
      for number in range(1000,	1000000      )
      if number == digits_fifth_powers_sum(lowerCamelCase      )      )


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



