<commit_before>/*
 * DOM MONSTER
 * Copyright (c) 2009-2011 <NAME> & <NAME>
 * This code is licensed under the terms of the MIT LICENSE
 * http://mir.aculo.us/dom-monster
 */
 if(!('JR' in window)) JR = { Version: '1.2' };

 JR._lines = { info:[], tip:[], warn:[] };
 JR._firebug = ('console' in window && 'firebug' in console);

 JR.reset = " margin:0;padding:0;border:0;outline:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align: baseline;color:inherit;line-height:inherit;";

 JR.close = function(){
   var results = document.getElementById('jr_results_tips');
   results.parentNode.removeChild(results);
 };

 JR.flush = function(string){
   var results = document.getElementById('jr_results_tips'), 
     html = '<div style="'+JR.reset+';margin-left:230px;padding-top:4px">';
   function flushArray(array){
     for(var i=0;i<array.length;i++)
       html += '<div style="'+JR.reset+'margin:0 0 4px 0;padding:4px 0px 0px 0px;font-size:11px">' + array[i] + '</div>';
   }
   var prognosis = document.getElementById("jr_results_prognosis"), 
     container = document.getElementById("jr_results_prognosis_container"),
     warnings = JR._lines.warn.length;
   if(warnings>0) {
     if(warnings>2) {
       container.style.cssText += ';color:#A02523';
       prognosis.innerHTML = 'whoa, potentially huge issues';
       document.getElementById('jr_results_warnings').innerHTML = JR._lines.warn.length + ' warnings indicate app ill-health';
     } else {
       container.style.cssText += ';color:#E8871D';
       prognosis.innerHTML = 'room for improvement';
       document.getElementById('jr_results_warnings').innerHTML = JR._lines.warn.length + ' warning' + (warnings==1?'':'s');
     }
     document.getElementById('jr_results_warnings_container').style.cssText += ';display:inline';
   } else {
     container.style.cssText += ';color:#40a40F';
     prognosis.innerHTML = 'yay! you\'re doing a great job!';
     document.getElementById('jr_results_warnings_container').style.cssText += ';display:none';
   }

   flushArray(JR._lines.warn);    
   flushArray(JR._lines.tip);
   flushArray(JR._lines.info);  
   html += '</div>';
   results.innerHTML += html;

   document.getElementById('jr_stats').innerHTML = JR.statsHTML;
 };

 JR.log = function(string, hint, type){
   type = type || 'tip';
   hint = hint || '';
   var color = { info: '888', tip:'88f', warn:'efb000' }[type];
   JR._lines[type].push(
     '<div style="'+JR.reset+'text-transform:uppercase;font-size:10px;border:1px solid #'+color+';width:32px;color:#'+color+';-webkit-border-radius:5px;padding:1px;float:left;text-align:center;margin:-2px 4px 0px 0px">'+type+'</div> '+
     '<strong>'+string+'</strong> '+hint);
 };
 JR.tip =  function(string, hint){ JR.log(string,hint,'tip'); };
 JR.info = function(string, hint){ JR.log(string,hint,'info'); };
 JR.warn = function(string, hint){ JR.log(string,hint,'warn'); };

 JR.time = function(scope){
   JR.time.scope = JR.time.scope || {};
   if(JR.time.scope[scope]) {
     var duration = (new Date()).getTime()-JR.time.scope[scope];
     JR.time.scope[scope] = null;
     return duration/1000;
   } else {
     JR.time.scope[scope] = (new Date()).getTime();
     return null;
   }
 };

 JR.benchmark = function(method, times, scope){
   var i = times || 1000;
   JR.time(scope||'benchmark');
   while(i--) method();
   return JR.time(scope||'benchmark')/times;
 };

 JR.scriptTagsTips = function(){
   var nodes = document.getElementsByTagName('script'),
     head = document.getElementsByTagName('head')[0];

   var count = 0, headcount = 0, i = nodes.length, sources = [];
   while(i--){
     if(nodes[i].src && nodes[i].src !== ''){
       if(nodes[i].src.indexOf('dommonster.js') === -1 && nodes[i].src.indexOf('google-analytics.com/ga.js') === -1){
         if(nodes[i].parentNode === head){
            headcount = headcount + 1;<commit_msg>Use `document.head` if it’s available.<commit_after>/*
 * DOM MONSTER
 * Copyright (c) 2009-2011 <NAME> & <NAME>
 * This code is licensed under the terms of the MIT LICENSE
 * http://mir.aculo.us/dom-monster
 */
 if(!('JR' in window)) JR = { Version: '1.2' };

 JR._lines = { info:[], tip:[], warn:[] };
 JR._firebug = ('console' in window && 'firebug' in console);

 JR.reset = " margin:0;padding:0;border:0;outline:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align: baseline;color:inherit;line-height:inherit;";

 JR.close = function(){
   var results = document.getElementById('jr_results_tips');
   results.parentNode.removeChild(results);
 };

 JR.flush = function(string){
   var results = document.getElementById('jr_results_tips'), 
     html = '<div style="'+JR.reset+';margin-left:230px;padding-top:4px">';
   function flushArray(array){
     for(var i=0;i<array.length;i++)
       html += '<div style="'+JR.reset+'margin:0 0 4px 0;padding:4px 0px 0px 0px;font-size:11px">' + array[i] + '</div>';
   }
   var prognosis = document.getElementById("jr_results_prognosis"), 
     container = document.getElementById("jr_results_prognosis_container"),
     warnings = JR._lines.warn.length;
   if(warnings>0) {
     if(warnings>2) {
       container.style.cssText += ';color:#A02523';
       prognosis.innerHTML = 'whoa, potentially huge issues';
       document.getElementById('jr_results_warnings').innerHTML = JR._lines.warn.length + ' warnings indicate app ill-health';
     } else {
       container.style.cssText += ';color:#E8871D';
       prognosis.innerHTML = 'room for improvement';
       document.getElementById('jr_results_warnings').innerHTML = JR._lines.warn.length + ' warning' + (warnings==1?'':'s');
     }
     document.getElementById('jr_results_warnings_container').style.cssText += ';display:inline';
   } else {
     container.style.cssText += ';color:#40a40F';
     prognosis.innerHTML = 'yay! you\'re doing a great job!';
     document.getElementById('jr_results_warnings_container').style.cssText += ';display:none';
   }

   flushArray(JR._lines.warn);    
   flushArray(JR._lines.tip);
   flushArray(JR._lines.info);  
   html += '</div>';
   results.innerHTML += html;

   document.getElementById('jr_stats').innerHTML = JR.statsHTML;
 };

 JR.log = function(string, hint, type){
   type = type || 'tip';
   hint = hint || '';
   var color = { info: '888', tip:'88f', warn:'efb000' }[type];
   JR._lines[type].push(
     '<div style="'+JR.reset+'text-transform:uppercase;font-size:10px;border:1px solid #'+color+';width:32px;color:#'+color+';-webkit-border-radius:5px;padding:1px;float:left;text-align:center;margin:-2px 4px 0px 0px">'+type+'</div> '+
     '<strong>'+string+'</strong> '+hint);
 };
 JR.tip =  function(string, hint){ JR.log(string,hint,'tip'); };
 JR.info = function(string, hint){ JR.log(string,hint,'info'); };
 JR.warn = function(string, hint){ JR.log(string,hint,'warn'); };

 JR.time = function(scope){
   JR.time.scope = JR.time.scope || {};
   if(JR.time.scope[scope]) {
     var duration = (new Date()).getTime()-JR.time.scope[scope];
     JR.time.scope[scope] = null;
     return duration/1000;
   } else {
     JR.time.scope[scope] = (new Date()).getTime();
     return null;
   }
 };

 JR.benchmark = function(method, times, scope){
   var i = times || 1000;
   JR.time(scope||'benchmark');
   while(i--) method();
   return JR.time(scope||'benchmark')/times;
 };

 JR.scriptTagsTips = function(){
   var nodes = document.getElementsByTagName('script'),
     head = document.head || document.getElementsByTagName('head')[0];

   var count = 0, headcount = 0, i = nodes.length, sources = [];
   while(i--){
     if(nodes[i].src && nodes[i].src !== ''){
       if(nodes[i].src.indexOf('dommonster.js') === -1 && nodes[i].src.indexOf('google-analytics.com/ga.js') === -1){
         if(nodes[i].parentNode === head){
            headcount = headcount + 1;
{'fraction_non_alphanumeric': 0.19043986778540553, 'fraction_numerical': 0.020594965675057208, 'mean_word_length': 4.055912596401028, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 27, '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': '5032583', 'n_tokens_mistral': 2809, 'n_tokens_neox': 2619, 'n_words': 448}