<commit_before>mixin print_val(val, depth)
    - if (val === undefined)
        span.undefined undefined
    - if (val === null)
        span.null null
    - else if (val instanceof Date)
        span.date #{val.toString()}
    - else if (typeof val === 'object')
        - if (Object.keys(val).length === 0)
            - if (val instanceof Array)
                span.array [ ]
            - else
                span.object { }
        - else
            mixin print_obj(val, depth + 1)
    - else if (typeof val === 'function')
        a.showFn args: #{val.length}, fn name: #{val.name}
        pre.fn !{val}
        - if (Object.keys(val).length)
            mixin print_obj(val, depth + 1)
    - else
        - _type = typeof val;
        span(class="#{_type}") #{val}

mixin print_obj(obj, depth)
    - depth = depth || 0;

    - if (!obj.EDT_hidden)
        - if (depth < EDTsettings.depth)
            table.object
                thead: tr.collapse
                    - if (obj instanceof Array)
                        th.arr index
                    - else
                        th name
                    th value
                    th.indicator
                tbody
                    - Object.keys(obj).forEach(function(prop){
                        - var val = obj[prop]
                        - if (!val || val.EDT_hidden === undefined)
                            tr
                                td !{prop}
                                td(colspan=2): mixin print_val(val, depth)
                    - })
        - else
            span.exceeded (Depth exceeded; settings.depth: #{EDTsettings.depth})<commit_msg>add configurable depth and sort<commit_after>mixin print_val(val, depth, options)
    - if (val === undefined)
        span.undefined undefined
    - if (val === null)
        span.null null
    - else if (val instanceof Date)
        span.date #{val.toString()}
    - else if (typeof val === 'object')
        - if (Object.keys(val).length === 0)
            - if (val instanceof Array)
                span.array [ ]
            - else
                span.object { }
        - else
            mixin print_obj(val, depth + 1, options)
    - else if (typeof val === 'function')
        a.showFn args: #{val.length}, fn name: #{val.name}
        pre.fn !{val}
        - if (Object.keys(val).length)
            mixin print_obj(val, depth + 1, options)
    - else
        - _type = typeof val;
        span(class="#{_type}") #{val}

mixin print_obj(obj, depth, options)
    - depth = depth || 0;
    - options = options || {};
    - options.depth = options.depth || EDTsettings.depth;
    - if (!obj.EDT_hidden)
        - if (depth < options.depth)
            - var keys = Object.keys(obj);
            - if (options.sort)
                - keys = keys.sort();
            table.object
                thead: tr.collapse
                    - if (obj instanceof Array)
                        th.arr index
                    - else
                        th name
                    th value
                    th.indicator
                tbody
                    - keys.forEach(function(prop){
                        - var val = obj[prop]
                        - if (!val || val.EDT_hidden === undefined)
                            tr
                                td !{prop}
                                td(colspan=2): mixin print_val(val, depth, options)
                    - })
        - else
            span.exceeded (Depth exceeded; max depth: #{options.depth})
{'fraction_non_alphanumeric': 0.11504675545480306, 'fraction_numerical': 0.0028336639274582033, 'mean_word_length': 1.1511273613650213, 'pattern_counts': {'":': 0, '<': 5, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2851688', 'n_tokens_mistral': 974, 'n_tokens_neox': 927, 'n_words': 247}