


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,
    make_list_of_images,
    to_numpy_array,
    valid_images,
)
from ...utils import TensorType, is_vision_available, logging


if is_vision_available():
						import PIL


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







class  snake_case__(							lowerCAmelCase__							):







						'''simple docstring'''




						SCREAMING_SNAKE_CASE__					:     Union[str, Any]    =							["""pixel_values"""]




						def __init__( self      ,  __lowercase = True      ,  __lowercase = None      ,  __lowercase = None      ,  __lowercase = PILImageResampling.BILINEAR      ,  __lowercase = True      ,  __lowercase = 1 / 2_5_5      ,  __lowercase = True      ,  __lowercase = None      ,  __lowercase = None      ,  **__lowercase      ,  )    ->			Dict:
										super().__init__(**lowercase_							)
										lowerCAmelCase_       :					Optional[int]			 = size if size is not None else {'''shortest_edge''': 3_8_4}
										lowerCAmelCase_       :					Dict			 = get_size_dict(lowercase_      ,  default_to_square=lowercase_							)

										lowerCAmelCase_       :					List[Any]			 = do_resize
										lowerCAmelCase_       :					str			 = size
										# Default value set here for backwards compatibility where the value in config is None
										lowerCAmelCase_       :					Optional[Any]			 = crop_pct if crop_pct is not None else 2_2_4 / 2_5_6
										lowerCAmelCase_       :					Optional[int]			 = resample
										lowerCAmelCase_       :					Any			 = do_rescale
										lowerCAmelCase_       :					Any			 = rescale_factor
										lowerCAmelCase_       :					Optional[Any]			 = do_normalize
										lowerCAmelCase_       :					Tuple			 = image_mean if image_mean is not None else IMAGENET_STANDARD_MEAN
										lowerCAmelCase_       :					Tuple			 = image_std if image_std is not None else IMAGENET_STANDARD_STD




						def   lowercase_       ( self      ,  __lowercase      ,  __lowercase      ,  __lowercase      ,  __lowercase = PILImageResampling.BICUBIC      ,  __lowercase = None      ,  **__lowercase      ,  )    ->			List[str]:
										lowerCAmelCase_       :					int			 = get_size_dict(lowercase_      ,  default_to_square=lowercase_							)
										if "shortest_edge" not in size:
														raise ValueError(f"""Size dictionary must contain 'shortest_edge' key. Got {size.keys()}"""							)
										lowerCAmelCase_       :					Any			 = size['''shortest_edge''']

										if shortest_edge < 3_8_4:
														# maintain same ratio, resizing shortest edge to shortest_edge/crop_pct
														lowerCAmelCase_       :					int			 = int(shortest_edge / crop_pct							)
														lowerCAmelCase_       :					Tuple			 = get_resize_output_image_size(lowercase_      ,  size=lowercase_      ,  default_to_square=lowercase_							)
														lowerCAmelCase_       :					str			 = resize(image=lowercase_      ,  size=lowercase_      ,  resample=lowercase_      ,  data_format=lowercase_      ,  **lowercase_							)
														# then crop to (shortest_edge, shortest_edge)
														return center_crop(image=lowercase_      ,  size=(shortest_edge, shortest_edge)      ,  data_format=lowercase_      ,  **lowercase_							)
										else:
														# warping (no cropping) when evaluated at 384 or larger
														return resize(
														    lowercase_      ,  size=(shortest_edge, shortest_edge)      ,  resample=lowercase_      ,  data_format=lowercase_      ,  **lowercase_							)




						def   lowercase_       ( self      ,  __lowercase      ,  __lowercase      ,  __lowercase = None      ,  **__lowercase      ,  )    ->			Optional[int]:
										return rescale(lowercase_      ,  scale=lowercase_      ,  data_format=lowercase_      ,  **lowercase_							)




						def   lowercase_       ( self      ,  __lowercase      ,  __lowercase      ,  __lowercase      ,  __lowercase = None      ,  **__lowercase      ,  )    ->			int:
										return normalize(lowercase_      ,  mean=lowercase_      ,  std=lowercase_      ,  data_format=lowercase_      ,  **lowercase_							)




						def   lowercase_       ( self      ,  __lowercase      ,  __lowercase = None      ,  __lowercase = None      ,  __lowercase = None      ,  __lowercase = None      ,  __lowercase = None      ,  __lowercase = None      ,  __lowercase = None      ,  __lowercase = None      ,  __lowercase = None      ,  __lowercase = None      ,  __lowercase = ChannelDimension.FIRST      ,  **__lowercase      ,  )    ->			Tuple:
										lowerCAmelCase_       :					Dict			 = do_resize if do_resize is not None else self.do_resize
										lowerCAmelCase_       :					Tuple			 = crop_pct if crop_pct is not None else self.crop_pct
										lowerCAmelCase_       :					Any			 = resample if resample is not None else self.resample
										lowerCAmelCase_       :					List[Any]			 = do_rescale if do_rescale is not None else self.do_rescale
										lowerCAmelCase_       :					Optional[int]			 = rescale_factor if rescale_factor is not None else self.rescale_factor
										lowerCAmelCase_       :					List[str]			 = do_normalize if do_normalize is not None else self.do_normalize
										lowerCAmelCase_       :					Optional[int]			 = image_mean if image_mean is not None else self.image_mean
										lowerCAmelCase_       :					List[Any]			 = image_std if image_std is not None else self.image_std

										lowerCAmelCase_       :					Optional[Any]			 = size if size is not None else self.size
										lowerCAmelCase_       :					List[str]			 = get_size_dict(lowercase_      ,  default_to_square=lowercase_							)

										lowerCAmelCase_       :					List[Any]			 = make_list_of_images(lowercase_							)

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

										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_resize and size["shortest_edge"] < 3_8_4 and crop_pct is None:
														raise ValueError('''crop_pct must be specified if size < 384.'''							)

										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.
										lowerCAmelCase_       :					str			 = [to_numpy_array(lowercase_							) for image in images]

										if do_resize:
														lowerCAmelCase_       :					Optional[Any]			 = [self.resize(image=lowercase_      ,  size=lowercase_      ,  crop_pct=lowercase_      ,  resample=lowercase_							) for image in images]

										if do_rescale:
														lowerCAmelCase_       :					Any			 = [self.rescale(image=lowercase_      ,  scale=lowercase_							) for image in images]

										if do_normalize:
														lowerCAmelCase_       :					str			 = [self.normalize(image=lowercase_      ,  mean=lowercase_      ,  std=lowercase_							) for image in images]

										lowerCAmelCase_       :					Optional[int]			 = [to_channel_dimension_format(lowercase_      ,  lowercase_							) for image in images]

										lowerCAmelCase_       :					Optional[Any]			 = {'''pixel_values''': images}
										return BatchFeature(data=lowercase_      ,  tensor_type=lowercase_							)




