<commit_before>from django.shortcuts import render
from event.models import Event
from tag.models import Tag
from django.conf import settings


def index(request):
    context = {}

    """All Tags
    全てのタグ
    """
    context['all_tags'] = Tag.objects.all()

    """New Events
    新規イベント
    """
    ev_all = Event.objects.all().order_by('-created')
    if request.user.is_anonymous():
        context['new_events'] = ev_all[:20]
    else:
        context['new_events'] = ev_all[:5]

    """Prefectures
    日本の(!)県名
    """
    # FIXME: i18n, how?
    # XXX: PREFECTURES must be sorted right out of the box
    prefs = settings.PREFECTURES.items()
    prefs = sorted(prefs, key=lambda x: x[1][1])
    prefs = [(k, v[0]) for k, v in prefs]
    context['prefectures'] = prefs

    return render(request, 'top.html', context)

def show_map(request):
    return render(request, 'map.html')<commit_msg>E302 expected 2 blank lines, found 1<commit_after>from django.shortcuts import render
from event.models import Event
from tag.models import Tag
from django.conf import settings


def index(request):
    context = {}

    """All Tags
    全てのタグ
    """
    context['all_tags'] = Tag.objects.all()

    """New Events
    新規イベント
    """
    ev_all = Event.objects.all().order_by('-created')
    if request.user.is_anonymous():
        context['new_events'] = ev_all[:20]
    else:
        context['new_events'] = ev_all[:5]

    """Prefectures
    日本の(!)県名
    """
    # FIXME: i18n, how?
    # XXX: PREFECTURES must be sorted right out of the box
    prefs = settings.PREFECTURES.items()
    prefs = sorted(prefs, key=lambda x: x[1][1])
    prefs = [(k, v[0]) for k, v in prefs]
    context['prefectures'] = prefs

    return render(request, 'top.html', context)


def show_map(request):
    return render(request, 'map.html')
{'fraction_non_alphanumeric': 0.13995609220636662, 'fraction_numerical': 0.011525795828759604, 'mean_word_length': 3.105855855855856, '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': '1831858', 'n_tokens_mistral': 652, 'n_tokens_neox': 626, 'n_words': 159}