code: def extra_template_vars(
      template, database, table, view_name, columns, request, datasette
  ):
      return {
          "extra_template_vars": json.dumps(
              {
                  "template": template,
                  "scope_path": request.scope["path"]
                  if request
                  else None,
                  "columns": columns,
              },
              default=lambda b: b.decode("utf8"),
          )
      }
  
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 6 for calling a global function with example usage: extra_template_vars(template, database, table, view_name, columns, request, datasette) and returns: dict