'''simple docstring'''







import doctest
from collections import deque

import numpy as np




class _SCREAMING_SNAKE_CASE:




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




						def      __lowerCamelCase       (    self :       List[Any]      )     ->				list[float]:
													SCREAMING_SNAKE_CASE__     :Optional[Any]						    = len(self.first_signal      )
													SCREAMING_SNAKE_CASE__     :List[str]						    = len(self.second_signal      )

													SCREAMING_SNAKE_CASE__     :Tuple						    = max(UpperCamelCase_							,							UpperCamelCase_      )

													# create a zero matrix of max_length x max_length
													SCREAMING_SNAKE_CASE__     :Optional[Any]						    = [[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_      ):
																				SCREAMING_SNAKE_CASE__     :str						    = 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
													SCREAMING_SNAKE_CASE__     :Optional[Any]						    = 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 typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCamelCase_      	=	{
    '''configuration_x_clip''': [
        '''XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''XCLIPConfig''',
        '''XCLIPTextConfig''',
        '''XCLIPVisionConfig''',
    ],
    '''processing_x_clip''': ['''XCLIPProcessor'''],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		UpperCamelCase_      	=	[
		    '''XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''XCLIPModel''',
		    '''XCLIPPreTrainedModel''',
		    '''XCLIPTextModel''',
		    '''XCLIPVisionModel''',
		]

if TYPE_CHECKING:
		from .configuration_x_clip import (
		    XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    XCLIPConfig,
		    XCLIPTextConfig,
		    XCLIPVisionConfig,
		)
		from .processing_x_clip import XCLIPProcessor

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_x_clip import (
				    XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
				    XCLIPModel,
				    XCLIPPreTrainedModel,
				    XCLIPTextModel,
				    XCLIPVisionModel,
				)

else:
		import sys

		UpperCamelCase_      	=	_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






