<commit_before>if(typeof define !== 'function') {
  var define = require('amdefine')(module);
}

define(function(require, exports) {
  function isInternalProperty(p) {
    return p === 'range' || p === 'loc' || p === 'attr' || p === 'comments' || p === 'raw';
  }
  
  function visit(root, visitor) {
    function doVisit(nd) {
      if(!nd || typeof nd !== 'object')
        return;
      
      if(nd.type) {
        var res = visitor(nd, doVisit);
        if(res === false)
          return;
      }
      
      for(var p in nd) {
        if(!nd.hasOwnProperty(p) || isInternalProperty(p))
          continue;
        doVisit(nd[p]);
      }
    }
    
    doVisit(root);
  }
  
  function init(ast) {
    var enclosingFunction = null;<commit_msg>Replaced internal property name check with regexp, which speeds up things by several seconds.<commit_after>if(typeof define !== 'function') {
  var define = require('amdefine')(module);
}

define(function(require, exports) {
  var internalPropRegExp = /range|loc|attr|comments|raw/;
  function visit(root, visitor) {
    function doVisit(nd) {
      if(!nd || typeof nd !== 'object')
        return;
      
      if(nd.type) {
        var res = visitor(nd, doVisit);
        if(res === false)
          return;
      }
      
      for(var p in nd) {
        if(!nd.hasOwnProperty(p) || p.match(internalPropRegExp))
          continue;
        doVisit(nd[p]);
      }
    }
    
    doVisit(root);
  }
  
  function init(ast) {
    var enclosingFunction = null;
{'fraction_non_alphanumeric': 0.15013227513227514, 'fraction_numerical': 0.0, 'mean_word_length': 2.3252747252747255, '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': '6216104', 'n_tokens_mistral': 490, 'n_tokens_neox': 479, 'n_words': 108}