3 gY0r@sbdZddlZdddgZGdddeZyddlmZdd ZWn ek rLdZ d Z ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd dddddd d d ddd d d d d d d d d d d d d dd d d d d dd dd d d dd d d d d dd dd d d d d d d d d dd d d d d dd d d d d d d dd d d d d d d d d dd dd d d dd d d d d dd dd d d dd d d d d d d d d d glZ ddZ dd ZYnXd dZ d!dZdS)"aK websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA NNoLock validate_utf8extract_err_messagec@seZdZddZddZdS)rcCsdS)N)selfrrA/Users/olari/OneDrive/sandbox/awsBlog2/lambda/websocket/_utils.py __enter__szNoLock.__enter__cCsdS)Nr)rexc_type exc_value tracebackrrr__exit__ szNoLock.__exit__N)__name__ __module__ __qualname__rr rrrrrs) Utf8ValidatorcCstj|dS)Nr)rvalidate)utfbytesrrr_validate_utf8(sr    $<`T0HcCsDt|}|tkr |d@|d>Bn d|?|@}td||}||fS)N?r)_UTF8D _UTF8_ACCEPT)statecodepchtprrr_decodeFs$r0cCsDt}d}x6|D].}tjr t|}t|||\}}|tkrdSqWdS)NrFT)r+sixPY2ordr0 _UTF8_REJECT)rr,r-irrrrOs cCst|S)z validate utf8 byte string. utfbytes: utf byte string to check. return value: if valid utf8 string, return true. Otherwise, return false. )r)rrrrr\scCs|jr|jdSdSdS)Nr)args) exceptionrrrres )__doc__r1__all__objectrZwsaccel.utf8validatorrr ImportErrorr+r4r*r0rrrrrrs4  @@@@@@@@0000