<commit_before>from datetime import datetime
import re
import sys
import time

from django import VERSION
from django.contrib import admin, messages
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.views import debug

from celery import current_app

from .tasks import celery_health_task


def timezone_view(request):
    """Admin view showing times and timezones in data."""
    # Note: This is an admin page that gets used once in a blue moon.
    # As such, I'm taking some liberties (hand-indexing the response,
    # time.sleep, etc) that I would never take if it was used more
    # often or was viewable by users. If these two assumptions ever
    # change, then this should be rewritten.

    from elasticutils import get_es

    from fjord.feedback.models import Response, ResponseMappingType
    from fjord.feedback.tests import ResponseFactory
    from fjord.search.index import get_index

    server_time = datetime.now()

    # Create a new response.
    resp = ResponseFactory.create()<commit_msg>Switch to the correct get_es<commit_after>from datetime import datetime
import re
import sys
import time

from django import VERSION
from django.contrib import admin, messages
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.views import debug

from celery import current_app

from .tasks import celery_health_task


def timezone_view(request):
    """Admin view showing times and timezones in data."""
    # Note: This is an admin page that gets used once in a blue moon.
    # As such, I'm taking some liberties (hand-indexing the response,
    # time.sleep, etc) that I would never take if it was used more
    # often or was viewable by users. If these two assumptions ever
    # change, then this should be rewritten.

    from elasticutils.contrib.django import get_es

    from fjord.feedback.models import Response, ResponseMappingType
    from fjord.feedback.tests import ResponseFactory
    from fjord.search.index import get_index

    server_time = datetime.now()

    # Create a new response.
    resp = ResponseFactory.create()
{'fraction_non_alphanumeric': 0.0514018691588785, 'fraction_numerical': 0.0, 'mean_word_length': 3.9218390804597703, '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': '1159094', 'n_tokens_mistral': 573, 'n_tokens_neox': 546, 'n_words': 255}