<commit_before>
/*
 *
 * poloniex-unofficial
 * https://git.io/polonode
 *
 * Yet another unofficial Node.js wrapper for the Poloniex cryptocurrency
 * exchange APIs.
 *
 * Copyright (c) 2016 <NAME>
 *
 * This software may be modified and distributed under the terms of the MIT
 * license. See the LICENSE file for details.
 *
 */

// Import modules
const autobahn = require("autobahn");

// Poloniex push API websocket URL and WAMP realm
const POLONIEX_PUSH_URL = "wss://api.poloniex.com";
const POLONIEX_PUSH_REALM = "realm1";

// Interval (in ms) for testing openness of a session after a connection has been established
const SESSION_WAIT_TEST_INTERVAL = 250;

// Number of tries to wait for openness of a session
const SESSION_WAIT_TEST_LIMIT = 4;

/*
 * Push API wrapper constructor.
 */
function PushWrapper() {
    // Autobahn|JS connection object for push API (utilizes the WAMP protocol)
    this._connection = new autobahn.connection({
        "url": POLONIEX_PUSH_URL,
        "realm": POLONIEX_PUSH_REALM
    });

    // Internally-routed callback sets for connection management events
    this._cxnCallbacksOpen = new Array();
    this._cxnCallbacksClose = new Array();

    // Internal lookup table for linking subscriptions to callbacks
    this._subLinks = {};
    this._subLinksId = 0;

    // Number of currently active subscriptions
    this._activeSubs = 0;

    // Handle connection open event
    this._connection.onopen = (session) => {
        // Loop through all open callbacks
        for (var i = 0; i < this._cxnCallbacksOpen.length; i++) {
            this._cxnCallbacksOpen[i](session);
        }
    };

    // Handle connection close event
    this._connection.onclose = (reason, details) => {
        // Loop through all close callbacks
        for (var i = 0; i < this._cxnCallbacksClose.length; i++) {
            this._cxnCallbacksClose[i](reason, details);<commit_msg>Capitalize connection class<commit_after>
/*
 *
 * poloniex-unofficial
 * https://git.io/polonode
 *
 * Yet another unofficial Node.js wrapper for the Poloniex cryptocurrency
 * exchange APIs.
 *
 * Copyright (c) 2016 <NAME>
 *
 * This software may be modified and distributed under the terms of the MIT
 * license. See the LICENSE file for details.
 *
 */

// Import modules
const autobahn = require("autobahn");

// Poloniex push API websocket URL and WAMP realm
const POLONIEX_PUSH_URL = "wss://api.poloniex.com";
const POLONIEX_PUSH_REALM = "realm1";

// Interval (in ms) for testing openness of a session after a connection has been established
const SESSION_WAIT_TEST_INTERVAL = 250;

// Number of tries to wait for openness of a session
const SESSION_WAIT_TEST_LIMIT = 4;

/*
 * Push API wrapper constructor.
 */
function PushWrapper() {
    // Autobahn|JS connection object for push API (utilizes the WAMP protocol)
    this._connection = new autobahn.Connection({
        "url": POLONIEX_PUSH_URL,
        "realm": POLONIEX_PUSH_REALM
    });

    // Internally-routed callback sets for connection management events
    this._cxnCallbacksOpen = new Array();
    this._cxnCallbacksClose = new Array();

    // Internal lookup table for linking subscriptions to callbacks
    this._subLinks = {};
    this._subLinksId = 0;

    // Number of currently active subscriptions
    this._activeSubs = 0;

    // Handle connection open event
    this._connection.onopen = (session) => {
        // Loop through all open callbacks
        for (var i = 0; i < this._cxnCallbacksOpen.length; i++) {
            this._cxnCallbacksOpen[i](session);
        }
    };

    // Handle connection close event
    this._connection.onclose = (reason, details) => {
        // Loop through all close callbacks
        for (var i = 0; i < this._cxnCallbacksClose.length; i++) {
            this._cxnCallbacksClose[i](reason, details);
{'fraction_non_alphanumeric': 0.09722948248823837, 'fraction_numerical': 0.006795608991113434, 'mean_word_length': 3.0843116328708646, 'pattern_counts': {'":': 4, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '1320831', 'n_tokens_mistral': 1187, 'n_tokens_neox': 1126, 'n_words': 365}