#NEWLINE# def _parse_image_ref( image_href ) : #NEWLINE# #INDENT# 'Parse an image href into composite parts.\n\n    :param image_href: href of an image\n    :returns: a tuple of the form (image_id, host, port)\n    :raises ValueError\n\n    ' #NEWLINE# o = urlparse ( image_href ) #NEWLINE# port = ( o . port or 80 ) #NEWLINE# host = o . netloc . split ( ':' , 1 ) [ 0 ] #NEWLINE# image_id = int ( o . path . split ( '/' ) [ ( - 1 ) ] ) #NEWLINE# return ( image_id , host , port )