<commit_before>/*
The MIT License (MIT)
Copyright (c) 2013 <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

/*global require, define, module

*/
(function (ctx, factory) {
    "use strict";

    var env = factory.env,
        def = factory.def,
        deps = {
            amd: ['./node_modules/modelo/modelo.js', './node_modules/deferjs/defer.js'],
            node: ['modelo', 'deferjs'],
            browser: ['Modelo', 'defer']
        };

    def.call(ctx, 'Event', deps[env], function (Modelo, defer) {

        var EventMixin;

        // The Event object is a Modelo object that provides asynchronous
        // events. While new instances of Event can be created directly, it
        // is intended as more of a Mix-In object that can be added to any
        // inheritance chain.
        EventMixin = Modelo.define(function (options) {

            this.events = {};

        });

        // This method, and its alias `bind`, are used to register callbacks
        // to a particular event.
        //
        // Event callbacks are passed no parameters. If callbacks should run
        // in a special context, an object instance for example, then
        // a reference to the context should be passed in as an optional
        // third argument. In the absence of a special context a default,
        // empty context is used.
        EventMixin.prototype.on = function (event, callback, context) {

            if (typeof callback !== "function") {
                return this;
            }

            context = context || null;

            this.events[event] = this.events[event] || [];

            this.events[event].push({
                "callback": callback,
                "context": context
            });

            return this;

        };
        EventMixin.prototype.bind = EventMixin.prototype.on;

        // This method, and its alias `unbind`, are used to unregister
        // a callback from an event. This method uses a four-way logic
        // to determine which callbacks to remove.
        //
        // If no arguments are arguments are passed in then all callback
        // for all events are unregistered.
        //
        // If an event is the only argument then all callbacks for that
        // event are unregistered.
        //
        // If an event and a reference to a callback are given then all
        // callbacks that equal the reference are removed from the specified
        // event.
        //
        // If an event, callback reference, and context reference are given
        // then only the callbacks that match both references are removed
        // from the event.
        //
        // It all depends on how specific you really need to be when
        // removing call backs from an object.
        EventMixin.prototype.off = function (event, callback, context) {

            var x;

            if (callback === undefined &&
                    context === undefined &&
                    event === undefined) {

                this.events = {};
                return this;

            }

            if (callback === undefined && context === undefined) {

                this.events[event].splice(0, this.events[event].length);<commit_msg>Change: Line lengths and style<commit_after>/*
The MIT License (MIT)
Copyright (c) 2013 <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

/*global require, define, module

*/
(function (ctx, factory) {
    "use strict";

    var env = factory.env,
        def = factory.def,
        deps = {
            amd: ['./node_modules/modelo/modelo.js', './node_modules/deferjs/defer.js'],
            node: ['modelo', 'deferjs'],
            browser: ['Modelo', 'defer']
        };

    def.call(ctx, 'Event', deps[env], function (Modelo, defer) {

        var EventMixin;

        // The Event object is a Modelo object that provides asynchronous
        // events. While new instances of Event can be created directly, it
        // is intended as more of a Mix-In object that can be added to any
        // inheritance chain.
        EventMixin = Modelo.define(function () {

            this.events = {};

        });

        // This method, and its alias `bind`, are used to register callbacks
        // to a particular event.
        //
        // Event callbacks are passed no parameters. If callbacks should run
        // in a special context, an object instance for example, then
        // a reference to the context should be passed in as an optional
        // third argument. In the absence of a special context a default,
        // empty context is used.
        EventMixin.prototype.on = function (event, callback, context) {

            if (typeof callback !== "function") {

                return this;

            }

            context = context || null;

            this.events[event] = this.events[event] || [];

            this.events[event].push({
                "callback": callback,
                "context": context
            });

            return this;

        };
        EventMixin.prototype.bind = EventMixin.prototype.on;

        // This method, and its alias `unbind`, are used to unregister
        // a callback from an event. This method uses a four-way logic
        // to determine which callbacks to remove.
        //
        // If no arguments are passed in then all callbacks for all events are
        // unregistered.
        //
        // If an event is the only argument given then all callbacks for that
        // event are unregistered.
        //
        // If an event and a reference to a callback are given then all
        // callbacks that equal the reference are removed from the specified
        // event.
        //
        // If an event, callback reference, and context reference are given
        // then only the callbacks that match both references are removed
        // from the event.
        //
        // It all depends on how specific you really need to be when
        // removing callbacks from an object.
        EventMixin.prototype.off = function (event, callback, context) {

            var x;

            if (callback === undefined &&
                    context === undefined &&
                    event === undefined) {

                this.events = {};
                return this;

            }

            if (callback === undefined && context === undefined) {

                this.events[event].splice(0, this.events[event].length);
{'fraction_non_alphanumeric': 0.08107787274453941, 'fraction_numerical': 0.0011870845204178537, 'mean_word_length': 2.0940139551964743, 'pattern_counts': {'":': 4, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '711419', 'n_tokens_mistral': 2080, 'n_tokens_neox': 1971, 'n_words': 956}