code: def test_streaming_observability_metrics_apis(
      model_def: str, timings_enabled: bool
  ) -> None:
      # TODO: refactor tests to not use cli singleton auth.
      certs.cli_cert = certs.default_load(conf.make_master_url())
      authentication.cli_auth = authentication.Authentication(
          conf.make_master_url()
      )
  
      config_path = conf.fixtures_path(
          "mnist_pytorch/const-profiling.yaml"
      )
  
      config_obj = conf.load_config(config_path)
      with tempfile.NamedTemporaryFile() as tf:
          with open(tf.name, "w") as f:
              util.yaml_safe_dump(config_obj, f)
          experiment_id = exp.create_experiment(tf.name, model_def)
  
      exp.wait_for_experiment_state(
          experiment_id, bindings.experimentv1State.COMPLETED
      )
      trials = exp.experiment_trials(experiment_id)
      trial_id = trials[0].trial.id
  
      gpu_enabled = conf.GPU_ENABLED
  
      request_profiling_metric_labels(
          trial_id, timings_enabled, gpu_enabled
      )
      if gpu_enabled:
          request_profiling_system_metrics(trial_id, "gpu_util")
      if timings_enabled:
          request_profiling_pytorch_timing_metrics(
              trial_id, "train_batch"
          )
          request_profiling_pytorch_timing_metrics(
              trial_id, "train_batch.backward", accumulated=True
          )
  
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 1 for calling a global function with example usage: test_streaming_observability_metrics_apis(model_def, timings_enabled) without return types