<commit_before>import urlparse
from urllib import quote as urlquote
from datetime import datetime

from twisted.python import log
from twisted.internet import defer, reactor
from twisted.web import proxy, server, http #, resource
from twisted.web.static import File

from klein import resource, route

STARTED = datetime.now()
DATE_FMT = "%A, %B %d, %Y - %H:%M:%S"
SPAMS = 0
HAMS = 0

@route('/stats')
def stats(request):
    response = ("<h1>Spammy - Stats</h1>"
        "Uptime: %s<br/>"
        "Started: %s<br/>"
        "Hams: %d<br/>"
        "Spams: %d")
    uptime = str(datetime.now() - STARTED).split('.')[0]
    resp = response % (uptime, STARTED.strftime(DATE_FMT), HAMS, SPAMS)
    return resp


@route('/score')
def score(request):
    global SPAMS
    SPAMS += 1
    sid = request.getSession().uid
    return str(0.0)


@route('/static/')
def static(request):
    return File("./static")


@route('/')
def index(request):
    return "<h4>Nothing to see here...</h4><br/><img src='/static/logo.gif'/>"


class SpammySiteException(Exception):<commit_msg>Test CI<commit_after>import urlparse
from urllib import quote as urlquote
from datetime import datetime

from twisted.python import log
from twisted.internet import defer, reactor
from twisted.web import proxy, server, http #, resource
from twisted.web.static import File

from klein import resource, route

STARTED = datetime.now()
DATE_FMT = "%A, %B %d, %Y - %H:%M:%S"
SPAMS = 0
HAMS = 0

@route('/stats')
def stats(request):
    response = ("<h1>Spammy - Stats</h1>"
        "Uptime: %s<br/>"
        "Started: %s<br/>"
        "Hams: %d<br/>"
        "Spams: %d")
    uptime = str(datetime.now() - STARTED).split('.')[0]
    resp = response % (uptime, STARTED.strftime(DATE_FMT), HAMS, SPAMS)
    return resp


@route('/score')
def score(request):
    global SPAMS
    SPAMS += 1
    sid = request.getSession().uid
    return str(0.1)


@route('/static/')
def static(request):
    return File("./static")


@route('/')
def index(request):
    return "<h4>Nothing to see here...</h4><br/><img src='/static/logo.gif'/>"


class SpammySiteException(Exception):
{'fraction_non_alphanumeric': 0.16353383458646617, 'fraction_numerical': 0.009398496240601503, 'mean_word_length': 3.529787234042553, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '1624035', 'n_tokens_mistral': 771, 'n_tokens_neox': 735, 'n_words': 202}