




import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
		import torch

if is_vision_available():
		from PIL import Image

		from transformers import LevitImageProcessor

class 		__lowerCAmelCase	(	unittest.TestCase ):
							def __init__(						self						:Any		,      __magic_name__						:Tuple		,      __magic_name__						:Any=7		,      __magic_name__						:List[str]=3		,      __magic_name__						:int=18		,      __magic_name__						:str=30		,      __magic_name__						:List[str]=400		,      __magic_name__						:List[str]=True		,      __magic_name__						:Tuple=None		,      __magic_name__						:List[Any]=True		,      __magic_name__						:int=None		,      __magic_name__						:str=True		,      __magic_name__						:Tuple=[0.5, 0.5, 0.5]		,      __magic_name__						:Tuple=[0.5, 0.5, 0.5]		,      ):







								'''simple docstring'''







								a										=							size if size is not None else {"""shortest_edge""": 18}
								a										=							crop_size if crop_size is not None else {"""height""": 18, """width""": 18}
								a										=							parent
								a										=							batch_size
								a										=							num_channels
								a										=							image_size
								a										=							min_resolution
								a										=							max_resolution
								a										=							do_resize
								a										=							size
								a										=							do_center_crop
								a										=							crop_size
								a										=							do_normalize
								a										=							image_mean
								a										=							image_std





							def       lowerCamelCase__							(						self						:Dict				):







								'''simple docstring'''







								return {
								    "image_mean": self.image_mean,
								    "image_std": self.image_std,
								    "do_normalize": self.do_normalize,
								    "do_resize": self.do_resize,
								    "do_center_crop": self.do_center_crop,
								    "size": self.size,
								    "crop_size": self.crop_size,
								}







