#NEWLINE# def __init__( self , func , cachedir , ignore = None , mmap_mode = None , compress = False , verbose = 1 , timestamp = None ) : #NEWLINE# #INDENT# "\n            Parameters\n            ----------\n            func: callable\n                The function to decorate\n            cachedir: string\n                The path of the base directory to use as a data store\n            ignore: list or None\n                List of variable names to ignore.\n            mmap_mode: {None, 'r+', 'r', 'w+', 'c'}, optional\n                The memmapping mode used when loading from cache\n                numpy arrays. See numpy.load for the meaning of the\n                arguments.\n            compress : boolean, or integer\n                Whether to zip the stored data on disk. If an integer is\n                given, it should be between 1 and 9, and sets the amount\n                of compression. Note that compressed arrays cannot be\n                read by memmapping.\n            verbose: int, optional\n                Verbosity flag, controls the debug messages that are issued\n                as functions are evaluated. The higher, the more verbose\n            timestamp: float, optional\n                The reference time from which times in tracing messages\n                are reported.\n        " #NEWLINE# Logger . __init__ ( self ) #NEWLINE# self . mmap_mode = compress #NEWLINE# self . func = func #NEWLINE# if ( ignore is None ) : #NEWLINE# #INDENT# ignore = [ ] #NEWLINE# #UNINDENT# self . ignore = ignore #NEWLINE# self . _verbose = verbose #NEWLINE# self . cachedir = cachedir #NEWLINE# self . compress = compress #NEWLINE# if ( compress and ( self . mmap_mode is not None ) ) : #NEWLINE# #INDENT# warnings . warn ( 'Compressed results cannot be memmapped' , stacklevel = 2 ) #NEWLINE# #UNINDENT# if ( timestamp is None ) : #NEWLINE# #INDENT# timestamp = time . time ( ) #NEWLINE# #UNINDENT# self . timestamp = timestamp #NEWLINE# mkdirp ( self . cachedir ) #NEWLINE# try : #NEWLINE# #INDENT# functools . update_wrapper ( self , func ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# " Objects like ufunc don't like that " #NEWLINE# #UNINDENT# if inspect . isfunction ( func ) : #NEWLINE# #INDENT# doc = pydoc . TextDoc ( ) . document ( func ) #NEWLINE# doc = doc . replace ( '\n' , '\n\n' , 1 ) #NEWLINE# doc = re . sub ( '\x08.' , '' , doc ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# doc = func . __doc__ #NEWLINE# #UNINDENT# self . __doc__ = ( 'Memoized version of %s' % doc )