<commit_before>'use strict';
/**
 * @name Request
 * @description provides all of the various request functions and all handeling to go with them.
 */

const request = require('request');


/**
 * @class
 */
class CivoRequest {
  /**
   * @constructor
   * @param {String} apiToken the provided api token from your civo account
   * @param {String} [endpoint='https://api.civo.com/v2'] An optional end point
   */
  constructor(apiToken = '', endpoint = 'https://api.civo.com/v2') {
    this.apiToken = apiToken;
    this.endpoint = endpoint;
    if (this.apiToken === '') {
      throw new Error('invalid civo API key');
    }
  }

  /**
   * @method CivoRequest~handleResponse
   * @desc handles the responses from the civo API
   * @param {Function} resolve a promise resolve callback
   * @param {Function} reject a promise reject callback
   */
  handleResponse(resolve, reject) {
    return (err, res, body) => {
      if (err) {
        reject(err);
      } else {<commit_msg>moved fallback out of argument list into parameter reassignment for node 4/5<commit_after>'use strict';
/**
 * @name Request
 * @description provides all of the various request functions and all handeling to go with them.
 */

const request = require('request');


/**
 * @class
 */
class CivoRequest {
  /**
   * @constructor
   * @param {String} apiToken the provided api token from your civo account
   * @param {String} [endpoint='https://api.civo.com/v2'] An optional end point
   */
  constructor(apiToken, endpoint) {
    this.apiToken = apiToken || '';
    this.endpoint = endpoint || 'https://api.civo.com/v2';
    if (this.apiToken === '') {
      throw new Error('invalid civo API key');
    }
  }

  /**
   * @method CivoRequest~handleResponse
   * @desc handles the responses from the civo API
   * @param {Function} resolve a promise resolve callback
   * @param {Function} reject a promise reject callback
   */
  handleResponse(resolve, reject) {
    return (err, res, body) => {
      if (err) {
        reject(err);
      } else {
{'fraction_non_alphanumeric': 0.13047759724273758, 'fraction_numerical': 0.0029542097488921715, 'mean_word_length': 3.0721442885771544, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '1821316', 'n_tokens_mistral': 598, 'n_tokens_neox': 592, 'n_words': 197}