class_docstr: Represents a cluster as a set of "tasks", organized into "jobs".
  
  A `tf.train.ClusterSpec` represents the set of processes that
  participate in a distributed TensorFlow computation. Every
  `tf.distribute.Server` is constructed in a particular cluster.
  
  To create a cluster with two jobs and five tasks, you specify the
  mapping from job names to lists of network addresses (typically
  hostname-port pairs).
  
  ```python
  cluster = tf.train.ClusterSpec({"worker": ["worker0.example.com:2222",
                                             "worker1.example.com:2222",
                                             "worker2.example.com:2222"],
                                  "ps": ["ps0.example.com:2222",
                                         "ps1.example.com:2222"]})
  ```
  
  Each job may also be specified as a sparse mapping from task indices
  to network addresses. This enables a server to be configured without
  needing to know the identity of (for example) all other worker
  tasks:
  
  ```python
  cluster = tf.train.ClusterSpec({"worker": {1: "worker1.example.com:2222"},
                                  "ps": ["ps0.example.com:2222",
                                         "ps1.example.com:2222"]})
  ```
class_docstr_tok: ["Represents","a","cluster","as","a","set","of","``","tasks","''",",","organized","into","``","jobs","''",".","A","`","tf.train.ClusterSpec","`","represents","the","set","of","processes","that","participate","in","a","distributed","TensorFlow","computation",".","Every","`","tf.distribute.Server","`","is","constructed","in","a","particular","cluster",".","To","create","a","cluster","with","two","jobs","and","five","tasks",",","you","specify","the","mapping","from","job","names","to","lists","of","network","addresses","(","typically","hostname-port","pairs",")",".","``","`","python","cluster","=","tf.train.ClusterSpec","(","{","``","worker","''",":","[","``","worker0.example.com:2222","''",",","``","worker1.example.com:2222","''",",","``","worker2.example.com:2222","''","]",",","``","ps","''",":","[","``","ps0.example.com:2222","''",",","``","ps1.example.com:2222","''","]","}",")","``","`","Each","job","may","also","be","specified","as","a","sparse","mapping","from","task","indices","to","network","addresses",".","This","enables","a","server","to","be","configured","without","needing","to","know","the","identity","of","(","for","example",")","all","other","worker","tasks",":","``","`","python","cluster","=","tf.train.ClusterSpec","(","{","``","worker","''",":","{","1",":","``","worker1.example.com:2222","''","}",",","``","ps","''",":","[","``","ps0.example.com:2222","''",",","``","ps1.example.com:2222","''","]","}",")","``","`"]
docstr: Returns a list of valid task indices in the given job.
  
  Args:
    job_name: The string name of a job in this cluster.
  
  Returns:
    A list of valid task indices in the given job.
  
  Raises:
    ValueError: If `job_name` does not name a job in this cluster,
    or no task with index `task_index` is defined in that job.
docstr_tok: ["Returns","a","list","of","valid","task","indices","in","the","given","job",".","Args",":","job_name",":","The","string","name","of","a","job","in","this","cluster",".","Returns",":","A","list","of","valid","task","indices","in","the","given","job",".","Raises",":","ValueError",":","If","`","job_name","`","does","not","name","a","job","in","this","cluster",",","or","no","task","with","index","`","task_index","`","is","defined","in","that","job","."]
code: def task_indices(self, job_name):
      """Returns a list of valid task indices in the given job.
  
      Args:
        job_name: The string name of a job in this cluster.
  
      Returns:
        A list of valid task indices in the given job.
  
      Raises:
        ValueError: If `job_name` does not name a job in this cluster,
        or no task with index `task_index` is defined in that job.
      """
      try:
          job = self._cluster_spec[job_name]
      except KeyError:
          raise ValueError("No such job in cluster: %r" % job_name)
      return list(sorted(job.keys()))
  
imports: from tensorflow.core.protobuf import cluster_pb2
  from tensorflow.core.protobuf import device_filters_pb2
  from tensorflow.core.protobuf import tensorflow_server_pb2
  from tensorflow.python.client import pywrap_tf_session
  from tensorflow.python.framework import errors
  from tensorflow.python.util import compat
  from tensorflow.python.util import deprecation
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 10 for calling the ClusterSpec obj's underlying member method code with example usage: obj.task_indices(job_name) and returns: list