/usr/local/lib/python3.6/site-packages/joblib/__pycache__
Edit: /usr/local/lib/python3.6/site-packages/joblib/__pycache__/backports.cpython-36.pyc (2555B)
3
Eg
@ s d Z ddlZddlZddlmZ ddlmZ ddlmZ yddl Z
dd
dZW n ek
rl dddZY nX ej
d
krdZddlmZ dd ZnddlmZ dS )z,
Backports of fixes for joblib dependencies
N)LooseVersion)basename)utiluint8r+CFc C sb t jdj|t| tj tj| |||||d}ttj dk rF||_
|r^ddlm} || |S )ab Custom memmap constructor compatible with numpy.memmap.
This function:
- is a backport the numpy memmap offset fix (See
https://github.com/numpy/numpy/pull/8443 for more details.
The numpy fix is available starting numpy 1.13)
- adds ``unlink_on_gc_collect``, which specifies explicitly whether
the process re-constructing the memmap owns a reference to the
underlying file. If set to True, it adds a finalizer to the
newly-created memmap that sends a maybe_unlink request for the
memmaped file to resource_tracker.
z?[MEMMAP READ] creating a memmap (shape {}, filename {}, pid {}))dtypemodeoffsetshapeorderz1.13 )add_maybe_unlink_finalizer)
r debugformatr osgetpidnpZmemmapr __version__r
Z_memmapping_reducerr ) filenamer r r
r r unlink_on_gc_collectmmr r :/usr/local/lib/python3.6/site-packages/joblib/backports.pymake_memmap s
r c C s t dd S )NzL'joblib.backports.make_memmap' should not be used if numpy is not installed.)NotImplementedError)r r r r
r r r r r r r + s nt
)replacec C s d}d}d}xp||k rzyt | | P W q tk
rv } z4t|ddtkrdtj| ||7 }|d9 }n W Y dd}~X qX qW dS )zRenames ``src`` into ``dst`` overwriting ``dst`` if it exists.
On Windows os.replace can yield permission errors if executed by two
different processes.
r
r gMbP?winerrorN )r Exceptiongetattraccess_denied_errorstimesleep)srcdstZmax_sleep_timeZtotal_sleep_timeZ
sleep_timeexcr r r concurrency_safe_rename7 s
r* )r r r Nr F)r r r Nr F)r r )__doc__r r% Zdistutils.versionr os.pathr multiprocessingr Znumpyr r ImportErrornamer$ r r* r r r r
s"