Ë
    æÿæiþE  ã                   óD  — d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlmZmZ ddlmZ ddlmZ ddlmZ ddlmZmZmZ dd	lmZ  ej8                  d
d«      Z G d„ de«      Zd„ Z  G d„ de¬«      Z! G d„ de"«      Z# G d„ de!e#«      Z$y)z.Storage providers backends for Memory caching.é    N)ÚABCMetaÚabstractmethod)ÚPicklingErroré   )Únumpy_pickle)Úconcurrency_safe_rename)Úmemstr_to_bytesÚmkdirpÚ
rm_subdirs)Úformat_timeÚCacheItemInfozpath size last_accessc                   ó   — e Zd ZdZy)ÚCacheWarningz:Warning to capture dump failures except for PicklingError.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úk/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/joblib/_store_backends.pyr   r      s   „ ÙDàr   r   c                 óÈ   — t        t        j                  «       «      }|› dt        j                  «       j
                  › dt        j                  «       › d|› �} || |«       |S )z>Writes an object into a unique file in a concurrency-safe way.Ú.Ú-)ÚidÚ	threadingÚcurrent_threadÚuuidÚuuid4ÚhexÚosÚgetpid)Úobject_to_writeÚfilenameÚ
write_funcÚ	thread_idÚtemporary_filenames        r   Úconcurrency_safe_writer'       sX   € ô ”9×+Ñ+Ó-Ó.€IØ$˜: Q¤t§z¡z£|×'7Ñ'7Ð&8¸¼"¿)¹)»+¸ÀaÈ	À{ÐSÐáˆÐ 2Ô3àÐr   c                   ó”   — e Zd ZdZdZed„ «       Zed„ «       Zed„ «       Zed„ «       Z	ed„ «       Z
ed„ «       Zed	 e«       fd
„«       Zy)ÚStoreBackendBasez^Helper Abstract Base Class which defines all methods that
    a StorageBackend must implement.Nc                  ó   — y)aß  Opens an item on the store and return a file-like object.

        This method is private and only used by the StoreBackendMixin object.

        Parameters
        ----------
        f: a file-like object
            The file-like object where an item is stored and retrieved
        mode: string, optional
            the mode in which the file-like object is opened allowed valued are
            'rb', 'wb'

        Returns
        -------
        a file-like object
        Nr   )ÚselfÚfÚmodes      r   Ú
_open_itemzStoreBackendBase._open_item5   ó   � r   c                  ó   — y)a¥  Checks if an item location exists in the store.

        This method is private and only used by the StoreBackendMixin object.

        Parameters
        ----------
        location: string
            The location of an item. On a filesystem, this corresponds to the
            absolute path, including the filename, of a file.

        Returns
        -------
        True if the item exists, False otherwise
        Nr   ©r+   Úlocations     r   Ú_item_existszStoreBackendBase._item_existsH   r/   r   c                  ó   — y)a-  Moves an item from src to dst in the store.

        This method is private and only used by the StoreBackendMixin object.

        Parameters
        ----------
        src: string
            The source location of an item
        dst: string
            The destination location of an item
        Nr   )r+   ÚsrcÚdsts      r   Ú
_move_itemzStoreBackendBase._move_itemY   r/   r   c                  ó   — y)zÎCreates a location on the store.

        Parameters
        ----------
        location: string
            The location in the store. On a filesystem, this corresponds to a
            directory.
        Nr   r1   s     r   Úcreate_locationz StoreBackendBase.create_locationg   r/   r   c                  ó   — y)zèClears a location on the store.

        Parameters
        ----------
        location: string
            The location in the store. On a filesystem, this corresponds to a
            directory or a filename absolute path
        Nr   r1   s     r   Úclear_locationzStoreBackendBase.clear_locationr   r/   r   c                  ó   — y)z»Returns the whole list of items available in the store.

        Returns
        -------
        The list of items identified by their ids (e.g filename in a
        filesystem).
        Nr   ©r+   s    r   Ú	get_itemszStoreBackendBase.get_items}   r/   r   r   c                  ó   — y)a—  Configures the store.

        Parameters
        ----------
        location: string
            The base location used by the store. On a filesystem, this
            corresponds to a directory.
        verbose: int
            The level of verbosity of the store
        backend_options: dict
            Contains a dictionary of named parameters used to configure the
            store backend.
        Nr   )r+   r2   ÚverboseÚbackend_optionss       r   Ú	configurezStoreBackendBase.configure‡   r/   r   )r   r   r   r   r2   r   r.   r3   r7   r9   r;   r>   ÚdictrB   r   r   r   r)   r)   /   sŸ   „ ñ(ð €Hàñó ðð$ ñó ðð  ñó ðð ñó ðð ñó ðð ñó ðð Ø*+¹T»Vò ó ñr   r)   )Ú	metaclassc                   ó€   — e Zd ZdZdd„Zdd„Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
