def create_application(connection: Optional[str] = None) -> Flask:
app = Flask(__name__)<EOL>flask_bootstrap.Bootstrap(app)<EOL>Admin(app)<EOL>connection = connection or DEFAULT_CACHE_CONNECTION<EOL>engine, session = build_engine_session(connection)<EOL>for name, add_admin in add_admins.items():<EOL><INDENT>url = '<STR_LIT>'.format(name)<EOL>add_admin(app, session, url=url, endpoint=name, name=name)<EOL>log.debug('<STR_LIT>', name, add_admin, url)<EOL><DEDENT>app.register_blueprint(ui)<EOL>return app<EOL>
Create a Flask application.