code: def request_train_trials_snapshot(experiment_id):  # type: ignore
      response = api.get(
          conf.make_master_url(),
          "api/v1/experiments/{}/metrics-stream/trials-snapshot".format(
              experiment_id
          ),
          params={
              "metric_name": "loss",
              "metric_type": "METRIC_TYPE_TRAINING",
              "batches_processed": 100,
              "period_seconds": 1,
          },
      )
      results = [
          message["result"]
          for message in map(json.loads, response.text.splitlines())
      ]
  
      # First let's verify an empty response was sent back before any real work was done
      if results[0]["trials"] != []:
          return ("unexpected trials in first response", results)
  
      # Then we verify that we receive the expected number of trials and the right types
      trials = set()
      for i in range(1, len(results)):
          for trial in results[i]["trials"]:
              trials.add(trial["trialId"])
              validate_hparam_types(trial["hparams"])
              if type(trial["metric"]) != float:
                  return ("metric of unexpected type", results)
      if len(trials) != 5:
          return ("unexpected number of trials received", results)
      return None
  
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 6 for calling a global function with example usage: request_train_trials_snapshot(experiment_id) and returns: None, str,  results, str,  results, str,  results