Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
streams.cpython-313.pyc88 linesDownload Raw Back to __pycache__
1�

2p�j~��0�SSKJr SSKJr "SS5rg)�)�annotations)�	Generatorc�h�\rSrSrSrS
SjrSSjrSSjrSSjrSSjr	SSjr3S
S	jrS
S4jrSr
g)�StreamReader�z�5Generator-based stream reader.6 7This class doesn't support concurrent calls to :meth:`read_line`,8:meth:`read_exact`, or :meth:`read_to_eof`. Make sure calls are9serialized.10 11c�0�[5UlSUlg)NF)�	bytearray�buffer�eof��selfs �XD:\code\apps\devtools\python\user_packages\Python313\site-packages\websockets/streams.py�__init__�StreamReader.__init__s���k������c#�r# �SnSnURRSU5S-nUS:�aOR[UR5nX1:�a[SUSUS35eUR(a[SUS35eS	v� MxX!:�a[SUSUS35eURS	UnURS	U2	U$7f)12a=13Read a LF-terminated line from the stream.14 15This is a generator-based coroutine.16 17The return value includes the LF character.18 19Args:20    m: Maximum number bytes to read; this is a security limit.21 22Raises:23    EOFError: If the stream ends without a LF.24    RuntimeError: If the stream ends in more than ``m`` bytes.25 26r�27��read � bytes, expected no more than � bytes�stream ends after z bytes, before end of lineN)r28�find�len�RuntimeErrorr�EOFError)r
�m�n�p�rs     r�	read_line�StreamReader.read_lines���� 
��
������ � ���*�Q�.�A��1�u���D�K�K� �A��u�"�U�1�#�-K�A�3�f�#U�V�V��x�x��!3�A�3�6P�Q�R�R���
�5���q�c�)G��s�&�Q�R�R��K�K���O���K�K����O���s�B5B7c#�:# �US:�de[UR5U:aWUR(a'[UR5n[SUSUS35eSv� [UR5U:aMWURSUnURSU2	U$7f)z�29Read a given number of bytes from the stream.30 31This is a generator-based coroutine.32 33Args:34    n: How many bytes to read.35 36Raises:37    EOFError: If the stream ends in less than ``n`` bytes.38 39rrz bytes, expected rN)rr40rr)r
rrr s    r�41read_exact�StreamReader.read_exact6s�����A�v�
�v��$�+�+���"��x�x�����$���!3�A�3�6G��s�&�Q�R�R��	�$�+�+���"�42
�K�K���O���K�K����O���s�A7B�; Bc#��# �UR(dC[UR5nX!:�a[SUSUS35eSv� UR(dMCURSSnURSS2	U$7f)z�43Read all bytes from the stream.44 45This is a generator-based coroutine.46 47Args:48    m: Maximum number bytes to read; this is a security limit.49 50Raises:51    RuntimeError: If the stream ends in more than ``m`` bytes.52 53rrrN)rrr54r)r
rrr s    r�read_to_eof�StreamReader.read_to_eofMsi����(�(��D�K�K� �A��u�"�U�1�#�-K�A�3�f�#U�V�V��	�(�(�(�55
�K�K��N���K�K��N���s�AA7� A7c#�`# �UR(agUR(agSv� M*7f)za56Tell whether the stream has ended and all data was read.57 58This is a generator-based coroutine.59 60TFN�r61rrs r�at_eof�StreamReader.at_eofcs(�����{�{���x�x��
��s�,.c�f�UR(a[S5eU=RU-
slg)z�62Write data to the stream.63 64:meth:`feed_data` cannot be called after :meth:`feed_eof`.65 66Args:67    data: Data to write.68 69Raises:70    EOFError: If the stream has ended.71 72�stream endedN)rrr73)r
�datas  r�	feed_data�StreamReader.feed_datass$���8�8��>�*�*����t��rc�J�UR(a[S5eSUlg)zu74End the stream.75 76:meth:`feed_eof` cannot be called more than once.77 78Raises:79    EOFError: If the stream has ended.80 81r.TN)rrrs r�feed_eof�StreamReader.feed_eof�s���8�8��>�*�*���rc�"�URSS2	g)z782Discard all buffered data, but don't end the stream.83 84N)r85rs r�discard�StreamReader.discard�s��86
�K�K��Nrr*N)�return�None)r�intr8� Generator[None, None, bytearray])rr:r8r;)r8zGenerator[None, None, bool])r/zbytes | bytearrayr8r9)�__name__�87__module__�__qualname__�__firstlineno__�__doc__rr!r$r'r+r0r3r6�__static_attributes__�rrrrs0���� �D�.�,� �"�rrN)�88__future__r�collections.abcrrrBrr�<module>rEs��"�%�Q�Qr
codekingpro/portable-devtools · Team Ai