



"""simple docstring"""

from typing import List

from .keymap import KEYMAP, get_character







def 							SCREAMING_SNAKE_CASE__      (		SCREAMING_SNAKE_CASE__ :  int			):



					"""simple docstring"""





					def decorator(SCREAMING_SNAKE_CASE__ :  List[str]			):
										snake_case_					:		Optional[int] 					=					getattr(a__				,    """handle_key"""				,    []			)
										handle += [key]
										setattr(a__				,    """handle_key"""				,    a__			)
										return func

					return decorator







def 							SCREAMING_SNAKE_CASE__      (		*SCREAMING_SNAKE_CASE__ :  Dict			):



					"""simple docstring"""





					def decorator(SCREAMING_SNAKE_CASE__ :  str			):
										snake_case_					:		List[str] 					=					getattr(a__				,    """handle_key"""				,    []			)
										handle += keys
										setattr(a__				,    """handle_key"""				,    a__			)
										return func

					return decorator







class    __lowercase     (					__lowercase):







						"""simple docstring"""







						def __new__(cls   ,		lowercase__   ,		lowercase__   ,		lowercase__       ):
											snake_case_					:		List[Any] 					=					super().__new__(cls   ,		__A   ,		__A   ,		__A       )
											if not hasattr(__A   ,		"""key_handler"""       ):
																setattr(__A   ,		"""key_handler"""   ,		{}       )
											setattr(__A   ,		"""handle_input"""   ,		KeyHandler.handle_input       )

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







						@staticmethod
						def 						__UpperCamelCase							(cls       ):
											snake_case_					:		int 					=					get_character()
											if char != KEYMAP["undefined"]:
																snake_case_					:		int 					=					ord(__A       )
											snake_case_					:		int 					=					cls.key_handler.get(__A       )
											if handler:
																snake_case_					:		List[Any] 					=					char
																return handler(cls       )
											else:
																return None







def 							SCREAMING_SNAKE_CASE__      (		cls :  int			):



					"""simple docstring"""





					return KeyHandler(cls.__name__				,    cls.__bases__				,    cls.__dict__.copy()			)









"""simple docstring"""

def 							SCREAMING_SNAKE_CASE__      (		SCREAMING_SNAKE_CASE__ :  int				,    SCREAMING_SNAKE_CASE__ :  int			):



					"""simple docstring"""





					return numa ^ numa < 0


if __name__ == "__main__":
			import doctest

			doctest.testmod()




