/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__/memory.cpython-36.pyc (6697B)
3 8%Eg!@szddlmZmZmZddlZddlmZddlmZddlm Z ddl m Z ej dZ Gdd d e ZGd d d e ZdS) )absolute_importdivisionprint_functionN)datetime) ENOTEMPTY)BytesIO)AbstractFileSystemzfsspec.memoryfsc@seZdZdZiZdgZdZdZeddZ d!dd Z d"d d Z d#d dZ ddZ ddZddZd$ddZddZd%ddZddZd&dd ZdS)'MemoryFileSystemzA filesystem based on a dict of BytesIO objects This is a global filesystem so instances of this class all point to the same in memory filesystem. Zmemory/cCsT|jdr|tdd}d|ks*d|kr4|jdS|jdjd}|rPd|SdS)Nz memory://z::z://r r ) startswithlenrstriplstrip)clspathrG/usr/local/lib/python3.6/site-packages/fsspec/implementations/memory.py_strip_protocols   z MemoryFileSystem._strip_protocolFc Ks|j|}||jkr8||j|jjd|j|jdgSt}|d}g}x|jD]}|j|rRd|t|dkr|j||j|jjd|j|jdqRt|t|krR||t|dj ddd}||krR|pg}|j|ddd|j |qRWx|j D]}|j|rd|t|dkrT||kr|j|ddd|j |nF||t|dj ddd}||kr|j|ddd|j |qW|s||j krgSt ||r|St dd |DS) Nfile)namesizetypecreatedr r directory)rrrcSsg|] }|dqS)rr).0frrr ^sz'MemoryFileSystem.ls..)rstore getbuffernbytesrsetr r appendsplitadd pseudo_dirsFileNotFoundErrorsorted) selfrZdetailkwargspathsZstarteroutp2Zppathrrrls"sV             zMemoryFileSystem.lsTc Ks|j|}||jks||jkr"t|j|jdrP|j|j|rPt|j||r|j|jdry|j|j||f|Wntk rYnX|r||jkr|jj |dS)Nr ) rrr&FileExistsError_parentstripisfileNotADirectoryErrormkdirr#)r)rcreate_parentsr*rrrr4`s  zMemoryFileSystem.mkdirc Cs2y|j|ddWntk r,|s(YnXdS)NT)r5)r4r/)r)rexist_okrrrmakedirsns zMemoryFileSystem.makedirscCsF|j|}||jkr:|j|s,|jj|qBttd|nt|dS)NzDirectory not empty)rr&r.removeOSErrorrr')r)rrrrrmdirus    zMemoryFileSystem.rmdircCs|j|}||jkp||jkS)N)rrr&)r)rrrrexistss zMemoryFileSystem.existsc s|j|jks6tfddt|j|jDrBdddS|jkr|j}t|drh|jn|jjdt |ddd St dS) Nc3s|]}|jdVqdS)r N)r )rp)rrr sz(MemoryFileSystem.info..rr)rrrrrr)rrrr) rr&anylistrhasattrrr r!getattrr')r)rr*Zfileliker)rrinfos     zMemoryFileSystem.inforbNc Ks|j|}||jkrt|}x,t|dkrH|j|}|j|rt|qW|dkr||jkr|j|}|dkr||jddn |jd|St ||dkrt ||} |j s| j | SdS) NrrCabrb+rwb)rCrDrE) rr&IsADirectoryErrorr r0r2r/rseekr' MemoryFileZ_intranscommit) r)rmode block_sizeZ autocommitZ cache_optionsr*parentrmrrr_opens*         zMemoryFileSystem._opencKsf|j|}|j|}|j|r}z t|WYdd}~XnXdS)N)rrrTr')r)rerrr_rms   zMemoryFileSystem._rmcCsR|j|||d}x     r c@s:eZdZdZd ddZddZddZd d Zd d ZdS)rJzA BytesIO which can't close and works as a context manager Can initialise with data. Each path should only be active once at any moment. No need to provide fs, path if auto-committing (default) NcCs@||_||_tjj|_|r<|j|t||_|j ddS)Nr) fsrrutcnow timestamprwriter rrI)r)rdrdatarrr__init__s  zMemoryFile.__init__cCs|S)Nr)r)rrr __enter__szMemoryFile.__enter__cCs$|j}|jdd|_|j|dS)NrrF)tellrIr)r)positionrrrcloseszMemoryFile.closecCsdS)Nr)r)rrrdiscardszMemoryFile.discardcCs||jj|j<dS)N)rdrr)r)rrrrKszMemoryFile.commit)NNN) r^r_r`rarirjrmrnrKrrrrrJs  rJ) __future__rrrloggingrerrnoriorZfsspecrLoggerloggerr rJrrrrs     Y