<commit_before># coding: utf-8
from __future__ import absolute_import
import json

from django.conf import settings as _settings
from kombu.serialization import registry

from .encoders import XJSONEncoder


# Register enhanced json encoder
def _json_dumps(obj):
    return json.dumps(obj, cls=XJSONEncoder)

registry.register('x-json', _json_dumps, json.loads, 'application/json', 'utf-8')

# Default limit for results of filter call
FILTER_LIMIT = 1000
# Default timeout for getting results
GET_RESULT_TIMEOUT = 10

# See Celery configuration parameters at
# http://docs.celeryproject.org/en/latest/configuration.html
# Some reasonable defaults are defined below

CELERY_RESULT_BACKEND = 'cache+memory://'

CELERY_DEFAULT_QUEUE = 'celery_rpc.requests'
CELERY_DEFAULT_EXCHANGE = 'celery_rpc'
CELERY_DEFAULT_ROUTING_KEY = 'celery_rpc'

# Do not let skip messages silently (RabbitMQ)
BROKER_TRANSPORT_OPTIONS = {'confirm_publish': True}

CELERY_ACKS_LATE = True
CELERY_TASK_SERIALIZER = 'x-json'
CELERY_RESULT_SERIALIZER = 'x-json'
<commit_msg>fix json.loads TypeError in python3<commit_after># coding: utf-8
from __future__ import absolute_import
import json

from django.conf import settings as _settings
from kombu.serialization import registry, bytes_t

from .encoders import XJSONEncoder


# Register enhanced json encoder
def _json_dumps(obj):
    return json.dumps(obj, cls=XJSONEncoder)
    
def _json_loads(obj):
    if isinstance(obj, bytes_t):
        obj = obj.decode()
    return json.loads(obj)


registry.register('x-json', _json_dumps, _json_loads, 'application/json', 'utf-8')

# Default limit for results of filter call
FILTER_LIMIT = 1000
# Default timeout for getting results
GET_RESULT_TIMEOUT = 10

# See Celery configuration parameters at
# http://docs.celeryproject.org/en/latest/configuration.html
# Some reasonable defaults are defined below

CELERY_RESULT_BACKEND = 'cache+memory://'

CELERY_DEFAULT_QUEUE = 'celery_rpc.requests'
CELERY_DEFAULT_EXCHANGE = 'celery_rpc'
CELERY_DEFAULT_ROUTING_KEY = 'celery_rpc'

# Do not let skip messages silently (RabbitMQ)
BROKER_TRANSPORT_OPTIONS = {'confirm_publish': True}

CELERY_ACKS_LATE = True
CELERY_TASK_SERIALIZER = 'x-json'
CELERY_RESULT_SERIALIZER = 'x-json'

{'fraction_non_alphanumeric': 0.08374384236453201, 'fraction_numerical': 0.00761307657859382, 'mean_word_length': 5.810975609756097, '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': '4360509', 'n_tokens_mistral': 758, 'n_tokens_neox': 747, 'n_words': 192}