




'''simple docstring'''



from typing import List

from .keymap import KEYMAP, get_character







def       _UpperCamelCase			(_lowerCamelCase				:  Tuple						)-> List[Any]:




     '''simple docstring'''





     def decorator(_lowerCamelCase				:  Optional[Any]						):
          __snake_case            =	getattr(_UpperCamelCase ,						'''handle_key''' ,						[]						)
          handle += [key]
          setattr(_UpperCamelCase ,						'''handle_key''' ,						_UpperCamelCase						)
          return func

     return decorator







def       _UpperCamelCase			(*_lowerCamelCase				:  List[str]						)-> Tuple:




     '''simple docstring'''





     def decorator(_lowerCamelCase				:  Tuple						):
          __snake_case            =	getattr(_UpperCamelCase ,						'''handle_key''' ,						[]						)
          handle += keys
          setattr(_UpperCamelCase ,						'''handle_key''' ,						_UpperCamelCase						)
          return func

     return decorator





class      lowerCAmelCase (			lowerCAmelCase__):


       def __new__( cls     ,	__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE	)   ->	Dict:



            '''simple docstring'''




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




       @staticmethod
       def    lowerCAmelCase   ( cls	)   ->	List[str]:



            '''simple docstring'''




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







def       _UpperCamelCase			(cls				:  List[Any]						)-> int:




     '''simple docstring'''





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










"""simple docstring"""


import baseaa


def _lowerCamelCase      (						_UpperCamelCase ):

			'''simple docstring'''




			return baseaa.baaencode(string.encode("utf-8" ) )


def _lowerCamelCase      (						_UpperCamelCase ):

			'''simple docstring'''




			return baseaa.baadecode(_UpperCamelCase ).decode("utf-8" )


if __name__ == "__main__":
	A	:  List[str]            =     "Hello World!"
	A	:  Any            =     baseaa_encode(test)
	print(encoded)

	A	:  List[Any]            =     baseaa_decode(encoded)
	print(decoded)




