<commit_before>
import time

from flask import Flask, render_template


# DEFAULT_EXPIRATION = 10  # 10 sec
# DEFAULT_EXPIRATION = 60 * 10  # 10 min
DEFAULT_EXPIRATION = 60 * 20  # 20 min


app = Flask(__name__)


last_ping = {}


@app.route('/')
def index():
    # return 'Hello, World!'
    return render_template('index.html')


@app.route('/ping/<thing>')
def ping(thing):
    now = time.time()
    last_ping[thing] = now
    return "%s %s" % (thing, now)


@app.route('/check/<thing>')
def check(thing):
    if thing not in last_ping:
        response = u"No such thing as %s" % thing
        return response, 404
    elapsed = time.time() - last_ping[thing]
    if elapsed > DEFAULT_EXPIRATION:
        del last_ping[thing]
        response = u"Thing expired: %s" % thing
        return response, 404
    return "%s %s" % (thing, elapsed)<commit_msg>Removing old hello world ish<commit_after>
import time

from flask import Flask, render_template


# DEFAULT_EXPIRATION = 10  # 10 sec
# DEFAULT_EXPIRATION = 60 * 10  # 10 min
DEFAULT_EXPIRATION = 60 * 20  # 20 min


app = Flask(__name__)


last_ping = {}


@app.route('/')
def index():
    return render_template('index.html')


@app.route('/ping/<thing>')
def ping(thing):
    now = time.time()
    last_ping[thing] = now
    return "%s %s" % (thing, now)


@app.route('/check/<thing>')
def check(thing):
    if thing not in last_ping:
        response = u"No such thing as %s" % thing
        return response, 404
    elapsed = time.time() - last_ping[thing]
    if elapsed > DEFAULT_EXPIRATION:
        del last_ping[thing]
        response = u"Thing expired: %s" % thing
        return response, 404
    return "%s %s" % (thing, elapsed)
{'fraction_non_alphanumeric': 0.13133097762073026, 'fraction_numerical': 0.02591283863368669, 'mean_word_length': 3.03562945368171, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '1298043', 'n_tokens_mistral': 643, 'n_tokens_neox': 566, 'n_words': 168}