<commit_before>const request = require('request');
/**
 * 获取一个request对象，用于请求接口
 * 基于node-request模块
 * @param  {[type]} options request配置
 * @return {[type]}         request实例对象
 */
function getRequest(options = {}) {
  const defaults = {
    'headers': {},
    'cert': null,
    'strictSSL': false,
    'timeout': 10 * 1000, // milliseconds 2秒
    'json': true
  };

  Object.assign(defaults, options);

  return request.defaults(defaults);
}

module.exports = getRequest;
<commit_msg>update 修订请求库<commit_after>const request = require('request');
/**
 * 获取一个request对象，用于请求接口
 * 基于node-request模块
 * @param  {[type]} options request配置
 * @return {[type]}         request实例对象
 */
function getRequest(options = {}) {
  const defaults = {
    'headers': {},
    'cert': null,
    'strictSSL': false,
    'timeout': 10 * 1000, // milliseconds 2秒
    'json': true
  };

  Object.assign(defaults, options);

  return request.defaults(defaults);
}

getRequest.methods = ['get', 'post', 'put', 'delete'].map(method => {
  getRequest[method] = (options, complete) => getRequest()[method](options, complete);
  return method;
});

module.exports = getRequest;

{'fraction_non_alphanumeric': 0.16898954703832753, 'fraction_numerical': 0.012195121951219513, 'mean_word_length': 3.848101265822785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2080958', 'n_tokens_mistral': 401, 'n_tokens_neox': 395, 'n_words': 81}