/usr/local/lib/python3.6/site-packages/fsspec/implementations/__pycache__
NameSizeModeActions
arrow.cpython-36.pyc73280644editdlrm
cached.cpython-36.pyc230300644editdlrm
dask.cpython-36.pyc46560644editdlrm
dbfs.cpython-36.pyc133510644editdlrm
dvc.cpython-36.pyc26220644editdlrm
ftp.cpython-36.pyc104440644editdlrm
git.cpython-36.pyc37500644editdlrm
github.cpython-36.pyc74040644editdlrm
hdfs.cpython-36.pyc70930644editdlrm
http.cpython-36.pyc207520644editdlrm
jupyter.cpython-36.pyc41310644editdlrm
libarchive.cpython-36.pyc60050644editdlrm
local.cpython-36.pyc119120644editdlrm
memory.cpython-36.pyc66970644editdlrm
reference.cpython-36.pyc161420644editdlrm
sftp.cpython-36.pyc61040644editdlrm
smb.cpython-36.pyc105910644editdlrm
tar.cpython-36.pyc45020644editdlrm
webhdfs.cpython-36.pyc147120644editdlrm
zip.cpython-36.pyc32760644editdlrm
__init__.cpython-36.pyc1560644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/fsspec/implementations/__pycache__/arrow.cpython-36.pyc (7328B)
3 8%Egj @sddlZddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z m Z mZddZGdd d e Ze d d d d ddddgGdddejZGdddeZdS)N)suppress)wraps)AbstractFileSystem)infer_storage_options mirror_fromstringify_pathcstfdd}|S)Ncshy ||Stk rb}z<|js$|j^}}t|trPd|krPttj||nWYdd}~XnXdS)Nzdoes not exist)OSErrorargs isinstancestrFileNotFoundErrorerrnoENOENT)r kwargs exceptionmessage)funcF/usr/local/lib/python3.6/site-packages/fsspec/implementations/arrow.pywrappers  z wrap_exceptions..wrapper)r)rrr)rrwrap_exceptions srcseZdZdZdZfddZeddZd#dd Zd d Z d d Z ddZ e ddZ e ddZeZe ddZe d$ddZe d%ddZe d&ddZe d'dd Ze d!d"ZZS)(ArrowFSWrapperzwFSSpec-compatible wrapper of pyarrow.fs.FileSystem. Parameters ---------- fs : pyarrow.fs.FileSystem /c s||_tjf|dS)N)fssuper__init__)selfrr) __class__rrr*szArrowFSWrapper.__init__cCs$t|}d|kr |jd\}}}|S)Nz://)r partition)clspath_rrr_strip_protocol.szArrowFSWrapper._strip_protocolFc sDddlm}fddjj||D}|r2|Sdd|DSdS)Nr) FileSelectorcsg|]}j|qSr) _make_entry).0entry)rrr :sz%ArrowFSWrapper.ls..cSsg|] }|dqS)namer)r%r&rrrr'@s) pyarrow.fsr#r get_file_info)rr Zdetailrr#entriesr)rrls6s   zArrowFSWrapper.lscKs$|j|}|jj|g\}|j|S)N)r"rr*r$)rr rinforrrr-Bs zArrowFSWrapper.infoc Cs6|j|}y|j|Wntk r,dSXdSdS)NFT)r"r-r )rr rrrexistsGs  zArrowFSWrapper.existscCsnddlm}|j|jkrd}n<|j|jkr0d}n*|j|jkrVttjt j tj|j nd}|j |j ||j dS)Nr)FileType directoryfileother)r(sizetypemtime)r)r/r4Z DirectoryFileZNotFoundr r rosstrerrorr r3r5)rr-r/kindrrrr$Ps    zArrowFSWrapper._make_entrycKs|j|jd}|j|jd}|j|d}dj|j|dtjdg}y6|j|d}tj ||WdQRX|j j ||Wn6t k rt t|j j|WdQRXYnXWdQRXdS)Nrrbz.tmp.wb)r"rstrip_openjoin_parentsecretsZ token_hexopenshutil copyfileobjrmove BaseExceptionrr delete_file)rpath1path2rZlstreamZ tmp_fnameZrstreamrrrcp_filecs  zArrowFSWrapper.cp_filecKs2|j|jd}|j|jd}|jj||dS)Nr)r"r=rrE)rrHrIrrrrmvsszArrowFSWrapper.mvcCs|j|}|jj|dS)N)r"rrG)rr rrrrm_file{s zArrowFSWrapper.rm_fileNcCsF|j|jd}|j|r6|r,|jj|qBtdn |jj|dS)Nrz0Can't delete directories without recursive=False)r"r=isdirr delete_dir ValueErrorrG)rr recursiveZmaxdepthrrrrms   zArrowFSWrapper.rmr:cKsN|dkr|jj|}n$|dkr,|jj|}ntd|t|||||f|S)Nr:r<z'unsupported mode for Arrow filesystem: )rZopen_input_streamZopen_output_streamrO ArrowFile)rr mode block_sizerstreamrrrr>s zArrowFSWrapper._openTcKs2|j|}|r|j|ddn|jj|dddS)NT)exist_okF)rP)r"makedirsr create_dir)rr Zcreate_parentsrrrrmkdirs zArrowFSWrapper.mkdircCs|j|}|jj|dddS)NT)rP)r"rrX)rr rVrrrrWs zArrowFSWrapper.makedirscCs|j|}|jj|dS)N)r"rrN)rr rrrrmdirs zArrowFSWrapper.rmdir)F)FN)r:N)T)F)__name__ __module__ __qualname____doc__Z root_markerr classmethodr"r,r-r.r$rrJrKZmv_filerLrQr>rYrWrZ __classcell__rr)rrrs*           rrUreadseektellwritereadablewritableclosec@s&eZdZdddZddZddZdS) rRNcKs.||_||_||_||_||_|_||_dS)N)r rSrrU blocksizerTr)rrrUr rSrTrrrrrs  zArrowFile.__init__cCs|S)Nr)rrrr __enter__szArrowFile.__enter__cGs|jS)N)rg)rr rrr__exit__szArrowFile.__exit__)N)r[r\r]rrirjrrrrrRs rRcs2eZdZdZdZd fdd Zedd ZZS) HadoopFileSystemz]A wrapper on top of the pyarrow.fs.HadoopFileSystem to connect it's interface with fsspecZhdfsdefaultrNc  s8ddlm}||||||d}tjfd|i|dS)a Parameters ---------- host: str Hostname, IP or "default" to try to read from Hadoop config port: int Port to connect on, or default from Hadoop config if 0 user: str or None If given, connect as this username kerb_ticket: str or None If given, use this ticket for authentication extra_conf: None or dict Passed on to HadoopFileSystem r)rk)hostportuser kerb_ticket extra_confrN)r)rkrr) rrmrnrorprqrrkr)rrrrs zHadoopFileSystem.__init__cCsXt|}i}|jddr$|d|d<|jddr<|d|d<|jddrT|d|d<|S)Nrmusernamerorn)rget)r opsoutrrr_get_kwargs_from_urlss      z&HadoopFileSystem._get_kwargs_from_urls)rlrNNN) r[r\r]r^protocolr staticmethodrvr`rr)rrrksrk)r ior7rArC contextlibr functoolsrZ fsspec.specrZ fsspec.utilsrrrrrIOBaserRrkrrrrs