<commit_before># -*- coding: utf8 -*-

from __future__ import absolute_import, division, print_function

import logging

from scipy.signal import wiener

from .base_stat_swfilter import BaseStatSWFilter


class WienerSWFilter(BaseStatSWFilter):
    __logger = logging.getLogger(__name__)

    def aggregate_windows(self,
                          window_seq,
                          return_velocity=False,
                          **kwargs):
        """
        Recomended window size is 25*32
        :param window_seq:
        :param return_velocity:
        :param kwargs:
        :return:
        """

        for window in window_seq:

            window_scaled = wiener(window, 10)

            for win_index, win_item in enumerate(window_scaled):
                # if win_index == 0:
                yield win_item<commit_msg>refactor due to spelling (2)<commit_after># -*- coding: utf8 -*-

from __future__ import absolute_import, division, print_function

import logging

from scipy.signal import wiener

from .base_stat_swfilter import BaseStatSWFilter


class WienerSWFilter(BaseStatSWFilter):
    __logger = logging.getLogger(__name__)

    def aggregate_windows(self,
                          window_seq,
                          return_velocity=False,
                          **kwargs):
        """
        Recommended window size is 25*32
        :param window_seq:
        :param return_velocity:
        :param kwargs:
        :return:
        """

        for window in window_seq:

            window_scaled = wiener(window, 10)

            for win_index, win_item in enumerate(window_scaled):
                # if win_index == 0:
                yield win_item
{'fraction_non_alphanumeric': 0.07109004739336493, 'fraction_numerical': 0.010071090047393365, 'mean_word_length': 1.9170984455958548, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3019130', 'n_tokens_mistral': 481, 'n_tokens_neox': 447, 'n_words': 117}