<commit_before>from django.shortcuts import render
from django.http import HttpResponse
from .forms import SimpleTestWidgetForm
import os
import sys

# Create your views here.
def demo_map(request):
    return render(request,
                  'widgets/demo_map.html',
                  {'api_key' : os.environ["GOOGLE_MAPS_API_KEY"]})
def demo_poly_mark(request):
    return render(request,
                  'widgets/demo_poly_mark.html',
                  {'api_key' : os.environ["GOOGLE_MAPS_API_KEY"]})

def simple_test_widget(request):
	if request.method == 'POST':
		form = SimpleTestWidgetForm(request.POST)
		if form.is_valid():
			sys.stderr.write("valid form")
			sys.stderr.write(str(form.cleaned_data))
			sys.stderr.flush()
			return HttpResponse("Form is Valid")
		else:
			sys.stderr.write("invalid form")
			sys.stderr.write(str(form.cleaned_data))
			sys.stderr.flush()
			return render(request, 'widgets/simple_test_widget.html', {'form': form})
	else:
		form = SimpleTestWidgetForm()
		return render(request, 'widgets/simple_test_widget.html', {'form': form})<commit_msg>a file missed for commit<commit_after>from django.shortcuts import render
from django.http import HttpResponse
from .forms import SimpleTestWidgetForm
import os
import sys

# Create your views here.
def demo_map(request):
    return render(request,
                  'widgets/demo_map.html',
                  {'api_key' : os.environ["GOOGLE_MAPS_API_KEY"]})

def demo_poly_mark(request):
    return render(request,
                  'widgets/demo_poly_mark.html',
                  {'api_key' : os.environ["GOOGLE_MAPS_API_KEY"]})

def simple_test_widget(request):
	if request.method == 'POST':
		form = SimpleTestWidgetForm(request.POST)
		if form.is_valid():
			sys.stderr.write("valid form")
			sys.stderr.write(str(form.cleaned_data))
			sys.stderr.flush()
			return HttpResponse("Form is Valid")
		else:
			sys.stderr.write("invalid form")
			sys.stderr.write(str(form.cleaned_data))
			sys.stderr.flush()
			return render(request, 'widgets/simple_test_widget.html', {'form': form})
	else:
		form = SimpleTestWidgetForm()
		return render(request, 'widgets/simple_test_widget.html', {'form': form})
{'fraction_non_alphanumeric': 0.12397447584320875, 'fraction_numerical': 0.0, 'mean_word_length': 3.856194690265487, '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': '3551894', 'n_tokens_mistral': 742, 'n_tokens_neox': 681, 'n_words': 141}