<commit_before>// APIs for language/runtime support (records, locals, function values)

namespace pxsim {
    export var quiet = false;

    export function check(cond: boolean, msg: string = "sim: check failed") {
        if (!cond) {
            debugger
            throw new Error(msg)
        }
    }

    let floatingPoint = false;
    let cfgKey: Map<number> = {}
    let cfg: Map<number> = {}

    export function getConfig(id: number) {
        if (cfg.hasOwnProperty(id + ""))
            return cfg[id + ""]
        return null
    }

    export function getConfigKey(id: string) {
        if (cfgKey.hasOwnProperty(id))
            return cfgKey[id]
        return null
    }

    export function getAllConfigKeys() {
        return Object.keys(cfgKey)
    }

    export function setConfig(id: number, val: number) {
        cfg[id] = val
    }<commit_msg>Fix undefined pxsim.noRefCounting. (#3506)<commit_after>// APIs for language/runtime support (records, locals, function values)

namespace pxsim {
    export var quiet = false;

    export function check(cond: boolean, msg: string = "sim: check failed") {
        if (!cond) {
            debugger
            throw new Error(msg)
        }
    }

    let floatingPoint = false;
    let cfgKey: Map<number> = {}
    let cfg: Map<number> = {}

    export function noRefCounting() {
        if (runtime) runtime.refCounting = false;
    }

    export function getConfig(id: number) {
        if (cfg.hasOwnProperty(id + ""))
            return cfg[id + ""]
        return null
    }

    export function getConfigKey(id: string) {
        if (cfgKey.hasOwnProperty(id))
            return cfgKey[id]
        return null
    }

    export function getAllConfigKeys() {
        return Object.keys(cfgKey)
    }

    export function setConfig(id: number, val: number) {
        cfg[id] = val
    }
{'fraction_non_alphanumeric': 0.1064516129032258, 'fraction_numerical': 0.002150537634408602, 'mean_word_length': 2.1649659863945576, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3060744', 'n_tokens_mistral': 549, 'n_tokens_neox': 535, 'n_words': 154}