<commit_before>// A dygraph "auto-loader".

// Check where this script was sourced from. If it was sourced from
// '../dygraph-dev.js', then we should source all the other scripts with the
// same relative path ('../dygraph.js', '../dygraph-canvas.js', ...)
(function() {
  var src=document.getElementsByTagName('script');
  var script = src[src.length-1].getAttribute("src");
  var m = /^(.*)\/[^/]*\.js$/.exec(script);
  if (!m) {
    console.error("Can't grok dygraph-dev.js path: " + script);
  } else {
    var path = m[1];  // captured group, not the full match.

    // This list needs to be kept in sync w/ the one in generate-combined.sh
    // and the one in jsTestDriver.conf.
    var source_files = [
      "strftime/strftime-min.js",
      "rgbcolor/rgbcolor.js",
      "dygraph-layout.js",
      "dygraph-canvas.js",
      "dygraph.js",
      "dygraph-utils.js",
      "dygraph-gviz.js",
      "dygraph-interaction-model.js",
      "dygraph-options-reference.js"  // Shouldn't be included in generate-combined.sh
    ];

    for (var i = 0; i < source_files.length; i++) {
      document.write('<script type="text/javascript" src="' + path + '/' + source_files[i] + '"></script>\n');
    }
  }
})();<commit_msg>make dygraph-dev a bit smarter<commit_after>// A dygraph "auto-loader".

// Check where this script was sourced from. If it was sourced from
// '../dygraph-dev.js', then we should source all the other scripts with the
// same relative path ('../dygraph.js', '../dygraph-canvas.js', ...)
(function() {
  var src=document.getElementsByTagName('script');
  var script = src[src.length-1].getAttribute("src");

  // This list needs to be kept in sync w/ the one in generate-combined.sh
  // and the one in jsTestDriver.conf.
  var source_files = [
    "strftime/strftime-min.js",
    "rgbcolor/rgbcolor.js",
    "dygraph-layout.js",
    "dygraph-canvas.js",
    "dygraph.js",
    "dygraph-utils.js",
    "dygraph-gviz.js",
    "dygraph-interaction-model.js",
    "dygraph-options-reference.js"  // Shouldn't be included in generate-combined.sh
  ];

  for (var i = 0; i < source_files.length; i++) {
    document.write('<script type="text/javascript" src="' + script.replace('dygraph-dev.js', source_files[i]) + '"></script>\n');
  }
})();
{'fraction_non_alphanumeric': 0.17876106194690267, 'fraction_numerical': 0.0022123893805309734, 'mean_word_length': 2.952797202797203, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '4959969', 'n_tokens_mistral': 776, 'n_tokens_neox': 752, 'n_words': 194}