Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wiseplat
GitHub Repository: wiseplat/python-code
Path: blob/master/ invest-robot-contest_TinkoffBotTwitch-main/venv/lib/python3.8/site-packages/aiohttp/_helpers.c
7763 views
1
/* Generated by Cython 0.29.24 */
2
3
#ifndef PY_SSIZE_T_CLEAN
4
#define PY_SSIZE_T_CLEAN
5
#endif /* PY_SSIZE_T_CLEAN */
6
#include "Python.h"
7
#ifndef Py_PYTHON_H
8
#error Python headers needed to compile C extensions, please install development version of Python.
9
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10
#error Cython requires Python 2.6+ or Python 3.3+.
11
#else
12
#define CYTHON_ABI "0_29_24"
13
#define CYTHON_HEX_VERSION 0x001D18F0
14
#define CYTHON_FUTURE_DIVISION 1
15
#include <stddef.h>
16
#ifndef offsetof
17
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
18
#endif
19
#if !defined(WIN32) && !defined(MS_WINDOWS)
20
#ifndef __stdcall
21
#define __stdcall
22
#endif
23
#ifndef __cdecl
24
#define __cdecl
25
#endif
26
#ifndef __fastcall
27
#define __fastcall
28
#endif
29
#endif
30
#ifndef DL_IMPORT
31
#define DL_IMPORT(t) t
32
#endif
33
#ifndef DL_EXPORT
34
#define DL_EXPORT(t) t
35
#endif
36
#define __PYX_COMMA ,
37
#ifndef HAVE_LONG_LONG
38
#if PY_VERSION_HEX >= 0x02070000
39
#define HAVE_LONG_LONG
40
#endif
41
#endif
42
#ifndef PY_LONG_LONG
43
#define PY_LONG_LONG LONG_LONG
44
#endif
45
#ifndef Py_HUGE_VAL
46
#define Py_HUGE_VAL HUGE_VAL
47
#endif
48
#ifdef PYPY_VERSION
49
#define CYTHON_COMPILING_IN_PYPY 1
50
#define CYTHON_COMPILING_IN_PYSTON 0
51
#define CYTHON_COMPILING_IN_CPYTHON 0
52
#undef CYTHON_USE_TYPE_SLOTS
53
#define CYTHON_USE_TYPE_SLOTS 0
54
#undef CYTHON_USE_PYTYPE_LOOKUP
55
#define CYTHON_USE_PYTYPE_LOOKUP 0
56
#if PY_VERSION_HEX < 0x03050000
57
#undef CYTHON_USE_ASYNC_SLOTS
58
#define CYTHON_USE_ASYNC_SLOTS 0
59
#elif !defined(CYTHON_USE_ASYNC_SLOTS)
60
#define CYTHON_USE_ASYNC_SLOTS 1
61
#endif
62
#undef CYTHON_USE_PYLIST_INTERNALS
63
#define CYTHON_USE_PYLIST_INTERNALS 0
64
#undef CYTHON_USE_UNICODE_INTERNALS
65
#define CYTHON_USE_UNICODE_INTERNALS 0
66
#undef CYTHON_USE_UNICODE_WRITER
67
#define CYTHON_USE_UNICODE_WRITER 0
68
#undef CYTHON_USE_PYLONG_INTERNALS
69
#define CYTHON_USE_PYLONG_INTERNALS 0
70
#undef CYTHON_AVOID_BORROWED_REFS
71
#define CYTHON_AVOID_BORROWED_REFS 1
72
#undef CYTHON_ASSUME_SAFE_MACROS
73
#define CYTHON_ASSUME_SAFE_MACROS 0
74
#undef CYTHON_UNPACK_METHODS
75
#define CYTHON_UNPACK_METHODS 0
76
#undef CYTHON_FAST_THREAD_STATE
77
#define CYTHON_FAST_THREAD_STATE 0
78
#undef CYTHON_FAST_PYCALL
79
#define CYTHON_FAST_PYCALL 0
80
#undef CYTHON_PEP489_MULTI_PHASE_INIT
81
#define CYTHON_PEP489_MULTI_PHASE_INIT 0
82
#undef CYTHON_USE_TP_FINALIZE
83
#define CYTHON_USE_TP_FINALIZE 0
84
#undef CYTHON_USE_DICT_VERSIONS
85
#define CYTHON_USE_DICT_VERSIONS 0
86
#undef CYTHON_USE_EXC_INFO_STACK
87
#define CYTHON_USE_EXC_INFO_STACK 0
88
#elif defined(PYSTON_VERSION)
89
#define CYTHON_COMPILING_IN_PYPY 0
90
#define CYTHON_COMPILING_IN_PYSTON 1
91
#define CYTHON_COMPILING_IN_CPYTHON 0
92
#ifndef CYTHON_USE_TYPE_SLOTS
93
#define CYTHON_USE_TYPE_SLOTS 1
94
#endif
95
#undef CYTHON_USE_PYTYPE_LOOKUP
96
#define CYTHON_USE_PYTYPE_LOOKUP 0
97
#undef CYTHON_USE_ASYNC_SLOTS
98
#define CYTHON_USE_ASYNC_SLOTS 0
99
#undef CYTHON_USE_PYLIST_INTERNALS
100
#define CYTHON_USE_PYLIST_INTERNALS 0
101
#ifndef CYTHON_USE_UNICODE_INTERNALS
102
#define CYTHON_USE_UNICODE_INTERNALS 1
103
#endif
104
#undef CYTHON_USE_UNICODE_WRITER
105
#define CYTHON_USE_UNICODE_WRITER 0
106
#undef CYTHON_USE_PYLONG_INTERNALS
107
#define CYTHON_USE_PYLONG_INTERNALS 0
108
#ifndef CYTHON_AVOID_BORROWED_REFS
109
#define CYTHON_AVOID_BORROWED_REFS 0
110
#endif
111
#ifndef CYTHON_ASSUME_SAFE_MACROS
112
#define CYTHON_ASSUME_SAFE_MACROS 1
113
#endif
114
#ifndef CYTHON_UNPACK_METHODS
115
#define CYTHON_UNPACK_METHODS 1
116
#endif
117
#undef CYTHON_FAST_THREAD_STATE
118
#define CYTHON_FAST_THREAD_STATE 0
119
#undef CYTHON_FAST_PYCALL
120
#define CYTHON_FAST_PYCALL 0
121
#undef CYTHON_PEP489_MULTI_PHASE_INIT
122
#define CYTHON_PEP489_MULTI_PHASE_INIT 0
123
#undef CYTHON_USE_TP_FINALIZE
124
#define CYTHON_USE_TP_FINALIZE 0
125
#undef CYTHON_USE_DICT_VERSIONS
126
#define CYTHON_USE_DICT_VERSIONS 0
127
#undef CYTHON_USE_EXC_INFO_STACK
128
#define CYTHON_USE_EXC_INFO_STACK 0
129
#else
130
#define CYTHON_COMPILING_IN_PYPY 0
131
#define CYTHON_COMPILING_IN_PYSTON 0
132
#define CYTHON_COMPILING_IN_CPYTHON 1
133
#ifndef CYTHON_USE_TYPE_SLOTS
134
#define CYTHON_USE_TYPE_SLOTS 1
135
#endif
136
#if PY_VERSION_HEX < 0x02070000
137
#undef CYTHON_USE_PYTYPE_LOOKUP
138
#define CYTHON_USE_PYTYPE_LOOKUP 0
139
#elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
140
#define CYTHON_USE_PYTYPE_LOOKUP 1
141
#endif
142
#if PY_MAJOR_VERSION < 3
143
#undef CYTHON_USE_ASYNC_SLOTS
144
#define CYTHON_USE_ASYNC_SLOTS 0
145
#elif !defined(CYTHON_USE_ASYNC_SLOTS)
146
#define CYTHON_USE_ASYNC_SLOTS 1
147
#endif
148
#if PY_VERSION_HEX < 0x02070000
149
#undef CYTHON_USE_PYLONG_INTERNALS
150
#define CYTHON_USE_PYLONG_INTERNALS 0
151
#elif !defined(CYTHON_USE_PYLONG_INTERNALS)
152
#define CYTHON_USE_PYLONG_INTERNALS 1
153
#endif
154
#ifndef CYTHON_USE_PYLIST_INTERNALS
155
#define CYTHON_USE_PYLIST_INTERNALS 1
156
#endif
157
#ifndef CYTHON_USE_UNICODE_INTERNALS
158
#define CYTHON_USE_UNICODE_INTERNALS 1
159
#endif
160
#if PY_VERSION_HEX < 0x030300F0
161
#undef CYTHON_USE_UNICODE_WRITER
162
#define CYTHON_USE_UNICODE_WRITER 0
163
#elif !defined(CYTHON_USE_UNICODE_WRITER)
164
#define CYTHON_USE_UNICODE_WRITER 1
165
#endif
166
#ifndef CYTHON_AVOID_BORROWED_REFS
167
#define CYTHON_AVOID_BORROWED_REFS 0
168
#endif
169
#ifndef CYTHON_ASSUME_SAFE_MACROS
170
#define CYTHON_ASSUME_SAFE_MACROS 1
171
#endif
172
#ifndef CYTHON_UNPACK_METHODS
173
#define CYTHON_UNPACK_METHODS 1
174
#endif
175
#ifndef CYTHON_FAST_THREAD_STATE
176
#define CYTHON_FAST_THREAD_STATE 1
177
#endif
178
#ifndef CYTHON_FAST_PYCALL
179
#define CYTHON_FAST_PYCALL 1
180
#endif
181
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
182
#define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
183
#endif
184
#ifndef CYTHON_USE_TP_FINALIZE
185
#define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
186
#endif
187
#ifndef CYTHON_USE_DICT_VERSIONS
188
#define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
189
#endif
190
#ifndef CYTHON_USE_EXC_INFO_STACK
191
#define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
192
#endif
193
#endif
194
#if !defined(CYTHON_FAST_PYCCALL)
195
#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
196
#endif
197
#if CYTHON_USE_PYLONG_INTERNALS
198
#include "longintrepr.h"
199
#undef SHIFT
200
#undef BASE
201
#undef MASK
202
#ifdef SIZEOF_VOID_P
203
enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
204
#endif
205
#endif
206
#ifndef __has_attribute
207
#define __has_attribute(x) 0
208
#endif
209
#ifndef __has_cpp_attribute
210
#define __has_cpp_attribute(x) 0
211
#endif
212
#ifndef CYTHON_RESTRICT
213
#if defined(__GNUC__)
214
#define CYTHON_RESTRICT __restrict__
215
#elif defined(_MSC_VER) && _MSC_VER >= 1400
216
#define CYTHON_RESTRICT __restrict
217
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
218
#define CYTHON_RESTRICT restrict
219
#else
220
#define CYTHON_RESTRICT
221
#endif
222
#endif
223
#ifndef CYTHON_UNUSED
224
# if defined(__GNUC__)
225
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
226
# define CYTHON_UNUSED __attribute__ ((__unused__))
227
# else
228
# define CYTHON_UNUSED
229
# endif
230
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
231
# define CYTHON_UNUSED __attribute__ ((__unused__))
232
# else
233
# define CYTHON_UNUSED
234
# endif
235
#endif
236
#ifndef CYTHON_MAYBE_UNUSED_VAR
237
# if defined(__cplusplus)
238
template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
239
# else
240
# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
241
# endif
242
#endif
243
#ifndef CYTHON_NCP_UNUSED
244
# if CYTHON_COMPILING_IN_CPYTHON
245
# define CYTHON_NCP_UNUSED
246
# else
247
# define CYTHON_NCP_UNUSED CYTHON_UNUSED
248
# endif
249
#endif
250
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
251
#ifdef _MSC_VER
252
#ifndef _MSC_STDINT_H_
253
#if _MSC_VER < 1300
254
typedef unsigned char uint8_t;
255
typedef unsigned int uint32_t;
256
#else
257
typedef unsigned __int8 uint8_t;
258
typedef unsigned __int32 uint32_t;
259
#endif
260
#endif
261
#else
262
#include <stdint.h>
263
#endif
264
#ifndef CYTHON_FALLTHROUGH
265
#if defined(__cplusplus) && __cplusplus >= 201103L
266
#if __has_cpp_attribute(fallthrough)
267
#define CYTHON_FALLTHROUGH [[fallthrough]]
268
#elif __has_cpp_attribute(clang::fallthrough)
269
#define CYTHON_FALLTHROUGH [[clang::fallthrough]]
270
#elif __has_cpp_attribute(gnu::fallthrough)
271
#define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
272
#endif
273
#endif
274
#ifndef CYTHON_FALLTHROUGH
275
#if __has_attribute(fallthrough)
276
#define CYTHON_FALLTHROUGH __attribute__((fallthrough))
277
#else
278
#define CYTHON_FALLTHROUGH
279
#endif
280
#endif
281
#if defined(__clang__ ) && defined(__apple_build_version__)
282
#if __apple_build_version__ < 7000000
283
#undef CYTHON_FALLTHROUGH
284
#define CYTHON_FALLTHROUGH
285
#endif
286
#endif
287
#endif
288
289
#ifndef CYTHON_INLINE
290
#if defined(__clang__)
291
#define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
292
#elif defined(__GNUC__)
293
#define CYTHON_INLINE __inline__
294
#elif defined(_MSC_VER)
295
#define CYTHON_INLINE __inline
296
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
297
#define CYTHON_INLINE inline
298
#else
299
#define CYTHON_INLINE
300
#endif
301
#endif
302
303
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
304
#define Py_OptimizeFlag 0
305
#endif
306
#define __PYX_BUILD_PY_SSIZE_T "n"
307
#define CYTHON_FORMAT_SSIZE_T "z"
308
#if PY_MAJOR_VERSION < 3
309
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
310
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
311
PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
312
#define __Pyx_DefaultClassType PyClass_Type
313
#else
314
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
315
#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
316
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
317
PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
318
#else
319
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
320
PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
321
#endif
322
#define __Pyx_DefaultClassType PyType_Type
323
#endif
324
#ifndef Py_TPFLAGS_CHECKTYPES
325
#define Py_TPFLAGS_CHECKTYPES 0
326
#endif
327
#ifndef Py_TPFLAGS_HAVE_INDEX
328
#define Py_TPFLAGS_HAVE_INDEX 0
329
#endif
330
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
331
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
332
#endif
333
#ifndef Py_TPFLAGS_HAVE_FINALIZE
334
#define Py_TPFLAGS_HAVE_FINALIZE 0
335
#endif
336
#ifndef METH_STACKLESS
337
#define METH_STACKLESS 0
338
#endif
339
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
340
#ifndef METH_FASTCALL
341
#define METH_FASTCALL 0x80
342
#endif
343
typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
344
typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
345
Py_ssize_t nargs, PyObject *kwnames);
346
#else
347
#define __Pyx_PyCFunctionFast _PyCFunctionFast
348
#define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
349
#endif
350
#if CYTHON_FAST_PYCCALL
351
#define __Pyx_PyFastCFunction_Check(func)\
352
((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
353
#else
354
#define __Pyx_PyFastCFunction_Check(func) 0
355
#endif
356
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
357
#define PyObject_Malloc(s) PyMem_Malloc(s)
358
#define PyObject_Free(p) PyMem_Free(p)
359
#define PyObject_Realloc(p) PyMem_Realloc(p)
360
#endif
361
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
362
#define PyMem_RawMalloc(n) PyMem_Malloc(n)
363
#define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
364
#define PyMem_RawFree(p) PyMem_Free(p)
365
#endif
366
#if CYTHON_COMPILING_IN_PYSTON
367
#define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
368
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
369
#else
370
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
371
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
372
#endif
373
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
374
#define __Pyx_PyThreadState_Current PyThreadState_GET()
375
#elif PY_VERSION_HEX >= 0x03060000
376
#define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
377
#elif PY_VERSION_HEX >= 0x03000000
378
#define __Pyx_PyThreadState_Current PyThreadState_GET()
379
#else
380
#define __Pyx_PyThreadState_Current _PyThreadState_Current
381
#endif
382
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
383
#include "pythread.h"
384
#define Py_tss_NEEDS_INIT 0
385
typedef int Py_tss_t;
386
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
387
*key = PyThread_create_key();
388
return 0;
389
}
390
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
391
Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
392
*key = Py_tss_NEEDS_INIT;
393
return key;
394
}
395
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
396
PyObject_Free(key);
397
}
398
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
399
return *key != Py_tss_NEEDS_INIT;
400
}
401
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
402
PyThread_delete_key(*key);
403
*key = Py_tss_NEEDS_INIT;
404
}
405
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
406
return PyThread_set_key_value(*key, value);
407
}
408
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
409
return PyThread_get_key_value(*key);
410
}
411
#endif
412
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
413
#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
414
#else
415
#define __Pyx_PyDict_NewPresized(n) PyDict_New()
416
#endif
417
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
418
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
419
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
420
#else
421
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
422
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
423
#endif
424
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
425
#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
426
#else
427
#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
428
#endif
429
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
430
#define CYTHON_PEP393_ENABLED 1
431
#if defined(PyUnicode_IS_READY)
432
#define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
433
0 : _PyUnicode_Ready((PyObject *)(op)))
434
#else
435
#define __Pyx_PyUnicode_READY(op) (0)
436
#endif
437
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
438
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
439
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
440
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
441
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
442
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
443
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
444
#if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
445
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
446
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
447
#else
448
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
449
#endif
450
#else
451
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
452
#endif
453
#else
454
#define CYTHON_PEP393_ENABLED 0
455
#define PyUnicode_1BYTE_KIND 1
456
#define PyUnicode_2BYTE_KIND 2
457
#define PyUnicode_4BYTE_KIND 4
458
#define __Pyx_PyUnicode_READY(op) (0)
459
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
460
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
461
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
462
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
463
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
464
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
465
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
466
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
467
#endif
468
#if CYTHON_COMPILING_IN_PYPY
469
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
470
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
471
#else
472
#define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
473
#define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
474
PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
475
#endif
476
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
477
#define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
478
#endif
479
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
480
#define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
481
#endif
482
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
483
#define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
484
#endif
485
#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))
486
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
487
#if PY_MAJOR_VERSION >= 3
488
#define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
489
#else
490
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
491
#endif
492
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
493
#define PyObject_ASCII(o) PyObject_Repr(o)
494
#endif
495
#if PY_MAJOR_VERSION >= 3
496
#define PyBaseString_Type PyUnicode_Type
497
#define PyStringObject PyUnicodeObject
498
#define PyString_Type PyUnicode_Type
499
#define PyString_Check PyUnicode_Check
500
#define PyString_CheckExact PyUnicode_CheckExact
501
#ifndef PyObject_Unicode
502
#define PyObject_Unicode PyObject_Str
503
#endif
504
#endif
505
#if PY_MAJOR_VERSION >= 3
506
#define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
507
#define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
508
#else
509
#define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
510
#define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
511
#endif
512
#ifndef PySet_CheckExact
513
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
514
#endif
515
#if PY_VERSION_HEX >= 0x030900A4
516
#define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
517
#define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
518
#else
519
#define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
520
#define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
521
#endif
522
#if CYTHON_ASSUME_SAFE_MACROS
523
#define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
524
#else
525
#define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
526
#endif
527
#if PY_MAJOR_VERSION >= 3
528
#define PyIntObject PyLongObject
529
#define PyInt_Type PyLong_Type
530
#define PyInt_Check(op) PyLong_Check(op)
531
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
532
#define PyInt_FromString PyLong_FromString
533
#define PyInt_FromUnicode PyLong_FromUnicode
534
#define PyInt_FromLong PyLong_FromLong
535
#define PyInt_FromSize_t PyLong_FromSize_t
536
#define PyInt_FromSsize_t PyLong_FromSsize_t
537
#define PyInt_AsLong PyLong_AsLong
538
#define PyInt_AS_LONG PyLong_AS_LONG
539
#define PyInt_AsSsize_t PyLong_AsSsize_t
540
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
541
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
542
#define PyNumber_Int PyNumber_Long
543
#endif
544
#if PY_MAJOR_VERSION >= 3
545
#define PyBoolObject PyLongObject
546
#endif
547
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
548
#ifndef PyUnicode_InternFromString
549
#define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
550
#endif
551
#endif
552
#if PY_VERSION_HEX < 0x030200A4
553
typedef long Py_hash_t;
554
#define __Pyx_PyInt_FromHash_t PyInt_FromLong
555
#define __Pyx_PyInt_AsHash_t PyInt_AsLong
556
#else
557
#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
558
#define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
559
#endif
560
#if PY_MAJOR_VERSION >= 3
561
#define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
562
#else
563
#define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
564
#endif
565
#if CYTHON_USE_ASYNC_SLOTS
566
#if PY_VERSION_HEX >= 0x030500B1
567
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
568
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
569
#else
570
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
571
#endif
572
#else
573
#define __Pyx_PyType_AsAsync(obj) NULL
574
#endif
575
#ifndef __Pyx_PyAsyncMethodsStruct
576
typedef struct {
577
unaryfunc am_await;
578
unaryfunc am_aiter;
579
unaryfunc am_anext;
580
} __Pyx_PyAsyncMethodsStruct;
581
#endif
582
583
#if defined(WIN32) || defined(MS_WINDOWS)
584
#define _USE_MATH_DEFINES
585
#endif
586
#include <math.h>
587
#ifdef NAN
588
#define __PYX_NAN() ((float) NAN)
589
#else
590
static CYTHON_INLINE float __PYX_NAN() {
591
float value;
592
memset(&value, 0xFF, sizeof(value));
593
return value;
594
}
595
#endif
596
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
597
#define __Pyx_truncl trunc
598
#else
599
#define __Pyx_truncl truncl
600
#endif
601
602
#define __PYX_MARK_ERR_POS(f_index, lineno) \
603
{ __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
604
#define __PYX_ERR(f_index, lineno, Ln_error) \
605
{ __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
606
607
#ifndef __PYX_EXTERN_C
608
#ifdef __cplusplus
609
#define __PYX_EXTERN_C extern "C"
610
#else
611
#define __PYX_EXTERN_C extern
612
#endif
613
#endif
614
615
#define __PYX_HAVE__aiohttp___helpers
616
#define __PYX_HAVE_API__aiohttp___helpers
617
/* Early includes */
618
#ifdef _OPENMP
619
#include <omp.h>
620
#endif /* _OPENMP */
621
622
#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
623
#define CYTHON_WITHOUT_ASSERTIONS
624
#endif
625
626
typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
627
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
628
629
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
630
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
631
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
632
#define __PYX_DEFAULT_STRING_ENCODING ""
633
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
634
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
635
#define __Pyx_uchar_cast(c) ((unsigned char)c)
636
#define __Pyx_long_cast(x) ((long)x)
637
#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
638
(sizeof(type) < sizeof(Py_ssize_t)) ||\
639
(sizeof(type) > sizeof(Py_ssize_t) &&\
640
likely(v < (type)PY_SSIZE_T_MAX ||\
641
v == (type)PY_SSIZE_T_MAX) &&\
642
(!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
643
v == (type)PY_SSIZE_T_MIN))) ||\
644
(sizeof(type) == sizeof(Py_ssize_t) &&\
645
(is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
646
v == (type)PY_SSIZE_T_MAX))) )
647
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
648
return (size_t) i < (size_t) limit;
649
}
650
#if defined (__cplusplus) && __cplusplus >= 201103L
651
#include <cstdlib>
652
#define __Pyx_sst_abs(value) std::abs(value)
653
#elif SIZEOF_INT >= SIZEOF_SIZE_T
654
#define __Pyx_sst_abs(value) abs(value)
655
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
656
#define __Pyx_sst_abs(value) labs(value)
657
#elif defined (_MSC_VER)
658
#define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
659
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
660
#define __Pyx_sst_abs(value) llabs(value)
661
#elif defined (__GNUC__)
662
#define __Pyx_sst_abs(value) __builtin_llabs(value)
663
#else
664
#define __Pyx_sst_abs(value) ((value<0) ? -value : value)
665
#endif
666
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
667
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
668
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
669
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
670
#define __Pyx_PyBytes_FromString PyBytes_FromString
671
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
672
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
673
#if PY_MAJOR_VERSION < 3
674
#define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
675
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
676
#else
677
#define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
678
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
679
#endif
680
#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
681
#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
682
#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
683
#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
684
#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
685
#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
686
#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
687
#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
688
#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
689
#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
690
#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
691
#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
692
#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
693
#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
694
#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
695
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
696
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
697
const Py_UNICODE *u_end = u;
698
while (*u_end++) ;
699
return (size_t)(u_end - u - 1);
700
}
701
#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
702
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
703
#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
704
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
705
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
706
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
707
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
708
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
709
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
710
#define __Pyx_PySequence_Tuple(obj)\
711
(likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
712
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
713
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
714
#if CYTHON_ASSUME_SAFE_MACROS
715
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
716
#else
717
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
718
#endif
719
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
720
#if PY_MAJOR_VERSION >= 3
721
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
722
#else
723
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
724
#endif
725
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
726
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
727
static int __Pyx_sys_getdefaultencoding_not_ascii;
728
static int __Pyx_init_sys_getdefaultencoding_params(void) {
729
PyObject* sys;
730
PyObject* default_encoding = NULL;
731
PyObject* ascii_chars_u = NULL;
732
PyObject* ascii_chars_b = NULL;
733
const char* default_encoding_c;
734
sys = PyImport_ImportModule("sys");
735
if (!sys) goto bad;
736
default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
737
Py_DECREF(sys);
738
if (!default_encoding) goto bad;
739
default_encoding_c = PyBytes_AsString(default_encoding);
740
if (!default_encoding_c) goto bad;
741
if (strcmp(default_encoding_c, "ascii") == 0) {
742
__Pyx_sys_getdefaultencoding_not_ascii = 0;
743
} else {
744
char ascii_chars[128];
745
int c;
746
for (c = 0; c < 128; c++) {
747
ascii_chars[c] = c;
748
}
749
__Pyx_sys_getdefaultencoding_not_ascii = 1;
750
ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
751
if (!ascii_chars_u) goto bad;
752
ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
753
if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
754
PyErr_Format(
755
PyExc_ValueError,
756
"This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
757
default_encoding_c);
758
goto bad;
759
}
760
Py_DECREF(ascii_chars_u);
761
Py_DECREF(ascii_chars_b);
762
}
763
Py_DECREF(default_encoding);
764
return 0;
765
bad:
766
Py_XDECREF(default_encoding);
767
Py_XDECREF(ascii_chars_u);
768
Py_XDECREF(ascii_chars_b);
769
return -1;
770
}
771
#endif
772
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
773
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
774
#else
775
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
776
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
777
static char* __PYX_DEFAULT_STRING_ENCODING;
778
static int __Pyx_init_sys_getdefaultencoding_params(void) {
779
PyObject* sys;
780
PyObject* default_encoding = NULL;
781
char* default_encoding_c;
782
sys = PyImport_ImportModule("sys");
783
if (!sys) goto bad;
784
default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
785
Py_DECREF(sys);
786
if (!default_encoding) goto bad;
787
default_encoding_c = PyBytes_AsString(default_encoding);
788
if (!default_encoding_c) goto bad;
789
__PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
790
if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
791
strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
792
Py_DECREF(default_encoding);
793
return 0;
794
bad:
795
Py_XDECREF(default_encoding);
796
return -1;
797
}
798
#endif
799
#endif
800
801
802
/* Test for GCC > 2.95 */
803
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
804
#define likely(x) __builtin_expect(!!(x), 1)
805
#define unlikely(x) __builtin_expect(!!(x), 0)
806
#else /* !__GNUC__ or GCC < 2.95 */
807
#define likely(x) (x)
808
#define unlikely(x) (x)
809
#endif /* __GNUC__ */
810
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
811
812
static PyObject *__pyx_m = NULL;
813
static PyObject *__pyx_d;
814
static PyObject *__pyx_b;
815
static PyObject *__pyx_cython_runtime = NULL;
816
static PyObject *__pyx_empty_tuple;
817
static PyObject *__pyx_empty_bytes;
818
static PyObject *__pyx_empty_unicode;
819
static int __pyx_lineno;
820
static int __pyx_clineno = 0;
821
static const char * __pyx_cfilenm= __FILE__;
822
static const char *__pyx_filename;
823
824
825
static const char *__pyx_f[] = {
826
"aiohttp/_helpers.pyx",
827
"stringsource",
828
};
829
830
/*--- Type declarations ---*/
831
struct __pyx_obj_7aiohttp_8_helpers_reify;
832
833
/* "aiohttp/_helpers.pyx":1
834
* cdef class reify: # <<<<<<<<<<<<<<
835
* """Use as a class method decorator. It operates almost exactly like
836
* the Python `@property` decorator, but it puts the result of the
837
*/
838
struct __pyx_obj_7aiohttp_8_helpers_reify {
839
PyObject_HEAD
840
PyObject *wrapped;
841
PyObject *name;
842
};
843
844
845
/* --- Runtime support code (head) --- */
846
/* Refnanny.proto */
847
#ifndef CYTHON_REFNANNY
848
#define CYTHON_REFNANNY 0
849
#endif
850
#if CYTHON_REFNANNY
851
typedef struct {
852
void (*INCREF)(void*, PyObject*, int);
853
void (*DECREF)(void*, PyObject*, int);
854
void (*GOTREF)(void*, PyObject*, int);
855
void (*GIVEREF)(void*, PyObject*, int);
856
void* (*SetupContext)(const char*, int, const char*);
857
void (*FinishContext)(void**);
858
} __Pyx_RefNannyAPIStruct;
859
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
860
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
861
#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
862
#ifdef WITH_THREAD
863
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
864
if (acquire_gil) {\
865
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
866
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
867
PyGILState_Release(__pyx_gilstate_save);\
868
} else {\
869
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
870
}
871
#else
872
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
873
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
874
#endif
875
#define __Pyx_RefNannyFinishContext()\
876
__Pyx_RefNanny->FinishContext(&__pyx_refnanny)
877
#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
878
#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
879
#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
880
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
881
#define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
882
#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
883
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
884
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
885
#else
886
#define __Pyx_RefNannyDeclarations
887
#define __Pyx_RefNannySetupContext(name, acquire_gil)
888
#define __Pyx_RefNannyFinishContext()
889
#define __Pyx_INCREF(r) Py_INCREF(r)
890
#define __Pyx_DECREF(r) Py_DECREF(r)
891
#define __Pyx_GOTREF(r)
892
#define __Pyx_GIVEREF(r)
893
#define __Pyx_XINCREF(r) Py_XINCREF(r)
894
#define __Pyx_XDECREF(r) Py_XDECREF(r)
895
#define __Pyx_XGOTREF(r)
896
#define __Pyx_XGIVEREF(r)
897
#endif
898
#define __Pyx_XDECREF_SET(r, v) do {\
899
PyObject *tmp = (PyObject *) r;\
900
r = v; __Pyx_XDECREF(tmp);\
901
} while (0)
902
#define __Pyx_DECREF_SET(r, v) do {\
903
PyObject *tmp = (PyObject *) r;\
904
r = v; __Pyx_DECREF(tmp);\
905
} while (0)
906
#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
907
#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
908
909
/* PyObjectGetAttrStr.proto */
910
#if CYTHON_USE_TYPE_SLOTS
911
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
912
#else
913
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
914
#endif
915
916
/* GetBuiltinName.proto */
917
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
918
919
/* RaiseDoubleKeywords.proto */
920
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
921
922
/* ParseKeywords.proto */
923
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
924
PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
925
const char* function_name);
926
927
/* RaiseArgTupleInvalid.proto */
928
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
929
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
930
931
/* GetItemInt.proto */
932
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
933
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
934
__Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
935
(is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
936
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
937
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
938
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
939
__Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
940
(PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
941
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
942
int wraparound, int boundscheck);
943
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
944
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
945
__Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
946
(PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
947
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
948
int wraparound, int boundscheck);
949
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
950
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
951
int is_list, int wraparound, int boundscheck);
952
953
/* ObjectGetItem.proto */
954
#if CYTHON_USE_TYPE_SLOTS
955
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
956
#else
957
#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
958
#endif
959
960
/* GetTopmostException.proto */
961
#if CYTHON_USE_EXC_INFO_STACK
962
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
963
#endif
964
965
/* PyThreadStateGet.proto */
966
#if CYTHON_FAST_THREAD_STATE
967
#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
968
#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
969
#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
970
#else
971
#define __Pyx_PyThreadState_declare
972
#define __Pyx_PyThreadState_assign
973
#define __Pyx_PyErr_Occurred() PyErr_Occurred()
974
#endif
975
976
/* SaveResetException.proto */
977
#if CYTHON_FAST_THREAD_STATE
978
#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
979
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
980
#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
981
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
982
#else
983
#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
984
#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
985
#endif
986
987
/* PyErrExceptionMatches.proto */
988
#if CYTHON_FAST_THREAD_STATE
989
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
990
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
991
#else
992
#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
993
#endif
994
995
/* GetException.proto */
996
#if CYTHON_FAST_THREAD_STATE
997
#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
998
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
999
#else
1000
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1001
#endif
1002
1003
/* PyCFunctionFastCall.proto */
1004
#if CYTHON_FAST_PYCCALL
1005
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1006
#else
1007
#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1008
#endif
1009
1010
/* PyFunctionFastCall.proto */
1011
#if CYTHON_FAST_PYCALL
1012
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
1013
__Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1014
#if 1 || PY_VERSION_HEX < 0x030600B1
1015
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1016
#else
1017
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1018
#endif
1019
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
1020
(sizeof(char [1 - 2*!(cond)]) - 1)
1021
#ifndef Py_MEMBER_SIZE
1022
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1023
#endif
1024
static size_t __pyx_pyframe_localsplus_offset = 0;
1025
#include "frameobject.h"
1026
#define __Pxy_PyFrame_Initialize_Offsets()\
1027
((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1028
(void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1029
#define __Pyx_PyFrame_GetLocalsplus(frame)\
1030
(assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1031
#endif
1032
1033
/* PyObjectCall.proto */
1034
#if CYTHON_COMPILING_IN_CPYTHON
1035
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1036
#else
1037
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1038
#endif
1039
1040
/* PyObjectCall2Args.proto */
1041
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1042
1043
/* PyObjectCallMethO.proto */
1044
#if CYTHON_COMPILING_IN_CPYTHON
1045
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1046
#endif
1047
1048
/* PyObjectCallOneArg.proto */
1049
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1050
1051
/* PyErrFetchRestore.proto */
1052
#if CYTHON_FAST_THREAD_STATE
1053
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1054
#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1055
#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1056
#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1057
#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1058
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1059
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1060
#if CYTHON_COMPILING_IN_CPYTHON
1061
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1062
#else
1063
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1064
#endif
1065
#else
1066
#define __Pyx_PyErr_Clear() PyErr_Clear()
1067
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1068
#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1069
#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1070
#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1071
#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1072
#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1073
#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1074
#endif
1075
1076
/* RaiseException.proto */
1077
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1078
1079
/* GetAttr.proto */
1080
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1081
1082
/* GetAttr3.proto */
1083
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1084
1085
/* PyDictVersioning.proto */
1086
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1087
#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1088
#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1089
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1090
(version_var) = __PYX_GET_DICT_VERSION(dict);\
1091
(cache_var) = (value);
1092
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1093
static PY_UINT64_T __pyx_dict_version = 0;\
1094
static PyObject *__pyx_dict_cached_value = NULL;\
1095
if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1096
(VAR) = __pyx_dict_cached_value;\
1097
} else {\
1098
(VAR) = __pyx_dict_cached_value = (LOOKUP);\
1099
__pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1100
}\
1101
}
1102
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1103
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1104
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1105
#else
1106
#define __PYX_GET_DICT_VERSION(dict) (0)
1107
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1108
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1109
#endif
1110
1111
/* GetModuleGlobalName.proto */
1112
#if CYTHON_USE_DICT_VERSIONS
1113
#define __Pyx_GetModuleGlobalName(var, name) {\
1114
static PY_UINT64_T __pyx_dict_version = 0;\
1115
static PyObject *__pyx_dict_cached_value = NULL;\
1116
(var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1117
(likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1118
__Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1119
}
1120
#define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1121
PY_UINT64_T __pyx_dict_version;\
1122
PyObject *__pyx_dict_cached_value;\
1123
(var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1124
}
1125
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1126
#else
1127
#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1128
#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1129
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1130
#endif
1131
1132
/* Import.proto */
1133
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1134
1135
/* ImportFrom.proto */
1136
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1137
1138
/* HasAttr.proto */
1139
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1140
1141
/* PyObject_GenericGetAttrNoDict.proto */
1142
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1143
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1144
#else
1145
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1146
#endif
1147
1148
/* PyObject_GenericGetAttr.proto */
1149
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1150
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1151
#else
1152
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1153
#endif
1154
1155
/* PyObjectGetAttrStrNoError.proto */
1156
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1157
1158
/* SetupReduce.proto */
1159
static int __Pyx_setup_reduce(PyObject* type_obj);
1160
1161
/* CLineInTraceback.proto */
1162
#ifdef CYTHON_CLINE_IN_TRACEBACK
1163
#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1164
#else
1165
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1166
#endif
1167
1168
/* CodeObjectCache.proto */
1169
typedef struct {
1170
PyCodeObject* code_object;
1171
int code_line;
1172
} __Pyx_CodeObjectCacheEntry;
1173
struct __Pyx_CodeObjectCache {
1174
int count;
1175
int max_count;
1176
__Pyx_CodeObjectCacheEntry* entries;
1177
};
1178
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1179
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1180
static PyCodeObject *__pyx_find_code_object(int code_line);
1181
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1182
1183
/* AddTraceback.proto */
1184
static void __Pyx_AddTraceback(const char *funcname, int c_line,
1185
int py_line, const char *filename);
1186
1187
/* GCCDiagnostics.proto */
1188
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1189
#define __Pyx_HAS_GCC_DIAGNOSTIC
1190
#endif
1191
1192
/* CIntFromPy.proto */
1193
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1194
1195
/* CIntToPy.proto */
1196
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1197
1198
/* CIntFromPy.proto */
1199
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1200
1201
/* FastTypeChecks.proto */
1202
#if CYTHON_COMPILING_IN_CPYTHON
1203
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1204
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1205
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1206
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1207
#else
1208
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1209
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1210
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1211
#endif
1212
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1213
1214
/* CheckBinaryVersion.proto */
1215
static int __Pyx_check_binary_version(void);
1216
1217
/* InitStrings.proto */
1218
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1219
1220
1221
/* Module declarations from 'aiohttp._helpers' */
1222
static PyTypeObject *__pyx_ptype_7aiohttp_8_helpers_reify = 0;
1223
static PyObject *__pyx_f_7aiohttp_8_helpers___pyx_unpickle_reify__set_state(struct __pyx_obj_7aiohttp_8_helpers_reify *, PyObject *); /*proto*/
1224
#define __Pyx_MODULE_NAME "aiohttp._helpers"
1225
extern int __pyx_module_is_main_aiohttp___helpers;
1226
int __pyx_module_is_main_aiohttp___helpers = 0;
1227
1228
/* Implementation of 'aiohttp._helpers' */
1229
static PyObject *__pyx_builtin_KeyError;
1230
static PyObject *__pyx_builtin_AttributeError;
1231
static const char __pyx_k_doc[] = "__doc__";
1232
static const char __pyx_k_new[] = "__new__";
1233
static const char __pyx_k_dict[] = "__dict__";
1234
static const char __pyx_k_main[] = "__main__";
1235
static const char __pyx_k_name[] = "__name__";
1236
static const char __pyx_k_test[] = "__test__";
1237
static const char __pyx_k_cache[] = "_cache";
1238
static const char __pyx_k_reify[] = "reify";
1239
static const char __pyx_k_import[] = "__import__";
1240
static const char __pyx_k_pickle[] = "pickle";
1241
static const char __pyx_k_reduce[] = "__reduce__";
1242
static const char __pyx_k_update[] = "update";
1243
static const char __pyx_k_wrapped[] = "wrapped";
1244
static const char __pyx_k_KeyError[] = "KeyError";
1245
static const char __pyx_k_getstate[] = "__getstate__";
1246
static const char __pyx_k_pyx_type[] = "__pyx_type";
1247
static const char __pyx_k_setstate[] = "__setstate__";
1248
static const char __pyx_k_pyx_state[] = "__pyx_state";
1249
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
1250
static const char __pyx_k_pyx_result[] = "__pyx_result";
1251
static const char __pyx_k_PickleError[] = "PickleError";
1252
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
1253
static const char __pyx_k_stringsource[] = "stringsource";
1254
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
1255
static const char __pyx_k_AttributeError[] = "AttributeError";
1256
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
1257
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
1258
static const char __pyx_k_aiohttp__helpers[] = "aiohttp._helpers";
1259
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1260
static const char __pyx_k_pyx_unpickle_reify[] = "__pyx_unpickle_reify";
1261
static const char __pyx_k_reified_property_is_read_only[] = "reified property is read-only";
1262
static const char __pyx_k_Incompatible_checksums_s_vs_0x77[] = "Incompatible checksums (%s vs 0x770cb8f = (name, wrapped))";
1263
static PyObject *__pyx_n_s_AttributeError;
1264
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x77;
1265
static PyObject *__pyx_n_s_KeyError;
1266
static PyObject *__pyx_n_s_PickleError;
1267
static PyObject *__pyx_n_s_aiohttp__helpers;
1268
static PyObject *__pyx_n_s_cache;
1269
static PyObject *__pyx_n_s_cline_in_traceback;
1270
static PyObject *__pyx_n_s_dict;
1271
static PyObject *__pyx_n_s_doc;
1272
static PyObject *__pyx_n_s_getstate;
1273
static PyObject *__pyx_n_s_import;
1274
static PyObject *__pyx_n_s_main;
1275
static PyObject *__pyx_n_s_name;
1276
static PyObject *__pyx_n_s_new;
1277
static PyObject *__pyx_n_s_pickle;
1278
static PyObject *__pyx_n_s_pyx_PickleError;
1279
static PyObject *__pyx_n_s_pyx_checksum;
1280
static PyObject *__pyx_n_s_pyx_result;
1281
static PyObject *__pyx_n_s_pyx_state;
1282
static PyObject *__pyx_n_s_pyx_type;
1283
static PyObject *__pyx_n_s_pyx_unpickle_reify;
1284
static PyObject *__pyx_n_s_reduce;
1285
static PyObject *__pyx_n_s_reduce_cython;
1286
static PyObject *__pyx_n_s_reduce_ex;
1287
static PyObject *__pyx_kp_u_reified_property_is_read_only;
1288
static PyObject *__pyx_n_s_reify;
1289
static PyObject *__pyx_n_s_setstate;
1290
static PyObject *__pyx_n_s_setstate_cython;
1291
static PyObject *__pyx_kp_s_stringsource;
1292
static PyObject *__pyx_n_s_test;
1293
static PyObject *__pyx_n_s_update;
1294
static PyObject *__pyx_n_s_wrapped;
1295
static int __pyx_pf_7aiohttp_8_helpers_5reify___init__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v_wrapped); /* proto */
1296
static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_7__doc_____get__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self); /* proto */
1297
static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_2__get__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v_inst, CYTHON_UNUSED PyObject *__pyx_v_owner); /* proto */
1298
static int __pyx_pf_7aiohttp_8_helpers_5reify_4__set__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_inst, CYTHON_UNUSED PyObject *__pyx_v_value); /* proto */
1299
static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_6__reduce_cython__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self); /* proto */
1300
static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_8__setstate_cython__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
1301
static PyObject *__pyx_pf_7aiohttp_8_helpers___pyx_unpickle_reify(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
1302
static PyObject *__pyx_tp_new_7aiohttp_8_helpers_reify(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1303
static PyObject *__pyx_int_124832655;
1304
static PyObject *__pyx_tuple_;
1305
static PyObject *__pyx_tuple__2;
1306
static PyObject *__pyx_codeobj__3;
1307
/* Late includes */
1308
1309
/* "aiohttp/_helpers.pyx":13
1310
* cdef object name
1311
*
1312
* def __init__(self, wrapped): # <<<<<<<<<<<<<<
1313
* self.wrapped = wrapped
1314
* self.name = wrapped.__name__
1315
*/
1316
1317
/* Python wrapper */
1318
static int __pyx_pw_7aiohttp_8_helpers_5reify_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1319
static int __pyx_pw_7aiohttp_8_helpers_5reify_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1320
PyObject *__pyx_v_wrapped = 0;
1321
int __pyx_lineno = 0;
1322
const char *__pyx_filename = NULL;
1323
int __pyx_clineno = 0;
1324
int __pyx_r;
1325
__Pyx_RefNannyDeclarations
1326
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
1327
{
1328
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_wrapped,0};
1329
PyObject* values[1] = {0};
1330
if (unlikely(__pyx_kwds)) {
1331
Py_ssize_t kw_args;
1332
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1333
switch (pos_args) {
1334
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1335
CYTHON_FALLTHROUGH;
1336
case 0: break;
1337
default: goto __pyx_L5_argtuple_error;
1338
}
1339
kw_args = PyDict_Size(__pyx_kwds);
1340
switch (pos_args) {
1341
case 0:
1342
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wrapped)) != 0)) kw_args--;
1343
else goto __pyx_L5_argtuple_error;
1344
}
1345
if (unlikely(kw_args > 0)) {
1346
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
1347
}
1348
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
1349
goto __pyx_L5_argtuple_error;
1350
} else {
1351
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1352
}
1353
__pyx_v_wrapped = values[0];
1354
}
1355
goto __pyx_L4_argument_unpacking_done;
1356
__pyx_L5_argtuple_error:;
1357
__Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
1358
__pyx_L3_error:;
1359
__Pyx_AddTraceback("aiohttp._helpers.reify.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1360
__Pyx_RefNannyFinishContext();
1361
return -1;
1362
__pyx_L4_argument_unpacking_done:;
1363
__pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify___init__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self), __pyx_v_wrapped);
1364
1365
/* function exit code */
1366
__Pyx_RefNannyFinishContext();
1367
return __pyx_r;
1368
}
1369
1370
static int __pyx_pf_7aiohttp_8_helpers_5reify___init__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v_wrapped) {
1371
int __pyx_r;
1372
__Pyx_RefNannyDeclarations
1373
PyObject *__pyx_t_1 = NULL;
1374
int __pyx_lineno = 0;
1375
const char *__pyx_filename = NULL;
1376
int __pyx_clineno = 0;
1377
__Pyx_RefNannySetupContext("__init__", 0);
1378
1379
/* "aiohttp/_helpers.pyx":14
1380
*
1381
* def __init__(self, wrapped):
1382
* self.wrapped = wrapped # <<<<<<<<<<<<<<
1383
* self.name = wrapped.__name__
1384
*
1385
*/
1386
__Pyx_INCREF(__pyx_v_wrapped);
1387
__Pyx_GIVEREF(__pyx_v_wrapped);
1388
__Pyx_GOTREF(__pyx_v_self->wrapped);
1389
__Pyx_DECREF(__pyx_v_self->wrapped);
1390
__pyx_v_self->wrapped = __pyx_v_wrapped;
1391
1392
/* "aiohttp/_helpers.pyx":15
1393
* def __init__(self, wrapped):
1394
* self.wrapped = wrapped
1395
* self.name = wrapped.__name__ # <<<<<<<<<<<<<<
1396
*
1397
* @property
1398
*/
1399
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_wrapped, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
1400
__Pyx_GOTREF(__pyx_t_1);
1401
__Pyx_GIVEREF(__pyx_t_1);
1402
__Pyx_GOTREF(__pyx_v_self->name);
1403
__Pyx_DECREF(__pyx_v_self->name);
1404
__pyx_v_self->name = __pyx_t_1;
1405
__pyx_t_1 = 0;
1406
1407
/* "aiohttp/_helpers.pyx":13
1408
* cdef object name
1409
*
1410
* def __init__(self, wrapped): # <<<<<<<<<<<<<<
1411
* self.wrapped = wrapped
1412
* self.name = wrapped.__name__
1413
*/
1414
1415
/* function exit code */
1416
__pyx_r = 0;
1417
goto __pyx_L0;
1418
__pyx_L1_error:;
1419
__Pyx_XDECREF(__pyx_t_1);
1420
__Pyx_AddTraceback("aiohttp._helpers.reify.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1421
__pyx_r = -1;
1422
__pyx_L0:;
1423
__Pyx_RefNannyFinishContext();
1424
return __pyx_r;
1425
}
1426
1427
/* "aiohttp/_helpers.pyx":18
1428
*
1429
* @property
1430
* def __doc__(self): # <<<<<<<<<<<<<<
1431
* return self.wrapped.__doc__
1432
*
1433
*/
1434
1435
/* Python wrapper */
1436
static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_7__doc___1__get__(PyObject *__pyx_v_self); /*proto*/
1437
static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_7__doc___1__get__(PyObject *__pyx_v_self) {
1438
PyObject *__pyx_r = 0;
1439
__Pyx_RefNannyDeclarations
1440
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
1441
__pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify_7__doc_____get__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self));
1442
1443
/* function exit code */
1444
__Pyx_RefNannyFinishContext();
1445
return __pyx_r;
1446
}
1447
1448
static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_7__doc_____get__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self) {
1449
PyObject *__pyx_r = NULL;
1450
__Pyx_RefNannyDeclarations
1451
PyObject *__pyx_t_1 = NULL;
1452
int __pyx_lineno = 0;
1453
const char *__pyx_filename = NULL;
1454
int __pyx_clineno = 0;
1455
__Pyx_RefNannySetupContext("__get__", 0);
1456
1457
/* "aiohttp/_helpers.pyx":19
1458
* @property
1459
* def __doc__(self):
1460
* return self.wrapped.__doc__ # <<<<<<<<<<<<<<
1461
*
1462
* def __get__(self, inst, owner):
1463
*/
1464
__Pyx_XDECREF(__pyx_r);
1465
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->wrapped, __pyx_n_s_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
1466
__Pyx_GOTREF(__pyx_t_1);
1467
__pyx_r = __pyx_t_1;
1468
__pyx_t_1 = 0;
1469
goto __pyx_L0;
1470
1471
/* "aiohttp/_helpers.pyx":18
1472
*
1473
* @property
1474
* def __doc__(self): # <<<<<<<<<<<<<<
1475
* return self.wrapped.__doc__
1476
*
1477
*/
1478
1479
/* function exit code */
1480
__pyx_L1_error:;
1481
__Pyx_XDECREF(__pyx_t_1);
1482
__Pyx_AddTraceback("aiohttp._helpers.reify.__doc__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1483
__pyx_r = NULL;
1484
__pyx_L0:;
1485
__Pyx_XGIVEREF(__pyx_r);
1486
__Pyx_RefNannyFinishContext();
1487
return __pyx_r;
1488
}
1489
1490
/* "aiohttp/_helpers.pyx":21
1491
* return self.wrapped.__doc__
1492
*
1493
* def __get__(self, inst, owner): # <<<<<<<<<<<<<<
1494
* try:
1495
* try:
1496
*/
1497
1498
/* Python wrapper */
1499
static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_3__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_inst, PyObject *__pyx_v_owner); /*proto*/
1500
static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_3__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_inst, PyObject *__pyx_v_owner) {
1501
PyObject *__pyx_r = 0;
1502
__Pyx_RefNannyDeclarations
1503
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
1504
__pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify_2__get__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self), ((PyObject *)__pyx_v_inst), ((PyObject *)__pyx_v_owner));
1505
1506
/* function exit code */
1507
__Pyx_RefNannyFinishContext();
1508
return __pyx_r;
1509
}
1510
1511
static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_2__get__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v_inst, CYTHON_UNUSED PyObject *__pyx_v_owner) {
1512
PyObject *__pyx_v_val = NULL;
1513
PyObject *__pyx_r = NULL;
1514
__Pyx_RefNannyDeclarations
1515
PyObject *__pyx_t_1 = NULL;
1516
PyObject *__pyx_t_2 = NULL;
1517
PyObject *__pyx_t_3 = NULL;
1518
PyObject *__pyx_t_4 = NULL;
1519
PyObject *__pyx_t_5 = NULL;
1520
PyObject *__pyx_t_6 = NULL;
1521
PyObject *__pyx_t_7 = NULL;
1522
PyObject *__pyx_t_8 = NULL;
1523
int __pyx_t_9;
1524
PyObject *__pyx_t_10 = NULL;
1525
PyObject *__pyx_t_11 = NULL;
1526
PyObject *__pyx_t_12 = NULL;
1527
PyObject *__pyx_t_13 = NULL;
1528
int __pyx_t_14;
1529
int __pyx_t_15;
1530
int __pyx_lineno = 0;
1531
const char *__pyx_filename = NULL;
1532
int __pyx_clineno = 0;
1533
__Pyx_RefNannySetupContext("__get__", 0);
1534
1535
/* "aiohttp/_helpers.pyx":22
1536
*
1537
* def __get__(self, inst, owner):
1538
* try: # <<<<<<<<<<<<<<
1539
* try:
1540
* return inst._cache[self.name]
1541
*/
1542
{
1543
__Pyx_PyThreadState_declare
1544
__Pyx_PyThreadState_assign
1545
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
1546
__Pyx_XGOTREF(__pyx_t_1);
1547
__Pyx_XGOTREF(__pyx_t_2);
1548
__Pyx_XGOTREF(__pyx_t_3);
1549
/*try:*/ {
1550
1551
/* "aiohttp/_helpers.pyx":23
1552
* def __get__(self, inst, owner):
1553
* try:
1554
* try: # <<<<<<<<<<<<<<
1555
* return inst._cache[self.name]
1556
* except KeyError:
1557
*/
1558
{
1559
__Pyx_PyThreadState_declare
1560
__Pyx_PyThreadState_assign
1561
__Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
1562
__Pyx_XGOTREF(__pyx_t_4);
1563
__Pyx_XGOTREF(__pyx_t_5);
1564
__Pyx_XGOTREF(__pyx_t_6);
1565
/*try:*/ {
1566
1567
/* "aiohttp/_helpers.pyx":24
1568
* try:
1569
* try:
1570
* return inst._cache[self.name] # <<<<<<<<<<<<<<
1571
* except KeyError:
1572
* val = self.wrapped(inst)
1573
*/
1574
__Pyx_XDECREF(__pyx_r);
1575
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_inst, __pyx_n_s_cache); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 24, __pyx_L9_error)
1576
__Pyx_GOTREF(__pyx_t_7);
1577
__pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_v_self->name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 24, __pyx_L9_error)
1578
__Pyx_GOTREF(__pyx_t_8);
1579
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1580
__pyx_r = __pyx_t_8;
1581
__pyx_t_8 = 0;
1582
goto __pyx_L13_try_return;
1583
1584
/* "aiohttp/_helpers.pyx":23
1585
* def __get__(self, inst, owner):
1586
* try:
1587
* try: # <<<<<<<<<<<<<<
1588
* return inst._cache[self.name]
1589
* except KeyError:
1590
*/
1591
}
1592
__pyx_L9_error:;
1593
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
1594
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
1595
1596
/* "aiohttp/_helpers.pyx":25
1597
* try:
1598
* return inst._cache[self.name]
1599
* except KeyError: # <<<<<<<<<<<<<<
1600
* val = self.wrapped(inst)
1601
* inst._cache[self.name] = val
1602
*/
1603
__pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
1604
if (__pyx_t_9) {
1605
__Pyx_AddTraceback("aiohttp._helpers.reify.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1606
if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_10) < 0) __PYX_ERR(0, 25, __pyx_L11_except_error)
1607
__Pyx_GOTREF(__pyx_t_8);
1608
__Pyx_GOTREF(__pyx_t_7);
1609
__Pyx_GOTREF(__pyx_t_10);
1610
1611
/* "aiohttp/_helpers.pyx":26
1612
* return inst._cache[self.name]
1613
* except KeyError:
1614
* val = self.wrapped(inst) # <<<<<<<<<<<<<<
1615
* inst._cache[self.name] = val
1616
* return val
1617
*/
1618
__Pyx_INCREF(__pyx_v_self->wrapped);
1619
__pyx_t_12 = __pyx_v_self->wrapped; __pyx_t_13 = NULL;
1620
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
1621
__pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
1622
if (likely(__pyx_t_13)) {
1623
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
1624
__Pyx_INCREF(__pyx_t_13);
1625
__Pyx_INCREF(function);
1626
__Pyx_DECREF_SET(__pyx_t_12, function);
1627
}
1628
}
1629
__pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, __pyx_v_inst) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_inst);
1630
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
1631
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 26, __pyx_L11_except_error)
1632
__Pyx_GOTREF(__pyx_t_11);
1633
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
1634
__pyx_v_val = __pyx_t_11;
1635
__pyx_t_11 = 0;
1636
1637
/* "aiohttp/_helpers.pyx":27
1638
* except KeyError:
1639
* val = self.wrapped(inst)
1640
* inst._cache[self.name] = val # <<<<<<<<<<<<<<
1641
* return val
1642
* except AttributeError:
1643
*/
1644
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_inst, __pyx_n_s_cache); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 27, __pyx_L11_except_error)
1645
__Pyx_GOTREF(__pyx_t_11);
1646
if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_v_self->name, __pyx_v_val) < 0)) __PYX_ERR(0, 27, __pyx_L11_except_error)
1647
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
1648
1649
/* "aiohttp/_helpers.pyx":28
1650
* val = self.wrapped(inst)
1651
* inst._cache[self.name] = val
1652
* return val # <<<<<<<<<<<<<<
1653
* except AttributeError:
1654
* if inst is None:
1655
*/
1656
__Pyx_XDECREF(__pyx_r);
1657
__Pyx_INCREF(__pyx_v_val);
1658
__pyx_r = __pyx_v_val;
1659
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1660
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
1661
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
1662
goto __pyx_L12_except_return;
1663
}
1664
goto __pyx_L11_except_error;
1665
__pyx_L11_except_error:;
1666
1667
/* "aiohttp/_helpers.pyx":23
1668
* def __get__(self, inst, owner):
1669
* try:
1670
* try: # <<<<<<<<<<<<<<
1671
* return inst._cache[self.name]
1672
* except KeyError:
1673
*/
1674
__Pyx_XGIVEREF(__pyx_t_4);
1675
__Pyx_XGIVEREF(__pyx_t_5);
1676
__Pyx_XGIVEREF(__pyx_t_6);
1677
__Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
1678
goto __pyx_L3_error;
1679
__pyx_L13_try_return:;
1680
__Pyx_XGIVEREF(__pyx_t_4);
1681
__Pyx_XGIVEREF(__pyx_t_5);
1682
__Pyx_XGIVEREF(__pyx_t_6);
1683
__Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
1684
goto __pyx_L7_try_return;
1685
__pyx_L12_except_return:;
1686
__Pyx_XGIVEREF(__pyx_t_4);
1687
__Pyx_XGIVEREF(__pyx_t_5);
1688
__Pyx_XGIVEREF(__pyx_t_6);
1689
__Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
1690
goto __pyx_L7_try_return;
1691
}
1692
1693
/* "aiohttp/_helpers.pyx":22
1694
*
1695
* def __get__(self, inst, owner):
1696
* try: # <<<<<<<<<<<<<<
1697
* try:
1698
* return inst._cache[self.name]
1699
*/
1700
}
1701
__pyx_L3_error:;
1702
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
1703
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
1704
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
1705
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
1706
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
1707
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
1708
1709
/* "aiohttp/_helpers.pyx":29
1710
* inst._cache[self.name] = val
1711
* return val
1712
* except AttributeError: # <<<<<<<<<<<<<<
1713
* if inst is None:
1714
* return self
1715
*/
1716
__pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
1717
if (__pyx_t_9) {
1718
__Pyx_AddTraceback("aiohttp._helpers.reify.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1719
if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 29, __pyx_L5_except_error)
1720
__Pyx_GOTREF(__pyx_t_10);
1721
__Pyx_GOTREF(__pyx_t_7);
1722
__Pyx_GOTREF(__pyx_t_8);
1723
1724
/* "aiohttp/_helpers.pyx":30
1725
* return val
1726
* except AttributeError:
1727
* if inst is None: # <<<<<<<<<<<<<<
1728
* return self
1729
* raise
1730
*/
1731
__pyx_t_14 = (__pyx_v_inst == Py_None);
1732
__pyx_t_15 = (__pyx_t_14 != 0);
1733
if (__pyx_t_15) {
1734
1735
/* "aiohttp/_helpers.pyx":31
1736
* except AttributeError:
1737
* if inst is None:
1738
* return self # <<<<<<<<<<<<<<
1739
* raise
1740
*
1741
*/
1742
__Pyx_XDECREF(__pyx_r);
1743
__Pyx_INCREF(((PyObject *)__pyx_v_self));
1744
__pyx_r = ((PyObject *)__pyx_v_self);
1745
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1746
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
1747
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
1748
goto __pyx_L6_except_return;
1749
1750
/* "aiohttp/_helpers.pyx":30
1751
* return val
1752
* except AttributeError:
1753
* if inst is None: # <<<<<<<<<<<<<<
1754
* return self
1755
* raise
1756
*/
1757
}
1758
1759
/* "aiohttp/_helpers.pyx":32
1760
* if inst is None:
1761
* return self
1762
* raise # <<<<<<<<<<<<<<
1763
*
1764
* def __set__(self, inst, value):
1765
*/
1766
__Pyx_GIVEREF(__pyx_t_10);
1767
__Pyx_GIVEREF(__pyx_t_7);
1768
__Pyx_XGIVEREF(__pyx_t_8);
1769
__Pyx_ErrRestoreWithState(__pyx_t_10, __pyx_t_7, __pyx_t_8);
1770
__pyx_t_10 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0;
1771
__PYX_ERR(0, 32, __pyx_L5_except_error)
1772
}
1773
goto __pyx_L5_except_error;
1774
__pyx_L5_except_error:;
1775
1776
/* "aiohttp/_helpers.pyx":22
1777
*
1778
* def __get__(self, inst, owner):
1779
* try: # <<<<<<<<<<<<<<
1780
* try:
1781
* return inst._cache[self.name]
1782
*/
1783
__Pyx_XGIVEREF(__pyx_t_1);
1784
__Pyx_XGIVEREF(__pyx_t_2);
1785
__Pyx_XGIVEREF(__pyx_t_3);
1786
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
1787
goto __pyx_L1_error;
1788
__pyx_L7_try_return:;
1789
__Pyx_XGIVEREF(__pyx_t_1);
1790
__Pyx_XGIVEREF(__pyx_t_2);
1791
__Pyx_XGIVEREF(__pyx_t_3);
1792
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
1793
goto __pyx_L0;
1794
__pyx_L6_except_return:;
1795
__Pyx_XGIVEREF(__pyx_t_1);
1796
__Pyx_XGIVEREF(__pyx_t_2);
1797
__Pyx_XGIVEREF(__pyx_t_3);
1798
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
1799
goto __pyx_L0;
1800
}
1801
1802
/* "aiohttp/_helpers.pyx":21
1803
* return self.wrapped.__doc__
1804
*
1805
* def __get__(self, inst, owner): # <<<<<<<<<<<<<<
1806
* try:
1807
* try:
1808
*/
1809
1810
/* function exit code */
1811
__pyx_L1_error:;
1812
__Pyx_XDECREF(__pyx_t_7);
1813
__Pyx_XDECREF(__pyx_t_8);
1814
__Pyx_XDECREF(__pyx_t_10);
1815
__Pyx_XDECREF(__pyx_t_11);
1816
__Pyx_XDECREF(__pyx_t_12);
1817
__Pyx_XDECREF(__pyx_t_13);
1818
__Pyx_AddTraceback("aiohttp._helpers.reify.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1819
__pyx_r = NULL;
1820
__pyx_L0:;
1821
__Pyx_XDECREF(__pyx_v_val);
1822
__Pyx_XGIVEREF(__pyx_r);
1823
__Pyx_RefNannyFinishContext();
1824
return __pyx_r;
1825
}
1826
1827
/* "aiohttp/_helpers.pyx":34
1828
* raise
1829
*
1830
* def __set__(self, inst, value): # <<<<<<<<<<<<<<
1831
* raise AttributeError("reified property is read-only")
1832
*/
1833
1834
/* Python wrapper */
1835
static int __pyx_pw_7aiohttp_8_helpers_5reify_5__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_inst, PyObject *__pyx_v_value); /*proto*/
1836
static int __pyx_pw_7aiohttp_8_helpers_5reify_5__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_inst, PyObject *__pyx_v_value) {
1837
int __pyx_r;
1838
__Pyx_RefNannyDeclarations
1839
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
1840
__pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify_4__set__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self), ((PyObject *)__pyx_v_inst), ((PyObject *)__pyx_v_value));
1841
1842
/* function exit code */
1843
__Pyx_RefNannyFinishContext();
1844
return __pyx_r;
1845
}
1846
1847
static int __pyx_pf_7aiohttp_8_helpers_5reify_4__set__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_inst, CYTHON_UNUSED PyObject *__pyx_v_value) {
1848
int __pyx_r;
1849
__Pyx_RefNannyDeclarations
1850
PyObject *__pyx_t_1 = NULL;
1851
int __pyx_lineno = 0;
1852
const char *__pyx_filename = NULL;
1853
int __pyx_clineno = 0;
1854
__Pyx_RefNannySetupContext("__set__", 0);
1855
1856
/* "aiohttp/_helpers.pyx":35
1857
*
1858
* def __set__(self, inst, value):
1859
* raise AttributeError("reified property is read-only") # <<<<<<<<<<<<<<
1860
*/
1861
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
1862
__Pyx_GOTREF(__pyx_t_1);
1863
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
1864
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1865
__PYX_ERR(0, 35, __pyx_L1_error)
1866
1867
/* "aiohttp/_helpers.pyx":34
1868
* raise
1869
*
1870
* def __set__(self, inst, value): # <<<<<<<<<<<<<<
1871
* raise AttributeError("reified property is read-only")
1872
*/
1873
1874
/* function exit code */
1875
__pyx_L1_error:;
1876
__Pyx_XDECREF(__pyx_t_1);
1877
__Pyx_AddTraceback("aiohttp._helpers.reify.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1878
__pyx_r = -1;
1879
__Pyx_RefNannyFinishContext();
1880
return __pyx_r;
1881
}
1882
1883
/* "(tree fragment)":1
1884
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
1885
* cdef tuple state
1886
* cdef object _dict
1887
*/
1888
1889
/* Python wrapper */
1890
static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
1891
static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
1892
PyObject *__pyx_r = 0;
1893
__Pyx_RefNannyDeclarations
1894
__Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
1895
__pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify_6__reduce_cython__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self));
1896
1897
/* function exit code */
1898
__Pyx_RefNannyFinishContext();
1899
return __pyx_r;
1900
}
1901
1902
static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_6__reduce_cython__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self) {
1903
PyObject *__pyx_v_state = 0;
1904
PyObject *__pyx_v__dict = 0;
1905
int __pyx_v_use_setstate;
1906
PyObject *__pyx_r = NULL;
1907
__Pyx_RefNannyDeclarations
1908
PyObject *__pyx_t_1 = NULL;
1909
int __pyx_t_2;
1910
int __pyx_t_3;
1911
PyObject *__pyx_t_4 = NULL;
1912
int __pyx_t_5;
1913
PyObject *__pyx_t_6 = NULL;
1914
int __pyx_lineno = 0;
1915
const char *__pyx_filename = NULL;
1916
int __pyx_clineno = 0;
1917
__Pyx_RefNannySetupContext("__reduce_cython__", 0);
1918
1919
/* "(tree fragment)":5
1920
* cdef object _dict
1921
* cdef bint use_setstate
1922
* state = (self.name, self.wrapped) # <<<<<<<<<<<<<<
1923
* _dict = getattr(self, '__dict__', None)
1924
* if _dict is not None:
1925
*/
1926
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
1927
__Pyx_GOTREF(__pyx_t_1);
1928
__Pyx_INCREF(__pyx_v_self->name);
1929
__Pyx_GIVEREF(__pyx_v_self->name);
1930
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
1931
__Pyx_INCREF(__pyx_v_self->wrapped);
1932
__Pyx_GIVEREF(__pyx_v_self->wrapped);
1933
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->wrapped);
1934
__pyx_v_state = ((PyObject*)__pyx_t_1);
1935
__pyx_t_1 = 0;
1936
1937
/* "(tree fragment)":6
1938
* cdef bint use_setstate
1939
* state = (self.name, self.wrapped)
1940
* _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
1941
* if _dict is not None:
1942
* state += (_dict,)
1943
*/
1944
__pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
1945
__Pyx_GOTREF(__pyx_t_1);
1946
__pyx_v__dict = __pyx_t_1;
1947
__pyx_t_1 = 0;
1948
1949
/* "(tree fragment)":7
1950
* state = (self.name, self.wrapped)
1951
* _dict = getattr(self, '__dict__', None)
1952
* if _dict is not None: # <<<<<<<<<<<<<<
1953
* state += (_dict,)
1954
* use_setstate = True
1955
*/
1956
__pyx_t_2 = (__pyx_v__dict != Py_None);
1957
__pyx_t_3 = (__pyx_t_2 != 0);
1958
if (__pyx_t_3) {
1959
1960
/* "(tree fragment)":8
1961
* _dict = getattr(self, '__dict__', None)
1962
* if _dict is not None:
1963
* state += (_dict,) # <<<<<<<<<<<<<<
1964
* use_setstate = True
1965
* else:
1966
*/
1967
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
1968
__Pyx_GOTREF(__pyx_t_1);
1969
__Pyx_INCREF(__pyx_v__dict);
1970
__Pyx_GIVEREF(__pyx_v__dict);
1971
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
1972
__pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
1973
__Pyx_GOTREF(__pyx_t_4);
1974
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1975
__Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
1976
__pyx_t_4 = 0;
1977
1978
/* "(tree fragment)":9
1979
* if _dict is not None:
1980
* state += (_dict,)
1981
* use_setstate = True # <<<<<<<<<<<<<<
1982
* else:
1983
* use_setstate = self.name is not None or self.wrapped is not None
1984
*/
1985
__pyx_v_use_setstate = 1;
1986
1987
/* "(tree fragment)":7
1988
* state = (self.name, self.wrapped)
1989
* _dict = getattr(self, '__dict__', None)
1990
* if _dict is not None: # <<<<<<<<<<<<<<
1991
* state += (_dict,)
1992
* use_setstate = True
1993
*/
1994
goto __pyx_L3;
1995
}
1996
1997
/* "(tree fragment)":11
1998
* use_setstate = True
1999
* else:
2000
* use_setstate = self.name is not None or self.wrapped is not None # <<<<<<<<<<<<<<
2001
* if use_setstate:
2002
* return __pyx_unpickle_reify, (type(self), 0x770cb8f, None), state
2003
*/
2004
/*else*/ {
2005
__pyx_t_2 = (__pyx_v_self->name != Py_None);
2006
__pyx_t_5 = (__pyx_t_2 != 0);
2007
if (!__pyx_t_5) {
2008
} else {
2009
__pyx_t_3 = __pyx_t_5;
2010
goto __pyx_L4_bool_binop_done;
2011
}
2012
__pyx_t_5 = (__pyx_v_self->wrapped != Py_None);
2013
__pyx_t_2 = (__pyx_t_5 != 0);
2014
__pyx_t_3 = __pyx_t_2;
2015
__pyx_L4_bool_binop_done:;
2016
__pyx_v_use_setstate = __pyx_t_3;
2017
}
2018
__pyx_L3:;
2019
2020
/* "(tree fragment)":12
2021
* else:
2022
* use_setstate = self.name is not None or self.wrapped is not None
2023
* if use_setstate: # <<<<<<<<<<<<<<
2024
* return __pyx_unpickle_reify, (type(self), 0x770cb8f, None), state
2025
* else:
2026
*/
2027
__pyx_t_3 = (__pyx_v_use_setstate != 0);
2028
if (__pyx_t_3) {
2029
2030
/* "(tree fragment)":13
2031
* use_setstate = self.name is not None or self.wrapped is not None
2032
* if use_setstate:
2033
* return __pyx_unpickle_reify, (type(self), 0x770cb8f, None), state # <<<<<<<<<<<<<<
2034
* else:
2035
* return __pyx_unpickle_reify, (type(self), 0x770cb8f, state)
2036
*/
2037
__Pyx_XDECREF(__pyx_r);
2038
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_reify); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
2039
__Pyx_GOTREF(__pyx_t_4);
2040
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
2041
__Pyx_GOTREF(__pyx_t_1);
2042
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
2043
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
2044
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
2045
__Pyx_INCREF(__pyx_int_124832655);
2046
__Pyx_GIVEREF(__pyx_int_124832655);
2047
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_124832655);
2048
__Pyx_INCREF(Py_None);
2049
__Pyx_GIVEREF(Py_None);
2050
PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
2051
__pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
2052
__Pyx_GOTREF(__pyx_t_6);
2053
__Pyx_GIVEREF(__pyx_t_4);
2054
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
2055
__Pyx_GIVEREF(__pyx_t_1);
2056
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
2057
__Pyx_INCREF(__pyx_v_state);
2058
__Pyx_GIVEREF(__pyx_v_state);
2059
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
2060
__pyx_t_4 = 0;
2061
__pyx_t_1 = 0;
2062
__pyx_r = __pyx_t_6;
2063
__pyx_t_6 = 0;
2064
goto __pyx_L0;
2065
2066
/* "(tree fragment)":12
2067
* else:
2068
* use_setstate = self.name is not None or self.wrapped is not None
2069
* if use_setstate: # <<<<<<<<<<<<<<
2070
* return __pyx_unpickle_reify, (type(self), 0x770cb8f, None), state
2071
* else:
2072
*/
2073
}
2074
2075
/* "(tree fragment)":15
2076
* return __pyx_unpickle_reify, (type(self), 0x770cb8f, None), state
2077
* else:
2078
* return __pyx_unpickle_reify, (type(self), 0x770cb8f, state) # <<<<<<<<<<<<<<
2079
* def __setstate_cython__(self, __pyx_state):
2080
* __pyx_unpickle_reify__set_state(self, __pyx_state)
2081
*/
2082
/*else*/ {
2083
__Pyx_XDECREF(__pyx_r);
2084
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_reify); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
2085
__Pyx_GOTREF(__pyx_t_6);
2086
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
2087
__Pyx_GOTREF(__pyx_t_1);
2088
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
2089
__Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
2090
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
2091
__Pyx_INCREF(__pyx_int_124832655);
2092
__Pyx_GIVEREF(__pyx_int_124832655);
2093
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_124832655);
2094
__Pyx_INCREF(__pyx_v_state);
2095
__Pyx_GIVEREF(__pyx_v_state);
2096
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
2097
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
2098
__Pyx_GOTREF(__pyx_t_4);
2099
__Pyx_GIVEREF(__pyx_t_6);
2100
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
2101
__Pyx_GIVEREF(__pyx_t_1);
2102
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
2103
__pyx_t_6 = 0;
2104
__pyx_t_1 = 0;
2105
__pyx_r = __pyx_t_4;
2106
__pyx_t_4 = 0;
2107
goto __pyx_L0;
2108
}
2109
2110
/* "(tree fragment)":1
2111
* def __reduce_cython__(self): # <<<<<<<<<<<<<<
2112
* cdef tuple state
2113
* cdef object _dict
2114
*/
2115
2116
/* function exit code */
2117
__pyx_L1_error:;
2118
__Pyx_XDECREF(__pyx_t_1);
2119
__Pyx_XDECREF(__pyx_t_4);
2120
__Pyx_XDECREF(__pyx_t_6);
2121
__Pyx_AddTraceback("aiohttp._helpers.reify.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2122
__pyx_r = NULL;
2123
__pyx_L0:;
2124
__Pyx_XDECREF(__pyx_v_state);
2125
__Pyx_XDECREF(__pyx_v__dict);
2126
__Pyx_XGIVEREF(__pyx_r);
2127
__Pyx_RefNannyFinishContext();
2128
return __pyx_r;
2129
}
2130
2131
/* "(tree fragment)":16
2132
* else:
2133
* return __pyx_unpickle_reify, (type(self), 0x770cb8f, state)
2134
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
2135
* __pyx_unpickle_reify__set_state(self, __pyx_state)
2136
*/
2137
2138
/* Python wrapper */
2139
static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
2140
static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
2141
PyObject *__pyx_r = 0;
2142
__Pyx_RefNannyDeclarations
2143
__Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
2144
__pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify_8__setstate_cython__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
2145
2146
/* function exit code */
2147
__Pyx_RefNannyFinishContext();
2148
return __pyx_r;
2149
}
2150
2151
static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_8__setstate_cython__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
2152
PyObject *__pyx_r = NULL;
2153
__Pyx_RefNannyDeclarations
2154
PyObject *__pyx_t_1 = NULL;
2155
int __pyx_lineno = 0;
2156
const char *__pyx_filename = NULL;
2157
int __pyx_clineno = 0;
2158
__Pyx_RefNannySetupContext("__setstate_cython__", 0);
2159
2160
/* "(tree fragment)":17
2161
* return __pyx_unpickle_reify, (type(self), 0x770cb8f, state)
2162
* def __setstate_cython__(self, __pyx_state):
2163
* __pyx_unpickle_reify__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
2164
*/
2165
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
2166
__pyx_t_1 = __pyx_f_7aiohttp_8_helpers___pyx_unpickle_reify__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
2167
__Pyx_GOTREF(__pyx_t_1);
2168
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2169
2170
/* "(tree fragment)":16
2171
* else:
2172
* return __pyx_unpickle_reify, (type(self), 0x770cb8f, state)
2173
* def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
2174
* __pyx_unpickle_reify__set_state(self, __pyx_state)
2175
*/
2176
2177
/* function exit code */
2178
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
2179
goto __pyx_L0;
2180
__pyx_L1_error:;
2181
__Pyx_XDECREF(__pyx_t_1);
2182
__Pyx_AddTraceback("aiohttp._helpers.reify.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2183
__pyx_r = NULL;
2184
__pyx_L0:;
2185
__Pyx_XGIVEREF(__pyx_r);
2186
__Pyx_RefNannyFinishContext();
2187
return __pyx_r;
2188
}
2189
2190
/* "(tree fragment)":1
2191
* def __pyx_unpickle_reify(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
2192
* cdef object __pyx_PickleError
2193
* cdef object __pyx_result
2194
*/
2195
2196
/* Python wrapper */
2197
static PyObject *__pyx_pw_7aiohttp_8_helpers_1__pyx_unpickle_reify(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2198
static PyMethodDef __pyx_mdef_7aiohttp_8_helpers_1__pyx_unpickle_reify = {"__pyx_unpickle_reify", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7aiohttp_8_helpers_1__pyx_unpickle_reify, METH_VARARGS|METH_KEYWORDS, 0};
2199
static PyObject *__pyx_pw_7aiohttp_8_helpers_1__pyx_unpickle_reify(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2200
PyObject *__pyx_v___pyx_type = 0;
2201
long __pyx_v___pyx_checksum;
2202
PyObject *__pyx_v___pyx_state = 0;
2203
int __pyx_lineno = 0;
2204
const char *__pyx_filename = NULL;
2205
int __pyx_clineno = 0;
2206
PyObject *__pyx_r = 0;
2207
__Pyx_RefNannyDeclarations
2208
__Pyx_RefNannySetupContext("__pyx_unpickle_reify (wrapper)", 0);
2209
{
2210
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
2211
PyObject* values[3] = {0,0,0};
2212
if (unlikely(__pyx_kwds)) {
2213
Py_ssize_t kw_args;
2214
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2215
switch (pos_args) {
2216
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2217
CYTHON_FALLTHROUGH;
2218
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2219
CYTHON_FALLTHROUGH;
2220
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2221
CYTHON_FALLTHROUGH;
2222
case 0: break;
2223
default: goto __pyx_L5_argtuple_error;
2224
}
2225
kw_args = PyDict_Size(__pyx_kwds);
2226
switch (pos_args) {
2227
case 0:
2228
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
2229
else goto __pyx_L5_argtuple_error;
2230
CYTHON_FALLTHROUGH;
2231
case 1:
2232
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
2233
else {
2234
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_reify", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
2235
}
2236
CYTHON_FALLTHROUGH;
2237
case 2:
2238
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
2239
else {
2240
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_reify", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
2241
}
2242
}
2243
if (unlikely(kw_args > 0)) {
2244
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_reify") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
2245
}
2246
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2247
goto __pyx_L5_argtuple_error;
2248
} else {
2249
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2250
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2251
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2252
}
2253
__pyx_v___pyx_type = values[0];
2254
__pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
2255
__pyx_v___pyx_state = values[2];
2256
}
2257
goto __pyx_L4_argument_unpacking_done;
2258
__pyx_L5_argtuple_error:;
2259
__Pyx_RaiseArgtupleInvalid("__pyx_unpickle_reify", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
2260
__pyx_L3_error:;
2261
__Pyx_AddTraceback("aiohttp._helpers.__pyx_unpickle_reify", __pyx_clineno, __pyx_lineno, __pyx_filename);
2262
__Pyx_RefNannyFinishContext();
2263
return NULL;
2264
__pyx_L4_argument_unpacking_done:;
2265
__pyx_r = __pyx_pf_7aiohttp_8_helpers___pyx_unpickle_reify(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
2266
2267
/* function exit code */
2268
__Pyx_RefNannyFinishContext();
2269
return __pyx_r;
2270
}
2271
2272
static PyObject *__pyx_pf_7aiohttp_8_helpers___pyx_unpickle_reify(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
2273
PyObject *__pyx_v___pyx_PickleError = 0;
2274
PyObject *__pyx_v___pyx_result = 0;
2275
PyObject *__pyx_r = NULL;
2276
__Pyx_RefNannyDeclarations
2277
int __pyx_t_1;
2278
PyObject *__pyx_t_2 = NULL;
2279
PyObject *__pyx_t_3 = NULL;
2280
PyObject *__pyx_t_4 = NULL;
2281
PyObject *__pyx_t_5 = NULL;
2282
int __pyx_t_6;
2283
int __pyx_lineno = 0;
2284
const char *__pyx_filename = NULL;
2285
int __pyx_clineno = 0;
2286
__Pyx_RefNannySetupContext("__pyx_unpickle_reify", 0);
2287
2288
/* "(tree fragment)":4
2289
* cdef object __pyx_PickleError
2290
* cdef object __pyx_result
2291
* if __pyx_checksum != 0x770cb8f: # <<<<<<<<<<<<<<
2292
* from pickle import PickleError as __pyx_PickleError
2293
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x770cb8f = (name, wrapped))" % __pyx_checksum)
2294
*/
2295
__pyx_t_1 = ((__pyx_v___pyx_checksum != 0x770cb8f) != 0);
2296
if (__pyx_t_1) {
2297
2298
/* "(tree fragment)":5
2299
* cdef object __pyx_result
2300
* if __pyx_checksum != 0x770cb8f:
2301
* from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
2302
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x770cb8f = (name, wrapped))" % __pyx_checksum)
2303
* __pyx_result = reify.__new__(__pyx_type)
2304
*/
2305
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
2306
__Pyx_GOTREF(__pyx_t_2);
2307
__Pyx_INCREF(__pyx_n_s_PickleError);
2308
__Pyx_GIVEREF(__pyx_n_s_PickleError);
2309
PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
2310
__pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
2311
__Pyx_GOTREF(__pyx_t_3);
2312
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2313
__pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
2314
__Pyx_GOTREF(__pyx_t_2);
2315
__Pyx_INCREF(__pyx_t_2);
2316
__pyx_v___pyx_PickleError = __pyx_t_2;
2317
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2318
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2319
2320
/* "(tree fragment)":6
2321
* if __pyx_checksum != 0x770cb8f:
2322
* from pickle import PickleError as __pyx_PickleError
2323
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x770cb8f = (name, wrapped))" % __pyx_checksum) # <<<<<<<<<<<<<<
2324
* __pyx_result = reify.__new__(__pyx_type)
2325
* if __pyx_state is not None:
2326
*/
2327
__pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
2328
__Pyx_GOTREF(__pyx_t_2);
2329
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x77, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
2330
__Pyx_GOTREF(__pyx_t_4);
2331
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2332
__Pyx_INCREF(__pyx_v___pyx_PickleError);
2333
__pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
2334
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
2335
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
2336
if (likely(__pyx_t_5)) {
2337
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2338
__Pyx_INCREF(__pyx_t_5);
2339
__Pyx_INCREF(function);
2340
__Pyx_DECREF_SET(__pyx_t_2, function);
2341
}
2342
}
2343
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
2344
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2345
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2346
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
2347
__Pyx_GOTREF(__pyx_t_3);
2348
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2349
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
2350
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2351
__PYX_ERR(1, 6, __pyx_L1_error)
2352
2353
/* "(tree fragment)":4
2354
* cdef object __pyx_PickleError
2355
* cdef object __pyx_result
2356
* if __pyx_checksum != 0x770cb8f: # <<<<<<<<<<<<<<
2357
* from pickle import PickleError as __pyx_PickleError
2358
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x770cb8f = (name, wrapped))" % __pyx_checksum)
2359
*/
2360
}
2361
2362
/* "(tree fragment)":7
2363
* from pickle import PickleError as __pyx_PickleError
2364
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x770cb8f = (name, wrapped))" % __pyx_checksum)
2365
* __pyx_result = reify.__new__(__pyx_type) # <<<<<<<<<<<<<<
2366
* if __pyx_state is not None:
2367
* __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
2368
*/
2369
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7aiohttp_8_helpers_reify), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
2370
__Pyx_GOTREF(__pyx_t_2);
2371
__pyx_t_4 = NULL;
2372
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
2373
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
2374
if (likely(__pyx_t_4)) {
2375
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2376
__Pyx_INCREF(__pyx_t_4);
2377
__Pyx_INCREF(function);
2378
__Pyx_DECREF_SET(__pyx_t_2, function);
2379
}
2380
}
2381
__pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
2382
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2383
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
2384
__Pyx_GOTREF(__pyx_t_3);
2385
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2386
__pyx_v___pyx_result = __pyx_t_3;
2387
__pyx_t_3 = 0;
2388
2389
/* "(tree fragment)":8
2390
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x770cb8f = (name, wrapped))" % __pyx_checksum)
2391
* __pyx_result = reify.__new__(__pyx_type)
2392
* if __pyx_state is not None: # <<<<<<<<<<<<<<
2393
* __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
2394
* return __pyx_result
2395
*/
2396
__pyx_t_1 = (__pyx_v___pyx_state != Py_None);
2397
__pyx_t_6 = (__pyx_t_1 != 0);
2398
if (__pyx_t_6) {
2399
2400
/* "(tree fragment)":9
2401
* __pyx_result = reify.__new__(__pyx_type)
2402
* if __pyx_state is not None:
2403
* __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
2404
* return __pyx_result
2405
* cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state):
2406
*/
2407
if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
2408
__pyx_t_3 = __pyx_f_7aiohttp_8_helpers___pyx_unpickle_reify__set_state(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
2409
__Pyx_GOTREF(__pyx_t_3);
2410
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2411
2412
/* "(tree fragment)":8
2413
* raise __pyx_PickleError("Incompatible checksums (%s vs 0x770cb8f = (name, wrapped))" % __pyx_checksum)
2414
* __pyx_result = reify.__new__(__pyx_type)
2415
* if __pyx_state is not None: # <<<<<<<<<<<<<<
2416
* __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
2417
* return __pyx_result
2418
*/
2419
}
2420
2421
/* "(tree fragment)":10
2422
* if __pyx_state is not None:
2423
* __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
2424
* return __pyx_result # <<<<<<<<<<<<<<
2425
* cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state):
2426
* __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
2427
*/
2428
__Pyx_XDECREF(__pyx_r);
2429
__Pyx_INCREF(__pyx_v___pyx_result);
2430
__pyx_r = __pyx_v___pyx_result;
2431
goto __pyx_L0;
2432
2433
/* "(tree fragment)":1
2434
* def __pyx_unpickle_reify(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
2435
* cdef object __pyx_PickleError
2436
* cdef object __pyx_result
2437
*/
2438
2439
/* function exit code */
2440
__pyx_L1_error:;
2441
__Pyx_XDECREF(__pyx_t_2);
2442
__Pyx_XDECREF(__pyx_t_3);
2443
__Pyx_XDECREF(__pyx_t_4);
2444
__Pyx_XDECREF(__pyx_t_5);
2445
__Pyx_AddTraceback("aiohttp._helpers.__pyx_unpickle_reify", __pyx_clineno, __pyx_lineno, __pyx_filename);
2446
__pyx_r = NULL;
2447
__pyx_L0:;
2448
__Pyx_XDECREF(__pyx_v___pyx_PickleError);
2449
__Pyx_XDECREF(__pyx_v___pyx_result);
2450
__Pyx_XGIVEREF(__pyx_r);
2451
__Pyx_RefNannyFinishContext();
2452
return __pyx_r;
2453
}
2454
2455
/* "(tree fragment)":11
2456
* __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
2457
* return __pyx_result
2458
* cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
2459
* __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
2460
* if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
2461
*/
2462
2463
static PyObject *__pyx_f_7aiohttp_8_helpers___pyx_unpickle_reify__set_state(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
2464
PyObject *__pyx_r = NULL;
2465
__Pyx_RefNannyDeclarations
2466
PyObject *__pyx_t_1 = NULL;
2467
int __pyx_t_2;
2468
Py_ssize_t __pyx_t_3;
2469
int __pyx_t_4;
2470
int __pyx_t_5;
2471
PyObject *__pyx_t_6 = NULL;
2472
PyObject *__pyx_t_7 = NULL;
2473
PyObject *__pyx_t_8 = NULL;
2474
int __pyx_lineno = 0;
2475
const char *__pyx_filename = NULL;
2476
int __pyx_clineno = 0;
2477
__Pyx_RefNannySetupContext("__pyx_unpickle_reify__set_state", 0);
2478
2479
/* "(tree fragment)":12
2480
* return __pyx_result
2481
* cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state):
2482
* __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1] # <<<<<<<<<<<<<<
2483
* if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
2484
* __pyx_result.__dict__.update(__pyx_state[2])
2485
*/
2486
if (unlikely(__pyx_v___pyx_state == Py_None)) {
2487
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
2488
__PYX_ERR(1, 12, __pyx_L1_error)
2489
}
2490
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
2491
__Pyx_GOTREF(__pyx_t_1);
2492
__Pyx_GIVEREF(__pyx_t_1);
2493
__Pyx_GOTREF(__pyx_v___pyx_result->name);
2494
__Pyx_DECREF(__pyx_v___pyx_result->name);
2495
__pyx_v___pyx_result->name = __pyx_t_1;
2496
__pyx_t_1 = 0;
2497
if (unlikely(__pyx_v___pyx_state == Py_None)) {
2498
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
2499
__PYX_ERR(1, 12, __pyx_L1_error)
2500
}
2501
__pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
2502
__Pyx_GOTREF(__pyx_t_1);
2503
__Pyx_GIVEREF(__pyx_t_1);
2504
__Pyx_GOTREF(__pyx_v___pyx_result->wrapped);
2505
__Pyx_DECREF(__pyx_v___pyx_result->wrapped);
2506
__pyx_v___pyx_result->wrapped = __pyx_t_1;
2507
__pyx_t_1 = 0;
2508
2509
/* "(tree fragment)":13
2510
* cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state):
2511
* __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
2512
* if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
2513
* __pyx_result.__dict__.update(__pyx_state[2])
2514
*/
2515
if (unlikely(__pyx_v___pyx_state == Py_None)) {
2516
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
2517
__PYX_ERR(1, 13, __pyx_L1_error)
2518
}
2519
__pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
2520
__pyx_t_4 = ((__pyx_t_3 > 2) != 0);
2521
if (__pyx_t_4) {
2522
} else {
2523
__pyx_t_2 = __pyx_t_4;
2524
goto __pyx_L4_bool_binop_done;
2525
}
2526
__pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
2527
__pyx_t_5 = (__pyx_t_4 != 0);
2528
__pyx_t_2 = __pyx_t_5;
2529
__pyx_L4_bool_binop_done:;
2530
if (__pyx_t_2) {
2531
2532
/* "(tree fragment)":14
2533
* __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
2534
* if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
2535
* __pyx_result.__dict__.update(__pyx_state[2]) # <<<<<<<<<<<<<<
2536
*/
2537
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
2538
__Pyx_GOTREF(__pyx_t_6);
2539
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
2540
__Pyx_GOTREF(__pyx_t_7);
2541
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2542
if (unlikely(__pyx_v___pyx_state == Py_None)) {
2543
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
2544
__PYX_ERR(1, 14, __pyx_L1_error)
2545
}
2546
__pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
2547
__Pyx_GOTREF(__pyx_t_6);
2548
__pyx_t_8 = NULL;
2549
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
2550
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
2551
if (likely(__pyx_t_8)) {
2552
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
2553
__Pyx_INCREF(__pyx_t_8);
2554
__Pyx_INCREF(function);
2555
__Pyx_DECREF_SET(__pyx_t_7, function);
2556
}
2557
}
2558
__pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
2559
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2560
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2561
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
2562
__Pyx_GOTREF(__pyx_t_1);
2563
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2564
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2565
2566
/* "(tree fragment)":13
2567
* cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state):
2568
* __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
2569
* if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
2570
* __pyx_result.__dict__.update(__pyx_state[2])
2571
*/
2572
}
2573
2574
/* "(tree fragment)":11
2575
* __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
2576
* return __pyx_result
2577
* cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
2578
* __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
2579
* if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
2580
*/
2581
2582
/* function exit code */
2583
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
2584
goto __pyx_L0;
2585
__pyx_L1_error:;
2586
__Pyx_XDECREF(__pyx_t_1);
2587
__Pyx_XDECREF(__pyx_t_6);
2588
__Pyx_XDECREF(__pyx_t_7);
2589
__Pyx_XDECREF(__pyx_t_8);
2590
__Pyx_AddTraceback("aiohttp._helpers.__pyx_unpickle_reify__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
2591
__pyx_r = 0;
2592
__pyx_L0:;
2593
__Pyx_XGIVEREF(__pyx_r);
2594
__Pyx_RefNannyFinishContext();
2595
return __pyx_r;
2596
}
2597
2598
static PyObject *__pyx_tp_new_7aiohttp_8_helpers_reify(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
2599
struct __pyx_obj_7aiohttp_8_helpers_reify *p;
2600
PyObject *o;
2601
if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
2602
o = (*t->tp_alloc)(t, 0);
2603
} else {
2604
o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
2605
}
2606
if (unlikely(!o)) return 0;
2607
p = ((struct __pyx_obj_7aiohttp_8_helpers_reify *)o);
2608
p->wrapped = Py_None; Py_INCREF(Py_None);
2609
p->name = Py_None; Py_INCREF(Py_None);
2610
return o;
2611
}
2612
2613
static void __pyx_tp_dealloc_7aiohttp_8_helpers_reify(PyObject *o) {
2614
struct __pyx_obj_7aiohttp_8_helpers_reify *p = (struct __pyx_obj_7aiohttp_8_helpers_reify *)o;
2615
#if CYTHON_USE_TP_FINALIZE
2616
if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
2617
if (PyObject_CallFinalizerFromDealloc(o)) return;
2618
}
2619
#endif
2620
PyObject_GC_UnTrack(o);
2621
Py_CLEAR(p->wrapped);
2622
Py_CLEAR(p->name);
2623
(*Py_TYPE(o)->tp_free)(o);
2624
}
2625
2626
static int __pyx_tp_traverse_7aiohttp_8_helpers_reify(PyObject *o, visitproc v, void *a) {
2627
int e;
2628
struct __pyx_obj_7aiohttp_8_helpers_reify *p = (struct __pyx_obj_7aiohttp_8_helpers_reify *)o;
2629
if (p->wrapped) {
2630
e = (*v)(p->wrapped, a); if (e) return e;
2631
}
2632
if (p->name) {
2633
e = (*v)(p->name, a); if (e) return e;
2634
}
2635
return 0;
2636
}
2637
2638
static int __pyx_tp_clear_7aiohttp_8_helpers_reify(PyObject *o) {
2639
PyObject* tmp;
2640
struct __pyx_obj_7aiohttp_8_helpers_reify *p = (struct __pyx_obj_7aiohttp_8_helpers_reify *)o;
2641
tmp = ((PyObject*)p->wrapped);
2642
p->wrapped = Py_None; Py_INCREF(Py_None);
2643
Py_XDECREF(tmp);
2644
tmp = ((PyObject*)p->name);
2645
p->name = Py_None; Py_INCREF(Py_None);
2646
Py_XDECREF(tmp);
2647
return 0;
2648
}
2649
2650
static PyObject *__pyx_tp_descr_get_7aiohttp_8_helpers_reify(PyObject *o, PyObject *i, PyObject *c) {
2651
PyObject *r = 0;
2652
if (!i) i = Py_None;
2653
if (!c) c = Py_None;
2654
r = __pyx_pw_7aiohttp_8_helpers_5reify_3__get__(o, i, c);
2655
return r;
2656
}
2657
2658
static int __pyx_tp_descr_set_7aiohttp_8_helpers_reify(PyObject *o, PyObject *i, PyObject *v) {
2659
if (v) {
2660
return __pyx_pw_7aiohttp_8_helpers_5reify_5__set__(o, i, v);
2661
}
2662
else {
2663
PyErr_SetString(PyExc_NotImplementedError, "__delete__");
2664
return -1;
2665
}
2666
}
2667
2668
static PyObject *__pyx_getprop_7aiohttp_8_helpers_5reify___doc__(PyObject *o, CYTHON_UNUSED void *x) {
2669
return __pyx_pw_7aiohttp_8_helpers_5reify_7__doc___1__get__(o);
2670
}
2671
2672
static PyMethodDef __pyx_methods_7aiohttp_8_helpers_reify[] = {
2673
{"__reduce_cython__", (PyCFunction)__pyx_pw_7aiohttp_8_helpers_5reify_7__reduce_cython__, METH_NOARGS, 0},
2674
{"__setstate_cython__", (PyCFunction)__pyx_pw_7aiohttp_8_helpers_5reify_9__setstate_cython__, METH_O, 0},
2675
{0, 0, 0, 0}
2676
};
2677
2678
static struct PyGetSetDef __pyx_getsets_7aiohttp_8_helpers_reify[] = {
2679
{(char *)"__doc__", __pyx_getprop_7aiohttp_8_helpers_5reify___doc__, 0, (char *)0, 0},
2680
{0, 0, 0, 0, 0}
2681
};
2682
2683
static PyTypeObject __pyx_type_7aiohttp_8_helpers_reify = {
2684
PyVarObject_HEAD_INIT(0, 0)
2685
"aiohttp._helpers.reify", /*tp_name*/
2686
sizeof(struct __pyx_obj_7aiohttp_8_helpers_reify), /*tp_basicsize*/
2687
0, /*tp_itemsize*/
2688
__pyx_tp_dealloc_7aiohttp_8_helpers_reify, /*tp_dealloc*/
2689
#if PY_VERSION_HEX < 0x030800b4
2690
0, /*tp_print*/
2691
#endif
2692
#if PY_VERSION_HEX >= 0x030800b4
2693
0, /*tp_vectorcall_offset*/
2694
#endif
2695
0, /*tp_getattr*/
2696
0, /*tp_setattr*/
2697
#if PY_MAJOR_VERSION < 3
2698
0, /*tp_compare*/
2699
#endif
2700
#if PY_MAJOR_VERSION >= 3
2701
0, /*tp_as_async*/
2702
#endif
2703
0, /*tp_repr*/
2704
0, /*tp_as_number*/
2705
0, /*tp_as_sequence*/
2706
0, /*tp_as_mapping*/
2707
0, /*tp_hash*/
2708
0, /*tp_call*/
2709
0, /*tp_str*/
2710
0, /*tp_getattro*/
2711
0, /*tp_setattro*/
2712
0, /*tp_as_buffer*/
2713
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
2714
"Use as a class method decorator. It operates almost exactly like\n the Python `@property` decorator, but it puts the result of the\n method it decorates into the instance dict after the first call,\n effectively replacing the function it decorates with an instance\n variable. It is, in Python parlance, a data descriptor.\n\n ", /*tp_doc*/
2715
__pyx_tp_traverse_7aiohttp_8_helpers_reify, /*tp_traverse*/
2716
__pyx_tp_clear_7aiohttp_8_helpers_reify, /*tp_clear*/
2717
0, /*tp_richcompare*/
2718
0, /*tp_weaklistoffset*/
2719
0, /*tp_iter*/
2720
0, /*tp_iternext*/
2721
__pyx_methods_7aiohttp_8_helpers_reify, /*tp_methods*/
2722
0, /*tp_members*/
2723
__pyx_getsets_7aiohttp_8_helpers_reify, /*tp_getset*/
2724
0, /*tp_base*/
2725
0, /*tp_dict*/
2726
__pyx_tp_descr_get_7aiohttp_8_helpers_reify, /*tp_descr_get*/
2727
__pyx_tp_descr_set_7aiohttp_8_helpers_reify, /*tp_descr_set*/
2728
0, /*tp_dictoffset*/
2729
__pyx_pw_7aiohttp_8_helpers_5reify_1__init__, /*tp_init*/
2730
0, /*tp_alloc*/
2731
__pyx_tp_new_7aiohttp_8_helpers_reify, /*tp_new*/
2732
0, /*tp_free*/
2733
0, /*tp_is_gc*/
2734
0, /*tp_bases*/
2735
0, /*tp_mro*/
2736
0, /*tp_cache*/
2737
0, /*tp_subclasses*/
2738
0, /*tp_weaklist*/
2739
0, /*tp_del*/
2740
0, /*tp_version_tag*/
2741
#if PY_VERSION_HEX >= 0x030400a1
2742
0, /*tp_finalize*/
2743
#endif
2744
#if PY_VERSION_HEX >= 0x030800b1
2745
0, /*tp_vectorcall*/
2746
#endif
2747
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
2748
0, /*tp_print*/
2749
#endif
2750
};
2751
2752
static PyMethodDef __pyx_methods[] = {
2753
{0, 0, 0, 0}
2754
};
2755
2756
#if PY_MAJOR_VERSION >= 3
2757
#if CYTHON_PEP489_MULTI_PHASE_INIT
2758
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
2759
static int __pyx_pymod_exec__helpers(PyObject* module); /*proto*/
2760
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
2761
{Py_mod_create, (void*)__pyx_pymod_create},
2762
{Py_mod_exec, (void*)__pyx_pymod_exec__helpers},
2763
{0, NULL}
2764
};
2765
#endif
2766
2767
static struct PyModuleDef __pyx_moduledef = {
2768
PyModuleDef_HEAD_INIT,
2769
"_helpers",
2770
0, /* m_doc */
2771
#if CYTHON_PEP489_MULTI_PHASE_INIT
2772
0, /* m_size */
2773
#else
2774
-1, /* m_size */
2775
#endif
2776
__pyx_methods /* m_methods */,
2777
#if CYTHON_PEP489_MULTI_PHASE_INIT
2778
__pyx_moduledef_slots, /* m_slots */
2779
#else
2780
NULL, /* m_reload */
2781
#endif
2782
NULL, /* m_traverse */
2783
NULL, /* m_clear */
2784
NULL /* m_free */
2785
};
2786
#endif
2787
#ifndef CYTHON_SMALL_CODE
2788
#if defined(__clang__)
2789
#define CYTHON_SMALL_CODE
2790
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
2791
#define CYTHON_SMALL_CODE __attribute__((cold))
2792
#else
2793
#define CYTHON_SMALL_CODE
2794
#endif
2795
#endif
2796
2797
static __Pyx_StringTabEntry __pyx_string_tab[] = {
2798
{&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
2799
{&__pyx_kp_s_Incompatible_checksums_s_vs_0x77, __pyx_k_Incompatible_checksums_s_vs_0x77, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x77), 0, 0, 1, 0},
2800
{&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
2801
{&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
2802
{&__pyx_n_s_aiohttp__helpers, __pyx_k_aiohttp__helpers, sizeof(__pyx_k_aiohttp__helpers), 0, 0, 1, 1},
2803
{&__pyx_n_s_cache, __pyx_k_cache, sizeof(__pyx_k_cache), 0, 0, 1, 1},
2804
{&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
2805
{&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
2806
{&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
2807
{&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
2808
{&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
2809
{&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
2810
{&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
2811
{&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
2812
{&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
2813
{&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
2814
{&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
2815
{&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
2816
{&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
2817
{&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
2818
{&__pyx_n_s_pyx_unpickle_reify, __pyx_k_pyx_unpickle_reify, sizeof(__pyx_k_pyx_unpickle_reify), 0, 0, 1, 1},
2819
{&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
2820
{&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
2821
{&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
2822
{&__pyx_kp_u_reified_property_is_read_only, __pyx_k_reified_property_is_read_only, sizeof(__pyx_k_reified_property_is_read_only), 0, 1, 0, 0},
2823
{&__pyx_n_s_reify, __pyx_k_reify, sizeof(__pyx_k_reify), 0, 0, 1, 1},
2824
{&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
2825
{&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
2826
{&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
2827
{&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
2828
{&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
2829
{&__pyx_n_s_wrapped, __pyx_k_wrapped, sizeof(__pyx_k_wrapped), 0, 0, 1, 1},
2830
{0, 0, 0, 0, 0, 0, 0}
2831
};
2832
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
2833
__pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 25, __pyx_L1_error)
2834
__pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 29, __pyx_L1_error)
2835
return 0;
2836
__pyx_L1_error:;
2837
return -1;
2838
}
2839
2840
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
2841
__Pyx_RefNannyDeclarations
2842
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
2843
2844
/* "aiohttp/_helpers.pyx":35
2845
*
2846
* def __set__(self, inst, value):
2847
* raise AttributeError("reified property is read-only") # <<<<<<<<<<<<<<
2848
*/
2849
__pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_reified_property_is_read_only); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 35, __pyx_L1_error)
2850
__Pyx_GOTREF(__pyx_tuple_);
2851
__Pyx_GIVEREF(__pyx_tuple_);
2852
2853
/* "(tree fragment)":1
2854
* def __pyx_unpickle_reify(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
2855
* cdef object __pyx_PickleError
2856
* cdef object __pyx_result
2857
*/
2858
__pyx_tuple__2 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 1, __pyx_L1_error)
2859
__Pyx_GOTREF(__pyx_tuple__2);
2860
__Pyx_GIVEREF(__pyx_tuple__2);
2861
__pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_reify, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 1, __pyx_L1_error)
2862
__Pyx_RefNannyFinishContext();
2863
return 0;
2864
__pyx_L1_error:;
2865
__Pyx_RefNannyFinishContext();
2866
return -1;
2867
}
2868
2869
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
2870
if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
2871
__pyx_int_124832655 = PyInt_FromLong(124832655L); if (unlikely(!__pyx_int_124832655)) __PYX_ERR(0, 1, __pyx_L1_error)
2872
return 0;
2873
__pyx_L1_error:;
2874
return -1;
2875
}
2876
2877
static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
2878
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
2879
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
2880
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
2881
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
2882
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
2883
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
2884
2885
static int __Pyx_modinit_global_init_code(void) {
2886
__Pyx_RefNannyDeclarations
2887
__Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
2888
/*--- Global init code ---*/
2889
__Pyx_RefNannyFinishContext();
2890
return 0;
2891
}
2892
2893
static int __Pyx_modinit_variable_export_code(void) {
2894
__Pyx_RefNannyDeclarations
2895
__Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
2896
/*--- Variable export code ---*/
2897
__Pyx_RefNannyFinishContext();
2898
return 0;
2899
}
2900
2901
static int __Pyx_modinit_function_export_code(void) {
2902
__Pyx_RefNannyDeclarations
2903
__Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
2904
/*--- Function export code ---*/
2905
__Pyx_RefNannyFinishContext();
2906
return 0;
2907
}
2908
2909
static int __Pyx_modinit_type_init_code(void) {
2910
__Pyx_RefNannyDeclarations
2911
int __pyx_lineno = 0;
2912
const char *__pyx_filename = NULL;
2913
int __pyx_clineno = 0;
2914
__Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
2915
/*--- Type init code ---*/
2916
if (PyType_Ready(&__pyx_type_7aiohttp_8_helpers_reify) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2917
#if PY_VERSION_HEX < 0x030800B1
2918
__pyx_type_7aiohttp_8_helpers_reify.tp_print = 0;
2919
#endif
2920
if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7aiohttp_8_helpers_reify.tp_dictoffset && __pyx_type_7aiohttp_8_helpers_reify.tp_getattro == PyObject_GenericGetAttr)) {
2921
__pyx_type_7aiohttp_8_helpers_reify.tp_getattro = __Pyx_PyObject_GenericGetAttr;
2922
}
2923
if (PyObject_SetAttr(__pyx_m, __pyx_n_s_reify, (PyObject *)&__pyx_type_7aiohttp_8_helpers_reify) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2924
if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7aiohttp_8_helpers_reify) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2925
__pyx_ptype_7aiohttp_8_helpers_reify = &__pyx_type_7aiohttp_8_helpers_reify;
2926
__Pyx_RefNannyFinishContext();
2927
return 0;
2928
__pyx_L1_error:;
2929
__Pyx_RefNannyFinishContext();
2930
return -1;
2931
}
2932
2933
static int __Pyx_modinit_type_import_code(void) {
2934
__Pyx_RefNannyDeclarations
2935
__Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
2936
/*--- Type import code ---*/
2937
__Pyx_RefNannyFinishContext();
2938
return 0;
2939
}
2940
2941
static int __Pyx_modinit_variable_import_code(void) {
2942
__Pyx_RefNannyDeclarations
2943
__Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
2944
/*--- Variable import code ---*/
2945
__Pyx_RefNannyFinishContext();
2946
return 0;
2947
}
2948
2949
static int __Pyx_modinit_function_import_code(void) {
2950
__Pyx_RefNannyDeclarations
2951
__Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
2952
/*--- Function import code ---*/
2953
__Pyx_RefNannyFinishContext();
2954
return 0;
2955
}
2956
2957
2958
#ifndef CYTHON_NO_PYINIT_EXPORT
2959
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
2960
#elif PY_MAJOR_VERSION < 3
2961
#ifdef __cplusplus
2962
#define __Pyx_PyMODINIT_FUNC extern "C" void
2963
#else
2964
#define __Pyx_PyMODINIT_FUNC void
2965
#endif
2966
#else
2967
#ifdef __cplusplus
2968
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
2969
#else
2970
#define __Pyx_PyMODINIT_FUNC PyObject *
2971
#endif
2972
#endif
2973
2974
2975
#if PY_MAJOR_VERSION < 3
2976
__Pyx_PyMODINIT_FUNC init_helpers(void) CYTHON_SMALL_CODE; /*proto*/
2977
__Pyx_PyMODINIT_FUNC init_helpers(void)
2978
#else
2979
__Pyx_PyMODINIT_FUNC PyInit__helpers(void) CYTHON_SMALL_CODE; /*proto*/
2980
__Pyx_PyMODINIT_FUNC PyInit__helpers(void)
2981
#if CYTHON_PEP489_MULTI_PHASE_INIT
2982
{
2983
return PyModuleDef_Init(&__pyx_moduledef);
2984
}
2985
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
2986
#if PY_VERSION_HEX >= 0x030700A1
2987
static PY_INT64_T main_interpreter_id = -1;
2988
PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
2989
if (main_interpreter_id == -1) {
2990
main_interpreter_id = current_id;
2991
return (unlikely(current_id == -1)) ? -1 : 0;
2992
} else if (unlikely(main_interpreter_id != current_id))
2993
#else
2994
static PyInterpreterState *main_interpreter = NULL;
2995
PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
2996
if (!main_interpreter) {
2997
main_interpreter = current_interpreter;
2998
} else if (unlikely(main_interpreter != current_interpreter))
2999
#endif
3000
{
3001
PyErr_SetString(
3002
PyExc_ImportError,
3003
"Interpreter change detected - this module can only be loaded into one interpreter per process.");
3004
return -1;
3005
}
3006
return 0;
3007
}
3008
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
3009
PyObject *value = PyObject_GetAttrString(spec, from_name);
3010
int result = 0;
3011
if (likely(value)) {
3012
if (allow_none || value != Py_None) {
3013
result = PyDict_SetItemString(moddict, to_name, value);
3014
}
3015
Py_DECREF(value);
3016
} else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
3017
PyErr_Clear();
3018
} else {
3019
result = -1;
3020
}
3021
return result;
3022
}
3023
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
3024
PyObject *module = NULL, *moddict, *modname;
3025
if (__Pyx_check_single_interpreter())
3026
return NULL;
3027
if (__pyx_m)
3028
return __Pyx_NewRef(__pyx_m);
3029
modname = PyObject_GetAttrString(spec, "name");
3030
if (unlikely(!modname)) goto bad;
3031
module = PyModule_NewObject(modname);
3032
Py_DECREF(modname);
3033
if (unlikely(!module)) goto bad;
3034
moddict = PyModule_GetDict(module);
3035
if (unlikely(!moddict)) goto bad;
3036
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
3037
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
3038
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
3039
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
3040
return module;
3041
bad:
3042
Py_XDECREF(module);
3043
return NULL;
3044
}
3045
3046
3047
static CYTHON_SMALL_CODE int __pyx_pymod_exec__helpers(PyObject *__pyx_pyinit_module)
3048
#endif
3049
#endif
3050
{
3051
PyObject *__pyx_t_1 = NULL;
3052
int __pyx_lineno = 0;
3053
const char *__pyx_filename = NULL;
3054
int __pyx_clineno = 0;
3055
__Pyx_RefNannyDeclarations
3056
#if CYTHON_PEP489_MULTI_PHASE_INIT
3057
if (__pyx_m) {
3058
if (__pyx_m == __pyx_pyinit_module) return 0;
3059
PyErr_SetString(PyExc_RuntimeError, "Module '_helpers' has already been imported. Re-initialisation is not supported.");
3060
return -1;
3061
}
3062
#elif PY_MAJOR_VERSION >= 3
3063
if (__pyx_m) return __Pyx_NewRef(__pyx_m);
3064
#endif
3065
#if CYTHON_REFNANNY
3066
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
3067
if (!__Pyx_RefNanny) {
3068
PyErr_Clear();
3069
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
3070
if (!__Pyx_RefNanny)
3071
Py_FatalError("failed to import 'refnanny' module");
3072
}
3073
#endif
3074
__Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__helpers(void)", 0);
3075
if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3076
#ifdef __Pxy_PyFrame_Initialize_Offsets
3077
__Pxy_PyFrame_Initialize_Offsets();
3078
#endif
3079
__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
3080
__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
3081
__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
3082
#ifdef __Pyx_CyFunction_USED
3083
if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3084
#endif
3085
#ifdef __Pyx_FusedFunction_USED
3086
if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3087
#endif
3088
#ifdef __Pyx_Coroutine_USED
3089
if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3090
#endif
3091
#ifdef __Pyx_Generator_USED
3092
if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3093
#endif
3094
#ifdef __Pyx_AsyncGen_USED
3095
if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3096
#endif
3097
#ifdef __Pyx_StopAsyncIteration_USED
3098
if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3099
#endif
3100
/*--- Library function declarations ---*/
3101
/*--- Threads initialization code ---*/
3102
#if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
3103
PyEval_InitThreads();
3104
#endif
3105
/*--- Module creation code ---*/
3106
#if CYTHON_PEP489_MULTI_PHASE_INIT
3107
__pyx_m = __pyx_pyinit_module;
3108
Py_INCREF(__pyx_m);
3109
#else
3110
#if PY_MAJOR_VERSION < 3
3111
__pyx_m = Py_InitModule4("_helpers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
3112
#else
3113
__pyx_m = PyModule_Create(&__pyx_moduledef);
3114
#endif
3115
if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
3116
#endif
3117
__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
3118
Py_INCREF(__pyx_d);
3119
__pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
3120
Py_INCREF(__pyx_b);
3121
__pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
3122
Py_INCREF(__pyx_cython_runtime);
3123
if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
3124
/*--- Initialize various global constants etc. ---*/
3125
if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3126
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
3127
if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3128
#endif
3129
if (__pyx_module_is_main_aiohttp___helpers) {
3130
if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3131
}
3132
#if PY_MAJOR_VERSION >= 3
3133
{
3134
PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
3135
if (!PyDict_GetItemString(modules, "aiohttp._helpers")) {
3136
if (unlikely(PyDict_SetItemString(modules, "aiohttp._helpers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
3137
}
3138
}
3139
#endif
3140
/*--- Builtin init code ---*/
3141
if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3142
/*--- Constants init code ---*/
3143
if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3144
/*--- Global type/function init code ---*/
3145
(void)__Pyx_modinit_global_init_code();
3146
(void)__Pyx_modinit_variable_export_code();
3147
(void)__Pyx_modinit_function_export_code();
3148
if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
3149
(void)__Pyx_modinit_type_import_code();
3150
(void)__Pyx_modinit_variable_import_code();
3151
(void)__Pyx_modinit_function_import_code();
3152
/*--- Execution code ---*/
3153
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
3154
if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3155
#endif
3156
3157
/* "(tree fragment)":1
3158
* def __pyx_unpickle_reify(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
3159
* cdef object __pyx_PickleError
3160
* cdef object __pyx_result
3161
*/
3162
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7aiohttp_8_helpers_1__pyx_unpickle_reify, NULL, __pyx_n_s_aiohttp__helpers); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
3163
__Pyx_GOTREF(__pyx_t_1);
3164
if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_reify, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3165
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3166
3167
/* "aiohttp/_helpers.pyx":1
3168
* cdef class reify: # <<<<<<<<<<<<<<
3169
* """Use as a class method decorator. It operates almost exactly like
3170
* the Python `@property` decorator, but it puts the result of the
3171
*/
3172
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
3173
__Pyx_GOTREF(__pyx_t_1);
3174
if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3175
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3176
3177
/*--- Wrapped vars code ---*/
3178
3179
goto __pyx_L0;
3180
__pyx_L1_error:;
3181
__Pyx_XDECREF(__pyx_t_1);
3182
if (__pyx_m) {
3183
if (__pyx_d) {
3184
__Pyx_AddTraceback("init aiohttp._helpers", __pyx_clineno, __pyx_lineno, __pyx_filename);
3185
}
3186
Py_CLEAR(__pyx_m);
3187
} else if (!PyErr_Occurred()) {
3188
PyErr_SetString(PyExc_ImportError, "init aiohttp._helpers");
3189
}
3190
__pyx_L0:;
3191
__Pyx_RefNannyFinishContext();
3192
#if CYTHON_PEP489_MULTI_PHASE_INIT
3193
return (__pyx_m != NULL) ? 0 : -1;
3194
#elif PY_MAJOR_VERSION >= 3
3195
return __pyx_m;
3196
#else
3197
return;
3198
#endif
3199
}
3200
3201
/* --- Runtime support code --- */
3202
/* Refnanny */
3203
#if CYTHON_REFNANNY
3204
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
3205
PyObject *m = NULL, *p = NULL;
3206
void *r = NULL;
3207
m = PyImport_ImportModule(modname);
3208
if (!m) goto end;
3209
p = PyObject_GetAttrString(m, "RefNannyAPI");
3210
if (!p) goto end;
3211
r = PyLong_AsVoidPtr(p);
3212
end:
3213
Py_XDECREF(p);
3214
Py_XDECREF(m);
3215
return (__Pyx_RefNannyAPIStruct *)r;
3216
}
3217
#endif
3218
3219
/* PyObjectGetAttrStr */
3220
#if CYTHON_USE_TYPE_SLOTS
3221
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
3222
PyTypeObject* tp = Py_TYPE(obj);
3223
if (likely(tp->tp_getattro))
3224
return tp->tp_getattro(obj, attr_name);
3225
#if PY_MAJOR_VERSION < 3
3226
if (likely(tp->tp_getattr))
3227
return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
3228
#endif
3229
return PyObject_GetAttr(obj, attr_name);
3230
}
3231
#endif
3232
3233
/* GetBuiltinName */
3234
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
3235
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
3236
if (unlikely(!result)) {
3237
PyErr_Format(PyExc_NameError,
3238
#if PY_MAJOR_VERSION >= 3
3239
"name '%U' is not defined", name);
3240
#else
3241
"name '%.200s' is not defined", PyString_AS_STRING(name));
3242
#endif
3243
}
3244
return result;
3245
}
3246
3247
/* RaiseDoubleKeywords */
3248
static void __Pyx_RaiseDoubleKeywordsError(
3249
const char* func_name,
3250
PyObject* kw_name)
3251
{
3252
PyErr_Format(PyExc_TypeError,
3253
#if PY_MAJOR_VERSION >= 3
3254
"%s() got multiple values for keyword argument '%U'", func_name, kw_name);
3255
#else
3256
"%s() got multiple values for keyword argument '%s'", func_name,
3257
PyString_AsString(kw_name));
3258
#endif
3259
}
3260
3261
/* ParseKeywords */
3262
static int __Pyx_ParseOptionalKeywords(
3263
PyObject *kwds,
3264
PyObject **argnames[],
3265
PyObject *kwds2,
3266
PyObject *values[],
3267
Py_ssize_t num_pos_args,
3268
const char* function_name)
3269
{
3270
PyObject *key = 0, *value = 0;
3271
Py_ssize_t pos = 0;
3272
PyObject*** name;
3273
PyObject*** first_kw_arg = argnames + num_pos_args;
3274
while (PyDict_Next(kwds, &pos, &key, &value)) {
3275
name = first_kw_arg;
3276
while (*name && (**name != key)) name++;
3277
if (*name) {
3278
values[name-argnames] = value;
3279
continue;
3280
}
3281
name = first_kw_arg;
3282
#if PY_MAJOR_VERSION < 3
3283
if (likely(PyString_Check(key))) {
3284
while (*name) {
3285
if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
3286
&& _PyString_Eq(**name, key)) {
3287
values[name-argnames] = value;
3288
break;
3289
}
3290
name++;
3291
}
3292
if (*name) continue;
3293
else {
3294
PyObject*** argname = argnames;
3295
while (argname != first_kw_arg) {
3296
if ((**argname == key) || (
3297
(CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
3298
&& _PyString_Eq(**argname, key))) {
3299
goto arg_passed_twice;
3300
}
3301
argname++;
3302
}
3303
}
3304
} else
3305
#endif
3306
if (likely(PyUnicode_Check(key))) {
3307
while (*name) {
3308
int cmp = (**name == key) ? 0 :
3309
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
3310
(__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
3311
#endif
3312
PyUnicode_Compare(**name, key);
3313
if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
3314
if (cmp == 0) {
3315
values[name-argnames] = value;
3316
break;
3317
}
3318
name++;
3319
}
3320
if (*name) continue;
3321
else {
3322
PyObject*** argname = argnames;
3323
while (argname != first_kw_arg) {
3324
int cmp = (**argname == key) ? 0 :
3325
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
3326
(__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
3327
#endif
3328
PyUnicode_Compare(**argname, key);
3329
if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
3330
if (cmp == 0) goto arg_passed_twice;
3331
argname++;
3332
}
3333
}
3334
} else
3335
goto invalid_keyword_type;
3336
if (kwds2) {
3337
if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
3338
} else {
3339
goto invalid_keyword;
3340
}
3341
}
3342
return 0;
3343
arg_passed_twice:
3344
__Pyx_RaiseDoubleKeywordsError(function_name, key);
3345
goto bad;
3346
invalid_keyword_type:
3347
PyErr_Format(PyExc_TypeError,
3348
"%.200s() keywords must be strings", function_name);
3349
goto bad;
3350
invalid_keyword:
3351
PyErr_Format(PyExc_TypeError,
3352
#if PY_MAJOR_VERSION < 3
3353
"%.200s() got an unexpected keyword argument '%.200s'",
3354
function_name, PyString_AsString(key));
3355
#else
3356
"%s() got an unexpected keyword argument '%U'",
3357
function_name, key);
3358
#endif
3359
bad:
3360
return -1;
3361
}
3362
3363
/* RaiseArgTupleInvalid */
3364
static void __Pyx_RaiseArgtupleInvalid(
3365
const char* func_name,
3366
int exact,
3367
Py_ssize_t num_min,
3368
Py_ssize_t num_max,
3369
Py_ssize_t num_found)
3370
{
3371
Py_ssize_t num_expected;
3372
const char *more_or_less;
3373
if (num_found < num_min) {
3374
num_expected = num_min;
3375
more_or_less = "at least";
3376
} else {
3377
num_expected = num_max;
3378
more_or_less = "at most";
3379
}
3380
if (exact) {
3381
more_or_less = "exactly";
3382
}
3383
PyErr_Format(PyExc_TypeError,
3384
"%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
3385
func_name, more_or_less, num_expected,
3386
(num_expected == 1) ? "" : "s", num_found);
3387
}
3388
3389
/* GetItemInt */
3390
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
3391
PyObject *r;
3392
if (!j) return NULL;
3393
r = PyObject_GetItem(o, j);
3394
Py_DECREF(j);
3395
return r;
3396
}
3397
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
3398
CYTHON_NCP_UNUSED int wraparound,
3399
CYTHON_NCP_UNUSED int boundscheck) {
3400
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3401
Py_ssize_t wrapped_i = i;
3402
if (wraparound & unlikely(i < 0)) {
3403
wrapped_i += PyList_GET_SIZE(o);
3404
}
3405
if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
3406
PyObject *r = PyList_GET_ITEM(o, wrapped_i);
3407
Py_INCREF(r);
3408
return r;
3409
}
3410
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
3411
#else
3412
return PySequence_GetItem(o, i);
3413
#endif
3414
}
3415
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
3416
CYTHON_NCP_UNUSED int wraparound,
3417
CYTHON_NCP_UNUSED int boundscheck) {
3418
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3419
Py_ssize_t wrapped_i = i;
3420
if (wraparound & unlikely(i < 0)) {
3421
wrapped_i += PyTuple_GET_SIZE(o);
3422
}
3423
if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
3424
PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
3425
Py_INCREF(r);
3426
return r;
3427
}
3428
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
3429
#else
3430
return PySequence_GetItem(o, i);
3431
#endif
3432
}
3433
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
3434
CYTHON_NCP_UNUSED int wraparound,
3435
CYTHON_NCP_UNUSED int boundscheck) {
3436
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
3437
if (is_list || PyList_CheckExact(o)) {
3438
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
3439
if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
3440
PyObject *r = PyList_GET_ITEM(o, n);
3441
Py_INCREF(r);
3442
return r;
3443
}
3444
}
3445
else if (PyTuple_CheckExact(o)) {
3446
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
3447
if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
3448
PyObject *r = PyTuple_GET_ITEM(o, n);
3449
Py_INCREF(r);
3450
return r;
3451
}
3452
} else {
3453
PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
3454
if (likely(m && m->sq_item)) {
3455
if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
3456
Py_ssize_t l = m->sq_length(o);
3457
if (likely(l >= 0)) {
3458
i += l;
3459
} else {
3460
if (!PyErr_ExceptionMatches(PyExc_OverflowError))
3461
return NULL;
3462
PyErr_Clear();
3463
}
3464
}
3465
return m->sq_item(o, i);
3466
}
3467
}
3468
#else
3469
if (is_list || PySequence_Check(o)) {
3470
return PySequence_GetItem(o, i);
3471
}
3472
#endif
3473
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
3474
}
3475
3476
/* ObjectGetItem */
3477
#if CYTHON_USE_TYPE_SLOTS
3478
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
3479
PyObject *runerr;
3480
Py_ssize_t key_value;
3481
PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
3482
if (unlikely(!(m && m->sq_item))) {
3483
PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
3484
return NULL;
3485
}
3486
key_value = __Pyx_PyIndex_AsSsize_t(index);
3487
if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
3488
return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
3489
}
3490
if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
3491
PyErr_Clear();
3492
PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
3493
}
3494
return NULL;
3495
}
3496
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
3497
PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
3498
if (likely(m && m->mp_subscript)) {
3499
return m->mp_subscript(obj, key);
3500
}
3501
return __Pyx_PyObject_GetIndex(obj, key);
3502
}
3503
#endif
3504
3505
/* GetTopmostException */
3506
#if CYTHON_USE_EXC_INFO_STACK
3507
static _PyErr_StackItem *
3508
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
3509
{
3510
_PyErr_StackItem *exc_info = tstate->exc_info;
3511
while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
3512
exc_info->previous_item != NULL)
3513
{
3514
exc_info = exc_info->previous_item;
3515
}
3516
return exc_info;
3517
}
3518
#endif
3519
3520
/* SaveResetException */
3521
#if CYTHON_FAST_THREAD_STATE
3522
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
3523
#if CYTHON_USE_EXC_INFO_STACK
3524
_PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
3525
*type = exc_info->exc_type;
3526
*value = exc_info->exc_value;
3527
*tb = exc_info->exc_traceback;
3528
#else
3529
*type = tstate->exc_type;
3530
*value = tstate->exc_value;
3531
*tb = tstate->exc_traceback;
3532
#endif
3533
Py_XINCREF(*type);
3534
Py_XINCREF(*value);
3535
Py_XINCREF(*tb);
3536
}
3537
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
3538
PyObject *tmp_type, *tmp_value, *tmp_tb;
3539
#if CYTHON_USE_EXC_INFO_STACK
3540
_PyErr_StackItem *exc_info = tstate->exc_info;
3541
tmp_type = exc_info->exc_type;
3542
tmp_value = exc_info->exc_value;
3543
tmp_tb = exc_info->exc_traceback;
3544
exc_info->exc_type = type;
3545
exc_info->exc_value = value;
3546
exc_info->exc_traceback = tb;
3547
#else
3548
tmp_type = tstate->exc_type;
3549
tmp_value = tstate->exc_value;
3550
tmp_tb = tstate->exc_traceback;
3551
tstate->exc_type = type;
3552
tstate->exc_value = value;
3553
tstate->exc_traceback = tb;
3554
#endif
3555
Py_XDECREF(tmp_type);
3556
Py_XDECREF(tmp_value);
3557
Py_XDECREF(tmp_tb);
3558
}
3559
#endif
3560
3561
/* PyErrExceptionMatches */
3562
#if CYTHON_FAST_THREAD_STATE
3563
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
3564
Py_ssize_t i, n;
3565
n = PyTuple_GET_SIZE(tuple);
3566
#if PY_MAJOR_VERSION >= 3
3567
for (i=0; i<n; i++) {
3568
if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
3569
}
3570
#endif
3571
for (i=0; i<n; i++) {
3572
if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
3573
}
3574
return 0;
3575
}
3576
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
3577
PyObject *exc_type = tstate->curexc_type;
3578
if (exc_type == err) return 1;
3579
if (unlikely(!exc_type)) return 0;
3580
if (unlikely(PyTuple_Check(err)))
3581
return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
3582
return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
3583
}
3584
#endif
3585
3586
/* GetException */
3587
#if CYTHON_FAST_THREAD_STATE
3588
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
3589
#else
3590
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
3591
#endif
3592
{
3593
PyObject *local_type, *local_value, *local_tb;
3594
#if CYTHON_FAST_THREAD_STATE
3595
PyObject *tmp_type, *tmp_value, *tmp_tb;
3596
local_type = tstate->curexc_type;
3597
local_value = tstate->curexc_value;
3598
local_tb = tstate->curexc_traceback;
3599
tstate->curexc_type = 0;
3600
tstate->curexc_value = 0;
3601
tstate->curexc_traceback = 0;
3602
#else
3603
PyErr_Fetch(&local_type, &local_value, &local_tb);
3604
#endif
3605
PyErr_NormalizeException(&local_type, &local_value, &local_tb);
3606
#if CYTHON_FAST_THREAD_STATE
3607
if (unlikely(tstate->curexc_type))
3608
#else
3609
if (unlikely(PyErr_Occurred()))
3610
#endif
3611
goto bad;
3612
#if PY_MAJOR_VERSION >= 3
3613
if (local_tb) {
3614
if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
3615
goto bad;
3616
}
3617
#endif
3618
Py_XINCREF(local_tb);
3619
Py_XINCREF(local_type);
3620
Py_XINCREF(local_value);
3621
*type = local_type;
3622
*value = local_value;
3623
*tb = local_tb;
3624
#if CYTHON_FAST_THREAD_STATE
3625
#if CYTHON_USE_EXC_INFO_STACK
3626
{
3627
_PyErr_StackItem *exc_info = tstate->exc_info;
3628
tmp_type = exc_info->exc_type;
3629
tmp_value = exc_info->exc_value;
3630
tmp_tb = exc_info->exc_traceback;
3631
exc_info->exc_type = local_type;
3632
exc_info->exc_value = local_value;
3633
exc_info->exc_traceback = local_tb;
3634
}
3635
#else
3636
tmp_type = tstate->exc_type;
3637
tmp_value = tstate->exc_value;
3638
tmp_tb = tstate->exc_traceback;
3639
tstate->exc_type = local_type;
3640
tstate->exc_value = local_value;
3641
tstate->exc_traceback = local_tb;
3642
#endif
3643
Py_XDECREF(tmp_type);
3644
Py_XDECREF(tmp_value);
3645
Py_XDECREF(tmp_tb);
3646
#else
3647
PyErr_SetExcInfo(local_type, local_value, local_tb);
3648
#endif
3649
return 0;
3650
bad:
3651
*type = 0;
3652
*value = 0;
3653
*tb = 0;
3654
Py_XDECREF(local_type);
3655
Py_XDECREF(local_value);
3656
Py_XDECREF(local_tb);
3657
return -1;
3658
}
3659
3660
/* PyCFunctionFastCall */
3661
#if CYTHON_FAST_PYCCALL
3662
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
3663
PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
3664
PyCFunction meth = PyCFunction_GET_FUNCTION(func);
3665
PyObject *self = PyCFunction_GET_SELF(func);
3666
int flags = PyCFunction_GET_FLAGS(func);
3667
assert(PyCFunction_Check(func));
3668
assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
3669
assert(nargs >= 0);
3670
assert(nargs == 0 || args != NULL);
3671
/* _PyCFunction_FastCallDict() must not be called with an exception set,
3672
because it may clear it (directly or indirectly) and so the
3673
caller loses its exception */
3674
assert(!PyErr_Occurred());
3675
if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
3676
return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
3677
} else {
3678
return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
3679
}
3680
}
3681
#endif
3682
3683
/* PyFunctionFastCall */
3684
#if CYTHON_FAST_PYCALL
3685
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
3686
PyObject *globals) {
3687
PyFrameObject *f;
3688
PyThreadState *tstate = __Pyx_PyThreadState_Current;
3689
PyObject **fastlocals;
3690
Py_ssize_t i;
3691
PyObject *result;
3692
assert(globals != NULL);
3693
/* XXX Perhaps we should create a specialized
3694
PyFrame_New() that doesn't take locals, but does
3695
take builtins without sanity checking them.
3696
*/
3697
assert(tstate != NULL);
3698
f = PyFrame_New(tstate, co, globals, NULL);
3699
if (f == NULL) {
3700
return NULL;
3701
}
3702
fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
3703
for (i = 0; i < na; i++) {
3704
Py_INCREF(*args);
3705
fastlocals[i] = *args++;
3706
}
3707
result = PyEval_EvalFrameEx(f,0);
3708
++tstate->recursion_depth;
3709
Py_DECREF(f);
3710
--tstate->recursion_depth;
3711
return result;
3712
}
3713
#if 1 || PY_VERSION_HEX < 0x030600B1
3714
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
3715
PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
3716
PyObject *globals = PyFunction_GET_GLOBALS(func);
3717
PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
3718
PyObject *closure;
3719
#if PY_MAJOR_VERSION >= 3
3720
PyObject *kwdefs;
3721
#endif
3722
PyObject *kwtuple, **k;
3723
PyObject **d;
3724
Py_ssize_t nd;
3725
Py_ssize_t nk;
3726
PyObject *result;
3727
assert(kwargs == NULL || PyDict_Check(kwargs));
3728
nk = kwargs ? PyDict_Size(kwargs) : 0;
3729
if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
3730
return NULL;
3731
}
3732
if (
3733
#if PY_MAJOR_VERSION >= 3
3734
co->co_kwonlyargcount == 0 &&
3735
#endif
3736
likely(kwargs == NULL || nk == 0) &&
3737
co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
3738
if (argdefs == NULL && co->co_argcount == nargs) {
3739
result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
3740
goto done;
3741
}
3742
else if (nargs == 0 && argdefs != NULL
3743
&& co->co_argcount == Py_SIZE(argdefs)) {
3744
/* function called with no arguments, but all parameters have
3745
a default value: use default values as arguments .*/
3746
args = &PyTuple_GET_ITEM(argdefs, 0);
3747
result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
3748
goto done;
3749
}
3750
}
3751
if (kwargs != NULL) {
3752
Py_ssize_t pos, i;
3753
kwtuple = PyTuple_New(2 * nk);
3754
if (kwtuple == NULL) {
3755
result = NULL;
3756
goto done;
3757
}
3758
k = &PyTuple_GET_ITEM(kwtuple, 0);
3759
pos = i = 0;
3760
while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
3761
Py_INCREF(k[i]);
3762
Py_INCREF(k[i+1]);
3763
i += 2;
3764
}
3765
nk = i / 2;
3766
}
3767
else {
3768
kwtuple = NULL;
3769
k = NULL;
3770
}
3771
closure = PyFunction_GET_CLOSURE(func);
3772
#if PY_MAJOR_VERSION >= 3
3773
kwdefs = PyFunction_GET_KW_DEFAULTS(func);
3774
#endif
3775
if (argdefs != NULL) {
3776
d = &PyTuple_GET_ITEM(argdefs, 0);
3777
nd = Py_SIZE(argdefs);
3778
}
3779
else {
3780
d = NULL;
3781
nd = 0;
3782
}
3783
#if PY_MAJOR_VERSION >= 3
3784
result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
3785
args, (int)nargs,
3786
k, (int)nk,
3787
d, (int)nd, kwdefs, closure);
3788
#else
3789
result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
3790
args, (int)nargs,
3791
k, (int)nk,
3792
d, (int)nd, closure);
3793
#endif
3794
Py_XDECREF(kwtuple);
3795
done:
3796
Py_LeaveRecursiveCall();
3797
return result;
3798
}
3799
#endif
3800
#endif
3801
3802
/* PyObjectCall */
3803
#if CYTHON_COMPILING_IN_CPYTHON
3804
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
3805
PyObject *result;
3806
ternaryfunc call = Py_TYPE(func)->tp_call;
3807
if (unlikely(!call))
3808
return PyObject_Call(func, arg, kw);
3809
if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
3810
return NULL;
3811
result = (*call)(func, arg, kw);
3812
Py_LeaveRecursiveCall();
3813
if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
3814
PyErr_SetString(
3815
PyExc_SystemError,
3816
"NULL result without error in PyObject_Call");
3817
}
3818
return result;
3819
}
3820
#endif
3821
3822
/* PyObjectCall2Args */
3823
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
3824
PyObject *args, *result = NULL;
3825
#if CYTHON_FAST_PYCALL
3826
if (PyFunction_Check(function)) {
3827
PyObject *args[2] = {arg1, arg2};
3828
return __Pyx_PyFunction_FastCall(function, args, 2);
3829
}
3830
#endif
3831
#if CYTHON_FAST_PYCCALL
3832
if (__Pyx_PyFastCFunction_Check(function)) {
3833
PyObject *args[2] = {arg1, arg2};
3834
return __Pyx_PyCFunction_FastCall(function, args, 2);
3835
}
3836
#endif
3837
args = PyTuple_New(2);
3838
if (unlikely(!args)) goto done;
3839
Py_INCREF(arg1);
3840
PyTuple_SET_ITEM(args, 0, arg1);
3841
Py_INCREF(arg2);
3842
PyTuple_SET_ITEM(args, 1, arg2);
3843
Py_INCREF(function);
3844
result = __Pyx_PyObject_Call(function, args, NULL);
3845
Py_DECREF(args);
3846
Py_DECREF(function);
3847
done:
3848
return result;
3849
}
3850
3851
/* PyObjectCallMethO */
3852
#if CYTHON_COMPILING_IN_CPYTHON
3853
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
3854
PyObject *self, *result;
3855
PyCFunction cfunc;
3856
cfunc = PyCFunction_GET_FUNCTION(func);
3857
self = PyCFunction_GET_SELF(func);
3858
if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
3859
return NULL;
3860
result = cfunc(self, arg);
3861
Py_LeaveRecursiveCall();
3862
if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
3863
PyErr_SetString(
3864
PyExc_SystemError,
3865
"NULL result without error in PyObject_Call");
3866
}
3867
return result;
3868
}
3869
#endif
3870
3871
/* PyObjectCallOneArg */
3872
#if CYTHON_COMPILING_IN_CPYTHON
3873
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
3874
PyObject *result;
3875
PyObject *args = PyTuple_New(1);
3876
if (unlikely(!args)) return NULL;
3877
Py_INCREF(arg);
3878
PyTuple_SET_ITEM(args, 0, arg);
3879
result = __Pyx_PyObject_Call(func, args, NULL);
3880
Py_DECREF(args);
3881
return result;
3882
}
3883
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
3884
#if CYTHON_FAST_PYCALL
3885
if (PyFunction_Check(func)) {
3886
return __Pyx_PyFunction_FastCall(func, &arg, 1);
3887
}
3888
#endif
3889
if (likely(PyCFunction_Check(func))) {
3890
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
3891
return __Pyx_PyObject_CallMethO(func, arg);
3892
#if CYTHON_FAST_PYCCALL
3893
} else if (__Pyx_PyFastCFunction_Check(func)) {
3894
return __Pyx_PyCFunction_FastCall(func, &arg, 1);
3895
#endif
3896
}
3897
}
3898
return __Pyx__PyObject_CallOneArg(func, arg);
3899
}
3900
#else
3901
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
3902
PyObject *result;
3903
PyObject *args = PyTuple_Pack(1, arg);
3904
if (unlikely(!args)) return NULL;
3905
result = __Pyx_PyObject_Call(func, args, NULL);
3906
Py_DECREF(args);
3907
return result;
3908
}
3909
#endif
3910
3911
/* PyErrFetchRestore */
3912
#if CYTHON_FAST_THREAD_STATE
3913
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
3914
PyObject *tmp_type, *tmp_value, *tmp_tb;
3915
tmp_type = tstate->curexc_type;
3916
tmp_value = tstate->curexc_value;
3917
tmp_tb = tstate->curexc_traceback;
3918
tstate->curexc_type = type;
3919
tstate->curexc_value = value;
3920
tstate->curexc_traceback = tb;
3921
Py_XDECREF(tmp_type);
3922
Py_XDECREF(tmp_value);
3923
Py_XDECREF(tmp_tb);
3924
}
3925
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
3926
*type = tstate->curexc_type;
3927
*value = tstate->curexc_value;
3928
*tb = tstate->curexc_traceback;
3929
tstate->curexc_type = 0;
3930
tstate->curexc_value = 0;
3931
tstate->curexc_traceback = 0;
3932
}
3933
#endif
3934
3935
/* RaiseException */
3936
#if PY_MAJOR_VERSION < 3
3937
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
3938
CYTHON_UNUSED PyObject *cause) {
3939
__Pyx_PyThreadState_declare
3940
Py_XINCREF(type);
3941
if (!value || value == Py_None)
3942
value = NULL;
3943
else
3944
Py_INCREF(value);
3945
if (!tb || tb == Py_None)
3946
tb = NULL;
3947
else {
3948
Py_INCREF(tb);
3949
if (!PyTraceBack_Check(tb)) {
3950
PyErr_SetString(PyExc_TypeError,
3951
"raise: arg 3 must be a traceback or None");
3952
goto raise_error;
3953
}
3954
}
3955
if (PyType_Check(type)) {
3956
#if CYTHON_COMPILING_IN_PYPY
3957
if (!value) {
3958
Py_INCREF(Py_None);
3959
value = Py_None;
3960
}
3961
#endif
3962
PyErr_NormalizeException(&type, &value, &tb);
3963
} else {
3964
if (value) {
3965
PyErr_SetString(PyExc_TypeError,
3966
"instance exception may not have a separate value");
3967
goto raise_error;
3968
}
3969
value = type;
3970
type = (PyObject*) Py_TYPE(type);
3971
Py_INCREF(type);
3972
if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
3973
PyErr_SetString(PyExc_TypeError,
3974
"raise: exception class must be a subclass of BaseException");
3975
goto raise_error;
3976
}
3977
}
3978
__Pyx_PyThreadState_assign
3979
__Pyx_ErrRestore(type, value, tb);
3980
return;
3981
raise_error:
3982
Py_XDECREF(value);
3983
Py_XDECREF(type);
3984
Py_XDECREF(tb);
3985
return;
3986
}
3987
#else
3988
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
3989
PyObject* owned_instance = NULL;
3990
if (tb == Py_None) {
3991
tb = 0;
3992
} else if (tb && !PyTraceBack_Check(tb)) {
3993
PyErr_SetString(PyExc_TypeError,
3994
"raise: arg 3 must be a traceback or None");
3995
goto bad;
3996
}
3997
if (value == Py_None)
3998
value = 0;
3999
if (PyExceptionInstance_Check(type)) {
4000
if (value) {
4001
PyErr_SetString(PyExc_TypeError,
4002
"instance exception may not have a separate value");
4003
goto bad;
4004
}
4005
value = type;
4006
type = (PyObject*) Py_TYPE(value);
4007
} else if (PyExceptionClass_Check(type)) {
4008
PyObject *instance_class = NULL;
4009
if (value && PyExceptionInstance_Check(value)) {
4010
instance_class = (PyObject*) Py_TYPE(value);
4011
if (instance_class != type) {
4012
int is_subclass = PyObject_IsSubclass(instance_class, type);
4013
if (!is_subclass) {
4014
instance_class = NULL;
4015
} else if (unlikely(is_subclass == -1)) {
4016
goto bad;
4017
} else {
4018
type = instance_class;
4019
}
4020
}
4021
}
4022
if (!instance_class) {
4023
PyObject *args;
4024
if (!value)
4025
args = PyTuple_New(0);
4026
else if (PyTuple_Check(value)) {
4027
Py_INCREF(value);
4028
args = value;
4029
} else
4030
args = PyTuple_Pack(1, value);
4031
if (!args)
4032
goto bad;
4033
owned_instance = PyObject_Call(type, args, NULL);
4034
Py_DECREF(args);
4035
if (!owned_instance)
4036
goto bad;
4037
value = owned_instance;
4038
if (!PyExceptionInstance_Check(value)) {
4039
PyErr_Format(PyExc_TypeError,
4040
"calling %R should have returned an instance of "
4041
"BaseException, not %R",
4042
type, Py_TYPE(value));
4043
goto bad;
4044
}
4045
}
4046
} else {
4047
PyErr_SetString(PyExc_TypeError,
4048
"raise: exception class must be a subclass of BaseException");
4049
goto bad;
4050
}
4051
if (cause) {
4052
PyObject *fixed_cause;
4053
if (cause == Py_None) {
4054
fixed_cause = NULL;
4055
} else if (PyExceptionClass_Check(cause)) {
4056
fixed_cause = PyObject_CallObject(cause, NULL);
4057
if (fixed_cause == NULL)
4058
goto bad;
4059
} else if (PyExceptionInstance_Check(cause)) {
4060
fixed_cause = cause;
4061
Py_INCREF(fixed_cause);
4062
} else {
4063
PyErr_SetString(PyExc_TypeError,
4064
"exception causes must derive from "
4065
"BaseException");
4066
goto bad;
4067
}
4068
PyException_SetCause(value, fixed_cause);
4069
}
4070
PyErr_SetObject(type, value);
4071
if (tb) {
4072
#if CYTHON_COMPILING_IN_PYPY
4073
PyObject *tmp_type, *tmp_value, *tmp_tb;
4074
PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
4075
Py_INCREF(tb);
4076
PyErr_Restore(tmp_type, tmp_value, tb);
4077
Py_XDECREF(tmp_tb);
4078
#else
4079
PyThreadState *tstate = __Pyx_PyThreadState_Current;
4080
PyObject* tmp_tb = tstate->curexc_traceback;
4081
if (tb != tmp_tb) {
4082
Py_INCREF(tb);
4083
tstate->curexc_traceback = tb;
4084
Py_XDECREF(tmp_tb);
4085
}
4086
#endif
4087
}
4088
bad:
4089
Py_XDECREF(owned_instance);
4090
return;
4091
}
4092
#endif
4093
4094
/* GetAttr */
4095
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
4096
#if CYTHON_USE_TYPE_SLOTS
4097
#if PY_MAJOR_VERSION >= 3
4098
if (likely(PyUnicode_Check(n)))
4099
#else
4100
if (likely(PyString_Check(n)))
4101
#endif
4102
return __Pyx_PyObject_GetAttrStr(o, n);
4103
#endif
4104
return PyObject_GetAttr(o, n);
4105
}
4106
4107
/* GetAttr3 */
4108
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
4109
__Pyx_PyThreadState_declare
4110
__Pyx_PyThreadState_assign
4111
if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
4112
return NULL;
4113
__Pyx_PyErr_Clear();
4114
Py_INCREF(d);
4115
return d;
4116
}
4117
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
4118
PyObject *r = __Pyx_GetAttr(o, n);
4119
return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
4120
}
4121
4122
/* PyDictVersioning */
4123
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
4124
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
4125
PyObject *dict = Py_TYPE(obj)->tp_dict;
4126
return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
4127
}
4128
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
4129
PyObject **dictptr = NULL;
4130
Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
4131
if (offset) {
4132
#if CYTHON_COMPILING_IN_CPYTHON
4133
dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
4134
#else
4135
dictptr = _PyObject_GetDictPtr(obj);
4136
#endif
4137
}
4138
return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
4139
}
4140
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
4141
PyObject *dict = Py_TYPE(obj)->tp_dict;
4142
if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
4143
return 0;
4144
return obj_dict_version == __Pyx_get_object_dict_version(obj);
4145
}
4146
#endif
4147
4148
/* GetModuleGlobalName */
4149
#if CYTHON_USE_DICT_VERSIONS
4150
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
4151
#else
4152
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
4153
#endif
4154
{
4155
PyObject *result;
4156
#if !CYTHON_AVOID_BORROWED_REFS
4157
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
4158
result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
4159
__PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
4160
if (likely(result)) {
4161
return __Pyx_NewRef(result);
4162
} else if (unlikely(PyErr_Occurred())) {
4163
return NULL;
4164
}
4165
#else
4166
result = PyDict_GetItem(__pyx_d, name);
4167
__PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
4168
if (likely(result)) {
4169
return __Pyx_NewRef(result);
4170
}
4171
#endif
4172
#else
4173
result = PyObject_GetItem(__pyx_d, name);
4174
__PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
4175
if (likely(result)) {
4176
return __Pyx_NewRef(result);
4177
}
4178
PyErr_Clear();
4179
#endif
4180
return __Pyx_GetBuiltinName(name);
4181
}
4182
4183
/* Import */
4184
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
4185
PyObject *empty_list = 0;
4186
PyObject *module = 0;
4187
PyObject *global_dict = 0;
4188
PyObject *empty_dict = 0;
4189
PyObject *list;
4190
#if PY_MAJOR_VERSION < 3
4191
PyObject *py_import;
4192
py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
4193
if (!py_import)
4194
goto bad;
4195
#endif
4196
if (from_list)
4197
list = from_list;
4198
else {
4199
empty_list = PyList_New(0);
4200
if (!empty_list)
4201
goto bad;
4202
list = empty_list;
4203
}
4204
global_dict = PyModule_GetDict(__pyx_m);
4205
if (!global_dict)
4206
goto bad;
4207
empty_dict = PyDict_New();
4208
if (!empty_dict)
4209
goto bad;
4210
{
4211
#if PY_MAJOR_VERSION >= 3
4212
if (level == -1) {
4213
if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
4214
module = PyImport_ImportModuleLevelObject(
4215
name, global_dict, empty_dict, list, 1);
4216
if (!module) {
4217
if (!PyErr_ExceptionMatches(PyExc_ImportError))
4218
goto bad;
4219
PyErr_Clear();
4220
}
4221
}
4222
level = 0;
4223
}
4224
#endif
4225
if (!module) {
4226
#if PY_MAJOR_VERSION < 3
4227
PyObject *py_level = PyInt_FromLong(level);
4228
if (!py_level)
4229
goto bad;
4230
module = PyObject_CallFunctionObjArgs(py_import,
4231
name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
4232
Py_DECREF(py_level);
4233
#else
4234
module = PyImport_ImportModuleLevelObject(
4235
name, global_dict, empty_dict, list, level);
4236
#endif
4237
}
4238
}
4239
bad:
4240
#if PY_MAJOR_VERSION < 3
4241
Py_XDECREF(py_import);
4242
#endif
4243
Py_XDECREF(empty_list);
4244
Py_XDECREF(empty_dict);
4245
return module;
4246
}
4247
4248
/* ImportFrom */
4249
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
4250
PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
4251
if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
4252
PyErr_Format(PyExc_ImportError,
4253
#if PY_MAJOR_VERSION < 3
4254
"cannot import name %.230s", PyString_AS_STRING(name));
4255
#else
4256
"cannot import name %S", name);
4257
#endif
4258
}
4259
return value;
4260
}
4261
4262
/* HasAttr */
4263
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
4264
PyObject *r;
4265
if (unlikely(!__Pyx_PyBaseString_Check(n))) {
4266
PyErr_SetString(PyExc_TypeError,
4267
"hasattr(): attribute name must be string");
4268
return -1;
4269
}
4270
r = __Pyx_GetAttr(o, n);
4271
if (unlikely(!r)) {
4272
PyErr_Clear();
4273
return 0;
4274
} else {
4275
Py_DECREF(r);
4276
return 1;
4277
}
4278
}
4279
4280
/* PyObject_GenericGetAttrNoDict */
4281
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
4282
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
4283
PyErr_Format(PyExc_AttributeError,
4284
#if PY_MAJOR_VERSION >= 3
4285
"'%.50s' object has no attribute '%U'",
4286
tp->tp_name, attr_name);
4287
#else
4288
"'%.50s' object has no attribute '%.400s'",
4289
tp->tp_name, PyString_AS_STRING(attr_name));
4290
#endif
4291
return NULL;
4292
}
4293
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
4294
PyObject *descr;
4295
PyTypeObject *tp = Py_TYPE(obj);
4296
if (unlikely(!PyString_Check(attr_name))) {
4297
return PyObject_GenericGetAttr(obj, attr_name);
4298
}
4299
assert(!tp->tp_dictoffset);
4300
descr = _PyType_Lookup(tp, attr_name);
4301
if (unlikely(!descr)) {
4302
return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
4303
}
4304
Py_INCREF(descr);
4305
#if PY_MAJOR_VERSION < 3
4306
if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
4307
#endif
4308
{
4309
descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
4310
if (unlikely(f)) {
4311
PyObject *res = f(descr, obj, (PyObject *)tp);
4312
Py_DECREF(descr);
4313
return res;
4314
}
4315
}
4316
return descr;
4317
}
4318
#endif
4319
4320
/* PyObject_GenericGetAttr */
4321
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
4322
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
4323
if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
4324
return PyObject_GenericGetAttr(obj, attr_name);
4325
}
4326
return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
4327
}
4328
#endif
4329
4330
/* PyObjectGetAttrStrNoError */
4331
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
4332
__Pyx_PyThreadState_declare
4333
__Pyx_PyThreadState_assign
4334
if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
4335
__Pyx_PyErr_Clear();
4336
}
4337
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
4338
PyObject *result;
4339
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
4340
PyTypeObject* tp = Py_TYPE(obj);
4341
if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
4342
return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
4343
}
4344
#endif
4345
result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
4346
if (unlikely(!result)) {
4347
__Pyx_PyObject_GetAttrStr_ClearAttributeError();
4348
}
4349
return result;
4350
}
4351
4352
/* SetupReduce */
4353
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
4354
int ret;
4355
PyObject *name_attr;
4356
name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
4357
if (likely(name_attr)) {
4358
ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
4359
} else {
4360
ret = -1;
4361
}
4362
if (unlikely(ret < 0)) {
4363
PyErr_Clear();
4364
ret = 0;
4365
}
4366
Py_XDECREF(name_attr);
4367
return ret;
4368
}
4369
static int __Pyx_setup_reduce(PyObject* type_obj) {
4370
int ret = 0;
4371
PyObject *object_reduce = NULL;
4372
PyObject *object_reduce_ex = NULL;
4373
PyObject *reduce = NULL;
4374
PyObject *reduce_ex = NULL;
4375
PyObject *reduce_cython = NULL;
4376
PyObject *setstate = NULL;
4377
PyObject *setstate_cython = NULL;
4378
#if CYTHON_USE_PYTYPE_LOOKUP
4379
if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
4380
#else
4381
if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
4382
#endif
4383
#if CYTHON_USE_PYTYPE_LOOKUP
4384
object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
4385
#else
4386
object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
4387
#endif
4388
reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
4389
if (reduce_ex == object_reduce_ex) {
4390
#if CYTHON_USE_PYTYPE_LOOKUP
4391
object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
4392
#else
4393
object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
4394
#endif
4395
reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
4396
if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
4397
reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
4398
if (likely(reduce_cython)) {
4399
ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
4400
ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
4401
} else if (reduce == object_reduce || PyErr_Occurred()) {
4402
goto __PYX_BAD;
4403
}
4404
setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
4405
if (!setstate) PyErr_Clear();
4406
if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
4407
setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
4408
if (likely(setstate_cython)) {
4409
ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
4410
ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
4411
} else if (!setstate || PyErr_Occurred()) {
4412
goto __PYX_BAD;
4413
}
4414
}
4415
PyType_Modified((PyTypeObject*)type_obj);
4416
}
4417
}
4418
goto __PYX_GOOD;
4419
__PYX_BAD:
4420
if (!PyErr_Occurred())
4421
PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
4422
ret = -1;
4423
__PYX_GOOD:
4424
#if !CYTHON_USE_PYTYPE_LOOKUP
4425
Py_XDECREF(object_reduce);
4426
Py_XDECREF(object_reduce_ex);
4427
#endif
4428
Py_XDECREF(reduce);
4429
Py_XDECREF(reduce_ex);
4430
Py_XDECREF(reduce_cython);
4431
Py_XDECREF(setstate);
4432
Py_XDECREF(setstate_cython);
4433
return ret;
4434
}
4435
4436
/* CLineInTraceback */
4437
#ifndef CYTHON_CLINE_IN_TRACEBACK
4438
static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
4439
PyObject *use_cline;
4440
PyObject *ptype, *pvalue, *ptraceback;
4441
#if CYTHON_COMPILING_IN_CPYTHON
4442
PyObject **cython_runtime_dict;
4443
#endif
4444
if (unlikely(!__pyx_cython_runtime)) {
4445
return c_line;
4446
}
4447
__Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
4448
#if CYTHON_COMPILING_IN_CPYTHON
4449
cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
4450
if (likely(cython_runtime_dict)) {
4451
__PYX_PY_DICT_LOOKUP_IF_MODIFIED(
4452
use_cline, *cython_runtime_dict,
4453
__Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
4454
} else
4455
#endif
4456
{
4457
PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
4458
if (use_cline_obj) {
4459
use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
4460
Py_DECREF(use_cline_obj);
4461
} else {
4462
PyErr_Clear();
4463
use_cline = NULL;
4464
}
4465
}
4466
if (!use_cline) {
4467
c_line = 0;
4468
PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
4469
}
4470
else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
4471
c_line = 0;
4472
}
4473
__Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
4474
return c_line;
4475
}
4476
#endif
4477
4478
/* CodeObjectCache */
4479
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
4480
int start = 0, mid = 0, end = count - 1;
4481
if (end >= 0 && code_line > entries[end].code_line) {
4482
return count;
4483
}
4484
while (start < end) {
4485
mid = start + (end - start) / 2;
4486
if (code_line < entries[mid].code_line) {
4487
end = mid;
4488
} else if (code_line > entries[mid].code_line) {
4489
start = mid + 1;
4490
} else {
4491
return mid;
4492
}
4493
}
4494
if (code_line <= entries[mid].code_line) {
4495
return mid;
4496
} else {
4497
return mid + 1;
4498
}
4499
}
4500
static PyCodeObject *__pyx_find_code_object(int code_line) {
4501
PyCodeObject* code_object;
4502
int pos;
4503
if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
4504
return NULL;
4505
}
4506
pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
4507
if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
4508
return NULL;
4509
}
4510
code_object = __pyx_code_cache.entries[pos].code_object;
4511
Py_INCREF(code_object);
4512
return code_object;
4513
}
4514
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
4515
int pos, i;
4516
__Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
4517
if (unlikely(!code_line)) {
4518
return;
4519
}
4520
if (unlikely(!entries)) {
4521
entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
4522
if (likely(entries)) {
4523
__pyx_code_cache.entries = entries;
4524
__pyx_code_cache.max_count = 64;
4525
__pyx_code_cache.count = 1;
4526
entries[0].code_line = code_line;
4527
entries[0].code_object = code_object;
4528
Py_INCREF(code_object);
4529
}
4530
return;
4531
}
4532
pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
4533
if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
4534
PyCodeObject* tmp = entries[pos].code_object;
4535
entries[pos].code_object = code_object;
4536
Py_DECREF(tmp);
4537
return;
4538
}
4539
if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
4540
int new_max = __pyx_code_cache.max_count + 64;
4541
entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
4542
__pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
4543
if (unlikely(!entries)) {
4544
return;
4545
}
4546
__pyx_code_cache.entries = entries;
4547
__pyx_code_cache.max_count = new_max;
4548
}
4549
for (i=__pyx_code_cache.count; i>pos; i--) {
4550
entries[i] = entries[i-1];
4551
}
4552
entries[pos].code_line = code_line;
4553
entries[pos].code_object = code_object;
4554
__pyx_code_cache.count++;
4555
Py_INCREF(code_object);
4556
}
4557
4558
/* AddTraceback */
4559
#include "compile.h"
4560
#include "frameobject.h"
4561
#include "traceback.h"
4562
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
4563
const char *funcname, int c_line,
4564
int py_line, const char *filename) {
4565
PyCodeObject *py_code = 0;
4566
PyObject *py_srcfile = 0;
4567
PyObject *py_funcname = 0;
4568
#if PY_MAJOR_VERSION < 3
4569
py_srcfile = PyString_FromString(filename);
4570
#else
4571
py_srcfile = PyUnicode_FromString(filename);
4572
#endif
4573
if (!py_srcfile) goto bad;
4574
if (c_line) {
4575
#if PY_MAJOR_VERSION < 3
4576
py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
4577
#else
4578
py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
4579
#endif
4580
}
4581
else {
4582
#if PY_MAJOR_VERSION < 3
4583
py_funcname = PyString_FromString(funcname);
4584
#else
4585
py_funcname = PyUnicode_FromString(funcname);
4586
#endif
4587
}
4588
if (!py_funcname) goto bad;
4589
py_code = __Pyx_PyCode_New(
4590
0,
4591
0,
4592
0,
4593
0,
4594
0,
4595
__pyx_empty_bytes, /*PyObject *code,*/
4596
__pyx_empty_tuple, /*PyObject *consts,*/
4597
__pyx_empty_tuple, /*PyObject *names,*/
4598
__pyx_empty_tuple, /*PyObject *varnames,*/
4599
__pyx_empty_tuple, /*PyObject *freevars,*/
4600
__pyx_empty_tuple, /*PyObject *cellvars,*/
4601
py_srcfile, /*PyObject *filename,*/
4602
py_funcname, /*PyObject *name,*/
4603
py_line,
4604
__pyx_empty_bytes /*PyObject *lnotab*/
4605
);
4606
Py_DECREF(py_srcfile);
4607
Py_DECREF(py_funcname);
4608
return py_code;
4609
bad:
4610
Py_XDECREF(py_srcfile);
4611
Py_XDECREF(py_funcname);
4612
return NULL;
4613
}
4614
static void __Pyx_AddTraceback(const char *funcname, int c_line,
4615
int py_line, const char *filename) {
4616
PyCodeObject *py_code = 0;
4617
PyFrameObject *py_frame = 0;
4618
PyThreadState *tstate = __Pyx_PyThreadState_Current;
4619
if (c_line) {
4620
c_line = __Pyx_CLineForTraceback(tstate, c_line);
4621
}
4622
py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
4623
if (!py_code) {
4624
py_code = __Pyx_CreateCodeObjectForTraceback(
4625
funcname, c_line, py_line, filename);
4626
if (!py_code) goto bad;
4627
__pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
4628
}
4629
py_frame = PyFrame_New(
4630
tstate, /*PyThreadState *tstate,*/
4631
py_code, /*PyCodeObject *code,*/
4632
__pyx_d, /*PyObject *globals,*/
4633
0 /*PyObject *locals*/
4634
);
4635
if (!py_frame) goto bad;
4636
__Pyx_PyFrame_SetLineNumber(py_frame, py_line);
4637
PyTraceBack_Here(py_frame);
4638
bad:
4639
Py_XDECREF(py_code);
4640
Py_XDECREF(py_frame);
4641
}
4642
4643
/* CIntFromPyVerify */
4644
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
4645
__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
4646
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
4647
__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
4648
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
4649
{\
4650
func_type value = func_value;\
4651
if (sizeof(target_type) < sizeof(func_type)) {\
4652
if (unlikely(value != (func_type) (target_type) value)) {\
4653
func_type zero = 0;\
4654
if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
4655
return (target_type) -1;\
4656
if (is_unsigned && unlikely(value < zero))\
4657
goto raise_neg_overflow;\
4658
else\
4659
goto raise_overflow;\
4660
}\
4661
}\
4662
return (target_type) value;\
4663
}
4664
4665
/* CIntFromPy */
4666
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
4667
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
4668
#pragma GCC diagnostic push
4669
#pragma GCC diagnostic ignored "-Wconversion"
4670
#endif
4671
const long neg_one = (long) -1, const_zero = (long) 0;
4672
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
4673
#pragma GCC diagnostic pop
4674
#endif
4675
const int is_unsigned = neg_one > const_zero;
4676
#if PY_MAJOR_VERSION < 3
4677
if (likely(PyInt_Check(x))) {
4678
if (sizeof(long) < sizeof(long)) {
4679
__PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
4680
} else {
4681
long val = PyInt_AS_LONG(x);
4682
if (is_unsigned && unlikely(val < 0)) {
4683
goto raise_neg_overflow;
4684
}
4685
return (long) val;
4686
}
4687
} else
4688
#endif
4689
if (likely(PyLong_Check(x))) {
4690
if (is_unsigned) {
4691
#if CYTHON_USE_PYLONG_INTERNALS
4692
const digit* digits = ((PyLongObject*)x)->ob_digit;
4693
switch (Py_SIZE(x)) {
4694
case 0: return (long) 0;
4695
case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
4696
case 2:
4697
if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
4698
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
4699
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
4700
} else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
4701
return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
4702
}
4703
}
4704
break;
4705
case 3:
4706
if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
4707
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
4708
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
4709
} else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
4710
return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
4711
}
4712
}
4713
break;
4714
case 4:
4715
if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
4716
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
4717
__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])))
4718
} else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
4719
return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
4720
}
4721
}
4722
break;
4723
}
4724
#endif
4725
#if CYTHON_COMPILING_IN_CPYTHON
4726
if (unlikely(Py_SIZE(x) < 0)) {
4727
goto raise_neg_overflow;
4728
}
4729
#else
4730
{
4731
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
4732
if (unlikely(result < 0))
4733
return (long) -1;
4734
if (unlikely(result == 1))
4735
goto raise_neg_overflow;
4736
}
4737
#endif
4738
if (sizeof(long) <= sizeof(unsigned long)) {
4739
__PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
4740
#ifdef HAVE_LONG_LONG
4741
} else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
4742
__PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
4743
#endif
4744
}
4745
} else {
4746
#if CYTHON_USE_PYLONG_INTERNALS
4747
const digit* digits = ((PyLongObject*)x)->ob_digit;
4748
switch (Py_SIZE(x)) {
4749
case 0: return (long) 0;
4750
case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
4751
case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
4752
case -2:
4753
if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
4754
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
4755
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
4756
} else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
4757
return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
4758
}
4759
}
4760
break;
4761
case 2:
4762
if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
4763
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
4764
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
4765
} else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
4766
return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
4767
}
4768
}
4769
break;
4770
case -3:
4771
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
4772
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
4773
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
4774
} else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
4775
return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
4776
}
4777
}
4778
break;
4779
case 3:
4780
if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
4781
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
4782
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
4783
} else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
4784
return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
4785
}
4786
}
4787
break;
4788
case -4:
4789
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
4790
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
4791
__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])))
4792
} else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
4793
return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
4794
}
4795
}
4796
break;
4797
case 4:
4798
if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
4799
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
4800
__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])))
4801
} else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
4802
return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
4803
}
4804
}
4805
break;
4806
}
4807
#endif
4808
if (sizeof(long) <= sizeof(long)) {
4809
__PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
4810
#ifdef HAVE_LONG_LONG
4811
} else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
4812
__PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
4813
#endif
4814
}
4815
}
4816
{
4817
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
4818
PyErr_SetString(PyExc_RuntimeError,
4819
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
4820
#else
4821
long val;
4822
PyObject *v = __Pyx_PyNumber_IntOrLong(x);
4823
#if PY_MAJOR_VERSION < 3
4824
if (likely(v) && !PyLong_Check(v)) {
4825
PyObject *tmp = v;
4826
v = PyNumber_Long(tmp);
4827
Py_DECREF(tmp);
4828
}
4829
#endif
4830
if (likely(v)) {
4831
int one = 1; int is_little = (int)*(unsigned char *)&one;
4832
unsigned char *bytes = (unsigned char *)&val;
4833
int ret = _PyLong_AsByteArray((PyLongObject *)v,
4834
bytes, sizeof(val),
4835
is_little, !is_unsigned);
4836
Py_DECREF(v);
4837
if (likely(!ret))
4838
return val;
4839
}
4840
#endif
4841
return (long) -1;
4842
}
4843
} else {
4844
long val;
4845
PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
4846
if (!tmp) return (long) -1;
4847
val = __Pyx_PyInt_As_long(tmp);
4848
Py_DECREF(tmp);
4849
return val;
4850
}
4851
raise_overflow:
4852
PyErr_SetString(PyExc_OverflowError,
4853
"value too large to convert to long");
4854
return (long) -1;
4855
raise_neg_overflow:
4856
PyErr_SetString(PyExc_OverflowError,
4857
"can't convert negative value to long");
4858
return (long) -1;
4859
}
4860
4861
/* CIntToPy */
4862
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
4863
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
4864
#pragma GCC diagnostic push
4865
#pragma GCC diagnostic ignored "-Wconversion"
4866
#endif
4867
const long neg_one = (long) -1, const_zero = (long) 0;
4868
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
4869
#pragma GCC diagnostic pop
4870
#endif
4871
const int is_unsigned = neg_one > const_zero;
4872
if (is_unsigned) {
4873
if (sizeof(long) < sizeof(long)) {
4874
return PyInt_FromLong((long) value);
4875
} else if (sizeof(long) <= sizeof(unsigned long)) {
4876
return PyLong_FromUnsignedLong((unsigned long) value);
4877
#ifdef HAVE_LONG_LONG
4878
} else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
4879
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
4880
#endif
4881
}
4882
} else {
4883
if (sizeof(long) <= sizeof(long)) {
4884
return PyInt_FromLong((long) value);
4885
#ifdef HAVE_LONG_LONG
4886
} else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
4887
return PyLong_FromLongLong((PY_LONG_LONG) value);
4888
#endif
4889
}
4890
}
4891
{
4892
int one = 1; int little = (int)*(unsigned char *)&one;
4893
unsigned char *bytes = (unsigned char *)&value;
4894
return _PyLong_FromByteArray(bytes, sizeof(long),
4895
little, !is_unsigned);
4896
}
4897
}
4898
4899
/* CIntFromPy */
4900
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
4901
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
4902
#pragma GCC diagnostic push
4903
#pragma GCC diagnostic ignored "-Wconversion"
4904
#endif
4905
const int neg_one = (int) -1, const_zero = (int) 0;
4906
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
4907
#pragma GCC diagnostic pop
4908
#endif
4909
const int is_unsigned = neg_one > const_zero;
4910
#if PY_MAJOR_VERSION < 3
4911
if (likely(PyInt_Check(x))) {
4912
if (sizeof(int) < sizeof(long)) {
4913
__PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
4914
} else {
4915
long val = PyInt_AS_LONG(x);
4916
if (is_unsigned && unlikely(val < 0)) {
4917
goto raise_neg_overflow;
4918
}
4919
return (int) val;
4920
}
4921
} else
4922
#endif
4923
if (likely(PyLong_Check(x))) {
4924
if (is_unsigned) {
4925
#if CYTHON_USE_PYLONG_INTERNALS
4926
const digit* digits = ((PyLongObject*)x)->ob_digit;
4927
switch (Py_SIZE(x)) {
4928
case 0: return (int) 0;
4929
case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
4930
case 2:
4931
if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
4932
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
4933
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
4934
} else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
4935
return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
4936
}
4937
}
4938
break;
4939
case 3:
4940
if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
4941
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
4942
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
4943
} else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
4944
return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
4945
}
4946
}
4947
break;
4948
case 4:
4949
if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
4950
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
4951
__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])))
4952
} else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
4953
return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
4954
}
4955
}
4956
break;
4957
}
4958
#endif
4959
#if CYTHON_COMPILING_IN_CPYTHON
4960
if (unlikely(Py_SIZE(x) < 0)) {
4961
goto raise_neg_overflow;
4962
}
4963
#else
4964
{
4965
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
4966
if (unlikely(result < 0))
4967
return (int) -1;
4968
if (unlikely(result == 1))
4969
goto raise_neg_overflow;
4970
}
4971
#endif
4972
if (sizeof(int) <= sizeof(unsigned long)) {
4973
__PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
4974
#ifdef HAVE_LONG_LONG
4975
} else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
4976
__PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
4977
#endif
4978
}
4979
} else {
4980
#if CYTHON_USE_PYLONG_INTERNALS
4981
const digit* digits = ((PyLongObject*)x)->ob_digit;
4982
switch (Py_SIZE(x)) {
4983
case 0: return (int) 0;
4984
case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
4985
case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
4986
case -2:
4987
if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
4988
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
4989
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
4990
} else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
4991
return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
4992
}
4993
}
4994
break;
4995
case 2:
4996
if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
4997
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
4998
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
4999
} else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
5000
return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5001
}
5002
}
5003
break;
5004
case -3:
5005
if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
5006
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5007
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5008
} else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
5009
return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5010
}
5011
}
5012
break;
5013
case 3:
5014
if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
5015
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5016
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5017
} else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
5018
return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5019
}
5020
}
5021
break;
5022
case -4:
5023
if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
5024
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5025
__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])))
5026
} else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
5027
return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5028
}
5029
}
5030
break;
5031
case 4:
5032
if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
5033
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5034
__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])))
5035
} else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
5036
return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5037
}
5038
}
5039
break;
5040
}
5041
#endif
5042
if (sizeof(int) <= sizeof(long)) {
5043
__PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
5044
#ifdef HAVE_LONG_LONG
5045
} else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
5046
__PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
5047
#endif
5048
}
5049
}
5050
{
5051
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
5052
PyErr_SetString(PyExc_RuntimeError,
5053
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
5054
#else
5055
int val;
5056
PyObject *v = __Pyx_PyNumber_IntOrLong(x);
5057
#if PY_MAJOR_VERSION < 3
5058
if (likely(v) && !PyLong_Check(v)) {
5059
PyObject *tmp = v;
5060
v = PyNumber_Long(tmp);
5061
Py_DECREF(tmp);
5062
}
5063
#endif
5064
if (likely(v)) {
5065
int one = 1; int is_little = (int)*(unsigned char *)&one;
5066
unsigned char *bytes = (unsigned char *)&val;
5067
int ret = _PyLong_AsByteArray((PyLongObject *)v,
5068
bytes, sizeof(val),
5069
is_little, !is_unsigned);
5070
Py_DECREF(v);
5071
if (likely(!ret))
5072
return val;
5073
}
5074
#endif
5075
return (int) -1;
5076
}
5077
} else {
5078
int val;
5079
PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
5080
if (!tmp) return (int) -1;
5081
val = __Pyx_PyInt_As_int(tmp);
5082
Py_DECREF(tmp);
5083
return val;
5084
}
5085
raise_overflow:
5086
PyErr_SetString(PyExc_OverflowError,
5087
"value too large to convert to int");
5088
return (int) -1;
5089
raise_neg_overflow:
5090
PyErr_SetString(PyExc_OverflowError,
5091
"can't convert negative value to int");
5092
return (int) -1;
5093
}
5094
5095
/* FastTypeChecks */
5096
#if CYTHON_COMPILING_IN_CPYTHON
5097
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
5098
while (a) {
5099
a = a->tp_base;
5100
if (a == b)
5101
return 1;
5102
}
5103
return b == &PyBaseObject_Type;
5104
}
5105
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
5106
PyObject *mro;
5107
if (a == b) return 1;
5108
mro = a->tp_mro;
5109
if (likely(mro)) {
5110
Py_ssize_t i, n;
5111
n = PyTuple_GET_SIZE(mro);
5112
for (i = 0; i < n; i++) {
5113
if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
5114
return 1;
5115
}
5116
return 0;
5117
}
5118
return __Pyx_InBases(a, b);
5119
}
5120
#if PY_MAJOR_VERSION == 2
5121
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
5122
PyObject *exception, *value, *tb;
5123
int res;
5124
__Pyx_PyThreadState_declare
5125
__Pyx_PyThreadState_assign
5126
__Pyx_ErrFetch(&exception, &value, &tb);
5127
res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
5128
if (unlikely(res == -1)) {
5129
PyErr_WriteUnraisable(err);
5130
res = 0;
5131
}
5132
if (!res) {
5133
res = PyObject_IsSubclass(err, exc_type2);
5134
if (unlikely(res == -1)) {
5135
PyErr_WriteUnraisable(err);
5136
res = 0;
5137
}
5138
}
5139
__Pyx_ErrRestore(exception, value, tb);
5140
return res;
5141
}
5142
#else
5143
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
5144
int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
5145
if (!res) {
5146
res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
5147
}
5148
return res;
5149
}
5150
#endif
5151
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
5152
Py_ssize_t i, n;
5153
assert(PyExceptionClass_Check(exc_type));
5154
n = PyTuple_GET_SIZE(tuple);
5155
#if PY_MAJOR_VERSION >= 3
5156
for (i=0; i<n; i++) {
5157
if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
5158
}
5159
#endif
5160
for (i=0; i<n; i++) {
5161
PyObject *t = PyTuple_GET_ITEM(tuple, i);
5162
#if PY_MAJOR_VERSION < 3
5163
if (likely(exc_type == t)) return 1;
5164
#endif
5165
if (likely(PyExceptionClass_Check(t))) {
5166
if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
5167
} else {
5168
}
5169
}
5170
return 0;
5171
}
5172
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
5173
if (likely(err == exc_type)) return 1;
5174
if (likely(PyExceptionClass_Check(err))) {
5175
if (likely(PyExceptionClass_Check(exc_type))) {
5176
return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
5177
} else if (likely(PyTuple_Check(exc_type))) {
5178
return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
5179
} else {
5180
}
5181
}
5182
return PyErr_GivenExceptionMatches(err, exc_type);
5183
}
5184
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
5185
assert(PyExceptionClass_Check(exc_type1));
5186
assert(PyExceptionClass_Check(exc_type2));
5187
if (likely(err == exc_type1 || err == exc_type2)) return 1;
5188
if (likely(PyExceptionClass_Check(err))) {
5189
return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
5190
}
5191
return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
5192
}
5193
#endif
5194
5195
/* CheckBinaryVersion */
5196
static int __Pyx_check_binary_version(void) {
5197
char ctversion[4], rtversion[4];
5198
PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
5199
PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
5200
if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
5201
char message[200];
5202
PyOS_snprintf(message, sizeof(message),
5203
"compiletime version %s of module '%.100s' "
5204
"does not match runtime version %s",
5205
ctversion, __Pyx_MODULE_NAME, rtversion);
5206
return PyErr_WarnEx(NULL, message, 1);
5207
}
5208
return 0;
5209
}
5210
5211
/* InitStrings */
5212
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
5213
while (t->p) {
5214
#if PY_MAJOR_VERSION < 3
5215
if (t->is_unicode) {
5216
*t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
5217
} else if (t->intern) {
5218
*t->p = PyString_InternFromString(t->s);
5219
} else {
5220
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
5221
}
5222
#else
5223
if (t->is_unicode | t->is_str) {
5224
if (t->intern) {
5225
*t->p = PyUnicode_InternFromString(t->s);
5226
} else if (t->encoding) {
5227
*t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
5228
} else {
5229
*t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
5230
}
5231
} else {
5232
*t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
5233
}
5234
#endif
5235
if (!*t->p)
5236
return -1;
5237
if (PyObject_Hash(*t->p) == -1)
5238
return -1;
5239
++t;
5240
}
5241
return 0;
5242
}
5243
5244
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
5245
return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
5246
}
5247
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
5248
Py_ssize_t ignore;
5249
return __Pyx_PyObject_AsStringAndSize(o, &ignore);
5250
}
5251
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
5252
#if !CYTHON_PEP393_ENABLED
5253
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5254
char* defenc_c;
5255
PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
5256
if (!defenc) return NULL;
5257
defenc_c = PyBytes_AS_STRING(defenc);
5258
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5259
{
5260
char* end = defenc_c + PyBytes_GET_SIZE(defenc);
5261
char* c;
5262
for (c = defenc_c; c < end; c++) {
5263
if ((unsigned char) (*c) >= 128) {
5264
PyUnicode_AsASCIIString(o);
5265
return NULL;
5266
}
5267
}
5268
}
5269
#endif
5270
*length = PyBytes_GET_SIZE(defenc);
5271
return defenc_c;
5272
}
5273
#else
5274
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5275
if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
5276
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5277
if (likely(PyUnicode_IS_ASCII(o))) {
5278
*length = PyUnicode_GET_LENGTH(o);
5279
return PyUnicode_AsUTF8(o);
5280
} else {
5281
PyUnicode_AsASCIIString(o);
5282
return NULL;
5283
}
5284
#else
5285
return PyUnicode_AsUTF8AndSize(o, length);
5286
#endif
5287
}
5288
#endif
5289
#endif
5290
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5291
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
5292
if (
5293
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5294
__Pyx_sys_getdefaultencoding_not_ascii &&
5295
#endif
5296
PyUnicode_Check(o)) {
5297
return __Pyx_PyUnicode_AsStringAndSize(o, length);
5298
} else
5299
#endif
5300
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
5301
if (PyByteArray_Check(o)) {
5302
*length = PyByteArray_GET_SIZE(o);
5303
return PyByteArray_AS_STRING(o);
5304
} else
5305
#endif
5306
{
5307
char* result;
5308
int r = PyBytes_AsStringAndSize(o, &result, length);
5309
if (unlikely(r < 0)) {
5310
return NULL;
5311
} else {
5312
return result;
5313
}
5314
}
5315
}
5316
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
5317
int is_true = x == Py_True;
5318
if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
5319
else return PyObject_IsTrue(x);
5320
}
5321
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
5322
int retval;
5323
if (unlikely(!x)) return -1;
5324
retval = __Pyx_PyObject_IsTrue(x);
5325
Py_DECREF(x);
5326
return retval;
5327
}
5328
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
5329
#if PY_MAJOR_VERSION >= 3
5330
if (PyLong_Check(result)) {
5331
if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
5332
"__int__ returned non-int (type %.200s). "
5333
"The ability to return an instance of a strict subclass of int "
5334
"is deprecated, and may be removed in a future version of Python.",
5335
Py_TYPE(result)->tp_name)) {
5336
Py_DECREF(result);
5337
return NULL;
5338
}
5339
return result;
5340
}
5341
#endif
5342
PyErr_Format(PyExc_TypeError,
5343
"__%.4s__ returned non-%.4s (type %.200s)",
5344
type_name, type_name, Py_TYPE(result)->tp_name);
5345
Py_DECREF(result);
5346
return NULL;
5347
}
5348
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
5349
#if CYTHON_USE_TYPE_SLOTS
5350
PyNumberMethods *m;
5351
#endif
5352
const char *name = NULL;
5353
PyObject *res = NULL;
5354
#if PY_MAJOR_VERSION < 3
5355
if (likely(PyInt_Check(x) || PyLong_Check(x)))
5356
#else
5357
if (likely(PyLong_Check(x)))
5358
#endif
5359
return __Pyx_NewRef(x);
5360
#if CYTHON_USE_TYPE_SLOTS
5361
m = Py_TYPE(x)->tp_as_number;
5362
#if PY_MAJOR_VERSION < 3
5363
if (m && m->nb_int) {
5364
name = "int";
5365
res = m->nb_int(x);
5366
}
5367
else if (m && m->nb_long) {
5368
name = "long";
5369
res = m->nb_long(x);
5370
}
5371
#else
5372
if (likely(m && m->nb_int)) {
5373
name = "int";
5374
res = m->nb_int(x);
5375
}
5376
#endif
5377
#else
5378
if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
5379
res = PyNumber_Int(x);
5380
}
5381
#endif
5382
if (likely(res)) {
5383
#if PY_MAJOR_VERSION < 3
5384
if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
5385
#else
5386
if (unlikely(!PyLong_CheckExact(res))) {
5387
#endif
5388
return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
5389
}
5390
}
5391
else if (!PyErr_Occurred()) {
5392
PyErr_SetString(PyExc_TypeError,
5393
"an integer is required");
5394
}
5395
return res;
5396
}
5397
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
5398
Py_ssize_t ival;
5399
PyObject *x;
5400
#if PY_MAJOR_VERSION < 3
5401
if (likely(PyInt_CheckExact(b))) {
5402
if (sizeof(Py_ssize_t) >= sizeof(long))
5403
return PyInt_AS_LONG(b);
5404
else
5405
return PyInt_AsSsize_t(b);
5406
}
5407
#endif
5408
if (likely(PyLong_CheckExact(b))) {
5409
#if CYTHON_USE_PYLONG_INTERNALS
5410
const digit* digits = ((PyLongObject*)b)->ob_digit;
5411
const Py_ssize_t size = Py_SIZE(b);
5412
if (likely(__Pyx_sst_abs(size) <= 1)) {
5413
ival = likely(size) ? digits[0] : 0;
5414
if (size == -1) ival = -ival;
5415
return ival;
5416
} else {
5417
switch (size) {
5418
case 2:
5419
if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
5420
return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
5421
}
5422
break;
5423
case -2:
5424
if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
5425
return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
5426
}
5427
break;
5428
case 3:
5429
if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
5430
return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
5431
}
5432
break;
5433
case -3:
5434
if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
5435
return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
5436
}
5437
break;
5438
case 4:
5439
if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
5440
return (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]));
5441
}
5442
break;
5443
case -4:
5444
if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
5445
return -(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]));
5446
}
5447
break;
5448
}
5449
}
5450
#endif
5451
return PyLong_AsSsize_t(b);
5452
}
5453
x = PyNumber_Index(b);
5454
if (!x) return -1;
5455
ival = PyInt_AsSsize_t(x);
5456
Py_DECREF(x);
5457
return ival;
5458
}
5459
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
5460
return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
5461
}
5462
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
5463
return PyInt_FromSize_t(ival);
5464
}
5465
5466
5467
#endif /* Py_PYTHON_H */
5468
5469