


import doctest
from collections import deque

import numpy as np

class 							a						:




							"""simple docstring"""


							def __init__(				self			:    List[str]							)      ->       None:
														__snake_case						:     List[Any]									=  [2, 1, 2, -1]
														__snake_case						:     Union[str, Any]									=  [1, 2, 3, 4]






							def        __snake_case   (				self			:    int							)      ->       list[float]:
														__snake_case						:     int									=  len(self.first_signal							)
														__snake_case						:     Union[str, Any]									=  len(self.second_signal							)

														__snake_case						:     Any									=  max(lowerCamelCase       ,      lowerCamelCase							)

														# create a zero matrix of max_length x max_length
														__snake_case						:     str									=  [[0] * max_length for i in range(lowerCamelCase							)]

														# 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(lowerCamelCase							):
																					__snake_case						:     Tuple									=  deque(self.second_signal							)
																					rotated_signal.rotate(lowerCamelCase							)
																					for j, item in enumerate(lowerCamelCase							):
																												matrix[i][j] += item

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

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


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






"""simple docstring"""






from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__snake_case				:  Tuple =       {
    'configuration_autoformer': [
        'AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'AutoformerConfig',
    ],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__snake_case				:  Optional[Any] =       [
	    'AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'AutoformerForPrediction',
	    'AutoformerModel',
	    'AutoformerPreTrainedModel',
	]


if TYPE_CHECKING:
	from .configuration_autoformer import (
	    AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
	    AutoformerConfig,
	)

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_autoformer import (
		    AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
		    AutoformerForPrediction,
		    AutoformerModel,
		    AutoformerPreTrainedModel,
		)

else:
	import sys

	__snake_case				:  Optional[int] =       _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)