#NEWLINE# @ override #NEWLINE# def download_files( self , epoch = ( - 1 ) ) : #NEWLINE# #INDENT# task = self . train_task ( ) #NEWLINE# snapshot_filename = None #NEWLINE# if ( ( epoch == ( - 1 ) ) and len ( task . snapshots ) ) : #NEWLINE# #INDENT# epoch = task . snapshots [ ( - 1 ) ] [ 1 ] #NEWLINE# snapshot_filename = self . snapshots [ ( - 1 ) ] [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for ( f , e ) in task . snapshots : #NEWLINE# #INDENT# if ( e == epoch ) : #NEWLINE# #INDENT# snapshot_filename = f #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( not snapshot_filename ) : #NEWLINE# #INDENT# raise ValueError ( 'Invalid epoch' ) #NEWLINE# #UNINDENT# model_files = task . get_model_files ( ) #NEWLINE# download_files = [ ( self . path ( filename ) , os . path . basename ( filename ) ) for filename in model_files . values ( ) ] #NEWLINE# download_files . extend ( [ ( task . dataset . path ( task . dataset . labels_file ) , os . path . basename ( task . dataset . labels_file ) ) , ( task . dataset . path ( task . dataset . train_db_task ( ) . mean_file ) , os . path . basename ( task . dataset . train_db_task ( ) . mean_file ) ) , ( snapshot_filename , os . path . basename ( snapshot_filename ) ) ] ) #NEWLINE# return download_files