<commit_before>/**
 * @author <NAME> <<EMAIL>>
 * @see https://github.com/adriancmiranda/console.js
 * @version 1.1.0
 */
(function(global, factory){
  'use strict';

  if(typeof module === 'object' && typeof module.exports === 'object'){
    module.exports = factory(global, true);
  }else{
    global.trace = factory(global).log;
  }

}(typeof window !== 'undefined' ? window : this, function(global, nodeEnv){
  'use strict';

  var debug = !nodeEnv && /\bdebug\b/i.test(global.location.href);
  var slice = Array.prototype.slice;

  function trace(console, outputFn, method){
    console[method] = function(){
      if(!console.enabled) return void(0);
      var args = slice.call(arguments);
      if(console.history.length >= console.scrollback){
        console.history.shift();
      }
      console.history.push({ type:method, message:args });
      return outputFn.apply(console, args);
    };
  }

  function Logger(console){
    var ctor = function(){};
    console.enabled = debug || console.enabled;
    for(var methods = 'assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,timeStamp,profile,profileEnd,time,timeEnd,trace,warn,log'.split(','), method; method = methods.pop();){
      trace(console, console[method] || ctor, method);
    }
    return console;
  }

  return Logger(function(limit){
    try{
      console.log();
      global.console.history = [];
      global.console.scrollback = limit;
      return global.console;
    }catch(error){
      global.console = { history:[], scrollback:limit };
      return global.console;
    }
  }(global.console && typeof global.console.scrollback === 'number'?
    global.console.scrollback : 10
  ));
}));<commit_msg>Refactoring: easy peasy to read<commit_after>/**
 * @author <NAME> <<EMAIL>>
 * @see https://github.com/adriancmiranda/console.js
 * @version 1.1.0
 */
(function(global, factory){
  'use strict';

  if(typeof module === 'object' && typeof module.exports === 'object'){
    module.exports = factory(global, true);
  }else{
    global.trace = factory(global).log;
  }

}(typeof window !== 'undefined' ? window : this, function(global, nodeEnv){
  'use strict';

  var debug = !nodeEnv && /\bdebug\b/i.test(global.location.href);
  var slice = Array.prototype.slice;

  function trace(console, outputFn, method){
    console[method] = function(){
      if(!console.enabled) return void(0);
      var args = slice.call(arguments);
      if(console.history.length >= console.scrollback){
        console.history.shift();
      }
      console.history.push({ type:method, message:args });
      return outputFn.apply(console, args);
    };
  }

  function Logger(console){
    var ctor = function(){};
    console.enabled = debug || console.enabled;
    for(var methods = 'assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,timeStamp,profile,profileEnd,time,timeEnd,trace,warn,log'.split(','), method; method = methods.pop();){
      trace(console, console[method] || ctor, method);
    }
    return console;
  }

  function getConsole(limit){
    try{
      console.log();
      global.console.history = [];
      global.console.scrollback = limit;
      return global.console;
    }catch(error){
      global.console = { history:[], scrollback:limit };
      return global.console;
    }
  }

  return Logger(getConsole(global.console && typeof global.console.scrollback === 'number'?
    global.console.scrollback : 1
  ));
}));
{'fraction_non_alphanumeric': 0.16349480968858132, 'fraction_numerical': 0.0031718569780853517, 'mean_word_length': 3.6253333333333333, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1100066', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1051, 'n_words': 209}