





"""simple docstring"""




from typing import List

from .keymap import KEYMAP, get_character





def 	a_    (							_lowercase       ):


      def decorator(_lowercase       ):
            _UpperCamelCase      : List[str]         =   getattr(__UpperCamelCase	,						'''handle_key'''	,						[]       )
            handle += [key]
            setattr(__UpperCamelCase	,						'''handle_key'''	,						__UpperCamelCase       )
            return func

      return decorator





def 	a_    (							*_lowercase       ):


      def decorator(_lowercase       ):
            _UpperCamelCase      : Optional[int]         =   getattr(__UpperCamelCase	,						'''handle_key'''	,						[]       )
            handle += keys
            setattr(__UpperCamelCase	,						'''handle_key'''	,						__UpperCamelCase       )
            return func

      return decorator




class 			_a						(				__a    ):






    def __new__(			cls		:   int,			lowerCAmelCase__		:   List[str],			lowerCAmelCase__		:   int,			lowerCAmelCase__		:   Optional[Any]							)     ->				int:




          '''simple docstring'''



          _UpperCamelCase      : Dict         =   super().__new__(cls,			UpperCamelCase__,			UpperCamelCase__,			UpperCamelCase__							)
          if not hasattr(UpperCamelCase__,			'''key_handler'''							):
                setattr(UpperCamelCase__,			'''key_handler''',			{}							)
          setattr(UpperCamelCase__,			'''handle_input''',			KeyHandler.handle_input							)

          for value in attrs.values():
                _UpperCamelCase      : Dict         =   getattr(UpperCamelCase__,			'''handle_key''',			[]							)
                for key in handled_keys:
                      _UpperCamelCase      : Union[str, Any]         =   value
          return new_cls






    @staticmethod
    def     snake_case     (			cls		:   List[Any]							)     ->				Dict:




          '''simple docstring'''



          _UpperCamelCase      : Any         =   get_character()
          if char != KEYMAP["undefined"]:
                _UpperCamelCase      : int         =   ord(UpperCamelCase__							)
          _UpperCamelCase      : Optional[int]         =   cls.key_handler.get(UpperCamelCase__							)
          if handler:
                _UpperCamelCase      : Union[str, Any]         =   char
                return handler(cls							)
          else:
                return None





def 	a_    (							cls       ):
      return KeyHandler(cls.__name__	,						cls.__bases__	,						cls.__dict__.copy()       )










"""simple docstring"""




import logging

from transformers.configuration_utils import PretrainedConfig


UpperCamelCase_									=logging.getLogger(__name__)




class 			_a						(				_lowerCAmelCase    ):
				UpperCamelCase								=   '''masked_bert'''






				def __init__(			self		:   Optional[Any],			lowerCAmelCase__		:   Dict=3_0_5_2_2,			lowerCAmelCase__		:   int=7_6_8,			lowerCAmelCase__		:   Tuple=1_2,			lowerCAmelCase__		:   Optional[Any]=1_2,			lowerCAmelCase__		:   Tuple=3_0_7_2,			lowerCAmelCase__		:   Optional[int]="gelu",			lowerCAmelCase__		:   Tuple=0.1,			lowerCAmelCase__		:   Tuple=0.1,			lowerCAmelCase__		:   Any=5_1_2,			lowerCAmelCase__		:   Optional[int]=2,			lowerCAmelCase__		:   Optional[int]=0.02,			lowerCAmelCase__		:   Union[str, Any]=1e-1_2,			lowerCAmelCase__		:   Union[str, Any]=0,			lowerCAmelCase__		:   Dict="topK",			lowerCAmelCase__		:   Union[str, Any]="constant",			lowerCAmelCase__		:   Union[str, Any]=0.0,			**lowerCAmelCase__		:   Any,			)     ->				List[Any]:




										'''simple docstring'''



										super().__init__(pad_token_id=lowerCAmelCase__,			**lowerCAmelCase__							)

										_UpperCamelCase      : Optional[Any]         =   vocab_size
										_UpperCamelCase      : int         =   hidden_size
										_UpperCamelCase      : List[Any]         =   num_hidden_layers
										_UpperCamelCase      : Any         =   num_attention_heads
										_UpperCamelCase      : List[str]         =   hidden_act
										_UpperCamelCase      : Tuple         =   intermediate_size
										_UpperCamelCase      : int         =   hidden_dropout_prob
										_UpperCamelCase      : str         =   attention_probs_dropout_prob
										_UpperCamelCase      : Optional[int]         =   max_position_embeddings
										_UpperCamelCase      : str         =   type_vocab_size
										_UpperCamelCase      : Optional[Any]         =   initializer_range
										_UpperCamelCase      : List[str]         =   layer_norm_eps
										_UpperCamelCase      : int         =   pruning_method
										_UpperCamelCase      : Union[str, Any]         =   mask_init
										_UpperCamelCase      : Any         =   mask_scale



