<commit_before>"""Entry point for flask app"""
# pylint: disable=C0413,E0611
import time
import jinja2

from flask import g
from flask import Flask
from typing import Tuple
from urllib.parse import urlparse
from utility import formatting

from gn3.authentication import DataRole, AdminRole

from wqflask.database import parse_db_url

from wqflask.group_manager import group_management
from wqflask.resource_manager import resource_management
from wqflask.metadata_edits import metadata_edit

from wqflask.api.markdown import glossary_blueprint
from wqflask.api.markdown import references_blueprint
from wqflask.api.markdown import links_blueprint
from wqflask.api.markdown import policies_blueprint
from wqflask.api.markdown import environments_blueprint
from wqflask.api.markdown import facilities_blueprint
from wqflask.api.markdown import blogs_blueprint
from wqflask.api.markdown import news_blueprint

from wqflask.jupyter_notebooks import jupyter_notebooks

app = Flask(__name__)


# See http://flask.pocoo.org/docs/config/#configuring-from-files
# Note no longer use the badly named WQFLASK_OVERRIDES (nyi)
app.config.from_envvar('GN2_SETTINGS')

DB_HOST, DB_USER, DB_PASS, DB_NAME = parse_db_url(app.config.get('SQL_URI'))
app.config["DB_HOST"] = DB_HOST
app.config["DB_USER"] = DB_USER
app.config["DB_PASS"] = DB_PASS
app.config["DB_NAME"] = DB_NAME

app.jinja_env.globals.update(
    undefined=jinja2.StrictUndefined,
    numify=formatting.numify)

# Registering blueprints
app.register_blueprint(glossary_blueprint, url_prefix="/glossary")
app.register_blueprint(references_blueprint, url_prefix="/references")<commit_msg>Register the port in the app configs<commit_after>"""Entry point for flask app"""
# pylint: disable=C0413,E0611
import time
import jinja2

from flask import g
from flask import Flask
from typing import Tuple
from urllib.parse import urlparse
from utility import formatting

from gn3.authentication import DataRole, AdminRole

from wqflask.database import parse_db_url

from wqflask.group_manager import group_management
from wqflask.resource_manager import resource_management
from wqflask.metadata_edits import metadata_edit

from wqflask.api.markdown import glossary_blueprint
from wqflask.api.markdown import references_blueprint
from wqflask.api.markdown import links_blueprint
from wqflask.api.markdown import policies_blueprint
from wqflask.api.markdown import environments_blueprint
from wqflask.api.markdown import facilities_blueprint
from wqflask.api.markdown import blogs_blueprint
from wqflask.api.markdown import news_blueprint

from wqflask.jupyter_notebooks import jupyter_notebooks

app = Flask(__name__)


# See http://flask.pocoo.org/docs/config/#configuring-from-files
# Note no longer use the badly named WQFLASK_OVERRIDES (nyi)
app.config.from_envvar('GN2_SETTINGS')

DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT = parse_db_url(app.config.get('SQL_URI'))
app.config["DB_HOST"] = DB_HOST
app.config["DB_USER"] = DB_USER
app.config["DB_PASS"] = DB_PASS
app.config["DB_NAME"] = DB_NAME
app.config["DB_PORT"] = DB_PORT

app.jinja_env.globals.update(
    undefined=jinja2.StrictUndefined,
    numify=formatting.numify)

# Registering blueprints
app.register_blueprint(glossary_blueprint, url_prefix="/glossary")
app.register_blueprint(references_blueprint, url_prefix="/references")
{'fraction_non_alphanumeric': 0.07657657657657657, 'fraction_numerical': 0.007207207207207207, 'mean_word_length': 7.007211538461538, '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': '4982996', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1100, 'n_words': 256}