code: def test_trial_describe_metrics() -> None:
      exp_id = exp.run_basic_test(
          conf.fixtures_path("no_op/single-one-short-step.yaml"),
          conf.fixtures_path("no_op"),
          1,
      )
      trials = exp.experiment_trials(exp_id)
      trial_id = trials[0].trial.id
  
      cmd = [
          "det",
          "-m",
          conf.make_master_url(),
          "trial",
          "describe",
          "--json",
          "--metrics",
          str(trial_id),
      ]
  
      output = json.loads(subprocess.check_output(cmd))
  
      workloads = output["workloads"]
      assert len(workloads) == 102
      flattened_batch_metrics: List[Dict[str, float]] = sum(
          (
              w["training"]["metrics"]["batchMetrics"]
              for w in workloads
              if w["training"]
          ),
          [],
      )
      losses = [m["loss"] for m in flattened_batch_metrics]
  
      assert len(losses) == 100
  
      # assert summary metrics in trial
      sess = api_utils.determined_test_session(admin=True)
      resp = bindings.get_GetTrial(session=sess, trialId=trial_id)
      summaryMetrics = resp.trial.summaryMetrics
      assert summaryMetrics is not None
      assert summaryMetrics["avg_metrics"]["loss"]["count"] == 100
      assert summaryMetrics["avg_metrics"]["loss"]["max"] is not None
      assert summaryMetrics["avg_metrics"]["loss"]["min"] is not None
      assert summaryMetrics["avg_metrics"]["loss"]["mean"] is not None
      assert summaryMetrics["avg_metrics"]["loss"]["type"] == "number"
  
imports: import json
  import multiprocessing
  import multiprocessing.pool
  import subprocess
  from typing import Dict, List, Set, Union
  import pytest
  from determined.common import api
  from determined.common.api import authentication, bindings, certs
  from tests import api_utils
  from tests import config
  from tests import experiment
label_desc: Use image node_id 12 for calling a global function with example usage: test_trial_describe_metrics() without return types