





'''simple docstring'''
import doctest
from collections import deque

import numpy as np

class      snake_case     :




 """simple docstring"""



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






 def        _lowerCamelCase					(       self       :							str	):
        __UpperCamelCase       =  len(self.first_signal	)
        __UpperCamelCase       =  len(self.second_signal	)

        __UpperCamelCase       =  max(__A							,	__A	)

        # create a zero matrix of max_length x max_length
        __UpperCamelCase       =  [[0] * max_length for i in range(__A	)]

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

        # multiply the matrix with the first signal
        __UpperCamelCase       =  np.matmul(np.transpose(__A	)							,	np.transpose(self.first_signal	)	)

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


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







'''simple docstring'''
import pytest

from datasets.splits import SplitDict, SplitInfo
from datasets.utils.py_utils import asdict
@pytest.mark.parametrize(
    'split_dict'				,  [
        SplitDict(),
        SplitDict({'train': SplitInfo(name='train'				,  num_bytes=1337				,  num_examples=42				,  dataset_name='my_dataset'     )}     ),
        SplitDict({'train': SplitInfo(name='train'				,  num_bytes=1337				,  num_examples=42     )}     ),
        SplitDict({'train': SplitInfo()}     ),
    ]				,  )
def 				lowercase__   (   __lowercase						:  SplitDict     ) ->      int:



       """simple docstring"""






       __UpperCamelCase       =  split_dict._to_yaml_list()
       assert len(__lowercase     ) == len(__lowercase     )
       __UpperCamelCase       =  SplitDict._from_yaml_list(__lowercase     )
       for split_name, split_info in split_dict.items():
              # dataset_name field is deprecated, and is therefore not part of the YAML dump
              __UpperCamelCase       =  None
              # the split name of split_dict takes over the name of the split info object
              __UpperCamelCase       =  split_name
       assert split_dict == reloaded


@pytest.mark.parametrize(
    'split_info'				,  [SplitInfo(), SplitInfo(dataset_name=__lowercase     ), SplitInfo(dataset_name='my_dataset'     )]     )
def 				lowercase__   (   __lowercase						:  Dict     ) ->      Any:



       """simple docstring"""






       __UpperCamelCase       =  asdict(SplitDict({'train': split_info}     )     )
       assert "dataset_name" in split_dict_asdict["train"]
       assert split_dict_asdict["train"]["dataset_name"] == split_info.dataset_name
