<commit_before>
import numpy as np

import scipy.signal as signal

from seisflows.tools.config import SeisflowsParameters
PAR = SeisflowsParameters()


def sbandpass(s, h, freqlo, freqhi):
    nr = h.nr
    dt = h.dt
    fs = 1/dt

    for ir in range(0, nr):
        s[:,ir] = bandpass(s[:,ir],freqlo,freqhi,fs)
    return s


def sconvolve(s, h, w, inplace=True):
    nt = h.nt
    nr = h.nr

    if inplace:
        for ir in range(nr):
            s[:,ir] = np.convolve(s[:,ir], w, 'same')
        return s
    else:
        s2 = np.zeros((nt,nr))
        for ir in range(nr):
            s2[:,ir] = np.convolve(s[:,ir], w, 'same')
        return s2


def slowpass(s, h, freq):
    raise NotImplementedError


def shighpass(s, h, freq):
    raise NotImplementedError


def smute(s, h, vel, toff, xoff=0, constant_spacing=False):
    nt = h.nt
    dt = h.dt
    nr = h.nr

    # construct tapered window
    length = 400
    win = np.sin(np.linspace(0, np.pi, 2*length))<commit_msg>modified muting<commit_after>
import numpy as np

import scipy.signal as signal

from seisflows.tools.config import SeisflowsParameters
PAR = SeisflowsParameters()


def sbandpass(s, h, freqlo, freqhi):
    nr = h.nr
    dt = h.dt
    fs = 1/dt

    for ir in range(0, nr):
        s[:,ir] = bandpass(s[:,ir],freqlo,freqhi,fs)
    return s


def sconvolve(s, h, w, inplace=True):
    nt = h.nt
    nr = h.nr

    if inplace:
        for ir in range(nr):
            s[:,ir] = np.convolve(s[:,ir], w, 'same')
        return s
    else:
        s2 = np.zeros((nt,nr))
        for ir in range(nr):
            s2[:,ir] = np.convolve(s[:,ir], w, 'same')
        return s2


def slowpass(s, h, freq):
    raise NotImplementedError


def shighpass(s, h, freq):
    raise NotImplementedError


def smute(s, h, vel, toff, xoff=0, constant_spacing=False):
    nt = h.nt
    dt = h.dt
    nr = h.nr

    # construct tapered window
    length = 300
    win = np.sin(np.linspace(0, np.pi, 2*length))
{'fraction_non_alphanumeric': 0.13793103448275862, 'fraction_numerical': 0.011156186612576065, 'mean_word_length': 2.3900343642611683, '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': '7365320', 'n_tokens_mistral': 791, 'n_tokens_neox': 766, 'n_words': 206}