code: 
  
  
  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 (
      get_resize_output_image_size,
      normalize,
      pad,
      rescale,
      resize,
      to_channel_dimension_format,
  )
  from ...image_utils import (
      IMAGENET_STANDARD_MEAN,
      IMAGENET_STANDARD_STD,
      ChannelDimension,
      ImageInput,
      PILImageResampling,
      get_image_size,
      make_list_of_images,
      to_numpy_array,
      valid_images,
  )
  from ...utils import TensorType, logging
  from ...utils.import_utils import is_vision_available
  
  
  __lowerCamelCase       :       Optional[int]				   =			logging.get_logger(__name__)
  
  
  if is_vision_available():
  						import PIL
  
  
  
  class 			a      (      UpperCAmelCase_   ):
  		__lowercase													=		["""pixel_values"""]
  
  
  
  
  
  
  		def __init__(  self	,     __UpperCamelCase = True	,     __UpperCamelCase = None	,     __UpperCamelCase = PILImageResampling.BILINEAR	,     __UpperCamelCase = True	,     __UpperCamelCase = False	,     __UpperCamelCase = True	,     __UpperCamelCase = True	,     __UpperCamelCase = 1 / 2_55	,     __UpperCamelCase = True	,     __UpperCamelCase = None	,     __UpperCamelCase = None	,     **__UpperCamelCase	,     )->			None:
  						'''simple docstring'''
  
  
  						super().__init__(**__UpperCamelCase							)
  
  						A__     :							str   				=size if size is not None else {'''height''': 25_60, '''width''': 19_20}
  						if isinstance(__UpperCamelCase	,     (tuple, list)							):
  										# The previous feature extractor size parameter was in (width, height) format
  										A__     :							List[Any]   				=size[::-1]
  						A__     :							List[Any]   				=get_size_dict(__UpperCamelCase							)
  
  						A__     :							Any   				=do_resize
  						A__     :							str   				=size
  						A__     :							List[str]   				=resample
  						A__     :							Dict   				=do_thumbnail
  						A__     :							str   				=do_align_long_axis
  						A__     :							Optional[int]   				=do_pad
  						A__     :							str   				=do_rescale
  						A__     :							Union[str, Any]   				=rescale_factor
  						A__     :							List[str]   				=do_normalize
  						A__     :							Tuple   				=image_mean if image_mean is not None else IMAGENET_STANDARD_MEAN
  						A__     :							List[str]   				=image_std if image_std is not None else IMAGENET_STANDARD_STD
  
  
  
  
  
  
  		def       lowerCAmelCase_  (  self	,     __UpperCamelCase	,     __UpperCamelCase	,     __UpperCamelCase = None							)->			np.ndarray:
  						'''simple docstring'''
  
  
  						A__				,  A__     :							Optional[int]   				=get_image_size(__UpperCamelCase							)
  						A__				,  A__     :							Tuple   				=size['''height'''], size['''width''']
  
  						if (output_width < output_height and input_width > input_height) or (
  						    output_width > output_height and input_width < input_height
  						):
  										A__     :							Any   				=np.rotaa(__UpperCamelCase	,     3							)
  
  						if data_format is not None:
  										A__     :							Optional[Any]   				=to_channel_dimension_format(__UpperCamelCase	,     __UpperCamelCase							)
  
  						return image
  
  
  
  
  
  
  		def       lowerCAmelCase_  (  self	,     __UpperCamelCase	,     __UpperCamelCase	,     __UpperCamelCase = False	,     __UpperCamelCase = None	,     )->			np.ndarray:
  						'''simple docstring'''
  
  
  						A__				,  A__     :							Union[str, Any]   				=size['''height'''], size['''width''']
  						A__				,  A__     :							str   				=get_image_size(__UpperCamelCase							)
  
  						A__     :							Dict   				=output_width - input_width
  						A__     :							List[str]   				=output_height - input_height
  
  						if random_padding:
  										A__     :							List[Any]   				=np.random.randint(low=0	,     high=delta_height + 1							)
  										A__     :							str   				=np.random.randint(low=0	,     high=delta_width + 1							)
  						else:
  										A__     :							Dict   				=delta_height // 2
  										A__     :							Optional[Any]   				=delta_width // 2
  
  						A__     :							List[str]   				=delta_height - pad_top
  						A__     :							int   				=delta_width - pad_left
  
  						A__     :							List[Any]   				=((pad_top, pad_bottom), (pad_left, pad_right))
  						return pad(__UpperCamelCase	,     __UpperCamelCase	,     data_format=__UpperCamelCase							)
  
  
  
  
  
  
  		def       lowerCAmelCase_  (  self	,     *__UpperCamelCase	,     **__UpperCamelCase							)->			str:
  						'''simple docstring'''
  
  
  						logger.info('''pad is deprecated and will be removed in version 4.27. Please use pad_image instead.'''							)
  						return self.pad_image(*__UpperCamelCase	,     **__UpperCamelCase							)
  
  
  
  
  
  
  		def       lowerCAmelCase_  (  self	,     __UpperCamelCase	,     __UpperCamelCase	,     __UpperCamelCase = PILImageResampling.BICUBIC	,     __UpperCamelCase = None	,     **__UpperCamelCase	,     )->			np.ndarray:
  						'''simple docstring'''
  
  
  						A__				,  A__     :							Optional[Any]   				=get_image_size(__UpperCamelCase							)
  						A__				,  A__     :							Tuple   				=size['''height'''], size['''width''']
  
  						# We always resize to the smallest of either the input or output size.
  						A__     :							Optional[Any]   				=min(__UpperCamelCase	,     __UpperCamelCase							)
  						A__     :							str   				=min(__UpperCamelCase	,     __UpperCamelCase							)
  
  						if height == input_height and width == input_width:
  										return image
  
  						if input_height > input_width:
  										A__     :							List[str]   				=int(input_width * height / input_height							)
  						elif input_width > input_height:
  										A__     :							List[str]   				=int(input_height * width / input_width							)
  
  						return resize(
  						    __UpperCamelCase	,     size=(height, width)	,     resample=__UpperCamelCase	,     reducing_gap=2.0	,     data_format=__UpperCamelCase	,     **__UpperCamelCase							)
  
  
  
  
  
  
  		def       lowerCAmelCase_  (  self	,     __UpperCamelCase	,     __UpperCamelCase	,     __UpperCamelCase = PILImageResampling.BICUBIC	,     __UpperCamelCase = None	,     **__UpperCamelCase	,     )->			np.ndarray:
  						'''simple docstring'''
  
  
  						A__     :							Any   				=get_size_dict(__UpperCamelCase							)
  						A__     :							Optional[Any]   				=min(size['''height''']	,     size['''width''']							)
  						A__     :							Union[str, Any]   				=get_resize_output_image_size(__UpperCamelCase	,     size=__UpperCamelCase	,     default_to_square=__UpperCamelCase							)
  						A__     :							int   				=resize(__UpperCamelCase	,     size=__UpperCamelCase	,     resample=__UpperCamelCase	,     data_format=__UpperCamelCase	,     **__UpperCamelCase							)
  						return resized_image
  
  
  
  
  
  
  		def       lowerCAmelCase_  (  self	,     __UpperCamelCase	,     __UpperCamelCase	,     __UpperCamelCase = None	,     **__UpperCamelCase	,     )->			List[Any]:
  						'''simple docstring'''
  
  
  						return rescale(__UpperCamelCase	,     scale=__UpperCamelCase	,     data_format=__UpperCamelCase	,     **__UpperCamelCase							)
  
  
  
  
  
  
  		def       lowerCAmelCase_  (  self	,     __UpperCamelCase	,     __UpperCamelCase	,     __UpperCamelCase	,     __UpperCamelCase = None	,     **__UpperCamelCase	,     )->			np.ndarray:
  						'''simple docstring'''
  
  
  						return normalize(__UpperCamelCase	,     mean=__UpperCamelCase	,     std=__UpperCamelCase	,     data_format=__UpperCamelCase	,     **__UpperCamelCase							)
  
  
  
  
  
  
  		def       lowerCAmelCase_  (  self	,     __UpperCamelCase	,     __UpperCamelCase = None	,     __UpperCamelCase = None	,     __UpperCamelCase = None	,     __UpperCamelCase = None	,     __UpperCamelCase = None	,     __UpperCamelCase = None	,     __UpperCamelCase = False	,     __UpperCamelCase = None	,     __UpperCamelCase = None	,     __UpperCamelCase = None	,     __UpperCamelCase = None	,     __UpperCamelCase = None	,     __UpperCamelCase = None	,     __UpperCamelCase = ChannelDimension.FIRST	,     **__UpperCamelCase	,     )->			PIL.Image.Image:
  						'''simple docstring'''
  
  
  						A__     :							Union[str, Any]   				=do_resize if do_resize is not None else self.do_resize
  						A__     :							str   				=size if size is not None else self.size
  						if isinstance(__UpperCamelCase	,     (tuple, list)							):
  										# Previous feature extractor had size in (width, height) format
  										A__     :							str   				=size[::-1]
  						A__     :							str   				=get_size_dict(__UpperCamelCase							)
  						A__     :							str   				=resample if resample is not None else self.resample
  						A__     :							str   				=do_thumbnail if do_thumbnail is not None else self.do_thumbnail
  						A__     :							Tuple   				=do_align_long_axis if do_align_long_axis is not None else self.do_align_long_axis
  						A__     :							Dict   				=do_pad if do_pad is not None else self.do_pad
  						A__     :							Any   				=do_rescale if do_rescale is not None else self.do_rescale
  						A__     :							Optional[Any]   				=rescale_factor if rescale_factor is not None else self.rescale_factor
  						A__     :							str   				=do_normalize if do_normalize is not None else self.do_normalize
  						A__     :							Optional[int]   				=image_mean if image_mean is not None else self.image_mean
  						A__     :							int   				=image_std if image_std is not None else self.image_std
  
  						A__     :							Optional[Any]   				=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:
  										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_pad and size is None:
  										raise ValueError('''Size must be specified if do_pad 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.
  						A__     :							Any   				=[to_numpy_array(__UpperCamelCase							) for image in images]
  
  						if do_align_long_axis:
  										A__     :							Any   				=[self.align_long_axis(__UpperCamelCase	,     size=__UpperCamelCase							) for image in images]
  
  						if do_resize:
  										A__     :							str   				=[self.resize(image=__UpperCamelCase	,     size=__UpperCamelCase	,     resample=__UpperCamelCase							) for image in images]
  
  						if do_thumbnail:
  										A__     :							Union[str, Any]   				=[self.thumbnail(image=__UpperCamelCase	,     size=__UpperCamelCase							) for image in images]
  
  						if do_pad:
  										A__     :							Dict   				=[self.pad_image(image=__UpperCamelCase	,     size=__UpperCamelCase	,     random_padding=__UpperCamelCase							) for image in images]
  
  						if do_rescale:
  										A__     :							Optional[Any]   				=[self.rescale(image=__UpperCamelCase	,     scale=__UpperCamelCase							) for image in images]
  
  						if do_normalize:
  										A__     :							Dict   				=[self.normalize(image=__UpperCamelCase	,     mean=__UpperCamelCase	,     std=__UpperCamelCase							) for image in images]
  
  						A__     :							Union[str, Any]   				=[to_channel_dimension_format(__UpperCamelCase	,     __UpperCamelCase							) for image in images]
  
  						A__     :							Dict   				={'''pixel_values''': images}
  						return BatchFeature(data=__UpperCamelCase	,     tensor_type=__UpperCamelCase							)
  
  
  
  
style_context: 
  
  
  def   SCREAMING_SNAKE_CASE__						(							snake_case_	)			->							int:
  				if number != int(snake_case_	):
  								raise ValueError('''factorial() only accepts integral values'''	)
  				if number < 0:
  								raise ValueError('''factorial() not defined for negative values'''	)
  				A__     :							Union[str, Any]   				=1
  				for i in range(1,	number + 1	):
  								value *= i
  				return value
  
  
  
  def   SCREAMING_SNAKE_CASE__						(							snake_case_	)			->							int:
  				if not isinstance(snake_case_,	snake_case_	):
  								raise ValueError('''factorial() only accepts integral values'''	)
  				if n < 0:
  								raise ValueError('''factorial() not defined for negative values'''	)
  				return 1 if n == 0 or n == 1 else n * factorial(n - 1	)
  
  
  if __name__ == "__main__":
  						import doctest
  
  						doctest.testmod()
  
  						__lowerCamelCase       :       Any				   =			int(input("Enter a positive integer: ").strip() or 0)
  						print(F"factorial{n} is {factorial(n)}")
  
  
  
  