/usr/local/lib/python3.6/site-packages/joblib/__pycache__
NameSizeModeActions
backports.cpython-36.pyc25550644editdlrm
compressor.cpython-36.pyc166160644editdlrm
disk.cpython-36.pyc30500644editdlrm
executor.cpython-36.pyc31660644editdlrm
format_stack.cpython-36.pyc8440644editdlrm
func_inspect.cpython-36.pyc87290644editdlrm
hashing.cpython-36.pyc62650644editdlrm
logger.cpython-36.pyc39600644editdlrm
memory.cpython-36.pyc288340644editdlrm
my_exceptions.cpython-36.pyc11300644editdlrm
numpy_pickle.cpython-36.pyc155640644editdlrm
numpy_pickle_compat.cpython-36.pyc70520644editdlrm
numpy_pickle_utils.cpython-36.pyc65160644editdlrm
parallel.cpython-36.pyc324160644editdlrm
pool.cpython-36.pyc124350644editdlrm
testing.cpython-36.pyc20370644editdlrm
_cloudpickle_wrapper.cpython-36.pyc5430644editdlrm
_dask.cpython-36.pyc105280644editdlrm
_deprecated_format_stack.cpython-36.pyc82160644editdlrm
_deprecated_my_exceptions.cpython-36.pyc27510644editdlrm
_memmapping_reducer.cpython-36.pyc161240644editdlrm
_multiprocessing_helpers.cpython-36.pyc12100644editdlrm
_parallel_backends.cpython-36.pyc196710644editdlrm
_store_backends.cpython-36.pyc139460644editdlrm
_utils.cpython-36.pyc11260644editdlrm
__init__.cpython-36.pyc45380644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/joblib/__pycache__/compressor.cpython-36.pyc (16616B)
3 Eg:M$@sdZddlZddlZddlmZyddlmZWn ek rPddlmZYnXy ddl Z Wnek rvdZ YnXyddl Z ddl m Z Wnek rdZ YnXy ddl Z Wnek rdZ YnXdZiadZdZd Zd Zd Zd Zd Zd'ddZGdddZGdddeZGdddeZGdddeZGdddeZdZdZdZdZ dZ!Gdd d ej"Z#Gd!d"d"eZ$Gd#d$d$e#Z%Gd%d&d&eZ&dS)(z/Classes and functions for managing compressors.N) LooseVersion)RLock) LZ4FrameFilezMLZ4 is not installed. Install it with pip: https://python-lz4.readthedocs.io/sZFxssBZs7zXZs]s"MFcCst|tstdj|t|ts0tdj||jdk rt|jd srt|jd srt|jd srt|jd rtdj|j|tkr| rtd j||t|<dS) zRegister a new compressor. Parameters ----------- compressor_name: str. The name of the compressor. compressor: CompressorWrapper An instance of a 'CompressorWrapper'. z/Compressor name should be a string, '{}' given.zHCompressor should implement the CompressorWrapper interface, '{}' given.Nreadwriteseektellz^Compressor 'fileobj_factory' attribute should implement the file object interface, '{}' given.z#Compressor '{}' already registered.) isinstancestr ValueErrorformatCompressorWrapperfileobj_factoryhasattr _COMPRESSORS)Zcompressor_nameZ compressorforcer;/usr/local/lib/python3.6/site-packages/joblib/compressor.pyregister_compressor-s"    rc@s,eZdZdZd ddZd ddZd d ZdS) raA wrapper around a compressor file object. Attributes ---------- obj: a file-like object The object must implement the buffer interface and will be used internally to compress/decompress the data. prefix: bytestring A bytestring corresponding to the magic number that identifies the file format associated to the compressor. extention: str The file extension used to automatically select this compressor during a dump to a file. cCs||_||_||_dS)N)rprefix extension)selfobjrrrrr__init__aszCompressorWrapper.__init__NcCs(|dkr|j|dS|j|d|dSdS)z0Returns an instance of a compressor file object.Nwb) compresslevel)r)rfileobjrrrrcompressor_filefs z!CompressorWrapper.compressor_filecCs |j|dS)z2Returns an instance of a decompressor file object.rb)r)rrrrrdecompressor_filensz#CompressorWrapper.decompressor_file)rr)N)__name__ __module__ __qualname____doc__rr r"rrrrrQs  rc@s6eZdZeZdZddZddZd ddZd d Z dS) BZ2CompressorWrapperz.bz2cCstdk rtj|_nd|_dS)N)bz2BZ2Filer)rrrrrxs zBZ2CompressorWrapper.__init__cCstdkrtddS)Nz;bz2 module is not compiled on your python standard library.)r(r )rrrr_check_versions~sz$BZ2CompressorWrapper._check_versionsNcCs0|j|dkr|j|dS|j|d|dSdS)z0Returns an instance of a compressor file object.Nr)r)r*r)rrrrrrr s  z$BZ2CompressorWrapper.compressor_filecCs|j|j|d}|S)z2Returns an instance of a decompressor file object.r!)r*r)rrrrrr"s z&BZ2CompressorWrapper.decompressor_file)N) r#r$r% _BZ2_PREFIXrrrr*r r"rrrrr'ss  r'c@s:eZdZeZdZdZddZddZd dd Z d d Z dS) LZMACompressorWrapperz.lzma FORMAT_ALONEcCs*tdk r tj|_tt|j|_nd|_dS)N)lzmaLZMAFilergetattr_lzma_format_name _lzma_format)rrrrrszLZMACompressorWrapper.__init__cCstdkrtddS)Nz= 2.7. If filename is a str or bytes object, it gives the name of the file to be opened. Otherwise, it should be a file object, which will be used to read or write the compressed data. mode can be 'rb' for reading (default) or 'wb' for (over)writing If mode is 'wb', compresslevel can be a number between 1 and 9 specifying the level of compression: 1 produces the least compression, and 9 produces the most compression. 3 is the default. r!rAcCst|_d|_d|_t|_d|_d|_||_t |t  sRd|koJdkn r`t dj ||dkrt |_tj|j|_d|_d|_n:|dkrt|_tj|jtj|jtjd|_nt d |ft |trtj|||_d |_n&t|d st|d r||_ntd dS)NFrr; zS'compresslevel' must be an integer between 1 and 9. You provided 'compresslevel={}'r!rrzInvalid mode: %rTrrz1filename must be a str or bytes object, or a file)r_lock_fp_closefp _MODE_CLOSED_mode_pos_sizerr intr r _MODE_READzlib decompressobjwbits _decompressor_buffer_buffer_offset _MODE_WRITE compressobjDEFLATED DEF_MEM_LEVEL _compressorr ioopenr TypeError)rfilenamemoderrrrrs6& zBinaryZlibFile.__init__cCs|j|jtkrdSz<|jttfkr.d|_n"|jtkrP|jj|j j d|_ Wdz|j rf|jj Wdd|_d|_ t|_d|_ d|_XXWdQRXdS)zFlush and close the file. May be called more than once without error. Once the file is closed, any other operation on it will raise a ValueError. NFrr)rErIrHrM_MODE_READ_EOFrQrTrFrrXflushrGcloserRrS)rrrrr`'s"   zBinaryZlibFile.closecCs |jtkS)zTrue if this file is closed.)rIrH)rrrrclosedAszBinaryZlibFile.closedcCs|j|jjS)z3Return the file descriptor for the underlying file.)_check_not_closedrFfileno)rrrrrcFszBinaryZlibFile.filenocCs|jo|jjS)z)Return whether the file supports seeking.)readablerFseekable)rrrrreKszBinaryZlibFile.seekablecCs|j|jttfkS)z/Return whether the file was opened for reading.)rbrIrMr^)rrrrrdOszBinaryZlibFile.readablecCs|j|jtkS)z/Return whether the file was opened for writing.)rbrIrT)rrrrwritableTszBinaryZlibFile.writablecCsB|jr>t|jdd}d}|dk r.|dj|7}|d7}t|dS)NnamezI/O operation on closed filez {}.)rar0rFr r )rfnamemsgrrrrb[sz BinaryZlibFile._check_not_closedcCs$|jttfkr |jtjddS)NzFile not open for reading)rIrMr^rbrYUnsupportedOperation)rrrr_check_can_readdszBinaryZlibFile._check_can_readcCs |jtkr|jtjddS)NzFile not open for writing)rIrTrbrYrk)rrrr_check_can_writeis zBinaryZlibFile._check_can_writecCs8|jttfkr |jtjd|jjs4tjddS)Nz3Seeking is only supported on files open for readingz3The underlying file object does not support seeking)rIrMr^rbrYrkrFre)rrrr_check_can_seekns   zBinaryZlibFile._check_can_seekc Cs|jtkrdSxl|jt|jkrzy |jjp4|jjt }|s>t Wn"t k rbt|_|j |_ dSX|jj ||_d|_qWdS)NFrT)rIr^rSlenrRrQ unused_datarFr _BUFFER_SIZEEOFErrorrJrK decompress)rrawblockrrr _fill_bufferxs   zBinaryZlibFile._fill_bufferTcCsf|j|jd|_d|_g}x6|jrR|r6|j|j|jt|j7_d|_qW|rbdj|SdS)Nrr)rRrSruappendrJrojoin)r return_datablocksrrr _read_alls   zBinaryZlibFile._read_allcCs|j|}|t|jkrL|j|j|}||_|jt|7_|rH|SdS|j|jd|_d|_g}xp|dkr|jr|t|jkr|jd|}||_n |j}d|_|r|j||jt|7_|t|8}qjW|rdj|SdS)Nrr)rSrorRrJrurvrw)rZn_bytesrxenddataryrrr _read_blocks*   zBinaryZlibFile._read_blockr;c CsD|j4|j|dkrdS|dkr,|jS|j|SWdQRXdS)zRead up to size uncompressed bytes from the file. If size is negative or omitted, read until EOF is reached. Returns b'' if the file is already at EOF. rrN)rErlrzr})rsizerrrrszBinaryZlibFile.readc Cs |jtjj||SQRXdS)z_Read up to len(b) bytes into b. Returns the number of bytes read (0 for EOF). N)rErYBufferedIOBasereadinto)rbrrrrszBinaryZlibFile.readintoc Cs^|jN|jt|tr"|j}|jj|}|jj||j t |7_ t |SQRXdS)zWrite a byte string to the file. Returns the number of uncompressed bytes written, which is always len(data). Note that due to buffering, the file on disk may not reflect the data written until close() is called. N) rErmr memoryviewtobytesrXcompressrFrrJro)rr| compressedrrrrs   zBinaryZlibFile.writecCs8|jjddt|_d|_tj|j|_d|_ d|_ dS)Nrr) rFrrMrIrJrNrOrPrQrRrS)rrrr_rewinds zBinaryZlibFile._rewindrc Cs|j|j|dkrnL|dkr.|j|}n8|dkrX|jdkrL|jdd|j|}ntd|f||jkrz|jn ||j8}|j|dd|jSQRXdS)aChange the file position. The new position is specified by offset, relative to the position indicated by whence. Values for whence are: 0: start of stream (default); offset must not be negative 1: current stream position 2: end of stream; offset must not be positive Returns the new file position. Note that seeking is emulated, so depending on the parameters, this operation may be extremely slow. rr;r@F)rxzInvalid value for whence: %sN)rErnrJrKrzr rr})roffsetwhencerrrrs        zBinaryZlibFile.seekc Cs |j|j|jSQRXdS)z!Return the current file position.N)rErbrJ)rrrrr szBinaryZlibFile.tellN)r!rA)T)TrD)rD)r)r#r$r%r&rN MAX_WBITSrPrr`propertyrarcrerdrfrbrlrmrnrurzr}rrrrrr rrrrrBs, &       *rBc@seZdZddZdS)ZlibCompressorWrappercCstj|ttdddS)Nz.z)rrr)rrrB _ZLIB_PREFIX)rrrrr szZlibCompressorWrapper.__init__N)r#r$r%rrrrrrsrc@seZdZdZdZdS)BinaryGzipFilea A file object providing transparent gzip (de)compression. If filename is a str or bytes object, it gives the name of the file to be opened. Otherwise, it should be a file object, which will be used to read or write the compressed data. mode can be 'rb' for reading (default) or 'wb' for (over)writing If mode is 'wb', compresslevel can be a number between 1 and 9 specifying the level of compression: 1 produces the least compression, and 9 produces the most compression. 3 is the default. N)r#r$r%r&rPrrrrr%s rc@seZdZddZdS)GzipCompressorWrappercCstj|ttdddS)Nz.gz)rrr)rrr _GZIP_PREFIX)rrrrr8szGzipCompressorWrapper.__init__N)r#r$r%rrrrrr6sr)F)'r&rYrNZdistutils.versionr threadingr ImportErrordummy_threadingr(r9Z lz4.framerr.r<rZ _ZFILE_PREFIXrrr+r7r4r?rrr'r,r5r8rHrMr^rTrqrrBrrrrrrrs\       #" !%9