<commit_before>import { XmlError, XE } from "xmljs";

export interface CryptoEx extends Crypto {
    name: string;
}

let _crypto: CryptoEx | null = null;

if (typeof self !== "undefined") {
    _crypto = self.crypto as any;
    _crypto!.name = "Browser";
}

export class Application {

    /**
     * Sets crypto engine for the current Application
     * @param  {string} name
     * @param  {Crypto} crypto
     * @returns void
     */
    static setEngine(name: string, crypto: Crypto): void {
        _crypto = crypto as CryptoEx;
        _crypto.name = name;
    }

    /**
     * Gets the crypto module from the Application
     */
    static get crypto(): CryptoEx {
        if (!_crypto)
            throw new XmlError(XE.CRYPTOGRAPHIC_NO_MODULE);
        return _crypto;
    }

    static isNodePlugin(): boolean {
        return (typeof module !== "undefined");
    }
}

// set default w3 WebCrypto
+function init() {
    if (!Application.isNodePlugin()) {<commit_msg>Fix isNodePlugin<commit_after>import { XmlError, XE } from "xmljs";

export interface CryptoEx extends Crypto {
    name: string;
}

let _crypto: CryptoEx | null = null;

if (typeof self !== "undefined") {
    _crypto = self.crypto as any;
    _crypto!.name = "Browser";
}

export class Application {

    /**
     * Sets crypto engine for the current Application
     * @param  {string} name
     * @param  {Crypto} crypto
     * @returns void
     */
    static setEngine(name: string, crypto: Crypto): void {
        _crypto = crypto as CryptoEx;
        _crypto.name = name;
    }

    /**
     * Gets the crypto module from the Application
     */
    static get crypto(): CryptoEx {
        if (!_crypto)
            throw new XmlError(XE.CRYPTOGRAPHIC_NO_MODULE);
        return _crypto;
    }

    static isNodePlugin(): boolean {
        return (typeof self === "undefined" && typeof window === "undefined");
    }
}

// set default w3 WebCrypto
+function init() {
    if (!Application.isNodePlugin()) {
{'fraction_non_alphanumeric': 0.11507537688442211, 'fraction_numerical': 0.0010050251256281408, 'mean_word_length': 2.5238938053097346, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1732538', 'n_tokens_mistral': 607, 'n_tokens_neox': 590, 'n_words': 184}