"""simple docstring"""





import os
import re
import unicodedata
from shutil import copyfile
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union

import sentencepiece as spm

from ...tokenization_utils import PreTrainedTokenizer
from ...utils import is_torch_available, logging


if is_torch_available():
				import torch


if TYPE_CHECKING:
				from transformers.pipelines.conversational import Conversation


__A  =				logging.get_logger(__name__)
__A  =				{'''vocab_file''': '''spiece.model'''}

__A  =				{
    '''vocab_file''': {
        '''AI-Sweden/gpt-sw3-126m''': '''https://huggingface.co/AI-Sweden/gpt-sw3-126m/resolve/main/spiece.model''',
        '''AI-Sweden/gpt-sw3-350m''': '''https://huggingface.co/AI-Sweden/gpt-sw3-350m/resolve/main/spiece.model''',
        '''AI-Sweden/gpt-sw3-1.6b''': '''https://huggingface.co/AI-Sweden/gpt-sw3-1.6b/resolve/main/spiece.model''',
        '''AI-Sweden/gpt-sw3-6.7b''': '''https://huggingface.co/AI-Sweden/gpt-sw3-6.7b/resolve/main/spiece.model''',
        '''AI-Sweden/gpt-sw3-20b''': '''https://huggingface.co/AI-Sweden/gpt-sw3-20b/resolve/main/spiece.model''',
    }
}

