<commit_before>'use strict';

function enumToName(list, val) {
  for (var i in list) {
    if (list.hasOwnProperty(i)) {
      if (list[i] === val) {
        return i;
      }
    }
  }
  return 'unknown:' + val;
}

function hrTime() {
  return (new Date()).getTime();
}

// Build a list of parameters passed
var clientParams = [];
if (window.location.hash.length > 1) {
  clientParams = window.location.hash.substr(1).split(',');
}

// Generate option changes based on this.
for (var i = 0; i < clientParams.length; ++i) {
  var param = clientParams[i];
  var paramEqIdx = param.indexOf('=');
  if (paramEqIdx === -1) {
    config[param] = true;
  } else {
    var paramName = param.substr(0, paramEqIdx);
    var paramVal = param.substr(paramEqIdx+1);
    config[paramName] = paramVal;
  }
}


function debugValidateProps(obj, props) {
  for (var i = 0; i < props.length; ++i) {
    var propVal = eval('obj.' + props[i][0]);
    if (propVal === undefined) {
      console.warn('Expected property to be set: ', props[i][0]);
      console.trace();
      continue;
    }
    if (propVal instanceof Int64) {
      // We can cheat since the check value has to be 32bit anyways.
      if (propVal.hi !== 0 ||
        props[i][1] && propVal.lo < props[i][1] ||
        props[i][1] && propVal.lo > props[i][1]) {
        console.warn('Expected property', props[i][0], 'to be between', props[i][1], 'and', props[i][1], '(got:0x' + propVal.toString(16) + ')');
        console.trace();
        continue;
      }
    } else {
      if (props[i][1] && propVal < props[i][1] ||
          props[i][1] && propVal > props[i][1]) {
        console.warn('Expected property', props[i][0], 'to be between', props[i][1], 'and', props[i][1], '(got:' + propVal + ')');
        console.trace();
        continue;<commit_msg>Correct bug in debugValidateProps.<commit_after>'use strict';

function enumToName(list, val) {
  for (var i in list) {
    if (list.hasOwnProperty(i)) {
      if (list[i] === val) {
        return i;
      }
    }
  }
  return 'unknown:' + val;
}

function hrTime() {
  return (new Date()).getTime();
}

// Build a list of parameters passed
var clientParams = [];
if (window.location.hash.length > 1) {
  clientParams = window.location.hash.substr(1).split(',');
}

// Generate option changes based on this.
for (var i = 0; i < clientParams.length; ++i) {
  var param = clientParams[i];
  var paramEqIdx = param.indexOf('=');
  if (paramEqIdx === -1) {
    config[param] = true;
  } else {
    var paramName = param.substr(0, paramEqIdx);
    var paramVal = param.substr(paramEqIdx+1);
    config[paramName] = paramVal;
  }
}


function debugValidateProps(obj, props) {
  for (var i = 0; i < props.length; ++i) {
    var propVal = eval('obj.' + props[i][0]);
    if (propVal === undefined) {
      console.warn('Expected property to be set: ', props[i][0]);
      console.trace();
      continue;
    }
    if (propVal instanceof Int64) {
      // We can cheat since the check value has to be 32bit anyways.
      if (propVal.hi !== 0 ||
        props[i][1] && propVal.lo < props[i][1] ||
        props[i][2] && propVal.lo > props[i][2]) {
        console.warn('Expected property', props[i][0], 'to be between', props[i][1], 'and', props[i][2], '(got:0x' + propVal.toString(16) + ')');
        console.trace();
        continue;
      }
    } else {
      if (props[i][1] && propVal < props[i][1] ||
          props[i][2] && propVal > props[i][2]) {
        console.warn('Expected property', props[i][0], 'to be between', props[i][1], 'and', props[i][2], '(got:' + propVal + ')');
        console.trace();
        continue;
{'fraction_non_alphanumeric': 0.18775847808105872, 'fraction_numerical': 0.017094017094017096, 'mean_word_length': 2.863684771033014, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '5737598', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1239, 'n_words': 314}