





'''simple docstring'''

import os
import string
import sys


a        =						1 << 8

a        =						{
    "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,
}

a        =						KEYMAP["up"]
a        =						KEYMAP["left"]

if sys.platform == "win32":
    a        =						[]
    a        =						{
        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):
    a        =						ord(str(i))

def 						__magic_name__       (							)						->					Union[str, Any]:

   '''simple docstring'''







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

      __SCREAMING_SNAKE_CASE     :   Union[str, Any]      							=       """mbcs"""
      # Flush the keyboard buffer
      while msvcrt.kbhit():
         msvcrt.getch()
      if len(__UpperCAmelCase      ) == 0:
         # Read the keystroke
         __SCREAMING_SNAKE_CASE     :   Dict      							=       msvcrt.getch()

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

      __SCREAMING_SNAKE_CASE     :   Tuple      							=       sys.stdin.fileno()
      __SCREAMING_SNAKE_CASE     :   int      							=       termios.tcgetattr(__UpperCAmelCase      )
      try:
         tty.setraw(__UpperCAmelCase      )
         __SCREAMING_SNAKE_CASE     :   Optional[int]      							=       sys.stdin.read(1      )
      finally:
         termios.tcsetattr(__UpperCAmelCase							,	termios.TCSADRAIN							,	__UpperCAmelCase      )
   return ch







