<commit_before>import numpy
from time_series import TimeSeries


class firFilter(object):
    r""""
    Class for representing finite impluse response (FIR) linear filter.
    """

    def __init__(self, ir):
        r"""
        Initializes instance of FIR class.

        :param ir: array with filter coefficients.

        :type ir: array-like.
        """
        self.__ir = numpy.array(ir)

    @property
    def ir_coefficients(self):
        r"""
        Get the filter impulse response coefficients.

        :return: filter inmpulse reponse coefficients.

        :rtype: numpy.ndarray.
        """
        return self.__ir

    def filter_signal(self, signal):
        r"""
        Filter given signal with this filter.

        :param signal: signal to be filtered.

        :type signal: array-like.

        :return: filtered signal.

        :rtype: array-like, dependent on type of signal. If signal is subclass
            of numpy.ndarray then returned array is of the same type, otherwise
            it is numpy.ndarray.
        """

        if issubclass(type(signal), numpy.ndarray):
            _signal = signal
        else:
            _signal = numpy.array(signal)

        sample_size = len(_signal)

        if sample_size == 0:
            raise ValueError("Signal cannot be empty.")

        filter_size = len(self.ir_coefficients)

        if filter_size > sample_size:<commit_msg>Add :raise:.<commit_after>import numpy
from time_series import TimeSeries


class firFilter(object):
    r""""
    Class for representing finite impluse response (FIR) linear filter.
    """

    def __init__(self, ir):
        r"""
        Initializes instance of FIR class.

        :param ir: array with filter coefficients.

        :type ir: array-like.
        """
        self.__ir = numpy.array(ir)

    @property
    def ir_coefficients(self):
        r"""
        Get the filter impulse response coefficients.

        :return: filter inmpulse reponse coefficients.

        :rtype: numpy.ndarray.
        """
        return self.__ir

    def filter_signal(self, signal):
        r"""
        Filter given signal with this filter.

        :param signal: signal to be filtered.

        :type signal: array-like.

        :return: filtered signal.

        :rtype: array-like, dependent on type of signal. If signal is subclass
            of numpy.ndarray then returned array is of the same type, otherwise
            it is numpy.ndarray.
	:raise: ValueError if signal is empty
        """

        if issubclass(type(signal), numpy.ndarray):
            _signal = signal
        else:
            _signal = numpy.array(signal)

        sample_size = len(_signal)

        if sample_size == 0:
            raise ValueError("Signal cannot be empty.")

        filter_size = len(self.ir_coefficients)

        if filter_size > sample_size:
{'fraction_non_alphanumeric': 0.08420684835779176, 'fraction_numerical': 0.0006988120195667365, 'mean_word_length': 2.020042194092827, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1226724', 'n_tokens_mistral': 786, 'n_tokens_neox': 742, 'n_words': 262}