code: def _build_unmanaged_trial_cluster_info(
      client: experimental.Determined,
      exp_id: int,
      trial_id: int,
      task_id: str,
      config_text: str,  # TODO(ilia): we could load it from server.
      hparams: Optional[dict] = None,
      resume: bool = True,
      distributed: Optional[core.DistributedContext] = None,
  ) -> det.ClusterInfo:
      sess = client._session
      assert sess
  
      cluster_id = _get_cluster_id(sess)
      assert sess._auth
      token = sess._auth.get_session_token(True)
  
      resp = _start_trial(client, trial_id, resume, distributed)
  
      return det.ClusterInfo(
          master_url=client._master,
          cluster_id=cluster_id,  # Required for tensorboard paths correctness.
          agent_id="unmanaged",  # TODO(ilia): when does this matter?
          slot_ids=[],
          task_id=task_id,
          allocation_id=task_id,  # TODO(ilia): when does this matter?
          session_token=token,
          task_type="TRIAL",
          trial_info=det.TrialInfo(
              trial_id=trial_id,
              experiment_id=exp_id,
              trial_seed=0,
              hparams=hparams or {},
              config=util.yaml_safe_load(config_text),
              steps_completed=resp.stepsCompleted,
              trial_run_id=resp.trialRunId,
              debug=False,
              inter_node_network_interface=None,
          ),
          latest_checkpoint=resp.latestCheckpoint,
          rendezvous_info=det.RendezvousInfo(["127.0.0.1"], 0, [0]),
      )
  
imports: import logging
  from typing import Callable, Optional, Tuple, TypeVar, Union
  import determined
  from determined import core, experimental
  from determined.common import api, util
  from determined.common.api import bindings
label_desc: Use image node_id 15 for calling a global function with example usage: _build_unmanaged_trial_cluster_info(client, exp_id, trial_id, task_id, config_text, hparams, resume, distributed) and returns: det