� L�g1� �$�ddlmZ gd�ZGd�d��Z ddlmZdeeefdefd�Z n/#e $r'dZ d Z gd �Z d ed ed edefd�Zdeeefdefd�Z YnwxYwdeeefdefd�Zdedeedffd�Zdedeedffd�ZdS)�)�Union)�NoLock� validate_utf8�extract_err_message�extract_error_codec��eZdZdd�Zdd�ZdS)r�returnNc��dS�N�)�selfs �`/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/websocket/_utils.py� __enter__zNoLock.__enter__��� ��c��dSr r )r �exc_type� exc_value� tracebacks r�__exit__zNoLock.__exit__rr)r N)�__name__� __module__� __qualname__rrr rrrrs<������ � � � � � � � � � rr)� Utf8Validator�utfbytesr c�T�t���|��d}|S�Nr)r�validate)r�results r�_validate_utf8r %s#��$���/�/��9�9�!�<��� r� (lrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr�r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"� r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#�r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$�r%�r&r&r&r&r&r&r&r&r&r&r&r&r&r&r&r&r&r&r&r&r&r&r&r&r&r&r&r&r&� �r(r(r(r(r(r(r(r(r(r(r(�r(r(� �r+r+�r%r%r%r%r%r%r%r%r%r%r%rr!��$�<�`�Tr!r!r!�0�Hr!r!r!r!r!r!r!r!r!r!r!r!r!rr!r!r!r!r!rr!rr!r!r!r-r!r!r!r!r!r-r!r-r!r!r!r!r!r!r!r!r!r-r!r!r!r!r!r-r!r!r!r!r!r!r!r-r!r!r!r!r!r!r!r!r!r.r!r.r!r!r!r.r!r!r!r!r!r.r!r.r!r!r!r.r!r!r!r!r!r!r!r!r!r!�state�codep�chc��t|}|tkr |dz|dzznd|z |z}td|z|z}||fS)N�?r+���)�_UTF8D� _UTF8_ACCEPT)r4r5r6�tps r�_decoder>�s[�� �B�Z��,1�L�+@�+@�R�$�Y�5�A�:� &� &��PR� �VX�GX� ��s�U�{�R�'�(���e�|�rc��t}d}|D]1}t||t|����\}}|tkrdS�2dS)NrFT)r<r>�int� _UTF8_REJECT)rr4r5�is rr r �sT������� � �A�"�5�%��Q���8�8�L�E�5�� �$�$��u�u�%��trc� �t|��S)z� validate utf8 byte string. utfbytes: utf byte string to check. return value: if valid utf8 string, return true. Otherwise, return false. )r )rs rrr�s�� �(� #� #�#r� exceptionNc�2�|jr|jd}|SdSr)�args)rD�exception_messages rrr�s$���~��!*���!2�� � ��trc��|jrGt|j��dkr1t|jdt��r |jdndSdSdS)Nr"r)rF�len� isinstancer@)rDs rrr�s[���~�Q�#�i�n�-�-��1�1�$.�y�~�a�/@�#�$F�$F�P�y�~�a� � �D�P�Q�Q�1�1r)�typingr�__all__r�wsaccel.utf8validatorr�str�bytes�boolr � ImportErrorr<rAr;r@�tupler>r� Exceptionrrr rr�<module>rTs����������$ S� R� R�� � � � � � � � �U�4�3�3�3�3�3���s�E�z�!2��t��������L�L�L��L��L�q�q�q�F�f �s��3��C��E�������s�E�z�!2��t�������I L����^ $�E�#�u�*�-�$�$�$�$�$�$��9���s�D�y�1A�����Q�)�Q��c�4�i�0@�Q�Q�Q�Q�Q�Qs�1�)A�A
Memory