<commit_before>storage = new function()
{
  var setCookie =function(name, value, time)
  {
    document.cookie = name + "="+
      encodeURIComponent(value)+
      "; expires="+(new Date(new Date().getTime()+time)).toGMTString()+
      "; path=/";
  }

  var getCookie = function(name)
  {
    var match = null;
	  if( match = new RegExp(name+'\=([^;]*);','').exec(document.cookie+';') )
    {
      return decodeURIComponent(match[1]);
    }
	  return null;
  }

  var storage = {};<commit_msg>storage with cookies and json<commit_after>storage = new function()
{
  var setCookie =function(name, value, time)
  {
    document.cookie = name + "="+
      encodeURIComponent(value)+
      "; expires="+(new Date(new Date().getTime()+ ( time || 360 * 24 * 60 * 60 * 1000 ))).toGMTString()+
      "; path=/";
  }

  var getCookie = function(name)
  {
    var match = null;
	  if( match = new RegExp(name+'\=([^;]*);','').exec(document.cookie+';') )
    {
      return decodeURIComponent(match[1]);
    }
	  return null;
  }
  
  this.set = function(key, value)
  {
    setCookie(key, JSON.stringify(value))
  }
  
  this.get = function(key, default_value)
  {
    var val = getCookie(key);
    if(val)
    {
      // this can be false;
      return JSON.parse(val);
    }
    return default_value;
  }
  
  var storage = {};
{'fraction_non_alphanumeric': 0.1803030303030303, 'fraction_numerical': 0.011363636363636364, 'mean_word_length': 2.8179190751445087, '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': '6411052', 'n_tokens_mistral': 472, 'n_tokens_neox': 457, 'n_words': 93}