<commit_before>/**
 * notus v0.1.0
 *
 * Author: <NAME> <<EMAIL>> (https://doublslash.com)
 * Date: 12 February, 2016
 *
 * Main Notus Script.
 */

(function() {
    "use strict";

    var self = this,
        hasRequire = (typeof require !== 'undefined'),
        old_notus = self.notus,
        notus;

    // UMD Definition < https://github.com/umdjs/umd >.
    if (typeof exports !== 'undefined')
    {<commit_msg>Add internal utility API and some basic code.<commit_after>/**
 * notus v0.1.0
 *
 * Author: <NAME> <<EMAIL>> (https://doublslash.com)
 * Date: 12 February, 2016
 *
 * Main Notus Script.
 */

(function() {
    "use strict";

    var self = this,
        hasRequire = (typeof require !== 'undefined'),
        old_notus = self.notus,
        _n = {},
        notus;

    /**
     * Local Utility API.
     */
    _n = {
        /**
         * Generate timestamp based unique ID.
         */
        genId: function() {
            return 'notus-' + Math.floor(Math.random() * 10000000000000001);
        },

        /**
         * Simple Object extender (similar to jQuery's $.extend()).
         * courtesy; SO < http://stackoverflow.com/a/11197343/414749 >
         */
        extend: function() {
            var key, i;

            for (i = 1; i < arguments.length; i++)
            {
                for (key in arguments[i])
                {
                    if (arguments[i].hasOwnProperty(key))
                        arguments[0][key] = arguments[i][key];
                }
            }

            return arguments[0];
        },

        /**
         * String formatter.
         * Accepts first param as target string, and following params as strings to
         * replace placeholders (eg; {0}).
         * courtesy: SO <http://stackoverflow.com/a/1038930/414749>
         */
        format: function() {
            var str = arguments[0],
                reg,
                i;

            for (i = 0; i < arguments.length - 1; i++) {
                reg = new RegExp("\\{" + i + "\\}", "gm");
                str = str.replace(reg, arguments[i + 1]);
            }

            return str;
        },

        createNotusEl: function(config) {
            var parentDiv = document.createElement('div'),
                notusElTpl;

            parentDiv.setAttribute('id', this.genId());
            parentDiv.setAttribute('class', 'notus notus-float');

            notusElTpl = [
                '<div class="notus-body-item notus-text">',
                    '{0}',
                '</div>',
                '<div class="notus-body-item notus-close">',
                    '<span class="icon-close">&times;</span>',
                '</div>'
            ].join('');

            parentDiv.innerHTML = this.format(notusElTpl, config.message);

            return parentDiv;
        }
    };

    notus = self.notus = function(defaultConfig) {
        var bodyEL = document.body,
            thisNotus = {};

        /** Notus API begin **/

        /**
         * Resolve instance conflict in case module is loaded more than once.
         */
        thisNotus.noConflict = function() {
            self.notus = old_notus;
            return notus;
        };


        thisNotus.send = function(config) {
            var notusEl;

            notusEl = _n.createNotusEl({
                message: config.message
            });

            bodyEL.appendChild(notusEl);

            return notusEl.getAttribute('id');
        };
        /** Notus API end **/

        return thisNotus;
    };

    // UMD Definition < https://github.com/umdjs/umd >.
    if (typeof exports !== 'undefined')
    {
{'fraction_non_alphanumeric': 0.14093406593406593, 'fraction_numerical': 0.019505494505494506, 'mean_word_length': 1.448554135843981, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '2915149', 'n_tokens_mistral': 1111, 'n_tokens_neox': 1026, 'n_words': 240}