<commit_before>// DOMinate by <NAME>

function DOMinate(a, b, c) {

    function d(a, b) {
        a = a.split('#');
        b = document.createElement(a[0]);
        b.id = a[1] || null;
        return b
    }

    if (a[0].big)
        a[0] = d(a[0]);

    for (c = 1; c < a.length; c++) {
        if (a[c].big)
            a[0].innerHTML = a[c];

        else if (a[c].pop) {
            if (a[c][0].big)
                a[c][0] = d(a[c][0]);
            a[0].appendChild(a[c][0]);
            DOMinate(a[c])

        } else
            for (b in a[c])
                a[0].setAttribute(b, a[c][b])
    }

    return a[0]<commit_msg>documented DOMinate function (fixes #3)<commit_after>// DOMinate by <NAME>

function DOMinate(a,                        // Array containing the DOMfragment in JsonML
                  b,                        // placeholder
                  c                         // placeholder
    ) {

    function d(a,                           // create DOM element from syntax sugar string
               b                            // placeholder
        ) {
        a = a.split('#');                   // split string into element-name and id
        b = document.createElement(a[0]);   // create element
        b.id = a[1] || null;                // assign id if is set
        return b                            // return DOM element
    }

    if (a[0].big)                           // if is string create DOM element
        a[0] = d(a[0]);                     // else is already a DOM element

    for (c = 1; c < a.length; c++) {        // for each in the element array (except the first)
        if (a[c].big)                       // if is string has to be content
            a[0].innerHTML = a[c];          // set content

        else if (a[c].pop) {                // if is array has to be child element
            if (a[c][0].big)                // if is string create DOM element
                a[c][0] = d(a[c][0]);       // else is already a DOM element
            a[0].appendChild(a[c][0]);      // append the element to its parent element
            DOMinate(a[c])                  // use DOMinate recursively for all child elements

        } else                                  // else must be object with attributes
            for (b in a[c])                     // for each attribute
                a[0].setAttribute(b, a[c][b])   // set attribute
    }

    return a[0]                             // return DOM element
{'fraction_non_alphanumeric': 0.1263073209975865, 'fraction_numerical': 0.01166532582461786, 'mean_word_length': 1.0829145728643217, 'pattern_counts': {'":': 0, '<': 7, '<?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': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1304046', 'n_tokens_mistral': 712, 'n_tokens_neox': 679, 'n_words': 217}