


'''simple docstring'''







from collections import OrderedDict
from typing import Any, Mapping, Optional

from ... import PreTrainedTokenizer
from ...configuration_utils import PretrainedConfig
from ...file_utils import TensorType, is_torch_available
from ...onnx import OnnxConfig, OnnxConfigWithPast, OnnxSeqaSeqConfigWithPast
from ...onnx.utils import compute_effective_axis_dimension
from ...utils import logging


lowerCAmelCase    :     Optional[Any]					=						logging.get_logger(__name__)

lowerCAmelCase    :     List[str]					=						{
    """facebook/blenderbot_small-90M""": """https://huggingface.co/facebook/blenderbot_small-90M/resolve/main/config.json""",
    # See all BlenderbotSmall models at https://huggingface.co/models?filter=blenderbot_small
}
class 	UpperCamelCase__					( a__   ):



     """simple docstring"""






     __magic_name__    			=    "blenderbot-small"
     __magic_name__    			=    ["past_key_values"]
     __magic_name__    			=    {"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}







     def __init__( self      ,	snake_case__=5_0265      ,	snake_case__=512      ,	snake_case__=8      ,	snake_case__=2048      ,	snake_case__=16      ,	snake_case__=8      ,	snake_case__=2048      ,	snake_case__=16      ,	snake_case__=0.0      ,	snake_case__=0.0      ,	snake_case__=True      ,	snake_case__=True      ,	snake_case__="gelu"      ,	snake_case__=512      ,	snake_case__=0.1      ,	snake_case__=0.0      ,	snake_case__=0.0      ,	snake_case__=0.02      ,	snake_case__=1      ,	snake_case__=False      ,	snake_case__=0      ,	snake_case__=1      ,	snake_case__=2      ,	snake_case__=2      ,	**snake_case__      ,	):

            '''simple docstring'''

            _lowerCAmelCase    :							List[Any]   			=       vocab_size
            _lowerCAmelCase    :							Dict   			=       max_position_embeddings
            _lowerCAmelCase    :							List[str]   			=       d_model
            _lowerCAmelCase    :							List[Any]   			=       encoder_ffn_dim
            _lowerCAmelCase    :							int   			=       encoder_layers
            _lowerCAmelCase    :							List[str]   			=       encoder_attention_heads
            _lowerCAmelCase    :							List[Any]   			=       decoder_ffn_dim
            _lowerCAmelCase    :							Dict   			=       decoder_layers
            _lowerCAmelCase    :							Tuple   			=       decoder_attention_heads
            _lowerCAmelCase    :							str   			=       dropout
            _lowerCAmelCase    :							Any   			=       attention_dropout
            _lowerCAmelCase    :							str   			=       activation_dropout
            _lowerCAmelCase    :							Dict   			=       activation_function
            _lowerCAmelCase    :							Optional[Any]   			=       init_std
            _lowerCAmelCase    :							Optional[Any]   			=       encoder_layerdrop
            _lowerCAmelCase    :							Tuple   			=       decoder_layerdrop
            _lowerCAmelCase    :							List[str]   			=       use_cache
            _lowerCAmelCase    :							Union[str, Any]   			=       encoder_layers
            _lowerCAmelCase    :							Union[str, Any]   			=       scale_embedding  # scale factor will be sqrt(d_model) if True

            super().__init__(
                pad_token_id=_A      ,	bos_token_id=_A      ,	eos_token_id=_A      ,	is_encoder_decoder=_A      ,	decoder_start_token_id=_A      ,	forced_eos_token_id=_A      ,	**_A      ,	)
class 	UpperCamelCase__					( a__   ):



     """simple docstring"""






     @property
     def a	( self   ):

            '''simple docstring'''

            if self.task in ["default", "seq2seq-lm"]:
                   _lowerCAmelCase    :							Union[str, Any]   			=       OrderedDict(
                       [
                           ('input_ids', {0: 'batch', 1: 'encoder_sequence'}),
                           ('attention_mask', {0: 'batch', 1: 'encoder_sequence'}),
                       ]   )

                   if self.use_past:
                          _lowerCAmelCase    :							str   			=       {0: 'batch'}
                          _lowerCAmelCase    :							Optional[Any]   			=       {0: 'batch', 1: 'past_decoder_sequence + sequence'}
                   else:
                          _lowerCAmelCase    :							Optional[Any]   			=       {0: 'batch', 1: 'decoder_sequence'}
                          _lowerCAmelCase    :							Optional[int]   			=       {0: 'batch', 1: 'decoder_sequence'}

                   if self.use_past:
                          self.fill_with_past_key_values_(_A      ,	direction='inputs'   )
            elif self.task == "causal-lm":
                   # TODO: figure this case out.
                   _lowerCAmelCase    :							Optional[Any]   			=       OrderedDict(
                       [
                           ('input_ids', {0: 'batch', 1: 'encoder_sequence'}),
                           ('attention_mask', {0: 'batch', 1: 'encoder_sequence'}),
                       ]   )
                   if self.use_past:
                          _lowerCAmelCase    :							Any   			=       self.num_layers
                          for i in range(_A   ):
                                 _lowerCAmelCase    :							List[Any]   			=       {0: 'batch', 2: 'past_sequence + sequence'}
                                 _lowerCAmelCase    :							int   			=       {0: 'batch', 2: 'past_sequence + sequence'}
            else:
                   _lowerCAmelCase    :							List[Any]   			=       OrderedDict(
                       [
                           ('input_ids', {0: 'batch', 1: 'encoder_sequence'}),
                           ('attention_mask', {0: 'batch', 1: 'encoder_sequence'}),
                           ('decoder_input_ids', {0: 'batch', 1: 'decoder_sequence'}),
                           ('decoder_attention_mask', {0: 'batch', 1: 'decoder_sequence'}),
                       ]   )

            return common_inputs







     @property
     def a	( self   ):

            '''simple docstring'''

            if self.task in ["default", "seq2seq-lm"]:
                   _lowerCAmelCase    :							Union[str, Any]   			=       super().outputs
            else:
                   _lowerCAmelCase    :							Optional[int]   			=       super(_A      ,	self   ).outputs
                   if self.use_past:
                          _lowerCAmelCase    :							Optional[Any]   			=       self.num_layers
                          for i in range(_A   ):
                                 _lowerCAmelCase    :							Any   			=       {0: 'batch', 2: 'past_sequence + sequence'}
                                 _lowerCAmelCase    :							Tuple   			=       {0: 'batch', 2: 'past_sequence + sequence'}
            return common_outputs







     def a	( self      ,	snake_case__      ,	snake_case__ = -1      ,	snake_case__ = -1      ,	snake_case__ = False      ,	snake_case__ = None      ,	):

            '''simple docstring'''

            _lowerCAmelCase    :							List[str]   			=       self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
                _A      ,	_A      ,	_A      ,	_A      ,	_A   )

            # Generate decoder inputs
            _lowerCAmelCase    :							List[str]   			=       seq_length if not self.use_past else 1
            _lowerCAmelCase    :							List[str]   			=       self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
                _A      ,	_A      ,	_A      ,	_A      ,	_A   )
            _lowerCAmelCase    :							str   			=       {F'decoder_{name}': tensor for name, tensor in decoder_inputs.items()}
            _lowerCAmelCase    :							Optional[int]   			=       dict(**_A      ,	**_A   )

            if self.use_past:
                   if not is_torch_available():
                          raise ValueError('Cannot generate dummy past_keys inputs without PyTorch installed.'   )
                   else:
                          import torch
                   _lowerCAmelCase    :							str   			=       common_inputs['input_ids'].shape
                   _lowerCAmelCase    :							Tuple   			=       common_inputs['decoder_input_ids'].shape[1]
                   _lowerCAmelCase    :							int   			=       self.num_attention_heads
                   _lowerCAmelCase    :							Any   			=       (
                       batch,
                       num_encoder_attention_heads,
                       encoder_seq_length,
                       self._config.hidden_size // num_encoder_attention_heads,
                   )
                   _lowerCAmelCase    :							List[Any]   			=       decoder_seq_length + 3
                   _lowerCAmelCase    :							List[str]   			=       (
                       batch,
                       num_decoder_attention_heads,
                       decoder_past_length,
                       self._config.hidden_size // num_decoder_attention_heads,
                   )

                   _lowerCAmelCase    :							Optional[Any]   			=       torch.cat(
                       [common_inputs['decoder_attention_mask'], torch.ones(_A      ,	_A   )]      ,	dim=1   )

                   _lowerCAmelCase    :							str   			=       []
                   # If the number of encoder and decoder layers are present in the model configuration, both are considered
                   _lowerCAmelCase    :							Optional[Any]   			=       self.num_layers
                   _lowerCAmelCase    :							List[Any]   			=       min(_A      ,	_A   )
                   _lowerCAmelCase    :							str   			=       max(_A      ,	_A   ) - min_num_layers
                   _lowerCAmelCase    :							Any   			=       'encoder' if num_encoder_layers > num_decoder_layers else 'decoder'

                   for _ in range(_A   ):
                          common_inputs["past_key_values"].append(
                              (
                                  torch.zeros(_A   ),
                                  torch.zeros(_A   ),
                                  torch.zeros(_A   ),
                                  torch.zeros(_A   ),
                              )   )
                   # TODO: test this.
                   _lowerCAmelCase    :							Dict   			=       encoder_shape if remaining_side_name == 'encoder' else decoder_shape
                   for _ in range(_A      ,	_A   ):
                          common_inputs["past_key_values"].append((torch.zeros(_A   ), torch.zeros(_A   ))   )
            return common_inputs







     def a	( self      ,	snake_case__      ,	snake_case__ = -1      ,	snake_case__ = -1      ,	snake_case__ = False      ,	snake_case__ = None      ,	):

            '''simple docstring'''

            _lowerCAmelCase    :							Union[str, Any]   			=       self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
                _A      ,	_A      ,	_A      ,	_A      ,	_A   )

            if self.use_past:
                   if not is_torch_available():
                          raise ValueError('Cannot generate dummy past_keys inputs without PyTorch installed.'   )
                   else:
                          import torch
                   _lowerCAmelCase    :							List[Any]   			=       common_inputs['input_ids'].shape
                   # Not using the same length for past_key_values
                   _lowerCAmelCase    :							str   			=       seqlen + 2
                   _lowerCAmelCase    :							Dict   			=       self.num_layers
                   _lowerCAmelCase    :							Any   			=       self.num_attention_heads
                   _lowerCAmelCase    :							Optional[int]   			=       (
                       batch,
                       num_encoder_attention_heads,
                       past_key_values_length,
                       self._config.hidden_size // num_encoder_attention_heads,
                   )

                   _lowerCAmelCase    :							Optional[int]   			=       common_inputs['attention_mask'].dtype
                   _lowerCAmelCase    :							Dict   			=       torch.cat(
                       [common_inputs['attention_mask'], torch.ones(_A      ,	_A      ,	dtype=_A   )]      ,	dim=1   )
                   _lowerCAmelCase    :							str   			=       [
                       (torch.zeros(_A   ), torch.zeros(_A   )) for _ in range(_A   )
                   ]
            return common_inputs







     def a	( self      ,	snake_case__      ,	snake_case__ = -1      ,	snake_case__ = -1      ,	snake_case__ = False      ,	snake_case__ = None      ,	):

            '''simple docstring'''

            _lowerCAmelCase    :							str   			=       compute_effective_axis_dimension(
                _A      ,	fixed_dimension=OnnxConfig.default_fixed_batch      ,	num_token_to_add=0   )

            # If dynamic axis (-1) we forward with a fixed dimension of 8 tokens to avoid optimizations made by ONNX
            _lowerCAmelCase    :							Optional[int]   			=       tokenizer.num_special_tokens_to_add(_A   )
            _lowerCAmelCase    :							str   			=       compute_effective_axis_dimension(
                _A      ,	fixed_dimension=OnnxConfig.default_fixed_sequence      ,	num_token_to_add=_A   )

            # Generate dummy inputs according to compute batch and sequence
            _lowerCAmelCase    :							str   			=       [' '.join([tokenizer.unk_token]   ) * seq_length] * batch_size
            _lowerCAmelCase    :							Tuple   			=       dict(tokenizer(_A      ,	return_tensors=_A   )   )
            return common_inputs







     def a	( self      ,	snake_case__      ,	snake_case__ = -1      ,	snake_case__ = -1      ,	snake_case__ = False      ,	snake_case__ = None      ,	):

            '''simple docstring'''

            if self.task in ["default", "seq2seq-lm"]:
                   _lowerCAmelCase    :							Dict   			=       self._generate_dummy_inputs_for_default_and_seqaseq_lm(
                       _A      ,	batch_size=_A      ,	seq_length=_A      ,	is_pair=_A      ,	framework=_A   )

            elif self.task == "causal-lm":
                   _lowerCAmelCase    :							Optional[Any]   			=       self._generate_dummy_inputs_for_causal_lm(
                       _A      ,	batch_size=_A      ,	seq_length=_A      ,	is_pair=_A      ,	framework=_A   )
            else:
                   _lowerCAmelCase    :							str   			=       self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
                       _A      ,	batch_size=_A      ,	seq_length=_A      ,	is_pair=_A      ,	framework=_A   )

            return common_inputs







     def a	( self      ,	snake_case__      ,	snake_case__      ,	snake_case__      ,	snake_case__   ):

            '''simple docstring'''

            if self.task in ["default", "seq2seq-lm"]:
                   _lowerCAmelCase    :							Optional[Any]   			=       super()._flatten_past_key_values_(_A      ,	_A      ,	_A      ,	_A   )
            else:
                   _lowerCAmelCase    :							str   			=       super(_A      ,	self   )._flatten_past_key_values_(
                       _A      ,	_A      ,	_A      ,	_A   )





