Debian Codegraph @

pypy/module/cpyext/test/specmethdocstring.c

raw symbols SCIP
1 /* Generated by Cython 3.0.0a10 */
2 /* and then modified to use "struct wrapperbase", look for the
3 * commented out // #if CYTHON_COMPILING_IN_CPYTHON
4 *
5 * From specmethdocstring.pyx
6
7 * cdef class C:
8 * def __cinit__(self):
9 * "This is an unusable docstring."
10 * def __init__(self):
11 * "This is an unusable docstring."
12 * def __dealloc__(self):
13 * "This is an unusable docstring."
14 * def __richcmp__(self, other, int op):
15 * "This is an unusable docstring."
16 * def __nonzero__(self):
17 * "This is an unusable docstring."
18 * return False
19 * def __contains__(self, other):
20 * "This is an unusable docstring."
21 *
22 * property foo:
23 * def __get__(self):
24 * "So is this."
25 * def __set__(self, x):
26 * "And here is another one."
27 *
28 * def __div__(self, other):
29 * "usable docstring"
30 * def __iter__(self):
31 * "usable docstring"
32 * return False
33 * def __next__(self):
34 * "usable docstring"
35 * return False
36 */
37
38
39 #ifndef PY_SSIZE_T_CLEAN
40 #define PY_SSIZE_T_CLEAN
41 #endif /* PY_SSIZE_T_CLEAN */
42 #if defined(CYTHON_LIMITED_API) && 0
43 #ifndef Py_LIMITED_API
44 #if CYTHON_LIMITED_API+0 > 0x03030000
45 #define Py_LIMITED_API CYTHON_LIMITED_API
46 #else
47 #define Py_LIMITED_API 0x03030000
48 #endif
49 #endif
50 #endif
51
52 #include "Python.h"
53 #ifndef Py_PYTHON_H
54 #error Python headers needed to compile C extensions, please install development version of Python.
55 #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
56 #error Cython requires Python 2.7+ or Python 3.3+.
57 #else
58 #define CYTHON_ABI "3_0_0a10"
59 #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
60 #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
61 #define CYTHON_HEX_VERSION 0x030000AA
62 #define CYTHON_FUTURE_DIVISION 0
63 #include <stddef.h>
64 #ifndef offsetof
65 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
66 #endif
67 #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
68 #ifndef __stdcall
69 #define __stdcall
70 #endif
71 #ifndef __cdecl
72 #define __cdecl
73 #endif
74 #ifndef __fastcall
75 #define __fastcall
76 #endif
77 #endif
78 #ifndef DL_IMPORT
79 #define DL_IMPORT(t) t
80 #endif
81 #define __PYX_COMMA ,
82 #ifndef HAVE_LONG_LONG
83 #define HAVE_LONG_LONG
84 #endif
85 #ifndef PY_LONG_LONG
86 #define PY_LONG_LONG LONG_LONG
87 #endif
88 #ifndef Py_HUGE_VAL
89 #define Py_HUGE_VAL HUGE_VAL
90 #endif
91 #if defined(GRAALVM_PYTHON)
92 /* For very preliminary testing purposes. Most variables are set the same as PyPy.
93 The existence of this section does not imply that anything works or is even tested */
94 #define CYTHON_COMPILING_IN_PYPY 0
95 #define CYTHON_COMPILING_IN_CPYTHON 0
96 #define CYTHON_COMPILING_IN_LIMITED_API 0
97 #define CYTHON_COMPILING_IN_GRAAL 1
98 #undef CYTHON_USE_TYPE_SLOTS
99 #define CYTHON_USE_TYPE_SLOTS 0
100 #undef CYTHON_USE_TYPE_SPECS
101 #define CYTHON_USE_TYPE_SPECS 0
102 #undef CYTHON_USE_PYTYPE_LOOKUP
103 #define CYTHON_USE_PYTYPE_LOOKUP 0
104 #if PY_VERSION_HEX < 0x03050000
105 #undef CYTHON_USE_ASYNC_SLOTS
106 #define CYTHON_USE_ASYNC_SLOTS 0
107 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
108 #define CYTHON_USE_ASYNC_SLOTS 1
109 #endif
110 #undef CYTHON_USE_PYLIST_INTERNALS
111 #define CYTHON_USE_PYLIST_INTERNALS 0
112 #undef CYTHON_USE_UNICODE_INTERNALS
113 #define CYTHON_USE_UNICODE_INTERNALS 0
114 #undef CYTHON_USE_UNICODE_WRITER
115 #define CYTHON_USE_UNICODE_WRITER 0
116 #undef CYTHON_USE_PYLONG_INTERNALS
117 #define CYTHON_USE_PYLONG_INTERNALS 0
118 #undef CYTHON_AVOID_BORROWED_REFS
119 #define CYTHON_AVOID_BORROWED_REFS 1
120 #undef CYTHON_ASSUME_SAFE_MACROS
121 #define CYTHON_ASSUME_SAFE_MACROS 0
122 #undef CYTHON_UNPACK_METHODS
123 #define CYTHON_UNPACK_METHODS 0
124 #undef CYTHON_FAST_THREAD_STATE
125 #define CYTHON_FAST_THREAD_STATE 0
126 #undef CYTHON_FAST_GIL
127 #define CYTHON_FAST_GIL 0
128 #undef CYTHON_METH_FASTCALL
129 #define CYTHON_METH_FASTCALL 0
130 #undef CYTHON_FAST_PYCALL
131 #define CYTHON_FAST_PYCALL 0
132 #ifndef CYTHON_PEP487_INIT_SUBCLASS
133 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
134 #endif
135 #undef CYTHON_PEP489_MULTI_PHASE_INIT
136 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
137 #undef CYTHON_USE_MODULE_STATE
138 #define CYTHON_USE_MODULE_STATE 0
139 #undef CYTHON_USE_TP_FINALIZE
140 #define CYTHON_USE_TP_FINALIZE 0
141 #undef CYTHON_USE_DICT_VERSIONS
142 #define CYTHON_USE_DICT_VERSIONS 0
143 #undef CYTHON_USE_EXC_INFO_STACK
144 #define CYTHON_USE_EXC_INFO_STACK 0
145 #elif defined(PYPY_VERSION)
146 #define CYTHON_COMPILING_IN_PYPY 1
147 #define CYTHON_COMPILING_IN_CPYTHON 0
148 #define CYTHON_COMPILING_IN_LIMITED_API 0
149 #define CYTHON_COMPILING_IN_GRAAL 0
150 #undef CYTHON_USE_TYPE_SLOTS
151 #define CYTHON_USE_TYPE_SLOTS 0
152 #undef CYTHON_USE_TYPE_SPECS
153 #define CYTHON_USE_TYPE_SPECS 0
154 #undef CYTHON_USE_PYTYPE_LOOKUP
155 #define CYTHON_USE_PYTYPE_LOOKUP 0
156 #if PY_VERSION_HEX < 0x03050000
157 #undef CYTHON_USE_ASYNC_SLOTS
158 #define CYTHON_USE_ASYNC_SLOTS 0
159 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
160 #define CYTHON_USE_ASYNC_SLOTS 1
161 #endif
162 #undef CYTHON_USE_PYLIST_INTERNALS
163 #define CYTHON_USE_PYLIST_INTERNALS 0
164 #undef CYTHON_USE_UNICODE_INTERNALS
165 #define CYTHON_USE_UNICODE_INTERNALS 0
166 #undef CYTHON_USE_UNICODE_WRITER
167 #define CYTHON_USE_UNICODE_WRITER 0
168 #undef CYTHON_USE_PYLONG_INTERNALS
169 #define CYTHON_USE_PYLONG_INTERNALS 0
170 #undef CYTHON_AVOID_BORROWED_REFS
171 #define CYTHON_AVOID_BORROWED_REFS 1
172 #undef CYTHON_ASSUME_SAFE_MACROS
173 #define CYTHON_ASSUME_SAFE_MACROS 0
174 #undef CYTHON_UNPACK_METHODS
175 #define CYTHON_UNPACK_METHODS 0
176 #undef CYTHON_FAST_THREAD_STATE
177 #define CYTHON_FAST_THREAD_STATE 0
178 #undef CYTHON_FAST_GIL
179 #define CYTHON_FAST_GIL 0
180 #undef CYTHON_METH_FASTCALL
181 #define CYTHON_METH_FASTCALL 0
182 #undef CYTHON_FAST_PYCALL
183 #define CYTHON_FAST_PYCALL 0
184 #ifndef CYTHON_PEP487_INIT_SUBCLASS
185 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
186 #endif
187 #undef CYTHON_PEP489_MULTI_PHASE_INIT
188 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
189 #undef CYTHON_USE_MODULE_STATE
190 #define CYTHON_USE_MODULE_STATE 0
191 #undef CYTHON_USE_TP_FINALIZE
192 #define CYTHON_USE_TP_FINALIZE 0
193 #undef CYTHON_USE_DICT_VERSIONS
194 #define CYTHON_USE_DICT_VERSIONS 0
195 #undef CYTHON_USE_EXC_INFO_STACK
196 #define CYTHON_USE_EXC_INFO_STACK 0
197 #elif defined(CYTHON_LIMITED_API)
198 #define CYTHON_COMPILING_IN_PYPY 0
199 #define CYTHON_COMPILING_IN_CPYTHON 0
200 #define CYTHON_COMPILING_IN_LIMITED_API 1
201 #define CYTHON_COMPILING_IN_GRAAL 0
202 #undef CYTHON_CLINE_IN_TRACEBACK
203 #define CYTHON_CLINE_IN_TRACEBACK 0
204 #undef CYTHON_USE_TYPE_SLOTS
205 #define CYTHON_USE_TYPE_SLOTS 0
206 #undef CYTHON_USE_TYPE_SPECS
207 #define CYTHON_USE_TYPE_SPECS 1
208 #undef CYTHON_USE_PYTYPE_LOOKUP
209 #define CYTHON_USE_PYTYPE_LOOKUP 0
210 #undef CYTHON_USE_ASYNC_SLOTS
211 #define CYTHON_USE_ASYNC_SLOTS 0
212 #undef CYTHON_USE_PYLIST_INTERNALS
213 #define CYTHON_USE_PYLIST_INTERNALS 0
214 #undef CYTHON_USE_UNICODE_INTERNALS
215 #define CYTHON_USE_UNICODE_INTERNALS 0
216 #ifndef CYTHON_USE_UNICODE_WRITER
217 #define CYTHON_USE_UNICODE_WRITER 0
218 #endif
219 #undef CYTHON_USE_PYLONG_INTERNALS
220 #define CYTHON_USE_PYLONG_INTERNALS 0
221 #ifndef CYTHON_AVOID_BORROWED_REFS
222 #define CYTHON_AVOID_BORROWED_REFS 0
223 #endif
224 #undef CYTHON_ASSUME_SAFE_MACROS
225 #define CYTHON_ASSUME_SAFE_MACROS 0
226 #undef CYTHON_UNPACK_METHODS
227 #define CYTHON_UNPACK_METHODS 0
228 #undef CYTHON_FAST_THREAD_STATE
229 #define CYTHON_FAST_THREAD_STATE 0
230 #undef CYTHON_FAST_GIL
231 #define CYTHON_FAST_GIL 0
232 #undef CYTHON_METH_FASTCALL
233 #define CYTHON_METH_FASTCALL 0
234 #undef CYTHON_FAST_PYCALL
235 #define CYTHON_FAST_PYCALL 0
236 #ifndef CYTHON_PEP487_INIT_SUBCLASS
237 #define CYTHON_PEP487_INIT_SUBCLASS 1
238 #endif
239 #undef CYTHON_PEP489_MULTI_PHASE_INIT
240 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
241 #undef CYTHON_USE_MODULE_STATE
242 #define CYTHON_USE_MODULE_STATE 1
243 #ifndef CYTHON_USE_TP_FINALIZE
244 #define CYTHON_USE_TP_FINALIZE 1
245 #endif
246 #undef CYTHON_USE_DICT_VERSIONS
247 #define CYTHON_USE_DICT_VERSIONS 0
248 #undef CYTHON_USE_EXC_INFO_STACK
249 #define CYTHON_USE_EXC_INFO_STACK 0
250 #else
251 #define CYTHON_COMPILING_IN_PYPY 0
252 #define CYTHON_COMPILING_IN_CPYTHON 1
253 #define CYTHON_COMPILING_IN_LIMITED_API 0
254 #define CYTHON_COMPILING_IN_GRAAL 0
255 #ifndef CYTHON_USE_TYPE_SLOTS
256 #define CYTHON_USE_TYPE_SLOTS 1
257 #endif
258 #ifndef CYTHON_USE_TYPE_SPECS
259 #define CYTHON_USE_TYPE_SPECS 0
260 #endif
261 #ifndef CYTHON_USE_PYTYPE_LOOKUP
262 #define CYTHON_USE_PYTYPE_LOOKUP 1
263 #endif
264 #if PY_MAJOR_VERSION < 3
265 #undef CYTHON_USE_ASYNC_SLOTS
266 #define CYTHON_USE_ASYNC_SLOTS 0
267 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
268 #define CYTHON_USE_ASYNC_SLOTS 1
269 #endif
270 #ifndef CYTHON_USE_PYLONG_INTERNALS
271 #define CYTHON_USE_PYLONG_INTERNALS 1
272 #endif
273 #ifndef CYTHON_USE_PYLIST_INTERNALS
274 #define CYTHON_USE_PYLIST_INTERNALS 1
275 #endif
276 #ifndef CYTHON_USE_UNICODE_INTERNALS
277 #define CYTHON_USE_UNICODE_INTERNALS 1
278 #endif
279 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
280 #undef CYTHON_USE_UNICODE_WRITER
281 #define CYTHON_USE_UNICODE_WRITER 0
282 #elif !defined(CYTHON_USE_UNICODE_WRITER)
283 #define CYTHON_USE_UNICODE_WRITER 1
284 #endif
285 #ifndef CYTHON_AVOID_BORROWED_REFS
286 #define CYTHON_AVOID_BORROWED_REFS 0
287 #endif
288 #ifndef CYTHON_ASSUME_SAFE_MACROS
289 #define CYTHON_ASSUME_SAFE_MACROS 1
290 #endif
291 #ifndef CYTHON_UNPACK_METHODS
292 #define CYTHON_UNPACK_METHODS 1
293 #endif
294 #ifndef CYTHON_FAST_THREAD_STATE
295 #define CYTHON_FAST_THREAD_STATE 1
296 #endif
297 #ifndef CYTHON_FAST_GIL
298 #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000)
299 #endif
300 #ifndef CYTHON_METH_FASTCALL
301 #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
302 #endif
303 #ifndef CYTHON_FAST_PYCALL
304 #define CYTHON_FAST_PYCALL 1
305 #endif
306 #ifndef CYTHON_PEP487_INIT_SUBCLASS
307 #define CYTHON_PEP487_INIT_SUBCLASS 1
308 #endif
309 #if PY_VERSION_HEX < 0x03050000
310 #undef CYTHON_PEP489_MULTI_PHASE_INIT
311 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
312 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
313 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
314 #endif
315 #ifndef CYTHON_USE_MODULE_STATE
316 #define CYTHON_USE_MODULE_STATE 0
317 #endif
318 #if PY_VERSION_HEX < 0x030400a1
319 #undef CYTHON_USE_TP_FINALIZE
320 #define CYTHON_USE_TP_FINALIZE 0
321 #elif !defined(CYTHON_USE_TP_FINALIZE)
322 #define CYTHON_USE_TP_FINALIZE 1
323 #endif
324 #if PY_VERSION_HEX < 0x030600B1
325 #undef CYTHON_USE_DICT_VERSIONS
326 #define CYTHON_USE_DICT_VERSIONS 0
327 #elif !defined(CYTHON_USE_DICT_VERSIONS)
328 #define CYTHON_USE_DICT_VERSIONS 1
329 #endif
330 #if PY_VERSION_HEX < 0x030700A3
331 #undef CYTHON_USE_EXC_INFO_STACK
332 #define CYTHON_USE_EXC_INFO_STACK 0
333 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
334 #define CYTHON_USE_EXC_INFO_STACK 1
335 #endif
336 #endif
337 #if !defined(CYTHON_FAST_PYCCALL)
338 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
339 #endif
340 #if !defined(CYTHON_VECTORCALL)
341 #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
342 #endif
343 #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
344 #if CYTHON_USE_PYLONG_INTERNALS
345 #if PY_MAJOR_VERSION < 3
346 #include "longintrepr.h"
347 #endif
348 #undef SHIFT
349 #undef BASE
350 #undef MASK
351 #ifdef SIZEOF_VOID_P
352 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
353 #endif
354 #endif
355 #ifndef __has_attribute
356 #define __has_attribute(x) 0
357 #endif
358 #ifndef __has_cpp_attribute
359 #define __has_cpp_attribute(x) 0
360 #endif
361 #ifndef CYTHON_RESTRICT
362 #if defined(__GNUC__)
363 #define CYTHON_RESTRICT __restrict__
364 #elif defined(_MSC_VER) && _MSC_VER >= 1400
365 #define CYTHON_RESTRICT __restrict
366 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
367 #define CYTHON_RESTRICT restrict
368 #else
369 #define CYTHON_RESTRICT
370 #endif
371 #endif
372 #ifndef CYTHON_UNUSED
373 # if defined(__GNUC__)
374 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
375 # define CYTHON_UNUSED __attribute__ ((__unused__))
376 # else
377 # define CYTHON_UNUSED
378 # endif
379 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
380 # define CYTHON_UNUSED __attribute__ ((__unused__))
381 # else
382 # define CYTHON_UNUSED
383 # endif
384 #endif
385 #ifndef CYTHON_UNUSED_VAR
386 # if defined(__cplusplus)
387 template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
388 # else
389 # define CYTHON_UNUSED_VAR(x) (void)(x)
390 # endif
391 #endif
392 #ifndef CYTHON_MAYBE_UNUSED_VAR
393 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
394 #endif
395 #ifndef CYTHON_NCP_UNUSED
396 # if CYTHON_COMPILING_IN_CPYTHON
397 # define CYTHON_NCP_UNUSED
398 # else
399 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
400 # endif
401 #endif
402 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
403 #ifdef _MSC_VER
404 #ifndef _MSC_STDINT_H_
405 #if _MSC_VER < 1300
406 typedef unsigned char uint8_t;
407 typedef unsigned short uint16_t;
408 typedef unsigned int uint32_t;
409 #else
410 typedef unsigned __int8 uint8_t;
411 typedef unsigned __int16 uint16_t;
412 typedef unsigned __int32 uint32_t;
413 #endif
414 #endif
415 #if _MSC_VER < 1300
416 #ifdef _WIN64
417 typedef unsigned long long __pyx_uintptr_t;
418 #else
419 typedef unsigned int __pyx_uintptr_t;
420 #endif
421 #else
422 #ifdef _WIN64
423 typedef unsigned __int64 __pyx_uintptr_t;
424 #else
425 typedef unsigned __int32 __pyx_uintptr_t;
426 #endif
427 #endif
428 #else
429 #include <stdint.h>
430 typedef uintptr_t __pyx_uintptr_t;
431 #endif
432 #ifndef CYTHON_FALLTHROUGH
433 #if defined(__cplusplus) && __cplusplus >= 201103L
434 #if __has_cpp_attribute(fallthrough)
435 #define CYTHON_FALLTHROUGH [[fallthrough]]
436 #elif __has_cpp_attribute(clang::fallthrough)
437 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
438 #elif __has_cpp_attribute(gnu::fallthrough)
439 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
440 #endif
441 #endif
442 #ifndef CYTHON_FALLTHROUGH
443 #if __has_attribute(fallthrough)
444 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
445 #else
446 #define CYTHON_FALLTHROUGH
447 #endif
448 #endif
449 #if defined(__clang__ ) && defined(__apple_build_version__)
450 #if __apple_build_version__ < 7000000
451 #undef CYTHON_FALLTHROUGH
452 #define CYTHON_FALLTHROUGH
453 #endif
454 #endif
455 #endif
456
457 #ifndef CYTHON_INLINE
458 #if defined(__clang__)
459 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
460 #elif defined(__GNUC__)
461 #define CYTHON_INLINE __inline__
462 #elif defined(_MSC_VER)
463 #define CYTHON_INLINE __inline
464 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
465 #define CYTHON_INLINE inline
466 #else
467 #define CYTHON_INLINE
468 #endif
469 #endif
470
471 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
472 #define Py_OptimizeFlag 0
473 #endif
474 #define __PYX_BUILD_PY_SSIZE_T "n"
475 #define CYTHON_FORMAT_SSIZE_T "z"
476 #if PY_MAJOR_VERSION < 3
477 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
478 #define __Pyx_DefaultClassType PyClass_Type
479 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
480 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
481 #else
482 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
483 #define __Pyx_DefaultClassType PyType_Type
484 #if PY_VERSION_HEX >= 0x030B00A1
485 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
486 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
487 PyObject *fv, PyObject *cell, PyObject* fn,
488 PyObject *name, int fline, PyObject *lnos) {
489 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
490 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
491 const char *fn_cstr=NULL;
492 const char *name_cstr=NULL;
493 PyCodeObject* co=NULL;
494 PyObject *type, *value, *traceback;
495 PyErr_Fetch(&type, &value, &traceback);
496 if (!(kwds=PyDict_New())) goto end;
497 if (!(argcount=PyLong_FromLong(a))) goto end;
498 if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
499 if (!(posonlyargcount=PyLong_FromLong(p))) goto end;
500 if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
501 if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
502 if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
503 if (!(nlocals=PyLong_FromLong(l))) goto end;
504 if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
505 if (!(stacksize=PyLong_FromLong(s))) goto end;
506 if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
507 if (!(flags=PyLong_FromLong(f))) goto end;
508 if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
509 if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
510 if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
511 if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
512 if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
513 if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
514 if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
515 if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
516 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
517 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
518 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
519 if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
520 if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
521 if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
522 Py_XDECREF((PyObject*)co);
523 co = (PyCodeObject*)call_result;
524 call_result = NULL;
525 if (0) {
526 cleanup_code_too:
527 Py_XDECREF((PyObject*)co);
528 co = NULL;
529 }
530 end:
531 Py_XDECREF(kwds);
532 Py_XDECREF(argcount);
533 Py_XDECREF(posonlyargcount);
534 Py_XDECREF(kwonlyargcount);
535 Py_XDECREF(nlocals);
536 Py_XDECREF(stacksize);
537 Py_XDECREF(replace);
538 Py_XDECREF(call_result);
539 Py_XDECREF(empty);
540 if (type) {
541 PyErr_Restore(type, value, traceback);
542 }
543 return co;
544 }
545 #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
546 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
547 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
548 #else
549 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
550 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
551 #endif
552 #endif
553 #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
554 #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
555 #else
556 #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
557 #endif
558 #ifndef Py_TPFLAGS_CHECKTYPES
559 #define Py_TPFLAGS_CHECKTYPES 0
560 #endif
561 #ifndef Py_TPFLAGS_HAVE_INDEX
562 #define Py_TPFLAGS_HAVE_INDEX 0
563 #endif
564 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
565 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
566 #endif
567 #ifndef Py_TPFLAGS_HAVE_FINALIZE
568 #define Py_TPFLAGS_HAVE_FINALIZE 0
569 #endif
570 #ifndef METH_STACKLESS
571 #define METH_STACKLESS 0
572 #endif
573 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
574 #ifndef METH_FASTCALL
575 #define METH_FASTCALL 0x80
576 #endif
577 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
578 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
579 Py_ssize_t nargs, PyObject *kwnames);
580 #else
581 #define __Pyx_PyCFunctionFast _PyCFunctionFast
582 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
583 #endif
584 #if CYTHON_METH_FASTCALL
585 #define __Pyx_METH_FASTCALL METH_FASTCALL
586 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
587 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
588 #else
589 #define __Pyx_METH_FASTCALL METH_VARARGS
590 #define __Pyx_PyCFunction_FastCall PyCFunction
591 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
592 #endif
593 #if CYTHON_VECTORCALL
594 #define __pyx_vectorcallfunc vectorcallfunc
595 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
596 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
597 #elif CYTHON_BACKPORT_VECTORCALL
598 typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
599 size_t nargsf, PyObject *kwnames);
600 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
601 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
602 #else
603 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
604 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
605 #endif
606 #if PY_VERSION_HEX < 0x030900B1
607 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
608 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
609 #else
610 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
611 #define __Pyx_PyCMethod PyCMethod
612 #endif
613 #ifndef METH_METHOD
614 #define METH_METHOD 0x200
615 #endif
616 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
617 #define PyObject_Malloc(s) PyMem_Malloc(s)
618 #define PyObject_Free(p) PyMem_Free(p)
619 #define PyObject_Realloc(p) PyMem_Realloc(p)
620 #endif
621 #if CYTHON_COMPILING_IN_LIMITED_API
622 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
623 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
624 #else
625 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
626 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
627 #endif
628 #if CYTHON_COMPILING_IN_LIMITED_API
629 #define __Pyx_PyThreadState_Current PyThreadState_Get()
630 #elif !CYTHON_FAST_THREAD_STATE
631 #define __Pyx_PyThreadState_Current PyThreadState_GET()
632 #elif PY_VERSION_HEX >= 0x03060000
633 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
634 #elif PY_VERSION_HEX >= 0x03000000
635 #define __Pyx_PyThreadState_Current PyThreadState_GET()
636 #else
637 #define __Pyx_PyThreadState_Current _PyThreadState_Current
638 #endif
639 #if CYTHON_COMPILING_IN_LIMITED_API
640 static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
641 {
642 void *result;
643 result = PyModule_GetState(op);
644 if (!result)
645 Py_FatalError("Couldn't find the module state");
646 return result;
647 }
648 #endif
649 #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
650 #if CYTHON_COMPILING_IN_LIMITED_API
651 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
652 #else
653 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
654 #endif
655 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
656 #include "pythread.h"
657 #define Py_tss_NEEDS_INIT 0
658 typedef int Py_tss_t;
659 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
660 *key = PyThread_create_key();
661 return 0;
662 }
663 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
664 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
665 *key = Py_tss_NEEDS_INIT;
666 return key;
667 }
668 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
669 PyObject_Free(key);
670 }
671 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
672 return *key != Py_tss_NEEDS_INIT;
673 }
674 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
675 PyThread_delete_key(*key);
676 *key = Py_tss_NEEDS_INIT;
677 }
678 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
679 return PyThread_set_key_value(*key, value);
680 }
681 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
682 return PyThread_get_key_value(*key);
683 }
684 #endif
685 #if PY_MAJOR_VERSION < 3
686 #if CYTHON_COMPILING_IN_PYPY
687 #if PYPY_VERSION_NUM < 0x07030600
688 #if defined(__cplusplus) && __cplusplus >= 201402L
689 [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
690 #elif defined(__GNUC__) || defined(__clang__)
691 __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
692 #elif defined(_MSC_VER)
693 __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
694 #endif
695 static CYTHON_INLINE int PyGILState_Check(void) {
696 return 0;
697 }
698 #else // PYPY_VERSION_NUM < 0x07030600
699 #endif // PYPY_VERSION_NUM < 0x07030600
700 #else
701 static CYTHON_INLINE int PyGILState_Check(void) {
702 PyThreadState * tstate = _PyThreadState_Current;
703 return tstate && (tstate == PyGILState_GetThisThreadState());
704 }
705 #endif
706 #endif
707 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
708 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
709 #else
710 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
711 #endif
712 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
713 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
714 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
715 #else
716 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
717 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
718 #endif
719 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS
720 #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
721 static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
722 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
723 if (res == NULL) PyErr_Clear();
724 return res;
725 }
726 #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
727 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
728 #define __Pyx_PyDict_GetItemStr PyDict_GetItem
729 #else
730 static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
731 #if CYTHON_COMPILING_IN_PYPY
732 return PyDict_GetItem(dict, name);
733 #else
734 PyDictEntry *ep;
735 PyDictObject *mp = (PyDictObject*) dict;
736 long hash = ((PyStringObject *) name)->ob_shash;
737 assert(hash != -1);
738 ep = (mp->ma_lookup)(mp, name, hash);
739 if (ep == NULL) {
740 return NULL;
741 }
742 return ep->me_value;
743 #endif
744 }
745 #define __Pyx_PyDict_GetItemStr PyDict_GetItem
746 #endif
747 #if CYTHON_USE_TYPE_SLOTS
748 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
749 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
750 #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
751 #else
752 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
753 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
754 #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
755 #endif
756 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
757 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
758 PyTypeObject *type = Py_TYPE(obj);\
759 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
760 PyObject_GC_Del(obj);\
761 Py_DECREF(type);\
762 }
763 #else
764 #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
765 #endif
766 #if CYTHON_COMPILING_IN_LIMITED_API
767 #define CYTHON_PEP393_ENABLED 1
768 #define __Pyx_PyUnicode_READY(op) (0)
769 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
770 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
771 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111)
772 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
773 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
774 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
775 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
776 #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
777 #define CYTHON_PEP393_ENABLED 1
778 #if defined(PyUnicode_IS_READY)
779 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
780 0 : _PyUnicode_Ready((PyObject *)(op)))
781 #else
782 #define __Pyx_PyUnicode_READY(op) (0)
783 #endif
784 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
785 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
786 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
787 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
788 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
789 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
790 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
791 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
792 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
793 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
794 #else
795 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
796 #endif
797 #else
798 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
799 #endif
800 #else
801 #define CYTHON_PEP393_ENABLED 0
802 #define PyUnicode_1BYTE_KIND 1
803 #define PyUnicode_2BYTE_KIND 2
804 #define PyUnicode_4BYTE_KIND 4
805 #define __Pyx_PyUnicode_READY(op) (0)
806 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
807 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
808 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
809 #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE))
810 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
811 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
812 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
813 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
814 #endif
815 #if CYTHON_COMPILING_IN_PYPY
816 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
817 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
818 #else
819 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
820 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
821 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
822 #endif
823 #if CYTHON_COMPILING_IN_PYPY
824 #if !defined(PyUnicode_DecodeUnicodeEscape)
825 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
826 #endif
827 #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
828 #undef PyUnicode_Contains
829 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
830 #endif
831 #if !defined(PyByteArray_Check)
832 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
833 #endif
834 #if !defined(PyObject_Format)
835 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
836 #endif
837 #endif
838 #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))
839 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
840 #if PY_MAJOR_VERSION >= 3
841 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
842 #else
843 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
844 #endif
845 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
846 #define PyObject_ASCII(o) PyObject_Repr(o)
847 #endif
848 #if PY_MAJOR_VERSION >= 3
849 #define PyBaseString_Type PyUnicode_Type
850 #define PyStringObject PyUnicodeObject
851 #define PyString_Type PyUnicode_Type
852 #define PyString_Check PyUnicode_Check
853 #define PyString_CheckExact PyUnicode_CheckExact
854 #ifndef PyObject_Unicode
855 #define PyObject_Unicode PyObject_Str
856 #endif
857 #endif
858 #if PY_MAJOR_VERSION >= 3
859 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
860 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
861 #else
862 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
863 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
864 #endif
865 #if CYTHON_COMPILING_IN_CPYTHON
866 #define __Pyx_PySequence_ListKeepNew(obj)\
867 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
868 #else
869 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
870 #endif
871 #ifndef PySet_CheckExact
872 #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
873 #endif
874 #if PY_VERSION_HEX >= 0x030900A4
875 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
876 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
877 #else
878 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
879 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
880 #endif
881 #if CYTHON_ASSUME_SAFE_MACROS
882 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
883 #else
884 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
885 #endif
886 #if PY_MAJOR_VERSION >= 3
887 #define PyIntObject PyLongObject
888 #define PyInt_Type PyLong_Type
889 #define PyInt_Check(op) PyLong_Check(op)
890 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
891 #define PyInt_FromString PyLong_FromString
892 #define PyInt_FromUnicode PyLong_FromUnicode
893 #define PyInt_FromLong PyLong_FromLong
894 #define PyInt_FromSize_t PyLong_FromSize_t
895 #define PyInt_FromSsize_t PyLong_FromSsize_t
896 #define PyInt_AsLong PyLong_AsLong
897 #define PyInt_AS_LONG PyLong_AS_LONG
898 #define PyInt_AsSsize_t PyLong_AsSsize_t
899 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
900 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
901 #define PyNumber_Int PyNumber_Long
902 #endif
903 #if PY_MAJOR_VERSION >= 3
904 #define PyBoolObject PyLongObject
905 #endif
906 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
907 #ifndef PyUnicode_InternFromString
908 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
909 #endif
910 #endif
911 #if PY_VERSION_HEX < 0x030200A4
912 typedef long Py_hash_t;
913 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
914 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
915 #else
916 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
917 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
918 #endif
919 #if CYTHON_USE_ASYNC_SLOTS
920 #if PY_VERSION_HEX >= 0x030500B1
921 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
922 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
923 #else
924 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
925 #endif
926 #else
927 #define __Pyx_PyType_AsAsync(obj) NULL
928 #endif
929 #ifndef __Pyx_PyAsyncMethodsStruct
930 typedef struct {
931 unaryfunc am_await;
932 unaryfunc am_aiter;
933 unaryfunc am_anext;
934 } __Pyx_PyAsyncMethodsStruct;
935 #endif
936
937 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
938 #define _USE_MATH_DEFINES
939 #endif
940 #include <math.h>
941 #ifdef NAN
942 #define __PYX_NAN() ((float) NAN)
943 #else
944 static CYTHON_INLINE float __PYX_NAN() {
945 float value;
946 memset(&value, 0xFF, sizeof(value));
947 return value;
948 }
949 #endif
950 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
951 #define __Pyx_truncl trunc
952 #else
953 #define __Pyx_truncl truncl
954 #endif
955
956 #define __PYX_MARK_ERR_POS(f_index, lineno) \
957 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
958 #define __PYX_ERR(f_index, lineno, Ln_error) \
959 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
960
961 #ifndef __PYX_EXTERN_C
962 #ifdef __cplusplus
963 #define __PYX_EXTERN_C extern "C"
964 #else
965 #define __PYX_EXTERN_C extern
966 #endif
967 #endif
968
969 #define __PYX_HAVE__specmethdocstring
970 #define __PYX_HAVE_API__specmethdocstring
971 /* Early includes */
972 #ifdef _OPENMP
973 #include <omp.h>
974 #endif /* _OPENMP */
975
976 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
977 #define CYTHON_WITHOUT_ASSERTIONS
978 #endif
979
980 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
981 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
982
983 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
984 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
985 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
986 #define __PYX_DEFAULT_STRING_ENCODING ""
987 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
988 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
989 #define __Pyx_uchar_cast(c) ((unsigned char)c)
990 #define __Pyx_long_cast(x) ((long)x)
991 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
992 (sizeof(type) < sizeof(Py_ssize_t)) ||\
993 (sizeof(type) > sizeof(Py_ssize_t) &&\
994 likely(v < (type)PY_SSIZE_T_MAX ||\
995 v == (type)PY_SSIZE_T_MAX) &&\
996 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
997 v == (type)PY_SSIZE_T_MIN))) ||\
998 (sizeof(type) == sizeof(Py_ssize_t) &&\
999 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1000 v == (type)PY_SSIZE_T_MAX))) )
1001 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1002 return (size_t) i < (size_t) limit;
1003 }
1004 #if defined (__cplusplus) && __cplusplus >= 201103L
1005 #include <cstdlib>
1006 #define __Pyx_sst_abs(value) std::abs(value)
1007 #elif SIZEOF_INT >= SIZEOF_SIZE_T
1008 #define __Pyx_sst_abs(value) abs(value)
1009 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
1010 #define __Pyx_sst_abs(value) labs(value)
1011 #elif defined (_MSC_VER)
1012 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1013 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1014 #define __Pyx_sst_abs(value) llabs(value)
1015 #elif defined (__GNUC__)
1016 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1017 #else
1018 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1019 #endif
1020 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1021 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1022 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
1023 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1024 #define __Pyx_PyBytes_FromString PyBytes_FromString
1025 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1026 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1027 #if PY_MAJOR_VERSION < 3
1028 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1029 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1030 #else
1031 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1032 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1033 #endif
1034 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1035 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1036 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1037 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1038 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1039 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1040 #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1041 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1042 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1043 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1044 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1045 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1046 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1047 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1048 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1049 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1050 #if CYTHON_COMPILING_IN_LIMITED_API
1051 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u)
1052 {
1053 const wchar_t *u_end = u;
1054 while (*u_end++) ;
1055 return (size_t)(u_end - u - 1);
1056 }
1057 #else
1058 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
1059 {
1060 const Py_UNICODE *u_end = u;
1061 while (*u_end++) ;
1062 return (size_t)(u_end - u - 1);
1063 }
1064 #endif
1065 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
1066 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
1067 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1068 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1069 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1070 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1071 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1072 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1073 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1074 #define __Pyx_PySequence_Tuple(obj)\
1075 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1076 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1077 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
1078 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1079 #if CYTHON_ASSUME_SAFE_MACROS
1080 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1081 #else
1082 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1083 #endif
1084 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1085 #if PY_MAJOR_VERSION >= 3
1086 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1087 #else
1088 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1089 #endif
1090 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1091 static int __Pyx_sys_getdefaultencoding_not_ascii;
1092 static int __Pyx_init_sys_getdefaultencoding_params(void) {
1093 PyObject* sys;
1094 PyObject* default_encoding = NULL;
1095 PyObject* ascii_chars_u = NULL;
1096 PyObject* ascii_chars_b = NULL;
1097 const char* default_encoding_c;
1098 sys = PyImport_ImportModule("sys");
1099 if (!sys) goto bad;
1100 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1101 Py_DECREF(sys);
1102 if (!default_encoding) goto bad;
1103 default_encoding_c = PyBytes_AsString(default_encoding);
1104 if (!default_encoding_c) goto bad;
1105 if (strcmp(default_encoding_c, "ascii") == 0) {
1106 __Pyx_sys_getdefaultencoding_not_ascii = 0;
1107 } else {
1108 char ascii_chars[128];
1109 int c;
1110 for (c = 0; c < 128; c++) {
1111 ascii_chars[c] = c;
1112 }
1113 __Pyx_sys_getdefaultencoding_not_ascii = 1;
1114 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1115 if (!ascii_chars_u) goto bad;
1116 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1117 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1118 PyErr_Format(
1119 PyExc_ValueError,
1120 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1121 default_encoding_c);
1122 goto bad;
1123 }
1124 Py_DECREF(ascii_chars_u);
1125 Py_DECREF(ascii_chars_b);
1126 }
1127 Py_DECREF(default_encoding);
1128 return 0;
1129 bad:
1130 Py_XDECREF(default_encoding);
1131 Py_XDECREF(ascii_chars_u);
1132 Py_XDECREF(ascii_chars_b);
1133 return -1;
1134 }
1135 #endif
1136 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1137 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1138 #else
1139 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1140 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1141 static char* __PYX_DEFAULT_STRING_ENCODING;
1142 static int __Pyx_init_sys_getdefaultencoding_params(void) {
1143 PyObject* sys;
1144 PyObject* default_encoding = NULL;
1145 char* default_encoding_c;
1146 sys = PyImport_ImportModule("sys");
1147 if (!sys) goto bad;
1148 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1149 Py_DECREF(sys);
1150 if (!default_encoding) goto bad;
1151 default_encoding_c = PyBytes_AsString(default_encoding);
1152 if (!default_encoding_c) goto bad;
1153 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1154 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1155 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1156 Py_DECREF(default_encoding);
1157 return 0;
1158 bad:
1159 Py_XDECREF(default_encoding);
1160 return -1;
1161 }
1162 #endif
1163 #endif
1164
1165
1166 /* Test for GCC > 2.95 */
1167 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1168 #define likely(x) __builtin_expect(!!(x), 1)
1169 #define unlikely(x) __builtin_expect(!!(x), 0)
1170 #else /* !__GNUC__ or GCC < 2.95 */
1171 #define likely(x) (x)
1172 #define unlikely(x) (x)
1173 #endif /* __GNUC__ */
1174 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1175
1176 #if !CYTHON_USE_MODULE_STATE
1177 static PyObject *__pyx_m = NULL;
1178 static PyObject *__pyx_d;
1179 static PyObject *__pyx_b;
1180 static PyObject *__pyx_cython_runtime = NULL;
1181 static PyObject *__pyx_empty_tuple;
1182 static PyObject *__pyx_empty_bytes;
1183 static PyObject *__pyx_empty_unicode;
1184 #endif
1185 static int __pyx_lineno;
1186 static int __pyx_clineno = 0;
1187 static const char * __pyx_cfilenm = __FILE__;
1188 static const char *__pyx_filename;
1189
1190 /* #### Code section: filename_table ### */
1191
1192 static const char *__pyx_f[] = {
1193 "<stringsource>",
1194 "tests/compile/specmethdocstring.pyx",
1195 };
1196 /* #### Code section: utility_code_proto_before_types ### */
1197 /* #### Code section: numeric_typedefs ### */
1198 /* #### Code section: complex_type_declarations ### */
1199 /* #### Code section: type_declarations ### */
1200
1201 /*--- Type declarations ---*/
1202 struct __pyx_obj_17specmethdocstring_C;
1203
1204 /* "specmethdocstring.pyx":3
1205 * # mode: compile
1206 *
1207 * cdef class C: # <<<<<<<<<<<<<<
1208 * def __cinit__(self):
1209 * "This is an unusable docstring."
1210 */
1211 struct __pyx_obj_17specmethdocstring_C {
1212 PyObject_HEAD
1213 };
1214
1215 /* #### Code section: utility_code_proto ### */
1216
1217 /* --- Runtime support code (head) --- */
1218 /* Refnanny.proto */
1219 #ifndef CYTHON_REFNANNY
1220 #define CYTHON_REFNANNY 0
1221 #endif
1222 #if CYTHON_REFNANNY
1223 typedef struct {
1224 void (*INCREF)(void*, PyObject*, Py_ssize_t);
1225 void (*DECREF)(void*, PyObject*, Py_ssize_t);
1226 void (*GOTREF)(void*, PyObject*, Py_ssize_t);
1227 void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
1228 void* (*SetupContext)(const char*, Py_ssize_t, const char*);
1229 void (*FinishContext)(void**);
1230 } __Pyx_RefNannyAPIStruct;
1231 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1232 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1233 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1234 #ifdef WITH_THREAD
1235 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1236 if (acquire_gil) {\
1237 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1238 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1239 PyGILState_Release(__pyx_gilstate_save);\
1240 } else {\
1241 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1242 }
1243 #define __Pyx_RefNannyFinishContextNogil() {\
1244 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1245 __Pyx_RefNannyFinishContext();\
1246 PyGILState_Release(__pyx_gilstate_save);\
1247 }
1248 #else
1249 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1250 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
1251 #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
1252 #endif
1253 #define __Pyx_RefNannyFinishContext()\
1254 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1255 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1256 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1257 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1258 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1259 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
1260 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
1261 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
1262 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
1263 #else
1264 #define __Pyx_RefNannyDeclarations
1265 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1266 #define __Pyx_RefNannyFinishContextNogil()
1267 #define __Pyx_RefNannyFinishContext()
1268 #define __Pyx_INCREF(r) Py_INCREF(r)
1269 #define __Pyx_DECREF(r) Py_DECREF(r)
1270 #define __Pyx_GOTREF(r)
1271 #define __Pyx_GIVEREF(r)
1272 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1273 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1274 #define __Pyx_XGOTREF(r)
1275 #define __Pyx_XGIVEREF(r)
1276 #endif
1277 #define __Pyx_Py_XDECREF_SET(r, v) do {\
1278 PyObject *tmp = (PyObject *) r;\
1279 r = v; Py_XDECREF(tmp);\
1280 } while (0)
1281 #define __Pyx_XDECREF_SET(r, v) do {\
1282 PyObject *tmp = (PyObject *) r;\
1283 r = v; __Pyx_XDECREF(tmp);\
1284 } while (0)
1285 #define __Pyx_DECREF_SET(r, v) do {\
1286 PyObject *tmp = (PyObject *) r;\
1287 r = v; __Pyx_DECREF(tmp);\
1288 } while (0)
1289 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1290 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1291
1292 /* PyErrExceptionMatches.proto */
1293 #if CYTHON_FAST_THREAD_STATE
1294 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1295 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1296 #else
1297 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1298 #endif
1299
1300 /* PyThreadStateGet.proto */
1301 #if CYTHON_FAST_THREAD_STATE
1302 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1303 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1304 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1305 #else
1306 #define __Pyx_PyThreadState_declare
1307 #define __Pyx_PyThreadState_assign
1308 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1309 #endif
1310
1311 /* PyErrFetchRestore.proto */
1312 #if CYTHON_FAST_THREAD_STATE
1313 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1314 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1315 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1316 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1317 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1318 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1319 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1320 #if CYTHON_COMPILING_IN_CPYTHON
1321 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1322 #else
1323 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1324 #endif
1325 #else
1326 #define __Pyx_PyErr_Clear() PyErr_Clear()
1327 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1328 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1329 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1330 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1331 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1332 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1333 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1334 #endif
1335
1336 /* PyObjectGetAttrStr.proto */
1337 #if CYTHON_USE_TYPE_SLOTS
1338 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1339 #else
1340 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1341 #endif
1342
1343 /* PyObjectGetAttrStrNoError.proto */
1344 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1345
1346 /* GetBuiltinName.proto */
1347 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1348
1349 /* TupleAndListFromArray.proto */
1350 #if CYTHON_COMPILING_IN_CPYTHON
1351 static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
1352 static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
1353 #endif
1354
1355 /* IncludeStringH.proto */
1356 #include <string.h>
1357
1358 /* BytesEquals.proto */
1359 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1360
1361 /* UnicodeEquals.proto */
1362 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1363
1364 /* fastcall.proto */
1365 #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
1366 #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
1367 #define __Pyx_KwValues_VARARGS(args, nargs) NULL
1368 #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
1369 #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
1370 #if CYTHON_METH_FASTCALL
1371 #define __Pyx_Arg_FASTCALL(args, i) args[i]
1372 #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
1373 #define __Pyx_KwValues_FASTCALL(args, nargs) (&args[nargs])
1374 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
1375 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
1376 #else
1377 #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
1378 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
1379 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
1380 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
1381 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
1382 #endif
1383 #if CYTHON_COMPILING_IN_CPYTHON
1384 #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
1385 #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
1386 #else
1387 #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
1388 #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
1389 #endif
1390
1391 /* RaiseArgTupleInvalid.proto */
1392 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1393 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1394
1395 /* KeywordStringCheck.proto */
1396 static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);
1397
1398 /* RaiseException.proto */
1399 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1400
1401 /* RaiseDoubleKeywords.proto */
1402 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1403
1404 /* ParseKeywords.proto */
1405 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
1406 PyObject **argnames[],
1407 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
1408 const char* function_name);
1409
1410 /* IncludeStructmemberH.proto */
1411 #include <structmember.h>
1412
1413 /* FixUpExtensionType.proto */
1414 #if CYTHON_USE_TYPE_SPECS
1415 static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
1416 #endif
1417
1418 /* PyFunctionFastCall.proto */
1419 #if CYTHON_FAST_PYCALL
1420 #if !CYTHON_VECTORCALL
1421 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1422 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1423 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1424 #endif
1425 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1426 (sizeof(char [1 - 2*!(cond)]) - 1)
1427 #ifndef Py_MEMBER_SIZE
1428 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1429 #endif
1430 #if !CYTHON_VECTORCALL
1431 #if PY_VERSION_HEX >= 0x03080000
1432 #include "frameobject.h"
1433 #define __Pxy_PyFrame_Initialize_Offsets()
1434 #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
1435 #else
1436 static size_t __pyx_pyframe_localsplus_offset = 0;
1437 #include "frameobject.h"
1438 #define __Pxy_PyFrame_Initialize_Offsets()\
1439 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1440 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1441 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1442 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1443 #endif
1444 #endif
1445 #endif
1446
1447 /* PyObjectCall.proto */
1448 #if CYTHON_COMPILING_IN_CPYTHON
1449 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1450 #else
1451 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1452 #endif
1453
1454 /* PyObjectCallMethO.proto */
1455 #if CYTHON_COMPILING_IN_CPYTHON
1456 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1457 #endif
1458
1459 /* PyObjectFastCall.proto */
1460 #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
1461 static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);
1462
1463 /* PyObjectCallNoArg.proto */
1464 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1465
1466 /* PyObjectCallOneArg.proto */
1467 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1468
1469 /* PyObjectGetMethod.proto */
1470 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
1471
1472 /* PyObjectCallMethod0.proto */
1473 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
1474
1475 /* ValidateBasesTuple.proto */
1476 #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
1477 static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
1478 #endif
1479
1480 /* PyType_Ready.proto */
1481 static CYTHON_UNUSED int __Pyx_PyType_Ready(PyTypeObject *t);
1482
1483 /* PyObject_GenericGetAttrNoDict.proto */
1484 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1485 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1486 #else
1487 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1488 #endif
1489
1490 /* PyObject_GenericGetAttr.proto */
1491 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1492 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1493 #else
1494 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1495 #endif
1496
1497 /* SetupReduce.proto */
1498 #if !CYTHON_COMPILING_IN_LIMITED_API
1499 static int __Pyx_setup_reduce(PyObject* type_obj);
1500 #endif
1501
1502 /* FetchSharedCythonModule.proto */
1503 static PyObject *__Pyx_FetchSharedCythonABIModule(void);
1504
1505 /* FetchCommonType.proto */
1506 #if !CYTHON_USE_TYPE_SPECS
1507 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1508 #else
1509 static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
1510 #endif
1511
1512 /* PyMethodNew.proto */
1513 #if PY_MAJOR_VERSION >= 3
1514 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
1515 CYTHON_UNUSED_VAR(typ);
1516 if (!self)
1517 return __Pyx_NewRef(func);
1518 return PyMethod_New(func, self);
1519 }
1520 #else
1521 #define __Pyx_PyMethod_New PyMethod_New
1522 #endif
1523
1524 /* PyVectorcallFastCallDict.proto */
1525 #if CYTHON_METH_FASTCALL
1526 static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
1527 #endif
1528
1529 /* CythonFunctionShared.proto */
1530 #define __Pyx_CyFunction_USED
1531 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1532 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1533 #define __Pyx_CYFUNCTION_CCLASS 0x04
1534 #define __Pyx_CYFUNCTION_COROUTINE 0x08
1535 #define __Pyx_CyFunction_GetClosure(f)\
1536 (((__pyx_CyFunctionObject *) (f))->func_closure)
1537 #if PY_VERSION_HEX < 0x030900B1
1538 #define __Pyx_CyFunction_GetClassObj(f)\
1539 (((__pyx_CyFunctionObject *) (f))->func_classobj)
1540 #else
1541 #define __Pyx_CyFunction_GetClassObj(f)\
1542 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
1543 #endif
1544 #define __Pyx_CyFunction_SetClassObj(f, classobj)\
1545 __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
1546 #define __Pyx_CyFunction_Defaults(type, f)\
1547 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1548 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1549 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1550 typedef struct {
1551 #if PY_VERSION_HEX < 0x030900B1
1552 PyCFunctionObject func;
1553 #else
1554 PyCMethodObject func;
1555 #endif
1556 #if CYTHON_BACKPORT_VECTORCALL
1557 __pyx_vectorcallfunc func_vectorcall;
1558 #endif
1559 #if PY_VERSION_HEX < 0x030500A0
1560 PyObject *func_weakreflist;
1561 #endif
1562 PyObject *func_dict;
1563 PyObject *func_name;
1564 PyObject *func_qualname;
1565 PyObject *func_doc;
1566 PyObject *func_globals;
1567 PyObject *func_code;
1568 PyObject *func_closure;
1569 #if PY_VERSION_HEX < 0x030900B1
1570 PyObject *func_classobj;
1571 #endif
1572 void *defaults;
1573 int defaults_pyobjects;
1574 size_t defaults_size; // used by FusedFunction for copying defaults
1575 int flags;
1576 PyObject *defaults_tuple;
1577 PyObject *defaults_kwdict;
1578 PyObject *(*defaults_getter)(PyObject *);
1579 PyObject *func_annotations;
1580 PyObject *func_is_coroutine;
1581 } __pyx_CyFunctionObject;
1582 #if !CYTHON_USE_MODULE_STATE
1583 static PyTypeObject *__pyx_CyFunctionType = 0;
1584 #endif
1585 #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
1586 #define __Pyx_IsCyOrPyCFunction(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
1587 #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
1588 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
1589 int flags, PyObject* qualname,
1590 PyObject *closure,
1591 PyObject *module, PyObject *globals,
1592 PyObject* code);
1593 static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
1594 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1595 size_t size,
1596 int pyobjects);
1597 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1598 PyObject *tuple);
1599 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1600 PyObject *dict);
1601 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1602 PyObject *dict);
1603 static int __pyx_CyFunction_init(PyObject *module);
1604 #if CYTHON_METH_FASTCALL
1605 static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
1606 static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
1607 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
1608 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
1609 #if CYTHON_BACKPORT_VECTORCALL
1610 #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
1611 #else
1612 #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
1613 #endif
1614 #endif
1615
1616 /* CythonFunction.proto */
1617 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
1618 int flags, PyObject* qualname,
1619 PyObject *closure,
1620 PyObject *module, PyObject *globals,
1621 PyObject* code);
1622
1623 /* RegisterModuleCleanup.proto */
1624 static void __pyx_module_cleanup(PyObject *self);
1625 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
1626 static int __Pyx_RegisterCleanup(void);
1627 #else
1628 #define __Pyx_RegisterCleanup() (0)
1629 #endif
1630
1631 /* PyDictVersioning.proto */
1632 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1633 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1634 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1635 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1636 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1637 (cache_var) = (value);
1638 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1639 static PY_UINT64_T __pyx_dict_version = 0;\
1640 static PyObject *__pyx_dict_cached_value = NULL;\
1641 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1642 (VAR) = __pyx_dict_cached_value;\
1643 } else {\
1644 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1645 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1646 }\
1647 }
1648 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1649 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1650 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1651 #else
1652 #define __PYX_GET_DICT_VERSION(dict) (0)
1653 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1654 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1655 #endif
1656
1657 /* CLineInTraceback.proto */
1658 #ifdef CYTHON_CLINE_IN_TRACEBACK
1659 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1660 #else
1661 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1662 #endif
1663
1664 /* CodeObjectCache.proto */
1665 #if !CYTHON_COMPILING_IN_LIMITED_API
1666 typedef struct {
1667 PyCodeObject* code_object;
1668 int code_line;
1669 } __Pyx_CodeObjectCacheEntry;
1670 struct __Pyx_CodeObjectCache {
1671 int count;
1672 int max_count;
1673 __Pyx_CodeObjectCacheEntry* entries;
1674 };
1675 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1676 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1677 static PyCodeObject *__pyx_find_code_object(int code_line);
1678 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1679 #endif
1680
1681 /* AddTraceback.proto */
1682 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1683 int py_line, const char *filename);
1684
1685 /* GCCDiagnostics.proto */
1686 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1687 #define __Pyx_HAS_GCC_DIAGNOSTIC
1688 #endif
1689
1690 /* CIntFromPy.proto */
1691 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1692
1693 /* FormatTypeName.proto */
1694 #if CYTHON_COMPILING_IN_LIMITED_API
1695 typedef PyObject *__Pyx_TypeName;
1696 #define __Pyx_FMT_TYPENAME "%U"
1697 static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
1698 #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
1699 #else
1700 typedef const char *__Pyx_TypeName;
1701 #define __Pyx_FMT_TYPENAME "%.200s"
1702 #define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
1703 #define __Pyx_DECREF_TypeName(obj)
1704 #endif
1705
1706 /* CIntToPy.proto */
1707 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1708
1709 /* CIntFromPy.proto */
1710 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1711
1712 /* FastTypeChecks.proto */
1713 #if CYTHON_COMPILING_IN_CPYTHON
1714 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1715 #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
1716 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1717 static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
1718 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1719 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1720 #else
1721 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1722 #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
1723 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1724 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1725 #endif
1726 #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_Occurred(), err1, err2)
1727 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1728
1729 /* CheckBinaryVersion.proto */
1730 static int __Pyx_check_binary_version(void);
1731
1732 /* InitStrings.proto */
1733 #if CYTHON_COMPILING_IN_LIMITED_API
1734 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str);
1735 #else
1736 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1737 #endif
1738
1739 /* #### Code section: module_declarations ### */
1740
1741 /* Module declarations from "specmethdocstring" */
1742 #if !CYTHON_USE_MODULE_STATE
1743 static PyTypeObject *__pyx_ptype_17specmethdocstring_C = 0;
1744 #endif
1745 /* #### Code section: typeinfo ### */
1746 /* #### Code section: before_global_var ### */
1747 #define __Pyx_MODULE_NAME "specmethdocstring"
1748 extern int __pyx_module_is_main_specmethdocstring;
1749 int __pyx_module_is_main_specmethdocstring = 0;
1750
1751 /* Implementation of "specmethdocstring" */
1752 /* #### Code section: global_var ### */
1753 static PyObject *__pyx_builtin_TypeError;
1754 /* #### Code section: string_decls ### */
1755 static const char __pyx_k_C[] = "C";
1756 static const char __pyx_k__5[] = "?";
1757 static const char __pyx_k_gc[] = "gc";
1758 static const char __pyx_k_main[] = "__main__";
1759 static const char __pyx_k_name[] = "__name__";
1760 static const char __pyx_k_self[] = "self";
1761 static const char __pyx_k_test[] = "__test__";
1762 static const char __pyx_k_enable[] = "enable";
1763 static const char __pyx_k_reduce[] = "__reduce__";
1764 static const char __pyx_k_disable[] = "disable";
1765 static const char __pyx_k_getstate[] = "__getstate__";
1766 static const char __pyx_k_setstate[] = "__setstate__";
1767 static const char __pyx_k_TypeError[] = "TypeError";
1768 static const char __pyx_k_isenabled[] = "isenabled";
1769 static const char __pyx_k_pyx_state[] = "__pyx_state";
1770 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
1771 static const char __pyx_k_is_coroutine[] = "_is_coroutine";
1772 static const char __pyx_k_stringsource[] = "<stringsource>";
1773 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
1774 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
1775 static const char __pyx_k_C___reduce_cython[] = "C.__reduce_cython__";
1776 static const char __pyx_k_specmethdocstring[] = "specmethdocstring";
1777 static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
1778 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1779 static const char __pyx_k_C___setstate_cython[] = "C.__setstate_cython__";
1780 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
1781 #if !CYTHON_USE_MODULE_STATE
1782 static PyObject *__pyx_n_s_C;
1783 static PyObject *__pyx_n_s_C___reduce_cython;
1784 static PyObject *__pyx_n_s_C___setstate_cython;
1785 static PyObject *__pyx_n_s_TypeError;
1786 static PyObject *__pyx_n_s__5;
1787 static PyObject *__pyx_n_s_asyncio_coroutines;
1788 static PyObject *__pyx_n_s_cline_in_traceback;
1789 static PyObject *__pyx_kp_u_disable;
1790 static PyObject *__pyx_kp_u_enable;
1791 static PyObject *__pyx_kp_u_gc;
1792 static PyObject *__pyx_n_s_getstate;
1793 static PyObject *__pyx_n_s_is_coroutine;
1794 static PyObject *__pyx_kp_u_isenabled;
1795 static PyObject *__pyx_n_s_main;
1796 static PyObject *__pyx_n_s_name;
1797 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
1798 static PyObject *__pyx_n_s_pyx_state;
1799 static PyObject *__pyx_n_s_reduce;
1800 static PyObject *__pyx_n_s_reduce_cython;
1801 static PyObject *__pyx_n_s_reduce_ex;
1802 static PyObject *__pyx_n_s_self;
1803 static PyObject *__pyx_n_s_setstate;
1804 static PyObject *__pyx_n_s_setstate_cython;
1805 static PyObject *__pyx_n_s_specmethdocstring;
1806 static PyObject *__pyx_kp_s_stringsource;
1807 static PyObject *__pyx_n_s_test;
1808 #endif
1809 /* #### Code section: decls ### */
1810 static int __pyx_pf_17specmethdocstring_1C___cinit__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self); /* proto */
1811 static int __pyx_pf_17specmethdocstring_1C_2__init__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self); /* proto */
1812 static void __pyx_pf_17specmethdocstring_1C_4__dealloc__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self); /* proto */
1813 static PyObject *__pyx_pf_17specmethdocstring_1C_6__richcmp__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other, CYTHON_UNUSED int __pyx_v_op); /* proto */
1814 static int __pyx_pf_17specmethdocstring_1C_8__nonzero__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self); /* proto */
1815 static int __pyx_pf_17specmethdocstring_1C_10__contains__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto */
1816 static PyObject *__pyx_pf_17specmethdocstring_1C_3foo___get__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self); /* proto */
1817 static int __pyx_pf_17specmethdocstring_1C_3foo_2__set__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x); /* proto */
1818 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
1819 static PyObject *__pyx_pf_17specmethdocstring_1C_12__div__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto */
1820 #endif
1821 static PyObject *__pyx_pf_17specmethdocstring_1C_14__iter__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self); /* proto */
1822 static PyObject *__pyx_pf_17specmethdocstring_1C_16__next__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self); /* proto */
1823 static PyObject *__pyx_pf_17specmethdocstring_1C_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self); /* proto */
1824 static PyObject *__pyx_pf_17specmethdocstring_1C_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1825 static PyObject *__pyx_tp_new_17specmethdocstring_C(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1826 #if !CYTHON_USE_MODULE_STATE
1827 #endif
1828 #if !CYTHON_USE_MODULE_STATE
1829 static PyObject *__pyx_tuple_;
1830 static PyObject *__pyx_tuple__3;
1831 static PyObject *__pyx_codeobj__2;
1832 static PyObject *__pyx_codeobj__4;
1833 #endif
1834 /* #### Code section: late_includes ### */
1835 /* #### Code section: module_state ### */
1836 #if CYTHON_USE_MODULE_STATE
1837 typedef struct {
1838 PyObject *__pyx_d;
1839 PyObject *__pyx_b;
1840 PyObject *__pyx_cython_runtime;
1841 PyObject *__pyx_empty_tuple;
1842 PyObject *__pyx_empty_bytes;
1843 PyObject *__pyx_empty_unicode;
1844 #ifdef __Pyx_CyFunction_USED
1845 PyTypeObject *__pyx_CyFunctionType;
1846 #endif
1847 #ifdef __Pyx_FusedFunction_USED
1848 PyTypeObject *__pyx_FusedFunctionType;
1849 #endif
1850 PyTypeObject *__pyx_ptype_17specmethdocstring_C;
1851 PyObject *__pyx_type_17specmethdocstring_C;
1852 PyObject *__pyx_n_s_C;
1853 PyObject *__pyx_n_s_C___reduce_cython;
1854 PyObject *__pyx_n_s_C___setstate_cython;
1855 PyObject *__pyx_n_s_TypeError;
1856 PyObject *__pyx_n_s__5;
1857 PyObject *__pyx_n_s_asyncio_coroutines;
1858 PyObject *__pyx_n_s_cline_in_traceback;
1859 PyObject *__pyx_kp_u_disable;
1860 PyObject *__pyx_kp_u_enable;
1861 PyObject *__pyx_kp_u_gc;
1862 PyObject *__pyx_n_s_getstate;
1863 PyObject *__pyx_n_s_is_coroutine;
1864 PyObject *__pyx_kp_u_isenabled;
1865 PyObject *__pyx_n_s_main;
1866 PyObject *__pyx_n_s_name;
1867 PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
1868 PyObject *__pyx_n_s_pyx_state;
1869 PyObject *__pyx_n_s_reduce;
1870 PyObject *__pyx_n_s_reduce_cython;
1871 PyObject *__pyx_n_s_reduce_ex;
1872 PyObject *__pyx_n_s_self;
1873 PyObject *__pyx_n_s_setstate;
1874 PyObject *__pyx_n_s_setstate_cython;
1875 PyObject *__pyx_n_s_specmethdocstring;
1876 PyObject *__pyx_kp_s_stringsource;
1877 PyObject *__pyx_n_s_test;
1878 PyObject *__pyx_tuple_;
1879 PyObject *__pyx_tuple__3;
1880 PyObject *__pyx_codeobj__2;
1881 PyObject *__pyx_codeobj__4;
1882 } __pyx_mstate;
1883
1884 #ifdef __cplusplus
1885 namespace {
1886 extern struct PyModuleDef __pyx_moduledef;
1887 } /* anonymous namespace */
1888 #else
1889 static struct PyModuleDef __pyx_moduledef;
1890 #endif
1891
1892 #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
1893
1894 #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
1895
1896 #define __pyx_m (PyState_FindModule(&__pyx_moduledef))
1897 #endif
1898 /* #### Code section: module_state_clear ### */
1899 #if CYTHON_USE_MODULE_STATE
1900 static int __pyx_m_clear(PyObject *m) {
1901 __pyx_mstate *clear_module_state = __pyx_mstate(m);
1902 if (!clear_module_state) return 0;
1903 Py_CLEAR(clear_module_state->__pyx_d);
1904 Py_CLEAR(clear_module_state->__pyx_b);
1905 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
1906 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
1907 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
1908 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
1909 #ifdef __Pyx_CyFunction_USED
1910 Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
1911 #endif
1912 #ifdef __Pyx_FusedFunction_USED
1913 Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
1914 #endif
1915 Py_CLEAR(clear_module_state->__pyx_ptype_17specmethdocstring_C);
1916 Py_CLEAR(clear_module_state->__pyx_type_17specmethdocstring_C);
1917 Py_CLEAR(clear_module_state->__pyx_n_s_C);
1918 Py_CLEAR(clear_module_state->__pyx_n_s_C___reduce_cython);
1919 Py_CLEAR(clear_module_state->__pyx_n_s_C___setstate_cython);
1920 Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
1921 Py_CLEAR(clear_module_state->__pyx_n_s__5);
1922 Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
1923 Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
1924 Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
1925 Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
1926 Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
1927 Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
1928 Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
1929 Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
1930 Py_CLEAR(clear_module_state->__pyx_n_s_main);
1931 Py_CLEAR(clear_module_state->__pyx_n_s_name);
1932 Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
1933 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
1934 Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
1935 Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
1936 Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
1937 Py_CLEAR(clear_module_state->__pyx_n_s_self);
1938 Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
1939 Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
1940 Py_CLEAR(clear_module_state->__pyx_n_s_specmethdocstring);
1941 Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
1942 Py_CLEAR(clear_module_state->__pyx_n_s_test);
1943 Py_CLEAR(clear_module_state->__pyx_tuple_);
1944 Py_CLEAR(clear_module_state->__pyx_tuple__3);
1945 Py_CLEAR(clear_module_state->__pyx_codeobj__2);
1946 Py_CLEAR(clear_module_state->__pyx_codeobj__4);
1947 return 0;
1948 }
1949 #endif
1950 /* #### Code section: module_state_traverse ### */
1951 #if CYTHON_USE_MODULE_STATE
1952 static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
1953 __pyx_mstate *traverse_module_state = __pyx_mstate(m);
1954 if (!traverse_module_state) return 0;
1955 Py_VISIT(traverse_module_state->__pyx_d);
1956 Py_VISIT(traverse_module_state->__pyx_b);
1957 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
1958 Py_VISIT(traverse_module_state->__pyx_empty_tuple);
1959 Py_VISIT(traverse_module_state->__pyx_empty_bytes);
1960 Py_VISIT(traverse_module_state->__pyx_empty_unicode);
1961 #ifdef __Pyx_CyFunction_USED
1962 Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
1963 #endif
1964 #ifdef __Pyx_FusedFunction_USED
1965 Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
1966 #endif
1967 Py_VISIT(traverse_module_state->__pyx_ptype_17specmethdocstring_C);
1968 Py_VISIT(traverse_module_state->__pyx_type_17specmethdocstring_C);
1969 Py_VISIT(traverse_module_state->__pyx_n_s_C);
1970 Py_VISIT(traverse_module_state->__pyx_n_s_C___reduce_cython);
1971 Py_VISIT(traverse_module_state->__pyx_n_s_C___setstate_cython);
1972 Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
1973 Py_VISIT(traverse_module_state->__pyx_n_s__5);
1974 Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
1975 Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
1976 Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
1977 Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
1978 Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
1979 Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
1980 Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
1981 Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
1982 Py_VISIT(traverse_module_state->__pyx_n_s_main);
1983 Py_VISIT(traverse_module_state->__pyx_n_s_name);
1984 Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
1985 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
1986 Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
1987 Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
1988 Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
1989 Py_VISIT(traverse_module_state->__pyx_n_s_self);
1990 Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
1991 Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
1992 Py_VISIT(traverse_module_state->__pyx_n_s_specmethdocstring);
1993 Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
1994 Py_VISIT(traverse_module_state->__pyx_n_s_test);
1995 Py_VISIT(traverse_module_state->__pyx_tuple_);
1996 Py_VISIT(traverse_module_state->__pyx_tuple__3);
1997 Py_VISIT(traverse_module_state->__pyx_codeobj__2);
1998 Py_VISIT(traverse_module_state->__pyx_codeobj__4);
1999 return 0;
2000 }
2001 #endif
2002 /* #### Code section: module_state_defines ### */
2003 #if CYTHON_USE_MODULE_STATE
2004 #define __pyx_d __pyx_mstate_global->__pyx_d
2005 #define __pyx_b __pyx_mstate_global->__pyx_b
2006 #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
2007 #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
2008 #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
2009 #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
2010 #ifdef __Pyx_CyFunction_USED
2011 #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
2012 #endif
2013 #ifdef __Pyx_FusedFunction_USED
2014 #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
2015 #endif
2016 #define __pyx_ptype_17specmethdocstring_C __pyx_mstate_global->__pyx_ptype_17specmethdocstring_C
2017 #define __pyx_type_17specmethdocstring_C __pyx_mstate_global->__pyx_type_17specmethdocstring_C
2018 #define __pyx_n_s_C __pyx_mstate_global->__pyx_n_s_C
2019 #define __pyx_n_s_C___reduce_cython __pyx_mstate_global->__pyx_n_s_C___reduce_cython
2020 #define __pyx_n_s_C___setstate_cython __pyx_mstate_global->__pyx_n_s_C___setstate_cython
2021 #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
2022 #define __pyx_n_s__5 __pyx_mstate_global->__pyx_n_s__5
2023 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
2024 #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
2025 #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
2026 #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
2027 #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
2028 #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
2029 #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
2030 #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
2031 #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
2032 #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
2033 #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non
2034 #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
2035 #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
2036 #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
2037 #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
2038 #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self
2039 #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
2040 #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
2041 #define __pyx_n_s_specmethdocstring __pyx_mstate_global->__pyx_n_s_specmethdocstring
2042 #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
2043 #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
2044 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_
2045 #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3
2046 #define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2
2047 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4
2048 #endif
2049 /* #### Code section: module_code ### */
2050
2051 /* "specmethdocstring.pyx":4
2052 *
2053 * cdef class C:
2054 * def __cinit__(self): # <<<<<<<<<<<<<<
2055 * "This is an unusable docstring."
2056 * def __init__(self):
2057 */
2058
2059 /* Python wrapper */
2060 static int __pyx_pw_17specmethdocstring_1C_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2061 static int __pyx_pw_17specmethdocstring_1C_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2062 CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
2063 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
2064 int __pyx_r;
2065 __Pyx_RefNannyDeclarations
2066 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
2067 if (unlikely(__pyx_nargs > 0)) {
2068 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
2069 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
2070 __pyx_r = __pyx_pf_17specmethdocstring_1C___cinit__(((struct __pyx_obj_17specmethdocstring_C *)__pyx_v_self));
2071
2072 /* function exit code */
2073 __Pyx_RefNannyFinishContext();
2074 return __pyx_r;
2075 }
2076
2077 static int __pyx_pf_17specmethdocstring_1C___cinit__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self) {
2078 int __pyx_r;
2079 __Pyx_RefNannyDeclarations
2080 __Pyx_RefNannySetupContext("__cinit__", 0);
2081
2082 /* function exit code */
2083 __pyx_r = 0;
2084 __Pyx_RefNannyFinishContext();
2085 return __pyx_r;
2086 }
2087
2088 /* "specmethdocstring.pyx":6
2089 * def __cinit__(self):
2090 * "This is an unusable docstring."
2091 * def __init__(self): # <<<<<<<<<<<<<<
2092 * "This is an unusable docstring."
2093 * def __dealloc__(self):
2094 */
2095
2096 /* Python wrapper */
2097 static int __pyx_pw_17specmethdocstring_1C_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2098 // #if CYTHON_COMPILING_IN_CPYTHON
2099 PyDoc_STRVAR(__pyx_doc_17specmethdocstring_1C_2__init__, "This is an unusable docstring.");
2100 struct wrapperbase __pyx_wrapperbase_17specmethdocstring_1C_2__init__;
2101 // #endif
2102 static int __pyx_pw_17specmethdocstring_1C_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2103 CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
2104 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
2105 int __pyx_r;
2106 __Pyx_RefNannyDeclarations
2107 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2108 if (unlikely(__pyx_nargs > 0)) {
2109 __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1;}
2110 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
2111 __pyx_r = __pyx_pf_17specmethdocstring_1C_2__init__(((struct __pyx_obj_17specmethdocstring_C *)__pyx_v_self));
2112
2113 /* function exit code */
2114 __Pyx_RefNannyFinishContext();
2115 return __pyx_r;
2116 }
2117
2118 static int __pyx_pf_17specmethdocstring_1C_2__init__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self) {
2119 int __pyx_r;
2120 __Pyx_RefNannyDeclarations
2121 __Pyx_RefNannySetupContext("__init__", 0);
2122
2123 /* function exit code */
2124 __pyx_r = 0;
2125 __Pyx_RefNannyFinishContext();
2126 return __pyx_r;
2127 }
2128
2129 /* "specmethdocstring.pyx":8
2130 * def __init__(self):
2131 * "This is an unusable docstring."
2132 * def __dealloc__(self): # <<<<<<<<<<<<<<
2133 * "This is an unusable docstring."
2134 * def __richcmp__(self, other, int op):
2135 */
2136
2137 /* Python wrapper */
2138 static void __pyx_pw_17specmethdocstring_1C_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
2139 static void __pyx_pw_17specmethdocstring_1C_5__dealloc__(PyObject *__pyx_v_self) {
2140 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
2141 __Pyx_RefNannyDeclarations
2142 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
2143 __pyx_pf_17specmethdocstring_1C_4__dealloc__(((struct __pyx_obj_17specmethdocstring_C *)__pyx_v_self));
2144
2145 /* function exit code */
2146 __Pyx_RefNannyFinishContext();
2147 }
2148
2149 static void __pyx_pf_17specmethdocstring_1C_4__dealloc__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self) {
2150 __Pyx_RefNannyDeclarations
2151 __Pyx_RefNannySetupContext("__dealloc__", 0);
2152
2153 /* function exit code */
2154 __Pyx_RefNannyFinishContext();
2155 }
2156
2157 /* "specmethdocstring.pyx":10
2158 * def __dealloc__(self):
2159 * "This is an unusable docstring."
2160 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
2161 * "This is an unusable docstring."
2162 * def __nonzero__(self):
2163 */
2164
2165 /* Python wrapper */
2166 static PyObject *__pyx_pw_17specmethdocstring_1C_7__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
2167 static PyObject *__pyx_pw_17specmethdocstring_1C_7__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
2168 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
2169 PyObject *__pyx_r = 0;
2170 __Pyx_RefNannyDeclarations
2171 __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
2172 __pyx_r = __pyx_pf_17specmethdocstring_1C_6__richcmp__(((struct __pyx_obj_17specmethdocstring_C *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op));
2173
2174 /* function exit code */
2175 __Pyx_RefNannyFinishContext();
2176 return __pyx_r;
2177 }
2178
2179 static PyObject *__pyx_pf_17specmethdocstring_1C_6__richcmp__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other, CYTHON_UNUSED int __pyx_v_op) {
2180 PyObject *__pyx_r = NULL;
2181 __Pyx_RefNannyDeclarations
2182 __Pyx_RefNannySetupContext("__richcmp__", 0);
2183
2184 /* function exit code */
2185 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2186 __Pyx_XGIVEREF(__pyx_r);
2187 __Pyx_RefNannyFinishContext();
2188 return __pyx_r;
2189 }
2190
2191 /* "specmethdocstring.pyx":12
2192 * def __richcmp__(self, other, int op):
2193 * "This is an unusable docstring."
2194 * def __nonzero__(self): # <<<<<<<<<<<<<<
2195 * "This is an unusable docstring."
2196 * return False
2197 */
2198
2199 /* Python wrapper */
2200 static int __pyx_pw_17specmethdocstring_1C_9__nonzero__(PyObject *__pyx_v_self); /*proto*/
2201 static int __pyx_pw_17specmethdocstring_1C_9__nonzero__(PyObject *__pyx_v_self) {
2202 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
2203 int __pyx_r;
2204 __Pyx_RefNannyDeclarations
2205 __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
2206 __pyx_r = __pyx_pf_17specmethdocstring_1C_8__nonzero__(((struct __pyx_obj_17specmethdocstring_C *)__pyx_v_self));
2207
2208 /* function exit code */
2209 __Pyx_RefNannyFinishContext();
2210 return __pyx_r;
2211 }
2212
2213 static int __pyx_pf_17specmethdocstring_1C_8__nonzero__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self) {
2214 int __pyx_r;
2215 __Pyx_RefNannyDeclarations
2216 __Pyx_RefNannySetupContext("__nonzero__", 0);
2217
2218 /* "specmethdocstring.pyx":14
2219 * def __nonzero__(self):
2220 * "This is an unusable docstring."
2221 * return False # <<<<<<<<<<<<<<
2222 * def __contains__(self, other):
2223 * "This is an unusable docstring."
2224 */
2225 __pyx_r = 0;
2226 goto __pyx_L0;
2227
2228 /* "specmethdocstring.pyx":12
2229 * def __richcmp__(self, other, int op):
2230 * "This is an unusable docstring."
2231 * def __nonzero__(self): # <<<<<<<<<<<<<<
2232 * "This is an unusable docstring."
2233 * return False
2234 */
2235
2236 /* function exit code */
2237 __pyx_L0:;
2238 __Pyx_RefNannyFinishContext();
2239 return __pyx_r;
2240 }
2241
2242 /* "specmethdocstring.pyx":15
2243 * "This is an unusable docstring."
2244 * return False
2245 * def __contains__(self, other): # <<<<<<<<<<<<<<
2246 * "This is an unusable docstring."
2247 *
2248 */
2249
2250 /* Python wrapper */
2251 static int __pyx_pw_17specmethdocstring_1C_11__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
2252 // #if CYTHON_COMPILING_IN_CPYTHON
2253 PyDoc_STRVAR(__pyx_doc_17specmethdocstring_1C_10__contains__, "This is an unusable docstring.");
2254 struct wrapperbase __pyx_wrapperbase_17specmethdocstring_1C_10__contains__;
2255 // #endif
2256 static int __pyx_pw_17specmethdocstring_1C_11__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
2257 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
2258 int __pyx_r;
2259 __Pyx_RefNannyDeclarations
2260 __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
2261 __pyx_r = __pyx_pf_17specmethdocstring_1C_10__contains__(((struct __pyx_obj_17specmethdocstring_C *)__pyx_v_self), ((PyObject *)__pyx_v_other));
2262
2263 /* function exit code */
2264 __Pyx_RefNannyFinishContext();
2265 return __pyx_r;
2266 }
2267
2268 static int __pyx_pf_17specmethdocstring_1C_10__contains__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other) {
2269 int __pyx_r;
2270 __Pyx_RefNannyDeclarations
2271 __Pyx_RefNannySetupContext("__contains__", 0);
2272
2273 /* function exit code */
2274 __pyx_r = 0;
2275 __Pyx_RefNannyFinishContext();
2276 return __pyx_r;
2277 }
2278
2279 /* "specmethdocstring.pyx":19
2280 *
2281 * property foo:
2282 * def __get__(self): # <<<<<<<<<<<<<<
2283 * "So is this."
2284 * def __set__(self, x):
2285 */
2286
2287 /* Python wrapper */
2288 static PyObject *__pyx_pw_17specmethdocstring_1C_3foo_1__get__(PyObject *__pyx_v_self); /*proto*/
2289 static PyObject *__pyx_pw_17specmethdocstring_1C_3foo_1__get__(PyObject *__pyx_v_self) {
2290 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
2291 PyObject *__pyx_r = 0;
2292 __Pyx_RefNannyDeclarations
2293 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2294 __pyx_r = __pyx_pf_17specmethdocstring_1C_3foo___get__(((struct __pyx_obj_17specmethdocstring_C *)__pyx_v_self));
2295
2296 /* function exit code */
2297 __Pyx_RefNannyFinishContext();
2298 return __pyx_r;
2299 }
2300
2301 static PyObject *__pyx_pf_17specmethdocstring_1C_3foo___get__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self) {
2302 PyObject *__pyx_r = NULL;
2303 __Pyx_RefNannyDeclarations
2304 __Pyx_RefNannySetupContext("__get__", 0);
2305
2306 /* function exit code */
2307 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2308 __Pyx_XGIVEREF(__pyx_r);
2309 __Pyx_RefNannyFinishContext();
2310 return __pyx_r;
2311 }
2312
2313 /* "specmethdocstring.pyx":21
2314 * def __get__(self):
2315 * "So is this."
2316 * def __set__(self, x): # <<<<<<<<<<<<<<
2317 * "And here is another one."
2318 *
2319 */
2320
2321 /* Python wrapper */
2322 static int __pyx_pw_17specmethdocstring_1C_3foo_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
2323 static int __pyx_pw_17specmethdocstring_1C_3foo_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
2324 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
2325 int __pyx_r;
2326 __Pyx_RefNannyDeclarations
2327 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
2328 __pyx_r = __pyx_pf_17specmethdocstring_1C_3foo_2__set__(((struct __pyx_obj_17specmethdocstring_C *)__pyx_v_self), ((PyObject *)__pyx_v_x));
2329
2330 /* function exit code */
2331 __Pyx_RefNannyFinishContext();
2332 return __pyx_r;
2333 }
2334
2335 static int __pyx_pf_17specmethdocstring_1C_3foo_2__set__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x) {
2336 int __pyx_r;
2337 __Pyx_RefNannyDeclarations
2338 __Pyx_RefNannySetupContext("__set__", 0);
2339
2340 /* function exit code */
2341 __pyx_r = 0;
2342 __Pyx_RefNannyFinishContext();
2343 return __pyx_r;
2344 }
2345
2346 /* "specmethdocstring.pyx":24
2347 * "And here is another one."
2348 *
2349 * def __div__(self, other): # <<<<<<<<<<<<<<
2350 * "usable docstring"
2351 * def __iter__(self):
2352 */
2353
2354 /* Python wrapper */
2355 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2356 static PyObject *__pyx_pw_17specmethdocstring_1C_13__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
2357 // #if CYTHON_COMPILING_IN_CPYTHON
2358 PyDoc_STRVAR(__pyx_doc_17specmethdocstring_1C_12__div__, "usable docstring");
2359 struct wrapperbase __pyx_wrapperbase_17specmethdocstring_1C_12__div__;
2360 // #endif
2361 static PyObject *__pyx_pw_17specmethdocstring_1C_13__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
2362 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
2363 PyObject *__pyx_r = 0;
2364 __Pyx_RefNannyDeclarations
2365 __Pyx_RefNannySetupContext("__div__ (wrapper)", 0);
2366 __pyx_r = __pyx_pf_17specmethdocstring_1C_12__div__(((struct __pyx_obj_17specmethdocstring_C *)__pyx_v_self), ((PyObject *)__pyx_v_other));
2367
2368 /* function exit code */
2369 __Pyx_RefNannyFinishContext();
2370 return __pyx_r;
2371 }
2372 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
2373
2374 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2375 static PyObject *__pyx_pf_17specmethdocstring_1C_12__div__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other) {
2376 PyObject *__pyx_r = NULL;
2377 __Pyx_RefNannyDeclarations
2378 __Pyx_RefNannySetupContext("__div__", 0);
2379
2380 /* function exit code */
2381 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2382 __Pyx_XGIVEREF(__pyx_r);
2383 __Pyx_RefNannyFinishContext();
2384 return __pyx_r;
2385 }
2386 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
2387
2388 /* "specmethdocstring.pyx":26
2389 * def __div__(self, other):
2390 * "usable docstring"
2391 * def __iter__(self): # <<<<<<<<<<<<<<
2392 * "usable docstring"
2393 * return False
2394 */
2395
2396 /* Python wrapper */
2397 static PyObject *__pyx_pw_17specmethdocstring_1C_15__iter__(PyObject *__pyx_v_self); /*proto*/
2398 // #if CYTHON_COMPILING_IN_CPYTHON
2399 PyDoc_STRVAR(__pyx_doc_17specmethdocstring_1C_14__iter__, "usable docstring");
2400 struct wrapperbase __pyx_wrapperbase_17specmethdocstring_1C_14__iter__;
2401 // #endif
2402 static PyObject *__pyx_pw_17specmethdocstring_1C_15__iter__(PyObject *__pyx_v_self) {
2403 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
2404 PyObject *__pyx_r = 0;
2405 __Pyx_RefNannyDeclarations
2406 __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
2407 __pyx_r = __pyx_pf_17specmethdocstring_1C_14__iter__(((struct __pyx_obj_17specmethdocstring_C *)__pyx_v_self));
2408
2409 /* function exit code */
2410 __Pyx_RefNannyFinishContext();
2411 return __pyx_r;
2412 }
2413
2414 static PyObject *__pyx_pf_17specmethdocstring_1C_14__iter__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self) {
2415 PyObject *__pyx_r = NULL;
2416 __Pyx_RefNannyDeclarations
2417 __Pyx_RefNannySetupContext("__iter__", 0);
2418
2419 /* "specmethdocstring.pyx":28
2420 * def __iter__(self):
2421 * "usable docstring"
2422 * return False # <<<<<<<<<<<<<<
2423 * def __next__(self):
2424 * "usable docstring"
2425 */
2426 __Pyx_XDECREF(__pyx_r);
2427 __Pyx_INCREF(Py_False);
2428 __pyx_r = Py_False;
2429 goto __pyx_L0;
2430
2431 /* "specmethdocstring.pyx":26
2432 * def __div__(self, other):
2433 * "usable docstring"
2434 * def __iter__(self): # <<<<<<<<<<<<<<
2435 * "usable docstring"
2436 * return False
2437 */
2438
2439 /* function exit code */
2440 __pyx_L0:;
2441 __Pyx_XGIVEREF(__pyx_r);
2442 __Pyx_RefNannyFinishContext();
2443 return __pyx_r;
2444 }
2445
2446 /* "specmethdocstring.pyx":29
2447 * "usable docstring"
2448 * return False
2449 * def __next__(self): # <<<<<<<<<<<<<<
2450 * "usable docstring"
2451 * return False
2452 */
2453
2454 /* Python wrapper */
2455 static PyObject *__pyx_pw_17specmethdocstring_1C_17__next__(PyObject *__pyx_v_self); /*proto*/
2456 PyDoc_STRVAR(__pyx_doc_17specmethdocstring_1C_16__next__, "__next__($self, /)\n--\n\nusable docstring");
2457 // #if CYTHON_COMPILING_IN_CPYTHON
2458 struct wrapperbase __pyx_wrapperbase_17specmethdocstring_1C_16__next__;
2459 // #endif
2460 static PyObject *__pyx_pw_17specmethdocstring_1C_17__next__(PyObject *__pyx_v_self) {
2461 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
2462 PyObject *__pyx_r = 0;
2463 __Pyx_RefNannyDeclarations
2464 __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
2465 __pyx_r = __pyx_pf_17specmethdocstring_1C_16__next__(((struct __pyx_obj_17specmethdocstring_C *)__pyx_v_self));
2466
2467 /* function exit code */
2468 __Pyx_RefNannyFinishContext();
2469 return __pyx_r;
2470 }
2471
2472 static PyObject *__pyx_pf_17specmethdocstring_1C_16__next__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self) {
2473 PyObject *__pyx_r = NULL;
2474 __Pyx_RefNannyDeclarations
2475 __Pyx_RefNannySetupContext("__next__", 0);
2476
2477 /* "specmethdocstring.pyx":31
2478 * def __next__(self):
2479 * "usable docstring"
2480 * return False # <<<<<<<<<<<<<<
2481 *
2482 */
2483 __Pyx_XDECREF(__pyx_r);
2484 __Pyx_INCREF(Py_False);
2485 __pyx_r = Py_False;
2486 goto __pyx_L0;
2487
2488 /* "specmethdocstring.pyx":29
2489 * "usable docstring"
2490 * return False
2491 * def __next__(self): # <<<<<<<<<<<<<<
2492 * "usable docstring"
2493 * return False
2494 */
2495
2496 /* function exit code */
2497 __pyx_L0:;
2498 __Pyx_XGIVEREF(__pyx_r);
2499 __Pyx_RefNannyFinishContext();
2500 return __pyx_r;
2501 }
2502
2503 /* "(tree fragment)":1
2504 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
2505 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
2506 * def __setstate_cython__(self, __pyx_state):
2507 */
2508
2509 /* Python wrapper */
2510 static PyObject *__pyx_pw_17specmethdocstring_1C_19__reduce_cython__(PyObject *__pyx_v_self,
2511 #if CYTHON_METH_FASTCALL
2512 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
2513 #else
2514 PyObject *__pyx_args, PyObject *__pyx_kwds
2515 #endif
2516 ); /*proto*/
2517 static PyMethodDef __pyx_mdef_17specmethdocstring_1C_19__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17specmethdocstring_1C_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
2518 static PyObject *__pyx_pw_17specmethdocstring_1C_19__reduce_cython__(PyObject *__pyx_v_self,
2519 #if CYTHON_METH_FASTCALL
2520 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
2521 #else
2522 PyObject *__pyx_args, PyObject *__pyx_kwds
2523 #endif
2524 ) {
2525 #if !CYTHON_METH_FASTCALL
2526 CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
2527 #endif
2528 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
2529 PyObject *__pyx_r = 0;
2530 __Pyx_RefNannyDeclarations
2531 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
2532 if (unlikely(__pyx_nargs > 0)) {
2533 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
2534 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
2535 __pyx_r = __pyx_pf_17specmethdocstring_1C_18__reduce_cython__(((struct __pyx_obj_17specmethdocstring_C *)__pyx_v_self));
2536
2537 /* function exit code */
2538 __Pyx_RefNannyFinishContext();
2539 return __pyx_r;
2540 }
2541
2542 static PyObject *__pyx_pf_17specmethdocstring_1C_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self) {
2543 PyObject *__pyx_r = NULL;
2544 __Pyx_RefNannyDeclarations
2545 int __pyx_lineno = 0;
2546 const char *__pyx_filename = NULL;
2547 int __pyx_clineno = 0;
2548 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
2549
2550 /* "(tree fragment)":2
2551 * def __reduce_cython__(self):
2552 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
2553 * def __setstate_cython__(self, __pyx_state):
2554 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
2555 */
2556 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
2557 __PYX_ERR(0, 2, __pyx_L1_error)
2558
2559 /* "(tree fragment)":1
2560 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
2561 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
2562 * def __setstate_cython__(self, __pyx_state):
2563 */
2564
2565 /* function exit code */
2566 __pyx_L1_error:;
2567 __Pyx_AddTraceback("specmethdocstring.C.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2568 __pyx_r = NULL;
2569 __Pyx_XGIVEREF(__pyx_r);
2570 __Pyx_RefNannyFinishContext();
2571 return __pyx_r;
2572 }
2573
2574 /* "(tree fragment)":3
2575 * def __reduce_cython__(self):
2576 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
2577 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
2578 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
2579 */
2580
2581 /* Python wrapper */
2582 static PyObject *__pyx_pw_17specmethdocstring_1C_21__setstate_cython__(PyObject *__pyx_v_self,
2583 #if CYTHON_METH_FASTCALL
2584 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
2585 #else
2586 PyObject *__pyx_args, PyObject *__pyx_kwds
2587 #endif
2588 ); /*proto*/
2589 static PyMethodDef __pyx_mdef_17specmethdocstring_1C_21__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17specmethdocstring_1C_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
2590 static PyObject *__pyx_pw_17specmethdocstring_1C_21__setstate_cython__(PyObject *__pyx_v_self,
2591 #if CYTHON_METH_FASTCALL
2592 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
2593 #else
2594 PyObject *__pyx_args, PyObject *__pyx_kwds
2595 #endif
2596 ) {
2597 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
2598 #if !CYTHON_METH_FASTCALL
2599 CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
2600 #endif
2601 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
2602 int __pyx_lineno = 0;
2603 const char *__pyx_filename = NULL;
2604 int __pyx_clineno = 0;
2605 PyObject *__pyx_r = 0;
2606 __Pyx_RefNannyDeclarations
2607 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
2608 {
2609 #if CYTHON_USE_MODULE_STATE
2610 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
2611 #else
2612 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
2613 #endif
2614 PyObject* values[1] = {0};
2615 if (__pyx_kwds) {
2616 Py_ssize_t kw_args;
2617 switch (__pyx_nargs) {
2618 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
2619 CYTHON_FALLTHROUGH;
2620 case 0: break;
2621 default: goto __pyx_L5_argtuple_error;
2622 }
2623 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
2624 switch (__pyx_nargs) {
2625 case 0:
2626 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--;
2627 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error)
2628 else goto __pyx_L5_argtuple_error;
2629 }
2630 if (unlikely(kw_args > 0)) {
2631 const Py_ssize_t kwd_pos_args = __pyx_nargs;
2632 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 3, __pyx_L3_error)
2633 }
2634 } else if (unlikely(__pyx_nargs != 1)) {
2635 goto __pyx_L5_argtuple_error;
2636 } else {
2637 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
2638 }
2639 __pyx_v___pyx_state = values[0];
2640 }
2641 goto __pyx_L4_argument_unpacking_done;
2642 __pyx_L5_argtuple_error:;
2643 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error)
2644 __pyx_L3_error:;
2645 __Pyx_AddTraceback("specmethdocstring.C.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2646 __Pyx_RefNannyFinishContext();
2647 return NULL;
2648 __pyx_L4_argument_unpacking_done:;
2649 __pyx_r = __pyx_pf_17specmethdocstring_1C_20__setstate_cython__(((struct __pyx_obj_17specmethdocstring_C *)__pyx_v_self), __pyx_v___pyx_state);
2650
2651 /* function exit code */
2652 __Pyx_RefNannyFinishContext();
2653 return __pyx_r;
2654 }
2655
2656 static PyObject *__pyx_pf_17specmethdocstring_1C_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_17specmethdocstring_C *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
2657 PyObject *__pyx_r = NULL;
2658 __Pyx_RefNannyDeclarations
2659 int __pyx_lineno = 0;
2660 const char *__pyx_filename = NULL;
2661 int __pyx_clineno = 0;
2662 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
2663
2664 /* "(tree fragment)":4
2665 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
2666 * def __setstate_cython__(self, __pyx_state):
2667 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
2668 */
2669 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
2670 __PYX_ERR(0, 4, __pyx_L1_error)
2671
2672 /* "(tree fragment)":3
2673 * def __reduce_cython__(self):
2674 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
2675 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
2676 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
2677 */
2678
2679 /* function exit code */
2680 __pyx_L1_error:;
2681 __Pyx_AddTraceback("specmethdocstring.C.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2682 __pyx_r = NULL;
2683 __Pyx_XGIVEREF(__pyx_r);
2684 __Pyx_RefNannyFinishContext();
2685 return __pyx_r;
2686 }
2687
2688 static PyObject *__pyx_tp_new_17specmethdocstring_C(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
2689 PyObject *o;
2690 #if CYTHON_COMPILING_IN_LIMITED_API
2691 allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
2692 o = alloc_func(t, 0);
2693 #else
2694 if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
2695 o = (*t->tp_alloc)(t, 0);
2696 } else {
2697 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
2698 }
2699 if (unlikely(!o)) return 0;
2700 #endif
2701 if (unlikely(__pyx_pw_17specmethdocstring_1C_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
2702 return o;
2703 bad:
2704 Py_DECREF(o); o = 0;
2705 return NULL;
2706 }
2707
2708 static void __pyx_tp_dealloc_17specmethdocstring_C(PyObject *o) {
2709 #if CYTHON_USE_TP_FINALIZE
2710 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
2711 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_17specmethdocstring_C) {
2712 if (PyObject_CallFinalizerFromDealloc(o)) return;
2713 }
2714 }
2715 #endif
2716 {
2717 PyObject *etype, *eval, *etb;
2718 PyErr_Fetch(&etype, &eval, &etb);
2719 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
2720 __pyx_pw_17specmethdocstring_1C_5__dealloc__(o);
2721 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
2722 PyErr_Restore(etype, eval, etb);
2723 }
2724 (*Py_TYPE(o)->tp_free)(o);
2725 }
2726
2727 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2728 static CYTHON_INLINE PyObject *__pyx_nb_divide_17specmethdocstring_C_maybe_call_slot(PyTypeObject* type, PyObject *left, PyObject *right ) {
2729 binaryfunc slot;
2730 #if CYTHON_USE_TYPE_SLOTS || PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
2731 slot = type->tp_as_number ? type->tp_as_number->nb_divide : NULL;
2732 #else
2733 slot = (binaryfunc) PyType_GetSlot(type, Py_nb_divide);
2734 #endif
2735 return slot ? slot(left, right ) : __Pyx_NewRef(Py_NotImplemented);
2736 }
2737 static PyObject *__pyx_nb_divide_17specmethdocstring_C(PyObject *left, PyObject *right ) {
2738 int maybe_self_is_left, maybe_self_is_right = 0;
2739 maybe_self_is_left = Py_TYPE(left) == Py_TYPE(right)
2740 #if CYTHON_USE_TYPE_SLOTS
2741 || (Py_TYPE(left)->tp_as_number && Py_TYPE(left)->tp_as_number->nb_divide == &__pyx_nb_divide_17specmethdocstring_C)
2742 #endif
2743 || __Pyx_TypeCheck(left, __pyx_ptype_17specmethdocstring_C);
2744 if (!(1)) {
2745 maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right)
2746 #if CYTHON_USE_TYPE_SLOTS
2747 || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_divide == &__pyx_nb_divide_17specmethdocstring_C)
2748 #endif
2749 || __Pyx_TypeCheck(right, __pyx_ptype_17specmethdocstring_C);
2750 }
2751 if (maybe_self_is_left) {
2752 PyObject *res;
2753 if (maybe_self_is_right && 0 && !(1)) {
2754 res = __pyx_nb_divide_17specmethdocstring_C_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_17specmethdocstring_C, tp_base, PyTypeObject*), left, right );
2755 if (res != Py_NotImplemented) return res;
2756 Py_DECREF(res);
2757 maybe_self_is_right = 0;
2758 }
2759 res = __pyx_pw_17specmethdocstring_1C_13__div__(left, right);
2760 if (res != Py_NotImplemented) return res;
2761 Py_DECREF(res);
2762 }
2763 if ((1)) {
2764 maybe_self_is_right = Py_TYPE(left) == Py_TYPE(right)
2765 #if CYTHON_USE_TYPE_SLOTS
2766 || (Py_TYPE(right)->tp_as_number && Py_TYPE(right)->tp_as_number->nb_divide == &__pyx_nb_divide_17specmethdocstring_C)
2767 #endif
2768 || PyType_IsSubtype(Py_TYPE(right), __pyx_ptype_17specmethdocstring_C);
2769 }
2770 if (maybe_self_is_right) {
2771 return __pyx_nb_divide_17specmethdocstring_C_maybe_call_slot(__Pyx_PyType_GetSlot(__pyx_ptype_17specmethdocstring_C, tp_base, PyTypeObject*), left, right );
2772 }
2773 return __Pyx_NewRef(Py_NotImplemented);
2774 }
2775
2776
2777 #endif
2778
2779 static PyObject *__pyx_getprop_17specmethdocstring_1C_foo(PyObject *o, CYTHON_UNUSED void *x) {
2780 return __pyx_pw_17specmethdocstring_1C_3foo_1__get__(o);
2781 }
2782
2783 static int __pyx_setprop_17specmethdocstring_1C_foo(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
2784 if (v) {
2785 return __pyx_pw_17specmethdocstring_1C_3foo_3__set__(o, v);
2786 }
2787 else {
2788 PyErr_SetString(PyExc_NotImplementedError, "__del__");
2789 return -1;
2790 }
2791 }
2792
2793 static PyObject *__pyx_specialmethod___pyx_pw_17specmethdocstring_1C_17__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_17specmethdocstring_1C_17__next__(self);}
2794
2795 static PyMethodDef __pyx_methods_17specmethdocstring_C[] = {
2796 {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_17specmethdocstring_1C_17__next__, METH_NOARGS|METH_COEXIST, __pyx_doc_17specmethdocstring_1C_16__next__},
2797 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17specmethdocstring_1C_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
2798 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_17specmethdocstring_1C_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
2799 {0, 0, 0, 0}
2800 };
2801
2802 static struct PyGetSetDef __pyx_getsets_17specmethdocstring_C[] = {
2803 {(char *)"foo", __pyx_getprop_17specmethdocstring_1C_foo, __pyx_setprop_17specmethdocstring_1C_foo, (char *)0, 0},
2804 {0, 0, 0, 0, 0}
2805 };
2806 #if CYTHON_USE_TYPE_SPECS
2807 static PyType_Slot __pyx_type_17specmethdocstring_C_slots[] = {
2808 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_17specmethdocstring_C},
2809 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2810 {Py_nb_divide, (void *)__pyx_nb_divide_17specmethdocstring_C},
2811 #endif
2812 {Py_nb_bool, (void *)__pyx_pw_17specmethdocstring_1C_9__nonzero__},
2813 {Py_sq_contains, (void *)__pyx_pw_17specmethdocstring_1C_11__contains__},
2814 {Py_tp_richcompare, (void *)__pyx_pw_17specmethdocstring_1C_7__richcmp__},
2815 {Py_tp_iter, (void *)__pyx_pw_17specmethdocstring_1C_15__iter__},
2816 {Py_tp_iternext, (void *)__pyx_pw_17specmethdocstring_1C_17__next__},
2817 {Py_tp_methods, (void *)__pyx_methods_17specmethdocstring_C},
2818 {Py_tp_getset, (void *)__pyx_getsets_17specmethdocstring_C},
2819 {Py_tp_init, (void *)__pyx_pw_17specmethdocstring_1C_3__init__},
2820 {Py_tp_new, (void *)__pyx_tp_new_17specmethdocstring_C},
2821 {0, 0},
2822 };
2823 static PyType_Spec __pyx_type_17specmethdocstring_C_spec = {
2824 "specmethdocstring.C",
2825 sizeof(struct __pyx_obj_17specmethdocstring_C),
2826 0,
2827 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
2828 __pyx_type_17specmethdocstring_C_slots,
2829 };
2830 #else
2831
2832 static PyNumberMethods __pyx_tp_as_number_C = {
2833 0, /*nb_add*/
2834 0, /*nb_subtract*/
2835 0, /*nb_multiply*/
2836 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2837 __pyx_nb_divide_17specmethdocstring_C, /*nb_divide*/
2838 #endif
2839 0, /*nb_remainder*/
2840 0, /*nb_divmod*/
2841 0, /*nb_power*/
2842 0, /*nb_negative*/
2843 0, /*nb_positive*/
2844 0, /*nb_absolute*/
2845 __pyx_pw_17specmethdocstring_1C_9__nonzero__, /*nb_bool*/
2846 0, /*nb_invert*/
2847 0, /*nb_lshift*/
2848 0, /*nb_rshift*/
2849 0, /*nb_and*/
2850 0, /*nb_xor*/
2851 0, /*nb_or*/
2852 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2853 0, /*nb_coerce*/
2854 #endif
2855 0, /*nb_int*/
2856 #if PY_MAJOR_VERSION < 3
2857 0, /*nb_long*/
2858 #else
2859 0, /*reserved*/
2860 #endif
2861 0, /*nb_float*/
2862 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2863 0, /*nb_oct*/
2864 #endif
2865 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2866 0, /*nb_hex*/
2867 #endif
2868 0, /*nb_inplace_add*/
2869 0, /*nb_inplace_subtract*/
2870 0, /*nb_inplace_multiply*/
2871 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2872 0, /*nb_inplace_divide*/
2873 #endif
2874 0, /*nb_inplace_remainder*/
2875 0, /*nb_inplace_power*/
2876 0, /*nb_inplace_lshift*/
2877 0, /*nb_inplace_rshift*/
2878 0, /*nb_inplace_and*/
2879 0, /*nb_inplace_xor*/
2880 0, /*nb_inplace_or*/
2881 0, /*nb_floor_divide*/
2882 0, /*nb_true_divide*/
2883 0, /*nb_inplace_floor_divide*/
2884 0, /*nb_inplace_true_divide*/
2885 0, /*nb_index*/
2886 #if PY_VERSION_HEX >= 0x03050000
2887 0, /*nb_matrix_multiply*/
2888 #endif
2889 #if PY_VERSION_HEX >= 0x03050000
2890 0, /*nb_inplace_matrix_multiply*/
2891 #endif
2892 };
2893
2894 static PySequenceMethods __pyx_tp_as_sequence_C = {
2895 0, /*sq_length*/
2896 0, /*sq_concat*/
2897 0, /*sq_repeat*/
2898 0, /*sq_item*/
2899 0, /*sq_slice*/
2900 0, /*sq_ass_item*/
2901 0, /*sq_ass_slice*/
2902 __pyx_pw_17specmethdocstring_1C_11__contains__, /*sq_contains*/
2903 0, /*sq_inplace_concat*/
2904 0, /*sq_inplace_repeat*/
2905 };
2906
2907 static PyTypeObject __pyx_type_17specmethdocstring_C = {
2908 PyVarObject_HEAD_INIT(0, 0)
2909 "specmethdocstring.""C", /*tp_name*/
2910 sizeof(struct __pyx_obj_17specmethdocstring_C), /*tp_basicsize*/
2911 0, /*tp_itemsize*/
2912 __pyx_tp_dealloc_17specmethdocstring_C, /*tp_dealloc*/
2913 #if PY_VERSION_HEX < 0x030800b4
2914 0, /*tp_print*/
2915 #endif
2916 #if PY_VERSION_HEX >= 0x030800b4
2917 0, /*tp_vectorcall_offset*/
2918 #endif
2919 0, /*tp_getattr*/
2920 0, /*tp_setattr*/
2921 #if PY_MAJOR_VERSION < 3
2922 0, /*tp_compare*/
2923 #endif
2924 #if PY_MAJOR_VERSION >= 3
2925 0, /*tp_as_async*/
2926 #endif
2927 0, /*tp_repr*/
2928 &__pyx_tp_as_number_C, /*tp_as_number*/
2929 &__pyx_tp_as_sequence_C, /*tp_as_sequence*/
2930 0, /*tp_as_mapping*/
2931 0, /*tp_hash*/
2932 0, /*tp_call*/
2933 0, /*tp_str*/
2934 0, /*tp_getattro*/
2935 0, /*tp_setattro*/
2936 0, /*tp_as_buffer*/
2937 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
2938 0, /*tp_doc*/
2939 0, /*tp_traverse*/
2940 0, /*tp_clear*/
2941 __pyx_pw_17specmethdocstring_1C_7__richcmp__, /*tp_richcompare*/
2942 0, /*tp_weaklistoffset*/
2943 __pyx_pw_17specmethdocstring_1C_15__iter__, /*tp_iter*/
2944 __pyx_pw_17specmethdocstring_1C_17__next__, /*tp_iternext*/
2945 __pyx_methods_17specmethdocstring_C, /*tp_methods*/
2946 0, /*tp_members*/
2947 __pyx_getsets_17specmethdocstring_C, /*tp_getset*/
2948 0, /*tp_base*/
2949 0, /*tp_dict*/
2950 0, /*tp_descr_get*/
2951 0, /*tp_descr_set*/
2952 #if !CYTHON_USE_TYPE_SPECS
2953 0, /*tp_dictoffset*/
2954 #endif
2955 __pyx_pw_17specmethdocstring_1C_3__init__, /*tp_init*/
2956 0, /*tp_alloc*/
2957 __pyx_tp_new_17specmethdocstring_C, /*tp_new*/
2958 0, /*tp_free*/
2959 0, /*tp_is_gc*/
2960 0, /*tp_bases*/
2961 0, /*tp_mro*/
2962 0, /*tp_cache*/
2963 0, /*tp_subclasses*/
2964 0, /*tp_weaklist*/
2965 0, /*tp_del*/
2966 0, /*tp_version_tag*/
2967 #if PY_VERSION_HEX >= 0x030400a1
2968 #if CYTHON_USE_TP_FINALIZE
2969 0, /*tp_finalize*/
2970 #else
2971 NULL, /*tp_finalize*/
2972 #endif
2973 #endif
2974 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
2975 0, /*tp_vectorcall*/
2976 #endif
2977 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
2978 0, /*tp_print*/
2979 #endif
2980 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
2981 0, /*tp_pypy_flags*/
2982 #endif
2983 };
2984 #endif
2985
2986 static PyMethodDef __pyx_methods[] = {
2987 {0, 0, 0, 0}
2988 };
2989 #ifndef CYTHON_SMALL_CODE
2990 #if defined(__clang__)
2991 #define CYTHON_SMALL_CODE
2992 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
2993 #define CYTHON_SMALL_CODE __attribute__((cold))
2994 #else
2995 #define CYTHON_SMALL_CODE
2996 #endif
2997 #endif
2998 /* #### Code section: pystring_table ### */
2999
3000 static __Pyx_StringTabEntry __pyx_string_tab[] = {
3001 #if CYTHON_USE_MODULE_STATE
3002 {0, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
3003 {0, __pyx_k_C___reduce_cython, sizeof(__pyx_k_C___reduce_cython), 0, 0, 1, 1},
3004 {0, __pyx_k_C___setstate_cython, sizeof(__pyx_k_C___setstate_cython), 0, 0, 1, 1},
3005 {0, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
3006 {0, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 1},
3007 {0, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
3008 {0, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
3009 {0, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
3010 {0, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
3011 {0, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
3012 {0, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
3013 {0, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
3014 {0, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
3015 {0, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
3016 {0, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
3017 {0, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
3018 {0, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
3019 {0, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
3020 {0, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
3021 {0, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
3022 {0, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
3023 {0, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
3024 {0, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
3025 {0, __pyx_k_specmethdocstring, sizeof(__pyx_k_specmethdocstring), 0, 0, 1, 1},
3026 {0, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
3027 {0, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
3028 #else
3029 {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
3030 {&__pyx_n_s_C___reduce_cython, __pyx_k_C___reduce_cython, sizeof(__pyx_k_C___reduce_cython), 0, 0, 1, 1},
3031 {&__pyx_n_s_C___setstate_cython, __pyx_k_C___setstate_cython, sizeof(__pyx_k_C___setstate_cython), 0, 0, 1, 1},
3032 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
3033 {&__pyx_n_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 1},
3034 {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
3035 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
3036 {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
3037 {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
3038 {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
3039 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
3040 {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
3041 {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
3042 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
3043 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
3044 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
3045 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
3046 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
3047 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
3048 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
3049 {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
3050 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
3051 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
3052 {&__pyx_n_s_specmethdocstring, __pyx_k_specmethdocstring, sizeof(__pyx_k_specmethdocstring), 0, 0, 1, 1},
3053 {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
3054 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
3055 #endif
3056 {0, 0, 0, 0, 0, 0, 0}
3057 };
3058 /* #### Code section: cached_builtins ### */
3059 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
3060 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
3061 return 0;
3062 __pyx_L1_error:;
3063 return -1;
3064 }
3065 /* #### Code section: cached_constants ### */
3066
3067 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
3068 __Pyx_RefNannyDeclarations
3069 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
3070
3071 /* "(tree fragment)":1
3072 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3073 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
3074 * def __setstate_cython__(self, __pyx_state):
3075 */
3076 __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 1, __pyx_L1_error)
3077 __Pyx_GOTREF(__pyx_tuple_);
3078 __Pyx_GIVEREF(__pyx_tuple_);
3079 __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 1, __pyx_L1_error)
3080
3081 /* "(tree fragment)":3
3082 * def __reduce_cython__(self):
3083 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
3084 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3085 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
3086 */
3087 __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 3, __pyx_L1_error)
3088 __Pyx_GOTREF(__pyx_tuple__3);
3089 __Pyx_GIVEREF(__pyx_tuple__3);
3090 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 3, __pyx_L1_error)
3091 __Pyx_RefNannyFinishContext();
3092 return 0;
3093 __pyx_L1_error:;
3094 __Pyx_RefNannyFinishContext();
3095 return -1;
3096 }
3097 /* #### Code section: init_constants ### */
3098
3099 static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
3100 #if CYTHON_USE_MODULE_STATE
3101 if (__Pyx_InitString(__pyx_string_tab[0], &__pyx_n_s_C) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3102 if (__Pyx_InitString(__pyx_string_tab[1], &__pyx_n_s_C___reduce_cython) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3103 if (__Pyx_InitString(__pyx_string_tab[2], &__pyx_n_s_C___setstate_cython) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3104 if (__Pyx_InitString(__pyx_string_tab[3], &__pyx_n_s_TypeError) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3105 if (__Pyx_InitString(__pyx_string_tab[4], &__pyx_n_s__5) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3106 if (__Pyx_InitString(__pyx_string_tab[5], &__pyx_n_s_asyncio_coroutines) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3107 if (__Pyx_InitString(__pyx_string_tab[6], &__pyx_n_s_cline_in_traceback) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3108 if (__Pyx_InitString(__pyx_string_tab[7], &__pyx_kp_u_disable) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3109 if (__Pyx_InitString(__pyx_string_tab[8], &__pyx_kp_u_enable) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3110 if (__Pyx_InitString(__pyx_string_tab[9], &__pyx_kp_u_gc) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3111 if (__Pyx_InitString(__pyx_string_tab[10], &__pyx_n_s_getstate) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3112 if (__Pyx_InitString(__pyx_string_tab[11], &__pyx_n_s_is_coroutine) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3113 if (__Pyx_InitString(__pyx_string_tab[12], &__pyx_kp_u_isenabled) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3114 if (__Pyx_InitString(__pyx_string_tab[13], &__pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3115 if (__Pyx_InitString(__pyx_string_tab[14], &__pyx_n_s_name) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3116 if (__Pyx_InitString(__pyx_string_tab[15], &__pyx_kp_s_no_default___reduce___due_to_non) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3117 if (__Pyx_InitString(__pyx_string_tab[16], &__pyx_n_s_pyx_state) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3118 if (__Pyx_InitString(__pyx_string_tab[17], &__pyx_n_s_reduce) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3119 if (__Pyx_InitString(__pyx_string_tab[18], &__pyx_n_s_reduce_cython) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3120 if (__Pyx_InitString(__pyx_string_tab[19], &__pyx_n_s_reduce_ex) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3121 if (__Pyx_InitString(__pyx_string_tab[20], &__pyx_n_s_self) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3122 if (__Pyx_InitString(__pyx_string_tab[21], &__pyx_n_s_setstate) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3123 if (__Pyx_InitString(__pyx_string_tab[22], &__pyx_n_s_setstate_cython) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3124 if (__Pyx_InitString(__pyx_string_tab[23], &__pyx_n_s_specmethdocstring) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3125 if (__Pyx_InitString(__pyx_string_tab[24], &__pyx_kp_s_stringsource) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3126 if (__Pyx_InitString(__pyx_string_tab[25], &__pyx_n_s_test) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3127 #endif
3128 #if !CYTHON_USE_MODULE_STATE
3129 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3130 #endif
3131 return 0;
3132 __pyx_L1_error:;
3133 return -1;
3134 }
3135 /* #### Code section: init_globals ### */
3136
3137 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
3138 return 0;
3139 }
3140 /* #### Code section: init_module ### */
3141
3142 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
3143 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
3144 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
3145 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
3146 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
3147 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
3148 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
3149
3150 static int __Pyx_modinit_global_init_code(void) {
3151 __Pyx_RefNannyDeclarations
3152 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
3153 /*--- Global init code ---*/
3154 __Pyx_RefNannyFinishContext();
3155 return 0;
3156 }
3157
3158 static int __Pyx_modinit_variable_export_code(void) {
3159 __Pyx_RefNannyDeclarations
3160 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
3161 /*--- Variable export code ---*/
3162 __Pyx_RefNannyFinishContext();
3163 return 0;
3164 }
3165
3166 static int __Pyx_modinit_function_export_code(void) {
3167 __Pyx_RefNannyDeclarations
3168 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
3169 /*--- Function export code ---*/
3170 __Pyx_RefNannyFinishContext();
3171 return 0;
3172 }
3173
3174 static int __Pyx_modinit_type_init_code(void) {
3175 __Pyx_RefNannyDeclarations
3176 int __pyx_lineno = 0;
3177 const char *__pyx_filename = NULL;
3178 int __pyx_clineno = 0;
3179 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
3180 /*--- Type init code ---*/
3181 #if CYTHON_USE_TYPE_SPECS
3182 __pyx_ptype_17specmethdocstring_C = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_17specmethdocstring_C_spec, NULL); if (unlikely(!__pyx_ptype_17specmethdocstring_C)) __PYX_ERR(1, 3, __pyx_L1_error)
3183 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_17specmethdocstring_C_spec, __pyx_ptype_17specmethdocstring_C) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
3184 #else
3185 __pyx_ptype_17specmethdocstring_C = &__pyx_type_17specmethdocstring_C;
3186 #endif
3187 #if !CYTHON_COMPILING_IN_LIMITED_API
3188 #endif
3189 #if !CYTHON_USE_TYPE_SPECS
3190 if (__Pyx_PyType_Ready(__pyx_ptype_17specmethdocstring_C) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
3191 #endif
3192 #if PY_MAJOR_VERSION < 3
3193 __pyx_ptype_17specmethdocstring_C->tp_print = 0;
3194 #endif
3195 #if !CYTHON_COMPILING_IN_LIMITED_API
3196 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_17specmethdocstring_C->tp_dictoffset && __pyx_ptype_17specmethdocstring_C->tp_getattro == PyObject_GenericGetAttr)) {
3197 __pyx_ptype_17specmethdocstring_C->tp_getattro = __Pyx_PyObject_GenericGetAttr;
3198 }
3199 #endif
3200 // #if CYTHON_COMPILING_IN_CPYTHON
3201 {
3202 PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_17specmethdocstring_C, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 3, __pyx_L1_error)
3203 if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
3204 __pyx_wrapperbase_17specmethdocstring_1C_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
3205 __pyx_wrapperbase_17specmethdocstring_1C_2__init__.doc = __pyx_doc_17specmethdocstring_1C_2__init__;
3206 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_17specmethdocstring_1C_2__init__;
3207 }
3208 }
3209 // #endif
3210 // #if CYTHON_COMPILING_IN_CPYTHON
3211 {
3212 PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_17specmethdocstring_C, "__contains__"); if (unlikely(!wrapper)) __PYX_ERR(1, 3, __pyx_L1_error)
3213 if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
3214 __pyx_wrapperbase_17specmethdocstring_1C_10__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
3215 __pyx_wrapperbase_17specmethdocstring_1C_10__contains__.doc = __pyx_doc_17specmethdocstring_1C_10__contains__;
3216 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_17specmethdocstring_1C_10__contains__;
3217 }
3218 }
3219 // #endif
3220 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
3221 // #if CYTHON_COMPILING_IN_CPYTHON
3222 {
3223 PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_17specmethdocstring_C, "__div__"); if (unlikely(!wrapper)) __PYX_ERR(1, 3, __pyx_L1_error)
3224 if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
3225 __pyx_wrapperbase_17specmethdocstring_1C_12__div__ = *((PyWrapperDescrObject *)wrapper)->d_base;
3226 __pyx_wrapperbase_17specmethdocstring_1C_12__div__.doc = __pyx_doc_17specmethdocstring_1C_12__div__;
3227 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_17specmethdocstring_1C_12__div__;
3228 }
3229 }
3230 // #endif
3231 #endif
3232 // #if CYTHON_COMPILING_IN_CPYTHON
3233 {
3234 PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_17specmethdocstring_C, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(1, 3, __pyx_L1_error)
3235 if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
3236 __pyx_wrapperbase_17specmethdocstring_1C_14__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
3237 __pyx_wrapperbase_17specmethdocstring_1C_14__iter__.doc = __pyx_doc_17specmethdocstring_1C_14__iter__;
3238 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_17specmethdocstring_1C_14__iter__;
3239 }
3240 }
3241 // #endif
3242 // #if CYTHON_COMPILING_IN_CPYTHON
3243 {
3244 PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_17specmethdocstring_C, "__next__"); if (unlikely(!wrapper)) __PYX_ERR(1, 3, __pyx_L1_error)
3245 if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
3246 __pyx_wrapperbase_17specmethdocstring_1C_16__next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
3247 __pyx_wrapperbase_17specmethdocstring_1C_16__next__.doc = __pyx_doc_17specmethdocstring_1C_16__next__;
3248 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_17specmethdocstring_1C_16__next__;
3249 }
3250 }
3251 // #endif
3252 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_C, (PyObject *) __pyx_ptype_17specmethdocstring_C) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
3253 // #if !CYTHON_COMPILING_IN_LIMITED_API
3254 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_17specmethdocstring_C) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
3255 // #endif
3256 __Pyx_RefNannyFinishContext();
3257 return 0;
3258 __pyx_L1_error:;
3259 __Pyx_RefNannyFinishContext();
3260 return -1;
3261 }
3262
3263 static int __Pyx_modinit_type_import_code(void) {
3264 __Pyx_RefNannyDeclarations
3265 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
3266 /*--- Type import code ---*/
3267 __Pyx_RefNannyFinishContext();
3268 return 0;
3269 }
3270
3271 static int __Pyx_modinit_variable_import_code(void) {
3272 __Pyx_RefNannyDeclarations
3273 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
3274 /*--- Variable import code ---*/
3275 __Pyx_RefNannyFinishContext();
3276 return 0;
3277 }
3278
3279 static int __Pyx_modinit_function_import_code(void) {
3280 __Pyx_RefNannyDeclarations
3281 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
3282 /*--- Function import code ---*/
3283 __Pyx_RefNannyFinishContext();
3284 return 0;
3285 }
3286
3287
3288 #if PY_MAJOR_VERSION >= 3
3289 #if CYTHON_PEP489_MULTI_PHASE_INIT
3290 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
3291 static int __pyx_pymod_exec_specmethdocstring(PyObject* module); /*proto*/
3292 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
3293 {Py_mod_create, (void*)__pyx_pymod_create},
3294 {Py_mod_exec, (void*)__pyx_pymod_exec_specmethdocstring},
3295 {0, NULL}
3296 };
3297 #endif
3298
3299 #ifdef __cplusplus
3300 namespace {
3301 struct PyModuleDef __pyx_moduledef =
3302 #else
3303 static struct PyModuleDef __pyx_moduledef =
3304 #endif
3305 {
3306 PyModuleDef_HEAD_INIT,
3307 "specmethdocstring",
3308 0, /* m_doc */
3309 #if CYTHON_PEP489_MULTI_PHASE_INIT
3310 0, /* m_size */
3311 #elif CYTHON_USE_MODULE_STATE
3312 sizeof(__pyx_mstate), /* m_size */
3313 #else
3314 -1, /* m_size */
3315 #endif
3316 __pyx_methods /* m_methods */,
3317 #if CYTHON_PEP489_MULTI_PHASE_INIT
3318 __pyx_moduledef_slots, /* m_slots */
3319 #else
3320 NULL, /* m_reload */
3321 #endif
3322 #if CYTHON_USE_MODULE_STATE
3323 __pyx_m_traverse, /* m_traverse */
3324 __pyx_m_clear, /* m_clear */
3325 (freefunc)__pyx_module_cleanup /* m_free */
3326 #else
3327 NULL, /* m_traverse */
3328 NULL, /* m_clear */
3329 (freefunc)__pyx_module_cleanup /* m_free */
3330 #endif
3331 };
3332 #ifdef __cplusplus
3333 } /* anonymous namespace */
3334 #endif
3335 #endif
3336
3337 #ifndef CYTHON_NO_PYINIT_EXPORT
3338 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
3339 #elif PY_MAJOR_VERSION < 3
3340 #ifdef __cplusplus
3341 #define __Pyx_PyMODINIT_FUNC extern "C" void
3342 #else
3343 #define __Pyx_PyMODINIT_FUNC void
3344 #endif
3345 #else
3346 #ifdef __cplusplus
3347 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
3348 #else
3349 #define __Pyx_PyMODINIT_FUNC PyObject *
3350 #endif
3351 #endif
3352
3353
3354 #if PY_MAJOR_VERSION < 3
3355 __Pyx_PyMODINIT_FUNC initspecmethdocstring(void) CYTHON_SMALL_CODE; /*proto*/
3356 __Pyx_PyMODINIT_FUNC initspecmethdocstring(void)
3357 #else
3358 __Pyx_PyMODINIT_FUNC PyInit_specmethdocstring(void) CYTHON_SMALL_CODE; /*proto*/
3359 __Pyx_PyMODINIT_FUNC PyInit_specmethdocstring(void)
3360 #if CYTHON_PEP489_MULTI_PHASE_INIT
3361 {
3362 return PyModuleDef_Init(&__pyx_moduledef);
3363 }
3364 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
3365 #if PY_VERSION_HEX >= 0x030700A1
3366 static PY_INT64_T main_interpreter_id = -1;
3367 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
3368 if (main_interpreter_id == -1) {
3369 main_interpreter_id = current_id;
3370 return (unlikely(current_id == -1)) ? -1 : 0;
3371 } else if (unlikely(main_interpreter_id != current_id))
3372 #else
3373 static PyInterpreterState *main_interpreter = NULL;
3374 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
3375 if (!main_interpreter) {
3376 main_interpreter = current_interpreter;
3377 } else if (unlikely(main_interpreter != current_interpreter))
3378 #endif
3379 {
3380 PyErr_SetString(
3381 PyExc_ImportError,
3382 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
3383 return -1;
3384 }
3385 return 0;
3386 }
3387 #if CYTHON_COMPILING_IN_LIMITED_API
3388 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
3389 #else
3390 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)
3391 #endif
3392 {
3393 PyObject *value = PyObject_GetAttrString(spec, from_name);
3394 int result = 0;
3395 if (likely(value)) {
3396 if (allow_none || value != Py_None) {
3397 #if CYTHON_COMPILING_IN_LIMITED_API
3398 result = PyModule_AddObject(module, to_name, value);
3399 #else
3400 result = PyDict_SetItemString(moddict, to_name, value);
3401 #endif
3402 }
3403 Py_DECREF(value);
3404 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
3405 PyErr_Clear();
3406 } else {
3407 result = -1;
3408 }
3409 return result;
3410 }
3411 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
3412 PyObject *module = NULL, *moddict, *modname;
3413 CYTHON_UNUSED_VAR(def);
3414 if (__Pyx_check_single_interpreter())
3415 return NULL;
3416 if (__pyx_m)
3417 return __Pyx_NewRef(__pyx_m);
3418 modname = PyObject_GetAttrString(spec, "name");
3419 if (unlikely(!modname)) goto bad;
3420 module = PyModule_NewObject(modname);
3421 Py_DECREF(modname);
3422 if (unlikely(!module)) goto bad;
3423 #if CYTHON_COMPILING_IN_LIMITED_API
3424 moddict = module;
3425 #else
3426 moddict = PyModule_GetDict(module);
3427 if (unlikely(!moddict)) goto bad;
3428 #endif
3429 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
3430 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
3431 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
3432 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
3433 return module;
3434 bad:
3435 Py_XDECREF(module);
3436 return NULL;
3437 }
3438
3439
3440 static CYTHON_SMALL_CODE int __pyx_pymod_exec_specmethdocstring(PyObject *__pyx_pyinit_module)
3441 #endif
3442 #endif
3443 {
3444 int stringtab_initialized = 0;
3445 PyObject *__pyx_t_1 = NULL;
3446 PyObject *__pyx_t_2 = NULL;
3447 int __pyx_lineno = 0;
3448 const char *__pyx_filename = NULL;
3449 int __pyx_clineno = 0;
3450 __Pyx_RefNannyDeclarations
3451 #if CYTHON_PEP489_MULTI_PHASE_INIT
3452 if (__pyx_m) {
3453 if (__pyx_m == __pyx_pyinit_module) return 0;
3454 PyErr_SetString(PyExc_RuntimeError, "Module 'specmethdocstring' has already been imported. Re-initialisation is not supported.");
3455 return -1;
3456 }
3457 #elif PY_MAJOR_VERSION >= 3
3458 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
3459 #endif
3460 /*--- Module creation code ---*/
3461 #if CYTHON_PEP489_MULTI_PHASE_INIT
3462 __pyx_m = __pyx_pyinit_module;
3463 Py_INCREF(__pyx_m);
3464 #else
3465 #if PY_MAJOR_VERSION < 3
3466 __pyx_m = Py_InitModule4("specmethdocstring", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
3467 if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
3468 #elif CYTHON_COMPILING_IN_LIMITED_API
3469 /* __pyx_t_1 allocated (Python object) */
3470 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
3471 {
3472 int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
3473 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3474 if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error)
3475 }
3476 /* __pyx_t_1 released */
3477 #else
3478 __pyx_m = PyModule_Create(&__pyx_moduledef);
3479 if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
3480 #endif
3481 #endif
3482 CYTHON_UNUSED_VAR(__pyx_t_1);
3483 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
3484 Py_INCREF(__pyx_d);
3485 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
3486 Py_INCREF(__pyx_b);
3487 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
3488 Py_INCREF(__pyx_cython_runtime);
3489 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
3490 #if CYTHON_REFNANNY
3491 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
3492 if (!__Pyx_RefNanny) {
3493 PyErr_Clear();
3494 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
3495 if (!__Pyx_RefNanny)
3496 Py_FatalError("failed to import 'refnanny' module");
3497 }
3498 #endif
3499 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_specmethdocstring(void)", 0);
3500 if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3501 #ifdef __Pxy_PyFrame_Initialize_Offsets
3502 __Pxy_PyFrame_Initialize_Offsets();
3503 #endif
3504 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
3505 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
3506 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
3507 #ifdef __Pyx_CyFunction_USED
3508 if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3509 #endif
3510 #ifdef __Pyx_FusedFunction_USED
3511 if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3512 #endif
3513 #ifdef __Pyx_Coroutine_USED
3514 if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3515 #endif
3516 #ifdef __Pyx_Generator_USED
3517 if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3518 #endif
3519 #ifdef __Pyx_AsyncGen_USED
3520 if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3521 #endif
3522 #ifdef __Pyx_StopAsyncIteration_USED
3523 if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3524 #endif
3525 /*--- Library function declarations ---*/
3526 /*--- Threads initialization code ---*/
3527 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
3528 PyEval_InitThreads();
3529 #endif
3530 /*--- Initialize various global constants etc. ---*/
3531 if (__Pyx_InitConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3532 stringtab_initialized = 1;
3533 if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3534 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
3535 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3536 #endif
3537 if (__pyx_module_is_main_specmethdocstring) {
3538 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3539 }
3540 #if PY_MAJOR_VERSION >= 3
3541 {
3542 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
3543 if (!PyDict_GetItemString(modules, "specmethdocstring")) {
3544 if (unlikely((PyDict_SetItemString(modules, "specmethdocstring", __pyx_m) < 0))) __PYX_ERR(1, 1, __pyx_L1_error)
3545 }
3546 }
3547 #endif
3548 /*--- Builtin init code ---*/
3549 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3550 /*--- Constants init code ---*/
3551 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3552 /*--- Global type/function init code ---*/
3553 (void)__Pyx_modinit_global_init_code();
3554 (void)__Pyx_modinit_variable_export_code();
3555 (void)__Pyx_modinit_function_export_code();
3556 if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error)
3557 (void)__Pyx_modinit_type_import_code();
3558 (void)__Pyx_modinit_variable_import_code();
3559 (void)__Pyx_modinit_function_import_code();
3560 /*--- Execution code ---*/
3561 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
3562 if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3563 #endif
3564
3565 /* "(tree fragment)":1
3566 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3567 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
3568 * def __setstate_cython__(self, __pyx_state):
3569 */
3570 /* __pyx_t_2 allocated (Python object) */
3571 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_17specmethdocstring_1C_19__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C___reduce_cython, NULL, __pyx_n_s_specmethdocstring, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
3572 __Pyx_GOTREF(__pyx_t_2);
3573 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3574 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3575 /* __pyx_t_2 released */
3576
3577 /* "(tree fragment)":3
3578 * def __reduce_cython__(self):
3579 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
3580 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3581 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
3582 */
3583 /* __pyx_t_2 allocated (Python object) */
3584 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_17specmethdocstring_1C_21__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C___setstate_cython, NULL, __pyx_n_s_specmethdocstring, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
3585 __Pyx_GOTREF(__pyx_t_2);
3586 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
3587 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3588 /* __pyx_t_2 released */
3589
3590 /* "specmethdocstring.pyx":1
3591 * # mode: compile # <<<<<<<<<<<<<<
3592 *
3593 * cdef class C:
3594 */
3595 /* __pyx_t_2 allocated (Python object) */
3596 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
3597 __Pyx_GOTREF(__pyx_t_2);
3598 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3599 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3600 /* __pyx_t_2 released */
3601
3602 /*--- Wrapped vars code ---*/
3603
3604 if (__Pyx_RegisterCleanup()) __PYX_ERR(1, 1, __pyx_L1_error);
3605 goto __pyx_L0;
3606 __pyx_L1_error:;
3607 __Pyx_XDECREF(__pyx_t_2);
3608 if (__pyx_m) {
3609 if (__pyx_d && stringtab_initialized) {
3610 __Pyx_AddTraceback("init specmethdocstring", __pyx_clineno, __pyx_lineno, __pyx_filename);
3611 }
3612 #if !CYTHON_USE_MODULE_STATE
3613 Py_CLEAR(__pyx_m);
3614 #endif
3615 } else if (!PyErr_Occurred()) {
3616 PyErr_SetString(PyExc_ImportError, "init specmethdocstring");
3617 }
3618 __pyx_L0:;
3619 __Pyx_RefNannyFinishContext();
3620 #if CYTHON_PEP489_MULTI_PHASE_INIT
3621 return (__pyx_m != NULL) ? 0 : -1;
3622 #elif PY_MAJOR_VERSION >= 3
3623 return __pyx_m;
3624 #else
3625 return;
3626 #endif
3627 }
3628 /* #### Code section: cleanup_globals ### */
3629
3630 static CYTHON_SMALL_CODE void __Pyx_CleanupGlobals(void) {
3631 Py_CLEAR(__pyx_tuple_);
3632 Py_CLEAR(__pyx_codeobj__2);
3633 Py_CLEAR(__pyx_tuple__3);
3634 Py_CLEAR(__pyx_codeobj__4);
3635 /* CodeObjectCache.cleanup */
3636 #if !CYTHON_COMPILING_IN_LIMITED_API
3637 if (__pyx_code_cache.entries) {
3638 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
3639 int i, count = __pyx_code_cache.count;
3640 __pyx_code_cache.count = 0;
3641 __pyx_code_cache.max_count = 0;
3642 __pyx_code_cache.entries = NULL;
3643 for (i=0; i<count; i++) {
3644 Py_DECREF(entries[i].code_object);
3645 }
3646 PyMem_Free(entries);
3647 }
3648 #endif
3649
3650 }
3651 /* #### Code section: cleanup_module ### */
3652 static void __pyx_module_cleanup(CYTHON_UNUSED PyObject *self) {
3653 /*--- Global cleanup code ---*/
3654 __Pyx_CleanupGlobals();
3655 /*--- Type import cleanup code ---*/
3656 /*--- Builtin cleanup code ---*/
3657 Py_CLEAR(__pyx_builtin_TypeError);
3658 /*--- Intern cleanup code ---*/
3659 Py_CLEAR(__pyx_empty_tuple);
3660 Py_CLEAR(__pyx_cython_runtime);
3661 Py_CLEAR(__pyx_b);
3662 Py_CLEAR(__pyx_d);
3663 }
3664 /* #### Code section: main_method ### */
3665 /* #### Code section: utility_code_pragmas ### */
3666 #if _MSC_VER
3667 #pragma warning( push )
3668 /* Warning 4127: conditional expression is constant
3669 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
3670 * compile-time, so this warning is not useful
3671 */
3672 #pragma warning( disable : 4127 )
3673 #endif
3674
3675
3676
3677 /* #### Code section: utility_code_def ### */
3678
3679 /* --- Runtime support code --- */
3680 /* Refnanny */
3681 #if CYTHON_REFNANNY
3682 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
3683 PyObject *m = NULL, *p = NULL;
3684 void *r = NULL;
3685 m = PyImport_ImportModule(modname);
3686 if (!m) goto end;
3687 p = PyObject_GetAttrString(m, "RefNannyAPI");
3688 if (!p) goto end;
3689 r = PyLong_AsVoidPtr(p);
3690 end:
3691 Py_XDECREF(p);
3692 Py_XDECREF(m);
3693 return (__Pyx_RefNannyAPIStruct *)r;
3694 }
3695 #endif
3696
3697 /* PyErrExceptionMatches */
3698 #if CYTHON_FAST_THREAD_STATE
3699 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
3700 Py_ssize_t i, n;
3701 n = PyTuple_GET_SIZE(tuple);
3702 #if PY_MAJOR_VERSION >= 3
3703 for (i=0; i<n; i++) {
3704 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
3705 }
3706 #endif
3707 for (i=0; i<n; i++) {
3708 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
3709 }
3710 return 0;
3711 }
3712 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
3713 PyObject *exc_type = tstate->curexc_type;
3714 if (exc_type == err) return 1;
3715 if (unlikely(!exc_type)) return 0;
3716 if (unlikely(PyTuple_Check(err)))
3717 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
3718 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
3719 }
3720 #endif
3721
3722 /* PyErrFetchRestore */
3723 #if CYTHON_FAST_THREAD_STATE
3724 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
3725 PyObject *tmp_type, *tmp_value, *tmp_tb;
3726 tmp_type = tstate->curexc_type;
3727 tmp_value = tstate->curexc_value;
3728 tmp_tb = tstate->curexc_traceback;
3729 tstate->curexc_type = type;
3730 tstate->curexc_value = value;
3731 tstate->curexc_traceback = tb;
3732 Py_XDECREF(tmp_type);
3733 Py_XDECREF(tmp_value);
3734 Py_XDECREF(tmp_tb);
3735 }
3736 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
3737 *type = tstate->curexc_type;
3738 *value = tstate->curexc_value;
3739 *tb = tstate->curexc_traceback;
3740 tstate->curexc_type = 0;
3741 tstate->curexc_value = 0;
3742 tstate->curexc_traceback = 0;
3743 }
3744 #endif
3745
3746 /* PyObjectGetAttrStr */
3747 #if CYTHON_USE_TYPE_SLOTS
3748 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
3749 PyTypeObject* tp = Py_TYPE(obj);
3750 if (likely(tp->tp_getattro))
3751 return tp->tp_getattro(obj, attr_name);
3752 #if PY_MAJOR_VERSION < 3
3753 if (likely(tp->tp_getattr))
3754 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
3755 #endif
3756 return PyObject_GetAttr(obj, attr_name);
3757 }
3758 #endif
3759
3760 /* PyObjectGetAttrStrNoError */
3761 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
3762 __Pyx_PyThreadState_declare
3763 __Pyx_PyThreadState_assign
3764 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
3765 __Pyx_PyErr_Clear();
3766 }
3767 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
3768 PyObject *result;
3769 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
3770 PyTypeObject* tp = Py_TYPE(obj);
3771 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
3772 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
3773 }
3774 #endif
3775 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
3776 if (unlikely(!result)) {
3777 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
3778 }
3779 return result;
3780 }
3781
3782 /* GetBuiltinName */
3783 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
3784 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
3785 if (unlikely(!result) && !PyErr_Occurred()) {
3786 PyErr_Format(PyExc_NameError,
3787 #if PY_MAJOR_VERSION >= 3
3788 "name '%U' is not defined", name);
3789 #else
3790 "name '%.200s' is not defined", PyString_AS_STRING(name));
3791 #endif
3792 }
3793 return result;
3794 }
3795
3796 /* TupleAndListFromArray */
3797 #if CYTHON_COMPILING_IN_CPYTHON
3798 static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
3799 PyObject *v;
3800 Py_ssize_t i;
3801 for (i = 0; i < length; i++) {
3802 v = dest[i] = src[i];
3803 Py_INCREF(v);
3804 }
3805 }
3806 static CYTHON_INLINE PyObject *
3807 __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
3808 {
3809 PyObject *res;
3810 if (n <= 0) {
3811 Py_INCREF(__pyx_empty_tuple);
3812 return __pyx_empty_tuple;
3813 }
3814 res = PyTuple_New(n);
3815 if (unlikely(res == NULL)) return NULL;
3816 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
3817 return res;
3818 }
3819 static CYTHON_INLINE PyObject *
3820 __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
3821 {
3822 PyObject *res;
3823 if (n <= 0) {
3824 return PyList_New(0);
3825 }
3826 res = PyList_New(n);
3827 if (unlikely(res == NULL)) return NULL;
3828 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
3829 return res;
3830 }
3831 #endif
3832
3833 /* BytesEquals */
3834 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
3835 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
3836 return PyObject_RichCompareBool(s1, s2, equals);
3837 #else
3838 if (s1 == s2) {
3839 return (equals == Py_EQ);
3840 } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
3841 const char *ps1, *ps2;
3842 Py_ssize_t length = PyBytes_GET_SIZE(s1);
3843 if (length != PyBytes_GET_SIZE(s2))
3844 return (equals == Py_NE);
3845 ps1 = PyBytes_AS_STRING(s1);
3846 ps2 = PyBytes_AS_STRING(s2);
3847 if (ps1[0] != ps2[0]) {
3848 return (equals == Py_NE);
3849 } else if (length == 1) {
3850 return (equals == Py_EQ);
3851 } else {
3852 int result;
3853 #if CYTHON_USE_UNICODE_INTERNALS
3854 Py_hash_t hash1, hash2;
3855 hash1 = ((PyBytesObject*)s1)->ob_shash;
3856 hash2 = ((PyBytesObject*)s2)->ob_shash;
3857 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
3858 return (equals == Py_NE);
3859 }
3860 #endif
3861 result = memcmp(ps1, ps2, (size_t)length);
3862 return (equals == Py_EQ) ? (result == 0) : (result != 0);
3863 }
3864 } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
3865 return (equals == Py_NE);
3866 } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
3867 return (equals == Py_NE);
3868 } else {
3869 int result;
3870 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
3871 if (!py_result)
3872 return -1;
3873 result = __Pyx_PyObject_IsTrue(py_result);
3874 Py_DECREF(py_result);
3875 return result;
3876 }
3877 #endif
3878 }
3879
3880 /* UnicodeEquals */
3881 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
3882 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
3883 return PyObject_RichCompareBool(s1, s2, equals);
3884 #else
3885 #if PY_MAJOR_VERSION < 3
3886 PyObject* owned_ref = NULL;
3887 #endif
3888 int s1_is_unicode, s2_is_unicode;
3889 if (s1 == s2) {
3890 goto return_eq;
3891 }
3892 s1_is_unicode = PyUnicode_CheckExact(s1);
3893 s2_is_unicode = PyUnicode_CheckExact(s2);
3894 #if PY_MAJOR_VERSION < 3
3895 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
3896 owned_ref = PyUnicode_FromObject(s2);
3897 if (unlikely(!owned_ref))
3898 return -1;
3899 s2 = owned_ref;
3900 s2_is_unicode = 1;
3901 } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
3902 owned_ref = PyUnicode_FromObject(s1);
3903 if (unlikely(!owned_ref))
3904 return -1;
3905 s1 = owned_ref;
3906 s1_is_unicode = 1;
3907 } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
3908 return __Pyx_PyBytes_Equals(s1, s2, equals);
3909 }
3910 #endif
3911 if (s1_is_unicode & s2_is_unicode) {
3912 Py_ssize_t length;
3913 int kind;
3914 void *data1, *data2;
3915 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
3916 return -1;
3917 length = __Pyx_PyUnicode_GET_LENGTH(s1);
3918 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
3919 goto return_ne;
3920 }
3921 #if CYTHON_USE_UNICODE_INTERNALS
3922 {
3923 Py_hash_t hash1, hash2;
3924 #if CYTHON_PEP393_ENABLED
3925 hash1 = ((PyASCIIObject*)s1)->hash;
3926 hash2 = ((PyASCIIObject*)s2)->hash;
3927 #else
3928 hash1 = ((PyUnicodeObject*)s1)->hash;
3929 hash2 = ((PyUnicodeObject*)s2)->hash;
3930 #endif
3931 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
3932 goto return_ne;
3933 }
3934 }
3935 #endif
3936 kind = __Pyx_PyUnicode_KIND(s1);
3937 if (kind != __Pyx_PyUnicode_KIND(s2)) {
3938 goto return_ne;
3939 }
3940 data1 = __Pyx_PyUnicode_DATA(s1);
3941 data2 = __Pyx_PyUnicode_DATA(s2);
3942 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
3943 goto return_ne;
3944 } else if (length == 1) {
3945 goto return_eq;
3946 } else {
3947 int result = memcmp(data1, data2, (size_t)(length * kind));
3948 #if PY_MAJOR_VERSION < 3
3949 Py_XDECREF(owned_ref);
3950 #endif
3951 return (equals == Py_EQ) ? (result == 0) : (result != 0);
3952 }
3953 } else if ((s1 == Py_None) & s2_is_unicode) {
3954 goto return_ne;
3955 } else if ((s2 == Py_None) & s1_is_unicode) {
3956 goto return_ne;
3957 } else {
3958 int result;
3959 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
3960 #if PY_MAJOR_VERSION < 3
3961 Py_XDECREF(owned_ref);
3962 #endif
3963 if (!py_result)
3964 return -1;
3965 result = __Pyx_PyObject_IsTrue(py_result);
3966 Py_DECREF(py_result);
3967 return result;
3968 }
3969 return_eq:
3970 #if PY_MAJOR_VERSION < 3
3971 Py_XDECREF(owned_ref);
3972 #endif
3973 return (equals == Py_EQ);
3974 return_ne:
3975 #if PY_MAJOR_VERSION < 3
3976 Py_XDECREF(owned_ref);
3977 #endif
3978 return (equals == Py_NE);
3979 #endif
3980 }
3981
3982 /* fastcall */
3983 #if CYTHON_METH_FASTCALL
3984 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
3985 {
3986 Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
3987 for (i = 0; i < n; i++)
3988 {
3989 if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
3990 }
3991 for (i = 0; i < n; i++)
3992 {
3993 int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
3994 if (unlikely(eq != 0)) {
3995 if (unlikely(eq < 0)) return NULL; // error
3996 return kwvalues[i];
3997 }
3998 }
3999 return NULL; // not found (no exception set)
4000 }
4001 #endif
4002
4003 /* RaiseArgTupleInvalid */
4004 static void __Pyx_RaiseArgtupleInvalid(
4005 const char* func_name,
4006 int exact,
4007 Py_ssize_t num_min,
4008 Py_ssize_t num_max,
4009 Py_ssize_t num_found)
4010 {
4011 Py_ssize_t num_expected;
4012 const char *more_or_less;
4013 if (num_found < num_min) {
4014 num_expected = num_min;
4015 more_or_less = "at least";
4016 } else {
4017 num_expected = num_max;
4018 more_or_less = "at most";
4019 }
4020 if (exact) {
4021 more_or_less = "exactly";
4022 }
4023 PyErr_Format(PyExc_TypeError,
4024 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
4025 func_name, more_or_less, num_expected,
4026 (num_expected == 1) ? "" : "s", num_found);
4027 }
4028
4029 /* KeywordStringCheck */
4030 static int __Pyx_CheckKeywordStrings(
4031 PyObject *kw,
4032 const char* function_name,
4033 int kw_allowed)
4034 {
4035 PyObject* key = 0;
4036 Py_ssize_t pos = 0;
4037 #if CYTHON_COMPILING_IN_PYPY
4038 if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
4039 goto invalid_keyword;
4040 return 1;
4041 #else
4042 if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
4043 if (unlikely(PyTuple_GET_SIZE(kw) == 0))
4044 return 1;
4045 if (!kw_allowed) {
4046 key = PyTuple_GET_ITEM(kw, 0);
4047 goto invalid_keyword;
4048 }
4049 #if PY_VERSION_HEX < 0x03090000
4050 for (pos = 0; pos < PyTuple_GET_SIZE(kw); pos++) {
4051 key = PyTuple_GET_ITEM(kw, pos);
4052 if (unlikely(!PyUnicode_Check(key)))
4053 goto invalid_keyword_type;
4054 }
4055 #endif
4056 return 1;
4057 }
4058 while (PyDict_Next(kw, &pos, &key, 0)) {
4059 #if PY_MAJOR_VERSION < 3
4060 if (unlikely(!PyString_Check(key)))
4061 #endif
4062 if (unlikely(!PyUnicode_Check(key)))
4063 goto invalid_keyword_type;
4064 }
4065 if (!kw_allowed && unlikely(key))
4066 goto invalid_keyword;
4067 return 1;
4068 invalid_keyword_type:
4069 PyErr_Format(PyExc_TypeError,
4070 "%.200s() keywords must be strings", function_name);
4071 return 0;
4072 #endif
4073 invalid_keyword:
4074 #if PY_MAJOR_VERSION < 3
4075 PyErr_Format(PyExc_TypeError,
4076 "%.200s() got an unexpected keyword argument '%.200s'",
4077 function_name, PyString_AsString(key));
4078 #else
4079 PyErr_Format(PyExc_TypeError,
4080 "%s() got an unexpected keyword argument '%U'",
4081 function_name, key);
4082 #endif
4083 return 0;
4084 }
4085
4086 /* RaiseException */
4087 #if PY_MAJOR_VERSION < 3
4088 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
4089 __Pyx_PyThreadState_declare
4090 CYTHON_UNUSED_VAR(cause);
4091 Py_XINCREF(type);
4092 if (!value || value == Py_None)
4093 value = NULL;
4094 else
4095 Py_INCREF(value);
4096 if (!tb || tb == Py_None)
4097 tb = NULL;
4098 else {
4099 Py_INCREF(tb);
4100 if (!PyTraceBack_Check(tb)) {
4101 PyErr_SetString(PyExc_TypeError,
4102 "raise: arg 3 must be a traceback or None");
4103 goto raise_error;
4104 }
4105 }
4106 if (PyType_Check(type)) {
4107 #if CYTHON_COMPILING_IN_PYPY
4108 if (!value) {
4109 Py_INCREF(Py_None);
4110 value = Py_None;
4111 }
4112 #endif
4113 PyErr_NormalizeException(&type, &value, &tb);
4114 } else {
4115 if (value) {
4116 PyErr_SetString(PyExc_TypeError,
4117 "instance exception may not have a separate value");
4118 goto raise_error;
4119 }
4120 value = type;
4121 type = (PyObject*) Py_TYPE(type);
4122 Py_INCREF(type);
4123 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
4124 PyErr_SetString(PyExc_TypeError,
4125 "raise: exception class must be a subclass of BaseException");
4126 goto raise_error;
4127 }
4128 }
4129 __Pyx_PyThreadState_assign
4130 __Pyx_ErrRestore(type, value, tb);
4131 return;
4132 raise_error:
4133 Py_XDECREF(value);
4134 Py_XDECREF(type);
4135 Py_XDECREF(tb);
4136 return;
4137 }
4138 #else
4139 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
4140 PyObject* owned_instance = NULL;
4141 if (tb == Py_None) {
4142 tb = 0;
4143 } else if (tb && !PyTraceBack_Check(tb)) {
4144 PyErr_SetString(PyExc_TypeError,
4145 "raise: arg 3 must be a traceback or None");
4146 goto bad;
4147 }
4148 if (value == Py_None)
4149 value = 0;
4150 if (PyExceptionInstance_Check(type)) {
4151 if (value) {
4152 PyErr_SetString(PyExc_TypeError,
4153 "instance exception may not have a separate value");
4154 goto bad;
4155 }
4156 value = type;
4157 type = (PyObject*) Py_TYPE(value);
4158 } else if (PyExceptionClass_Check(type)) {
4159 PyObject *instance_class = NULL;
4160 if (value && PyExceptionInstance_Check(value)) {
4161 instance_class = (PyObject*) Py_TYPE(value);
4162 if (instance_class != type) {
4163 int is_subclass = PyObject_IsSubclass(instance_class, type);
4164 if (!is_subclass) {
4165 instance_class = NULL;
4166 } else if (unlikely(is_subclass == -1)) {
4167 goto bad;
4168 } else {
4169 type = instance_class;
4170 }
4171 }
4172 }
4173 if (!instance_class) {
4174 PyObject *args;
4175 if (!value)
4176 args = PyTuple_New(0);
4177 else if (PyTuple_Check(value)) {
4178 Py_INCREF(value);
4179 args = value;
4180 } else
4181 args = PyTuple_Pack(1, value);
4182 if (!args)
4183 goto bad;
4184 owned_instance = PyObject_Call(type, args, NULL);
4185 Py_DECREF(args);
4186 if (!owned_instance)
4187 goto bad;
4188 value = owned_instance;
4189 if (!PyExceptionInstance_Check(value)) {
4190 PyErr_Format(PyExc_TypeError,
4191 "calling %R should have returned an instance of "
4192 "BaseException, not %R",
4193 type, Py_TYPE(value));
4194 goto bad;
4195 }
4196 }
4197 } else {
4198 PyErr_SetString(PyExc_TypeError,
4199 "raise: exception class must be a subclass of BaseException");
4200 goto bad;
4201 }
4202 if (cause) {
4203 PyObject *fixed_cause;
4204 if (cause == Py_None) {
4205 fixed_cause = NULL;
4206 } else if (PyExceptionClass_Check(cause)) {
4207 fixed_cause = PyObject_CallObject(cause, NULL);
4208 if (fixed_cause == NULL)
4209 goto bad;
4210 } else if (PyExceptionInstance_Check(cause)) {
4211 fixed_cause = cause;
4212 Py_INCREF(fixed_cause);
4213 } else {
4214 PyErr_SetString(PyExc_TypeError,
4215 "exception causes must derive from "
4216 "BaseException");
4217 goto bad;
4218 }
4219 PyException_SetCause(value, fixed_cause);
4220 }
4221 PyErr_SetObject(type, value);
4222 if (tb) {
4223 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
4224 PyObject *tmp_type, *tmp_value, *tmp_tb;
4225 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
4226 Py_INCREF(tb);
4227 PyErr_Restore(tmp_type, tmp_value, tb);
4228 Py_XDECREF(tmp_tb);
4229 #else
4230 PyThreadState *tstate = __Pyx_PyThreadState_Current;
4231 PyObject* tmp_tb = tstate->curexc_traceback;
4232 if (tb != tmp_tb) {
4233 Py_INCREF(tb);
4234 tstate->curexc_traceback = tb;
4235 Py_XDECREF(tmp_tb);
4236 }
4237 #endif
4238 }
4239 bad:
4240 Py_XDECREF(owned_instance);
4241 return;
4242 }
4243 #endif
4244
4245 /* RaiseDoubleKeywords */
4246 static void __Pyx_RaiseDoubleKeywordsError(
4247 const char* func_name,
4248 PyObject* kw_name)
4249 {
4250 PyErr_Format(PyExc_TypeError,
4251 #if PY_MAJOR_VERSION >= 3
4252 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
4253 #else
4254 "%s() got multiple values for keyword argument '%s'", func_name,
4255 PyString_AsString(kw_name));
4256 #endif
4257 }
4258
4259 /* ParseKeywords */
4260 static int __Pyx_ParseOptionalKeywords(
4261 PyObject *kwds,
4262 PyObject *const *kwvalues,
4263 PyObject **argnames[],
4264 PyObject *kwds2,
4265 PyObject *values[],
4266 Py_ssize_t num_pos_args,
4267 const char* function_name)
4268 {
4269 PyObject *key = 0, *value = 0;
4270 Py_ssize_t pos = 0;
4271 PyObject*** name;
4272 PyObject*** first_kw_arg = argnames + num_pos_args;
4273 int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
4274 while (1) {
4275 if (kwds_is_tuple) {
4276 if (pos >= PyTuple_GET_SIZE(kwds)) break;
4277 key = PyTuple_GET_ITEM(kwds, pos);
4278 value = kwvalues[pos];
4279 pos++;
4280 }
4281 else
4282 {
4283 if (!PyDict_Next(kwds, &pos, &key, &value)) break;
4284 }
4285 name = first_kw_arg;
4286 while (*name && (**name != key)) name++;
4287 if (*name) {
4288 values[name-argnames] = value;
4289 continue;
4290 }
4291 name = first_kw_arg;
4292 #if PY_MAJOR_VERSION < 3
4293 if (likely(PyString_Check(key))) {
4294 while (*name) {
4295 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
4296 && _PyString_Eq(**name, key)) {
4297 values[name-argnames] = value;
4298 break;
4299 }
4300 name++;
4301 }
4302 if (*name) continue;
4303 else {
4304 PyObject*** argname = argnames;
4305 while (argname != first_kw_arg) {
4306 if ((**argname == key) || (
4307 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
4308 && _PyString_Eq(**argname, key))) {
4309 goto arg_passed_twice;
4310 }
4311 argname++;
4312 }
4313 }
4314 } else
4315 #endif
4316 if (likely(PyUnicode_Check(key))) {
4317 while (*name) {
4318 int cmp = (
4319 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
4320 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
4321 #endif
4322 PyUnicode_Compare(**name, key)
4323 );
4324 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
4325 if (cmp == 0) {
4326 values[name-argnames] = value;
4327 break;
4328 }
4329 name++;
4330 }
4331 if (*name) continue;
4332 else {
4333 PyObject*** argname = argnames;
4334 while (argname != first_kw_arg) {
4335 int cmp = (**argname == key) ? 0 :
4336 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
4337 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
4338 #endif
4339 PyUnicode_Compare(**argname, key);
4340 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
4341 if (cmp == 0) goto arg_passed_twice;
4342 argname++;
4343 }
4344 }
4345 } else
4346 goto invalid_keyword_type;
4347 if (kwds2) {
4348 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
4349 } else {
4350 goto invalid_keyword;
4351 }
4352 }
4353 return 0;
4354 arg_passed_twice:
4355 __Pyx_RaiseDoubleKeywordsError(function_name, key);
4356 goto bad;
4357 invalid_keyword_type:
4358 PyErr_Format(PyExc_TypeError,
4359 "%.200s() keywords must be strings", function_name);
4360 goto bad;
4361 invalid_keyword:
4362 #if PY_MAJOR_VERSION < 3
4363 PyErr_Format(PyExc_TypeError,
4364 "%.200s() got an unexpected keyword argument '%.200s'",
4365 function_name, PyString_AsString(key));
4366 #else
4367 PyErr_Format(PyExc_TypeError,
4368 "%s() got an unexpected keyword argument '%U'",
4369 function_name, key);
4370 #endif
4371 bad:
4372 return -1;
4373 }
4374
4375 /* FixUpExtensionType */
4376 #if CYTHON_USE_TYPE_SPECS
4377 static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
4378 #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
4379 (void) spec;
4380 (void) type;
4381 #else
4382 const PyType_Slot *slot = spec->slots;
4383 while (slot && slot->slot && slot->slot != Py_tp_members)
4384 slot++;
4385 if (slot && slot->slot == Py_tp_members) {
4386 int changed = 0;
4387 #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
4388 const
4389 #endif
4390 PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
4391 while (memb && memb->name) {
4392 if (memb->name[0] == '_' && memb->name[1] == '_') {
4393 #if PY_VERSION_HEX < 0x030900b1
4394 if (strcmp(memb->name, "__weaklistoffset__") == 0) {
4395 assert(memb->type == T_PYSSIZET);
4396 assert(memb->flags == READONLY);
4397 type->tp_weaklistoffset = memb->offset;
4398 changed = 1;
4399 }
4400 else if (strcmp(memb->name, "__dictoffset__") == 0) {
4401 assert(memb->type == T_PYSSIZET);
4402 assert(memb->flags == READONLY);
4403 type->tp_dictoffset = memb->offset;
4404 changed = 1;
4405 }
4406 #if CYTHON_METH_FASTCALL
4407 else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
4408 assert(memb->type == T_PYSSIZET);
4409 assert(memb->flags == READONLY);
4410 #if PY_VERSION_HEX >= 0x030800b4
4411 type->tp_vectorcall_offset = memb->offset;
4412 #else
4413 type->tp_print = (printfunc) memb->offset;
4414 #endif
4415 changed = 1;
4416 }
4417 #endif
4418 #else
4419 if ((0));
4420 #endif
4421 #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
4422 else if (strcmp(memb->name, "__module__") == 0) {
4423 PyObject *descr;
4424 assert(memb->type == T_OBJECT);
4425 assert(memb->flags == 0 || memb->flags == READONLY);
4426 descr = PyDescr_NewMember(type, memb);
4427 if (unlikely(!descr))
4428 return -1;
4429 if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
4430 Py_DECREF(descr);
4431 return -1;
4432 }
4433 Py_DECREF(descr);
4434 changed = 1;
4435 }
4436 #endif
4437 }
4438 memb++;
4439 }
4440 if (changed)
4441 PyType_Modified(type);
4442 }
4443 #endif
4444 return 0;
4445 }
4446 #endif
4447
4448 /* PyFunctionFastCall */
4449 #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
4450 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
4451 PyObject *globals) {
4452 PyFrameObject *f;
4453 PyThreadState *tstate = __Pyx_PyThreadState_Current;
4454 PyObject **fastlocals;
4455 Py_ssize_t i;
4456 PyObject *result;
4457 assert(globals != NULL);
4458 /* XXX Perhaps we should create a specialized
4459 PyFrame_New() that doesn't take locals, but does
4460 take builtins without sanity checking them.
4461 */
4462 assert(tstate != NULL);
4463 f = PyFrame_New(tstate, co, globals, NULL);
4464 if (f == NULL) {
4465 return NULL;
4466 }
4467 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
4468 for (i = 0; i < na; i++) {
4469 Py_INCREF(*args);
4470 fastlocals[i] = *args++;
4471 }
4472 result = PyEval_EvalFrameEx(f,0);
4473 ++tstate->recursion_depth;
4474 Py_DECREF(f);
4475 --tstate->recursion_depth;
4476 return result;
4477 }
4478 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
4479 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
4480 PyObject *globals = PyFunction_GET_GLOBALS(func);
4481 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
4482 PyObject *closure;
4483 #if PY_MAJOR_VERSION >= 3
4484 PyObject *kwdefs;
4485 #endif
4486 PyObject *kwtuple, **k;
4487 PyObject **d;
4488 Py_ssize_t nd;
4489 Py_ssize_t nk;
4490 PyObject *result;
4491 assert(kwargs == NULL || PyDict_Check(kwargs));
4492 nk = kwargs ? PyDict_Size(kwargs) : 0;
4493 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
4494 return NULL;
4495 }
4496 if (
4497 #if PY_MAJOR_VERSION >= 3
4498 co->co_kwonlyargcount == 0 &&
4499 #endif
4500 likely(kwargs == NULL || nk == 0) &&
4501 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
4502 if (argdefs == NULL && co->co_argcount == nargs) {
4503 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
4504 goto done;
4505 }
4506 else if (nargs == 0 && argdefs != NULL
4507 && co->co_argcount == Py_SIZE(argdefs)) {
4508 /* function called with no arguments, but all parameters have
4509 a default value: use default values as arguments .*/
4510 args = &PyTuple_GET_ITEM(argdefs, 0);
4511 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
4512 goto done;
4513 }
4514 }
4515 if (kwargs != NULL) {
4516 Py_ssize_t pos, i;
4517 kwtuple = PyTuple_New(2 * nk);
4518 if (kwtuple == NULL) {
4519 result = NULL;
4520 goto done;
4521 }
4522 k = &PyTuple_GET_ITEM(kwtuple, 0);
4523 pos = i = 0;
4524 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
4525 Py_INCREF(k[i]);
4526 Py_INCREF(k[i+1]);
4527 i += 2;
4528 }
4529 nk = i / 2;
4530 }
4531 else {
4532 kwtuple = NULL;
4533 k = NULL;
4534 }
4535 closure = PyFunction_GET_CLOSURE(func);
4536 #if PY_MAJOR_VERSION >= 3
4537 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
4538 #endif
4539 if (argdefs != NULL) {
4540 d = &PyTuple_GET_ITEM(argdefs, 0);
4541 nd = Py_SIZE(argdefs);
4542 }
4543 else {
4544 d = NULL;
4545 nd = 0;
4546 }
4547 #if PY_MAJOR_VERSION >= 3
4548 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
4549 args, (int)nargs,
4550 k, (int)nk,
4551 d, (int)nd, kwdefs, closure);
4552 #else
4553 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
4554 args, (int)nargs,
4555 k, (int)nk,
4556 d, (int)nd, closure);
4557 #endif
4558 Py_XDECREF(kwtuple);
4559 done:
4560 Py_LeaveRecursiveCall();
4561 return result;
4562 }
4563 #endif
4564
4565 /* PyObjectCall */
4566 #if CYTHON_COMPILING_IN_CPYTHON
4567 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
4568 PyObject *result;
4569 ternaryfunc call = Py_TYPE(func)->tp_call;
4570 if (unlikely(!call))
4571 return PyObject_Call(func, arg, kw);
4572 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
4573 return NULL;
4574 result = (*call)(func, arg, kw);
4575 Py_LeaveRecursiveCall();
4576 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
4577 PyErr_SetString(
4578 PyExc_SystemError,
4579 "NULL result without error in PyObject_Call");
4580 }
4581 return result;
4582 }
4583 #endif
4584
4585 /* PyObjectCallMethO */
4586 #if CYTHON_COMPILING_IN_CPYTHON
4587 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
4588 PyObject *self, *result;
4589 PyCFunction cfunc;
4590 cfunc = PyCFunction_GET_FUNCTION(func);
4591 self = PyCFunction_GET_SELF(func);
4592 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
4593 return NULL;
4594 result = cfunc(self, arg);
4595 Py_LeaveRecursiveCall();
4596 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
4597 PyErr_SetString(
4598 PyExc_SystemError,
4599 "NULL result without error in PyObject_Call");
4600 }
4601 return result;
4602 }
4603 #endif
4604
4605 /* PyObjectFastCall */
4606 static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
4607 PyObject *argstuple;
4608 PyObject *result;
4609 size_t i;
4610 argstuple = PyTuple_New((Py_ssize_t)nargs);
4611 if (unlikely(!argstuple)) return NULL;
4612 for (i = 0; i < nargs; i++) {
4613 Py_INCREF(args[i]);
4614 PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]);
4615 }
4616 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
4617 Py_DECREF(argstuple);
4618 return result;
4619 }
4620 static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
4621 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
4622 #if CYTHON_COMPILING_IN_CPYTHON
4623 if (nargs == 0 && kwargs == NULL) {
4624 #ifdef __Pyx_CyFunction_USED
4625 if (__Pyx_IsCyOrPyCFunction(func))
4626 #else
4627 if (PyCFunction_Check(func))
4628 #endif
4629 {
4630 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
4631 return __Pyx_PyObject_CallMethO(func, NULL);
4632 }
4633 }
4634 }
4635 else if (nargs == 1 && kwargs == NULL) {
4636 if (PyCFunction_Check(func))
4637 {
4638 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
4639 return __Pyx_PyObject_CallMethO(func, args[0]);
4640 }
4641 }
4642 }
4643 #endif
4644 #if PY_VERSION_HEX < 0x030800B1
4645 #if CYTHON_FAST_PYCCALL
4646 if (PyCFunction_Check(func)) {
4647 if (kwargs) {
4648 return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
4649 } else {
4650 return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
4651 }
4652 }
4653 #if PY_VERSION_HEX >= 0x030700A1
4654 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
4655 return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
4656 }
4657 #endif
4658 #endif
4659 #if CYTHON_FAST_PYCALL
4660 if (PyFunction_Check(func)) {
4661 return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
4662 }
4663 #endif
4664 #endif
4665 #if CYTHON_VECTORCALL
4666 vectorcallfunc f = _PyVectorcall_Function(func);
4667 if (f) {
4668 return f(func, args, (size_t)nargs, kwargs);
4669 }
4670 #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
4671 if (__Pyx_CyFunction_CheckExact(func)) {
4672 __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
4673 if (f) return f(func, args, (size_t)nargs, kwargs);
4674 }
4675 #endif
4676 if (nargs == 0) {
4677 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
4678 }
4679 return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
4680 }
4681
4682 /* PyObjectCallNoArg */
4683 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
4684 PyObject *arg = NULL;
4685 return __Pyx_PyObject_FastCall(func, (&arg)+1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
4686 }
4687
4688 /* PyObjectCallOneArg */
4689 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
4690 PyObject *args[2] = {NULL, arg};
4691 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
4692 }
4693
4694 /* PyObjectGetMethod */
4695 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
4696 PyObject *attr;
4697 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
4698 __Pyx_TypeName type_name;
4699 PyTypeObject *tp = Py_TYPE(obj);
4700 PyObject *descr;
4701 descrgetfunc f = NULL;
4702 PyObject **dictptr, *dict;
4703 int meth_found = 0;
4704 assert (*method == NULL);
4705 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
4706 attr = __Pyx_PyObject_GetAttrStr(obj, name);
4707 goto try_unpack;
4708 }
4709 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
4710 return 0;
4711 }
4712 descr = _PyType_Lookup(tp, name);
4713 if (likely(descr != NULL)) {
4714 Py_INCREF(descr);
4715 #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
4716 if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
4717 #elif PY_MAJOR_VERSION >= 3
4718 #ifdef __Pyx_CyFunction_USED
4719 if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
4720 #else
4721 if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
4722 #endif
4723 #else
4724 #ifdef __Pyx_CyFunction_USED
4725 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
4726 #else
4727 if (likely(PyFunction_Check(descr)))
4728 #endif
4729 #endif
4730 {
4731 meth_found = 1;
4732 } else {
4733 f = Py_TYPE(descr)->tp_descr_get;
4734 if (f != NULL && PyDescr_IsData(descr)) {
4735 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
4736 Py_DECREF(descr);
4737 goto try_unpack;
4738 }
4739 }
4740 }
4741 dictptr = _PyObject_GetDictPtr(obj);
4742 if (dictptr != NULL && (dict = *dictptr) != NULL) {
4743 Py_INCREF(dict);
4744 attr = __Pyx_PyDict_GetItemStr(dict, name);
4745 if (attr != NULL) {
4746 Py_INCREF(attr);
4747 Py_DECREF(dict);
4748 Py_XDECREF(descr);
4749 goto try_unpack;
4750 }
4751 Py_DECREF(dict);
4752 }
4753 if (meth_found) {
4754 *method = descr;
4755 return 1;
4756 }
4757 if (f != NULL) {
4758 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
4759 Py_DECREF(descr);
4760 goto try_unpack;
4761 }
4762 if (likely(descr != NULL)) {
4763 *method = descr;
4764 return 0;
4765 }
4766 type_name = __Pyx_PyType_GetName(tp);
4767 PyErr_Format(PyExc_AttributeError,
4768 #if PY_MAJOR_VERSION >= 3
4769 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
4770 type_name, name);
4771 #else
4772 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
4773 type_name, PyString_AS_STRING(name));
4774 #endif
4775 __Pyx_DECREF_TypeName(type_name);
4776 return 0;
4777 #else
4778 attr = __Pyx_PyObject_GetAttrStr(obj, name);
4779 goto try_unpack;
4780 #endif
4781 try_unpack:
4782 #if CYTHON_UNPACK_METHODS
4783 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
4784 PyObject *function = PyMethod_GET_FUNCTION(attr);
4785 Py_INCREF(function);
4786 Py_DECREF(attr);
4787 *method = function;
4788 return 1;
4789 }
4790 #endif
4791 *method = attr;
4792 return 0;
4793 }
4794
4795 /* PyObjectCallMethod0 */
4796 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
4797 PyObject *method = NULL, *result = NULL;
4798 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
4799 if (likely(is_method)) {
4800 result = __Pyx_PyObject_CallOneArg(method, obj);
4801 Py_DECREF(method);
4802 return result;
4803 }
4804 if (unlikely(!method)) goto bad;
4805 result = __Pyx_PyObject_CallNoArg(method);
4806 Py_DECREF(method);
4807 bad:
4808 return result;
4809 }
4810
4811 /* ValidateBasesTuple */
4812 #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
4813 static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
4814 Py_ssize_t i, n = PyTuple_GET_SIZE(bases);
4815 for (i = 1; i < n; i++)
4816 {
4817 PyObject *b0 = PyTuple_GET_ITEM(bases, i);
4818 PyTypeObject *b;
4819 #if PY_MAJOR_VERSION < 3
4820 if (PyClass_Check(b0))
4821 {
4822 PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
4823 PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
4824 return -1;
4825 }
4826 #endif
4827 b = (PyTypeObject*) b0;
4828 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
4829 {
4830 __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
4831 PyErr_Format(PyExc_TypeError,
4832 "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
4833 __Pyx_DECREF_TypeName(b_name);
4834 return -1;
4835 }
4836 if (dictoffset == 0 && b->tp_dictoffset)
4837 {
4838 __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
4839 PyErr_Format(PyExc_TypeError,
4840 "extension type '%.200s' has no __dict__ slot, "
4841 "but base type '" __Pyx_FMT_TYPENAME "' has: "
4842 "either add 'cdef dict __dict__' to the extension type "
4843 "or add '__slots__ = [...]' to the base type",
4844 type_name, b_name);
4845 __Pyx_DECREF_TypeName(b_name);
4846 return -1;
4847 }
4848 }
4849 return 0;
4850 }
4851 #endif
4852
4853 /* PyType_Ready */
4854 static int __Pyx_PyType_Ready(PyTypeObject *t) {
4855 #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
4856 (void)__Pyx_PyObject_CallMethod0;
4857 #if CYTHON_USE_TYPE_SPECS
4858 (void)__Pyx_validate_bases_tuple;
4859 #endif
4860 return PyType_Ready(t);
4861 #else
4862 int r;
4863 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
4864 if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
4865 return -1;
4866 #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
4867 {
4868 int gc_was_enabled;
4869 #if PY_VERSION_HEX >= 0x030A00b1
4870 gc_was_enabled = PyGC_Disable();
4871 (void)__Pyx_PyObject_CallMethod0;
4872 #else
4873 PyObject *ret, *py_status;
4874 PyObject *gc = NULL;
4875 #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
4876 gc = PyImport_GetModule(__pyx_kp_u_gc);
4877 #endif
4878 if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
4879 if (unlikely(!gc)) return -1;
4880 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
4881 if (unlikely(!py_status)) {
4882 Py_DECREF(gc);
4883 return -1;
4884 }
4885 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
4886 Py_DECREF(py_status);
4887 if (gc_was_enabled > 0) {
4888 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
4889 if (unlikely(!ret)) {
4890 Py_DECREF(gc);
4891 return -1;
4892 }
4893 Py_DECREF(ret);
4894 } else if (unlikely(gc_was_enabled == -1)) {
4895 Py_DECREF(gc);
4896 return -1;
4897 }
4898 #endif
4899 t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
4900 #else
4901 (void)__Pyx_PyObject_CallMethod0;
4902 #endif
4903 r = PyType_Ready(t);
4904 #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
4905 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
4906 #if PY_VERSION_HEX >= 0x030A00b1
4907 if (gc_was_enabled)
4908 PyGC_Enable();
4909 #else
4910 if (gc_was_enabled) {
4911 PyObject *tp, *v, *tb;
4912 PyErr_Fetch(&tp, &v, &tb);
4913 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
4914 if (likely(ret || r == -1)) {
4915 Py_XDECREF(ret);
4916 PyErr_Restore(tp, v, tb);
4917 } else {
4918 Py_XDECREF(tp);
4919 Py_XDECREF(v);
4920 Py_XDECREF(tb);
4921 r = -1;
4922 }
4923 }
4924 Py_DECREF(gc);
4925 #endif
4926 }
4927 #endif
4928 return r;
4929 #endif
4930 }
4931
4932 /* PyObject_GenericGetAttrNoDict */
4933 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
4934 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
4935 __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
4936 PyErr_Format(PyExc_AttributeError,
4937 #if PY_MAJOR_VERSION >= 3
4938 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
4939 type_name, attr_name);
4940 #else
4941 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
4942 type_name, PyString_AS_STRING(attr_name));
4943 #endif
4944 __Pyx_DECREF_TypeName(type_name);
4945 return NULL;
4946 }
4947 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
4948 PyObject *descr;
4949 PyTypeObject *tp = Py_TYPE(obj);
4950 if (unlikely(!PyString_Check(attr_name))) {
4951 return PyObject_GenericGetAttr(obj, attr_name);
4952 }
4953 assert(!tp->tp_dictoffset);
4954 descr = _PyType_Lookup(tp, attr_name);
4955 if (unlikely(!descr)) {
4956 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
4957 }
4958 Py_INCREF(descr);
4959 #if PY_MAJOR_VERSION < 3
4960 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
4961 #endif
4962 {
4963 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
4964 if (unlikely(f)) {
4965 PyObject *res = f(descr, obj, (PyObject *)tp);
4966 Py_DECREF(descr);
4967 return res;
4968 }
4969 }
4970 return descr;
4971 }
4972 #endif
4973
4974 /* PyObject_GenericGetAttr */
4975 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
4976 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
4977 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
4978 return PyObject_GenericGetAttr(obj, attr_name);
4979 }
4980 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
4981 }
4982 #endif
4983
4984 /* SetupReduce */
4985 #if !CYTHON_COMPILING_IN_LIMITED_API
4986 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
4987 int ret;
4988 PyObject *name_attr;
4989 name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name);
4990 if (likely(name_attr)) {
4991 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
4992 } else {
4993 ret = -1;
4994 }
4995 if (unlikely(ret < 0)) {
4996 PyErr_Clear();
4997 ret = 0;
4998 }
4999 Py_XDECREF(name_attr);
5000 return ret;
5001 }
5002 static int __Pyx_setup_reduce(PyObject* type_obj) {
5003 int ret = 0;
5004 PyObject *object_reduce = NULL;
5005 PyObject *object_reduce_ex = NULL;
5006 PyObject *reduce = NULL;
5007 PyObject *reduce_ex = NULL;
5008 PyObject *reduce_cython = NULL;
5009 PyObject *setstate = NULL;
5010 PyObject *setstate_cython = NULL;
5011 #if CYTHON_USE_PYTYPE_LOOKUP
5012 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
5013 #else
5014 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
5015 #endif
5016 #if CYTHON_USE_PYTYPE_LOOKUP
5017 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
5018 #else
5019 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
5020 #endif
5021 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
5022 if (reduce_ex == object_reduce_ex) {
5023 #if CYTHON_USE_PYTYPE_LOOKUP
5024 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
5025 #else
5026 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
5027 #endif
5028 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
5029 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
5030 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
5031 if (likely(reduce_cython)) {
5032 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
5033 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
5034 } else if (reduce == object_reduce || PyErr_Occurred()) {
5035 goto __PYX_BAD;
5036 }
5037 setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
5038 if (!setstate) PyErr_Clear();
5039 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
5040 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
5041 if (likely(setstate_cython)) {
5042 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
5043 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
5044 } else if (!setstate || PyErr_Occurred()) {
5045 goto __PYX_BAD;
5046 }
5047 }
5048 PyType_Modified((PyTypeObject*)type_obj);
5049 }
5050 }
5051 goto __PYX_GOOD;
5052 __PYX_BAD:
5053 if (!PyErr_Occurred()) {
5054 __Pyx_TypeName type_obj_name =
5055 __Pyx_PyType_GetName((PyTypeObject*)type_obj);
5056 PyErr_Format(PyExc_RuntimeError,
5057 "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
5058 __Pyx_DECREF_TypeName(type_obj_name);
5059 }
5060 ret = -1;
5061 __PYX_GOOD:
5062 #if !CYTHON_USE_PYTYPE_LOOKUP
5063 Py_XDECREF(object_reduce);
5064 Py_XDECREF(object_reduce_ex);
5065 #endif
5066 Py_XDECREF(reduce);
5067 Py_XDECREF(reduce_ex);
5068 Py_XDECREF(reduce_cython);
5069 Py_XDECREF(setstate);
5070 Py_XDECREF(setstate_cython);
5071 return ret;
5072 }
5073 #endif
5074
5075 /* FetchSharedCythonModule */
5076 static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
5077 PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME);
5078 if (unlikely(!abi_module)) return NULL;
5079 Py_INCREF(abi_module);
5080 return abi_module;
5081 }
5082
5083 /* FetchCommonType */
5084 static int __Pyx_VerifyCachedType(PyObject *cached_type,
5085 const char *name,
5086 Py_ssize_t basicsize,
5087 Py_ssize_t expected_basicsize) {
5088 if (!PyType_Check(cached_type)) {
5089 PyErr_Format(PyExc_TypeError,
5090 "Shared Cython type %.200s is not a type object", name);
5091 return -1;
5092 }
5093 if (basicsize != expected_basicsize) {
5094 PyErr_Format(PyExc_TypeError,
5095 "Shared Cython type %.200s has the wrong size, try recompiling",
5096 name);
5097 return -1;
5098 }
5099 return 0;
5100 }
5101 #if !CYTHON_USE_TYPE_SPECS
5102 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
5103 PyObject* abi_module;
5104 const char* object_name;
5105 PyTypeObject *cached_type = NULL;
5106 abi_module = __Pyx_FetchSharedCythonABIModule();
5107 if (!abi_module) return NULL;
5108 object_name = strrchr(type->tp_name, '.');
5109 object_name = object_name ? object_name+1 : type->tp_name;
5110 cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
5111 if (cached_type) {
5112 if (__Pyx_VerifyCachedType(
5113 (PyObject *)cached_type,
5114 object_name,
5115 cached_type->tp_basicsize,
5116 type->tp_basicsize) < 0) {
5117 goto bad;
5118 }
5119 goto done;
5120 }
5121 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
5122 PyErr_Clear();
5123 if (PyType_Ready(type) < 0) goto bad;
5124 if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
5125 goto bad;
5126 Py_INCREF(type);
5127 cached_type = type;
5128 done:
5129 Py_DECREF(abi_module);
5130 return cached_type;
5131 bad:
5132 Py_XDECREF(cached_type);
5133 cached_type = NULL;
5134 goto done;
5135 }
5136 #else
5137 static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
5138 PyObject *abi_module, *cached_type = NULL;
5139 const char* object_name = strrchr(spec->name, '.');
5140 object_name = object_name ? object_name+1 : spec->name;
5141 abi_module = __Pyx_FetchSharedCythonABIModule();
5142 if (!abi_module) return NULL;
5143 cached_type = PyObject_GetAttrString(abi_module, object_name);
5144 if (cached_type) {
5145 Py_ssize_t basicsize;
5146 #if CYTHON_COMPILING_IN_LIMITED_API
5147 PyObject *py_basicsize;
5148 py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
5149 if (unlikely(!py_basicsize)) goto bad;
5150 basicsize = PyLong_AsSsize_t(py_basicsize);
5151 Py_DECREF(py_basicsize);
5152 py_basicsize = 0;
5153 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
5154 #else
5155 basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
5156 #endif
5157 if (__Pyx_VerifyCachedType(
5158 cached_type,
5159 object_name,
5160 basicsize,
5161 spec->basicsize) < 0) {
5162 goto bad;
5163 }
5164 goto done;
5165 }
5166 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
5167 PyErr_Clear();
5168 (void) module;
5169 cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
5170 if (unlikely(!cached_type)) goto bad;
5171 if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
5172 if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
5173 done:
5174 Py_DECREF(abi_module);
5175 assert(cached_type == NULL || PyType_Check(cached_type));
5176 return (PyTypeObject *) cached_type;
5177 bad:
5178 Py_XDECREF(cached_type);
5179 cached_type = NULL;
5180 goto done;
5181 }
5182 #endif
5183
5184 /* PyVectorcallFastCallDict */
5185 #if CYTHON_METH_FASTCALL
5186 static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
5187 {
5188 PyObject *res = NULL;
5189 PyObject *kwnames;
5190 PyObject **newargs;
5191 PyObject **kwvalues;
5192 Py_ssize_t i, pos;
5193 size_t j;
5194 PyObject *key, *value;
5195 unsigned long keys_are_strings;
5196 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
5197 newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
5198 if (unlikely(newargs == NULL)) {
5199 PyErr_NoMemory();
5200 return NULL;
5201 }
5202 for (j = 0; j < nargs; j++) newargs[j] = args[j];
5203 kwnames = PyTuple_New(nkw);
5204 if (unlikely(kwnames == NULL)) {
5205 PyMem_Free(newargs);
5206 return NULL;
5207 }
5208 kwvalues = newargs + nargs;
5209 pos = i = 0;
5210 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
5211 while (PyDict_Next(kw, &pos, &key, &value)) {
5212 keys_are_strings &= Py_TYPE(key)->tp_flags;
5213 Py_INCREF(key);
5214 Py_INCREF(value);
5215 PyTuple_SET_ITEM(kwnames, i, key);
5216 kwvalues[i] = value;
5217 i++;
5218 }
5219 if (unlikely(!keys_are_strings)) {
5220 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
5221 goto cleanup;
5222 }
5223 res = vc(func, newargs, nargs, kwnames);
5224 cleanup:
5225 Py_DECREF(kwnames);
5226 for (i = 0; i < nkw; i++)
5227 Py_DECREF(kwvalues[i]);
5228 PyMem_Free(newargs);
5229 return res;
5230 }
5231 static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
5232 {
5233 if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
5234 return vc(func, args, nargs, NULL);
5235 }
5236 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
5237 }
5238 #endif
5239
5240 /* CythonFunctionShared */
5241 static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
5242 #if PY_VERSION_HEX < 0x030900B1
5243 __Pyx_Py_XDECREF_SET(
5244 __Pyx_CyFunction_GetClassObj(f),
5245 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
5246 #else
5247 __Pyx_Py_XDECREF_SET(
5248 ((PyCMethodObject *) (f))->mm_class,
5249 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
5250 #endif
5251 }
5252 static PyObject *
5253 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
5254 {
5255 CYTHON_UNUSED_VAR(closure);
5256 if (unlikely(op->func_doc == NULL)) {
5257 if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
5258 #if PY_MAJOR_VERSION >= 3
5259 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
5260 #else
5261 op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
5262 #endif
5263 if (unlikely(op->func_doc == NULL))
5264 return NULL;
5265 } else {
5266 Py_INCREF(Py_None);
5267 return Py_None;
5268 }
5269 }
5270 Py_INCREF(op->func_doc);
5271 return op->func_doc;
5272 }
5273 static int
5274 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
5275 {
5276 CYTHON_UNUSED_VAR(context);
5277 if (value == NULL) {
5278 value = Py_None;
5279 }
5280 Py_INCREF(value);
5281 __Pyx_Py_XDECREF_SET(op->func_doc, value);
5282 return 0;
5283 }
5284 static PyObject *
5285 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
5286 {
5287 CYTHON_UNUSED_VAR(context);
5288 if (unlikely(op->func_name == NULL)) {
5289 #if PY_MAJOR_VERSION >= 3
5290 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
5291 #else
5292 op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
5293 #endif
5294 if (unlikely(op->func_name == NULL))
5295 return NULL;
5296 }
5297 Py_INCREF(op->func_name);
5298 return op->func_name;
5299 }
5300 static int
5301 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
5302 {
5303 CYTHON_UNUSED_VAR(context);
5304 #if PY_MAJOR_VERSION >= 3
5305 if (unlikely(value == NULL || !PyUnicode_Check(value)))
5306 #else
5307 if (unlikely(value == NULL || !PyString_Check(value)))
5308 #endif
5309 {
5310 PyErr_SetString(PyExc_TypeError,
5311 "__name__ must be set to a string object");
5312 return -1;
5313 }
5314 Py_INCREF(value);
5315 __Pyx_Py_XDECREF_SET(op->func_name, value);
5316 return 0;
5317 }
5318 static PyObject *
5319 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
5320 {
5321 CYTHON_UNUSED_VAR(context);
5322 Py_INCREF(op->func_qualname);
5323 return op->func_qualname;
5324 }
5325 static int
5326 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
5327 {
5328 CYTHON_UNUSED_VAR(context);
5329 #if PY_MAJOR_VERSION >= 3
5330 if (unlikely(value == NULL || !PyUnicode_Check(value)))
5331 #else
5332 if (unlikely(value == NULL || !PyString_Check(value)))
5333 #endif
5334 {
5335 PyErr_SetString(PyExc_TypeError,
5336 "__qualname__ must be set to a string object");
5337 return -1;
5338 }
5339 Py_INCREF(value);
5340 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
5341 return 0;
5342 }
5343 static PyObject *
5344 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
5345 {
5346 CYTHON_UNUSED_VAR(context);
5347 if (unlikely(op->func_dict == NULL)) {
5348 op->func_dict = PyDict_New();
5349 if (unlikely(op->func_dict == NULL))
5350 return NULL;
5351 }
5352 Py_INCREF(op->func_dict);
5353 return op->func_dict;
5354 }
5355 static int
5356 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
5357 {
5358 CYTHON_UNUSED_VAR(context);
5359 if (unlikely(value == NULL)) {
5360 PyErr_SetString(PyExc_TypeError,
5361 "function's dictionary may not be deleted");
5362 return -1;
5363 }
5364 if (unlikely(!PyDict_Check(value))) {
5365 PyErr_SetString(PyExc_TypeError,
5366 "setting function's dictionary to a non-dict");
5367 return -1;
5368 }
5369 Py_INCREF(value);
5370 __Pyx_Py_XDECREF_SET(op->func_dict, value);
5371 return 0;
5372 }
5373 static PyObject *
5374 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
5375 {
5376 CYTHON_UNUSED_VAR(context);
5377 Py_INCREF(op->func_globals);
5378 return op->func_globals;
5379 }
5380 static PyObject *
5381 __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
5382 {
5383 CYTHON_UNUSED_VAR(op);
5384 CYTHON_UNUSED_VAR(context);
5385 Py_INCREF(Py_None);
5386 return Py_None;
5387 }
5388 static PyObject *
5389 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
5390 {
5391 PyObject* result = (op->func_code) ? op->func_code : Py_None;
5392 CYTHON_UNUSED_VAR(context);
5393 Py_INCREF(result);
5394 return result;
5395 }
5396 static int
5397 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
5398 int result = 0;
5399 PyObject *res = op->defaults_getter((PyObject *) op);
5400 if (unlikely(!res))
5401 return -1;
5402 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5403 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
5404 Py_INCREF(op->defaults_tuple);
5405 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
5406 Py_INCREF(op->defaults_kwdict);
5407 #else
5408 op->defaults_tuple = PySequence_ITEM(res, 0);
5409 if (unlikely(!op->defaults_tuple)) result = -1;
5410 else {
5411 op->defaults_kwdict = PySequence_ITEM(res, 1);
5412 if (unlikely(!op->defaults_kwdict)) result = -1;
5413 }
5414 #endif
5415 Py_DECREF(res);
5416 return result;
5417 }
5418 static int
5419 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
5420 CYTHON_UNUSED_VAR(context);
5421 if (!value) {
5422 value = Py_None;
5423 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
5424 PyErr_SetString(PyExc_TypeError,
5425 "__defaults__ must be set to a tuple object");
5426 return -1;
5427 }
5428 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
5429 "currently affect the values used in function calls", 1);
5430 Py_INCREF(value);
5431 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
5432 return 0;
5433 }
5434 static PyObject *
5435 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
5436 PyObject* result = op->defaults_tuple;
5437 CYTHON_UNUSED_VAR(context);
5438 if (unlikely(!result)) {
5439 if (op->defaults_getter) {
5440 if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
5441 result = op->defaults_tuple;
5442 } else {
5443 result = Py_None;
5444 }
5445 }
5446 Py_INCREF(result);
5447 return result;
5448 }
5449 static int
5450 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
5451 CYTHON_UNUSED_VAR(context);
5452 if (!value) {
5453 value = Py_None;
5454 } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
5455 PyErr_SetString(PyExc_TypeError,
5456 "__kwdefaults__ must be set to a dict object");
5457 return -1;
5458 }
5459 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
5460 "currently affect the values used in function calls", 1);
5461 Py_INCREF(value);
5462 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
5463 return 0;
5464 }
5465 static PyObject *
5466 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
5467 PyObject* result = op->defaults_kwdict;
5468 CYTHON_UNUSED_VAR(context);
5469 if (unlikely(!result)) {
5470 if (op->defaults_getter) {
5471 if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
5472 result = op->defaults_kwdict;
5473 } else {
5474 result = Py_None;
5475 }
5476 }
5477 Py_INCREF(result);
5478 return result;
5479 }
5480 static int
5481 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
5482 CYTHON_UNUSED_VAR(context);
5483 if (!value || value == Py_None) {
5484 value = NULL;
5485 } else if (unlikely(!PyDict_Check(value))) {
5486 PyErr_SetString(PyExc_TypeError,
5487 "__annotations__ must be set to a dict object");
5488 return -1;
5489 }
5490 Py_XINCREF(value);
5491 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
5492 return 0;
5493 }
5494 static PyObject *
5495 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
5496 PyObject* result = op->func_annotations;
5497 CYTHON_UNUSED_VAR(context);
5498 if (unlikely(!result)) {
5499 result = PyDict_New();
5500 if (unlikely(!result)) return NULL;
5501 op->func_annotations = result;
5502 }
5503 Py_INCREF(result);
5504 return result;
5505 }
5506 static PyObject *
5507 __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
5508 int is_coroutine;
5509 CYTHON_UNUSED_VAR(context);
5510 if (op->func_is_coroutine) {
5511 return __Pyx_NewRef(op->func_is_coroutine);
5512 }
5513 is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
5514 #if PY_VERSION_HEX >= 0x03050000
5515 if (is_coroutine) {
5516 PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
5517 fromlist = PyList_New(1);
5518 if (unlikely(!fromlist)) return NULL;
5519 Py_INCREF(marker);
5520 PyList_SET_ITEM(fromlist, 0, marker);
5521 module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
5522 Py_DECREF(fromlist);
5523 if (unlikely(!module)) goto ignore;
5524 op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
5525 Py_DECREF(module);
5526 if (likely(op->func_is_coroutine)) {
5527 return __Pyx_NewRef(op->func_is_coroutine);
5528 }
5529 ignore:
5530 PyErr_Clear();
5531 }
5532 #endif
5533 op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
5534 return __Pyx_NewRef(op->func_is_coroutine);
5535 }
5536 static PyGetSetDef __pyx_CyFunction_getsets[] = {
5537 {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
5538 {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
5539 {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
5540 {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
5541 {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
5542 {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
5543 {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
5544 {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
5545 {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
5546 {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
5547 {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
5548 {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
5549 {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
5550 {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
5551 {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
5552 {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
5553 {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
5554 {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
5555 {0, 0, 0, 0, 0}
5556 };
5557 static PyMemberDef __pyx_CyFunction_members[] = {
5558 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
5559 #if CYTHON_USE_TYPE_SPECS
5560 {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
5561 #if CYTHON_METH_FASTCALL
5562 #if CYTHON_BACKPORT_VECTORCALL
5563 {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
5564 #else
5565 {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
5566 #endif
5567 #endif
5568 #if PY_VERSION_HEX < 0x030500A0
5569 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
5570 #else
5571 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
5572 #endif
5573 #endif
5574 {0, 0, 0, 0, 0}
5575 };
5576 static PyObject *
5577 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
5578 {
5579 CYTHON_UNUSED_VAR(args);
5580 #if PY_MAJOR_VERSION >= 3
5581 Py_INCREF(m->func_qualname);
5582 return m->func_qualname;
5583 #else
5584 return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
5585 #endif
5586 }
5587 static PyMethodDef __pyx_CyFunction_methods[] = {
5588 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
5589 {0, 0, 0, 0}
5590 };
5591 #if PY_VERSION_HEX < 0x030500A0
5592 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
5593 #else
5594 #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
5595 #endif
5596 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
5597 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
5598 PyCFunctionObject *cf = (PyCFunctionObject*) op;
5599 if (unlikely(op == NULL))
5600 return NULL;
5601 op->flags = flags;
5602 __Pyx_CyFunction_weakreflist(op) = NULL;
5603 cf->m_ml = ml;
5604 cf->m_self = (PyObject *) op;
5605 Py_XINCREF(closure);
5606 op->func_closure = closure;
5607 Py_XINCREF(module);
5608 cf->m_module = module;
5609 op->func_dict = NULL;
5610 op->func_name = NULL;
5611 Py_INCREF(qualname);
5612 op->func_qualname = qualname;
5613 op->func_doc = NULL;
5614 #if PY_VERSION_HEX < 0x030900B1
5615 op->func_classobj = NULL;
5616 #else
5617 ((PyCMethodObject*)op)->mm_class = NULL;
5618 #endif
5619 op->func_globals = globals;
5620 Py_INCREF(op->func_globals);
5621 Py_XINCREF(code);
5622 op->func_code = code;
5623 op->defaults_pyobjects = 0;
5624 op->defaults_size = 0;
5625 op->defaults = NULL;
5626 op->defaults_tuple = NULL;
5627 op->defaults_kwdict = NULL;
5628 op->defaults_getter = NULL;
5629 op->func_annotations = NULL;
5630 op->func_is_coroutine = NULL;
5631 #if CYTHON_METH_FASTCALL
5632 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
5633 case METH_NOARGS:
5634 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
5635 break;
5636 case METH_O:
5637 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
5638 break;
5639 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
5640 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
5641 break;
5642 case METH_FASTCALL | METH_KEYWORDS:
5643 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
5644 break;
5645 case METH_VARARGS | METH_KEYWORDS:
5646 __Pyx_CyFunction_func_vectorcall(op) = NULL;
5647 break;
5648 default:
5649 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
5650 Py_DECREF(op);
5651 return NULL;
5652 }
5653 #endif
5654 return (PyObject *) op;
5655 }
5656 static int
5657 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
5658 {
5659 Py_CLEAR(m->func_closure);
5660 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
5661 Py_CLEAR(m->func_dict);
5662 Py_CLEAR(m->func_name);
5663 Py_CLEAR(m->func_qualname);
5664 Py_CLEAR(m->func_doc);
5665 Py_CLEAR(m->func_globals);
5666 Py_CLEAR(m->func_code);
5667 #if PY_VERSION_HEX < 0x030900B1
5668 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
5669 #else
5670 {
5671 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
5672 ((PyCMethodObject *) (m))->mm_class = NULL;
5673 Py_XDECREF(cls);
5674 }
5675 #endif
5676 Py_CLEAR(m->defaults_tuple);
5677 Py_CLEAR(m->defaults_kwdict);
5678 Py_CLEAR(m->func_annotations);
5679 Py_CLEAR(m->func_is_coroutine);
5680 if (m->defaults) {
5681 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
5682 int i;
5683 for (i = 0; i < m->defaults_pyobjects; i++)
5684 Py_XDECREF(pydefaults[i]);
5685 PyObject_Free(m->defaults);
5686 m->defaults = NULL;
5687 }
5688 return 0;
5689 }
5690 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
5691 {
5692 if (__Pyx_CyFunction_weakreflist(m) != NULL)
5693 PyObject_ClearWeakRefs((PyObject *) m);
5694 __Pyx_CyFunction_clear(m);
5695 __Pyx_PyHeapTypeObject_GC_Del(m);
5696 }
5697 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
5698 {
5699 PyObject_GC_UnTrack(m);
5700 __Pyx__CyFunction_dealloc(m);
5701 }
5702 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
5703 {
5704 Py_VISIT(m->func_closure);
5705 Py_VISIT(((PyCFunctionObject*)m)->m_module);
5706 Py_VISIT(m->func_dict);
5707 Py_VISIT(m->func_name);
5708 Py_VISIT(m->func_qualname);
5709 Py_VISIT(m->func_doc);
5710 Py_VISIT(m->func_globals);
5711 Py_VISIT(m->func_code);
5712 Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
5713 Py_VISIT(m->defaults_tuple);
5714 Py_VISIT(m->defaults_kwdict);
5715 Py_VISIT(m->func_is_coroutine);
5716 if (m->defaults) {
5717 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
5718 int i;
5719 for (i = 0; i < m->defaults_pyobjects; i++)
5720 Py_VISIT(pydefaults[i]);
5721 }
5722 return 0;
5723 }
5724 static PyObject*
5725 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
5726 {
5727 #if PY_MAJOR_VERSION >= 3
5728 return PyUnicode_FromFormat("<cyfunction %U at %p>",
5729 op->func_qualname, (void *)op);
5730 #else
5731 return PyString_FromFormat("<cyfunction %s at %p>",
5732 PyString_AsString(op->func_qualname), (void *)op);
5733 #endif
5734 }
5735 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
5736 PyCFunctionObject* f = (PyCFunctionObject*)func;
5737 PyCFunction meth = f->m_ml->ml_meth;
5738 Py_ssize_t size;
5739 switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
5740 case METH_VARARGS:
5741 if (likely(kw == NULL || PyDict_Size(kw) == 0))
5742 return (*meth)(self, arg);
5743 break;
5744 case METH_VARARGS | METH_KEYWORDS:
5745 return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
5746 case METH_NOARGS:
5747 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
5748 size = PyTuple_GET_SIZE(arg);
5749 if (likely(size == 0))
5750 return (*meth)(self, NULL);
5751 PyErr_Format(PyExc_TypeError,
5752 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
5753 f->m_ml->ml_name, size);
5754 return NULL;
5755 }
5756 break;
5757 case METH_O:
5758 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
5759 size = PyTuple_GET_SIZE(arg);
5760 if (likely(size == 1)) {
5761 PyObject *result, *arg0;
5762 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5763 arg0 = PyTuple_GET_ITEM(arg, 0);
5764 #else
5765 arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
5766 #endif
5767 result = (*meth)(self, arg0);
5768 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
5769 Py_DECREF(arg0);
5770 #endif
5771 return result;
5772 }
5773 PyErr_Format(PyExc_TypeError,
5774 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
5775 f->m_ml->ml_name, size);
5776 return NULL;
5777 }
5778 break;
5779 default:
5780 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
5781 return NULL;
5782 }
5783 PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
5784 f->m_ml->ml_name);
5785 return NULL;
5786 }
5787 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
5788 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
5789 }
5790 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
5791 PyObject *result;
5792 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
5793 #if CYTHON_METH_FASTCALL
5794 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
5795 if (vc) {
5796 #if CYTHON_ASSUME_SAFE_MACROS
5797 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
5798 #else
5799 (void) &__Pyx_PyVectorcall_FastCallDict;
5800 return PyVectorcall_Call(func, args, kw);
5801 #endif
5802 }
5803 #endif
5804 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
5805 Py_ssize_t argc;
5806 PyObject *new_args;
5807 PyObject *self;
5808 argc = PyTuple_GET_SIZE(args);
5809 new_args = PyTuple_GetSlice(args, 1, argc);
5810 if (unlikely(!new_args))
5811 return NULL;
5812 self = PyTuple_GetItem(args, 0);
5813 if (unlikely(!self)) {
5814 Py_DECREF(new_args);
5815 return NULL;
5816 }
5817 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
5818 Py_DECREF(new_args);
5819 } else {
5820 result = __Pyx_CyFunction_Call(func, args, kw);
5821 }
5822 return result;
5823 }
5824 #if CYTHON_METH_FASTCALL
5825 static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
5826 {
5827 int ret = 0;
5828 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
5829 if (unlikely(nargs < 1)) {
5830 PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
5831 ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
5832 return -1;
5833 }
5834 ret = 1;
5835 }
5836 if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
5837 PyErr_Format(PyExc_TypeError,
5838 "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
5839 return -1;
5840 }
5841 return ret;
5842 }
5843 static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
5844 {
5845 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
5846 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
5847 #if CYTHON_BACKPORT_VECTORCALL
5848 Py_ssize_t nargs = (Py_ssize_t)nargsf;
5849 #else
5850 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
5851 #endif
5852 PyObject *self;
5853 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
5854 case 1:
5855 self = args[0];
5856 args += 1;
5857 nargs -= 1;
5858 break;
5859 case 0:
5860 self = ((PyCFunctionObject*)cyfunc)->m_self;
5861 break;
5862 default:
5863 return NULL;
5864 }
5865 if (unlikely(nargs != 0)) {
5866 PyErr_Format(PyExc_TypeError,
5867 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
5868 def->ml_name, nargs);
5869 return NULL;
5870 }
5871 return def->ml_meth(self, NULL);
5872 }
5873 static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
5874 {
5875 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
5876 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
5877 #if CYTHON_BACKPORT_VECTORCALL
5878 Py_ssize_t nargs = (Py_ssize_t)nargsf;
5879 #else
5880 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
5881 #endif
5882 PyObject *self;
5883 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
5884 case 1:
5885 self = args[0];
5886 args += 1;
5887 nargs -= 1;
5888 break;
5889 case 0:
5890 self = ((PyCFunctionObject*)cyfunc)->m_self;
5891 break;
5892 default:
5893 return NULL;
5894 }
5895 if (unlikely(nargs != 1)) {
5896 PyErr_Format(PyExc_TypeError,
5897 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
5898 def->ml_name, nargs);
5899 return NULL;
5900 }
5901 return def->ml_meth(self, args[0]);
5902 }
5903 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
5904 {
5905 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
5906 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
5907 #if CYTHON_BACKPORT_VECTORCALL
5908 Py_ssize_t nargs = (Py_ssize_t)nargsf;
5909 #else
5910 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
5911 #endif
5912 PyObject *self;
5913 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
5914 case 1:
5915 self = args[0];
5916 args += 1;
5917 nargs -= 1;
5918 break;
5919 case 0:
5920 self = ((PyCFunctionObject*)cyfunc)->m_self;
5921 break;
5922 default:
5923 return NULL;
5924 }
5925 return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
5926 }
5927 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
5928 {
5929 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
5930 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
5931 PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
5932 #if CYTHON_BACKPORT_VECTORCALL
5933 Py_ssize_t nargs = (Py_ssize_t)nargsf;
5934 #else
5935 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
5936 #endif
5937 PyObject *self;
5938 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
5939 case 1:
5940 self = args[0];
5941 args += 1;
5942 nargs -= 1;
5943 break;
5944 case 0:
5945 self = ((PyCFunctionObject*)cyfunc)->m_self;
5946 break;
5947 default:
5948 return NULL;
5949 }
5950 return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, nargs, kwnames);
5951 }
5952 #endif
5953 #if CYTHON_USE_TYPE_SPECS
5954 static PyType_Slot __pyx_CyFunctionType_slots[] = {
5955 {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
5956 {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
5957 {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
5958 {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
5959 {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
5960 {Py_tp_methods, (void *)__pyx_CyFunction_methods},
5961 {Py_tp_members, (void *)__pyx_CyFunction_members},
5962 {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
5963 {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
5964 {0, 0},
5965 };
5966 static PyType_Spec __pyx_CyFunctionType_spec = {
5967 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
5968 sizeof(__pyx_CyFunctionObject),
5969 0,
5970 #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
5971 Py_TPFLAGS_METHOD_DESCRIPTOR |
5972 #endif
5973 #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
5974 _Py_TPFLAGS_HAVE_VECTORCALL |
5975 #endif
5976 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
5977 __pyx_CyFunctionType_slots
5978 };
5979 #else
5980 static PyTypeObject __pyx_CyFunctionType_type = {
5981 PyVarObject_HEAD_INIT(0, 0)
5982 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
5983 sizeof(__pyx_CyFunctionObject),
5984 0,
5985 (destructor) __Pyx_CyFunction_dealloc,
5986 #if !CYTHON_METH_FASTCALL
5987 0,
5988 #elif CYTHON_BACKPORT_VECTORCALL
5989 (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
5990 #else
5991 offsetof(PyCFunctionObject, vectorcall),
5992 #endif
5993 0,
5994 0,
5995 #if PY_MAJOR_VERSION < 3
5996 0,
5997 #else
5998 0,
5999 #endif
6000 (reprfunc) __Pyx_CyFunction_repr,
6001 0,
6002 0,
6003 0,
6004 0,
6005 __Pyx_CyFunction_CallAsMethod,
6006 0,
6007 0,
6008 0,
6009 0,
6010 #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
6011 Py_TPFLAGS_METHOD_DESCRIPTOR |
6012 #endif
6013 #ifdef _Py_TPFLAGS_HAVE_VECTORCALL
6014 _Py_TPFLAGS_HAVE_VECTORCALL |
6015 #endif
6016 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
6017 0,
6018 (traverseproc) __Pyx_CyFunction_traverse,
6019 (inquiry) __Pyx_CyFunction_clear,
6020 0,
6021 #if PY_VERSION_HEX < 0x030500A0
6022 offsetof(__pyx_CyFunctionObject, func_weakreflist),
6023 #else
6024 offsetof(PyCFunctionObject, m_weakreflist),
6025 #endif
6026 0,
6027 0,
6028 __pyx_CyFunction_methods,
6029 __pyx_CyFunction_members,
6030 __pyx_CyFunction_getsets,
6031 0,
6032 0,
6033 __Pyx_PyMethod_New,
6034 0,
6035 offsetof(__pyx_CyFunctionObject, func_dict),
6036 0,
6037 0,
6038 0,
6039 0,
6040 0,
6041 0,
6042 0,
6043 0,
6044 0,
6045 0,
6046 0,
6047 0,
6048 #if PY_VERSION_HEX >= 0x030400a1
6049 0,
6050 #endif
6051 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
6052 0,
6053 #endif
6054 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
6055 0,
6056 #endif
6057 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
6058 0,
6059 #endif
6060 };
6061 #endif
6062 static int __pyx_CyFunction_init(PyObject *module) {
6063 #if CYTHON_USE_TYPE_SPECS
6064 __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
6065 #else
6066 (void) module;
6067 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
6068 #endif
6069 if (unlikely(__pyx_CyFunctionType == NULL)) {
6070 return -1;
6071 }
6072 return 0;
6073 }
6074 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
6075 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
6076 m->defaults = PyObject_Malloc(size);
6077 if (unlikely(!m->defaults))
6078 return PyErr_NoMemory();
6079 memset(m->defaults, 0, size);
6080 m->defaults_pyobjects = pyobjects;
6081 m->defaults_size = size;
6082 return m->defaults;
6083 }
6084 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
6085 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
6086 m->defaults_tuple = tuple;
6087 Py_INCREF(tuple);
6088 }
6089 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
6090 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
6091 m->defaults_kwdict = dict;
6092 Py_INCREF(dict);
6093 }
6094 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
6095 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
6096 m->func_annotations = dict;
6097 Py_INCREF(dict);
6098 }
6099
6100 /* CythonFunction */
6101 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
6102 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
6103 PyObject *op = __Pyx_CyFunction_Init(
6104 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
6105 ml, flags, qualname, closure, module, globals, code
6106 );
6107 if (likely(op)) {
6108 PyObject_GC_Track(op);
6109 }
6110 return op;
6111 }
6112
6113 /* RegisterModuleCleanup */
6114 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
6115 static PyObject* __pyx_module_cleanup_atexit(PyObject *module, PyObject *unused) {
6116 CYTHON_UNUSED_VAR(unused);
6117 __pyx_module_cleanup(module);
6118 Py_INCREF(Py_None); return Py_None;
6119 }
6120 static int __Pyx_RegisterCleanup(void) {
6121 static PyMethodDef cleanup_def = {
6122 "__cleanup", (PyCFunction)__pyx_module_cleanup_atexit, METH_NOARGS, 0};
6123 PyObject *cleanup_func = 0;
6124 PyObject *atexit = 0;
6125 PyObject *reg = 0;
6126 PyObject *args = 0;
6127 PyObject *res = 0;
6128 int ret = -1;
6129 cleanup_func = PyCFunction_New(&cleanup_def, 0);
6130 if (!cleanup_func)
6131 goto bad;
6132 atexit = PyImport_ImportModule("atexit");
6133 if (!atexit)
6134 goto bad;
6135 reg = PyObject_GetAttrString(atexit, "_exithandlers");
6136 if (reg && PyList_Check(reg)) {
6137 PyObject *a, *kw;
6138 a = PyTuple_New(0);
6139 kw = PyDict_New();
6140 if (!a || !kw) {
6141 Py_XDECREF(a);
6142 Py_XDECREF(kw);
6143 goto bad;
6144 }
6145 args = PyTuple_Pack(3, cleanup_func, a, kw);
6146 Py_DECREF(a);
6147 Py_DECREF(kw);
6148 if (!args)
6149 goto bad;
6150 ret = PyList_Insert(reg, 0, args);
6151 } else {
6152 if (!reg)
6153 PyErr_Clear();
6154 Py_XDECREF(reg);
6155 reg = PyObject_GetAttrString(atexit, "register");
6156 if (!reg)
6157 goto bad;
6158 args = PyTuple_Pack(1, cleanup_func);
6159 if (!args)
6160 goto bad;
6161 res = PyObject_CallObject(reg, args);
6162 if (!res)
6163 goto bad;
6164 ret = 0;
6165 }
6166 bad:
6167 Py_XDECREF(cleanup_func);
6168 Py_XDECREF(atexit);
6169 Py_XDECREF(reg);
6170 Py_XDECREF(args);
6171 Py_XDECREF(res);
6172 return ret;
6173 }
6174 #endif
6175
6176 /* PyDictVersioning */
6177 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
6178 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
6179 PyObject *dict = Py_TYPE(obj)->tp_dict;
6180 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
6181 }
6182 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
6183 PyObject **dictptr = NULL;
6184 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
6185 if (offset) {
6186 #if CYTHON_COMPILING_IN_CPYTHON
6187 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
6188 #else
6189 dictptr = _PyObject_GetDictPtr(obj);
6190 #endif
6191 }
6192 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
6193 }
6194 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
6195 PyObject *dict = Py_TYPE(obj)->tp_dict;
6196 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
6197 return 0;
6198 return obj_dict_version == __Pyx_get_object_dict_version(obj);
6199 }
6200 #endif
6201
6202 /* CLineInTraceback */
6203 #ifndef CYTHON_CLINE_IN_TRACEBACK
6204 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
6205 PyObject *use_cline;
6206 PyObject *ptype, *pvalue, *ptraceback;
6207 #if CYTHON_COMPILING_IN_CPYTHON
6208 PyObject **cython_runtime_dict;
6209 #endif
6210 if (unlikely(!__pyx_cython_runtime)) {
6211 return c_line;
6212 }
6213 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
6214 #if CYTHON_COMPILING_IN_CPYTHON
6215 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
6216 if (likely(cython_runtime_dict)) {
6217 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
6218 use_cline, *cython_runtime_dict,
6219 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
6220 } else
6221 #endif
6222 {
6223 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
6224 if (use_cline_obj) {
6225 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
6226 Py_DECREF(use_cline_obj);
6227 } else {
6228 PyErr_Clear();
6229 use_cline = NULL;
6230 }
6231 }
6232 if (!use_cline) {
6233 c_line = 0;
6234 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
6235 }
6236 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
6237 c_line = 0;
6238 }
6239 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
6240 return c_line;
6241 }
6242 #endif
6243
6244 /* CodeObjectCache */
6245 #if !CYTHON_COMPILING_IN_LIMITED_API
6246 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
6247 int start = 0, mid = 0, end = count - 1;
6248 if (end >= 0 && code_line > entries[end].code_line) {
6249 return count;
6250 }
6251 while (start < end) {
6252 mid = start + (end - start) / 2;
6253 if (code_line < entries[mid].code_line) {
6254 end = mid;
6255 } else if (code_line > entries[mid].code_line) {
6256 start = mid + 1;
6257 } else {
6258 return mid;
6259 }
6260 }
6261 if (code_line <= entries[mid].code_line) {
6262 return mid;
6263 } else {
6264 return mid + 1;
6265 }
6266 }
6267 static PyCodeObject *__pyx_find_code_object(int code_line) {
6268 PyCodeObject* code_object;
6269 int pos;
6270 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
6271 return NULL;
6272 }
6273 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
6274 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
6275 return NULL;
6276 }
6277 code_object = __pyx_code_cache.entries[pos].code_object;
6278 Py_INCREF(code_object);
6279 return code_object;
6280 }
6281 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
6282 int pos, i;
6283 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
6284 if (unlikely(!code_line)) {
6285 return;
6286 }
6287 if (unlikely(!entries)) {
6288 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
6289 if (likely(entries)) {
6290 __pyx_code_cache.entries = entries;
6291 __pyx_code_cache.max_count = 64;
6292 __pyx_code_cache.count = 1;
6293 entries[0].code_line = code_line;
6294 entries[0].code_object = code_object;
6295 Py_INCREF(code_object);
6296 }
6297 return;
6298 }
6299 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
6300 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
6301 PyCodeObject* tmp = entries[pos].code_object;
6302 entries[pos].code_object = code_object;
6303 Py_DECREF(tmp);
6304 return;
6305 }
6306 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
6307 int new_max = __pyx_code_cache.max_count + 64;
6308 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
6309 __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
6310 if (unlikely(!entries)) {
6311 return;
6312 }
6313 __pyx_code_cache.entries = entries;
6314 __pyx_code_cache.max_count = new_max;
6315 }
6316 for (i=__pyx_code_cache.count; i>pos; i--) {
6317 entries[i] = entries[i-1];
6318 }
6319 entries[pos].code_line = code_line;
6320 entries[pos].code_object = code_object;
6321 __pyx_code_cache.count++;
6322 Py_INCREF(code_object);
6323 }
6324 #endif
6325
6326 /* AddTraceback */
6327 #include "compile.h"
6328 #include "frameobject.h"
6329 #include "traceback.h"
6330 #if CYTHON_COMPILING_IN_LIMITED_API
6331 static void __Pyx_AddTraceback(const char *funcname, int c_line,
6332 int py_line, const char *filename) {
6333 if (c_line) {
6334 (void) __pyx_cfilenm;
6335 (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
6336 }
6337 _PyTraceback_Add(funcname, filename, py_line);
6338 }
6339 #else
6340 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
6341 const char *funcname, int c_line,
6342 int py_line, const char *filename) {
6343 PyCodeObject *py_code = NULL;
6344 PyObject *py_funcname = NULL;
6345 #if PY_MAJOR_VERSION < 3
6346 PyObject *py_srcfile = NULL;
6347 py_srcfile = PyString_FromString(filename);
6348 if (!py_srcfile) goto bad;
6349 #endif
6350 if (c_line) {
6351 #if PY_MAJOR_VERSION < 3
6352 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
6353 if (!py_funcname) goto bad;
6354 #else
6355 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
6356 if (!py_funcname) goto bad;
6357 funcname = PyUnicode_AsUTF8(py_funcname);
6358 if (!funcname) goto bad;
6359 #endif
6360 }
6361 else {
6362 #if PY_MAJOR_VERSION < 3
6363 py_funcname = PyString_FromString(funcname);
6364 if (!py_funcname) goto bad;
6365 #endif
6366 }
6367 #if PY_MAJOR_VERSION < 3
6368 py_code = __Pyx_PyCode_New(
6369 0,
6370 0,
6371 0,
6372 0,
6373 0,
6374 0,
6375 __pyx_empty_bytes, /*PyObject *code,*/
6376 __pyx_empty_tuple, /*PyObject *consts,*/
6377 __pyx_empty_tuple, /*PyObject *names,*/
6378 __pyx_empty_tuple, /*PyObject *varnames,*/
6379 __pyx_empty_tuple, /*PyObject *freevars,*/
6380 __pyx_empty_tuple, /*PyObject *cellvars,*/
6381 py_srcfile, /*PyObject *filename,*/
6382 py_funcname, /*PyObject *name,*/
6383 py_line,
6384 __pyx_empty_bytes /*PyObject *lnotab*/
6385 );
6386 Py_DECREF(py_srcfile);
6387 #else
6388 py_code = PyCode_NewEmpty(filename, funcname, py_line);
6389 #endif
6390 Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
6391 return py_code;
6392 bad:
6393 Py_XDECREF(py_funcname);
6394 #if PY_MAJOR_VERSION < 3
6395 Py_XDECREF(py_srcfile);
6396 #endif
6397 return NULL;
6398 }
6399 static void __Pyx_AddTraceback(const char *funcname, int c_line,
6400 int py_line, const char *filename) {
6401 PyCodeObject *py_code = 0;
6402 PyFrameObject *py_frame = 0;
6403 PyThreadState *tstate = __Pyx_PyThreadState_Current;
6404 if (c_line) {
6405 c_line = __Pyx_CLineForTraceback(tstate, c_line);
6406 }
6407 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
6408 if (!py_code) {
6409 py_code = __Pyx_CreateCodeObjectForTraceback(
6410 funcname, c_line, py_line, filename);
6411 if (!py_code) goto bad;
6412 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
6413 }
6414 py_frame = PyFrame_New(
6415 tstate, /*PyThreadState *tstate,*/
6416 py_code, /*PyCodeObject *code,*/
6417 __pyx_d, /*PyObject *globals,*/
6418 0 /*PyObject *locals*/
6419 );
6420 if (!py_frame) goto bad;
6421 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
6422 PyTraceBack_Here(py_frame);
6423 bad:
6424 Py_XDECREF(py_code);
6425 Py_XDECREF(py_frame);
6426 }
6427 #endif
6428
6429 /* CIntFromPyVerify */
6430 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
6431 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
6432 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
6433 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
6434 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
6435 {\
6436 func_type value = func_value;\
6437 if (sizeof(target_type) < sizeof(func_type)) {\
6438 if (unlikely(value != (func_type) (target_type) value)) {\
6439 func_type zero = 0;\
6440 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
6441 return (target_type) -1;\
6442 if (is_unsigned && unlikely(value < zero))\
6443 goto raise_neg_overflow;\
6444 else\
6445 goto raise_overflow;\
6446 }\
6447 }\
6448 return (target_type) value;\
6449 }
6450
6451 /* CIntFromPy */
6452 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
6453 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6454 #pragma GCC diagnostic push
6455 #pragma GCC diagnostic ignored "-Wconversion"
6456 #endif
6457 const int neg_one = (int) -1, const_zero = (int) 0;
6458 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6459 #pragma GCC diagnostic pop
6460 #endif
6461 const int is_unsigned = neg_one > const_zero;
6462 #if PY_MAJOR_VERSION < 3
6463 if (likely(PyInt_Check(x))) {
6464 if ((sizeof(int) < sizeof(long))) {
6465 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
6466 } else {
6467 long val = PyInt_AS_LONG(x);
6468 if (is_unsigned && unlikely(val < 0)) {
6469 goto raise_neg_overflow;
6470 }
6471 return (int) val;
6472 }
6473 } else
6474 #endif
6475 if (likely(PyLong_Check(x))) {
6476 if (is_unsigned) {
6477 #if CYTHON_USE_PYLONG_INTERNALS
6478 const digit* digits = ((PyLongObject*)x)->ob_digit;
6479 switch (Py_SIZE(x)) {
6480 case 0: return (int) 0;
6481 case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
6482 case 2:
6483 if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
6484 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
6485 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
6486 } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
6487 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
6488 }
6489 }
6490 break;
6491 case 3:
6492 if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
6493 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
6494 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
6495 } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
6496 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
6497 }
6498 }
6499 break;
6500 case 4:
6501 if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
6502 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
6503 __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])))
6504 } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
6505 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
6506 }
6507 }
6508 break;
6509 }
6510 #endif
6511 #if CYTHON_COMPILING_IN_CPYTHON
6512 if (unlikely(Py_SIZE(x) < 0)) {
6513 goto raise_neg_overflow;
6514 }
6515 #else
6516 {
6517 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
6518 if (unlikely(result < 0))
6519 return (int) -1;
6520 if (unlikely(result == 1))
6521 goto raise_neg_overflow;
6522 }
6523 #endif
6524 if ((sizeof(int) <= sizeof(unsigned long))) {
6525 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
6526 #ifdef HAVE_LONG_LONG
6527 } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
6528 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
6529 #endif
6530 }
6531 } else {
6532 #if CYTHON_USE_PYLONG_INTERNALS
6533 const digit* digits = ((PyLongObject*)x)->ob_digit;
6534 switch (Py_SIZE(x)) {
6535 case 0: return (int) 0;
6536 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
6537 case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
6538 case -2:
6539 if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
6540 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
6541 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
6542 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
6543 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
6544 }
6545 }
6546 break;
6547 case 2:
6548 if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
6549 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
6550 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
6551 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
6552 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
6553 }
6554 }
6555 break;
6556 case -3:
6557 if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
6558 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
6559 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
6560 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
6561 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
6562 }
6563 }
6564 break;
6565 case 3:
6566 if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
6567 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
6568 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
6569 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
6570 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
6571 }
6572 }
6573 break;
6574 case -4:
6575 if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
6576 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
6577 __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])))
6578 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
6579 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
6580 }
6581 }
6582 break;
6583 case 4:
6584 if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
6585 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
6586 __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])))
6587 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
6588 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
6589 }
6590 }
6591 break;
6592 }
6593 #endif
6594 if ((sizeof(int) <= sizeof(long))) {
6595 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
6596 #ifdef HAVE_LONG_LONG
6597 } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
6598 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
6599 #endif
6600 }
6601 }
6602 {
6603 #if (CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) && !defined(_PyLong_AsByteArray)
6604 PyErr_SetString(PyExc_RuntimeError,
6605 "_PyLong_AsByteArray() not available, cannot convert large numbers");
6606 #else
6607 int val;
6608 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
6609 #if PY_MAJOR_VERSION < 3
6610 if (likely(v) && !PyLong_Check(v)) {
6611 PyObject *tmp = v;
6612 v = PyNumber_Long(tmp);
6613 Py_DECREF(tmp);
6614 }
6615 #endif
6616 if (likely(v)) {
6617 int one = 1; int is_little = (int)*(unsigned char *)&one;
6618 unsigned char *bytes = (unsigned char *)&val;
6619 int ret = _PyLong_AsByteArray((PyLongObject *)v,
6620 bytes, sizeof(val),
6621 is_little, !is_unsigned);
6622 Py_DECREF(v);
6623 if (likely(!ret))
6624 return val;
6625 }
6626 #endif
6627 return (int) -1;
6628 }
6629 } else {
6630 int val;
6631 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
6632 if (!tmp) return (int) -1;
6633 val = __Pyx_PyInt_As_int(tmp);
6634 Py_DECREF(tmp);
6635 return val;
6636 }
6637 raise_overflow:
6638 PyErr_SetString(PyExc_OverflowError,
6639 "value too large to convert to int");
6640 return (int) -1;
6641 raise_neg_overflow:
6642 PyErr_SetString(PyExc_OverflowError,
6643 "can't convert negative value to int");
6644 return (int) -1;
6645 }
6646
6647 /* FormatTypeName */
6648 #if CYTHON_COMPILING_IN_LIMITED_API
6649 static __Pyx_TypeName
6650 __Pyx_PyType_GetName(PyTypeObject* tp)
6651 {
6652 PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
6653 __pyx_n_s_name);
6654 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
6655 PyErr_Clear();
6656 Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__5));
6657 }
6658 return name;
6659 }
6660 #endif
6661
6662 /* CIntToPy */
6663 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
6664 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6665 #pragma GCC diagnostic push
6666 #pragma GCC diagnostic ignored "-Wconversion"
6667 #endif
6668 const long neg_one = (long) -1, const_zero = (long) 0;
6669 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6670 #pragma GCC diagnostic pop
6671 #endif
6672 const int is_unsigned = neg_one > const_zero;
6673 if (is_unsigned) {
6674 if (sizeof(long) < sizeof(long)) {
6675 return PyInt_FromLong((long) value);
6676 } else if (sizeof(long) <= sizeof(unsigned long)) {
6677 return PyLong_FromUnsignedLong((unsigned long) value);
6678 #ifdef HAVE_LONG_LONG
6679 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
6680 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
6681 #endif
6682 }
6683 } else {
6684 if (sizeof(long) <= sizeof(long)) {
6685 return PyInt_FromLong((long) value);
6686 #ifdef HAVE_LONG_LONG
6687 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
6688 return PyLong_FromLongLong((PY_LONG_LONG) value);
6689 #endif
6690 }
6691 }
6692 {
6693 int one = 1; int little = (int)*(unsigned char *)&one;
6694 unsigned char *bytes = (unsigned char *)&value;
6695 return _PyLong_FromByteArray(bytes, sizeof(long),
6696 little, !is_unsigned);
6697 }
6698 }
6699
6700 /* CIntFromPy */
6701 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
6702 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6703 #pragma GCC diagnostic push
6704 #pragma GCC diagnostic ignored "-Wconversion"
6705 #endif
6706 const long neg_one = (long) -1, const_zero = (long) 0;
6707 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6708 #pragma GCC diagnostic pop
6709 #endif
6710 const int is_unsigned = neg_one > const_zero;
6711 #if PY_MAJOR_VERSION < 3
6712 if (likely(PyInt_Check(x))) {
6713 if ((sizeof(long) < sizeof(long))) {
6714 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
6715 } else {
6716 long val = PyInt_AS_LONG(x);
6717 if (is_unsigned && unlikely(val < 0)) {
6718 goto raise_neg_overflow;
6719 }
6720 return (long) val;
6721 }
6722 } else
6723 #endif
6724 if (likely(PyLong_Check(x))) {
6725 if (is_unsigned) {
6726 #if CYTHON_USE_PYLONG_INTERNALS
6727 const digit* digits = ((PyLongObject*)x)->ob_digit;
6728 switch (Py_SIZE(x)) {
6729 case 0: return (long) 0;
6730 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
6731 case 2:
6732 if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
6733 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
6734 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
6735 } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
6736 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
6737 }
6738 }
6739 break;
6740 case 3:
6741 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
6742 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
6743 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
6744 } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
6745 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
6746 }
6747 }
6748 break;
6749 case 4:
6750 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
6751 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
6752 __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])))
6753 } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
6754 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
6755 }
6756 }
6757 break;
6758 }
6759 #endif
6760 #if CYTHON_COMPILING_IN_CPYTHON
6761 if (unlikely(Py_SIZE(x) < 0)) {
6762 goto raise_neg_overflow;
6763 }
6764 #else
6765 {
6766 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
6767 if (unlikely(result < 0))
6768 return (long) -1;
6769 if (unlikely(result == 1))
6770 goto raise_neg_overflow;
6771 }
6772 #endif
6773 if ((sizeof(long) <= sizeof(unsigned long))) {
6774 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
6775 #ifdef HAVE_LONG_LONG
6776 } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
6777 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
6778 #endif
6779 }
6780 } else {
6781 #if CYTHON_USE_PYLONG_INTERNALS
6782 const digit* digits = ((PyLongObject*)x)->ob_digit;
6783 switch (Py_SIZE(x)) {
6784 case 0: return (long) 0;
6785 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
6786 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
6787 case -2:
6788 if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
6789 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
6790 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
6791 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
6792 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
6793 }
6794 }
6795 break;
6796 case 2:
6797 if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
6798 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
6799 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
6800 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
6801 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
6802 }
6803 }
6804 break;
6805 case -3:
6806 if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
6807 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
6808 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
6809 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
6810 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
6811 }
6812 }
6813 break;
6814 case 3:
6815 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
6816 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
6817 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
6818 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
6819 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
6820 }
6821 }
6822 break;
6823 case -4:
6824 if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
6825 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
6826 __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])))
6827 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
6828 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
6829 }
6830 }
6831 break;
6832 case 4:
6833 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
6834 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
6835 __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])))
6836 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
6837 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
6838 }
6839 }
6840 break;
6841 }
6842 #endif
6843 if ((sizeof(long) <= sizeof(long))) {
6844 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
6845 #ifdef HAVE_LONG_LONG
6846 } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
6847 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
6848 #endif
6849 }
6850 }
6851 {
6852 #if (CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) && !defined(_PyLong_AsByteArray)
6853 PyErr_SetString(PyExc_RuntimeError,
6854 "_PyLong_AsByteArray() not available, cannot convert large numbers");
6855 #else
6856 long val;
6857 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
6858 #if PY_MAJOR_VERSION < 3
6859 if (likely(v) && !PyLong_Check(v)) {
6860 PyObject *tmp = v;
6861 v = PyNumber_Long(tmp);
6862 Py_DECREF(tmp);
6863 }
6864 #endif
6865 if (likely(v)) {
6866 int one = 1; int is_little = (int)*(unsigned char *)&one;
6867 unsigned char *bytes = (unsigned char *)&val;
6868 int ret = _PyLong_AsByteArray((PyLongObject *)v,
6869 bytes, sizeof(val),
6870 is_little, !is_unsigned);
6871 Py_DECREF(v);
6872 if (likely(!ret))
6873 return val;
6874 }
6875 #endif
6876 return (long) -1;
6877 }
6878 } else {
6879 long val;
6880 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
6881 if (!tmp) return (long) -1;
6882 val = __Pyx_PyInt_As_long(tmp);
6883 Py_DECREF(tmp);
6884 return val;
6885 }
6886 raise_overflow:
6887 PyErr_SetString(PyExc_OverflowError,
6888 "value too large to convert to long");
6889 return (long) -1;
6890 raise_neg_overflow:
6891 PyErr_SetString(PyExc_OverflowError,
6892 "can't convert negative value to long");
6893 return (long) -1;
6894 }
6895
6896 /* FastTypeChecks */
6897 #if CYTHON_COMPILING_IN_CPYTHON
6898 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
6899 while (a) {
6900 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
6901 if (a == b)
6902 return 1;
6903 }
6904 return b == &PyBaseObject_Type;
6905 }
6906 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
6907 PyObject *mro;
6908 if (a == b) return 1;
6909 mro = a->tp_mro;
6910 if (likely(mro)) {
6911 Py_ssize_t i, n;
6912 n = PyTuple_GET_SIZE(mro);
6913 for (i = 0; i < n; i++) {
6914 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
6915 return 1;
6916 }
6917 return 0;
6918 }
6919 return __Pyx_InBases(a, b);
6920 }
6921 static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
6922 PyObject *mro;
6923 if (cls == a || cls == b) return 1;
6924 mro = cls->tp_mro;
6925 if (likely(mro)) {
6926 Py_ssize_t i, n;
6927 n = PyTuple_GET_SIZE(mro);
6928 for (i = 0; i < n; i++) {
6929 PyObject *base = PyTuple_GET_ITEM(mro, i);
6930 if (base == (PyObject *)a || base == (PyObject *)b)
6931 return 1;
6932 }
6933 return 0;
6934 }
6935 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
6936 }
6937 #if PY_MAJOR_VERSION == 2
6938 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
6939 PyObject *exception, *value, *tb;
6940 int res;
6941 __Pyx_PyThreadState_declare
6942 __Pyx_PyThreadState_assign
6943 __Pyx_ErrFetch(&exception, &value, &tb);
6944 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
6945 if (unlikely(res == -1)) {
6946 PyErr_WriteUnraisable(err);
6947 res = 0;
6948 }
6949 if (!res) {
6950 res = PyObject_IsSubclass(err, exc_type2);
6951 if (unlikely(res == -1)) {
6952 PyErr_WriteUnraisable(err);
6953 res = 0;
6954 }
6955 }
6956 __Pyx_ErrRestore(exception, value, tb);
6957 return res;
6958 }
6959 #else
6960 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
6961 if (exc_type1) {
6962 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
6963 } else {
6964 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
6965 }
6966 }
6967 #endif
6968 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
6969 Py_ssize_t i, n;
6970 assert(PyExceptionClass_Check(exc_type));
6971 n = PyTuple_GET_SIZE(tuple);
6972 #if PY_MAJOR_VERSION >= 3
6973 for (i=0; i<n; i++) {
6974 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
6975 }
6976 #endif
6977 for (i=0; i<n; i++) {
6978 PyObject *t = PyTuple_GET_ITEM(tuple, i);
6979 #if PY_MAJOR_VERSION < 3
6980 if (likely(exc_type == t)) return 1;
6981 #endif
6982 if (likely(PyExceptionClass_Check(t))) {
6983 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
6984 } else {
6985 }
6986 }
6987 return 0;
6988 }
6989 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
6990 if (likely(err == exc_type)) return 1;
6991 if (likely(PyExceptionClass_Check(err))) {
6992 if (likely(PyExceptionClass_Check(exc_type))) {
6993 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
6994 } else if (likely(PyTuple_Check(exc_type))) {
6995 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
6996 } else {
6997 }
6998 }
6999 return PyErr_GivenExceptionMatches(err, exc_type);
7000 }
7001 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
7002 assert(PyExceptionClass_Check(exc_type1));
7003 assert(PyExceptionClass_Check(exc_type2));
7004 if (likely(err == exc_type1 || err == exc_type2)) return 1;
7005 if (likely(PyExceptionClass_Check(err))) {
7006 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
7007 }
7008 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
7009 }
7010 #endif
7011
7012 /* CheckBinaryVersion */
7013 static int __Pyx_check_binary_version(void) {
7014 char ctversion[4], rtversion[4];
7015 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
7016 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
7017 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
7018 char message[200];
7019 PyOS_snprintf(message, sizeof(message),
7020 "compile time version %s of module '%.100s' "
7021 "does not match runtime version %s",
7022 ctversion, __Pyx_MODULE_NAME, rtversion);
7023 return PyErr_WarnEx(NULL, message, 1);
7024 }
7025 return 0;
7026 }
7027
7028 /* InitStrings */
7029 #if PY_MAJOR_VERSION >= 3
7030 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
7031 if (t.is_unicode | t.is_str) {
7032 if (t.intern) {
7033 *str = PyUnicode_InternFromString(t.s);
7034 } else if (t.encoding) {
7035 *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
7036 } else {
7037 *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
7038 }
7039 } else {
7040 *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
7041 }
7042 if (!*str)
7043 return -1;
7044 if (PyObject_Hash(*str) == -1)
7045 return -1;
7046 return 0;
7047 }
7048 #endif
7049 #if !CYTHON_COMPILING_IN_LIMITED_API
7050 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
7051 while (t->p) {
7052 #if PY_MAJOR_VERSION >= 3
7053 __Pyx_InitString(*t, t->p);
7054 #else
7055 if (t->is_unicode) {
7056 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
7057 } else if (t->intern) {
7058 *t->p = PyString_InternFromString(t->s);
7059 } else {
7060 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
7061 }
7062 if (!*t->p)
7063 return -1;
7064 if (PyObject_Hash(*t->p) == -1)
7065 return -1;
7066 #endif
7067 ++t;
7068 }
7069 return 0;
7070 }
7071 #endif
7072
7073 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
7074 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
7075 }
7076 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
7077 Py_ssize_t ignore;
7078 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
7079 }
7080 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
7081 #if !CYTHON_PEP393_ENABLED
7082 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
7083 char* defenc_c;
7084 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
7085 if (!defenc) return NULL;
7086 defenc_c = PyBytes_AS_STRING(defenc);
7087 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
7088 {
7089 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
7090 char* c;
7091 for (c = defenc_c; c < end; c++) {
7092 if ((unsigned char) (*c) >= 128) {
7093 PyUnicode_AsASCIIString(o);
7094 return NULL;
7095 }
7096 }
7097 }
7098 #endif
7099 *length = PyBytes_GET_SIZE(defenc);
7100 return defenc_c;
7101 }
7102 #else
7103 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
7104 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
7105 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
7106 if (likely(PyUnicode_IS_ASCII(o))) {
7107 *length = PyUnicode_GET_LENGTH(o);
7108 return PyUnicode_AsUTF8(o);
7109 } else {
7110 PyUnicode_AsASCIIString(o);
7111 return NULL;
7112 }
7113 #else
7114 return PyUnicode_AsUTF8AndSize(o, length);
7115 #endif
7116 }
7117 #endif
7118 #endif
7119 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
7120 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
7121 if (
7122 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
7123 __Pyx_sys_getdefaultencoding_not_ascii &&
7124 #endif
7125 PyUnicode_Check(o)) {
7126 return __Pyx_PyUnicode_AsStringAndSize(o, length);
7127 } else
7128 #endif
7129 #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
7130 if (PyByteArray_Check(o)) {
7131 *length = PyByteArray_GET_SIZE(o);
7132 return PyByteArray_AS_STRING(o);
7133 } else
7134 #endif
7135 {
7136 char* result;
7137 int r = PyBytes_AsStringAndSize(o, &result, length);
7138 if (unlikely(r < 0)) {
7139 return NULL;
7140 } else {
7141 return result;
7142 }
7143 }
7144 }
7145 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
7146 int is_true = x == Py_True;
7147 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
7148 else return PyObject_IsTrue(x);
7149 }
7150 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
7151 int retval;
7152 if (unlikely(!x)) return -1;
7153 retval = __Pyx_PyObject_IsTrue(x);
7154 Py_DECREF(x);
7155 return retval;
7156 }
7157 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
7158 __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
7159 #if PY_MAJOR_VERSION >= 3
7160 if (PyLong_Check(result)) {
7161 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
7162 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
7163 "The ability to return an instance of a strict subclass of int is deprecated, "
7164 "and may be removed in a future version of Python.",
7165 result_type_name)) {
7166 __Pyx_DECREF_TypeName(result_type_name);
7167 Py_DECREF(result);
7168 return NULL;
7169 }
7170 __Pyx_DECREF_TypeName(result_type_name);
7171 return result;
7172 }
7173 #endif
7174 PyErr_Format(PyExc_TypeError,
7175 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
7176 type_name, type_name, result_type_name);
7177 __Pyx_DECREF_TypeName(result_type_name);
7178 Py_DECREF(result);
7179 return NULL;
7180 }
7181 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
7182 #if CYTHON_USE_TYPE_SLOTS
7183 PyNumberMethods *m;
7184 #endif
7185 const char *name = NULL;
7186 PyObject *res = NULL;
7187 #if PY_MAJOR_VERSION < 3
7188 if (likely(PyInt_Check(x) || PyLong_Check(x)))
7189 #else
7190 if (likely(PyLong_Check(x)))
7191 #endif
7192 return __Pyx_NewRef(x);
7193 #if CYTHON_USE_TYPE_SLOTS
7194 m = Py_TYPE(x)->tp_as_number;
7195 #if PY_MAJOR_VERSION < 3
7196 if (m && m->nb_int) {
7197 name = "int";
7198 res = m->nb_int(x);
7199 }
7200 else if (m && m->nb_long) {
7201 name = "long";
7202 res = m->nb_long(x);
7203 }
7204 #else
7205 if (likely(m && m->nb_int)) {
7206 name = "int";
7207 res = m->nb_int(x);
7208 }
7209 #endif
7210 #else
7211 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
7212 res = PyNumber_Int(x);
7213 }
7214 #endif
7215 if (likely(res)) {
7216 #if PY_MAJOR_VERSION < 3
7217 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
7218 #else
7219 if (unlikely(!PyLong_CheckExact(res))) {
7220 #endif
7221 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
7222 }
7223 }
7224 else if (!PyErr_Occurred()) {
7225 PyErr_SetString(PyExc_TypeError,
7226 "an integer is required");
7227 }
7228 return res;
7229 }
7230 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
7231 Py_ssize_t ival;
7232 PyObject *x;
7233 #if PY_MAJOR_VERSION < 3
7234 if (likely(PyInt_CheckExact(b))) {
7235 if (sizeof(Py_ssize_t) >= sizeof(long))
7236 return PyInt_AS_LONG(b);
7237 else
7238 return PyInt_AsSsize_t(b);
7239 }
7240 #endif
7241 if (likely(PyLong_CheckExact(b))) {
7242 #if CYTHON_USE_PYLONG_INTERNALS
7243 const digit* digits = ((PyLongObject*)b)->ob_digit;
7244 const Py_ssize_t size = Py_SIZE(b);
7245 if (likely(__Pyx_sst_abs(size) <= 1)) {
7246 ival = likely(size) ? digits[0] : 0;
7247 if (size == -1) ival = -ival;
7248 return ival;
7249 } else {
7250 switch (size) {
7251 case 2:
7252 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
7253 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
7254 }
7255 break;
7256 case -2:
7257 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
7258 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
7259 }
7260 break;
7261 case 3:
7262 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
7263 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
7264 }
7265 break;
7266 case -3:
7267 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
7268 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
7269 }
7270 break;
7271 case 4:
7272 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
7273 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]));
7274 }
7275 break;
7276 case -4:
7277 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
7278 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]));
7279 }
7280 break;
7281 }
7282 }
7283 #endif
7284 return PyLong_AsSsize_t(b);
7285 }
7286 x = PyNumber_Index(b);
7287 if (!x) return -1;
7288 ival = PyInt_AsSsize_t(x);
7289 Py_DECREF(x);
7290 return ival;
7291 }
7292 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
7293 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
7294 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
7295 #if PY_MAJOR_VERSION < 3
7296 } else if (likely(PyInt_CheckExact(o))) {
7297 return PyInt_AS_LONG(o);
7298 #endif
7299 } else {
7300 Py_ssize_t ival;
7301 PyObject *x;
7302 x = PyNumber_Index(o);
7303 if (!x) return -1;
7304 ival = PyInt_AsLong(x);
7305 Py_DECREF(x);
7306 return ival;
7307 }
7308 }
7309 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
7310 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
7311 }
7312 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
7313 return PyInt_FromSize_t(ival);
7314 }
7315
7316
7317 /* #### Code section: utility_code_pragmas_end ### */
7318 #if _MSV_VER
7319 #pragma warning( pop )
7320 #endif
7321
7322
7323
7324 /* #### Code section: end ### */
7325 #endif /* Py_PYTHON_H */