code: def test_dcgm(test_settings):
      with mock.patch.object(
          wandb.sdk.internal.system.assets.open_metrics.requests.Session,
          "get",
          mocked_requests_get,
      ):
          interface = AssetInterface()
          settings = SettingsStatic(
              test_settings(
                  dict(
                      _stats_sample_rate_seconds=1,
                      _stats_samples_to_average=1,
                  )
              ).to_proto()
          )
          shutdown_event = threading.Event()
  
          url = "http://localhost:9400/metrics"
  
          dcgm = OpenMetrics(
              interface=interface,
              settings=settings,
              shutdown_event=shutdown_event,
              name="dcgm",
              url=url,
          )
  
          assert dcgm.is_available(url)
          assert isinstance(dcgm, Asset)
  
          dcgm.start()
  
          # wait for the mock data to be processed indefinitely,
          # until the test times out in the worst case
          while interface.metrics_queue.empty():
              time.sleep(0.1)
  
          shutdown_event.set()
          dcgm.finish()
  
          assert not interface.metrics_queue.empty()
          assert not interface.telemetry_queue.empty()
  
          while not interface.metrics_queue.empty():
              print(interface.metrics_queue.get())
  
imports: import random
  import threading
  import time
  from typing import Union
  from unittest import mock
  import pytest
  import requests
  import wandb
  from wandb.sdk.internal.settings_static import SettingsStatic
  from wandb.sdk.internal.system.assets import OpenMetrics
  from wandb.sdk.internal.system.assets.interfaces import Asset
  from wandb.sdk.internal.system.assets.open_metrics import _nested_dict_to_tuple, _should_capture_metric, _tuple_to_nested_dict
  from wandb.sdk.internal.system.system_monitor import AssetInterface
label_desc: Use image node_id 10 for calling a global function with example usage: test_dcgm(test_settings) without return types