<commit_before>import os
from tempfile import mkstemp
import sys

import scikits.audiolab

TEST_DATA_DIR = os.path.join(os.path.dirname(scikits.audiolab.__file__),
                             'test_data')

def open_tmp_file(name):
    """On any sane platforms, return a fd on a tmp file. On windows, returns
    the filename, and as such, is not secure (someone else can reopen the file
    in between)."""
    fd, cfilename = mkstemp('pysndfiletest.wav')
    if sys.platform == 'win32':
        return fd, cfilename, cfilename
    else:
        return fd, fd, cfilename

def close_tmp_file(fd, filename):
    """On any sane platforms, remove the file . On windows, only close the
    file."""
    os.close(fd)
    os.remove(filename)<commit_msg>Actually uses the name hint for temp files in tests.<commit_after>import os
from tempfile import mkstemp
import sys

import scikits.audiolab

TEST_DATA_DIR = os.path.join(os.path.dirname(scikits.audiolab.__file__),
                             'test_data')

def open_tmp_file(name):
    """On any sane platforms, return a fd on a tmp file. On windows, returns
    the filename, and as such, is not secure (someone else can reopen the file
    in between)."""
    fd, cfilename = mkstemp(name)
    if sys.platform == 'win32':
        return fd, cfilename, cfilename
    else:
        return fd, fd, cfilename

def close_tmp_file(fd, filename):
    """On any sane platforms, remove the file . On windows, only close the
    file."""
    os.close(fd)
    os.remove(filename)
{'fraction_non_alphanumeric': 0.09486166007905138, 'fraction_numerical': 0.002635046113306983, 'mean_word_length': 2.9973684210526317, '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': '2347961', 'n_tokens_mistral': 480, 'n_tokens_neox': 463, 'n_words': 164}