<commit_before>from flask import Flask, jsonify
from flask_sqlalchemy import SQLAlchemy
import config

app = Flask(__name__)

app.config.from_object(config)

db = SQLAlchemy(app)


@app.errorhandler(404)
def not_found(error):
    return jsonify(error="Not found"), 404


# Register submodules
from mod_auth.controller import mod_auth
app.register_blueprint(mod_auth)

from mod_note import note_module
app.register_blueprint(note_module)

# Create the database
db.create_all()<commit_msg>add error handlers for 500 and 405 (#2)<commit_after>from flask import Flask, jsonify
from flask_sqlalchemy import SQLAlchemy
import config

app = Flask(__name__)

app.config.from_object(config)

db = SQLAlchemy(app)


@app.errorhandler(404)
def not_found(error):
    return jsonify(error="Not found"), 404


@app.errorhandler(405)
def not_allowed(error):
    return jsonify(error="Method not allowed"), 405


@app.errorhandler(500)
def internal(error):
    return jsonify(error="Internal error"), 500


# Register submodules
from mod_auth.controller import mod_auth
app.register_blueprint(mod_auth)

from mod_note import note_module
app.register_blueprint(note_module)

# Create the database
db.create_all()
{'fraction_non_alphanumeric': 0.0895397489539749, 'fraction_numerical': 0.02594142259414226, 'mean_word_length': 6.428571428571429, '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': '5346259', 'n_tokens_mistral': 423, 'n_tokens_neox': 377, 'n_words': 99}