
'''simple docstring'''





from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


a__						:				List[str]           =    logging.get_logger(__name__)

a__						:				int           =    {
    "mnaylor/mega-base-wikitext": "https://huggingface.co/mnaylor/mega-base-wikitext/resolve/main/config.json",
}


class 	UpperCamelCase__					(      _a):
 UpperCAmelCase__  			=   'mega'






 def __init__(     self					:str		,			_A					:Optional[int]=30_522		,			_A					:Any=128		,			_A					:List[Any]=4		,			_A					:Tuple=256		,			_A					:Tuple=16		,			_A					:Optional[int]=True		,			_A					:int=64		,			_A					:List[Any]=False		,			_A					:int=-1		,			_A					:Union[str, Any]=None		,			_A					:Union[str, Any]=True		,			_A					:Dict="scalenorm"		,			_A					:Optional[int]=True		,			_A					:Any="silu"		,			_A					:Optional[Any]="softmax"		,			_A					:Any=0.1		,			_A					:str=0.1		,			_A					:List[str]=0.1		,			_A					:Tuple=False		,			_A					:Union[str, Any]=True		,			_A					:Union[str, Any]=256		,			_A					:int=True		,			_A					:Tuple=0.1		,			_A					:Optional[Any]=2_048		,			_A					:Optional[int]=False		,			_A					:Union[str, Any]=2		,			_A					:Tuple=0.02		,			_A					:Optional[Any]=0.2		,			_A					:List[str]=0.02		,			_A					:Dict=1.0		,			_A					:Any=1		,			_A					:List[str]=0		,			_A					:Any=2		,			_A					:Any="rotary"		,			_A					:Optional[int]=None		,			_A					:List[str]=True		,			_A					:Optional[int]=True		,			**_A					:str		,			)			->     Tuple:







       '''simple docstring'''



       super().__init__(pad_token_id=_A		,			bos_token_id=_A		,			eos_token_id=_A		,			**_A     )

       __A    		=     vocab_size
       __A    		=     hidden_size
       __A    		=     num_hidden_layers
       __A    		=     activation
       __A    		=     attention_activation
       __A    		=     intermediate_size
       __A    		=     ema_projection_size
       __A    		=     bidirectional
       __A    		=     shared_representation_size
       __A    		=     use_chunking
       __A    		=     chunk_size
       __A    		=     truncation
       __A    		=     normalize_before_mega
       __A    		=     normalization_type
       __A    		=     norm_affine
       __A    		=     dropout_prob
       __A    		=     hidden_dropout_prob
       __A    		=     attention_probs_dropout_prob
       __A    		=     use_feature_dropout
       __A    		=     use_normalized_ffn
       __A    		=     nffn_hidden_size
       __A    		=     normalize_before_ffn
       __A    		=     nffn_activation_dropout_prob
       __A    		=     max_positions
       __A    		=     add_token_type_embeddings
       __A    		=     type_vocab_size
       __A    		=     initializer_range
       __A    		=     ema_delta_alpha_range
       __A    		=     ema_beta_range
       __A    		=     ema_gamma_omega_range
       __A    		=     relative_positional_bias
       __A    		=     use_cache
       __A    		=     classifier_dropout
       __A    		=     add_lm_hidden_dense_layer
       __A    		=     1  # not used but required by Hugging Face


class 	UpperCamelCase__					(      _a):






 @property
 def 		lowercase_  (     self					:Union[str, Any]     )			->     Optional[int]:







       '''simple docstring'''



       if self.task == "multiple-choice":
             __A    		=     {0: 'batch', 1: 'choice', 2: 'sequence'}
       else:
             __A    		=     {0: 'batch', 1: 'sequence'}
       return OrderedDict(
           [
               ('input_ids', dynamic_axis),
               ('attention_mask', dynamic_axis),
           ]     )








'''simple docstring'''





from __future__ import annotations





def     snake_case							(						UpperCAmelCase ,					UpperCAmelCase ,					UpperCAmelCase		)->     tuple[float, float]:







      """simple docstring"""
      assert (
          c % greatest_common_divisor(UpperCAmelCase ,					UpperCAmelCase		) == 0
      )  # greatest_common_divisor(a,b) function implemented below
      ((__A)		, (__A)		, (__A))    		=     extended_gcd(UpperCAmelCase ,					UpperCAmelCase		)  # extended_gcd(a,b) function implemented below
      __A    		=     c / d
      return (r * x, r * y)





def     snake_case							(						UpperCAmelCase ,					UpperCAmelCase ,					UpperCAmelCase ,					UpperCAmelCase = 2		)->     None:







      """simple docstring"""
      ((__A)		, (__A))    		=     diophantine(UpperCAmelCase ,					UpperCAmelCase ,					UpperCAmelCase		)  # Initial value
      __A    		=     greatest_common_divisor(UpperCAmelCase ,					UpperCAmelCase		)
      __A    		=     a // d
      __A    		=     b // d

      for i in range(UpperCAmelCase		):
            __A    		=     xa + i * q
            __A    		=     ya - i * p
            print(UpperCAmelCase ,					UpperCAmelCase		)





def     snake_case							(						UpperCAmelCase ,					UpperCAmelCase		)->     int:







      """simple docstring"""
      if a < b:
            __A		, __A    		=     b, a

      while a % b != 0:
            __A		, __A    		=     b, a % b

      return b





def     snake_case							(						UpperCAmelCase ,					UpperCAmelCase		)->     tuple[int, int, int]:







      """simple docstring"""
      assert a >= 0 and b >= 0

      if b == 0:
            __A		, __A		, __A    		=     a, 1, 0
      else:
            ((__A)		, (__A)		, (__A))    		=     extended_gcd(UpperCAmelCase ,					a % b		)
            __A    		=     q
            __A    		=     p - q * (a // b)

      assert a % d == 0 and b % d == 0
      assert d == a * x + b * y

      return (d, x, y)


if __name__ == "__main__":
 from doctest import testmod

 testmod(name="diophantine", verbose=True)
 testmod(name="diophantine_all_soln", verbose=True)
 testmod(name="extended_gcd", verbose=True)
 testmod(name="greatest_common_divisor", verbose=True)






