"""simple docstring"""



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


_UpperCamelCase								=		logging.get_logger(__name__)

_UpperCamelCase								=		{
    "studio-ousia/luke-base": "https://huggingface.co/studio-ousia/luke-base/resolve/main/config.json",
    "studio-ousia/luke-large": "https://huggingface.co/studio-ousia/luke-large/resolve/main/config.json",
}
class 						__UpperCAmelCase    (__A     ):







			'''simple docstring'''
			_UpperCamelCase  :						List[str]					     =				'luke'





			def __init__(			self   ,      snake_case_=50_267   ,      snake_case_=500_000   ,      snake_case_=768   ,      snake_case_=256   ,      snake_case_=12   ,      snake_case_=12   ,      snake_case_=3_072   ,      snake_case_="gelu"   ,      snake_case_=0.1   ,      snake_case_=0.1   ,      snake_case_=512   ,      snake_case_=2   ,      snake_case_=0.02   ,      snake_case_=1E-12   ,      snake_case_=True   ,      snake_case_=None   ,      snake_case_=1   ,      snake_case_=0   ,      snake_case_=2   ,      **snake_case_   ,      ):







										'''simple docstring'''


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

										A__       :     Optional[int]								=			vocab_size
										A__       :     List[str]								=			entity_vocab_size
										A__       :     Union[str, Any]								=			hidden_size
										A__       :     int								=			entity_emb_size
										A__       :     Tuple								=			num_hidden_layers
										A__       :     List[Any]								=			num_attention_heads
										A__       :     Any								=			hidden_act
										A__       :     Dict								=			intermediate_size
										A__       :     Optional[int]								=			hidden_dropout_prob
										A__       :     Tuple								=			attention_probs_dropout_prob
										A__       :     str								=			max_position_embeddings
										A__       :     str								=			type_vocab_size
										A__       :     int								=			initializer_range
										A__       :     Union[str, Any]								=			layer_norm_eps
										A__       :     Optional[Any]								=			use_entity_aware_attention
										A__       :     Optional[Any]								=			classifier_dropout






"""simple docstring"""



from typing import List

from .keymap import KEYMAP, get_character

def  _A(		lowerCAmelCase							):

							def decorator(lowerCAmelCase							):
														A__       :     Any								=			getattr(lowerCAmelCase			,  """handle_key"""			,  []							)
														handle += [key]
														setattr(lowerCAmelCase			,  """handle_key"""			,  lowerCAmelCase							)
														return func

							return decorator

def  _A(		*lowerCAmelCase							):

							def decorator(lowerCAmelCase							):
														A__       :     Optional[Any]								=			getattr(lowerCAmelCase			,  """handle_key"""			,  []							)
														handle += keys
														setattr(lowerCAmelCase			,  """handle_key"""			,  lowerCAmelCase							)
														return func

							return decorator
class 						__UpperCAmelCase    (__A     ):







			'''simple docstring'''





			def __new__(			cls   ,      snake_case_   ,      snake_case_   ,      snake_case_							):







										'''simple docstring'''


										A__       :     Union[str, Any]								=			super().__new__(cls   ,      snake_case_   ,      snake_case_   ,      snake_case_							)
										if not hasattr(snake_case_   ,      """key_handler"""							):
																	setattr(snake_case_   ,      """key_handler"""   ,      {}							)
										setattr(snake_case_   ,      """handle_input"""   ,      KeyHandler.handle_input							)

										for value in attrs.values():
																	A__       :     Dict								=			getattr(snake_case_   ,      """handle_key"""   ,      []							)
																	for key in handled_keys:
																								A__       :     Optional[Any]								=			value
										return new_cls





			@staticmethod
			def 		lowerCamelCase					(			cls							):







										'''simple docstring'''


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





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





