<commit_before>'use strict';

var isString = require('lodash.isstring');
var isFunction = require('lodash.isfunction');

function Instantly(channel, opts) {
    if (!channel) {
        throw new TypeError('You need to provide a channel we can listen to!');
    } else {
        this.channel = channel;
    }

    if (!opts) {
        opts = {};
    }

    this.retries = opts.retries || 5;
    this.timeout = opts.timeout || 15000;

    if (opts.closeConnNotFocus) {
        document.addEventListener('visibilitychange', this.onVisibilityChange.bind(this));
    }

    if (isFunction(opts.error)) {
        this.errorHandler = opts.error;
    }

    this.initialized = false;
    this.callbacks = {};
}

Instantly.prototype = {
    internalRetry: 0,

    on: function(event, callback) {
        if (!isFunction(callback)) {<commit_msg>move properties from constructor to prototype<commit_after>'use strict';

var isString = require('lodash.isstring');
var isFunction = require('lodash.isfunction');

function Instantly(channel, opts) {
    if (!channel) {
        throw new TypeError('You need to provide a channel we can listen to!');
    } else {
        this.channel = channel;
    }

    if (!opts) {
        opts = {};
    }

    this.retries = opts.retries || 5;
    this.timeout = opts.timeout || 15000;

    if (opts.closeConnNotFocus) {
        document.addEventListener('visibilitychange', this.onVisibilityChange.bind(this));
    }

    if (isFunction(opts.error)) {
        this.errorHandler = opts.error;
    }
}

Instantly.prototype = {
    initialized: false,

    callbacks: {},

    internalRetry: 0,

    on: function(event, callback) {
        if (!isFunction(callback)) {
{'fraction_non_alphanumeric': 0.13246599645180368, 'fraction_numerical': 0.00827912477823773, 'mean_word_length': 2.854214123006834, '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': '5239759', 'n_tokens_mistral': 527, 'n_tokens_neox': 501, 'n_words': 117}