code: def request_profiling_metric_labels(
      trial_id: int, timing_enabled: bool, gpu_enabled: bool
  ) -> None:
      def validate_labels(labels: Sequence[Dict[str, Any]]) -> None:
          # Check some labels against the expected labels. Return the missing labels.
          expected = {
              "cpu_util_simple": PROFILER_METRIC_TYPE_SYSTEM,
              "dataloader_next": PROFILER_METRIC_TYPE_TIMING,
              "disk_iops": PROFILER_METRIC_TYPE_SYSTEM,
              "disk_throughput_read": PROFILER_METRIC_TYPE_SYSTEM,
              "disk_throughput_write": PROFILER_METRIC_TYPE_SYSTEM,
              "free_memory": PROFILER_METRIC_TYPE_SYSTEM,
              "from_device": PROFILER_METRIC_TYPE_TIMING,
              "net_throughput_recv": PROFILER_METRIC_TYPE_SYSTEM,
              "net_throughput_sent": PROFILER_METRIC_TYPE_SYSTEM,
              "reduce_metrics": PROFILER_METRIC_TYPE_TIMING,
              "step_lr_schedulers": PROFILER_METRIC_TYPE_TIMING,
              "to_device": PROFILER_METRIC_TYPE_TIMING,
              "train_batch": PROFILER_METRIC_TYPE_TIMING,
          }
  
          if gpu_enabled:
              expected.update(
                  {
                      "gpu_free_memory": PROFILER_METRIC_TYPE_SYSTEM,
                      "gpu_util": PROFILER_METRIC_TYPE_SYSTEM,
                  }
              )
          if not timing_enabled:
              expected = {
                  k: v
                  for k, v in expected.items()
                  if v != PROFILER_METRIC_TYPE_TIMING
              }
          for label in labels:
              metric_name = label["name"]
              metric_type = label["metricType"]
              if expected.get(metric_name, None) == metric_type:
                  del expected[metric_name]
  
          if len(expected) > 0:
              pytest.fail(
                  f"expected completed experiment to have all labels but some are missing: {expected}"
              )
  
      with api.get(
          conf.make_master_url(),
          "api/v1/trials/{}/profiler/available_series".format(trial_id),
          stream=True,
      ) as r:
          for line in r.iter_lines():
              labels = json.loads(line)["result"]["labels"]
              validate_labels(labels)
              # Just check 1 iter.
              return
  
file_path: determined/e2e_tests/tests/experiment/test_profiling.py
imports: import json
  import tempfile
  from typing import Any, Dict, Optional, Sequence
  from urllib.parse import urlencode
  import pytest
  from determined.common import api, util
  from determined.common.api import authentication, bindings, certs
  from tests import config
  from tests import experiment
label_desc: Use image node_id 2 for calling a global function with example usage: request_profiling_metric_labels(trial_id, timing_enabled, gpu_enabled) without return types