<commit_before>from random import randint

from django.shortcuts import render_to_response, HttpResponse
from chematoru.ads.models import Ad, Publisher

def serve(self, pubid):
    publisher = Publisher.objects.get(id=pubid)
    publisher.impressions += 1
    publisher.save()
    
    ads_count = Ad.objects.count()
    ad = Ad.objects.get(id= randint(1, ads_count))
    
    ad.impressions += 1
    ad.save()
    return render_to_response('serve.html', {
        'publisher_url' : publisher.url,
        'ad_name' : ad.name,
        'ad_url' : ad.image.url})

def index(self):
    return render_to_response('index.html', {
        'domain': "http://chematoru.ceata.org"})
<commit_msg>fix bug with linking to publisher's site<commit_after>from random import randint

from django.shortcuts import render_to_response, HttpResponse
from chematoru.ads.models import Ad, Publisher

def serve(self, pubid):
    publisher = Publisher.objects.get(id=pubid)
    publisher.impressions += 1
    publisher.save()
    
    ads_count = Ad.objects.count()
    ad = Ad.objects.get(id= randint(1, ads_count))
    
    ad.impressions += 1
    ad.save()
    return render_to_response('serve.html', {
        'publisher_url' : ad.advertiser.url,
        'ad_name' : ad.name,
        'ad_url' : ad.image.url})

def index(self):
    return render_to_response('index.html', {
        'domain': "http://chematoru.ceata.org"})

{'fraction_non_alphanumeric': 0.12687099073414113, 'fraction_numerical': 0.0042765502494654314, 'mean_word_length': 3.3067484662576687, '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': '7337282', 'n_tokens_mistral': 478, 'n_tokens_neox': 475, 'n_words': 96}