<commit_before>"Default settings for django-scribbler."
from __future__ import unicode_literals

import hashlib

from django.conf import settings


DEFAULT_TIMEOUT = 12 * 60 * 60

CACHE_TIMEOUT = getattr(settings, 'SCRIBBLER_CACHE_TIMEOUT', DEFAULT_TIMEOUT)

CACHE_PREFIX = 'scribbler'


def default_cache_key(slug, url):
    "Construct a cache key for a given slug/url pair."
    sha = hashlib.sha1(b'{0}#{1}'.format(url, slug))
    return '{0}:{1}'.format(CACHE_PREFIX, sha.hexdigest())


CACHE_KEY_FUNCTION = default_cache_key # Not currently configurable<commit_msg>Cannot format bytes. Format as unicode and encode.<commit_after>"Default settings for django-scribbler."
from __future__ import unicode_literals

import hashlib

from django.conf import settings


DEFAULT_TIMEOUT = 12 * 60 * 60

CACHE_TIMEOUT = getattr(settings, 'SCRIBBLER_CACHE_TIMEOUT', DEFAULT_TIMEOUT)

CACHE_PREFIX = 'scribbler'


def default_cache_key(slug, url):
    "Construct a cache key for a given slug/url pair."
    sha = hashlib.sha1('{0}#{1}'.format(url, slug).encode('ascii'))
    return '{0}:{1}'.format(CACHE_PREFIX, sha.hexdigest())


CACHE_KEY_FUNCTION = default_cache_key # Not currently configurable
{'fraction_non_alphanumeric': 0.10654362416107382, 'fraction_numerical': 0.018456375838926176, 'mean_word_length': 5.5911602209944755, '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': '2177653', 'n_tokens_mistral': 395, 'n_tokens_neox': 378, 'n_words': 100}