+
    Pj                          ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIH	t	 ]P                  ! R4      t ! R R]4      tR tR
R	 ltR# )    N)MutableMapping)cached_property)	url_to_fszfsspec.mappingc                      a  ] tR t^t o RtRR lt]R 4       tR tRR lt	R t
R tR	 tR
 tRR ltRR ltR tR tR tR tR tR tRtV tR# )FSMapa  Wrap a FileSystem instance as a mutable wrapping.

The keys of the mapping become files under the given root, and the
values (which must be bytes) the contents of those files.

Parameters
----------
root: string
    prefix for all the files
fs: FileSystem instance
check: bool (=True)
    performs a touch at the location, to check for write access.

Examples
--------
>>> fs = FileSystem(**parameters)  # doctest: +SKIP
>>> d = FSMap('my-data/path/', fs)  # doctest: +SKIP
or, more likely
>>> d = fs.get_mapper('my-data/path/')

>>> d['loc1'] = b'Hello World'  # doctest: +SKIP
>>> list(d.keys())  # doctest: +SKIP
['loc1']
>>> d['loc1']  # doctest: +SKIP
b'Hello World'
Nc                l   W n         VP                  V4      V n        VP                  \        P                  ! VR 4      4      RR V n        Vf   \        \        \        3pWPn	        W0n
        W@n        V'       d=   V P                   P                  V4      '       g   V P                   P                  V4       V'       dw   V P                   P                  V4      '       g   \        RV R24      hV P                   P                  VR,           4       V P                   P!                  VR,           4       R# R# )xNzPath z9 does not exist. Create  with the ``create=True`` keywordz/a)fs_strip_protocolroot	posixpathjoin_root_key_to_strFileNotFoundErrorIsADirectoryErrorNotADirectoryErrormissing_exceptionscheckcreateexistsmkdir
ValueErrortouchrm)selfr   r   r   r   r   s   &&&&&&g/Users/ahmed/devFolder/Ultron/claude-voice/gateway/.venv/lib/python3.14/site-packages/fsspec/mapping.py__init__FSMap.__init__)   s    &&t,	 " 2 29>>$3L Mcr R%!!""
 #5
77>>$''d#77>>$'' D6 "8 9  GGMM$+&GGJJtd{#     c                J    ^RI Hp V! V P                  V P                  R7      # )z@dirfs instance that can be used with the same keys as the mapper)DirFileSystem)pathr   )implementations.dirfsr"   r   r   )r   r"   s   & r   dirfsFSMap.dirfsB   s     	9$"7"7DGGDDr    c                    \         P                  RV P                  4        V P                  P	                  V P                  R4       V P                  P                  V P                  4       R#     R# ; i)z0Remove all keys below root - empties out mappingzClear mapping at %sTN)loggerinfor   r   r   r   r   s   &r   clearFSMap.clearI   sN    )4995	GGJJtyy$'GGMM$))$	s   AA/ /A4c                   V Uu. uF  q0P                  V4      NK  	  ppVR8X  d   TMRp V P                  P                  WER7      p\        V\        4      '       d   V^ ,          V/pTP                  4        UUu/ uF-  w  r8T\        YP
                  4      '       d   \        4       MTbK/  	  ppp\        Y4       U	U
u/ uFT  w  rTR8X  g   \        Yj,          \        4      '       d   K*  YR8X  d	   Yj,          MTP                  T
\        T
4      4      bKV  	  up
p	# u upi   T P
                   d   p\        ThRp?ii ; iu uppi u up
p	i )a/  Fetch multiple items from the store

If the backend is async-able, this might proceed concurrently

Parameters
----------
keys: list(str)
    They keys to be fetched
on_error : "raise", "omit", "return"
    If raise, an underlying exception will be raised (converted to KeyError
    if the type is in self.missing_exceptions); if omit, keys with exception
    will simply not be included in the output; if "return", all keys are
    included in the output, but the value will be bytes or an exception
    instance.

Returns
-------
dict(key, bytes|exception)
raisereturn)on_errorN)_key_to_strr   cat
isinstancebytesr   KeyErroritemszipBaseExceptionget)r   keysr0   kkeys2oeoutevkeyk2s   &&&        r   getitemsFSMap.getitemsR   s/   ( /33d!!!$d3!W,X(	"''++e+1C#u%%Qxo
 		
# j,C,CDD
!K# 	 
 t+
+8#:cg}+M OC/SWWR"5NN+
 	
 4 && 	"!	"

s.   D=D# <3E 'E	,.E	#E 4D;;E c                    VP                  4        UUu/ uF   w  r#V P                  V4      \        V4      bK"  	  pppV P                  P	                  V4       R# u uppi )zcSet the values of multiple items in the store

Parameters
----------
values_dict: dict(str, bytes)
N)r6   r1   maybe_convertr   pipe)r   values_dictr;   r@   valuess   &&   r   setitemsFSMap.setitemsx   sR     EPDUDUDWXDWDA$""1%}Q'77DWXV Ys   &Ac                    V P                   P                  V Uu. uF  q P                  V4      NK  	  up4       R# u upi )z#Remove multiple keys from the storeN)r   r   r1   )r   r:   r;   s   && r   delitemsFSMap.delitems   s-    

