def _check_location_uri(context, store_api, store_utils, uri):
 try:
  is_ok = (store_utils.validate_external_location(uri) and (store_api.get_size_from_backend(uri, context=context) > 0))
 except (store.UnknownScheme, store.NotFound, store.BadStoreUri):
  is_ok = False
 if (not is_ok):
  reason = _('Invalid location')
  raise exception.BadStoreUri(message=reason)

def _check_location_uri ( context , store_api , store_utils , uri ) : try : is_ok = ( store_utils . validate_external_location ( uri ) and ( store_api . get_size_from_backend ( uri , context = context ) > 0 ) ) except ( store . UnknownScheme , store . NotFound , store . BadStoreUri ) : is_ok = False if ( not is_ok ) : reason = _ ( 'Invalid location' ) raise exception . BadStoreUri ( message = reason )
check if an image location is valid .