<commit_before>from django.shortcuts import render

# Create your views here.
from django.http import HttpResponse, JsonResponse, HttpResponseNotAllowed
from models import *
import json
from django.core import serializers
import urllib2
from django.views.decorators.csrf import csrf_exempt


@csrf_exempt
def consume(request):
    app_id = "id=762ab8eb-e560-48a9-8b05-a0acd9d5e1fd&subscription-key=<KEY>"
    if request.method == "GET":
        return HttpResponseNotAllowed

    json_data = json.loads(request.body)
    response = urllib2.urlopen(str.format("https://api.projectoxford.ai/luis/v1/application?%s&q=rain", app_id)).read()
    return HttpResponse(response)
<commit_msg>no message<commit_after>from django.shortcuts import render

# Create your views here.
from django.http import HttpResponse, JsonResponse, HttpResponseNotAllowed
from models import *
import json
from django.core import serializers
import urllib2
from django.views.decorators.csrf import csrf_exempt


@csrf_exempt
def consume(request):
    app_id = "id=762ab8eb-e560-48a9-8b05-a0acd9d5e1fd&subscription-key=<KEY>"
    if request.method == "GET":
        return HttpResponseNotAllowed

    json_data = json.loads(request.body)

    response = urllib2.urlopen(str.format("https://api.projectoxford.ai/luis/v1/application?{}&q={}",
                                          app_id, json_data['message'])).read()
    return HttpResponse(response)

{'fraction_non_alphanumeric': 0.10238429172510519, 'fraction_numerical': 0.028050490883590462, 'mean_word_length': 4.40530303030303, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '200223', 'n_tokens_mistral': 472, 'n_tokens_neox': 459, 'n_words': 94}