


"""simple docstring"""







import argparse
import datetime
def _A						(						lowercase		):







    """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(lowercase		) < 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(lowercase		)	,   int(lowercase		)	,   int(lowercase		)		)

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


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       lowerCamelCase_       :       Optional[Any]      						=  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)"""
       )
       lowerCamelCase_       :       int      						=  parser.parse_args()
       zeller(args.date_input)



"""simple docstring"""







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 				__A    (	_SCREAMING_SNAKE_CASE,   _SCREAMING_SNAKE_CASE,   unittest.TestCase      ):






 """simple docstring"""




 __lowerCAmelCase			 =  IFInpaintingSuperResolutionPipeline
 __lowerCAmelCase			 =  TEXT_GUIDED_IMAGE_INPAINTING_PARAMS - {"width", "height"}
 __lowerCAmelCase			 =  TEXT_GUIDED_IMAGE_INPAINTING_BATCH_PARAMS.union({"original_image"}      )
 __lowerCAmelCase			 =  PipelineTesterMixin.required_optional_params - {"latents"}


 def 				SCREAMING_SNAKE_CASE							(		self						) ->					Optional[int]:
     return self._get_superresolution_dummy_components()


 def 				SCREAMING_SNAKE_CASE							(		self			,   __A			,   __A=0						) ->					Optional[int]:
     if str(__A						).startswith('''mps'''						):
         a					=torch.manual_seed(__A						)
     else:
         a					=torch.Generator(device=__A						).manual_seed(__A						)

     a					=floats_tensor((1, 3, 16, 16)			,   rng=random.Random(__A						)						).to(__A						)
     a					=floats_tensor((1, 3, 32, 32)			,   rng=random.Random(__A						)						).to(__A						)
     a					=floats_tensor((1, 3, 32, 32)			,   rng=random.Random(__A						)						).to(__A						)

     a					={
         '''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 				SCREAMING_SNAKE_CASE							(		self						) ->					List[Any]:
     self._test_xformers_attention_forwardGenerator_pass(expected_max_diff=1E-3						)


 def 				SCREAMING_SNAKE_CASE							(		self						) ->					Dict:
     self._test_save_load_optional_components()


 @unittest.skipIf(torch_device != '''cuda'''			,   reason='''float16 requires CUDA'''						)
 def 				SCREAMING_SNAKE_CASE							(		self						) ->					int:
     # 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 				SCREAMING_SNAKE_CASE							(		self						) ->					Any:
     self._test_attention_slicing_forward_pass(expected_max_diff=1E-2						)


 def 				SCREAMING_SNAKE_CASE							(		self						) ->					List[Any]:
     self._test_save_load_local()





 def 				SCREAMING_SNAKE_CASE							(		self						) ->					Dict:
     self._test_inference_batch_single_identical(
         expected_max_diff=1E-2			,   )