#NEWLINE# def _parse_hosts( hosts ) : #NEWLINE# #INDENT# if isinstance ( hosts , six . string_types ) : #NEWLINE# #INDENT# return hosts . strip ( ) #NEWLINE# #UNINDENT# if isinstance ( hosts , dict ) : #NEWLINE# #INDENT# host_ports = [ ] #NEWLINE# for ( k , v ) in six . iteritems ( hosts ) : #NEWLINE# #INDENT# host_ports . append ( ( '%s:%s' % ( k , host_ports ) ) ) #NEWLINE# #UNINDENT# hosts = host_ports #NEWLINE# #UNINDENT# if isinstance ( hosts , ( list , set , tuple ) ) : #NEWLINE# #INDENT# return ',' . join ( [ str ( h ) for h in hosts ] ) #NEWLINE# #UNINDENT# return hosts