<commit_before>var crypto = require("crypto");
var exec   = require('child_process').exec;
var fs     = require("fs");
var marked = require("marked");
var path   = require("path");


var tempFiles = {};

module.exports = function(dirname, done) {
  var pkg = JSON.parse(
    fs.readFileSync(dirname+"/package.json").toString()
  );

  var md = fs.readFileSync(dirname+"/README.md").toString();

  var tokens = marked.lexer(md, {gfm: true});

  var re = new RegExp("require\\([\"']"+pkg.name+"(\/?[^\"']*)[\"']\\)");

  var code = tokens
    .map(function(token) {
      if(token.type === "code" && token.lang === "js") {
        return token.text;
      } else {
        return "";
      }
    })
    .join("")
    .replace(re, function() {
      return "require(\""+dirname+"/"+RegExp.$1+"\")";
    });

  // Added assertion globally
  code = "var assert = require('assert');\n"+code;<commit_msg>Added "g" flag to regexp.<commit_after>var crypto = require("crypto");
var exec   = require('child_process').exec;
var fs     = require("fs");
var marked = require("marked");
var path   = require("path");


var tempFiles = {};

module.exports = function(dirname, done) {
  var pkg = JSON.parse(
    fs.readFileSync(dirname+"/package.json").toString()
  );

  var md = fs.readFileSync(dirname+"/README.md").toString();

  var tokens = marked.lexer(md, {gfm: true});

  var re = new RegExp("require\\([\"']"+pkg.name+"(\/?[^\"']*)[\"']\\)", "g");

  var code = tokens
    .map(function(token) {
      if(token.type === "code" && token.lang === "js") {
        return token.text;
      } else {
        return "";
      }
    })
    .join("")
    .replace(re, function() {
      return "require(\""+dirname+"/"+RegExp.$1+"\")";
    });

  // Added assertion globally
  code = "var assert = require('assert');\n"+code;
{'fraction_non_alphanumeric': 0.22639425731639978, 'fraction_numerical': 0.0011043622308117063, 'mean_word_length': 3.053691275167785, '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': '7329326', 'n_tokens_mistral': 621, 'n_tokens_neox': 598, 'n_words': 124}