<commit_before>from flask import Flask, render_template, request, redirect, url_for, abort
import flask
from flask_login import LoginManager, login_required, login_user, current_user, logout_user
import time
import sqlalchemy
import icalendar as ics
import pytz
from datetime import datetime, timedelta

from .util import get_or_abort, event_acceptor, wait_for, TaskTimeout, TimeoutException, parse_from
from .models import User, Calendar, CalendarSource, Event
from .forms import CalendarForm, CalendarSourceForm, DeleteForm, LoginForm, LogoutForm, EditForm, RegisterForm
from .tasks import update_sources, update_source_id

from coalics import app, q, db

app.jinja_env.globals['logout_form'] = lambda: LogoutForm()

@app.route("/")
def home():
    # r = q.enqueue(update_sources)
    # while not r.result:
        # time.sleep(0.1)

    # return ""

    # update.delay()
    if current_user.is_authenticated:
        return flask.redirect(url_for("calendars"))
    return render_template("home.html")

@app.route("/calendar")
@login_required
def calendars():
    cals = Calendar.query.filter_by(owner=current_user)

    delete_form = DeleteForm()

    return render_template("calendars.html", 
                           calendars=cals, 
                           delete_form=delete_form)

@app.route("/calendar/add", methods=["GET", "POST"])
@login_required
def calendar_add():
    if request.method == "GET":
        form = CalendarForm()
        return render_template("calendar_add.html", form=form)

    # is post
    form = CalendarForm(request.form)
    if not form.validate():
        return render_template("calendar_add.html", form=form)<commit_msg>disable home page<commit_after>from flask import Flask, render_template, request, redirect, url_for, abort
import flask
from flask_login import LoginManager, login_required, login_user, current_user, logout_user
import time
import sqlalchemy
import icalendar as ics
import pytz
from datetime import datetime, timedelta

from .util import get_or_abort, event_acceptor, wait_for, TaskTimeout, TimeoutException, parse_from
from .models import User, Calendar, CalendarSource, Event
from .forms import CalendarForm, CalendarSourceForm, DeleteForm, LoginForm, LogoutForm, EditForm, RegisterForm
from .tasks import update_sources, update_source_id

from coalics import app, q, db

app.jinja_env.globals['logout_form'] = lambda: LogoutForm()

@app.route("/")
def home():
    return "", 404
    # # r = q.enqueue(update_sources)
    # # while not r.result:
        # # time.sleep(0.1)

    # # return ""

    # # update.delay()
    # if current_user.is_authenticated:
        # return flask.redirect(url_for("calendars"))
    # return render_template("home.html")

@app.route("/calendar")
@login_required
def calendars():
    cals = Calendar.query.filter_by(owner=current_user)

    delete_form = DeleteForm()

    return render_template("calendars.html", 
                           calendars=cals, 
                           delete_form=delete_form)

@app.route("/calendar/add", methods=["GET", "POST"])
@login_required
def calendar_add():
    if request.method == "GET":
        form = CalendarForm()
        return render_template("calendar_add.html", form=form)

    # is post
    form = CalendarForm(request.form)
    if not form.validate():
        return render_template("calendar_add.html", form=form)
{'fraction_non_alphanumeric': 0.10430906389301635, 'fraction_numerical': 0.0020802377414561664, 'mean_word_length': 3.99406528189911, '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': '6225714', 'n_tokens_mistral': 1037, 'n_tokens_neox': 990, 'n_words': 257}