§
    €zIf+A  ã                   óR  — d Z ddlm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mZmZ ddlmZ dd	lmZ  ej        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#dS )z.Storage providers backends for Memory caching.é    )ÚPicklingErrorN)ÚABCMetaÚabstractmethodé   )Úconcurrency_safe_rename)ÚmkdirpÚmemstr_to_bytesÚ
rm_subdirs)Úformat_time)Únumpy_pickleÚCacheItemInfozpath size last_accessc                   ó   — e Zd ZdZdS )ÚCacheWarningz:Warning to capture dump failures except for PicklingError.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úJ/var/www/piapp/venv/lib/python3.11/site-packages/joblib/_store_backends.pyr   r      s   € € € € € ØDÐDØ€Dr   r   c                 ó®   — t          t          j        ¦   «         ¦  «        }d                     ||t	          j        ¦   «         ¦  «        } || |¦  «         |S )z>Writes an object into a unique file in a concurrency-safe way.z{}.thread-{}-pid-{})ÚidÚ	threadingÚcurrent_threadÚformatÚosÚgetpid)Úobject_to_writeÚfilenameÚ
write_funcÚ	thread_idÚtemporary_filenames        r   Úconcurrency_safe_writer#      sT   € å•9Ô+Ñ-Ô-Ñ.Ô.€IØ.×5Ò5Ø�)�RœY™[œ[ñ*ô *Ðà€JˆÐ 2Ñ3Ô3Ð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dS )ÚStoreBackendBasezaHelper Abstract Base Class which defines all methods that
       a StorageBackend must implement.Nc                 ó   — dS )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_item/   ó   € € € r   c                 ó   — dS )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_existsB   r+   r   c                 ó   — dS )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_itemS   r+   r   c                 ó   — dS )zÎCreates a location on the store.

        Parameters
        ----------
        location: string
            The location in the store. On a filesystem, this corresponds to a
            directory.
        Nr   r-   s     r   Úcreate_locationz StoreBackendBase.create_locationa   r+   r   c                 ó   — dS )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   r-   s     r   Úclear_locationzStoreBackendBase.clear_locationl   r+   r   c                 ó   — dS )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_itemsw   r+   r   r   c                 ó   — dS )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'   r.   ÚverboseÚbackend_optionss       r   Ú	configurezStoreBackendBase.configure�   r+   r   )r   r   r   r   r.   r   r*   r/   r3   r5   r7   r:   Údictr>   r   r   r   r%   r%   )   sð   € € € € € ð+ð +ð €Hàðð ñ „^ðð$ ðð ñ „^ðð  ðð ñ „^ðð ðð ñ „^ðð ðð ñ „^ðð ðð ñ „^ðð Ø*+¸T¸T¹V¼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dS )Ú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.
    r   Nc                 óî  — t          j        j        | j        g|¢R Ž }|dk    �r|�6d                     t          t          j        ¦   «         |z
  ¦  «        ¦  «        nd}t           j                             |d         ¦  «        }|�Sd|v rOd                     d„ |d                              ¦   «         D ¦   «         ¦  «        }|d	                     |¦  «        z  }d
                     ||¦  «        }	|dk     r#t          d                     |	¦  «        ¦  «         n#t          d                     |	|¦  «        ¦  «         t          | d¦  «        sdn| j        }
