def ParseHostPort(address):
 host_port_re = re.match('([a-zA-Z0-9-\\.]+):([0-9]{1,5})$', address)
 if (not host_port_re):
  raise TypeError(('bad host:port: %s' % address))
 host = host_port_re.group(1)
 port = int(host_port_re.group(2))
 if (port >= 65536):
  raise TypeError(('invalid port: %d' % port))
 return (host, port)

def ParseHostPort ( address ) : host_port_re = re . match ( '([a-zA-Z0-9-\\.]+):([0-9]{1,5})$' , address ) if ( not host_port_re ) : raise TypeError ( ( 'bad host:port: %s' % address ) ) host = host_port_re . group ( 1 ) port = int ( host_port_re . group ( 2 ) ) if ( port >= 65536 ) : raise TypeError ( ( 'invalid port: %d' % port ) ) return ( host , port )
parses the provided address string as host:port and returns a tuple of .