<commit_before>from django.shortcuts import render, get_object_or_404

from config.utils import get_active_event

from .models import Talk


def list_talks(request):
    event = get_active_event()
    talks = event.talks.prefetch_related(
        'applicants',
        'applicants__user',
        'skill_level',
        'sponsor',
    ).order_by('-keynote', 'title')

    # Temporary hack to let only admins & committee members see the talks
    user = request.user
    permitted = user.is_authenticated and (user.is_superuser or user.is_talk_committee_member())
    if not permitted:
        talks = event.talks.none()

    return render(request, 'talks/list_talks.html', {
        "talks": talks,
    })


def view_talk(request, slug):<commit_msg>Revert "Temporarily make talks visible only to committee"<commit_after>from django.shortcuts import render, get_object_or_404

from config.utils import get_active_event

from .models import Talk


def list_talks(request):
    event = get_active_event()
    talks = event.talks.prefetch_related(
        'applicants',
        'applicants__user',
        'skill_level',
        'sponsor',
    ).order_by('-keynote', 'title')

    return render(request, 'talks/list_talks.html', {
        "talks": talks,
    })


def view_talk(request, slug):
{'fraction_non_alphanumeric': 0.10395655546935609, 'fraction_numerical': 0.004654771140418929, 'mean_word_length': 3.4178082191780823, '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': '2588314', 'n_tokens_mistral': 425, 'n_tokens_neox': 405, 'n_words': 96}