<commit_before>import json

__version__ = '0.1'


class VersionConflictionException(Exception):
    def __init__(self, n):
        super().__init__('Version {} has already been specified'.format(n))


def database():
    def instance():
        versions = {}
        latest = -1

        def version(n=0):
            def wrapper(cls):
                if n in versions:
                    raise VersionConflictionException(n)
                versions[n] = cls
                nonlocal latest
                latest = max(latest, n)
                return cls
            return wrapper

        def record(jstr):
            jobj = json.loads(jstr)
            n = jobj['__ver']
            while n < latest:
                cls = versions[n + 1]
                cls.migrate(jobj)
                n += 1
            jobj['__ver'] = latest
            return versions[latest](jobj)
<commit_msg>use _ver instead of __ver<commit_after>import json

__version__ = '0.1.1'


class VersionConflictionException(Exception):
    def __init__(self, n):
        super().__init__('Version {} has already been specified'.format(n))


def database():
    def instance():
        versions = {}
        latest = -1

        def version(n=0):
            def wrapper(cls):
                if n in versions:
                    raise VersionConflictionException(n)
                versions[n] = cls
                nonlocal latest
                latest = max(latest, n)
                return cls
            return wrapper

        def record(jstr):
            jobj = json.loads(jstr)
            n = jobj['_ver']
            while n < latest:
                cls = versions[n + 1]
                cls.migrate(jobj)
                n += 1
            jobj['_ver'] = latest
            return versions[latest](jobj)

{'fraction_non_alphanumeric': 0.0961111111111111, 'fraction_numerical': 0.007222222222222222, 'mean_word_length': 1.4272237196765498, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1853454', 'n_tokens_mistral': 499, 'n_tokens_neox': 472, 'n_words': 126}