<commit_before>/*
    Heavily inspired by the original js library copyright Mixpanel, Inc.
    (http://mixpanel.com/)

    Copyright (c) 2012 <NAME>

    Released under the MIT license.
*/

var http            = require('http'),
    https           = require('https'),
    querystring     = require('querystring'),
    Buffer          = require('buffer').Buffer,
    util            = require('util'),
    HttpsProxyAgent = require('https-proxy-agent');

var REQUEST_LIBS = {
    http: http,
    https: https
};

var create_proxy_agent = function() {
    var proxyPath = process.env.HTTPS_PROXY || process.env.HTTP_PROXY;

    if (proxyPath) {
        return new HttpsProxyAgent(proxyPath);
    }

    return;
}

var create_client = function(token, config) {
    var metrics = {};
    var proxyAgent = create_proxy_agent();

    // mixpanel constants
    var MAX_BATCH_SIZE = 50,
        TRACK_AGE_LIMIT = 60 * 60 * 24 * 5;

    if(!token) {
        throw new Error("The Mixpanel Client needs a Mixpanel token: `init(token)`");
    }<commit_msg>don't rely on implicit undefined return in create_proxy_agent<commit_after>/*
    Heavily inspired by the original js library copyright Mixpanel, Inc.
    (http://mixpanel.com/)

    Copyright (c) 2012 <NAME>

    Released under the MIT license.
*/

var http            = require('http'),
    https           = require('https'),
    querystring     = require('querystring'),
    Buffer          = require('buffer').Buffer,
    util            = require('util'),
    HttpsProxyAgent = require('https-proxy-agent');

var REQUEST_LIBS = {
    http: http,
    https: https
};

var create_proxy_agent = function() {
    var proxyPath = process.env.HTTPS_PROXY || process.env.HTTP_PROXY;
    return proxyPath ? new HttpsProxyAgent(proxyPath) : null;
}

var create_client = function(token, config) {
    var metrics = {};
    var proxyAgent = create_proxy_agent();

    // mixpanel constants
    var MAX_BATCH_SIZE = 50,
        TRACK_AGE_LIMIT = 60 * 60 * 24 * 5;

    if(!token) {
        throw new Error("The Mixpanel Client needs a Mixpanel token: `init(token)`");
    }
{'fraction_non_alphanumeric': 0.11742424242424243, 'fraction_numerical': 0.01231060606060606, 'mean_word_length': 2.68760907504363, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5407701', 'n_tokens_mistral': 673, 'n_tokens_neox': 634, 'n_words': 172}