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

    angular
        .module('app')
        .factory('Recommendations', Recommendations);

    Recommendations.$inject = ['$q', '$rootScope', 'GitHub', 'Recommender'];

    function Recommendations($q, $rootScope, GitHub, Recommender) {
        var service = {
            get: getRecommendations
        };

        return service;

        //////////

        function getRecommendations() {
            return getCurrentTabUrl().then(function(url) {
                var gitUrl = GitHub.parseGitUrl(url);

                $rootScope.gitUrl = gitUrl;

                if (gitUrl.error) {
                    return $q.reject(gitUrl.error);
                }

                return GitHub.getContents(gitUrl.username, gitUrl.repository, gitUrl.path).then(function(contents) {
                    var files = getContentsNames(contents);

                    return Recommender.get(GitHub.getRepositoryUrl(url), files).then(function(files) {
                        return files.map(function(file) {
                            file.html_url = GitHub.getFileHtmlUrl(gitUrl, file);
                            return file;
                        });
                    });
                });
            });


            function getContentsNames(contents) {
                return contents.filter(function(data) {
                    return data.type === 'file';
                }).map(function(data) {
                    return data.path;
                });
            }
        }

        function getCurrentTabUrl() {
            var dfd = $q.defer();

            chrome.tabs.query({
                currentWindow: true,
                active: true
            }, function(tabs) {
                $rootScope.$apply(function() {
                    dfd.resolve(tabs[0].url);
                });
            });

            return dfd.promise;
        }
    }
})();<commit_msg>Added dummy branch as needed by recommender backend<commit_after>(function() {
    'use strict';

    angular
        .module('app')
        .factory('Recommendations', Recommendations);

    Recommendations.$inject = ['$q', '$rootScope', 'GitHub', 'Recommender'];

    function Recommendations($q, $rootScope, GitHub, Recommender) {
        var service = {
            get: getRecommendations
        };

        return service;

        //////////

        function getRecommendations() {
            return getCurrentTabUrl().then(function(url) {
                var gitUrl = GitHub.parseGitUrl(url);

                $rootScope.gitUrl = gitUrl;

                if (gitUrl.error) {
                    return $q.reject(gitUrl.error);
                }

                return GitHub.getContents(gitUrl.username, gitUrl.repository, gitUrl.path).then(function(contents) {
                    var files = getContentsNames(contents);

                    return Recommender.get(GitHub.getRepositoryUrl(url), files).then(function(files) {
                        return files.map(function(file) {
                            file.html_url = GitHub.getFileHtmlUrl(gitUrl, file);
                            return file;
                        });
                    });
                });
            });


            function getContentsNames(contents) {
                return contents.filter(function(data) {
                    return data.type === 'file';
                }).map(function(data) {
                    return "master/" + data.path;
                });
            }
        }

        function getCurrentTabUrl() {
            var dfd = $q.defer();

            chrome.tabs.query({
                currentWindow: true,
                active: true
            }, function(tabs) {
                $rootScope.$apply(function() {
                    dfd.resolve(tabs[0].url);
                });
            });

            return dfd.promise;
        }
    }
})();
{'fraction_non_alphanumeric': 0.11740684022460439, 'fraction_numerical': 0.0005104645227156713, 'mean_word_length': 1.3066509711595056, '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': '5128627', 'n_tokens_mistral': 1033, 'n_tokens_neox': 926, 'n_words': 164}