<commit_before>/*!
 * Copyright 2014 Digital Services, University of Cambridge Licensed
 * under the Educational Community License, Version 2.0 (the
 * "License"); you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at
 *
 *     http://opensource.org/licenses/ECL-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an "AS IS"
 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

/**
 * Initialises the grasshopper APIs
 */
define(['gh.api.admin', 'gh.api.app', 'gh.api.authentication', 'gh.api.config', 'gh.api.event', 'gh.api.groups', 'gh.api.orgunit', 'gh.api.series', 'gh.api.tenant', 'gh.api.user', 'gh.api.util'],
    function(adminAPI, appAPI, authenticationAPI, configAPI, eventAPI, groupsAPI, orgunitAPI, seriesAPI, tenantAPI, userAPI, utilAPI) {

        var gh = {
            'api': {
                'adminAPI': adminAPI,
                'appAPI': appAPI,
                'authenticationAPI': authenticationAPI,
                'configAPI': configAPI,
                'eventAPI': eventAPI,
                'groupsAPI': groupsAPI,
                'orgunitAPI': orgunitAPI,
                'seriesAPI': seriesAPI,
                'tenantAPI': tenantAPI,
                'userAPI': userAPI,
                'utilAPI': utilAPI
            },
            'data': {
                'me': null
            }
        };

        var initGH = function(callback) {
            // Load the me feed
            userAPI.getMe(function(err, me) {
                /* istanbul ignore if */
                if (!err) {
                    gh.data.me = me;
                } else {
                    // throw new Error('The /me feed could not be loaded - ' + err.code + ': ' + err.msg);
                }

                utilAPI.cachePartials(function() {
                    // Continue startup
                    return callback(gh);
                });
            });
        };

        return {
            /*!
             * Invoked when the module has been loaded, which can trigger initialization in a chained manner.
             */
            'load': function(name, parentRequire, load, config) {
                initGH(load);
            }
        };
    }
);
<commit_msg>Fix istanbul ignore else line<commit_after>/*!
 * Copyright 2014 Digital Services, University of Cambridge Licensed
 * under the Educational Community License, Version 2.0 (the
 * "License"); you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at
 *
 *     http://opensource.org/licenses/ECL-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an "AS IS"
 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

/**
 * Initialises the grasshopper APIs
 */
define(['gh.api.admin', 'gh.api.app', 'gh.api.authentication', 'gh.api.config', 'gh.api.event', 'gh.api.groups', 'gh.api.orgunit', 'gh.api.series', 'gh.api.tenant', 'gh.api.user', 'gh.api.util'],
    function(adminAPI, appAPI, authenticationAPI, configAPI, eventAPI, groupsAPI, orgunitAPI, seriesAPI, tenantAPI, userAPI, utilAPI) {

        var gh = {
            'api': {
                'adminAPI': adminAPI,
                'appAPI': appAPI,
                'authenticationAPI': authenticationAPI,
                'configAPI': configAPI,
                'eventAPI': eventAPI,
                'groupsAPI': groupsAPI,
                'orgunitAPI': orgunitAPI,
                'seriesAPI': seriesAPI,
                'tenantAPI': tenantAPI,
                'userAPI': userAPI,
                'utilAPI': utilAPI
            },
            'data': {
                'me': null
            }
        };

        var initGH = function(callback) {
            // Load the me feed
            userAPI.getMe(function(err, me) {
                /* istanbul ignore else */
                if (!err) {
                    gh.data.me = me;
                } else {
                    // throw new Error('The /me feed could not be loaded - ' + err.code + ': ' + err.msg);
                }

                utilAPI.cachePartials(function() {
                    // Continue startup
                    return callback(gh);
                });
            });
        };

        return {
            /*!
             * Invoked when the module has been loaded, which can trigger initialization in a chained manner.
             */
            'load': function(name, parentRequire, load, config) {
                initGH(load);
            }
        };
    }
);

{'fraction_non_alphanumeric': 0.11002842062525375, 'fraction_numerical': 0.0032480714575720666, 'mean_word_length': 1.6733586543678785, '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': '7284840', 'n_tokens_mistral': 1319, 'n_tokens_neox': 1240, 'n_words': 396}