t           j                             |d¦  «        }|                      |¦  «        st          d|z  ¦  «        ‚|
€C|                      |d¦  «        5 }t          j        |¦  «        }ddd¦  «         n# 1 swxY w Y   nt          j        ||
¬¦  «        }|S )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         |Ž V — ŒdS )z{}={}N)r   ©Ú.0Úitems     r   ú	<genexpr>z.StoreBackendMixin.load_item.<locals>.<genexpr>¥   sG   è è € ð #Oð #OØ'+ð $2 7¤>°4Ð#8ð #Oð #Oð #Oð #Oð #Oð #Or   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)rL   )r   ÚpathÚjoinr.   r   r   ÚtimeÚbasenameÚitemsÚprintÚhasattrrL   r/   ÚKeyErrorr*   r   Úload)r'   Úcall_idr<   Ú	timestampÚmetadataÚ	full_pathÚ	ts_stringÚ	signatureÚkwargsÚmsgrL   r   r(   rI   s                 r   Ú	load_itemzStoreBackendMixin.load_itemœ   sH  € å”G”L ¤Ð9°Ð9Ð9Ð9ˆ	à�QŠ;‰;à%Ð1ð #×)Ò)­+µd´i±k´kÀIÑ6MÑ*NÔ*NÑOÔOÐOØ79ð åœ×(Ò(¨°¬Ñ4Ô4ˆIØÐ#¨¸Ð(@Ð(@ØŸšð #Oð #OØ/7¸Ô/E×/KÒ/KÑ/MÔ/Mð#Oñ #Oô #Oñ Oô O�à˜VŸ]š]¨6Ñ2Ô2Ñ2�	Ø*×1Ò1°)¸YÑGÔGˆCØ˜Š|ˆ|Ý�h—o’o cÑ*Ô*Ñ+Ô+Ð+Ð+å�n×+Ò+¨C°Ñ;Ô;Ñ<Ô<Ð<å!(¨¨{Ñ!;Ô!;ð )�T�TØœ.ð 	õ ”7—<’< 	¨<Ñ8Ô8ˆØ× Ò  Ñ*Ô*ð 	KÝð ?ØAIñJñ Kô Kð Kð ÐØ—’ ¨4Ñ0Ô0ð ,°AÝ#Ô(¨Ñ+Ô+�ð,ð ,ð ,ñ ,ô ,ð ,ð ,ð ,ð ,ð ,ð ,øøøð ,ð ,ð ,ð ,øõ  Ô$ X¸ÐCÑCÔCˆDØˆs   Æ2GÇGÇGc                 óª  ‡ — 	 t          j        j        ‰ j        g|¢R Ž }‰                      |¦  «        s‰                      |¦  «         t           j                             |d¦  «        }|dk    rt          d|z  ¦  «         ˆ fd„}‰                      |||¦  «         dS # t          $ r)}t          j
        d|› d�t          ¦  «         Y d}~dS d}~ww xY w)z;Dump an item in the store at the id given as a list of str.rM   rK   zPersisting in %sc                 ó  •— ‰                      |d¦  «        5 }	 t          j        | |‰j        ¬¦  «         n5# t          $ r(}t          j        d|› d�t          ¦  «         Y d }~nd }~ww xY wd d d ¦  «         d S # 1 swxY w Y   d S )NÚwb)ÚcompresszjUnable to cache to disk: failed to pickle output. In version 1.5 this will raise an exception. Exception: ú.)r*   r   Údumprd   r   ÚwarningsÚwarnÚFutureWarning)Úto_writeÚdest_filenamer(   Úer'   s       €r   r    z/StoreBackendMixin.dump_item.<locals>.write_funcÈ   s  ø€ Ø—_’_ ]°DÑ9Ô9ð 
