class_docstr: ClusterInfo exposes various properties that are set for tasks while running on the cluster.
  
  Examples:
  
  .. code:: python
  
      info = det.get_cluster_info()
      assert info is not None, "this code only runs on-cluster!"
  
      print("master_url", info.master_url)
      print("task_id", info.task_id)
      print("allocation_id", info.allocation_id)
      print("session_token", info.session_token)
  
      print("container_addrs", info.container_addrs)
      print("container_rank", info.container_rank)
  
      if info.task_type == "TRIAL":
          print("trial.id", info.trial.trial_id)
          print("trial.hparams", info.trial.hparams)
  
  .. warning::
  
     Be careful with this object!  If you depend on a ClusterInfo object during training for
     anything more than e.g.  informational logging, you run the risk of making your training code
     unable to run outside of Determined.  ClusterInfo is meant to be most useful to custom launch
     layers, which likely are not able to run outside of Determined anyway.
class_docstr_tok: ["ClusterInfo","exposes","various","properties","that","are","set","for","tasks","while","running","on","the","cluster",".","Examples",":","..","code",":",":","python","info","=","det.get_cluster_info","(",")","assert","info","is","not","None",",","``","this","code","only","runs","on-cluster","!","''","print","(","``","master_url","''",",","info.master_url",")","print","(","``","task_id","''",",","info.task_id",")","print","(","``","allocation_id","''",",","info.allocation_id",")","print","(","``","session_token","''",",","info.session_token",")","print","(","``","container_addrs","''",",","info.container_addrs",")","print","(","``","container_rank","''",",","info.container_rank",")","if","info.task_type","==","``","TRIAL","''",":","print","(","``","trial.id","''",",","info.trial.trial_id",")","print","(","``","trial.hparams","''",",","info.trial.hparams",")","..","warning",":",":","Be","careful","with","this","object","!","If","you","depend","on","a","ClusterInfo","object","during","training","for","anything","more","than","e.g",".","informational","logging",",","you","run","the","risk","of","making","your","training","code","unable","to","run","outside","of","Determined",".","ClusterInfo","is","meant","to","be","most","useful","to","custom","launch","layers",",","which","likely","are","not","able","to","run","outside","of","Determined","anyway","."]
docstr: The rank assigned to this container.
  
  When using a distributed training framework, the framework may choose a different rank for
  this container.
docstr_tok: ["The","rank","assigned","to","this","container",".","When","using","a","distributed","training","framework",",","the","framework","may","choose","a","different","rank","for","this","container","."]
code: def container_rank(self) -> int:
      """
      The rank assigned to this container.
  
      When using a distributed training framework, the framework may choose a different rank for
      this container.
      """
      if self.task_type != "TRIAL":
          # Presently, only trials are allowed to use the rendezvous API.
          # But also, only trials are scheduled across multiple nodes, so we can cheat here.
          return 0
      assert self._rendezvous_info is not None
      return self._rendezvous_info.container_rank
  
imports: import json
  import os
  from typing import Any, Dict, Iterable, List, Optional, Union
  from determined import gpu
label_desc: Use image node_id 10 for calling the ClusterInfo obj's underlying member method code with example usage: obj.container_rank() and returns: self, int