code: def register_routes():
      async def one(datasette):
          return Response.text(
              (
                  await datasette.get_database().execute("select 1 + 1")
              ).first()[0]
          )
  
      async def two(request):
          name = request.url_vars["name"]
          greeting = request.args.get("greeting")
          return Response.text(f"{greeting} {name}")
  
      async def three(scope, send):
          await asgi_send_json(
              send,
              {"hello": "world"},
              status=200,
              headers={"x-three": "1"},
          )
  
      async def post(request):
          if request.method == "GET":
              return Response.html(request.scope["csrftoken"]())
          else:
              return Response.json(await request.post_vars())
  
      async def csrftoken_form(request, datasette):
          return Response.html(
              await datasette.render_template(
                  "csrftoken_form.html", request=request
              )
          )
  
      def not_async():
          return Response.html("This was not async")
  
      def add_message(datasette, request):
          datasette.add_message(request, "Hello from messages")
          return Response.html("Added message")
  
      async def render_message(datasette, request):
          return Response.html(
              await datasette.render_template(
                  "render_message.html", request=request
              )
          )
  
      def login_as_root(datasette, request):
          # Mainly for the latest.datasette.io demo
          if request.method == "POST":
              response = Response.redirect("/")
              response.set_cookie(
                  "ds_actor",
                  datasette.sign({"a": {"id": "root"}}, "actor"),
              )
              return response
          return Response.html(
              """
              <form action="{}" method="POST">
                  <p>
                      <input type="hidden" name="csrftoken" value="{}">
                      <input type="submit"
                        value="Sign in as root user"
                        style="font-size: 2em; padding: 0.1em 0.5em;">
                  </p>
              </form>
          """.format(
                  request.path, request.scope["csrftoken"]()
              )
          )
  
      def asgi_scope(scope):
          return Response.json(scope, default=repr)
  
      async def parallel_queries(datasette):
          db = datasette.get_database()
          with tracer.trace_child_tasks():
              one, two = await asyncio.gather(
                  db.execute("select coalesce(sleep(0.1), 1)"),
                  db.execute("select coalesce(sleep(0.1), 2)"),
              )
          return Response.json(
              {"one": one.single_value(), "two": two.single_value()}
          )
  
      return [
          (r"/one/$", one),
          (r"/two/(?P<name>.*)$", two),
          (r"/three/$", three),
          (r"/post/$", post),
          (r"/csrftoken-form/$", csrftoken_form),
          (r"/login-as-root$", login_as_root),
          (r"/not-async/$", not_async),
          (r"/add-message/$", add_message),
          (r"/render-message/$", render_message),
          (r"/asgi-scope$", asgi_scope),
          (r"/parallel-queries$", parallel_queries),
      ]
  
imports: import asyncio
  from datasette import hookimpl, Permission
  from datasette.facets import Facet
  from datasette import tracer
  from datasette.utils import path_with_added_args
  from datasette.utils.asgi import asgi_send_json, Response
  import base64
  import pint
  import json
label_desc: Use image node_id 12 for calling a global function with example usage: register_routes() and returns: list, Response, Response, Response, Response, Response, Response, Response, Response, Response, Response, Response, response