code: def flash(self, msg: str, category: Optional[str] = None):
          
          if not request.is_json and app.config.FLASH_MESSAGES:
              flash(msg, category)
docs: Convenience method for flashing messages.
  
          :param msg: The message to flash.
          :param category: The category of the message.