<commit_before>from django.shortcuts import render
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User

from accounts.forms import LoginForm, RegistrationForm
from lists.forms import TodoForm


def login_view(request):

    if request.method == 'POST':
        username = request.POST['username']
        password = request.POST['password']
        user = authenticate(username=username, password=password)
        if user is not None:
            if user.is_active:
                login(request, user)
                return render(request, 'lists/index.html',
                              {'form': TodoForm()})
    else:
        return render(request, 'accounts/login.html', {'form': LoginForm()})

    return render(request, 'lists/index.html', {'form': TodoForm()})

def register(request):
    if request.method == 'POST':
        email = request.POST['email']
        username = request.POST['username']
        password = request.POST['password']
        password_confirmation = request.POST['password_confirmation']
        # TODO add proper password check
        assert password == password_confirmation
        User.objects.create_user(username, email=email, password=password)
    else:<commit_msg>Two line separation between classes.<commit_after>from django.shortcuts import render
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User

from accounts.forms import LoginForm, RegistrationForm
from lists.forms import TodoForm


def login_view(request):

    if request.method == 'POST':
        username = request.POST['username']
        password = request.POST['password']
        user = authenticate(username=username, password=password)
        if user is not None:
            if user.is_active:
                login(request, user)
                return render(request, 'lists/index.html',
                              {'form': TodoForm()})
    else:
        return render(request, 'accounts/login.html', {'form': LoginForm()})

    return render(request, 'lists/index.html', {'form': TodoForm()})


def register(request):
    if request.method == 'POST':
        email = request.POST['email']
        username = request.POST['username']
        password = request.POST['password']
        password_confirmation = request.POST['password_confirmation']
        # TODO add proper password check
        assert password == password_confirmation
        User.objects.create_user(username, email=email, password=password)
    else:
{'fraction_non_alphanumeric': 0.10862745098039216, 'fraction_numerical': 0.0, 'mean_word_length': 2.992175273865415, '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': '3900855', 'n_tokens_mistral': 660, 'n_tokens_neox': 640, 'n_words': 173}