<commit_before># -*- coding: utf-8 -*-
from django.shortcuts import render
from player.models import Room


def host(request):
    room_name = request.POST.get('room')
    password = request.POST.get('password')
    if request.method == "POST" and room_name and password:
        room = Room.objects.filter(name=room_name)
        if room.count() == 0:
            bad_password = True
            logging = True
        elif room[0].password != password:
            bad_password = True
            logging = True
        else:
            request.session['room'] = room_name
            request.session['token'] = room[0].token

    if not request.session.get('room', False):
        rooms = Room.objects.values_list('name', flat=True).all()
        logging = True
        return render(request, 'player.html', locals())

    return render(request, 'player.html', locals())


def logout(request):
    request.session.flush()

    return render(request, 'player.html', locals())<commit_msg>fix logout<commit_after># -*- coding: utf-8 -*-
from django.shortcuts import render
from player.models import Room


def host(request):
    room_name = request.POST.get('room')
    password = request.POST.get('password')
    if request.method == "POST" and room_name and password:
        room = Room.objects.filter(name=room_name)
        if room.count() == 0:
            bad_password = True
            logging = True
        elif room[0].password != password:
            bad_password = True
            logging = True
        else:
            request.session['room'] = room_name
            request.session['token'] = room[0].token

    if not request.session.get('room', False):
        rooms = Room.objects.values_list('name', flat=True).all()
        logging = True
        return render(request, 'player.html', locals())

    return render(request, 'player.html', locals())


def logout(request):
    request.session.flush()
    logging = True
    return render(request, 'player.html', locals())
{'fraction_non_alphanumeric': 0.13082706766917293, 'fraction_numerical': 0.0040100250626566416, 'mean_word_length': 2.5642857142857145, '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': '1835426', 'n_tokens_mistral': 559, 'n_tokens_neox': 545, 'n_words': 140}