def _parse_image_ref(image_href):
 o = urlparse.urlparse(image_href)
 port = (o.port or 80)
 host = o.netloc.split(':', 1)[0]
 image_id = o.path.split('/')[(-1)]
 use_ssl = (o.scheme == 'https')
 return (image_id, host, port, use_ssl)

def _parse_image_ref ( image_href ) : o = urlparse . urlparse ( image_href ) port = ( o . port or 80 ) host = o . netloc . split ( ':' , 1 ) [ 0 ] image_id = o . path . split ( '/' ) [ ( - 1 ) ] use_ssl = ( o . scheme == 'https' ) return ( image_id , host , port , use_ssl )
parse an image href into composite parts .