d
„ Zd„ Zdd„Zd„ Zd„ Zd„ Zdd„Zdd„Zd„ Zd„ Zy)ÚStoreBackendMixina‰  Class providing all logic for managing the store in a generic way.

    The StoreBackend subclass has to implement 3 methods: create_location,
    clear_location and configure. The StoreBackend also has to provide
    a private _open_item, _item_exists and _move_item methods. The _open_item
    method has to have the same signature as the builtin open and return a
    file-like object.
    Nc                 ó�  — t        j                  j                  | j                  g|¢­Ž }|dkD  rå|�/dj	                  t        t        j                  «       |z
  «      «      nd}t         j                  j                  |d   «      }|�Ad|v r=dj                  d„ |d   j                  «       D «       «      }|d	j	                  |«      z  }d
j	                  ||«      }	|dk  rt        dj	                  |	«      «       nt        dj	                  |	|«      «       t        | d«      sdn| j                  }
t         j                  j                  |d«      }| j                  |«      st        d|z  «      ‚|
€2| j                  |d«      5 }t        j                   |«      }ddd«       |S t        j                   ||
¬«      }|S # 1 sw Y   S xY w)z:Load an item from the store given its id as a list of str.r   Nz{: <16}Ú r   Ú
input_argsz, c              3   ó:   K  — | ]  } d j                   |Ž –— Œ y­w)z{}={}N)Úformat©Ú.0Úitems     r   Ú	<genexpr>z.StoreBackendMixin.load_item.<locals>.<genexpr>®   s    è ø€ ð #Ù6T¨d�N�G—N‘N DÔ)Ñ6Tùs   ‚z({})z[Memory]{}: Loading {}é
   z{0}...z{0} from {1}Ú	mmap_modeú
