<commit_before>'use strict';
SIREPO.srlog = console.log.bind(console);
SIREPO.srdbg = console.log.bind(console);

// No timeout for now (https://github.com/radiasoft/sirepo/issues/317)
SIREPO.http_timeout = 0;

var srlog = SIREPO.srlog;
var srdbg = SIREPO.srdbg;

// start the angular app after the app's json schema file has been loaded
angular.element(document).ready(function() {

    function loadDynamicModule(src) {
        return src.endsWith('.css')
            ? addTag(src, 'link', 'head', 'href', {'rel': 'stylesheet'})
            : addTag(src, 'script', 'body', 'src', {'type': 'text/javascript', 'async': true});
    }

    function addTag(src, name, parent, uri, attrs) {
        var d = $.Deferred();
        var t = document.createElement(name);
        t[uri] = src + SIREPO.SOURCE_CACHE_KEY;
        Object.assign(t, attrs);
        document.getElementsByTagName(parent)[0].appendChild(t);
        t.onload = function () {
            d.resolve();
        };
        return d.promise();<commit_msg>use javascript match() and $.extend() in place of endsWith() and assign() for MSIE 11<commit_after>'use strict';
SIREPO.srlog = console.log.bind(console);
SIREPO.srdbg = console.log.bind(console);

// No timeout for now (https://github.com/radiasoft/sirepo/issues/317)
SIREPO.http_timeout = 0;

var srlog = SIREPO.srlog;
var srdbg = SIREPO.srdbg;

// start the angular app after the app's json schema file has been loaded
angular.element(document).ready(function() {

    function loadDynamicModule(src) {
        return src.match(/\.css$/)
            ? addTag(src, 'link', 'head', 'href', {'rel': 'stylesheet'})
            : addTag(src, 'script', 'body', 'src', {'type': 'text/javascript', 'async': true});
    }

    function addTag(src, name, parent, uri, attrs) {
        var d = $.Deferred();
        var t = document.createElement(name);
        t[uri] = src + SIREPO.SOURCE_CACHE_KEY;
        $.extend(t, attrs);
        document.getElementsByTagName(parent)[0].appendChild(t);
        t.onload = function () {
            d.resolve();
        };
        return d.promise();
{'fraction_non_alphanumeric': 0.1595238095238095, 'fraction_numerical': 0.005714285714285714, 'mean_word_length': 3.0095419847328246, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6187917', 'n_tokens_mistral': 687, 'n_tokens_neox': 670, 'n_words': 160}