<commit_before>'use strict';

function getFirstHeaderInRow(tr) {
    var th = tr.firstChild;
    while (th) {
        if (th.tagName === 'TH') break;
        if (th.tagName === 'TD') {
            th = null;
            break;
        }
        th = th.nextSibling;
    }
    return th;
}

function getHeaders(element) {
    return [].filter.call(element.children().children().children(), function (it) {
        return it.tagName === 'TH';
    });
}

function updateTitle(td, th) {
    var title = th && th.textContent;
    if (title && (td.getAttributeNode('data-title-override') || !td.getAttributeNode('data-title'))) {
        td.setAttribute('data-title', title);
        td.setAttribute('data-title-override', title);
    }
}

function colspan(td) {
    var colspan = td.getAttributeNode('colspan');
    return colspan ? parseInt(colspan.value) : 1;
}

function wtResponsiveTable() {
    return {
        restrict: 'A',
        controller: ['$element', function ($element) {
            angular.extend(this, {
                contains: function (td) {
                    var tableEl = $element[0];
                    var el = td;
                    do {
                        if (el === tableEl) return true;
                        if (el.tagName === 'TABLE') return false;

                        el = el.parentElement;
                    } while (el);
                    throw new Error('Table element not found for ' + td);
                },

                getHeader: function (td) {
                    var firstHeader = getFirstHeaderInRow(td.parentElement);
                    if (firstHeader) return firstHeader; 
<commit_msg>Changed getAttributeNode to getAttribute also changed colspan.value to colspan (#24)<commit_after>'use strict';

function getFirstHeaderInRow(tr) {
    var th = tr.firstChild;
    while (th) {
        if (th.tagName === 'TH') break;
        if (th.tagName === 'TD') {
            th = null;
            break;
        }
        th = th.nextSibling;
    }
    return th;
}

function getHeaders(element) {
    return [].filter.call(element.children().children().children(), function (it) {
        return it.tagName === 'TH';
    });
}

function updateTitle(td, th) {
    var title = th && th.textContent;
    if (title && (td.getAttribute('data-title-override') || !td.getAttribute('data-title'))) {
        td.setAttribute('data-title', title);
        td.setAttribute('data-title-override', title);
    }
}

function colspan(td) {
    var colspan = td.getAttribute('colspan');
    return colspan ? parseInt(colspan) : 1;
}

function wtResponsiveTable() {
    return {
        restrict: 'A',
        controller: ['$element', function ($element) {
            angular.extend(this, {
                contains: function (td) {
                    var tableEl = $element[0];
                    var el = td;
                    do {
                        if (el === tableEl) return true;
                        if (el.tagName === 'TABLE') return false;

                        el = el.parentElement;
                    } while (el);
                    throw new Error('Table element not found for ' + td);
                },

                getHeader: function (td) {
                    var firstHeader = getFirstHeaderInRow(td.parentElement);
                    if (firstHeader) return firstHeader;

{'fraction_non_alphanumeric': 0.13132817153067303, 'fraction_numerical': 0.001786777843954735, 'mean_word_length': 1.7555373256767843, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3778577', 'n_tokens_mistral': 945, 'n_tokens_neox': 915, 'n_words': 225}