<commit_before>var _ = require('lodash');
var constants = require('./constants');

var fun = () => true;
var generators = {};

/*
 * String generators
 */ 
generators.byte = () => Math.floor(Math.random() * 256);
generators.char = () => String.fromCharCode(generators.byte());
generators.string = (size) => {
	var randomString = '';

	for(var i in _.range(_.random(0, size))) {
		randomString += generators.char();
	}
	return randomString;
};

generators.int = () => {
	return _.random(constants.MAX_INT * -1, constants.MAX_INT);
};

module.exports = generators;<commit_msg>Added an arrayOf generator<commit_after>var _ = require('lodash');
var constants = require('./constants');

var fun = () => true;
var generators = {};

/*
 * array generators
 */
generators.arrayOf = (gen) => {
    // yeah, unreadble, but fun :)
    return size => _.range(_.random(0, size)).map(i => gen(i));
}

/*
 * String generators
 */ 
generators.byte = () => Math.floor(Math.random() * 256);
generators.char = () => String.fromCharCode(generators.byte());
generators.string = (size) => {
    return generators.arrayOf(generators.char)(size).join('');
};

generators.int = () => {
	return _.random(constants.MAX_INT * -1, constants.MAX_INT);
};

module.exports = generators;
{'fraction_non_alphanumeric': 0.19776714513556617, 'fraction_numerical': 0.007974481658692184, 'mean_word_length': 4.229166666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, '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': '6228311', 'n_tokens_mistral': 423, 'n_tokens_neox': 406, 'n_words': 80}