§
    dŠtjþE  ã                   óZ  — 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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.é    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dS )ÚCacheWarningz:Warning to capture dump failures except for PicklingError.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úT/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/joblib/_store_backends.pyr   r      s   € € € € € ØDÐDà€Dr   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'       sf   € õ •9Ô+Ñ-Ô-Ñ.Ô.€IØ$ÐSÐS¥t¤z¡|¤|Ô'7ÐSÐS½"¼)¹+¼+ÐSÐSÈ	ÐSÐSÐà€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 )ÚStoreBackendBasez^Helper 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_item5   ó   € € € 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_existsH   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_itemY   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   r1   s     r   Úcreate_locationz StoreBackendBase.create_locationg   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   r1   s     r   Úclear_locationzStoreBackendBase.clear_locationr   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_items}   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+   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¸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)Úformat©Ú.0Úitems     r   ú	<genexpr>z.StoreBackendMixin.load_item.<locals>.<genexpr>®   s<   è è € ð #ð #Ø.2�N�G”N DÐ)ð#ð #ð #ð #ð #ð #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)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”L ¤Ð9°Ð9Ð9Ð9ˆ	à�QŠ;‰;ð Ð(ð × Ò ¥­T¬Y©[¬[¸9Ñ-DÑ!EÔ!EÑFÔFÐFàð õ
 œ×(Ò(¨°¬Ñ4Ô4ˆIØÐ#¨¸Ð(@Ð(@ØŸšð #ð #Ø6>¸|Ô6L×6RÒ6RÑ6TÔ6Tð#ñ #ô #ñ ô �ð ˜VŸ]š]¨6Ñ2Ô2Ñ2�	Ø*×1Ò1°)¸YÑGÔGˆCØ˜Š|ˆ|Ý�h—o’o cÑ*Ô*Ñ+Ô+Ð+Ð+å�n×+Ò+¨C°Ñ;Ô;Ñ<Ô<Ð<å '¨¨kÑ :Ô :ÐN�D�DÀÄˆ	å”7—<’< 	¨<Ñ8Ô8ˆØ× Ò  Ñ*Ô*ð 	Ýð4Ø6>ñ?ñô ð ð ÐØ—’ ¨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.rR   rP   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.   r   Údumpri   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: 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Ñ/Ô/ð 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    rT   rU   r2   r3   r;   )r+   r]   rs   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.rR   )r    rT   rU   r2   r3   )r+   r]   rs   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.r2   ©r    rT   rU   r2   ©r+   r]   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.jsonrS   úutf-8N)	r    rT   rU   r2   r.   ÚjsonÚloadsÚreadÚdecode)r+   r]   rs   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 )Nrh   r‚   )r.   Úwriterƒ   ÚdumpsÚencode)rn   ro   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    rT   rU   r2   r9   rq   )r+   r]   r_   rs   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    rT   rU   r2   Úobject_exists©r+   r]   Ú	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.Nrv   r�   s      r   Ú
clear_pathzStoreBackendMixin.clear_path  rx   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.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”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—   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”< ¤Ð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.r2   r|   r}   s     r   Úget_cached_func_infoz&StoreBackendMixin.get_cached_func_info1  r   r   c                 ó:   — |                       | j        ¦  «         dS )zClear the whole store content.N)r;   r2   r=   s    r   ÚclearzStoreBackendMixin.clear5  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.
        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  sž   € ð ×3Ò3°KÀÈiÑXÔXˆà#ð 
	ð 
	ˆ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}|�bt          d„ |D ¦   «         ¦  «        }|                     ¦   «         dk     rt          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)ÚsizerL   s     r   rO   z9StoreBackendMixin._get_items_to_delete.<locals>.<genexpr>V  s$   è è € Ð/Ð/ �4”9Ð/Ð/Ð/Ð/Ð/Ð/r   Nr   c              3   ó$   K  — | ]}|j         V — Œd S 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  sÃ  € õ �k¥3Ñ'Ô'ð 	7Ý)¨+Ñ6Ô6ˆKà—’Ñ Ô ˆØð 	ØˆIåÐ/Ð/¨Ð/Ñ/Ô/Ñ/Ô/ˆàÐ"Ø! KÑ/ˆNˆNàˆNàÐ"Ý! %™jœj¨;Ñ6ˆOˆOàˆOàÐ ÝÐ@Ð@¸%Ð@Ñ@Ô@Ñ@Ô@ˆJØ×&Ò&Ñ(Ô(¨1Ò,Ð,Ý Ð!KÑLÔLÐLÝÔ(×,Ò,Ñ.Ô.°Ñ:ˆHˆHàˆHð ˜aÒÐØ 1Ò$Ð$ØÐ! 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'   r7   )r+   rn   r#   r$   r&   s        r   rq   z)StoreBackendMixin._concurrency_safe_write‡  s/   € å3°H¸hÈ
ÑSÔSÐØ�ŠÐ*¨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_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ð Cð Cðð ð ðð ð ð-ð -ð -ð
+ð +ð +ð	3ð 	3ð 	3ð 	3ðð ð ðCð Cð Cð+ð +ð +ðð ð ð ð$:ð :ð :ð :ðx6ð 6ð 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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)r2   r   ÚshutilÚrmtreer1   s     r   r;   z%FileSystemStoreBackend.clear_locationš  s>   € à�t”}Ò$Ð$Ý�xÑ Ô Ð Ð Ð åŒM˜(°$Ð7Ñ7Ô7Ð7Ð7Ð7r   c                 ó$   — t          |¦  «         dS )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                             ‰	¦  «        ¦  «        }|�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}rR   c                 óP   •— g | ]"}t           j                             ‰|¦  «        ‘Œ#S r   )r    rT   rU   )rM   ÚfnÚdirpaths     €r   ú
<listcomp>z4FileSystemStoreBackend.get_items.<locals>.<listcomp>¹  s)   ø€ Ð%TÐ%TÐ%TÀB¥b¤g§l¢l°7¸BÑ&?Ô&?Ð%TÐ%TÐ%Tr   c              3   óT   K  — | ]#}t           j                             |¦  «        V — Œ$d S rª   )r    rT   Úgetsize)rM   rÐ   s     r   rO   z3FileSystemStoreBackend.get_items.<locals>.<genexpr>º  s0   è è € Ð!OÐ!O¸"¥"¤'§/¢/°"Ñ"5Ô"5Ð!OÐ!OÐ!OÐ!OÐ!OÐ!Or   )r    Úwalkr2   ÚreÚmatchrT   rW   rU   Úgetatimer¢   r¶   Úfromtimestampr±   r»   r   )
r+   rX   Ú_Ú	filenamesÚis_cache_hash_dirÚoutput_filenamer­   Úfull_filenamesÚdirsizerÑ   s
            @r   r>   z FileSystemStoreBackend.get_items¥  s„  ø€ àˆå%'¤W¨T¬]Ñ%;Ô%;ð 	Kñ 	KÑ!ˆG�Q˜	Ý "¤¨½¼×9IÒ9IÈ'Ñ9RÔ9RÑ SÔ SÐà ñ KÝ"$¤'§,¢,¨w¸Ñ"EÔ"E�ð!Ý"$¤'×"2Ò"2°?Ñ"CÔ"C�K�KøÝð !ð !ð !ð!Ý&(¤g×&6Ò&6°wÑ&?Ô&?˜˜øÝ"ð !ð !ð !à ˜˜ð!øøøð $˜ð!øøøõ 'Ô/×=Ò=¸kÑJÔJ�ðØ%TÐ%TÐ%TÐ%TÈ)Ð%TÑ%TÔ%T�NÝ!Ð!OÐ!OÀÐ!OÑ!OÔ!OÑOÔO�G�GøÝð ð ð ð ‘Hð	øøøð —’�]¨7°G¸[ÑIÔIÑJÔJÐJùàˆsH   Á:BÂ
CÂ%CÃCÃ
CÃCÃCÃCÃCÃ<'D$Ä$
D2Ä1D2r   Nc                 ó–  — |€i }|| _         t          j                             | j         ¦  «        st	          | j         ¦  «         t          j                             |¦  «        rBt          j                             |¦  «        dk    rt          j                             |¦  «        n|}t          j                             |d¦  «        }t          j                             |¦  «        s†	 t          |d¦  «        5 }| 	                    d¦  «         | 	                    d¦  «         ddd¦  «         n# 1 swxY w Y   n2# t          $ r%}t          j        d|› d|› d	�¦  «         Y d}~nd}~ww xY w|                     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'
        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Å  s  € ð
 Ð"Ø ˆOð !ˆŒÝŒw�~Š~˜dœmÑ,Ô,ð 	"Ý�4”=Ñ!Ô!Ð!õ Œw�Š˜xÑ(Ô(ðÝ-/¬W×-=Ò-=¸hÑ-GÔ-GÈ8Ò-SÐ-Sõ ŒG�OŠO˜HÑ%Ô%Ð%àð 	õ
 ”G—L’L °,Ñ?Ô?ˆ	ÝŒw�~Š~˜iÑ(Ô(ð 	OðOÝ˜) SÑ)Ô)ð &¨TØ—J’JÐEÑFÔFÐFØ—J’J˜uÑ%Ô%Ð%ð&ð &ð &ñ &ô &ð &ð &ð &ð &ð &ð &øøøð &ð &ð &ð &øøõ ð Oð Oð OÝ”ÐM°ÐMÐMÈÐMÐMÐMÑNÔNÐNÐNÐNÐNÐNÐNøøøøðOøøøð (×+Ò+¨J¸Ñ>Ô>ˆŒð $×'Ò'¨Ñ4Ô4ˆ	ØŒ=ð 	˜YÐ2ÝŒMð<àðñ ô ð ð #ˆŒØˆŒˆˆs<   Ã'D: Ã7+D.Ä"D: Ä.D2Ä2D: Ä5D2Ä6D: Ä:
E)ÅE$Å$E))r   N)r   r   r   r   Ústaticmethodrç   r.   r    rT   rå   r3   r   r7   r;   r9   r>   rB   r   r   r   rÈ   rÈ   “  sŽ   € € € € € ØAÐAà�˜dÑ#Ô#€JØ�< ¤¤Ñ/Ô/€LØ�Ð5Ñ6Ô6€Jð8ð 8ð 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Ð 4à Ð Ð Ð Ø €€€Ø €€€Ø €€€Ø 	€	€	€	Ø €€€Ø 	€	€	€	Ø €€€Ø Ð Ð Ð Ø €€€Ø €€€Ø €€€Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø  Ð  Ð  Ð  Ð  Ð  à Ð Ð Ð Ð Ð Ø .Ð .Ð .Ð .Ð .Ð .Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ø Ð Ð Ð Ð Ð à&�Ô& Ð8OÑPÔP€ð	ð 	ð 	ð 	ð 	�7ñ 	ô 	ð 	ðð ð ðfð fð fð fð f ð fñ fô fð fðRx
ð x
ð x
ð x
ð x
˜ñ x
ô x
ð x
ðvað að að að aÐ-Ð/@ñ aô að að að ar   