code: def list_routes(app: Sanic) -> Dict[Text, Text]:
      """List all the routes of a sanic application. Mainly used for debugging."""
      from urllib.parse import unquote
  
      output = {}
  
      def find_route(suffix: Text, path: Text) -> Optional[Text]:
          for name, (uri, _) in app.router.routes_names.items():
              if name.split(".")[-1] == suffix and uri == path:
                  return name
          return None
  
      for route in app.router.routes:
          endpoint = route.parts
          if (
              endpoint[:-1] in app.router.routes_all
              and endpoint[-1] == "/"
          ):
              continue
  
          options = {}
          for arg in route._params:
              options[arg] = f"[{arg}]"
  
          handlers = [
              (
                  next(iter(route.methods)),
                  route.name.replace("rasa_server.", ""),
              )
          ]
  
          for method, name in handlers:
              full_endpoint = "/" + "/".join(endpoint)
              line = unquote(f"{full_endpoint:50s} {method:30s} {name}")
              output[name] = line
  
      url_table = "\n".join(output[url] for url in sorted(output))
      logger.debug(f"Available web server routes: \n{url_table}")
  
      return output
  
imports: import json
  import logging
  import os
  from decimal import Decimal
  from pathlib import Path
  from typing import Any, Dict, Optional, Set, Text, Tuple, Union
  import numpy
  import rasa.shared.utils.io
  from rasa.constants import DEFAULT_SANIC_WORKERS, ENV_SANIC_WORKERS
  from rasa.shared.constants import DEFAULT_ENDPOINTS_PATH, TCP_PROTOCOL
  from rasa.core.lock_store import LockStore, RedisLockStore, InMemoryLockStore
  from rasa.utils.endpoints import EndpointConfig, read_endpoint_config
  from sanic import Sanic
  from socket import SOCK_DGRAM, SOCK_STREAM
  import rasa.cli.utils
label_desc: Use image node_id 4 for calling a global function with example usage: list_routes(app) and returns: output, None, name