¸Qð	Ý$Ô)¨(°AÀÄÐNÑNÔNÐNÐNøÝ(ð ð ð å œð:à56ð:ð :ð :õ *ñ	ô ð ð ð ð ð ð øøøøðøøøð
ð 
ð 
ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
øøøð 
ð 
ð 
ð 
ð 
ð 
s7   ˜A9š7¶A9·
A)ÁA$ÁA9Á$A)Á)A9Á9A=Â A=z`Unable to cache to disk. Possibly a race condition in the creation of the directory. Exception: re   N)r   rO   rP   r.   r/   r5   rT   Ú_concurrency_safe_writeÚ	Exceptionrg   rh   r   )r'   rX   rI   r<   Ú	item_pathr   r    rl   s   `       r   Ú	dump_itemzStoreBackendMixin.dump_item¾   s#  ø€ ð	Ýœœ T¤]Ð=°WÐ=Ð=Ð=ˆIØ×$Ò$ YÑ/Ô/ð 0Ø×$Ò$ YÑ/Ô/Ð/Ý”w—|’| I¨|Ñ<Ô<ˆHØ˜Š|ˆ|ÝÐ(¨9Ñ4Ñ5Ô5Ð5ðð ð ð ð ð ×(Ò(¨¨x¸ÑDÔDÐDÐDÐDøÝð 	ð 	ð 	ÝŒMð>Ø9:ð>ð >ð >åñô ð ð ð ð ð ð ð øøøøð	øøøs   ƒBB Â
CÂ)CÃCc                 ó–   — t          j        j        | j        g|¢R Ž }|                      |¦  «        r|                      |¦  «         dS dS )z1Clear the item at the id, given as a list of str.N©r   rO   rP   r.   r/   r7   )r'   rX   ro   s      r   Ú
clear_itemzStoreBackendMixin.clear_itemÝ   óW   € å”G”L ¤Ð9°Ð9Ð9Ð9ˆ	Ø×Ò˜YÑ'Ô'ð 	+Ø×Ò 	Ñ*Ô*Ð*Ð*Ð*ð	+ð 	+r   c                 ó¤   — t          j        j        | j        g|¢R Ž }t           j                             |d¦  «        }|                      |¦  «        S )z<Check if there is an item at the id, given as a list of str.rM   )r   rO   rP   r.   r/   )r'   rX   ro   r   s       r   Úcontains_itemzStoreBackendMixin.contains_itemã   sF   € å”G”L ¤Ð9°Ð9Ð9Ð9ˆ	Ý”7—<’< 	¨<Ñ8Ô8ˆà× Ò  Ñ*Ô*Ð*r   c                 ó>   — dt          j        j        | j        g|¢R Ž iS )zReturn information about item.r.   ©r   rO   rP   r.   ©r'   rX   s     r   Úget_item_infozStoreBackendMixin.get_item_infoê   ó#   € à�BœGœL¨¬ÐA¸ÐAÐAÐAÐBÐBr   c                 ó`  — 	 t          j        j        | j        g|¢R Ž }t           j                             |d¦  «        }|                      |d¦  «        5 }t          j        |                     ¦   «                              d¦  «        ¦  «        cddd¦  «         S # 1 swxY w Y   dS #  i cY S xY w)z"Return actual metadata of an item.úmetadata.jsonrN   úutf-8N)	r   rO   rP   r.   r*   ÚjsonÚloadsÚreadÚdecode)r'   rX   ro   r   r(   s        r   Úget_metadatazStoreBackendMixin.get_metadataî   sß   € ð	Ýœœ T¤]Ð=°WÐ=Ð=Ð=ˆIÝ”w—|’| I¨Ñ?Ô?ˆHØ—’ ¨4Ñ0Ô0ð <°AÝ”z !§&¢&¡(¤(§/¢/°'Ñ":Ô":Ñ;Ô;ð<ð <ð <ð <ñ <ô <ð <ð <ð <ð <ð <ð <øøøð <ð <ð <ð <ð <ð <øð	ØˆIˆIˆIøøøs0   ‚AB' Á9BÂB' ÂBÂB' Â!BÂ"B' Â'B-c                 óô   ‡ — 	 t          j        j        ‰ j        g|¢R Ž }‰                      |¦  «         t           j                             |d¦  «        }ˆ fd„}‰                      |||¦  «         dS #  Y dS xY w)z Store metadata of a computation.r}   c                 óÚ   •— ‰                      |d¦  «        5 }|                     t          j        | ¦  «                             d¦  «        ¦  «         d d d ¦  «         d S # 1 swxY w Y   d S )Nrc   r~   )r*   Úwriter   ÚdumpsÚencode)rj   rk   r(   r'   s      €r   r    z4StoreBackendMixin.store_metadata.<locals>.write_funcÿ   sµ   ø€ Ø—_’_ ]°DÑ9Ô9ð B¸QØ—G’G�DœJ xÑ0Ô0×7Ò7¸Ñ@Ô@ÑAÔAÐAðBð Bð Bñ Bô Bð Bð Bð Bð Bð Bð Bð Bøøøð Bð Bð Bð Bð Bð Bs   ˜;A Á A$Á'A$N)r   rO   rP   r.   r5   rm   )r'   rX   rZ   ro   r   r    s   `     r   Ústore_metadataz StoreBackendMixin.store_metadataø   sš   ø€ ð	Ýœœ T¤]Ð=°WÐ=Ð=Ð=ˆIØ× Ò  Ñ+Ô+Ð+Ý”w—|’| I¨Ñ?Ô?ˆHðBð Bð Bð Bð Bð ×(Ò(¨°8¸ZÑHÔHÐHÐHÐHøð	ØˆDˆDøøøs   ƒA-A2 Á2A7c                 ód   — t          j        j        | j        g|¢R Ž }|                      |¦  «        S )z,Check cached function is available in store.)r   rO   rP   r.   Úobject_exists©r'   rX   Ú	func_paths      r   Úcontains_pathzStoreBackendMixin.contains_path  s1   € å”G”L ¤Ð9°Ð9Ð9Ð9ˆ	Ø×!Ò! )Ñ,Ô,Ð,r   c                 ó–   — t          j        j        | j        g|¢R Ž }|                      |¦  «        r|                      |¦  «         dS dS )z0Clear all items with a common path in the store.Nrr   rŒ   s      r   Ú
clear_pathzStoreBackendMixin.clear_path  rt   r   c                 óˆ  — t          j        j        | j        g|¢R Ž }|                      |¦  «        s|                      |¦  «         |�yt           j                             |d¦  «        }|                      |d¦  «        5 }|                     |                     d¦  «        ¦  «         ddd¦  «         dS # 1 swxY w Y   dS dS )ú&Store the code of the cached function.Núfunc_code.pyrc   r~   )	r   rO   rP   r.   r/   r5   r*   r†   rˆ   )r'   rX   Ú	func_coder�   r   r(   s         r   Ústore_cached_func_codez(StoreBackendMixin.store_cached_func_code  sÿ   € å”G”L ¤Ð9°Ð9Ð9Ð9ˆ	Ø× Ò  Ñ+Ô+ð 	,Ø× Ò  Ñ+Ô+Ð+àÐ Ý”w—|’| I¨~Ñ>Ô>ˆHØ—’ ¨4Ñ0Ô0ð 3°AØ—’˜	×(Ò(¨Ñ1Ô1Ñ2Ô2Ð2ð3ð 3ð 3ñ 3ô 3ð 3ð 3ð 3ð 3ð 3ð 3ð 3øøøð 3ð 3ð 3ð 3ð 3ð 3ð !Ð s   Á?)B5Â5B9Â<B9c                 óú   — t          j        j        | j        g|¢d‘R Ž }	 |                      |d¦  «        5 }|                     ¦   «                              d¦  «        cddd¦  «         S # 1 swxY w Y   dS #  ‚ xY w)r’   r“   rN   r~   N)r   rO   rP   r.   r*   r�   r‚   )r'   rX   r   r(   s       r   Úget_cached_func_codez&StoreBackendMixin.get_cached_func_code  s¿   € å”7”< ¤ÐH°ÐH¸ÐHÐHÐHˆð	Ø—’ ¨4Ñ0Ô0ð 0°AØ—v’v‘x”x—’ wÑ/Ô/ð0ð 0ð 0ð 0ñ 0ô 0ð 0ð 0ð 0ð 0ð 0ð 0øøøð 0ð 0ð 0ð 0ð 0ð 0øð	Øøøøs.    A7 ¶'A*ÁA7 Á*A.Á.A7 Á1A.Á2A7 Á7A:c                 ó>   — dt          j        j        | j        g|¢R Ž iS )z?Return information related to the cached function if it exists.r.   rx   ry   s     r   Úget_cached_func_infoz&StoreBackendMixin.get_cached_func_info&  r{   r   c                 ó:   — |                       | j        ¦  «         dS )zClear the whole store content.N)r7   r.   r9   s    r   ÚclearzStoreBackendMixin.clear*  s   € à×Ò˜DœMÑ*Ô*Ð*Ð*Ð*r   c                 óî   — |                       |||¦  «        }|D ]Z}| j        dk    r"t          d                     |¦  «        ¦  «         	 |                      |j        ¦  «         ŒK# t          $ r Y ŒWw xY wdS )zX
        Remove the store's oldest files to enforce item, byte, and age limits.
        rK   zDeleting item {0}N)Ú_get_items_to_deleter<   rT   r   r7   rO   ÚOSError)r'   Úbytes_limitÚitems_limitÚ	age_limitÚitems_to_deleterI   s         r   Úenforce_store_limitsz&StoreBackendMixin.enforce_store_limits.  s¥   € ð ×3Ò3Ø˜ iñ
