+
    nDj|:                         R t ^ RIHtHt ^ RIHtHtHtHtH	t	H
t
HtHtHtHtHt ]t. t ^ RIHt  ^ RIHt  ^ RIHt  ^ R	IHtHtHtHtHtH t H!t!H"t"H#t#H$t$ ^ R
I%t%]%PL                  ! ]"4       R t'RR/R lt(RRR/R llt)RRRRR/R llt* ! R R]4      t+R
#   ] d    ]P+                  R4        Li ; i  ] d    ]P+                  R4        Li ; i  ] d    ]P+                  R4        Li ; i  ] d    ]P+                  R4        Li ; i)zO
FileSystem abstraction to interact with various local and remote filesystems.
)_is_path_like_stringify_path)FileSelectorFileTypeFileInfo
FileSystemLocalFileSystemSubTreeFileSystem_MockFileSystemFileSystemHandlerPyFileSystem_copy_files_copy_files_selector)AzureFileSystemr   )HadoopFileSystemr   )GcsFileSystemr   )
AwsDefaultS3RetryStrategyAwsStandardS3RetryStrategyS3FileSystem
S3LogLevelS3RetryStrategyensure_s3_initializedfinalize_s3ensure_s3_finalizedinitialize_s3resolve_s3_regionNr   c                 T    V \         9   d   \        R V  R24      h\        RV  R24      h)z8The pyarrow installation is not built with support for ''z&module 'pyarrow.fs' has no attribute ')_not_importedImportErrorAttributeError)names   &D/data/cameron/venvs/s3viz/lib/python3.14/site-packages/pyarrow/fs.py__getattr__r#   I   sC    }vQ
 	

 
0a8     use_mmapFc          	         \        V \        4      '       d   V # \        V \        4      '       d   V'       d   \        R 4      h\        P                  ! V 4      w  r#VP                  V4      pV'       dw   VP                  V.4      ^ ,          pVP                  \        P                  8w  d4   \        RVP                  P                   RVP                   RV  R24      h\        WB4      pV#  ^ RIp\        WP                  4      '       d;   \        V 4      P                  R8X  d   \!        VR7      # \#        \%        V 4      4      #  \)        R\        V 4       R	24      h  \&         d     L%i ; i)
zXSpecifying to use memory mapping not supported for filesystem specified as an URI stringzWThe path component of the filesystem URI must point to a directory but it has a type: `z`. The path component is `z#` and the given filesystem URI is ``Nr   r%   zUnrecognized filesystem: zP. `filesystem` argument must be a FileSystem instance or a valid file system URI)
isinstancer   str
ValueErrorfrom_urinormalize_pathget_file_infotyper   	Directoryr!   pathr	   fsspecAbstractFileSystem__name__r   r   FSSpecHandlerr   	TypeError)
filesystemr%   fsr1   prefixprefix_infor2   s   &$     r"   _ensure_filesystemr;   U   so   *j))	J	$	$ 8  &&z2""4(**F84Q7K8#5#55 55@5E5E5J5J4K L%%0%5%5$6 7%,a)  #6.B			? *&?&?@@
#,,0AA*H==#M*$=>>	 A 'Z(8'9 :B B
 	
  		s   ,E E,+E,
memory_mapc                  \        V 4      '       g   Ve   \        R4      hW3# Ved   \        WR7      p\        V\        4      '       d   \        V 4      p M!\        V \        4      '       g   \        R4      hVP                  V 4      p W3# \        V 4      p \	        VR7      p VP                  V 4      pVP                  \        P                  8g  pV'       g    \        P                  ! V 4      w  rW3# VP                  V 4      p W3#   \         d    RpRp LIi ; i  \         d&   p\        T4      pRT9   g   RT9   d    Rp?M
ThRp?ii ; i Y3# )z
Return filesystem/path from path which could be an URI or a plain
filesystem path or a combination of fsspec protocol and URI.
Nzg'filesystem' passed but the specified path is file-like, so there is nothing to open with 'filesystem'.r(   zPExpected string path; path-like objects are only allowed with a local filesystemFzempty schemezCannot parse URI)r   r+   r;   r)   r   r   r*   r6   r-   r.   r/   r   NotFoundr   r,   )r1   r7   r<   	file_infoexists_locallyemsgs   &&$    r"   _resolve_filesystem_and_pathrC      sv   
 !?  '
