<commit_before>var { getCookies, addCookie } = cookie;
var { File } = this;
function isFile(a) {
    if (File) {
        return a instanceof File;
    }
}
var base = null, location_href = null;
var encrypt = null;
//               /////  1   ////////// 2 /////// 3 ////    4  //
var domainReg = /^(?:(https?)\:)?\/\/(.*?)(?:\/(.*?))?([\?#].*)?$/i;
var setHost = function (host) {
    base = host;
    encrypt = null;
};
var HeadersKeys = ["Content-Type"];
var cors_hosts = [];
function getDomainPath(url) {
    return url.replace(domainReg, "$2/$3");
}
function getRequestProtocol(url) {
    if (/^https:/i.test(url)) {
        return "https:";
    }
    return "http:";
}
function isChildPath(relative, path) {
    return relative.replace(/^(.*\/)[^\/]*$/, path);
}

var getCrossUrl = function (domain, headers, encrypt) {
    if (notCross(domain)) return domain;
    var originDomain = getDomainPath(domain);
    var _cookies = getCookies(originDomain);
    var _headers = {};
    if (_cookies) {
        _headers.Cookie = _cookies;
    }
    extend(_headers, headers);
    _headers = serialize(_headers);
    if (_headers) _headers = "," + _headers;
    var b = encrypt ? "!" : `*`;
    var ishttps = /^(https\:|s\/\/)/i.test(domain);
    domain = domain
        .replace(/^(s?)(\/\/)/i, "http$1:$2")
        .replace(domainReg, `$2${_headers}/$3$4`)
    if (ishttps) domain = b + domain;
    if (encrypt) domain = encode62.timeencode(domain);
    return base + b + domain;
};
function noop() { }
function toResponse() {
    if (this.responseType === 'json') return JSON.stringify(this.response);
    return this.response;
}
function cross_(jsonp, digest = noop, method, url, headers) {
    var originDomain = getDomainPath(url);
    if (!originDomain) throw new Error("路径格式错误！");
    var _cookies = getCookies(originDomain);
    var _headers = {};
    if (_cookies) {
        _headers.Cookie = _cookies;
    }
    extend(_headers, headers);
    if (/^[mc]/i.test(method)) {
        _headers["User-Agent"] = /^m/i.test(method)
            ? "Efront/1.9 (iPhone) Safari/602.1"
            : "Efront/1.9 (Windows) Chrome/77.0.3865.90";
        method = method.slice(1);
    }
    var loaded, errored;
    var onload = function (data) {
        removeFromList(requests, xhr);
        if (xhr.decoder) {
            data = xhr.decoder(data);
        }
        loaded = data;
        flush();
        digest();
    };
    var onerror1 = function (e) {
        removeFromList(requests, xhr);
        errored = e || "未知错误！";
        flush();
        digest();
    };
    var onerror = async function (e) {
        if (e.type === 'error') {
            e = { response: "无法访问服务器", toString: toResponse };
        }
        for (var r of reforms) {
            var r = await reform(r, { method, url, status: xhr.status, headers: _headers }, fire, onerror1, e);
            if (r === false) return;
        }
        onerror1(e);
    };
    var flush = function () {
        var then = xhr.then;
        delete xhr.then;
        if (loaded) onloads.splice(0, onloads.length).map(e => e instanceof Function && e(xhr));
        if (errored) onerrors.splice(0, onerrors.length).map(e => e instanceof Function && e(errored));
        xhr.then = then;
    };
    if (/^jsonp/i.test(method)) {
        var cb = method.split('\-')[1] || 'callback';
        setTimeout(function () {
            if (!isEmpty(jsondata) && isEmpty(datas)) {
                datas = serialize(jsondata);
            }
            if (datas) {
                xhr.src += (/\?/.test(xhr.src) ? "&" : "?") + datas;
            }
        });
        var xhr = jsonp(url, {
            [cb](a) {
                onload({ status: 200, response: JSON.stringify(a), toString: toResponse });
            }
        });
        xhr.onerror = onerror;
    }
    else {
        var nocross = notCross(url);
        var callback = async function () {
            var exposeHeaders = !nocross && xhr.getResponseHeader("access-control-expose-headers");
            var exposeMap = {};
            if (exposeHeaders) exposeHeaders.split(",").forEach(h => exposeMap[h.toLowerCase()] = true);
            if (xhr.getResponseHeader) {
                var exposekey = nocross ? "set-cookie" : "efront-cookie";
                if (exposeMap[exposekey]) {
                    var cookie = xhr.getResponseHeader(exposekey);<commit_msg>修复一处错误<commit_after>var { getCookies, addCookie } = cookie;
var { File } = this;
function isFile(a) {
    if (File) {
        return a instanceof File;
    }
}
var base = null, location_href = null;
var encrypt = null;
//               /////  1   ////////// 2 /////// 3 ////    4  //
var domainReg = /^(?:(https?)\:)?\/\/(.*?)(?:\/(.*?))?([\?#].*)?$/i;
var setHost = function (host) {
    base = host;
    encrypt = null;
};
var HeadersKeys = ["Content-Type"];
var cors_hosts = [];
function getDomainPath(url) {
    return url.replace(domainReg, "$2/$3");
}
function getRequestProtocol(url) {
    if (/^https:/i.test(url)) {
        return "https:";
    }
    return "http:";
}
function isChildPath(relative, path) {
    return relative.replace(/^(.*\/)[^\/]*$/, path);
}

var getCrossUrl = function (domain, headers, encrypt) {
    if (notCross(domain)) return domain;
    var originDomain = getDomainPath(domain);
    var _cookies = getCookies(originDomain);
    var _headers = {};
    if (_cookies) {
        _headers.Cookie = _cookies;
    }
    extend(_headers, headers);
    _headers = serialize(_headers);
    if (_headers) _headers = "," + _headers;
    var b = encrypt ? "!" : `*`;
    var ishttps = /^(https\:|s\/\/)/i.test(domain);
    domain = domain
        .replace(/^(s?)(\/\/)/i, "http$1:$2")
        .replace(domainReg, `$2${_headers}/$3$4`)
    if (ishttps) domain = b + domain;
    if (encrypt) domain = encode62.timeencode(domain);
    return base + b + domain;
};
function noop() { }
function toResponse() {
    if (this.responseType === 'json') return JSON.stringify(this.response);
    return this.response;
}
function cross_(jsonp, digest = noop, method, url, headers) {
    var originDomain = getDomainPath(url);
    if (!originDomain) throw new Error("路径格式错误！");
    var _cookies = getCookies(originDomain);
    var _headers = {};
    if (_cookies) {
        _headers.Cookie = _cookies;
    }
    extend(_headers, headers);
    if (/^[mc]/i.test(method)) {
        _headers["User-Agent"] = /^m/i.test(method)
            ? "Efront/1.9 (iPhone) Safari/602.1"
            : "Efront/1.9 (Windows) Chrome/77.0.3865.90";
        method = method.slice(1);
    }
    var loaded, errored;
    var onload = function (data) {
        if (xhr.decoder) {
            data = xhr.decoder(data);
        }
        loaded = data;
        flush();
        digest();
    };
    var onerror1 = function (e) {
        errored = e || "未知错误！";
        flush();
        digest();
    };
    var onerror = async function (e) {
        if (e.type === 'error') {
            removeFromList(requests, e.target);
            e = { response: "无法访问服务器", toString: toResponse };
        }
        for (var r of reforms) {
            var r = await reform(r, { method, url, status: xhr.status, headers: _headers }, fire, onerror1, e);
            if (r === false) return;
        }
        onerror1(e);
    };
    var flush = function () {
        var then = xhr.then;
        delete xhr.then;
        if (loaded) onloads.splice(0, onloads.length).map(e => e instanceof Function && e(xhr));
        if (errored) onerrors.splice(0, onerrors.length).map(e => e instanceof Function && e(errored));
        xhr.then = then;
    };
    if (/^jsonp/i.test(method)) {
        var cb = method.split('\-')[1] || 'callback';
        setTimeout(function () {
            if (!isEmpty(jsondata) && isEmpty(datas)) {
                datas = serialize(jsondata);
            }
            if (datas) {
                xhr.src += (/\?/.test(xhr.src) ? "&" : "?") + datas;
            }
        });
        var xhr = jsonp(url, {
            [cb](a) {
                onload({ status: 200, response: JSON.stringify(a), toString: toResponse });
            }
        });
        xhr.onerror = onerror;
    }
    else {
        var nocross = notCross(url);
        var callback = async function () {
            removeFromList(requests, xhr);
            var exposeHeaders = !nocross && xhr.getResponseHeader("access-control-expose-headers");
            var exposeMap = {};
            if (exposeHeaders) exposeHeaders.split(",").forEach(h => exposeMap[h.toLowerCase()] = true);
            if (xhr.getResponseHeader) {
                var exposekey = nocross ? "set-cookie" : "efront-cookie";
                if (exposeMap[exposekey]) {
                    var cookie = xhr.getResponseHeader(exposekey);
{'fraction_non_alphanumeric': 0.17233896756509823, 'fraction_numerical': 0.009136592051164915, 'mean_word_length': 2.1053191489361702, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7420040', 'n_tokens_mistral': 2919, 'n_tokens_neox': 2855, 'n_words': 633}