<commit_before>/**
 * Returns a new array with the numbers, i.e. [0, 1, ...len]
 *
 * @param {number} len - the length of the new array
 * @returns {number[]}
 */
export const range = len => Array(...Array(len)).map((_, i) => i);

/**
 * Takes an array returns a shallowly flattened copy
 *
 * @param {array} arr - the array to flatten
 * @returns {array}
 */
export const flatten = arr => arr.reduce((flat, nested) => flat.concat(nested), []);

/**
 * Creates a new 2D array split into evenly sized chunks
 *
 * @param {array} arr - the length of the new array
 * @param {number} size - the size of each chunk
 * @returns {array[]}
 */
export const chunk = (arr, size) => range(Math.ceil(arr.length / 2))
  .map(i => arr.slice(i * size, (i + 1) * size));
<commit_msg>Fix typo in chunk docstring<commit_after>/**
 * Returns a new array with the numbers, i.e. [0, 1, ...len]
 *
 * @param {number} len - the length of the new array
 * @returns {number[]}
 */
export const range = len => Array(...Array(len)).map((_, i) => i);

/**
 * Takes an array returns a shallowly flattened copy
 *
 * @param {array} arr - the array to flatten
 * @returns {array}
 */
export const flatten = arr => arr.reduce((flat, nested) => flat.concat(nested), []);

/**
 * Creates a new 2D array split into evenly sized chunks
 *
 * @param {array} arr - the array to chunk
 * @param {number} size - the size of each chunk
 * @returns {array[]}
 */
export const chunk = (arr, size) => range(Math.ceil(arr.length / 2))
  .map(i => arr.slice(i * size, (i + 1) * size));

{'fraction_non_alphanumeric': 0.1752109020116807, 'fraction_numerical': 0.006489292667099286, 'mean_word_length': 3.2952646239554317, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '6025723', 'n_tokens_mistral': 519, 'n_tokens_neox': 502, 'n_words': 194}