<commit_before>(function (angular) {
    'use strict';
    var SignalRService = function (jQuery) {
        this.jQuery = jQuery;
    };

    SignalRService.prototype.getHub = function (hubName) {
        return this.jQuery.connection[hubName];
    };

    var SignalRProvider = function () {
        this._url = '/signalr';
        this._proxies = {};
    };

    SignalRProvider.prototype.url = function (value) {
        if (angular.isUndefined(value)) {
            return this._url;
        }
        this._url = value;
        return this;
    };

    SignalRProvider.prototype.proxies = function (value) {
        if (angular.isUndefined(value)) {
            return this._proxies;
        }
        this._proxies = value;
        return this;
    };

    SignalRProvider.prototype.$get = function ($rootScope, $window) {
        var jQuery = $window.jQuery;
        var self = this;
        angular.forEach(jQuery.connection.hub.proxies, function (proxy, proxyName) {
            if (!self._proxies.hasOwnProperty(proxyName)) {
                return;
            }
            angular.forEach(self._proxies[proxyName], function (methodName) {
                proxy.client[methodName] = function () {
                    var args = [];
                    angular.forEach(arguments, function (argument) {
                        args.push(argument);
                    });
                    $rootScope.$broadcast('eehSignalR:' + methodName, args);
                    $rootScope.$apply();
                };
            });
        });
        jQuery.connection.hub.url = this.url();
        jQuery.connection.hub.start();
        return new SignalRService(jQuery);
    };

    angular.module('eehSignalR', []).provider('eehSignalR', SignalRProvider);
}(angular));
<commit_msg>Make API for adding proxy methods to broadcast more explicit<commit_after>(function (angular) {
    'use strict';
    var SignalRService = function (jQuery) {
        this.jQuery = jQuery;
    };

    SignalRService.prototype.getHub = function (hubName) {
        return this.jQuery.connection[hubName];
    };

    var SignalRProvider = function () {
        this._url = '/signalr';
        this._proxies = {};
    };

    SignalRProvider.prototype.url = function (value) {
        if (angular.isUndefined(value)) {
            return this._url;
        }
        this._url = value;
        return this;
    };

    SignalRProvider.prototype.proxy = function (name, methods) {
        if (angular.isUndefined(methods)) {
            return this._proxies[name];
        }
        this._proxies[name] = methods;
        return this;
    };

    SignalRProvider.prototype.$get = function ($rootScope, $window) {
        var jQuery = $window.jQuery;
        var self = this;
        angular.forEach(jQuery.connection.hub.proxies, function (proxy, proxyName) {
            if (!self._proxies.hasOwnProperty(proxyName)) {
                return;
            }
            angular.forEach(self._proxies[proxyName], function (methodName) {
                proxy.client[methodName] = function () {
                    var args = [];
                    angular.forEach(arguments, function (argument) {
                        args.push(argument);
                    });
                    $rootScope.$broadcast('eehSignalR:' + methodName, args);
                    $rootScope.$apply();
                };
            });
        });
        jQuery.connection.hub.url = this.url();
        jQuery.connection.hub.start();
        return new SignalRService(jQuery);
    };

    angular.module('eehSignalR', []).provider('eehSignalR', SignalRProvider);
}(angular));

{'fraction_non_alphanumeric': 0.1242798353909465, 'fraction_numerical': 0.0, 'mean_word_length': 1.8506645817044567, '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': '1732589', 'n_tokens_mistral': 1003, 'n_tokens_neox': 958, 'n_words': 180}