<commit_before>"""Application base, containing global templates."""
import re
from django.http import HttpResponsePermanentRedirect
from django.shortcuts import redirect
from urlresolvers import reverse


old_ie_patterns = re.compile(".*MSIE [6-8]\.")


class BrowserDetectionMiddleware(object):
    def process_request(self, request):
        if old_ie_patterns.match(request.META['HTTP_USER_AGENT']):
            redirect_path = reverse('not.supported')
            if request.path != redirect_path:
                return HttpResponsePermanentRedirect(redirect_path)
<commit_msg>Fixed import.<commit_after>"""Application base, containing global templates."""
import re
from django.core.urlresolvers import reverse
from django.http import HttpResponsePermanentRedirect
from django.shortcuts import redirect

old_ie_patterns = re.compile(".*MSIE [6-8]\.")


class BrowserDetectionMiddleware(object):
    def process_request(self, request):
        if old_ie_patterns.match(request.META['HTTP_USER_AGENT']):
            redirect_path = reverse('not.supported')
            if request.path != redirect_path:
                return HttpResponsePermanentRedirect(redirect_path)

{'fraction_non_alphanumeric': 0.09446808510638298, 'fraction_numerical': 0.003404255319148936, 'mean_word_length': 4.394495412844036, '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': '5181116', 'n_tokens_mistral': 323, 'n_tokens_neox': 309, 'n_words': 73}