code: def override_dashboard_dir():
      with tempfile.TemporaryDirectory() as tempdir:
          os.environ[
              "RAY_METRICS_GRAFANA_DASHBOARD_OUTPUT_DIR"
          ] = tempdir
          yield tempdir
          del os.environ["RAY_METRICS_GRAFANA_DASHBOARD_OUTPUT_DIR"]
  
file_path: ray/python/ray/tests/test_metrics_head.py
imports: import json
  import logging
  import os
  import pytest
  import sys
  import tempfile
  from ray.dashboard.modules.metrics.dashboards.default_dashboard_panels import DEFAULT_GRAFANA_PANELS
  from ray.dashboard.modules.metrics.dashboards.serve_dashboard_panels import SERVE_GRAFANA_PANELS
  from ray.tests.conftest import _ray_start
label_desc: Use image node_id 2 for calling a global function with example usage: override_dashboard_dir() without return types