<commit_before>import pprint

from flask import Flask
from flaskext.script import Manager, Command, Option, Shell, Server

def create_app():
    app = Flask(__name__)
    app.config.from_envvar('APP_CONFIG', silent=True)
    return app

manager = Manager(create_app)

@manager.command
def dumpconfig(app):
    "Dumps config"
    pprint.pprint(app.config)

@manager.command
def output(app, name):
    "print something"
    print name

@manager.command
def outputplus(app, name, url=None):
    "print name and url"
    print name, url

@manager.option('-n', '--name', dest='name', help="your name")
@manager.option('-u', '--url', dest='url', help="your url")
def optional(app, name, url):
    "print name and url"
    print name, url

manager.add_command("shell", Shell())
manager.add_command("runserver", Server())

if __name__ == "__main__":
    manager.run()<commit_msg>testing debug in example<commit_after>import pprint

from flask import Flask, Response
from flaskext.script import Manager, Command, Option, Shell, Server

def create_app():
    app = Flask(__name__)
    app.debug = False
    app.config.from_envvar('APP_CONFIG', silent=True)

    @app.route("/")
    def index():
        # deliberate error, test debug working
        assert False, "oops"

    return app

manager = Manager(create_app)

@manager.command
def dumpconfig(app):
    "Dumps config"
    pprint.pprint(app.config)

@manager.command
def output(app, name):
    "print something"
    print name

@manager.command
def outputplus(app, name, url=None):
    "print name and url"
    print name, url

@manager.option('-n', '--name', dest='name', help="your name")
@manager.option('-u', '--url', dest='url', help="your url")
def optional(app, name, url):
    "print name and url"
    print name, url

manager.add_command("shell", Shell())
manager.add_command("runserver", Server(use_debugger=False))

if __name__ == "__main__":
    manager.run()
{'fraction_non_alphanumeric': 0.14233576642335766, 'fraction_numerical': 0.0, 'mean_word_length': 4.228882833787466, 'pattern_counts': {'":': 2, '<': 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': '5129835', 'n_tokens_mistral': 626, 'n_tokens_neox': 624, 'n_words': 174}