/usr/local/lib/python3.6/site-packages/datasets/filesystems/__pycache__
NameSizeModeActions
compression.cpython-36.pyc61420644editdlrm
hffilesystem.cpython-36.pyc32260644editdlrm
s3filesystem.cpython-36.pyc56000644editdlrm
__init__.cpython-36.pyc15760644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/datasets/filesystems/__pycache__/compression.cpython-36.pyc (6142B)
3 <%EgV@sddlZddlmZddlZddlmZddlmZGdddeZGdddeZ Gd d d eZ Gd d d eZ Gd ddeZ GdddeZ dS)N)Optional)AbstractArchiveFileSystem)DEFAULT_BLOCK_SIZEcseZdZUdZdZdZedZedZedee ee e dfdd Z e fddZ d d Zed d d ZdeedddZZS)BaseCompressedFileFileSystemzFRead contents of compressed file as a filesystem with one file inside.N)fotarget_protocoltarget_optionsc stj|f|tj|fd||jd|p*i|_tjj|jjj dd|_ d|j krn|j d|j j dn|j |_ d|_ dS)a The compressed file system can be instantiated from any compressed file. It reads the contents of compressed file as a filesystem with one file inside, as if it was an archive. The single file inside the filesystem is named after the compresssed file, without the compression extension at the end of the filename. Args: fo (:obj:``str``): Path to compressed file. Will fetch file using ``fsspec.open()`` mode (:obj:``str``): Currently, only 'rb' accepted target_protocol(:obj:``str``, optional): To override the FS protocol inferred from a URL. target_options (:obj:``dict``, optional): Kwargs passed when instantiating the target FS. rb)modeprotocol compressionz::r.N)super__init__fsspecopenr fileospathbasenamesplitcompressed_namerindexuncompressed_name dir_cache)selfrrr kwargs) __class__J/usr/local/lib/python3.6/site-packages/datasets/filesystems/compression.pyrs z%BaseCompressedFileFileSystem.__init__cstj|jdS)N/)r_strip_protocollstrip)clsr)rrr r"0sz,BaseCompressedFileFileSystem._strip_protocolcCs8|jdkr4|jjj|jjd|ji}|d|i|_dS)Nname)rrfsinforr)rfrrr _get_dirs5s z&BaseCompressedFileFileSystem._get_dirs)rcCs|jjjS)N)rrread)rrrrr cat:sz BaseCompressedFileFileSystem.catr T)rr cKs6|j|}|dkr,td|d|jjd|jjS)Nr zTried to read with mode z on file z opened with mode 'rb')r" ValueErrorrrr)rrr block_sizeZ autocommitZ cache_optionsrrrr _open=s z"BaseCompressedFileFileSystem._open)rNN)r NTN)__name__ __module__ __qualname____doc__Z root_markerr strr extensionrdictr classmethodr"r)r+r. __classcell__rr)rr r s  rc@seZdZdZdZdZdZdS) Bz2FileSystemz?Read contents of BZ2 file as a filesystem with one file inside.bz2z.bz2N)r/r0r1r2r r r4rrrr r8Lsr8c@seZdZdZdZdZdZdS)GzipFileSystemz@Read contents of GZIP file as a filesystem with one file inside.gzipz.gzN)r/r0r1r2r r r4rrrr r:Tsr:c@seZdZdZdZdZdZdS) Lz4FileSystemz?Read contents of LZ4 file as a filesystem with one file inside.Zlz4z.lz4N)r/r0r1r2r r r4rrrr r<\sr<c@seZdZdZdZdZdZdS) XzFileSystemzFRead contents of .xz (LZMA) file as a filesystem with one file inside.xzz.xzN)r/r0r1r2r r r4rrrr r=dsr=csLeZdZdZdZdZdZdddefeee ee e e dfdd Z Z S) ZstdFileSystemz Read contents of zstd file as a filesystem with one file inside. Note that reading in binary mode with fsspec isn't supported yet: https://github.com/indygreg/python-zstandard/issues/136 Zzstdz.zstr N)rr rr r-c sNtjf|||||d||jjGdddfdd}||j_dS)N)rr rr r-c@s<eZdZddZddZddZddZd d Zd d Zd S)z,ZstdFileSystem.__init__..WrappedFilecSs ||_dS)N)_file)rfile_rrr rsz5ZstdFileSystem.__init__..WrappedFile.__init__cSs|jj|S)N)r@ __enter__)rrrr rBs z6ZstdFileSystem.__init__..WrappedFile.__enter__c_s|jj||dS)N)r@__exit__)rargsrrrr rCsz5ZstdFileSystem.__init__..WrappedFile.__exit__cSs t|jS)N)iterr@)rrrr __iter__sz5ZstdFileSystem.__init__..WrappedFile.__iter__cSs t|jS)N)nextr@)rrrr __next__sz5ZstdFileSystem.__init__..WrappedFile.__next__cSs t|j|S)N)getattrr@)rattrrrr __getattr__sz8ZstdFileSystem.__init__..WrappedFile.__getattr__N) r/r0r1rrBrCrFrHrKrrrr WrappedFiles rLcs||S)Nr)rDr)rL_enterrr fixed_entersz,ZstdFileSystem.__init__..fixed_enter)rrrrB)rrr rr r-rrN)r)rLrMr rxs  zZstdFileSystem.__init__)r/r0r1r2r r r4rr3rr5intrr7rr)rr r?lsr?)rtypingrrZfsspec.archiverZ fsspec.utilsrrr8r:r<r=r?rrrr s   C