



'''simple docstring'''


import os
import string
import sys


lowercase							       =			1 << 8

lowercase							       =			{
    '''tab''': ord('''\t'''),
    '''newline''': ord('''\r'''),
    '''esc''': 27,
    '''up''': 65 + ARROW_KEY_FLAG,
    '''down''': 66 + ARROW_KEY_FLAG,
    '''right''': 67 + ARROW_KEY_FLAG,
    '''left''': 68 + ARROW_KEY_FLAG,
    '''mod_int''': 91,
    '''undefined''': sys.maxsize,
    '''interrupt''': 3,
    '''insert''': 50,
    '''delete''': 51,
    '''pg_up''': 53,
    '''pg_down''': 54,
}

lowercase							       =			KEYMAP['''up''']
lowercase							       =			KEYMAP['''left''']

if sys.platform == "win32":
  lowercase							       =			[]
  lowercase							       =			{
      B'''\xe0H''': KEYMAP['''up'''] - ARROW_KEY_FLAG,
      B'''\x00H''': KEYMAP['''up'''] - ARROW_KEY_FLAG,
      B'''\xe0P''': KEYMAP['''down'''] - ARROW_KEY_FLAG,
      B'''\x00P''': KEYMAP['''down'''] - ARROW_KEY_FLAG,
      B'''\xe0M''': KEYMAP['''right'''] - ARROW_KEY_FLAG,
      B'''\x00M''': KEYMAP['''right'''] - ARROW_KEY_FLAG,
      B'''\xe0K''': KEYMAP['''left'''] - ARROW_KEY_FLAG,
      B'''\x00K''': KEYMAP['''left'''] - ARROW_KEY_FLAG,
  }

for i in range(10):
  lowercase							       =			ord(str(i))






def  UpperCAmelCase_       (		):


     '''simple docstring'''







     if os.name == "nt":
          import msvcrt

          a_       		="mbcs"
          # Flush the keyboard buffer
          while msvcrt.kbhit():
               msvcrt.getch()
          if len(lowercase__       ) == 0:
               # Read the keystroke
               a_       		=msvcrt.getch()

               # If it is a prefix char, get second part
               if ch in (b"\x00", b"\xe0"):
                    a_       		=ch + msvcrt.getch()
                    # Translate actual Win chars to bullet char types
                    try:
                         a_       		=chr(WIN_KEYMAP[cha]       )
                         WIN_CH_BUFFER.append(chr(KEYMAP["mod_int"]       )       )
                         WIN_CH_BUFFER.append(lowercase__       )
                         if ord(lowercase__       ) in (
                             KEYMAP["insert"] - 1 << 9,
                             KEYMAP["delete"] - 1 << 9,
                             KEYMAP["pg_up"] - 1 << 9,
                             KEYMAP["pg_down"] - 1 << 9,
                         ):
                              WIN_CH_BUFFER.append(chr(1_2_6       )       )
                         a_       		=chr(KEYMAP["esc"]       )
                    except KeyError:
                         a_       		=cha[1]
               else:
                    a_       		=ch.decode(lowercase__       )
          else:
               a_       		=WIN_CH_BUFFER.pop(0       )
     elif os.name == "posix":
          import termios
          import tty

          a_       		=sys.stdin.fileno()
          a_       		=termios.tcgetattr(lowercase__       )
          try:
               tty.setraw(lowercase__       )
               a_       		=sys.stdin.read(1       )
          finally:
               termios.tcsetattr(lowercase__       ,	termios.TCSADRAIN       ,	lowercase__       )
     return ch






def  UpperCAmelCase_       (		):


     '''simple docstring'''







     a_       		=get_raw_chars()
     if ord(lowercase__       ) in [KEYMAP["interrupt"], KEYMAP["newline"]]:
          return char

     elif ord(lowercase__       ) == KEYMAP["esc"]:
          a_       		=get_raw_chars()
          if ord(lowercase__       ) == KEYMAP["mod_int"]:
               a_       		=get_raw_chars()
               if ord(lowercase__       ) >= KEYMAP["arrow_begin"] - ARROW_KEY_FLAG and ord(lowercase__       ) <= KEYMAP["arrow_end"] - ARROW_KEY_FLAG:
                    return chr(ord(lowercase__       ) + ARROW_KEY_FLAG       )
               else:
                    return KEYMAP["undefined"]
          else:
               return get_raw_chars()

     else:
          if char in string.printable:
               return char
          else:
               return KEYMAP["undefined"]







'''simple docstring'''


from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig


lowercase							       =			{
    '''albert-base-v1''': '''https://huggingface.co/albert-base-v1/resolve/main/config.json''',
    '''albert-large-v1''': '''https://huggingface.co/albert-large-v1/resolve/main/config.json''',
    '''albert-xlarge-v1''': '''https://huggingface.co/albert-xlarge-v1/resolve/main/config.json''',
    '''albert-xxlarge-v1''': '''https://huggingface.co/albert-xxlarge-v1/resolve/main/config.json''',
    '''albert-base-v2''': '''https://huggingface.co/albert-base-v2/resolve/main/config.json''',
    '''albert-large-v2''': '''https://huggingface.co/albert-large-v2/resolve/main/config.json''',
    '''albert-xlarge-v2''': '''https://huggingface.co/albert-xlarge-v2/resolve/main/config.json''',
    '''albert-xxlarge-v2''': '''https://huggingface.co/albert-xxlarge-v2/resolve/main/config.json''',
}







class 	UpperCAmelCase	(		__a):


 '''simple docstring'''




 __magic_name__					: int  =      "albert"




 def __init__(   self							,  lowerCAmelCase_=3_0_0_0_0							,  lowerCAmelCase_=1_2_8							,  lowerCAmelCase_=4_0_9_6							,  lowerCAmelCase_=1_2							,  lowerCAmelCase_=1							,  lowerCAmelCase_=6_4							,  lowerCAmelCase_=1_6_3_8_4							,  lowerCAmelCase_=1							,  lowerCAmelCase_="gelu_new"							,  lowerCAmelCase_=0							,  lowerCAmelCase_=0							,  lowerCAmelCase_=5_1_2							,  lowerCAmelCase_=2							,  lowerCAmelCase_=0.0_2							,  lowerCAmelCase_=1e-12							,  lowerCAmelCase_=0.1							,  lowerCAmelCase_="absolute"							,  lowerCAmelCase_=0							,  lowerCAmelCase_=2							,  lowerCAmelCase_=3							,  **lowerCAmelCase_							,  ) ->      Any:



      """simple docstring"""







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

      a_       		=vocab_size
      a_       		=embedding_size
      a_       		=hidden_size
      a_       		=num_hidden_layers
      a_       		=num_hidden_groups
      a_       		=num_attention_heads
      a_       		=inner_group_num
      a_       		=hidden_act
      a_       		=intermediate_size
      a_       		=hidden_dropout_prob
      a_       		=attention_probs_dropout_prob
      a_       		=max_position_embeddings
      a_       		=type_vocab_size
      a_       		=initializer_range
      a_       		=layer_norm_eps
      a_       		=classifier_dropout_prob
      a_       		=position_embedding_type







class 	UpperCAmelCase	(		__a):


 '''simple docstring'''




 @property
 def       lowercase_  (   self) ->      Mapping[str, Mapping[int, str]]:



      """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),
              ("token_type_ids", dynamic_axis),
          ])


