<commit_before>const getSocketURL              = require('../../config').getSocketURL;
const getAppId                  = require('../../config').getAppId;
const Login                     = require('../base/login').Login;
const objectNotEmpty            = require('../base/utility').objectNotEmpty;
const getPropertyValue          = require('../base/utility').getPropertyValue;
const getLoginToken             = require('../common_functions/common_functions').getLoginToken;
const displayAcctSettings       = require('../common_functions/account_opening').displayAcctSettings;
const SessionDurationLimit      = require('../common_functions/session_duration_limit').SessionDurationLimit;
const checkClientsCountry       = require('../common_functions/country_base').checkClientsCountry;
const Cashier                   = require('./cashier/cashier').Cashier;
const CashierJP                 = require('../../binary_japan/cashier').CashierJP;
const PaymentAgentWithdrawWS    = require('./cashier/payment_agent_withdrawws').PaymentAgentWithdrawWS;
const create_language_drop_down = require('../common_functions/attach_dom/language_dropdown').create_language_drop_down;
const TNCApproval               = require('./user/tnc_approval').TNCApproval;
const ViewPopupWS               = require('./user/view_popup/view_popupws').ViewPopupWS;
const ViewBalanceUI             = require('./user/viewbalance/viewbalance.ui').ViewBalanceUI;
const Cookies                   = require('../../lib/js-cookie');
const State                     = require('../base/storage').State;
const Highchart                 = require('./trade/charts/highchartws').Highchart;
const WSTickDisplay             = require('./trade/tick_trade').WSTickDisplay;
const TradePage                 = require('./trade/tradepage').TradePage;
const Notifications             = require('./trade/notifications').Notifications;
const TradePage_Beta            = require('./trade/beta/tradepage').TradePage_Beta;
const reloadPage                = require('./trade/common').reloadPage;
const MBTradePage               = require('./mb_trade/mb_tradepage').MBTradePage;
const RealityCheck              = require('./user/reality_check/reality_check.init').RealityCheck;
const RealityCheckData          = require('./user/reality_check/reality_check.data').RealityCheckData;
const localize         = require('../base/localize').localize;
const getLanguage      = require('../base/language').getLanguage;
const validate_loginid = require('../base/client').validate_loginid;
const GTM        = require('../base/gtm').GTM;
const Clock      = require('../base/clock').Clock;
const Header     = require('../base/header').Header;
const LocalStore = require('../base/storage').LocalStore;
const Client     = require('../base/client').Client;
const page       = require('../base/page').page;
const check_risk_classification       = require('../common_functions/check_risk_classification').check_risk_classification;
const qualify_for_risk_classification = require('../common_functions/check_risk_classification').qualify_for_risk_classification;

/*
 * It provides a abstraction layer over native javascript Websocket.
 *
 * Provide additional functionality like if connection is close, open
 * it again and process the buffered requests
 *
 *
 * Usage:
 *
 * `BinarySocket.init()` to initiate the connection
 * `BinarySocket.send({contracts_for : 1})` to send message to server
 */
const BinarySocketClass = function() {
    'use strict';

    let binarySocket,
        bufferedSends = [],
        manualClosed = false,
        events = {},
        authorized = false,
        req_number = 0,
        req_id     = 0,
        wrongAppId = 0;

    const timeouts  = {};
    const socketUrl = getSocketURL() + '?app_id=' + getAppId() + '&l=' + getLanguage();
    const promises  = {};
    const no_duplicate_requests = [
        'authorize',
        'get_settings',
    ];
    const waiting_list = {
        items: {},<commit_msg>add residence list to no duplicated calls<commit_after>const getSocketURL              = require('../../config').getSocketURL;
const getAppId                  = require('../../config').getAppId;
const Login                     = require('../base/login').Login;
const objectNotEmpty            = require('../base/utility').objectNotEmpty;
const getPropertyValue          = require('../base/utility').getPropertyValue;
const getLoginToken             = require('../common_functions/common_functions').getLoginToken;
const displayAcctSettings       = require('../common_functions/account_opening').displayAcctSettings;
const SessionDurationLimit      = require('../common_functions/session_duration_limit').SessionDurationLimit;
const checkClientsCountry       = require('../common_functions/country_base').checkClientsCountry;
const Cashier                   = require('./cashier/cashier').Cashier;
const CashierJP                 = require('../../binary_japan/cashier').CashierJP;
const PaymentAgentWithdrawWS    = require('./cashier/payment_agent_withdrawws').PaymentAgentWithdrawWS;
const create_language_drop_down = require('../common_functions/attach_dom/language_dropdown').create_language_drop_down;
const TNCApproval               = require('./user/tnc_approval').TNCApproval;
const ViewPopupWS               = require('./user/view_popup/view_popupws').ViewPopupWS;
const ViewBalanceUI             = require('./user/viewbalance/viewbalance.ui').ViewBalanceUI;
const Cookies                   = require('../../lib/js-cookie');
const State                     = require('../base/storage').State;
const Highchart                 = require('./trade/charts/highchartws').Highchart;
const WSTickDisplay             = require('./trade/tick_trade').WSTickDisplay;
const TradePage                 = require('./trade/tradepage').TradePage;
const Notifications             = require('./trade/notifications').Notifications;
const TradePage_Beta            = require('./trade/beta/tradepage').TradePage_Beta;
const reloadPage                = require('./trade/common').reloadPage;
const MBTradePage               = require('./mb_trade/mb_tradepage').MBTradePage;
const RealityCheck              = require('./user/reality_check/reality_check.init').RealityCheck;
const RealityCheckData          = require('./user/reality_check/reality_check.data').RealityCheckData;
const localize         = require('../base/localize').localize;
const getLanguage      = require('../base/language').getLanguage;
const validate_loginid = require('../base/client').validate_loginid;
const GTM        = require('../base/gtm').GTM;
const Clock      = require('../base/clock').Clock;
const Header     = require('../base/header').Header;
const LocalStore = require('../base/storage').LocalStore;
const Client     = require('../base/client').Client;
const page       = require('../base/page').page;
const check_risk_classification       = require('../common_functions/check_risk_classification').check_risk_classification;
const qualify_for_risk_classification = require('../common_functions/check_risk_classification').qualify_for_risk_classification;

/*
 * It provides a abstraction layer over native javascript Websocket.
 *
 * Provide additional functionality like if connection is close, open
 * it again and process the buffered requests
 *
 *
 * Usage:
 *
 * `BinarySocket.init()` to initiate the connection
 * `BinarySocket.send({contracts_for : 1})` to send message to server
 */
const BinarySocketClass = function() {
    'use strict';

    let binarySocket,
        bufferedSends = [],
        manualClosed = false,
        events = {},
        authorized = false,
        req_number = 0,
        req_id     = 0,
        wrongAppId = 0;

    const timeouts  = {};
    const socketUrl = getSocketURL() + '?app_id=' + getAppId() + '&l=' + getLanguage();
    const promises  = {};
    const no_duplicate_requests = [
        'authorize',
        'get_settings',
        'residence_list',
    ];
    const waiting_list = {
        items: {},
{'fraction_non_alphanumeric': 0.1324561403508772, 'fraction_numerical': 0.0010025062656641604, 'mean_word_length': 3.0595116988809767, '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': '3426685', 'n_tokens_mistral': 2176, 'n_tokens_neox': 2074, 'n_words': 385}