output.pklzANon-existing item (may have been cleared).
File %s does not existÚrb)rQ   )r    ÚpathÚjoinr2   rK   r   ÚtimeÚbasenameÚitemsÚprintÚhasattrrQ   r3   ÚKeyErrorr.   r   Úload)r+   Úcall_idr@   Ú	timestampÚmetadataÚ	full_pathÚ	ts_stringÚ	signatureÚkwargsÚmsgrQ   r#   r,   rN   s                 r   Ú	load_itemzStoreBackendMixin.load_item¢   s¢  € ä—G‘G—L‘L §¡Ð9°Ò9ˆ	à�QŠ;ð Ð(ð × Ñ ¤¬T¯Y©Y«[¸9Ñ-DÓ!EÔFàð ô
 Ÿ™×(Ñ(¨°©Ó4ˆIØÐ#¨¸Ñ(@ØŸ™ñ #Ø6>¸|Ñ6L×6RÑ6RÔ6Tó#ó �ð ˜VŸ]™]¨6Ó2Ñ2�	Ø*×1Ñ1°)¸YÓGˆCØ˜Š|Ü�h—o‘o cÓ*Õ+ä�n×+Ñ+¨C°Ó;Ô<ä '¨¨kÔ :‘DÀÇÁˆ	ä—7‘7—<‘< 	¨<Ó8ˆØ× Ñ  Ô*Üð4Ø6>ñ?óð ð ÐØ—‘ ¨4Ô0°AÜ#×(Ñ(¨Ó+�÷ 1ð ˆô  ×$Ñ$ X¸ÔCˆDØˆ÷	 1ð ˆús   ÆF;Æ;Gc                 óž  ‡ — 	 t        j                  j                  ‰ j                  g|¢­Ž }‰ j	                  |«      s‰ j                  |«       t         j                  j                  |d«      }|dkD  rt        d|z  «       ˆ fd„}‰ j                  |||«       y# t        $ r(}t        j                  d|› d�t        «       Y d}~yd}~ww xY w)z;Dump an item in the store at the id given as a list of str.rR   rP   zPersisting in %sc                 ó  •— ‰j                  |d«      5 }	 t        j                  | |‰j                  ¬«       d d d «       y # t        $ r(}t        j                  d|› d�t        «       Y d }~Œ5d }~ww xY w# 1 sw Y   y xY w)NÚwb)ÚcompresszjUnable to cache to disk: failed to pickle output. In version 1.5 this will raise an exception. Exception: r   )r.   r   Údumpri   r   ÚwarningsÚwarnÚFutureWarning)Úto_writeÚdest_filenamer,   Úer+   s       €r   r$   z/StoreBackendMixin.dump_item.<locals>.write_funcÓ   sx   ø€ Ø—_‘_ ]°DÔ9¸Qð	Ü$×)Ñ)¨(°AÀÇÁÕN÷ :Ð9øô )ò ä Ÿ™ð5à56°C°qð:ô *÷	ñ ûðú÷ :Ð9ús.   ”A5–"AÁ	A2Á
A-Á(A5Á-A2Á2A5Á5A>z`Unable to cache to disk. Possibly a race condition in the creation of the directory. Exception: r   N)r    rT   rU   r2   r3   r9   rY   Ú_concurrency_safe_writeÚ	Exceptionrk   rl   r   )r+   r]   rN   r@   Ú	item_pathr#   r$   rp   s   `       r   Ú	dump_itemzStoreBackendMixin.dump_itemÉ   s¶   ø€ ð	ÜŸ™Ÿ™ T§]¡]Ð=°WÒ=ˆIØ×$Ñ$ YÔ/Ø×$Ñ$ YÔ/Ü—w‘w—|‘| I¨|Ó<ˆHØ˜Š|ÜÐ(¨9Ñ4Ô5ôð ×(Ñ(¨¨x¸ÕDøÜò 	Ü�M‰Mð9Ø9:¸¸1ð>ä÷ñ ûð	ús   ƒBB Â	CÂ$CÃCc                 óž   — t        j                  j                  | j                  g|¢­Ž }| j	                  |«      r| j                  |«       yy)z1Clear the item at the id, given as a list of str.N©r    rT   rU   r2   r3   r;   )r+   r]   rs   s      r   Ú
clear_itemzStoreBackendMixin.clear_itemè   ó>   € ä—G‘G—L‘L §¡Ð9°Ò9ˆ	Ø×Ñ˜YÔ'Ø×Ñ 	Õ*ð (r   c                 ó¸   — t        j                  j                  | j                  g|¢­Ž }t         j                  j                  |d«      }| j	                  |«      S )z<Check if there is an item at the id, given as a list of str.rR   )r    rT   rU   r2   r3   )r+   r]   rs   r#   s       r   Úcontains_itemzStoreBackendMixin.contains_itemî   sB   € ä—G‘G—L‘L §¡Ð9°Ò9ˆ	Ü—7‘7—<‘< 	¨<Ó8ˆà× Ñ  Ó*Ð*r   c                 óZ   — dt        j                  j                  | j                  g|¢­Ž iS )zReturn information about item.r2   ©r    rT   rU   r2   ©r+   r]   s     r   Úget_item_infozStoreBackendMixin.get_item_infoõ   ó#   € àœBŸG™GŸL™L¨¯©ÐA¸ÒAÐBÐBr   c                 ó^  — 	 t        j                  j                  | j                  g|¢­Ž }t         j                  j                  |d«      }| j	                  |d«      5 }t        j                  |j                  «       j                  d«      «      cddd«       S # 1 sw Y   yxY w#  i cY S xY w)z"Return actual metadata of an item.úmetadata.jsonrS   úutf-8N)	r    rT   rU   r2   r.   ÚjsonÚloadsÚreadÚdecode)r+   r]   rs   r#   r,   s        r   Úget_metadatazStoreBackendMixin.get_metadataù   sx   € ð	ÜŸ™Ÿ™ T§]¡]Ð=°WÒ=ˆIÜ—w‘w—|‘| I¨Ó?ˆHØ—‘ ¨4Ô0°AÜ—z‘z !§&¡&£(§/¡/°'Ó":Ó;÷ 1×0Ò0ûð	ØŠIús*   ‚AB& Á2BÂ	B& ÂB#ÂB& Â#B& Â&B,c                 óü   ‡ — 	 t        j                  j                  ‰ j                  g|¢­Ž }‰ j	                  |«       t         j                  j                  |d«      }ˆ fd„}‰ j                  |||«       y#  Y yxY w)z Store metadata of a computation.r�   c                 óº   •— ‰j                  |d«      5 }|j                  t        j                  | «      j	                  d«      «       d d d «       y # 1 sw Y   y xY w)Nrh   r‚   )r.   Úwriterƒ   ÚdumpsÚencode)rn   ro   r,   r+   s      €r   r$   z4StoreBackendMixin.store_metadata.<locals>.write_func
  s?   ø€ Ø—_‘_ ]°DÔ9¸QØ—G‘GœDŸJ™J xÓ0×7Ñ7¸Ó@ÔA÷ :×9Ñ9ús   ”4AÁAN)r    rT   rU   r2   r9   rq   )r+   r]   r_   rs   r#   r$   s   `     r   Ústore_metadataz StoreBackendMixin.store_metadata  si   ø€ ð	ÜŸ™Ÿ™ T§]¡]Ð=°WÒ=ˆIØ× Ñ  Ô+Ü—w‘w—|‘| I¨Ó?ˆHôBð ×(Ñ(¨°8¸ZÕHøð	Ùús   ƒA3A7 Á7A;c                 óx   — t        j                  j                  | j                  g|¢­Ž }| j	                  |«      S )z,Check cached function is available in store.)r    rT   rU   r2   Úobject_exists©r+   r]   Ú	func_paths      r   Úcontains_pathzStoreBackendMixin.contains_path  s.   € ä—G‘G—L‘L §¡Ð9°Ò9ˆ	Ø×!Ñ! )Ó,Ð,r   c                 óž   — t        j                  j                  | j                  g|¢­Ž }| j	                  |«      r| j                  |«       yy)z0Clear all items with a common path in the store.Nrv   r�   s      r   Ú
