<commit_before>$(document).ready(function () {
    var showSlave = function ($master, showOn) {
        if ($master.is(':checkbox')) {
            return (+$master.is(':checked')).toString() === showOn;
        }

        var value = $master.val().toString();

        if ($master.is('select') && $master.prop('multiple')) {
            return value.indexOf(showOn) >= 0;
        }

        return value === showOn;
    };
    var toggleSlaveContainer = function ($slaveContainer, $master, showOn) {
        $master.val() && showSlave($master, showOn) ? $slaveContainer.show() : $slaveContainer.hide();
    };

    $('.slave_input').each(function () {
        var $slave = $(this);
        var $slaveContainer = $slave.closest('.table_row');
        var masterSelector = $slave.data('master');
        var showOn = $slave.data('show-on').toString();
<commit_msg>Add slave option support to the master-slave inputs JS.<commit_after>$(document).ready(function () {
    var showSlave = function ($master, showOn) {
        if ($master.is(':checkbox')) {
            return (+$master.is(':checked')).toString() === showOn;
        }

        var value = $master.val().toString();

        if ($master.is('select') && $master.prop('multiple')) {
            return value.indexOf(showOn) >= 0;
        }

        return value === showOn;
    };
    var toggleSlaveContainer = function ($slaveContainer, $master, showOn) {
        $master.val() && showSlave($master, showOn) ? $slaveContainer.show() : $slaveContainer.hide();

        if ($slaveContainer.is('option')) {
            $slaveContainer.closest('select').trigger('chosen:updated');
        }
    };

    $('.slave_input').each(function () {
        var $slave = $(this);

        var $slaveContainer = $slave.is('option') ? $slave : $slave.closest('.table_row');

        var masterSelector = $slave.data('master');
        var showOn = $slave.data('show-on').toString();

{'fraction_non_alphanumeric': 0.18578100674623768, 'fraction_numerical': 0.0010378827192527244, 'mean_word_length': 2.7582846003898633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3740783', 'n_tokens_mistral': 560, 'n_tokens_neox': 548, 'n_words': 107}