code: def session_ended(self, f):
          
          self._session_ended_view_func = f
  
          @wraps(f)
          def wrapper(*args, **kw):
              self._flask_view_func(*args, **kw)
          return f
docs: Decorator routes Alexa SessionEndedRequest to the wrapped view function to end the skill.
  
          @ask.session_ended
          def session_ended():
              return "{}", 200
  
          The wrapped function is registered as the session_ended view function
          and renders the response for requests to the end of the session.
  
          Arguments:
              f {function} -- session_ended view function