<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def init_app(self, app):
 """Initialize extension to the given application. Extension will be registered to `app.extensions` with lower classname as key and instance as value. :param app: Flask application. """

        self.init_extension(app)

        if not hasattr(app, 'extensions'):
            app.extensions = {}
        classname = self.__class__.__name__
        extname = classname.replace('Flask', '').lower()
        app.extensions[extname] = self