ô 
ˆð $ð 
	ð 
	ˆDØŒ|˜bÒ Ð ÝÐ)×0Ò0°Ñ6Ô6Ñ7Ô7Ð7ðØ×#Ò# D¤IÑ.Ô.Ð.Ð.øÝð ð ð ð
 �ðøøøð
	ð 
	s   Á
A%Á%
A2Á1A2c                 ó€  — t          |t          ¦  «        rt          |¦  «        }|                      ¦   «         }|sg S t	          d„ |D ¦   «         ¦  «        }|�||z
  }nd}|�t          |¦  «        |z
  }nd}|�;t          d„ |D ¦   «         ¦  «        }t          j                             ¦   «         |z
  }	nd}	|dk    r|dk    r
|	�||	k    rg S | 	                    t          j        d¦  «        ¬¦  «         g }
d}d}|D ]A}||k    r||k    r|	�|	|j        k     r n%|
                     |¦  «         ||j        z  }|dz  }ŒB|
S )zW
        Get items to delete to keep the store under size, file, & age limits.
        c              3   ó$   K  — | ]}|j         V — Œd S ©N)ÚsizerG   s     r   rJ   z9StoreBackendMixin._get_items_to_delete.<locals>.<genexpr>Q  s$   è è € Ð/Ð/ �4”9Ð/Ð/Ð/Ð/Ð/Ð/r   Nr   c              3   ó$   K  — | ]}|j         V — Œd S r¦   )Úlast_accessrG   s     r   rJ   z9StoreBackendMixin._get_items_to_delete.<locals>.<genexpr>^  s%   è è € Ð@Ð@°$˜TÔ-Ð@Ð@Ð@Ð@Ð@Ð@r   r©   )Úkeyr   )Ú
