
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 LevitImageProcessor



class       _snake_case   (	unittest.TestCase							):


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


   '''simple docstring'''




   lowercase__  :   List[Any]    		=      size if size is not None else {"""shortest_edge""": 18}
   lowercase__  :   List[str]    		=      crop_size if crop_size is not None else {"""height""": 18, """width""": 18}
   lowercase__  :   Dict    		=      parent
   lowercase__  :   Dict    		=      batch_size
   lowercase__  :   int    		=      num_channels
   lowercase__  :   List[str]    		=      image_size
   lowercase__  :   Dict    		=      min_resolution
   lowercase__  :   str    		=      max_resolution
   lowercase__  :   Optional[Any]    		=      do_resize
   lowercase__  :   List[str]    		=      size
   lowercase__  :   List[str]    		=      do_center_crop
   lowercase__  :   Tuple    		=      crop_size
   lowercase__  :   Optional[Any]    		=      do_normalize
   lowercase__  :   List[Any]    		=      image_mean
   lowercase__  :   Optional[Any]    		=      image_std



 def      lowercase__     (					self):


   '''simple docstring'''




   return {
       "image_mean": self.image_mean,
       "image_std": self.image_std,
       "do_normalize": self.do_normalize,
       "do_resize": self.do_resize,
       "do_center_crop": self.do_center_crop,
       "size": self.size,
       "crop_size": self.crop_size,
   }



@require_torch
@require_vision
class       _snake_case   (	UpperCAmelCase_  ,						unittest.TestCase							):
 __lowerCAmelCase  :     Any        =			LevitImageProcessor if is_vision_available() else None


 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   Optional[Any]    		=      LevitImageProcessingTester(self)


 @property
 def      lowercase__     (					self):


   '''simple docstring'''




   return self.image_processor_tester.prepare_image_processor_dict()


 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   List[Any]    		=      self.image_processing_class(**self.image_processor_dict)
   self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_					,  """image_mean"""))
   self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_					,  """image_std"""))
   self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_					,  """do_normalize"""))
   self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_					,  """do_resize"""))
   self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_					,  """do_center_crop"""))
   self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_					,  """size"""))


 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   List[Any]    		=      self.image_processing_class.from_dict(self.image_processor_dict)
   self.assertEqual(image_processor.size					,  {"""shortest_edge""": 18})
   self.assertEqual(image_processor.crop_size					,  {"""height""": 18, """width""": 18})

   lowercase__  :   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      lowercase__     (					self):


   '''simple docstring'''




   pass


 def      lowercase__     (					self):


   '''simple docstring'''




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

   # Test not batched input
   lowercase__  :   Optional[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
   lowercase__  :   str    		=      image_processing(SCREAMING_SNAKE_CASE_					,  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      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   Tuple    		=      self.image_processing_class(**self.image_processor_dict)
   # create random numpy tensors
   lowercase__  :   List[Any]    		=      prepare_image_inputs(self.image_processor_tester					,  equal_resolution=SCREAMING_SNAKE_CASE_					,  numpify=SCREAMING_SNAKE_CASE_)
   for image in image_inputs:
     self.assertIsInstance(SCREAMING_SNAKE_CASE_					,  np.ndarray)

   # Test not batched input
   lowercase__  :   Optional[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(SCREAMING_SNAKE_CASE_					,  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      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   List[Any]    		=      self.image_processing_class(**self.image_processor_dict)
   # create random PyTorch tensors
   lowercase__  :   List[Any]    		=      prepare_image_inputs(self.image_processor_tester					,  equal_resolution=SCREAMING_SNAKE_CASE_					,  torchify=SCREAMING_SNAKE_CASE_)
   for image in image_inputs:
     self.assertIsInstance(SCREAMING_SNAKE_CASE_					,  torch.Tensor)

   # Test not batched input
   lowercase__  :   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
   lowercase__  :   List[str]    		=      image_processing(SCREAMING_SNAKE_CASE_					,  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"""],
       )					,  )








import sys

lowerCamelCase__    :		List[Any]          =   (
    """73167176531330624919225119674426574742355349194934"""
    """96983520312774506326239578318016984801869478851843"""
    """85861560789112949495459501737958331952853208805511"""
    """12540698747158523863050715693290963295227443043557"""
    """66896648950445244523161731856403098711121722383113"""
    """62229893423380308135336276614282806444486645238749"""
    """30358907296290491560440772390713810515859307960866"""
    """70172427121883998797908792274921901699720888093776"""
    """65727333001053367881220235421809751254540594752243"""
    """52584907711670556013604839586446706324415722155397"""
    """53697817977846174064955149290862569321978468622482"""
    """83972241375657056057490261407972968652414535100474"""
    """82166370484403199890008895243450658541227588666881"""
    """16427171479924442928230863465674813919123162824586"""
    """17866458359124566529476545682848912883142607690042"""
    """24219022671055626321111109370544217506941658960408"""
    """07198403850962455444362981230987879927244284909188"""
    """84580156166097919133875499200524063689912560717606"""
    """05886116467109405077541002256983155200055935729725"""
    """71636269561882670428252483600823257530420752963450"""
)

def 		UpperCamelCase	(      lowercase_ = N   )		->	int:


  '''simple docstring'''






  lowercase__  :   int    		=      -sys.maxsize - 1
  for i in range(len(lowercase_   ) - 12   ):
    lowercase__  :   Optional[int]    		=      1
    for j in range(13   ):
      product *= int(n[i + j]   )
    if product > largest_product:
      lowercase__  :   int    		=      product
  return largest_product


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






