<commit_before>;(function($B){

eval($B.InjectBuiltins())

var $ObjectDict = _b_.object.$dict

var $LocationDict = {__class__:$B.$type,__name__:'Location'}

$LocationDict.__mro__ = [$ObjectDict]

var _window = self;

function $Location(){ // used because of Firefox bug #814622
    var obj = {}
    for(var x in _window.location){
        if(typeof _window.location[x]==='function'){
            obj[x] = (function(f){
                return function(){
                    return f.apply(_window.location,arguments)
                }
              })(_window.location[x])
        }else{
            obj[x]=_window.location[x]
        }
    }
    if(obj['replace']===undefined){ // IE
        obj['replace'] = function(url){_window.location = url}
    }
    obj.__class__ = $LocationDict
    obj.toString = function(){return _window.location.toString()}
    obj.__repr__ = obj.__str__ = obj.toString
    return obj
}

$LocationDict.$factory = $Location
$Location.$dict = $LocationDict

// Transforms a Javascript constructor into a Python function
// that returns instances of the constructor, converted to Python objects

var $JSConstructorDict = {__class__:$B.$type,__name__:'JSConstructor'}

$JSConstructorDict.__call__ = function(self){
    // self.func is a constructor
    // It takes Javascript arguments so we must convert
    // those passed to the Python function
    var args = [null]
    for(var i=1, _len_i = arguments.length; i < _len_i;i++){
        args.push(pyobj2jsobj(arguments[i]))
    }
    var factory = self.func.bind.apply(self.func, args)
    var res = new factory()
    // res is a Javascript object
    return $B.$JS2Py(res)
}

$JSConstructorDict.__getattr__ = function(self, attr){
    // Attributes of a constructor are taken from the original JS object
    return $JSObjectDict.__getattribute__(self.obj, attr)
}

$JSConstructorDict.__mro__ = [$ObjectDict]

function JSConstructor(obj){
    return {
        __class__:$JSConstructorDict,
        obj: obj,
        func:obj.js_func
    }
}
JSConstructor.__class__ = $B.$factory
JSConstructor.$dict = $JSConstructorDict
$JSConstructorDict.$factory = JSConstructor

// JSObject : wrapper around a native Javascript object

var jsobj2pyobj=$B.jsobj2pyobj=function(jsobj) {
    switch(jsobj) {
      case true:
      case false:
        return jsobj
    }

    if(jsobj === undefined || jsobj === null) {
        return _b_.None
    }

    if (Array.isArray(jsobj)) return _b_.list(jsobj)

    if (typeof jsobj === 'number') {
       if (jsobj.toString().indexOf('.') == -1) return _b_.int(jsobj)
       // for now, lets assume a float
       return _b_.float(jsobj)
    }

    return $B.JSObject(jsobj)
}<commit_msg>Conversion of undefined to NotImplemented<commit_after>;(function($B){

eval($B.InjectBuiltins())

var $ObjectDict = _b_.object.$dict

var $LocationDict = {__class__:$B.$type,__name__:'Location'}

$LocationDict.__mro__ = [$ObjectDict]

var _window = self;

function $Location(){ // used because of Firefox bug #814622
    var obj = {}
    for(var x in _window.location){
        if(typeof _window.location[x]==='function'){
            obj[x] = (function(f){
                return function(){
                    return f.apply(_window.location,arguments)
                }
              })(_window.location[x])
        }else{
            obj[x]=_window.location[x]
        }
    }
    if(obj['replace']===undefined){ // IE
        obj['replace'] = function(url){_window.location = url}
    }
    obj.__class__ = $LocationDict
    obj.toString = function(){return _window.location.toString()}
    obj.__repr__ = obj.__str__ = obj.toString
    return obj
}

$LocationDict.$factory = $Location
$Location.$dict = $LocationDict

// Transforms a Javascript constructor into a Python function
// that returns instances of the constructor, converted to Python objects

var $JSConstructorDict = {__class__:$B.$type,__name__:'JSConstructor'}

$JSConstructorDict.__call__ = function(self){
    // self.func is a constructor
    // It takes Javascript arguments so we must convert
    // those passed to the Python function
    var args = [null]
    for(var i=1, _len_i = arguments.length; i < _len_i;i++){
        args.push(pyobj2jsobj(arguments[i]))
    }
    var factory = self.func.bind.apply(self.func, args)
    var res = new factory()
    // res is a Javascript object
    return $B.$JS2Py(res)
}

$JSConstructorDict.__getattr__ = function(self, attr){
    // Attributes of a constructor are taken from the original JS object
    return $JSObjectDict.__getattribute__(self.obj, attr)
}

$JSConstructorDict.__mro__ = [$ObjectDict]

function JSConstructor(obj){
    return {
        __class__:$JSConstructorDict,
        obj: obj,
        func:obj.js_func
    }
}
JSConstructor.__class__ = $B.$factory
JSConstructor.$dict = $JSConstructorDict
$JSConstructorDict.$factory = JSConstructor

// JSObject : wrapper around a native Javascript object

var jsobj2pyobj=$B.jsobj2pyobj=function(jsobj) {
    switch(jsobj) {
      case true:
      case false:
        return jsobj
    }

    if(jsobj === undefined){return _b_.NotImplemented}
    else if(jsobj === null) {return _b_.None}

    if (Array.isArray(jsobj)) return _b_.list(jsobj)

    if (typeof jsobj === 'number') {
       if (jsobj.toString().indexOf('.') == -1) return _b_.int(jsobj)
       // for now, lets assume a float
       return _b_.float(jsobj)
    }

    return $B.JSObject(jsobj)
}
{'fraction_non_alphanumeric': 0.12750689972401105, 'fraction_numerical': 0.0044158233670653175, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5733654', 'n_tokens_mistral': 1695, 'n_tokens_neox': 1681, 'n_words': 406}