code: def template_variables(scheduler):
      from distributed.diagnostics.nvml import device_get_count
  
      template_variables = {
          "pages": [
              "status",
              "workers",
              "tasks",
              "system",
              *(["gpu"] if device_get_count() > 0 else []),
              "profile",
              "graph",
              "groups",
              "info",
          ],
          "plots": [
              {
                  "url": x.strip("/"),
                  "name": " ".join(x.strip("/").split("-")[1:])
                  .title()
                  .replace("Cpu", "CPU")
                  .replace("Gpu", "GPU")
                  .replace("Rmm", "RMM"),
              }
              for x in applications
              if "individual" in x
          ]
          + [
              {"url": "hardware", "name": "Hardware"},
              {"url": "shuffle", "name": "Shuffle"},
          ],
          "jupyter": scheduler.jupyter,
      }
      template_variables["plots"] = sorted(
          template_variables["plots"], key=lambda d: d["name"]
      )
      return template_variables
  
file_path: distributed/distributed/dashboard/scheduler.py
imports: from __future__ import annotations
  from urllib.parse import urljoin
  from tlz import memoize
  from tornado import web
  from tornado.ioloop import IOLoop
  from distributed.dashboard.components.nvml import gpu_doc, gpu_memory_doc, gpu_utilization_doc
  from distributed.dashboard.components.rmm import rmm_memory_doc
  from distributed.dashboard.components.scheduler import AggregateAction, BandwidthTypes, BandwidthWorkers, ClusterMemory, ComputePerKey, Contention, CurrentLoad, ExceptionsTable, FinePerformanceMetrics, MemoryByKey, Occupancy, SystemMonitor, SystemTimeseries, TaskGraph, TaskGroupGraph, TaskGroupProgress, TaskProgress, TaskStream, WorkerNetworkBandwidth, WorkersMemory, WorkersTransferBytes, WorkerTable, events_doc, exceptions_doc, graph_doc, hardware_doc, individual_doc, individual_profile_doc, individual_profile_server_doc, profile_doc, profile_server_doc, shuffling_doc, status_doc, stealing_doc, systemmonitor_doc, tasks_doc, tg_graph_doc, workers_doc
  from distributed.dashboard.core import BokehApplication
  from distributed.dashboard.worker import counters_doc
label_desc: Use image node_id 1 for calling a global function with example usage: template_variables(scheduler) and returns: template_variables