isinstanceÚstrr	   r:   ÚsumÚlenÚminÚdatetimeÚnowÚsortÚoperatorÚ
attrgetterr©   Úappendr§   )r'   rŸ   r    r¡   rS   r§   Úto_delete_sizeÚto_delete_itemsÚ
older_itemÚdeadliner¢   Úsize_so_farÚitems_so_farrI   s                 r   r�   z&StoreBackendMixin._get_items_to_deleteD  sœ  € õ �k¥3Ñ'Ô'ð 	7Ý)¨+Ñ6Ô6ˆKà—’Ñ Ô ˆØð 	ØˆIåÐ/Ð/¨Ð/Ñ/Ô/Ñ/Ô/ˆàÐ"Ø! KÑ/ˆNˆNàˆNàÐ"Ý! %™jœj¨;Ñ6ˆOˆOàˆOàÐ ÝÐ@Ð@¸%Ð@Ñ@Ô@Ñ@Ô@ˆJÝÔ(×,Ò,Ñ.Ô.°Ñ:ˆHˆHàˆHð ˜aÒÐ O°qÒ$8Ð$8ØÐ! Z°(Ò%:Ð%:àˆIð 	�
Š
•xÔ*¨=Ñ9Ô9ˆ
Ñ:Ô:Ð:àˆØˆØˆàð 
	ð 
	ˆDà Ò.Ð.Ø  OÒ3Ð3ØÐ%¨°DÔ4DÒ)DÐ)Dà�à×"Ò" 4Ñ(Ô(Ð(Ø˜4œ9Ñ$ˆKØ˜AÑˆLˆLàÐr   c                 óT   — t          |||¦  «        }|                      ||¦  «         dS )z7Writes an object into a file in a concurrency-safe way.N)r#   r3   )r'   rj   r   r    r"   s        r   rm   z)StoreBackendMixin._concurrency_safe_write  s6   € å3°HØ4<¸jñJô JÐà�ŠÐ*¨HÑ5Ô5Ð5Ð5Ð5r   c                 óN   — d                      | j        j        | j        ¬¦  «        S )z/Printable representation of the store location.z#{class_name}(location="{location}"))Ú
