


'''simple docstring'''
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,
    convert_to_rgb,
    get_resize_output_image_size,
    normalize,
    rescale,
    resize,
    to_channel_dimension_format,
)
from ...image_utils import (
    OPENAI_CLIP_MEAN,
    OPENAI_CLIP_STD,
    ChannelDimension,
    ImageInput,
    PILImageResampling,
    make_list_of_images,
    to_numpy_array,
    valid_images,
)
from ...utils import TensorType, is_vision_available, logging


UpperCamelCase__          = logging.get_logger(__name__)


if is_vision_available():
  import PIL




class      lowerCamelCase_  (      __a ):
      lowerCAmelCase__							=	['pixel_values']






      def __init__(   self							:       Any		,		_A							:       bool = True		,		_A							:       Dict[str, int] = None		,		_A							:       PILImageResampling = PILImageResampling.BICUBIC		,		_A							:       bool = True		,		_A							:       Dict[str, int] = None		,		_A							:       bool = True		,		_A							:       Union[int, float] = 1 / 255		,		_A							:       bool = True		,		_A							:       Optional[Union[float, List[float]]] = None		,		_A							:       Optional[Union[float, List[float]]] = None		,		_A							:       bool = True		,		**_A							:       List[Any]		,		):


          '''simple docstring'''


          super().__init__(**_A					)
          UpperCAmelCase__     :						Optional[int]						=							size if size is not None else {'''shortest_edge''': 224}
          UpperCAmelCase__     :						Union[str, Any]						=							get_size_dict(_A		,		default_to_square=_A					)
          UpperCAmelCase__     :						List[str]						=							crop_size if crop_size is not None else {'''height''': 224, '''width''': 224}
          UpperCAmelCase__     :						Optional[Any]						=							get_size_dict(_A		,		default_to_square=_A		,		param_name='''crop_size'''					)

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






      def lowercase_				(   self							:       Optional[int]		,		_A							:       np.ndarray		,		_A							:       Dict[str, int]		,		_A							:       PILImageResampling = PILImageResampling.BICUBIC		,		_A							:       Optional[Union[str, ChannelDimension]] = None		,		**_A							:       List[str]		,		):


          '''simple docstring'''


          UpperCAmelCase__     :						Any						=							get_size_dict(_A		,		default_to_square=_A					)
          if "shortest_edge" not in size:
              raise ValueError(f"""The `size` parameter must contain the key `shortest_edge`. Got {size.keys()}"""					)
          UpperCAmelCase__     :						List[Any]						=							get_resize_output_image_size(_A		,		size=size['''shortest_edge''']		,		default_to_square=_A					)
          return resize(_A		,		size=_A		,		resample=_A		,		data_format=_A		,		**_A					)






      def lowercase_				(   self							:       Any		,		_A							:       np.ndarray		,		_A							:       Dict[str, int]		,		_A							:       Optional[Union[str, ChannelDimension]] = None		,		**_A							:       int		,		):


          '''simple docstring'''


          UpperCAmelCase__     :						Union[str, Any]						=							get_size_dict(_A					)
          if "height" not in size or "width" not in size:
              raise ValueError(f"""The `size` parameter must contain the keys (height, width). Got {size.keys()}"""					)
          return center_crop(_A		,		size=(size['''height'''], size['''width'''])		,		data_format=_A		,		**_A					)






      def lowercase_				(   self							:       str		,		_A							:       np.ndarray		,		_A							:       Union[int, float]		,		_A							:       Optional[Union[str, ChannelDimension]] = None		,		**_A							:       Optional[Any]		,		):


          '''simple docstring'''


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






      def lowercase_				(   self							:       List[Any]		,		_A							:       np.ndarray		,		_A							:       Union[float, List[float]]		,		_A							:       Union[float, List[float]]		,		_A							:       Optional[Union[str, ChannelDimension]] = None		,		**_A							:       Optional[int]		,		):


          '''simple docstring'''


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






      def lowercase_				(   self							:       Optional[int]		,		_A							:       ImageInput		,		_A							:       bool = None		,		_A							:       Dict[str, int] = None		,		_A							:       PILImageResampling = None		,		_A							:       bool = None		,		_A							:       int = None		,		_A							:       bool = None		,		_A							:       float = None		,		_A							:       bool = None		,		_A							:       Optional[Union[float, List[float]]] = None		,		_A							:       Optional[Union[float, List[float]]] = None		,		_A							:       bool = None		,		_A							:       Optional[Union[str, TensorType]] = None		,		_A							:       Optional[ChannelDimension] = ChannelDimension.FIRST		,		**_A							:       int		,		):


          '''simple docstring'''


          UpperCAmelCase__     :						str						=							do_resize if do_resize is not None else self.do_resize
          UpperCAmelCase__     :						Optional[int]						=							size if size is not None else self.size
          UpperCAmelCase__     :						List[Any]						=							get_size_dict(_A		,		param_name='''size'''		,		default_to_square=_A					)
          UpperCAmelCase__     :						str						=							resample if resample is not None else self.resample
          UpperCAmelCase__     :						Tuple						=							do_center_crop if do_center_crop is not None else self.do_center_crop
          UpperCAmelCase__     :						List[str]						=							crop_size if crop_size is not None else self.crop_size
          UpperCAmelCase__     :						Dict						=							get_size_dict(_A		,		param_name='''crop_size'''		,		default_to_square=_A					)
          UpperCAmelCase__     :						int						=							do_rescale if do_rescale is not None else self.do_rescale
          UpperCAmelCase__     :						Optional[Any]						=							rescale_factor if rescale_factor is not None else self.rescale_factor
          UpperCAmelCase__     :						Tuple						=							do_normalize if do_normalize is not None else self.do_normalize
          UpperCAmelCase__     :						Optional[Any]						=							image_mean if image_mean is not None else self.image_mean
          UpperCAmelCase__     :						Tuple						=							image_std if image_std is not None else self.image_std
          UpperCAmelCase__     :						Dict						=							do_convert_rgb if do_convert_rgb is not None else self.do_convert_rgb

          UpperCAmelCase__     :						int						=							make_list_of_images(_A					)

          if not valid_images(_A					):
              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:
              raise ValueError('''Size 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.'''					)

          # PIL RGBA images are converted to RGB
          if do_convert_rgb:
              UpperCAmelCase__     :						str						=							[convert_to_rgb(_A					) for image in images]

          # All transformations expect numpy arrays.
          UpperCAmelCase__     :						Dict						=							[to_numpy_array(_A					) for image in images]

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

          if do_center_crop:
              UpperCAmelCase__     :						List[Any]						=							[self.center_crop(image=_A		,		size=_A					) for image in images]

          if do_rescale:
              UpperCAmelCase__     :						Optional[int]						=							[self.rescale(image=_A		,		scale=_A					) for image in images]

          if do_normalize:
              UpperCAmelCase__     :						Union[str, Any]						=							[self.normalize(image=_A		,		mean=_A		,		std=_A					) for image in images]

          UpperCAmelCase__     :						List[Any]						=							[to_channel_dimension_format(_A		,		_A					) for image in images]

          UpperCAmelCase__     :						Tuple						=							{'''pixel_values''': images}
          return BatchFeature(data=_A		,		tensor_type=_A					)



def 							__lowerCAmelCase     (							_UpperCamelCase		:	List[str]=2_81_23						)		->				str:
 '''simple docstring'''


 SCREAMING_SNAKE_CASE		    =      [1] * (limit + 1)

 for i in range(2		,				int(limit**0.5						) + 1						):
  sum_divs[i * i] += i
  for k in range(i + 1		,				limit // i + 1						):
   sum_divs[k * i] += k + i

 SCREAMING_SNAKE_CASE		    =      set()
 SCREAMING_SNAKE_CASE		    =      0

 for n in range(1		,				limit + 1						):
  if sum_divs[n] > n:
   abundants.add(_UpperCamelCase						)

  if not any((n - a in abundants) for a in abundants						):
   res += n

 return res


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

