<commit_before>"""
extend TiddlyWiki serialization to optionally use beta or externalized
releases

activated via "twrelease=beta" URL parameter
"""


import logging

from tiddlyweb.control import filter_tiddlers
from tiddlyweb.util import read_utf8_file

from tiddlywebwiki.serialization import Serialization as WikiSerialization

from tiddlywebplugins.tiddlyspace.space import Space

def build_config_var(alpha=False, beta=False, external=False):
    base = 'base_tiddlywiki'
    if external:
        base += '_external'
    if beta:
        base += '_beta'
    elif alpha:
        base += '_alpha'
    return base


class Serialization(WikiSerialization):

    def list_tiddlers(self, tiddlers):
        """
        Push out a wiki. Filter out the system- bags, if we are
        download only.
        """
        download = self.environ.get('tiddlyweb.query', {}).get(
                'download', [False])[0]
        if download:
            filter_string = ';'.join(
                    ['select=bag:!%s' % bag for bag, _ in Space.CORE_RECIPE if
                        bag.endswith('_public')])
            tiddlers = filter_tiddlers(tiddlers, filter_string,
                    environ=self.environ)
        return self._put_tiddlers_in_tiddlywiki(tiddlers)<commit_msg>Revert "Merge branch 'master' into downloadlite"<commit_after>"""
extend TiddlyWiki serialization to optionally use beta or externalized
releases

activated via "twrelease=beta" URL parameter
"""


import logging

from tiddlyweb.control import filter_tiddlers
from tiddlyweb.util import read_utf8_file

from tiddlywebwiki.serialization import Serialization as WikiSerialization

from tiddlywebplugins.tiddlyspace.space import Space

def build_config_var(alpha=False, beta=False, external=False):
    base = 'base_tiddlywiki'
    if external:
        base += '_external'
    if beta:
        base += '_beta'
    elif alpha:
        base += '_alpha'
    return base


class Serialization(WikiSerialization):
{'fraction_non_alphanumeric': 0.08324924318869828, 'fraction_numerical': 0.0015136226034308778, 'mean_word_length': 3.2191489361702126, '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': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3948533', 'n_tokens_mistral': 598, 'n_tokens_neox': 580, 'n_words': 160}