




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_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__						:       int							=    logging.get_logger(__name__)

class      UpperCAmelCase						(			_SCREAMING_SNAKE_CASE   ):
   __SCREAMING_SNAKE_CASE		:							List[str]							=					['pixel_values']






   def __init__(	self   :       Dict						,					UpperCamelCase_   :       bool = True						,					UpperCamelCase_   :       Dict[str, int] = None						,					UpperCamelCase_   :       PILImageResampling = PIL.Image.NEAREST						,					UpperCamelCase_   :       bool = False						,					UpperCamelCase_   :       Dict[str, int] = None						,					UpperCamelCase_   :       Union[int, float] = 1 / 2_55						,					UpperCamelCase_   :       bool = False						,					UpperCamelCase_   :       bool = True						,					UpperCamelCase_   :       bool = True						,					UpperCamelCase_   :       Optional[Union[float, List[float]]] = None						,					UpperCamelCase_   :       Optional[Union[float, List[float]]] = None						,					UpperCamelCase_   :       bool = True						,					**UpperCamelCase_   :       Optional[Any]						,					)->			Tuple:
     super().__init__(**UpperCamelCase__     )
     _lowercase: List[Any]						     =    size if size is not None else {'height': 3_46, 'width': 3_46}
     _lowercase: Optional[int]						     =    get_size_dict(UpperCamelCase__     )
     _lowercase: List[Any]						     =    crop_size if crop_size is not None else {'height': 2_89, 'width': 2_89}
     _lowercase: Dict						     =    get_size_dict(UpperCamelCase__						,					param_name='crop_size'     )

     _lowercase: Optional[int]						     =    do_resize
     _lowercase: List[str]						     =    size
     _lowercase: Any						     =    resample
     _lowercase: Optional[int]						     =    do_center_crop
     _lowercase: Tuple						     =    crop_size
     _lowercase: Optional[Any]						     =    do_rescale
     _lowercase: List[str]						     =    rescale_factor
     _lowercase: Tuple						     =    rescale_offset
     _lowercase: Tuple						     =    do_normalize
     _lowercase: List[Any]						     =    image_mean if image_mean is not None else IMAGENET_STANDARD_MEAN
     _lowercase: Optional[Any]						     =    image_std if image_std is not None else IMAGENET_STANDARD_STD
     _lowercase: str						     =    include_top






   def  _a						(	self   :       Dict						,					UpperCamelCase_   :       np.ndarray						,					UpperCamelCase_   :       Dict[str, int]						,					UpperCamelCase_   :       PILImageResampling = PIL.Image.NEAREST						,					UpperCamelCase_   :       Optional[Union[str, ChannelDimension]] = None						,					**UpperCamelCase_   :       List[Any]						,					)->			Optional[Any]:
     _lowercase: Optional[Any]						     =    get_size_dict(UpperCamelCase__     )
     if "height" not in size or "width" not in size:
       raise ValueError(f'The size dictionary must have keys \'height\' and \'width\'. Got {size.keys()}'     )
     return resize(
         UpperCamelCase__						,					size=(size['height'], size['width'])						,					resample=UpperCamelCase__						,					data_format=UpperCamelCase__						,					**UpperCamelCase__     )






   def  _a						(	self   :       Union[str, Any]						,					UpperCamelCase_   :       np.ndarray						,					UpperCamelCase_   :       Dict[str, int]						,					UpperCamelCase_   :       Optional[Union[str, ChannelDimension]] = None						,					**UpperCamelCase_   :       Optional[int]						,					)->			str:
     _lowercase: List[str]						     =    get_size_dict(UpperCamelCase__     )
     if "height" not in size or "width" not in size:
       raise ValueError(f'The size dictionary must have keys \'height\' and \'width\'. Got {size.keys()}'     )
     return center_crop(UpperCamelCase__						,					size=(size['height'], size['width'])						,					data_format=UpperCamelCase__						,					**UpperCamelCase__     )






   def  _a						(	self   :       Tuple						,					UpperCamelCase_   :       np.ndarray						,					UpperCamelCase_   :       Union[int, float]						,					UpperCamelCase_   :       bool = True						,					UpperCamelCase_   :       Optional[Union[str, ChannelDimension]] = None						,					**UpperCamelCase_   :       Union[str, Any]						,					)->			Optional[int]:
     if offset:
       _lowercase: List[str]						     =    (image - 127.5) * scale
       if data_format is not None:
         _lowercase: Optional[Any]						     =    to_channel_dimension_format(UpperCamelCase__						,					UpperCamelCase__     )
       _lowercase: Union[str, Any]						     =    rescaled_image.astype(np.floataa     )
     else:
       _lowercase: List[str]						     =    rescale(UpperCamelCase__						,					scale=UpperCamelCase__						,					data_format=UpperCamelCase__						,					**UpperCamelCase__     )
     return rescaled_image






   def  _a						(	self   :       Tuple						,					UpperCamelCase_   :       np.ndarray						,					UpperCamelCase_   :       Union[float, List[float]]						,					UpperCamelCase_   :       Union[float, List[float]]						,					UpperCamelCase_   :       Optional[Union[str, ChannelDimension]] = None						,					**UpperCamelCase_   :       List[str]						,					)->			List[Any]:
     return normalize(UpperCamelCase__						,					mean=UpperCamelCase__						,					std=UpperCamelCase__						,					data_format=UpperCamelCase__						,					**UpperCamelCase__     )






   def  _a						(	self   :       Optional[int]						,					UpperCamelCase_   :       ImageInput						,					UpperCamelCase_   :       bool = None						,					UpperCamelCase_   :       Dict[str, int] = None						,					UpperCamelCase_   :       int=None						,					UpperCamelCase_   :       bool = None						,					UpperCamelCase_   :       Dict[str, int] = None						,					UpperCamelCase_   :       bool = None						,					UpperCamelCase_   :       float = None						,					UpperCamelCase_   :       bool = None						,					UpperCamelCase_   :       bool = None						,					UpperCamelCase_   :       Optional[Union[float, List[float]]] = None						,					UpperCamelCase_   :       Optional[Union[float, List[float]]] = None						,					UpperCamelCase_   :       bool = None						,					UpperCamelCase_   :       Optional[Union[str, TensorType]] = None						,					UpperCamelCase_   :       ChannelDimension = ChannelDimension.FIRST						,					**UpperCamelCase_   :       List[Any]						,					)->			Any:
     _lowercase: List[str]						     =    do_resize if do_resize is not None else self.do_resize
     _lowercase: Optional[int]						     =    resample if resample is not None else self.resample
     _lowercase: List[str]						     =    do_center_crop if do_center_crop is not None else self.do_center_crop
     _lowercase: List[Any]						     =    do_rescale if do_rescale is not None else self.do_rescale
     _lowercase: List[Any]						     =    rescale_factor if rescale_factor is not None else self.rescale_factor
     _lowercase: Union[str, Any]						     =    rescale_offset if rescale_offset is not None else self.rescale_offset
     _lowercase: Union[str, Any]						     =    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: str						     =    image_std if image_std is not None else self.image_std
     _lowercase: int						     =    include_top if include_top is not None else self.include_top

     _lowercase: Union[str, Any]						     =    size if size is not None else self.size
     _lowercase: Dict						     =    get_size_dict(UpperCamelCase__     )
     _lowercase: Dict						     =    crop_size if crop_size is not None else self.crop_size
     _lowercase: Any						     =    get_size_dict(UpperCamelCase__						,					param_name='crop_size'     )

     _lowercase: List[str]						     =    make_list_of_images(UpperCamelCase__     )

     if not valid_images(UpperCamelCase__     ):
       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_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: Dict						     =    [to_numpy_array(UpperCamelCase__     ) for image in images]

     if do_resize:
       _lowercase: str						     =    [self.resize(image=UpperCamelCase__						,					size=UpperCamelCase__						,					resample=UpperCamelCase__     ) for image in images]

     if do_center_crop:
       _lowercase: List[str]						     =    [self.center_crop(image=UpperCamelCase__						,					size=UpperCamelCase__     ) for image in images]

     if do_rescale:
       _lowercase: List[Any]						     =    [self.rescale(image=UpperCamelCase__						,					scale=UpperCamelCase__						,					offset=UpperCamelCase__     ) for image in images]

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

     if include_top:
       _lowercase: Any						     =    [self.normalize(image=UpperCamelCase__						,					mean=[0, 0, 0]						,					std=UpperCamelCase__     ) for image in images]

     _lowercase: Optional[int]						     =    [to_channel_dimension_format(UpperCamelCase__						,					UpperCamelCase__     ) for image in images]

     _lowercase: List[Any]						     =    {'pixel_values': images}
     return BatchFeature(data=UpperCamelCase__						,					tensor_type=UpperCamelCase__     )






import math


def 		_lowerCamelCase				(					UpperCamelCase							)			->		int:





  """simple docstring"""





  return sum(int(UpperCamelCase							) for digit in str(UpperCamelCase							)							)


def 		_lowerCamelCase				(					UpperCamelCase = 30							)			->		int:





  """simple docstring"""





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

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


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