<commit_before>from .basicauthutils import validate_request
from .response import HttpResponseUnauthorized


class BasicAuthMiddleware:
    def process_request(self, request):
        if not validate_request(request):
            return HttpResponseUnauthorized()
        return None<commit_msg>Updates for newstyle middleware, django 1.10+<commit_after>from .basicauthutils import validate_request
from .response import HttpResponseUnauthorized
from django.utils.deprecation import MiddlewareMixin


class BasicAuthMiddleware(MiddlewareMixin):
    def process_request(self, request):
        if not validate_request(request):
            return HttpResponseUnauthorized()
        return None
{'fraction_non_alphanumeric': 0.05346820809248555, 'fraction_numerical': 0.004335260115606936, 'mean_word_length': 4.634146341463414, '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': '6851208', 'n_tokens_mistral': 167, 'n_tokens_neox': 165, 'n_words': 48}