code: def test_hook_extra_template_vars(restore_working_directory):
      with make_app_client(
          template_dir=str(
              pathlib.Path(__file__).parent / "test_templates"
          )
      ) as client:
          response = client.get("/-/metadata")
          assert response.status_code == 200
          extra_template_vars = json.loads(
              Soup(response.text, "html.parser")
              .select("pre.extra_template_vars")[0]
              .text
          )
          assert {
              "template": "show_json.html",
              "scope_path": "/-/metadata",
              "columns": None,
          } == extra_template_vars
          extra_template_vars_from_awaitable = json.loads(
              Soup(response.text, "html.parser")
              .select("pre.extra_template_vars_from_awaitable")[0]
              .text
          )
          assert {
              "template": "show_json.html",
              "awaitable": True,
              "scope_path": "/-/metadata",
          } == extra_template_vars_from_awaitable
  
imports: from bs4 import BeautifulSoup
  from .fixtures import app_client, app_client, make_app_client, TABLES, TEMP_PLUGIN_SECRET_FILE, PLUGINS_DIR, TestClient
  from click.testing import CliRunner
  from datasette.app import Datasette
  from datasette import cli, hookimpl, Permission
  from datasette.filters import FilterArguments
  from datasette.plugins import get_plugins, DEFAULT_PLUGINS, pm
  from datasette.utils.sqlite import sqlite3
  from datasette.utils import CustomRow, StartupError
  from jinja2.environment import Template
  from jinja2 import ChoiceLoader, FileSystemLoader
  import base64
  import importlib
  import json
  import os
  import pathlib
  import re
  import textwrap
  import pytest
  import urllib
label_desc: Use image node_id 3 for calling a global function with example usage: test_hook_extra_template_vars(restore_working_directory) without return types