+
    &j                     d    ^ RI t ^ RIt^ RIt^ RIt^ RIHtHt ^RIHt RR lt	 ! R R]]4      t
R# )    N)AsyncFileSystemrunning_async)ChainedFileSystemc                J   a a \         P                  ! S 4      V V3R l4       pV# )ai  
Wraps a synchronous function to make it awaitable.

Parameters
----------
func : callable
    The synchronous function to wrap.
obj : object, optional
    The instance to bind the function to, if applicable.
semaphore : asyncio.Semaphore, optional
    A semaphore to limit concurrent calls.

Returns
-------
coroutine
    An awaitable version of the function.
c                  6  <"   S'       dH   S;_uu_4       GR j  xL
  \         P                  ! S.V O5/ VB G R j  xL
 uuR R R 4      GR j  xL
  # \         P                  ! S.V O5/ VB G R j  xL
 #  LZ L: L+  + GR j  xL 
 '       g   i     LA; i L&5iN)asyncio	to_thread)argskwargsfunc	semaphores   *,{/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/fsspec/implementations/asyn_wrapper.pywrapperasync_wrapper.<locals>.wrapper   si      yy$..tEdEfEE !yy&&t=d=f=== !E !yyy=sf   BA5BA;A7A; BA9"B0B1B7A;9B;B	B
B	B		B)	functoolswraps)r   objr   r   s   f&f r   async_wrapperr      s'    & __T> > N    c                   h   a a ] tR t^(t oRtRtRtR	V 3R llt]R 4       t	R t
]R 4       tRtVtV ;t# )
AsyncFileSystemWrappera8  
A wrapper class to convert a synchronous filesystem into an asynchronous one.

This class takes an existing synchronous filesystem implementation and wraps all
its methods to provide an asynchronous interface.

Parameters
----------
sync_fs : AbstractFileSystem
    The synchronous filesystem instance to wrap.
Fc                   < Vf   \        4       p\        SV `  ! RRV/VB  Ve   Wn        M\        P
                  ! V3/ VB V n        V P                  P                  V n        WPn        V P                  4        R # )Nasynchronous )	r   super__init__sync_fsfsspec
filesystemprotocolr   _wrap_all_sync_methods)	selffsr   target_protocoltarget_optionsr   max_concurrent_tasksr   	__class__s	   &&&&&&&,r   r   AsyncFileSystemWrapper.__init__8   sj     (?L=l=f=>L!,,_OODL--"##%r   c                4    R V P                   P                   2# )async_)r   fsid)r#   s   &r   r,   AsyncFileSystemWrapper.fsidM   s    ))*++r   c                   R0p\        V P                  4       F  pVP                  R4      '       g   W!9   d   K"  \        P                  ! V P                  V4      p\        V\        4      '       d   K[  \        V P                  V4      p\        V4      '       g   K  \        P                  ! V4      '       d   K  \        W@V P                  R7      p\        V RV 2V4       K  	  R# )zW
Wrap all synchronous methods of the underlying filesystem with asynchronous versions.
open_)r   r   N)dirr   
startswithinspectgetattr_static
isinstancepropertygetattrcallableiscoroutinefunctionr   r   setattr)r#   excluded_methodsmethod_nameattrmethodasync_methods   &     r   r"   -AsyncFileSystemWrapper._wrap_all_sync_methodsQ   s     #8t||,K%%c**k.M))$,,DD$))T\\;7F(C(CF(K(K,VX+/> -r   c                N   a  ! V3R lRV 4      pRSP                    R2Vn         V# )aM  
Create a new class that can be used to instantiate an AsyncFileSystemWrapper
with lazy instantiation of the underlying synchronous filesystem.

Parameters
----------
sync_fs_class : type
    The class of the synchronous filesystem to wrap.

Returns
-------
type
    A new class that wraps the provided synchronous filesystem class.
c                   6   <a a ] tR t^tt oV V3R ltRtVtV ;t# )JAsyncFileSystemWrapper.wrap_class.<locals>.GeneratedAsyncFileSystemWrapperc                6   < S! V/ VB p\         SV `  V4       R # r   )r   r   )r#   r   r   r   r(   sync_fs_classs   &*, r   r   SAsyncFileSystemWrapper.wrap_class.<locals>.GeneratedAsyncFileSystemWrapper.__init__u   s    '88 )r   r   )__name__
__module____qualname____firstlineno__r   __static_attributes____classdictcell____classcell__)r(   __classdict__rE   s   @@r   GeneratedAsyncFileSystemWrapperrC   t   s     * *r   rO   AsyncWrapper)rG   )clsrE   rO   s   &f r   
wrap_class!AsyncFileSystemWrapper.wrap_classc   s4    "	*c 	* M**+73 	(0 /.r   )r!   r   r   )asyncwrapperr   )NNNNNN)rG   rH   rI   rJ   __doc__r!   cachabler   r6   r,   r"   classmethodrS   rK   rL   rM   )r(   rN   s   @@r   r   r   (   sM     
 /HH&* , ,?$ / / /r   r   )NN)r	   r   r3   r   fsspec.asynr   r   chainedr   r   r   r   r   r   <module>r[      s-        6 &:T/_.? T/r   