<commit_before><commit_msg>add jnorthpole lib<commit_after>// Generated by CoffeeScript 1.10.0
window.jNorthPole = {
  BASE_URL: '/',
  help: "NorthPole JS wrapper example usage:\n\nresponseHandler = function (data) {\n  console.log(data);\n};\n\njNorthPole.BASE_URL = '/';\njNorthPole.getStorage(json, responseHandler);",
  genericRequest: function(jsonObj, method, endPoint, responseHandler, errorHandler) {
    var r;
    if (errorHandler == null) {
      errorHandler = responseHandler;
    }
    if (responseHandler == null) {
      throw 'responseHandler function missing';
    }
    r = new XMLHttpRequest;
    r.open(method, "" + this.BASE_URL + endPoint + ".json", true);
    r.onreadystatechange = function() {
      var err, error;
      if (r.readyState !== 4) {
        return;
      }
      if (r.status === 200) {
        responseHandler(JSON.parse(r.responseText), r.status);
      } else {
        try {
          errorHandler(JSON.parse(r.responseText), r.status);
        } catch (error) {
          err = error;
          errorHandler(r.responseText, r.status);
        }
      }
    };
    r.send(JSON.stringify(jsonObj));
  },
  createUser: function(api_key, secret, success, failure) {
    var jsonObj;
    jsonObj = {
      'api_key': api_key,
      'secret': secret
    };
    this.genericRequest(jsonObj, 'POST', 'user', success, failure);
  },
  getUser: function(jsonObj, responseHandler, errorHandler) {
    this.genericRequest(jsonObj, 'SEARCH', 'user', responseHandler, errorHandler);
  },
  createStorage: function(jsonObj, responseHandler, errorHandler) {
    this.genericRequest(jsonObj, 'POST', 'storage', responseHandler, errorHandler);
  },
  getStorage: function(jsonObj, responseHandler, errorHandler) {
    this.genericRequest(jsonObj, 'SEARCH', 'storage', responseHandler, errorHandler);
  },
  putStorage: function(jsonObj, responseHandler, errorHandler) {
    this.genericRequest(jsonObj, 'PUT', 'storage', responseHandler, errorHandler);
  },
  deleteStorage: function(jsonObj, responseHandler, errorHandler) {
    this.genericRequest(jsonObj, 'DELETE', 'storage', responseHandler, errorHandler);
  }
};
{'fraction_non_alphanumeric': 0.13833255705635772, 'fraction_numerical': 0.0037261294829995344, 'mean_word_length': 3.6193548387096772, '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': '7634530', 'n_tokens_mistral': 665, 'n_tokens_neox': 646, 'n_words': 136}