<commit_before>// Generated by CoffeeScript 1.6.3
(function() {
  var HOST, apiRequest, fontello, fs, needle, open, path, print, unzip;

  fs = require('fs');

  needle = require('needle');

  open = require('open');

  print = require('util').print;

  path = require('path');

  unzip = require('unzip');

  HOST = 'http://fontello.com';

  apiRequest = function(options, successCallback, errorCallback) {
    var data, requestOptions;
    if (options.host == null) {
      options.host = HOST;
    }
    requestOptions = {
      multipart: true
    };
    if (options.proxy != null) {
      requestOptions.proxy = options.proxy;
    }
    data = {
      config: {
        file: options.config,
        content_type: 'application/json'
      }
    };
    return needle.post(options.host, data, requestOptions, function(error, response, body) {
      var sessionId, sessionUrl;
      if (error) {
        throw error;
      }
      sessionId = body;
      if (response.statusCode === 200) {
        sessionUrl = "" + options.host + "/" + sessionId;
        return typeof successCallback === "function" ? successCallback(sessionUrl) : void 0;
      } else {
        return typeof errorCallback === "function" ? errorCallback(response) : void 0;
      }
    });
  };

  fontello = {
    install: function(options) {
      return apiRequest(options, function(sessionUrl) {
        var requestOptions, zipFile;
        requestOptions = {};
        if (options.proxy != null) {
          requestOptions.proxy = options.proxy;
        }
        zipFile = needle.get("" + sessionUrl + "/get", requestOptions, function(error, response, body) {
          if (error) {
            throw error;
          }
        });
        if (options.css && options.font) {
          return zipFile.pipe(unzip.Parse()).on('entry', (function(entry) {
            var cssPath, dirName, fileName, fontPath, pathName, type, _ref;
            pathName = entry.path, type = entry.type;
            if (type === 'File') {
              dirName = (_ref = path.dirname(pathName).match(/\/([^\/]*)$/)) != null ? _ref[1] : void 0;
              fileName = path.basename(pathName);
              switch (dirName) {
                case 'css':
                  cssPath = path.join(options.css, fileName);
                  return entry.pipe(fs.createWriteStream(cssPath));
                case 'font':
                  fontPath = path.join(options.font, fileName);
                  return entry.pipe(fs.createWriteStream(fontPath));
                default:
                  return entry.autodrain();
              }
            }
          })).on('finish', (function() {<commit_msg>Follow keep alive requests on install<commit_after>// Generated by CoffeeScript 1.6.3
(function() {
  var HOST, apiRequest, fontello, fs, needle, open, path, print, unzip;

  fs = require('fs');

  needle = require('needle');

  open = require('open');

  print = require('util').print;

  path = require('path');

  unzip = require('unzip');

  HOST = 'http://fontello.com';

  apiRequest = function(options, successCallback, errorCallback) {
    var data, requestOptions;
    if (options.host == null) {
      options.host = HOST;
    }
    requestOptions = {
      multipart: true
    };
    if (options.proxy != null) {
      requestOptions.proxy = options.proxy;
    }
    data = {
      config: {
        file: options.config,
        content_type: 'application/json'
      }
    };
    return needle.post(options.host, data, requestOptions, function(error, response, body) {
      var sessionId, sessionUrl;
      if (error) {
        throw error;
      }
      sessionId = body;
      if (response.statusCode === 200) {
        sessionUrl = "" + options.host + "/" + sessionId;
        return typeof successCallback === "function" ? successCallback(sessionUrl) : void 0;
      } else {
        return typeof errorCallback === "function" ? errorCallback(response) : void 0;
      }
    });
  };

  fontello = {
    install: function(options) {
      return apiRequest(options, function(sessionUrl) {
        var requestOptions, zipFile;
        requestOptions = {
          follow: 10
        };
        if (options.proxy != null) {
          requestOptions.proxy = options.proxy;
        }
        zipFile = needle.get("" + sessionUrl + "/get", requestOptions, function(error, response, body) {
          if (error) {
            throw error;
          }
        });
        if (options.css && options.font) {
          return zipFile.pipe(unzip.Parse()).on('entry', (function(entry) {
            var cssPath, dirName, fileName, fontPath, pathName, type, _ref;
            pathName = entry.path, type = entry.type;
            if (type === 'File') {
              dirName = (_ref = path.dirname(pathName).match(/\/([^\/]*)$/)) != null ? _ref[1] : void 0;
              fileName = path.basename(pathName);
              switch (dirName) {
                case 'css':
                  cssPath = path.join(options.css, fileName);
                  return entry.pipe(fs.createWriteStream(cssPath));
                case 'font':
                  fontPath = path.join(options.font, fileName);
                  return entry.pipe(fs.createWriteStream(fontPath));
                default:
                  return entry.autodrain();
              }
            }
          })).on('finish', (function() {
{'fraction_non_alphanumeric': 0.1368047779022023, 'fraction_numerical': 0.004106009705113848, 'mean_word_length': 2.0293951384963256, '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': '714094', 'n_tokens_mistral': 1544, 'n_tokens_neox': 1497, 'n_words': 349}