code: def trainium_asset(test_settings) -> AssetInterface:
      interface = AssetInterface()
      settings = SettingsStatic(
          test_settings(
              dict(
                  _stats_sample_rate_seconds=1,
                  _stats_samples_to_average=1,
                  _stats_pid=1337,
              )
          ).to_proto()
      )
      shutdown_event = threading.Event()
  
      trainium = Trainium(
          interface=interface,
          settings=settings,
          shutdown_event=shutdown_event,
      )
  
      assert not trainium.is_available()
  
      trainium.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()
      trainium.finish()
  
      assert not interface.metrics_queue.empty()
      assert not interface.telemetry_queue.empty()
  
      return interface
  
file_path: wandb/tests/pytest_tests/unit_tests/test_system_metrics/test_trainium.py
imports: import itertools
  import json
  import os
  import threading
  import time
  from unittest import mock
  import pytest
  from wandb.sdk.internal.settings_static import SettingsStatic
  from wandb.sdk.internal.system.assets import Trainium
  from wandb.sdk.internal.system.assets.trainium import NeuronCoreStats
  from wandb.sdk.internal.system.system_monitor import AssetInterface
label_desc: Use image node_id 2 for calling a global function with example usage: trainium_asset(test_settings) and returns: interface