§
    ÈtºfŠ	  ã                   ó  — d Z ddlmZ ddlmZmZmZmZ ddlm	Z	m
Z
 ddlmZmZmZmZ  ed¦  «        Z G d„ de¦  «        Z G d	„ d
e¦  «        Ze
 G d„ d¦  «        ¦   «         Zdededee         fd„Zdedee         defd„ZdS )z
Buffer byte streams.
é    )Úcount)ÚDictÚIteratorÚListÚTypeVar)ÚFactoryÚdefine)ÚAMPÚCommandÚIntegerÚStringÚTc                   ó,   — e Zd ZdZd e¦   «         fgZdS )Ú
StreamOpenz
    Open a new stream.
    ó   streamIdN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úresponse© ó    úY/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/trial/_dist/stream.pyr   r      s-   € € € € € ðð ð ˜g˜g™iœiÐ(Ð)€H€H€Hr   r   c                   óB   — e Zd ZdZd e¦   «         fd e¦   «         fgZdS )ÚStreamWritez,
    Write a chunk of data to a stream.
    r   s   dataN)r   r   r   r   r   ÚBytesÚ	argumentsr   r   r   r   r      s=   € € € € € ðð ð
 
�g�g‘i”iÐ Ø	�%�%‘'”'Ðð€I€I€Ir   r   c                   ó¶   — e Zd ZU dZ e¦   «         Zee         ed<    e	e
¦  «        Zeeee         f         ed<   defd„Zdededdfd	„Zdedee         fd
„ZdS )ÚStreamReceiverz9
    Buffering de-multiplexing byte stream receiver.
    Ú_counterÚ_streamsÚreturnc                 óB   — t          | j        ¦  «        }g | j        |<   |S )zE
        Open a new stream and return its unique identifier.
        )Únextr    r!   )ÚselfÚnewIds     r   ÚopenzStreamReceiver.open+   s$   € õ �T”]Ñ#Ô#ˆØ!ˆŒ�eÑØˆr   ÚstreamIdÚchunkNc                 óF   — | j         |                              |¦  «         dS )z�
        Write to an open stream using its unique identifier.

        @raise KeyError: If there is no such open stream.
        N)r!   Úappend)r%   r(   r)   s      r   ÚwritezStreamReceiver.write3   s%   € ð 	Œ�hÔ×&Ò& uÑ-Ô-Ð-Ð-Ð-r   c                 ó6   — | j                              |¦  «        S )z°
        Indicate an open stream may receive no further data and return all of
        its current contents.

        @raise KeyError: If there is no such open stream.
        )r!   Úpop)r%   r(   s     r   ÚfinishzStreamReceiver.finish;   s   € ð Œ}× Ò  Ñ*Ô*Ð*r   )r   r   r   r   r   r    r   ÚintÚ__annotations__r   Údictr!   r   r   Úbytesr'   r,   r/   r   r   r   r   r   "   sÌ   € € € € € € ðð ð $˜e™gœg€Hˆh�sŒmÐ%Ð%Ñ%Ø'. w¨t¡}¤}€Hˆd�3˜˜UœÐ#Ô$Ð4Ð4Ñ4ð�cð ð ð ð ð.˜cð .¨%ð .°Dð .ð .ð .ð .ð+˜sð + t¨E¤{ð +ð +ð +ð +ð +ð +r   r   ÚdataÚ	chunkSizer"   c              #   ó†   K  — d}|t          | ¦  «        k     r)| |||z   …         V — ||z  }|t          | ¦  «        k     °'dS dS )a  
    Break a byte string into pieces of no more than ``chunkSize`` length.

    @param data: The byte string.

    @param chunkSize: The maximum length of the resulting pieces.  All pieces
        except possibly the last will be this length.

    @return: The pieces.
    r   N)Úlen)r4   r5   Úposs      r   r)   r)   E   sY   è è € ð €CØ
•�D‘	”	Š/ˆ/Ø�3˜˜y™Ð(Ô)Ð)Ð)Ð)ØˆyÑˆð •�D‘	”	Š/ˆ/ˆ/ˆ/ˆ/ˆ/r   ÚampÚchunksc              ƒ   óÔ   K  — |                       t          ¦  «        ƒ d{V —†d         }t          |t          ¦  «        sJ ‚|D ]%}|                       t          ||¬¦  «        ƒ d{V —† Œ&|S )zö
    Send the given stream chunks, one by one, over the given connection.

    The chunks are sent using L{StreamWrite} over a stream opened using
    L{StreamOpen}.

    @return: The identifier of the stream over which the chunks were sent.
    Nr(   )r(   r4   )Ú
callRemoter   Ú
isinstancer0   r   )r9   r:   r(   ÚoneChunks       r   Ústreamr?   V   s‰   è è € ð —n’n¥ZÑ0Ô0Ð0Ð0Ð0Ð0Ð0Ð0°*Ô=€HÝ�h¥Ñ$Ô$Ð$Ð$Ð$àð Lð LˆØ�nŠn�[°8À(ˆnÑKÔKÐKÐKÐKÐKÐKÐKÐKÐKØ€Or   N)r   Ú	itertoolsr   Útypingr   r   r   r   Úattrsr   r	   Útwisted.protocols.ampr
   r   r   r   r   r   r   r   r   r3   r0   r)   r?   r   r   r   ú<module>rD      s}  ððð ð Ð Ð Ð Ð Ð Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0à !Ð !Ð !Ð !Ð !Ð !Ð !Ð !à HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ Hà€GˆC�L„L€ð*ð *ð *ð *ð *�ñ *ô *ð *ðð ð ð ð �'ñ ô ð ð ð+ð +ð +ð +ð +ñ +ô +ñ „ð+ðD�ð  #ð ¨(°5¬/ð ð ð ð ð"�cð  8¨E¤?ð °sð ð ð ð ð ð r   