


"""simple docstring"""




from ...configuration_utils import PretrainedConfig
from ...utils import logging


UpperCAmelCase_				:			List[Any]   =	logging.get_logger(__name__)

UpperCAmelCase_				:			List[Any]   =	{
    'google/pegasus-large': 'https://huggingface.co/google/pegasus-large/resolve/main/config.json',
    # See all PEGASUS models at https://huggingface.co/models?filter=pegasus
}
class 			SCREAMING_SNAKE_CASE__  (    snake_case_      ):
      snake_case__    :					Tuple					       =						"pegasus"
      snake_case__    :					str					       =						["past_key_values"]
      snake_case__    :					int					       =						{"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}
      def __init__(	self    :	Union[str, Any]					,							SCREAMING_SNAKE_CASE__    :	Optional[Any]=5_0_2_6_5					,							SCREAMING_SNAKE_CASE__    :	List[str]=1_0_2_4					,							SCREAMING_SNAKE_CASE__    :	Optional[int]=1_2					,							SCREAMING_SNAKE_CASE__    :	Any=4_0_9_6					,							SCREAMING_SNAKE_CASE__    :	str=1_6					,							SCREAMING_SNAKE_CASE__    :	Dict=1_2					,							SCREAMING_SNAKE_CASE__    :	Dict=4_0_9_6					,							SCREAMING_SNAKE_CASE__    :	Dict=1_6					,							SCREAMING_SNAKE_CASE__    :	Optional[int]=0.0					,							SCREAMING_SNAKE_CASE__    :	Dict=0.0					,							SCREAMING_SNAKE_CASE__    :	Dict=True					,							SCREAMING_SNAKE_CASE__    :	Optional[Any]=True					,							SCREAMING_SNAKE_CASE__    :	Optional[int]="gelu"					,							SCREAMING_SNAKE_CASE__    :	Tuple=1_0_2_4					,							SCREAMING_SNAKE_CASE__    :	int=0.1					,							SCREAMING_SNAKE_CASE__    :	Optional[Any]=0.0					,							SCREAMING_SNAKE_CASE__    :	str=0.0					,							SCREAMING_SNAKE_CASE__    :	List[Any]=0.02					,							SCREAMING_SNAKE_CASE__    :	Union[str, Any]=0					,							SCREAMING_SNAKE_CASE__    :	str=False					,							SCREAMING_SNAKE_CASE__    :	List[Any]=0					,							SCREAMING_SNAKE_CASE__    :	List[str]=1					,							SCREAMING_SNAKE_CASE__    :	List[Any]=1					,							**SCREAMING_SNAKE_CASE__    :	Optional[Any]					,							)		->      Optional[Any]:
             a_ :		Union[str, Any]							=  vocab_size
             a_ :		str							=  max_position_embeddings
             a_ :		List[str]							=  d_model
             a_ :		List[str]							=  encoder_ffn_dim
             a_ :		Optional[Any]							=  encoder_layers
             a_ :		str							=  encoder_attention_heads
             a_ :		Any							=  decoder_ffn_dim
             a_ :		Optional[Any]							=  decoder_layers
             a_ :		Tuple							=  decoder_attention_heads
             a_ :		Dict							=  dropout
             a_ :		List[str]							=  attention_dropout
             a_ :		Any							=  activation_dropout
             a_ :		int							=  activation_function
             a_ :		Tuple							=  init_std
             a_ :		int							=  encoder_layerdrop
             a_ :		List[Any]							=  decoder_layerdrop
             a_ :		Any							=  use_cache
             a_ :		List[Any]							=  encoder_layers
             a_ :		Optional[Any]							=  scale_embedding  # scale factor will be sqrt(d_model) if True
             super().__init__(
                 pad_token_id=_A					,							eos_token_id=_A					,							is_encoder_decoder=_A					,							decoder_start_token_id=_A					,							forced_eos_token_id=_A					,							**_A					,							)
      @property
      def 	SCREAMING_SNAKE_CASE							(	self    :	List[Any]					)		->      int:
             return self.encoder_attention_heads

      @property
      def 	SCREAMING_SNAKE_CASE							(	self    :	Optional[int]					)		->      int:
             return self.d_model






def 	SCREAMING_SNAKE_CASE_						(      __A			:      list    )     ->		bool:

       """simple docstring"""

       if not isinstance(__A  ,   __A    ):
              raise ValueError('Input series is not valid, valid series - [2, 4, 6]'    )
       if len(__A    ) == 0:
              raise ValueError('Input list must be a non empty list'    )
       if len(__A    ) == 1:
              return True
       a_ :		Tuple							=  series[1] - series[0]
       for index in range(len(__A    ) - 1    ):
              if series[index + 1] - series[index] != common_diff:
                     return False
       return True







def 	SCREAMING_SNAKE_CASE_						(      __A			:      list    )     ->		float:

       """simple docstring"""

       if not isinstance(__A  ,   __A    ):
              raise ValueError('Input series is not valid, valid series - [2, 4, 6]'    )
       if len(__A    ) == 0:
              raise ValueError('Input list must be a non empty list'    )
       a_ :		str							=  0
       for val in series:
              answer += val
       return answer / len(__A    )


if __name__ == "__main__":
   import doctest

   doctest.testmod()


