<commit_before>var redis = require('redis').createClient();
var uuid = require('node-uuid');

var streams = {}

module.exports = {
    addStream: function (req, res, next){
        var id = req.params.id;
        streams[id] = res;
    },
    getStream: function (id){
        return streams[id];
    },
    setup: function (req, res, next){

        redis.incr('client_counter', function (err, count){

            var id = uuid.v1();
            var major = parseInt(count / 65536, 10);
            var minor = parseInt(count % 65536);

            var stringId = 'id:'+major+'-'+minor;

            redis.set(stringId, id);
            redis.set('uuid:'+id, major+'-'+minor);

            res.send({
                minor: minor,
                major: major,
                client_id: id
            });

        })
    },
    shutup: function (req, res, next){
        var id = req.params.id;
        
        if(streams && streams[id]){
            streams[id].close();
            delete streams[id];
        }

        redis.get('uuid:'+id, function (err, ids){
            if(err) res.send(500); next();
            _ids = ids.split('-');
            redis.del('uuid:'+id);
            redis.del('id:'+ids);
            res.send(200);
            next();
        });
    }
}<commit_msg>Header fixes<commit_after>var redis = require('redis').createClient();
var uuid = require('node-uuid');

var streams = {}

module.exports = {
    addStream: function (req, res, next){
        var id = req.params.id;
        streams[id] = res;
    },
    getStream: function (id){
        return streams[id];
    },
    setup: function (req, res, next){

        redis.incr('client_counter', function (err, count){

            var id = uuid.v1();
            var major = parseInt(count / 65536, 10);
            var minor = parseInt(count % 65536);

            var stringId = 'id:'+major+'-'+minor;

            redis.set(stringId, id);
            redis.set('uuid:'+id, major+'-'+minor);

            res.send({
                minor: minor,
                major: major,
                client_id: id
            });

        })
    },
    shutup: function (req, res, next){
        var id = req.params.id;
        
        if(streams && streams[id]){
            streams[id].close();
            delete streams[id];
        }

        redis.get('uuid:'+id, function (err, ids){
            if(err){
                res.status(500).end();
                next();
            }
            if(!ids){
                res.status(404).end(); next();
            }
            redis.del('uuid:'+id);
            redis.del('id:'+ids);
            res.status(200).end();
            next();
        });
    }
}
{'fraction_non_alphanumeric': 0.16025166543301259, 'fraction_numerical': 0.015173945225758698, 'mean_word_length': 1.4935424354243543, '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': '5058381', 'n_tokens_mistral': 855, 'n_tokens_neox': 807, 'n_words': 172}