<commit_before>;(function($B){

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

$B.del_exc = function(){
    var frame = $B.last($B.frames_stack)
    frame[1].$current_exception = undefined
}

$B.set_exc = function(exc){
    var frame = $B.last($B.frames_stack)
    frame[1].$current_exception = $B.exception(exc)
}

$B.get_exc = function(){
    var frame = $B.last($B.frames_stack)
    return frame[1].$current_exception
}

$B.$raise = function(arg){
    // Used for "raise" without specifying an exception.
    // If there is an exception in the stack, use it, else throw a simple
    // Exception
    if(arg === undefined){
        var es = $B.get_exc()
        if(es !== undefined){throw es}
        throw _b_.RuntimeError.$factory("No active exception to reraise")
    }else if(isinstance(arg, BaseException)){
        throw arg
    }else if(arg.$is_class && issubclass(arg, BaseException)){
        throw $B.$call(arg)()
    }else{
        throw _b_.TypeError.$factory("exceptions must derive from BaseException")
    }
}

$B.$syntax_err_line = function(exc, module, src, pos, line_num){
    // map position to line number
    var pos2line = {},
        lnum = 1,
        module = module.charAt(0) == "$" ? "<string>" : module<commit_msg>Implement PEP 479 : Change StopIteration handling inside generators<commit_after>;(function($B){

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

$B.del_exc = function(){
    var frame = $B.last($B.frames_stack)
    frame[1].$current_exception = undefined
}

$B.set_exc = function(exc){
    var frame = $B.last($B.frames_stack)
    frame[1].$current_exception = $B.exception(exc)
}

$B.get_exc = function(){
    var frame = $B.last($B.frames_stack)
    return frame[1].$current_exception
}

$B.$raise = function(arg){
    // Used for "raise" without specifying an exception.
    // If there is an exception in the stack, use it, else throw a simple
    // Exception
    if(arg === undefined){
        var es = $B.get_exc()
        if(es !== undefined){throw es}
        throw _b_.RuntimeError.$factory("No active exception to reraise")
    }else if(isinstance(arg, BaseException)){
        if(arg.__class__ === _b_.StopIteration &&
                $B.last($B.frames_stack)[1].$is_generator){
            // PEP 479
            arg = _b_.RuntimeError.$factory("generator raised StopIteration")
        }
        throw arg
    }else if(arg.$is_class && issubclass(arg, BaseException)){
        if(arg === _b_.StopIteration &&
                $B.last($B.frames_stack)[1].$is_generator){
            // PEP 479
            throw _b_.RuntimeError.$factory("generator raised StopIteration")
        }
        throw $B.$call(arg)()
    }else{
        throw _b_.TypeError.$factory("exceptions must derive from BaseException")
    }
}

$B.$syntax_err_line = function(exc, module, src, pos, line_num){
    // map position to line number
    var pos2line = {},
        lnum = 1,
        module = module.charAt(0) == "$" ? "<string>" : module
{'fraction_non_alphanumeric': 0.14791105121293802, 'fraction_numerical': 0.00774932614555256, 'mean_word_length': 2.891218872870249, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3186962', 'n_tokens_mistral': 968, 'n_tokens_neox': 950, 'n_words': 226}