
"""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,
    get_resize_output_image_size,
    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, logging


SCREAMING_SNAKE_CASE_    					=						logging.get_logger(__name__)
class      _UpperCAmelCase							(		SCREAMING_SNAKE_CASE_							):
      __SCREAMING_SNAKE_CASE   :							Union[str, Any]							      =	["pixel_values"]




      def __init__(							self   ,       lowercase_ = True   ,       lowercase_ = None   ,       lowercase_ = PILImageResampling.BILINEAR   ,       lowercase_ = True   ,       lowercase_ = None   ,       lowercase_ = True   ,       lowercase_ = 1 / 2_5_5   ,       lowercase_ = True   ,       lowercase_ = None   ,       lowercase_ = None   ,       **lowercase_   ,       )						->					None:
          super().__init__(**lowercase_							)
          UpperCAmelCase									=					size if size is not None else {'shortest_edge': 2_5_6}
          UpperCAmelCase									=					get_size_dict(lowercase_   ,       default_to_square=lowercase_							)
          UpperCAmelCase									=					crop_size if crop_size is not None else {'height': 2_2_4, 'width': 2_2_4}
          UpperCAmelCase									=					get_size_dict(lowercase_							)
          UpperCAmelCase									=					do_resize
          UpperCAmelCase									=					size
          UpperCAmelCase									=					resample
          UpperCAmelCase									=					do_center_crop
          UpperCAmelCase									=					crop_size
          UpperCAmelCase									=					do_rescale
          UpperCAmelCase									=					rescale_factor
          UpperCAmelCase									=					do_normalize
          UpperCAmelCase									=					image_mean if image_mean is not None else IMAGENET_STANDARD_MEAN
          UpperCAmelCase									=					image_std if image_std is not None else IMAGENET_STANDARD_STD




      def     a_      (							self   ,       lowercase_   ,       lowercase_   ,       lowercase_ = PILImageResampling.BICUBIC   ,       lowercase_ = None   ,       **lowercase_   ,       )						->					np.ndarray:
          UpperCAmelCase									=					get_size_dict(lowercase_   ,       default_to_square=lowercase_							)
          if "shortest_edge" not in size:
              raise ValueError(F"The `size` parameter must contain the key `shortest_edge`. Got {size.keys()}"							)
          UpperCAmelCase									=					get_resize_output_image_size(lowercase_   ,       size=size['shortest_edge']   ,       default_to_square=lowercase_							)
          return resize(lowercase_   ,       size=lowercase_   ,       resample=lowercase_   ,       data_format=lowercase_   ,       **lowercase_							)




      def     a_      (							self   ,       lowercase_   ,       lowercase_   ,       lowercase_ = None   ,       **lowercase_   ,       )						->					np.ndarray:
          UpperCAmelCase									=					get_size_dict(lowercase_							)
          return center_crop(lowercase_   ,       size=(size['height'], size['width'])   ,       data_format=lowercase_   ,       **lowercase_							)




      def     a_      (							self   ,       lowercase_   ,       lowercase_   ,       lowercase_ = None   ,       **lowercase_							)						->					np.ndarray:
          return rescale(lowercase_   ,       scale=lowercase_   ,       data_format=lowercase_   ,       **lowercase_							)




      def     a_      (							self   ,       lowercase_   ,       lowercase_   ,       lowercase_   ,       lowercase_ = None   ,       **lowercase_   ,       )						->					np.ndarray:
          return normalize(lowercase_   ,       mean=lowercase_   ,       std=lowercase_   ,       data_format=lowercase_   ,       **lowercase_							)




      def     a_      (							self   ,       lowercase_   ,       lowercase_ = None   ,       lowercase_ = None   ,       lowercase_ = None   ,       lowercase_ = None   ,       lowercase_ = None   ,       lowercase_ = None   ,       lowercase_ = None   ,       lowercase_ = None   ,       lowercase_ = None   ,       lowercase_ = None   ,       lowercase_ = None   ,       lowercase_ = ChannelDimension.FIRST   ,       **lowercase_   ,       )						->					str:
          UpperCAmelCase									=					do_resize if do_resize is not None else self.do_resize
          UpperCAmelCase									=					size if size is not None else self.size
          UpperCAmelCase									=					get_size_dict(lowercase_   ,       default_to_square=lowercase_							)
          UpperCAmelCase									=					resample if resample is not None else self.resample
          UpperCAmelCase									=					do_center_crop if do_center_crop is not None else self.do_center_crop
          UpperCAmelCase									=					crop_size if crop_size is not None else self.crop_size
          UpperCAmelCase									=					get_size_dict(lowercase_							)
          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									=					make_list_of_images(lowercase_							)

          if not valid_images(lowercase_							):
              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.'							)

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

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

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

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

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

          UpperCAmelCase									=					[to_channel_dimension_format(lowercase_   ,       lowercase_							) for image in images]

          UpperCAmelCase									=					{'pixel_values': images}
          return BatchFeature(data=lowercase_   ,       tensor_type=lowercase_							)





"""simple docstring"""

import argparse
import datetime




def     lowercase__						(					lowerCAmelCase				:					str ) ->      str:






    """simple docstring"""




    UpperCAmelCase									=					{
        '0': 'Sunday',
        '1': 'Monday',
        '2': 'Tuesday',
        '3': 'Wednesday',
        '4': 'Thursday',
        '5': 'Friday',
        '6': 'Saturday',
    }

    UpperCAmelCase									=					{0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 0}

    # Validate
    if not 0 < len(lowerCAmelCase ) < 11:
        raise ValueError('Must be 10 characters long' )

    # Get month
    UpperCAmelCase									=					int(date_input[0] + date_input[1] )
    # Validate
    if not 0 < m < 13:
        raise ValueError('Month must be between 1 - 12' )

    UpperCAmelCase									=					date_input[2]
    # Validate
    if sep_a not in ["-", "/"]:
        raise ValueError('Date separator must be \'-\' or \'/\'' )

    # Get day
    UpperCAmelCase									=					int(date_input[3] + date_input[4] )
    # Validate
    if not 0 < d < 32:
        raise ValueError('Date must be between 1 - 31' )

    # Get second separator
    UpperCAmelCase									=					date_input[5]
    # Validate
    if sep_a not in ["-", "/"]:
        raise ValueError('Date separator must be \'-\' or \'/\'' )

    # Get year
    UpperCAmelCase									=					int(date_input[6] + date_input[7] + date_input[8] + date_input[9] )
    # Arbitrary year range
    if not 45 < y < 8_500:
        raise ValueError(
            'Year out of range. There has to be some sort of limit...right?' )

    # Get datetime obj for validation
    UpperCAmelCase									=					datetime.date(int(lowerCAmelCase ) ,				int(lowerCAmelCase ) ,				int(lowerCAmelCase ) )

    # Start math
    if m <= 2:
        UpperCAmelCase									=					y - 1
        UpperCAmelCase									=					m + 12
    # maths var
    UpperCAmelCase									=					int(str(lowerCAmelCase )[:2] )
    UpperCAmelCase									=					int(str(lowerCAmelCase )[2:] )
    UpperCAmelCase									=					int(2.6 * m - 5.39 )
    UpperCAmelCase									=					int(c / 4 )
    UpperCAmelCase									=					int(k / 4 )
    UpperCAmelCase									=					int(d + k )
    UpperCAmelCase									=					int(t + u + v + x )
    UpperCAmelCase									=					int(z - (2 * c) )
    UpperCAmelCase									=					round(w % 7 )
    # End math

    # Validate math
    if f != convert_datetime_days[dt_ck.weekday()]:
        raise AssertionError('The date was evaluated incorrectly. Contact developer.' )

    # Response
    UpperCAmelCase									=					F"Your date {date_input}, is a {days[str(lowerCAmelCase )]}!"
    return response


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   SCREAMING_SNAKE_CASE_    					=						argparse.ArgumentParser(
       description=(
           '''Find out what day of the week nearly any date is or was. Enter '''
           '''date as a string in the mm-dd-yyyy or mm/dd/yyyy format'''
       )
   )
   parser.add_argument(
       '''date_input''', type=str, help='''Date as a string (mm-dd-yyyy or mm/dd/yyyy)'''
   )
   SCREAMING_SNAKE_CASE_    					=						parser.parse_args()
   zeller(args.date_input)



