Path: blob/master/ invest-robot-contest_TinkoffBotTwitch-main/venv/lib/python3.8/site-packages/aiohttp/_websocket.c
7763 views
/* Generated by Cython 0.29.24 */12#ifndef PY_SSIZE_T_CLEAN3#define PY_SSIZE_T_CLEAN4#endif /* PY_SSIZE_T_CLEAN */5#include "Python.h"6#ifndef Py_PYTHON_H7#error Python headers needed to compile C extensions, please install development version of Python.8#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)9#error Cython requires Python 2.6+ or Python 3.3+.10#else11#define CYTHON_ABI "0_29_24"12#define CYTHON_HEX_VERSION 0x001D18F013#define CYTHON_FUTURE_DIVISION 114#include <stddef.h>15#ifndef offsetof16#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )17#endif18#if !defined(WIN32) && !defined(MS_WINDOWS)19#ifndef __stdcall20#define __stdcall21#endif22#ifndef __cdecl23#define __cdecl24#endif25#ifndef __fastcall26#define __fastcall27#endif28#endif29#ifndef DL_IMPORT30#define DL_IMPORT(t) t31#endif32#ifndef DL_EXPORT33#define DL_EXPORT(t) t34#endif35#define __PYX_COMMA ,36#ifndef HAVE_LONG_LONG37#if PY_VERSION_HEX >= 0x0207000038#define HAVE_LONG_LONG39#endif40#endif41#ifndef PY_LONG_LONG42#define PY_LONG_LONG LONG_LONG43#endif44#ifndef Py_HUGE_VAL45#define Py_HUGE_VAL HUGE_VAL46#endif47#ifdef PYPY_VERSION48#define CYTHON_COMPILING_IN_PYPY 149#define CYTHON_COMPILING_IN_PYSTON 050#define CYTHON_COMPILING_IN_CPYTHON 051#undef CYTHON_USE_TYPE_SLOTS52#define CYTHON_USE_TYPE_SLOTS 053#undef CYTHON_USE_PYTYPE_LOOKUP54#define CYTHON_USE_PYTYPE_LOOKUP 055#if PY_VERSION_HEX < 0x0305000056#undef CYTHON_USE_ASYNC_SLOTS57#define CYTHON_USE_ASYNC_SLOTS 058#elif !defined(CYTHON_USE_ASYNC_SLOTS)59#define CYTHON_USE_ASYNC_SLOTS 160#endif61#undef CYTHON_USE_PYLIST_INTERNALS62#define CYTHON_USE_PYLIST_INTERNALS 063#undef CYTHON_USE_UNICODE_INTERNALS64#define CYTHON_USE_UNICODE_INTERNALS 065#undef CYTHON_USE_UNICODE_WRITER66#define CYTHON_USE_UNICODE_WRITER 067#undef CYTHON_USE_PYLONG_INTERNALS68#define CYTHON_USE_PYLONG_INTERNALS 069#undef CYTHON_AVOID_BORROWED_REFS70#define CYTHON_AVOID_BORROWED_REFS 171#undef CYTHON_ASSUME_SAFE_MACROS72#define CYTHON_ASSUME_SAFE_MACROS 073#undef CYTHON_UNPACK_METHODS74#define CYTHON_UNPACK_METHODS 075#undef CYTHON_FAST_THREAD_STATE76#define CYTHON_FAST_THREAD_STATE 077#undef CYTHON_FAST_PYCALL78#define CYTHON_FAST_PYCALL 079#undef CYTHON_PEP489_MULTI_PHASE_INIT80#define CYTHON_PEP489_MULTI_PHASE_INIT 081#undef CYTHON_USE_TP_FINALIZE82#define CYTHON_USE_TP_FINALIZE 083#undef CYTHON_USE_DICT_VERSIONS84#define CYTHON_USE_DICT_VERSIONS 085#undef CYTHON_USE_EXC_INFO_STACK86#define CYTHON_USE_EXC_INFO_STACK 087#elif defined(PYSTON_VERSION)88#define CYTHON_COMPILING_IN_PYPY 089#define CYTHON_COMPILING_IN_PYSTON 190#define CYTHON_COMPILING_IN_CPYTHON 091#ifndef CYTHON_USE_TYPE_SLOTS92#define CYTHON_USE_TYPE_SLOTS 193#endif94#undef CYTHON_USE_PYTYPE_LOOKUP95#define CYTHON_USE_PYTYPE_LOOKUP 096#undef CYTHON_USE_ASYNC_SLOTS97#define CYTHON_USE_ASYNC_SLOTS 098#undef CYTHON_USE_PYLIST_INTERNALS99#define CYTHON_USE_PYLIST_INTERNALS 0100#ifndef CYTHON_USE_UNICODE_INTERNALS101#define CYTHON_USE_UNICODE_INTERNALS 1102#endif103#undef CYTHON_USE_UNICODE_WRITER104#define CYTHON_USE_UNICODE_WRITER 0105#undef CYTHON_USE_PYLONG_INTERNALS106#define CYTHON_USE_PYLONG_INTERNALS 0107#ifndef CYTHON_AVOID_BORROWED_REFS108#define CYTHON_AVOID_BORROWED_REFS 0109#endif110#ifndef CYTHON_ASSUME_SAFE_MACROS111#define CYTHON_ASSUME_SAFE_MACROS 1112#endif113#ifndef CYTHON_UNPACK_METHODS114#define CYTHON_UNPACK_METHODS 1115#endif116#undef CYTHON_FAST_THREAD_STATE117#define CYTHON_FAST_THREAD_STATE 0118#undef CYTHON_FAST_PYCALL119#define CYTHON_FAST_PYCALL 0120#undef CYTHON_PEP489_MULTI_PHASE_INIT121#define CYTHON_PEP489_MULTI_PHASE_INIT 0122#undef CYTHON_USE_TP_FINALIZE123#define CYTHON_USE_TP_FINALIZE 0124#undef CYTHON_USE_DICT_VERSIONS125#define CYTHON_USE_DICT_VERSIONS 0126#undef CYTHON_USE_EXC_INFO_STACK127#define CYTHON_USE_EXC_INFO_STACK 0128#else129#define CYTHON_COMPILING_IN_PYPY 0130#define CYTHON_COMPILING_IN_PYSTON 0131#define CYTHON_COMPILING_IN_CPYTHON 1132#ifndef CYTHON_USE_TYPE_SLOTS133#define CYTHON_USE_TYPE_SLOTS 1134#endif135#if PY_VERSION_HEX < 0x02070000136#undef CYTHON_USE_PYTYPE_LOOKUP137#define CYTHON_USE_PYTYPE_LOOKUP 0138#elif !defined(CYTHON_USE_PYTYPE_LOOKUP)139#define CYTHON_USE_PYTYPE_LOOKUP 1140#endif141#if PY_MAJOR_VERSION < 3142#undef CYTHON_USE_ASYNC_SLOTS143#define CYTHON_USE_ASYNC_SLOTS 0144#elif !defined(CYTHON_USE_ASYNC_SLOTS)145#define CYTHON_USE_ASYNC_SLOTS 1146#endif147#if PY_VERSION_HEX < 0x02070000148#undef CYTHON_USE_PYLONG_INTERNALS149#define CYTHON_USE_PYLONG_INTERNALS 0150#elif !defined(CYTHON_USE_PYLONG_INTERNALS)151#define CYTHON_USE_PYLONG_INTERNALS 1152#endif153#ifndef CYTHON_USE_PYLIST_INTERNALS154#define CYTHON_USE_PYLIST_INTERNALS 1155#endif156#ifndef CYTHON_USE_UNICODE_INTERNALS157#define CYTHON_USE_UNICODE_INTERNALS 1158#endif159#if PY_VERSION_HEX < 0x030300F0160#undef CYTHON_USE_UNICODE_WRITER161#define CYTHON_USE_UNICODE_WRITER 0162#elif !defined(CYTHON_USE_UNICODE_WRITER)163#define CYTHON_USE_UNICODE_WRITER 1164#endif165#ifndef CYTHON_AVOID_BORROWED_REFS166#define CYTHON_AVOID_BORROWED_REFS 0167#endif168#ifndef CYTHON_ASSUME_SAFE_MACROS169#define CYTHON_ASSUME_SAFE_MACROS 1170#endif171#ifndef CYTHON_UNPACK_METHODS172#define CYTHON_UNPACK_METHODS 1173#endif174#ifndef CYTHON_FAST_THREAD_STATE175#define CYTHON_FAST_THREAD_STATE 1176#endif177#ifndef CYTHON_FAST_PYCALL178#define CYTHON_FAST_PYCALL 1179#endif180#ifndef CYTHON_PEP489_MULTI_PHASE_INIT181#define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)182#endif183#ifndef CYTHON_USE_TP_FINALIZE184#define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)185#endif186#ifndef CYTHON_USE_DICT_VERSIONS187#define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)188#endif189#ifndef CYTHON_USE_EXC_INFO_STACK190#define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)191#endif192#endif193#if !defined(CYTHON_FAST_PYCCALL)194#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)195#endif196#if CYTHON_USE_PYLONG_INTERNALS197#include "longintrepr.h"198#undef SHIFT199#undef BASE200#undef MASK201#ifdef SIZEOF_VOID_P202enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };203#endif204#endif205#ifndef __has_attribute206#define __has_attribute(x) 0207#endif208#ifndef __has_cpp_attribute209#define __has_cpp_attribute(x) 0210#endif211#ifndef CYTHON_RESTRICT212#if defined(__GNUC__)213#define CYTHON_RESTRICT __restrict__214#elif defined(_MSC_VER) && _MSC_VER >= 1400215#define CYTHON_RESTRICT __restrict216#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L217#define CYTHON_RESTRICT restrict218#else219#define CYTHON_RESTRICT220#endif221#endif222#ifndef CYTHON_UNUSED223# if defined(__GNUC__)224# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))225# define CYTHON_UNUSED __attribute__ ((__unused__))226# else227# define CYTHON_UNUSED228# endif229# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))230# define CYTHON_UNUSED __attribute__ ((__unused__))231# else232# define CYTHON_UNUSED233# endif234#endif235#ifndef CYTHON_MAYBE_UNUSED_VAR236# if defined(__cplusplus)237template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }238# else239# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)240# endif241#endif242#ifndef CYTHON_NCP_UNUSED243# if CYTHON_COMPILING_IN_CPYTHON244# define CYTHON_NCP_UNUSED245# else246# define CYTHON_NCP_UNUSED CYTHON_UNUSED247# endif248#endif249#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)250#ifdef _MSC_VER251#ifndef _MSC_STDINT_H_252#if _MSC_VER < 1300253typedef unsigned char uint8_t;254typedef unsigned int uint32_t;255#else256typedef unsigned __int8 uint8_t;257typedef unsigned __int32 uint32_t;258#endif259#endif260#else261#include <stdint.h>262#endif263#ifndef CYTHON_FALLTHROUGH264#if defined(__cplusplus) && __cplusplus >= 201103L265#if __has_cpp_attribute(fallthrough)266#define CYTHON_FALLTHROUGH [[fallthrough]]267#elif __has_cpp_attribute(clang::fallthrough)268#define CYTHON_FALLTHROUGH [[clang::fallthrough]]269#elif __has_cpp_attribute(gnu::fallthrough)270#define CYTHON_FALLTHROUGH [[gnu::fallthrough]]271#endif272#endif273#ifndef CYTHON_FALLTHROUGH274#if __has_attribute(fallthrough)275#define CYTHON_FALLTHROUGH __attribute__((fallthrough))276#else277#define CYTHON_FALLTHROUGH278#endif279#endif280#if defined(__clang__ ) && defined(__apple_build_version__)281#if __apple_build_version__ < 7000000282#undef CYTHON_FALLTHROUGH283#define CYTHON_FALLTHROUGH284#endif285#endif286#endif287288#ifndef CYTHON_INLINE289#if defined(__clang__)290#define CYTHON_INLINE __inline__ __attribute__ ((__unused__))291#elif defined(__GNUC__)292#define CYTHON_INLINE __inline__293#elif defined(_MSC_VER)294#define CYTHON_INLINE __inline295#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L296#define CYTHON_INLINE inline297#else298#define CYTHON_INLINE299#endif300#endif301302#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)303#define Py_OptimizeFlag 0304#endif305#define __PYX_BUILD_PY_SSIZE_T "n"306#define CYTHON_FORMAT_SSIZE_T "z"307#if PY_MAJOR_VERSION < 3308#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"309#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\310PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)311#define __Pyx_DefaultClassType PyClass_Type312#else313#define __Pyx_BUILTIN_MODULE_NAME "builtins"314#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2315#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\316PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)317#else318#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\319PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)320#endif321#define __Pyx_DefaultClassType PyType_Type322#endif323#ifndef Py_TPFLAGS_CHECKTYPES324#define Py_TPFLAGS_CHECKTYPES 0325#endif326#ifndef Py_TPFLAGS_HAVE_INDEX327#define Py_TPFLAGS_HAVE_INDEX 0328#endif329#ifndef Py_TPFLAGS_HAVE_NEWBUFFER330#define Py_TPFLAGS_HAVE_NEWBUFFER 0331#endif332#ifndef Py_TPFLAGS_HAVE_FINALIZE333#define Py_TPFLAGS_HAVE_FINALIZE 0334#endif335#ifndef METH_STACKLESS336#define METH_STACKLESS 0337#endif338#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)339#ifndef METH_FASTCALL340#define METH_FASTCALL 0x80341#endif342typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);343typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,344Py_ssize_t nargs, PyObject *kwnames);345#else346#define __Pyx_PyCFunctionFast _PyCFunctionFast347#define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords348#endif349#if CYTHON_FAST_PYCCALL350#define __Pyx_PyFastCFunction_Check(func)\351((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))352#else353#define __Pyx_PyFastCFunction_Check(func) 0354#endif355#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)356#define PyObject_Malloc(s) PyMem_Malloc(s)357#define PyObject_Free(p) PyMem_Free(p)358#define PyObject_Realloc(p) PyMem_Realloc(p)359#endif360#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1361#define PyMem_RawMalloc(n) PyMem_Malloc(n)362#define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)363#define PyMem_RawFree(p) PyMem_Free(p)364#endif365#if CYTHON_COMPILING_IN_PYSTON366#define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)367#define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)368#else369#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)370#define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)371#endif372#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000373#define __Pyx_PyThreadState_Current PyThreadState_GET()374#elif PY_VERSION_HEX >= 0x03060000375#define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()376#elif PY_VERSION_HEX >= 0x03000000377#define __Pyx_PyThreadState_Current PyThreadState_GET()378#else379#define __Pyx_PyThreadState_Current _PyThreadState_Current380#endif381#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)382#include "pythread.h"383#define Py_tss_NEEDS_INIT 0384typedef int Py_tss_t;385static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {386*key = PyThread_create_key();387return 0;388}389static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {390Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));391*key = Py_tss_NEEDS_INIT;392return key;393}394static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {395PyObject_Free(key);396}397static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {398return *key != Py_tss_NEEDS_INIT;399}400static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {401PyThread_delete_key(*key);402*key = Py_tss_NEEDS_INIT;403}404static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {405return PyThread_set_key_value(*key, value);406}407static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {408return PyThread_get_key_value(*key);409}410#endif411#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)412#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))413#else414#define __Pyx_PyDict_NewPresized(n) PyDict_New()415#endif416#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION417#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)418#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)419#else420#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)421#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)422#endif423#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS424#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)425#else426#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)427#endif428#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)429#define CYTHON_PEP393_ENABLED 1430#if defined(PyUnicode_IS_READY)431#define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\4320 : _PyUnicode_Ready((PyObject *)(op)))433#else434#define __Pyx_PyUnicode_READY(op) (0)435#endif436#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)437#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)438#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)439#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)440#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)441#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)442#define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)443#if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)444#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000445#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))446#else447#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))448#endif449#else450#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))451#endif452#else453#define CYTHON_PEP393_ENABLED 0454#define PyUnicode_1BYTE_KIND 1455#define PyUnicode_2BYTE_KIND 2456#define PyUnicode_4BYTE_KIND 4457#define __Pyx_PyUnicode_READY(op) (0)458#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)459#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))460#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)461#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))462#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))463#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))464#define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)465#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))466#endif467#if CYTHON_COMPILING_IN_PYPY468#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)469#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)470#else471#define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)472#define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\473PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))474#endif475#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)476#define PyUnicode_Contains(u, s) PySequence_Contains(u, s)477#endif478#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)479#define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)480#endif481#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)482#define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)483#endif484#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))485#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))486#if PY_MAJOR_VERSION >= 3487#define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)488#else489#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)490#endif491#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)492#define PyObject_ASCII(o) PyObject_Repr(o)493#endif494#if PY_MAJOR_VERSION >= 3495#define PyBaseString_Type PyUnicode_Type496#define PyStringObject PyUnicodeObject497#define PyString_Type PyUnicode_Type498#define PyString_Check PyUnicode_Check499#define PyString_CheckExact PyUnicode_CheckExact500#ifndef PyObject_Unicode501#define PyObject_Unicode PyObject_Str502#endif503#endif504#if PY_MAJOR_VERSION >= 3505#define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)506#define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)507#else508#define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))509#define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))510#endif511#ifndef PySet_CheckExact512#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)513#endif514#if PY_VERSION_HEX >= 0x030900A4515#define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)516#define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)517#else518#define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)519#define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)520#endif521#if CYTHON_ASSUME_SAFE_MACROS522#define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)523#else524#define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)525#endif526#if PY_MAJOR_VERSION >= 3527#define PyIntObject PyLongObject528#define PyInt_Type PyLong_Type529#define PyInt_Check(op) PyLong_Check(op)530#define PyInt_CheckExact(op) PyLong_CheckExact(op)531#define PyInt_FromString PyLong_FromString532#define PyInt_FromUnicode PyLong_FromUnicode533#define PyInt_FromLong PyLong_FromLong534#define PyInt_FromSize_t PyLong_FromSize_t535#define PyInt_FromSsize_t PyLong_FromSsize_t536#define PyInt_AsLong PyLong_AsLong537#define PyInt_AS_LONG PyLong_AS_LONG538#define PyInt_AsSsize_t PyLong_AsSsize_t539#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask540#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask541#define PyNumber_Int PyNumber_Long542#endif543#if PY_MAJOR_VERSION >= 3544#define PyBoolObject PyLongObject545#endif546#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY547#ifndef PyUnicode_InternFromString548#define PyUnicode_InternFromString(s) PyUnicode_FromString(s)549#endif550#endif551#if PY_VERSION_HEX < 0x030200A4552typedef long Py_hash_t;553#define __Pyx_PyInt_FromHash_t PyInt_FromLong554#define __Pyx_PyInt_AsHash_t PyInt_AsLong555#else556#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t557#define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t558#endif559#if PY_MAJOR_VERSION >= 3560#define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))561#else562#define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)563#endif564#if CYTHON_USE_ASYNC_SLOTS565#if PY_VERSION_HEX >= 0x030500B1566#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods567#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)568#else569#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))570#endif571#else572#define __Pyx_PyType_AsAsync(obj) NULL573#endif574#ifndef __Pyx_PyAsyncMethodsStruct575typedef struct {576unaryfunc am_await;577unaryfunc am_aiter;578unaryfunc am_anext;579} __Pyx_PyAsyncMethodsStruct;580#endif581582#if defined(WIN32) || defined(MS_WINDOWS)583#define _USE_MATH_DEFINES584#endif585#include <math.h>586#ifdef NAN587#define __PYX_NAN() ((float) NAN)588#else589static CYTHON_INLINE float __PYX_NAN() {590float value;591memset(&value, 0xFF, sizeof(value));592return value;593}594#endif595#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)596#define __Pyx_truncl trunc597#else598#define __Pyx_truncl truncl599#endif600601#define __PYX_MARK_ERR_POS(f_index, lineno) \602{ __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }603#define __PYX_ERR(f_index, lineno, Ln_error) \604{ __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }605606#ifndef __PYX_EXTERN_C607#ifdef __cplusplus608#define __PYX_EXTERN_C extern "C"609#else610#define __PYX_EXTERN_C extern611#endif612#endif613614#define __PYX_HAVE__aiohttp___websocket615#define __PYX_HAVE_API__aiohttp___websocket616/* Early includes */617#include <string.h>618#include <stdio.h>619#include "pythread.h"620#include <stdint.h>621#ifdef _OPENMP622#include <omp.h>623#endif /* _OPENMP */624625#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)626#define CYTHON_WITHOUT_ASSERTIONS627#endif628629typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;630const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;631632#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0633#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0634#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)635#define __PYX_DEFAULT_STRING_ENCODING ""636#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString637#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize638#define __Pyx_uchar_cast(c) ((unsigned char)c)639#define __Pyx_long_cast(x) ((long)x)640#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\641(sizeof(type) < sizeof(Py_ssize_t)) ||\642(sizeof(type) > sizeof(Py_ssize_t) &&\643likely(v < (type)PY_SSIZE_T_MAX ||\644v == (type)PY_SSIZE_T_MAX) &&\645(!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\646v == (type)PY_SSIZE_T_MIN))) ||\647(sizeof(type) == sizeof(Py_ssize_t) &&\648(is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\649v == (type)PY_SSIZE_T_MAX))) )650static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {651return (size_t) i < (size_t) limit;652}653#if defined (__cplusplus) && __cplusplus >= 201103L654#include <cstdlib>655#define __Pyx_sst_abs(value) std::abs(value)656#elif SIZEOF_INT >= SIZEOF_SIZE_T657#define __Pyx_sst_abs(value) abs(value)658#elif SIZEOF_LONG >= SIZEOF_SIZE_T659#define __Pyx_sst_abs(value) labs(value)660#elif defined (_MSC_VER)661#define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))662#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L663#define __Pyx_sst_abs(value) llabs(value)664#elif defined (__GNUC__)665#define __Pyx_sst_abs(value) __builtin_llabs(value)666#else667#define __Pyx_sst_abs(value) ((value<0) ? -value : value)668#endif669static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);670static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);671#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))672#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)673#define __Pyx_PyBytes_FromString PyBytes_FromString674#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize675static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);676#if PY_MAJOR_VERSION < 3677#define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString678#define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize679#else680#define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString681#define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize682#endif683#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))684#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))685#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))686#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))687#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))688#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))689#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))690#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))691#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))692#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))693#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))694#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)695#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)696#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)697#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)698#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)699static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {700const Py_UNICODE *u_end = u;701while (*u_end++) ;702return (size_t)(u_end - u - 1);703}704#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))705#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode706#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode707#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)708#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)709static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);710static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);711static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);712static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);713#define __Pyx_PySequence_Tuple(obj)\714(likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))715static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);716static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);717#if CYTHON_ASSUME_SAFE_MACROS718#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))719#else720#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)721#endif722#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))723#if PY_MAJOR_VERSION >= 3724#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))725#else726#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))727#endif728#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))729#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII730static int __Pyx_sys_getdefaultencoding_not_ascii;731static int __Pyx_init_sys_getdefaultencoding_params(void) {732PyObject* sys;733PyObject* default_encoding = NULL;734PyObject* ascii_chars_u = NULL;735PyObject* ascii_chars_b = NULL;736const char* default_encoding_c;737sys = PyImport_ImportModule("sys");738if (!sys) goto bad;739default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);740Py_DECREF(sys);741if (!default_encoding) goto bad;742default_encoding_c = PyBytes_AsString(default_encoding);743if (!default_encoding_c) goto bad;744if (strcmp(default_encoding_c, "ascii") == 0) {745__Pyx_sys_getdefaultencoding_not_ascii = 0;746} else {747char ascii_chars[128];748int c;749for (c = 0; c < 128; c++) {750ascii_chars[c] = c;751}752__Pyx_sys_getdefaultencoding_not_ascii = 1;753ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);754if (!ascii_chars_u) goto bad;755ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);756if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {757PyErr_Format(758PyExc_ValueError,759"This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",760default_encoding_c);761goto bad;762}763Py_DECREF(ascii_chars_u);764Py_DECREF(ascii_chars_b);765}766Py_DECREF(default_encoding);767return 0;768bad:769Py_XDECREF(default_encoding);770Py_XDECREF(ascii_chars_u);771Py_XDECREF(ascii_chars_b);772return -1;773}774#endif775#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3776#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)777#else778#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)779#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT780static char* __PYX_DEFAULT_STRING_ENCODING;781static int __Pyx_init_sys_getdefaultencoding_params(void) {782PyObject* sys;783PyObject* default_encoding = NULL;784char* default_encoding_c;785sys = PyImport_ImportModule("sys");786if (!sys) goto bad;787default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);788Py_DECREF(sys);789if (!default_encoding) goto bad;790default_encoding_c = PyBytes_AsString(default_encoding);791if (!default_encoding_c) goto bad;792__PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);793if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;794strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);795Py_DECREF(default_encoding);796return 0;797bad:798Py_XDECREF(default_encoding);799return -1;800}801#endif802#endif803804805/* Test for GCC > 2.95 */806#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))807#define likely(x) __builtin_expect(!!(x), 1)808#define unlikely(x) __builtin_expect(!!(x), 0)809#else /* !__GNUC__ or GCC < 2.95 */810#define likely(x) (x)811#define unlikely(x) (x)812#endif /* __GNUC__ */813static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }814815static PyObject *__pyx_m = NULL;816static PyObject *__pyx_d;817static PyObject *__pyx_b;818static PyObject *__pyx_cython_runtime = NULL;819static PyObject *__pyx_empty_tuple;820static PyObject *__pyx_empty_bytes;821static PyObject *__pyx_empty_unicode;822static int __pyx_lineno;823static int __pyx_clineno = 0;824static const char * __pyx_cfilenm= __FILE__;825static const char *__pyx_filename;826827828static const char *__pyx_f[] = {829"aiohttp/_websocket.pyx",830"type.pxd",831"bool.pxd",832"complex.pxd",833};834835/*--- Type declarations ---*/836837/* --- Runtime support code (head) --- */838/* Refnanny.proto */839#ifndef CYTHON_REFNANNY840#define CYTHON_REFNANNY 0841#endif842#if CYTHON_REFNANNY843typedef struct {844void (*INCREF)(void*, PyObject*, int);845void (*DECREF)(void*, PyObject*, int);846void (*GOTREF)(void*, PyObject*, int);847void (*GIVEREF)(void*, PyObject*, int);848void* (*SetupContext)(const char*, int, const char*);849void (*FinishContext)(void**);850} __Pyx_RefNannyAPIStruct;851static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;852static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);853#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;854#ifdef WITH_THREAD855#define __Pyx_RefNannySetupContext(name, acquire_gil)\856if (acquire_gil) {\857PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\858__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\859PyGILState_Release(__pyx_gilstate_save);\860} else {\861__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\862}863#else864#define __Pyx_RefNannySetupContext(name, acquire_gil)\865__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)866#endif867#define __Pyx_RefNannyFinishContext()\868__Pyx_RefNanny->FinishContext(&__pyx_refnanny)869#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)870#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)871#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)872#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)873#define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)874#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)875#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)876#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)877#else878#define __Pyx_RefNannyDeclarations879#define __Pyx_RefNannySetupContext(name, acquire_gil)880#define __Pyx_RefNannyFinishContext()881#define __Pyx_INCREF(r) Py_INCREF(r)882#define __Pyx_DECREF(r) Py_DECREF(r)883#define __Pyx_GOTREF(r)884#define __Pyx_GIVEREF(r)885#define __Pyx_XINCREF(r) Py_XINCREF(r)886#define __Pyx_XDECREF(r) Py_XDECREF(r)887#define __Pyx_XGOTREF(r)888#define __Pyx_XGIVEREF(r)889#endif890#define __Pyx_XDECREF_SET(r, v) do {\891PyObject *tmp = (PyObject *) r;\892r = v; __Pyx_XDECREF(tmp);\893} while (0)894#define __Pyx_DECREF_SET(r, v) do {\895PyObject *tmp = (PyObject *) r;\896r = v; __Pyx_DECREF(tmp);\897} while (0)898#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)899#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)900901/* PyObjectGetAttrStr.proto */902#if CYTHON_USE_TYPE_SLOTS903static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);904#else905#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)906#endif907908/* GetBuiltinName.proto */909static PyObject *__Pyx_GetBuiltinName(PyObject *name);910911/* RaiseArgTupleInvalid.proto */912static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,913Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);914915/* RaiseDoubleKeywords.proto */916static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);917918/* ParseKeywords.proto */919static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\920PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\921const char* function_name);922923/* PyCFunctionFastCall.proto */924#if CYTHON_FAST_PYCCALL925static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);926#else927#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)928#endif929930/* PyFunctionFastCall.proto */931#if CYTHON_FAST_PYCALL932#define __Pyx_PyFunction_FastCall(func, args, nargs)\933__Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)934#if 1 || PY_VERSION_HEX < 0x030600B1935static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);936#else937#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)938#endif939#define __Pyx_BUILD_ASSERT_EXPR(cond)\940(sizeof(char [1 - 2*!(cond)]) - 1)941#ifndef Py_MEMBER_SIZE942#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)943#endif944static size_t __pyx_pyframe_localsplus_offset = 0;945#include "frameobject.h"946#define __Pxy_PyFrame_Initialize_Offsets()\947((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\948(void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))949#define __Pyx_PyFrame_GetLocalsplus(frame)\950(assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))951#endif952953/* PyObjectCall.proto */954#if CYTHON_COMPILING_IN_CPYTHON955static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);956#else957#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)958#endif959960/* PyObjectCallMethO.proto */961#if CYTHON_COMPILING_IN_CPYTHON962static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);963#endif964965/* PyObjectCallOneArg.proto */966static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);967968/* TypeImport.proto */969#ifndef __PYX_HAVE_RT_ImportType_proto970#define __PYX_HAVE_RT_ImportType_proto971enum __Pyx_ImportType_CheckSize {972__Pyx_ImportType_CheckSize_Error = 0,973__Pyx_ImportType_CheckSize_Warn = 1,974__Pyx_ImportType_CheckSize_Ignore = 2975};976static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);977#endif978979/* PyDictVersioning.proto */980#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS981#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)982#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)983#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\984(version_var) = __PYX_GET_DICT_VERSION(dict);\985(cache_var) = (value);986#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\987static PY_UINT64_T __pyx_dict_version = 0;\988static PyObject *__pyx_dict_cached_value = NULL;\989if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\990(VAR) = __pyx_dict_cached_value;\991} else {\992(VAR) = __pyx_dict_cached_value = (LOOKUP);\993__pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\994}\995}996static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);997static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);998static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);999#else1000#define __PYX_GET_DICT_VERSION(dict) (0)1001#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)1002#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);1003#endif10041005/* PyThreadStateGet.proto */1006#if CYTHON_FAST_THREAD_STATE1007#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;1008#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;1009#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type1010#else1011#define __Pyx_PyThreadState_declare1012#define __Pyx_PyThreadState_assign1013#define __Pyx_PyErr_Occurred() PyErr_Occurred()1014#endif10151016/* PyErrFetchRestore.proto */1017#if CYTHON_FAST_THREAD_STATE1018#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)1019#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)1020#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)1021#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)1022#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)1023static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);1024static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);1025#if CYTHON_COMPILING_IN_CPYTHON1026#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))1027#else1028#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)1029#endif1030#else1031#define __Pyx_PyErr_Clear() PyErr_Clear()1032#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)1033#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)1034#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)1035#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)1036#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)1037#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)1038#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)1039#endif10401041/* CLineInTraceback.proto */1042#ifdef CYTHON_CLINE_IN_TRACEBACK1043#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)1044#else1045static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);1046#endif10471048/* CodeObjectCache.proto */1049typedef struct {1050PyCodeObject* code_object;1051int code_line;1052} __Pyx_CodeObjectCacheEntry;1053struct __Pyx_CodeObjectCache {1054int count;1055int max_count;1056__Pyx_CodeObjectCacheEntry* entries;1057};1058static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};1059static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);1060static PyCodeObject *__pyx_find_code_object(int code_line);1061static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);10621063/* AddTraceback.proto */1064static void __Pyx_AddTraceback(const char *funcname, int c_line,1065int py_line, const char *filename);10661067/* GCCDiagnostics.proto */1068#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))1069#define __Pyx_HAS_GCC_DIAGNOSTIC1070#endif10711072/* CIntToPy.proto */1073static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);10741075/* CIntFromPy.proto */1076static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);10771078/* CIntFromPy.proto */1079static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);10801081/* FastTypeChecks.proto */1082#if CYTHON_COMPILING_IN_CPYTHON1083#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)1084static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);1085static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);1086static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);1087#else1088#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)1089#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)1090#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))1091#endif1092#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)10931094/* CheckBinaryVersion.proto */1095static int __Pyx_check_binary_version(void);10961097/* InitStrings.proto */1098static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);109911001101/* Module declarations from 'cpython.version' */11021103/* Module declarations from '__builtin__' */11041105/* Module declarations from 'cpython.type' */1106static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;11071108/* Module declarations from 'libc.string' */11091110/* Module declarations from 'libc.stdio' */11111112/* Module declarations from 'cpython.object' */11131114/* Module declarations from 'cpython.ref' */11151116/* Module declarations from 'cpython.exc' */11171118/* Module declarations from 'cpython.module' */11191120/* Module declarations from 'cpython.mem' */11211122/* Module declarations from 'cpython.tuple' */11231124/* Module declarations from 'cpython.list' */11251126/* Module declarations from 'cpython.sequence' */11271128/* Module declarations from 'cpython.mapping' */11291130/* Module declarations from 'cpython.iterator' */11311132/* Module declarations from 'cpython.number' */11331134/* Module declarations from 'cpython.int' */11351136/* Module declarations from '__builtin__' */11371138/* Module declarations from 'cpython.bool' */1139static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;11401141/* Module declarations from 'cpython.long' */11421143/* Module declarations from 'cpython.float' */11441145/* Module declarations from '__builtin__' */11461147/* Module declarations from 'cpython.complex' */1148static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;11491150/* Module declarations from 'cpython.string' */11511152/* Module declarations from 'cpython.unicode' */11531154/* Module declarations from 'cpython.dict' */11551156/* Module declarations from 'cpython.instance' */11571158/* Module declarations from 'cpython.function' */11591160/* Module declarations from 'cpython.method' */11611162/* Module declarations from 'cpython.weakref' */11631164/* Module declarations from 'cpython.getargs' */11651166/* Module declarations from 'cpython.pythread' */11671168/* Module declarations from 'cpython.pystate' */11691170/* Module declarations from 'cpython.cobject' */11711172/* Module declarations from 'cpython.oldbuffer' */11731174/* Module declarations from 'cpython.set' */11751176/* Module declarations from 'cpython.buffer' */11771178/* Module declarations from 'cpython.bytes' */11791180/* Module declarations from 'cpython.pycapsule' */11811182/* Module declarations from 'cpython' */11831184/* Module declarations from 'libc.stdint' */11851186/* Module declarations from 'aiohttp._websocket' */1187#define __Pyx_MODULE_NAME "aiohttp._websocket"1188extern int __pyx_module_is_main_aiohttp___websocket;1189int __pyx_module_is_main_aiohttp___websocket = 0;11901191/* Implementation of 'aiohttp._websocket' */1192static PyObject *__pyx_builtin_range;1193static const char __pyx_k_i[] = "i";1194static const char __pyx_k_data[] = "data";1195static const char __pyx_k_main[] = "__main__";1196static const char __pyx_k_mask[] = "mask";1197static const char __pyx_k_name[] = "__name__";1198static const char __pyx_k_test[] = "__test__";1199static const char __pyx_k_range[] = "range";1200static const char __pyx_k_in_buf[] = "in_buf";1201static const char __pyx_k_data_len[] = "data_len";1202static const char __pyx_k_mask_buf[] = "mask_buf";1203static const char __pyx_k_uint32_msk[] = "uint32_msk";1204static const char __pyx_k_uint64_msk[] = "uint64_msk";1205static const char __pyx_k_aiohttp__websocket[] = "aiohttp._websocket";1206static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";1207static const char __pyx_k_websocket_mask_cython[] = "_websocket_mask_cython";1208static const char __pyx_k_aiohttp__websocket_pyx[] = "aiohttp/_websocket.pyx";1209static PyObject *__pyx_n_s_aiohttp__websocket;1210static PyObject *__pyx_kp_s_aiohttp__websocket_pyx;1211static PyObject *__pyx_n_s_cline_in_traceback;1212static PyObject *__pyx_n_s_data;1213static PyObject *__pyx_n_s_data_len;1214static PyObject *__pyx_n_s_i;1215static PyObject *__pyx_n_s_in_buf;1216static PyObject *__pyx_n_s_main;1217static PyObject *__pyx_n_s_mask;1218static PyObject *__pyx_n_s_mask_buf;1219static PyObject *__pyx_n_s_name;1220static PyObject *__pyx_n_s_range;1221static PyObject *__pyx_n_s_test;1222static PyObject *__pyx_n_s_uint32_msk;1223static PyObject *__pyx_n_s_uint64_msk;1224static PyObject *__pyx_n_s_websocket_mask_cython;1225static PyObject *__pyx_pf_7aiohttp_10_websocket__websocket_mask_cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mask, PyObject *__pyx_v_data); /* proto */1226static PyObject *__pyx_tuple_;1227static PyObject *__pyx_codeobj__2;1228/* Late includes */12291230/* "aiohttp/_websocket.pyx":111231*1232*1233* def _websocket_mask_cython(object mask, object data): # <<<<<<<<<<<<<<1234* """Note, this function mutates its `data` argument1235* """1236*/12371238/* Python wrapper */1239static PyObject *__pyx_pw_7aiohttp_10_websocket_1_websocket_mask_cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/1240static char __pyx_doc_7aiohttp_10_websocket__websocket_mask_cython[] = "Note, this function mutates its `data` argument\n ";1241static PyMethodDef __pyx_mdef_7aiohttp_10_websocket_1_websocket_mask_cython = {"_websocket_mask_cython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7aiohttp_10_websocket_1_websocket_mask_cython, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7aiohttp_10_websocket__websocket_mask_cython};1242static PyObject *__pyx_pw_7aiohttp_10_websocket_1_websocket_mask_cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {1243PyObject *__pyx_v_mask = 0;1244PyObject *__pyx_v_data = 0;1245int __pyx_lineno = 0;1246const char *__pyx_filename = NULL;1247int __pyx_clineno = 0;1248PyObject *__pyx_r = 0;1249__Pyx_RefNannyDeclarations1250__Pyx_RefNannySetupContext("_websocket_mask_cython (wrapper)", 0);1251{1252static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mask,&__pyx_n_s_data,0};1253PyObject* values[2] = {0,0};1254if (unlikely(__pyx_kwds)) {1255Py_ssize_t kw_args;1256const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);1257switch (pos_args) {1258case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);1259CYTHON_FALLTHROUGH;1260case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);1261CYTHON_FALLTHROUGH;1262case 0: break;1263default: goto __pyx_L5_argtuple_error;1264}1265kw_args = PyDict_Size(__pyx_kwds);1266switch (pos_args) {1267case 0:1268if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;1269else goto __pyx_L5_argtuple_error;1270CYTHON_FALLTHROUGH;1271case 1:1272if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;1273else {1274__Pyx_RaiseArgtupleInvalid("_websocket_mask_cython", 1, 2, 2, 1); __PYX_ERR(0, 11, __pyx_L3_error)1275}1276}1277if (unlikely(kw_args > 0)) {1278if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_websocket_mask_cython") < 0)) __PYX_ERR(0, 11, __pyx_L3_error)1279}1280} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {1281goto __pyx_L5_argtuple_error;1282} else {1283values[0] = PyTuple_GET_ITEM(__pyx_args, 0);1284values[1] = PyTuple_GET_ITEM(__pyx_args, 1);1285}1286__pyx_v_mask = values[0];1287__pyx_v_data = values[1];1288}1289goto __pyx_L4_argument_unpacking_done;1290__pyx_L5_argtuple_error:;1291__Pyx_RaiseArgtupleInvalid("_websocket_mask_cython", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 11, __pyx_L3_error)1292__pyx_L3_error:;1293__Pyx_AddTraceback("aiohttp._websocket._websocket_mask_cython", __pyx_clineno, __pyx_lineno, __pyx_filename);1294__Pyx_RefNannyFinishContext();1295return NULL;1296__pyx_L4_argument_unpacking_done:;1297__pyx_r = __pyx_pf_7aiohttp_10_websocket__websocket_mask_cython(__pyx_self, __pyx_v_mask, __pyx_v_data);12981299/* function exit code */1300__Pyx_RefNannyFinishContext();1301return __pyx_r;1302}13031304static PyObject *__pyx_pf_7aiohttp_10_websocket__websocket_mask_cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mask, PyObject *__pyx_v_data) {1305Py_ssize_t __pyx_v_data_len;1306Py_ssize_t __pyx_v_i;1307unsigned char *__pyx_v_in_buf;1308unsigned char const *__pyx_v_mask_buf;1309uint32_t __pyx_v_uint32_msk;1310uint64_t __pyx_v_uint64_msk;1311PyObject *__pyx_r = NULL;1312__Pyx_RefNannyDeclarations1313Py_ssize_t __pyx_t_1;1314int __pyx_t_2;1315int __pyx_t_3;1316PyObject *__pyx_t_4 = NULL;1317char *__pyx_t_5;1318uint64_t *__pyx_t_6;1319long __pyx_t_7;1320uint32_t *__pyx_t_8;1321Py_ssize_t __pyx_t_9;1322Py_ssize_t __pyx_t_10;1323Py_ssize_t __pyx_t_11;1324int __pyx_lineno = 0;1325const char *__pyx_filename = NULL;1326int __pyx_clineno = 0;1327__Pyx_RefNannySetupContext("_websocket_mask_cython", 0);1328__Pyx_INCREF(__pyx_v_mask);1329__Pyx_INCREF(__pyx_v_data);13301331/* "aiohttp/_websocket.pyx":221332* uint64_t uint64_msk1333*1334* assert len(mask) == 4 # <<<<<<<<<<<<<<1335*1336* if not isinstance(mask, bytes):1337*/1338#ifndef CYTHON_WITHOUT_ASSERTIONS1339if (unlikely(!Py_OptimizeFlag)) {1340__pyx_t_1 = PyObject_Length(__pyx_v_mask); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 22, __pyx_L1_error)1341if (unlikely(!((__pyx_t_1 == 4) != 0))) {1342PyErr_SetNone(PyExc_AssertionError);1343__PYX_ERR(0, 22, __pyx_L1_error)1344}1345}1346#endif13471348/* "aiohttp/_websocket.pyx":241349* assert len(mask) == 41350*1351* if not isinstance(mask, bytes): # <<<<<<<<<<<<<<1352* mask = bytes(mask)1353*1354*/1355__pyx_t_2 = PyBytes_Check(__pyx_v_mask);1356__pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);1357if (__pyx_t_3) {13581359/* "aiohttp/_websocket.pyx":251360*1361* if not isinstance(mask, bytes):1362* mask = bytes(mask) # <<<<<<<<<<<<<<1363*1364* if isinstance(data, bytearray):1365*/1366__pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error)1367__Pyx_GOTREF(__pyx_t_4);1368__Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_4);1369__pyx_t_4 = 0;13701371/* "aiohttp/_websocket.pyx":241372* assert len(mask) == 41373*1374* if not isinstance(mask, bytes): # <<<<<<<<<<<<<<1375* mask = bytes(mask)1376*1377*/1378}13791380/* "aiohttp/_websocket.pyx":271381* mask = bytes(mask)1382*1383* if isinstance(data, bytearray): # <<<<<<<<<<<<<<1384* data = <bytearray>data1385* else:1386*/1387__pyx_t_3 = PyByteArray_Check(__pyx_v_data);1388__pyx_t_2 = (__pyx_t_3 != 0);1389if (__pyx_t_2) {13901391/* "aiohttp/_websocket.pyx":281392*1393* if isinstance(data, bytearray):1394* data = <bytearray>data # <<<<<<<<<<<<<<1395* else:1396* data = bytearray(data)1397*/1398__pyx_t_4 = __pyx_v_data;1399__Pyx_INCREF(__pyx_t_4);1400__Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4);1401__pyx_t_4 = 0;14021403/* "aiohttp/_websocket.pyx":271404* mask = bytes(mask)1405*1406* if isinstance(data, bytearray): # <<<<<<<<<<<<<<1407* data = <bytearray>data1408* else:1409*/1410goto __pyx_L4;1411}14121413/* "aiohttp/_websocket.pyx":301414* data = <bytearray>data1415* else:1416* data = bytearray(data) # <<<<<<<<<<<<<<1417*1418* data_len = len(data)1419*/1420/*else*/ {1421__pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_v_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error)1422__Pyx_GOTREF(__pyx_t_4);1423__Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4);1424__pyx_t_4 = 0;1425}1426__pyx_L4:;14271428/* "aiohttp/_websocket.pyx":321429* data = bytearray(data)1430*1431* data_len = len(data) # <<<<<<<<<<<<<<1432* in_buf = <unsigned char*>PyByteArray_AsString(data)1433* mask_buf = <const unsigned char*>PyBytes_AsString(mask)1434*/1435__pyx_t_1 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 32, __pyx_L1_error)1436__pyx_v_data_len = __pyx_t_1;14371438/* "aiohttp/_websocket.pyx":331439*1440* data_len = len(data)1441* in_buf = <unsigned char*>PyByteArray_AsString(data) # <<<<<<<<<<<<<<1442* mask_buf = <const unsigned char*>PyBytes_AsString(mask)1443* uint32_msk = (<uint32_t*>mask_buf)[0]1444*/1445if (!(likely(PyByteArray_CheckExact(__pyx_v_data))||((__pyx_v_data) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytearray", Py_TYPE(__pyx_v_data)->tp_name), 0))) __PYX_ERR(0, 33, __pyx_L1_error)1446__pyx_t_5 = PyByteArray_AsString(((PyObject*)__pyx_v_data)); if (unlikely(__pyx_t_5 == ((char *)NULL))) __PYX_ERR(0, 33, __pyx_L1_error)1447__pyx_v_in_buf = ((unsigned char *)__pyx_t_5);14481449/* "aiohttp/_websocket.pyx":341450* data_len = len(data)1451* in_buf = <unsigned char*>PyByteArray_AsString(data)1452* mask_buf = <const unsigned char*>PyBytes_AsString(mask) # <<<<<<<<<<<<<<1453* uint32_msk = (<uint32_t*>mask_buf)[0]1454*1455*/1456__pyx_t_5 = PyBytes_AsString(__pyx_v_mask); if (unlikely(__pyx_t_5 == ((char *)NULL))) __PYX_ERR(0, 34, __pyx_L1_error)1457__pyx_v_mask_buf = ((unsigned char const *)__pyx_t_5);14581459/* "aiohttp/_websocket.pyx":351460* in_buf = <unsigned char*>PyByteArray_AsString(data)1461* mask_buf = <const unsigned char*>PyBytes_AsString(mask)1462* uint32_msk = (<uint32_t*>mask_buf)[0] # <<<<<<<<<<<<<<1463*1464* # TODO: align in_data ptr to achieve even faster speeds1465*/1466__pyx_v_uint32_msk = (((uint32_t *)__pyx_v_mask_buf)[0]);14671468/* "aiohttp/_websocket.pyx":401469* # does it need in python ?! malloc() always aligns to sizeof(long) bytes1470*1471* if sizeof(size_t) >= 8: # <<<<<<<<<<<<<<1472* uint64_msk = uint32_msk1473* uint64_msk = (uint64_msk << 32) | uint32_msk1474*/1475__pyx_t_2 = (((sizeof(size_t)) >= 8) != 0);1476if (__pyx_t_2) {14771478/* "aiohttp/_websocket.pyx":411479*1480* if sizeof(size_t) >= 8:1481* uint64_msk = uint32_msk # <<<<<<<<<<<<<<1482* uint64_msk = (uint64_msk << 32) | uint32_msk1483*1484*/1485__pyx_v_uint64_msk = __pyx_v_uint32_msk;14861487/* "aiohttp/_websocket.pyx":421488* if sizeof(size_t) >= 8:1489* uint64_msk = uint32_msk1490* uint64_msk = (uint64_msk << 32) | uint32_msk # <<<<<<<<<<<<<<1491*1492* while data_len >= 8:1493*/1494__pyx_v_uint64_msk = ((__pyx_v_uint64_msk << 32) | __pyx_v_uint32_msk);14951496/* "aiohttp/_websocket.pyx":441497* uint64_msk = (uint64_msk << 32) | uint32_msk1498*1499* while data_len >= 8: # <<<<<<<<<<<<<<1500* (<uint64_t*>in_buf)[0] ^= uint64_msk1501* in_buf += 81502*/1503while (1) {1504__pyx_t_2 = ((__pyx_v_data_len >= 8) != 0);1505if (!__pyx_t_2) break;15061507/* "aiohttp/_websocket.pyx":451508*1509* while data_len >= 8:1510* (<uint64_t*>in_buf)[0] ^= uint64_msk # <<<<<<<<<<<<<<1511* in_buf += 81512* data_len -= 81513*/1514__pyx_t_6 = ((uint64_t *)__pyx_v_in_buf);1515__pyx_t_7 = 0;1516(__pyx_t_6[__pyx_t_7]) = ((__pyx_t_6[__pyx_t_7]) ^ __pyx_v_uint64_msk);15171518/* "aiohttp/_websocket.pyx":461519* while data_len >= 8:1520* (<uint64_t*>in_buf)[0] ^= uint64_msk1521* in_buf += 8 # <<<<<<<<<<<<<<1522* data_len -= 81523*1524*/1525__pyx_v_in_buf = (__pyx_v_in_buf + 8);15261527/* "aiohttp/_websocket.pyx":471528* (<uint64_t*>in_buf)[0] ^= uint64_msk1529* in_buf += 81530* data_len -= 8 # <<<<<<<<<<<<<<1531*1532*1533*/1534__pyx_v_data_len = (__pyx_v_data_len - 8);1535}15361537/* "aiohttp/_websocket.pyx":401538* # does it need in python ?! malloc() always aligns to sizeof(long) bytes1539*1540* if sizeof(size_t) >= 8: # <<<<<<<<<<<<<<1541* uint64_msk = uint32_msk1542* uint64_msk = (uint64_msk << 32) | uint32_msk1543*/1544}15451546/* "aiohttp/_websocket.pyx":501547*1548*1549* while data_len >= 4: # <<<<<<<<<<<<<<1550* (<uint32_t*>in_buf)[0] ^= uint32_msk1551* in_buf += 41552*/1553while (1) {1554__pyx_t_2 = ((__pyx_v_data_len >= 4) != 0);1555if (!__pyx_t_2) break;15561557/* "aiohttp/_websocket.pyx":511558*1559* while data_len >= 4:1560* (<uint32_t*>in_buf)[0] ^= uint32_msk # <<<<<<<<<<<<<<1561* in_buf += 41562* data_len -= 41563*/1564__pyx_t_8 = ((uint32_t *)__pyx_v_in_buf);1565__pyx_t_7 = 0;1566(__pyx_t_8[__pyx_t_7]) = ((__pyx_t_8[__pyx_t_7]) ^ __pyx_v_uint32_msk);15671568/* "aiohttp/_websocket.pyx":521569* while data_len >= 4:1570* (<uint32_t*>in_buf)[0] ^= uint32_msk1571* in_buf += 4 # <<<<<<<<<<<<<<1572* data_len -= 41573*1574*/1575__pyx_v_in_buf = (__pyx_v_in_buf + 4);15761577/* "aiohttp/_websocket.pyx":531578* (<uint32_t*>in_buf)[0] ^= uint32_msk1579* in_buf += 41580* data_len -= 4 # <<<<<<<<<<<<<<1581*1582* for i in range(0, data_len):1583*/1584__pyx_v_data_len = (__pyx_v_data_len - 4);1585}15861587/* "aiohttp/_websocket.pyx":551588* data_len -= 41589*1590* for i in range(0, data_len): # <<<<<<<<<<<<<<1591* in_buf[i] ^= mask_buf[i]1592*/1593__pyx_t_1 = __pyx_v_data_len;1594__pyx_t_9 = __pyx_t_1;1595for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {1596__pyx_v_i = __pyx_t_10;15971598/* "aiohttp/_websocket.pyx":561599*1600* for i in range(0, data_len):1601* in_buf[i] ^= mask_buf[i] # <<<<<<<<<<<<<<1602*/1603__pyx_t_11 = __pyx_v_i;1604(__pyx_v_in_buf[__pyx_t_11]) = ((__pyx_v_in_buf[__pyx_t_11]) ^ (__pyx_v_mask_buf[__pyx_v_i]));1605}16061607/* "aiohttp/_websocket.pyx":111608*1609*1610* def _websocket_mask_cython(object mask, object data): # <<<<<<<<<<<<<<1611* """Note, this function mutates its `data` argument1612* """1613*/16141615/* function exit code */1616__pyx_r = Py_None; __Pyx_INCREF(Py_None);1617goto __pyx_L0;1618__pyx_L1_error:;1619__Pyx_XDECREF(__pyx_t_4);1620__Pyx_AddTraceback("aiohttp._websocket._websocket_mask_cython", __pyx_clineno, __pyx_lineno, __pyx_filename);1621__pyx_r = NULL;1622__pyx_L0:;1623__Pyx_XDECREF(__pyx_v_mask);1624__Pyx_XDECREF(__pyx_v_data);1625__Pyx_XGIVEREF(__pyx_r);1626__Pyx_RefNannyFinishContext();1627return __pyx_r;1628}16291630static PyMethodDef __pyx_methods[] = {1631{0, 0, 0, 0}1632};16331634#if PY_MAJOR_VERSION >= 31635#if CYTHON_PEP489_MULTI_PHASE_INIT1636static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/1637static int __pyx_pymod_exec__websocket(PyObject* module); /*proto*/1638static PyModuleDef_Slot __pyx_moduledef_slots[] = {1639{Py_mod_create, (void*)__pyx_pymod_create},1640{Py_mod_exec, (void*)__pyx_pymod_exec__websocket},1641{0, NULL}1642};1643#endif16441645static struct PyModuleDef __pyx_moduledef = {1646PyModuleDef_HEAD_INIT,1647"_websocket",16480, /* m_doc */1649#if CYTHON_PEP489_MULTI_PHASE_INIT16500, /* m_size */1651#else1652-1, /* m_size */1653#endif1654__pyx_methods /* m_methods */,1655#if CYTHON_PEP489_MULTI_PHASE_INIT1656__pyx_moduledef_slots, /* m_slots */1657#else1658NULL, /* m_reload */1659#endif1660NULL, /* m_traverse */1661NULL, /* m_clear */1662NULL /* m_free */1663};1664#endif1665#ifndef CYTHON_SMALL_CODE1666#if defined(__clang__)1667#define CYTHON_SMALL_CODE1668#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))1669#define CYTHON_SMALL_CODE __attribute__((cold))1670#else1671#define CYTHON_SMALL_CODE1672#endif1673#endif16741675static __Pyx_StringTabEntry __pyx_string_tab[] = {1676{&__pyx_n_s_aiohttp__websocket, __pyx_k_aiohttp__websocket, sizeof(__pyx_k_aiohttp__websocket), 0, 0, 1, 1},1677{&__pyx_kp_s_aiohttp__websocket_pyx, __pyx_k_aiohttp__websocket_pyx, sizeof(__pyx_k_aiohttp__websocket_pyx), 0, 0, 1, 0},1678{&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},1679{&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},1680{&__pyx_n_s_data_len, __pyx_k_data_len, sizeof(__pyx_k_data_len), 0, 0, 1, 1},1681{&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},1682{&__pyx_n_s_in_buf, __pyx_k_in_buf, sizeof(__pyx_k_in_buf), 0, 0, 1, 1},1683{&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},1684{&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},1685{&__pyx_n_s_mask_buf, __pyx_k_mask_buf, sizeof(__pyx_k_mask_buf), 0, 0, 1, 1},1686{&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},1687{&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},1688{&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},1689{&__pyx_n_s_uint32_msk, __pyx_k_uint32_msk, sizeof(__pyx_k_uint32_msk), 0, 0, 1, 1},1690{&__pyx_n_s_uint64_msk, __pyx_k_uint64_msk, sizeof(__pyx_k_uint64_msk), 0, 0, 1, 1},1691{&__pyx_n_s_websocket_mask_cython, __pyx_k_websocket_mask_cython, sizeof(__pyx_k_websocket_mask_cython), 0, 0, 1, 1},1692{0, 0, 0, 0, 0, 0, 0}1693};1694static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {1695__pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 55, __pyx_L1_error)1696return 0;1697__pyx_L1_error:;1698return -1;1699}17001701static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {1702__Pyx_RefNannyDeclarations1703__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);17041705/* "aiohttp/_websocket.pyx":111706*1707*1708* def _websocket_mask_cython(object mask, object data): # <<<<<<<<<<<<<<1709* """Note, this function mutates its `data` argument1710* """1711*/1712__pyx_tuple_ = PyTuple_Pack(8, __pyx_n_s_mask, __pyx_n_s_data, __pyx_n_s_data_len, __pyx_n_s_i, __pyx_n_s_in_buf, __pyx_n_s_mask_buf, __pyx_n_s_uint32_msk, __pyx_n_s_uint64_msk); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 11, __pyx_L1_error)1713__Pyx_GOTREF(__pyx_tuple_);1714__Pyx_GIVEREF(__pyx_tuple_);1715__pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_aiohttp__websocket_pyx, __pyx_n_s_websocket_mask_cython, 11, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 11, __pyx_L1_error)1716__Pyx_RefNannyFinishContext();1717return 0;1718__pyx_L1_error:;1719__Pyx_RefNannyFinishContext();1720return -1;1721}17221723static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {1724if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);1725return 0;1726__pyx_L1_error:;1727return -1;1728}17291730static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/1731static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/1732static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/1733static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/1734static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/1735static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/1736static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/17371738static int __Pyx_modinit_global_init_code(void) {1739__Pyx_RefNannyDeclarations1740__Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);1741/*--- Global init code ---*/1742__Pyx_RefNannyFinishContext();1743return 0;1744}17451746static int __Pyx_modinit_variable_export_code(void) {1747__Pyx_RefNannyDeclarations1748__Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);1749/*--- Variable export code ---*/1750__Pyx_RefNannyFinishContext();1751return 0;1752}17531754static int __Pyx_modinit_function_export_code(void) {1755__Pyx_RefNannyDeclarations1756__Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);1757/*--- Function export code ---*/1758__Pyx_RefNannyFinishContext();1759return 0;1760}17611762static int __Pyx_modinit_type_init_code(void) {1763__Pyx_RefNannyDeclarations1764__Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);1765/*--- Type init code ---*/1766__Pyx_RefNannyFinishContext();1767return 0;1768}17691770static int __Pyx_modinit_type_import_code(void) {1771__Pyx_RefNannyDeclarations1772PyObject *__pyx_t_1 = NULL;1773int __pyx_lineno = 0;1774const char *__pyx_filename = NULL;1775int __pyx_clineno = 0;1776__Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);1777/*--- Type import code ---*/1778__pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)1779__Pyx_GOTREF(__pyx_t_1);1780__pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",1781#if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B00001782sizeof(PyTypeObject),1783#else1784sizeof(PyHeapTypeObject),1785#endif1786__Pyx_ImportType_CheckSize_Warn);1787if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(1, 9, __pyx_L1_error)1788__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;1789__pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)1790__Pyx_GOTREF(__pyx_t_1);1791__pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn);1792if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(2, 8, __pyx_L1_error)1793__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;1794__pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error)1795__Pyx_GOTREF(__pyx_t_1);1796__pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn);1797if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(3, 15, __pyx_L1_error)1798__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;1799__Pyx_RefNannyFinishContext();1800return 0;1801__pyx_L1_error:;1802__Pyx_XDECREF(__pyx_t_1);1803__Pyx_RefNannyFinishContext();1804return -1;1805}18061807static int __Pyx_modinit_variable_import_code(void) {1808__Pyx_RefNannyDeclarations1809__Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);1810/*--- Variable import code ---*/1811__Pyx_RefNannyFinishContext();1812return 0;1813}18141815static int __Pyx_modinit_function_import_code(void) {1816__Pyx_RefNannyDeclarations1817__Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);1818/*--- Function import code ---*/1819__Pyx_RefNannyFinishContext();1820return 0;1821}182218231824#ifndef CYTHON_NO_PYINIT_EXPORT1825#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC1826#elif PY_MAJOR_VERSION < 31827#ifdef __cplusplus1828#define __Pyx_PyMODINIT_FUNC extern "C" void1829#else1830#define __Pyx_PyMODINIT_FUNC void1831#endif1832#else1833#ifdef __cplusplus1834#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *1835#else1836#define __Pyx_PyMODINIT_FUNC PyObject *1837#endif1838#endif183918401841#if PY_MAJOR_VERSION < 31842__Pyx_PyMODINIT_FUNC init_websocket(void) CYTHON_SMALL_CODE; /*proto*/1843__Pyx_PyMODINIT_FUNC init_websocket(void)1844#else1845__Pyx_PyMODINIT_FUNC PyInit__websocket(void) CYTHON_SMALL_CODE; /*proto*/1846__Pyx_PyMODINIT_FUNC PyInit__websocket(void)1847#if CYTHON_PEP489_MULTI_PHASE_INIT1848{1849return PyModuleDef_Init(&__pyx_moduledef);1850}1851static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {1852#if PY_VERSION_HEX >= 0x030700A11853static PY_INT64_T main_interpreter_id = -1;1854PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);1855if (main_interpreter_id == -1) {1856main_interpreter_id = current_id;1857return (unlikely(current_id == -1)) ? -1 : 0;1858} else if (unlikely(main_interpreter_id != current_id))1859#else1860static PyInterpreterState *main_interpreter = NULL;1861PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;1862if (!main_interpreter) {1863main_interpreter = current_interpreter;1864} else if (unlikely(main_interpreter != current_interpreter))1865#endif1866{1867PyErr_SetString(1868PyExc_ImportError,1869"Interpreter change detected - this module can only be loaded into one interpreter per process.");1870return -1;1871}1872return 0;1873}1874static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {1875PyObject *value = PyObject_GetAttrString(spec, from_name);1876int result = 0;1877if (likely(value)) {1878if (allow_none || value != Py_None) {1879result = PyDict_SetItemString(moddict, to_name, value);1880}1881Py_DECREF(value);1882} else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {1883PyErr_Clear();1884} else {1885result = -1;1886}1887return result;1888}1889static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {1890PyObject *module = NULL, *moddict, *modname;1891if (__Pyx_check_single_interpreter())1892return NULL;1893if (__pyx_m)1894return __Pyx_NewRef(__pyx_m);1895modname = PyObject_GetAttrString(spec, "name");1896if (unlikely(!modname)) goto bad;1897module = PyModule_NewObject(modname);1898Py_DECREF(modname);1899if (unlikely(!module)) goto bad;1900moddict = PyModule_GetDict(module);1901if (unlikely(!moddict)) goto bad;1902if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;1903if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;1904if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;1905if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;1906return module;1907bad:1908Py_XDECREF(module);1909return NULL;1910}191119121913static CYTHON_SMALL_CODE int __pyx_pymod_exec__websocket(PyObject *__pyx_pyinit_module)1914#endif1915#endif1916{1917PyObject *__pyx_t_1 = NULL;1918int __pyx_lineno = 0;1919const char *__pyx_filename = NULL;1920int __pyx_clineno = 0;1921__Pyx_RefNannyDeclarations1922#if CYTHON_PEP489_MULTI_PHASE_INIT1923if (__pyx_m) {1924if (__pyx_m == __pyx_pyinit_module) return 0;1925PyErr_SetString(PyExc_RuntimeError, "Module '_websocket' has already been imported. Re-initialisation is not supported.");1926return -1;1927}1928#elif PY_MAJOR_VERSION >= 31929if (__pyx_m) return __Pyx_NewRef(__pyx_m);1930#endif1931#if CYTHON_REFNANNY1932__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");1933if (!__Pyx_RefNanny) {1934PyErr_Clear();1935__Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");1936if (!__Pyx_RefNanny)1937Py_FatalError("failed to import 'refnanny' module");1938}1939#endif1940__Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__websocket(void)", 0);1941if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)1942#ifdef __Pxy_PyFrame_Initialize_Offsets1943__Pxy_PyFrame_Initialize_Offsets();1944#endif1945__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)1946__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)1947__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)1948#ifdef __Pyx_CyFunction_USED1949if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)1950#endif1951#ifdef __Pyx_FusedFunction_USED1952if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)1953#endif1954#ifdef __Pyx_Coroutine_USED1955if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)1956#endif1957#ifdef __Pyx_Generator_USED1958if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)1959#endif1960#ifdef __Pyx_AsyncGen_USED1961if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)1962#endif1963#ifdef __Pyx_StopAsyncIteration_USED1964if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)1965#endif1966/*--- Library function declarations ---*/1967/*--- Threads initialization code ---*/1968#if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS1969PyEval_InitThreads();1970#endif1971/*--- Module creation code ---*/1972#if CYTHON_PEP489_MULTI_PHASE_INIT1973__pyx_m = __pyx_pyinit_module;1974Py_INCREF(__pyx_m);1975#else1976#if PY_MAJOR_VERSION < 31977__pyx_m = Py_InitModule4("_websocket", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);1978#else1979__pyx_m = PyModule_Create(&__pyx_moduledef);1980#endif1981if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)1982#endif1983__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)1984Py_INCREF(__pyx_d);1985__pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)1986Py_INCREF(__pyx_b);1987__pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)1988Py_INCREF(__pyx_cython_runtime);1989if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);1990/*--- Initialize various global constants etc. ---*/1991if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)1992#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)1993if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)1994#endif1995if (__pyx_module_is_main_aiohttp___websocket) {1996if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)1997}1998#if PY_MAJOR_VERSION >= 31999{2000PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)2001if (!PyDict_GetItemString(modules, "aiohttp._websocket")) {2002if (unlikely(PyDict_SetItemString(modules, "aiohttp._websocket", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)2003}2004}2005#endif2006/*--- Builtin init code ---*/2007if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)2008/*--- Constants init code ---*/2009if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)2010/*--- Global type/function init code ---*/2011(void)__Pyx_modinit_global_init_code();2012(void)__Pyx_modinit_variable_export_code();2013(void)__Pyx_modinit_function_export_code();2014(void)__Pyx_modinit_type_init_code();2015if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)2016(void)__Pyx_modinit_variable_import_code();2017(void)__Pyx_modinit_function_import_code();2018/*--- Execution code ---*/2019#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)2020if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)2021#endif20222023/* "aiohttp/_websocket.pyx":112024*2025*2026* def _websocket_mask_cython(object mask, object data): # <<<<<<<<<<<<<<2027* """Note, this function mutates its `data` argument2028* """2029*/2030__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7aiohttp_10_websocket_1_websocket_mask_cython, NULL, __pyx_n_s_aiohttp__websocket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)2031__Pyx_GOTREF(__pyx_t_1);2032if (PyDict_SetItem(__pyx_d, __pyx_n_s_websocket_mask_cython, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)2033__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;20342035/* "aiohttp/_websocket.pyx":12036* from cpython cimport PyBytes_AsString # <<<<<<<<<<<<<<2037*2038*2039*/2040__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)2041__Pyx_GOTREF(__pyx_t_1);2042if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)2043__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;20442045/*--- Wrapped vars code ---*/20462047goto __pyx_L0;2048__pyx_L1_error:;2049__Pyx_XDECREF(__pyx_t_1);2050if (__pyx_m) {2051if (__pyx_d) {2052__Pyx_AddTraceback("init aiohttp._websocket", __pyx_clineno, __pyx_lineno, __pyx_filename);2053}2054Py_CLEAR(__pyx_m);2055} else if (!PyErr_Occurred()) {2056PyErr_SetString(PyExc_ImportError, "init aiohttp._websocket");2057}2058__pyx_L0:;2059__Pyx_RefNannyFinishContext();2060#if CYTHON_PEP489_MULTI_PHASE_INIT2061return (__pyx_m != NULL) ? 0 : -1;2062#elif PY_MAJOR_VERSION >= 32063return __pyx_m;2064#else2065return;2066#endif2067}20682069/* --- Runtime support code --- */2070/* Refnanny */2071#if CYTHON_REFNANNY2072static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {2073PyObject *m = NULL, *p = NULL;2074void *r = NULL;2075m = PyImport_ImportModule(modname);2076if (!m) goto end;2077p = PyObject_GetAttrString(m, "RefNannyAPI");2078if (!p) goto end;2079r = PyLong_AsVoidPtr(p);2080end:2081Py_XDECREF(p);2082Py_XDECREF(m);2083return (__Pyx_RefNannyAPIStruct *)r;2084}2085#endif20862087/* PyObjectGetAttrStr */2088#if CYTHON_USE_TYPE_SLOTS2089static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {2090PyTypeObject* tp = Py_TYPE(obj);2091if (likely(tp->tp_getattro))2092return tp->tp_getattro(obj, attr_name);2093#if PY_MAJOR_VERSION < 32094if (likely(tp->tp_getattr))2095return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));2096#endif2097return PyObject_GetAttr(obj, attr_name);2098}2099#endif21002101/* GetBuiltinName */2102static PyObject *__Pyx_GetBuiltinName(PyObject *name) {2103PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);2104if (unlikely(!result)) {2105PyErr_Format(PyExc_NameError,2106#if PY_MAJOR_VERSION >= 32107"name '%U' is not defined", name);2108#else2109"name '%.200s' is not defined", PyString_AS_STRING(name));2110#endif2111}2112return result;2113}21142115/* RaiseArgTupleInvalid */2116static void __Pyx_RaiseArgtupleInvalid(2117const char* func_name,2118int exact,2119Py_ssize_t num_min,2120Py_ssize_t num_max,2121Py_ssize_t num_found)2122{2123Py_ssize_t num_expected;2124const char *more_or_less;2125if (num_found < num_min) {2126num_expected = num_min;2127more_or_less = "at least";2128} else {2129num_expected = num_max;2130more_or_less = "at most";2131}2132if (exact) {2133more_or_less = "exactly";2134}2135PyErr_Format(PyExc_TypeError,2136"%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",2137func_name, more_or_less, num_expected,2138(num_expected == 1) ? "" : "s", num_found);2139}21402141/* RaiseDoubleKeywords */2142static void __Pyx_RaiseDoubleKeywordsError(2143const char* func_name,2144PyObject* kw_name)2145{2146PyErr_Format(PyExc_TypeError,2147#if PY_MAJOR_VERSION >= 32148"%s() got multiple values for keyword argument '%U'", func_name, kw_name);2149#else2150"%s() got multiple values for keyword argument '%s'", func_name,2151PyString_AsString(kw_name));2152#endif2153}21542155/* ParseKeywords */2156static int __Pyx_ParseOptionalKeywords(2157PyObject *kwds,2158PyObject **argnames[],2159PyObject *kwds2,2160PyObject *values[],2161Py_ssize_t num_pos_args,2162const char* function_name)2163{2164PyObject *key = 0, *value = 0;2165Py_ssize_t pos = 0;2166PyObject*** name;2167PyObject*** first_kw_arg = argnames + num_pos_args;2168while (PyDict_Next(kwds, &pos, &key, &value)) {2169name = first_kw_arg;2170while (*name && (**name != key)) name++;2171if (*name) {2172values[name-argnames] = value;2173continue;2174}2175name = first_kw_arg;2176#if PY_MAJOR_VERSION < 32177if (likely(PyString_Check(key))) {2178while (*name) {2179if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))2180&& _PyString_Eq(**name, key)) {2181values[name-argnames] = value;2182break;2183}2184name++;2185}2186if (*name) continue;2187else {2188PyObject*** argname = argnames;2189while (argname != first_kw_arg) {2190if ((**argname == key) || (2191(CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))2192&& _PyString_Eq(**argname, key))) {2193goto arg_passed_twice;2194}2195argname++;2196}2197}2198} else2199#endif2200if (likely(PyUnicode_Check(key))) {2201while (*name) {2202int cmp = (**name == key) ? 0 :2203#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 32204(__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :2205#endif2206PyUnicode_Compare(**name, key);2207if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;2208if (cmp == 0) {2209values[name-argnames] = value;2210break;2211}2212name++;2213}2214if (*name) continue;2215else {2216PyObject*** argname = argnames;2217while (argname != first_kw_arg) {2218int cmp = (**argname == key) ? 0 :2219#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 32220(__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :2221#endif2222PyUnicode_Compare(**argname, key);2223if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;2224if (cmp == 0) goto arg_passed_twice;2225argname++;2226}2227}2228} else2229goto invalid_keyword_type;2230if (kwds2) {2231if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;2232} else {2233goto invalid_keyword;2234}2235}2236return 0;2237arg_passed_twice:2238__Pyx_RaiseDoubleKeywordsError(function_name, key);2239goto bad;2240invalid_keyword_type:2241PyErr_Format(PyExc_TypeError,2242"%.200s() keywords must be strings", function_name);2243goto bad;2244invalid_keyword:2245PyErr_Format(PyExc_TypeError,2246#if PY_MAJOR_VERSION < 32247"%.200s() got an unexpected keyword argument '%.200s'",2248function_name, PyString_AsString(key));2249#else2250"%s() got an unexpected keyword argument '%U'",2251function_name, key);2252#endif2253bad:2254return -1;2255}22562257/* PyCFunctionFastCall */2258#if CYTHON_FAST_PYCCALL2259static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {2260PyCFunctionObject *func = (PyCFunctionObject*)func_obj;2261PyCFunction meth = PyCFunction_GET_FUNCTION(func);2262PyObject *self = PyCFunction_GET_SELF(func);2263int flags = PyCFunction_GET_FLAGS(func);2264assert(PyCFunction_Check(func));2265assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));2266assert(nargs >= 0);2267assert(nargs == 0 || args != NULL);2268/* _PyCFunction_FastCallDict() must not be called with an exception set,2269because it may clear it (directly or indirectly) and so the2270caller loses its exception */2271assert(!PyErr_Occurred());2272if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {2273return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);2274} else {2275return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);2276}2277}2278#endif22792280/* PyFunctionFastCall */2281#if CYTHON_FAST_PYCALL2282static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,2283PyObject *globals) {2284PyFrameObject *f;2285PyThreadState *tstate = __Pyx_PyThreadState_Current;2286PyObject **fastlocals;2287Py_ssize_t i;2288PyObject *result;2289assert(globals != NULL);2290/* XXX Perhaps we should create a specialized2291PyFrame_New() that doesn't take locals, but does2292take builtins without sanity checking them.2293*/2294assert(tstate != NULL);2295f = PyFrame_New(tstate, co, globals, NULL);2296if (f == NULL) {2297return NULL;2298}2299fastlocals = __Pyx_PyFrame_GetLocalsplus(f);2300for (i = 0; i < na; i++) {2301Py_INCREF(*args);2302fastlocals[i] = *args++;2303}2304result = PyEval_EvalFrameEx(f,0);2305++tstate->recursion_depth;2306Py_DECREF(f);2307--tstate->recursion_depth;2308return result;2309}2310#if 1 || PY_VERSION_HEX < 0x030600B12311static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {2312PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);2313PyObject *globals = PyFunction_GET_GLOBALS(func);2314PyObject *argdefs = PyFunction_GET_DEFAULTS(func);2315PyObject *closure;2316#if PY_MAJOR_VERSION >= 32317PyObject *kwdefs;2318#endif2319PyObject *kwtuple, **k;2320PyObject **d;2321Py_ssize_t nd;2322Py_ssize_t nk;2323PyObject *result;2324assert(kwargs == NULL || PyDict_Check(kwargs));2325nk = kwargs ? PyDict_Size(kwargs) : 0;2326if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {2327return NULL;2328}2329if (2330#if PY_MAJOR_VERSION >= 32331co->co_kwonlyargcount == 0 &&2332#endif2333likely(kwargs == NULL || nk == 0) &&2334co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {2335if (argdefs == NULL && co->co_argcount == nargs) {2336result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);2337goto done;2338}2339else if (nargs == 0 && argdefs != NULL2340&& co->co_argcount == Py_SIZE(argdefs)) {2341/* function called with no arguments, but all parameters have2342a default value: use default values as arguments .*/2343args = &PyTuple_GET_ITEM(argdefs, 0);2344result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);2345goto done;2346}2347}2348if (kwargs != NULL) {2349Py_ssize_t pos, i;2350kwtuple = PyTuple_New(2 * nk);2351if (kwtuple == NULL) {2352result = NULL;2353goto done;2354}2355k = &PyTuple_GET_ITEM(kwtuple, 0);2356pos = i = 0;2357while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {2358Py_INCREF(k[i]);2359Py_INCREF(k[i+1]);2360i += 2;2361}2362nk = i / 2;2363}2364else {2365kwtuple = NULL;2366k = NULL;2367}2368closure = PyFunction_GET_CLOSURE(func);2369#if PY_MAJOR_VERSION >= 32370kwdefs = PyFunction_GET_KW_DEFAULTS(func);2371#endif2372if (argdefs != NULL) {2373d = &PyTuple_GET_ITEM(argdefs, 0);2374nd = Py_SIZE(argdefs);2375}2376else {2377d = NULL;2378nd = 0;2379}2380#if PY_MAJOR_VERSION >= 32381result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,2382args, (int)nargs,2383k, (int)nk,2384d, (int)nd, kwdefs, closure);2385#else2386result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,2387args, (int)nargs,2388k, (int)nk,2389d, (int)nd, closure);2390#endif2391Py_XDECREF(kwtuple);2392done:2393Py_LeaveRecursiveCall();2394return result;2395}2396#endif2397#endif23982399/* PyObjectCall */2400#if CYTHON_COMPILING_IN_CPYTHON2401static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {2402PyObject *result;2403ternaryfunc call = Py_TYPE(func)->tp_call;2404if (unlikely(!call))2405return PyObject_Call(func, arg, kw);2406if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))2407return NULL;2408result = (*call)(func, arg, kw);2409Py_LeaveRecursiveCall();2410if (unlikely(!result) && unlikely(!PyErr_Occurred())) {2411PyErr_SetString(2412PyExc_SystemError,2413"NULL result without error in PyObject_Call");2414}2415return result;2416}2417#endif24182419/* PyObjectCallMethO */2420#if CYTHON_COMPILING_IN_CPYTHON2421static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {2422PyObject *self, *result;2423PyCFunction cfunc;2424cfunc = PyCFunction_GET_FUNCTION(func);2425self = PyCFunction_GET_SELF(func);2426if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))2427return NULL;2428result = cfunc(self, arg);2429Py_LeaveRecursiveCall();2430if (unlikely(!result) && unlikely(!PyErr_Occurred())) {2431PyErr_SetString(2432PyExc_SystemError,2433"NULL result without error in PyObject_Call");2434}2435return result;2436}2437#endif24382439/* PyObjectCallOneArg */2440#if CYTHON_COMPILING_IN_CPYTHON2441static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {2442PyObject *result;2443PyObject *args = PyTuple_New(1);2444if (unlikely(!args)) return NULL;2445Py_INCREF(arg);2446PyTuple_SET_ITEM(args, 0, arg);2447result = __Pyx_PyObject_Call(func, args, NULL);2448Py_DECREF(args);2449return result;2450}2451static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {2452#if CYTHON_FAST_PYCALL2453if (PyFunction_Check(func)) {2454return __Pyx_PyFunction_FastCall(func, &arg, 1);2455}2456#endif2457if (likely(PyCFunction_Check(func))) {2458if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {2459return __Pyx_PyObject_CallMethO(func, arg);2460#if CYTHON_FAST_PYCCALL2461} else if (__Pyx_PyFastCFunction_Check(func)) {2462return __Pyx_PyCFunction_FastCall(func, &arg, 1);2463#endif2464}2465}2466return __Pyx__PyObject_CallOneArg(func, arg);2467}2468#else2469static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {2470PyObject *result;2471PyObject *args = PyTuple_Pack(1, arg);2472if (unlikely(!args)) return NULL;2473result = __Pyx_PyObject_Call(func, args, NULL);2474Py_DECREF(args);2475return result;2476}2477#endif24782479/* TypeImport */2480#ifndef __PYX_HAVE_RT_ImportType2481#define __PYX_HAVE_RT_ImportType2482static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,2483size_t size, enum __Pyx_ImportType_CheckSize check_size)2484{2485PyObject *result = 0;2486char warning[200];2487Py_ssize_t basicsize;2488#ifdef Py_LIMITED_API2489PyObject *py_basicsize;2490#endif2491result = PyObject_GetAttrString(module, class_name);2492if (!result)2493goto bad;2494if (!PyType_Check(result)) {2495PyErr_Format(PyExc_TypeError,2496"%.200s.%.200s is not a type object",2497module_name, class_name);2498goto bad;2499}2500#ifndef Py_LIMITED_API2501basicsize = ((PyTypeObject *)result)->tp_basicsize;2502#else2503py_basicsize = PyObject_GetAttrString(result, "__basicsize__");2504if (!py_basicsize)2505goto bad;2506basicsize = PyLong_AsSsize_t(py_basicsize);2507Py_DECREF(py_basicsize);2508py_basicsize = 0;2509if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())2510goto bad;2511#endif2512if ((size_t)basicsize < size) {2513PyErr_Format(PyExc_ValueError,2514"%.200s.%.200s size changed, may indicate binary incompatibility. "2515"Expected %zd from C header, got %zd from PyObject",2516module_name, class_name, size, basicsize);2517goto bad;2518}2519if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {2520PyErr_Format(PyExc_ValueError,2521"%.200s.%.200s size changed, may indicate binary incompatibility. "2522"Expected %zd from C header, got %zd from PyObject",2523module_name, class_name, size, basicsize);2524goto bad;2525}2526else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {2527PyOS_snprintf(warning, sizeof(warning),2528"%s.%s size changed, may indicate binary incompatibility. "2529"Expected %zd from C header, got %zd from PyObject",2530module_name, class_name, size, basicsize);2531if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;2532}2533return (PyTypeObject *)result;2534bad:2535Py_XDECREF(result);2536return NULL;2537}2538#endif25392540/* PyDictVersioning */2541#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS2542static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {2543PyObject *dict = Py_TYPE(obj)->tp_dict;2544return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;2545}2546static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {2547PyObject **dictptr = NULL;2548Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;2549if (offset) {2550#if CYTHON_COMPILING_IN_CPYTHON2551dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);2552#else2553dictptr = _PyObject_GetDictPtr(obj);2554#endif2555}2556return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;2557}2558static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {2559PyObject *dict = Py_TYPE(obj)->tp_dict;2560if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))2561return 0;2562return obj_dict_version == __Pyx_get_object_dict_version(obj);2563}2564#endif25652566/* PyErrFetchRestore */2567#if CYTHON_FAST_THREAD_STATE2568static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {2569PyObject *tmp_type, *tmp_value, *tmp_tb;2570tmp_type = tstate->curexc_type;2571tmp_value = tstate->curexc_value;2572tmp_tb = tstate->curexc_traceback;2573tstate->curexc_type = type;2574tstate->curexc_value = value;2575tstate->curexc_traceback = tb;2576Py_XDECREF(tmp_type);2577Py_XDECREF(tmp_value);2578Py_XDECREF(tmp_tb);2579}2580static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {2581*type = tstate->curexc_type;2582*value = tstate->curexc_value;2583*tb = tstate->curexc_traceback;2584tstate->curexc_type = 0;2585tstate->curexc_value = 0;2586tstate->curexc_traceback = 0;2587}2588#endif25892590/* CLineInTraceback */2591#ifndef CYTHON_CLINE_IN_TRACEBACK2592static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {2593PyObject *use_cline;2594PyObject *ptype, *pvalue, *ptraceback;2595#if CYTHON_COMPILING_IN_CPYTHON2596PyObject **cython_runtime_dict;2597#endif2598if (unlikely(!__pyx_cython_runtime)) {2599return c_line;2600}2601__Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);2602#if CYTHON_COMPILING_IN_CPYTHON2603cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);2604if (likely(cython_runtime_dict)) {2605__PYX_PY_DICT_LOOKUP_IF_MODIFIED(2606use_cline, *cython_runtime_dict,2607__Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))2608} else2609#endif2610{2611PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);2612if (use_cline_obj) {2613use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;2614Py_DECREF(use_cline_obj);2615} else {2616PyErr_Clear();2617use_cline = NULL;2618}2619}2620if (!use_cline) {2621c_line = 0;2622PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);2623}2624else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {2625c_line = 0;2626}2627__Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);2628return c_line;2629}2630#endif26312632/* CodeObjectCache */2633static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {2634int start = 0, mid = 0, end = count - 1;2635if (end >= 0 && code_line > entries[end].code_line) {2636return count;2637}2638while (start < end) {2639mid = start + (end - start) / 2;2640if (code_line < entries[mid].code_line) {2641end = mid;2642} else if (code_line > entries[mid].code_line) {2643start = mid + 1;2644} else {2645return mid;2646}2647}2648if (code_line <= entries[mid].code_line) {2649return mid;2650} else {2651return mid + 1;2652}2653}2654static PyCodeObject *__pyx_find_code_object(int code_line) {2655PyCodeObject* code_object;2656int pos;2657if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {2658return NULL;2659}2660pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);2661if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {2662return NULL;2663}2664code_object = __pyx_code_cache.entries[pos].code_object;2665Py_INCREF(code_object);2666return code_object;2667}2668static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {2669int pos, i;2670__Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;2671if (unlikely(!code_line)) {2672return;2673}2674if (unlikely(!entries)) {2675entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));2676if (likely(entries)) {2677__pyx_code_cache.entries = entries;2678__pyx_code_cache.max_count = 64;2679__pyx_code_cache.count = 1;2680entries[0].code_line = code_line;2681entries[0].code_object = code_object;2682Py_INCREF(code_object);2683}2684return;2685}2686pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);2687if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {2688PyCodeObject* tmp = entries[pos].code_object;2689entries[pos].code_object = code_object;2690Py_DECREF(tmp);2691return;2692}2693if (__pyx_code_cache.count == __pyx_code_cache.max_count) {2694int new_max = __pyx_code_cache.max_count + 64;2695entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(2696__pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));2697if (unlikely(!entries)) {2698return;2699}2700__pyx_code_cache.entries = entries;2701__pyx_code_cache.max_count = new_max;2702}2703for (i=__pyx_code_cache.count; i>pos; i--) {2704entries[i] = entries[i-1];2705}2706entries[pos].code_line = code_line;2707entries[pos].code_object = code_object;2708__pyx_code_cache.count++;2709Py_INCREF(code_object);2710}27112712/* AddTraceback */2713#include "compile.h"2714#include "frameobject.h"2715#include "traceback.h"2716static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(2717const char *funcname, int c_line,2718int py_line, const char *filename) {2719PyCodeObject *py_code = 0;2720PyObject *py_srcfile = 0;2721PyObject *py_funcname = 0;2722#if PY_MAJOR_VERSION < 32723py_srcfile = PyString_FromString(filename);2724#else2725py_srcfile = PyUnicode_FromString(filename);2726#endif2727if (!py_srcfile) goto bad;2728if (c_line) {2729#if PY_MAJOR_VERSION < 32730py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);2731#else2732py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);2733#endif2734}2735else {2736#if PY_MAJOR_VERSION < 32737py_funcname = PyString_FromString(funcname);2738#else2739py_funcname = PyUnicode_FromString(funcname);2740#endif2741}2742if (!py_funcname) goto bad;2743py_code = __Pyx_PyCode_New(27440,27450,27460,27470,27480,2749__pyx_empty_bytes, /*PyObject *code,*/2750__pyx_empty_tuple, /*PyObject *consts,*/2751__pyx_empty_tuple, /*PyObject *names,*/2752__pyx_empty_tuple, /*PyObject *varnames,*/2753__pyx_empty_tuple, /*PyObject *freevars,*/2754__pyx_empty_tuple, /*PyObject *cellvars,*/2755py_srcfile, /*PyObject *filename,*/2756py_funcname, /*PyObject *name,*/2757py_line,2758__pyx_empty_bytes /*PyObject *lnotab*/2759);2760Py_DECREF(py_srcfile);2761Py_DECREF(py_funcname);2762return py_code;2763bad:2764Py_XDECREF(py_srcfile);2765Py_XDECREF(py_funcname);2766return NULL;2767}2768static void __Pyx_AddTraceback(const char *funcname, int c_line,2769int py_line, const char *filename) {2770PyCodeObject *py_code = 0;2771PyFrameObject *py_frame = 0;2772PyThreadState *tstate = __Pyx_PyThreadState_Current;2773if (c_line) {2774c_line = __Pyx_CLineForTraceback(tstate, c_line);2775}2776py_code = __pyx_find_code_object(c_line ? -c_line : py_line);2777if (!py_code) {2778py_code = __Pyx_CreateCodeObjectForTraceback(2779funcname, c_line, py_line, filename);2780if (!py_code) goto bad;2781__pyx_insert_code_object(c_line ? -c_line : py_line, py_code);2782}2783py_frame = PyFrame_New(2784tstate, /*PyThreadState *tstate,*/2785py_code, /*PyCodeObject *code,*/2786__pyx_d, /*PyObject *globals,*/27870 /*PyObject *locals*/2788);2789if (!py_frame) goto bad;2790__Pyx_PyFrame_SetLineNumber(py_frame, py_line);2791PyTraceBack_Here(py_frame);2792bad:2793Py_XDECREF(py_code);2794Py_XDECREF(py_frame);2795}27962797/* CIntToPy */2798static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {2799#ifdef __Pyx_HAS_GCC_DIAGNOSTIC2800#pragma GCC diagnostic push2801#pragma GCC diagnostic ignored "-Wconversion"2802#endif2803const long neg_one = (long) -1, const_zero = (long) 0;2804#ifdef __Pyx_HAS_GCC_DIAGNOSTIC2805#pragma GCC diagnostic pop2806#endif2807const int is_unsigned = neg_one > const_zero;2808if (is_unsigned) {2809if (sizeof(long) < sizeof(long)) {2810return PyInt_FromLong((long) value);2811} else if (sizeof(long) <= sizeof(unsigned long)) {2812return PyLong_FromUnsignedLong((unsigned long) value);2813#ifdef HAVE_LONG_LONG2814} else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {2815return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);2816#endif2817}2818} else {2819if (sizeof(long) <= sizeof(long)) {2820return PyInt_FromLong((long) value);2821#ifdef HAVE_LONG_LONG2822} else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {2823return PyLong_FromLongLong((PY_LONG_LONG) value);2824#endif2825}2826}2827{2828int one = 1; int little = (int)*(unsigned char *)&one;2829unsigned char *bytes = (unsigned char *)&value;2830return _PyLong_FromByteArray(bytes, sizeof(long),2831little, !is_unsigned);2832}2833}28342835/* CIntFromPyVerify */2836#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\2837__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)2838#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\2839__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)2840#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\2841{\2842func_type value = func_value;\2843if (sizeof(target_type) < sizeof(func_type)) {\2844if (unlikely(value != (func_type) (target_type) value)) {\2845func_type zero = 0;\2846if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\2847return (target_type) -1;\2848if (is_unsigned && unlikely(value < zero))\2849goto raise_neg_overflow;\2850else\2851goto raise_overflow;\2852}\2853}\2854return (target_type) value;\2855}28562857/* CIntFromPy */2858static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {2859#ifdef __Pyx_HAS_GCC_DIAGNOSTIC2860#pragma GCC diagnostic push2861#pragma GCC diagnostic ignored "-Wconversion"2862#endif2863const long neg_one = (long) -1, const_zero = (long) 0;2864#ifdef __Pyx_HAS_GCC_DIAGNOSTIC2865#pragma GCC diagnostic pop2866#endif2867const int is_unsigned = neg_one > const_zero;2868#if PY_MAJOR_VERSION < 32869if (likely(PyInt_Check(x))) {2870if (sizeof(long) < sizeof(long)) {2871__PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))2872} else {2873long val = PyInt_AS_LONG(x);2874if (is_unsigned && unlikely(val < 0)) {2875goto raise_neg_overflow;2876}2877return (long) val;2878}2879} else2880#endif2881if (likely(PyLong_Check(x))) {2882if (is_unsigned) {2883#if CYTHON_USE_PYLONG_INTERNALS2884const digit* digits = ((PyLongObject*)x)->ob_digit;2885switch (Py_SIZE(x)) {2886case 0: return (long) 0;2887case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])2888case 2:2889if (8 * sizeof(long) > 1 * PyLong_SHIFT) {2890if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {2891__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))2892} else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {2893return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));2894}2895}2896break;2897case 3:2898if (8 * sizeof(long) > 2 * PyLong_SHIFT) {2899if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {2900__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))2901} else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {2902return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));2903}2904}2905break;2906case 4:2907if (8 * sizeof(long) > 3 * PyLong_SHIFT) {2908if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {2909__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))2910} else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {2911return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));2912}2913}2914break;2915}2916#endif2917#if CYTHON_COMPILING_IN_CPYTHON2918if (unlikely(Py_SIZE(x) < 0)) {2919goto raise_neg_overflow;2920}2921#else2922{2923int result = PyObject_RichCompareBool(x, Py_False, Py_LT);2924if (unlikely(result < 0))2925return (long) -1;2926if (unlikely(result == 1))2927goto raise_neg_overflow;2928}2929#endif2930if (sizeof(long) <= sizeof(unsigned long)) {2931__PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))2932#ifdef HAVE_LONG_LONG2933} else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {2934__PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))2935#endif2936}2937} else {2938#if CYTHON_USE_PYLONG_INTERNALS2939const digit* digits = ((PyLongObject*)x)->ob_digit;2940switch (Py_SIZE(x)) {2941case 0: return (long) 0;2942case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))2943case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])2944case -2:2945if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {2946if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {2947__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))2948} else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {2949return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));2950}2951}2952break;2953case 2:2954if (8 * sizeof(long) > 1 * PyLong_SHIFT) {2955if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {2956__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))2957} else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {2958return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));2959}2960}2961break;2962case -3:2963if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {2964if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {2965__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))2966} else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {2967return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));2968}2969}2970break;2971case 3:2972if (8 * sizeof(long) > 2 * PyLong_SHIFT) {2973if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {2974__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))2975} else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {2976return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));2977}2978}2979break;2980case -4:2981if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {2982if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {2983__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))2984} else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {2985return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));2986}2987}2988break;2989case 4:2990if (8 * sizeof(long) > 3 * PyLong_SHIFT) {2991if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {2992__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))2993} else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {2994return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));2995}2996}2997break;2998}2999#endif3000if (sizeof(long) <= sizeof(long)) {3001__PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))3002#ifdef HAVE_LONG_LONG3003} else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {3004__PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))3005#endif3006}3007}3008{3009#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)3010PyErr_SetString(PyExc_RuntimeError,3011"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");3012#else3013long val;3014PyObject *v = __Pyx_PyNumber_IntOrLong(x);3015#if PY_MAJOR_VERSION < 33016if (likely(v) && !PyLong_Check(v)) {3017PyObject *tmp = v;3018v = PyNumber_Long(tmp);3019Py_DECREF(tmp);3020}3021#endif3022if (likely(v)) {3023int one = 1; int is_little = (int)*(unsigned char *)&one;3024unsigned char *bytes = (unsigned char *)&val;3025int ret = _PyLong_AsByteArray((PyLongObject *)v,3026bytes, sizeof(val),3027is_little, !is_unsigned);3028Py_DECREF(v);3029if (likely(!ret))3030return val;3031}3032#endif3033return (long) -1;3034}3035} else {3036long val;3037PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);3038if (!tmp) return (long) -1;3039val = __Pyx_PyInt_As_long(tmp);3040Py_DECREF(tmp);3041return val;3042}3043raise_overflow:3044PyErr_SetString(PyExc_OverflowError,3045"value too large to convert to long");3046return (long) -1;3047raise_neg_overflow:3048PyErr_SetString(PyExc_OverflowError,3049"can't convert negative value to long");3050return (long) -1;3051}30523053/* CIntFromPy */3054static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {3055#ifdef __Pyx_HAS_GCC_DIAGNOSTIC3056#pragma GCC diagnostic push3057#pragma GCC diagnostic ignored "-Wconversion"3058#endif3059const int neg_one = (int) -1, const_zero = (int) 0;3060#ifdef __Pyx_HAS_GCC_DIAGNOSTIC3061#pragma GCC diagnostic pop3062#endif3063const int is_unsigned = neg_one > const_zero;3064#if PY_MAJOR_VERSION < 33065if (likely(PyInt_Check(x))) {3066if (sizeof(int) < sizeof(long)) {3067__PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))3068} else {3069long val = PyInt_AS_LONG(x);3070if (is_unsigned && unlikely(val < 0)) {3071goto raise_neg_overflow;3072}3073return (int) val;3074}3075} else3076#endif3077if (likely(PyLong_Check(x))) {3078if (is_unsigned) {3079#if CYTHON_USE_PYLONG_INTERNALS3080const digit* digits = ((PyLongObject*)x)->ob_digit;3081switch (Py_SIZE(x)) {3082case 0: return (int) 0;3083case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])3084case 2:3085if (8 * sizeof(int) > 1 * PyLong_SHIFT) {3086if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {3087__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))3088} else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {3089return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));3090}3091}3092break;3093case 3:3094if (8 * sizeof(int) > 2 * PyLong_SHIFT) {3095if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {3096__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))3097} else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {3098return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));3099}3100}3101break;3102case 4:3103if (8 * sizeof(int) > 3 * PyLong_SHIFT) {3104if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {3105__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))3106} else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {3107return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));3108}3109}3110break;3111}3112#endif3113#if CYTHON_COMPILING_IN_CPYTHON3114if (unlikely(Py_SIZE(x) < 0)) {3115goto raise_neg_overflow;3116}3117#else3118{3119int result = PyObject_RichCompareBool(x, Py_False, Py_LT);3120if (unlikely(result < 0))3121return (int) -1;3122if (unlikely(result == 1))3123goto raise_neg_overflow;3124}3125#endif3126if (sizeof(int) <= sizeof(unsigned long)) {3127__PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))3128#ifdef HAVE_LONG_LONG3129} else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {3130__PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))3131#endif3132}3133} else {3134#if CYTHON_USE_PYLONG_INTERNALS3135const digit* digits = ((PyLongObject*)x)->ob_digit;3136switch (Py_SIZE(x)) {3137case 0: return (int) 0;3138case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))3139case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])3140case -2:3141if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {3142if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {3143__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))3144} else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {3145return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));3146}3147}3148break;3149case 2:3150if (8 * sizeof(int) > 1 * PyLong_SHIFT) {3151if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {3152__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))3153} else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {3154return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));3155}3156}3157break;3158case -3:3159if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {3160if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {3161__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))3162} else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {3163return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));3164}3165}3166break;3167case 3:3168if (8 * sizeof(int) > 2 * PyLong_SHIFT) {3169if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {3170__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))3171} else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {3172return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));3173}3174}3175break;3176case -4:3177if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {3178if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {3179__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))3180} else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {3181return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));3182}3183}3184break;3185case 4:3186if (8 * sizeof(int) > 3 * PyLong_SHIFT) {3187if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {3188__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))3189} else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {3190return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));3191}3192}3193break;3194}3195#endif3196if (sizeof(int) <= sizeof(long)) {3197__PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))3198#ifdef HAVE_LONG_LONG3199} else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {3200__PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))3201#endif3202}3203}3204{3205#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)3206PyErr_SetString(PyExc_RuntimeError,3207"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");3208#else3209int val;3210PyObject *v = __Pyx_PyNumber_IntOrLong(x);3211#if PY_MAJOR_VERSION < 33212if (likely(v) && !PyLong_Check(v)) {3213PyObject *tmp = v;3214v = PyNumber_Long(tmp);3215Py_DECREF(tmp);3216}3217#endif3218if (likely(v)) {3219int one = 1; int is_little = (int)*(unsigned char *)&one;3220unsigned char *bytes = (unsigned char *)&val;3221int ret = _PyLong_AsByteArray((PyLongObject *)v,3222bytes, sizeof(val),3223is_little, !is_unsigned);3224Py_DECREF(v);3225if (likely(!ret))3226return val;3227}3228#endif3229return (int) -1;3230}3231} else {3232int val;3233PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);3234if (!tmp) return (int) -1;3235val = __Pyx_PyInt_As_int(tmp);3236Py_DECREF(tmp);3237return val;3238}3239raise_overflow:3240PyErr_SetString(PyExc_OverflowError,3241"value too large to convert to int");3242return (int) -1;3243raise_neg_overflow:3244PyErr_SetString(PyExc_OverflowError,3245"can't convert negative value to int");3246return (int) -1;3247}32483249/* FastTypeChecks */3250#if CYTHON_COMPILING_IN_CPYTHON3251static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {3252while (a) {3253a = a->tp_base;3254if (a == b)3255return 1;3256}3257return b == &PyBaseObject_Type;3258}3259static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {3260PyObject *mro;3261if (a == b) return 1;3262mro = a->tp_mro;3263if (likely(mro)) {3264Py_ssize_t i, n;3265n = PyTuple_GET_SIZE(mro);3266for (i = 0; i < n; i++) {3267if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)3268return 1;3269}3270return 0;3271}3272return __Pyx_InBases(a, b);3273}3274#if PY_MAJOR_VERSION == 23275static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {3276PyObject *exception, *value, *tb;3277int res;3278__Pyx_PyThreadState_declare3279__Pyx_PyThreadState_assign3280__Pyx_ErrFetch(&exception, &value, &tb);3281res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;3282if (unlikely(res == -1)) {3283PyErr_WriteUnraisable(err);3284res = 0;3285}3286if (!res) {3287res = PyObject_IsSubclass(err, exc_type2);3288if (unlikely(res == -1)) {3289PyErr_WriteUnraisable(err);3290res = 0;3291}3292}3293__Pyx_ErrRestore(exception, value, tb);3294return res;3295}3296#else3297static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {3298int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;3299if (!res) {3300res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);3301}3302return res;3303}3304#endif3305static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {3306Py_ssize_t i, n;3307assert(PyExceptionClass_Check(exc_type));3308n = PyTuple_GET_SIZE(tuple);3309#if PY_MAJOR_VERSION >= 33310for (i=0; i<n; i++) {3311if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;3312}3313#endif3314for (i=0; i<n; i++) {3315PyObject *t = PyTuple_GET_ITEM(tuple, i);3316#if PY_MAJOR_VERSION < 33317if (likely(exc_type == t)) return 1;3318#endif3319if (likely(PyExceptionClass_Check(t))) {3320if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;3321} else {3322}3323}3324return 0;3325}3326static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {3327if (likely(err == exc_type)) return 1;3328if (likely(PyExceptionClass_Check(err))) {3329if (likely(PyExceptionClass_Check(exc_type))) {3330return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);3331} else if (likely(PyTuple_Check(exc_type))) {3332return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);3333} else {3334}3335}3336return PyErr_GivenExceptionMatches(err, exc_type);3337}3338static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {3339assert(PyExceptionClass_Check(exc_type1));3340assert(PyExceptionClass_Check(exc_type2));3341if (likely(err == exc_type1 || err == exc_type2)) return 1;3342if (likely(PyExceptionClass_Check(err))) {3343return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);3344}3345return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));3346}3347#endif33483349/* CheckBinaryVersion */3350static int __Pyx_check_binary_version(void) {3351char ctversion[4], rtversion[4];3352PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);3353PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());3354if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {3355char message[200];3356PyOS_snprintf(message, sizeof(message),3357"compiletime version %s of module '%.100s' "3358"does not match runtime version %s",3359ctversion, __Pyx_MODULE_NAME, rtversion);3360return PyErr_WarnEx(NULL, message, 1);3361}3362return 0;3363}33643365/* InitStrings */3366static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {3367while (t->p) {3368#if PY_MAJOR_VERSION < 33369if (t->is_unicode) {3370*t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);3371} else if (t->intern) {3372*t->p = PyString_InternFromString(t->s);3373} else {3374*t->p = PyString_FromStringAndSize(t->s, t->n - 1);3375}3376#else3377if (t->is_unicode | t->is_str) {3378if (t->intern) {3379*t->p = PyUnicode_InternFromString(t->s);3380} else if (t->encoding) {3381*t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);3382} else {3383*t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);3384}3385} else {3386*t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);3387}3388#endif3389if (!*t->p)3390return -1;3391if (PyObject_Hash(*t->p) == -1)3392return -1;3393++t;3394}3395return 0;3396}33973398static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {3399return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));3400}3401static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {3402Py_ssize_t ignore;3403return __Pyx_PyObject_AsStringAndSize(o, &ignore);3404}3405#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT3406#if !CYTHON_PEP393_ENABLED3407static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {3408char* defenc_c;3409PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);3410if (!defenc) return NULL;3411defenc_c = PyBytes_AS_STRING(defenc);3412#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII3413{3414char* end = defenc_c + PyBytes_GET_SIZE(defenc);3415char* c;3416for (c = defenc_c; c < end; c++) {3417if ((unsigned char) (*c) >= 128) {3418PyUnicode_AsASCIIString(o);3419return NULL;3420}3421}3422}3423#endif3424*length = PyBytes_GET_SIZE(defenc);3425return defenc_c;3426}3427#else3428static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {3429if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;3430#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII3431if (likely(PyUnicode_IS_ASCII(o))) {3432*length = PyUnicode_GET_LENGTH(o);3433return PyUnicode_AsUTF8(o);3434} else {3435PyUnicode_AsASCIIString(o);3436return NULL;3437}3438#else3439return PyUnicode_AsUTF8AndSize(o, length);3440#endif3441}3442#endif3443#endif3444static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {3445#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT3446if (3447#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII3448__Pyx_sys_getdefaultencoding_not_ascii &&3449#endif3450PyUnicode_Check(o)) {3451return __Pyx_PyUnicode_AsStringAndSize(o, length);3452} else3453#endif3454#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))3455if (PyByteArray_Check(o)) {3456*length = PyByteArray_GET_SIZE(o);3457return PyByteArray_AS_STRING(o);3458} else3459#endif3460{3461char* result;3462int r = PyBytes_AsStringAndSize(o, &result, length);3463if (unlikely(r < 0)) {3464return NULL;3465} else {3466return result;3467}3468}3469}3470static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {3471int is_true = x == Py_True;3472if (is_true | (x == Py_False) | (x == Py_None)) return is_true;3473else return PyObject_IsTrue(x);3474}3475static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {3476int retval;3477if (unlikely(!x)) return -1;3478retval = __Pyx_PyObject_IsTrue(x);3479Py_DECREF(x);3480return retval;3481}3482static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {3483#if PY_MAJOR_VERSION >= 33484if (PyLong_Check(result)) {3485if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,3486"__int__ returned non-int (type %.200s). "3487"The ability to return an instance of a strict subclass of int "3488"is deprecated, and may be removed in a future version of Python.",3489Py_TYPE(result)->tp_name)) {3490Py_DECREF(result);3491return NULL;3492}3493return result;3494}3495#endif3496PyErr_Format(PyExc_TypeError,3497"__%.4s__ returned non-%.4s (type %.200s)",3498type_name, type_name, Py_TYPE(result)->tp_name);3499Py_DECREF(result);3500return NULL;3501}3502static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {3503#if CYTHON_USE_TYPE_SLOTS3504PyNumberMethods *m;3505#endif3506const char *name = NULL;3507PyObject *res = NULL;3508#if PY_MAJOR_VERSION < 33509if (likely(PyInt_Check(x) || PyLong_Check(x)))3510#else3511if (likely(PyLong_Check(x)))3512#endif3513return __Pyx_NewRef(x);3514#if CYTHON_USE_TYPE_SLOTS3515m = Py_TYPE(x)->tp_as_number;3516#if PY_MAJOR_VERSION < 33517if (m && m->nb_int) {3518name = "int";3519res = m->nb_int(x);3520}3521else if (m && m->nb_long) {3522name = "long";3523res = m->nb_long(x);3524}3525#else3526if (likely(m && m->nb_int)) {3527name = "int";3528res = m->nb_int(x);3529}3530#endif3531#else3532if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {3533res = PyNumber_Int(x);3534}3535#endif3536if (likely(res)) {3537#if PY_MAJOR_VERSION < 33538if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {3539#else3540if (unlikely(!PyLong_CheckExact(res))) {3541#endif3542return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);3543}3544}3545else if (!PyErr_Occurred()) {3546PyErr_SetString(PyExc_TypeError,3547"an integer is required");3548}3549return res;3550}3551static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {3552Py_ssize_t ival;3553PyObject *x;3554#if PY_MAJOR_VERSION < 33555if (likely(PyInt_CheckExact(b))) {3556if (sizeof(Py_ssize_t) >= sizeof(long))3557return PyInt_AS_LONG(b);3558else3559return PyInt_AsSsize_t(b);3560}3561#endif3562if (likely(PyLong_CheckExact(b))) {3563#if CYTHON_USE_PYLONG_INTERNALS3564const digit* digits = ((PyLongObject*)b)->ob_digit;3565const Py_ssize_t size = Py_SIZE(b);3566if (likely(__Pyx_sst_abs(size) <= 1)) {3567ival = likely(size) ? digits[0] : 0;3568if (size == -1) ival = -ival;3569return ival;3570} else {3571switch (size) {3572case 2:3573if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {3574return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));3575}3576break;3577case -2:3578if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {3579return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));3580}3581break;3582case 3:3583if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {3584return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));3585}3586break;3587case -3:3588if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {3589return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));3590}3591break;3592case 4:3593if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {3594return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));3595}3596break;3597case -4:3598if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {3599return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));3600}3601break;3602}3603}3604#endif3605return PyLong_AsSsize_t(b);3606}3607x = PyNumber_Index(b);3608if (!x) return -1;3609ival = PyInt_AsSsize_t(x);3610Py_DECREF(x);3611return ival;3612}3613static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {3614return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);3615}3616static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {3617return PyInt_FromSize_t(ival);3618}361936203621#endif /* Py_PYTHON_H */362236233624