<commit_before>#! /usr/bin/env python2.7
# -*- coding: utf-8 -*-
import requests
from flask import redirect, url_for, \
    render_template, jsonify, request
import datetime

from models import DB_Stop, DB_Train, VBB_Stop, Bvg_line, app, db
from helpers import print_success, print_failure


@app.route("/")
def main():
    ''' The main page '''
    return pagination(1)


@app.route("/city/<city>/page/<number>")
def pagination(number, city="Cottbus"):
    """ Render only 100 stops for better overview"""
    number = int(number)
    start = (number-1)*50
    stop = number * 50
    matches = DB_Stop.query.filter(
        DB_Stop.landkreis == city,
        DB_Stop.matches > 0
    ).count()
    all_stops = DB_Stop.query.filter(DB_Stop.landkreis == city).count()
    Stops = DB_Stop.query \
        .filter(DB_Stop.landkreis == city) \
        .order_by("last_run desc") \
        .slice(start, stop)
    landkreise = set([stop.landkreis for stop in DB_Stop.query.all()])
    return render_template("index.html",
                           stops=Stops,
                           pages=all_stops,
                           this_page=number,
                           matches_count=matches,
                           landkreise=landkreise<commit_msg>Set Berlin as the default city<commit_after>#! /usr/bin/env python2.7
# -*- coding: utf-8 -*-
import requests
from flask import redirect, url_for, \
    render_template, jsonify, request
import datetime

from models import DB_Stop, DB_Train, VBB_Stop, Bvg_line, app, db
from helpers import print_success, print_failure


@app.route("/")
def main():
    ''' The main page '''
    return pagination(1)


@app.route("/city/<city>/page/<number>")
def pagination(number, city="Berlin"):
    """ Render only 100 stops for better overview"""
    number = int(number)
    start = (number-1)*50
    stop = number * 50
    matches = DB_Stop.query.filter(
        DB_Stop.landkreis == city,
        DB_Stop.matches > 0
    ).count()
    all_stops = DB_Stop.query.filter(DB_Stop.landkreis == city).count()
    Stops = DB_Stop.query \
        .filter(DB_Stop.landkreis == city) \
        .order_by("last_run desc") \
        .slice(start, stop)
    landkreise = set([stop.landkreis for stop in DB_Stop.query.all()])
    return render_template("index.html",
                           stops=Stops,
                           pages=all_stops,
                           this_page=number,
                           matches_count=matches,
                           landkreise=landkreise
{'fraction_non_alphanumeric': 0.12114014251781473, 'fraction_numerical': 0.010292953285827395, 'mean_word_length': 2.2989556135770237, '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': '1107242', 'n_tokens_mistral': 787, 'n_tokens_neox': 792, 'n_words': 180}