class_namer.   )r   Ú	__class__r   r.   r9   s    r   Ú__repr__zStoreBackendMixin.__repr__…  s.   € à4×;Ò;Ø”~Ô.¸¼ð <ñ Hô Hð 	Hr   )r   NN)r   r¦   )NN)r   r   r   r   r`   rp   rs   rv   rz   rƒ   r‰   rŽ   r�   r•   r—   r™   r›   r£   r�   rm   rÀ   r   r   r   rB   rB   ’   sO  € € € € € ðð ð ð  ð  ð  ðDð ð ð ð>+ð +ð +ð+ð +ð +ðCð Cð Cðð ð ðð ð ð-ð -ð -ð
+ð +ð +ð	3ð 	3ð 	3ð 	3ðð ð ðCð Cð Cð+ð +ð +ð
 <@ðð ð ð ð. <@ð9ð 9ð 9ð 9ðv6ð 6ð 6ðHð Hð Hð Hð Hr   rB   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dS )	ÚFileSystemStoreBackendz7A StoreBackend used with local or network file systems.c                 ój   — || j         k    rt          |¦  «         dS t          j        |d¬¦  «         dS )zDelete location on store.T)Úignore_errorsN)r.   r
   ÚshutilÚrmtreer-   s     r   r7   z%FileSystemStoreBackend.clear_location’  s>   € à˜œÒ%Ð%Ý�xÑ Ô Ð Ð Ð åŒM˜(°$Ð7Ñ7Ô7Ð7Ð7Ð7r   c                 ó$   — t          |¦  «         dS )zCreate object location on storeN)r   r-   s     r   r5   z&FileSystemStoreBackend.create_location™  s   € åˆxÑÔÐÐÐr   c                 óº  ‡	— g }t          j        | j        ¦  «        D �]<\  Š	}}t          j        dt           j                             ‰	¦  «        ¦  «        }|�r t           j                             ‰	d¦  «        }	 t           j                             |¦  «        }nB# t          $ r5 	 t           j                             ‰	¦  «        }n# t          $ r Y Y Œµw xY wY nw xY wt          j
                             |¦  «        }	 ˆ	fd„|D ¦   «         }t          d„ |D ¦   «         ¦  «        }n# t          $ r Y �Œw xY w|                     t          ‰	||¦  «        ¦  «         �Œ>|S )z7Returns the whole list of items available in the store.z[a-f0-9]{32}rM   c                 óP   •— g | ]"}t           j                             ‰|¦  «        ‘Œ#S r   )r   rO   rP   )rH   ÚfnÚdirpaths     €r   ú
<listcomp>z4FileSystemStoreBackend.get_items.<locals>.<listcomp>²  s9   ø€ ð &;ð &;ð &;Ø*,õ ')¤g§l¢l°7¸BÑ&?Ô&?ð &;ð &;ð &;r   c              3   óT   K  — | ]#}t           j                             |¦  «        V — Œ$d S r¦   )r   rO   Úgetsize)rH   rÊ   s     r   rJ   z3FileSystemStoreBackend.get_items.<locals>.<genexpr>´  sD   è è € ð "<ð "<Ø&(õ #%¤'§/¢/°"Ñ"5Ô"5ð "<ð "<ð "<ð "<ð "<ð "<r   )r   Úwalkr.   ÚreÚmatchrO   rR   rP   Úgetatimerž   r°   Úfromtimestampr­   rµ   r   )
r'   rS   Ú_Ú	filenamesÚis_cache_hash_dirÚoutput_filenamer©   Úfull_filenamesÚdirsizerË   s
            @r   r:   z FileSystemStoreBackend.get_items�  sµ  ø€ àˆå%'¤W¨T¬]Ñ%;Ô%;ð 	9ñ 	9Ñ!ˆG�Q˜	Ý "¤¨Ý)+¬×)9Ò)9¸'Ñ)BÔ)Bñ!Dô !DÐð !ñ 9Ý"$¤'§,¢,¨w¸Ñ"EÔ"E�ð!Ý"$¤'×"2Ò"2°?Ñ"CÔ"C�K�KøÝð !ð !ð !ð!Ý&(¤g×&6Ò&6°wÑ&?Ô&?˜˜øÝ"ð !ð !ð !à ˜˜ð!øøøð $˜ð!øøøõ 'Ô/×=Ò=¸kÑJÔJ�ð	ð&;ð &;ð &;ð &;Ø09ð&;ñ &;ô &;�Nå!ð "<ð "<Ø,:ð"<ñ "<ô "<ñ <ô <�G�Gøåð ð ð ð ‘Hð	øøøð —’�]¨7°GØ+6ñ8ô 8ñ 9ô 9ð 9ùð ˆsH   Á:BÂ
CÂ%CÃCÃ
CÃCÃCÃCÃCÃ<'D$Ä$
D2Ä1D2r   Nc                 óF  — |€i }|| _         t          j                             | j         ¦  «        st	          | j         ¦  «         |                     dd¦  «        | _        |                     d¦  «        }| j        r|�t          j        dd¬¦  «         || _	        || _
        dS )zsConfigure the store backend.

        For this backend, valid store options are 'compress' and 'mmap_mode'
        Nrd   FrL   zSCompressed items cannot be memmapped in a filesystem store. Option will be ignored.é   )Ú
stacklevel)r.   r   rO   Úexistsr   Úgetrd   rg   rh   rL   r<   )r'   r.   r<   r=   rL   s        r   r>   z FileSystemStoreBackend.configureÁ  s³   € ð
 Ð"Ø ˆOð !ˆŒÝŒw�~Š~˜dœmÑ,Ô,ð 	"Ý�4”=Ñ!Ô!Ð!ð (×+Ò+¨J¸Ñ>Ô>ˆŒð $×'Ò'¨Ñ4Ô4ˆ	ØŒ=ð 	(˜YÐ2ÝŒMð Fà%&ð(ñ (ô (ð (ð #ˆŒØˆŒˆˆr   )r   N)r   r   r   r   ÚstaticmethodÚopenr*   r   rO   rÝ   r/   r   r3   r7   r5   r:   r>   r   r   r   rÂ   rÂ   ‹  sŽ   € € € € € ØAÐAà�˜dÑ#Ô#€JØ�< ¤¤Ñ/Ô/€LØ�Ð5Ñ6Ô6€Jð8ð 8ð 8ðð ð ð"ð "ð "ðHð ð ð ð ð r   rÂ   )$r   Úpickler   rÐ   r   Úos.pathr°   r   rÅ   rQ   rg   Úcollectionsr³   r   Úabcr   r   Ú	backportsr   Údiskr   r	   r
   Úloggerr   rD   r   Ú
namedtupler   ÚWarningr   r#   r%   ÚobjectrB   rÂ   r   r   r   ú<module>rë      sü  ðØ 4Ð 4à  Ð  Ð  Ð  Ð  Ð  Ø 	€	€	€	Ø 	€	€	€	Ø €€€Ø €€€Ø €€€Ø €€€Ø €€€Ø €€€Ø Ð Ð Ð Ø €€€Ø Ð Ð Ð Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'à .Ð .Ð .Ð .Ð .Ð .Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à&�Ô& Ø'>ñ@ô @€ð	ð 	ð 	ð 	ð 	�7ñ 	ô 	ð 	ð
ð ð ðfð fð fð fð f ð fñ fô fð fðRvHð vHð vHð vHð vH˜ñ vHô vHð vHðrOð Oð Oð Oð OÐ-Ð/@ñ Oô Oð Oð Oð Or   