def _endpoint_from_image_ref(image_href):
 parts = image_href.split('/')
 image_id = parts[(-1)]
 endpoint = '/'.join(parts[:(-3)])
 return (image_id, endpoint)

def _endpoint_from_image_ref ( image_href ) : parts = image_href . split ( '/' ) image_id = parts [ ( - 1 ) ] endpoint = '/' . join ( parts [ : ( - 3 ) ] ) return ( image_id , endpoint )
return the image_ref and guessed endpoint from an image url .