code: def request_train_trials_sample(experiment_id):  # type: ignore
      response = api.get(
          conf.make_master_url(),
          "api/v1/experiments/{}/metrics-stream/trials-sample".format(
              experiment_id
          ),
          params={
              "metric_name": "loss",
              "metric_type": "METRIC_TYPE_TRAINING",
              "period_seconds": 1,
          },
      )
      results = [
          message["result"]
          for message in map(json.loads, response.text.splitlines())
      ]
      return check_trials_sample_result(results)
  
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 9 for calling a global function with example usage: request_train_trials_sample(experiment_id) and returns: check_trials_sample_result