__A  =				{
    '''AI-Sweden/gpt-sw3-126m''': 2048,
    '''AI-Sweden/gpt-sw3-350m''': 2048,
    '''AI-Sweden/gpt-sw3-1.6b''': 2048,
    '''AI-Sweden/gpt-sw3-6.7b''': 2048,
    '''AI-Sweden/gpt-sw3-20b''': 2048,
}
class  _snake_case     (					a__		):
						snake_case__			  =			VOCAB_FILES_NAMES
						snake_case__			  =			PRETRAINED_VOCAB_FILES_MAP
						snake_case__			  =			PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
						snake_case__			  =			["input_ids", "attention_mask"]






						def __init__(       self      :			Tuple							,					UpperCAmelCase      :			Optional[Any]							,					UpperCAmelCase      :			Tuple=False							,					UpperCAmelCase      :			Dict=False							,					UpperCAmelCase      :			List[Any]=False							,					UpperCAmelCase      :			Tuple=None							,					UpperCAmelCase      :			List[Any]=None							,					UpperCAmelCase      :			Any=None							,					UpperCAmelCase      :			Dict=None							,					UpperCAmelCase      :			Optional[Dict[str, Any]] = None							,					**UpperCAmelCase      :			int							,					):
													__lowerCamelCase					:		str		   =     {} if sp_model_kwargs is None else sp_model_kwargs

													__lowerCamelCase					:		str		   =     kwargs.get("name_or_path"    )
													if name_or_path is None:
																				logger.warning(
																				    "name_or_path not provided, will work for all GPTSw3 models except gpt-sw3-7b,"
																				    " you are testing the model, this can safely be ignored"    )
																				__lowerCamelCase					:		Any		   =     "None"

													# Default definitions for our 2 tokenizer versions, with None-checks to enable proper testing
													__lowerCamelCase					:		List[str]		   =     "<|endoftext|>" if eos_token is None else eos_token
													__lowerCamelCase					:		str		   =     "<unk>" if unk_token is None else unk_token
													if "gpt-sw3-7b" in name_or_path:
																				__lowerCamelCase					:		Dict		   =     unk_token if pad_token is None else pad_token
																				__lowerCamelCase					:		Union[str, Any]		   =     eos_token if bos_token is None else bos_token
													else:
																				__lowerCamelCase					:		Optional[int]		   =     "<pad>" if pad_token is None else pad_token
																				__lowerCamelCase					:		Tuple		   =     "<s>" if bos_token is None else bos_token

													super().__init__(
													    do_lower_case=UpperCAmelCase							,					remove_space=UpperCAmelCase							,					keep_accents=UpperCAmelCase							,					bos_token=UpperCAmelCase							,					eos_token=UpperCAmelCase							,					unk_token=UpperCAmelCase							,					pad_token=UpperCAmelCase							,					sp_model_kwargs=self.sp_model_kwargs							,					**UpperCAmelCase							,					)

													__lowerCamelCase					:		Tuple		   =     do_lower_case
													__lowerCamelCase					:		Optional[Any]		   =     remove_space
													__lowerCamelCase					:		List[Any]		   =     keep_accents
													__lowerCamelCase					:		str		   =     vocab_file

													__lowerCamelCase					:		str		   =     spm.SentencePieceProcessor(**self.sp_model_kwargs    )
													self.sp_model.Load(UpperCAmelCase    )

													# Used for whitespace normalization in input texts
													# fmt : off
													__lowerCamelCase					:		Dict		   =     {" ", " ", " ", " ", " ", "　", " ", " ", " ", " ", "￼", ""}
													# fmt : on

													# Regular expression to remove non-printing characters (e.g. some unicode control chars) in preprocessing
													__lowerCamelCase					:		Union[str, Any]		   =     re.compile(
													    F"""[{"".join(map(UpperCAmelCase							,					list(range(0							,					9    )    ) + list(range(11							,					32    )    ) + list(range(127							,					160    )    ) + [160, 173, 8203]    )    )}]"""    )






						def __getstate__(       self      :			Union[str, Any]    ):
													__lowerCamelCase					:		Tuple		   =     self.__dict__.copy()
													__lowerCamelCase					:		List[Any]		   =     None
													return state






						def __setstate__(       self      :			str							,					UpperCAmelCase      :			str    ):
													__lowerCamelCase					:		str		   =     d

													# for backward compatibility
													if not hasattr(self							,					"sp_model_kwargs"    ):
																				__lowerCamelCase					:		Any		   =     {}

													__lowerCamelCase					:		Optional[Any]		   =     spm.SentencePieceProcessor(**self.sp_model_kwargs    )
													self.sp_model.Load(self.vocab_file    )






						@property
						# Copied from transformers.models.albert.tokenization_albert.AlbertTokenizer.vocab_size
						def       lowerCamelCase__     (       self      :			List[Any]    ):
													return len(self.sp_model    )






						def       lowerCamelCase__     (       self      :			Optional[Any]							,					UpperCAmelCase      :			str    ):
													__lowerCamelCase					:		Tuple		   =     self.non_printing_characters_re.sub(""							,					UpperCAmelCase    )

													# Normalize whitespaces
													__lowerCamelCase					:		Tuple		   =     "".join([char if char not in self.whitespaces else " " for char in text]    )

													# NFC Unicode normalization
													__lowerCamelCase					:		int		   =     unicodedata.normalize("NFC"							,					UpperCAmelCase    )
													return text






						def       lowerCamelCase__     (       self      :			Dict							,					UpperCAmelCase      :			str							,					**UpperCAmelCase      :			Union[str, Any]    ):
													__lowerCamelCase					:		str		   =     self.preprocess_text(UpperCAmelCase    )
													return self.sp_model.encode(UpperCAmelCase							,					out_type=UpperCAmelCase    )






						def       lowerCamelCase__     (       self      :			int							,					UpperCAmelCase      :			str    ):
													return self.sp_model.PieceToId(UpperCAmelCase    )






						def       lowerCamelCase__     (       self      :			List[str]							,					UpperCAmelCase      :			int    ):
													return self.sp_model.IdToPiece(UpperCAmelCase    )






						@staticmethod
						def       lowerCamelCase__     (       UpperCAmelCase      :			str    ):
													return out_string






						def       lowerCamelCase__     (       self      :			Any							,					UpperCAmelCase      :			List[str]    ):
													__lowerCamelCase					:		str		   =     []
													__lowerCamelCase					:		List[str]		   =     ""
													__lowerCamelCase					:		int		   =     False
													for token in tokens:
																				# make sure that special tokens are not decoded using sentencepiece model
																				if token in self.all_special_tokens:
																											# TODO: Check if this is needed, as it ensures that decode(encode(doc)) != doc by adding extra whitespace in the decoded document
																											if not prev_is_special:
																																		out_string += " "

																											out_string += self.sp_model.decode(UpperCAmelCase    ) + token
																											__lowerCamelCase					:		List[str]		   =     True
																											__lowerCamelCase					:		List[str]		   =     []
																				else:
																											current_sub_tokens.append(UpperCAmelCase    )
																											__lowerCamelCase					:		Optional[int]		   =     False
													out_string += self.sp_model.decode(UpperCAmelCase    )

													return out_string






						def       lowerCamelCase__     (       self      :			int    ):
													__lowerCamelCase					:		List[str]		   =     {self.convert_ids_to_tokens(UpperCAmelCase    ): i for i in range(self.vocab_size    )}
													vocab.update(self.added_tokens_encoder    )
													return vocab






						def       lowerCamelCase__     (       self      :			List[str]							,					UpperCAmelCase      :			str							,					UpperCAmelCase      :			Optional[str] = None    ):
													if not os.path.isdir(UpperCAmelCase    ):
																				logger.error(F"""Vocabulary path ({save_directory}) should be a directory"""    )
																				return
													__lowerCamelCase					:		Optional[Any]		   =     os.path.join(
													    UpperCAmelCase							,					(filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]    )

													if os.path.abspath(self.vocab_file    ) != os.path.abspath(UpperCAmelCase    ) and os.path.isfile(self.vocab_file    ):
																				copyfile(self.vocab_file							,					UpperCAmelCase    )
													elif not os.path.isfile(self.vocab_file    ):
																				with open(UpperCAmelCase							,					"wb"    ) as fi:
																											__lowerCamelCase					:		Union[str, Any]		   =     self.sp_model.serialized_model_proto()
																											fi.write(UpperCAmelCase    )

													return (out_vocab_file,)






						def       lowerCamelCase__     (       self      :			Dict							,					UpperCAmelCase      :			Union[str, List[str]]							,					UpperCAmelCase      :			Union[str, bool] = False    ):

													if isinstance(UpperCAmelCase							,					UpperCAmelCase    ):
																				__lowerCamelCase					:		Tuple		   =     self.preprocess_text(UpperCAmelCase    )
																				__lowerCamelCase					:		List[Any]		   =     self.sp_model.encode(UpperCAmelCase    )
													else:
																				__lowerCamelCase					:		Union[str, Any]		   =     [self.preprocess_text(UpperCAmelCase    ) for t in text]
																				__lowerCamelCase					:		str		   =     self.sp_model.encode(UpperCAmelCase    )

													if return_tensors is True or return_tensors == "pt":
																				__lowerCamelCase					:		Optional[Any]		   =     torch.tensor(UpperCAmelCase    )

													return token_ids






						def       lowerCamelCase__     (       self      :			List[Any]							,					UpperCAmelCase      :			Union[int, List[int]]    ):
													return self.sp_model.decode(UpperCAmelCase    )







						def       lowerCamelCase__     (       self      :			Optional[Any]							,					UpperCAmelCase      :			"Conversation"    ):
													__lowerCamelCase					:		Dict		   =     [F"""User: {text}""" if is_user else F"""Bot: {text}""" for is_user, text in conversation.iter_texts()]
													__lowerCamelCase					:		str		   =     (
													    F"""{self.eos_token}{self.bos_token}""" + F"""{self.bos_token}""".join(UpperCAmelCase    ) + F"""{self.bos_token}Bot:"""
													)
													return self.encode(text=UpperCAmelCase    )
