<commit_before>from django.http import HttpResponse, Http404
from django.shortcuts import render, get_object_or_404
from django.views import generic
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.core.urlresolvers import reverse_lazy
from .models import Submission
from .forms import SubmissionForm
from ndmg.scripts.ndmg_func_pipeline import ndmg_func_pipeline as fngs_pipeline
from ndmg.scripts.ndmg_dwi_pipeline import ndmg_dwi_pipeline as ndmg_pipeline
from django.conf import settings
import time
import importlib
import imp
from ndmg.utils import utils as mgu
from threading import Thread
from multiprocessing import Process
import os
import re
import csv

def index(request):
	return render(request, 'analyze/index.html')

def submit_job(request):
	form = SubmissionForm(request.POST or None, request.FILES or None)
	if form.is_valid():
		submission = form.save(commit=False)
		submission.creds_file = request.FILES['creds_file']
		submission.data_file = request.FILES['data_file']
		submission.save()
		logfile = submission.jobdir + "log.txt"
		p1 = Process(target=unzipstuff, args=(submission))
		p1.daemon=True
		p1.start()
		p1.join()
		p2 = Process(target=uploadstuff, args=(submission))
		p2.daemon=True
		p2.start()
		p2.join()
		p3 = Process(target=deletestuff, args=(submission))
		p3.daemon=True
		p3.start()
		p3.join()<commit_msg>Update views.py<commit_after>from django.http import HttpResponse, Http404
from django.shortcuts import render, get_object_or_404
from django.views import generic
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.core.urlresolvers import reverse_lazy
from .models import Submission
from .forms import SubmissionForm
from ndmg.scripts.ndmg_func_pipeline import ndmg_func_pipeline as fngs_pipeline
from ndmg.scripts.ndmg_dwi_pipeline import ndmg_dwi_pipeline as ndmg_pipeline
from django.conf import settings
import time
import importlib
import imp
from ndmg.utils import utils as mgu
from threading import Thread
from multiprocessing import Process
import os
import re
import csv

def index(request):
	return render(request, 'analyze/index.html')

def submit_job(request):
	form = SubmissionForm(request.POST or None, request.FILES or None)
	if form.is_valid():
		submission = form.save(commit=False)
		submission.creds_file = request.FILES['creds_file']
		if submission.upload_data_or_not == "yes":
			submission.data_file = request.FILES['data_file']
		submission.save()
		logfile = submission.jobdir + "log.txt"
		p1 = Process(target=unzipstuff, args=(submission))
		p1.daemon=True
		p1.start()
		p1.join()
		p2 = Process(target=uploadstuff, args=(submission))
		p2.daemon=True
		p2.start()
		p2.join()
		p3 = Process(target=deletestuff, args=(submission))
		p3.daemon=True
		p3.start()
		p3.join()
{'fraction_non_alphanumeric': 0.08894401133947555, 'fraction_numerical': 0.012756909992912827, 'mean_word_length': 5.76978417266187, 'pattern_counts': {'":': 1, '<': 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': '1739067', 'n_tokens_mistral': 972, 'n_tokens_neox': 927, 'n_words': 239}