<commit_before>var onfire = (function () {
    'use strict';

    function createEvent(target, event) {
        var listeners = [];

        function removeByIndex(index) {
            delete listeners[index];
        }

        function removeByReference(reference) {
            listeners.forEach(function (listener, index) {
                if (listener === reference) {
                    removeByIndex(index);
                }
            });
        }

        function addListener(listener) {
            var index = listeners.length;
            listeners[index] = listener;

            return function () {
                removeByIndex(index);
            };
        }

        function fireEvent(data) {
            listeners.forEach(function (listener) {
                listener(data);
            });
        }

        target.on[event] = addListener;
        target.off[event] = removeByReference;
        target.fire[event] = fireEvent;
    }

    function createEvents(events) {
        var target = {
            on: {},
            off: {},
            fire: {}
        };

        events.forEach(function (event) {
            createEvent(target, event);
        });

        return target;
    }

    function createContext() {
        var definitions = [];

        function removeByIndex(index) {
            definitions[index].remover();

            delete definitions[index];
        }

        function removeByReference(event, listener) {
            definitions.forEach(function (definition, index) {
                if (definition.listener === listener && definition.event === event) {
                    removeByIndex(index);
                }
            });
        }

        function addListener(event, listener) {
            var remover = event(listener);
            var index = definitions.length;

            definitions[index] = {
                event: event,
                listener: listener,
                remover: remover
            };

            return function () {
                removeByIndex(index);
            };
        }

        function dispose() {
            definitions.forEach(function (ignore, index) {
                removeByIndex(index);
            });

            definitions = null;
        }

        return {
            on: addListener,
            off: removeByReference,
            dispose: dispose
        };
    }

    return {
        createEvents: createEvents,
        createContext: createContext
    };
}());<commit_msg>Module wrapper.<commit_after>(function (factory) {
    'use strict';

    if (typeof define === 'function' && define.amd) {
        define(['exports'], factory);
    } else if (typeof module === 'object' && module.exports) {
        factory(module.exports);
    } else {
        window.onfire = {};
        factory(window.onfire);
    }
}(function (exports) {
    'use strict';

    function createEvent(target, event) {
        var listeners = [];

        function removeByIndex(index) {
            delete listeners[index];
        }

        function removeByReference(reference) {
            listeners.forEach(function (listener, index) {
                if (listener === reference) {
                    removeByIndex(index);
                }
            });
        }

        function addListener(listener) {
            var index = listeners.length;
            listeners[index] = listener;

            return function () {
                removeByIndex(index);
            };
        }

        function fireEvent(data) {
            listeners.forEach(function (listener) {
                listener(data);
            });
        }

        target.on[event] = addListener;
        target.off[event] = removeByReference;
        target.fire[event] = fireEvent;
    }

    function createEvents(events) {
        var target = {
            on: {},
            off: {},
            fire: {}
        };

        events.forEach(function (event) {
            createEvent(target, event);
        });

        return target;
    }

    function createContext() {
        var definitions = [];

        function removeByIndex(index) {
            definitions[index].remover();

            delete definitions[index];
        }

        function removeByReference(event, listener) {
            definitions.forEach(function (definition, index) {
                if (definition.listener === listener && definition.event === event) {
                    removeByIndex(index);
                }
            });
        }

        function addListener(event, listener) {
            var remover = event(listener);
            var index = definitions.length;

            definitions[index] = {
                event: event,
                listener: listener,
                remover: remover
            };

            return function () {
                removeByIndex(index);
            };
        }

        function dispose() {
            definitions.forEach(function (ignore, index) {
                removeByIndex(index);
            });

            definitions = null;
        }

        return {
            on: addListener,
            off: removeByReference,
            dispose: dispose
        };
    }

    exports.createEvents = createEvents;
    exports.createContext = createContext;
}));
{'fraction_non_alphanumeric': 0.1044523764794289, 'fraction_numerical': 0.0, 'mean_word_length': 1.412324422292705, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '552716', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1234, 'n_words': 254}