<commit_before>from flask import render_template, flash
from app import app
from datetime import datetime as dt
import time
import json

day_length = 86400
with open('app/topics.json') as f:
    topics = json.loads(f.read())

#the day given by times refers to 12AM of the morning of the day of class
with open('app/times.json') as f:
    times = json.loads(f.read())

if topics['num-classes'] != times['num-classes']:
    raise Exception('Mismatch between number of topics and number of days')

topics = topics['data']
localtimes = [time.mktime(dt.strptime(t, "%m/%d/%y").timetuple()) for t in times['data']]

#Zip time info into the topics dictionary
time_iter = iter(localtimes)
for unit in topics:
    for cl in unit['unit-classes']:
        t = time_iter.next()
        cl['time'] = t
        dt_obj = dt.fromtimestamp(t)
        cl['day-of-week'] = int(dt_obj.strftime("%w")) #1 = Monday, 2 = Tuesday, ..., 5 = Friday
        cl['week-of-year'] = int(dt_obj.strftime("%W"))
        cl['pretty-time'] = dt_obj.strftime("%A: %B %d, %Y")

@app.route('/')
@app.route('/index')
def index():
    return render_template('index.html',
        title = 'Home')

@app.route('/loghw')
def me():
    current_time = time.time()

    current_dt = dt.fromtimestamp(current_time)
    day_of_week = int(current_dt.strftime("%w"))<commit_msg>AARRGHH I keep forgetting to commit files when I push<commit_after>from flask import render_template, flash
from app import app
from datetime import datetime as dt
import time
import json

day_length = 86400
with open('app/sem2topics.json') as f:
    topics = json.loads(f.read())

#the day given by times refers to 12AM of the morning of the day of class
with open('app/sem2times.json') as f:
    times = json.loads(f.read())

if topics['num-classes'] != times['num-classes']:
    raise Exception('Mismatch between number of topics and number of days')

topics = topics['data']
localtimes = [time.mktime(dt.strptime(t, "%m/%d/%y").timetuple()) for t in times['data']]

#Zip time info into the topics dictionary
time_iter = iter(localtimes)
for unit in topics:
    for cl in unit['unit-classes']:
        t = time_iter.next()
        cl['time'] = t
        dt_obj = dt.fromtimestamp(t)
        cl['day-of-week'] = int(dt_obj.strftime("%w")) #1 = Monday, 2 = Tuesday, ..., 5 = Friday
        cl['week-of-year'] = int(dt_obj.strftime("%W"))
        cl['pretty-time'] = dt_obj.strftime("%A: %B %d, %Y")

@app.route('/')
@app.route('/index')
def index():
    return render_template('index.html',
        title = 'Home')

@app.route('/loghw')
def me():
    current_time = time.time()

    current_dt = dt.fromtimestamp(current_time)
    day_of_week = int(current_dt.strftime("%w"))
{'fraction_non_alphanumeric': 0.15828402366863906, 'fraction_numerical': 0.008136094674556213, 'mean_word_length': 3.729020979020979, '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': '6736859', 'n_tokens_mistral': 938, 'n_tokens_neox': 910, 'n_words': 260}