H
j/22"4(DD#&&*  ((.4 D
 !*5J?,,T2	
 $..H,=,== 
	)2248J  ((./  	  	a&C$(:c(A 	  s0   #D	 D 	DDE)E	E		E
chunk_sizeuse_threadsTc                   \        W4      w  rg\        W4      w  rVP                  V4      p
V
P                  \        P                  8X  d   \        VRR7      p\        WkWWE4       R# \        WgWWE4       R# )a  
Copy files between FileSystems.

This functions allows you to recursively copy directories of files from
one file system to another, such as from S3 to your local machine.

Parameters
----------
source : string
    Source file path or URI to a single file or directory.
    If a directory, files will be copied recursively from this path.
destination : string
    Destination file path or URI. If `source` is a file, `destination`
    is also interpreted as the destination file (not directory).
    Directories will be created as necessary.
source_filesystem : FileSystem, optional
    Source filesystem, needs to be specified if `source` is not a URI,
    otherwise inferred.
destination_filesystem : FileSystem, optional
    Destination filesystem, needs to be specified if `destination` is not
    a URI, otherwise inferred.
chunk_size : int, default 1MB
    The maximum size of block to read before flushing to the
    destination file. A larger chunk_size will use more memory while
    copying but may help accommodate high latency FileSystems.
use_threads : bool, default True
    Whether to use multiple threads to accelerate copying.

Examples
--------
Inspect an S3 bucket's files:

>>> s3, path = fs.FileSystem.from_uri(
...            "s3://registry.opendata.aws/roda/ndjson/")
>>> selector = fs.FileSelector(path)
>>> s3.get_file_info(selector)
[<FileInfo for 'registry.opendata.aws/roda/ndjson/index.ndjson':...]

Copy one file from S3 bucket to a local directory:

>>> fs.copy_files("s3://registry.opendata.aws/roda/ndjson/index.ndjson",
...               f"file:///{local_path}/index_copy.ndjson")

>>> fs.LocalFileSystem().get_file_info(str(local_path)+
...                                    '/index_copy.ndjson')
<FileInfo for '.../index_copy.ndjson': type=FileType.File, size=...>

Copy file using a FileSystem object:

>>> fs.copy_files("registry.opendata.aws/roda/ndjson/index.ndjson",
...               f"file:///{local_path}/index_copy.ndjson",
...               source_filesystem=fs.S3FileSystem())
T	recursiveN)rC   r.   r/   r   r0   r   r   r   )sourcedestinationsource_filesystemdestination_filesystemrD   rE   	source_fssource_pathdestination_fsdestination_pathr?   
source_sels   &&&&$$      r"   
copy_filesrR      sz    p :I (D($N ''4I~~+++!+>
Y+'	6 	I"	-r$   c                      a  ] tR tRt o RtR tR tR tR tR t	]
R 4       tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tRtV tR# )r5   i	  z
Handler for fsspec-based Python filesystems.

https://filesystem-spec.readthedocs.io/en/latest/index.html

Parameters
----------
fs : FSSpec-compliant filesystem instance

Examples
--------
>>> PyFileSystem(FSSpecHandler(fsspec_fs)) # doctest: +SKIP
c                    Wn         R # Nr8   )selfr8   s   &&r"   __init__FSSpecHandler.__init__  s    r$   c                l    \        V\        4      '       d   V P                  VP                  8H  # \        # rU   r)   r5   r8   NotImplementedrW   others   &&r"   __eq__FSSpecHandler.__eq__  (    e]++77ehh&&r$   c                l    \        V\        4      '       d   V P                  VP                  8g  # \        # rU   r[   r]   s   &&r"   __ne__FSSpecHandler.__ne__   ra   r$   c                v    V P                   P                  p\        V\        4      '       d
   V^ ,          pRV 2# )    zfsspec+)r8   protocolr)   list)rW   rg   s   & r"   get_type_nameFSSpecHandler.get_type_name%  s4    77##h%%{H
##r$   c                    V# rU    rW   r1   s   &&r"   r-   FSSpecHandler.normalize_path+  s    r$   c           	         VR ,          pVR,          R8X  d   \         P                  pM1VR,          R8X  d   \         P                  pRpM\         P                  p\	        WW!P                  RR4      R7      # )sizer/   file	directoryNmtime)rp   rs   )r   Filer0   Unknownr   get)r1   inforp   ftypes   &&  r"   _create_file_infoFSSpecHandler._create_file_info.  s_    F|<6!MME&\[(&&ED$$E$hhw6MNNr$   c                
   . pV F?  p V P                   P                  V4      pVP                  V P                  W44      4       KA  	  V#   \         d.    TP                  \        T\        P                  4      4        K|  i ; irU   )r8   rw   appendry   FileNotFoundErrorr   r   r>   )rW   pathsinfosr1   rw   s   &&   r"   r.   FSSpecHandler.get_file_info;  su    DAww||D) T33D?@  	 % @XdH,=,=>?@s   A

4BBc                   V P                   P                  VP                  4      '       gj   V P                   P                  VP                  4      '       d   \	        VP                  4      hVP
                  '       d   . # \        VP                  4      hVP                  '       d   R pM^p. pV P                   P                  VP                  VRRR7      pVP                  4        FY  w  rVVP                  R4      pVP                  P                  R4      pWx8w  g   K9  VP                  V P                  WV4      4       K[  	  V# )NT)maxdepthwithdirsdetail/)r8   isdirbase_direxistsNotADirectoryErrorallow_not_foundr}   rH   finditemsstripr|   ry   )	rW   selectorr   r   selected_filesr1   rw   _pathr   s	   &&       r"   get_file_info_selector$FSSpecHandler.get_file_info_selectorF  s   ww}}X..//ww~~h//00():):;;+++I+H,=,=>>HH4 & 
 )..0JDJJsOE((..s3H  T33D?@ 1 r$   c                d     V P                   P                  WR 7       R#   \         d     R# i ; i))create_parentsN)r8   mkdirFileExistsError)rW   r1   rH   s   &&&r"   
create_dirFSSpecHandler.create_dirc  s+    	GGMM$M9 		s     //c                @    V P                   P                  VR R7       R# TrG   N)r8   rmrm   s   &&r"   
delete_dirFSSpecHandler.delete_dirj  s    

44
(r$   c                    V P                   P                  VR R7      pT F  pT P                   P                  T4      '       d    T P                   P	                  TRR7       KC  T P                   P                  T4      '       g   Kf  T P                   P	                  T4       K  	  R#   \         d    T'       d    R# h i ; i)F)r   NTrG   )r8   listdirr}   r   r   isfile)rW   r1   missing_dir_oksubpathssubpaths   &&&  r"   _delete_dir_contents"FSSpecHandler._delete_dir_contentsm  s    	wwtE:H
  Gww}}W%%

7d
3((

7#	  	 ! 		s   B( (C >C c                n    VP                  R 4      R8X  d   \        RVR4      hV P                  W4       R# )r    z$delete_dir_contents called on path 'r   N)r   r+   r   )rW   r1   r   s   &&&r"   delete_dir_contents!FSSpecHandler.delete_dir_contentsz  s6    ::c?b 6cC C!!$7r$   c                *    V P                  R R4       R# )r   FN)r   )rW   s   &r"   delete_root_dir_contents&FSSpecHandler.delete_root_dir_contents  s    !!#u-r$   c                    V P                   P                  V4      '       g   \        V4      hV P                   P                  V4       R # rU   )r8   r   r}   r   rm   s   &&r"   delete_fileFSSpecHandler.delete_file  s2     ww~~d###D))

4r$   c                @    V P                   P                  WR R7       R# r   )r8   mvrW   srcdests   &&&r"   moveFSSpecHandler.move  s    

3
-r$   c                <    V P                   P                  W4       R # rU   )r8   copyr   s   &&&r"   	copy_fileFSSpecHandler.copy_file  s     	Sr$   c                    ^ RI Hp V P                  P                  V4      '       g   \	        V4      hV! V P                  P                  VRR7      RR7      # rf   
PythonFilerbmoderpyarrowr   r8   r   r}   openrW   r1   r   s   && r"   open_input_streamFSSpecHandler.open_input_stream  A    &ww~~d###D))$'',,t$,7cBBr$   c                    ^ RI Hp V P                  P                  V4      '       g   \	        V4      hV! V P                  P                  VRR7      RR7      # r   r   r   s   && r"   open_input_fileFSSpecHandler.open_input_file  r   r$   c                X    ^ RI Hp V! V P                  P                  VRR7      RR7      # )rf   r   wbr   wr   r   r8   r   rW   r1   metadatar   s   &&& r"   open_output_stream FSSpecHandler.open_output_stream  #    &$'',,t$,7cBBr$   c                X    ^ RI Hp V! V P                  P                  VRR7      RR7      # )rf   r   abr   r   r   r   s   &&& r"   open_append_stream FSSpecHandler.open_append_stream  r   r$   rV   N)r4   
__module____qualname____firstlineno____doc__rX   r_   rc   ri   r-   staticmethodry   r.   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell__)__classdict__s   @r"   r5   r5   	  s     

$ 
O 
O	:)$8.. CCC
C Cr$   r5   rU   )NNi   ),r   pyarrow.utilr   r   pyarrow._fsr   r   r   r   r   r	   r
   r   r   r   r   	FileStatsr   pyarrow._azurefsr   r   r|   pyarrow._hdfsr   pyarrow._gcsfsr   pyarrow._s3fsr   r   r   r   r   r   r   r   r   r   atexitregisterr#   r;   rC   rR   r5   rl   r$   r"   <module>r      s5  $ 8    	,0-.*,)L L L 
OO'(	*
u *
Z9e 9xH-&H-48H-VcC% cC{  ,*+,
  -+,-
  *)*  )()sD   B B6 C C2 B32B36CCC/.C/2DD