<commit_before>#!/usr/bin/env python
# CREATED:2014-01-18 14:09:05 by <NAME> <<EMAIL>>
# unit tests for util routines 

import numpy as np
import librosa

def test_frame():

    # Generate a random time series
    y = np.random.randn(8000)

    for frame in [256, 1024, 2048]:
        for hop_length in [64, 256, 512]:
            y_frame = librosa.util.frame(y, frame_length=frame, hop_length=hop_length)

            for i in xrange(y_frame.shape[1]):
                assert np.allclose(y_frame[:, i], y[ i * hop_length : (i * hop_length + frame)])<commit_msg>revised frame tester<commit_after>#!/usr/bin/env python
# CREATED:2014-01-18 14:09:05 by <NAME> <<EMAIL>>
# unit tests for util routines 

import numpy as np
import librosa

def test_frame():

    # Generate a random time series
    def __test(P):
        frame, hop = P

        y = np.random.randn(8000)
        y_frame = librosa.util.frame(y, frame_length=frame, hop_length=hop)

        for i in xrange(y_frame.shape[1]):
            assert np.allclose(y_frame[:, i], y[ i * hop : (i * hop + frame)])

    for frame in [256, 1024, 2048]:
        for hop_length in [64, 256, 512]:
            yield (__test, [frame, hop_length])
{'fraction_non_alphanumeric': 0.12824811399832356, 'fraction_numerical': 0.06370494551550712, 'mean_word_length': 2.826923076923077, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5597108', 'n_tokens_mistral': 481, 'n_tokens_neox': 407, 'n_words': 122}