


'''simple docstring'''







import unittest

import numpy as np

from diffusers import OnnxStableDiffusionInpaintPipelineLegacy
from diffusers.utils.testing_utils import (
    is_onnx_available,
    load_image,
    load_numpy,
    nightly,
    require_onnxruntime,
    require_torch_gpu,
)


if is_onnx_available():
       import onnxruntime as ort
@nightly
@require_onnxruntime
@require_torch_gpu
class 	UpperCamelCase__					( unittest.TestCase   ):



     """simple docstring"""






     @property
     def a	( self   ):

            '''simple docstring'''

            return (
                "CUDAExecutionProvider",
                {
                    "gpu_mem_limit": "15000000000",  # 15GB
                    "arena_extend_strategy": "kSameAsRequested",
                },
            )







     @property
     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							int   			=       ort.SessionOptions()
            _lowerCAmelCase    :							int   			=       False
            return options







     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							Tuple   			=       load_image(
                'https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main'
                '/in_paint/overture-creations-5sI6fQgYIuo.png'   )
            _lowerCAmelCase    :							Optional[int]   			=       load_image(
                'https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main'
                '/in_paint/overture-creations-5sI6fQgYIuo_mask.png'   )
            _lowerCAmelCase    :							str   			=       load_numpy(
                'https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main'
                '/in_paint/red_cat_sitting_on_a_park_bench_onnx.npy'   )

            # using the PNDM scheduler by default
            _lowerCAmelCase    :							Tuple   			=       OnnxStableDiffusionInpaintPipelineLegacy.from_pretrained(
                'CompVis/stable-diffusion-v1-4'      ,	revision='onnx'      ,	safety_checker=lowercase_      ,	feature_extractor=lowercase_      ,	provider=self.gpu_provider      ,	sess_options=self.gpu_options      ,	)
            pipe.set_progress_bar_config(disable=lowercase_   )

            _lowerCAmelCase    :							str   			=       'A red cat sitting on a park bench'

            _lowerCAmelCase    :							Tuple   			=       np.random.RandomState(0   )
            _lowerCAmelCase    :							Dict   			=       pipe(
                prompt=lowercase_      ,	image=lowercase_      ,	mask_image=lowercase_      ,	strength=0.75      ,	guidance_scale=7.5      ,	num_inference_steps=15      ,	generator=lowercase_      ,	output_type='np'      ,	)

            _lowerCAmelCase    :							Dict   			=       output.images[0]

            assert image.shape == (512, 512, 3)
            assert np.abs(expected_image - image   ).max() < 1E-2





'''simple docstring'''







import math
from datetime import datetime, timedelta






def 			lowercase				(_A					):







       """simple docstring"""







       _lowerCAmelCase    :							Optional[Any]   			=       year % 1_9
       _lowerCAmelCase    :							Any   			=       year % 4
       _lowerCAmelCase    :							Optional[int]   			=       year % 7
       _lowerCAmelCase    :							int   			=       math.floor(year / 1_0_0					)
       _lowerCAmelCase    :							Dict   			=       math.floor((1_3 + 8 * leap_day_inhibits) / 2_5					)
       _lowerCAmelCase    :							Optional[Any]   			=       leap_day_inhibits / 4
       _lowerCAmelCase    :							Dict   			=       (
           1_5 - lunar_orbit_correction + leap_day_inhibits - leap_day_reinstall_number
       ) % 3_0
       _lowerCAmelCase    :							List[Any]   			=       (4 + leap_day_inhibits - leap_day_reinstall_number) % 7

       # days to be added to March 21
       _lowerCAmelCase    :							Dict   			=       (1_9 * metonic_cycle + secular_moon_shift) % 3_0

       # PHM -> Paschal Full Moon
       _lowerCAmelCase    :							Union[str, Any]   			=       (
           2 * julian_leap_year
           + 4 * non_leap_year
           + 6 * days_to_add
           + century_starting_point
       ) % 7

       if days_to_add == 2_9 and days_from_phm_to_sunday == 6:
              return datetime(_A   ,						4   ,						1_9					)
       elif days_to_add == 2_8 and days_from_phm_to_sunday == 6:
              return datetime(_A   ,						4   ,						1_8					)
       else:
              return datetime(_A   ,						3   ,						2_2					) + timedelta(
                  days=int(days_to_add + days_from_phm_to_sunday					)					)


if __name__ == "__main__":
       for year in (19_94, 20_00, 20_10, 20_21, 20_23):
              lowerCAmelCase    :     List[str]					=						"""will be""" if year > datetime.now().year else """was"""
              print(F'''Easter in {year} {tense} {gauss_easter(year)}''')

