#NEWLINE# def __call__( self , a ) : #NEWLINE# #INDENT# m = _get_backing_memmap ( a ) #NEWLINE# if ( m is not None ) : #NEWLINE# #INDENT# return _reduce_memmap_backed ( a , m ) #NEWLINE# #UNINDENT# if ( ( not a . dtype . hasobject ) and ( self . _max_nbytes is not None ) and ( a . nbytes > self . _max_nbytes ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# os . makedirs ( self . _temp_folder ) #NEWLINE# os . chmod ( self . _temp_folder , FOLDER_PERMISSIONS ) #NEWLINE# #UNINDENT# except OSError as e : #NEWLINE# #INDENT# if ( e . errno != errno . EEXIST ) : #NEWLINE# #INDENT# raise e #NEWLINE# #UNINDENT# #UNINDENT# basename = ( '%d-%d-%s.pkl' % ( os . getpid ( ) , id ( threading . current_thread ( ) ) , hash ( a ) ) ) #NEWLINE# filename = os . path . join ( self . _temp_folder , basename ) #NEWLINE# if ( not os . path . exists ( filename ) ) : #NEWLINE# #INDENT# if ( self . verbose > 0 ) : #NEWLINE# #INDENT# print ( ( 'Memmaping (shape=%r, dtype=%s) to new file %s' % ( a . shape , a . dtype , filename ) ) ) #NEWLINE# #UNINDENT# for dumped_filename in dump ( a , filename ) : #NEWLINE# #INDENT# os . chmod ( dumped_filename , FILE_PERMISSIONS ) #NEWLINE# #UNINDENT# if self . _prewarm : #NEWLINE# #INDENT# load ( filename , mmap_mode = self . _mmap_mode ) . max ( ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . verbose > 1 ) : #NEWLINE# #INDENT# print ( ( 'Memmaping (shape=%s, dtype=%s) to old file %s' % ( a . shape , a . dtype , filename ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return ( load , ( filename , self . _mmap_mode ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . verbose > 1 ) : #NEWLINE# #INDENT# print ( ( 'Pickling array (shape=%r, dtype=%s).' % ( a . shape , a . dtype ) ) ) #NEWLINE# #UNINDENT# return ( loads , ( dumps ( a , protocol = HIGHEST_PROTOCOL ) , ) )