<commit_before>from django.contrib import messages
from django.contrib.auth import login as do_login, logout as do_logout
from django.contrib.auth.forms import AuthenticationForm
from django.shortcuts import redirect, render
from django.template.context import RequestContext

def login(request):
    #messages.debug(request, "Debug!")
    #messages.info(request, "Info!")
    #messages.success(request, "Success!")
    #messages.warning(request, "Warning!")
    #messages.error(request, "Error!")
    
    if request.user.is_authenticated():
        return redirect("/student")
    
    context = {}
    if request.method == "POST":
        form = AuthenticationForm(None, request.POST)
        if form.is_valid():
            user = form.get_user()
            print user
            if user.is_active:
                do_login(request, user)
                return redirect("/student")
            else:
                messages.error(request, "Benutzeraccount ist deaktiviert!")
    else:
        form = AuthenticationForm()
    context["form"] = form
    return render(request, "session/login.html", context, context_instance=RequestContext(request))

def logout(request):<commit_msg>Fixed print to python3-conform version<commit_after>from django.contrib import messages
from django.contrib.auth import login as do_login, logout as do_logout
from django.contrib.auth.forms import AuthenticationForm
from django.shortcuts import redirect, render
from django.template.context import RequestContext

def login(request):
    #messages.debug(request, "Debug!")
    #messages.info(request, "Info!")
    #messages.success(request, "Success!")
    #messages.warning(request, "Warning!")
    #messages.error(request, "Error!")
    
    if request.user.is_authenticated():
        return redirect("/student")
    
    context = {}
    if request.method == "POST":
        form = AuthenticationForm(None, request.POST)
        if form.is_valid():
            user = form.get_user()
            print(user)
            if user.is_active:
                do_login(request, user)
                return redirect("/student")
            else:
                messages.error(request, "Benutzeraccount ist deaktiviert!")
    else:
        form = AuthenticationForm()
    context["form"] = form
    return render(request, "session/login.html", context, context_instance=RequestContext(request))

def logout(request):
{'fraction_non_alphanumeric': 0.11023294509151414, 'fraction_numerical': 0.00041597337770382697, 'mean_word_length': 3.0556492411467118, 'pattern_counts': {'":': 2, '<': 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': '3605416', 'n_tokens_mistral': 657, 'n_tokens_neox': 646, 'n_words': 158}