





from typing import List

from .keymap import KEYMAP, get_character






def 				SCREAMING_SNAKE_CASE__							(       UpperCamelCase__:							Union[str, Any]    ):


		def decorator(UpperCamelCase__:							List[Any]    ):
				SCREAMING_SNAKE_CASE__			=      getattr(lowerCamelCase__					,   """handle_key"""					,   []    )
				handle += [key]
				setattr(lowerCamelCase__					,   """handle_key"""					,   lowerCamelCase__    )
				return func

		return decorator






def 				SCREAMING_SNAKE_CASE__							(       *UpperCamelCase__:							Any    ):


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

		return decorator




class   UpperCamelCase_       (     UpperCamelCase__    ):


							def __new__(							cls    :Any							,				__A    :List[str]							,				__A    :int							,				__A    :Union[str, Any]		)   ->   List[str]:



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__			=      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():
											SCREAMING_SNAKE_CASE__			=      getattr(UpperCamelCase_							,				"""handle_key"""							,				[]		)
											for key in handled_keys:
													SCREAMING_SNAKE_CASE__			=      value
									return new_cls


							@staticmethod
							def      _snake_case  (							cls    :Tuple		)   ->   List[Any]:



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__			=      get_character()
									if char != KEYMAP["undefined"]:
											SCREAMING_SNAKE_CASE__			=      ord(UpperCamelCase_		)
									SCREAMING_SNAKE_CASE__			=      cls.key_handler.get(UpperCamelCase_		)
									if handler:
											SCREAMING_SNAKE_CASE__			=      char
											return handler(cls		)
									else:
											return None






def 				SCREAMING_SNAKE_CASE__							(       cls:							List[Any]    ):
		return KeyHandler(cls.__name__					,   cls.__bases__					,   cls.__dict__.copy()    )






import warnings
from functools import wraps
from typing import Callable






def 				SCREAMING_SNAKE_CASE__							(       UpperCamelCase__:							Callable    ):

		@wraps(UpperCamelCase__    )
		def _inner_fn(*UpperCamelCase__:							Dict					,   **UpperCamelCase__:							Any    ):
				warnings.warn(
				    (f'''\'{fn.__name__}\' is experimental and might be subject to breaking changes in the future.''')					,   UpperCamelCase__					,   )
				return fn(*UpperCamelCase__					,   **UpperCamelCase__    )

		return _inner_fn