<commit_before>var okcoinExchange = {
        name: 'OKCoin',
        products: {
            quarterlies: 'Quarterlies',
            weeklies: 'Weeklies',
            biWeeklies: 'Bi-Weeklies'
        }
    },
    channelToProduct = {
        this_week: okcoinExchange.products.weeklies,
        next_week: okcoinExchange.products.biWeeklies,
        quarter: okcoinExchange.products.quarterlies
    }

function startOKCoinWebSocket() {
    new OKCoin()
        .setChannels({
            ok_sub_futureusd_btc_index: handleIndex,
            ok_sub_futureusd_btc_trade_this_week: handleTrade,
            ok_sub_futureusd_btc_trade_next_week: handleTrade,
            ok_sub_futureusd_btc_trade_quarter: handleTrade,
            ok_sub_futureusd_btc_ticker_this_week: handleTicker,
            ok_sub_futureusd_btc_ticker_next_week: handleTicker,
            ok_sub_futureusd_btc_ticker_quarter: handleTicker
        })
        .isFutures()
        .start()
}

// Index data
function handleIndex(message) {
    view.updateIndex(okcoinExchange.name, message.data.futureIndex)
}

// Last trade data
function handleTrade(message) {
    message.data.forEach(function (trade) {
        view.update(okcoinExchange.name, getProduct(message.channel), 'price', parseFloat(trade[1]))
    })
}

// Volume data
function handleTicker(message) {
    var volume = parseFloat(message.data.vol) / 10 // in k$
    view.updateVolume(okcoinExchange.name, getProduct(message.channel), volume)
}

function getProduct(channel) {

    var product
    forEach(channelToProduct, function (key, value) {
        if (channel.match(new RegExp(key))) {
            product = value
        }
    })

    if (product !== undefined) {
        return product
    }
    else {
        console.log('Unknown channel: ' + channel)
    }
}
<commit_msg>Changed OKEX futures order.<commit_after>var okcoinExchange = {
        name: 'OKCoin',
        products: {
            quarterlies: 'Quarterlies',
            biWeeklies: 'Bi-Weeklies'
            weeklies: 'Weeklies',
        }
    },
    channelToProduct = {
        this_week: okcoinExchange.products.weeklies,
        next_week: okcoinExchange.products.biWeeklies,
        quarter: okcoinExchange.products.quarterlies
    }

function startOKCoinWebSocket() {
    new OKCoin()
        .setChannels({
            ok_sub_futureusd_btc_index: handleIndex,
            ok_sub_futureusd_btc_trade_this_week: handleTrade,
            ok_sub_futureusd_btc_trade_next_week: handleTrade,
            ok_sub_futureusd_btc_trade_quarter: handleTrade,
            ok_sub_futureusd_btc_ticker_this_week: handleTicker,
            ok_sub_futureusd_btc_ticker_next_week: handleTicker,
            ok_sub_futureusd_btc_ticker_quarter: handleTicker
        })
        .isFutures()
        .start()
}

// Index data
function handleIndex(message) {
    view.updateIndex(okcoinExchange.name, message.data.futureIndex)
}

// Last trade data
function handleTrade(message) {
    message.data.forEach(function (trade) {
        view.update(okcoinExchange.name, getProduct(message.channel), 'price', parseFloat(trade[1]))
    })
}

// Volume data
function handleTicker(message) {
    var volume = parseFloat(message.data.vol) / 10 // in k$
    view.updateVolume(okcoinExchange.name, getProduct(message.channel), volume)
}

function getProduct(channel) {

    var product
    forEach(channelToProduct, function (key, value) {
        if (channel.match(new RegExp(key))) {
            product = value
        }
    })

    if (product !== undefined) {
        return product
    }
    else {
        console.log('Unknown channel: ' + channel)
    }
}

{'fraction_non_alphanumeric': 0.09637561779242175, 'fraction_numerical': 0.0016474464579901153, 'mean_word_length': 2.7135575942915393, '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': '2077750', 'n_tokens_mistral': 1190, 'n_tokens_neox': 1130, 'n_words': 185}