(hosts, default_port=DEFAULT_PORT)
return nodes
Takes a string of the form host1[:port],host2[:port]... and
    splits it into (host, port) tuples. If [:port] isn't present the
    default_port is used.

    Returns a set of 2-tuples containing the host name (or IP) followed by
    port number.

    :Parameters:
        - `hosts`: A string of the form host1[:port],host2[:port],...
        - `default_port`: The port number to use when one wasn't specified
          for a host.
Takes a string of the form host1[:port],host2[:port]... and
    splits it into (host, port) tuples. If [:port] isn't present the
    default_port is used.
Takes a string of the form host1 [ : port ] host2 [ : port ] ... and splits it into ( host port ) tuples . If [ : port ] isn t present the default_port is used .
def split_hosts(hosts, default_port=DEFAULT_PORT):
    """Takes a string of the form host1[:port],host2[:port]... and
    splits it into (host, port) tuples. If [:port] isn't present the
    default_port is used.

    Returns a set of 2-tuples containing the host name (or IP) followed by
    port number.

    :Parameters:
        - `hosts`: A string of the form host1[:port],host2[:port],...
        - `default_port`: The port number to use when one wasn't specified
          for a host.
    """
    nodes = []
    for entity in hosts.split(','):
        if not entity:
            raise ConfigurationError("Empty host "
                                     "(or extra comma in host list).")
        port = default_port
        # Unix socket entities don't have ports
        if entity.endswith('.sock'):
            port = None
        nodes.append(parse_host(entity, port))
    return nodes
def split_hosts ( hosts , default_port = DEFAULT_PORT ) : nodes = [ ] for entity in hosts . split ( ',' ) : if not entity : raise ConfigurationError ( "Empty host " "(or extra comma in host list)." ) port = default_port # Unix socket entities don't have ports if entity . endswith ( '.sock' ) : port = None nodes . append ( parse_host ( entity , port ) ) return nodes