<commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-

__author__ = '<NAME>'

from flask import Flask
from pymongo import MongoClient
from app.filters import datetime_filter

client = MongoClient()
db = client.test

def create_app():
    app = Flask(__name__)
    app.jinja_env.filters.update(datetime=datetime_filter)
    from app.views.route import route
    app.register_blueprint(route)
    return app<commit_msg>set flask.g, put into before_request<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-

__author__ = '<NAME>'

import time
from flask import Flask, request, g
from pymongo import MongoClient
from app.filters import datetime_filter

COOKIE_NAME = "YuiSession"

client = MongoClient()
db = client.test

from app.utilities import cookieToUser
from app.views.route import route

def loginStatus():
    cookie = request.cookies.get(COOKIE_NAME)
    g.__user__ = cookieToUser(cookie)

def create_app():
    app = Flask(__name__)
    app.jinja_env.filters.update(datetime=datetime_filter)
    app.before_request(loginStatus)
    app.register_blueprint(route)
    return app
{'fraction_non_alphanumeric': 0.10263396911898275, 'fraction_numerical': 0.0036330608537693005, 'mean_word_length': 4.455445544554456, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4176698', 'n_tokens_mistral': 362, 'n_tokens_neox': 350, 'n_words': 88}