<commit_before>var Cycle = function(){
    var cycles = {};
    
    var that = {};
    
    var thru = function(){
        var values, i, cycle, options, name, nextValue;
        
        values = Array.prototype.slice.call(arguments);
        options = typeof(values.slice(-1)) === 'object' ? values.pop() : {};
        
        name = options['name'] || 'default';
        
        if(cycles[name]) {
            cycle = cycles[name];
            nextValue = cycle.values[cycle.index];
            cycle.index = (cycle.index === cycle.values.length -1) ? 0 : (cycle.index +1);
            return nextValue;
        } else {
            cycles[name] = {
              values: values,
              index: 0
            };
            return thru.apply(that, values);
        }
    };
    that.thru = thru;
    
    var reset = function(name) {
        if(cycles[name]) {
            cycles[name].index = 0;
        }
    };
    that.reset = reset;
    
    return that;
    
}();<commit_msg>Fixed a bug in cycle having to do with array slicing<commit_after>var Cycle = function(){
    var cycles, that, thru, reset;
    
    cycles = {};
    that = {};

    thru = function(){
        var values, i, cycle, options, name, nextValue;

        values = Array.prototype.slice.call(arguments);
        options = typeof(values.slice(-1)[0]) === 'object' ? values.pop() : {};

        name = options['name'] || 'default';

        if(!cycles[name]) {
            cycles[name] = {
              values: values,
              index: 0
            }; 
        };
        cycle = cycles[name];
        nextValue = cycle.values[cycle.index];
        cycle.index = (cycle.index === cycle.values.length -1) ? 0 : (cycle.index +1);
        return nextValue;
    };
    that.thru = thru;

    reset = function(name) {
        if(cycles[name]) {
            cycles[name].index = 0;
        }
    };
    that.reset = reset;
    
    return that;

}();
{'fraction_non_alphanumeric': 0.14824380165289255, 'fraction_numerical': 0.006714876033057851, 'mean_word_length': 1.6317934782608696, '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': '5953552', 'n_tokens_mistral': 582, 'n_tokens_neox': 558, 'n_words': 129}