




"""simple docstring"""

import argparse
import datetime






def 		_snake_case	(   _snake_case				:   Dict				)       ->   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(_snake_case				) < 11:
            raise ValueError('Must be 10 characters long'				)

      # Get month
      _A     =  int(date_input[0] + date_input[1]				)
      # Validate
      if not 0 < m < 13:
            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 < 32:
            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 45 < y < 85_00:
            raise ValueError(
                'Year out of range. There has to be some sort of limit...right?'				)

      # Get datetime obj for validation
      _A     =  datetime.date(int(_snake_case				)							,    int(_snake_case				)							,    int(_snake_case				)				)

      # Start math
      if m <= 2:
            _A     =  y - 1
            _A     =  m + 12
      # maths var
      _A     =  int(str(_snake_case				)[:2]				)
      _A     =  int(str(_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(_snake_case				)]}!'''
      return response


if __name__ == "__main__":
       import doctest

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



import random
import unittest

import torch

from diffusers import IFInpaintingSuperResolutionPipeline
from diffusers.utils import floats_tensor
from diffusers.utils.import_utils import is_xformers_available
from diffusers.utils.testing_utils import skip_mps, torch_device

from ..pipeline_params import (
    TEXT_GUIDED_IMAGE_INPAINTING_BATCH_PARAMS,
    TEXT_GUIDED_IMAGE_INPAINTING_PARAMS,
)
from ..test_pipelines_common import PipelineTesterMixin
from . import IFPipelineTesterMixin

@skip_mps
class 							_UpperCamelCase					(       _A  ,							_A  ,							unittest.TestCase	):






			'''simple docstring'''

			__UpperCamelCase   :    str          =			IFInpaintingSuperResolutionPipeline
			__UpperCamelCase   :    str          =			TEXT_GUIDED_IMAGE_INPAINTING_PARAMS - {"""width""", """height"""}
			__UpperCamelCase   :    Optional[Any]          =			TEXT_GUIDED_IMAGE_INPAINTING_BATCH_PARAMS.union({"""original_image"""}	)
			__UpperCamelCase   :    Dict          =			PipelineTesterMixin.required_optional_params - {"""latents"""}

			def    lowerCAmelCase__						(							self			:							Union[str, Any]   ):
							return self._get_superresolution_dummy_components()

			def    lowerCAmelCase__						(							self			:							Dict    ,						snake_case_			:							Optional[int]    ,						snake_case_			:							str=0   ):
							if str(snake_case_   ).startswith("""mps"""   ):
											UpperCamelCase_:				Union[str, Any]						=    torch.manual_seed(snake_case_   )
							else:
											UpperCamelCase_:				Tuple						=    torch.Generator(device=snake_case_   ).manual_seed(snake_case_   )

							UpperCamelCase_:				Dict						=    floats_tensor((1, 3, 16, 16)    ,						rng=random.Random(snake_case_   )   ).to(snake_case_   )
							UpperCamelCase_:				int						=    floats_tensor((1, 3, 32, 32)    ,						rng=random.Random(snake_case_   )   ).to(snake_case_   )
							UpperCamelCase_:				str						=    floats_tensor((1, 3, 32, 32)    ,						rng=random.Random(snake_case_   )   ).to(snake_case_   )

							UpperCamelCase_:				Dict						=    {
							    """prompt""": """A painting of a squirrel eating a burger""",
							    """image""": image,
							    """original_image""": original_image,
							    """mask_image""": mask_image,
							    """generator""": generator,
							    """num_inference_steps""": 2,
							    """output_type""": """numpy""",
							}

							return inputs

			@unittest.skipIf(
			    torch_device != """cuda""" or not is_xformers_available()    ,						reason="""XFormers attention is only available with CUDA and `xformers` installed"""    ,						)
			def    lowerCAmelCase__						(							self			:							Tuple   ):
							self._test_xformers_attention_forwardGenerator_pass(expected_max_diff=1e-3   )

			def    lowerCAmelCase__						(							self			:							Union[str, Any]   ):
							self._test_save_load_optional_components()

			@unittest.skipIf(torch_device != """cuda"""    ,						reason="""float16 requires CUDA"""   )
			def    lowerCAmelCase__						(							self			:							List[Any]   ):
							# Due to non-determinism in save load of the hf-internal-testing/tiny-random-t5 text encoder
							super().test_save_load_floataa(expected_max_diff=1e-1   )

			def    lowerCAmelCase__						(							self			:							str   ):
							self._test_attention_slicing_forward_pass(expected_max_diff=1e-2   )

			def    lowerCAmelCase__						(							self			:							str   ):
							self._test_save_load_local()




			def    lowerCAmelCase__						(							self			:							Union[str, Any]   ):
							self._test_inference_batch_single_identical(
							    expected_max_diff=1e-2    ,						)






