from typing import Dict, List, Optional, Union

import numpy as np

from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
from ...image_transforms import (
    center_crop,
    get_resize_output_image_size,
    normalize,
    rescale,
    resize,
    to_channel_dimension_format,
)
from ...image_utils import (
    IMAGENET_STANDARD_MEAN,
    IMAGENET_STANDARD_STD,
    ChannelDimension,
    ImageInput,
    PILImageResampling,
    is_valid_image,
    to_numpy_array,
    valid_images,
)
from ...utils import TensorType, is_vision_available, logging


if is_vision_available():
     import PIL


lowerCamelCase__    :		Optional[Any]          =   logging.get_logger(__name__)

def 		UpperCamelCase	(      lowercase_   )		->	List[List[ImageInput]]:


  '''simple docstring'''






  if isinstance(lowercase_ , (list, tuple)   ) and isinstance(videos[0] , (list, tuple)   ) and is_valid_image(videos[0][0]   ):
    return videos

  elif isinstance(lowercase_ , (list, tuple)   ) and is_valid_image(videos[0]   ):
    return [videos]

  elif is_valid_image(lowercase_   ):
    return [[videos]]

  raise ValueError(F'Could not make batched video from {videos}'   )



class       _snake_case   (	UpperCAmelCase_							):
 __lowerCAmelCase  :     List[Any]        =			['pixel_values']


 def __init__(					self					,  SCREAMING_SNAKE_CASE_ = True					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = PILImageResampling.BILINEAR					,  SCREAMING_SNAKE_CASE_ = True					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = True					,  SCREAMING_SNAKE_CASE_ = 1 / 2_55					,  SCREAMING_SNAKE_CASE_ = True					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  **SCREAMING_SNAKE_CASE_					,  ):


   '''simple docstring'''




   super().__init__(**SCREAMING_SNAKE_CASE_)
   lowercase__  :   Dict    		=      size if size is not None else {"""shortest_edge""": 2_24}
   lowercase__  :   Optional[Any]    		=      get_size_dict(SCREAMING_SNAKE_CASE_					,  default_to_square=SCREAMING_SNAKE_CASE_)
   lowercase__  :   Union[str, Any]    		=      crop_size if crop_size is not None else {"""height""": 2_24, """width""": 2_24}
   lowercase__  :   int    		=      get_size_dict(SCREAMING_SNAKE_CASE_					,  param_name="""crop_size""")

   lowercase__  :   Optional[Any]    		=      do_resize
   lowercase__  :   Dict    		=      size
   lowercase__  :   List[Any]    		=      do_center_crop
   lowercase__  :   Any    		=      crop_size
   lowercase__  :   Optional[int]    		=      resample
   lowercase__  :   Union[str, Any]    		=      do_rescale
   lowercase__  :   Optional[int]    		=      rescale_factor
   lowercase__  :   str    		=      do_normalize
   lowercase__  :   Tuple    		=      image_mean if image_mean is not None else IMAGENET_STANDARD_MEAN
   lowercase__  :   List[str]    		=      image_std if image_std is not None else IMAGENET_STANDARD_STD


 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_ = PILImageResampling.BILINEAR					,  SCREAMING_SNAKE_CASE_ = None					,  **SCREAMING_SNAKE_CASE_					,  ):


   '''simple docstring'''




   lowercase__  :   str    		=      get_size_dict(SCREAMING_SNAKE_CASE_					,  default_to_square=SCREAMING_SNAKE_CASE_)
   if "shortest_edge" in size:
     lowercase__  :   List[Any]    		=      get_resize_output_image_size(SCREAMING_SNAKE_CASE_					,  size["""shortest_edge"""]					,  default_to_square=SCREAMING_SNAKE_CASE_)
   elif "height" in size and "width" in size:
     lowercase__  :   Any    		=      (size["""height"""], size["""width"""])
   else:
     raise ValueError(f'Size must have \'height\' and \'width\' or \'shortest_edge\' as keys. Got {size.keys()}')
   return resize(SCREAMING_SNAKE_CASE_					,  size=SCREAMING_SNAKE_CASE_					,  resample=SCREAMING_SNAKE_CASE_					,  data_format=SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_)


 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_ = None					,  **SCREAMING_SNAKE_CASE_					,  ):


   '''simple docstring'''




   lowercase__  :   List[Any]    		=      get_size_dict(SCREAMING_SNAKE_CASE_)
   if "height" not in size or "width" not in size:
     raise ValueError(f'Size must have \'height\' and \'width\' as keys. Got {size.keys()}')
   return center_crop(SCREAMING_SNAKE_CASE_					,  size=(size["""height"""], size["""width"""])					,  data_format=SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_)


 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_ = None					,  **SCREAMING_SNAKE_CASE_					,  ):


   '''simple docstring'''




   return rescale(SCREAMING_SNAKE_CASE_					,  scale=SCREAMING_SNAKE_CASE_					,  data_format=SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_)


 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_ = None					,  **SCREAMING_SNAKE_CASE_					,  ):


   '''simple docstring'''




   return normalize(SCREAMING_SNAKE_CASE_					,  mean=SCREAMING_SNAKE_CASE_					,  std=SCREAMING_SNAKE_CASE_					,  data_format=SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_)


 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = ChannelDimension.FIRST					,  ):


   '''simple docstring'''




   if do_resize and size is None or resample is None:
     raise ValueError("""Size and resample must be specified if do_resize is True.""")

   if do_center_crop and crop_size is None:
     raise ValueError("""Crop size must be specified if do_center_crop is True.""")

   if do_rescale and rescale_factor is None:
     raise ValueError("""Rescale factor must be specified if do_rescale is True.""")

   if do_normalize and (image_mean is None or image_std is None):
     raise ValueError("""Image mean and std must be specified if do_normalize is True.""")

   # All transformations expect numpy arrays.
   lowercase__  :   Optional[Any]    		=      to_numpy_array(SCREAMING_SNAKE_CASE_)

   if do_resize:
     lowercase__  :   Tuple    		=      self.resize(image=SCREAMING_SNAKE_CASE_					,  size=SCREAMING_SNAKE_CASE_					,  resample=SCREAMING_SNAKE_CASE_)

   if do_center_crop:
     lowercase__  :   Tuple    		=      self.center_crop(SCREAMING_SNAKE_CASE_					,  size=SCREAMING_SNAKE_CASE_)

   if do_rescale:
     lowercase__  :   Tuple    		=      self.rescale(image=SCREAMING_SNAKE_CASE_					,  scale=SCREAMING_SNAKE_CASE_)

   if do_normalize:
     lowercase__  :   List[Any]    		=      self.normalize(image=SCREAMING_SNAKE_CASE_					,  mean=SCREAMING_SNAKE_CASE_					,  std=SCREAMING_SNAKE_CASE_)

   lowercase__  :   Optional[int]    		=      to_channel_dimension_format(SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_)
   return image



 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = None					,  SCREAMING_SNAKE_CASE_ = ChannelDimension.FIRST					,  **SCREAMING_SNAKE_CASE_					,  ):


   '''simple docstring'''




   lowercase__  :   List[str]    		=      do_resize if do_resize is not None else self.do_resize
   lowercase__  :   Union[str, Any]    		=      resample if resample is not None else self.resample
   lowercase__  :   int    		=      do_center_crop if do_center_crop is not None else self.do_center_crop
   lowercase__  :   Any    		=      do_rescale if do_rescale is not None else self.do_rescale
   lowercase__  :   Optional[Any]    		=      rescale_factor if rescale_factor is not None else self.rescale_factor
   lowercase__  :   Dict    		=      do_normalize if do_normalize is not None else self.do_normalize
   lowercase__  :   Dict    		=      image_mean if image_mean is not None else self.image_mean
   lowercase__  :   List[Any]    		=      image_std if image_std is not None else self.image_std

   lowercase__  :   List[Any]    		=      size if size is not None else self.size
   lowercase__  :   List[str]    		=      get_size_dict(SCREAMING_SNAKE_CASE_					,  default_to_square=SCREAMING_SNAKE_CASE_)
   lowercase__  :   List[Any]    		=      crop_size if crop_size is not None else self.crop_size
   lowercase__  :   Any    		=      get_size_dict(SCREAMING_SNAKE_CASE_					,  param_name="""crop_size""")

   if not valid_images(SCREAMING_SNAKE_CASE_):
     raise ValueError(
         """Invalid image type. Must be of type PIL.Image.Image, numpy.ndarray, """
         """torch.Tensor, tf.Tensor or jax.ndarray.""")

   lowercase__  :   Optional[Any]    		=      make_batched(SCREAMING_SNAKE_CASE_)

   lowercase__  :   Optional[Any]    		=      [
       [
           self._preprocess_image(
               image=SCREAMING_SNAKE_CASE_					,  do_resize=SCREAMING_SNAKE_CASE_					,  size=SCREAMING_SNAKE_CASE_					,  resample=SCREAMING_SNAKE_CASE_					,  do_center_crop=SCREAMING_SNAKE_CASE_					,  crop_size=SCREAMING_SNAKE_CASE_					,  do_rescale=SCREAMING_SNAKE_CASE_					,  rescale_factor=SCREAMING_SNAKE_CASE_					,  do_normalize=SCREAMING_SNAKE_CASE_					,  image_mean=SCREAMING_SNAKE_CASE_					,  image_std=SCREAMING_SNAKE_CASE_					,  data_format=SCREAMING_SNAKE_CASE_					,  )
           for img in video
       ]
       for video in videos
   ]

   lowercase__  :   str    		=      {"""pixel_values""": videos}
   return BatchFeature(data=SCREAMING_SNAKE_CASE_					,  tensor_type=SCREAMING_SNAKE_CASE_)








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() = }''')






