<commit_before>from utils.api import get_watcher
from django.shortcuts import render, HttpResponseRedirect
from utils.constants import ErrorList, division
from rank.models import Player
from rank.constants import RANK_INT
from rank.views import get_vector, get_score, get_data, get_rank

import operator
import json


def index(request):
    return render(request, "index.html", locals())

def about(request):
    return render(request, "about.html", locals())

def result(request, username):
    player = Player.objects.get(username=username)
    friends_id = json.loads(player.friends.replace("'", '"'))['ids']
    players = Player.objects.filter(userid__in=friends_id).order_by('-total_score')
    return render(request, "result.html", locals())

def transition(request, username):
    username = username
    return render(request, "transition.html", locals())

def testing(request):
    return render(request, "testing.html", locals())

def summoner(request):
    if request.is_ajax():
        #deal with the user input here.
        # rank(user)
        # redirect to result display page
        return render(request, "result.html", locals())
    return render(request, "search.html", locals())

def search(request):<commit_msg>lol this time really finish<commit_after>from utils.api import get_watcher
from django.shortcuts import render, HttpResponseRedirect
from utils.constants import ErrorList, division
from rank.models import Player
from rank.constants import RANK_INT
from rank.views import get_vector, get_score, get_data, get_rank

import operator
import json


def index(request):
    return render(request, "index.html", locals())

def about(request):
    return render(request, "about.html", locals())

def result(request, username):
    player = Player.objects.get(username=username)
    friends_id = json.loads(player.friends.replace("'", '"'))['ids']
    players = Player.objects.filter(userid__in=friends_id).order_by('evaluation', 'total_score')
    print ["rank: " + str(player.evaluation) + " total score: " + str(player.total_score) for player in players]
    return render(request, "result.html", locals())

def transition(request, username):
    username = username
    return render(request, "transition.html", locals())

def testing(request):
    return render(request, "testing.html", locals())

def summoner(request):
    if request.is_ajax():
        #deal with the user input here.
        # rank(user)
        # redirect to result display page
        return render(request, "result.html", locals())
    return render(request, "search.html", locals())

def search(request):
{'fraction_non_alphanumeric': 0.1206896551724138, 'fraction_numerical': 0.0, 'mean_word_length': 4.7384615384615385, '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': '2979518', 'n_tokens_mistral': 732, 'n_tokens_neox': 735, 'n_words': 214}