<commit_before># coding: utf-8

import json
from StringIO import StringIO
from django.core.management import call_command
from django.shortcuts import render
from django.views.generic import TemplateView, View
from django.http import JsonResponse, HttpResponse


class IndexView(TemplateView):
    template_name = "main.html"


class EvalResponseView(View):

    def post(self, request):
        to_eval = request.POST.get("toEval")
        try:
            out = StringIO()
            call_command("eval", to_eval, stdout=out)
            out, err = out.getvalue().split("}##{")
            return JsonResponse({'out':  out, 'err': err})
        except Exception as err:
            return HttpResponse(status=500, reason=str(err))
<commit_msg>remove unused imports<commit_after># coding: utf-8

from StringIO import StringIO
from django.core.management import call_command
from django.views.generic import TemplateView, View
from django.http import JsonResponse, HttpResponse


class IndexView(TemplateView):
    template_name = "main.html"


class EvalResponseView(View):

    def post(self, request):
        to_eval = request.POST.get("toEval")
        try:
            out = StringIO()
            call_command("eval", to_eval, stdout=out)
            out, err = out.getvalue().split("}##{")
            return JsonResponse({'out':  out, 'err': err})
        except Exception as err:
            return HttpResponse(status=500, reason=str(err))

{'fraction_non_alphanumeric': 0.1081267217630854, 'fraction_numerical': 0.005509641873278237, 'mean_word_length': 3.2238372093023258, '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': '5864524', 'n_tokens_mistral': 415, 'n_tokens_neox': 403, 'n_words': 114}