<commit_before>from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext
from django.conf import settings
from donationparty.models import Round, Donation
import json
from email import Emailer

def home(request):
    round = Round.objects.create(url=Round.generate_url())
    
    return HttpResponseRedirect(round.absolute_url())
    
def round_page(request, round_id):
    round = get_object_or_404(Round, url=round_id)

    if request.method == "POST":
        return round_create(request, round_id)
    
    if round.closed:
        return render_to_response('round_closed.xhtml', {
            'round': round,
            'settings': settings,
        }, context_instance=RequestContext(request))
    elif round.charity:
        return render_to_response('round_running.xhtml', {
            'round': round,
            'settings': settings,
        }, context_instance=RequestContext(request))
    else:
        return render_to_response('round_create.xhtml', {
            'round': round,
            'settings': settings,
        }, context_instance=RequestContext(request))

def round_create(request, round_id):
    round = get_object_or_404(Round, url=round_id)
    charity_name = request.POST['charity']
    
    round.charity = charity_name
    round.save()
    
    return HttpResponseRedirect(round.absolute_url())<commit_msg>expire the round<commit_after>from datetime import datetime
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext
from django.conf import settings
from donationparty.models import Round, Donation
import json
from email import Emailer

def home(request):
    round = Round.objects.create(url=Round.generate_url())
    
    return HttpResponseRedirect(round.absolute_url())
    
def round_page(request, round_id):
    round = get_object_or_404(Round, url=round_id)

    if request.method == "POST":
        return round_create(request, round_id)
    
    if round.closed:
        return render_to_response('round_closed.xhtml', {
            'round': round,
            'settings': settings,
        }, context_instance=RequestContext(request))
    elif round.charity:
        return render_to_response('round_running.xhtml', {
            'round': round,
            'settings': settings,
        }, context_instance=RequestContext(request))
    else:
        return render_to_response('round_create.xhtml', {
            'round': round,
            'settings': settings,
        }, context_instance=RequestContext(request))

def round_create(request, round_id):
    round = get_object_or_404(Round, url=round_id)
    charity_name = request.POST['charity']
    
    round.charity = charity_name
    round.expire_time = datetime.now + datetime.timedelta(hours=3)
    round.save()
    
    return HttpResponseRedirect(round.absolute_url())
{'fraction_non_alphanumeric': 0.09327115256495669, 'fraction_numerical': 0.006329113924050633, 'mean_word_length': 3.5569044006069803, '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': '1320554', 'n_tokens_mistral': 851, 'n_tokens_neox': 827, 'n_words': 180}