/usr/local/lib/python3.6/site-packages/fsspec/implementations/__pycache__
Edit: /usr/local/lib/python3.6/site-packages/fsspec/implementations/__pycache__/dask.cpython-36.pyc (4656B)
3
8%EgY @ sx d dl Z d dlmZmZ d dlmZ d dlmZ d dlm Z m
Z
d dlmZ dd Z
G d d
d
e
ZG dd de ZdS )
N)Client_get_global_client)
get_worker)
filesystem)AbstractBufferedFileAbstractFileSystem)infer_storage_optionsc C s( | d krt S t| tr| S t| S d S )N)r
isinstancer )client r E/usr/local/lib/python3.6/site-packages/fsspec/implementations/dask.py_get_client
s
r
c sp e Zd ZdZd fdd Zedd Zdd Zd d
Zdd Z d
d Z
dd Zdd ZdddZ
dd Z ZS )DaskWorkerFileSystema) View files accessible to a worker as any other remote file-system
When instances are run on the worker, uses the real filesystem. When
run on the client, they call the worker to provide information or data.
**Warning** this implementation is experimental, and read-only for now.
Nc sP t jf | |d k|d kA s&td|| _|| _d | _|| _|| _| j d S )NzKPlease provide one of filesystem instance (fs) or target_protocol, not both) super__init__
ValueErrortarget_protocoltarget_optionsworkerr
fs_determine_worker)selfr r r r
kwargs) __class__r r r s zDaskWorkerFileSystem.__init__c C s: t | }d|kr2d|kr2d|d d|d iS i S d S )Nhostportr
:)r )pathsor r r _get_kwargs_from_urls- s z*DaskWorkerFileSystem._get_kwargs_from_urlsc C sh y0t d| _| jd kr.t| jf| jp(i | _W n2 tk
rb d| _t| j| _t j
| | _Y nX d S )NTF)r r r r r r r r
r
daskZdelayedrfs)r r r r r 5 s
z&DaskWorkerFileSystem._determine_workerc O s, | j r| jj|| n| jj||j d S )N)r r mkdirr! compute)r argsr r r r r" B s zDaskWorkerFileSystem.mkdirc O s, | j r| jj|| n| jj||j d S )N)r r rmr! r# )r r$ r r r r r% H s zDaskWorkerFileSystem.rmc O s, | j r| jj|| n| jj||j d S )N)r r copyr! r# )r r$ r r r r r&