Skip to main content
Glama

ClickUp Operator

by noah-vh
asyn.cpython-312.pyc45.8 kB
� lMg����>�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z ddl mZmZddlmZddlmZddlmZmZmZdd lmZmZdd lmZmZmZej>d �Z dgZ!dgZ"da#ejHZ$d �Z%d �Z&d&d�Z'dd�d�Z(d&d�Z)e d��Z*d�Z+erddl,Z,e,jZZ.n ddl,Z,e/e,de0�Z.dZ2dZ3d'd�Z4de5fd�Z6dedddfd�Z7gd�Z8Gd�de�Z9d�Z:Gd �d!e;�Z<d"d"e<dfd#�Z=Gd$�d%e�Z>y#e1$rdZ,e0Z.Y�SwxYw)(�N)�contextmanager)� has_magic)� TYPE_CHECKING�Iterable�)�DEFAULT_CALLBACK)�FSTimeoutError)�LocalFileSystem�make_path_posix� trailing_sep)�AbstractBufferedFile�AbstractFileSystem)�glob_translate� is_exception� other_pathsz_[^_]c�B�tstj�atS)zAllocate or return a threading lock. The lock is allocated on first use to allow setting one lock per forked process. )�_lock� threading�Lock���WC:\Users\noahv\Documents\GitHub\clickup-operator\.venv\Lib\site-packages\fsspec/asyn.py�get_lockrs�� ���� �� �Lrc�,�dtd<dtd<day)z�Reset the global lock. This should be called only on the init of a forked process to reset the lock to None, enabling the new forked process to get a new lock. Nr)�iothread�looprrrr� reset_lockr&s���H�Q�K��D��G� �Erc���K�|r|nd}|�tj||��} |�d{���|d<|j�y7�#t$r}||d<Yd}~�&d}~wwxYw#|j�wxYw�w)N��timeoutr)�asyncio�wait_for� Exception�set)�event�coro�resultr �exs r�_runnerr)3sk���� �g�d�G�������g�6����J��q� � � � � � �� ����q� ���� � � � �sI� A3�A�A�A�A3�A� A� A�A�A�A�A0�0A3rc��|r|nd}|�|j�r td�� tjj �}||ur t d�� ||i|��}dg}t j�}tjt||||�|� |jd�rn|�|dz}|dkrt��%|d} t| tj�rt| �t| t�r| �| S#t $r�t$rY��wxYw)z� Make loop run coroutine until it returns. Runs in other thread Examples -------- >>> fsspec.asyn.sync(fsspec.asyn.get_loop(), func, *args, timeout=timeout, **kwargs) NzLoop is not runningz)Calling sync() from within a running looprr)� is_closed� RuntimeErrorr!�events�get_running_loop�NotImplementedErrorr�Event�run_coroutine_threadsafer)�waitr � isinstance� TimeoutError� BaseException) r�funcr �args�kwargs�loop0r&r'r%� return_results r�syncr;?s!��!�g�d�G� �|�t�~�~�'��0�1�1� ����/�/�1�� �D�=�%�&Q�R� R� � �� �� �D��V�F� �O�O� �E� �$�$�W�U�D�&�'�%J�D�Q� � �:�:�a�=� � � � �q�L�G���{�$�$� ��1�I�M��-��!5�!5�6��-�/� �M�=� 1������1 �� � � � � �s�-C4�4D �D c�F���tj����fd��}|S)z�Given a function, make so can be called in blocking contexts Leave obj=None if defining within a class. Pass the instance if attaching as an attribute of the instance. c�J���xs|d}t|j�g|��i|��S)Nr)r;r)r7r8�selfr6�objs ��r�wrapperzsync_wrapper.<locals>.wrapperss+����~�d�1�g���D�I�I�t�5�d�5�f�5�5r)� functools�wraps)r6r?r@s`` r� sync_wrapperrCls'����_�_�T��6��6� �Nrc#�0K�tj�} tjdk(r7t td�r'tj tj ��d��tj |�y#tj |�wxYw�w)N�nt�WindowsSelectorEventLoopPolicy)r!�get_event_loop_policy�os�name�hasattr�set_event_loop_policyrF)�original_policys r�_selector_policyrM{sd�����3�3�5�O�7� �7�7�d�?�w�w�0P�Q� � )� )�'�*P�*P�*R� S� ��%�%�o�6���%�%�o�6�s�B�AA<�&B�<B�Bc��td��t�5td�vt�5tj�td<ddd�t j tdjd��}d|_|j�|td<ddd�tdStdS#1swY�kxYw#1swYtdSxYw)zdCreate or return the default fsspec IO loop The loop will be running on a separate thread. rN�fsspecIO)�targetrIT) rrrMr!�new_event_loopr�Thread� run_forever�daemon�startr)�ths r�get_looprW�s���  �A�w�� �Z��A�w��%�'�%�4�4�6�D��G�(��%�%�T�!�W�-@�-@�z�R�� �� ���� � ��� �� ��7�N�4��7�N� (�'�� � ��7�N�s#�B:�B.�AB:�.B7 �3B:�:C �error�iFc��ddlm}|r d|vr|dSd|vr|dS|rtSt�tS tj tj �\}}|tjk(ry|dzS#tttf$r tcYSwxYw)Nr)�conf�nofiles_gather_batch_size�gather_batch_size������) � fsspec.configr[�_NOFILES_DEFAULT_BATCH_SIZE�resource�_DEFAULT_BATCH_SIZE� getrlimit� RLIMIT_NOFILE� ImportError� ValueError� ResourceError� RLIM_INFINITY)�nofilesr[� soft_limit�_s r�_get_batch_sizerm�s���"�� &�$� .��3�4� 4� �$� &��+�,� ,��*�*���"�"�#� �*�*�8�+A�+A�B� � �A��X�+�+�+���Q���� ��]� 3�#�"�"�#�s�&A/�/B � B �returnc�L� tj�y#t$rYywxYw)z Being executed by an event loop?TF)r!r.r,rrr� running_asyncrp�s(���� � �"��� ����s �� #�#c��6���K�|� t|��}|dk(r t|�}|dkDsJ����fd�}d}t|�}dg|z} t�} | s||kr�t| �|krL||krG| jt j ||||���|dz }t| �|kr||kr�G| s | St j | tj���d{���\} } | r#| j��d{���\} } | | | <| r�#| r��||kr��| S7�77��w)aSRun the given coroutines in chunks. Parameters ---------- coros: list of coroutines to run batch_size: int or None Number of coroutines to submit/wait on simultaneously. If -1, then it will not be any throttling. If None, it will be inferred from _get_batch_size() callback: fsspec.callbacks.Callback instance Gets a relative_update when each coroutine completes timeout: number or None If given, each coroutine times out after this time. Note that, since there are multiple batches, the total run time of this function will in general be longer return_exceptions: bool Same meaning as in asyncio.gather nofiles: bool If inferring the batch_size, does this operation involve local files? If yes, you normally expect smaller batches. N)rjr^rc����K� tj|����d{���|f�jd�S7�#t$r"}�s�||fcYd}~�jd�Sd}~wwxYw#�jd�wxYw�w)Nrr)r!r"�relative_updater#)r&�i�e�callback�return_exceptionsr s ���r� _run_coroz'_run_coros_in_chunks.<locals>._run_coro�sw����� (� �)�)�$��@�@�!�C� � $� $�Q� '� A��� �$���a�4�K� � $� $�Q� '��  �� � $� $�Q� '�sO�A=�9�7�9�A=�9� A$�A�A$� A'� A=�A$�$A'�'A:�:A=r)� return_when) rm�lenr$�addr!� ensure_futurer2�FIRST_COMPLETED�pop)�coros� batch_sizervr rwrjrxrt�n�results�pending�doner'�ks ``` r�_run_coros_in_chunksr��s$�����<��$�W�5� ��R����Z� � ��>��>�(� �A� �E� �A��f�q�j�G��e�G� �Q��U��'�l�Z�'�A��E� �K�K��-�-�i��a��!�.D�E� F� ��F�A��'�l�Z�'�A��E�� � �N� &�l�l�7��@W�@W�X�X� ��g��"�h�h�j�(�I�F�A��G�A�J�� �Q��U� �N� Y��(�s<�B*D�0-D�D�D�:D�;D� D� D�D�D)�_ls� _cat_file� _get_file� _put_file�_rm_file�_cp_file� _pipe_file� _expand_path�_info�_isfile�_isdir�_exists�_walk�_glob�_find�_du�_size�_mkdir� _makedirsc�>��eZdZdZdZdZdZdddd��fd� Zed��Z d�Z d&d �Z d �Z d �Z d'd �Zd �Zd(d�Zd�Zd(d�Z d)d�Z d*d�Zd�Zdeddfd�Zd�Zdedfd�Zd�Zd�Zd�Zd+d�Zd�Zd�Zd,d�Z d-d�Z!d+d�Z"d.d �Z#d/d!�Z$d&d"�Z%d,d#�Z&d0d$�Z'd1d%�Z(�xZ)S)2�AsyncFileSystemakAsync file operations, default implementations Passes bulk operations to asyncio.gather for concurrent operation. Implementations that have concurrent batch operations and/or async methods should inherit from this class instead of AbstractFileSystem. Docstrings are copied from the un-underscored method in AbstractFileSystem, if not given. TFN)� asynchronousrr�c���||_tj�|_|s|xs t �|_nd|_||_t�|� |i|��y�N) r�rH�getpid�_pidrW�_loopr��super�__init__)r>r�rr�r7r8� __class__s �rr�zAsyncFileSystem.__init__;sI���(����I�I�K�� ���+���D�J��D�J�$��� ���$�)�&�)rc�r�|jtj�k7r td��|jS)NzThis class is not fork-safe)r�rHr�r,r��r>s rrzAsyncFileSystem.loopEs*�� �9�9�� � � � #��<�=� =��z�z�rc��K�t��wr��r/�r>�pathr8s rr�zAsyncFileSystem._rm_fileK� ����!�!��� c ���K�|xs |j}|j||���d{���}tt|�D�cgc]}|j|fi|����c}|d���d{���S7�Bcc}w7� �w)N�� recursiveT�r�rj)r�r�r��reversedr�)r>r�r�r�r8�ps r�_rmzAsyncFileSystem._rmNsx�����2�4�?�?� ��&�&�t�y�&�A�A��)�19�$�� @��A�]�T�]�]�1� '�� '�� @�!�� � � �B�� @� �s-�'A5�A,�A5�A.� A5�'A3�(A5�.A5c��K�t��wr�r�)r>�path1�path2r8s rr�zAsyncFileSystem._cp_fileXr�r�c��zK�|j||��d{���|j|��d{���y7�7��wr�)r�r�)r>r�r�s r�_mv_filezAsyncFileSystem._mv_file[s5�����m�m�E�5�)�)�)��m�m�E�"�"�"� *��"�s�;�7�;�9�;�;c ��K�|�|rd}n|�d}t|t�rt|t�r|}|} n�t|t�} |j|||���d{���}| r<|r|�8|D� cgc]*} t | �r�|j | ��d{���r�)| ��,}} |syt |�dk(} t|t�xr&t |�xs|j |��d{���} | xr/t|�xr| xst|� xr| xr t |� }t|||| ��} |xs |j}t|| �D��cgc]\}}|j||fi|����}}}t||dd���d{���}tt|�D]}|dk(rt|t�r�|�y7��P7��cc} w7��cc}}w7�D�w)N�ignore�raise)�maxdepthr�r��exists�flattenT)r�rwrj)r3�list�strr�r r�rzrrr��zipr�r��filterr�FileNotFoundError)r>r�r�r��on_errorr�r�r8�paths1�paths2� source_is_strr��source_is_file� dest_is_dirr��p1�p2rr'r(s r�_copyzAsyncFileSystem._copy_s����� � � ��H� � ��H� �e�T� "�z�%��'>��F��F�&�u�c�2�M��,�,���I�-���F��i�8�3G� &��%�!�l�1�o�t�{�{�ST�~�AU�AU�A�v����� ��[�A�-�N�$�U�C�0���U�#�?�T�[�[��-?�'?� �#���5�!�4�n�V�!�%�(�(�T�[�T��e�AT�=T� �!����)�)� �F� �2�4�?�?� �?B�6�6�?R�S�?R�V�R������r�2�0��0�?R��S�+� �j�D�$� � ����v�.�B��8�#� �2�7H�(I���H�/�C�� BV���(@��T� �sn�AF?�F*�F?�)F0�:F0�F- �F0�F0�AF?�F5�A&F?�F7�#F?�8F=�92F?�-F0�0F?�7F?c��K�t��wr�r�)r>r��valuer8s rr�zAsyncFileSystem._pipe_file�r�r�c ���K�t|t�r||i}|xs |j}t|j �D��cgc]\}}|j ||fi|����c}}|d���d{���Scc}}w7� �w)NTr�)r3r�r�r��itemsr�)r>r�r�r�r8r��vs r�_pipezAsyncFileSystem._pipe�su���� �d�C� ��%�=�D��2�4�?�?� �)�9=���� F����A�_�T�_�_�Q�� ,�V� ,�� F�!�� � � �� F� �s�=A8�A0 �A8�+A6�, A8c��HK�d}d}|�5|dkr0|�| }d}d}n*|xs|j|��d{���d}||z}n|�d}|sR|�-|dkr(|�*|xs|j|��d{���d}||z}n|�d}t|tj�r|dz}d|�d |��S7�m7�:�w) z"Helper for "Range"-based _cat_fileNFr�T�sizerzbytes=�-)r�r3�numbers�Integral)r>�urlrU�endr��suffs r�_process_limitszAsyncFileSystem._process_limits�s��������� � �����{��f�������>�d�j�j��o� 5�v�>���u� �� �]��E����3��7��$��B�$�*�*�S�/�$9�6�#B�D���*�C������#�w�/�/�0��q�����w�a��u�%�%�!6��%:�s!�.B"�B�4B"�%B �&9B"� B"c��K�t��wr�r�)r>r�rUr�r8s rr�zAsyncFileSystem._cat_file�r�r�c��K�|j||���d{���}|D�cgc]}|j|fi|����}}|xs |j}t||dd���d{���}|dk(rt t t |�d�} | r| �t|�dkDs'tt�s|d|j|�k7r0t||�D� � cic]\} } |dk7s t | �s| | ��c} } S|dS7��cc}w7��cc} } w�w) Nr�T�r�rjrwr�Frr�omit) r�r�r�r��nextr�rrzr3r��_strip_protocolr�) r>r�r�r�r�r8�pathsr�outr(r�r�s r�_catzAsyncFileSystem._cat�s�����'�'�� �'�B�B��<A�B�E�D������/��/�E��B��2�4�?�?� �(� �j�$�$� � �� �w� ��f�\�3�/��7�B���� ��J��N��$��%��Q�x�4�/�/��5�5� ��s�O��+�D�A�q��v�%�\�!�_��1��+�� � �q�6�M�+C��B� ���s>�D�C2�D�C4�$D� C9�!A+D� C;�) D�4D�;Dc ���K�|�t�t|t�st�t|t�s|gt |�z}t|t�s|gt |�z}t |�t |�k7st |�t |�k7rt �t|||�D�� � cgc]\}} } |j|f| | d�|����} } }} |xs |j}t| |dd���d{���Scc} } }w7� �w)aYGet the contents of byte ranges from one or more files Parameters ---------- paths: list A list of of filepaths on this filesystems starts, ends: int or list Bytes limits of the read. If using a single int, the same value will be used to read all the specified files. N)rUr�Tr�) r/r3r�� TypeErrorrrzrgr�r�r�r�) r>r��starts�ends�max_gapr�r�r8r��srurs r� _cat_rangeszAsyncFileSystem._cat_ranges�s�����* � �%� %��%��&��O��&�(�+��X��E� �*�F��$��)��6�C��J�&�D� �v�;�#�e�*� $��D� �S��Z�(?�� ��u�f�d�3� �3���1�a� �D�N�N�1� 7�A�1� 7�� 7�3� � � �2�4�?�?� �)� �j�$�$� � � ��  �  �s�B"C9�$!C0�&C9�+C7�, C9c��K�t��wr�r�)r>�lpath�rpathr8s rr�zAsyncFileSystem._put_filer�r�c ��K�t|t�rt|t�r|}|} �n t|t�} | r t|�}t �} | j |||��} | r4|r|�0| D� cgc]"} t | �r�| j| �r�!| ��$} } | syt| �dk(} t|t�xr&t |�xs|j|��d{���}|j|�}| xr/t|�xr| xst|� xr|xr t |� }t| ||| ��}| D�cic]"}|tjj|���$}}t| |�D��cgc] \}}||s� |��}}}t| |�D��cgc]\}}||r� ||f��}}}t!j"|D�cgc]}|j%|d����c}��d{���|xs |j&}g}|j)t|��|D]9\}}|j+|j,�}|j/|||fi|����;t1|||���d{���Scc} w7���cc}wcc}}wcc}}wcc}w7��7�$�w)a�Copy file(s) from local. Copies a specific file or tree of files (if recursive=True). If rpath ends with a "/", it will be assumed to be a directory, and target files will go within. The put_file method will be called concurrently on a batch of files. The batch_size option can configure the amount of futures that can be executed at the same time. If it is -1, then all the files will be uploaded concurrently. The default can be set for this instance by passing "batch_size" in the constructor, or for all instances by setting the "gather_batch_size" key in ``fsspec.config.conf``, falling back to 1/8th of the system limit . �r�r�Nrr�T��exist_ok�r�rv)r3r�r�r r � expand_pathr �isdirrzr�r�rrrHr�r�r!�gatherr�r��set_size� branch_coror��appendr�)r>r�r�r�rvr�r�r8�rpaths�lpathsr��fsr�r�r�r��l�is_dir�r�rdirs� file_pairs�dr�lfile�rfile�put_files r�_putzAsyncFileSystem._put s|����. �e�T� "�z�%��'>��F��F�&�u�c�2�M��'��.�� �"�B��^�^�E�Y��^�R�F��i�8�3G�%+�T�V��L��O�r�x�x�PQ�{�!�V��T��� ��[�A�-�N�$�U�C�0���U�#�?�T�[�[��-?�'?� ��(�(��/�E�"���5�!�4�n�V�!�%�(�(�T�[�T��e�AT�=T� �!����)�)� �F�06�6�v�!�!�R�W�W�]�]�1�%�%�v��6�"�6�6�2�@�2�t�q�!�f�Q�i��2��@�),�V�V�)<�N�)<���A�F�1�I�q�!�f�)<� �N��n�n��O��A�t�~�~�a�$�~�?��O�P�P�P��2�4�?�?� ������#�j�/�*�&�L�E�5��+�+�D�N�N�;�H� �L�L��%��9�&�9� :�'�*� �j�8� � � ��EU� (@��7��@��N��O�P�� �s��A,J�.I$�?I$�I$�AJ�I)�AJ�8'I,�J�0 I1�>I1�J� I7�"I7�(J�>I=�J�J� A?J�J� J�,J�Jc��K�t��wr�r�)r>r�r�r8s rr�zAsyncFileSystem._get_fileUr�r�c��TK�t|t�rt|t�r|}|}�nt|t�} | xr t|� } |j |�}|j |||���d{���}| r<|r|�8|D� cgc]*} t| �r�|j | ��d{���r�)| ��,}} |syt|�}t|�dk(} t|t�xr&t|�xst�j|�} | xr%t|�xr| xst|� xr| xr| }t|||| ��}|D�cgc]6}tjtjj!|�d����8c}|j#d|j$�}g}|j't|��t)||�D]9\}}|j+|j,�}|j/|||fi|����;t1|||���d{���S7���7��tcc} wcc}w7��w) aCopy file(s) to local. Copies a specific file or tree of files (if recursive=True). If lpath ends with a "/", it will be assumed to be a directory, and target files will go within. Can submit a list of paths, which may be glob-patterns and will be expanded. The get_file method will be called concurrently on a batch of files. The batch_size option can configure the amount of futures that can be executed at the same time. If it is -1, then all the files will be uploaded concurrently. The default can be set for this instance by passing "batch_size" in the constructor, or for all instances by setting the "gather_batch_size" key in ``fsspec.config.conf``, falling back to 1/8th of the system limit . r�Nrr�Tr�r�r�)r3r�r�r r�r�r�r rzr r�rrrH�makedirsr��dirnamer~r�r�r�r�r�r�r�)r>r�r�r�rvr�r8r�r�r��source_not_trailing_sepr�r�r�r��lpr�r�get_files r�_getzAsyncFileSystem._getXs-����. �e�T� "�z�%��'>��F��F�&�u�c�2�M�&3�&O�L��<O�8O� #��(�(��/�E��,�,���X�-���F��i�8�3G� &��%�!�l�1�o�t�{�{�ST�~�AU�AU�A�v�����#�E�*�E� ��[�A�-�N�$�U�C�0���U�#�E��'8�'>�'>�u�'E� �#���5�!�4�n�V�!�%�(�(�T�[�T�=T� �!����)�)� �F�DJ�J�6�R����R�W�W�_�_�R�(�4� 8�6�J��Z�Z� �d�o�o�>� ������#�f�+�&����/�L�E�5��+�+�D�N�N�;�H� �L�L��%��9�&�9� :�0�*� �j�8� � � �I�� BV����. K� �s\�A/H(�1H�2H(�H�H�%H �&H�+H�/BH(�;H!�=BH(�H&�H(�H� H(c��\K� |j|��d{���ddk(S7� #YyxYw�w)N�type�fileF)r��r>r�s rr�zAsyncFileSystem._isfile�s3���� ��*�*�T�*�*�F�3�v�=� =�*�� ��s �,�%�#� %�,�%�)�,c��lK� |j|��d{���ddk(S7� #t$rYywxYw�w)Nr� directoryF)r��OSErrorrs rr�zAsyncFileSystem._isdir�s;���� ��*�*�T�*�*�F�3�{�B� B�*��� �� �s(�4�%�#� %�4�%� 1�4�1�4c��`K�|j|��d{���jdd�S7��w)Nr�)r��getrs rr�zAsyncFileSystem._size�s(�����j�j��&�&�+�+�F�D�9�9�&�s �.�,�.c��K�|xs |j}t|D�cgc]}|j|���c}|���d{���Scc}w7� �w)N)r�)r�r�r�)r>r�r�r�s r�_sizeszAsyncFileSystem._sizes�sJ�����2�4�?�?� �)�$)� *�E�q�T�Z�Z��]�E� *�z� � � �� *� �s�A �A� A �A � A c��fK� |j|fi|���d{���y7�#t$rYywxYw�w)NTF)r�r�r�s rr�zAsyncFileSystem._exists�s=���� ��$�*�*�T�,�V�,� ,� ,�� -�� � �� �s(�1�"� �"�1�"� .�1�.�1c��K�t��wr�r�r�s rr�zAsyncFileSystem._info�r�r�c��K�t��wr�r�)r>r��detailr8s rr�zAsyncFileSystem._ls�r�r�c ��K�|�|dkr td��|j|�}i}i}i}|jdd�} |j|fddi|���d{���} | D]S} | djd�} | jdd�d } | d d k(r| |k7r | || <| || <�D| |k(r| |d <�O| || <�U|r |||f���n|t|�t|�f���|� |dz}|dkry|D])}|j||f||d �|��23d{���}|����y7��#tt f$r6} |dk(r�t |�r|| �|r |iif���n|ggf���Yd} ~ yd} ~ wwxYw7�V6�{�w)Nr�maxdepth must be at least 1rFTr�rI�/r^rrr�)r�r) rgr�r~r�r�r�callable�rstrip�rsplitr�r�)r>r�r�r�r8� full_dirs�dirs�filesr�listingru�info�pathnamerIrrls rr�zAsyncFileSystem._walk�s����� � �H�q�L��:�;� ;��#�#�D�)��� ��������H�e�,�� �$�D�H�H�T�A�$�A�&�A�A�G��D��F�|�*�*�3�/�H��?�?�3��*�2�.�D��F�|�{�*�x�4�/?�"*� �$��!��T� ��T�!� ��b� �"��d� �� ���e�#� #���T� �D��K�/� /� � � ��M�H��!�|���A�%�4�:�:��!� ��'/���BH�� �a��� �KB��!�7�+� ��7�"���(�#��� ���B��l�"��B��l�"� �� ��J ���se�<E#�D�D�D�B(E#�E!�E� E!� E#�D�E�&,E�E#�E�E#�E!�!E#c��K�|�|dkr td��ddl}tjjr4tjj tjjfntjj f}|j |�}|j|�}|xs!|j td�|D���}|jd�dk\r|jd�n t|�}|jd�dk\r|jd�n t|�} |jd�dk\r|jd�n t|�} t|| | �} |jdd �} t|�sC|j|fi|���d{���r"| s|gS||j|fi|���d{���iS| sgSiSd |d| vr7|d| j!d �} |d| dz} || dzdj#d �dz}nd } || dzdj#d �dz}d |vr5|�1|jd �}||dj#d �dz}||z |z}nd}|j$| f|d d d�|���d{���}t'||rd nd z�}|j(|�}t+|j-��D��cic](\}}|j/|r |ddk(r|d zn|�r||��*}}}| r|St1|�S7��^7��@7��cc}}w�w)Nrr!rc3�&K�|] }|dz��� y�w)�**Nr)�.0�seps r� <genexpr>z(AsyncFileSystem._glob.<locals>.<genexpr>s����-���#��*��s��*�?�[rFr"r�r.T)r��withdirsrrr)rg�rerHr��altsepr0�endswithr��tuple�findrz�minr~rr�r��rindex�countr�r�compile�sortedr��matchr�)r>r�r�r8r6�seps� ends_with_sep�append_slash_to_dirname�idx_star� idx_qmark� idx_brace�min_idxr�root�depth�idx_double_stars�depth_double_stars�allpaths�patternr�r*r�s rr�zAsyncFileSystem._glob�s���� � �H�q�L��:�;� ;��02�������� � �R�W�W�^�^�,�R�W�W�[�[�N��� � �d�+� ��#�#�D�)��"/�# �4�=�=� �-��-� -�4 ��&*�Y�Y�s�^�q�%8�4�9�9�S�>�c�$�i��&*�i�i��n��&9�D�I�I�c�N�s�4�y� �&*�i�i��n��&9�D�I�I�c�N�s�4�y� ��h� �9�5�����H�e�,�����!�T�\�\�$�1�&�1�1�1�� �6�M� � �� � �4�(B�6�(B�"B�C�C���I��I� �D��'�N� "��8�G�n�+�+�C�0�G�� �'�A�+�&�D���1���'�-�-�c�2�Q�6�E��D���1���'�-�-�c�2�Q�6�E� �4�<��#�#'�9�9�T�?� �%)�*:�*;�%<�%B�%B�3�%G�!�%K�"�� 2�2�X�=����#���� � � �4�� �@F� � ��!�� ��2�!F�G���"�*�*�W�%��"�(�.�.�"2�3�  �3���4��}�}�/�4��<�;�3N���G�� � �t�G�3� �  � ��J���9� �a2��#C��, ��  �sJ�FL�K7� L�:K:�;B8L�3K=�4AL�8-K?�%L�:L�=L�?Lc���K�i}|j|fd|i|���d{���D]&}|j|��d{���}|d||d<�(|rt|j��S|S7�J7�0�w)Nr�r�rI)r�r��sum�values)r>r��totalr�r8�sizes�fr*s rr�zAsyncFileSystem._du@sx������!�t�z�z�$�D��D�V�D�D�D�A����A��&�D�"&�v�,�E�$�v�,� �E� ��u�|�|�~�&� &��L� E��&�s�A,�A(�A,�A*�/A,�*A,c ��RK�|j|�}i}|jdd�}|r:|dk7r5|j|��d{���r|j|��d{���||<|j||fddi|��23d{���\}}} |r| j |�|j | j �D� � cic] \} } | d| �� c} } ��W7��7�v7�Vcc} } w6|s|j|��d{���7ri||<t|�} |s| S| D� cic]} | || �� c} Scc} w�w)NrFr�TrI) r�r~r�r�r��updater�r�r?) r>r�r�r5r8r�rrlr'r(rIr*�namess rr�zAsyncFileSystem._findKs1�����#�#�D�)�������H�e�,�� ��� �T�[�[��->�'>�'>�"�j�j��.�.�C��I�%/�D�J�J�t�X�$U�d�$U�f�$U� M�.�!�T�5��� � �T�"� �J�J�U�[�[�]�K�]�z�t�T��V� �d�*�]�K� L�(?��.�� M��L�%V��d�l�l�4�0�0�0��C��I��s� ����L�05�6���D�#�d�)�O��6� 6��6�sl�AD'�C�D'�C�D'�:C�>C�?C�6D'�8C � D'�D'�C�D'�4C7�5D'� D"�D'c ���K�|�|dkr td��t|t�r|j|g||��d{���}�nt �}|D�cgc]}|j |���}}|D]�}t |�rlt |j||���d{����}||z}|r@|�|dkr�A|t |jt|�||�|dz nd���d{����z}�z|r*t |j||d���d{����}||z}||vs��|dus|j|��d{���s��|j|���|s t|��t|�S7��%cc}w7��7��7�g7�>�w)Nrr!)r�r�T)r�r5F)rgr3r�r�r$r�rr�r�r�r�r{r�r?)r>r�r�r�r�r��bit�recs rr�zAsyncFileSystem._expand_pathds����� � �H�q�L��:�;� ;� �d�C� ��)�)�4�&�)�X�F�F�C��%�C�59�:�T��D�(�(��+�T�D�:����Q�<��D�J�J�q�8�J�$D�D�E�C��3�J�C� �$�/�H��M�$��s�"&�"3�"3� $�S� �*3�9A�9M��A��SW�#4�#�� ������D�J�J�q�8�d�J�$S�S�T�C��3�J�C��C�<�Y�%�%7�$�,�,�q�/�<Q�<Q��G�G�A�J�/�0�#�D�)� )��c�{��=G��;�E����T��<Q�sp�:E1�E!�E1�E$�)-E1�E) �AE1�E+ �)E1�E- �E1�E1�0E/�1E1�6,E1�$E1�+E1�-E1�/E1c�� K�y�wr�r)r>r��create_parentsr8s rr�zAsyncFileSystem._mkdir�� ���� ���c�� K�y�wr�r)r>r�r�s rr�zAsyncFileSystem._makedirs�r\r]c��LK�d|vs|jd�rt�t��w)N�b� compression)rrgr/)r>r��moder8s r� open_asynczAsyncFileSystem.open_async�s$���� �d�?�f�j�j��7�� �!�!�s�"$)FN)FNNN)NN)Fr�N)NNrnr�)T)Nr�)TN)NF�F)�rb)*�__name__� __module__� __qualname__�__doc__� async_impl�mirror_sync_methods�disable_throttlingr��propertyrr�r�r�r�r�r�r�r�r�r�r�r�rrr�rr�r�r�rr�r�r�r�r�r�r�r�r�r�rc� __classcell__)r�s@rr�r�*s�����J�����+0�t��*����� "� �"�#�����:�x"� �&�4"�CG��>���' �R"��!���H �T"��!�� G �R� � :� � �"�"�4�lE�N �7�2#�J � �"rr�c���ddlm}ttt�zD]�}|j d�s�|dd}t j|�s�0tjt||d��}tt||d�dd�}|t||d�u}|s�z|s�}tt||�|� �}t|||�|jr��tt||d�d d�|_ ��y) a,Populate sync and async methods for obj For each method will create a sync version if the name refers to an async method (coroutine) and there is no override in the child class; will create an async method for the corresponding sync method if there is no implementation. Uses the methods specified in - async_methods: the set that an implementation is expected to provide - default_async_methods: that can be derived from their sync version in AbstractFileSystem - AsyncFileSystem: async-specific default coroutines r)rrlrNF�__func__r�)r?ri)�fsspecr� async_methods�dirr�� startswith�privater@�inspect�iscoroutinefunction�getattrrC�setattrri)r?r�method�smethod�isco�unsync� is_default�mths rrkrk�s���*��#�o�"6�6��� � ��%� ����*�� �=�=�� ��.�.�w�s�F�D�/I�J�D��W�S�'�5�9�:�t�L�F��7�+=�w��#K�K�J�� �"�7�3��#7�S�A����W�c�*��{�{�")�� 2�G�T�B�I�r�#�C�K�7rc� �eZdZy)�FSSpecCoroutineCancelN)rfrgrhrrrr�r��s��rr�Tc ��ddl}tjjtd�D�cgc]}|j �r�|��}}|r|D�cgc]}|j ���c}|D�cgc]�}|jjj|jjjj|jjjj|jjj|j|jj�|r|ndd����}}|r�|D]�}|j} |j!�tj"j$j'||�tj"j$j!|�| D� cgc] } | d|���c}  |jj)|���|Scc}wcc}wcc}wcc} w#|$rY��wxYw)Nr)�localsr� firstline�linelo�stack�task)� tracebackr!�tasks� all_tasksrr�� print_stack�_coro�cr_frame�f_locals�f_code� co_filename�co_firstlineno�f_lineno� format_stack� _callbacks�cancel�futures�Future� set_exception�throw) �printoutr��exc� with_taskr��tr�r�r��cbs�cbs r�_dump_running_tasksr��s����� � �/�/��Q��8� I�8�1�����Q�8�E� I��(-�.���� � � ��.�� ��D��j�j�)�)�2�2��J�J�'�'�.�.�:�:����,�,�3�3�B�B��j�j�)�)�2�2��+�+�D�J�J�,?�,?�@�%�D�4�  ��� ���A��,�,�C� �H�H�J� �O�O� "� "� 0� 0��C� 8� �O�O� "� "� )� )�!� ,� #� $��"�U�R��U�1�X�� $� ���� � �c�"�� �J��3 J��.�� ��" %��� �� �s0�G!�G!�G&�-CG+�,G0�G5�5G=�<G=c�H�eZdZd d�Zd�Zd�Zd d�Zd�Zd�Zd�Z d�Z d d �Z y ) �AbstractAsyncStreamedFilec��xK�|�dn t|�}|jdk7r td��|dkr|j|jz }|j r td��|dk(ry|j |j|j|z��d{���}|xjt|�z c_|S7�$�w)z� Return data from cache, or fetch pieces as necessary Parameters ---------- length: int (-1) Number of bytes to read; if <0, all remaining bytes. Nr^rezFile not in read moder�I/O operation on closed file.r)�intrbrgr��loc�closed� _fetch_rangerz)r>�lengthr�s r�readzAbstractAsyncStreamedFile.read�s������~��3�v�;�� �9�9�� ��4�5� 5� �A�:��Y�Y����)�F� �;�;��<�=� =� �Q�;���%�%�d�h�h����6�0A�B�B�� ���C��H���� �C�s�BB:�B8�%B:c��~K�|jdvr td��|jr td��|jr td��|jj |�}|xj |z c_|jj�|jk\r|j��d{���|S7��w)z� Write data to buffer. Buffer only sent on flush() or if buffer is greater than or equal to blocksize. Parameters ---------- data: bytes Set of bytes to be written. >�ab�wbzFile not in write moder�z0This file has been force-flushed, can only closeN) rbrgr��forced�buffer�writer��tell� blocksize�flush)r>�datar�s rr�zAbstractAsyncStreamedFile.write�s����� �9�9�L� (��5�6� 6� �;�;��<�=� =� �;�;��O�P� P��k�k����%�� ���C��� �;�;� � � ���� /��*�*�,� � �� � �s�B2B=�4B;�5B=c��K�t|dd�ry|jry|jdk(rd|_d|_y|js|j d���d{���|j �c|j j|j�|j j|j j|j��d|_y7�{�w)z=Close file Finalizes writes, discards cache � _unclosableFNreT)�force) rxr�rb�cacher�r�r��invalidate_cacher��_parentr�s r�closezAbstractAsyncStreamedFile.close s����� �4��� .� � �;�;� � �9�9�� ��D�J��� ��;�;��j�j�t�j�,�,�,��w�w�"����(�(����3����(�(���������)C�D��� � -�s�AC�C�A<Cc��4K�|jr td��|r|jr td��|rd|_|jdvry|s(|jj �|j kry|j� d|_ |j��d{���|j|���d{���durI|xj|jjdd�z c_tj�|_yy7�j#d|_�xYw7�_�w) NzFlush on closed filez+Force flush cannot be called more than onceT>r�r�r)�finalF�) r�rgr�rbr�r�r��offset�_initiate_upload� _upload_chunk�seek�io�BytesIO)r>r�s rr�zAbstractAsyncStreamedFile.flush"s����� �;�;��3�4� 4� �T�[�[��J�K� K� ��D�K� �9�9�L� (� �����)�)�+�d�n�n�<� � �;�;� ��D�K� ��+�+�-�-�-� �#�#�%�#�0� 0�� =� �K�K�4�;�;�+�+�A�q�1� 1�K��*�*�,�D�K� >� .�� �"�� ��� 0�s=�BD� D �D�D �!D�6D�7AD�D � D�Dc��K�|S�wr�rr�s r� __aenter__z$AbstractAsyncStreamedFile.__aenter__?s ����� �s�c��@K�|j��d{���y7��wr�)r�)r>�exc_type�exc_val�exc_tbs r� __aexit__z#AbstractAsyncStreamedFile.__aexit__Bs�����j�j�l���s ���c��K�t��wr�r�)r>rUr�s rr�z&AbstractAsyncStreamedFile._fetch_rangeEr�r�c�� K�y�wr�rr�s rr�z*AbstractAsyncStreamedFile._initiate_uploadHr\r]c��K�t��wr�r�)r>r�s rr�z'AbstractAsyncStreamedFile._upload_chunkKr�r�N)r^rd) rfrgrhr�r�r�r�r�r�r�r�r�rrrr�r��s/���.�0�*'�:��"� �"rr�r�rd)?r!�asyncio.eventsrArvr�r�rHr6r� contextlibr�globr�typingrr� callbacksr� exceptionsr �implementations.localr r r �specr r�utilsrrrr>rurrrr.rrr)r;rCrMrWrbrXrhrxrrfrcrarm�boolrpr�rrr�rkr#r�r�r�rrr�<module>r�si������ �� � ��%��*�'�&�Q�Q�:�<�<� �"�*�*�W� �� �6�� �v�� ���+�+��� � �%)�*�Z ��7��7��&���N�N�M�<��  ��'�7�;� ���"���2�t��� � �� � B�L� �.h "�(�h "�V�@ �I� � �$�$9�U��Br"� 4�r"��s � ���� � �s�:D� D�D

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