
"""simple docstring"""
from collections import OrderedDict
from typing import Mapping

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


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

_a   :      Dict       =				{
    """google/electra-small-generator""": """https://huggingface.co/google/electra-small-generator/resolve/main/config.json""",
    """google/electra-base-generator""": """https://huggingface.co/google/electra-base-generator/resolve/main/config.json""",
    """google/electra-large-generator""": """https://huggingface.co/google/electra-large-generator/resolve/main/config.json""",
    """google/electra-small-discriminator""": (
        """https://huggingface.co/google/electra-small-discriminator/resolve/main/config.json"""
    ),
    """google/electra-base-discriminator""": (
        """https://huggingface.co/google/electra-base-discriminator/resolve/main/config.json"""
    ),
    """google/electra-large-discriminator""": (
        """https://huggingface.co/google/electra-large-discriminator/resolve/main/config.json"""
    ),
}






class   _UpperCAmelCase					(       _snake_case):
    __lowercase				:			Tuple	=       """electra"""
    def __init__(     self    ,     snake_case_=3_05_22    ,     snake_case_=1_28    ,     snake_case_=2_56    ,     snake_case_=12    ,     snake_case_=4    ,     snake_case_=10_24    ,     snake_case_="gelu"    ,     snake_case_=0.1    ,     snake_case_=0.1    ,     snake_case_=5_12    ,     snake_case_=2    ,     snake_case_=0.02    ,     snake_case_=1E-12    ,     snake_case_="first"    ,     snake_case_=True    ,     snake_case_="gelu"    ,     snake_case_=0.1    ,     snake_case_=0    ,     snake_case_="absolute"    ,     snake_case_=True    ,     snake_case_=None    ,     **snake_case_    ,     ):
      super().__init__(pad_token_id=snake_case_    ,     **snake_case_  )

      _snake_case  :    List[Any]            = vocab_size
      _snake_case  :    int            = embedding_size
      _snake_case  :    Optional[int]            = hidden_size
      _snake_case  :    int            = num_hidden_layers
      _snake_case  :    int            = num_attention_heads
      _snake_case  :    Union[str, Any]            = intermediate_size
      _snake_case  :    Tuple            = hidden_act
      _snake_case  :    Tuple            = hidden_dropout_prob
      _snake_case  :    Dict            = attention_probs_dropout_prob
      _snake_case  :    int            = max_position_embeddings
      _snake_case  :    str            = type_vocab_size
      _snake_case  :    Union[str, Any]            = initializer_range
      _snake_case  :    str            = layer_norm_eps

      _snake_case  :    Any            = summary_type
      _snake_case  :    Optional[Any]            = summary_use_proj
      _snake_case  :    List[Any]            = summary_activation
      _snake_case  :    List[str]            = summary_last_dropout
      _snake_case  :    Any            = position_embedding_type
      _snake_case  :    str            = use_cache
      _snake_case  :    Any            = classifier_dropout






class   _UpperCAmelCase					(       _snake_case):
    @property
    def        lowerCamelCase__						(     self  ):
      if self.task == "multiple-choice":
        _snake_case  :    Tuple            = {0: "batch", 1: "choice", 2: "sequence"}
      else:
        _snake_case  :    Tuple            = {0: "batch", 1: "sequence"}
      return OrderedDict(
          [
              ("input_ids", dynamic_axis),
              ("attention_mask", dynamic_axis),
              ("token_type_ids", dynamic_axis),
          ]  )


from hashlib import mda, shaaaa

__snake_case         =     (shaaaa, mda)







class       __snake_case :
 def __init__(	self		, snake_case__ = 8    )						->				None:
       '''simple docstring'''





       UpperCAmelCase     :			str     	=0b0
       UpperCAmelCase     :			str     	=size
 def 						UpperCAmelCase__							(	self		, snake_case__    )						->				None:
       '''simple docstring'''





       UpperCAmelCase     :			Union[str, Any]     	=self.hash_(snake_case__    )
       self.bitarray |= h
 def 						UpperCAmelCase__							(	self		, snake_case__    )						->				bool:
       '''simple docstring'''





       UpperCAmelCase     :			List[Any]     	=self.hash_(snake_case__    )
       return (h & self.bitarray) == h
 def __contains__(	self		, snake_case__    )						->				bool:
       '''simple docstring'''





       return self.exists(snake_case__    )
 def 						UpperCAmelCase__							(	self		, snake_case__    )						->				str:
       '''simple docstring'''





       UpperCAmelCase     :			Dict     	=bin(snake_case__    )[2:]
       return res.zfill(self.size    )
 @property
 def 						UpperCAmelCase__							(	self    )						->				str:
       '''simple docstring'''





       return self.format_bin(self.bitarray    )
 def 						UpperCAmelCase__							(	self		, snake_case__    )						->				int:
       '''simple docstring'''





       UpperCAmelCase     :			Union[str, Any]     	=0b0
       for func in HASH_FUNCTIONS:
             UpperCAmelCase     :			Optional[Any]     	=(
                 int.from_bytes(func(value.encode()    ).digest()		, '''little'''    ) % self.size
             )
             res |= 2**position
       return res
 def 						UpperCAmelCase__							(	self		, snake_case__    )						->				str:
       '''simple docstring'''





       return self.format_bin(self.hash_(snake_case__    )    )






 @property
 def 						UpperCAmelCase__							(	self    )						->				float:
       '''simple docstring'''





       UpperCAmelCase     :			int     	=bin(self.bitarray    ).count('''1'''    )
       return (n_ones / self.size) ** len(snake_case__    )
