<commit_before>from django.http import HttpResponsePermanentRedirect


class DomainRedirectMiddleware(object):

    def process_request(self, request):
        if request.method != 'GET':
            return None
        host = request.get_host()
        if host != 'scoretool.appspot.com':<commit_msg>Don't redirect App Engine cron jobs.<commit_after>from django.http import HttpResponsePermanentRedirect


class DomainRedirectMiddleware(object):

    def process_request(self, request):
        if request.method != 'GET':
            # Only redirect GET requests.
            return None
        if request.META['REMOTE_ADDR'] == '0.1.0.1':
            # Don't redirect cron jobs.
            return None
        host = request.get_host()
        if host != 'scoretool.appspot.com':
            # Only redirect default version.
{'fraction_non_alphanumeric': 0.09408926417370325, 'fraction_numerical': 0.0048250904704463205, 'mean_word_length': 2.6244541484716155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '192172', 'n_tokens_mistral': 225, 'n_tokens_neox': 212, 'n_words': 59}