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

from __future__ import unicode_literals
from django.utils import translation
from django.db.models import ObjectDoesNotExist
from pybb import util

class PybbMiddleware(object):
    def process_request(self, request):<commit_msg>close #244 update middleware for django 1.10<commit_after># -*- coding: utf-8 -*-

from __future__ import unicode_literals

import django
from django.utils import translation
from django.db.models import ObjectDoesNotExist
from pybb import util


if django.VERSION < (1, 10):
    MiddlewareParentClass = object
else:
    from django.utils.deprecation import MiddlewareMixin
    MiddlewareParentClass = MiddlewareMixin


class PybbMiddleware(MiddlewareParentClass):
    def process_request(self, request):
{'fraction_non_alphanumeric': 0.07373868046571798, 'fraction_numerical': 0.014230271668822769, 'mean_word_length': 5.2926829268292686, 'pattern_counts': {'":': 0, '<': 4, '<?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': '5172733', 'n_tokens_mistral': 222, 'n_tokens_neox': 214, 'n_words': 68}