6A$$Q'676s   <c                    \        V\        4      '       gH   \        P                  ! R\        4       \        V\
        4      '       d   \        V4      p\        V4      pV P                   V 2P                  R4      # )zGenerate full path for the keyzAfrom fsspec 2023.5 onward FSMap non-str keys will raise TypeError/)	r3   strwarningswarnDeprecationWarninglisttupler   rstrip)r   rA   s   &&r   r1   FSMap._key_to_str   sc    #s##MMS" #t$$Cjc(C''(.55c::r    c                P    V\        V P                  4      R P                  R4      # )zStrip path of to leave key nameNrP   )lenr   lstrip)r   ss   &&r   _str_to_keyFSMap._str_to_key   s#    TYY!"))#..r    c                    V P                  V4      p V P                  P                  V4      pV#   T P                   d   pTe   Tu Rp?# \	        T4      ThRp?ii ; i)zRetrieve dataN)r1   r   r2   r   r5   )r   rA   defaultr;   resultexcs   &&&   r   __getitem__FSMap.__getitem__   s^    S!	)WW[[^F
 	 && 	)"3-S(	)s!   0 AAAAAc                R    V P                  W4      p W V#   \         d     T# i ; i)zPop data)rc   r5   )r   rA   r`   ra   s   &&& r   pop	FSMap.pop   s<    !!#/		   		s    &&c                    V P                  V4      pV P                  P                  V P                  P                  V4      RR7       V P                  P	                  V\        V4      4       R# )zStore value in keyT)exist_okN)r1   r   mkdirs_parent	pipe_filerF   )r   rA   values   &&&r   __setitem__FSMap.__setitem__   sL    s#twws+d;#}U34r    c                b   a  V 3R  lS P                   P                  S P                  4       4       # )c              3   F   <"   T F  pSP                  V4      x  K  	  R # 5iN)r]   ).0r	   r   s   & r   	<genexpr>!FSMap.__iter__.<locals>.<genexpr>   s!     E-D  ##-Ds   !)r   findr   r*   s   fr   __iter__FSMap.__iter__   s    ETWW\\$))-DEEr    c                ^    \        V P                  P                  V P                  4      4      # rr   )rZ   r   rv   r   r*   s   &r   __len__FSMap.__len__   s    477<<		*++r    c                     V P                   P                  V P                  V4      4       R#   \         d   p\        ThRp?ii ; i)z
Remove keyN)r   r   r1   	Exceptionr5   )r   rA   rb   s   && r   __delitem__FSMap.__delitem__   s:    	$GGJJt'',- 	$#	$s   *. AA  Ac                Z    V P                  V4      pV P                  P                  V4      # )zDoes key exist in mapping?)r1   r   isfile)r   rA   r#   s   && r   __contains__FSMap.__contains__   s%    $ww~~d##r    c                X    \         V P                  V P                  R R V P                  33# )F)r   r   r   r   r*   s   &r   
__reduce__FSMap.__reduce__   s&    tyy$''5%9P9PQQQr    )r   r   r   r   r   r   )FFN)r.   rr   )__name__
__module____qualname____firstlineno____doc__r   r   r%   r+   rC   rJ   rM   r1   r]   rc   rf   rn   rw   rz   r~   r   r   __static_attributes____classdictcell__)__classdict__s   @r   r   r      st     6$2 E E$
L8;/	5F,$$
R Rr    r   c                    \        V \        P                  4      '       g   \        V R 4      '       dS   \        V R4      '       d-   V P                  P                  R9   d   V P                  R4      p \        \        V 4      4      p V # )	__array__dtypeMmint64)r3   arrayhasattrr   kindviewr4   
memoryview)rm   s   &r   rF   rF      sa    %%%)D)D5'""u{{'7'74'? JJw'Ej'(Lr    c                J    \        V 3/ VB w  rgVe   TMTp\        WWVR7      # )a#  Create key-value interface for given URL and options

The URL will be of the form "protocol://location" and point to the root
of the mapper required. All keys will be file-names below this location,
and their values the contents of each key.

Also accepts compound URLs like zip::s3://bucket/file.zip , see ``fsspec.open``.

Parameters
----------
url: str
    Root URL of mapping
check: bool
    Whether to attempt to read from the location before instantiation, to
    check that the mapping does exist
create: bool
    Whether to make the directory corresponding to the root before
    instantiating
missing_exceptions: None or tuple
    If given, these exception types will be regarded as missing keys and
    return KeyError when trying to read data. By default, you get
    (FileNotFoundError, IsADirectoryError, NotADirectoryError)
alternate_root: None or str
    In cases of complex URLs, the parser may fail to pick the correct part
    for the mapper root, so this arg can override

Returns
-------
``FSMap`` instance, the dict-like key-value store.
)r   )r   r   )	urlr   r   r   alternate_rootkwargsr   urlpathr   s	   &&&&&,   r   
get_mapperr      s2    N C*6*KB+7>WD5=OPPr    ) FFNN)r   loggingr   rR   collections.abcr   	functoolsr   fsspec.corer   	getLoggerr(   r   rF   r    r    r   <module>r      sG        * % !			+	,wRN wRt)Qr    