<commit_before>(function (prmebro, $, templateRenderer) {
    "use strict";

    function loadPullRequests() {
        var pullRequests = [],
            github = prmebro.github,
            numberRequestsPending = 0;

        function addPullRequestsToList(error, newPullRequests) {
            pullRequests = pullRequests.concat(newPullRequests);

            numberRequestsPending--;
        }

        numberRequestsPending++;
        github.getUser().subscriptions(function (error, repositories) {
            for (var i = 0; i < repositories.length; i++) {
                numberRequestsPending++;
                github.getRepo(repositories[i].owner.login, repositories[i].name).listPulls('open', addPullRequestsToList);
            }

            numberRequestsPending--;
        });

        var anyPendingRequestsLeftChecker = setInterval(function () {
            if (numberRequestsPending === 0) {
                displayPullRequests(pullRequests);
                clearInterval(anyPendingRequestsLeftChecker);
            }
        }, 10);
    }

    function displayPullRequests(pullRequests) {
        var templateSource = $('#pullrequest-list-view').html(),
            compiledTemplate = dust.compile(templateSource, "pull-request-list-view");<commit_msg>Cache the PRs somewhere so we can get to them later<commit_after>(function (prmebro, $, templateRenderer) {
    "use strict";

    function cachePullRequests(pullRequests) {
        prmebro.pullRequests = {};

        for (var i = 0; i < pullRequests.length; i++) {
            prmebro.pullRequests[pullRequests[i].head.repo.html_url] = pullRequests[i];
        }
    }

    function loadPullRequests() {
        var pullRequests = [],
            github = prmebro.github,
            numberRequestsPending = 0;

        function addPullRequestsToList(error, newPullRequests) {
            pullRequests = pullRequests.concat(newPullRequests);

            numberRequestsPending--;
        }

        numberRequestsPending++;
        github.getUser().subscriptions(function (error, repositories) {
            for (var i = 0; i < repositories.length; i++) {
                numberRequestsPending++;
                github.getRepo(repositories[i].owner.login, repositories[i].name).listPulls('open', addPullRequestsToList);
            }

            numberRequestsPending--;
        });

        var anyPendingRequestsLeftChecker = setInterval(function () {
            if (numberRequestsPending === 0) {
                clearInterval(anyPendingRequestsLeftChecker);

                displayPullRequests(pullRequests);
                cachePullRequests(pullRequests);
            }
        }, 10);
    }

    function displayPullRequests(pullRequests) {
        var templateSource = $('#pullrequest-list-view').html(),
            compiledTemplate = dust.compile(templateSource, "pull-request-list-view");
{'fraction_non_alphanumeric': 0.10813630041724617, 'fraction_numerical': 0.0038247566063977748, 'mean_word_length': 2.3531468531468533, 'pattern_counts': {'":': 0, '<': 6, '<?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': '7011913', 'n_tokens_mistral': 760, 'n_tokens_neox': 755, 'n_words': 126}