CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
data.cpython-310.pyc28 linesDownload Raw Back to __pycache__
1o

2��Yi[�@s<ddlZddlZddlmZddlmZGdd�de�ZdS)�N)�unquote)�AbstractFileSystemcsdeZdZdZdZ�fdd�Zddd�Zdd	�Z	3			ddd
�Ze	dde4dedBfdd��Z�Z
S)�DataFileSystemz�A handy decoder for data-URLs5 6    Example7    -------8    >>> with fsspec.open("data:,Hello%2C%20World%21") as f:9    ...     print(f.read())10    b"Hello, World!"11 12    See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs13    �datacst�jdi|��dS)z!No parameters for this filesystemN�)�super�__init__)�self�kwargs��	__class__r��E:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\fsspec/implementations/data.pyrszDataFileSystem.__init__NcKs@|�dd�\}}|�d�rt�|�||�St|���||�S)N�,��base64)�split�endswithr�	b64decoder�encode)r	�path�start�endr14�prefrrrr
�cat_files15zDataFileSystem.cat_filecKsH|�dd�\}}|�|�}|�dd�d�dd�d}|t|�d|d�S)Nrr�:�;r�file)�name�size�type�mimetype)rr�len)r	rr16rrr�mimerrr
�info s17zDataFileSystem.info�rbTcKs d|vrtd��t�|�|��S)N�rzRead only filesystem)�18ValueError�io�BytesIOr)r	r�mode�19block_sizeZ20autocommitZ
cache_optionsr21rrr
�_open&s	zDataFileSystem._openr"cCsd|pd�dt�|�����S)z�Format the given data into data-URL syntax22 23        This version always base64 encodes, even when the data is ascii/url-safe.24        zdata:�z;base64,)r�	b64encode�decode)rr"rrr
r3szDataFileSystem.encode)NN)r$NTN)N)�__name__�25__module__�__qualname__�__doc__�protocolrrr#r+�staticmethod�bytes�strr�
__classcell__rrrr
rs26	27�
"r)rr'�urllib.parserZfsspecrrrrrr
�<module>s28
Aluode/PerceptionLabPortable · CoolFace