



import math
import time

from transformers import Trainer, is_torch_tpu_available
from transformers.trainer_utils import PredictionOutput, speed_metrics


if is_torch_tpu_available(check_device=False):
	import torch_xla.core.xla_model as xm
	import torch_xla.debug.metrics as met


class 					_lowercase      (a_					):
				'''simple docstring'''







				def __init__(       self   ,       *snake_case__   ,       snake_case__=None   ,       snake_case__=None   ,       **snake_case__			):

									'''simple docstring'''


									super().__init__(*snake_case__   ,       **snake_case__			)
									UpperCamelCase_						     =      eval_examples
									UpperCamelCase_						     =      post_process_function

				def 					_lowerCamelCase    (       self   ,       snake_case__=None   ,       snake_case__=None   ,       snake_case__=None   ,       snake_case__ = "eval"			):

									'''simple docstring'''


									UpperCamelCase_						     =      self.eval_dataset if eval_dataset is None else eval_dataset
									UpperCamelCase_						     =      self.get_eval_dataloader(snake_case__			)
									UpperCamelCase_						     =      self.eval_examples if eval_examples is None else eval_examples

									# Temporarily disable metric computation, we will do it in the loop here.
									UpperCamelCase_						     =      self.compute_metrics
									UpperCamelCase_						     =      None
									UpperCamelCase_						     =      self.prediction_loop if self.args.use_legacy_prediction_loop else self.evaluation_loop
									UpperCamelCase_						     =      time.time()
									try:
														UpperCamelCase_						     =      eval_loop(
														    snake_case__   ,       description="Evaluation"   ,       prediction_loss_only=True if compute_metrics is None else None   ,       ignore_keys=snake_case__   ,       metric_key_prefix=snake_case__   ,       )
									finally:
														UpperCamelCase_						     =      compute_metrics
									UpperCamelCase_						     =      self.args.eval_batch_size * self.args.world_size
									if F"""{metric_key_prefix}_jit_compilation_time""" in output.metrics:
														start_time += output.metrics[F"""{metric_key_prefix}_jit_compilation_time"""]
									output.metrics.update(
									    speed_metrics(
									        snake_case__   ,       snake_case__   ,       num_samples=output.num_samples   ,       num_steps=math.ceil(output.num_samples / total_batch_size			)   ,       )			)
									if self.post_process_function is not None and self.compute_metrics is not None and self.args.should_save:
														# Only the main node write the results by default
														UpperCamelCase_						     =      self.post_process_function(snake_case__   ,       snake_case__   ,       output.predictions			)
														UpperCamelCase_						     =      self.compute_metrics(snake_case__			)

														# Prefix all keys with metric_key_prefix + '_'
														for key in list(metrics.keys()			):
																			if not key.startswith(F"""{metric_key_prefix}_"""			):
																								UpperCamelCase_						     =      metrics.pop(snake_case__			)
														metrics.update(output.metrics			)
									else:
														UpperCamelCase_						     =      output.metrics

									if self.args.should_log:
														# Only the main node log the results by default
														self.log(snake_case__			)

									if self.args.tpu_metrics_debug or self.args.debug:
														# tpu-comment: Logging debug metrics for PyTorch/XLA (compile, execute times, ops, etc.)
														xm.master_print(met.metrics_report()			)

									UpperCamelCase_						     =      self.callback_handler.on_evaluate(self.args   ,       self.state   ,       self.control   ,       snake_case__			)
									return metrics

				def 					_lowerCamelCase    (       self   ,       snake_case__   ,       snake_case__   ,       snake_case__=None   ,       snake_case__ = "test"			):

									'''simple docstring'''


									UpperCamelCase_						     =      self.get_test_dataloader(snake_case__			)

									# Temporarily disable metric computation, we will do it in the loop here.
									UpperCamelCase_						     =      self.compute_metrics
									UpperCamelCase_						     =      None
									UpperCamelCase_						     =      self.prediction_loop if self.args.use_legacy_prediction_loop else self.evaluation_loop
									UpperCamelCase_						     =      time.time()
									try:
														UpperCamelCase_						     =      eval_loop(
														    snake_case__   ,       description="Prediction"   ,       prediction_loss_only=True if compute_metrics is None else None   ,       ignore_keys=snake_case__   ,       metric_key_prefix=snake_case__   ,       )
									finally:
														UpperCamelCase_						     =      compute_metrics
									UpperCamelCase_						     =      self.args.eval_batch_size * self.args.world_size
									if F"""{metric_key_prefix}_jit_compilation_time""" in output.metrics:
														start_time += output.metrics[F"""{metric_key_prefix}_jit_compilation_time"""]
									output.metrics.update(
									    speed_metrics(
									        snake_case__   ,       snake_case__   ,       num_samples=output.num_samples   ,       num_steps=math.ceil(output.num_samples / total_batch_size			)   ,       )			)

									if self.post_process_function is None or self.compute_metrics is None:
														return output

									UpperCamelCase_						     =      self.post_process_function(snake_case__   ,       snake_case__   ,       output.predictions   ,       "predict"			)
									UpperCamelCase_						     =      self.compute_metrics(snake_case__			)

									# Prefix all keys with metric_key_prefix + '_'
									for key in list(metrics.keys()			):
														if not key.startswith(F"""{metric_key_prefix}_"""			):
																			UpperCamelCase_						     =      metrics.pop(snake_case__			)
									metrics.update(output.metrics			)
									return PredictionOutput(predictions=predictions.predictions   ,       label_ids=predictions.label_ids   ,       metrics=snake_case__			)






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)}')

