#NEWLINE# @ typecheck ( Resource ) #NEWLINE# def remove_resource_instance( self , resource ) : #NEWLINE# #INDENT# client = self . _redis_maker ( ) #NEWLINE# weblab_resource = ( WEBLAB_RESOURCE % weblab_resource . resource_type ) #NEWLINE# if client . srem ( weblab_resource , resource . resource_instance ) : #NEWLINE# #INDENT# weblab_resource_instance_experiments = ( WEBLAB_RESOURCE_INSTANCE_EXPERIMENTS % ( resource . resource_type , resource . resource_instance ) ) #NEWLINE# experiment_instances = ( client . smembers ( weblab_resource_instance_experiments ) or [ ] ) #NEWLINE# client . delete ( weblab_resource_instance_experiments ) #NEWLINE# for experiment_instance in experiment_instances : #NEWLINE# #INDENT# experiment_instance_id = ExperimentInstanceId . parse ( experiment_instance ) #NEWLINE# self . remove_resource_instance_id ( experiment_instance_id )