'''simple docstring'''







import math
from datetime import datetime, timedelta






def 			lowercase				(_A					):







       """simple docstring"""







       _lowerCAmelCase    :							Optional[Any]   			=       year % 1_9
       _lowerCAmelCase    :							Any   			=       year % 4
       _lowerCAmelCase    :							Optional[int]   			=       year % 7
       _lowerCAmelCase    :							int   			=       math.floor(year / 1_0_0					)
       _lowerCAmelCase    :							Dict   			=       math.floor((1_3 + 8 * leap_day_inhibits) / 2_5					)
       _lowerCAmelCase    :							Optional[Any]   			=       leap_day_inhibits / 4
       _lowerCAmelCase    :							Dict   			=       (
           1_5 - lunar_orbit_correction + leap_day_inhibits - leap_day_reinstall_number
       ) % 3_0
       _lowerCAmelCase    :							List[Any]   			=       (4 + leap_day_inhibits - leap_day_reinstall_number) % 7

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

       # PHM -> Paschal Full Moon
       _lowerCAmelCase    :							Union[str, Any]   			=       (
           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(_A   ,						4   ,						1_9					)
       elif days_to_add == 2_8 and days_from_phm_to_sunday == 6:
              return datetime(_A   ,						4   ,						1_8					)
       else:
              return datetime(_A   ,						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):
              lowerCAmelCase    :     List[str]					=						"""will be""" if year > datetime.now().year else """was"""
              print(F'''Easter in {year} {tense} {gauss_easter(year)}''')

