<commit_before>(function() {
    'use strict';

    angular.module('SocketIoNgService', [])
        .service('socketService', ['$rootScope', '$q', function ($rootScope, $q) {
            // holds the promise of a connected socket
            var deferredConnectedSocket = $q.defer();
            function onConnectedSocket() {
                return deferredConnectedSocket.promise;
            }

            // connects with the server and resolves the promise
            var _socket = io.connect();
            _socket.on('connect', function () {
                deferredConnectedSocket.resolve(_socket);API
            });

            /** emits an event to the server with a facultative callback */
            function emit(eventName, data, callback) {
                onConnectedSocket().then(function(socket) {
                    socket.emit(eventName, data, function () {
                        if (callback) {
                            var args = arguments;
                            $rootScope.$apply(function () {
                                callback.apply(socket, args);
                            });
                        }
                    });
                });
            }

            // the socket service
            var socketService = {
                /** listens for a server event */<commit_msg>* removed reference to API<commit_after>(function() {
    'use strict';

    angular.module('SocketIoNgService', [])
        .service('socketService', ['$rootScope', '$q', function ($rootScope, $q) {
            // holds the promise of a connected socket
            var deferredConnectedSocket = $q.defer();
            function onConnectedSocket() {
                return deferredConnectedSocket.promise;
            }

            // connects with the server and resolves the promise
            var _socket = io.connect();
            _socket.on('connect', function () {
                deferredConnectedSocket.resolve(_socket);
            });

            /** emits an event to the server with a facultative callback */
            function emit(eventName, data, callback) {
                onConnectedSocket().then(function(socket) {
                    socket.emit(eventName, data, function () {
                        if (callback) {
                            var args = arguments;
                            $rootScope.$apply(function () {
                                callback.apply(socket, args);
                            });
                        }
                    });
                });
            }

            // the socket service
            var socketService = {
                /** listens for a server event */
{'fraction_non_alphanumeric': 0.10066864784546806, 'fraction_numerical': 0.0, 'mean_word_length': 1.2880203908241292, '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': '2334087', 'n_tokens_mistral': 612, 'n_tokens_neox': 575, 'n_words': 152}