"""simple docstring"""





import math
from datetime import datetime, timedelta


def    lowercase_   (   _lowerCamelCase:	int      ) ->      datetime:



							'''simple docstring'''

							__lowerCamelCase					:		List[Any]		   =     year % 19
							__lowerCamelCase					:		List[str]		   =     year % 4
							__lowerCamelCase					:		Dict		   =     year % 7
							__lowerCamelCase					:		Optional[Any]		   =     math.floor(year / 100      )
							__lowerCamelCase					:		Tuple		   =     math.floor((13 + 8 * leap_day_inhibits) / 25      )
							__lowerCamelCase					:		List[str]		   =     leap_day_inhibits / 4
							__lowerCamelCase					:		Optional[Any]		   =     (
							    15 - lunar_orbit_correction + leap_day_inhibits - leap_day_reinstall_number
							) % 30
							__lowerCamelCase					:		Union[str, Any]		   =     (4 + leap_day_inhibits - leap_day_reinstall_number) % 7

							# days to be added to March 21
							__lowerCamelCase					:		Union[str, Any]		   =     (19 * metonic_cycle + secular_moon_shift) % 30

							# PHM -> Paschal Full Moon
							__lowerCamelCase					:		List[Any]		   =     (
							    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 (1994, 2000, 2010, 2021, 2023):
								__A  =				'''will be''' if year > datetime.now().year else '''was'''
								print(F"""Easter in {year} {tense} {gauss_easter(year)}""")