+
    &jr                         ^ RI t ^ RIHtHt ^ RIHt ^ RIHt ^ RIH	t	H
t
 ^ RIHt R tR t ! R	 R
]
4      t ! R R]	4      tR# )    N)Client_get_global_client)Worker)
filesystem)AbstractBufferedFileAbstractFileSysteminfer_storage_optionsc                 d    V f   \        4       # \        V \        4      '       d   V # \        V 4      # N)r   
isinstancer   )clients   &s/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/fsspec/implementations/dask.py_get_clientr   
   s.    ~!##	FF	#	# f~    c                  4    \        \        P                  4      # r   )boolr   
_instances r   r   
_in_workerr      s    !!""r   c                   ~   a a ] tR t^t oRtRV 3R llt]R 4       tR tR t	R t
R tR tR	 tRR
 ltR tRtVtV ;t# )DaskWorkerFileSystema  View files accessible to a worker as any other remote file-system

When instances are run on the worker, uses the real filesystem. When
run on the client, they call the worker to provide information or data.

**Warning** this implementation is experimental, and read-only for now.
c                   < \         SV `  ! R/ VB  VR J VR J ,          '       g   \        R4      hWn        W n        R V n        W@n        W0n        V P                  4        R # )NzKPlease provide one of filesystem instance (fs) or target_protocol, not bothr   )	super__init__
ValueErrortarget_protocoltarget_optionsworkerr   fs_determine_worker)selfr   r   r    r   kwargs	__class__s   &&&&&,r   r   DaskWorkerFileSystem.__init__!   sf     	"6"d
$677-   /, r   c                f    \        V 4      pR V9   d   RV9   d   RVR ,           RVR,           2/# / # )hostportr   :r	   )pathsos   & r   _get_kwargs_from_urls*DaskWorkerFileSystem._get_kwargs_from_urls1   s<    "4(R<FbLFAbj\:;;Ir   c                .   \        4       '       dI   R V n        V P                  f2   \        V P                  3/ V P
                  ;'       g    / B V n        R# R# RV n        \        V P                  4      V n        \        P                  ! V 4      V n
        R# )TNF)r   r   r    r   r   r   r   r   daskdelayedrfsr"   s   &r   r!   &DaskWorkerFileSystem._determine_worker9   sr    <<DKww$((-1-@-@-F-FB 
  DK%dkk2DK||D)DHr   c                    V P                   '       d   V P                  P                  ! V/ VB  R # V P                  P                  ! V/ VB P	                  4        R # r   )r   r    mkdirr1   computer"   argsr#   s   &*,r   r5   DaskWorkerFileSystem.mkdirE   s>    ;;;GGMM4*6*HHNND+F+335r   c                    V P                   '       d   V P                  P                  ! V/ VB  R # V P                  P                  ! V/ VB P	                  4        R # r   )r   r    rmr1   r6   r7   s   &*,r   r;   DaskWorkerFileSystem.rmK   >    ;;;GGJJ''HHKK((002r   c                    V P                   '       d   V P                  P                  ! V/ VB  R # V P                  P                  ! V/ VB P	                  4        R # r   )r   r    copyr1   r6   r7   s   &*,r   r?   DaskWorkerFileSystem.copyQ   s>    ;;;GGLL$)&)HHMM4*6*224r   c                    V P                   '       d   V P                  P                  ! V/ VB  R # V P                  P                  ! V/ VB P	                  4        R # r   )r   r    mvr1   r6   r7   s   &*,r   rB   DaskWorkerFileSystem.mvW   r=   r   c                    V P                   '       d   V P                  P                  ! V/ VB # V P                  P                  ! V/ VB P	                  4       # r   )r   r    lsr1   r6   r7   s   &*,r   rE   DaskWorkerFileSystem.ls]   sD    ;;;77::t.v..88;;//7799r   c                    V P                   '       d&   V P                  P                  ! V3R VRVRVRV/VB # \        RRV RVR VRVRVRV/VB # )mode
block_size
autocommitcache_optionsr    r*   r   )r   r    _openDaskFile)r"   r*   rH   rI   rJ   rK   r#   s   &&&&&&,r   rL   DaskWorkerFileSystem._openc   s     ;;;77== & &	
 ,      &	
 & ,  r   c                :   V P                   '       dM   V P                  W4      ;_uu_ 4       pVP                  V4       VP                  WC,
          4      uuR R R 4       # V P                  P                  WW44      P                  4       #   + '       g   i     R # ; ir   )r   rL   seekreadr1   fetch_ranger6   )r"   r*   rH   startendfs   &&&&& r   rR    DaskWorkerFileSystem.fetch_range   sk    ;;;D''1uvvck* (' 88''E?GGII	 (''s   (B		B	)r   r    r1   r   r   r   )NNNN)rbNTN)__name__
__module____qualname____firstlineno____doc__r   staticmethodr,   r!   r5   r;   r?   rB   rE   rL   rR   __static_attributes____classdictcell____classcell__r$   __classdict__s   @@r   r   r      sR     !   
*6353::J Jr   r   c                   L   a a ] tR t^t oRV 3R lltRR ltR tR tRtVt	V ;t
# )rM   c                L   < VR 8w  d   \        R4      h\        SV `  ! R/ VB  R# )rW   z1Remote dask files can only be opened in "rb" modeNr   )r   r   r   )r"   rH   r#   r$   s   &&,r   r   DaskFile.__init__   s&    4<PQQ"6"r   c                    R # r   r   )r"   finals   &&r   _upload_chunkDaskFile._upload_chunk   s    r   c                    R# )zCreate remote file/uploadNr   r2   s   &r   _initiate_uploadDaskFile._initiate_upload   s    r   c                d    V P                   P                  V P                  V P                  W4      # )z*Get the specified set of bytes from remote)r    rR   r*   rH   )r"   rS   rT   s   &&&r   _fetch_rangeDaskFile._fetch_range   s#    ww""499diiDDr   r   )rW   )F)rX   rY   rZ   r[   r   rh   rk   rn   r^   r_   r`   ra   s   @@r   rM   rM      s      #
E Er   rM   )r/   distributed.clientr   r   distributed.workerr   fsspecr   fsspec.specr   r   fsspec.utilsr
   r   r   r   rM   r   r   r   <module>ru      sB     9 %  @ .#nJ- nJbE# Er   