<commit_before>define([],function () {
    /**
     * This script is responsible to provide the correct domain name to use
     * for webservices consumption according to the browsed domain name
     */

    var domain_switcher = function(){
        this.items = [];
        this.forced = false;
    };
    domain_switcher.prototype.reference = function(browsed, consumed,allow_ssl,allow_tracking){
        this.items.push({
            browsed:browsed,
            consumed:consumed,
            allow_ssl:allow_ssl,
            allow_tracking:allow_tracking
        });
    };
    domain_switcher.prototype.get_consumed = function(browsed){
        if( this.forced ){
            return this.forced;
        }
        browsed = !browsed?window.location.hostname:browsed;
        for(var n in this.items ){
            var b = this.items[n];
            if(b.browsed.indexOf){ // is it a string ?
                if(b.browsed == browsed ){
                    return b;
                }
            }else{  // then it is a function handler
                if( b.browsed(browsed) ){
                    return b;
                }
            }
        }
    };
    domain_switcher.prototype.get = function(url){
        var domain = this.get_consumed();
        return "http://"+domain.consumed+url;
    };
    domain_switcher.prototype.getSsl = function(url){
        var domain = this.get_consumed();
        return "http"+(domain.allow_ssl?"s":"")+"://"+domain.consumed+url;
    };
    domain_switcher.prototype.trackingAllowed = function(){
        return this.get_consumed().allow_tracking==true;
    };
    domain_switcher.prototype.force = function(consumed){
        this.forced = consumed;
    };
<commit_msg>routine code update<commit_after>define([],function () {
    /**
     * This script is responsible to provide the correct domain name to use
     * for webservices consumption according to the browsed domain name
     */

    var domain_switcher = function(){
        this.items = [];
        this.forced = false;
    };
    domain_switcher.prototype.reference = function(browsed, consumed,allow_ssl,allow_tracking){
        this.items.push({
            browsed:browsed,
            consumed:consumed,
            allow_ssl:allow_ssl,
            allow_tracking:allow_tracking
        });
    };
    domain_switcher.prototype.get_consumed = function(currently_browsed){
        if( this.forced ){
            return this.forced;
        }
        currently_browsed = !currently_browsed?window.location.host:currently_browsed;
        for(var n in this.items ){
            var b = this.items[n];
            if(b.browsed.indexOf){ // is it a string ?
                if(b.browsed == currently_browsed ){
                    return b;
                }
            }else{  // then it is a function handler
                if( b.browsed(currently_browsed) ){
                    return b;
                }
            }
        }
    };
    domain_switcher.prototype.get = function(url){
        var domain = this.get_consumed();
        return "http://"+domain.consumed+url;
    };
    domain_switcher.prototype.getSsl = function(url){
        var domain = this.get_consumed();
        return "http"+(domain.allow_ssl?"s":"")+"://"+domain.consumed+url;
    };
    domain_switcher.prototype.trackingAllowed = function(){
        return this.get_consumed().allow_tracking==true;
    };
    domain_switcher.prototype.force = function(consumed){
        this.forced = consumed;
    };

{'fraction_non_alphanumeric': 0.1142204454597373, 'fraction_numerical': 0.0, 'mean_word_length': 1.971162001696353, 'pattern_counts': {'":': 4, '<': 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': '3942790', 'n_tokens_mistral': 1008, 'n_tokens_neox': 999, 'n_words': 188}