def METHOD_NAME(uri):
    """Get a backend storage provider based on uri."""
    for provider in ProviderFactory.get_storage_providers():
        try:
            supports = provider.supports_storage(uri)  # type: ignore[union-attr]
        except BaseException as e:
            communication.warn(f"Couldn't test provider {provider}: {e}")
        else:
            if supports:
                return provider(uri=uri)  # type: ignore[call-arg]
    raise errors.DatasetProviderNotFound(uri=uri)