<commit_before>var fs = require('fs'),
    md5 = require('MD5'),
    redis = require('redis'),
    csv = require('csv-parser');

var client = redis.createClient();
var task = process.argv[2].split('.')[0];

client.on('error', function(err) {
    console.log('err', err);
});

// if this gets too slow checkout multi
// https://github.com/mranney/node_redis#clientmulticommands

fs.createReadStream(process.argv[2])
    .pipe(csv())
    .on('data', function(data) {
        var key = md5(JSON.stringify(data));
        try {
            client.sadd(task, key);
            client.hmset(task + ':' + key, data);
        } catch (e) {
            console.log(e);
        }
    })
    .on('end', function() {
        client.quit();
    });<commit_msg>Forget about the rest of the filepath<commit_after>var fs = require('fs'),
    md5 = require('MD5'),
    redis = require('redis'),
    csv = require('csv-parser');

var client = redis.createClient();
var task = process.argv[2].split('.')[0].split('/')[1];

client.on('error', function(err) {
    console.log('err', err);
});

// if this gets too slow checkout multi
// https://github.com/mranney/node_redis#clientmulticommands

fs.createReadStream(process.argv[2])
    .pipe(csv())
    .on('data', function(data) {
        var key = md5(JSON.stringify(data));
        try {
            client.sadd(task, key);
            client.hmset(task + ':' + key, data);
        } catch (e) {
            console.log(e);
        }
    })
    .on('end', function() {
        client.quit();
    });
{'fraction_non_alphanumeric': 0.1919060052219321, 'fraction_numerical': 0.008485639686684074, 'mean_word_length': 2.5901639344262297, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '4171647', 'n_tokens_mistral': 517, 'n_tokens_neox': 513, 'n_words': 98}