<commit_before>var Promise = require('rsvp').Promise;
var System = require('systemjs');

var asp = require('rsvp').denodeify;
var fs = require('fs');
var path = require('path');

var toFileURL = require('./utils').toFileURL;

var attachCompilers = require('./compile').attachCompilers;
var compileOutputs = require('./compile').compileOutputs;
var writeOutputs = require('./output').writeOutputs;

var traceExpression = require('./arithmetic').traceExpression;

var Trace = require('./trace');

var getCanonicalName = require('./utils').getCanonicalName;

function processOpts(opts_, outFile) {
  var opts = {
    config: {},
    outFile: outFile,
    normalize: true,

    runtime: false,
    minify: false,
    mangle: true,

    sfxFormat: 'global',
    sfxEncoding: true,
    sfxGlobals: {},
    sfxGlobalName: null,

    sourceMaps: false,
    sourceMapContents: opts_ && opts_.sourceMaps == 'inline',
    lowResSourceMaps: false
  };
  for (var key in opts_)
    opts[key] = opts_[key];
  return opts;
}


function Builder(baseURL, cfg) {
  if (typeof baseURL == 'object') {
    cfg = baseURL;
    baseURL = null;
  }

  this.loader = null;
  this.reset();

  if (baseURL)
    this.config({ baseURL: baseURL });

  if (typeof cfg == 'object')
    this.config(cfg);
  else if (typeof cfg == 'string')
    this.loadConfigSync(cfg);
}

// reverse mapping from globbed address
Builder.prototype.getCanonicalName = function(normalized) {
  return getCanonicalName(this.loader, normalized);
};

Builder.prototype.reset = function(baseLoader) {
  baseLoader = baseLoader || this.loader || System;

  var loader = this.loader = new baseLoader.constructor();
  loader.constructor = baseLoader.constructor;
  loader.baseURL = baseLoader.baseURL;

  loader.builder = true;<commit_msg>copy instance methods from baseLoader<commit_after>var Promise = require('rsvp').Promise;
var System = require('systemjs');

var asp = require('rsvp').denodeify;
var fs = require('fs');
var path = require('path');

var toFileURL = require('./utils').toFileURL;

var attachCompilers = require('./compile').attachCompilers;
var compileOutputs = require('./compile').compileOutputs;
var writeOutputs = require('./output').writeOutputs;

var traceExpression = require('./arithmetic').traceExpression;

var Trace = require('./trace');

var getCanonicalName = require('./utils').getCanonicalName;

function processOpts(opts_, outFile) {
  var opts = {
    config: {},
    outFile: outFile,
    normalize: true,

    runtime: false,
    minify: false,
    mangle: true,

    sfxFormat: 'global',
    sfxEncoding: true,
    sfxGlobals: {},
    sfxGlobalName: null,

    sourceMaps: false,
    sourceMapContents: opts_ && opts_.sourceMaps == 'inline',
    lowResSourceMaps: false
  };
  for (var key in opts_)
    opts[key] = opts_[key];
  return opts;
}


function Builder(baseURL, cfg) {
  if (typeof baseURL == 'object') {
    cfg = baseURL;
    baseURL = null;
  }

  this.loader = null;
  this.reset();

  if (baseURL)
    this.config({ baseURL: baseURL });

  if (typeof cfg == 'object')
    this.config(cfg);
  else if (typeof cfg == 'string')
    this.loadConfigSync(cfg);
}

// reverse mapping from globbed address
Builder.prototype.getCanonicalName = function(normalized) {
  return getCanonicalName(this.loader, normalized);
};

Builder.prototype.reset = function(baseLoader) {
  baseLoader = baseLoader || this.loader || System;

  var loader = this.loader = new baseLoader.constructor();
  loader.constructor = baseLoader.constructor;
  loader.baseURL = baseLoader.baseURL;

  loader.normalize = baseLoader.normalize;
  loader.normalizeSync = baseLoader.normalizeSync;
  loader.locate = baseLoader.locate;
  loader.fetch = baseLoader.fetch;
  loader.translate = baseLoader.translate;
  loader.instantiate = baseLoader.instantiate;

  loader.builder = true;
{'fraction_non_alphanumeric': 0.13753581661891118, 'fraction_numerical': 0.0, 'mean_word_length': 4.12, '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': '1623586', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1168, 'n_words': 281}