def create_app(**options):
<EOL>app = Flask('<STR_LIT>')<EOL>app.config.from_object(settings)<EOL>app.config.update(options)<EOL>app.jinja_env.filters['<STR_LIT>'] = format<EOL>app.jinja_env.globals['<STR_LIT>'] = constants<EOL>app.jinja_env.globals.update({<EOL>'<STR_LIT>': constants,<EOL>'<STR_LIT:float>': float,<EOL>'<STR_LIT>': datetime.datetime.fromtimestamp,<EOL>'<STR_LIT>': iteritems,<EOL>'<STR_LIT>': len,<EOL>})<EOL>Redis(app, '<STR_LIT>')<EOL>Redis(app, '<STR_LIT>')<EOL>views = LazyViews(app, '<STR_LIT>')<EOL>views.add('<STR_LIT:/>', '<STR_LIT:index>', methods=('<STR_LIT:GET>', '<STR_LIT:POST>'))<EOL>views.add('<STR_LIT>', '<STR_LIT>', methods=('<STR_LIT:POST>', ))<EOL>views.add('<STR_LIT>', '<STR_LIT>')<EOL>views.add('<STR_LIT>', '<STR_LIT>')<EOL>views.add('<STR_LIT>', '<STR_LIT>', methods=('<STR_LIT:POST>', ))<EOL>views.add('<STR_LIT>', '<STR_LIT>')<EOL>views.add('<STR_LIT>',<EOL>'<STR_LIT>',<EOL>methods=('<STR_LIT:GET>', '<STR_LIT:POST>'))<EOL>views.add_error(<NUM_LIT>, '<STR_LIT:error>')<EOL>views.add_error(<NUM_LIT>, '<STR_LIT:error>')<EOL>views.add_error(<NUM_LIT>, '<STR_LIT:error>')<EOL>views.add_error(Exception, '<STR_LIT:error>')<EOL>@app.before_request<EOL>def global_username():<EOL><INDENT>key = constants.USERNAME_KEY.format(app.config['<STR_LIT>'])<EOL>g.username = session.get(key) or '<STR_LIT>'<EOL><DEDENT>return app<EOL>
r"""Factory function to create test application.

    :param \*\*options: Override default settings from given options.
    :type \*\*options: dict