#NEWLINE# def _load_output( output_dir , func_name , timestamp = None , metadata = None , mmap_mode = None , verbose = 0 ) : #NEWLINE# #INDENT# 'Load output of a computation.' #NEWLINE# if ( verbose > 1 ) : #NEWLINE# #INDENT# signature = '' #NEWLINE# try : #NEWLINE# #INDENT# if ( metadata is not None ) : #NEWLINE# #INDENT# args = ', ' . join ( [ ( '%s=%s' % ( name , value ) ) for ( name , value ) in metadata [ 'input_args' ] . items ( ) ] ) #NEWLINE# signature = ( '%s(%s)' % ( os . path . basename ( func_name ) , args ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# signature = os . path . basename ( func_name ) #NEWLINE# #UNINDENT# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# if ( timestamp is not None ) : #NEWLINE# #INDENT# t = ( '% 16s' % format_time ( ( time . time ( ) - timestamp ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# t = '' #NEWLINE# #UNINDENT# if ( verbose < 10 ) : #NEWLINE# #INDENT# print ( ( '[Memory]%s: Loading %s...' % ( t , str ( signature ) ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( ( '[Memory]%s: Loading %s from %s' % ( t , str ( signature ) , output_dir ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# filename = os . path . join ( output_dir , 'output.pkl' ) #NEWLINE# if ( not os . path . isfile ( filename ) ) : #NEWLINE# #INDENT# raise KeyError ( ( 'Non-existing cache value (may have been cleared).\nFile %s does not exist' % filename ) ) #NEWLINE# #UNINDENT# return numpy_pickle . load ( filename , mmap_mode = mmap_mode )