



'''simple docstring'''

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 	__magic_name__						(    unittest.TestCase   ):







							@property
							def 							__lowercase			(							self					:       Optional[int]		):
									torch.manual_seed(0		)
									_a     :      Dict        =							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 							__lowercase			(							self					:       Optional[int]		):
									_a     :      Tuple        =							self.dummy_uncond_unet
									_a     :      Any        =							KarrasVeScheduler()

									_a     :      int        =							KarrasVePipeline(unet=_UpperCAmelCase	,scheduler=_UpperCAmelCase		)
									pipe.to(_UpperCAmelCase		)
									pipe.set_progress_bar_config(disable=_UpperCAmelCase		)

									_a     :      int        =							torch.manual_seed(0		)
									_a     :      Optional[int]        =							pipe(num_inference_steps=2	,generator=_UpperCAmelCase	,output_type='numpy'		).images

									_a     :      Any        =							torch.manual_seed(0		)
									_a     :      int        =							pipe(num_inference_steps=2	,generator=_UpperCAmelCase	,output_type='numpy'	,return_dict=_UpperCAmelCase		)[0]

									_a     :      Dict        =							image[0, -3:, -3:, -1]
									_a     :      Dict        =							image_from_tuple[0, -3:, -3:, -1]

									assert image.shape == (1, 32, 32, 3)
									_a     :      Dict        =							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 	__magic_name__						(    unittest.TestCase   ):







							def 							__lowercase			(							self					:       List[str]		):
									_a     :      Union[str, Any]        =							'google/ncsnpp-celebahq-256'
									_a     :      List[Any]        =							UNetaDModel.from_pretrained(_UpperCAmelCase		)
									_a     :      List[str]        =							KarrasVeScheduler()

									_a     :      str        =							KarrasVePipeline(unet=_UpperCAmelCase	,scheduler=_UpperCAmelCase		)
									pipe.to(_UpperCAmelCase		)
									pipe.set_progress_bar_config(disable=_UpperCAmelCase		)

									_a     :      List[str]        =							torch.manual_seed(0		)
									_a     :      List[str]        =							pipe(num_inference_steps=20	,generator=_UpperCAmelCase	,output_type='numpy'		).images

									_a     :      Union[str, Any]        =							image[0, -3:, -3:, -1]
									assert image.shape == (1, 256, 256, 3)
									_a     :      Any        =							np.array([0.5_78, 0.58_11, 0.59_24, 0.58_09, 0.5_87, 0.58_86, 0.58_61, 0.58_02, 0.5_86]		)

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





import math
from datetime import datetime, timedelta


def    a__       (						__UpperCamelCase ):
      SCREAMING_SNAKE_CASE_      =     year % 1_9
      SCREAMING_SNAKE_CASE_      =     year % 4
      SCREAMING_SNAKE_CASE_      =     year % 7
      SCREAMING_SNAKE_CASE_      =     math.floor(year / 1_0_0 )
      SCREAMING_SNAKE_CASE_      =     math.floor((1_3 + 8 * leap_day_inhibits) / 2_5 )
      SCREAMING_SNAKE_CASE_      =     leap_day_inhibits / 4
      SCREAMING_SNAKE_CASE_      =     (
          1_5 - lunar_orbit_correction + leap_day_inhibits - leap_day_reinstall_number
      ) % 3_0
      SCREAMING_SNAKE_CASE_      =     (4 + leap_day_inhibits - leap_day_reinstall_number) % 7

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

      # PHM -> Paschal Full Moon
      SCREAMING_SNAKE_CASE_      =     (
          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(__UpperCamelCase   ,					4   ,					1_9 )
      elif days_to_add == 2_8 and days_from_phm_to_sunday == 6:
            return datetime(__UpperCamelCase   ,					4   ,					1_8 )
      else:
            return datetime(__UpperCamelCase   ,					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):
            A   :     Dict       =				"will be" if year > datetime.now().year else "was"
            print(f"Easter in {year} {tense} {gauss_easter(year)}")


