<commit_before>/* global config, $, APP, Strophe, callstats */
var jsSHA = require('jssha');
var io = require('socket.io-client');
var callStats = null;

function initCallback (err, msg) {
    console.log("Initializing Status: err="+err+" msg="+msg);
}

var CallStats = {
    init: function (jingleSession) {

        if(!config.callStatsID || !config.callStatsSecret || callStats !== null)
            return;

        callStats = new callstats($, io, jsSHA);

        this.session = jingleSession;
        this.peerconnection = jingleSession.peerconnection.peerconnection;

        this.userID =  APP.xmpp.myResource();

        var location = window.location;
        this.confID = location.protocol + "//" +
            location.hostname + location.pathname;

        //userID is generated or given by the origin server
        callStats.initialize(config.callStatsID,
            config.callStatsSecret,
            this.userID,
            initCallback);

        var usage = callStats.fabricUsage.multiplex;

        callStats.addNewFabric(this.peerconnection,
            Strophe.getResourceFromJid(jingleSession.peerjid),
            usage,
            this.confID,
            this.pcCallback.bind(this));
    },
    pcCallback: function (err, msg) {
        if (!callStats)
            return;
        console.log("Monitoring status: "+ err + " msg: " + msg);
        callStats.sendFabricEvent(this.peerconnection,
            callStats.fabricEvent.fabricSetup, this.confID);
    },
    sendMuteEvent: function (mute, type) {
        if (!callStats)
            return;
        var event = null;<commit_msg>Removes the protocol from the callstats.io conferenceID.<commit_after>/* global config, $, APP, Strophe, callstats */
var jsSHA = require('jssha');
var io = require('socket.io-client');
var callStats = null;

function initCallback (err, msg) {
    console.log("Initializing Status: err="+err+" msg="+msg);
}

var CallStats = {
    init: function (jingleSession) {

        if(!config.callStatsID || !config.callStatsSecret || callStats !== null)
            return;

        callStats = new callstats($, io, jsSHA);

        this.session = jingleSession;
        this.peerconnection = jingleSession.peerconnection.peerconnection;

        this.userID =  APP.xmpp.myResource();

        var location = window.location;
        this.confID = location.hostname + location.pathname;

        //userID is generated or given by the origin server
        callStats.initialize(config.callStatsID,
            config.callStatsSecret,
            this.userID,
            initCallback);

        var usage = callStats.fabricUsage.multiplex;

        callStats.addNewFabric(this.peerconnection,
            Strophe.getResourceFromJid(jingleSession.peerjid),
            usage,
            this.confID,
            this.pcCallback.bind(this));
    },
    pcCallback: function (err, msg) {
        if (!callStats)
            return;
        console.log("Monitoring status: "+ err + " msg: " + msg);
        callStats.sendFabricEvent(this.peerconnection,
            callStats.fabricEvent.fabricSetup, this.confID);
    },
    sendMuteEvent: function (mute, type) {
        if (!callStats)
            return;
        var event = null;
{'fraction_non_alphanumeric': 0.11327160493827161, 'fraction_numerical': 0.0, 'mean_word_length': 2.418776371308017, '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': '7636209', 'n_tokens_mistral': 932, 'n_tokens_neox': 904, 'n_words': 198}