<commit_before>from fftw3 import ComplexFFTW
import numpy

import unittest

def timer_test_setup(fft_length = 2048, vectors = 256):
    a = numpy.complex64(numpy.random.rand(vectors,fft_length)
            +1j*numpy.random.rand(vectors,fft_length))
    b = numpy.complex64(numpy.random.rand(vectors,fft_length)
            +1j*numpy.random.rand(vectors,fft_length))
    
    fft_class = ComplexFFTW(a,b, flags=['FFTW_MEASURE'])

    # We need to refill a with data as it get's clobbered by
    # initialisation.
    a[:] = numpy.complex64(numpy.random.rand(vectors,fft_length)
            +1j*numpy.random.rand(vectors,fft_length))


    return fft_class, a, b

timer_setup = '''
try:
    from __main__ import timer_test_setup
except:
    from test_fftw3 import timer_test_setup

fft_class,a,b= timer_test_setup()
'''
def timer():
    from timeit import Timer
    N = 100
    t = Timer(stmt="fft_class.execute()", setup=timer_setup)
        
    print 'One run: '+ ("%.2f" % (1000.0/N*t.timeit(N)))+' ms'

def timer_with_array_update():
    from timeit import Timer
    N = 100
    # We can update the arrays with the original arrays. We're
    # really just trying to test the code path, which should be
    # fixed regardless of the array size.
    t = Timer(<commit_msg>Correcting an english error in the comments<commit_after>from fftw3 import ComplexFFTW
import numpy

import unittest

def timer_test_setup(fft_length = 2048, vectors = 256):
    a = numpy.complex64(numpy.random.rand(vectors,fft_length)
            +1j*numpy.random.rand(vectors,fft_length))
    b = numpy.complex64(numpy.random.rand(vectors,fft_length)
            +1j*numpy.random.rand(vectors,fft_length))
    
    fft_class = ComplexFFTW(a,b, flags=['FFTW_MEASURE'])

    # We need to refill a with data as it gets clobbered by
    # initialisation.
    a[:] = numpy.complex64(numpy.random.rand(vectors,fft_length)
            +1j*numpy.random.rand(vectors,fft_length))


    return fft_class, a, b

timer_setup = '''
try:
    from __main__ import timer_test_setup
except:
    from test_fftw3 import timer_test_setup

fft_class,a,b= timer_test_setup()
'''
def timer():
    from timeit import Timer
    N = 100
    t = Timer(stmt="fft_class.execute()", setup=timer_setup)
        
    print 'One run: '+ ("%.2f" % (1000.0/N*t.timeit(N)))+' ms'

def timer_with_array_update():
    from timeit import Timer
    N = 100
    # We can update the arrays with the original arrays. We're
    # really just trying to test the code path, which should be
    # fixed regardless of the array size.
    t = Timer(
{'fraction_non_alphanumeric': 0.10834951456310679, 'fraction_numerical': 0.02330097087378641, 'mean_word_length': 3.464471403812825, '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': '6666694', 'n_tokens_mistral': 964, 'n_tokens_neox': 883, 'n_words': 223}