clear_pathzStoreBackendMixin.clear_path  rx   r   c                 óp  — t        j                  j                  | j                  g|¢­Ž }| j	                  |«      s| j                  |«       |�\t         j                  j                  |d«      }| j                  |d«      5 }|j                  |j                  d«      «       ddd«       yy# 1 sw Y   yxY w)ú&Store the code of the cached function.Núfunc_code.pyrh   r‚   )	r    rT   rU   r2   r3   r9   r.   rŠ   rŒ   )r+   r]   Ú	func_coder‘   r#   r,   s         r   Ústore_cached_func_codez(StoreBackendMixin.store_cached_func_code  sŽ   € ä—G‘G—L‘L §¡Ð9°Ò9ˆ	Ø× Ñ  Ô+Ø× Ñ  Ô+àÐ Ü—w‘w—|‘| I¨~Ó>ˆHØ—‘ ¨4Ô0°AØ—‘˜	×(Ñ(¨Ó1Ô2÷ 1Ð0ð !ç0Ð0ús   Â!B,Â,B5c                 óö   — t        j                  j                  | j                  g|¢d‘­Ž }	 | j	                  |d«      5 }|j                  «       j                  d«      cddd«       S # 1 sw Y   yxY w#  ‚ xY w)r–   r—   rS   r‚   N)r    rT   rU   r2   r.   r…   r†   )r+   r]   r#   r,   s       r   Úget_cached_func_codez&StoreBackendMixin.get_cached_func_code(  s^   € ä—7‘7—<‘< §¡ÐH°ÐH¸ÒHˆð	Ø—‘ ¨4Ô0°AØ—v‘v“x—‘ wÓ/÷ 1×0Ò0ûð	Øús)   ®A5 Á A)Á	A5 Á)A2Á.A5 Á2A5 Á5A8c                 óZ   — dt        j                  j                  | j                  g|¢­Ž iS )z?Return information related to the cached function if it exists.r2   r|   r}   s     r   Úget_cached_func_infoz&StoreBackendMixin.get_cached_func_info1  r   r   c                 ó:   — | j                  | j                  «       y)zClear the whole store content.N)r;   r2   r=   s    r   ÚclearzStoreBackendMixin.clear5  s   € à×Ñ˜DŸM™MÕ*r   c                 óà   — | j                  |||«      }|D ]G  }| j                  dkD  rt        dj                  |«      «       	 | j	                  |j
                  «       ŒI y# t        $ r Y ŒVw xY w)zX
        Remove the store's oldest files to enforce item, byte, and age limits.
        rP   zDeleting item {0}N)Ú_get_items_to_deleter@   rY   rK   r;   rT   ÚOSError)r+   Úbytes_limitÚitems_limitÚ	age_limitÚitems_to_deleterN   s         r   Úenforce_store_limitsz&StoreBackendMixin.enforce_store_limits9  so   € ð ×3Ñ3°KÀÈiÓXˆã#ˆDØ�|‰|˜bÒ ÜÐ)×0Ñ0°Ó6Ô7ðØ×#Ñ# D§I¡IÕ.ñ	 $øô
 ò ñ
 ðús   ÁA!Á!	A-Á,A-c                 ó~  — t        |t        «      rt        |«      }| j                  «       }|sg S t	        d„ |D «       «      }|�||z
  }nd}|�t        |«      |z
  }nd}|�Rt        d„ |D «       «      }|j                  «       dk  rt        d«      ‚t        j                  j                  «       |z
  }	nd}	|dk  r|dk  r	|	�|	kD  rg S |j                  t        j                  d«      ¬«       g }
