<commit_before>import os
import json
import requests
import re
from datetime import date, datetime
import time
from flask import Flask, Response, request, render_template, jsonify, make_response, abort
from flask_scss import Scss
from website_utils.timecard import MemoizedFile, get_date_or_none
from website_utils.config_loader import read_config

app = Flask(__name__)
read_config(app)

# Memoized 
log_file = MemoizedFile(os.environ.get('BADGE_LOG_PATH', 'seclab.log'))

# Start SCSS Compilation
app_dir = os.path.dirname(os.path.abspath(__file__))
asset_dir = os.path.join(app_dir, "assets")
static_dir = os.path.join(app_dir, "static")
scss_compiler = Scss(app, static_dir='static', asset_dir='assets', load_paths=None)
scss_compiler.update_scss()

u = {'GET': 'None', 'POST': 'None'}
try:
    e = json.load(open(os.environ.get('e')))
except:
    e = None
if e is not None:
    u['GET'] = e['s'][0]['GET']
    u['POST'] = e['s'][0]['POST']

@app.route('/')
def home():
    scss_compiler.update_scss() # REMOVE BEFORE FINAL COMMIT
    return render_template('index.html')

@app.route('/about')
def about():
    scss_compiler.update_scss() # REMOVE BEFORE FINAL COMMIT
    return render_template('about.html')

@app.route('/officers')
def officers():
    scss_compiler.update_scss() # REMOVE BEFORE FINAL COMMIT
    return render_template('officers.html')

@app.route('/resources')
def resources():
    scss_compiler.update_scss() # REMOVE BEFORE FINAL COMMIT
    return render_template('resources.html')

@app.route('/videos')
def videos():
    scss_compiler.update_scss() # REMOVE BEFORE FINAL COMMIT
    return render_template('videos.html')

@app.route('/calendar')
def calendar():
    scss_compiler.update_scss() # REMOVE BEFORE FINAL COMMIT
    return render_template('calendar.html')

@app.route('/signup')
def signup():
    scss_compiler.update_scss() # REMOVE BEFORE FINAL COMMIT
    return render_template('signup.html')

@app.route('/visit')
def visit():
    scss_compiler.update_scss() # REMOVE BEFORE FINAL COMMIT
    return render_template('visit.html')

@app.route('/<file_name>.txt')
def method_name(file_name):
    return app.send_static_file(file_name + '.txt')

@app.route('/<file_name>.jpg')
def jpg(file_name):
    if file_name.split('-')[0] == 'officers':
        return app.send_static_file('images/officers/' + file_name.split('-')[1] + '.jpg')
    else:
        return app.send_static_file('images/' + file_name + '.jpg')

@app.route('/<file_name>.png')
def png(file_name):
    return app.send_static_file('images/' + file_name + '.png')

@app.route('/<file_name>.ico')
def ico(file_name):
    return app.send_static_file('images/' + file_name + '.ico')

@app.route('/<file_name>.css')
def css(file_name):
    return app.send_static_file('css/' + file_name + '.css')

@app.route('/<file_name>.otf')
def fonts(file_name):
    return app.send_static_file('fonts/' + file_name + '.otf')

@app.route('/<file_name>.js')
def js(file_name):
    if file_name == "sw":
        return app.send_static_file('sw' + '.js')
    return app.send_static_file('js/' + file_name + '.js')

@app.route('/offline')
def offline():
    scss_compiler.update_scss() # REMOVE BEFORE FINAL COMMIT
    out = render_template('offline.html')
    
    f = open('static/offline.html', 'w').write(out)
    return app.send_static_file('offline.html')

@app.route('/lab-offline.svg')
def offline_badge():
    return app.send_static_file('images/' + 'lab-offline' + '.svg')

@app.route('/sw.js')
def sw():
    return app.send_static_file('sw.js')

@app.route('/timecard')
def timecard():
    scss_compiler.update_scss() # REMOVE BEFORE FINAL COMMIT
    return render_template('timecard.html')

@app.route('/timecard.svg')
def timecard_image():
    range_start = get_date_or_none(request.args, 'start')
    range_stop = get_date_or_none(request.args, 'end')<commit_msg>Removed remaining SCSS compiler updates per network reqeusts<commit_after>import os
import json
import requests
import re
from datetime import date, datetime
import time
from flask import Flask, Response, request, render_template, jsonify, make_response, abort
from flask_scss import Scss
from website_utils.timecard import MemoizedFile, get_date_or_none
from website_utils.config_loader import read_config

app = Flask(__name__)
read_config(app)

# Memoized 
log_file = MemoizedFile(os.environ.get('BADGE_LOG_PATH', 'seclab.log'))

# Start SCSS Compilation
app_dir = os.path.dirname(os.path.abspath(__file__))
asset_dir = os.path.join(app_dir, "assets")
static_dir = os.path.join(app_dir, "static")
scss_compiler = Scss(app, static_dir='static', asset_dir='assets', load_paths=None)
scss_compiler.update_scss()

u = {'GET': 'None', 'POST': 'None'}
try:
    e = json.load(open(os.environ.get('e')))
except:
    e = None
if e is not None:
    u['GET'] = e['s'][0]['GET']
    u['POST'] = e['s'][0]['POST']

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

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

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

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

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

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

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

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

@app.route('/<file_name>.txt')
def method_name(file_name):
    return app.send_static_file(file_name + '.txt')

@app.route('/<file_name>.jpg')
def jpg(file_name):
    if file_name.split('-')[0] == 'officers':
        return app.send_static_file('images/officers/' + file_name.split('-')[1] + '.jpg')
    else:
        return app.send_static_file('images/' + file_name + '.jpg')

@app.route('/<file_name>.png')
def png(file_name):
    return app.send_static_file('images/' + file_name + '.png')

@app.route('/<file_name>.ico')
def ico(file_name):
    return app.send_static_file('images/' + file_name + '.ico')

@app.route('/<file_name>.css')
def css(file_name):
    return app.send_static_file('css/' + file_name + '.css')

@app.route('/<file_name>.otf')
def fonts(file_name):
    return app.send_static_file('fonts/' + file_name + '.otf')

@app.route('/<file_name>.js')
def js(file_name):
    if file_name == "sw":
        return app.send_static_file('sw' + '.js')
    return app.send_static_file('js/' + file_name + '.js')

@app.route('/offline')
def offline():
    out = render_template('offline.html')
    
    f = open('static/offline.html', 'w').write(out)
    return app.send_static_file('offline.html')

@app.route('/lab-offline.svg')
def offline_badge():
    return app.send_static_file('images/' + 'lab-offline' + '.svg')

@app.route('/sw.js')
def sw():
    return app.send_static_file('sw.js')

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

@app.route('/timecard.svg')
def timecard_image():
    range_start = get_date_or_none(request.args, 'start')
    range_stop = get_date_or_none(request.args, 'end')
{'fraction_non_alphanumeric': 0.16883298392732354, 'fraction_numerical': 0.0011180992313067784, 'mean_word_length': 4.904290429042904, 'pattern_counts': {'":': 2, '<': 17, '<?xml version=': 0, '>': 17, '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': '266597', 'n_tokens_mistral': 2557, 'n_tokens_neox': 2528, 'n_words': 496}