�
lMgr � � � d dl Z d dlmZmZ d dlmZ d dlmZ d dlm Z m
Z
d dlmZ d� Z
d� Z G d � d
e
� Z G d� de � Zy)
� N)�Client�_get_global_client)�Worker)�
filesystem)�AbstractBufferedFile�AbstractFileSystem��infer_storage_optionsc �T � | �
t � S t | t � r| S t | � S �N)r �
isinstancer )�clients �gC:\Users\noahv\Documents\GitHub\clickup-operator\.venv\Lib\site-packages\fsspec/implementations/dask.py�_get_clientr
s+ � �
�~�!�#�#� �F�F� #��
� �f�~�� c �4 � t t j � S r )�boolr �
_instances� r r �
_in_workerr s � ���!�!�"�"r c �p � � e Zd ZdZ d� fd� Zed� � Zd� Zd� Zd� Z d� Z
d� Zd � Z d
d
�Z
d� Z� xZS )�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.
c � �� t �| � di |�� |d u |d u z st d� �|| _ || _ d | _ || _ || _ | j � y )NzKPlease provide one of filesystem instance (fs) or target_protocol, not bothr ) �super�__init__�
ValueError�target_protocol�target_options�workerr �fs�_determine_worker)�selfr r r r �kwargs� __class__s �r r zDaskWorkerFileSystem.__init__! sk �� � ���"�6�"��d�
��$�6�7��-��
� /���,��������������� r c �J � t | � }d|v rd|v rd|d � d|d � �iS i S )N�host�portr �:r )�path�sos r �_get_kwargs_from_urlsz*DaskWorkerFileSystem._get_kwargs_from_urls1 s<