code: def asgi_wrapper(datasette):
      def wrap_with_databases_header(app):
          @wraps(app)
          async def add_x_databases_header(scope, receive, send):
              async def wrapped_send(event):
                  if event["type"] == "http.response.start":
                      original_headers = event.get("headers") or []
                      event = {
                          "type": event["type"],
                          "status": event["status"],
                          "headers": original_headers
                          + [
                              [
                                  b"x-databases",
                                  ", ".join(
                                      datasette.databases.keys()
                                  ).encode("utf-8"),
                              ]
                          ],
                      }
                  await send(event)
  
              await app(scope, receive, wrapped_send)
  
          return add_x_databases_header
  
      return wrap_with_databases_header
  
file_path: datasette/tests/plugins/my_plugin_2.py
imports: from datasette import hookimpl
  from datasette.utils.asgi import Response
  from functools import wraps
  import markupsafe
  import json
label_desc: Use image node_id 4 for calling a global function with example usage: asgi_wrapper(datasette) and returns: wrap_with_databases_header, add_x_databases_header