HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/websocket/__pycache__/_utils.cpython-310.pyc
o

���a�
�@s�dZgd�ZGdd�d�ZzddlmZdd�ZWney2dZdZgd	�Z	d
d�Z
dd�ZYnwd
d�Zdd�Zdd�Z
dS)a^
_url.py
websocket - WebSocket client library for Python

Copyright 2021 engn33r

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
)�NoLock�
validate_utf8�extract_err_message�extract_error_codec@seZdZdd�Zdd�ZdS)rcC�dS�N�)�selfrr�2/usr/lib/python3/dist-packages/websocket/_utils.py�	__enter__�zNoLock.__enter__cCrrr)r�exc_type�	exc_value�	tracebackrrr	�__exit__rzNoLock.__exit__N)�__name__�
__module__�__qualname__r
rrrrr	rsr�)�
Utf8ValidatorcCst��|�dS�Nr)r�validate��utfbytesrrr	�_validate_utf8$sr�(lrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr�rrrrrrrrrrrrrrr�	rrrrrrrrrrrrrrr�rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr�r�rrrrrrrrrrrrrrrrrrrrrrrrrrrrr�
�r!r!r!r!r!r!r!r!r!r!r!�r!r!��r$r$�rrrrrrrrrrrrr��$�<�`�Trrr�0�Hrrrrrrrrrrrrrrrrrrrrrrrrrr&rrrrrr&rr&rrrrrrrrrr&rrrrrr&rrrrrrrr&rrrrrrrrrr'rr'rrrr'rrrrrr'rr'rrrr'rrrrrrrrrrcCsDt|}|tkr|d@|d>Bnd|?|@}td||}||fS)N�?r$��)�_UTF8D�_UTF8_ACCEPT)�state�codep�ch�tprrr	�_decodeBs�
�r6cCs4t}d}|D]}t|||�\}}|tkrdSqdS)NrFT)r1r6�_UTF8_REJECT)rr2r3�irrr	rKs�cCst|�S)z�
    validate utf8 byte string.
    utfbytes: utf byte string to check.
    return value: if valid utf8 string, return true. Otherwise, return false.
    )rrrrr	rVsrcCs|jr|jdSdSr)�args��	exceptionrrr	r_s
rcCs:|jrt|j�dkrt|jdt�r|jdSdSdSdS)Nrr)r9�len�
isinstance�intr:rrr	rfs�rN)�__doc__�__all__r�wsaccel.utf8validatorrr�ImportErrorr1r7r0r6rrrrrrr	�<module>s 		�/