



import doctest
from collections import deque

import numpy as np






class SCREAMING_SNAKE_CASE__	:




    '''simple docstring'''






    def __init__(			self						):
        A					:			Any		=  [2, 1, 2, -1]
        A					:			Union[str, Any]		=  [1, 2, 3, 4]






    def      _lowerCAmelCase   (			self						):
        A					:			Tuple		=  len(self.first_signal						)
        A					:			str		=  len(self.second_signal						)

        A					:			Union[str, Any]		=  max(_UpperCamelCase,						_UpperCamelCase						)

        # create a zero matrix of max_length x max_length
        A					:			int		=  [[0] * max_length for i in range(_UpperCamelCase						)]

        # fills the smaller signal with zeros to make both signals of same length
        if length_first_signal < length_second_signal:
            self.first_signal += [0] * (max_length - length_first_signal)
        elif length_first_signal > length_second_signal:
            self.second_signal += [0] * (max_length - length_second_signal)
        for i in range(_UpperCamelCase						):
            A					:			Tuple		=  deque(self.second_signal						)
            rotated_signal.rotate(_UpperCamelCase						)
            for j, item in enumerate(_UpperCamelCase						):
                matrix[i][j] += item

        # multiply the matrix with the first signal
        A					:			Optional[int]		=  np.matmul(np.transpose(_UpperCamelCase						),						np.transpose(self.first_signal						)						)

        # rounding-off to two decimal places
        return [round(_UpperCamelCase,						2						) for i in final_signal]


if __name__ == "__main__":
     doctest.testmod()









from typing import List

from .keymap import KEYMAP, get_character
def      A__       (    SCREAMING_SNAKE_CASE_   :      str						)  ->  List[str]:






   """simple docstring"""







   def decorator(SCREAMING_SNAKE_CASE_   :      List[Any]						):
      _UpperCAmelCase           =   getattr(SCREAMING_SNAKE_CASE_				,	'''handle_key'''				,	[]						)
      handle += [key]
      setattr(SCREAMING_SNAKE_CASE_				,	'''handle_key'''				,	SCREAMING_SNAKE_CASE_						)
      return func

   return decorator
def      A__       (    *SCREAMING_SNAKE_CASE_   :      List[str]						)  ->  Dict:






   """simple docstring"""







   def decorator(SCREAMING_SNAKE_CASE_   :      Any						):
      _UpperCAmelCase           =   getattr(SCREAMING_SNAKE_CASE_				,	'''handle_key'''				,	[]						)
      handle += keys
      setattr(SCREAMING_SNAKE_CASE_				,	'''handle_key'''				,	SCREAMING_SNAKE_CASE_						)
      return func

   return decorator




class 			__UpperCamelCase    (							A__    ):





     def __new__(     cls				,							_UpperCamelCase				,							_UpperCamelCase				,							_UpperCamelCase					):
        _UpperCAmelCase           =   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():
           _UpperCAmelCase           =   getattr(_UpperCamelCase				,							'''handle_key'''				,							[]					)
           for key in handled_keys:
              _UpperCAmelCase           =   value
        return new_cls





     @staticmethod
     def 		UpperCamelCase(     cls					):
        _UpperCAmelCase           =   get_character()
        if char != KEYMAP["undefined"]:
           _UpperCAmelCase           =   ord(_UpperCamelCase					)
        _UpperCAmelCase           =   cls.key_handler.get(_UpperCamelCase					)
        if handler:
           _UpperCAmelCase           =   char
           return handler(cls					)
        else:
           return None




def      A__       (    cls   :      Union[str, Any]						)  ->  Any:






   """simple docstring"""







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