@require_torch
@require_vision
class 		__lowerCAmelCase	(	__magic_name__      ,       unittest.TestCase ):
							UpperCamelCase__					     =  LevitImageProcessor if is_vision_available() else None
							def       lowerCamelCase__							(						self						:Optional[int]				):







								'''simple docstring'''







								a										=							LevitImageProcessingTester(self				)
							@property
							def       lowerCamelCase__							(						self						:Optional[Any]				):







								'''simple docstring'''







								return self.image_processor_tester.prepare_image_processor_dict()
							def       lowerCamelCase__							(						self						:Dict				):







								'''simple docstring'''







								a										=							self.image_processing_class(**self.image_processor_dict				)
								self.assertTrue(hasattr(__magic_name__		,      """image_mean"""				)				)
								self.assertTrue(hasattr(__magic_name__		,      """image_std"""				)				)
								self.assertTrue(hasattr(__magic_name__		,      """do_normalize"""				)				)
								self.assertTrue(hasattr(__magic_name__		,      """do_resize"""				)				)
								self.assertTrue(hasattr(__magic_name__		,      """do_center_crop"""				)				)
								self.assertTrue(hasattr(__magic_name__		,      """size"""				)				)
							def       lowerCamelCase__							(						self						:List[Any]				):







								'''simple docstring'''







								a										=							self.image_processing_class.from_dict(self.image_processor_dict				)
								self.assertEqual(image_processor.size		,      {"""shortest_edge""": 18}				)
								self.assertEqual(image_processor.crop_size		,      {"""height""": 18, """width""": 18}				)

								a										=							self.image_processing_class.from_dict(self.image_processor_dict		,      size=42		,      crop_size=84				)
								self.assertEqual(image_processor.size		,      {"""shortest_edge""": 42}				)
								self.assertEqual(image_processor.crop_size		,      {"""height""": 84, """width""": 84}				)
							def       lowerCamelCase__							(						self						:int				):







								'''simple docstring'''







								pass
							def       lowerCamelCase__							(						self						:Any				):







								'''simple docstring'''







								a										=							self.image_processing_class(**self.image_processor_dict				)
								# create random PIL images
								a										=							prepare_image_inputs(self.image_processor_tester		,      equal_resolution=__magic_name__				)
								for image in image_inputs:
									self.assertIsInstance(__magic_name__		,      Image.Image				)

								# Test not batched input
								a										=							image_processing(image_inputs[0]		,      return_tensors="""pt"""				).pixel_values
								self.assertEqual(
								    encoded_images.shape		,      (
								        1,
								        self.image_processor_tester.num_channels,
								        self.image_processor_tester.crop_size["""height"""],
								        self.image_processor_tester.crop_size["""width"""],
								    )		,      )

								# Test batched
								a										=							image_processing(__magic_name__		,      return_tensors="""pt"""				).pixel_values
								self.assertEqual(
								    encoded_images.shape		,      (
								        self.image_processor_tester.batch_size,
								        self.image_processor_tester.num_channels,
								        self.image_processor_tester.crop_size["""height"""],
								        self.image_processor_tester.crop_size["""width"""],
								    )		,      )
							def       lowerCamelCase__							(						self						:Union[str, Any]				):







								'''simple docstring'''







								a										=							self.image_processing_class(**self.image_processor_dict				)
								# create random numpy tensors
								a										=							prepare_image_inputs(self.image_processor_tester		,      equal_resolution=__magic_name__		,      numpify=__magic_name__				)
								for image in image_inputs:
									self.assertIsInstance(__magic_name__		,      np.ndarray				)

								# Test not batched input
								a										=							image_processing(image_inputs[0]		,      return_tensors="""pt"""				).pixel_values
								self.assertEqual(
								    encoded_images.shape		,      (
								        1,
								        self.image_processor_tester.num_channels,
								        self.image_processor_tester.crop_size["""height"""],
								        self.image_processor_tester.crop_size["""width"""],
								    )		,      )

								# Test batched
								a										=							image_processing(__magic_name__		,      return_tensors="""pt"""				).pixel_values
								self.assertEqual(
								    encoded_images.shape		,      (
								        self.image_processor_tester.batch_size,
								        self.image_processor_tester.num_channels,
								        self.image_processor_tester.crop_size["""height"""],
								        self.image_processor_tester.crop_size["""width"""],
								    )		,      )





							def       lowerCamelCase__							(						self						:Tuple				):







								'''simple docstring'''







								a										=							self.image_processing_class(**self.image_processor_dict				)
								# create random PyTorch tensors
								a										=							prepare_image_inputs(self.image_processor_tester		,      equal_resolution=__magic_name__		,      torchify=__magic_name__				)
								for image in image_inputs:
									self.assertIsInstance(__magic_name__		,      torch.Tensor				)

								# Test not batched input
								a										=							image_processing(image_inputs[0]		,      return_tensors="""pt"""				).pixel_values
								self.assertEqual(
								    encoded_images.shape		,      (
								        1,
								        self.image_processor_tester.num_channels,
								        self.image_processor_tester.crop_size["""height"""],
								        self.image_processor_tester.crop_size["""width"""],
								    )		,      )

								# Test batched
								a										=							image_processing(__magic_name__		,      return_tensors="""pt"""				).pixel_values
								self.assertEqual(
								    encoded_images.shape		,      (
								        self.image_processor_tester.batch_size,
								        self.image_processor_tester.num_channels,
								        self.image_processor_tester.crop_size["""height"""],
								        self.image_processor_tester.crop_size["""width"""],
								    )		,      )







import math
from datetime import datetime, timedelta





def 		__A		(	__lowerCamelCase    )      ->       datetime:
	a										=							year % 19
	a										=							year % 4
	a										=							year % 7
	a										=							math.floor(year / 100    )
	a										=							math.floor((13 + 8 * leap_day_inhibits) / 25    )
	a										=							leap_day_inhibits / 4
	a										=							(
	    15 - lunar_orbit_correction + leap_day_inhibits - leap_day_reinstall_number
	) % 30
	a										=							(4 + leap_day_inhibits - leap_day_reinstall_number) % 7

	# days to be added to March 21
	a										=							(19 * metonic_cycle + secular_moon_shift) % 30

	# PHM -> Paschal Full Moon
	a										=							(
	    2 * julian_leap_year
	    + 4 * non_leap_year
	    + 6 * days_to_add
	    + century_starting_point
	) % 7

	if days_to_add == 29 and days_from_phm_to_sunday == 6:
		return datetime(__lowerCamelCase							,			4							,			19    )
	elif days_to_add == 28 and days_from_phm_to_sunday == 6:
		return datetime(__lowerCamelCase							,			4							,			18    )
	else:
		return datetime(__lowerCamelCase							,			3							,			22    ) + timedelta(
		    days=int(days_to_add + days_from_phm_to_sunday    )    )


if __name__ == "__main__":
		for year in (1_994, 2_000, 2_010, 2_021, 2_023):
				__UpperCamelCase					:       Tuple    					=      "will be" if year > datetime.now().year else "was"
				print(F'Easter in {year} {tense} {gauss_easter(year)}')

