<commit_before>+function(global) {
  var require_sync = require
  global.require = function(path) {
    return arguments.length > 1
      ? require.async.apply(global, arguments)
      : require.sync(path)
  }
  for(var i in require_sync) require[i] = require_sync[i]

  require.sync = require_sync
  
  require.async = function() {
    var paths = Array.prototype.slice.call(arguments),
        callback = typeof paths[paths.length-1] == "function" && paths.pop(),
        deps = []
    
    for(var i=0; i<paths.length; i++) 
      deps.push(paths[i])

    function run(path) {
      load(path, function(mod, new_deps) {
        deps.splice(deps.indexOf(path), 1)
        var dep

        if(!deps.length && !new_deps.length) {
          var args = []
          for(var i=0; i<paths.length; i++) args.push(require(paths[i]))
          return callback && callback.apply(global, args)
        }

        while(dep = new_deps.shift()) {
          var p = require.relative(dep, path)
          deps.unshift(p)
          run(p)
        }
      })
    }
    for(var i=0; i<paths.length; i++) 
      run(paths[i])
  }

  require.compile = function(name, ext, text) {
    text = require.compilers[ext](text)
    return "define('" + name + "', [], function(module, exports, require) {\n" + text + "\n});"
  }
  require.compilers = {}
  require.registerExtension = function(ext, fn) {
    require.compilers[ext] = fn    
  }
  require.registerExtension(".js", function(text) { return text } )

  function load(module_name, callback) {
    var mod, l
    var ext = module_name.match(/\.[a-zA-Z0-9_]*$/)
    if(ext) {
      var path = module_name  
      ext = ext[0]
    } else {
      var path = module_name + ".js"
      ext = ".js"
    }

    if(mod = require.resolve(path)) { return callback(mod, []) }

    if(l = load.loaders[path]) {
      l.callbacks.push(callback)
      return l
    }

    var loader = { callbacks: [callback] }

    xhr(path, function(u, text) {
      var mod = require.globalEval(require.compile(path, ext, text) + "//@ sourceURL=" + u)<commit_msg>compile text before checking dependencies<commit_after>+function(global) {
  var require_sync = require
  global.require = function(path) {
    return arguments.length > 1
      ? require.async.apply(global, arguments)
      : require.sync(path)
  }
  for(var i in require_sync) require[i] = require_sync[i]

  require.sync = require_sync
  
  require.async = function() {
    var paths = Array.prototype.slice.call(arguments),
        callback = typeof paths[paths.length-1] == "function" && paths.pop(),
        deps = []
    
    for(var i=0; i<paths.length; i++) 
      deps.push(paths[i])

    function run(path) {
      load(path, function(mod, new_deps) {
        deps.splice(deps.indexOf(path), 1)
        var dep

        if(!deps.length && !new_deps.length) {
          var args = []
          for(var i=0; i<paths.length; i++) args.push(require(paths[i]))
          return callback && callback.apply(global, args)
        }

        while(dep = new_deps.shift()) {
          var p = require.relative(dep, path)
          deps.unshift(p)
          run(p)
        }
      })
    }
    for(var i=0; i<paths.length; i++) 
      run(paths[i])
  }

  require.compile = function(name, ext, text) {
    text = require.compilers[ext](text)
    return "define('" + name + "', [], function(module, exports, require) {\n" + text + "\n});"
  }
  require.compilers = {}
  require.registerExtension = function(ext, fn) {
    require.compilers[ext] = fn    
  }
  require.registerExtension(".js", function(text) { return text } )

  function load(module_name, callback) {
    var mod, l
    var ext = module_name.match(/\.[a-zA-Z0-9_]*$/)
    if(ext) {
      var path = module_name  
      ext = ext[0]
    } else {
      var path = module_name + ".js"
      ext = ".js"
    }

    if(mod = require.resolve(path)) { return callback(mod, []) }

    if(l = load.loaders[path]) {
      l.callbacks.push(callback)
      return l
    }

    var loader = { callbacks: [callback] }

    xhr(path, function(u, text) {
      text = require.compile(path, ext, text)
      var mod = require.globalEval(text + "//@ sourceURL=" + u)
{'fraction_non_alphanumeric': 0.1556671449067432, 'fraction_numerical': 0.00430416068866571, 'mean_word_length': 2.428688524590164, 'pattern_counts': {'":': 0, '<': 9, '<?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': '1426223', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1396, 'n_words': 287}