


"""simple docstring"""

from ..utils import DummyObject, requires_backends





class    lowerCamelCase__						(		metaclass=UpperCamelCase_    ):
      a :     Union[str, Any]											=		["""torch""", """scipy"""]
      def __init__(		self	:	str      ,       *A_	:	Optional[int]      ,       **A_	:	Optional[int]							):






       '''simple docstring'''


       requires_backends(self      ,       ["""torch""", """scipy"""]							)
      @classmethod
      def SCREAMING_SNAKE_CASE_	(		cls	:	int      ,       *A_	:	int      ,       **A_	:	List[Any]							):






       '''simple docstring'''


       requires_backends(cls      ,       ["""torch""", """scipy"""]							)






      @classmethod
      def SCREAMING_SNAKE_CASE_	(		cls	:	Dict      ,       *A_	:	Optional[int]      ,       **A_	:	Optional[int]							):






       '''simple docstring'''


       requires_backends(cls      ,       ["""torch""", """scipy"""]							)




"""simple docstring"""

from typing import List

from .keymap import KEYMAP, get_character


def lowerCAmelCase_      (				UpperCamelCase__	: str ):






 """simple docstring"""







 def decorator(UpperCamelCase__	: Tuple ):
  __lowercase									=	getattr(UpperCamelCase__				,   """handle_key"""				,   [] )
  handle += [key]
  setattr(UpperCamelCase__				,   """handle_key"""				,   UpperCamelCase__ )
  return func

 return decorator


def lowerCAmelCase_      (				*UpperCamelCase__	: List[str] ):






 """simple docstring"""







 def decorator(UpperCamelCase__	: Tuple ):
  __lowercase									=	getattr(UpperCamelCase__				,   """handle_key"""				,   [] )
  handle += keys
  setattr(UpperCamelCase__				,   """handle_key"""				,   UpperCamelCase__ )
  return func

 return decorator





class    lowerCamelCase__						(		_a    ):
      def __new__(		cls	:	str      ,       A_	:	Optional[Any]      ,       A_	:	Union[str, Any]      ,       A_	:	int							):






       '''simple docstring'''


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






      @staticmethod
      def SCREAMING_SNAKE_CASE_	(		cls	:	Dict							):






       '''simple docstring'''


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






def lowerCAmelCase_      (				cls	: int ):






 """simple docstring"""







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