

'''simple docstring'''

class lowerCamelCase      :







    class lowerCamelCase      :
        snake_case_           =   '''_prev''', '''_data''', '''_next'''

        def __init__(					self,	lowercase_,	lowercase_,	lowercase_   )						->       Union[str, Any]:
         snake_case							 =				link_p
         snake_case							 =				element
         snake_case							 =				link_n






        def 				_lowerCamelCase						(					self   )						->       int:
         return (
             F''' Prev -> {self._prev is not None}, Next -> {self._next is not None}'''
         )

    def __init__(					self   )						->       int:
     snake_case							 =				self._Node(lowercase_,	lowercase_,	lowercase_   )
     snake_case							 =				self._Node(lowercase_,	lowercase_,	lowercase_   )
     snake_case							 =				self._trailer
     snake_case							 =				self._header
     snake_case							 =				0

    def __len__(					self   )						->       List[Any]:
     return self._size

    def 				_lowerCamelCase						(					self   )						->       List[Any]:
     return self.__len__() == 0

    def 				_lowerCamelCase						(					self,	lowercase_,	lowercase_,	lowercase_   )						->       Optional[int]:
     # Create new_node by setting it's prev.link -> header
     # setting it's next.link -> trailer
     snake_case							 =				self._Node(lowercase_,	lowercase_,	lowercase_   )
     snake_case							 =				new_node
     snake_case							 =				new_node
     self._size += 1
     return self






    def 				_lowerCamelCase						(					self,	lowercase_   )						->       Optional[int]:
     snake_case							 =				node._prev
     snake_case							 =				node._next

     snake_case							 =				successor
     snake_case							 =				predecessor
     self._size -= 1
     snake_case							 =				node._data
     snake_case							 =				snake_case							 =				snake_case							 =				None
     del node
     return temp







class lowerCamelCase      (						_DoublyLinkedBase							):

    def 				_lowerCamelCase						(					self   )						->       List[str]:
     if self.is_empty():
      raise Exception('List is empty'   )
     return self._header._next._data

    def 				_lowerCamelCase						(					self   )						->       Any:
     if self.is_empty():
      raise Exception('List is empty'   )
     return self._trailer._prev._data

    def 				_lowerCamelCase						(					self,	lowercase_   )						->       Optional[Any]:
     return self._insert(self._header,	lowercase_,	self._header._next   )

    def 				_lowerCamelCase						(					self,	lowercase_   )						->       List[Any]:
     return self._insert(self._trailer._prev,	lowercase_,	self._trailer   )

    def 				_lowerCamelCase						(					self   )						->       Optional[Any]:
     if self.is_empty():
      raise IndexError('remove_first from empty list'   )
     return self._delete(self._header._next   )






    def 				_lowerCamelCase						(					self   )						->       Optional[int]:
     if self.is_empty():
      raise IndexError('remove_first from empty list'   )
     return self._delete(self._trailer._prev   )








'''simple docstring'''

from collections import OrderedDict
from typing import Mapping

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


lowerCAmelCase_						   =			logging.get_logger(__name__)

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







class lowerCamelCase      (						__lowerCAmelCase							):
				snake_case_           =   '''mega'''

				def __init__(					self,	lowercase_=30522,	lowercase_=128,	lowercase_=4,	lowercase_=256,	lowercase_=16,	lowercase_=True,	lowercase_=64,	lowercase_=False,	lowercase_=-1,	lowercase_=None,	lowercase_=True,	lowercase_="scalenorm",	lowercase_=True,	lowercase_="silu",	lowercase_="softmax",	lowercase_=0.1,	lowercase_=0.1,	lowercase_=0.1,	lowercase_=False,	lowercase_=True,	lowercase_=256,	lowercase_=True,	lowercase_=0.1,	lowercase_=2048,	lowercase_=False,	lowercase_=2,	lowercase_=0.02,	lowercase_=0.2,	lowercase_=0.02,	lowercase_=1.0,	lowercase_=1,	lowercase_=0,	lowercase_=2,	lowercase_="rotary",	lowercase_=None,	lowercase_=True,	lowercase_=True,	**lowercase_,	)						->       List[Any]:
					super().__init__(pad_token_id=lowercase_,	bos_token_id=lowercase_,	eos_token_id=lowercase_,	**lowercase_   )

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







class lowerCamelCase      (						__lowerCAmelCase							):

				@property
				def 				_lowerCamelCase						(					self   )						->       Mapping[str, Mapping[int, str]]:
					if self.task == "multiple-choice":
						snake_case							 =				{0: 'batch', 1: 'choice', 2: 'sequence'}
					else:
						snake_case							 =				{0: 'batch', 1: 'sequence'}
					return OrderedDict(
					    [
					        ('input_ids', dynamic_axis),
					        ('attention_mask', dynamic_axis),
					    ]   )





