<commit_before># -*- coding: utf-8 -*-

# Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
from __future__ import unicode_literals

import os
import re
import shutil
import tempfile
import threading
import time
import unittest
import warnings

from django.conf import settings
from django.core import management
from django.core.cache import cache, caches, CacheKeyWarning, InvalidCacheBackendError
from django.db import connection, router, transaction
from django.core.cache.utils import make_template_fragment_key
from django.http import HttpResponse, StreamingHttpResponse
from django.middleware.cache import (FetchFromCacheMiddleware,
    UpdateCacheMiddleware, CacheMiddleware)
from django.template import Template
from django.template.response import TemplateResponse
from django.test import TestCase, TransactionTestCase, RequestFactory
from django.test.utils import (override_settings, IgnoreDeprecationWarningsMixin,
    IgnorePendingDeprecationWarningsMixin)
from django.utils import six
from django.utils import timezone
from django.utils import translation
from django.utils.cache import (patch_vary_headers, get_cache_key,
    learn_cache_key, patch_cache_control, patch_response_headers)
from django.utils.six.moves import cPickle as pickle
from django.utils.encoding import force_text
from django.views.decorators.cache import cache_page

from .models import Poll, expensive_calculation

<commit_msg>Don't fail if cPickle doesn't exist.<commit_after># -*- coding: utf-8 -*-

# Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
from __future__ import unicode_literals

import os
import re
import shutil
import tempfile
import threading
import time
import unittest
import warnings

from django.conf import settings
from django.core import management
from django.core.cache import cache, caches, CacheKeyWarning, InvalidCacheBackendError
from django.db import connection, router, transaction
from django.core.cache.utils import make_template_fragment_key
from django.http import HttpResponse, StreamingHttpResponse
from django.middleware.cache import (FetchFromCacheMiddleware,
    UpdateCacheMiddleware, CacheMiddleware)
from django.template import Template
from django.template.response import TemplateResponse
from django.test import TestCase, TransactionTestCase, RequestFactory
from django.test.utils import (override_settings, IgnoreDeprecationWarningsMixin,
    IgnorePendingDeprecationWarningsMixin)
from django.utils import six
from django.utils import timezone
from django.utils import translation
from django.utils.cache import (patch_vary_headers, get_cache_key,
    learn_cache_key, patch_cache_control, patch_response_headers)
from django.utils.encoding import force_text
from django.views.decorators.cache import cache_page

try:    # Use the same idiom as in cache backends
    from django.utils.six.moves import cPickle as pickle
except ImportError:
    import pickle

from .models import Poll, expensive_calculation


{'fraction_non_alphanumeric': 0.04739960500329164, 'fraction_numerical': 0.0006583278472679394, 'mean_word_length': 6.287769784172662, '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': '5750364', 'n_tokens_mistral': 774, 'n_tokens_neox': 773, 'n_words': 286}