#NEWLINE# def delete( self , version ) : #NEWLINE# #INDENT# md = self . _read_md ( ) #NEWLINE# versions = [ m [ 'version' ] for m in md [ 'models' ] ] #NEWLINE# version = int ( version ) #NEWLINE# if ( version not in m ) : #NEWLINE# #INDENT# raise LookupError ( 'No such version: {}' . format ( version ) ) #NEWLINE# #UNINDENT# self . _update_md ( { #NEWLINE# #INDENT# 'models' : [ m for m in md [ 'models' ] if ( m [ 'version' ] != version ) ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# os . remove ( ( self . path . format ( version = version ) + '.pkl.gz' ) )