<commit_before>define(function (require, exports) {

    var schemes = {
        'basic': function(login, password) {
            return 'Basic ' + btoa(login + ':' + password);
        },
        'token': function(token) {
            return 'Token ' + token;
        }
    };

    exports.Authorizaeble = function() {

        var value;

        function authorize() {
            var args = Array.prototype.slice.call(arguments),
                scheme = args && (args.shift() || '').toLowerCase();

            if (!scheme) {
                return value;
            }

            if (schemes[scheme]) {
                return value = schemes[scheme].apply(this, args);
            } else {
                // plain authorization 'Scheme credentials'
                scheme = scheme.charAt(0).toUpperCase() + scheme.substr(1); // uppercase first
                return value = scheme + (args[0] ? ' ' + args[0] : '');
            }
        }

        function unauthorize() {
            value = undefined;
        }

        for (var scheme in schemes) {
            authorize[scheme] = (function(scheme) {
                return function() {
                    var args = Array.prototype.slice.call(arguments);

                    args.unshift(scheme);

                    return authorize.apply(this, args);
                }
            })(scheme);
        }

        this.authorize = authorize;
        this.unauthorize = unauthorize;

    };

});
<commit_msg>Fixed case transformation of authentification scheme<commit_after>define(function (require, exports) {

    var schemes = {

        'basic': function(login, password) {
            return 'Basic ' + btoa(login + ':' + password);
        },

        'token': function(token) {
            return 'Token ' + token;
        }

    };

    exports.Authorizaeble = function() {

        var value;

        function authorize() {
            var args = Array.prototype.slice.call(arguments),
                scheme = args && args.shift(),
                predefined;

            if (!scheme) {
                return value;
            }

            predefined = schemes[scheme.toLowerCase()];

            if (predefined) {
                return value = predefined.apply(this, args);
            } else {
                // plain authorization 'Scheme credentials'
                return value = scheme + (args[0] ? ' ' + args[0] : '');
            }

        }

        function unauthorize() {
            value = undefined;
        }

        for (var scheme in schemes) {

            authorize[scheme.toLowerCase()] = (function(scheme) {

                return function() {
                    var args = Array.prototype.slice.call(arguments);

                    args.unshift(scheme);

                    return authorize.apply(this, args);
                }

            })(scheme);

        }

        this.authorize = authorize;
        this.unauthorize = unauthorize;

    };

});

{'fraction_non_alphanumeric': 0.11467444120505345, 'fraction_numerical': 0.001943634596695821, 'mean_word_length': 1.2789667896678967, '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': '1485862', 'n_tokens_mistral': 824, 'n_tokens_neox': 729, 'n_words': 162}