<commit_before>;(function($B){

var bltns = $B.InjectBuiltins()
eval(bltns)

var object = _b_.object,
    str_hash = _b_.str.__hash__,
    $N = _b_.None

var set_ops = ["eq", "add", "sub", "and", "or", "xor", "le", "lt", "ge", "gt"]

$B.make_view = function(name, set_like){
    var klass = $B.make_class(name, function(items){
        return {
            __class__: klass,
            __dict__: _b_.dict.$factory(),
            counter: -1,
            items: items,
            len: items.length
        }
    })

    if(set_like){
        for(var i = 0, len = set_ops.length; i < len; i++){
            var op = "__" + set_ops[i] + "__"
            klass[op] = (function(op){
                return function(self, other){
                    // compare set of items to other
                    return _b_.set[op](_b_.set.$factory(self),
                        _b_.set.$factory(other))
                }
            })(op)
        }
    }
    klass.__iter__ = function(self){
        var it = klass.$iterator.$factory(self.items)
        it.len_func = self.len_func
        return it
    }
    klass.__repr__ = function(self){
        return klass.$infos.__name__ + '(' + _b_.repr(self.items) + ')'
    }

    return klass
}

// Special version of __next__ for iterators on dict keys / values / items.
// Checks that the dictionary size didn't change during iteration.
function dict_iterator_next(self){
    if(self.len_func() != self.len){
        throw RuntimeError.$factory("dictionary changed size during iteration")
    }
    self.counter++
    if(self.counter < self.items.length){
        return self.items[self.counter]
    }
    throw _b_.StopIteration.$factory("StopIteration")
}<commit_msg>Set $infos on dictionary views attributes<commit_after>;(function($B){

var bltns = $B.InjectBuiltins()
eval(bltns)

var object = _b_.object,
    str_hash = _b_.str.__hash__,
    $N = _b_.None

var set_ops = ["eq", "add", "sub", "and", "or", "xor", "le", "lt", "ge", "gt"]

$B.make_view = function(name, set_like){
    var klass = $B.make_class(name, function(items){
        return {
            __class__: klass,
            __dict__: _b_.dict.$factory(),
            counter: -1,
            items: items,
            len: items.length
        }
    })

    if(set_like){
        for(var i = 0, len = set_ops.length; i < len; i++){
            var op = "__" + set_ops[i] + "__"
            klass[op] = (function(op){
                return function(self, other){
                    // compare set of items to other
                    return _b_.set[op](_b_.set.$factory(self),
                        _b_.set.$factory(other))
                }
            })(op)
        }
    }
    klass.__iter__ = function(self){
        var it = klass.$iterator.$factory(self.items)
        it.len_func = self.len_func
        return it
    }
    klass.__repr__ = function(self){
        return klass.$infos.__name__ + '(' + _b_.repr(self.items) + ')'
    }

    $B.set_func_names(klass, "builtins")
    return klass
}

// Special version of __next__ for iterators on dict keys / values / items.
// Checks that the dictionary size didn't change during iteration.
function dict_iterator_next(self){
    if(self.len_func() != self.len){
        throw RuntimeError.$factory("dictionary changed size during iteration")
    }
    self.counter++
    if(self.counter < self.items.length){
        return self.items[self.counter]
    }
    throw _b_.StopIteration.$factory("StopIteration")
}
{'fraction_non_alphanumeric': 0.14248779086469404, 'fraction_numerical': 0.0011490950876185005, 'mean_word_length': 2.06784140969163, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4509919', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1112, 'n_words': 251}