





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, normalize, rescale, resize, to_channel_dimension_format
from ...image_utils import (
    IMAGENET_DEFAULT_MEAN,
    IMAGENET_DEFAULT_STD,
    ChannelDimension,
    ImageInput,
    PILImageResampling,
    get_image_size,
    make_list_of_images,
    to_numpy_array,
    valid_images,
)
from ...utils import TensorType, is_vision_available, logging


if is_vision_available():
      import PIL


__lowercase				    =      logging.get_logger(__name__)

class 	__snake_case					(      _a ):






    '''simple docstring'''
    _lowerCAmelCase  =						["""pixel_values"""]





    def __init__( self    :		int      ,    snake_case    :		Dict = True      ,    snake_case    :		List[str] = None      ,    snake_case    :		List[str] = True      ,    snake_case    :		str = None      ,    snake_case    :		str = PILImageResampling.BICUBIC      ,    snake_case    :		int = True      ,    snake_case    :		int = 1 / 255      ,    snake_case    :		List[str] = True      ,    snake_case    :		Tuple = None      ,    snake_case    :		Dict = None      ,    **snake_case    :		str      ,    ):

      """simple docstring"""





      super().__init__(**snake_case				)
      __lowerCAmelCase								=					crop_size if crop_size is not None else {'''height''': 256, '''width''': 256}
      __lowerCAmelCase								=					get_size_dict(snake_case      ,    param_name='''crop_size'''				)
      __lowerCAmelCase								=					size if size is not None else {'''height''': 224, '''width''': 224}
      __lowerCAmelCase								=					get_size_dict(snake_case				)

      __lowerCAmelCase								=					do_center_crop
      __lowerCAmelCase								=					crop_size
      __lowerCAmelCase								=					do_resize
      __lowerCAmelCase								=					size
      __lowerCAmelCase								=					resample
      __lowerCAmelCase								=					do_rescale
      __lowerCAmelCase								=					rescale_factor
      __lowerCAmelCase								=					do_normalize
      __lowerCAmelCase								=					image_mean if image_mean is not None else IMAGENET_DEFAULT_MEAN
      __lowerCAmelCase								=					image_std if image_std is not None else IMAGENET_DEFAULT_STD





    def 						A		( self    :		str      ,    snake_case    :		Union[str, Any]      ,    snake_case    :		List[Any]      ,    snake_case    :		int = None      ,    snake_case    :		str = None      ,    **snake_case    :		int      ,    ):

      """simple docstring"""





      __lowerCAmelCase								=					self.size if size is None else size
      __lowerCAmelCase								=					get_size_dict(snake_case				)
      __lowerCAmelCase								=					get_size_dict(snake_case      ,    param_name='''crop_size'''				)

      __lowerCAmelCase						,    __lowerCAmelCase								=					get_image_size(snake_case				)
      __lowerCAmelCase								=					min(snake_case      ,    snake_case				)
      __lowerCAmelCase								=					(size['''height'''] / crop_size['''height''']) * min_dim
      __lowerCAmelCase								=					(size['''width'''] / crop_size['''width''']) * min_dim
      return center_crop(snake_case      ,    size=(cropped_height, cropped_width)      ,    data_format=snake_case      ,    **snake_case				)





    def 						A		( self    :		Dict      ,    snake_case    :		str      ,    snake_case    :		Any      ,    snake_case    :		Dict = PIL.Image.BICUBIC      ,    snake_case    :		List[Any] = None      ,    **snake_case    :		Optional[int]      ,    ):

      """simple docstring"""





      __lowerCAmelCase								=					get_size_dict(snake_case				)
      if "height" not in size or "width" not in size:
        raise ValueError(f'''The size dictionary must contain the keys \'height\' and \'width\'. Got {size.keys()}'''				)
      return resize(
          snake_case      ,    size=(size['''height'''], size['''width'''])      ,    resample=snake_case      ,    data_format=snake_case      ,    **snake_case				)





    def 						A		( self    :		List[str]      ,    snake_case    :		Dict      ,    snake_case    :		Any      ,    snake_case    :		Optional[int] = None      ,    **snake_case    :		List[Any]      ,    ):

      """simple docstring"""





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





    def 						A		( self    :		Optional[Any]      ,    snake_case    :		Optional[int]      ,    snake_case    :		Dict      ,    snake_case    :		Optional[int]      ,    snake_case    :		Optional[int] = None      ,    **snake_case    :		str      ,    ):

      """simple docstring"""





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





    def 						A		( self    :		str      ,    snake_case    :		List[Any]      ,    snake_case    :		Dict = None      ,    snake_case    :		str = None      ,    snake_case    :		Any = None      ,    snake_case    :		List[str] = None      ,    snake_case    :		Optional[int] = None      ,    snake_case    :		Tuple = None      ,    snake_case    :		Dict = None      ,    snake_case    :		List[str] = None      ,    snake_case    :		Optional[Any] = None      ,    snake_case    :		List[Any] = None      ,    snake_case    :		int = None      ,    snake_case    :		int = ChannelDimension.FIRST      ,    **snake_case    :		Any      ,    ):

      """simple docstring"""





      __lowerCAmelCase								=					do_center_crop if do_center_crop is not None else self.do_center_crop
      __lowerCAmelCase								=					crop_size if crop_size is not None else self.crop_size
      __lowerCAmelCase								=					get_size_dict(snake_case      ,    param_name='''crop_size'''				)
      __lowerCAmelCase								=					do_resize if do_resize is not None else self.do_resize
      __lowerCAmelCase								=					size if size is not None else self.size
      __lowerCAmelCase								=					get_size_dict(snake_case				)
      __lowerCAmelCase								=					resample if resample is not None else self.resample
      __lowerCAmelCase								=					do_rescale if do_rescale is not None else self.do_rescale
      __lowerCAmelCase								=					rescale_factor if rescale_factor is not None else self.rescale_factor
      __lowerCAmelCase								=					do_normalize if do_normalize is not None else self.do_normalize
      __lowerCAmelCase								=					image_mean if image_mean is not None else self.image_mean
      __lowerCAmelCase								=					image_std if image_std is not None else self.image_std

      __lowerCAmelCase								=					make_list_of_images(snake_case				)

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

      if do_center_crop and crop_size is None:
        raise ValueError('''If `do_center_crop` is set to `True`, `crop_size` must be provided.'''				)

      if do_resize and size is None:
        raise ValueError('''Size must be specified if do_resize 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 image standard deviation must be specified if do_normalize is True.'''				)

      # All transformations expect numpy arrays.
      __lowerCAmelCase								=					[to_numpy_array(snake_case				) for image in images]

      if do_center_crop:
        __lowerCAmelCase								=					[self.center_crop(snake_case      ,    snake_case      ,    size=snake_case				) for image in images]

      if do_resize:
        __lowerCAmelCase								=					[self.resize(image=snake_case      ,    size=snake_case      ,    resample=snake_case				) for image in images]

      if do_rescale:
        __lowerCAmelCase								=					[self.rescale(image=snake_case      ,    scale=snake_case				) for image in images]

      if do_normalize:
        __lowerCAmelCase								=					[self.normalize(image=snake_case      ,    mean=snake_case      ,    std=snake_case				) for image in images]

      __lowerCAmelCase								=					[to_channel_dimension_format(snake_case      ,    snake_case				) for image in images]

      __lowerCAmelCase								=					{'''pixel_values''': images}
      return BatchFeature(data=snake_case      ,    tensor_type=snake_case				)




import math
def 							UpperCAmelCase_   (				__snake_case		)	->     int:







 """simple docstring"""


 return sum(int(__snake_case		) for digit in str(__snake_case		)		)
def 							UpperCAmelCase_   (				__snake_case = 30		)	->     int:







 """simple docstring"""


 _lowercase				 =[]
 for digit in range(2	,		100		):
  for power in range(2	,		100		):
   _lowercase				 =int(math.pow(__snake_case	,		__snake_case		)		)
   if digit == digit_sum(__snake_case		):
    digit_to_powers.append(__snake_case		)

 digit_to_powers.sort()
 return digit_to_powers[n - 1]


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

