<commit_before>#-*- coding: utf-8 -*-
"""
MeuhDB, a database that says "meuh".
"""
from __future__ import unicode_literals
from functools import wraps
import json
import os
from uuid import uuid4
import warnings

import six

DUMPER = {
    'json': json.dumps
}
LOADER = {
    'json': json.loads
}
DEFAULT_BACKEND = 'json'

try:
    import simplejson
    DUMPER.update({'simplejson': simplejson.dumps})
    LOADER.update({'simplejson': simplejson.loads})
    DEFAULT_BACKEND = 'simplejson'
except ImportError:
    pass

try:
    import jsonlib
    DUMPER.update({'jsonlib': jsonlib.dumps})
    LOADER.update({'jsonlib': jsonlib.loads})
    DEFAULT_BACKEND = 'jsonlib'
except ImportError:
    pass

try:
    import yajl
    DUMPER.update({'yajl': yajl.dumps})
    LOADER.update({'yajl': yajl.loads})
    DEFAULT_BACKEND = 'yajl'
except ImportError:
    pass

try:
    import ujson
    DUMPER.update({'ujson': ujson.dumps})
    LOADER.update({'ujson': ujson.loads})
    DEFAULT_BACKEND = 'ujson'
except ImportError:
    pass


def autocommit(f):
    "A decorator to commit to the storage if autocommit is set to True."
    @wraps(f)
    def wrapper(self, *args, **kwargs):
        result = f(self, *args, **kwargs)
        if self._meta.autocommit:
            self.commit()
        return result
    return wrapper


def intersect(d1, d2):<commit_msg>according to basic tests, reordering packages priorities<commit_after>#-*- coding: utf-8 -*-
"""
MeuhDB, a database that says "meuh".
"""
from __future__ import unicode_literals
from functools import wraps
import json
import os
from uuid import uuid4
import warnings

import six

DUMPER = {
    'json': json.dumps
}
LOADER = {
    'json': json.loads
}
DEFAULT_BACKEND = 'json'

try:
    import simplejson
    DUMPER.update({'simplejson': simplejson.dumps})
    LOADER.update({'simplejson': simplejson.loads})
    DEFAULT_BACKEND = 'simplejson'
except ImportError:
    pass

try:
    import yajl
    DUMPER.update({'yajl': yajl.dumps})
    LOADER.update({'yajl': yajl.loads})
    DEFAULT_BACKEND = 'yajl'
except ImportError:
    pass

try:
    import jsonlib
    DUMPER.update({'jsonlib': jsonlib.dumps})
    LOADER.update({'jsonlib': jsonlib.loads})
    DEFAULT_BACKEND = 'jsonlib'
except ImportError:
    pass

try:
    import ujson
    DUMPER.update({'ujson': ujson.dumps})
    LOADER.update({'ujson': ujson.loads})
    DEFAULT_BACKEND = 'ujson'
except ImportError:
    pass


def autocommit(f):
    "A decorator to commit to the storage if autocommit is set to True."
    @wraps(f)
    def wrapper(self, *args, **kwargs):
        result = f(self, *args, **kwargs)
        if self._meta.autocommit:
            self.commit()
        return result
    return wrapper


def intersect(d1, d2):
{'fraction_non_alphanumeric': 0.12148850784385261, 'fraction_numerical': 0.002918642831083546, 'mean_word_length': 3.359300476947536, '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': '5124602', 'n_tokens_mistral': 961, 'n_tokens_neox': 956, 'n_words': 243}