






import argparse
import datetime





def 	SCREAMING_SNAKE_CASE__    ( snake_case_	) ->	str:


	"""simple docstring"""



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

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

	# Validate
	if not 0 < len(_SCREAMING_SNAKE_CASE	) < 1_1:
		raise ValueError('''Must be 10 characters long'''	)

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

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

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

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

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

	# Get datetime obj for validation
	a												=      datetime.date(int(_SCREAMING_SNAKE_CASE	),	int(_SCREAMING_SNAKE_CASE	),	int(_SCREAMING_SNAKE_CASE	)	)

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


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				UpperCamelCase__    :   Tuple    		=       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__    :   Tuple    		=       parser.parse_args()
				zeller(args.date_input)












import unittest

import numpy as np
import torch

from diffusers import KarrasVePipeline, KarrasVeScheduler, UNetaDModel
from diffusers.utils.testing_utils import enable_full_determinism, require_torch, slow, torch_device


enable_full_determinism()







class      lowerCamelCase(						unittest.TestCase	):
     '''simple docstring'''


     @property
     def        lowerCAmelCase__		(    self							):
         torch.manual_seed(0							)
         _A     =							UNetaDModel(
             block_out_channels=(32, 64)				,     layers_per_block=2				,     sample_size=32				,     in_channels=3				,     out_channels=3				,     down_block_types=('DownBlock2D', 'AttnDownBlock2D')				,     up_block_types=('AttnUpBlock2D', 'UpBlock2D')				,     )
         return model




     def        lowerCAmelCase__		(    self							):
         _A     =							self.dummy_uncond_unet
         _A     =							KarrasVeScheduler()

         _A     =							KarrasVePipeline(unet=snake_case_				,     scheduler=snake_case_							)
         pipe.to(snake_case_							)
         pipe.set_progress_bar_config(disable=snake_case_							)

         _A     =							torch.manual_seed(0							)
         _A     =							pipe(num_inference_steps=2				,     generator=snake_case_				,     output_type='numpy'							).images

         _A     =							torch.manual_seed(0							)
         _A     =							pipe(num_inference_steps=2				,     generator=snake_case_				,     output_type='numpy'				,     return_dict=snake_case_							)[0]

         _A     =							image[0, -3:, -3:, -1]
         _A     =							image_from_tuple[0, -3:, -3:, -1]

         assert image.shape == (1, 32, 32, 3)
         _A     =							np.array([0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0]							)

         assert np.abs(image_slice.flatten() - expected_slice							).max() < 1E-2
         assert np.abs(image_from_tuple_slice.flatten() - expected_slice							).max() < 1E-2







@slow
@require_torch
class      lowerCamelCase(						unittest.TestCase	):
     '''simple docstring'''


     def        lowerCAmelCase__		(    self							):
         _A     =							'google/ncsnpp-celebahq-256'
         _A     =							UNetaDModel.from_pretrained(snake_case_							)
         _A     =							KarrasVeScheduler()

         _A     =							KarrasVePipeline(unet=snake_case_				,     scheduler=snake_case_							)
         pipe.to(snake_case_							)
         pipe.set_progress_bar_config(disable=snake_case_							)

         _A     =							torch.manual_seed(0							)
         _A     =							pipe(num_inference_steps=20				,     generator=snake_case_				,     output_type='numpy'							).images

         _A     =							image[0, -3:, -3:, -1]
         assert image.shape == (1, 256, 256, 3)
         _A     =							np.array([0.578, 0.5811, 0.5924, 0.5809, 0.587, 0.5886, 0.5861, 0.5802, 0.586]							)

         assert np.abs(image_slice.flatten() - expected_slice							).max() < 1E-2





