#NEWLINE# @ contextmanager #NEWLINE# def setup_rest_cache( self , local = None , return_failed = False ) : #NEWLINE# #INDENT# with temporary_dir ( ) as artifact_root : #NEWLINE# #INDENT# local = ( local or TempLocalArtifactCache ( artifact_root , 0 ) ) #NEWLINE# with self . setup_server ( return_failed = return_failed ) as base_url : #NEWLINE# #INDENT# ( yield RESTfulArtifactCache ( artifact_root , BestUrlSelector ( [ base_url ] ) , local ) )