



import argparse
import datetime
def 		UpperCamelCase     (       snake_case__	:   str     )     ->					Union[str, Any]:
   UpperCamelCase   :  Optional[int]						     =     {
       '0': 'Sunday',
       '1': 'Monday',
       '2': 'Tuesday',
       '3': 'Wednesday',
       '4': 'Thursday',
       '5': 'Friday',
       '6': 'Saturday',
   }

   UpperCamelCase   :  Optional[Any]						     =     {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 0}

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

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

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

   # Get day
   UpperCamelCase   :  str						     =     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   :  int						     =     date_input[5]
   # Validate
   if sep_a not in ["-", "/"]:
      raise ValueError('Date separator must be \'-\' or \'/\''     )

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

   # Get datetime obj for validation
   UpperCamelCase   :  List[str]						     =     datetime.date(int(snake_case__     )	,					int(snake_case__     )	,					int(snake_case__     )     )

   # Start math
   if m <= 2:
      UpperCamelCase   :  Dict						     =     y - 1
      UpperCamelCase   :  Union[str, Any]						     =     m + 12
   # maths var
   UpperCamelCase   :  List[Any]						     =     int(str(snake_case__     )[:2]     )
   UpperCamelCase   :  Dict						     =     int(str(snake_case__     )[2:]     )
   UpperCamelCase   :  Dict						     =     int(2.6 * m - 5.39     )
   UpperCamelCase   :  int						     =     int(c / 4     )
   UpperCamelCase   :  int						     =     int(k / 4     )
   UpperCamelCase   :  Tuple						     =     int(d + k     )
   UpperCamelCase   :  Any						     =     int(t + u + v + x     )
   UpperCamelCase   :  Any						     =     int(z - (2 * c)     )
   UpperCamelCase   :  Tuple						     =     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   :  Any						     =     F"""Your date {date_input}, is a {days[str(snake_case__     )]}!"""
   return response


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       __UpperCAmelCase	       =	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)'''
       )
       __UpperCAmelCase	       =	parser.parse_args()
       zeller(args.date_input)








import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
    import torch

if is_vision_available():
    from PIL import Image

    from transformers import ViTImageProcessor



class     lowerCAmelCase_		(  unittest.TestCase							):
       def __init__(      self,      SCREAMING_SNAKE_CASE_,      SCREAMING_SNAKE_CASE_=13,      SCREAMING_SNAKE_CASE_=3,      SCREAMING_SNAKE_CASE_=224,      SCREAMING_SNAKE_CASE_=30,      SCREAMING_SNAKE_CASE_=400,      SCREAMING_SNAKE_CASE_=True,      SCREAMING_SNAKE_CASE_=None,      SCREAMING_SNAKE_CASE_=True,      SCREAMING_SNAKE_CASE_=[0.5, 0.5, 0.5],      SCREAMING_SNAKE_CASE_=[0.5, 0.5, 0.5],      )					->		List[str]:
          UpperCamelCase   :  Optional[int]						     =     size if size is not None else {'height': 18, 'width': 18}
          UpperCamelCase   :  List[Any]						     =     parent
          UpperCamelCase   :  List[Any]						     =     batch_size
          UpperCamelCase   :  int						     =     num_channels
          UpperCamelCase   :  int						     =     image_size
          UpperCamelCase   :  List[Any]						     =     min_resolution
          UpperCamelCase   :  int						     =     max_resolution
          UpperCamelCase   :  Any						     =     do_resize
          UpperCamelCase   :  Optional[int]						     =     size
          UpperCamelCase   :  List[str]						     =     do_normalize
          UpperCamelCase   :  Optional[Any]						     =     image_mean
          UpperCamelCase   :  Tuple						     =     image_std






       def  snake_case_	(      self	)					->		List[Any]:
          return {
              "image_mean": self.image_mean,
              "image_std": self.image_std,
              "do_normalize": self.do_normalize,
              "do_resize": self.do_resize,
              "size": self.size,
          }






@require_torch
@require_vision
class     lowerCAmelCase_		(  a__	,   unittest.TestCase							):
       UpperCAmelCase__    : Optional[Any]       					=  ViTImageProcessor if is_vision_available() else None
       def  snake_case_	(      self	)					->		Any:
          UpperCamelCase   :  Dict						     =     EfficientFormerImageProcessorTester(self	)
       @property
       def  snake_case_	(      self	)					->		List[Any]:
          return self.image_proc_tester.prepare_image_processor_dict()
       def  snake_case_	(      self	)					->		Optional[int]:
          UpperCamelCase   :  Optional[int]						     =     self.image_processing_class(**self.image_processor_dict	)
          self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_,      'image_mean'	)	)
          self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_,      'image_std'	)	)
          self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_,      'do_normalize'	)	)
          self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_,      'do_resize'	)	)
          self.assertTrue(hasattr(SCREAMING_SNAKE_CASE_,      'size'	)	)
       def  snake_case_	(      self	)					->		Any:
          pass
       def  snake_case_	(      self	)					->		int:
          # Initialize image_processor
          UpperCamelCase   :  Union[str, Any]						     =     self.image_processing_class(**self.image_processor_dict	)
          # create random PIL images
          UpperCamelCase   :  List[str]						     =     prepare_image_inputs(self.image_proc_tester,      equal_resolution=SCREAMING_SNAKE_CASE_	)
          for image in image_inputs:
             self.assertIsInstance(SCREAMING_SNAKE_CASE_,      Image.Image	)

          # Test not batched input
          UpperCamelCase   :  str						     =     image_processor(image_inputs[0],      return_tensors='pt'	).pixel_values
          self.assertEqual(
              encoded_images.shape,      (
                  1,
                  self.image_proc_tester.num_channels,
                  self.image_proc_tester.size['height'],
                  self.image_proc_tester.size['width'],
              ),      )

          # Test batched
          UpperCamelCase   :  Optional[Any]						     =     image_processor(SCREAMING_SNAKE_CASE_,      return_tensors='pt'	).pixel_values
          self.assertEqual(
              encoded_images.shape,      (
                  self.image_proc_tester.batch_size,
                  self.image_proc_tester.num_channels,
                  self.image_proc_tester.size['height'],
                  self.image_proc_tester.size['width'],
              ),      )
       def  snake_case_	(      self	)					->		str:
          # Initialize image_processor
          UpperCamelCase   :  List[str]						     =     self.image_processing_class(**self.image_processor_dict	)
          # create random numpy tensors
          UpperCamelCase   :  Union[str, Any]						     =     prepare_image_inputs(self.image_proc_tester,      equal_resolution=SCREAMING_SNAKE_CASE_,      numpify=SCREAMING_SNAKE_CASE_	)
          for image in image_inputs:
             self.assertIsInstance(SCREAMING_SNAKE_CASE_,      np.ndarray	)

          # Test not batched input
          UpperCamelCase   :  Dict						     =     image_processor(image_inputs[0],      return_tensors='pt'	).pixel_values
          self.assertEqual(
              encoded_images.shape,      (
                  1,
                  self.image_proc_tester.num_channels,
                  self.image_proc_tester.size['height'],
                  self.image_proc_tester.size['width'],
              ),      )

          # Test batched
          UpperCamelCase   :  Dict						     =     image_processor(SCREAMING_SNAKE_CASE_,      return_tensors='pt'	).pixel_values
          self.assertEqual(
              encoded_images.shape,      (
                  self.image_proc_tester.batch_size,
                  self.image_proc_tester.num_channels,
                  self.image_proc_tester.size['height'],
                  self.image_proc_tester.size['width'],
              ),      )






       def  snake_case_	(      self	)					->		Tuple:
          # Initialize image_processor
          UpperCamelCase   :  Any						     =     self.image_processing_class(**self.image_processor_dict	)
          # create random PyTorch tensors
          UpperCamelCase   :  int						     =     prepare_image_inputs(self.image_proc_tester,      equal_resolution=SCREAMING_SNAKE_CASE_,      torchify=SCREAMING_SNAKE_CASE_	)
          for image in image_inputs:
             self.assertIsInstance(SCREAMING_SNAKE_CASE_,      torch.Tensor	)

          # Test not batched input
          UpperCamelCase   :  Optional[int]						     =     image_processor(image_inputs[0],      return_tensors='pt'	).pixel_values
          self.assertEqual(
              encoded_images.shape,      (
                  1,
                  self.image_proc_tester.num_channels,
                  self.image_proc_tester.size['height'],
                  self.image_proc_tester.size['width'],
              ),      )

          # Test batched
          UpperCamelCase   :  int						     =     image_processor(SCREAMING_SNAKE_CASE_,      return_tensors='pt'	).pixel_values
          self.assertEqual(
              encoded_images.shape,      (
                  self.image_proc_tester.batch_size,
                  self.image_proc_tester.num_channels,
                  self.image_proc_tester.size['height'],
                  self.image_proc_tester.size['width'],
              ),      )



