#NEWLINE# def _validate_nodeid( nodeid ) : #NEWLINE# #INDENT# if ( '|' in nodeid ) : #NEWLINE# #INDENT# nodeid = nodeid . split ( '|' , 1 ) [ 0 ] #NEWLINE# #UNINDENT# m = _VALID_NODEID_RE . match ( nodeid ) #NEWLINE# if ( not m ) : #NEWLINE# #INDENT# raise ValueError ( ( "Node IDs should be in the format '<ip-or-hostname>:<port>': %s" % ( nodeid , ) ) ) #NEWLINE# #UNINDENT# port = int ( m . group ( 1 ) ) #NEWLINE# if ( not ( 0 <= port <= 65535 ) ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Ports should be in the range 0-65535: %d' % ( port , ) ) )