


from collections import OrderedDict
from typing import Mapping

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


snake_case__ :						int     =			logging.get_logger(__name__)

snake_case__ :						str     =			{
    '''mnaylor/mega-base-wikitext''': '''https://huggingface.co/mnaylor/mega-base-wikitext/resolve/main/config.json''',
}





class     snake_case  (	__UpperCAmelCase							):


   '''simple docstring'''







   UpperCamelCase__	:       List[str]     =      """mega"""




   def __init__(					self     :	List[str]						,    lowerCamelCase_     :	Optional[int]=3_0522						,    lowerCamelCase_     :	Union[str, Any]=128						,    lowerCamelCase_     :	List[str]=4						,    lowerCamelCase_     :	str=256						,    lowerCamelCase_     :	str=16						,    lowerCamelCase_     :	Optional[int]=True						,    lowerCamelCase_     :	List[Any]=64						,    lowerCamelCase_     :	Dict=False						,    lowerCamelCase_     :	Optional[Any]=-1						,    lowerCamelCase_     :	Union[str, Any]=None						,    lowerCamelCase_     :	Tuple=True						,    lowerCamelCase_     :	Any="scalenorm"						,    lowerCamelCase_     :	int=True						,    lowerCamelCase_     :	List[str]="silu"						,    lowerCamelCase_     :	List[str]="softmax"						,    lowerCamelCase_     :	int=0.1						,    lowerCamelCase_     :	List[str]=0.1						,    lowerCamelCase_     :	Tuple=0.1						,    lowerCamelCase_     :	Any=False						,    lowerCamelCase_     :	Optional[int]=True						,    lowerCamelCase_     :	List[str]=256						,    lowerCamelCase_     :	Tuple=True						,    lowerCamelCase_     :	List[Any]=0.1						,    lowerCamelCase_     :	List[str]=2048						,    lowerCamelCase_     :	Optional[Any]=False						,    lowerCamelCase_     :	str=2						,    lowerCamelCase_     :	Any=0.02						,    lowerCamelCase_     :	Any=0.2						,    lowerCamelCase_     :	Tuple=0.02						,    lowerCamelCase_     :	Tuple=1.0						,    lowerCamelCase_     :	int=1						,    lowerCamelCase_     :	int=0						,    lowerCamelCase_     :	Any=2						,    lowerCamelCase_     :	List[Any]="rotary"						,    lowerCamelCase_     :	Any=None						,    lowerCamelCase_     :	Optional[int]=True						,    lowerCamelCase_     :	Union[str, Any]=True						,    **lowerCamelCase_     :	Any						,    )					->Optional[Any]:
     '''simple docstring'''







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

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





class     snake_case  (	__UpperCAmelCase							):


   '''simple docstring'''







   @property
   def 	UpperCAmelCase       (					self     :	List[str]			)					->Mapping[str, Mapping[int, str]]:
     '''simple docstring'''







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










from __future__ import annotations

from collections import Counter


def 						lowercase		(     _lowerCAmelCase      ):
  UpperCAmelCase__    						=   [True] * n
  UpperCAmelCase__    						=   False
  UpperCAmelCase__    						=   False
  UpperCAmelCase__    						=   True

  for i in range(3   ,     int(n**0.5 + 1      )   ,     2      ):
    UpperCAmelCase__    						=   i * 2
    while index < n:
      UpperCAmelCase__    						=   False
      UpperCAmelCase__    						=   index + i

  UpperCAmelCase__    						=   [2]

  for i in range(3   ,     _lowerCAmelCase   ,     2      ):
    if is_prime[i]:
      primes.append(_lowerCAmelCase      )

  return primes


def 						lowercase		(     _lowerCAmelCase      ):
  UpperCAmelCase__    						=   str(_lowerCAmelCase      )
  UpperCAmelCase__    						=   []
  UpperCAmelCase__    						=   ["""0""", """1""", """2""", """3""", """4""", """5""", """6""", """7""", """8""", """9"""]

  for duplicate in Counter(_lowerCAmelCase      ) - Counter(set(_lowerCAmelCase      )      ):
    UpperCAmelCase__    						=   [int(number_str.replace(_lowerCAmelCase   ,     _lowerCAmelCase      )      ) for digit in digits]
    replacements.append(_lowerCAmelCase      )

  return replacements


def 						lowercase		(     _lowerCAmelCase = 8      ):
  UpperCAmelCase__    						=   set()

  # Filter primes with less than 3 replaceable digits
  UpperCAmelCase__    						=   {
      x for x in set(prime_sieve(100_0000      )      ) if len(str(_lowerCAmelCase      )      ) - len(set(str(_lowerCAmelCase      )      )      ) >= 3
  }

  for prime in primes:
    if prime in numbers_checked:
      continue

    UpperCAmelCase__    						=   digit_replacements(_lowerCAmelCase      )

    for family in replacements:
      numbers_checked.update(_lowerCAmelCase      )
      UpperCAmelCase__    						=   primes.intersection(_lowerCAmelCase      )

      if len(_lowerCAmelCase      ) != family_length:
        continue

      return min(_lowerCAmelCase      )

  return -1


if __name__ == "__main__":
   print(solution())




