


"""simple docstring"""



import unittest

from datasets import load_dataset

from transformers import BloomTokenizerFast
from transformers.testing_utils import require_tokenizers

from ...test_tokenization_common import TokenizerTesterMixin







@require_tokenizers
class    __a						( __snake_case					,			unittest.TestCase							):
				lowerCamelCase     :       Dict			       =None
				lowerCamelCase     :       Any			       =BloomTokenizerFast
				lowerCamelCase     :       Union[str, Any]			       =BloomTokenizerFast
				lowerCamelCase     :       Dict			       =True
				lowerCamelCase     :       Optional[int]			       =False
				lowerCamelCase     :       List[str]			       ='tokenizer_file'
				lowerCamelCase     :       List[str]			       ={'bos_token': '<s>', 'eos_token': '</s>', 'unk_token': '<unk>', 'pad_token': '<pad>'}







				def      lowerCamelCase_     ( self   ):

					'''simple docstring'''






					super().setUp()
					lowerCAmelCase_      							=			BloomTokenizerFast.from_pretrained('''bigscience/tokenizer'''   )
					tokenizer.save_pretrained(self.tmpdirname   )







				def      lowerCamelCase_     ( self      ,	**UpperCAmelCase   ):

					'''simple docstring'''






					kwargs.update(self.special_tokens_map   )
					return BloomTokenizerFast.from_pretrained(self.tmpdirname      ,	**UpperCAmelCase   )







				def      lowerCamelCase_     ( self   ):

					'''simple docstring'''






					lowerCAmelCase_      							=			self.get_rust_tokenizer()

					lowerCAmelCase_      							=			['''The quick brown fox</s>''', '''jumps over the lazy dog</s>''']
					lowerCAmelCase_      							=			[[2175, 2_3714, 7_3173, 14_4252, 2], [77, 13_2619, 3478, 368, 10_9586, 3_5433, 2]]

					lowerCAmelCase_      							=			tokenizer.batch_encode_plus(UpperCAmelCase   )['''input_ids''']
					self.assertListEqual(UpperCAmelCase      ,	UpperCAmelCase   )

					lowerCAmelCase_      							=			tokenizer.batch_decode(UpperCAmelCase   )
					self.assertListEqual(UpperCAmelCase      ,	UpperCAmelCase   )







				def      lowerCamelCase_     ( self      ,	UpperCAmelCase=6   ):

					'''simple docstring'''






					for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
						with self.subTest(F"""{tokenizer.__class__.__name__} ({pretrained_name})"""   ):
							lowerCAmelCase_      							=			self.rust_tokenizer_class.from_pretrained(UpperCAmelCase      ,	**UpperCAmelCase   )
							# tokenizer_r.pad_token = None # Hotfixing padding = None
							# Simple input
							lowerCAmelCase_      							=			'''This is a simple input'''
							lowerCAmelCase_      							=			['''This is a simple input 1''', '''This is a simple input 2''']
							lowerCAmelCase_      							=			('''This is a simple input''', '''This is a pair''')
							lowerCAmelCase_      							=			[
							    ('''This is a simple input 1''', '''This is a simple input 2'''),
							    ('''This is a simple pair 1''', '''This is a simple pair 2'''),
							]

							# Simple input tests
							try:
								tokenizer_r.encode(UpperCAmelCase      ,	max_length=UpperCAmelCase   )
								tokenizer_r.encode_plus(UpperCAmelCase      ,	max_length=UpperCAmelCase   )

								tokenizer_r.batch_encode_plus(UpperCAmelCase      ,	max_length=UpperCAmelCase   )
								tokenizer_r.encode(UpperCAmelCase      ,	max_length=UpperCAmelCase   )
								tokenizer_r.batch_encode_plus(UpperCAmelCase      ,	max_length=UpperCAmelCase   )
							except ValueError:
								self.fail('''Bloom Tokenizer should be able to deal with padding'''   )

							lowerCAmelCase_      							=			None  # Hotfixing padding = None
							self.assertRaises(UpperCAmelCase      ,	tokenizer_r.encode      ,	UpperCAmelCase      ,	max_length=UpperCAmelCase      ,	padding='''max_length'''   )

							# Simple input
							self.assertRaises(UpperCAmelCase      ,	tokenizer_r.encode_plus      ,	UpperCAmelCase      ,	max_length=UpperCAmelCase      ,	padding='''max_length'''   )

							# Simple input
							self.assertRaises(
							    UpperCAmelCase      ,	tokenizer_r.batch_encode_plus      ,	UpperCAmelCase      ,	max_length=UpperCAmelCase      ,	padding='''max_length'''      ,	)

							# Pair input
							self.assertRaises(UpperCAmelCase      ,	tokenizer_r.encode      ,	UpperCAmelCase      ,	max_length=UpperCAmelCase      ,	padding='''max_length'''   )

							# Pair input
							self.assertRaises(UpperCAmelCase      ,	tokenizer_r.encode_plus      ,	UpperCAmelCase      ,	max_length=UpperCAmelCase      ,	padding='''max_length'''   )

							# Pair input
							self.assertRaises(
							    UpperCAmelCase      ,	tokenizer_r.batch_encode_plus      ,	UpperCAmelCase      ,	max_length=UpperCAmelCase      ,	padding='''max_length'''      ,	)







				def      lowerCamelCase_     ( self   ):

					'''simple docstring'''






					lowerCAmelCase_      							=			self.get_rust_tokenizer()
					lowerCAmelCase_      							=			load_dataset('''xnli'''      ,	'''all_languages'''      ,	split='''test'''      ,	streaming=UpperCAmelCase   )

					lowerCAmelCase_      							=			next(iter(UpperCAmelCase   )   )['''premise''']  # pick up one data
					lowerCAmelCase_      							=			list(sample_data.values()   )

					lowerCAmelCase_      							=			list(map(tokenizer.encode      ,	UpperCAmelCase   )   )
					lowerCAmelCase_      							=			[tokenizer.decode(UpperCAmelCase      ,	clean_up_tokenization_spaces=UpperCAmelCase   ) for x in output_tokens]
					self.assertListEqual(UpperCAmelCase      ,	UpperCAmelCase   )







				def      lowerCamelCase_     ( self   ):

					'''simple docstring'''






					self.assertGreaterEqual(len(self.tokenizer_class.pretrained_vocab_files_map   )      ,	1   )
					self.assertGreaterEqual(len(list(self.tokenizer_class.pretrained_vocab_files_map.values()   )[0]   )      ,	1   )



"""simple docstring"""



import math
from datetime import datetime, timedelta
def      UpperCAmelCase     (       _lowercase :   int	)						-> datetime:


	"""simple docstring"""




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

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

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