





'''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 convert_to_rgb, 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


if is_vision_available():
      import PIL


__lowerCamelCase						: Any		=   logging.get_logger(__name__)







class 		UpperCAmelCase   (				lowercase_):


  """simple docstring"""







  lowerCAmelCase_					=				["""pixel_values"""]


  def __init__(				self    :					Optional[int]							,	UpperCamelCase__    :					str = True							,	UpperCamelCase__    :					Optional[int] = None							,	UpperCamelCase__    :					str = PILImageResampling.BICUBIC							,	UpperCamelCase__    :					Optional[int] = True							,	UpperCamelCase__    :					List[Any] = 1 / 255							,	UpperCamelCase__    :					List[Any] = True							,	UpperCamelCase__    :					Optional[Any] = None							,	UpperCamelCase__    :					List[Any] = None							,	UpperCamelCase__    :					Union[str, Any] = True							,	**UpperCamelCase__    :					List[Any]							,	)     ->						Any:
    super().__init__(**UpperCamelCase__  )
    _UpperCamelCase       			=size if size is not None else {'''height''': 384, '''width''': 384}
    _UpperCamelCase       			=get_size_dict(UpperCamelCase__							,	default_to_square=UpperCamelCase__  )

    _UpperCamelCase       			=do_resize
    _UpperCamelCase       			=size
    _UpperCamelCase       			=resample
    _UpperCamelCase       			=do_rescale
    _UpperCamelCase       			=rescale_factor
    _UpperCamelCase       			=do_normalize
    _UpperCamelCase       			=image_mean if image_mean is not None else OPENAI_CLIP_MEAN
    _UpperCamelCase       			=image_std if image_std is not None else OPENAI_CLIP_STD
    _UpperCamelCase       			=do_convert_rgb


  def   UpperCamelCase__      (				self    :					int							,	UpperCamelCase__    :					Tuple							,	UpperCamelCase__    :					List[str]							,	UpperCamelCase__    :					List[Any] = PILImageResampling.BICUBIC							,	UpperCamelCase__    :					List[str] = None							,	**UpperCamelCase__    :					Tuple							,	)     ->						Dict:
    _UpperCamelCase       			=get_size_dict(UpperCamelCase__							,	default_to_square=UpperCamelCase__  )
    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()}'''  )
    _UpperCamelCase       			=(size['''height'''], size['''width'''])
    return resize(UpperCamelCase__							,	size=UpperCamelCase__							,	resample=UpperCamelCase__							,	data_format=UpperCamelCase__							,	**UpperCamelCase__  )


  def   UpperCamelCase__      (				self    :					str							,	UpperCamelCase__    :					List[str]							,	UpperCamelCase__    :					List[Any]							,	UpperCamelCase__    :					Union[str, Any] = None							,	**UpperCamelCase__    :					int							,	)     ->						List[str]:
    return rescale(UpperCamelCase__							,	scale=UpperCamelCase__							,	data_format=UpperCamelCase__							,	**UpperCamelCase__  )


  def   UpperCamelCase__      (				self    :					Tuple							,	UpperCamelCase__    :					Any							,	UpperCamelCase__    :					int							,	UpperCamelCase__    :					Optional[int]							,	UpperCamelCase__    :					List[Any] = None							,	**UpperCamelCase__    :					List[Any]							,	)     ->						List[str]:
    return normalize(UpperCamelCase__							,	mean=UpperCamelCase__							,	std=UpperCamelCase__							,	data_format=UpperCamelCase__							,	**UpperCamelCase__  )




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

    _UpperCamelCase       			=size if size is not None else self.size
    _UpperCamelCase       			=get_size_dict(UpperCamelCase__							,	default_to_square=UpperCamelCase__  )

    _UpperCamelCase       			=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_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       			=[convert_to_rgb(UpperCamelCase__  ) for image in images]

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

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

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

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

    _UpperCamelCase       			=[to_channel_dimension_format(UpperCamelCase__							,	UpperCamelCase__  ) for image in images]

    _UpperCamelCase       			=BatchFeature(data={'''pixel_values''': images}							,	tensor_type=UpperCamelCase__  )

    return encoded_outputs








'''simple docstring'''






def 					_a   (__SCREAMING_SNAKE_CASE   ):


  """simple docstring"""

  return 1 if digit in (0, 1) else (digit * factorial(digit - 1   ))


def 					_a   (__SCREAMING_SNAKE_CASE   ):


  """simple docstring"""

  _UpperCamelCase       			=0
  _UpperCamelCase       			=number
  while duplicate > 0:
    _UpperCamelCase			,     _UpperCamelCase       			=divmod(__SCREAMING_SNAKE_CASE  ,      10   )
    fact_sum += factorial(__SCREAMING_SNAKE_CASE   )
  return fact_sum == number


if __name__ == "__main__":
      print('Program to check whether a number is a Krisnamurthy Number or not.')
      __lowerCamelCase						: Optional[Any]		=   int(input('Enter number: ').strip())
      print(
          F"""{number} is {'' if krishnamurthy(number) else 'not '}a Krishnamurthy Number."""
      )






