class_docstr: Cluster manager for TensorFlow servers.
docstr: Create list of workers from the resource spec with semi-arbitrarily chosen ports.
docstr_tok: ["Create","list","of","workers","from","the","resource","spec","with","semi-arbitrarily","chosen","ports","."]
code: def _get_default_cluster_spec(resource_spec: ResourceSpec):
      """Create list of workers from the resource spec with semi-arbitrarily chosen ports."""
      return {
          "worker": [
              "{ip}:{port}".format(
                  ip=n,
                  port=next(DEFAULT_PORT_RANGE)
                  # sorted is important.
                  # we need to guarantee the ip-port mapping to be the same in every worker.
              )
              for n in sorted(resource_spec.nodes)
          ]
      }
  
imports: import atexit
  import contextlib
  import json
  import os
  import signal
  import subprocess
  import sys
  import warnings
  from abc import ABCMeta, abstractmethod
  import paramiko
  from autodist.const import DEFAULT_PORT_RANGE, DEFAULT_WORKING_DIR, ENV
  from autodist.resource_spec import ResourceSpec
  from autodist.utils import logging
label_desc: Use image node_id 2 for calling the Cluster obj's underlying member method code with example usage: obj._get_default_cluster_spec(resource_spec) and returns: dict