<commit_before>'''
Implement continuous wavelet transform for python
'''

import scipy.signal
import numpy as np
import pywt

class CWT:
	def __init__(self , waveletType):
		self.wavelet = pywt.Wavelet(waveletType)
    	[self.phi, self.psi, self.x] = wavelet.wavefun(4)
    	# Compute the central frequency
        fft = np.fft.fft(psi)
    	freqs = np.fft.fftfreq(len(fft) , x[1]-x[0])
        idx = np.nonzero(freqs >= 0)[0] # Only consider positive frequencies
        freqs = freqs[idx]
        fft = fft[idx]
        idx = np.nonzero(fft == np.max(fft))[0]
        self.centralFreq = freqs[idx][0]

    def centralFrequency():
        return self.centralFreq

    def getWavelet(self, scale, dt, time, data):
        basis = x * self.scale
        basis = basis * dt
        yVals = self.psi/np.sqrt(scale)
        delta = basis[1] - basis[0]<commit_msg>Added pyplot to the imports<commit_after>'''
Implement continuous wavelet transform for python
'''

import scipy.signal
import numpy as np
import pywt
import matplotlib.pyplot as plt

class CWT:
	def __init__(self , waveletType):
		self.wavelet = pywt.Wavelet(waveletType)
    	[self.phi, self.psi, self.x] = wavelet.wavefun(4)
    	# Compute the central frequency
        fft = np.fft.fft(psi)
    	freqs = np.fft.fftfreq(len(fft) , x[1]-x[0])
        idx = np.nonzero(freqs >= 0)[0] # Only consider positive frequencies
        freqs = freqs[idx]
        fft = fft[idx]
        idx = np.nonzero(fft == np.max(fft))[0]
        self.centralFreq = freqs[idx][0]

    def centralFrequency():
        return self.centralFreq

    def getWavelet(self, scale, dt, time, data):
        basis = x * self.scale
        basis = basis * dt
        yVals = self.psi/np.sqrt(scale)
        delta = basis[1] - basis[0]
{'fraction_non_alphanumeric': 0.12528344671201813, 'fraction_numerical': 0.01020408163265306, 'mean_word_length': 2.692468619246862, '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': '1301505', 'n_tokens_mistral': 647, 'n_tokens_neox': 621, 'n_words': 151}