Skip to main content
Glama

ClickUp Operator

by noah-vh
mapping.cpython-312.pyc12.2 kB
� lMga ���ddlZddlZddlZddlZddlmZddlmZddlm Z ejd�Z Gd�de�Z d�Z d d �Zy) �N)�MutableMapping)�cached_property)� url_to_fszfsspec.mappingc��eZdZdZdd�Zed��Zd�Zdd�Zd�Z d�Z d �Z d �Z dd �Z dd �Zd �Zd�Zd�Zd�Zd�Zd�Zy)�FSMapa�Wrap a FileSystem instance as a mutable wrapping. The keys of the mapping become files under the given root, and the values (which must be bytes) the contents of those files. Parameters ---------- root: string prefix for all the files fs: FileSystem instance check: bool (=True) performs a touch at the location, to check for write access. Examples -------- >>> fs = FileSystem(**parameters) # doctest: +SKIP >>> d = FSMap('my-data/path/', fs) # doctest: +SKIP or, more likely >>> d = fs.get_mapper('my-data/path/') >>> d['loc1'] = b'Hello World' # doctest: +SKIP >>> list(d.keys()) # doctest: +SKIP ['loc1'] >>> d['loc1'] # doctest: +SKIP b'Hello World' Nc�*�||_|j|�|_|jtj|d��dd|_|�t ttf}||_ ||_ ||_ |r6|jj|�s|jj|�|rg|jj|�std|�d���|jj|dz�|jj!|dz�yy)N�x�����zPath z9 does not exist. Create with the ``create=True`` keywordz/a)�fs�_strip_protocol�root� posixpath�join�_root_key_to_str�FileNotFoundError�IsADirectoryError�NotADirectoryError�missing_exceptions�check�create�exists�mkdir� ValueError�touch�rm)�selfr r rrrs �ZC:\Users\noahv\Documents\GitHub\clickup-operator\.venv\Lib\site-packages\fsspec/mapping.py�__init__zFSMap.__init__)s�������&�&�t�,�� � "� 2� 2�9�>�>�$��3L� M�c�r� R��� � %�!�!�"�"� � #5����� ��� � ��7�7�>�>�$�'���� � �d�#� ��7�7�>�>�$�'� ��D�6�"8�9��� �G�G�M�M�$��+� &� �G�G�J�J�t�d�{� #� �c�J�ddlm}||j|j��S)z@dirfs instance that can be used with the same keys as the mapper�)� DirFileSystem)�pathr )�implementations.dirfsr"rr )rr"s r�dirfsz FSMap.dirfsBs�� 9��$�"7�"7�D�G�G�D�Drc���tjd|j� |jj |jd�|jj |j�y#YyxYw)z0Remove all keys below root - empties out mappingzClear mapping at %sTN)�logger�infor r rr�rs r�clearz FSMap.clearIsN��� � �)�4�9�9�5� � �G�G�J�J�t�y�y�$� '� �G�G�M�M�$�)�)� $�� � �s �A A.�.A2c ��|D�cgc]}|j|���}}|dk(r|nd} |jj||��}t|t�r|d|i}|j�D��cic](\}}|t||j �r t �n|��*}}}t||�D� � cic]#\} } |dk(st|| t�s| || ��%c} } Scc}w#|j $r }t |�d}~wwxYwcc}}wcc} } w)a�Fetch multiple items from the store If the backend is async-able, this might proceed concurrently Parameters ---------- keys: list(str) They keys to be fetched on_error : "raise", "omit", "return" If raise, an underlying exception will be raised (converted to KeyError if the type is in self.missing_exceptions); if omit, keys with exception will simply not be included in the output; if "return", all keys are included in the output, but the value will be bytes or an exception instance. Returns ------- dict(key, bytes|exception) �raise�return)�on_errorrN) � _key_to_strr �cat� isinstance�bytesr�KeyError�items�zip� BaseException) r�keysr.�k�keys2�oe�out�e�v�key�k2s r�getitemszFSMap.getitemsRs��(/3�3�d���!�!�!�$�d��3�!�W�,�X�(�� "��'�'�+�+�e�b�+�1�C��#�u�%��Q�x��o�� � � � � �#���1� �j��D�,C�,C�D�� �!� K�#� � � �t�U�+� �+���R��8�#�:�c�"�g�}�+M� ��R��L�+� � ��4�� �&�&� "��� !�� "�� �� s(�C�4C �0-C>�/(D� C;�/C6�6C;c��|j�D��cic] \}}|j|�t|���"}}}|jj |�ycc}}w)z�Set the values of multiple items in the store Parameters ---------- values_dict: dict(str, bytes) N)r4r/� maybe_convertr �pipe)r� values_dictr8r=�valuess r�setitemszFSMap.setitemsxsT��EP�DU�DU�DW�X�DW�D�A�q�$�"�"�1�%�}�Q�'7�7�DW��X� ��� � �V���Ys�%Ac�~�|jj|D�cgc]}|j|���c}�ycc}w)z#Remove multiple keys from the storeN)r rr/)rr7r8s r�delitemszFSMap.delitems�s/�� ��� � ��6��A�D�$�$�Q�'��6�7��6s�:c���t|t�s@tjdt�t|t �r t |�}t|�}|j�|��jd�S)zGenerate full path for the keyzAfrom fsspec 2023.5 onward FSMap non-str keys will raise TypeError�/) r1�str�warnings�warn�DeprecationWarning�list�tupler�rstrip)rr>s rr/zFSMap._key_to_str�s]���#�s�#� �M�M�S�"� ��#�t�$��C�j���c�(�C��'�'�(���.�5�5�c�:�:rc�P�|t|j�djd�S)zStrip path of to leave key nameNrJ)�lenr �lstrip)r�ss r� _str_to_keyzFSMap._str_to_key�s#����T�Y�Y��!�"�)�)�#�.�.rc��|j|�} |jj|�}|S#|j$r}|�|cYd}~St |�|�d}~wwxYw)z Retrieve dataN)r/r r0rr3)rr>�defaultr8�result�excs r� __getitem__zFSMap.__getitem__�s^�� � � �S� !�� )��W�W�[�[��^�F� � �� �&�&� )��"����3�-�S� (�� )�s �0�A�A�A� A�Ac�R�|j||�} ||=|S#t$rY|SwxYw)zPop data)r[r3)rr>rXrYs r�popz FSMap.pop�s@���!�!�#�w�/�� ��S� �� ��� � �� � �s �� &�&c���|j|�}|jj|jj|�d��|jj |t |��y)zStore value in keyT)�exist_okN)r/r �mkdirs�_parent� pipe_filerB)rr>�values r� __setitem__zFSMap.__setitem__�sL�����s�#�� �����t�w�w���s�+�d��;� �����#�}�U�3�4rc�`���fd��jj�j�D�S)Nc3�@�K�|]}�j|����y�w�N)rV)�.0r rs �r� <genexpr>z!FSMap.__iter__.<locals>.<genexpr>�s�����E�-D��� � ��#�-D�s�)r �findr r)s`r�__iter__zFSMap.__iter__�s���E�T�W�W�\�\�$�)�)�-D�E�Erc�^�t|jj|j��Srg)rSr rjr r)s r�__len__z FSMap.__len__�s���4�7�7�<�<�� � �*�+�+rc�� |jj|j|��y#t$r }t|�d}~wwxYw)z Remove keyN)r rr/� Exceptionr3)rr>rZs r� __delitem__zFSMap.__delitem__�s:�� $� �G�G�J�J�t�'�'��,� -��� $��� #�� $�s�*-� A�=�Ac�Z�|j|�}|jj|�S)zDoes key exist in mapping?)r/r �isfile)rr>r#s r� __contains__zFSMap.__contains__�s%������$���w�w�~�~�d�#�#rc�X�t|j|jdd|jffS)NF)rr r rr)s r� __reduce__zFSMap.__reduce__�s&���t�y�y�$�'�'�5�%��9P�9P�Q�Q�Qr)FFN)r,rg)�__name__� __module__� __qualname__�__doc__rrr%r*r@rFrHr/rVr[r]rdrkrmrprsru�rrrr sk���6$�2�E��E� �$ �L�8� ;�/� ��5� F�,�$�$� Rrrc���t|tj�s t|d�rIt|d�r)|jjdvr|j d�}t t|��}|S)N� __array__�dtype�Mm�int64)r1�array�hasattrr}�kind�viewr2� memoryview)rcs rrBrB�sX���%����%��� �)D� �5�'� "�u�{�{�'7�'7�4�'?��J�J�w�'�E��j��'�(�� �Lrc �L�t|fi|��\}}|�|n|}t|||||��S)a�Create key-value interface for given URL and options The URL will be of the form "protocol://location" and point to the root of the mapper required. All keys will be file-names below this location, and their values the contents of each key. Also accepts compound URLs like zip::s3://bucket/file.zip , see ``fsspec.open``. Parameters ---------- url: str Root URL of mapping check: bool Whether to attempt to read from the location before instantiation, to check that the mapping does exist create: bool Whether to make the directory corresponding to the root before instantiating missing_exceptions: None or tuple If given, these exception types will be regarded as missing keys and return KeyError when trying to read data. By default, you get (FileNotFoundError, IsADirectoryError, NotADirectoryError) alternate_root: None or str In cases of complex URLs, the parser may fail to pick the correct part for the mapper root, so this arg can override Returns ------- ``FSMap`` instance, the dict-like key-value store. )r)rr) �urlrrr�alternate_root�kwargsr �urlpathr s r� get_mapperr��s8��N�C�*�6�*�K�B��+�7�>�W�D� ��r�5�&�=O� P�Pr)�FFNN)r��loggingrrL�collections.abcr� functoolsr� fsspec.corer� getLoggerr'rrBr�rzrr�<module>r�sZ�� ����*�%�!� �� � �+� ,��wR�N�wR�t� � � ��� )Qr

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/noah-vh/mcp-server-clickup'

If you have feedback or need assistance with the MCP directory API, please join our Discord server