def METHOD_NAME(run_mode=os.getenv('FLASK_ENV', 'production')):
    """Return a configured Flask App using the Factory method."""
    app = Flask(__name__)
    app.config.from_object(config.CONFIGURATION[run_mode])
    # Configure Sentry
    if str(app.config.get('SENTRY_ENABLE')).lower() == 'true':
        if app.config.get('SENTRY_DSN', None):
            sentry_sdk.init(  # pylint: disable=abstract-class-instantiated
                dsn=app.config.get('SENTRY_DSN'),
                integrations=[FlaskIntegration()]
            )
    flags.init_app(app)
    db.init_app(app)
    ma.init_app(app)
    mail.init_app(app)
    endpoints.init_app(app)
    if os.getenv('FLASK_ENV', 'production') != 'testing':
        setup_jwt_manager(app, jwt)
    ExceptionHandler(app)
    @app.before_request
    def set_origin():
        g.origin_url = request.environ.get('HTTP_ORIGIN', 'localhost')
    @app.after_request
    def handle_after_request(response):  # pylint: disable=unused-variable
        add_version(response)
        camelize_json(response)
        set_access_control_header(response)
        return response
    def set_access_control_header(response):
        response.headers['Access-Control-Allow-Origin'] = '*'
        response.headers['Access-Control-Allow-Headers'] = 'Authorization, Content-Type, registries-trace-id, ' \
                                                           'invitation_token'
    def add_version(response):
        version = get_run_version()
        response.headers['API'] = f'auth_api/{version}'
    def camelize_json(response):
        if (response.headers['Content-Type'] == 'application/json' and
           'swagger.json' not in request.base_url):
            response.set_data(json.dumps(camelize(json.loads(response.get_data()))))
    register_shellcontext(app)
    build_cache(app)
    return app