<commit_before>/*global define*/
define([
        '../ThirdParty/when',
        './defaultValue',
        './defined'
    ], function(
        when,
        defaultValue,
        defined) {
    "use strict";

    var maximumRequestsPerServer = 6;
    var activeRequests = {};
    var anchor;

    function getServer(url) {
        if (!defined(anchor)) {
            anchor = document.createElement('a');
        }
        anchor.href = url;
        return anchor.hostname + '%' + anchor.port;
    }

    /**
     * Because browsers throttle the number of parallel requests allowed to each server,
     * this function tracks the number of active requests in progress to each server, and
     * returns undefined immediately if the request would exceed the maximum, allowing
     * the caller to retry later, instead of queueing indefinitely under the browser's control.<commit_msg>Parse URL instead of using browser element, which is slower.<commit_after>/*global define*/
define([
        '../ThirdParty/Uri',
        '../ThirdParty/when',
        './defaultValue',
        './defined'
    ], function(
        Uri,
        when,
        defaultValue,
        defined) {
    "use strict";

    var maximumRequestsPerServer = 6;
    var activeRequests = {};

    var pageUri = new Uri(document.location.href);
    function getServer(url) {
        var uri = new Uri(url).resolve(pageUri);
        uri.normalize();
        var server = uri.authority;
        if (!/:/.test(server)) {
            server = server + ':' + (uri.scheme === 'https' ? '443' : '80');
        }
        return server;
    }

    /**
     * Because browsers throttle the number of parallel requests allowed to each server,
     * this function tracks the number of active requests in progress to each server, and
     * returns undefined immediately if the request would exceed the maximum, allowing
     * the caller to retry later, instead of queueing indefinitely under the browser's control.
{'fraction_non_alphanumeric': 0.10406091370558376, 'fraction_numerical': 0.003553299492385787, 'mean_word_length': 2.329391891891892, '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': '1869916', 'n_tokens_mistral': 514, 'n_tokens_neox': 494, 'n_words': 181}