<commit_before>'use strict';
const request          = require('../comum/tago_request.js');
const config           = require('../config.js');
const default_headers  = require('../comum/default_headers.js');

class Plan {
  constructor(acc_token) {
    this.token = acc_token;
    this.default_options = {
      'json':    true,
      'headers': default_headers(this)
    };
  }

  /** Activate a plan
  * @param  {JSON} data
  * @argument {*String} data.plan the id of the plan to be activated
  * @return {Promise}
  */
  activate(data) {
    data       = data || {};
    const url    = `${config.api_url}/account/plan`;
    const method = 'POST';

    const options = Object.assign({}, this.default_options, {url, method, data});
    return request(options);
  }
}

module.exports = Plan;<commit_msg>Created the route to get plan changing charges<commit_after>'use strict';
const request          = require('../comum/tago_request.js');
const config           = require('../config.js');
const default_headers  = require('../comum/default_headers.js');
const paramsSerializer = require('../comum/paramsSerializer');

class Plan {
  constructor(acc_token) {
    this.token = acc_token;
    this.default_options = {
      'json':    true,
      'headers': default_headers(this)
    };
  }

  /** Activate a plan
  * @param  {JSON} data
  * @argument {*String} data.plan the id of the plan to be activated
  * @return {Promise}
  */
  activate(data) {
    data       = data || {};
    const url    = `${config.api_url}/account/plan`;
    const method = 'POST';

    const options = Object.assign({}, this.default_options, {url, method, data});
    return request(options);
  }
  
  /** Activate a plan
  * @param  {*String} plan_id
  * @return {Promise}
  */
  getCurrentValue(plan_id) {
    const url    = `${config.api_url}/account/plan_value`;
    const method = 'GET';

    const options = Object.assign({}, this.default_options, {
      url,
      method,
      paramsSerializer,
      params: {
        id: plan_id,
      },
    });
    return request(options);
  }
}

module.exports = Plan;
{'fraction_non_alphanumeric': 0.15002388915432394, 'fraction_numerical': 0.0, 'mean_word_length': 2.7594254937163374, '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': '5125409', 'n_tokens_mistral': 658, 'n_tokens_neox': 654, 'n_words': 156}