class_docstr: Simple socket server with length-prefixed pickle messages.
  
  Args:
    :count: expected number of nodes in the cluster.
docstr: Returns a list of target ports as defined in the TFOS_SERVER_PORT environment (if set), otherwise defaults to 0 (any port).
  
  TFOS_SERVER_PORT should be either a single port number or a range, e.g. '8888' or '9997-9999'
docstr_tok: ["Returns","a","list","of","target","ports","as","defined","in","the","TFOS_SERVER_PORT","environment","(","if","set",")",",","otherwise","defaults","to","0","(","any","port",")",".","TFOS_SERVER_PORT","should","be","either","a","single","port","number","or","a","range",",","e.g",".","'8888","'","or","'9997-9999","'"]
code: def get_server_ports(self):
      """Returns a list of target ports as defined in the TFOS_SERVER_PORT environment (if set), otherwise defaults to 0 (any port).
  
      TFOS_SERVER_PORT should be either a single port number or a range, e.g. '8888' or '9997-9999'
      """
      port_string = os.getenv(TFOS_SERVER_PORT, "0")
      if "-" not in port_string:
          return [int(port_string)]
      else:
          ports = port_string.split("-")
          if len(ports) != 2:
              raise Exception(
                  "Invalid TFOS_SERVER_PORT: {}".format(port_string)
              )
          return list(range(int(ports[0]), int(ports[1]) + 1))
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import nested_scopes
  from __future__ import print_function
  import logging
  import os
  import pickle
  import select
  import socket
  import struct
  import sys
  import threading
  import time
  from .None import util
label_desc: Use image node_id 6 for calling the Server obj's underlying member method code with example usage: obj.get_server_ports() and returns: list, list