<commit_before>import flask
import os
import helpers
from importlib import import_module
import builtins
from escape_helpers import sparql_escape
from rdflib.namespace import Namespace

# WSGI variable name used by the server
app = flask.Flask(__name__)

####################
## Example method ##
####################

@app.route('/templateExample/')
def query():
    """Example query: Returns all the triples in the application graph in a JSON
    format."""
    q =  " SELECT *"
    q += " WHERE{"
    q += "   GRAPH <http://mu.semte.ch/application> {"
    q += "     ?s ?p ?o"
    q += "   }"
    q += " }"
    return flask.jsonify(helpers.query(q))

##################
## Vocabularies ##
##################
mu = Namespace('http://mu.semte.ch/vocabularies/')
mu_core = Namespace('http://mu.semte.ch/vocabularies/core/')
mu_ext = Namespace('http://mu.semte.ch/vocabularies/ext/')

SERVICE_RESOURCE_BASE = 'http://mu.semte.ch/services/'

builtins.app = app
builtins.helpers = helpers
builtins.sparql_escape = sparql_escape

# Import the app from the service consuming the template
app_file = os.environ.get('APP_ENTRYPOINT')
try:
    module_path = 'ext.app.{}'.format(app_file)
    import_module(module_path)
except Exception as e:
    helpers.log(str(e))

#######################
## Start Application ##
#######################
if __name__ == '__main__':
    debug = True if (os.environ.get('MODE') == "development") else False
    app.run(debug=debug, host='0.0.0.0', port=80)
<commit_msg>Reshuffled imports<commit_after>import os
from importlib import import_module
import builtins

import flask
from rdflib.namespace import Namespace

import helpers
from escape_helpers import sparql_escape

# WSGI variable name used by the server
app = flask.Flask(__name__)

####################
## Example method ##
####################

@app.route('/templateExample/')
def query():
    """Example query: Returns all the triples in the application graph in a JSON
    format."""
    q =  " SELECT *"
    q += " WHERE{"
    q += "   GRAPH <http://mu.semte.ch/application> {"
    q += "     ?s ?p ?o"
    q += "   }"
    q += " }"
    return flask.jsonify(helpers.query(q))

##################
## Vocabularies ##
##################
mu = Namespace('http://mu.semte.ch/vocabularies/')
mu_core = Namespace('http://mu.semte.ch/vocabularies/core/')
mu_ext = Namespace('http://mu.semte.ch/vocabularies/ext/')

SERVICE_RESOURCE_BASE = 'http://mu.semte.ch/services/'

builtins.app = app
builtins.helpers = helpers
builtins.sparql_escape = sparql_escape

# Import the app from the service consuming the template
app_file = os.environ.get('APP_ENTRYPOINT')
try:
    module_path = 'ext.app.{}'.format(app_file)
    import_module(module_path)
except Exception as e:
    helpers.log(str(e))

#######################
## Start Application ##
#######################
if __name__ == '__main__':
    debug = True if (os.environ.get('MODE') == "development") else False
    app.run(debug=debug, host='0.0.0.0', port=80)

{'fraction_non_alphanumeric': 0.2133065864259445, 'fraction_numerical': 0.004012036108324975, 'mean_word_length': 4.249122807017544, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3117104', 'n_tokens_mistral': 1000, 'n_tokens_neox': 993, 'n_words': 227}