<commit_before>function ExpSubTypeSelectionUpdater(selection_relations) {
    self.construct = function () {
        // Monitors experiment_type selects for change.
        $('ul.col-omics_experiment_types').on('change', 'select#omics_experiment_omicsExperimentTypes___exptype_prot___omicsExperimentTypeString', function () {
            var parent_val = $(this).find("option:selected").text();
            // Finds experiment_sub_type select children.
            var child_selectors = $(this).parent().parent().find('select#omics_experiment_omicsExperimentTypes___exptype_prot___omicsExperimentSubTypes___expsubtype_prot___omicsExperimentSubTypeString');
            $.each(child_selectors, function (i, val) {
                var child_selector = val;
                // Hides ALL options.
                $(child_selector).children('option').hide();
                // Shows relevant options.
                $.each(selection_relations[parent_val], function (i, val) {
                    $(child_selector).children('option').filter(function () {
                        return $(this).html() == val;
                    }).show();
                });
                // Gets first non-hidden option.
                var first_non_hidden_option = $(child_selector).children('option').filter(function () {
                    return $(this).css('display') != 'none';
                }).first()[0];
                // If it exists set it as selected, else set blank.
                if (typeof(first_non_hidden_option) != 'undefined') {
                    $(child_selector).val(first_non_hidden_option.value);
                } else {
                    $(child_selector).val('');
                }
            });
        });
    };

    self.construct();<commit_msg>Restored exp_type_updater to working order - still needs mutator to fully function.<commit_after>function ExpSubTypeSelectionUpdater(selection_relations) {
    self.construct = function () {
        // Monitors experiment_type selects for change.
        $('ul.col-omics_experiment_types').on('change', 'select[id$="omicsExperimentTypeString"]', function (e) {
            self.modify(e.target);
        });
    };

    self.modify = function(selector) {
        var frame = $('ul.col-omics_experiment_types');
        var parent_val = $("option:selected", selector).text();
        // Finds experiment_sub_type select children.
        var child_selectors = $(frame).find("select[id$='omicsExperimentSubTypeString']");
        $.each(child_selectors, function (i, val) {
            var child_selector = val;
            // Hides ALL options.
            $(child_selector).children('option').hide();
            // Shows relevant options.
            $.each(selection_relations[parent_val], function (i, val) {
                $(child_selector).children('option').filter(function () {
                    return $(this).html() == val;
                }).show();
            });
            // Gets first non-hidden option.
            var first_non_hidden_option = $(child_selector).children('option').filter(function () {
                return $(this).css('display') != 'none';
            }).first()[0];
            // If it exists set it as selected, else set blank.
            if (typeof(first_non_hidden_option) != 'undefined') {
                $(child_selector).val(first_non_hidden_option.value);
            } else {
                $(child_selector).val('');
            }
        });
    };

    self.construct();
{'fraction_non_alphanumeric': 0.13289511288939698, 'fraction_numerical': 0.0005715918833952558, 'mean_word_length': 2.1362007168458783, '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': '679104', 'n_tokens_mistral': 923, 'n_tokens_neox': 878, 'n_words': 163}