
import doctest
from collections import deque

import numpy as np





class       _lowerCAmelCase   :




				def __init__(   self	)							-> Tuple:
							lowerCAmelCase_         =      [2, 1, 2, -1]
							lowerCAmelCase_         =      [1, 2, 3, 4]




				def 	__a		(   self	)							-> Optional[Any]:
							lowerCAmelCase_         =      len(self.first_signal	)
							lowerCAmelCase_         =      len(self.second_signal	)

							lowerCAmelCase_         =      max(UpperCAmelCase__							,							UpperCAmelCase__	)

							# create a zero matrix of max_length x max_length
							lowerCAmelCase_         =      [[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__	):
										lowerCAmelCase_         =      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
							lowerCAmelCase_         =      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()






'''simple docstring'''





from __future__ import annotations






def 				_lowerCAmelCase			(   __magic_name__						:     list[float]						)				->  float:
						lowercase :							Any    		=0.0_0
						lowercase :							Tuple    		=0
						for resistor in resistors:
												if resistor <= 0:
																		lowercase :							Dict    		=f'''Resistor at index {index} has a negative or zero value!'''
																		raise ValueError(__magic_name__						)
												first_sum += 1 / float(__magic_name__						)
												index += 1
						return 1 / first_sum






def 				_lowerCAmelCase			(   __magic_name__						:     list[float]						)				->  float:
						lowercase :							Optional[Any]    		=0.0_0
						lowercase :							int    		=0
						for resistor in resistors:
												sum_r += resistor
												if resistor < 0:
																		lowercase :							Tuple    		=f'''Resistor at index {index} has a negative value!'''
																		raise ValueError(__magic_name__						)
												index += 1
						return sum_r


if __name__ == "__main__":
							import doctest

							doctest.testmod()





