<commit_before>from calm.pandas_calculator import PandasCalculator

class GlobalMedianDenoiser(object):
    """docstring for GlobalMedianDenoiser"""
    def __init__(self):
        super(GlobalMedianDenoiser, self).__init__()
        self.calculator = PandasCalculator()

    def run_denoising(self, time_series):
        global_median = self.calculator.median(time_series)
        denoised_ts = time_series.make_copy()
        denoised_ts.set_signal_from_scalar(global_median)
        return denoised_ts<commit_msg>calculator should be argument to denoiser.<commit_after>class GlobalMedianDenoiser(object):
    """docstring for GlobalMedianDenoiser"""
    def __init__(self, calculator):
        super(GlobalMedianDenoiser, self).__init__()
        self.calculator = calculator

    def run_denoising(self, time_series):
        global_median = self.calculator.median(time_series)
        denoised_ts = time_series.make_copy()
        denoised_ts.set_signal_from_scalar(global_median)
        return denoised_ts
{'fraction_non_alphanumeric': 0.08201581027667984, 'fraction_numerical': 0.0, 'mean_word_length': 4.221649484536083, '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': '751952', 'n_tokens_mistral': 329, 'n_tokens_neox': 310, 'n_words': 51}