<commit_before>import oebakery
from oebakery import die, err, warn, info, debug
import oelite.data
import sys, string

builtin_nohash = [
    "OE_REMOTES",
    "OE_MODULES",
    "BB_ENV_WHITELIST",
    "PATH",
    "PWD",
    "SHELL",
    "TERM",
    "TOPDIR",
    "TMPDIR",
    "BBPATH",
    "BBPATH_PRETTY",
    "BBFILES",
    "BBFILES_PRETTY",
    "BBRECIPES",
    "FILE",
    "_task_deps",
]

builtin_nohash_prefix = [
    "OE_REMOTE_",
    "OE_MODULE_",
]

def dump_var(key, o=sys.__stdout__, d=bb.data.init(), pretty=True,
             dynvars = {}):
    if pretty:
        eol = "\n\n"
    else:
        eol = "\n"

    val = d.getVar(key, True)

    if not val:
        return 0

    val = str(val)

    for varname in dynvars.keys():
        val = string.replace(val, dynvars[varname], "${%s}"%(varname))

    if d.getVarFlag(key, "func"):
        o.write("%s() {\n%s}%s"%(key, val, eol))
        return<commit_msg>lib/oelite: BBFILES is no more<commit_after>import oebakery
from oebakery import die, err, warn, info, debug
import oelite.data
import sys, string

builtin_nohash = [
    "OE_REMOTES",
    "OE_MODULES",
    "BB_ENV_WHITELIST",
    "PATH",
    "PWD",
    "SHELL",
    "TERM",
    "TOPDIR",
    "TMPDIR",
    "BBPATH",
    "BBPATH_PRETTY",
    "BBRECIPES",
    "BBRECIPES_PRETTY",
    "FILE",
    "_task_deps",
]

builtin_nohash_prefix = [
    "OE_REMOTE_",
    "OE_MODULE_",
]

def dump_var(key, o=sys.__stdout__, d=bb.data.init(), pretty=True,
             dynvars = {}):
    if pretty:
        eol = "\n\n"
    else:
        eol = "\n"

    val = d.getVar(key, True)

    if not val:
        return 0

    val = str(val)

    for varname in dynvars.keys():
        val = string.replace(val, dynvars[varname], "${%s}"%(varname))

    if d.getVarFlag(key, "func"):
        o.write("%s() {\n%s}%s"%(key, val, eol))
        return
{'fraction_non_alphanumeric': 0.16486486486486487, 'fraction_numerical': 0.001081081081081081, 'mean_word_length': 2.446927374301676, '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': '6049893', 'n_tokens_mistral': 777, 'n_tokens_neox': 756, 'n_words': 150}