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
  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 if entity . endswith ( '.sock' ) : port = None nodes . append ( parse_host ( entity , port ) ) return nodes
takes a string of the form host1[:port] .