d}d}|D ]E  }||k\  r||k\  r|	�|	|j                  k  r |
S |
j                  |«       ||j                   z  }|dz  }ŒG |
S )	zW
        Get items to delete to keep the store under size, file, & age limits.
        c              3   ó4   K  — | ]  }|j                   –— Œ y ­w©N)ÚsizerL   s     r   rO   z9StoreBackendMixin._get_items_to_delete.<locals>.<genexpr>V  s   è ø€ Ð/© �4—9•9©ùó   ‚Nr   c              3   ó4   K  — | ]  }|j                   –— Œ y ­wrª   )Úlast_accessrL   s     r   rO   z9StoreBackendMixin._get_items_to_delete.<locals>.<genexpr>c  s   è ø€ Ð@¹%°$˜T×-Õ-¹%ùr¬   z(age_limit has to be a positive timedeltar®   )Úkeyr   )Ú
isinstanceÚstrr	   r>   ÚsumÚlenÚminÚtotal_secondsÚ
ValueErrorÚdatetimeÚnowÚsortÚoperatorÚ
attrgetterr®   Úappendr«   )r+   r£   r¤   r¥   rX   r«   Úto_delete_sizeÚto_delete_itemsÚ
older_itemÚdeadliner¦   Úsize_so_farÚitems_so_farrN   s                 r   r¡   z&StoreBackendMixin._get_items_to_deleteK  sq  € ô �k¤3Ô'Ü)¨+Ó6ˆKà—‘Ó ˆÙØˆIäÑ/©Ó/Ó/ˆàÐ"Ø! KÑ/‰NàˆNàÐ"Ü! %›j¨;Ñ6‰OàˆOàÐ ÜÑ@¹%Ó@Ó@ˆJØ×&Ñ&Ó(¨1Ò,Ü Ð!KÓLÐLÜ×(Ñ(×,Ñ,Ó.°Ñ:‰HàˆHð ˜aÒØ 1Ò$ØÐ! Z°(Ò%:àˆIð 	�
‰
”x×*Ñ*¨=Ó9ˆ
Ô:àˆØˆØˆãˆDà Ò.Ø  OÒ3ØÐ%¨°D×4DÑ4DÒ)Dàð Ðð	 ×"Ñ" 4Ô(Ø˜4Ÿ9™9Ñ$ˆKØ˜AÑ‰Lð ð Ðr   c                 óB   — t        |||«      }| j                  ||«       y)z7Writes an object into a file in a concurrency-safe way.N)r'   r7   )r+   rn   r#   r$   r&   s        r   rq   z)StoreBackendMixin._concurrency_safe_write‡  s    € ä3°H¸hÈ
ÓSÐØ�‰Ð*¨HÕ5r   c                 ód   — dj                  | j                  j                  | j                  ¬«      S )z/Printable representation of the store location.z#{class_name}(location="{location}"))Ú
class_namer2   )rK   Ú	__class__r   r2   r=   s    r   Ú__repr__zStoreBackendMixin.__repr__Œ  s-   € à4×;Ñ;Ø—~‘~×.Ñ.¸¿¹ð <ó 
ð 	
r   )r   NN)r   rª   )NN)r   r   r   r   re   rt   rw   rz   r~   r‡   r�   r’   r”   r™   r›   r�   rŸ   r§   r¡   rq   rÇ   r   r   r   rF   rF   ˜   s`   „ ñó%óNò>+ò+òCòòò-ò
+ó	3òòCò+óó$:òx6ó

r   rF   c                   ó‚   — e Zd ZdZ ee«      Z eej                  j                  «      Z
 ee«      Zd„ Zd„ Zd„ Zdd„Zy)ÚFileSystemStoreBackendz7A StoreBackend used with local or network file systems.c                 óh   — || j                   k(  rt        |«       yt        j                  |d¬«       y)zDelete location on store.T)Úignore_errorsN)r2   r   ÚshutilÚrmtreer1   s     r   r;   z%FileSystemStoreBackend.clear_locationš  s$   € à�t—}‘}Ò$Ü�xÕ ä�M‰M˜(°$Ö7r   c                 ó   — t        |«       y)zCreate object location on storeN)r
   r1   s     r   r9   z&FileSystemStoreBackend.create_location¡  s
   € äˆxÕr   c                 óè  — g }t        j                  | j                  «      D ]÷  \  }}}t        j                  dt         j
                  j                  |«      «      }|sŒ=t         j
                  j                  |d«      }	 t         j
                  j                  |«      }t        j                  j                  |«      }	 |D �cg c]"  }t         j
                  j                  ||«      ‘Œ$ }	}t        d„ |	D «       «      }
|j                  t        ||
|«      «       Œù |S # t        $ r5 	 t         j
                  j                  |«      }n# t        $ r Y Y �Œ3w xY wY Œ¼w xY wc c}w # t        $ r Y �ŒNw xY w)z7Returns the whole list of items available in the store.z[a-f0-9]{32}rR   c              3   óZ   K  — | ]#  }t         j                  j                  |«      –— Œ% y ­wrª   )r    rT   Úgetsize)rM   Úfns     r   rO   z3FileSystemStoreBackend.get_items.<locals>.<genexpr>º  s   è ø€ Ð!OÁ¸"¤"§'¡'§/¡/°"×"5Áùs   ‚)+)r    Úwalkr2   ÚreÚmatchrT   rW   rU   Úgetatimer¢   r·   Úfromtimestampr²   r¼   r   )r+   rX   ÚdirpathÚ_Ú	filenamesÚis_cache_hash_dirÚoutput_filenamer®   rÒ   Úfull_filenamesÚdirsizes              r   r>   z FileSystemStoreBackend.get_items¥  s=  € àˆä%'§W¡W¨T¯]©]Ö%;Ñ!ˆG�Q˜	Ü "§¡¨¼¿¹×9IÑ9IÈ'Ó9RÓ SÐâ Ü"$§'¡'§,¡,¨w¸Ó"E�ð!Ü"$§'¡'×"2Ñ"2°?Ó"C�Kô '×/Ñ/×=Ñ=¸kÓJ�ðÙJSÓ%TÉ)ÀB¤b§g¡g§l¡l°7¸BÕ&?È)�NÐ%TÜ!Ñ!OÁÓ!OÓO�Gð —‘œ]¨7°G¸[ÓIÕJð1 &<ð4 ˆøô' ò !ð!Ü&(§g¡g×&6Ñ&6°wÓ&?™øÜ"ò !ã ð!úñ $ð!üò &Uøäò ò ð	úsZ   Â DÂ?E$Ã'EÃ*E$Ä	EÄ(EÅEÅ	EÅEÅEÅEÅEÅE$Å$	E1Å0E1Nc                 óz  — |€i }|| _         t        j                  j                  | j                   «      st	        | j                   «       t        j                  j                  |«      rAt        j                  j                  |«      dk(  rt        j                  j                  |«      n|}t        j                  j                  |d«      }t        j                  j                  |«      s8	 t        |d«      5 }|j                  d«       |j                  d«       ddd«       |j                  d
d«      | _        |j                  d«      }| j                  r|�t        j                  dd¬«       || _        || _        y# 1 sw Y   ŒexY w# t        $ r&}t        j                  d|› d|› d	�«       Y d}~Œ’d}~ww xY w)zsConfigure the store backend.

        For this backend, valid store options are 'compress' and 'mmap_mode'
        NÚjoblibz
.gitignoreÚwz## Created by joblib automatically.
z*
zUnable to write z. Exception: r   ri   FrQ   zSCompressed items cannot be memmapped in a filesystem store. Option will be ignored.é   )Ú
stacklevel)r2   r    rT   Úexistsr
   ÚdirnamerW   rU   ÚopenrŠ   r¢   rk   rl   Úgetri   rQ   r@   )	r+   r2   r@   rA   Úcache_directoryÚ	gitignoreÚfilerp   rQ   s	            r   rB   z FileSystemStoreBackend.configureÅ  sc  € ð
 Ð"Ø ˆOð !ˆŒÜ�w‰w�~‰~˜dŸm™mÔ,Ü�4—=‘=Ô!ô �w‰w�‰˜xÔ(¬R¯W©W×-=Ñ-=¸hÓ-GÈ8Ò-Sô �G‰G�O‰O˜HÔ%àð 	ô
 —G‘G—L‘L °,Ó?ˆ	Ü�w‰w�~‰~˜iÔ(ðOÜ˜) SÔ)¨TØ—J‘JÐEÔFØ—J‘J˜uÔ%÷ *ð (×+Ñ+¨J¸Ó>ˆŒð $×'Ñ'¨Ó4ˆ	Ø�=Š=˜YÐ2Ü�M‰Mð<àõð #ˆŒØˆ�÷) *Ð)ûô ò OÜ—‘Ð 0°°¸=ÈÈÈ1ÐM×NÑNûðOús0   Ã,F Ã8#E?ÄF Å?FÆF Æ	F:ÆF5Æ5F:)r   N)r   r   r   r   Ústaticmethodræ   r.   r    rT   rä   r3   r   r7   r;   r9   r>   rB   r   r   r   rÉ   rÉ   “  sA   „ ÙAá˜dÓ#€JÙ §¡§¡Ó/€LÙÐ5Ó6€Jò8òòô@/r   rÉ   )%r   Úcollectionsr·   rƒ   rº   r    Úos.pathrÔ   rÌ   r   rV   r   rk   Úabcr   r   Úpickler   rH   r   Ú	backportsr   Údiskr	   r
   r   Úloggerr   Ú
namedtupler   ÚWarningr   r'   r)   ÚobjectrF   rÉ   r   r   r   Ú<module>rö      s—   ðÙ 4ã Û Û Û Û 	Û Û 	Û Û Û Û Û ß 'Ý  å Ý .ß 5Ñ 5Ý à&�×&Ñ& Ð8OÓP€ô	�7ô 	òôf õ fôRx
˜ô x
ôvaÐ-Ð/@õ ar   