<commit_before>/*jslint node:true, stupid:true */
'use strict';

var fs = require('fs'),
    path = require('path'),
    rimraf = require('rimraf'),
    mkdirp = require('mkdirp'),
    copydir = require('wrench').copyDirSyncRecursive; // http://git.io/KYvKWw


function read(from) {
    return fs.readFileSync(from, 'utf-8');
}

function write(filepath, str) {
    mkdirp.sync(path.dirname(filepath));
    fs.writeFileSync(filepath, str, 'utf-8');
}

function writeJson(filepath, str) {
    write(filepath, JSON.stringify(str, null, 4));
}

function copy(from, to) {
    write(to, fs.readFileSync(from), false);
}

function rmrf(dir, cb) {
    rimraf(dir, cb);
}

module.exports = {
    read: read,
    write: write,
    writeJson: writeJson,
    copy: copy,
    copydir: copydir,
    rmrf: rmrf
};<commit_msg>minor- rename param to reflect type (it's not a "str")<commit_after>/*jslint node:true, stupid:true */
'use strict';

var fs = require('fs'),
    path = require('path'),
    rimraf = require('rimraf'),
    mkdirp = require('mkdirp'),
    copydir = require('wrench').copyDirSyncRecursive; // http://git.io/KYvKWw


function read(from) {
    return fs.readFileSync(from, 'utf-8');
}

function write(filepath, str) {
    mkdirp.sync(path.dirname(filepath));
    fs.writeFileSync(filepath, str, 'utf-8');
}

function writeJson(filepath, obj) {
    write(filepath, JSON.stringify(obj, null, 4));
}

function copy(from, to) {
    write(to, fs.readFileSync(from), false);
}

function rmrf(dir, cb) {
    rimraf(dir, cb);
}

module.exports = {
    read: read,
    write: write,
    writeJson: writeJson,
    copy: copy,
    copydir: copydir,
    rmrf: rmrf
};
{'fraction_non_alphanumeric': 0.16736905478627334, 'fraction_numerical': 0.003612281757977122, 'mean_word_length': 3.7621776504297992, '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': '3845780', 'n_tokens_mistral': 616, 'n_tokens_neox': 600, 'n_words': 129}