def 						__magic_name__       (							)						->					List[str]:

   '''simple docstring'''







   __SCREAMING_SNAKE_CASE     :   Dict      							=       get_raw_chars()
   if ord(__UpperCAmelCase      ) in [KEYMAP["interrupt"], KEYMAP["newline"]]:
      return char

   elif ord(__UpperCAmelCase      ) == KEYMAP["esc"]:
      __SCREAMING_SNAKE_CASE     :   Tuple      							=       get_raw_chars()
      if ord(__UpperCAmelCase      ) == KEYMAP["mod_int"]:
         __SCREAMING_SNAKE_CASE     :   int      							=       get_raw_chars()
         if ord(__UpperCAmelCase      ) >= KEYMAP["arrow_begin"] - ARROW_KEY_FLAG and ord(__UpperCAmelCase      ) <= KEYMAP["arrow_end"] - ARROW_KEY_FLAG:
            return chr(ord(__UpperCAmelCase      ) + 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'''

import functools
import operator

from ...configuration_utils import PretrainedConfig
from ...utils import logging


a        =						logging.get_logger(__name__)

a        =						{
    "asapp/sew-tiny-100k": "https://huggingface.co/asapp/sew-tiny-100k/resolve/main/config.json",
    # See all SEW models at https://huggingface.co/models?filter=sew
}







class __a (   _snake_case			):
   __UpperCamelCase   : Tuple	      =	'sew'





   def __init__(					self				:			str				,lowerCamelCase				:			Any=32				,lowerCamelCase				:			str=768				,lowerCamelCase				:			str=12				,lowerCamelCase				:			Union[str, Any]=12				,lowerCamelCase				:			Union[str, Any]=3072				,lowerCamelCase				:			int=2				,lowerCamelCase				:			Union[str, Any]="gelu"				,lowerCamelCase				:			Tuple=0.1				,lowerCamelCase				:			Union[str, Any]=0.1				,lowerCamelCase				:			Union[str, Any]=0.1				,lowerCamelCase				:			Any=0.0				,lowerCamelCase				:			Optional[Any]=0.1				,lowerCamelCase				:			Union[str, Any]=0.1				,lowerCamelCase				:			Optional[Any]=0.02				,lowerCamelCase				:			List[str]=1E-5				,lowerCamelCase				:			Tuple="group"				,lowerCamelCase				:			Optional[Any]="gelu"				,lowerCamelCase				:			List[str]=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512)				,lowerCamelCase				:			Any=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)				,lowerCamelCase				:			Dict=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)				,lowerCamelCase				:			Optional[int]=False				,lowerCamelCase				:			Dict=128				,lowerCamelCase				:			Union[str, Any]=16				,lowerCamelCase				:			List[Any]=True				,lowerCamelCase				:			List[Any]=0.05				,lowerCamelCase				:			Optional[int]=10				,lowerCamelCase				:			Any=2				,lowerCamelCase				:			Any=0.0				,lowerCamelCase				:			Tuple=10				,lowerCamelCase				:			str=0				,lowerCamelCase				:			Tuple="mean"				,lowerCamelCase				:			int=False				,lowerCamelCase				:			Dict=False				,lowerCamelCase				:			Optional[int]=256				,lowerCamelCase				:			str=0				,lowerCamelCase				:			Tuple=1				,lowerCamelCase				:			Tuple=2				,**lowerCamelCase				:			Union[str, Any]				,):

      '''simple docstring'''

      super().__init__(**lowerCamelCase				,pad_token_id=lowerCamelCase				,bos_token_id=lowerCamelCase				,eos_token_id=lowerCamelCase    )
      __SCREAMING_SNAKE_CASE      							=       hidden_size
      __SCREAMING_SNAKE_CASE      							=       feat_extract_norm
      __SCREAMING_SNAKE_CASE      							=       feat_extract_activation
      __SCREAMING_SNAKE_CASE      							=       list(lowerCamelCase    )
      __SCREAMING_SNAKE_CASE      							=       list(lowerCamelCase    )
      __SCREAMING_SNAKE_CASE      							=       list(lowerCamelCase    )
      __SCREAMING_SNAKE_CASE      							=       conv_bias
      __SCREAMING_SNAKE_CASE      							=       num_conv_pos_embeddings
      __SCREAMING_SNAKE_CASE      							=       num_conv_pos_embedding_groups
      __SCREAMING_SNAKE_CASE      							=       len(self.conv_dim    )
      __SCREAMING_SNAKE_CASE      							=       num_hidden_layers
      __SCREAMING_SNAKE_CASE      							=       intermediate_size
      __SCREAMING_SNAKE_CASE      							=       squeeze_factor
      __SCREAMING_SNAKE_CASE      							=       hidden_act
      __SCREAMING_SNAKE_CASE      							=       num_attention_heads
      __SCREAMING_SNAKE_CASE      							=       hidden_dropout
      __SCREAMING_SNAKE_CASE      							=       attention_dropout
      __SCREAMING_SNAKE_CASE      							=       activation_dropout
      __SCREAMING_SNAKE_CASE      							=       feat_proj_dropout
      __SCREAMING_SNAKE_CASE      							=       final_dropout
      __SCREAMING_SNAKE_CASE      							=       layerdrop
      __SCREAMING_SNAKE_CASE      							=       layer_norm_eps
      __SCREAMING_SNAKE_CASE      							=       initializer_range
      __SCREAMING_SNAKE_CASE      							=       vocab_size

      if (
          (len(self.conv_stride    ) != self.num_feat_extract_layers)
          or (len(self.conv_kernel    ) != self.num_feat_extract_layers)
          or (len(self.conv_dim    ) != self.num_feat_extract_layers)
      ):
         raise ValueError(
             """Configuration for convolutional layers is incorrect."""
             """It is required that `len(config.conv_dim)` == `len(config.conv_stride)` == `len(config.conv_kernel)`,"""
             f"""but is `len(config.conv_dim) = {len(self.conv_dim    )}`, `len(config.conv_stride)"""
             f"""= {len(self.conv_stride    )}`, `len(config.conv_kernel) = {len(self.conv_kernel    )}`."""    )

      # fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
      __SCREAMING_SNAKE_CASE      							=       apply_spec_augment
      __SCREAMING_SNAKE_CASE      							=       mask_time_prob
      __SCREAMING_SNAKE_CASE      							=       mask_time_length
      __SCREAMING_SNAKE_CASE      							=       mask_time_min_masks
      __SCREAMING_SNAKE_CASE      							=       mask_feature_prob
      __SCREAMING_SNAKE_CASE      							=       mask_feature_length
      __SCREAMING_SNAKE_CASE      							=       mask_feature_min_masks

      # ctc loss
      __SCREAMING_SNAKE_CASE      							=       ctc_loss_reduction
      __SCREAMING_SNAKE_CASE      							=       ctc_zero_infinity

      # sequence classification
      __SCREAMING_SNAKE_CASE      							=       use_weighted_layer_sum
      __SCREAMING_SNAKE_CASE      							=       classifier_proj_size





   @property
   def      UpperCAmelCase__     (					self				:			List[Any]    ):

      '''simple docstring'''

      return functools.reduce(operator.mul				,self.conv_stride				,1    )