"""simple docstring"""

import sys

lowercase__    :  Dict							    =	(
    '''73167176531330624919225119674426574742355349194934'''
    '''96983520312774506326239578318016984801869478851843'''
    '''85861560789112949495459501737958331952853208805511'''
    '''12540698747158523863050715693290963295227443043557'''
    '''66896648950445244523161731856403098711121722383113'''
    '''62229893423380308135336276614282806444486645238749'''
    '''30358907296290491560440772390713810515859307960866'''
    '''70172427121883998797908792274921901699720888093776'''
    '''65727333001053367881220235421809751254540594752243'''
    '''52584907711670556013604839586446706324415722155397'''
    '''53697817977846174064955149290862569321978468622482'''
    '''83972241375657056057490261407972968652414535100474'''
    '''82166370484403199890008895243450658541227588666881'''
    '''16427171479924442928230863465674813919123162824586'''
    '''17866458359124566529476545682848912883142607690042'''
    '''24219022671055626321111109370544217506941658960408'''
    '''07198403850962455444362981230987879927244284909188'''
    '''84580156166097919133875499200524063689912560717606'''
    '''05886116467109405077541002256983155200055935729725'''
    '''71636269561882670428252483600823257530420752963450'''
)




def __lowercase			(							_a    ):
    snake_case_ :     List[Any]				=	1
    for digit in s:
        product *= int(_a    )
    return product




def __lowercase			(							_a = N    ):
    snake_case_ :     Optional[int]				=	-sys.maxsize - 1
    snake_case_ :     str				=	n[:13]
    snake_case_ :     List[Any]				=	13
    while cur_index < len(_a    ) - 13:
        if int(n[cur_index]    ) >= int(substr[0]    ):
            snake_case_ :     int				=	substr[1:] + n[cur_index]
            cur_index += 1
        else:
            snake_case_ :     Optional[Any]				=	max(_a		,			str_eval(_a    )    )
            snake_case_ :     Any				=	n[cur_index : cur_index + 13]
            cur_index += 13
    return largest_product


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





