comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/site-packages/pysam/libcsamfile.c @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
comparison
equal deleted inserted replaced
67:0e9998148a16 69:33d812a61356
1 /* Generated by Cython 3.0.11 */
2
3 /* BEGIN: Cython Metadata
4 {
5 "distutils": {
6 "define_macros": [
7 [
8 "BUILDING_WHEEL",
9 null
10 ]
11 ],
12 "depends": [
13 "/project/htslib/htslib/bgzf.h",
14 "/project/htslib/htslib/cram.h",
15 "/project/htslib/htslib/faidx.h",
16 "/project/htslib/htslib/hfile.h",
17 "/project/htslib/htslib/hts.h",
18 "/project/htslib/htslib/kstring.h",
19 "/project/htslib/htslib/sam.h",
20 "/project/htslib/htslib/tbx.h",
21 "/project/htslib/htslib/vcf.h",
22 "/project/htslib/htslib/vcfutils.h",
23 "/project/pysam/htslib_util.h",
24 "/project/pysam/pysam_stream.h"
25 ],
26 "extra_compile_args": [
27 "-Wno-unused",
28 "-Wno-strict-prototypes",
29 "-Wno-sign-compare",
30 "-Wno-error=declaration-after-statement"
31 ],
32 "extra_link_args": [
33 "-Wl,-rpath,$ORIGIN"
34 ],
35 "include_dirs": [
36 "pysam",
37 "/project/pysam",
38 "/project/htslib",
39 "/project/samtools",
40 "/project/samtools/lz4",
41 "/project/bcftools",
42 "/project"
43 ],
44 "language": "c",
45 "libraries": [
46 "z",
47 "lzma",
48 "bz2",
49 "z",
50 "m",
51 "curl",
52 "crypto",
53 "chtslib.cpython-37m-x86_64-linux-gnu",
54 "cutils.cpython-37m-x86_64-linux-gnu"
55 ],
56 "library_dirs": [
57 "/project/pysam",
58 "/project",
59 "build/lib.linux-x86_64-cpython-37/pysam",
60 "build/lib.linux-x86_64-cpython-37/pysam",
61 "build/lib.linux-x86_64-cpython-37/pysam",
62 "build/lib.linux-x86_64-cpython-37/pysam",
63 "build/lib.linux-x86_64-cpython-37/pysam",
64 "build/lib.linux-x86_64-cpython-37/pysam"
65 ],
66 "name": "pysam.libcsamfile",
67 "sources": [
68 "pysam/libcsamfile.pyx"
69 ]
70 },
71 "module_name": "pysam.libcsamfile"
72 }
73 END: Cython Metadata */
74
75 #ifndef PY_SSIZE_T_CLEAN
76 #define PY_SSIZE_T_CLEAN
77 #endif /* PY_SSIZE_T_CLEAN */
78 #if defined(CYTHON_LIMITED_API) && 0
79 #ifndef Py_LIMITED_API
80 #if CYTHON_LIMITED_API+0 > 0x03030000
81 #define Py_LIMITED_API CYTHON_LIMITED_API
82 #else
83 #define Py_LIMITED_API 0x03030000
84 #endif
85 #endif
86 #endif
87
88 #include "Python.h"
89
90 #if PY_MAJOR_VERSION >= 3
91 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj)
92 #else
93 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL)
94 #endif
95
96
97 #if PY_MAJOR_VERSION <= 2
98 #define PyDict_GetItemWithError _PyDict_GetItemWithError
99 #endif
100
101
102 #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get)
103 #define PyContextVar_Get(var, d, v) ((d) ? ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) : ((v)[0] = NULL, 0) )
104 #endif
105
106 #ifndef Py_PYTHON_H
107 #error Python headers needed to compile C extensions, please install development version of Python.
108 #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
109 #error Cython requires Python 2.7+ or Python 3.3+.
110 #else
111 #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
112 #define __PYX_EXTRA_ABI_MODULE_NAME "limited"
113 #else
114 #define __PYX_EXTRA_ABI_MODULE_NAME ""
115 #endif
116 #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
117 #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
118 #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
119 #define CYTHON_HEX_VERSION 0x03000BF0
120 #define CYTHON_FUTURE_DIVISION 1
121 #include <stddef.h>
122 #ifndef offsetof
123 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
124 #endif
125 #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
126 #ifndef __stdcall
127 #define __stdcall
128 #endif
129 #ifndef __cdecl
130 #define __cdecl
131 #endif
132 #ifndef __fastcall
133 #define __fastcall
134 #endif
135 #endif
136 #ifndef DL_IMPORT
137 #define DL_IMPORT(t) t
138 #endif
139 #ifndef DL_EXPORT
140 #define DL_EXPORT(t) t
141 #endif
142 #define __PYX_COMMA ,
143 #ifndef HAVE_LONG_LONG
144 #define HAVE_LONG_LONG
145 #endif
146 #ifndef PY_LONG_LONG
147 #define PY_LONG_LONG LONG_LONG
148 #endif
149 #ifndef Py_HUGE_VAL
150 #define Py_HUGE_VAL HUGE_VAL
151 #endif
152 #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
153 #if defined(GRAALVM_PYTHON)
154 /* For very preliminary testing purposes. Most variables are set the same as PyPy.
155 The existence of this section does not imply that anything works or is even tested */
156 #define CYTHON_COMPILING_IN_PYPY 0
157 #define CYTHON_COMPILING_IN_CPYTHON 0
158 #define CYTHON_COMPILING_IN_LIMITED_API 0
159 #define CYTHON_COMPILING_IN_GRAAL 1
160 #define CYTHON_COMPILING_IN_NOGIL 0
161 #undef CYTHON_USE_TYPE_SLOTS
162 #define CYTHON_USE_TYPE_SLOTS 0
163 #undef CYTHON_USE_TYPE_SPECS
164 #define CYTHON_USE_TYPE_SPECS 0
165 #undef CYTHON_USE_PYTYPE_LOOKUP
166 #define CYTHON_USE_PYTYPE_LOOKUP 0
167 #if PY_VERSION_HEX < 0x03050000
168 #undef CYTHON_USE_ASYNC_SLOTS
169 #define CYTHON_USE_ASYNC_SLOTS 0
170 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
171 #define CYTHON_USE_ASYNC_SLOTS 1
172 #endif
173 #undef CYTHON_USE_PYLIST_INTERNALS
174 #define CYTHON_USE_PYLIST_INTERNALS 0
175 #undef CYTHON_USE_UNICODE_INTERNALS
176 #define CYTHON_USE_UNICODE_INTERNALS 0
177 #undef CYTHON_USE_UNICODE_WRITER
178 #define CYTHON_USE_UNICODE_WRITER 0
179 #undef CYTHON_USE_PYLONG_INTERNALS
180 #define CYTHON_USE_PYLONG_INTERNALS 0
181 #undef CYTHON_AVOID_BORROWED_REFS
182 #define CYTHON_AVOID_BORROWED_REFS 1
183 #undef CYTHON_ASSUME_SAFE_MACROS
184 #define CYTHON_ASSUME_SAFE_MACROS 0
185 #undef CYTHON_UNPACK_METHODS
186 #define CYTHON_UNPACK_METHODS 0
187 #undef CYTHON_FAST_THREAD_STATE
188 #define CYTHON_FAST_THREAD_STATE 0
189 #undef CYTHON_FAST_GIL
190 #define CYTHON_FAST_GIL 0
191 #undef CYTHON_METH_FASTCALL
192 #define CYTHON_METH_FASTCALL 0
193 #undef CYTHON_FAST_PYCALL
194 #define CYTHON_FAST_PYCALL 0
195 #ifndef CYTHON_PEP487_INIT_SUBCLASS
196 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
197 #endif
198 #undef CYTHON_PEP489_MULTI_PHASE_INIT
199 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
200 #undef CYTHON_USE_MODULE_STATE
201 #define CYTHON_USE_MODULE_STATE 0
202 #undef CYTHON_USE_TP_FINALIZE
203 #define CYTHON_USE_TP_FINALIZE 0
204 #undef CYTHON_USE_DICT_VERSIONS
205 #define CYTHON_USE_DICT_VERSIONS 0
206 #undef CYTHON_USE_EXC_INFO_STACK
207 #define CYTHON_USE_EXC_INFO_STACK 0
208 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
209 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
210 #endif
211 #undef CYTHON_USE_FREELISTS
212 #define CYTHON_USE_FREELISTS 0
213 #elif defined(PYPY_VERSION)
214 #define CYTHON_COMPILING_IN_PYPY 1
215 #define CYTHON_COMPILING_IN_CPYTHON 0
216 #define CYTHON_COMPILING_IN_LIMITED_API 0
217 #define CYTHON_COMPILING_IN_GRAAL 0
218 #define CYTHON_COMPILING_IN_NOGIL 0
219 #undef CYTHON_USE_TYPE_SLOTS
220 #define CYTHON_USE_TYPE_SLOTS 0
221 #ifndef CYTHON_USE_TYPE_SPECS
222 #define CYTHON_USE_TYPE_SPECS 0
223 #endif
224 #undef CYTHON_USE_PYTYPE_LOOKUP
225 #define CYTHON_USE_PYTYPE_LOOKUP 0
226 #if PY_VERSION_HEX < 0x03050000
227 #undef CYTHON_USE_ASYNC_SLOTS
228 #define CYTHON_USE_ASYNC_SLOTS 0
229 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
230 #define CYTHON_USE_ASYNC_SLOTS 1
231 #endif
232 #undef CYTHON_USE_PYLIST_INTERNALS
233 #define CYTHON_USE_PYLIST_INTERNALS 0
234 #undef CYTHON_USE_UNICODE_INTERNALS
235 #define CYTHON_USE_UNICODE_INTERNALS 0
236 #undef CYTHON_USE_UNICODE_WRITER
237 #define CYTHON_USE_UNICODE_WRITER 0
238 #undef CYTHON_USE_PYLONG_INTERNALS
239 #define CYTHON_USE_PYLONG_INTERNALS 0
240 #undef CYTHON_AVOID_BORROWED_REFS
241 #define CYTHON_AVOID_BORROWED_REFS 1
242 #undef CYTHON_ASSUME_SAFE_MACROS
243 #define CYTHON_ASSUME_SAFE_MACROS 0
244 #undef CYTHON_UNPACK_METHODS
245 #define CYTHON_UNPACK_METHODS 0
246 #undef CYTHON_FAST_THREAD_STATE
247 #define CYTHON_FAST_THREAD_STATE 0
248 #undef CYTHON_FAST_GIL
249 #define CYTHON_FAST_GIL 0
250 #undef CYTHON_METH_FASTCALL
251 #define CYTHON_METH_FASTCALL 0
252 #undef CYTHON_FAST_PYCALL
253 #define CYTHON_FAST_PYCALL 0
254 #ifndef CYTHON_PEP487_INIT_SUBCLASS
255 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
256 #endif
257 #if PY_VERSION_HEX < 0x03090000
258 #undef CYTHON_PEP489_MULTI_PHASE_INIT
259 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
260 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
261 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
262 #endif
263 #undef CYTHON_USE_MODULE_STATE
264 #define CYTHON_USE_MODULE_STATE 0
265 #undef CYTHON_USE_TP_FINALIZE
266 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
267 #undef CYTHON_USE_DICT_VERSIONS
268 #define CYTHON_USE_DICT_VERSIONS 0
269 #undef CYTHON_USE_EXC_INFO_STACK
270 #define CYTHON_USE_EXC_INFO_STACK 0
271 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
272 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
273 #endif
274 #undef CYTHON_USE_FREELISTS
275 #define CYTHON_USE_FREELISTS 0
276 #elif defined(CYTHON_LIMITED_API)
277 #ifdef Py_LIMITED_API
278 #undef __PYX_LIMITED_VERSION_HEX
279 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
280 #endif
281 #define CYTHON_COMPILING_IN_PYPY 0
282 #define CYTHON_COMPILING_IN_CPYTHON 0
283 #define CYTHON_COMPILING_IN_LIMITED_API 1
284 #define CYTHON_COMPILING_IN_GRAAL 0
285 #define CYTHON_COMPILING_IN_NOGIL 0
286 #undef CYTHON_CLINE_IN_TRACEBACK
287 #define CYTHON_CLINE_IN_TRACEBACK 0
288 #undef CYTHON_USE_TYPE_SLOTS
289 #define CYTHON_USE_TYPE_SLOTS 0
290 #undef CYTHON_USE_TYPE_SPECS
291 #define CYTHON_USE_TYPE_SPECS 1
292 #undef CYTHON_USE_PYTYPE_LOOKUP
293 #define CYTHON_USE_PYTYPE_LOOKUP 0
294 #undef CYTHON_USE_ASYNC_SLOTS
295 #define CYTHON_USE_ASYNC_SLOTS 0
296 #undef CYTHON_USE_PYLIST_INTERNALS
297 #define CYTHON_USE_PYLIST_INTERNALS 0
298 #undef CYTHON_USE_UNICODE_INTERNALS
299 #define CYTHON_USE_UNICODE_INTERNALS 0
300 #ifndef CYTHON_USE_UNICODE_WRITER
301 #define CYTHON_USE_UNICODE_WRITER 0
302 #endif
303 #undef CYTHON_USE_PYLONG_INTERNALS
304 #define CYTHON_USE_PYLONG_INTERNALS 0
305 #ifndef CYTHON_AVOID_BORROWED_REFS
306 #define CYTHON_AVOID_BORROWED_REFS 0
307 #endif
308 #undef CYTHON_ASSUME_SAFE_MACROS
309 #define CYTHON_ASSUME_SAFE_MACROS 0
310 #undef CYTHON_UNPACK_METHODS
311 #define CYTHON_UNPACK_METHODS 0
312 #undef CYTHON_FAST_THREAD_STATE
313 #define CYTHON_FAST_THREAD_STATE 0
314 #undef CYTHON_FAST_GIL
315 #define CYTHON_FAST_GIL 0
316 #undef CYTHON_METH_FASTCALL
317 #define CYTHON_METH_FASTCALL 0
318 #undef CYTHON_FAST_PYCALL
319 #define CYTHON_FAST_PYCALL 0
320 #ifndef CYTHON_PEP487_INIT_SUBCLASS
321 #define CYTHON_PEP487_INIT_SUBCLASS 1
322 #endif
323 #undef CYTHON_PEP489_MULTI_PHASE_INIT
324 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
325 #undef CYTHON_USE_MODULE_STATE
326 #define CYTHON_USE_MODULE_STATE 1
327 #ifndef CYTHON_USE_TP_FINALIZE
328 #define CYTHON_USE_TP_FINALIZE 0
329 #endif
330 #undef CYTHON_USE_DICT_VERSIONS
331 #define CYTHON_USE_DICT_VERSIONS 0
332 #undef CYTHON_USE_EXC_INFO_STACK
333 #define CYTHON_USE_EXC_INFO_STACK 0
334 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
335 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
336 #endif
337 #undef CYTHON_USE_FREELISTS
338 #define CYTHON_USE_FREELISTS 0
339 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
340 #define CYTHON_COMPILING_IN_PYPY 0
341 #define CYTHON_COMPILING_IN_CPYTHON 0
342 #define CYTHON_COMPILING_IN_LIMITED_API 0
343 #define CYTHON_COMPILING_IN_GRAAL 0
344 #define CYTHON_COMPILING_IN_NOGIL 1
345 #ifndef CYTHON_USE_TYPE_SLOTS
346 #define CYTHON_USE_TYPE_SLOTS 1
347 #endif
348 #ifndef CYTHON_USE_TYPE_SPECS
349 #define CYTHON_USE_TYPE_SPECS 0
350 #endif
351 #undef CYTHON_USE_PYTYPE_LOOKUP
352 #define CYTHON_USE_PYTYPE_LOOKUP 0
353 #ifndef CYTHON_USE_ASYNC_SLOTS
354 #define CYTHON_USE_ASYNC_SLOTS 1
355 #endif
356 #ifndef CYTHON_USE_PYLONG_INTERNALS
357 #define CYTHON_USE_PYLONG_INTERNALS 0
358 #endif
359 #undef CYTHON_USE_PYLIST_INTERNALS
360 #define CYTHON_USE_PYLIST_INTERNALS 0
361 #ifndef CYTHON_USE_UNICODE_INTERNALS
362 #define CYTHON_USE_UNICODE_INTERNALS 1
363 #endif
364 #undef CYTHON_USE_UNICODE_WRITER
365 #define CYTHON_USE_UNICODE_WRITER 0
366 #ifndef CYTHON_AVOID_BORROWED_REFS
367 #define CYTHON_AVOID_BORROWED_REFS 0
368 #endif
369 #ifndef CYTHON_ASSUME_SAFE_MACROS
370 #define CYTHON_ASSUME_SAFE_MACROS 1
371 #endif
372 #ifndef CYTHON_UNPACK_METHODS
373 #define CYTHON_UNPACK_METHODS 1
374 #endif
375 #undef CYTHON_FAST_THREAD_STATE
376 #define CYTHON_FAST_THREAD_STATE 0
377 #undef CYTHON_FAST_GIL
378 #define CYTHON_FAST_GIL 0
379 #ifndef CYTHON_METH_FASTCALL
380 #define CYTHON_METH_FASTCALL 1
381 #endif
382 #undef CYTHON_FAST_PYCALL
383 #define CYTHON_FAST_PYCALL 0
384 #ifndef CYTHON_PEP487_INIT_SUBCLASS
385 #define CYTHON_PEP487_INIT_SUBCLASS 1
386 #endif
387 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
388 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
389 #endif
390 #ifndef CYTHON_USE_MODULE_STATE
391 #define CYTHON_USE_MODULE_STATE 0
392 #endif
393 #ifndef CYTHON_USE_TP_FINALIZE
394 #define CYTHON_USE_TP_FINALIZE 1
395 #endif
396 #undef CYTHON_USE_DICT_VERSIONS
397 #define CYTHON_USE_DICT_VERSIONS 0
398 #undef CYTHON_USE_EXC_INFO_STACK
399 #define CYTHON_USE_EXC_INFO_STACK 0
400 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
401 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
402 #endif
403 #ifndef CYTHON_USE_FREELISTS
404 #define CYTHON_USE_FREELISTS 0
405 #endif
406 #else
407 #define CYTHON_COMPILING_IN_PYPY 0
408 #define CYTHON_COMPILING_IN_CPYTHON 1
409 #define CYTHON_COMPILING_IN_LIMITED_API 0
410 #define CYTHON_COMPILING_IN_GRAAL 0
411 #define CYTHON_COMPILING_IN_NOGIL 0
412 #ifndef CYTHON_USE_TYPE_SLOTS
413 #define CYTHON_USE_TYPE_SLOTS 1
414 #endif
415 #ifndef CYTHON_USE_TYPE_SPECS
416 #define CYTHON_USE_TYPE_SPECS 0
417 #endif
418 #ifndef CYTHON_USE_PYTYPE_LOOKUP
419 #define CYTHON_USE_PYTYPE_LOOKUP 1
420 #endif
421 #if PY_MAJOR_VERSION < 3
422 #undef CYTHON_USE_ASYNC_SLOTS
423 #define CYTHON_USE_ASYNC_SLOTS 0
424 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
425 #define CYTHON_USE_ASYNC_SLOTS 1
426 #endif
427 #ifndef CYTHON_USE_PYLONG_INTERNALS
428 #define CYTHON_USE_PYLONG_INTERNALS 1
429 #endif
430 #ifndef CYTHON_USE_PYLIST_INTERNALS
431 #define CYTHON_USE_PYLIST_INTERNALS 1
432 #endif
433 #ifndef CYTHON_USE_UNICODE_INTERNALS
434 #define CYTHON_USE_UNICODE_INTERNALS 1
435 #endif
436 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
437 #undef CYTHON_USE_UNICODE_WRITER
438 #define CYTHON_USE_UNICODE_WRITER 0
439 #elif !defined(CYTHON_USE_UNICODE_WRITER)
440 #define CYTHON_USE_UNICODE_WRITER 1
441 #endif
442 #ifndef CYTHON_AVOID_BORROWED_REFS
443 #define CYTHON_AVOID_BORROWED_REFS 0
444 #endif
445 #ifndef CYTHON_ASSUME_SAFE_MACROS
446 #define CYTHON_ASSUME_SAFE_MACROS 1
447 #endif
448 #ifndef CYTHON_UNPACK_METHODS
449 #define CYTHON_UNPACK_METHODS 1
450 #endif
451 #ifndef CYTHON_FAST_THREAD_STATE
452 #define CYTHON_FAST_THREAD_STATE 1
453 #endif
454 #ifndef CYTHON_FAST_GIL
455 #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
456 #endif
457 #ifndef CYTHON_METH_FASTCALL
458 #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
459 #endif
460 #ifndef CYTHON_FAST_PYCALL
461 #define CYTHON_FAST_PYCALL 1
462 #endif
463 #ifndef CYTHON_PEP487_INIT_SUBCLASS
464 #define CYTHON_PEP487_INIT_SUBCLASS 1
465 #endif
466 #if PY_VERSION_HEX < 0x03050000
467 #undef CYTHON_PEP489_MULTI_PHASE_INIT
468 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
469 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
470 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
471 #endif
472 #ifndef CYTHON_USE_MODULE_STATE
473 #define CYTHON_USE_MODULE_STATE 0
474 #endif
475 #if PY_VERSION_HEX < 0x030400a1
476 #undef CYTHON_USE_TP_FINALIZE
477 #define CYTHON_USE_TP_FINALIZE 0
478 #elif !defined(CYTHON_USE_TP_FINALIZE)
479 #define CYTHON_USE_TP_FINALIZE 1
480 #endif
481 #if PY_VERSION_HEX < 0x030600B1
482 #undef CYTHON_USE_DICT_VERSIONS
483 #define CYTHON_USE_DICT_VERSIONS 0
484 #elif !defined(CYTHON_USE_DICT_VERSIONS)
485 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5)
486 #endif
487 #if PY_VERSION_HEX < 0x030700A3
488 #undef CYTHON_USE_EXC_INFO_STACK
489 #define CYTHON_USE_EXC_INFO_STACK 0
490 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
491 #define CYTHON_USE_EXC_INFO_STACK 1
492 #endif
493 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
494 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
495 #endif
496 #ifndef CYTHON_USE_FREELISTS
497 #define CYTHON_USE_FREELISTS 1
498 #endif
499 #endif
500 #if !defined(CYTHON_FAST_PYCCALL)
501 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
502 #endif
503 #if !defined(CYTHON_VECTORCALL)
504 #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
505 #endif
506 #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
507 #if CYTHON_USE_PYLONG_INTERNALS
508 #if PY_MAJOR_VERSION < 3
509 #include "longintrepr.h"
510 #endif
511 #undef SHIFT
512 #undef BASE
513 #undef MASK
514 #ifdef SIZEOF_VOID_P
515 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
516 #endif
517 #endif
518 #ifndef __has_attribute
519 #define __has_attribute(x) 0
520 #endif
521 #ifndef __has_cpp_attribute
522 #define __has_cpp_attribute(x) 0
523 #endif
524 #ifndef CYTHON_RESTRICT
525 #if defined(__GNUC__)
526 #define CYTHON_RESTRICT __restrict__
527 #elif defined(_MSC_VER) && _MSC_VER >= 1400
528 #define CYTHON_RESTRICT __restrict
529 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
530 #define CYTHON_RESTRICT restrict
531 #else
532 #define CYTHON_RESTRICT
533 #endif
534 #endif
535 #ifndef CYTHON_UNUSED
536 #if defined(__cplusplus)
537 /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
538 * but leads to warnings with -pedantic, since it is a C++17 feature */
539 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
540 #if __has_cpp_attribute(maybe_unused)
541 #define CYTHON_UNUSED [[maybe_unused]]
542 #endif
543 #endif
544 #endif
545 #endif
546 #ifndef CYTHON_UNUSED
547 # if defined(__GNUC__)
548 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
549 # define CYTHON_UNUSED __attribute__ ((__unused__))
550 # else
551 # define CYTHON_UNUSED
552 # endif
553 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
554 # define CYTHON_UNUSED __attribute__ ((__unused__))
555 # else
556 # define CYTHON_UNUSED
557 # endif
558 #endif
559 #ifndef CYTHON_UNUSED_VAR
560 # if defined(__cplusplus)
561 template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
562 # else
563 # define CYTHON_UNUSED_VAR(x) (void)(x)
564 # endif
565 #endif
566 #ifndef CYTHON_MAYBE_UNUSED_VAR
567 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
568 #endif
569 #ifndef CYTHON_NCP_UNUSED
570 # if CYTHON_COMPILING_IN_CPYTHON
571 # define CYTHON_NCP_UNUSED
572 # else
573 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
574 # endif
575 #endif
576 #ifndef CYTHON_USE_CPP_STD_MOVE
577 #if defined(__cplusplus) && (\
578 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
579 #define CYTHON_USE_CPP_STD_MOVE 1
580 #else
581 #define CYTHON_USE_CPP_STD_MOVE 0
582 #endif
583 #endif
584 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
585 #ifdef _MSC_VER
586 #ifndef _MSC_STDINT_H_
587 #if _MSC_VER < 1300
588 typedef unsigned char uint8_t;
589 typedef unsigned short uint16_t;
590 typedef unsigned int uint32_t;
591 #else
592 typedef unsigned __int8 uint8_t;
593 typedef unsigned __int16 uint16_t;
594 typedef unsigned __int32 uint32_t;
595 #endif
596 #endif
597 #if _MSC_VER < 1300
598 #ifdef _WIN64
599 typedef unsigned long long __pyx_uintptr_t;
600 #else
601 typedef unsigned int __pyx_uintptr_t;
602 #endif
603 #else
604 #ifdef _WIN64
605 typedef unsigned __int64 __pyx_uintptr_t;
606 #else
607 typedef unsigned __int32 __pyx_uintptr_t;
608 #endif
609 #endif
610 #else
611 #include <stdint.h>
612 typedef uintptr_t __pyx_uintptr_t;
613 #endif
614 #ifndef CYTHON_FALLTHROUGH
615 #if defined(__cplusplus)
616 /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
617 * but leads to warnings with -pedantic, since it is a C++17 feature */
618 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
619 #if __has_cpp_attribute(fallthrough)
620 #define CYTHON_FALLTHROUGH [[fallthrough]]
621 #endif
622 #endif
623 #ifndef CYTHON_FALLTHROUGH
624 #if __has_cpp_attribute(clang::fallthrough)
625 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
626 #elif __has_cpp_attribute(gnu::fallthrough)
627 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
628 #endif
629 #endif
630 #endif
631 #ifndef CYTHON_FALLTHROUGH
632 #if __has_attribute(fallthrough)
633 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
634 #else
635 #define CYTHON_FALLTHROUGH
636 #endif
637 #endif
638 #if defined(__clang__) && defined(__apple_build_version__)
639 #if __apple_build_version__ < 7000000
640 #undef CYTHON_FALLTHROUGH
641 #define CYTHON_FALLTHROUGH
642 #endif
643 #endif
644 #endif
645 #ifdef __cplusplus
646 template <typename T>
647 struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
648 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
649 #else
650 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
651 #endif
652 #if CYTHON_COMPILING_IN_PYPY == 1
653 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
654 #else
655 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
656 #endif
657 #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
658
659 #ifndef CYTHON_INLINE
660 #if defined(__clang__)
661 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
662 #elif defined(__GNUC__)
663 #define CYTHON_INLINE __inline__
664 #elif defined(_MSC_VER)
665 #define CYTHON_INLINE __inline
666 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
667 #define CYTHON_INLINE inline
668 #else
669 #define CYTHON_INLINE
670 #endif
671 #endif
672
673 #define __PYX_BUILD_PY_SSIZE_T "n"
674 #define CYTHON_FORMAT_SSIZE_T "z"
675 #if PY_MAJOR_VERSION < 3
676 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
677 #define __Pyx_DefaultClassType PyClass_Type
678 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
679 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
680 #else
681 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
682 #define __Pyx_DefaultClassType PyType_Type
683 #if CYTHON_COMPILING_IN_LIMITED_API
684 static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
685 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
686 PyObject *fv, PyObject *cell, PyObject* fn,
687 PyObject *name, int fline, PyObject *lnos) {
688 PyObject *exception_table = NULL;
689 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
690 #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
691 PyObject *version_info;
692 PyObject *py_minor_version = NULL;
693 #endif
694 long minor_version = 0;
695 PyObject *type, *value, *traceback;
696 PyErr_Fetch(&type, &value, &traceback);
697 #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
698 minor_version = 11;
699 #else
700 if (!(version_info = PySys_GetObject("version_info"))) goto end;
701 if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
702 minor_version = PyLong_AsLong(py_minor_version);
703 Py_DECREF(py_minor_version);
704 if (minor_version == -1 && PyErr_Occurred()) goto end;
705 #endif
706 if (!(types_module = PyImport_ImportModule("types"))) goto end;
707 if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
708 if (minor_version <= 7) {
709 (void)p;
710 result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
711 c, n, v, fn, name, fline, lnos, fv, cell);
712 } else if (minor_version <= 10) {
713 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
714 c, n, v, fn, name, fline, lnos, fv, cell);
715 } else {
716 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
717 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
718 c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
719 }
720 end:
721 Py_XDECREF(code_type);
722 Py_XDECREF(exception_table);
723 Py_XDECREF(types_module);
724 if (type) {
725 PyErr_Restore(type, value, traceback);
726 }
727 return result;
728 }
729 #ifndef CO_OPTIMIZED
730 #define CO_OPTIMIZED 0x0001
731 #endif
732 #ifndef CO_NEWLOCALS
733 #define CO_NEWLOCALS 0x0002
734 #endif
735 #ifndef CO_VARARGS
736 #define CO_VARARGS 0x0004
737 #endif
738 #ifndef CO_VARKEYWORDS
739 #define CO_VARKEYWORDS 0x0008
740 #endif
741 #ifndef CO_ASYNC_GENERATOR
742 #define CO_ASYNC_GENERATOR 0x0200
743 #endif
744 #ifndef CO_GENERATOR
745 #define CO_GENERATOR 0x0020
746 #endif
747 #ifndef CO_COROUTINE
748 #define CO_COROUTINE 0x0080
749 #endif
750 #elif PY_VERSION_HEX >= 0x030B0000
751 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
752 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
753 PyObject *fv, PyObject *cell, PyObject* fn,
754 PyObject *name, int fline, PyObject *lnos) {
755 PyCodeObject *result;
756 PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
757 if (!empty_bytes) return NULL;
758 result =
759 #if PY_VERSION_HEX >= 0x030C0000
760 PyUnstable_Code_NewWithPosOnlyArgs
761 #else
762 PyCode_NewWithPosOnlyArgs
763 #endif
764 (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
765 Py_DECREF(empty_bytes);
766 return result;
767 }
768 #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
769 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
770 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
771 #else
772 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
773 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
774 #endif
775 #endif
776 #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
777 #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
778 #else
779 #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
780 #endif
781 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
782 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
783 #else
784 #define __Pyx_Py_Is(x, y) ((x) == (y))
785 #endif
786 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
787 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
788 #else
789 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
790 #endif
791 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
792 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
793 #else
794 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
795 #endif
796 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
797 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
798 #else
799 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
800 #endif
801 #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
802 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
803 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
804 #else
805 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
806 #endif
807 #ifndef CO_COROUTINE
808 #define CO_COROUTINE 0x80
809 #endif
810 #ifndef CO_ASYNC_GENERATOR
811 #define CO_ASYNC_GENERATOR 0x200
812 #endif
813 #ifndef Py_TPFLAGS_CHECKTYPES
814 #define Py_TPFLAGS_CHECKTYPES 0
815 #endif
816 #ifndef Py_TPFLAGS_HAVE_INDEX
817 #define Py_TPFLAGS_HAVE_INDEX 0
818 #endif
819 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
820 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
821 #endif
822 #ifndef Py_TPFLAGS_HAVE_FINALIZE
823 #define Py_TPFLAGS_HAVE_FINALIZE 0
824 #endif
825 #ifndef Py_TPFLAGS_SEQUENCE
826 #define Py_TPFLAGS_SEQUENCE 0
827 #endif
828 #ifndef Py_TPFLAGS_MAPPING
829 #define Py_TPFLAGS_MAPPING 0
830 #endif
831 #ifndef METH_STACKLESS
832 #define METH_STACKLESS 0
833 #endif
834 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
835 #ifndef METH_FASTCALL
836 #define METH_FASTCALL 0x80
837 #endif
838 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
839 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
840 Py_ssize_t nargs, PyObject *kwnames);
841 #else
842 #if PY_VERSION_HEX >= 0x030d00A4
843 # define __Pyx_PyCFunctionFast PyCFunctionFast
844 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
845 #else
846 # define __Pyx_PyCFunctionFast _PyCFunctionFast
847 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
848 #endif
849 #endif
850 #if CYTHON_METH_FASTCALL
851 #define __Pyx_METH_FASTCALL METH_FASTCALL
852 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
853 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
854 #else
855 #define __Pyx_METH_FASTCALL METH_VARARGS
856 #define __Pyx_PyCFunction_FastCall PyCFunction
857 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
858 #endif
859 #if CYTHON_VECTORCALL
860 #define __pyx_vectorcallfunc vectorcallfunc
861 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
862 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
863 #elif CYTHON_BACKPORT_VECTORCALL
864 typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
865 size_t nargsf, PyObject *kwnames);
866 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
867 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
868 #else
869 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
870 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
871 #endif
872 #if PY_MAJOR_VERSION >= 0x030900B1
873 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
874 #else
875 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
876 #endif
877 #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
878 #if CYTHON_COMPILING_IN_CPYTHON
879 #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
880 #elif !CYTHON_COMPILING_IN_LIMITED_API
881 #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
882 #endif
883 #if CYTHON_COMPILING_IN_CPYTHON
884 #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
885 static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
886 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
887 }
888 #endif
889 static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
890 #if CYTHON_COMPILING_IN_LIMITED_API
891 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
892 #else
893 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
894 #endif
895 }
896 #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
897 #if __PYX_LIMITED_VERSION_HEX < 0x030900B1
898 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
899 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
900 #else
901 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
902 #define __Pyx_PyCMethod PyCMethod
903 #endif
904 #ifndef METH_METHOD
905 #define METH_METHOD 0x200
906 #endif
907 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
908 #define PyObject_Malloc(s) PyMem_Malloc(s)
909 #define PyObject_Free(p) PyMem_Free(p)
910 #define PyObject_Realloc(p) PyMem_Realloc(p)
911 #endif
912 #if CYTHON_COMPILING_IN_LIMITED_API
913 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
914 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
915 #else
916 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
917 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
918 #endif
919 #if CYTHON_COMPILING_IN_LIMITED_API
920 #define __Pyx_PyThreadState_Current PyThreadState_Get()
921 #elif !CYTHON_FAST_THREAD_STATE
922 #define __Pyx_PyThreadState_Current PyThreadState_GET()
923 #elif PY_VERSION_HEX >= 0x030d00A1
924 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
925 #elif PY_VERSION_HEX >= 0x03060000
926 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
927 #elif PY_VERSION_HEX >= 0x03000000
928 #define __Pyx_PyThreadState_Current PyThreadState_GET()
929 #else
930 #define __Pyx_PyThreadState_Current _PyThreadState_Current
931 #endif
932 #if CYTHON_COMPILING_IN_LIMITED_API
933 static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
934 {
935 void *result;
936 result = PyModule_GetState(op);
937 if (!result)
938 Py_FatalError("Couldn't find the module state");
939 return result;
940 }
941 #endif
942 #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
943 #if CYTHON_COMPILING_IN_LIMITED_API
944 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
945 #else
946 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
947 #endif
948 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
949 #include "pythread.h"
950 #define Py_tss_NEEDS_INIT 0
951 typedef int Py_tss_t;
952 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
953 *key = PyThread_create_key();
954 return 0;
955 }
956 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
957 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
958 *key = Py_tss_NEEDS_INIT;
959 return key;
960 }
961 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
962 PyObject_Free(key);
963 }
964 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
965 return *key != Py_tss_NEEDS_INIT;
966 }
967 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
968 PyThread_delete_key(*key);
969 *key = Py_tss_NEEDS_INIT;
970 }
971 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
972 return PyThread_set_key_value(*key, value);
973 }
974 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
975 return PyThread_get_key_value(*key);
976 }
977 #endif
978 #if PY_MAJOR_VERSION < 3
979 #if CYTHON_COMPILING_IN_PYPY
980 #if PYPY_VERSION_NUM < 0x07030600
981 #if defined(__cplusplus) && __cplusplus >= 201402L
982 [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
983 #elif defined(__GNUC__) || defined(__clang__)
984 __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
985 #elif defined(_MSC_VER)
986 __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
987 #endif
988 static CYTHON_INLINE int PyGILState_Check(void) {
989 return 0;
990 }
991 #else // PYPY_VERSION_NUM < 0x07030600
992 #endif // PYPY_VERSION_NUM < 0x07030600
993 #else
994 static CYTHON_INLINE int PyGILState_Check(void) {
995 PyThreadState * tstate = _PyThreadState_Current;
996 return tstate && (tstate == PyGILState_GetThisThreadState());
997 }
998 #endif
999 #endif
1000 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
1001 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
1002 #else
1003 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
1004 #endif
1005 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
1006 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
1007 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
1008 #else
1009 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
1010 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
1011 #endif
1012 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
1013 #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
1014 static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
1015 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
1016 if (res == NULL) PyErr_Clear();
1017 return res;
1018 }
1019 #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
1020 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
1021 #define __Pyx_PyDict_GetItemStr PyDict_GetItem
1022 #else
1023 static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
1024 #if CYTHON_COMPILING_IN_PYPY
1025 return PyDict_GetItem(dict, name);
1026 #else
1027 PyDictEntry *ep;
1028 PyDictObject *mp = (PyDictObject*) dict;
1029 long hash = ((PyStringObject *) name)->ob_shash;
1030 assert(hash != -1);
1031 ep = (mp->ma_lookup)(mp, name, hash);
1032 if (ep == NULL) {
1033 return NULL;
1034 }
1035 return ep->me_value;
1036 #endif
1037 }
1038 #define __Pyx_PyDict_GetItemStr PyDict_GetItem
1039 #endif
1040 #if CYTHON_USE_TYPE_SLOTS
1041 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
1042 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
1043 #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
1044 #else
1045 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
1046 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
1047 #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
1048 #endif
1049 #if CYTHON_COMPILING_IN_LIMITED_API
1050 #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
1051 #else
1052 #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
1053 #endif
1054 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
1055 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
1056 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
1057 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
1058 PyObject_GC_Del(obj);\
1059 Py_DECREF(type);\
1060 }
1061 #else
1062 #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
1063 #endif
1064 #if CYTHON_COMPILING_IN_LIMITED_API
1065 #define CYTHON_PEP393_ENABLED 1
1066 #define __Pyx_PyUnicode_READY(op) (0)
1067 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
1068 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
1069 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
1070 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
1071 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
1072 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
1073 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
1074 #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
1075 #define CYTHON_PEP393_ENABLED 1
1076 #if PY_VERSION_HEX >= 0x030C0000
1077 #define __Pyx_PyUnicode_READY(op) (0)
1078 #else
1079 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
1080 0 : _PyUnicode_Ready((PyObject *)(op)))
1081 #endif
1082 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
1083 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
1084 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
1085 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
1086 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
1087 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
1088 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
1089 #if PY_VERSION_HEX >= 0x030C0000
1090 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
1091 #else
1092 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
1093 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
1094 #else
1095 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
1096 #endif
1097 #endif
1098 #else
1099 #define CYTHON_PEP393_ENABLED 0
1100 #define PyUnicode_1BYTE_KIND 1
1101 #define PyUnicode_2BYTE_KIND 2
1102 #define PyUnicode_4BYTE_KIND 4
1103 #define __Pyx_PyUnicode_READY(op) (0)
1104 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
1105 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
1106 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
1107 #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE))
1108 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
1109 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
1110 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
1111 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
1112 #endif
1113 #if CYTHON_COMPILING_IN_PYPY
1114 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
1115 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
1116 #else
1117 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
1118 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
1119 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
1120 #endif
1121 #if CYTHON_COMPILING_IN_PYPY
1122 #if !defined(PyUnicode_DecodeUnicodeEscape)
1123 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
1124 #endif
1125 #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
1126 #undef PyUnicode_Contains
1127 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
1128 #endif
1129 #if !defined(PyByteArray_Check)
1130 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
1131 #endif
1132 #if !defined(PyObject_Format)
1133 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
1134 #endif
1135 #endif
1136 #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))
1137 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
1138 #if PY_MAJOR_VERSION >= 3
1139 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
1140 #else
1141 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
1142 #endif
1143 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
1144 #define PyObject_ASCII(o) PyObject_Repr(o)
1145 #endif
1146 #if PY_MAJOR_VERSION >= 3
1147 #define PyBaseString_Type PyUnicode_Type
1148 #define PyStringObject PyUnicodeObject
1149 #define PyString_Type PyUnicode_Type
1150 #define PyString_Check PyUnicode_Check
1151 #define PyString_CheckExact PyUnicode_CheckExact
1152 #ifndef PyObject_Unicode
1153 #define PyObject_Unicode PyObject_Str
1154 #endif
1155 #endif
1156 #if PY_MAJOR_VERSION >= 3
1157 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
1158 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
1159 #else
1160 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
1161 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
1162 #endif
1163 #if CYTHON_COMPILING_IN_CPYTHON
1164 #define __Pyx_PySequence_ListKeepNew(obj)\
1165 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1166 #else
1167 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1168 #endif
1169 #ifndef PySet_CheckExact
1170 #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
1171 #endif
1172 #if PY_VERSION_HEX >= 0x030900A4
1173 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
1174 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
1175 #else
1176 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
1177 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
1178 #endif
1179 #if CYTHON_ASSUME_SAFE_MACROS
1180 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1181 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1182 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1183 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1184 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1185 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1186 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1187 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1188 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1189 #else
1190 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1191 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1192 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1193 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1194 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1195 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1196 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1197 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1198 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1199 #endif
1200 #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
1201 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
1202 #else
1203 static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
1204 PyObject *module = PyImport_AddModule(name);
1205 Py_XINCREF(module);
1206 return module;
1207 }
1208 #endif
1209 #if PY_MAJOR_VERSION >= 3
1210 #define PyIntObject PyLongObject
1211 #define PyInt_Type PyLong_Type
1212 #define PyInt_Check(op) PyLong_Check(op)
1213 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
1214 #define __Pyx_Py3Int_Check(op) PyLong_Check(op)
1215 #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op)
1216 #define PyInt_FromString PyLong_FromString
1217 #define PyInt_FromUnicode PyLong_FromUnicode
1218 #define PyInt_FromLong PyLong_FromLong
1219 #define PyInt_FromSize_t PyLong_FromSize_t
1220 #define PyInt_FromSsize_t PyLong_FromSsize_t
1221 #define PyInt_AsLong PyLong_AsLong
1222 #define PyInt_AS_LONG PyLong_AS_LONG
1223 #define PyInt_AsSsize_t PyLong_AsSsize_t
1224 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
1225 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
1226 #define PyNumber_Int PyNumber_Long
1227 #else
1228 #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op))
1229 #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op))
1230 #endif
1231 #if PY_MAJOR_VERSION >= 3
1232 #define PyBoolObject PyLongObject
1233 #endif
1234 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
1235 #ifndef PyUnicode_InternFromString
1236 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1237 #endif
1238 #endif
1239 #if PY_VERSION_HEX < 0x030200A4
1240 typedef long Py_hash_t;
1241 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
1242 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
1243 #else
1244 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
1245 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
1246 #endif
1247 #if CYTHON_USE_ASYNC_SLOTS
1248 #if PY_VERSION_HEX >= 0x030500B1
1249 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1250 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
1251 #else
1252 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
1253 #endif
1254 #else
1255 #define __Pyx_PyType_AsAsync(obj) NULL
1256 #endif
1257 #ifndef __Pyx_PyAsyncMethodsStruct
1258 typedef struct {
1259 unaryfunc am_await;
1260 unaryfunc am_aiter;
1261 unaryfunc am_anext;
1262 } __Pyx_PyAsyncMethodsStruct;
1263 #endif
1264
1265 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1266 #if !defined(_USE_MATH_DEFINES)
1267 #define _USE_MATH_DEFINES
1268 #endif
1269 #endif
1270 #include <math.h>
1271 #ifdef NAN
1272 #define __PYX_NAN() ((float) NAN)
1273 #else
1274 static CYTHON_INLINE float __PYX_NAN() {
1275 float value;
1276 memset(&value, 0xFF, sizeof(value));
1277 return value;
1278 }
1279 #endif
1280 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1281 #define __Pyx_truncl trunc
1282 #else
1283 #define __Pyx_truncl truncl
1284 #endif
1285
1286 #define __PYX_MARK_ERR_POS(f_index, lineno) \
1287 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1288 #define __PYX_ERR(f_index, lineno, Ln_error) \
1289 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1290
1291 #ifdef CYTHON_EXTERN_C
1292 #undef __PYX_EXTERN_C
1293 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1294 #elif defined(__PYX_EXTERN_C)
1295 #ifdef _MSC_VER
1296 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1297 #else
1298 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1299 #endif
1300 #else
1301 #ifdef __cplusplus
1302 #define __PYX_EXTERN_C extern "C"
1303 #else
1304 #define __PYX_EXTERN_C extern
1305 #endif
1306 #endif
1307
1308 #define __PYX_HAVE__pysam__libcsamfile
1309 #define __PYX_HAVE_API__pysam__libcsamfile
1310 /* Early includes */
1311 #include <stdint.h>
1312 #include <string.h>
1313 #include <stdlib.h>
1314 #include <stdio.h>
1315 #include <stddef.h>
1316 #include "pythread.h"
1317
1318 #if CYTHON_COMPILING_IN_PYPY
1319 #ifdef _MSC_VER
1320 #pragma message ("This module uses CPython specific internals of 'array.array', which are not available in PyPy.")
1321 #else
1322 #warning This module uses CPython specific internals of 'array.array', which are not available in PyPy.
1323 #endif
1324 #endif
1325
1326 #include <sys/types.h>
1327 #include "stdarg.h"
1328 #include "htslib/kstring.h"
1329 #include "htslib_util.h"
1330 #include "htslib/hfile.h"
1331 #include "htslib/bgzf.h"
1332 #include "htslib/hts.h"
1333 #include "htslib/sam.h"
1334 #include "htslib/faidx.h"
1335 #include "htslib/tbx.h"
1336 #include "htslib/vcf.h"
1337 #include "htslib/vcfutils.h"
1338 #include "htslib/cram.h"
1339 #include "pysam_stream.h"
1340 #ifdef _OPENMP
1341 #include <omp.h>
1342 #endif /* _OPENMP */
1343
1344 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1345 #define CYTHON_WITHOUT_ASSERTIONS
1346 #endif
1347
1348 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
1349 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
1350
1351 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1352 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1353 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
1354 #define __PYX_DEFAULT_STRING_ENCODING ""
1355 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1356 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1357 #define __Pyx_uchar_cast(c) ((unsigned char)c)
1358 #define __Pyx_long_cast(x) ((long)x)
1359 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1360 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1361 (sizeof(type) > sizeof(Py_ssize_t) &&\
1362 likely(v < (type)PY_SSIZE_T_MAX ||\
1363 v == (type)PY_SSIZE_T_MAX) &&\
1364 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1365 v == (type)PY_SSIZE_T_MIN))) ||\
1366 (sizeof(type) == sizeof(Py_ssize_t) &&\
1367 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1368 v == (type)PY_SSIZE_T_MAX))) )
1369 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1370 return (size_t) i < (size_t) limit;
1371 }
1372 #if defined (__cplusplus) && __cplusplus >= 201103L
1373 #include <cstdlib>
1374 #define __Pyx_sst_abs(value) std::abs(value)
1375 #elif SIZEOF_INT >= SIZEOF_SIZE_T
1376 #define __Pyx_sst_abs(value) abs(value)
1377 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
1378 #define __Pyx_sst_abs(value) labs(value)
1379 #elif defined (_MSC_VER)
1380 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1382 #define __Pyx_sst_abs(value) llabs(value)
1383 #elif defined (__GNUC__)
1384 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1385 #else
1386 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1387 #endif
1388 static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1389 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1390 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1391 static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1392 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1393 #define __Pyx_PyBytes_FromString PyBytes_FromString
1394 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1395 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1396 #if PY_MAJOR_VERSION < 3
1397 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1398 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1399 #else
1400 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1401 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1402 #endif
1403 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1404 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1405 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1406 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1407 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1408 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1409 #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1410 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1411 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1412 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1413 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1414 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1415 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1416 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1417 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1418 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1419 #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1420 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1421 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1422 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1423 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1424 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1425 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1426 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1427 #define __Pyx_PySequence_Tuple(obj)\
1428 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1429 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1430 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
1431 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1432 #if CYTHON_ASSUME_SAFE_MACROS
1433 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1434 #else
1435 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1436 #endif
1437 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1438 #if PY_MAJOR_VERSION >= 3
1439 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1440 #else
1441 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1442 #endif
1443 #if CYTHON_USE_PYLONG_INTERNALS
1444 #if PY_VERSION_HEX >= 0x030C00A7
1445 #ifndef _PyLong_SIGN_MASK
1446 #define _PyLong_SIGN_MASK 3
1447 #endif
1448 #ifndef _PyLong_NON_SIZE_BITS
1449 #define _PyLong_NON_SIZE_BITS 3
1450 #endif
1451 #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
1452 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
1453 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1454 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
1455 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
1456 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1457 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1458 #define __Pyx_PyLong_SignedDigitCount(x)\
1459 ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1460 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1461 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1462 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1463 #else
1464 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1465 #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1466 #endif
1467 typedef Py_ssize_t __Pyx_compact_pylong;
1468 typedef size_t __Pyx_compact_upylong;
1469 #else
1470 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1471 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1472 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1473 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1474 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1475 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1476 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1477 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1478 #define __Pyx_PyLong_CompactValue(x)\
1479 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1480 typedef sdigit __Pyx_compact_pylong;
1481 typedef digit __Pyx_compact_upylong;
1482 #endif
1483 #if PY_VERSION_HEX >= 0x030C00A5
1484 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1485 #else
1486 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1487 #endif
1488 #endif
1489 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1490 #include <string.h>
1491 static int __Pyx_sys_getdefaultencoding_not_ascii;
1492 static int __Pyx_init_sys_getdefaultencoding_params(void) {
1493 PyObject* sys;
1494 PyObject* default_encoding = NULL;
1495 PyObject* ascii_chars_u = NULL;
1496 PyObject* ascii_chars_b = NULL;
1497 const char* default_encoding_c;
1498 sys = PyImport_ImportModule("sys");
1499 if (!sys) goto bad;
1500 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1501 Py_DECREF(sys);
1502 if (!default_encoding) goto bad;
1503 default_encoding_c = PyBytes_AsString(default_encoding);
1504 if (!default_encoding_c) goto bad;
1505 if (strcmp(default_encoding_c, "ascii") == 0) {
1506 __Pyx_sys_getdefaultencoding_not_ascii = 0;
1507 } else {
1508 char ascii_chars[128];
1509 int c;
1510 for (c = 0; c < 128; c++) {
1511 ascii_chars[c] = (char) c;
1512 }
1513 __Pyx_sys_getdefaultencoding_not_ascii = 1;
1514 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1515 if (!ascii_chars_u) goto bad;
1516 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1517 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1518 PyErr_Format(
1519 PyExc_ValueError,
1520 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1521 default_encoding_c);
1522 goto bad;
1523 }
1524 Py_DECREF(ascii_chars_u);
1525 Py_DECREF(ascii_chars_b);
1526 }
1527 Py_DECREF(default_encoding);
1528 return 0;
1529 bad:
1530 Py_XDECREF(default_encoding);
1531 Py_XDECREF(ascii_chars_u);
1532 Py_XDECREF(ascii_chars_b);
1533 return -1;
1534 }
1535 #endif
1536 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1537 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1538 #else
1539 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1540 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1541 #include <string.h>
1542 static char* __PYX_DEFAULT_STRING_ENCODING;
1543 static int __Pyx_init_sys_getdefaultencoding_params(void) {
1544 PyObject* sys;
1545 PyObject* default_encoding = NULL;
1546 char* default_encoding_c;
1547 sys = PyImport_ImportModule("sys");
1548 if (!sys) goto bad;
1549 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1550 Py_DECREF(sys);
1551 if (!default_encoding) goto bad;
1552 default_encoding_c = PyBytes_AsString(default_encoding);
1553 if (!default_encoding_c) goto bad;
1554 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1555 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1556 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1557 Py_DECREF(default_encoding);
1558 return 0;
1559 bad:
1560 Py_XDECREF(default_encoding);
1561 return -1;
1562 }
1563 #endif
1564 #endif
1565
1566
1567 /* Test for GCC > 2.95 */
1568 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1569 #define likely(x) __builtin_expect(!!(x), 1)
1570 #define unlikely(x) __builtin_expect(!!(x), 0)
1571 #else /* !__GNUC__ or GCC < 2.95 */
1572 #define likely(x) (x)
1573 #define unlikely(x) (x)
1574 #endif /* __GNUC__ */
1575 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1576
1577 #if !CYTHON_USE_MODULE_STATE
1578 static PyObject *__pyx_m = NULL;
1579 #endif
1580 static int __pyx_lineno;
1581 static int __pyx_clineno = 0;
1582 static const char * __pyx_cfilenm = __FILE__;
1583 static const char *__pyx_filename;
1584
1585 /* #### Code section: filename_table ### */
1586
1587 static const char *__pyx_f[] = {
1588 "<stringsource>",
1589 "contextvars.pxd",
1590 "array.pxd",
1591 "pysam/libcsamfile.pyx",
1592 "type.pxd",
1593 "bool.pxd",
1594 "complex.pxd",
1595 "pysam/libchtslib.pxd",
1596 "pysam/libcfaidx.pxd",
1597 "pysam/libcalignedsegment.pxd",
1598 "pysam/libcalignmentfile.pxd",
1599 };
1600 /* #### Code section: utility_code_proto_before_types ### */
1601 /* ForceInitThreads.proto */
1602 #ifndef __PYX_FORCE_INIT_THREADS
1603 #define __PYX_FORCE_INIT_THREADS 0
1604 #endif
1605
1606 /* #### Code section: numeric_typedefs ### */
1607 /* #### Code section: complex_type_declarations ### */
1608 /* #### Code section: type_declarations ### */
1609
1610 /*--- Type declarations ---*/
1611 #ifndef _ARRAYARRAY_H
1612 struct arrayobject;
1613 typedef struct arrayobject arrayobject;
1614 #endif
1615 struct __pyx_obj_5pysam_10libchtslib_HTSFile;
1616 struct __pyx_obj_5pysam_9libcfaidx_FastaFile;
1617 struct __pyx_obj_5pysam_9libcfaidx_FastqProxy;
1618 struct __pyx_obj_5pysam_9libcfaidx_FastxRecord;
1619 struct __pyx_obj_5pysam_9libcfaidx_FastxFile;
1620 struct __pyx_obj_5pysam_9libcfaidx_FastqFile;
1621 struct __pyx_obj_5pysam_9libcfaidx_Fastafile;
1622 struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment;
1623 struct __pyx_obj_5pysam_18libcalignedsegment_PileupColumn;
1624 struct __pyx_obj_5pysam_18libcalignedsegment_PileupRead;
1625 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader;
1626 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile;
1627 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow;
1628 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowRegion;
1629 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowHead;
1630 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAll;
1631 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAllRefs;
1632 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowSelection;
1633 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn;
1634 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnRegion;
1635 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnAllRefs;
1636 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnAll;
1637 struct __pyx_obj_5pysam_17libcalignmentfile_IndexedReads;
1638 struct __pyx_obj_5pysam_11libcsamfile_AlignedRead;
1639 struct __pyx_obj_5pysam_11libcsamfile_Samfile;
1640 struct __pyx_opt_args_7cpython_11contextvars_get_value;
1641 struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default;
1642
1643 /* "cpython/contextvars.pxd":112
1644 *
1645 *
1646 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<<
1647 * """Return a new reference to the value of the context variable,
1648 * or the default value of the context variable,
1649 */
1650 struct __pyx_opt_args_7cpython_11contextvars_get_value {
1651 int __pyx_n;
1652 PyObject *default_value;
1653 };
1654
1655 /* "cpython/contextvars.pxd":129
1656 *
1657 *
1658 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<<
1659 * """Return a new reference to the value of the context variable,
1660 * or the provided default value if no such value was found.
1661 */
1662 struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default {
1663 int __pyx_n;
1664 PyObject *default_value;
1665 };
1666 struct __pyx_opt_args_5pysam_9libcfaidx_10FastqProxy_get_quality_array;
1667 struct __pyx_opt_args_5pysam_9libcfaidx_11FastxRecord_get_quality_array;
1668
1669 /* "pysam/libcfaidx.pxd":50
1670 * cdef cython.str to_string(self)
1671 * cdef cython.str tostring(self)
1672 * cpdef array.array get_quality_array(self, int offset=*) # <<<<<<<<<<<<<<
1673 *
1674 *
1675 */
1676 struct __pyx_opt_args_5pysam_9libcfaidx_10FastqProxy_get_quality_array {
1677 int __pyx_n;
1678 int offset;
1679 };
1680
1681 /* "pysam/libcfaidx.pxd":60
1682 * cdef cython.str to_string(self)
1683 * cdef cython.str tostring(self)
1684 * cpdef array.array get_quality_array(self, int offset=*) # <<<<<<<<<<<<<<
1685 *
1686 * cdef class FastxFile:
1687 */
1688 struct __pyx_opt_args_5pysam_9libcfaidx_11FastxRecord_get_quality_array {
1689 int __pyx_n;
1690 int offset;
1691 };
1692 struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_set_tag;
1693 struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_get_tag;
1694 struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_tostring;
1695
1696 /* "pysam/libcalignedsegment.pxd":31
1697 *
1698 * from pysam.libcalignmentfile cimport AlignmentFile, AlignmentHeader
1699 * ctypedef AlignmentFile AlignmentFile_t # <<<<<<<<<<<<<<
1700 *
1701 *
1702 */
1703 typedef struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile *__pyx_t_5pysam_18libcalignedsegment_AlignmentFile_t;
1704
1705 /* "pysam/libcalignedsegment.pxd":51
1706 * # add an alignment tag with value to the AlignedSegment
1707 * # an existing tag of the same name will be replaced.
1708 * cpdef set_tag(self, tag, value, value_type=?, replace=?) # <<<<<<<<<<<<<<
1709 *
1710 * # get an alignment tag from the AlignedSegment
1711 */
1712 struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_set_tag {
1713 int __pyx_n;
1714 PyObject *value_type;
1715 PyObject *replace;
1716 };
1717
1718 /* "pysam/libcalignedsegment.pxd":54
1719 *
1720 * # get an alignment tag from the AlignedSegment
1721 * cpdef get_tag(self, tag, with_value_type=?) # <<<<<<<<<<<<<<
1722 *
1723 * # return true if tag exists
1724 */
1725 struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_get_tag {
1726 int __pyx_n;
1727 PyObject *with_value_type;
1728 };
1729
1730 /* "pysam/libcalignedsegment.pxd":63
1731 *
1732 * # returns a valid sam alignment string (deprecated)
1733 * cpdef tostring(self, htsfile=*) # <<<<<<<<<<<<<<
1734 *
1735 *
1736 */
1737 struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_tostring {
1738 int __pyx_n;
1739 PyObject *htsfile;
1740 };
1741 struct __pyx_t_5pysam_17libcalignmentfile___iterdata;
1742 typedef struct __pyx_t_5pysam_17libcalignmentfile___iterdata __pyx_t_5pysam_17libcalignmentfile___iterdata;
1743 struct __pyx_opt_args_5pysam_17libcalignmentfile_14IteratorColumn__setup_iterator;
1744
1745 /* "pysam/libcalignmentfile.pxd":25
1746 * # Utility types
1747 *
1748 * ctypedef struct __iterdata: # <<<<<<<<<<<<<<
1749 * htsFile * htsfile
1750 * bam_hdr_t * header
1751 */
1752 struct __pyx_t_5pysam_17libcalignmentfile___iterdata {
1753 htsFile *htsfile;
1754 bam_hdr_t *header;
1755 hts_itr_t *iter;
1756 faidx_t *fastafile;
1757 int tid;
1758 char *seq;
1759 int seq_len;
1760 int min_mapping_quality;
1761 int flag_require;
1762 int flag_filter;
1763 int compute_baq;
1764 int redo_baq;
1765 int ignore_orphans;
1766 int adjust_capq_threshold;
1767 };
1768
1769 /* "pysam/libcalignmentfile.pxd":121
1770 * cdef int cnext(self)
1771 * cdef char * get_sequence(self)
1772 * cdef _setup_iterator(self, # <<<<<<<<<<<<<<
1773 * int tid,
1774 * int start,
1775 */
1776 struct __pyx_opt_args_5pysam_17libcalignmentfile_14IteratorColumn__setup_iterator {
1777 int __pyx_n;
1778 int multiple_iterators;
1779 };
1780
1781 /* "pysam/libchtslib.pxd":2706
1782 *
1783 *
1784 * cdef class HTSFile(object): # <<<<<<<<<<<<<<
1785 * cdef htsFile *htsfile # pointer to htsFile structure
1786 * cdef int64_t start_offset # BGZF offset of first record
1787 */
1788 struct __pyx_obj_5pysam_10libchtslib_HTSFile {
1789 PyObject_HEAD
1790 struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile *__pyx_vtab;
1791 htsFile *htsfile;
1792 int64_t start_offset;
1793 PyObject *filename;
1794 PyObject *mode;
1795 PyObject *threads;
1796 PyObject *index_filename;
1797 int is_stream;
1798 int is_remote;
1799 int duplicate_filehandle;
1800 };
1801
1802
1803 /* "pysam/libcfaidx.pxd":38
1804 * int * dret)
1805 *
1806 * cdef class FastaFile: # <<<<<<<<<<<<<<
1807 * cdef bint is_remote
1808 * cdef object _filename, _references, _lengths, reference2length
1809 */
1810 struct __pyx_obj_5pysam_9libcfaidx_FastaFile {
1811 PyObject_HEAD
1812 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastaFile *__pyx_vtab;
1813 int is_remote;
1814 PyObject *_filename;
1815 PyObject *_references;
1816 PyObject *_lengths;
1817 PyObject *reference2length;
1818 faidx_t *fastafile;
1819 };
1820
1821
1822 /* "pysam/libcfaidx.pxd":46
1823 *
1824 *
1825 * cdef class FastqProxy: # <<<<<<<<<<<<<<
1826 * cdef kseq_t * _delegate
1827 * cdef cython.str to_string(self)
1828 */
1829 struct __pyx_obj_5pysam_9libcfaidx_FastqProxy {
1830 PyObject_HEAD
1831 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqProxy *__pyx_vtab;
1832 kseq_t *_delegate;
1833 };
1834
1835
1836 /* "pysam/libcfaidx.pxd":53
1837 *
1838 *
1839 * cdef class FastxRecord: # <<<<<<<<<<<<<<
1840 * """
1841 * Python container for pysam.libcfaidx.FastqProxy with persistence.
1842 */
1843 struct __pyx_obj_5pysam_9libcfaidx_FastxRecord {
1844 PyObject_HEAD
1845 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxRecord *__pyx_vtab;
1846 PyObject *comment;
1847 PyObject *quality;
1848 PyObject *sequence;
1849 PyObject *name;
1850 };
1851
1852
1853 /* "pysam/libcfaidx.pxd":62
1854 * cpdef array.array get_quality_array(self, int offset=*)
1855 *
1856 * cdef class FastxFile: # <<<<<<<<<<<<<<
1857 * cdef object _filename
1858 * cdef BGZF * fastqfile
1859 */
1860 struct __pyx_obj_5pysam_9libcfaidx_FastxFile {
1861 PyObject_HEAD
1862 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxFile *__pyx_vtab;
1863 PyObject *_filename;
1864 BGZF *fastqfile;
1865 kseq_t *entry;
1866 int persist;
1867 int is_remote;
1868 };
1869
1870
1871 /* "pysam/libcfaidx.pxd":74
1872 *
1873 * # Compatibility Layer for pysam 0.8.1
1874 * cdef class FastqFile(FastxFile): # <<<<<<<<<<<<<<
1875 * pass
1876 *
1877 */
1878 struct __pyx_obj_5pysam_9libcfaidx_FastqFile {
1879 struct __pyx_obj_5pysam_9libcfaidx_FastxFile __pyx_base;
1880 };
1881
1882
1883 /* "pysam/libcfaidx.pxd":79
1884 *
1885 * # Compatibility Layer for pysam < 0.8
1886 * cdef class Fastafile(FastaFile): # <<<<<<<<<<<<<<
1887 * pass
1888 *
1889 */
1890 struct __pyx_obj_5pysam_9libcfaidx_Fastafile {
1891 struct __pyx_obj_5pysam_9libcfaidx_FastaFile __pyx_base;
1892 };
1893
1894
1895 /* "pysam/libcalignedsegment.pxd":35
1896 *
1897 * # Note: need to declare all C fields and methods here
1898 * cdef class AlignedSegment: # <<<<<<<<<<<<<<
1899 *
1900 * # object that this AlignedSegment represents
1901 */
1902 struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment {
1903 PyObject_HEAD
1904 struct __pyx_vtabstruct_5pysam_18libcalignedsegment_AlignedSegment *__pyx_vtab;
1905 bam1_t *_delegate;
1906 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader *header;
1907 PyObject *cache_query_qualities;
1908 PyObject *cache_query_alignment_qualities;
1909 PyObject *cache_query_sequence;
1910 PyObject *cache_query_alignment_sequence;
1911 };
1912
1913
1914 /* "pysam/libcalignedsegment.pxd":66
1915 *
1916 *
1917 * cdef class PileupColumn: # <<<<<<<<<<<<<<
1918 * cdef const bam_pileup1_t ** plp
1919 * cdef int tid
1920 */
1921 struct __pyx_obj_5pysam_18libcalignedsegment_PileupColumn {
1922 PyObject_HEAD
1923 bam_pileup1_t const **plp;
1924 int tid;
1925 int pos;
1926 int n_pu;
1927 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader *header;
1928 uint32_t min_base_quality;
1929 kstring_t buf;
1930 char *reference_sequence;
1931 };
1932
1933
1934 /* "pysam/libcalignedsegment.pxd":76
1935 * cdef char * reference_sequence
1936 *
1937 * cdef class PileupRead: # <<<<<<<<<<<<<<
1938 * cdef int32_t _qpos
1939 * cdef AlignedSegment _alignment
1940 */
1941 struct __pyx_obj_5pysam_18libcalignedsegment_PileupRead {
1942 PyObject_HEAD
1943 int32_t _qpos;
1944 struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment *_alignment;
1945 int _indel;
1946 int _level;
1947 uint32_t _is_del;
1948 uint32_t _is_head;
1949 uint32_t _is_tail;
1950 uint32_t _is_refskip;
1951 };
1952
1953
1954 /* "pysam/libcalignmentfile.pxd":42
1955 *
1956 *
1957 * cdef class AlignmentHeader(object): # <<<<<<<<<<<<<<
1958 * cdef bam_hdr_t *ptr
1959 *
1960 */
1961 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader {
1962 PyObject_HEAD
1963 bam_hdr_t *ptr;
1964 };
1965
1966
1967 /* "pysam/libcalignmentfile.pxd":45
1968 * cdef bam_hdr_t *ptr
1969 *
1970 * cdef class AlignmentFile(HTSFile): # <<<<<<<<<<<<<<
1971 * cdef readonly object reference_filename
1972 * cdef readonly AlignmentHeader header
1973 */
1974 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile {
1975 struct __pyx_obj_5pysam_10libchtslib_HTSFile __pyx_base;
1976 PyObject *reference_filename;
1977 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader *header;
1978 hts_idx_t *index;
1979 bam1_t *b;
1980 };
1981
1982
1983 /* "pysam/libcalignmentfile.pxd":62
1984 *
1985 *
1986 * cdef class IteratorRow: # <<<<<<<<<<<<<<
1987 * cdef int retval
1988 * cdef bam1_t * b
1989 */
1990 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow {
1991 PyObject_HEAD
1992 int retval;
1993 bam1_t *b;
1994 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile *samfile;
1995 htsFile *htsfile;
1996 hts_idx_t *index;
1997 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader *header;
1998 int owns_samfile;
1999 };
2000
2001
2002 /* "pysam/libcalignmentfile.pxd":72
2003 *
2004 *
2005 * cdef class IteratorRowRegion(IteratorRow): # <<<<<<<<<<<<<<
2006 * cdef hts_itr_t * iter
2007 * cdef bam1_t * getCurrent(self)
2008 */
2009 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowRegion {
2010 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow __pyx_base;
2011 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowRegion *__pyx_vtab;
2012 hts_itr_t *iter;
2013 };
2014
2015
2016 /* "pysam/libcalignmentfile.pxd":78
2017 *
2018 *
2019 * cdef class IteratorRowHead(IteratorRow): # <<<<<<<<<<<<<<
2020 * cdef int max_rows
2021 * cdef int current_row
2022 */
2023 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowHead {
2024 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow __pyx_base;
2025 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowHead *__pyx_vtab;
2026 int max_rows;
2027 int current_row;
2028 };
2029
2030
2031 /* "pysam/libcalignmentfile.pxd":85
2032 *
2033 *
2034 * cdef class IteratorRowAll(IteratorRow): # <<<<<<<<<<<<<<
2035 * cdef bam1_t * getCurrent(self)
2036 * cdef int cnext(self)
2037 */
2038 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAll {
2039 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow __pyx_base;
2040 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowAll *__pyx_vtab;
2041 };
2042
2043
2044 /* "pysam/libcalignmentfile.pxd":90
2045 *
2046 *
2047 * cdef class IteratorRowAllRefs(IteratorRow): # <<<<<<<<<<<<<<
2048 * cdef int tid
2049 * cdef IteratorRowRegion rowiter
2050 */
2051 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAllRefs {
2052 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow __pyx_base;
2053 int tid;
2054 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowRegion *rowiter;
2055 };
2056
2057
2058 /* "pysam/libcalignmentfile.pxd":95
2059 *
2060 *
2061 * cdef class IteratorRowSelection(IteratorRow): # <<<<<<<<<<<<<<
2062 * cdef int current_pos
2063 * cdef positions
2064 */
2065 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowSelection {
2066 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow __pyx_base;
2067 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowSelection *__pyx_vtab;
2068 int current_pos;
2069 PyObject *positions;
2070 };
2071
2072
2073 /* "pysam/libcalignmentfile.pxd":102
2074 *
2075 *
2076 * cdef class IteratorColumn: # <<<<<<<<<<<<<<
2077 *
2078 * # result of the last plbuf_push
2079 */
2080 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn {
2081 PyObject_HEAD
2082 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumn *__pyx_vtab;
2083 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowRegion *iter;
2084 int tid;
2085 int pos;
2086 int n_plp;
2087 uint32_t min_base_quality;
2088 bam_pileup1_t const *plp;
2089 bam_mplp_t pileup_iter;
2090 __pyx_t_5pysam_17libcalignmentfile___iterdata iterdata;
2091 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile *samfile;
2092 struct __pyx_obj_5pysam_9libcfaidx_FastaFile *fastafile;
2093 PyObject *stepper;
2094 int max_depth;
2095 int ignore_overlaps;
2096 };
2097
2098
2099 /* "pysam/libcalignmentfile.pxd":134
2100 *
2101 *
2102 * cdef class IteratorColumnRegion(IteratorColumn): # <<<<<<<<<<<<<<
2103 * cdef int start
2104 * cdef int stop
2105 */
2106 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnRegion {
2107 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn __pyx_base;
2108 int start;
2109 int stop;
2110 int truncate;
2111 };
2112
2113
2114 /* "pysam/libcalignmentfile.pxd":140
2115 *
2116 *
2117 * cdef class IteratorColumnAllRefs(IteratorColumn): # <<<<<<<<<<<<<<
2118 * pass
2119 *
2120 */
2121 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnAllRefs {
2122 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn __pyx_base;
2123 };
2124
2125
2126 /* "pysam/libcalignmentfile.pxd":144
2127 *
2128 *
2129 * cdef class IteratorColumnAll(IteratorColumn): # <<<<<<<<<<<<<<
2130 * pass
2131 *
2132 */
2133 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnAll {
2134 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn __pyx_base;
2135 };
2136
2137
2138 /* "pysam/libcalignmentfile.pxd":148
2139 *
2140 *
2141 * cdef class IndexedReads: # <<<<<<<<<<<<<<
2142 * cdef AlignmentFile samfile
2143 * cdef htsFile * htsfile
2144 */
2145 struct __pyx_obj_5pysam_17libcalignmentfile_IndexedReads {
2146 PyObject_HEAD
2147 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile *samfile;
2148 htsFile *htsfile;
2149 PyObject *index;
2150 int owns_samfile;
2151 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader *header;
2152 };
2153
2154
2155 /* "pysam/libcsamfile.pxd":10
2156 * from pysam.libchtslib cimport *
2157 *
2158 * cdef class AlignedRead(AlignedSegment): # <<<<<<<<<<<<<<
2159 * pass
2160 *
2161 */
2162 struct __pyx_obj_5pysam_11libcsamfile_AlignedRead {
2163 struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment __pyx_base;
2164 };
2165
2166
2167 /* "pysam/libcsamfile.pxd":13
2168 * pass
2169 *
2170 * cdef class Samfile(AlignmentFile): # <<<<<<<<<<<<<<
2171 * pass
2172 *
2173 */
2174 struct __pyx_obj_5pysam_11libcsamfile_Samfile {
2175 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile __pyx_base;
2176 };
2177
2178
2179
2180 /* "pysam/libchtslib.pxd":2706
2181 *
2182 *
2183 * cdef class HTSFile(object): # <<<<<<<<<<<<<<
2184 * cdef htsFile *htsfile # pointer to htsFile structure
2185 * cdef int64_t start_offset # BGZF offset of first record
2186 */
2187
2188 struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile {
2189 htsFile *(*_open_htsfile)(struct __pyx_obj_5pysam_10libchtslib_HTSFile *);
2190 };
2191 static struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile *__pyx_vtabptr_5pysam_10libchtslib_HTSFile;
2192
2193
2194 /* "pysam/libcfaidx.pxd":38
2195 * int * dret)
2196 *
2197 * cdef class FastaFile: # <<<<<<<<<<<<<<
2198 * cdef bint is_remote
2199 * cdef object _filename, _references, _lengths, reference2length
2200 */
2201
2202 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastaFile {
2203 char *(*_fetch)(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *, char *, int, int, int *);
2204 };
2205 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastaFile *__pyx_vtabptr_5pysam_9libcfaidx_FastaFile;
2206
2207
2208 /* "pysam/libcfaidx.pxd":46
2209 *
2210 *
2211 * cdef class FastqProxy: # <<<<<<<<<<<<<<
2212 * cdef kseq_t * _delegate
2213 * cdef cython.str to_string(self)
2214 */
2215
2216 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqProxy {
2217 PyObject *(*to_string)(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *);
2218 PyObject *(*tostring)(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *);
2219 arrayobject *(*get_quality_array)(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcfaidx_10FastqProxy_get_quality_array *__pyx_optional_args);
2220 };
2221 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqProxy *__pyx_vtabptr_5pysam_9libcfaidx_FastqProxy;
2222
2223
2224 /* "pysam/libcfaidx.pxd":53
2225 *
2226 *
2227 * cdef class FastxRecord: # <<<<<<<<<<<<<<
2228 * """
2229 * Python container for pysam.libcfaidx.FastqProxy with persistence.
2230 */
2231
2232 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxRecord {
2233 PyObject *(*to_string)(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *);
2234 PyObject *(*tostring)(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *);
2235 arrayobject *(*get_quality_array)(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcfaidx_11FastxRecord_get_quality_array *__pyx_optional_args);
2236 };
2237 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxRecord *__pyx_vtabptr_5pysam_9libcfaidx_FastxRecord;
2238
2239
2240 /* "pysam/libcfaidx.pxd":62
2241 * cpdef array.array get_quality_array(self, int offset=*)
2242 *
2243 * cdef class FastxFile: # <<<<<<<<<<<<<<
2244 * cdef object _filename
2245 * cdef BGZF * fastqfile
2246 */
2247
2248 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxFile {
2249 kseq_t *(*getCurrent)(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *);
2250 int (*cnext)(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *);
2251 };
2252 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxFile *__pyx_vtabptr_5pysam_9libcfaidx_FastxFile;
2253
2254
2255 /* "pysam/libcfaidx.pxd":74
2256 *
2257 * # Compatibility Layer for pysam 0.8.1
2258 * cdef class FastqFile(FastxFile): # <<<<<<<<<<<<<<
2259 * pass
2260 *
2261 */
2262
2263 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqFile {
2264 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxFile __pyx_base;
2265 };
2266 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqFile *__pyx_vtabptr_5pysam_9libcfaidx_FastqFile;
2267
2268
2269 /* "pysam/libcfaidx.pxd":79
2270 *
2271 * # Compatibility Layer for pysam < 0.8
2272 * cdef class Fastafile(FastaFile): # <<<<<<<<<<<<<<
2273 * pass
2274 *
2275 */
2276
2277 struct __pyx_vtabstruct_5pysam_9libcfaidx_Fastafile {
2278 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastaFile __pyx_base;
2279 };
2280 static struct __pyx_vtabstruct_5pysam_9libcfaidx_Fastafile *__pyx_vtabptr_5pysam_9libcfaidx_Fastafile;
2281
2282
2283 /* "pysam/libcalignedsegment.pxd":35
2284 *
2285 * # Note: need to declare all C fields and methods here
2286 * cdef class AlignedSegment: # <<<<<<<<<<<<<<
2287 *
2288 * # object that this AlignedSegment represents
2289 */
2290
2291 struct __pyx_vtabstruct_5pysam_18libcalignedsegment_AlignedSegment {
2292 PyObject *(*set_tag)(struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_set_tag *__pyx_optional_args);
2293 PyObject *(*get_tag)(struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_get_tag *__pyx_optional_args);
2294 PyObject *(*has_tag)(struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment *, PyObject *, int __pyx_skip_dispatch);
2295 PyObject *(*to_string)(struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment *, int __pyx_skip_dispatch);
2296 PyObject *(*tostring)(struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_tostring *__pyx_optional_args);
2297 };
2298 static struct __pyx_vtabstruct_5pysam_18libcalignedsegment_AlignedSegment *__pyx_vtabptr_5pysam_18libcalignedsegment_AlignedSegment;
2299
2300
2301 /* "pysam/libcalignmentfile.pxd":45
2302 * cdef bam_hdr_t *ptr
2303 *
2304 * cdef class AlignmentFile(HTSFile): # <<<<<<<<<<<<<<
2305 * cdef readonly object reference_filename
2306 * cdef readonly AlignmentHeader header
2307 */
2308
2309 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_AlignmentFile {
2310 struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile __pyx_base;
2311 bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile *);
2312 int (*cnext)(struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile *);
2313 int (*write)(struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile *, struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment *, int __pyx_skip_dispatch);
2314 };
2315 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_AlignmentFile *__pyx_vtabptr_5pysam_17libcalignmentfile_AlignmentFile;
2316
2317
2318 /* "pysam/libcalignmentfile.pxd":72
2319 *
2320 *
2321 * cdef class IteratorRowRegion(IteratorRow): # <<<<<<<<<<<<<<
2322 * cdef hts_itr_t * iter
2323 * cdef bam1_t * getCurrent(self)
2324 */
2325
2326 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowRegion {
2327 bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowRegion *);
2328 int (*cnext)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowRegion *);
2329 };
2330 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowRegion *__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowRegion;
2331
2332
2333 /* "pysam/libcalignmentfile.pxd":78
2334 *
2335 *
2336 * cdef class IteratorRowHead(IteratorRow): # <<<<<<<<<<<<<<
2337 * cdef int max_rows
2338 * cdef int current_row
2339 */
2340
2341 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowHead {
2342 bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowHead *);
2343 int (*cnext)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowHead *);
2344 };
2345 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowHead *__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowHead;
2346
2347
2348 /* "pysam/libcalignmentfile.pxd":85
2349 *
2350 *
2351 * cdef class IteratorRowAll(IteratorRow): # <<<<<<<<<<<<<<
2352 * cdef bam1_t * getCurrent(self)
2353 * cdef int cnext(self)
2354 */
2355
2356 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowAll {
2357 bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAll *);
2358 int (*cnext)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAll *);
2359 };
2360 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowAll *__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowAll;
2361
2362
2363 /* "pysam/libcalignmentfile.pxd":95
2364 *
2365 *
2366 * cdef class IteratorRowSelection(IteratorRow): # <<<<<<<<<<<<<<
2367 * cdef int current_pos
2368 * cdef positions
2369 */
2370
2371 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowSelection {
2372 bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowSelection *);
2373 int (*cnext)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowSelection *);
2374 };
2375 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowSelection *__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowSelection;
2376
2377
2378 /* "pysam/libcalignmentfile.pxd":102
2379 *
2380 *
2381 * cdef class IteratorColumn: # <<<<<<<<<<<<<<
2382 *
2383 * # result of the last plbuf_push
2384 */
2385
2386 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumn {
2387 int (*cnext)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn *);
2388 char *(*get_sequence)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn *);
2389 PyObject *(*_setup_iterator)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn *, int, int, int, struct __pyx_opt_args_5pysam_17libcalignmentfile_14IteratorColumn__setup_iterator *__pyx_optional_args);
2390 PyObject *(*_setup_raw_rest_iterator)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn *);
2391 PyObject *(*reset)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn *, PyObject *, PyObject *, PyObject *);
2392 PyObject *(*_free_pileup_iter)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn *);
2393 char *(*getSequence)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn *);
2394 };
2395 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumn *__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumn;
2396
2397
2398 /* "pysam/libcalignmentfile.pxd":134
2399 *
2400 *
2401 * cdef class IteratorColumnRegion(IteratorColumn): # <<<<<<<<<<<<<<
2402 * cdef int start
2403 * cdef int stop
2404 */
2405
2406 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnRegion {
2407 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumn __pyx_base;
2408 };
2409 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnRegion *__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnRegion;
2410
2411
2412 /* "pysam/libcalignmentfile.pxd":140
2413 *
2414 *
2415 * cdef class IteratorColumnAllRefs(IteratorColumn): # <<<<<<<<<<<<<<
2416 * pass
2417 *
2418 */
2419
2420 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnAllRefs {
2421 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumn __pyx_base;
2422 };
2423 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnAllRefs *__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnAllRefs;
2424
2425
2426 /* "pysam/libcalignmentfile.pxd":144
2427 *
2428 *
2429 * cdef class IteratorColumnAll(IteratorColumn): # <<<<<<<<<<<<<<
2430 * pass
2431 *
2432 */
2433
2434 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnAll {
2435 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumn __pyx_base;
2436 };
2437 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnAll *__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnAll;
2438
2439
2440 /* "pysam/libcsamfile.pyx":31
2441 *
2442 *
2443 * cdef class AlignedRead(AlignedSegment): # <<<<<<<<<<<<<<
2444 * '''Deprecated alternative for :class:`~pysam.AlignedSegment`
2445 *
2446 */
2447
2448 struct __pyx_vtabstruct_5pysam_11libcsamfile_AlignedRead {
2449 struct __pyx_vtabstruct_5pysam_18libcalignedsegment_AlignedSegment __pyx_base;
2450 };
2451 static struct __pyx_vtabstruct_5pysam_11libcsamfile_AlignedRead *__pyx_vtabptr_5pysam_11libcsamfile_AlignedRead;
2452
2453
2454 /* "pysam/libcsamfile.pyx":23
2455 *
2456 *
2457 * cdef class Samfile(AlignmentFile): # <<<<<<<<<<<<<<
2458 * '''Deprecated alternative for :class:`~pysam.AlignmentFile`
2459 *
2460 */
2461
2462 struct __pyx_vtabstruct_5pysam_11libcsamfile_Samfile {
2463 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_AlignmentFile __pyx_base;
2464 };
2465 static struct __pyx_vtabstruct_5pysam_11libcsamfile_Samfile *__pyx_vtabptr_5pysam_11libcsamfile_Samfile;
2466 /* #### Code section: utility_code_proto ### */
2467
2468 /* --- Runtime support code (head) --- */
2469 /* Refnanny.proto */
2470 #ifndef CYTHON_REFNANNY
2471 #define CYTHON_REFNANNY 0
2472 #endif
2473 #if CYTHON_REFNANNY
2474 typedef struct {
2475 void (*INCREF)(void*, PyObject*, Py_ssize_t);
2476 void (*DECREF)(void*, PyObject*, Py_ssize_t);
2477 void (*GOTREF)(void*, PyObject*, Py_ssize_t);
2478 void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
2479 void* (*SetupContext)(const char*, Py_ssize_t, const char*);
2480 void (*FinishContext)(void**);
2481 } __Pyx_RefNannyAPIStruct;
2482 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2483 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2484 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2485 #ifdef WITH_THREAD
2486 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2487 if (acquire_gil) {\
2488 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2489 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2490 PyGILState_Release(__pyx_gilstate_save);\
2491 } else {\
2492 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2493 }
2494 #define __Pyx_RefNannyFinishContextNogil() {\
2495 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2496 __Pyx_RefNannyFinishContext();\
2497 PyGILState_Release(__pyx_gilstate_save);\
2498 }
2499 #else
2500 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2501 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
2502 #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
2503 #endif
2504 #define __Pyx_RefNannyFinishContextNogil() {\
2505 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2506 __Pyx_RefNannyFinishContext();\
2507 PyGILState_Release(__pyx_gilstate_save);\
2508 }
2509 #define __Pyx_RefNannyFinishContext()\
2510 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2511 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2512 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2513 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2514 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2515 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2516 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2517 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2518 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2519 #else
2520 #define __Pyx_RefNannyDeclarations
2521 #define __Pyx_RefNannySetupContext(name, acquire_gil)
2522 #define __Pyx_RefNannyFinishContextNogil()
2523 #define __Pyx_RefNannyFinishContext()
2524 #define __Pyx_INCREF(r) Py_INCREF(r)
2525 #define __Pyx_DECREF(r) Py_DECREF(r)
2526 #define __Pyx_GOTREF(r)
2527 #define __Pyx_GIVEREF(r)
2528 #define __Pyx_XINCREF(r) Py_XINCREF(r)
2529 #define __Pyx_XDECREF(r) Py_XDECREF(r)
2530 #define __Pyx_XGOTREF(r)
2531 #define __Pyx_XGIVEREF(r)
2532 #endif
2533 #define __Pyx_Py_XDECREF_SET(r, v) do {\
2534 PyObject *tmp = (PyObject *) r;\
2535 r = v; Py_XDECREF(tmp);\
2536 } while (0)
2537 #define __Pyx_XDECREF_SET(r, v) do {\
2538 PyObject *tmp = (PyObject *) r;\
2539 r = v; __Pyx_XDECREF(tmp);\
2540 } while (0)
2541 #define __Pyx_DECREF_SET(r, v) do {\
2542 PyObject *tmp = (PyObject *) r;\
2543 r = v; __Pyx_DECREF(tmp);\
2544 } while (0)
2545 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2546 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2547
2548 /* PyErrExceptionMatches.proto */
2549 #if CYTHON_FAST_THREAD_STATE
2550 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2551 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2552 #else
2553 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2554 #endif
2555
2556 /* PyThreadStateGet.proto */
2557 #if CYTHON_FAST_THREAD_STATE
2558 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2559 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2560 #if PY_VERSION_HEX >= 0x030C00A6
2561 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2562 #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2563 #else
2564 #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2565 #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2566 #endif
2567 #else
2568 #define __Pyx_PyThreadState_declare
2569 #define __Pyx_PyThreadState_assign
2570 #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2571 #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2572 #endif
2573
2574 /* PyErrFetchRestore.proto */
2575 #if CYTHON_FAST_THREAD_STATE
2576 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2577 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2578 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2579 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2580 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2581 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2582 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2583 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2584 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2585 #else
2586 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2587 #endif
2588 #else
2589 #define __Pyx_PyErr_Clear() PyErr_Clear()
2590 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2591 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2592 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2593 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2594 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2595 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2596 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2597 #endif
2598
2599 /* PyObjectGetAttrStr.proto */
2600 #if CYTHON_USE_TYPE_SLOTS
2601 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2602 #else
2603 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2604 #endif
2605
2606 /* PyObjectGetAttrStrNoError.proto */
2607 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2608
2609 /* GetBuiltinName.proto */
2610 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2611
2612 /* TupleAndListFromArray.proto */
2613 #if CYTHON_COMPILING_IN_CPYTHON
2614 static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
2615 static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2616 #endif
2617
2618 /* IncludeStringH.proto */
2619 #include <string.h>
2620
2621 /* BytesEquals.proto */
2622 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2623
2624 /* UnicodeEquals.proto */
2625 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2626
2627 /* fastcall.proto */
2628 #if CYTHON_AVOID_BORROWED_REFS
2629 #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
2630 #elif CYTHON_ASSUME_SAFE_MACROS
2631 #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
2632 #else
2633 #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
2634 #endif
2635 #if CYTHON_AVOID_BORROWED_REFS
2636 #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
2637 #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
2638 #else
2639 #define __Pyx_Arg_NewRef_VARARGS(arg) arg
2640 #define __Pyx_Arg_XDECREF_VARARGS(arg)
2641 #endif
2642 #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2643 #define __Pyx_KwValues_VARARGS(args, nargs) NULL
2644 #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2645 #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2646 #if CYTHON_METH_FASTCALL
2647 #define __Pyx_Arg_FASTCALL(args, i) args[i]
2648 #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
2649 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2650 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2651 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2652 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2653 #else
2654 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2655 #endif
2656 #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
2657 to have the same reference counting */
2658 #define __Pyx_Arg_XDECREF_FASTCALL(arg)
2659 #else
2660 #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
2661 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2662 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2663 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2664 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2665 #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
2666 #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
2667 #endif
2668 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2669 #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
2670 #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
2671 #else
2672 #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2673 #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
2674 #endif
2675
2676 /* RaiseArgTupleInvalid.proto */
2677 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2678 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2679
2680 /* KeywordStringCheck.proto */
2681 static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);
2682
2683 /* Profile.proto */
2684 #ifndef CYTHON_PROFILE
2685 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
2686 #define CYTHON_PROFILE 0
2687 #else
2688 #define CYTHON_PROFILE 1
2689 #endif
2690 #endif
2691 #ifndef CYTHON_TRACE_NOGIL
2692 #define CYTHON_TRACE_NOGIL 0
2693 #else
2694 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
2695 #define CYTHON_TRACE 1
2696 #endif
2697 #endif
2698 #ifndef CYTHON_TRACE
2699 #define CYTHON_TRACE 0
2700 #endif
2701 #if CYTHON_TRACE
2702 #undef CYTHON_PROFILE_REUSE_FRAME
2703 #endif
2704 #ifndef CYTHON_PROFILE_REUSE_FRAME
2705 #define CYTHON_PROFILE_REUSE_FRAME 0
2706 #endif
2707 #if CYTHON_PROFILE || CYTHON_TRACE
2708 #include "compile.h"
2709 #include "frameobject.h"
2710 #include "traceback.h"
2711 #if PY_VERSION_HEX >= 0x030b00a6
2712 #ifndef Py_BUILD_CORE
2713 #define Py_BUILD_CORE 1
2714 #endif
2715 #include "internal/pycore_frame.h"
2716 #endif
2717 #if CYTHON_PROFILE_REUSE_FRAME
2718 #define CYTHON_FRAME_MODIFIER static
2719 #define CYTHON_FRAME_DEL(frame)
2720 #else
2721 #define CYTHON_FRAME_MODIFIER
2722 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
2723 #endif
2724 #define __Pyx_TraceDeclarations\
2725 static PyCodeObject *__pyx_frame_code = NULL;\
2726 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
2727 int __Pyx_use_tracing = 0;
2728 #define __Pyx_TraceFrameInit(codeobj)\
2729 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
2730 #if PY_VERSION_HEX >= 0x030b00a2
2731 #if PY_VERSION_HEX >= 0x030C00b1
2732 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
2733 ((!(check_tracing) || !(tstate)->tracing) &&\
2734 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
2735 #else
2736 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
2737 (unlikely((tstate)->cframe->use_tracing) &&\
2738 (!(check_tracing) || !(tstate)->tracing) &&\
2739 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
2740 #endif
2741 #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
2742 #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
2743 #elif PY_VERSION_HEX >= 0x030a00b1
2744 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
2745 (unlikely((tstate)->cframe->use_tracing) &&\
2746 (!(check_tracing) || !(tstate)->tracing) &&\
2747 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
2748 #define __Pyx_EnterTracing(tstate)\
2749 do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
2750 #define __Pyx_LeaveTracing(tstate)\
2751 do {\
2752 tstate->tracing--;\
2753 tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
2754 || tstate->c_profilefunc != NULL);\
2755 } while (0)
2756 #else
2757 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
2758 (unlikely((tstate)->use_tracing) &&\
2759 (!(check_tracing) || !(tstate)->tracing) &&\
2760 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
2761 #define __Pyx_EnterTracing(tstate)\
2762 do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
2763 #define __Pyx_LeaveTracing(tstate)\
2764 do {\
2765 tstate->tracing--;\
2766 tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
2767 || tstate->c_profilefunc != NULL);\
2768 } while (0)
2769 #endif
2770 #ifdef WITH_THREAD
2771 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
2772 if (nogil) {\
2773 if (CYTHON_TRACE_NOGIL) {\
2774 PyThreadState *tstate;\
2775 PyGILState_STATE state = PyGILState_Ensure();\
2776 tstate = __Pyx_PyThreadState_Current;\
2777 if (__Pyx_IsTracing(tstate, 1, 1)) {\
2778 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
2779 }\
2780 PyGILState_Release(state);\
2781 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
2782 }\
2783 } else {\
2784 PyThreadState* tstate = PyThreadState_GET();\
2785 if (__Pyx_IsTracing(tstate, 1, 1)) {\
2786 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
2787 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
2788 }\
2789 }
2790 #else
2791 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
2792 { PyThreadState* tstate = PyThreadState_GET();\
2793 if (__Pyx_IsTracing(tstate, 1, 1)) {\
2794 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
2795 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
2796 }\
2797 }
2798 #endif
2799 #define __Pyx_TraceException()\
2800 if (likely(!__Pyx_use_tracing)); else {\
2801 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
2802 if (__Pyx_IsTracing(tstate, 0, 1)) {\
2803 __Pyx_EnterTracing(tstate);\
2804 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
2805 if (exc_info) {\
2806 if (CYTHON_TRACE && tstate->c_tracefunc)\
2807 tstate->c_tracefunc(\
2808 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
2809 tstate->c_profilefunc(\
2810 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
2811 Py_DECREF(exc_info);\
2812 }\
2813 __Pyx_LeaveTracing(tstate);\
2814 }\
2815 }
2816 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
2817 PyObject *type, *value, *traceback;
2818 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
2819 __Pyx_EnterTracing(tstate);
2820 if (CYTHON_TRACE && tstate->c_tracefunc)
2821 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
2822 if (tstate->c_profilefunc)
2823 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
2824 CYTHON_FRAME_DEL(frame);
2825 __Pyx_LeaveTracing(tstate);
2826 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
2827 }
2828 #ifdef WITH_THREAD
2829 #define __Pyx_TraceReturn(result, nogil)\
2830 if (likely(!__Pyx_use_tracing)); else {\
2831 if (nogil) {\
2832 if (CYTHON_TRACE_NOGIL) {\
2833 PyThreadState *tstate;\
2834 PyGILState_STATE state = PyGILState_Ensure();\
2835 tstate = __Pyx_PyThreadState_Current;\
2836 if (__Pyx_IsTracing(tstate, 0, 0)) {\
2837 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
2838 }\
2839 PyGILState_Release(state);\
2840 }\
2841 } else {\
2842 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
2843 if (__Pyx_IsTracing(tstate, 0, 0)) {\
2844 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
2845 }\
2846 }\
2847 }
2848 #else
2849 #define __Pyx_TraceReturn(result, nogil)\
2850 if (likely(!__Pyx_use_tracing)); else {\
2851 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
2852 if (__Pyx_IsTracing(tstate, 0, 0)) {\
2853 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
2854 }\
2855 }
2856 #endif
2857 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
2858 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
2859 #else
2860 #define __Pyx_TraceDeclarations
2861 #define __Pyx_TraceFrameInit(codeobj)
2862 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
2863 #define __Pyx_TraceException()
2864 #define __Pyx_TraceReturn(result, nogil)
2865 #endif
2866 #if CYTHON_TRACE
2867 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
2868 int ret;
2869 PyObject *type, *value, *traceback;
2870 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
2871 __Pyx_PyFrame_SetLineNumber(frame, lineno);
2872 __Pyx_EnterTracing(tstate);
2873 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
2874 __Pyx_LeaveTracing(tstate);
2875 if (likely(!ret)) {
2876 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
2877 } else {
2878 Py_XDECREF(type);
2879 Py_XDECREF(value);
2880 Py_XDECREF(traceback);
2881 }
2882 return ret;
2883 }
2884 #ifdef WITH_THREAD
2885 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
2886 if (likely(!__Pyx_use_tracing)); else {\
2887 if (nogil) {\
2888 if (CYTHON_TRACE_NOGIL) {\
2889 int ret = 0;\
2890 PyThreadState *tstate;\
2891 PyGILState_STATE state = __Pyx_PyGILState_Ensure();\
2892 tstate = __Pyx_PyThreadState_Current;\
2893 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
2894 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
2895 }\
2896 __Pyx_PyGILState_Release(state);\
2897 if (unlikely(ret)) goto_error;\
2898 }\
2899 } else {\
2900 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
2901 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
2902 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
2903 if (unlikely(ret)) goto_error;\
2904 }\
2905 }\
2906 }
2907 #else
2908 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
2909 if (likely(!__Pyx_use_tracing)); else {\
2910 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
2911 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
2912 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
2913 if (unlikely(ret)) goto_error;\
2914 }\
2915 }
2916 #endif
2917 #else
2918 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
2919 #endif
2920
2921 /* RaiseException.proto */
2922 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2923
2924 /* RaiseDoubleKeywords.proto */
2925 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2926
2927 /* ParseKeywords.proto */
2928 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
2929 PyObject **argnames[],
2930 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
2931 const char* function_name);
2932
2933 /* CallNextTpTraverse.proto */
2934 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
2935
2936 /* CallNextTpClear.proto */
2937 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear);
2938
2939 /* TypeImport.proto */
2940 #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11
2941 #define __PYX_HAVE_RT_ImportType_proto_3_0_11
2942 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2943 #include <stdalign.h>
2944 #endif
2945 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2946 #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s)
2947 #else
2948 #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*)
2949 #endif
2950 enum __Pyx_ImportType_CheckSize_3_0_11 {
2951 __Pyx_ImportType_CheckSize_Error_3_0_11 = 0,
2952 __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1,
2953 __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2
2954 };
2955 static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size);
2956 #endif
2957
2958 /* GetVTable.proto */
2959 static void* __Pyx_GetVtable(PyTypeObject *type);
2960
2961 /* IncludeStructmemberH.proto */
2962 #include <structmember.h>
2963
2964 /* FixUpExtensionType.proto */
2965 #if CYTHON_USE_TYPE_SPECS
2966 static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
2967 #endif
2968
2969 /* PyFunctionFastCall.proto */
2970 #if CYTHON_FAST_PYCALL
2971 #if !CYTHON_VECTORCALL
2972 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
2973 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
2974 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
2975 #endif
2976 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
2977 (sizeof(char [1 - 2*!(cond)]) - 1)
2978 #ifndef Py_MEMBER_SIZE
2979 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
2980 #endif
2981 #if !CYTHON_VECTORCALL
2982 #if PY_VERSION_HEX >= 0x03080000
2983 #include "frameobject.h"
2984 #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
2985 #ifndef Py_BUILD_CORE
2986 #define Py_BUILD_CORE 1
2987 #endif
2988 #include "internal/pycore_frame.h"
2989 #endif
2990 #define __Pxy_PyFrame_Initialize_Offsets()
2991 #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
2992 #else
2993 static size_t __pyx_pyframe_localsplus_offset = 0;
2994 #include "frameobject.h"
2995 #define __Pxy_PyFrame_Initialize_Offsets()\
2996 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2997 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2998 #define __Pyx_PyFrame_GetLocalsplus(frame)\
2999 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
3000 #endif
3001 #endif
3002 #endif
3003
3004 /* PyObjectCall.proto */
3005 #if CYTHON_COMPILING_IN_CPYTHON
3006 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
3007 #else
3008 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
3009 #endif
3010
3011 /* PyObjectCallMethO.proto */
3012 #if CYTHON_COMPILING_IN_CPYTHON
3013 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
3014 #endif
3015
3016 /* PyObjectFastCall.proto */
3017 #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
3018 static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);
3019
3020 /* PyObjectCallNoArg.proto */
3021 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
3022
3023 /* PyObjectCallOneArg.proto */
3024 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
3025
3026 /* PyObjectGetMethod.proto */
3027 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
3028
3029 /* PyObjectCallMethod0.proto */
3030 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
3031
3032 /* ValidateBasesTuple.proto */
3033 #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
3034 static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
3035 #endif
3036
3037 /* PyType_Ready.proto */
3038 CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
3039
3040 /* PyObject_GenericGetAttrNoDict.proto */
3041 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
3042 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
3043 #else
3044 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
3045 #endif
3046
3047 /* PyObject_GenericGetAttr.proto */
3048 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
3049 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
3050 #else
3051 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
3052 #endif
3053
3054 /* SetVTable.proto */
3055 static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
3056
3057 /* MergeVTables.proto */
3058 #if !CYTHON_COMPILING_IN_LIMITED_API
3059 static int __Pyx_MergeVtables(PyTypeObject *type);
3060 #endif
3061
3062 /* SetupReduce.proto */
3063 #if !CYTHON_COMPILING_IN_LIMITED_API
3064 static int __Pyx_setup_reduce(PyObject* type_obj);
3065 #endif
3066
3067 /* Import.proto */
3068 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
3069
3070 /* ImportDottedModule.proto */
3071 static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
3072 #if PY_MAJOR_VERSION >= 3
3073 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
3074 #endif
3075
3076 /* FetchSharedCythonModule.proto */
3077 static PyObject *__Pyx_FetchSharedCythonABIModule(void);
3078
3079 /* FetchCommonType.proto */
3080 #if !CYTHON_USE_TYPE_SPECS
3081 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
3082 #else
3083 static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
3084 #endif
3085
3086 /* PyMethodNew.proto */
3087 #if CYTHON_COMPILING_IN_LIMITED_API
3088 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
3089 PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
3090 CYTHON_UNUSED_VAR(typ);
3091 if (!self)
3092 return __Pyx_NewRef(func);
3093 typesModule = PyImport_ImportModule("types");
3094 if (!typesModule) return NULL;
3095 methodType = PyObject_GetAttrString(typesModule, "MethodType");
3096 Py_DECREF(typesModule);
3097 if (!methodType) return NULL;
3098 result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
3099 Py_DECREF(methodType);
3100 return result;
3101 }
3102 #elif PY_MAJOR_VERSION >= 3
3103 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
3104 CYTHON_UNUSED_VAR(typ);
3105 if (!self)
3106 return __Pyx_NewRef(func);
3107 return PyMethod_New(func, self);
3108 }
3109 #else
3110 #define __Pyx_PyMethod_New PyMethod_New
3111 #endif
3112
3113 /* PyVectorcallFastCallDict.proto */
3114 #if CYTHON_METH_FASTCALL
3115 static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
3116 #endif
3117
3118 /* CythonFunctionShared.proto */
3119 #define __Pyx_CyFunction_USED
3120 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
3121 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
3122 #define __Pyx_CYFUNCTION_CCLASS 0x04
3123 #define __Pyx_CYFUNCTION_COROUTINE 0x08
3124 #define __Pyx_CyFunction_GetClosure(f)\
3125 (((__pyx_CyFunctionObject *) (f))->func_closure)
3126 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
3127 #define __Pyx_CyFunction_GetClassObj(f)\
3128 (((__pyx_CyFunctionObject *) (f))->func_classobj)
3129 #else
3130 #define __Pyx_CyFunction_GetClassObj(f)\
3131 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
3132 #endif
3133 #define __Pyx_CyFunction_SetClassObj(f, classobj)\
3134 __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
3135 #define __Pyx_CyFunction_Defaults(type, f)\
3136 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
3137 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
3138 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
3139 typedef struct {
3140 #if CYTHON_COMPILING_IN_LIMITED_API
3141 PyObject_HEAD
3142 PyObject *func;
3143 #elif PY_VERSION_HEX < 0x030900B1
3144 PyCFunctionObject func;
3145 #else
3146 PyCMethodObject func;
3147 #endif
3148 #if CYTHON_BACKPORT_VECTORCALL
3149 __pyx_vectorcallfunc func_vectorcall;
3150 #endif
3151 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
3152 PyObject *func_weakreflist;
3153 #endif
3154 PyObject *func_dict;
3155 PyObject *func_name;
3156 PyObject *func_qualname;
3157 PyObject *func_doc;
3158 PyObject *func_globals;
3159 PyObject *func_code;
3160 PyObject *func_closure;
3161 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
3162 PyObject *func_classobj;
3163 #endif
3164 void *defaults;
3165 int defaults_pyobjects;
3166 size_t defaults_size;
3167 int flags;
3168 PyObject *defaults_tuple;
3169 PyObject *defaults_kwdict;
3170 PyObject *(*defaults_getter)(PyObject *);
3171 PyObject *func_annotations;
3172 PyObject *func_is_coroutine;
3173 } __pyx_CyFunctionObject;
3174 #undef __Pyx_CyOrPyCFunction_Check
3175 #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
3176 #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
3177 #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
3178 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
3179 #undef __Pyx_IsSameCFunction
3180 #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
3181 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
3182 int flags, PyObject* qualname,
3183 PyObject *closure,
3184 PyObject *module, PyObject *globals,
3185 PyObject* code);
3186 static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
3187 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
3188 size_t size,
3189 int pyobjects);
3190 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
3191 PyObject *tuple);
3192 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
3193 PyObject *dict);
3194 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
3195 PyObject *dict);
3196 static int __pyx_CyFunction_init(PyObject *module);
3197 #if CYTHON_METH_FASTCALL
3198 static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3199 static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3200 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3201 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3202 #if CYTHON_BACKPORT_VECTORCALL
3203 #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
3204 #else
3205 #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
3206 #endif
3207 #endif
3208
3209 /* CythonFunction.proto */
3210 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
3211 int flags, PyObject* qualname,
3212 PyObject *closure,
3213 PyObject *module, PyObject *globals,
3214 PyObject* code);
3215
3216 /* PyDictVersioning.proto */
3217 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
3218 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
3219 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
3220 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
3221 (version_var) = __PYX_GET_DICT_VERSION(dict);\
3222 (cache_var) = (value);
3223 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
3224 static PY_UINT64_T __pyx_dict_version = 0;\
3225 static PyObject *__pyx_dict_cached_value = NULL;\
3226 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
3227 (VAR) = __pyx_dict_cached_value;\
3228 } else {\
3229 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
3230 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
3231 }\
3232 }
3233 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
3234 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
3235 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
3236 #else
3237 #define __PYX_GET_DICT_VERSION(dict) (0)
3238 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
3239 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
3240 #endif
3241
3242 /* CLineInTraceback.proto */
3243 #ifdef CYTHON_CLINE_IN_TRACEBACK
3244 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3245 #else
3246 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
3247 #endif
3248
3249 /* CodeObjectCache.proto */
3250 #if !CYTHON_COMPILING_IN_LIMITED_API
3251 typedef struct {
3252 PyCodeObject* code_object;
3253 int code_line;
3254 } __Pyx_CodeObjectCacheEntry;
3255 struct __Pyx_CodeObjectCache {
3256 int count;
3257 int max_count;
3258 __Pyx_CodeObjectCacheEntry* entries;
3259 };
3260 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
3261 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
3262 static PyCodeObject *__pyx_find_code_object(int code_line);
3263 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
3264 #endif
3265
3266 /* AddTraceback.proto */
3267 static void __Pyx_AddTraceback(const char *funcname, int c_line,
3268 int py_line, const char *filename);
3269
3270 /* GCCDiagnostics.proto */
3271 #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
3272 #define __Pyx_HAS_GCC_DIAGNOSTIC
3273 #endif
3274
3275 /* ArrayAPI.proto */
3276 #ifndef _ARRAYARRAY_H
3277 #define _ARRAYARRAY_H
3278 typedef struct arraydescr {
3279 int typecode;
3280 int itemsize;
3281 PyObject * (*getitem)(struct arrayobject *, Py_ssize_t);
3282 int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *);
3283 #if PY_MAJOR_VERSION >= 3
3284 char *formats;
3285 #endif
3286 } arraydescr;
3287 struct arrayobject {
3288 PyObject_HEAD
3289 Py_ssize_t ob_size;
3290 union {
3291 char *ob_item;
3292 float *as_floats;
3293 double *as_doubles;
3294 int *as_ints;
3295 unsigned int *as_uints;
3296 unsigned char *as_uchars;
3297 signed char *as_schars;
3298 char *as_chars;
3299 unsigned long *as_ulongs;
3300 long *as_longs;
3301 #if PY_MAJOR_VERSION >= 3
3302 unsigned long long *as_ulonglongs;
3303 long long *as_longlongs;
3304 #endif
3305 short *as_shorts;
3306 unsigned short *as_ushorts;
3307 Py_UNICODE *as_pyunicodes;
3308 void *as_voidptr;
3309 } data;
3310 Py_ssize_t allocated;
3311 struct arraydescr *ob_descr;
3312 PyObject *weakreflist;
3313 #if PY_MAJOR_VERSION >= 3
3314 int ob_exports;
3315 #endif
3316 };
3317 #ifndef NO_NEWARRAY_INLINE
3318 static CYTHON_INLINE PyObject * newarrayobject(PyTypeObject *type, Py_ssize_t size,
3319 struct arraydescr *descr) {
3320 arrayobject *op;
3321 size_t nbytes;
3322 if (size < 0) {
3323 PyErr_BadInternalCall();
3324 return NULL;
3325 }
3326 nbytes = size * descr->itemsize;
3327 if (nbytes / descr->itemsize != (size_t)size) {
3328 return PyErr_NoMemory();
3329 }
3330 op = (arrayobject *) type->tp_alloc(type, 0);
3331 if (op == NULL) {
3332 return NULL;
3333 }
3334 op->ob_descr = descr;
3335 op->allocated = size;
3336 op->weakreflist = NULL;
3337 __Pyx_SET_SIZE(op, size);
3338 if (size <= 0) {
3339 op->data.ob_item = NULL;
3340 }
3341 else {
3342 op->data.ob_item = PyMem_NEW(char, nbytes);
3343 if (op->data.ob_item == NULL) {
3344 Py_DECREF(op);
3345 return PyErr_NoMemory();
3346 }
3347 }
3348 return (PyObject *) op;
3349 }
3350 #else
3351 PyObject* newarrayobject(PyTypeObject *type, Py_ssize_t size,
3352 struct arraydescr *descr);
3353 #endif
3354 static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) {
3355 void *items = (void*) self->data.ob_item;
3356 PyMem_Resize(items, char, (size_t)(n * self->ob_descr->itemsize));
3357 if (items == NULL) {
3358 PyErr_NoMemory();
3359 return -1;
3360 }
3361 self->data.ob_item = (char*) items;
3362 __Pyx_SET_SIZE(self, n);
3363 self->allocated = n;
3364 return 0;
3365 }
3366 static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) {
3367 void *items = (void*) self->data.ob_item;
3368 Py_ssize_t newsize;
3369 if (n < self->allocated && n*4 > self->allocated) {
3370 __Pyx_SET_SIZE(self, n);
3371 return 0;
3372 }
3373 newsize = n + (n / 2) + 1;
3374 if (newsize <= n) {
3375 PyErr_NoMemory();
3376 return -1;
3377 }
3378 PyMem_Resize(items, char, (size_t)(newsize * self->ob_descr->itemsize));
3379 if (items == NULL) {
3380 PyErr_NoMemory();
3381 return -1;
3382 }
3383 self->data.ob_item = (char*) items;
3384 __Pyx_SET_SIZE(self, n);
3385 self->allocated = newsize;
3386 return 0;
3387 }
3388 #endif
3389
3390 /* CIntFromPy.proto */
3391 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
3392
3393 /* FormatTypeName.proto */
3394 #if CYTHON_COMPILING_IN_LIMITED_API
3395 typedef PyObject *__Pyx_TypeName;
3396 #define __Pyx_FMT_TYPENAME "%U"
3397 static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
3398 #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
3399 #else
3400 typedef const char *__Pyx_TypeName;
3401 #define __Pyx_FMT_TYPENAME "%.200s"
3402 #define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
3403 #define __Pyx_DECREF_TypeName(obj)
3404 #endif
3405
3406 /* CIntToPy.proto */
3407 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
3408
3409 /* CIntFromPy.proto */
3410 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
3411
3412 /* FastTypeChecks.proto */
3413 #if CYTHON_COMPILING_IN_CPYTHON
3414 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
3415 #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
3416 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
3417 static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
3418 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
3419 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
3420 #else
3421 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
3422 #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
3423 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
3424 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
3425 #endif
3426 #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
3427 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
3428
3429 /* CheckBinaryVersion.proto */
3430 static unsigned long __Pyx_get_runtime_version(void);
3431 static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
3432
3433 /* InitStrings.proto */
3434 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
3435
3436 /* #### Code section: module_declarations ### */
3437 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/
3438 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/
3439
3440 /* Module declarations from "libc.stdint" */
3441
3442 /* Module declarations from "libc.string" */
3443
3444 /* Module declarations from "libc.stdlib" */
3445
3446 /* Module declarations from "libc.stdio" */
3447
3448 /* Module declarations from "cython" */
3449
3450 /* Module declarations from "cpython.version" */
3451
3452 /* Module declarations from "__builtin__" */
3453
3454 /* Module declarations from "cpython.type" */
3455
3456 /* Module declarations from "cpython.object" */
3457
3458 /* Module declarations from "cpython.ref" */
3459
3460 /* Module declarations from "cpython.exc" */
3461
3462 /* Module declarations from "cpython.module" */
3463
3464 /* Module declarations from "cpython.mem" */
3465
3466 /* Module declarations from "cpython.tuple" */
3467
3468 /* Module declarations from "cpython.list" */
3469
3470 /* Module declarations from "cpython.sequence" */
3471
3472 /* Module declarations from "cpython.mapping" */
3473
3474 /* Module declarations from "cpython.iterator" */
3475
3476 /* Module declarations from "cpython.number" */
3477
3478 /* Module declarations from "cpython.int" */
3479
3480 /* Module declarations from "__builtin__" */
3481
3482 /* Module declarations from "cpython.bool" */
3483
3484 /* Module declarations from "cpython.long" */
3485
3486 /* Module declarations from "cpython.float" */
3487
3488 /* Module declarations from "__builtin__" */
3489
3490 /* Module declarations from "cpython.complex" */
3491
3492 /* Module declarations from "cpython.string" */
3493
3494 /* Module declarations from "libc.stddef" */
3495
3496 /* Module declarations from "cpython.unicode" */
3497
3498 /* Module declarations from "cpython.pyport" */
3499
3500 /* Module declarations from "cpython.dict" */
3501
3502 /* Module declarations from "cpython.instance" */
3503
3504 /* Module declarations from "cpython.function" */
3505
3506 /* Module declarations from "cpython.method" */
3507
3508 /* Module declarations from "cpython.weakref" */
3509
3510 /* Module declarations from "cpython.getargs" */
3511
3512 /* Module declarations from "cpython.pythread" */
3513
3514 /* Module declarations from "cpython.pystate" */
3515
3516 /* Module declarations from "cpython.cobject" */
3517
3518 /* Module declarations from "cpython.oldbuffer" */
3519
3520 /* Module declarations from "cpython.set" */
3521
3522 /* Module declarations from "cpython.buffer" */
3523
3524 /* Module declarations from "cpython.bytes" */
3525
3526 /* Module declarations from "cpython.pycapsule" */
3527
3528 /* Module declarations from "cpython.contextvars" */
3529
3530 /* Module declarations from "cpython" */
3531
3532 /* Module declarations from "array" */
3533
3534 /* Module declarations from "cpython.array" */
3535 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *, char *, Py_ssize_t); /*proto*/
3536
3537 /* Module declarations from "posix.types" */
3538
3539 /* Module declarations from "pysam.libchtslib" */
3540
3541 /* Module declarations from "pysam.libcfaidx" */
3542
3543 /* Module declarations from "pysam.libcalignedsegment" */
3544
3545 /* Module declarations from "pysam.libcalignmentfile" */
3546
3547 /* Module declarations from "pysam.libcsamfile" */
3548 /* #### Code section: typeinfo ### */
3549 /* #### Code section: before_global_var ### */
3550 #define __Pyx_MODULE_NAME "pysam.libcsamfile"
3551 extern int __pyx_module_is_main_pysam__libcsamfile;
3552 int __pyx_module_is_main_pysam__libcsamfile = 0;
3553
3554 /* Implementation of "pysam.libcsamfile" */
3555 /* #### Code section: global_var ### */
3556 static PyObject *__pyx_builtin_TypeError;
3557 static PyObject *__pyx_builtin_MemoryError;
3558 /* #### Code section: string_decls ### */
3559 static const char __pyx_k__5[] = "*";
3560 static const char __pyx_k__8[] = "?";
3561 static const char __pyx_k_gc[] = "gc";
3562 static const char __pyx_k_os[] = "os";
3563 static const char __pyx_k_re[] = "re";
3564 static const char __pyx_k_all[] = "__all__";
3565 static const char __pyx_k_sys[] = "sys";
3566 static const char __pyx_k_main[] = "__main__";
3567 static const char __pyx_k_name[] = "__name__";
3568 static const char __pyx_k_self[] = "self";
3569 static const char __pyx_k_spec[] = "__spec__";
3570 static const char __pyx_k_test[] = "__test__";
3571 static const char __pyx_k_types[] = "types";
3572 static const char __pyx_k_ctypes[] = "ctypes";
3573 static const char __pyx_k_enable[] = "enable";
3574 static const char __pyx_k_import[] = "__import__";
3575 static const char __pyx_k_reduce[] = "__reduce__";
3576 static const char __pyx_k_struct[] = "struct";
3577 static const char __pyx_k_Samfile[] = "Samfile";
3578 static const char __pyx_k_disable[] = "disable";
3579 static const char __pyx_k_getstate[] = "__getstate__";
3580 static const char __pyx_k_platform[] = "platform";
3581 static const char __pyx_k_setstate[] = "__setstate__";
3582 static const char __pyx_k_tempfile[] = "tempfile";
3583 static const char __pyx_k_warnings[] = "warnings";
3584 static const char __pyx_k_TypeError[] = "TypeError";
3585 static const char __pyx_k_isenabled[] = "isenabled";
3586 static const char __pyx_k_itertools[] = "itertools";
3587 static const char __pyx_k_pyx_state[] = "__pyx_state";
3588 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
3589 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
3590 static const char __pyx_k_AlignedRead[] = "AlignedRead";
3591 static const char __pyx_k_MemoryError[] = "MemoryError";
3592 static const char __pyx_k_collections[] = "collections";
3593 static const char __pyx_k_initializing[] = "_initializing";
3594 static const char __pyx_k_is_coroutine[] = "_is_coroutine";
3595 static const char __pyx_k_stringsource[] = "<stringsource>";
3596 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
3597 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
3598 static const char __pyx_k_pysam_libcsamfile[] = "pysam.libcsamfile";
3599 static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
3600 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
3601 static const char __pyx_k_Samfile___reduce_cython[] = "Samfile.__reduce_cython__";
3602 static const char __pyx_k_Samfile___setstate_cython[] = "Samfile.__setstate_cython__";
3603 static const char __pyx_k_AlignedRead___reduce_cython[] = "AlignedRead.__reduce_cython__";
3604 static const char __pyx_k_AlignedRead___setstate_cython[] = "AlignedRead.__setstate_cython__";
3605 static const char __pyx_k_self__delegate_cannot_be_convert[] = "self._delegate cannot be converted to a Python object for pickling";
3606 static const char __pyx_k_self_b_self_htsfile_self_index_c[] = "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling";
3607 /* #### Code section: decls ### */
3608 static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */
3609 static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
3610 static PyObject *__pyx_pf_5pysam_11libcsamfile_7Samfile___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_11libcsamfile_Samfile *__pyx_v_self); /* proto */
3611 static PyObject *__pyx_pf_5pysam_11libcsamfile_7Samfile_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_11libcsamfile_Samfile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3612 static PyObject *__pyx_pf_5pysam_11libcsamfile_11AlignedRead___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_11libcsamfile_AlignedRead *__pyx_v_self); /* proto */
3613 static PyObject *__pyx_pf_5pysam_11libcsamfile_11AlignedRead_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_11libcsamfile_AlignedRead *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3614 static PyObject *__pyx_tp_new_5pysam_11libcsamfile_AlignedRead(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3615 static PyObject *__pyx_tp_new_5pysam_11libcsamfile_Samfile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3616 /* #### Code section: late_includes ### */
3617 /* #### Code section: module_state ### */
3618 typedef struct {
3619 PyObject *__pyx_d;
3620 PyObject *__pyx_b;
3621 PyObject *__pyx_cython_runtime;
3622 PyObject *__pyx_empty_tuple;
3623 PyObject *__pyx_empty_bytes;
3624 PyObject *__pyx_empty_unicode;
3625 #ifdef __Pyx_CyFunction_USED
3626 PyTypeObject *__pyx_CyFunctionType;
3627 #endif
3628 #ifdef __Pyx_FusedFunction_USED
3629 PyTypeObject *__pyx_FusedFunctionType;
3630 #endif
3631 #ifdef __Pyx_Generator_USED
3632 PyTypeObject *__pyx_GeneratorType;
3633 #endif
3634 #ifdef __Pyx_IterableCoroutine_USED
3635 PyTypeObject *__pyx_IterableCoroutineType;
3636 #endif
3637 #ifdef __Pyx_Coroutine_USED
3638 PyTypeObject *__pyx_CoroutineAwaitType;
3639 #endif
3640 #ifdef __Pyx_Coroutine_USED
3641 PyTypeObject *__pyx_CoroutineType;
3642 #endif
3643 #if CYTHON_USE_MODULE_STATE
3644 #endif
3645 #if CYTHON_USE_MODULE_STATE
3646 #endif
3647 #if CYTHON_USE_MODULE_STATE
3648 #endif
3649 #if CYTHON_USE_MODULE_STATE
3650 #endif
3651 #if CYTHON_USE_MODULE_STATE
3652 #endif
3653 #if CYTHON_USE_MODULE_STATE
3654 #endif
3655 #if CYTHON_USE_MODULE_STATE
3656 #endif
3657 #if CYTHON_USE_MODULE_STATE
3658 #endif
3659 PyTypeObject *__pyx_ptype_7cpython_4type_type;
3660 #if CYTHON_USE_MODULE_STATE
3661 #endif
3662 #if CYTHON_USE_MODULE_STATE
3663 #endif
3664 #if CYTHON_USE_MODULE_STATE
3665 #endif
3666 #if CYTHON_USE_MODULE_STATE
3667 #endif
3668 #if CYTHON_USE_MODULE_STATE
3669 #endif
3670 #if CYTHON_USE_MODULE_STATE
3671 #endif
3672 #if CYTHON_USE_MODULE_STATE
3673 #endif
3674 #if CYTHON_USE_MODULE_STATE
3675 #endif
3676 #if CYTHON_USE_MODULE_STATE
3677 #endif
3678 #if CYTHON_USE_MODULE_STATE
3679 #endif
3680 #if CYTHON_USE_MODULE_STATE
3681 #endif
3682 #if CYTHON_USE_MODULE_STATE
3683 #endif
3684 #if CYTHON_USE_MODULE_STATE
3685 #endif
3686 #if CYTHON_USE_MODULE_STATE
3687 #endif
3688 PyTypeObject *__pyx_ptype_7cpython_4bool_bool;
3689 #if CYTHON_USE_MODULE_STATE
3690 #endif
3691 #if CYTHON_USE_MODULE_STATE
3692 #endif
3693 #if CYTHON_USE_MODULE_STATE
3694 #endif
3695 #if CYTHON_USE_MODULE_STATE
3696 #endif
3697 PyTypeObject *__pyx_ptype_7cpython_7complex_complex;
3698 #if CYTHON_USE_MODULE_STATE
3699 #endif
3700 #if CYTHON_USE_MODULE_STATE
3701 #endif
3702 #if CYTHON_USE_MODULE_STATE
3703 #endif
3704 #if CYTHON_USE_MODULE_STATE
3705 #endif
3706 #if CYTHON_USE_MODULE_STATE
3707 #endif
3708 #if CYTHON_USE_MODULE_STATE
3709 #endif
3710 #if CYTHON_USE_MODULE_STATE
3711 #endif
3712 #if CYTHON_USE_MODULE_STATE
3713 #endif
3714 #if CYTHON_USE_MODULE_STATE
3715 #endif
3716 #if CYTHON_USE_MODULE_STATE
3717 #endif
3718 #if CYTHON_USE_MODULE_STATE
3719 #endif
3720 #if CYTHON_USE_MODULE_STATE
3721 #endif
3722 #if CYTHON_USE_MODULE_STATE
3723 #endif
3724 #if CYTHON_USE_MODULE_STATE
3725 #endif
3726 #if CYTHON_USE_MODULE_STATE
3727 #endif
3728 #if CYTHON_USE_MODULE_STATE
3729 #endif
3730 #if CYTHON_USE_MODULE_STATE
3731 #endif
3732 #if CYTHON_USE_MODULE_STATE
3733 #endif
3734 #if CYTHON_USE_MODULE_STATE
3735 #endif
3736 #if CYTHON_USE_MODULE_STATE
3737 #endif
3738 #if CYTHON_USE_MODULE_STATE
3739 #endif
3740 #if CYTHON_USE_MODULE_STATE
3741 #endif
3742 PyTypeObject *__pyx_ptype_7cpython_5array_array;
3743 #if CYTHON_USE_MODULE_STATE
3744 #endif
3745 #if CYTHON_USE_MODULE_STATE
3746 #endif
3747 PyTypeObject *__pyx_ptype_5pysam_10libchtslib_HTSFile;
3748 #if CYTHON_USE_MODULE_STATE
3749 #endif
3750 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_FastaFile;
3751 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_FastqProxy;
3752 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_FastxRecord;
3753 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_FastxFile;
3754 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_FastqFile;
3755 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_Fastafile;
3756 #if CYTHON_USE_MODULE_STATE
3757 #endif
3758 PyTypeObject *__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment;
3759 PyTypeObject *__pyx_ptype_5pysam_18libcalignedsegment_PileupColumn;
3760 PyTypeObject *__pyx_ptype_5pysam_18libcalignedsegment_PileupRead;
3761 #if CYTHON_USE_MODULE_STATE
3762 #endif
3763 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_AlignmentHeader;
3764 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile;
3765 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorRow;
3766 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowRegion;
3767 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowHead;
3768 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAll;
3769 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAllRefs;
3770 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowSelection;
3771 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumn;
3772 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnRegion;
3773 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAllRefs;
3774 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAll;
3775 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IndexedReads;
3776 #if CYTHON_USE_MODULE_STATE
3777 PyObject *__pyx_type_5pysam_11libcsamfile_AlignedRead;
3778 PyObject *__pyx_type_5pysam_11libcsamfile_Samfile;
3779 #endif
3780 PyTypeObject *__pyx_ptype_5pysam_11libcsamfile_AlignedRead;
3781 PyTypeObject *__pyx_ptype_5pysam_11libcsamfile_Samfile;
3782 PyObject *__pyx_n_s_AlignedRead;
3783 PyObject *__pyx_n_u_AlignedRead;
3784 PyObject *__pyx_n_s_AlignedRead___reduce_cython;
3785 PyObject *__pyx_n_s_AlignedRead___setstate_cython;
3786 PyObject *__pyx_n_s_MemoryError;
3787 PyObject *__pyx_n_s_Samfile;
3788 PyObject *__pyx_n_u_Samfile;
3789 PyObject *__pyx_n_s_Samfile___reduce_cython;
3790 PyObject *__pyx_n_s_Samfile___setstate_cython;
3791 PyObject *__pyx_n_s_TypeError;
3792 PyObject *__pyx_n_s__5;
3793 PyObject *__pyx_n_s__8;
3794 PyObject *__pyx_n_s_all;
3795 PyObject *__pyx_n_s_asyncio_coroutines;
3796 PyObject *__pyx_n_s_cline_in_traceback;
3797 PyObject *__pyx_n_s_collections;
3798 PyObject *__pyx_n_s_ctypes;
3799 PyObject *__pyx_kp_u_disable;
3800 PyObject *__pyx_kp_u_enable;
3801 PyObject *__pyx_kp_u_gc;
3802 PyObject *__pyx_n_s_getstate;
3803 PyObject *__pyx_n_s_import;
3804 PyObject *__pyx_n_s_initializing;
3805 PyObject *__pyx_n_s_is_coroutine;
3806 PyObject *__pyx_kp_u_isenabled;
3807 PyObject *__pyx_n_s_itertools;
3808 PyObject *__pyx_n_s_main;
3809 PyObject *__pyx_n_s_name;
3810 PyObject *__pyx_n_s_os;
3811 PyObject *__pyx_n_s_platform;
3812 PyObject *__pyx_n_s_pysam_libcsamfile;
3813 PyObject *__pyx_n_s_pyx_state;
3814 PyObject *__pyx_n_s_pyx_vtable;
3815 PyObject *__pyx_n_s_re;
3816 PyObject *__pyx_n_s_reduce;
3817 PyObject *__pyx_n_s_reduce_cython;
3818 PyObject *__pyx_n_s_reduce_ex;
3819 PyObject *__pyx_n_s_self;
3820 PyObject *__pyx_kp_s_self__delegate_cannot_be_convert;
3821 PyObject *__pyx_kp_s_self_b_self_htsfile_self_index_c;
3822 PyObject *__pyx_n_s_setstate;
3823 PyObject *__pyx_n_s_setstate_cython;
3824 PyObject *__pyx_n_s_spec;
3825 PyObject *__pyx_kp_s_stringsource;
3826 PyObject *__pyx_n_s_struct;
3827 PyObject *__pyx_n_s_sys;
3828 PyObject *__pyx_n_s_tempfile;
3829 PyObject *__pyx_n_s_test;
3830 PyObject *__pyx_n_s_types;
3831 PyObject *__pyx_n_s_warnings;
3832 PyObject *__pyx_codeobj_;
3833 PyObject *__pyx_tuple__6;
3834 PyObject *__pyx_tuple__7;
3835 PyObject *__pyx_codeobj__2;
3836 PyObject *__pyx_codeobj__3;
3837 PyObject *__pyx_codeobj__4;
3838 } __pyx_mstate;
3839
3840 #if CYTHON_USE_MODULE_STATE
3841 #ifdef __cplusplus
3842 namespace {
3843 extern struct PyModuleDef __pyx_moduledef;
3844 } /* anonymous namespace */
3845 #else
3846 static struct PyModuleDef __pyx_moduledef;
3847 #endif
3848
3849 #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
3850
3851 #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
3852
3853 #define __pyx_m (PyState_FindModule(&__pyx_moduledef))
3854 #else
3855 static __pyx_mstate __pyx_mstate_global_static =
3856 #ifdef __cplusplus
3857 {};
3858 #else
3859 {0};
3860 #endif
3861 static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
3862 #endif
3863 /* #### Code section: module_state_clear ### */
3864 #if CYTHON_USE_MODULE_STATE
3865 static int __pyx_m_clear(PyObject *m) {
3866 __pyx_mstate *clear_module_state = __pyx_mstate(m);
3867 if (!clear_module_state) return 0;
3868 Py_CLEAR(clear_module_state->__pyx_d);
3869 Py_CLEAR(clear_module_state->__pyx_b);
3870 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
3871 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
3872 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
3873 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
3874 #ifdef __Pyx_CyFunction_USED
3875 Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
3876 #endif
3877 #ifdef __Pyx_FusedFunction_USED
3878 Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
3879 #endif
3880 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
3881 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool);
3882 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex);
3883 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_5array_array);
3884 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_10libchtslib_HTSFile);
3885 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_FastaFile);
3886 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_FastqProxy);
3887 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_FastxRecord);
3888 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_FastxFile);
3889 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_FastqFile);
3890 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_Fastafile);
3891 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment);
3892 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_18libcalignedsegment_PileupColumn);
3893 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_18libcalignedsegment_PileupRead);
3894 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_AlignmentHeader);
3895 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile);
3896 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRow);
3897 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowRegion);
3898 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowHead);
3899 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAll);
3900 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAllRefs);
3901 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowSelection);
3902 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumn);
3903 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnRegion);
3904 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAllRefs);
3905 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAll);
3906 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IndexedReads);
3907 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_11libcsamfile_AlignedRead);
3908 Py_CLEAR(clear_module_state->__pyx_type_5pysam_11libcsamfile_AlignedRead);
3909 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_11libcsamfile_Samfile);
3910 Py_CLEAR(clear_module_state->__pyx_type_5pysam_11libcsamfile_Samfile);
3911 Py_CLEAR(clear_module_state->__pyx_n_s_AlignedRead);
3912 Py_CLEAR(clear_module_state->__pyx_n_u_AlignedRead);
3913 Py_CLEAR(clear_module_state->__pyx_n_s_AlignedRead___reduce_cython);
3914 Py_CLEAR(clear_module_state->__pyx_n_s_AlignedRead___setstate_cython);
3915 Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
3916 Py_CLEAR(clear_module_state->__pyx_n_s_Samfile);
3917 Py_CLEAR(clear_module_state->__pyx_n_u_Samfile);
3918 Py_CLEAR(clear_module_state->__pyx_n_s_Samfile___reduce_cython);
3919 Py_CLEAR(clear_module_state->__pyx_n_s_Samfile___setstate_cython);
3920 Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
3921 Py_CLEAR(clear_module_state->__pyx_n_s__5);
3922 Py_CLEAR(clear_module_state->__pyx_n_s__8);
3923 Py_CLEAR(clear_module_state->__pyx_n_s_all);
3924 Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
3925 Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
3926 Py_CLEAR(clear_module_state->__pyx_n_s_collections);
3927 Py_CLEAR(clear_module_state->__pyx_n_s_ctypes);
3928 Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
3929 Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
3930 Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
3931 Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
3932 Py_CLEAR(clear_module_state->__pyx_n_s_import);
3933 Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
3934 Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
3935 Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
3936 Py_CLEAR(clear_module_state->__pyx_n_s_itertools);
3937 Py_CLEAR(clear_module_state->__pyx_n_s_main);
3938 Py_CLEAR(clear_module_state->__pyx_n_s_name);
3939 Py_CLEAR(clear_module_state->__pyx_n_s_os);
3940 Py_CLEAR(clear_module_state->__pyx_n_s_platform);
3941 Py_CLEAR(clear_module_state->__pyx_n_s_pysam_libcsamfile);
3942 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
3943 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
3944 Py_CLEAR(clear_module_state->__pyx_n_s_re);
3945 Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
3946 Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
3947 Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
3948 Py_CLEAR(clear_module_state->__pyx_n_s_self);
3949 Py_CLEAR(clear_module_state->__pyx_kp_s_self__delegate_cannot_be_convert);
3950 Py_CLEAR(clear_module_state->__pyx_kp_s_self_b_self_htsfile_self_index_c);
3951 Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
3952 Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
3953 Py_CLEAR(clear_module_state->__pyx_n_s_spec);
3954 Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
3955 Py_CLEAR(clear_module_state->__pyx_n_s_struct);
3956 Py_CLEAR(clear_module_state->__pyx_n_s_sys);
3957 Py_CLEAR(clear_module_state->__pyx_n_s_tempfile);
3958 Py_CLEAR(clear_module_state->__pyx_n_s_test);
3959 Py_CLEAR(clear_module_state->__pyx_n_s_types);
3960 Py_CLEAR(clear_module_state->__pyx_n_s_warnings);
3961 Py_CLEAR(clear_module_state->__pyx_codeobj_);
3962 Py_CLEAR(clear_module_state->__pyx_tuple__6);
3963 Py_CLEAR(clear_module_state->__pyx_tuple__7);
3964 Py_CLEAR(clear_module_state->__pyx_codeobj__2);
3965 Py_CLEAR(clear_module_state->__pyx_codeobj__3);
3966 Py_CLEAR(clear_module_state->__pyx_codeobj__4);
3967 return 0;
3968 }
3969 #endif
3970 /* #### Code section: module_state_traverse ### */
3971 #if CYTHON_USE_MODULE_STATE
3972 static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
3973 __pyx_mstate *traverse_module_state = __pyx_mstate(m);
3974 if (!traverse_module_state) return 0;
3975 Py_VISIT(traverse_module_state->__pyx_d);
3976 Py_VISIT(traverse_module_state->__pyx_b);
3977 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
3978 Py_VISIT(traverse_module_state->__pyx_empty_tuple);
3979 Py_VISIT(traverse_module_state->__pyx_empty_bytes);
3980 Py_VISIT(traverse_module_state->__pyx_empty_unicode);
3981 #ifdef __Pyx_CyFunction_USED
3982 Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
3983 #endif
3984 #ifdef __Pyx_FusedFunction_USED
3985 Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
3986 #endif
3987 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
3988 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool);
3989 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex);
3990 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_5array_array);
3991 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_10libchtslib_HTSFile);
3992 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_FastaFile);
3993 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_FastqProxy);
3994 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_FastxRecord);
3995 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_FastxFile);
3996 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_FastqFile);
3997 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_Fastafile);
3998 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment);
3999 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_18libcalignedsegment_PileupColumn);
4000 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_18libcalignedsegment_PileupRead);
4001 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_AlignmentHeader);
4002 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile);
4003 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRow);
4004 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowRegion);
4005 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowHead);
4006 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAll);
4007 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAllRefs);
4008 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowSelection);
4009 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumn);
4010 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnRegion);
4011 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAllRefs);
4012 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAll);
4013 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IndexedReads);
4014 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_11libcsamfile_AlignedRead);
4015 Py_VISIT(traverse_module_state->__pyx_type_5pysam_11libcsamfile_AlignedRead);
4016 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_11libcsamfile_Samfile);
4017 Py_VISIT(traverse_module_state->__pyx_type_5pysam_11libcsamfile_Samfile);
4018 Py_VISIT(traverse_module_state->__pyx_n_s_AlignedRead);
4019 Py_VISIT(traverse_module_state->__pyx_n_u_AlignedRead);
4020 Py_VISIT(traverse_module_state->__pyx_n_s_AlignedRead___reduce_cython);
4021 Py_VISIT(traverse_module_state->__pyx_n_s_AlignedRead___setstate_cython);
4022 Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
4023 Py_VISIT(traverse_module_state->__pyx_n_s_Samfile);
4024 Py_VISIT(traverse_module_state->__pyx_n_u_Samfile);
4025 Py_VISIT(traverse_module_state->__pyx_n_s_Samfile___reduce_cython);
4026 Py_VISIT(traverse_module_state->__pyx_n_s_Samfile___setstate_cython);
4027 Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
4028 Py_VISIT(traverse_module_state->__pyx_n_s__5);
4029 Py_VISIT(traverse_module_state->__pyx_n_s__8);
4030 Py_VISIT(traverse_module_state->__pyx_n_s_all);
4031 Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
4032 Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
4033 Py_VISIT(traverse_module_state->__pyx_n_s_collections);
4034 Py_VISIT(traverse_module_state->__pyx_n_s_ctypes);
4035 Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
4036 Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
4037 Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
4038 Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
4039 Py_VISIT(traverse_module_state->__pyx_n_s_import);
4040 Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
4041 Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
4042 Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
4043 Py_VISIT(traverse_module_state->__pyx_n_s_itertools);
4044 Py_VISIT(traverse_module_state->__pyx_n_s_main);
4045 Py_VISIT(traverse_module_state->__pyx_n_s_name);
4046 Py_VISIT(traverse_module_state->__pyx_n_s_os);
4047 Py_VISIT(traverse_module_state->__pyx_n_s_platform);
4048 Py_VISIT(traverse_module_state->__pyx_n_s_pysam_libcsamfile);
4049 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
4050 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
4051 Py_VISIT(traverse_module_state->__pyx_n_s_re);
4052 Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
4053 Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
4054 Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
4055 Py_VISIT(traverse_module_state->__pyx_n_s_self);
4056 Py_VISIT(traverse_module_state->__pyx_kp_s_self__delegate_cannot_be_convert);
4057 Py_VISIT(traverse_module_state->__pyx_kp_s_self_b_self_htsfile_self_index_c);
4058 Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
4059 Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
4060 Py_VISIT(traverse_module_state->__pyx_n_s_spec);
4061 Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
4062 Py_VISIT(traverse_module_state->__pyx_n_s_struct);
4063 Py_VISIT(traverse_module_state->__pyx_n_s_sys);
4064 Py_VISIT(traverse_module_state->__pyx_n_s_tempfile);
4065 Py_VISIT(traverse_module_state->__pyx_n_s_test);
4066 Py_VISIT(traverse_module_state->__pyx_n_s_types);
4067 Py_VISIT(traverse_module_state->__pyx_n_s_warnings);
4068 Py_VISIT(traverse_module_state->__pyx_codeobj_);
4069 Py_VISIT(traverse_module_state->__pyx_tuple__6);
4070 Py_VISIT(traverse_module_state->__pyx_tuple__7);
4071 Py_VISIT(traverse_module_state->__pyx_codeobj__2);
4072 Py_VISIT(traverse_module_state->__pyx_codeobj__3);
4073 Py_VISIT(traverse_module_state->__pyx_codeobj__4);
4074 return 0;
4075 }
4076 #endif
4077 /* #### Code section: module_state_defines ### */
4078 #define __pyx_d __pyx_mstate_global->__pyx_d
4079 #define __pyx_b __pyx_mstate_global->__pyx_b
4080 #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
4081 #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
4082 #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
4083 #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
4084 #ifdef __Pyx_CyFunction_USED
4085 #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
4086 #endif
4087 #ifdef __Pyx_FusedFunction_USED
4088 #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
4089 #endif
4090 #ifdef __Pyx_Generator_USED
4091 #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
4092 #endif
4093 #ifdef __Pyx_IterableCoroutine_USED
4094 #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
4095 #endif
4096 #ifdef __Pyx_Coroutine_USED
4097 #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
4098 #endif
4099 #ifdef __Pyx_Coroutine_USED
4100 #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
4101 #endif
4102 #if CYTHON_USE_MODULE_STATE
4103 #endif
4104 #if CYTHON_USE_MODULE_STATE
4105 #endif
4106 #if CYTHON_USE_MODULE_STATE
4107 #endif
4108 #if CYTHON_USE_MODULE_STATE
4109 #endif
4110 #if CYTHON_USE_MODULE_STATE
4111 #endif
4112 #if CYTHON_USE_MODULE_STATE
4113 #endif
4114 #if CYTHON_USE_MODULE_STATE
4115 #endif
4116 #if CYTHON_USE_MODULE_STATE
4117 #endif
4118 #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
4119 #if CYTHON_USE_MODULE_STATE
4120 #endif
4121 #if CYTHON_USE_MODULE_STATE
4122 #endif
4123 #if CYTHON_USE_MODULE_STATE
4124 #endif
4125 #if CYTHON_USE_MODULE_STATE
4126 #endif
4127 #if CYTHON_USE_MODULE_STATE
4128 #endif
4129 #if CYTHON_USE_MODULE_STATE
4130 #endif
4131 #if CYTHON_USE_MODULE_STATE
4132 #endif
4133 #if CYTHON_USE_MODULE_STATE
4134 #endif
4135 #if CYTHON_USE_MODULE_STATE
4136 #endif
4137 #if CYTHON_USE_MODULE_STATE
4138 #endif
4139 #if CYTHON_USE_MODULE_STATE
4140 #endif
4141 #if CYTHON_USE_MODULE_STATE
4142 #endif
4143 #if CYTHON_USE_MODULE_STATE
4144 #endif
4145 #if CYTHON_USE_MODULE_STATE
4146 #endif
4147 #define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool
4148 #if CYTHON_USE_MODULE_STATE
4149 #endif
4150 #if CYTHON_USE_MODULE_STATE
4151 #endif
4152 #if CYTHON_USE_MODULE_STATE
4153 #endif
4154 #if CYTHON_USE_MODULE_STATE
4155 #endif
4156 #define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex
4157 #if CYTHON_USE_MODULE_STATE
4158 #endif
4159 #if CYTHON_USE_MODULE_STATE
4160 #endif
4161 #if CYTHON_USE_MODULE_STATE
4162 #endif
4163 #if CYTHON_USE_MODULE_STATE
4164 #endif
4165 #if CYTHON_USE_MODULE_STATE
4166 #endif
4167 #if CYTHON_USE_MODULE_STATE
4168 #endif
4169 #if CYTHON_USE_MODULE_STATE
4170 #endif
4171 #if CYTHON_USE_MODULE_STATE
4172 #endif
4173 #if CYTHON_USE_MODULE_STATE
4174 #endif
4175 #if CYTHON_USE_MODULE_STATE
4176 #endif
4177 #if CYTHON_USE_MODULE_STATE
4178 #endif
4179 #if CYTHON_USE_MODULE_STATE
4180 #endif
4181 #if CYTHON_USE_MODULE_STATE
4182 #endif
4183 #if CYTHON_USE_MODULE_STATE
4184 #endif
4185 #if CYTHON_USE_MODULE_STATE
4186 #endif
4187 #if CYTHON_USE_MODULE_STATE
4188 #endif
4189 #if CYTHON_USE_MODULE_STATE
4190 #endif
4191 #if CYTHON_USE_MODULE_STATE
4192 #endif
4193 #if CYTHON_USE_MODULE_STATE
4194 #endif
4195 #if CYTHON_USE_MODULE_STATE
4196 #endif
4197 #if CYTHON_USE_MODULE_STATE
4198 #endif
4199 #if CYTHON_USE_MODULE_STATE
4200 #endif
4201 #define __pyx_ptype_7cpython_5array_array __pyx_mstate_global->__pyx_ptype_7cpython_5array_array
4202 #if CYTHON_USE_MODULE_STATE
4203 #endif
4204 #if CYTHON_USE_MODULE_STATE
4205 #endif
4206 #define __pyx_ptype_5pysam_10libchtslib_HTSFile __pyx_mstate_global->__pyx_ptype_5pysam_10libchtslib_HTSFile
4207 #if CYTHON_USE_MODULE_STATE
4208 #endif
4209 #define __pyx_ptype_5pysam_9libcfaidx_FastaFile __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_FastaFile
4210 #define __pyx_ptype_5pysam_9libcfaidx_FastqProxy __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_FastqProxy
4211 #define __pyx_ptype_5pysam_9libcfaidx_FastxRecord __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_FastxRecord
4212 #define __pyx_ptype_5pysam_9libcfaidx_FastxFile __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_FastxFile
4213 #define __pyx_ptype_5pysam_9libcfaidx_FastqFile __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_FastqFile
4214 #define __pyx_ptype_5pysam_9libcfaidx_Fastafile __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_Fastafile
4215 #if CYTHON_USE_MODULE_STATE
4216 #endif
4217 #define __pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment __pyx_mstate_global->__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment
4218 #define __pyx_ptype_5pysam_18libcalignedsegment_PileupColumn __pyx_mstate_global->__pyx_ptype_5pysam_18libcalignedsegment_PileupColumn
4219 #define __pyx_ptype_5pysam_18libcalignedsegment_PileupRead __pyx_mstate_global->__pyx_ptype_5pysam_18libcalignedsegment_PileupRead
4220 #if CYTHON_USE_MODULE_STATE
4221 #endif
4222 #define __pyx_ptype_5pysam_17libcalignmentfile_AlignmentHeader __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_AlignmentHeader
4223 #define __pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile
4224 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorRow __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRow
4225 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowRegion __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowRegion
4226 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowHead __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowHead
4227 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAll __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAll
4228 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAllRefs __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAllRefs
4229 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowSelection __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowSelection
4230 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorColumn __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumn
4231 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnRegion __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnRegion
4232 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAllRefs __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAllRefs
4233 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAll __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAll
4234 #define __pyx_ptype_5pysam_17libcalignmentfile_IndexedReads __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IndexedReads
4235 #if CYTHON_USE_MODULE_STATE
4236 #define __pyx_type_5pysam_11libcsamfile_AlignedRead __pyx_mstate_global->__pyx_type_5pysam_11libcsamfile_AlignedRead
4237 #define __pyx_type_5pysam_11libcsamfile_Samfile __pyx_mstate_global->__pyx_type_5pysam_11libcsamfile_Samfile
4238 #endif
4239 #define __pyx_ptype_5pysam_11libcsamfile_AlignedRead __pyx_mstate_global->__pyx_ptype_5pysam_11libcsamfile_AlignedRead
4240 #define __pyx_ptype_5pysam_11libcsamfile_Samfile __pyx_mstate_global->__pyx_ptype_5pysam_11libcsamfile_Samfile
4241 #define __pyx_n_s_AlignedRead __pyx_mstate_global->__pyx_n_s_AlignedRead
4242 #define __pyx_n_u_AlignedRead __pyx_mstate_global->__pyx_n_u_AlignedRead
4243 #define __pyx_n_s_AlignedRead___reduce_cython __pyx_mstate_global->__pyx_n_s_AlignedRead___reduce_cython
4244 #define __pyx_n_s_AlignedRead___setstate_cython __pyx_mstate_global->__pyx_n_s_AlignedRead___setstate_cython
4245 #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
4246 #define __pyx_n_s_Samfile __pyx_mstate_global->__pyx_n_s_Samfile
4247 #define __pyx_n_u_Samfile __pyx_mstate_global->__pyx_n_u_Samfile
4248 #define __pyx_n_s_Samfile___reduce_cython __pyx_mstate_global->__pyx_n_s_Samfile___reduce_cython
4249 #define __pyx_n_s_Samfile___setstate_cython __pyx_mstate_global->__pyx_n_s_Samfile___setstate_cython
4250 #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
4251 #define __pyx_n_s__5 __pyx_mstate_global->__pyx_n_s__5
4252 #define __pyx_n_s__8 __pyx_mstate_global->__pyx_n_s__8
4253 #define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all
4254 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
4255 #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
4256 #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections
4257 #define __pyx_n_s_ctypes __pyx_mstate_global->__pyx_n_s_ctypes
4258 #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
4259 #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
4260 #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
4261 #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
4262 #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
4263 #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
4264 #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
4265 #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
4266 #define __pyx_n_s_itertools __pyx_mstate_global->__pyx_n_s_itertools
4267 #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
4268 #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
4269 #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os
4270 #define __pyx_n_s_platform __pyx_mstate_global->__pyx_n_s_platform
4271 #define __pyx_n_s_pysam_libcsamfile __pyx_mstate_global->__pyx_n_s_pysam_libcsamfile
4272 #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
4273 #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
4274 #define __pyx_n_s_re __pyx_mstate_global->__pyx_n_s_re
4275 #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
4276 #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
4277 #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
4278 #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self
4279 #define __pyx_kp_s_self__delegate_cannot_be_convert __pyx_mstate_global->__pyx_kp_s_self__delegate_cannot_be_convert
4280 #define __pyx_kp_s_self_b_self_htsfile_self_index_c __pyx_mstate_global->__pyx_kp_s_self_b_self_htsfile_self_index_c
4281 #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
4282 #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
4283 #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
4284 #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
4285 #define __pyx_n_s_struct __pyx_mstate_global->__pyx_n_s_struct
4286 #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys
4287 #define __pyx_n_s_tempfile __pyx_mstate_global->__pyx_n_s_tempfile
4288 #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
4289 #define __pyx_n_s_types __pyx_mstate_global->__pyx_n_s_types
4290 #define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings
4291 #define __pyx_codeobj_ __pyx_mstate_global->__pyx_codeobj_
4292 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6
4293 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7
4294 #define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2
4295 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3
4296 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4
4297 /* #### Code section: module_code ### */
4298
4299 /* "cpython/complex.pxd":19
4300 *
4301 * @property
4302 * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<<
4303 * return self.cval.real
4304 *
4305 */
4306
4307 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) {
4308 double __pyx_r;
4309
4310 /* "cpython/complex.pxd":20
4311 * @property
4312 * cdef inline double real(self) noexcept:
4313 * return self.cval.real # <<<<<<<<<<<<<<
4314 *
4315 * @property
4316 */
4317 __pyx_r = __pyx_v_self->cval.real;
4318 goto __pyx_L0;
4319
4320 /* "cpython/complex.pxd":19
4321 *
4322 * @property
4323 * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<<
4324 * return self.cval.real
4325 *
4326 */
4327
4328 /* function exit code */
4329 __pyx_L0:;
4330 return __pyx_r;
4331 }
4332
4333 /* "cpython/complex.pxd":23
4334 *
4335 * @property
4336 * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<<
4337 * return self.cval.imag
4338 *
4339 */
4340
4341 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) {
4342 double __pyx_r;
4343
4344 /* "cpython/complex.pxd":24
4345 * @property
4346 * cdef inline double imag(self) noexcept:
4347 * return self.cval.imag # <<<<<<<<<<<<<<
4348 *
4349 * # PyTypeObject PyComplex_Type
4350 */
4351 __pyx_r = __pyx_v_self->cval.imag;
4352 goto __pyx_L0;
4353
4354 /* "cpython/complex.pxd":23
4355 *
4356 * @property
4357 * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<<
4358 * return self.cval.imag
4359 *
4360 */
4361
4362 /* function exit code */
4363 __pyx_L0:;
4364 return __pyx_r;
4365 }
4366
4367 /* "cpython/contextvars.pxd":112
4368 *
4369 *
4370 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<<
4371 * """Return a new reference to the value of the context variable,
4372 * or the default value of the context variable,
4373 */
4374
4375 static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) {
4376 PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
4377 PyObject *__pyx_v_value;
4378 PyObject *__pyx_v_pyvalue = NULL;
4379 PyObject *__pyx_r = NULL;
4380 __Pyx_RefNannyDeclarations
4381 int __pyx_t_1;
4382 int __pyx_t_2;
4383 PyObject *__pyx_t_3 = NULL;
4384 int __pyx_lineno = 0;
4385 const char *__pyx_filename = NULL;
4386 int __pyx_clineno = 0;
4387 __Pyx_RefNannySetupContext("get_value", 1);
4388 if (__pyx_optional_args) {
4389 if (__pyx_optional_args->__pyx_n > 0) {
4390 __pyx_v_default_value = __pyx_optional_args->default_value;
4391 }
4392 }
4393
4394 /* "cpython/contextvars.pxd":117
4395 * or None if no such value or default was found.
4396 * """
4397 * cdef PyObject *value = NULL # <<<<<<<<<<<<<<
4398 * PyContextVar_Get(var, NULL, &value)
4399 * if value is NULL:
4400 */
4401 __pyx_v_value = NULL;
4402
4403 /* "cpython/contextvars.pxd":118
4404 * """
4405 * cdef PyObject *value = NULL
4406 * PyContextVar_Get(var, NULL, &value) # <<<<<<<<<<<<<<
4407 * if value is NULL:
4408 * # context variable does not have a default
4409 */
4410 __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 118, __pyx_L1_error)
4411
4412 /* "cpython/contextvars.pxd":119
4413 * cdef PyObject *value = NULL
4414 * PyContextVar_Get(var, NULL, &value)
4415 * if value is NULL: # <<<<<<<<<<<<<<
4416 * # context variable does not have a default
4417 * pyvalue = default_value
4418 */
4419 __pyx_t_2 = (__pyx_v_value == NULL);
4420 if (__pyx_t_2) {
4421
4422 /* "cpython/contextvars.pxd":121
4423 * if value is NULL:
4424 * # context variable does not have a default
4425 * pyvalue = default_value # <<<<<<<<<<<<<<
4426 * else:
4427 * # value or default value of context variable
4428 */
4429 __Pyx_INCREF(__pyx_v_default_value);
4430 __pyx_v_pyvalue = __pyx_v_default_value;
4431
4432 /* "cpython/contextvars.pxd":119
4433 * cdef PyObject *value = NULL
4434 * PyContextVar_Get(var, NULL, &value)
4435 * if value is NULL: # <<<<<<<<<<<<<<
4436 * # context variable does not have a default
4437 * pyvalue = default_value
4438 */
4439 goto __pyx_L3;
4440 }
4441
4442 /* "cpython/contextvars.pxd":124
4443 * else:
4444 * # value or default value of context variable
4445 * pyvalue = <object>value # <<<<<<<<<<<<<<
4446 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*'
4447 * return pyvalue
4448 */
4449 /*else*/ {
4450 __pyx_t_3 = ((PyObject *)__pyx_v_value);
4451 __Pyx_INCREF(__pyx_t_3);
4452 __pyx_v_pyvalue = __pyx_t_3;
4453 __pyx_t_3 = 0;
4454
4455 /* "cpython/contextvars.pxd":125
4456 * # value or default value of context variable
4457 * pyvalue = <object>value
4458 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<<
4459 * return pyvalue
4460 *
4461 */
4462 Py_XDECREF(__pyx_v_value);
4463 }
4464 __pyx_L3:;
4465
4466 /* "cpython/contextvars.pxd":126
4467 * pyvalue = <object>value
4468 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*'
4469 * return pyvalue # <<<<<<<<<<<<<<
4470 *
4471 *
4472 */
4473 __Pyx_XDECREF(__pyx_r);
4474 __Pyx_INCREF(__pyx_v_pyvalue);
4475 __pyx_r = __pyx_v_pyvalue;
4476 goto __pyx_L0;
4477
4478 /* "cpython/contextvars.pxd":112
4479 *
4480 *
4481 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<<
4482 * """Return a new reference to the value of the context variable,
4483 * or the default value of the context variable,
4484 */
4485
4486 /* function exit code */
4487 __pyx_L1_error:;
4488 __Pyx_XDECREF(__pyx_t_3);
4489 __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
4490 __pyx_r = 0;
4491 __pyx_L0:;
4492 __Pyx_XDECREF(__pyx_v_pyvalue);
4493 __Pyx_XGIVEREF(__pyx_r);
4494 __Pyx_RefNannyFinishContext();
4495 return __pyx_r;
4496 }
4497
4498 /* "cpython/contextvars.pxd":129
4499 *
4500 *
4501 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<<
4502 * """Return a new reference to the value of the context variable,
4503 * or the provided default value if no such value was found.
4504 */
4505
4506 static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) {
4507 PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
4508 PyObject *__pyx_v_value;
4509 PyObject *__pyx_v_pyvalue = NULL;
4510 PyObject *__pyx_r = NULL;
4511 __Pyx_RefNannyDeclarations
4512 int __pyx_t_1;
4513 PyObject *__pyx_t_2 = NULL;
4514 int __pyx_lineno = 0;
4515 const char *__pyx_filename = NULL;
4516 int __pyx_clineno = 0;
4517 __Pyx_RefNannySetupContext("get_value_no_default", 1);
4518 if (__pyx_optional_args) {
4519 if (__pyx_optional_args->__pyx_n > 0) {
4520 __pyx_v_default_value = __pyx_optional_args->default_value;
4521 }
4522 }
4523
4524 /* "cpython/contextvars.pxd":135
4525 * Ignores the default value of the context variable, if any.
4526 * """
4527 * cdef PyObject *value = NULL # <<<<<<<<<<<<<<
4528 * PyContextVar_Get(var, <PyObject*>default_value, &value)
4529 * # value of context variable or 'default_value'
4530 */
4531 __pyx_v_value = NULL;
4532
4533 /* "cpython/contextvars.pxd":136
4534 * """
4535 * cdef PyObject *value = NULL
4536 * PyContextVar_Get(var, <PyObject*>default_value, &value) # <<<<<<<<<<<<<<
4537 * # value of context variable or 'default_value'
4538 * pyvalue = <object>value
4539 */
4540 __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 136, __pyx_L1_error)
4541
4542 /* "cpython/contextvars.pxd":138
4543 * PyContextVar_Get(var, <PyObject*>default_value, &value)
4544 * # value of context variable or 'default_value'
4545 * pyvalue = <object>value # <<<<<<<<<<<<<<
4546 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*'
4547 * return pyvalue
4548 */
4549 __pyx_t_2 = ((PyObject *)__pyx_v_value);
4550 __Pyx_INCREF(__pyx_t_2);
4551 __pyx_v_pyvalue = __pyx_t_2;
4552 __pyx_t_2 = 0;
4553
4554 /* "cpython/contextvars.pxd":139
4555 * # value of context variable or 'default_value'
4556 * pyvalue = <object>value
4557 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<<
4558 * return pyvalue
4559 */
4560 Py_XDECREF(__pyx_v_value);
4561
4562 /* "cpython/contextvars.pxd":140
4563 * pyvalue = <object>value
4564 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*'
4565 * return pyvalue # <<<<<<<<<<<<<<
4566 */
4567 __Pyx_XDECREF(__pyx_r);
4568 __Pyx_INCREF(__pyx_v_pyvalue);
4569 __pyx_r = __pyx_v_pyvalue;
4570 goto __pyx_L0;
4571
4572 /* "cpython/contextvars.pxd":129
4573 *
4574 *
4575 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<<
4576 * """Return a new reference to the value of the context variable,
4577 * or the provided default value if no such value was found.
4578 */
4579
4580 /* function exit code */
4581 __pyx_L1_error:;
4582 __Pyx_XDECREF(__pyx_t_2);
4583 __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
4584 __pyx_r = 0;
4585 __pyx_L0:;
4586 __Pyx_XDECREF(__pyx_v_pyvalue);
4587 __Pyx_XGIVEREF(__pyx_r);
4588 __Pyx_RefNannyFinishContext();
4589 return __pyx_r;
4590 }
4591
4592 /* "array.pxd":104
4593 * __data_union data
4594 *
4595 * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
4596 * # This implementation of getbuffer is geared towards Cython
4597 * # requirements, and does not yet fulfill the PEP.
4598 */
4599
4600 /* Python wrapper */
4601 CYTHON_UNUSED static int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
4602 CYTHON_UNUSED static int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
4603 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
4604 int __pyx_r;
4605 __Pyx_RefNannyDeclarations
4606 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
4607 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
4608 __pyx_r = __pyx_pf_7cpython_5array_5array___getbuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
4609
4610 /* function exit code */
4611 __Pyx_RefNannyFinishContext();
4612 return __pyx_r;
4613 }
4614
4615 static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags) {
4616 PyObject *__pyx_v_item_count = NULL;
4617 int __pyx_r;
4618 __Pyx_RefNannyDeclarations
4619 PyObject *__pyx_t_1 = NULL;
4620 char *__pyx_t_2;
4621 int __pyx_t_3;
4622 PyObject *__pyx_t_4 = NULL;
4623 Py_ssize_t __pyx_t_5;
4624 int __pyx_t_6;
4625 char __pyx_t_7;
4626 int __pyx_lineno = 0;
4627 const char *__pyx_filename = NULL;
4628 int __pyx_clineno = 0;
4629 if (unlikely(__pyx_v_info == NULL)) {
4630 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
4631 return -1;
4632 }
4633 __Pyx_RefNannySetupContext("__getbuffer__", 0);
4634 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
4635 __Pyx_GIVEREF(__pyx_v_info->obj);
4636
4637 /* "array.pxd":109
4638 * # In particular strided access is always provided regardless
4639 * # of flags
4640 * item_count = Py_SIZE(self) # <<<<<<<<<<<<<<
4641 *
4642 * info.suboffsets = NULL
4643 */
4644 __pyx_t_1 = PyInt_FromSsize_t(Py_SIZE(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 109, __pyx_L1_error)
4645 __Pyx_GOTREF(__pyx_t_1);
4646 __pyx_v_item_count = __pyx_t_1;
4647 __pyx_t_1 = 0;
4648
4649 /* "array.pxd":111
4650 * item_count = Py_SIZE(self)
4651 *
4652 * info.suboffsets = NULL # <<<<<<<<<<<<<<
4653 * info.buf = self.data.as_chars
4654 * info.readonly = 0
4655 */
4656 __pyx_v_info->suboffsets = NULL;
4657
4658 /* "array.pxd":112
4659 *
4660 * info.suboffsets = NULL
4661 * info.buf = self.data.as_chars # <<<<<<<<<<<<<<
4662 * info.readonly = 0
4663 * info.ndim = 1
4664 */
4665 __pyx_t_2 = __pyx_v_self->data.as_chars;
4666 __pyx_v_info->buf = __pyx_t_2;
4667
4668 /* "array.pxd":113
4669 * info.suboffsets = NULL
4670 * info.buf = self.data.as_chars
4671 * info.readonly = 0 # <<<<<<<<<<<<<<
4672 * info.ndim = 1
4673 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
4674 */
4675 __pyx_v_info->readonly = 0;
4676
4677 /* "array.pxd":114
4678 * info.buf = self.data.as_chars
4679 * info.readonly = 0
4680 * info.ndim = 1 # <<<<<<<<<<<<<<
4681 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
4682 * info.len = info.itemsize * item_count
4683 */
4684 __pyx_v_info->ndim = 1;
4685
4686 /* "array.pxd":115
4687 * info.readonly = 0
4688 * info.ndim = 1
4689 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) # <<<<<<<<<<<<<<
4690 * info.len = info.itemsize * item_count
4691 *
4692 */
4693 __pyx_t_3 = __pyx_v_self->ob_descr->itemsize;
4694 __pyx_v_info->itemsize = __pyx_t_3;
4695
4696 /* "array.pxd":116
4697 * info.ndim = 1
4698 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
4699 * info.len = info.itemsize * item_count # <<<<<<<<<<<<<<
4700 *
4701 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
4702 */
4703 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_info->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 116, __pyx_L1_error)
4704 __Pyx_GOTREF(__pyx_t_1);
4705 __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_item_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 116, __pyx_L1_error)
4706 __Pyx_GOTREF(__pyx_t_4);
4707 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4708 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 116, __pyx_L1_error)
4709 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4710 __pyx_v_info->len = __pyx_t_5;
4711
4712 /* "array.pxd":118
4713 * info.len = info.itemsize * item_count
4714 *
4715 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) # <<<<<<<<<<<<<<
4716 * if not info.shape:
4717 * raise MemoryError()
4718 */
4719 __pyx_v_info->shape = ((Py_ssize_t *)PyObject_Malloc(((sizeof(Py_ssize_t)) + 2)));
4720
4721 /* "array.pxd":119
4722 *
4723 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
4724 * if not info.shape: # <<<<<<<<<<<<<<
4725 * raise MemoryError()
4726 * info.shape[0] = item_count # constant regardless of resizing
4727 */
4728 __pyx_t_6 = (!(__pyx_v_info->shape != 0));
4729 if (unlikely(__pyx_t_6)) {
4730
4731 /* "array.pxd":120
4732 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
4733 * if not info.shape:
4734 * raise MemoryError() # <<<<<<<<<<<<<<
4735 * info.shape[0] = item_count # constant regardless of resizing
4736 * info.strides = &info.itemsize
4737 */
4738 PyErr_NoMemory(); __PYX_ERR(2, 120, __pyx_L1_error)
4739
4740 /* "array.pxd":119
4741 *
4742 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
4743 * if not info.shape: # <<<<<<<<<<<<<<
4744 * raise MemoryError()
4745 * info.shape[0] = item_count # constant regardless of resizing
4746 */
4747 }
4748
4749 /* "array.pxd":121
4750 * if not info.shape:
4751 * raise MemoryError()
4752 * info.shape[0] = item_count # constant regardless of resizing # <<<<<<<<<<<<<<
4753 * info.strides = &info.itemsize
4754 *
4755 */
4756 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_item_count); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L1_error)
4757 (__pyx_v_info->shape[0]) = __pyx_t_5;
4758
4759 /* "array.pxd":122
4760 * raise MemoryError()
4761 * info.shape[0] = item_count # constant regardless of resizing
4762 * info.strides = &info.itemsize # <<<<<<<<<<<<<<
4763 *
4764 * info.format = <char*> (info.shape + 1)
4765 */
4766 __pyx_v_info->strides = (&__pyx_v_info->itemsize);
4767
4768 /* "array.pxd":124
4769 * info.strides = &info.itemsize
4770 *
4771 * info.format = <char*> (info.shape + 1) # <<<<<<<<<<<<<<
4772 * info.format[0] = self.ob_descr.typecode
4773 * info.format[1] = 0
4774 */
4775 __pyx_v_info->format = ((char *)(__pyx_v_info->shape + 1));
4776
4777 /* "array.pxd":125
4778 *
4779 * info.format = <char*> (info.shape + 1)
4780 * info.format[0] = self.ob_descr.typecode # <<<<<<<<<<<<<<
4781 * info.format[1] = 0
4782 * info.obj = self
4783 */
4784 __pyx_t_7 = __pyx_v_self->ob_descr->typecode;
4785 (__pyx_v_info->format[0]) = __pyx_t_7;
4786
4787 /* "array.pxd":126
4788 * info.format = <char*> (info.shape + 1)
4789 * info.format[0] = self.ob_descr.typecode
4790 * info.format[1] = 0 # <<<<<<<<<<<<<<
4791 * info.obj = self
4792 *
4793 */
4794 (__pyx_v_info->format[1]) = 0;
4795
4796 /* "array.pxd":127
4797 * info.format[0] = self.ob_descr.typecode
4798 * info.format[1] = 0
4799 * info.obj = self # <<<<<<<<<<<<<<
4800 *
4801 * def __releasebuffer__(self, Py_buffer* info):
4802 */
4803 __Pyx_INCREF((PyObject *)__pyx_v_self);
4804 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
4805 __Pyx_GOTREF(__pyx_v_info->obj);
4806 __Pyx_DECREF(__pyx_v_info->obj);
4807 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
4808
4809 /* "array.pxd":104
4810 * __data_union data
4811 *
4812 * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
4813 * # This implementation of getbuffer is geared towards Cython
4814 * # requirements, and does not yet fulfill the PEP.
4815 */
4816
4817 /* function exit code */
4818 __pyx_r = 0;
4819 goto __pyx_L0;
4820 __pyx_L1_error:;
4821 __Pyx_XDECREF(__pyx_t_1);
4822 __Pyx_XDECREF(__pyx_t_4);
4823 __Pyx_AddTraceback("cpython.array.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4824 __pyx_r = -1;
4825 if (__pyx_v_info->obj != NULL) {
4826 __Pyx_GOTREF(__pyx_v_info->obj);
4827 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
4828 }
4829 goto __pyx_L2;
4830 __pyx_L0:;
4831 if (__pyx_v_info->obj == Py_None) {
4832 __Pyx_GOTREF(__pyx_v_info->obj);
4833 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
4834 }
4835 __pyx_L2:;
4836 __Pyx_XDECREF(__pyx_v_item_count);
4837 __Pyx_RefNannyFinishContext();
4838 return __pyx_r;
4839 }
4840
4841 /* "array.pxd":129
4842 * info.obj = self
4843 *
4844 * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<<
4845 * PyObject_Free(info.shape)
4846 *
4847 */
4848
4849 /* Python wrapper */
4850 CYTHON_UNUSED static void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
4851 CYTHON_UNUSED static void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
4852 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
4853 __Pyx_RefNannyDeclarations
4854 __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
4855 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
4856 __pyx_pf_7cpython_5array_5array_2__releasebuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
4857
4858 /* function exit code */
4859 __Pyx_RefNannyFinishContext();
4860 }
4861
4862 static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info) {
4863
4864 /* "array.pxd":130
4865 *
4866 * def __releasebuffer__(self, Py_buffer* info):
4867 * PyObject_Free(info.shape) # <<<<<<<<<<<<<<
4868 *
4869 * array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr)
4870 */
4871 PyObject_Free(__pyx_v_info->shape);
4872
4873 /* "array.pxd":129
4874 * info.obj = self
4875 *
4876 * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<<
4877 * PyObject_Free(info.shape)
4878 *
4879 */
4880
4881 /* function exit code */
4882 }
4883
4884 /* "array.pxd":141
4885 *
4886 *
4887 * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<<
4888 * """ fast creation of a new array, given a template array.
4889 * type will be same as template.
4890 */
4891
4892 static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) {
4893 arrayobject *__pyx_v_op = 0;
4894 arrayobject *__pyx_r = NULL;
4895 __Pyx_RefNannyDeclarations
4896 PyObject *__pyx_t_1 = NULL;
4897 int __pyx_t_2;
4898 int __pyx_t_3;
4899 int __pyx_lineno = 0;
4900 const char *__pyx_filename = NULL;
4901 int __pyx_clineno = 0;
4902 __Pyx_RefNannySetupContext("clone", 1);
4903
4904 /* "array.pxd":145
4905 * type will be same as template.
4906 * if zero is true, new array will be initialized with zeroes."""
4907 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) # <<<<<<<<<<<<<<
4908 * if zero and op is not None:
4909 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
4910 */
4911 __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_template)), __pyx_v_length, __pyx_v_template->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 145, __pyx_L1_error)
4912 __Pyx_GOTREF(__pyx_t_1);
4913 __pyx_v_op = ((arrayobject *)__pyx_t_1);
4914 __pyx_t_1 = 0;
4915
4916 /* "array.pxd":146
4917 * if zero is true, new array will be initialized with zeroes."""
4918 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
4919 * if zero and op is not None: # <<<<<<<<<<<<<<
4920 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
4921 * return op
4922 */
4923 if (__pyx_v_zero) {
4924 } else {
4925 __pyx_t_2 = __pyx_v_zero;
4926 goto __pyx_L4_bool_binop_done;
4927 }
4928 __pyx_t_3 = (((PyObject *)__pyx_v_op) != Py_None);
4929 __pyx_t_2 = __pyx_t_3;
4930 __pyx_L4_bool_binop_done:;
4931 if (__pyx_t_2) {
4932
4933 /* "array.pxd":147
4934 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
4935 * if zero and op is not None:
4936 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) # <<<<<<<<<<<<<<
4937 * return op
4938 *
4939 */
4940 (void)(memset(__pyx_v_op->data.as_chars, 0, (__pyx_v_length * __pyx_v_op->ob_descr->itemsize)));
4941
4942 /* "array.pxd":146
4943 * if zero is true, new array will be initialized with zeroes."""
4944 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
4945 * if zero and op is not None: # <<<<<<<<<<<<<<
4946 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
4947 * return op
4948 */
4949 }
4950
4951 /* "array.pxd":148
4952 * if zero and op is not None:
4953 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
4954 * return op # <<<<<<<<<<<<<<
4955 *
4956 * cdef inline array copy(array self):
4957 */
4958 __Pyx_XDECREF((PyObject *)__pyx_r);
4959 __Pyx_INCREF((PyObject *)__pyx_v_op);
4960 __pyx_r = __pyx_v_op;
4961 goto __pyx_L0;
4962
4963 /* "array.pxd":141
4964 *
4965 *
4966 * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<<
4967 * """ fast creation of a new array, given a template array.
4968 * type will be same as template.
4969 */
4970
4971 /* function exit code */
4972 __pyx_L1_error:;
4973 __Pyx_XDECREF(__pyx_t_1);
4974 __Pyx_AddTraceback("cpython.array.clone", __pyx_clineno, __pyx_lineno, __pyx_filename);
4975 __pyx_r = 0;
4976 __pyx_L0:;
4977 __Pyx_XDECREF((PyObject *)__pyx_v_op);
4978 __Pyx_XGIVEREF((PyObject *)__pyx_r);
4979 __Pyx_RefNannyFinishContext();
4980 return __pyx_r;
4981 }
4982
4983 /* "array.pxd":150
4984 * return op
4985 *
4986 * cdef inline array copy(array self): # <<<<<<<<<<<<<<
4987 * """ make a copy of an array. """
4988 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
4989 */
4990
4991 static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) {
4992 arrayobject *__pyx_v_op = 0;
4993 arrayobject *__pyx_r = NULL;
4994 __Pyx_RefNannyDeclarations
4995 PyObject *__pyx_t_1 = NULL;
4996 int __pyx_lineno = 0;
4997 const char *__pyx_filename = NULL;
4998 int __pyx_clineno = 0;
4999 __Pyx_RefNannySetupContext("copy", 1);
5000
5001 /* "array.pxd":152
5002 * cdef inline array copy(array self):
5003 * """ make a copy of an array. """
5004 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) # <<<<<<<<<<<<<<
5005 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
5006 * return op
5007 */
5008 __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_self)), Py_SIZE(((PyObject *)__pyx_v_self)), __pyx_v_self->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 152, __pyx_L1_error)
5009 __Pyx_GOTREF(__pyx_t_1);
5010 __pyx_v_op = ((arrayobject *)__pyx_t_1);
5011 __pyx_t_1 = 0;
5012
5013 /* "array.pxd":153
5014 * """ make a copy of an array. """
5015 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
5016 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) # <<<<<<<<<<<<<<
5017 * return op
5018 *
5019 */
5020 (void)(memcpy(__pyx_v_op->data.as_chars, __pyx_v_self->data.as_chars, (Py_SIZE(((PyObject *)__pyx_v_op)) * __pyx_v_op->ob_descr->itemsize)));
5021
5022 /* "array.pxd":154
5023 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
5024 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
5025 * return op # <<<<<<<<<<<<<<
5026 *
5027 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1:
5028 */
5029 __Pyx_XDECREF((PyObject *)__pyx_r);
5030 __Pyx_INCREF((PyObject *)__pyx_v_op);
5031 __pyx_r = __pyx_v_op;
5032 goto __pyx_L0;
5033
5034 /* "array.pxd":150
5035 * return op
5036 *
5037 * cdef inline array copy(array self): # <<<<<<<<<<<<<<
5038 * """ make a copy of an array. """
5039 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
5040 */
5041
5042 /* function exit code */
5043 __pyx_L1_error:;
5044 __Pyx_XDECREF(__pyx_t_1);
5045 __Pyx_AddTraceback("cpython.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
5046 __pyx_r = 0;
5047 __pyx_L0:;
5048 __Pyx_XDECREF((PyObject *)__pyx_v_op);
5049 __Pyx_XGIVEREF((PyObject *)__pyx_r);
5050 __Pyx_RefNannyFinishContext();
5051 return __pyx_r;
5052 }
5053
5054 /* "array.pxd":156
5055 * return op
5056 *
5057 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<<
5058 * """ efficient appending of new stuff of same type
5059 * (e.g. of same array type)
5060 */
5061
5062 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) {
5063 Py_ssize_t __pyx_v_itemsize;
5064 Py_ssize_t __pyx_v_origsize;
5065 int __pyx_r;
5066 int __pyx_t_1;
5067 int __pyx_lineno = 0;
5068 const char *__pyx_filename = NULL;
5069 int __pyx_clineno = 0;
5070
5071 /* "array.pxd":160
5072 * (e.g. of same array type)
5073 * n: number of elements (not number of bytes!) """
5074 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize # <<<<<<<<<<<<<<
5075 * cdef Py_ssize_t origsize = Py_SIZE(self)
5076 * resize_smart(self, origsize + n)
5077 */
5078 __pyx_t_1 = __pyx_v_self->ob_descr->itemsize;
5079 __pyx_v_itemsize = __pyx_t_1;
5080
5081 /* "array.pxd":161
5082 * n: number of elements (not number of bytes!) """
5083 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize
5084 * cdef Py_ssize_t origsize = Py_SIZE(self) # <<<<<<<<<<<<<<
5085 * resize_smart(self, origsize + n)
5086 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
5087 */
5088 __pyx_v_origsize = Py_SIZE(((PyObject *)__pyx_v_self));
5089
5090 /* "array.pxd":162
5091 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize
5092 * cdef Py_ssize_t origsize = Py_SIZE(self)
5093 * resize_smart(self, origsize + n) # <<<<<<<<<<<<<<
5094 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
5095 * return 0
5096 */
5097 __pyx_t_1 = resize_smart(__pyx_v_self, (__pyx_v_origsize + __pyx_v_n)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 162, __pyx_L1_error)
5098
5099 /* "array.pxd":163
5100 * cdef Py_ssize_t origsize = Py_SIZE(self)
5101 * resize_smart(self, origsize + n)
5102 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) # <<<<<<<<<<<<<<
5103 * return 0
5104 *
5105 */
5106 (void)(memcpy((__pyx_v_self->data.as_chars + (__pyx_v_origsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize)));
5107
5108 /* "array.pxd":164
5109 * resize_smart(self, origsize + n)
5110 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
5111 * return 0 # <<<<<<<<<<<<<<
5112 *
5113 * cdef inline int extend(array self, array other) except -1:
5114 */
5115 __pyx_r = 0;
5116 goto __pyx_L0;
5117
5118 /* "array.pxd":156
5119 * return op
5120 *
5121 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<<
5122 * """ efficient appending of new stuff of same type
5123 * (e.g. of same array type)
5124 */
5125
5126 /* function exit code */
5127 __pyx_L1_error:;
5128 __Pyx_AddTraceback("cpython.array.extend_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
5129 __pyx_r = -1;
5130 __pyx_L0:;
5131 return __pyx_r;
5132 }
5133
5134 /* "array.pxd":166
5135 * return 0
5136 *
5137 * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<<
5138 * """ extend array with data from another array; types must match. """
5139 * if self.ob_descr.typecode != other.ob_descr.typecode:
5140 */
5141
5142 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) {
5143 int __pyx_r;
5144 int __pyx_t_1;
5145 int __pyx_t_2;
5146 int __pyx_lineno = 0;
5147 const char *__pyx_filename = NULL;
5148 int __pyx_clineno = 0;
5149
5150 /* "array.pxd":168
5151 * cdef inline int extend(array self, array other) except -1:
5152 * """ extend array with data from another array; types must match. """
5153 * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<<
5154 * PyErr_BadArgument()
5155 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
5156 */
5157 __pyx_t_1 = (__pyx_v_self->ob_descr->typecode != __pyx_v_other->ob_descr->typecode);
5158 if (__pyx_t_1) {
5159
5160 /* "array.pxd":169
5161 * """ extend array with data from another array; types must match. """
5162 * if self.ob_descr.typecode != other.ob_descr.typecode:
5163 * PyErr_BadArgument() # <<<<<<<<<<<<<<
5164 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
5165 *
5166 */
5167 __pyx_t_2 = PyErr_BadArgument(); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 169, __pyx_L1_error)
5168
5169 /* "array.pxd":168
5170 * cdef inline int extend(array self, array other) except -1:
5171 * """ extend array with data from another array; types must match. """
5172 * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<<
5173 * PyErr_BadArgument()
5174 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
5175 */
5176 }
5177
5178 /* "array.pxd":170
5179 * if self.ob_descr.typecode != other.ob_descr.typecode:
5180 * PyErr_BadArgument()
5181 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) # <<<<<<<<<<<<<<
5182 *
5183 * cdef inline void zero(array self) noexcept:
5184 */
5185 __pyx_t_2 = __pyx_f_7cpython_5array_extend_buffer(__pyx_v_self, __pyx_v_other->data.as_chars, Py_SIZE(((PyObject *)__pyx_v_other))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 170, __pyx_L1_error)
5186 __pyx_r = __pyx_t_2;
5187 goto __pyx_L0;
5188
5189 /* "array.pxd":166
5190 * return 0
5191 *
5192 * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<<
5193 * """ extend array with data from another array; types must match. """
5194 * if self.ob_descr.typecode != other.ob_descr.typecode:
5195 */
5196
5197 /* function exit code */
5198 __pyx_L1_error:;
5199 __Pyx_AddTraceback("cpython.array.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
5200 __pyx_r = -1;
5201 __pyx_L0:;
5202 return __pyx_r;
5203 }
5204
5205 /* "array.pxd":172
5206 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
5207 *
5208 * cdef inline void zero(array self) noexcept: # <<<<<<<<<<<<<<
5209 * """ set all elements of array to zero. """
5210 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
5211 */
5212
5213 static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) {
5214
5215 /* "array.pxd":174
5216 * cdef inline void zero(array self) noexcept:
5217 * """ set all elements of array to zero. """
5218 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) # <<<<<<<<<<<<<<
5219 */
5220 (void)(memset(__pyx_v_self->data.as_chars, 0, (Py_SIZE(((PyObject *)__pyx_v_self)) * __pyx_v_self->ob_descr->itemsize)));
5221
5222 /* "array.pxd":172
5223 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
5224 *
5225 * cdef inline void zero(array self) noexcept: # <<<<<<<<<<<<<<
5226 * """ set all elements of array to zero. """
5227 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
5228 */
5229
5230 /* function exit code */
5231 }
5232
5233 /* "(tree fragment)":1
5234 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5235 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
5236 * def __setstate_cython__(self, __pyx_state):
5237 */
5238
5239 /* Python wrapper */
5240 static PyObject *__pyx_pw_5pysam_11libcsamfile_7Samfile_1__reduce_cython__(PyObject *__pyx_v_self,
5241 #if CYTHON_METH_FASTCALL
5242 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5243 #else
5244 PyObject *__pyx_args, PyObject *__pyx_kwds
5245 #endif
5246 ); /*proto*/
5247 PyDoc_STRVAR(__pyx_doc_5pysam_11libcsamfile_7Samfile___reduce_cython__, "Samfile.__reduce_cython__(self)");
5248 static PyMethodDef __pyx_mdef_5pysam_11libcsamfile_7Samfile_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_11libcsamfile_7Samfile_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_11libcsamfile_7Samfile___reduce_cython__};
5249 static PyObject *__pyx_pw_5pysam_11libcsamfile_7Samfile_1__reduce_cython__(PyObject *__pyx_v_self,
5250 #if CYTHON_METH_FASTCALL
5251 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5252 #else
5253 PyObject *__pyx_args, PyObject *__pyx_kwds
5254 #endif
5255 ) {
5256 #if !CYTHON_METH_FASTCALL
5257 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
5258 #endif
5259 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5260 PyObject *__pyx_r = 0;
5261 __Pyx_RefNannyDeclarations
5262 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5263 #if !CYTHON_METH_FASTCALL
5264 #if CYTHON_ASSUME_SAFE_MACROS
5265 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
5266 #else
5267 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
5268 #endif
5269 #endif
5270 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
5271 if (unlikely(__pyx_nargs > 0)) {
5272 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
5273 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
5274 __pyx_r = __pyx_pf_5pysam_11libcsamfile_7Samfile___reduce_cython__(((struct __pyx_obj_5pysam_11libcsamfile_Samfile *)__pyx_v_self));
5275
5276 /* function exit code */
5277 __Pyx_RefNannyFinishContext();
5278 return __pyx_r;
5279 }
5280
5281 static PyObject *__pyx_pf_5pysam_11libcsamfile_7Samfile___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_11libcsamfile_Samfile *__pyx_v_self) {
5282 PyObject *__pyx_r = NULL;
5283 __Pyx_TraceDeclarations
5284 __Pyx_RefNannyDeclarations
5285 int __pyx_lineno = 0;
5286 const char *__pyx_filename = NULL;
5287 int __pyx_clineno = 0;
5288 __Pyx_TraceFrameInit(__pyx_codeobj_)
5289 __Pyx_RefNannySetupContext("__reduce_cython__", 1);
5290 __Pyx_TraceCall("__reduce_cython__", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
5291
5292 /* "(tree fragment)":2
5293 * def __reduce_cython__(self):
5294 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<<
5295 * def __setstate_cython__(self, __pyx_state):
5296 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
5297 */
5298 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_b_self_htsfile_self_index_c, 0, 0);
5299 __PYX_ERR(0, 2, __pyx_L1_error)
5300
5301 /* "(tree fragment)":1
5302 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5303 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
5304 * def __setstate_cython__(self, __pyx_state):
5305 */
5306
5307 /* function exit code */
5308 __pyx_L1_error:;
5309 __Pyx_AddTraceback("pysam.libcsamfile.Samfile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5310 __pyx_r = NULL;
5311 __Pyx_XGIVEREF(__pyx_r);
5312 __Pyx_TraceReturn(__pyx_r, 0);
5313 __Pyx_RefNannyFinishContext();
5314 return __pyx_r;
5315 }
5316
5317 /* "(tree fragment)":3
5318 * def __reduce_cython__(self):
5319 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
5320 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5321 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
5322 */
5323
5324 /* Python wrapper */
5325 static PyObject *__pyx_pw_5pysam_11libcsamfile_7Samfile_3__setstate_cython__(PyObject *__pyx_v_self,
5326 #if CYTHON_METH_FASTCALL
5327 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5328 #else
5329 PyObject *__pyx_args, PyObject *__pyx_kwds
5330 #endif
5331 ); /*proto*/
5332 PyDoc_STRVAR(__pyx_doc_5pysam_11libcsamfile_7Samfile_2__setstate_cython__, "Samfile.__setstate_cython__(self, __pyx_state)");
5333 static PyMethodDef __pyx_mdef_5pysam_11libcsamfile_7Samfile_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_11libcsamfile_7Samfile_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_11libcsamfile_7Samfile_2__setstate_cython__};
5334 static PyObject *__pyx_pw_5pysam_11libcsamfile_7Samfile_3__setstate_cython__(PyObject *__pyx_v_self,
5335 #if CYTHON_METH_FASTCALL
5336 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5337 #else
5338 PyObject *__pyx_args, PyObject *__pyx_kwds
5339 #endif
5340 ) {
5341 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
5342 #if !CYTHON_METH_FASTCALL
5343 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
5344 #endif
5345 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5346 PyObject* values[1] = {0};
5347 int __pyx_lineno = 0;
5348 const char *__pyx_filename = NULL;
5349 int __pyx_clineno = 0;
5350 PyObject *__pyx_r = 0;
5351 __Pyx_RefNannyDeclarations
5352 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5353 #if !CYTHON_METH_FASTCALL
5354 #if CYTHON_ASSUME_SAFE_MACROS
5355 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
5356 #else
5357 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
5358 #endif
5359 #endif
5360 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
5361 {
5362 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
5363 if (__pyx_kwds) {
5364 Py_ssize_t kw_args;
5365 switch (__pyx_nargs) {
5366 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
5367 CYTHON_FALLTHROUGH;
5368 case 0: break;
5369 default: goto __pyx_L5_argtuple_error;
5370 }
5371 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
5372 switch (__pyx_nargs) {
5373 case 0:
5374 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
5375 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
5376 kw_args--;
5377 }
5378 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error)
5379 else goto __pyx_L5_argtuple_error;
5380 }
5381 if (unlikely(kw_args > 0)) {
5382 const Py_ssize_t kwd_pos_args = __pyx_nargs;
5383 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)
5384 }
5385 } else if (unlikely(__pyx_nargs != 1)) {
5386 goto __pyx_L5_argtuple_error;
5387 } else {
5388 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
5389 }
5390 __pyx_v___pyx_state = values[0];
5391 }
5392 goto __pyx_L6_skip;
5393 __pyx_L5_argtuple_error:;
5394 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error)
5395 __pyx_L6_skip:;
5396 goto __pyx_L4_argument_unpacking_done;
5397 __pyx_L3_error:;
5398 {
5399 Py_ssize_t __pyx_temp;
5400 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
5401 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
5402 }
5403 }
5404 __Pyx_AddTraceback("pysam.libcsamfile.Samfile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5405 __Pyx_RefNannyFinishContext();
5406 return NULL;
5407 __pyx_L4_argument_unpacking_done:;
5408 __pyx_r = __pyx_pf_5pysam_11libcsamfile_7Samfile_2__setstate_cython__(((struct __pyx_obj_5pysam_11libcsamfile_Samfile *)__pyx_v_self), __pyx_v___pyx_state);
5409
5410 /* function exit code */
5411 {
5412 Py_ssize_t __pyx_temp;
5413 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
5414 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
5415 }
5416 }
5417 __Pyx_RefNannyFinishContext();
5418 return __pyx_r;
5419 }
5420
5421 static PyObject *__pyx_pf_5pysam_11libcsamfile_7Samfile_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_11libcsamfile_Samfile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5422 PyObject *__pyx_r = NULL;
5423 __Pyx_TraceDeclarations
5424 __Pyx_RefNannyDeclarations
5425 int __pyx_lineno = 0;
5426 const char *__pyx_filename = NULL;
5427 int __pyx_clineno = 0;
5428 __Pyx_TraceFrameInit(__pyx_codeobj__2)
5429 __Pyx_RefNannySetupContext("__setstate_cython__", 1);
5430 __Pyx_TraceCall("__setstate_cython__", __pyx_f[0], 3, 0, __PYX_ERR(0, 3, __pyx_L1_error));
5431
5432 /* "(tree fragment)":4
5433 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
5434 * def __setstate_cython__(self, __pyx_state):
5435 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<<
5436 */
5437 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_b_self_htsfile_self_index_c, 0, 0);
5438 __PYX_ERR(0, 4, __pyx_L1_error)
5439
5440 /* "(tree fragment)":3
5441 * def __reduce_cython__(self):
5442 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
5443 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5444 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
5445 */
5446
5447 /* function exit code */
5448 __pyx_L1_error:;
5449 __Pyx_AddTraceback("pysam.libcsamfile.Samfile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5450 __pyx_r = NULL;
5451 __Pyx_XGIVEREF(__pyx_r);
5452 __Pyx_TraceReturn(__pyx_r, 0);
5453 __Pyx_RefNannyFinishContext();
5454 return __pyx_r;
5455 }
5456
5457 /* "(tree fragment)":1
5458 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5459 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
5460 * def __setstate_cython__(self, __pyx_state):
5461 */
5462
5463 /* Python wrapper */
5464 static PyObject *__pyx_pw_5pysam_11libcsamfile_11AlignedRead_1__reduce_cython__(PyObject *__pyx_v_self,
5465 #if CYTHON_METH_FASTCALL
5466 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5467 #else
5468 PyObject *__pyx_args, PyObject *__pyx_kwds
5469 #endif
5470 ); /*proto*/
5471 PyDoc_STRVAR(__pyx_doc_5pysam_11libcsamfile_11AlignedRead___reduce_cython__, "AlignedRead.__reduce_cython__(self)");
5472 static PyMethodDef __pyx_mdef_5pysam_11libcsamfile_11AlignedRead_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_11libcsamfile_11AlignedRead_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_11libcsamfile_11AlignedRead___reduce_cython__};
5473 static PyObject *__pyx_pw_5pysam_11libcsamfile_11AlignedRead_1__reduce_cython__(PyObject *__pyx_v_self,
5474 #if CYTHON_METH_FASTCALL
5475 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5476 #else
5477 PyObject *__pyx_args, PyObject *__pyx_kwds
5478 #endif
5479 ) {
5480 #if !CYTHON_METH_FASTCALL
5481 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
5482 #endif
5483 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5484 PyObject *__pyx_r = 0;
5485 __Pyx_RefNannyDeclarations
5486 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5487 #if !CYTHON_METH_FASTCALL
5488 #if CYTHON_ASSUME_SAFE_MACROS
5489 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
5490 #else
5491 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
5492 #endif
5493 #endif
5494 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
5495 if (unlikely(__pyx_nargs > 0)) {
5496 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
5497 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
5498 __pyx_r = __pyx_pf_5pysam_11libcsamfile_11AlignedRead___reduce_cython__(((struct __pyx_obj_5pysam_11libcsamfile_AlignedRead *)__pyx_v_self));
5499
5500 /* function exit code */
5501 __Pyx_RefNannyFinishContext();
5502 return __pyx_r;
5503 }
5504
5505 static PyObject *__pyx_pf_5pysam_11libcsamfile_11AlignedRead___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_11libcsamfile_AlignedRead *__pyx_v_self) {
5506 PyObject *__pyx_r = NULL;
5507 __Pyx_TraceDeclarations
5508 __Pyx_RefNannyDeclarations
5509 int __pyx_lineno = 0;
5510 const char *__pyx_filename = NULL;
5511 int __pyx_clineno = 0;
5512 __Pyx_TraceFrameInit(__pyx_codeobj__3)
5513 __Pyx_RefNannySetupContext("__reduce_cython__", 1);
5514 __Pyx_TraceCall("__reduce_cython__", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
5515
5516 /* "(tree fragment)":2
5517 * def __reduce_cython__(self):
5518 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<<
5519 * def __setstate_cython__(self, __pyx_state):
5520 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
5521 */
5522 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__delegate_cannot_be_convert, 0, 0);
5523 __PYX_ERR(0, 2, __pyx_L1_error)
5524
5525 /* "(tree fragment)":1
5526 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5527 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
5528 * def __setstate_cython__(self, __pyx_state):
5529 */
5530
5531 /* function exit code */
5532 __pyx_L1_error:;
5533 __Pyx_AddTraceback("pysam.libcsamfile.AlignedRead.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5534 __pyx_r = NULL;
5535 __Pyx_XGIVEREF(__pyx_r);
5536 __Pyx_TraceReturn(__pyx_r, 0);
5537 __Pyx_RefNannyFinishContext();
5538 return __pyx_r;
5539 }
5540
5541 /* "(tree fragment)":3
5542 * def __reduce_cython__(self):
5543 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
5544 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5545 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
5546 */
5547
5548 /* Python wrapper */
5549 static PyObject *__pyx_pw_5pysam_11libcsamfile_11AlignedRead_3__setstate_cython__(PyObject *__pyx_v_self,
5550 #if CYTHON_METH_FASTCALL
5551 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5552 #else
5553 PyObject *__pyx_args, PyObject *__pyx_kwds
5554 #endif
5555 ); /*proto*/
5556 PyDoc_STRVAR(__pyx_doc_5pysam_11libcsamfile_11AlignedRead_2__setstate_cython__, "AlignedRead.__setstate_cython__(self, __pyx_state)");
5557 static PyMethodDef __pyx_mdef_5pysam_11libcsamfile_11AlignedRead_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_11libcsamfile_11AlignedRead_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_11libcsamfile_11AlignedRead_2__setstate_cython__};
5558 static PyObject *__pyx_pw_5pysam_11libcsamfile_11AlignedRead_3__setstate_cython__(PyObject *__pyx_v_self,
5559 #if CYTHON_METH_FASTCALL
5560 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
5561 #else
5562 PyObject *__pyx_args, PyObject *__pyx_kwds
5563 #endif
5564 ) {
5565 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
5566 #if !CYTHON_METH_FASTCALL
5567 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
5568 #endif
5569 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5570 PyObject* values[1] = {0};
5571 int __pyx_lineno = 0;
5572 const char *__pyx_filename = NULL;
5573 int __pyx_clineno = 0;
5574 PyObject *__pyx_r = 0;
5575 __Pyx_RefNannyDeclarations
5576 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5577 #if !CYTHON_METH_FASTCALL
5578 #if CYTHON_ASSUME_SAFE_MACROS
5579 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
5580 #else
5581 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
5582 #endif
5583 #endif
5584 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
5585 {
5586 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
5587 if (__pyx_kwds) {
5588 Py_ssize_t kw_args;
5589 switch (__pyx_nargs) {
5590 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
5591 CYTHON_FALLTHROUGH;
5592 case 0: break;
5593 default: goto __pyx_L5_argtuple_error;
5594 }
5595 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
5596 switch (__pyx_nargs) {
5597 case 0:
5598 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
5599 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
5600 kw_args--;
5601 }
5602 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error)
5603 else goto __pyx_L5_argtuple_error;
5604 }
5605 if (unlikely(kw_args > 0)) {
5606 const Py_ssize_t kwd_pos_args = __pyx_nargs;
5607 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)
5608 }
5609 } else if (unlikely(__pyx_nargs != 1)) {
5610 goto __pyx_L5_argtuple_error;
5611 } else {
5612 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
5613 }
5614 __pyx_v___pyx_state = values[0];
5615 }
5616 goto __pyx_L6_skip;
5617 __pyx_L5_argtuple_error:;
5618 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error)
5619 __pyx_L6_skip:;
5620 goto __pyx_L4_argument_unpacking_done;
5621 __pyx_L3_error:;
5622 {
5623 Py_ssize_t __pyx_temp;
5624 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
5625 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
5626 }
5627 }
5628 __Pyx_AddTraceback("pysam.libcsamfile.AlignedRead.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5629 __Pyx_RefNannyFinishContext();
5630 return NULL;
5631 __pyx_L4_argument_unpacking_done:;
5632 __pyx_r = __pyx_pf_5pysam_11libcsamfile_11AlignedRead_2__setstate_cython__(((struct __pyx_obj_5pysam_11libcsamfile_AlignedRead *)__pyx_v_self), __pyx_v___pyx_state);
5633
5634 /* function exit code */
5635 {
5636 Py_ssize_t __pyx_temp;
5637 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
5638 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
5639 }
5640 }
5641 __Pyx_RefNannyFinishContext();
5642 return __pyx_r;
5643 }
5644
5645 static PyObject *__pyx_pf_5pysam_11libcsamfile_11AlignedRead_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_11libcsamfile_AlignedRead *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5646 PyObject *__pyx_r = NULL;
5647 __Pyx_TraceDeclarations
5648 __Pyx_RefNannyDeclarations
5649 int __pyx_lineno = 0;
5650 const char *__pyx_filename = NULL;
5651 int __pyx_clineno = 0;
5652 __Pyx_TraceFrameInit(__pyx_codeobj__4)
5653 __Pyx_RefNannySetupContext("__setstate_cython__", 1);
5654 __Pyx_TraceCall("__setstate_cython__", __pyx_f[0], 3, 0, __PYX_ERR(0, 3, __pyx_L1_error));
5655
5656 /* "(tree fragment)":4
5657 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
5658 * def __setstate_cython__(self, __pyx_state):
5659 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<<
5660 */
5661 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__delegate_cannot_be_convert, 0, 0);
5662 __PYX_ERR(0, 4, __pyx_L1_error)
5663
5664 /* "(tree fragment)":3
5665 * def __reduce_cython__(self):
5666 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
5667 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5668 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
5669 */
5670
5671 /* function exit code */
5672 __pyx_L1_error:;
5673 __Pyx_AddTraceback("pysam.libcsamfile.AlignedRead.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5674 __pyx_r = NULL;
5675 __Pyx_XGIVEREF(__pyx_r);
5676 __Pyx_TraceReturn(__pyx_r, 0);
5677 __Pyx_RefNannyFinishContext();
5678 return __pyx_r;
5679 }
5680 static struct __pyx_vtabstruct_5pysam_11libcsamfile_AlignedRead __pyx_vtable_5pysam_11libcsamfile_AlignedRead;
5681
5682 static PyObject *__pyx_tp_new_5pysam_11libcsamfile_AlignedRead(PyTypeObject *t, PyObject *a, PyObject *k) {
5683 struct __pyx_obj_5pysam_11libcsamfile_AlignedRead *p;
5684 PyObject *o = __Pyx_PyType_GetSlot(__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment, tp_new, newfunc)(t, a, k);
5685 if (unlikely(!o)) return 0;
5686 p = ((struct __pyx_obj_5pysam_11libcsamfile_AlignedRead *)o);
5687 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_18libcalignedsegment_AlignedSegment*)__pyx_vtabptr_5pysam_11libcsamfile_AlignedRead;
5688 return o;
5689 }
5690
5691 static int __pyx_tp_traverse_5pysam_11libcsamfile_AlignedRead(PyObject *o, visitproc v, void *a) {
5692 int e;
5693 e = ((likely(__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment)) ? ((__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment->tp_traverse) ? __pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5pysam_11libcsamfile_AlignedRead)); if (e) return e;
5694 return 0;
5695 }
5696
5697 static int __pyx_tp_clear_5pysam_11libcsamfile_AlignedRead(PyObject *o) {
5698 if (likely(__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment)) { if (__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment->tp_clear) __pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5pysam_11libcsamfile_AlignedRead);
5699 return 0;
5700 }
5701
5702 static PyMethodDef __pyx_methods_5pysam_11libcsamfile_AlignedRead[] = {
5703 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_11libcsamfile_11AlignedRead_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_11libcsamfile_11AlignedRead___reduce_cython__},
5704 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_11libcsamfile_11AlignedRead_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_11libcsamfile_11AlignedRead_2__setstate_cython__},
5705 {0, 0, 0, 0}
5706 };
5707 #if CYTHON_USE_TYPE_SPECS
5708 static PyType_Slot __pyx_type_5pysam_11libcsamfile_AlignedRead_slots[] = {
5709 {Py_tp_doc, (void *)PyDoc_STR("Deprecated alternative for :class:`~pysam.AlignedSegment`\n\n Added for backwards compatibility with pysam <= 0.8.0\n ")},
5710 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_11libcsamfile_AlignedRead},
5711 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_11libcsamfile_AlignedRead},
5712 {Py_tp_methods, (void *)__pyx_methods_5pysam_11libcsamfile_AlignedRead},
5713 {Py_tp_new, (void *)__pyx_tp_new_5pysam_11libcsamfile_AlignedRead},
5714 {0, 0},
5715 };
5716 static PyType_Spec __pyx_type_5pysam_11libcsamfile_AlignedRead_spec = {
5717 "pysam.libcsamfile.AlignedRead",
5718 sizeof(struct __pyx_obj_5pysam_11libcsamfile_AlignedRead),
5719 0,
5720 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
5721 __pyx_type_5pysam_11libcsamfile_AlignedRead_slots,
5722 };
5723 #else
5724
5725 static PyTypeObject __pyx_type_5pysam_11libcsamfile_AlignedRead = {
5726 PyVarObject_HEAD_INIT(0, 0)
5727 "pysam.libcsamfile.""AlignedRead", /*tp_name*/
5728 sizeof(struct __pyx_obj_5pysam_11libcsamfile_AlignedRead), /*tp_basicsize*/
5729 0, /*tp_itemsize*/
5730 0, /*tp_dealloc*/
5731 #if PY_VERSION_HEX < 0x030800b4
5732 0, /*tp_print*/
5733 #endif
5734 #if PY_VERSION_HEX >= 0x030800b4
5735 0, /*tp_vectorcall_offset*/
5736 #endif
5737 0, /*tp_getattr*/
5738 0, /*tp_setattr*/
5739 #if PY_MAJOR_VERSION < 3
5740 0, /*tp_compare*/
5741 #endif
5742 #if PY_MAJOR_VERSION >= 3
5743 0, /*tp_as_async*/
5744 #endif
5745 0, /*tp_repr*/
5746 0, /*tp_as_number*/
5747 0, /*tp_as_sequence*/
5748 0, /*tp_as_mapping*/
5749 0, /*tp_hash*/
5750 0, /*tp_call*/
5751 0, /*tp_str*/
5752 0, /*tp_getattro*/
5753 0, /*tp_setattro*/
5754 0, /*tp_as_buffer*/
5755 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
5756 PyDoc_STR("Deprecated alternative for :class:`~pysam.AlignedSegment`\n\n Added for backwards compatibility with pysam <= 0.8.0\n "), /*tp_doc*/
5757 __pyx_tp_traverse_5pysam_11libcsamfile_AlignedRead, /*tp_traverse*/
5758 __pyx_tp_clear_5pysam_11libcsamfile_AlignedRead, /*tp_clear*/
5759 0, /*tp_richcompare*/
5760 0, /*tp_weaklistoffset*/
5761 0, /*tp_iter*/
5762 0, /*tp_iternext*/
5763 __pyx_methods_5pysam_11libcsamfile_AlignedRead, /*tp_methods*/
5764 0, /*tp_members*/
5765 0, /*tp_getset*/
5766 0, /*tp_base*/
5767 0, /*tp_dict*/
5768 0, /*tp_descr_get*/
5769 0, /*tp_descr_set*/
5770 #if !CYTHON_USE_TYPE_SPECS
5771 0, /*tp_dictoffset*/
5772 #endif
5773 0, /*tp_init*/
5774 0, /*tp_alloc*/
5775 __pyx_tp_new_5pysam_11libcsamfile_AlignedRead, /*tp_new*/
5776 0, /*tp_free*/
5777 0, /*tp_is_gc*/
5778 0, /*tp_bases*/
5779 0, /*tp_mro*/
5780 0, /*tp_cache*/
5781 0, /*tp_subclasses*/
5782 0, /*tp_weaklist*/
5783 0, /*tp_del*/
5784 0, /*tp_version_tag*/
5785 #if PY_VERSION_HEX >= 0x030400a1
5786 #if CYTHON_USE_TP_FINALIZE
5787 0, /*tp_finalize*/
5788 #else
5789 NULL, /*tp_finalize*/
5790 #endif
5791 #endif
5792 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
5793 0, /*tp_vectorcall*/
5794 #endif
5795 #if __PYX_NEED_TP_PRINT_SLOT == 1
5796 0, /*tp_print*/
5797 #endif
5798 #if PY_VERSION_HEX >= 0x030C0000
5799 0, /*tp_watched*/
5800 #endif
5801 #if PY_VERSION_HEX >= 0x030d00A4
5802 0, /*tp_versions_used*/
5803 #endif
5804 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
5805 0, /*tp_pypy_flags*/
5806 #endif
5807 };
5808 #endif
5809 static struct __pyx_vtabstruct_5pysam_11libcsamfile_Samfile __pyx_vtable_5pysam_11libcsamfile_Samfile;
5810
5811 static PyObject *__pyx_tp_new_5pysam_11libcsamfile_Samfile(PyTypeObject *t, PyObject *a, PyObject *k) {
5812 struct __pyx_obj_5pysam_11libcsamfile_Samfile *p;
5813 PyObject *o = __Pyx_PyType_GetSlot(__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile, tp_new, newfunc)(t, a, k);
5814 if (unlikely(!o)) return 0;
5815 p = ((struct __pyx_obj_5pysam_11libcsamfile_Samfile *)o);
5816 p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile*)__pyx_vtabptr_5pysam_11libcsamfile_Samfile;
5817 return o;
5818 }
5819
5820 static int __pyx_tp_traverse_5pysam_11libcsamfile_Samfile(PyObject *o, visitproc v, void *a) {
5821 int e;
5822 e = ((likely(__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile)) ? ((__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile->tp_traverse) ? __pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5pysam_11libcsamfile_Samfile)); if (e) return e;
5823 return 0;
5824 }
5825
5826 static int __pyx_tp_clear_5pysam_11libcsamfile_Samfile(PyObject *o) {
5827 if (likely(__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile)) { if (__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile->tp_clear) __pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5pysam_11libcsamfile_Samfile);
5828 return 0;
5829 }
5830
5831 static PyMethodDef __pyx_methods_5pysam_11libcsamfile_Samfile[] = {
5832 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_11libcsamfile_7Samfile_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_11libcsamfile_7Samfile___reduce_cython__},
5833 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_11libcsamfile_7Samfile_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_11libcsamfile_7Samfile_2__setstate_cython__},
5834 {0, 0, 0, 0}
5835 };
5836 #if CYTHON_USE_TYPE_SPECS
5837 static PyType_Slot __pyx_type_5pysam_11libcsamfile_Samfile_slots[] = {
5838 {Py_tp_doc, (void *)PyDoc_STR("Deprecated alternative for :class:`~pysam.AlignmentFile`\n\n Added for backwards compatibility with pysam <= 0.8.0\n ")},
5839 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_11libcsamfile_Samfile},
5840 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_11libcsamfile_Samfile},
5841 {Py_tp_methods, (void *)__pyx_methods_5pysam_11libcsamfile_Samfile},
5842 {Py_tp_new, (void *)__pyx_tp_new_5pysam_11libcsamfile_Samfile},
5843 {0, 0},
5844 };
5845 static PyType_Spec __pyx_type_5pysam_11libcsamfile_Samfile_spec = {
5846 "pysam.libcsamfile.Samfile",
5847 sizeof(struct __pyx_obj_5pysam_11libcsamfile_Samfile),
5848 0,
5849 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
5850 __pyx_type_5pysam_11libcsamfile_Samfile_slots,
5851 };
5852 #else
5853
5854 static PyTypeObject __pyx_type_5pysam_11libcsamfile_Samfile = {
5855 PyVarObject_HEAD_INIT(0, 0)
5856 "pysam.libcsamfile.""Samfile", /*tp_name*/
5857 sizeof(struct __pyx_obj_5pysam_11libcsamfile_Samfile), /*tp_basicsize*/
5858 0, /*tp_itemsize*/
5859 0, /*tp_dealloc*/
5860 #if PY_VERSION_HEX < 0x030800b4
5861 0, /*tp_print*/
5862 #endif
5863 #if PY_VERSION_HEX >= 0x030800b4
5864 0, /*tp_vectorcall_offset*/
5865 #endif
5866 0, /*tp_getattr*/
5867 0, /*tp_setattr*/
5868 #if PY_MAJOR_VERSION < 3
5869 0, /*tp_compare*/
5870 #endif
5871 #if PY_MAJOR_VERSION >= 3
5872 0, /*tp_as_async*/
5873 #endif
5874 0, /*tp_repr*/
5875 0, /*tp_as_number*/
5876 0, /*tp_as_sequence*/
5877 0, /*tp_as_mapping*/
5878 0, /*tp_hash*/
5879 0, /*tp_call*/
5880 0, /*tp_str*/
5881 0, /*tp_getattro*/
5882 0, /*tp_setattro*/
5883 0, /*tp_as_buffer*/
5884 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
5885 PyDoc_STR("Deprecated alternative for :class:`~pysam.AlignmentFile`\n\n Added for backwards compatibility with pysam <= 0.8.0\n "), /*tp_doc*/
5886 __pyx_tp_traverse_5pysam_11libcsamfile_Samfile, /*tp_traverse*/
5887 __pyx_tp_clear_5pysam_11libcsamfile_Samfile, /*tp_clear*/
5888 0, /*tp_richcompare*/
5889 0, /*tp_weaklistoffset*/
5890 0, /*tp_iter*/
5891 0, /*tp_iternext*/
5892 __pyx_methods_5pysam_11libcsamfile_Samfile, /*tp_methods*/
5893 0, /*tp_members*/
5894 0, /*tp_getset*/
5895 0, /*tp_base*/
5896 0, /*tp_dict*/
5897 0, /*tp_descr_get*/
5898 0, /*tp_descr_set*/
5899 #if !CYTHON_USE_TYPE_SPECS
5900 0, /*tp_dictoffset*/
5901 #endif
5902 0, /*tp_init*/
5903 0, /*tp_alloc*/
5904 __pyx_tp_new_5pysam_11libcsamfile_Samfile, /*tp_new*/
5905 0, /*tp_free*/
5906 0, /*tp_is_gc*/
5907 0, /*tp_bases*/
5908 0, /*tp_mro*/
5909 0, /*tp_cache*/
5910 0, /*tp_subclasses*/
5911 0, /*tp_weaklist*/
5912 0, /*tp_del*/
5913 0, /*tp_version_tag*/
5914 #if PY_VERSION_HEX >= 0x030400a1
5915 #if CYTHON_USE_TP_FINALIZE
5916 0, /*tp_finalize*/
5917 #else
5918 NULL, /*tp_finalize*/
5919 #endif
5920 #endif
5921 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
5922 0, /*tp_vectorcall*/
5923 #endif
5924 #if __PYX_NEED_TP_PRINT_SLOT == 1
5925 0, /*tp_print*/
5926 #endif
5927 #if PY_VERSION_HEX >= 0x030C0000
5928 0, /*tp_watched*/
5929 #endif
5930 #if PY_VERSION_HEX >= 0x030d00A4
5931 0, /*tp_versions_used*/
5932 #endif
5933 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
5934 0, /*tp_pypy_flags*/
5935 #endif
5936 };
5937 #endif
5938
5939 static PyMethodDef __pyx_methods[] = {
5940 {0, 0, 0, 0}
5941 };
5942 #ifndef CYTHON_SMALL_CODE
5943 #if defined(__clang__)
5944 #define CYTHON_SMALL_CODE
5945 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
5946 #define CYTHON_SMALL_CODE __attribute__((cold))
5947 #else
5948 #define CYTHON_SMALL_CODE
5949 #endif
5950 #endif
5951 /* #### Code section: pystring_table ### */
5952
5953 static int __Pyx_CreateStringTabAndInitStrings(void) {
5954 __Pyx_StringTabEntry __pyx_string_tab[] = {
5955 {&__pyx_n_s_AlignedRead, __pyx_k_AlignedRead, sizeof(__pyx_k_AlignedRead), 0, 0, 1, 1},
5956 {&__pyx_n_u_AlignedRead, __pyx_k_AlignedRead, sizeof(__pyx_k_AlignedRead), 0, 1, 0, 1},
5957 {&__pyx_n_s_AlignedRead___reduce_cython, __pyx_k_AlignedRead___reduce_cython, sizeof(__pyx_k_AlignedRead___reduce_cython), 0, 0, 1, 1},
5958 {&__pyx_n_s_AlignedRead___setstate_cython, __pyx_k_AlignedRead___setstate_cython, sizeof(__pyx_k_AlignedRead___setstate_cython), 0, 0, 1, 1},
5959 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
5960 {&__pyx_n_s_Samfile, __pyx_k_Samfile, sizeof(__pyx_k_Samfile), 0, 0, 1, 1},
5961 {&__pyx_n_u_Samfile, __pyx_k_Samfile, sizeof(__pyx_k_Samfile), 0, 1, 0, 1},
5962 {&__pyx_n_s_Samfile___reduce_cython, __pyx_k_Samfile___reduce_cython, sizeof(__pyx_k_Samfile___reduce_cython), 0, 0, 1, 1},
5963 {&__pyx_n_s_Samfile___setstate_cython, __pyx_k_Samfile___setstate_cython, sizeof(__pyx_k_Samfile___setstate_cython), 0, 0, 1, 1},
5964 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
5965 {&__pyx_n_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 1},
5966 {&__pyx_n_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 1},
5967 {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
5968 {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
5969 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
5970 {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
5971 {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
5972 {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
5973 {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
5974 {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
5975 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
5976 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
5977 {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
5978 {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
5979 {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
5980 {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
5981 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
5982 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
5983 {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
5984 {&__pyx_n_s_platform, __pyx_k_platform, sizeof(__pyx_k_platform), 0, 0, 1, 1},
5985 {&__pyx_n_s_pysam_libcsamfile, __pyx_k_pysam_libcsamfile, sizeof(__pyx_k_pysam_libcsamfile), 0, 0, 1, 1},
5986 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
5987 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
5988 {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
5989 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
5990 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
5991 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
5992 {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
5993 {&__pyx_kp_s_self__delegate_cannot_be_convert, __pyx_k_self__delegate_cannot_be_convert, sizeof(__pyx_k_self__delegate_cannot_be_convert), 0, 0, 1, 0},
5994 {&__pyx_kp_s_self_b_self_htsfile_self_index_c, __pyx_k_self_b_self_htsfile_self_index_c, sizeof(__pyx_k_self_b_self_htsfile_self_index_c), 0, 0, 1, 0},
5995 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
5996 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
5997 {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
5998 {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
5999 {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
6000 {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
6001 {&__pyx_n_s_tempfile, __pyx_k_tempfile, sizeof(__pyx_k_tempfile), 0, 0, 1, 1},
6002 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
6003 {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
6004 {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
6005 {0, 0, 0, 0, 0, 0, 0}
6006 };
6007 return __Pyx_InitStrings(__pyx_string_tab);
6008 }
6009 /* #### Code section: cached_builtins ### */
6010 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
6011 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
6012 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 120, __pyx_L1_error)
6013 return 0;
6014 __pyx_L1_error:;
6015 return -1;
6016 }
6017 /* #### Code section: cached_constants ### */
6018
6019 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
6020 __Pyx_RefNannyDeclarations
6021 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
6022
6023 /* "(tree fragment)":1
6024 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6025 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
6026 * def __setstate_cython__(self, __pyx_state):
6027 */
6028 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 1, __pyx_L1_error)
6029 __Pyx_GOTREF(__pyx_tuple__6);
6030 __Pyx_GIVEREF(__pyx_tuple__6);
6031 __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 1, __pyx_L1_error)
6032
6033 /* "(tree fragment)":3
6034 * def __reduce_cython__(self):
6035 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
6036 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6037 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
6038 */
6039 __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 3, __pyx_L1_error)
6040 __Pyx_GOTREF(__pyx_tuple__7);
6041 __Pyx_GIVEREF(__pyx_tuple__7);
6042 __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 3, __pyx_L1_error)
6043
6044 /* "(tree fragment)":1
6045 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6046 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
6047 * def __setstate_cython__(self, __pyx_state):
6048 */
6049 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 1, __pyx_L1_error)
6050
6051 /* "(tree fragment)":3
6052 * def __reduce_cython__(self):
6053 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
6054 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6055 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
6056 */
6057 __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__7, __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)
6058 __Pyx_RefNannyFinishContext();
6059 return 0;
6060 __pyx_L1_error:;
6061 __Pyx_RefNannyFinishContext();
6062 return -1;
6063 }
6064 /* #### Code section: init_constants ### */
6065
6066 static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
6067 if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(3, 1, __pyx_L1_error);
6068 return 0;
6069 __pyx_L1_error:;
6070 return -1;
6071 }
6072 /* #### Code section: init_globals ### */
6073
6074 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
6075 return 0;
6076 }
6077 /* #### Code section: init_module ### */
6078
6079 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
6080 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
6081 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
6082 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
6083 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
6084 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
6085 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
6086
6087 static int __Pyx_modinit_global_init_code(void) {
6088 __Pyx_RefNannyDeclarations
6089 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
6090 /*--- Global init code ---*/
6091 __Pyx_RefNannyFinishContext();
6092 return 0;
6093 }
6094
6095 static int __Pyx_modinit_variable_export_code(void) {
6096 __Pyx_RefNannyDeclarations
6097 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
6098 /*--- Variable export code ---*/
6099 __Pyx_RefNannyFinishContext();
6100 return 0;
6101 }
6102
6103 static int __Pyx_modinit_function_export_code(void) {
6104 __Pyx_RefNannyDeclarations
6105 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
6106 /*--- Function export code ---*/
6107 __Pyx_RefNannyFinishContext();
6108 return 0;
6109 }
6110
6111 static int __Pyx_modinit_type_init_code(void) {
6112 __Pyx_RefNannyDeclarations
6113 PyObject *__pyx_t_1 = NULL;
6114 PyObject *__pyx_t_2 = NULL;
6115 PyObject *__pyx_t_3 = NULL;
6116 int __pyx_lineno = 0;
6117 const char *__pyx_filename = NULL;
6118 int __pyx_clineno = 0;
6119 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
6120 /*--- Type init code ---*/
6121 __pyx_t_1 = PyImport_ImportModule("pysam.libcalignedsegment"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1, __pyx_L1_error)
6122 __Pyx_GOTREF(__pyx_t_1);
6123 __pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignedsegment", "AlignedSegment", sizeof(struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment) __PYX_ERR(3, 1, __pyx_L1_error)
6124 __pyx_vtabptr_5pysam_18libcalignedsegment_AlignedSegment = (struct __pyx_vtabstruct_5pysam_18libcalignedsegment_AlignedSegment*)__Pyx_GetVtable(__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment); if (unlikely(!__pyx_vtabptr_5pysam_18libcalignedsegment_AlignedSegment)) __PYX_ERR(3, 1, __pyx_L1_error)
6125 __pyx_vtabptr_5pysam_11libcsamfile_AlignedRead = &__pyx_vtable_5pysam_11libcsamfile_AlignedRead;
6126 __pyx_vtable_5pysam_11libcsamfile_AlignedRead.__pyx_base = *__pyx_vtabptr_5pysam_18libcalignedsegment_AlignedSegment;
6127 #if CYTHON_USE_TYPE_SPECS
6128 __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 31, __pyx_L1_error)
6129 __Pyx_GOTREF(__pyx_t_2);
6130 __pyx_ptype_5pysam_11libcsamfile_AlignedRead = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_11libcsamfile_AlignedRead_spec, __pyx_t_2);
6131 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6132 if (unlikely(!__pyx_ptype_5pysam_11libcsamfile_AlignedRead)) __PYX_ERR(3, 31, __pyx_L1_error)
6133 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_11libcsamfile_AlignedRead_spec, __pyx_ptype_5pysam_11libcsamfile_AlignedRead) < 0) __PYX_ERR(3, 31, __pyx_L1_error)
6134 #else
6135 __pyx_ptype_5pysam_11libcsamfile_AlignedRead = &__pyx_type_5pysam_11libcsamfile_AlignedRead;
6136 #endif
6137 #if !CYTHON_COMPILING_IN_LIMITED_API
6138 __pyx_ptype_5pysam_11libcsamfile_AlignedRead->tp_dealloc = __pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment->tp_dealloc;
6139 __pyx_ptype_5pysam_11libcsamfile_AlignedRead->tp_base = __pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment;
6140 #endif
6141 #if !CYTHON_USE_TYPE_SPECS
6142 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_11libcsamfile_AlignedRead) < 0) __PYX_ERR(3, 31, __pyx_L1_error)
6143 #endif
6144 #if PY_MAJOR_VERSION < 3
6145 __pyx_ptype_5pysam_11libcsamfile_AlignedRead->tp_print = 0;
6146 #endif
6147 #if !CYTHON_COMPILING_IN_LIMITED_API
6148 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_11libcsamfile_AlignedRead->tp_dictoffset && __pyx_ptype_5pysam_11libcsamfile_AlignedRead->tp_getattro == PyObject_GenericGetAttr)) {
6149 __pyx_ptype_5pysam_11libcsamfile_AlignedRead->tp_getattro = __Pyx_PyObject_GenericGetAttr;
6150 }
6151 #endif
6152 if (__Pyx_SetVtable(__pyx_ptype_5pysam_11libcsamfile_AlignedRead, __pyx_vtabptr_5pysam_11libcsamfile_AlignedRead) < 0) __PYX_ERR(3, 31, __pyx_L1_error)
6153 #if !CYTHON_COMPILING_IN_LIMITED_API
6154 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_11libcsamfile_AlignedRead) < 0) __PYX_ERR(3, 31, __pyx_L1_error)
6155 #endif
6156 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AlignedRead, (PyObject *) __pyx_ptype_5pysam_11libcsamfile_AlignedRead) < 0) __PYX_ERR(3, 31, __pyx_L1_error)
6157 #if !CYTHON_COMPILING_IN_LIMITED_API
6158 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_11libcsamfile_AlignedRead) < 0) __PYX_ERR(3, 31, __pyx_L1_error)
6159 #endif
6160 __pyx_t_2 = PyImport_ImportModule("pysam.libcalignmentfile"); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1, __pyx_L1_error)
6161 __Pyx_GOTREF(__pyx_t_2);
6162 __pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile = __Pyx_ImportType_3_0_11(__pyx_t_2, "pysam.libcalignmentfile", "AlignmentFile", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile) __PYX_ERR(3, 1, __pyx_L1_error)
6163 __pyx_vtabptr_5pysam_17libcalignmentfile_AlignmentFile = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_AlignmentFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_AlignmentFile)) __PYX_ERR(3, 1, __pyx_L1_error)
6164 __pyx_vtabptr_5pysam_11libcsamfile_Samfile = &__pyx_vtable_5pysam_11libcsamfile_Samfile;
6165 __pyx_vtable_5pysam_11libcsamfile_Samfile.__pyx_base = *__pyx_vtabptr_5pysam_17libcalignmentfile_AlignmentFile;
6166 #if CYTHON_USE_TYPE_SPECS
6167 __pyx_t_3 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 23, __pyx_L1_error)
6168 __Pyx_GOTREF(__pyx_t_3);
6169 __pyx_ptype_5pysam_11libcsamfile_Samfile = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_11libcsamfile_Samfile_spec, __pyx_t_3);
6170 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6171 if (unlikely(!__pyx_ptype_5pysam_11libcsamfile_Samfile)) __PYX_ERR(3, 23, __pyx_L1_error)
6172 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_11libcsamfile_Samfile_spec, __pyx_ptype_5pysam_11libcsamfile_Samfile) < 0) __PYX_ERR(3, 23, __pyx_L1_error)
6173 #else
6174 __pyx_ptype_5pysam_11libcsamfile_Samfile = &__pyx_type_5pysam_11libcsamfile_Samfile;
6175 #endif
6176 #if !CYTHON_COMPILING_IN_LIMITED_API
6177 __pyx_ptype_5pysam_11libcsamfile_Samfile->tp_dealloc = __pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile->tp_dealloc;
6178 __pyx_ptype_5pysam_11libcsamfile_Samfile->tp_base = __pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile;
6179 #endif
6180 #if !CYTHON_USE_TYPE_SPECS
6181 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_11libcsamfile_Samfile) < 0) __PYX_ERR(3, 23, __pyx_L1_error)
6182 #endif
6183 #if PY_MAJOR_VERSION < 3
6184 __pyx_ptype_5pysam_11libcsamfile_Samfile->tp_print = 0;
6185 #endif
6186 #if !CYTHON_COMPILING_IN_LIMITED_API
6187 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_11libcsamfile_Samfile->tp_dictoffset && __pyx_ptype_5pysam_11libcsamfile_Samfile->tp_getattro == PyObject_GenericGetAttr)) {
6188 __pyx_ptype_5pysam_11libcsamfile_Samfile->tp_getattro = __Pyx_PyObject_GenericGetAttr;
6189 }
6190 #endif
6191 if (__Pyx_SetVtable(__pyx_ptype_5pysam_11libcsamfile_Samfile, __pyx_vtabptr_5pysam_11libcsamfile_Samfile) < 0) __PYX_ERR(3, 23, __pyx_L1_error)
6192 #if !CYTHON_COMPILING_IN_LIMITED_API
6193 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_11libcsamfile_Samfile) < 0) __PYX_ERR(3, 23, __pyx_L1_error)
6194 #endif
6195 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Samfile, (PyObject *) __pyx_ptype_5pysam_11libcsamfile_Samfile) < 0) __PYX_ERR(3, 23, __pyx_L1_error)
6196 #if !CYTHON_COMPILING_IN_LIMITED_API
6197 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_11libcsamfile_Samfile) < 0) __PYX_ERR(3, 23, __pyx_L1_error)
6198 #endif
6199 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6200 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6201 __Pyx_RefNannyFinishContext();
6202 return 0;
6203 __pyx_L1_error:;
6204 __Pyx_XDECREF(__pyx_t_1);
6205 __Pyx_XDECREF(__pyx_t_2);
6206 __Pyx_XDECREF(__pyx_t_3);
6207 __Pyx_RefNannyFinishContext();
6208 return -1;
6209 }
6210
6211 static int __Pyx_modinit_type_import_code(void) {
6212 __Pyx_RefNannyDeclarations
6213 PyObject *__pyx_t_1 = NULL;
6214 int __pyx_lineno = 0;
6215 const char *__pyx_filename = NULL;
6216 int __pyx_clineno = 0;
6217 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
6218 /*--- Type import code ---*/
6219 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
6220 __Pyx_GOTREF(__pyx_t_1);
6221 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
6222 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
6223 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
6224 #elif CYTHON_COMPILING_IN_LIMITED_API
6225 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
6226 #else
6227 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject),
6228 #endif
6229 __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
6230 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6231 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 8, __pyx_L1_error)
6232 __Pyx_GOTREF(__pyx_t_1);
6233 __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(5, 8, __pyx_L1_error)
6234 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6235 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 15, __pyx_L1_error)
6236 __Pyx_GOTREF(__pyx_t_1);
6237 __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(6, 15, __pyx_L1_error)
6238 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6239 __pyx_t_1 = PyImport_ImportModule("array"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 69, __pyx_L1_error)
6240 __Pyx_GOTREF(__pyx_t_1);
6241 __pyx_ptype_7cpython_5array_array = __Pyx_ImportType_3_0_11(__pyx_t_1, "array", "array", sizeof(arrayobject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(arrayobject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_5array_array) __PYX_ERR(2, 69, __pyx_L1_error)
6242 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6243 __pyx_t_1 = PyImport_ImportModule("pysam.libchtslib"); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 2706, __pyx_L1_error)
6244 __Pyx_GOTREF(__pyx_t_1);
6245 __pyx_ptype_5pysam_10libchtslib_HTSFile = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libchtslib", "HTSFile", sizeof(struct __pyx_obj_5pysam_10libchtslib_HTSFile), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_10libchtslib_HTSFile),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_10libchtslib_HTSFile) __PYX_ERR(7, 2706, __pyx_L1_error)
6246 __pyx_vtabptr_5pysam_10libchtslib_HTSFile = (struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_10libchtslib_HTSFile); if (unlikely(!__pyx_vtabptr_5pysam_10libchtslib_HTSFile)) __PYX_ERR(7, 2706, __pyx_L1_error)
6247 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6248 __pyx_t_1 = PyImport_ImportModule("pysam.libcfaidx"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 38, __pyx_L1_error)
6249 __Pyx_GOTREF(__pyx_t_1);
6250 __pyx_ptype_5pysam_9libcfaidx_FastaFile = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcfaidx", "FastaFile", sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastaFile), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libcfaidx_FastaFile),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libcfaidx_FastaFile) __PYX_ERR(8, 38, __pyx_L1_error)
6251 __pyx_vtabptr_5pysam_9libcfaidx_FastaFile = (struct __pyx_vtabstruct_5pysam_9libcfaidx_FastaFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libcfaidx_FastaFile); if (unlikely(!__pyx_vtabptr_5pysam_9libcfaidx_FastaFile)) __PYX_ERR(8, 38, __pyx_L1_error)
6252 __pyx_ptype_5pysam_9libcfaidx_FastqProxy = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcfaidx", "FastqProxy", sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libcfaidx_FastqProxy) __PYX_ERR(8, 46, __pyx_L1_error)
6253 __pyx_vtabptr_5pysam_9libcfaidx_FastqProxy = (struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libcfaidx_FastqProxy); if (unlikely(!__pyx_vtabptr_5pysam_9libcfaidx_FastqProxy)) __PYX_ERR(8, 46, __pyx_L1_error)
6254 __pyx_ptype_5pysam_9libcfaidx_FastxRecord = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcfaidx", "FastxRecord", sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libcfaidx_FastxRecord) __PYX_ERR(8, 53, __pyx_L1_error)
6255 __pyx_vtabptr_5pysam_9libcfaidx_FastxRecord = (struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxRecord*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libcfaidx_FastxRecord); if (unlikely(!__pyx_vtabptr_5pysam_9libcfaidx_FastxRecord)) __PYX_ERR(8, 53, __pyx_L1_error)
6256 __pyx_ptype_5pysam_9libcfaidx_FastxFile = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcfaidx", "FastxFile", sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastxFile), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libcfaidx_FastxFile),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libcfaidx_FastxFile) __PYX_ERR(8, 62, __pyx_L1_error)
6257 __pyx_vtabptr_5pysam_9libcfaidx_FastxFile = (struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libcfaidx_FastxFile); if (unlikely(!__pyx_vtabptr_5pysam_9libcfaidx_FastxFile)) __PYX_ERR(8, 62, __pyx_L1_error)
6258 __pyx_ptype_5pysam_9libcfaidx_FastqFile = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcfaidx", "FastqFile", sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastqFile), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libcfaidx_FastqFile),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libcfaidx_FastqFile) __PYX_ERR(8, 74, __pyx_L1_error)
6259 __pyx_vtabptr_5pysam_9libcfaidx_FastqFile = (struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libcfaidx_FastqFile); if (unlikely(!__pyx_vtabptr_5pysam_9libcfaidx_FastqFile)) __PYX_ERR(8, 74, __pyx_L1_error)
6260 __pyx_ptype_5pysam_9libcfaidx_Fastafile = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcfaidx", "Fastafile", sizeof(struct __pyx_obj_5pysam_9libcfaidx_Fastafile), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libcfaidx_Fastafile),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libcfaidx_Fastafile) __PYX_ERR(8, 79, __pyx_L1_error)
6261 __pyx_vtabptr_5pysam_9libcfaidx_Fastafile = (struct __pyx_vtabstruct_5pysam_9libcfaidx_Fastafile*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libcfaidx_Fastafile); if (unlikely(!__pyx_vtabptr_5pysam_9libcfaidx_Fastafile)) __PYX_ERR(8, 79, __pyx_L1_error)
6262 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6263 __pyx_t_1 = PyImport_ImportModule("pysam.libcalignedsegment"); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 66, __pyx_L1_error)
6264 __Pyx_GOTREF(__pyx_t_1);
6265 __pyx_ptype_5pysam_18libcalignedsegment_PileupColumn = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignedsegment", "PileupColumn", sizeof(struct __pyx_obj_5pysam_18libcalignedsegment_PileupColumn), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_18libcalignedsegment_PileupColumn),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_18libcalignedsegment_PileupColumn) __PYX_ERR(9, 66, __pyx_L1_error)
6266 __pyx_ptype_5pysam_18libcalignedsegment_PileupRead = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignedsegment", "PileupRead", sizeof(struct __pyx_obj_5pysam_18libcalignedsegment_PileupRead), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_18libcalignedsegment_PileupRead),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_18libcalignedsegment_PileupRead) __PYX_ERR(9, 76, __pyx_L1_error)
6267 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6268 __pyx_t_1 = PyImport_ImportModule("pysam.libcalignmentfile"); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 42, __pyx_L1_error)
6269 __Pyx_GOTREF(__pyx_t_1);
6270 __pyx_ptype_5pysam_17libcalignmentfile_AlignmentHeader = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "AlignmentHeader", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_AlignmentHeader) __PYX_ERR(10, 42, __pyx_L1_error)
6271 __pyx_ptype_5pysam_17libcalignmentfile_IteratorRow = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorRow", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorRow) __PYX_ERR(10, 62, __pyx_L1_error)
6272 __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowRegion = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorRowRegion", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowRegion), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowRegion),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowRegion) __PYX_ERR(10, 72, __pyx_L1_error)
6273 __pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowRegion = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowRegion*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowRegion); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowRegion)) __PYX_ERR(10, 72, __pyx_L1_error)
6274 __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowHead = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorRowHead", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowHead), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowHead),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowHead) __PYX_ERR(10, 78, __pyx_L1_error)
6275 __pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowHead = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowHead*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowHead); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowHead)) __PYX_ERR(10, 78, __pyx_L1_error)
6276 __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAll = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorRowAll", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAll), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAll),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAll) __PYX_ERR(10, 85, __pyx_L1_error)
6277 __pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowAll = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowAll*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAll); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowAll)) __PYX_ERR(10, 85, __pyx_L1_error)
6278 __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAllRefs = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorRowAllRefs", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAllRefs), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAllRefs),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAllRefs) __PYX_ERR(10, 90, __pyx_L1_error)
6279 __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowSelection = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorRowSelection", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowSelection), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowSelection),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowSelection) __PYX_ERR(10, 95, __pyx_L1_error)
6280 __pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowSelection = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowSelection*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowSelection); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowSelection)) __PYX_ERR(10, 95, __pyx_L1_error)
6281 __pyx_ptype_5pysam_17libcalignmentfile_IteratorColumn = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorColumn", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumn) __PYX_ERR(10, 102, __pyx_L1_error)
6282 __pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumn = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumn*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumn); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumn)) __PYX_ERR(10, 102, __pyx_L1_error)
6283 __pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnRegion = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorColumnRegion", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnRegion), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnRegion),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnRegion) __PYX_ERR(10, 134, __pyx_L1_error)
6284 __pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnRegion = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnRegion*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnRegion); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnRegion)) __PYX_ERR(10, 134, __pyx_L1_error)
6285 __pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAllRefs = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorColumnAllRefs", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnAllRefs), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnAllRefs),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAllRefs) __PYX_ERR(10, 140, __pyx_L1_error)
6286 __pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnAllRefs = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnAllRefs*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAllRefs); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnAllRefs)) __PYX_ERR(10, 140, __pyx_L1_error)
6287 __pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAll = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorColumnAll", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnAll), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnAll),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAll) __PYX_ERR(10, 144, __pyx_L1_error)
6288 __pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnAll = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnAll*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAll); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnAll)) __PYX_ERR(10, 144, __pyx_L1_error)
6289 __pyx_ptype_5pysam_17libcalignmentfile_IndexedReads = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IndexedReads", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IndexedReads), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IndexedReads),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IndexedReads) __PYX_ERR(10, 148, __pyx_L1_error)
6290 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6291 __Pyx_RefNannyFinishContext();
6292 return 0;
6293 __pyx_L1_error:;
6294 __Pyx_XDECREF(__pyx_t_1);
6295 __Pyx_RefNannyFinishContext();
6296 return -1;
6297 }
6298
6299 static int __Pyx_modinit_variable_import_code(void) {
6300 __Pyx_RefNannyDeclarations
6301 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
6302 /*--- Variable import code ---*/
6303 __Pyx_RefNannyFinishContext();
6304 return 0;
6305 }
6306
6307 static int __Pyx_modinit_function_import_code(void) {
6308 __Pyx_RefNannyDeclarations
6309 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
6310 /*--- Function import code ---*/
6311 __Pyx_RefNannyFinishContext();
6312 return 0;
6313 }
6314
6315
6316 #if PY_MAJOR_VERSION >= 3
6317 #if CYTHON_PEP489_MULTI_PHASE_INIT
6318 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
6319 static int __pyx_pymod_exec_libcsamfile(PyObject* module); /*proto*/
6320 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
6321 {Py_mod_create, (void*)__pyx_pymod_create},
6322 {Py_mod_exec, (void*)__pyx_pymod_exec_libcsamfile},
6323 {0, NULL}
6324 };
6325 #endif
6326
6327 #ifdef __cplusplus
6328 namespace {
6329 struct PyModuleDef __pyx_moduledef =
6330 #else
6331 static struct PyModuleDef __pyx_moduledef =
6332 #endif
6333 {
6334 PyModuleDef_HEAD_INIT,
6335 "libcsamfile",
6336 0, /* m_doc */
6337 #if CYTHON_PEP489_MULTI_PHASE_INIT
6338 0, /* m_size */
6339 #elif CYTHON_USE_MODULE_STATE
6340 sizeof(__pyx_mstate), /* m_size */
6341 #else
6342 -1, /* m_size */
6343 #endif
6344 __pyx_methods /* m_methods */,
6345 #if CYTHON_PEP489_MULTI_PHASE_INIT
6346 __pyx_moduledef_slots, /* m_slots */
6347 #else
6348 NULL, /* m_reload */
6349 #endif
6350 #if CYTHON_USE_MODULE_STATE
6351 __pyx_m_traverse, /* m_traverse */
6352 __pyx_m_clear, /* m_clear */
6353 NULL /* m_free */
6354 #else
6355 NULL, /* m_traverse */
6356 NULL, /* m_clear */
6357 NULL /* m_free */
6358 #endif
6359 };
6360 #ifdef __cplusplus
6361 } /* anonymous namespace */
6362 #endif
6363 #endif
6364
6365 #ifndef CYTHON_NO_PYINIT_EXPORT
6366 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
6367 #elif PY_MAJOR_VERSION < 3
6368 #ifdef __cplusplus
6369 #define __Pyx_PyMODINIT_FUNC extern "C" void
6370 #else
6371 #define __Pyx_PyMODINIT_FUNC void
6372 #endif
6373 #else
6374 #ifdef __cplusplus
6375 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
6376 #else
6377 #define __Pyx_PyMODINIT_FUNC PyObject *
6378 #endif
6379 #endif
6380
6381
6382 #if PY_MAJOR_VERSION < 3
6383 __Pyx_PyMODINIT_FUNC initlibcsamfile(void) CYTHON_SMALL_CODE; /*proto*/
6384 __Pyx_PyMODINIT_FUNC initlibcsamfile(void)
6385 #else
6386 __Pyx_PyMODINIT_FUNC PyInit_libcsamfile(void) CYTHON_SMALL_CODE; /*proto*/
6387 __Pyx_PyMODINIT_FUNC PyInit_libcsamfile(void)
6388 #if CYTHON_PEP489_MULTI_PHASE_INIT
6389 {
6390 return PyModuleDef_Init(&__pyx_moduledef);
6391 }
6392 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
6393 #if PY_VERSION_HEX >= 0x030700A1
6394 static PY_INT64_T main_interpreter_id = -1;
6395 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
6396 if (main_interpreter_id == -1) {
6397 main_interpreter_id = current_id;
6398 return (unlikely(current_id == -1)) ? -1 : 0;
6399 } else if (unlikely(main_interpreter_id != current_id))
6400 #else
6401 static PyInterpreterState *main_interpreter = NULL;
6402 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
6403 if (!main_interpreter) {
6404 main_interpreter = current_interpreter;
6405 } else if (unlikely(main_interpreter != current_interpreter))
6406 #endif
6407 {
6408 PyErr_SetString(
6409 PyExc_ImportError,
6410 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
6411 return -1;
6412 }
6413 return 0;
6414 }
6415 #if CYTHON_COMPILING_IN_LIMITED_API
6416 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)
6417 #else
6418 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)
6419 #endif
6420 {
6421 PyObject *value = PyObject_GetAttrString(spec, from_name);
6422 int result = 0;
6423 if (likely(value)) {
6424 if (allow_none || value != Py_None) {
6425 #if CYTHON_COMPILING_IN_LIMITED_API
6426 result = PyModule_AddObject(module, to_name, value);
6427 #else
6428 result = PyDict_SetItemString(moddict, to_name, value);
6429 #endif
6430 }
6431 Py_DECREF(value);
6432 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
6433 PyErr_Clear();
6434 } else {
6435 result = -1;
6436 }
6437 return result;
6438 }
6439 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
6440 PyObject *module = NULL, *moddict, *modname;
6441 CYTHON_UNUSED_VAR(def);
6442 if (__Pyx_check_single_interpreter())
6443 return NULL;
6444 if (__pyx_m)
6445 return __Pyx_NewRef(__pyx_m);
6446 modname = PyObject_GetAttrString(spec, "name");
6447 if (unlikely(!modname)) goto bad;
6448 module = PyModule_NewObject(modname);
6449 Py_DECREF(modname);
6450 if (unlikely(!module)) goto bad;
6451 #if CYTHON_COMPILING_IN_LIMITED_API
6452 moddict = module;
6453 #else
6454 moddict = PyModule_GetDict(module);
6455 if (unlikely(!moddict)) goto bad;
6456 #endif
6457 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
6458 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
6459 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
6460 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
6461 return module;
6462 bad:
6463 Py_XDECREF(module);
6464 return NULL;
6465 }
6466
6467
6468 static CYTHON_SMALL_CODE int __pyx_pymod_exec_libcsamfile(PyObject *__pyx_pyinit_module)
6469 #endif
6470 #endif
6471 {
6472 int stringtab_initialized = 0;
6473 #if CYTHON_USE_MODULE_STATE
6474 int pystate_addmodule_run = 0;
6475 #endif
6476 __Pyx_TraceDeclarations
6477 PyObject *__pyx_t_1 = NULL;
6478 PyObject *__pyx_t_2 = NULL;
6479 int __pyx_lineno = 0;
6480 const char *__pyx_filename = NULL;
6481 int __pyx_clineno = 0;
6482 __Pyx_RefNannyDeclarations
6483 #if CYTHON_PEP489_MULTI_PHASE_INIT
6484 if (__pyx_m) {
6485 if (__pyx_m == __pyx_pyinit_module) return 0;
6486 PyErr_SetString(PyExc_RuntimeError, "Module 'libcsamfile' has already been imported. Re-initialisation is not supported.");
6487 return -1;
6488 }
6489 #elif PY_MAJOR_VERSION >= 3
6490 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
6491 #endif
6492 /*--- Module creation code ---*/
6493 #if CYTHON_PEP489_MULTI_PHASE_INIT
6494 __pyx_m = __pyx_pyinit_module;
6495 Py_INCREF(__pyx_m);
6496 #else
6497 #if PY_MAJOR_VERSION < 3
6498 __pyx_m = Py_InitModule4("libcsamfile", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
6499 if (unlikely(!__pyx_m)) __PYX_ERR(3, 1, __pyx_L1_error)
6500 #elif CYTHON_USE_MODULE_STATE
6501 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1, __pyx_L1_error)
6502 {
6503 int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
6504 __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "libcsamfile" pseudovariable */
6505 if (unlikely((add_module_result < 0))) __PYX_ERR(3, 1, __pyx_L1_error)
6506 pystate_addmodule_run = 1;
6507 }
6508 #else
6509 __pyx_m = PyModule_Create(&__pyx_moduledef);
6510 if (unlikely(!__pyx_m)) __PYX_ERR(3, 1, __pyx_L1_error)
6511 #endif
6512 #endif
6513 CYTHON_UNUSED_VAR(__pyx_t_1);
6514 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(3, 1, __pyx_L1_error)
6515 Py_INCREF(__pyx_d);
6516 __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(3, 1, __pyx_L1_error)
6517 __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(3, 1, __pyx_L1_error)
6518 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
6519 #if CYTHON_REFNANNY
6520 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
6521 if (!__Pyx_RefNanny) {
6522 PyErr_Clear();
6523 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
6524 if (!__Pyx_RefNanny)
6525 Py_FatalError("failed to import 'refnanny' module");
6526 }
6527 #endif
6528 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_libcsamfile(void)", 0);
6529 if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
6530 #ifdef __Pxy_PyFrame_Initialize_Offsets
6531 __Pxy_PyFrame_Initialize_Offsets();
6532 #endif
6533 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(3, 1, __pyx_L1_error)
6534 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(3, 1, __pyx_L1_error)
6535 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(3, 1, __pyx_L1_error)
6536 #ifdef __Pyx_CyFunction_USED
6537 if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
6538 #endif
6539 #ifdef __Pyx_FusedFunction_USED
6540 if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
6541 #endif
6542 #ifdef __Pyx_Coroutine_USED
6543 if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
6544 #endif
6545 #ifdef __Pyx_Generator_USED
6546 if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
6547 #endif
6548 #ifdef __Pyx_AsyncGen_USED
6549 if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
6550 #endif
6551 #ifdef __Pyx_StopAsyncIteration_USED
6552 if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
6553 #endif
6554 /*--- Library function declarations ---*/
6555 /*--- Threads initialization code ---*/
6556 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
6557 PyEval_InitThreads();
6558 #endif
6559 /*--- Initialize various global constants etc. ---*/
6560 if (__Pyx_InitConstants() < 0) __PYX_ERR(3, 1, __pyx_L1_error)
6561 stringtab_initialized = 1;
6562 if (__Pyx_InitGlobals() < 0) __PYX_ERR(3, 1, __pyx_L1_error)
6563 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
6564 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(3, 1, __pyx_L1_error)
6565 #endif
6566 if (__pyx_module_is_main_pysam__libcsamfile) {
6567 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
6568 }
6569 #if PY_MAJOR_VERSION >= 3
6570 {
6571 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(3, 1, __pyx_L1_error)
6572 if (!PyDict_GetItemString(modules, "pysam.libcsamfile")) {
6573 if (unlikely((PyDict_SetItemString(modules, "pysam.libcsamfile", __pyx_m) < 0))) __PYX_ERR(3, 1, __pyx_L1_error)
6574 }
6575 }
6576 #endif
6577 /*--- Builtin init code ---*/
6578 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(3, 1, __pyx_L1_error)
6579 /*--- Constants init code ---*/
6580 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(3, 1, __pyx_L1_error)
6581 /*--- Global type/function init code ---*/
6582 (void)__Pyx_modinit_global_init_code();
6583 (void)__Pyx_modinit_variable_export_code();
6584 (void)__Pyx_modinit_function_export_code();
6585 if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(3, 1, __pyx_L1_error)
6586 if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(3, 1, __pyx_L1_error)
6587 (void)__Pyx_modinit_variable_import_code();
6588 (void)__Pyx_modinit_function_import_code();
6589 /*--- Execution code ---*/
6590 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
6591 if (__Pyx_patch_abc() < 0) __PYX_ERR(3, 1, __pyx_L1_error)
6592 #endif
6593 __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_libcsamfile(void)", __pyx_f[3], 1, 0, __PYX_ERR(3, 1, __pyx_L1_error));
6594
6595 /* "pysam/libcsamfile.pyx":4
6596 * # cython: profile=True
6597 * # adds doc-strings for sphinx
6598 * import tempfile # <<<<<<<<<<<<<<
6599 * import os
6600 * import sys
6601 */
6602 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_tempfile, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4, __pyx_L1_error)
6603 __Pyx_GOTREF(__pyx_t_2);
6604 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempfile, __pyx_t_2) < 0) __PYX_ERR(3, 4, __pyx_L1_error)
6605 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6606
6607 /* "pysam/libcsamfile.pyx":5
6608 * # adds doc-strings for sphinx
6609 * import tempfile
6610 * import os # <<<<<<<<<<<<<<
6611 * import sys
6612 * import types
6613 */
6614 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5, __pyx_L1_error)
6615 __Pyx_GOTREF(__pyx_t_2);
6616 if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(3, 5, __pyx_L1_error)
6617 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6618
6619 /* "pysam/libcsamfile.pyx":6
6620 * import tempfile
6621 * import os
6622 * import sys # <<<<<<<<<<<<<<
6623 * import types
6624 * import itertools
6625 */
6626 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6, __pyx_L1_error)
6627 __Pyx_GOTREF(__pyx_t_2);
6628 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(3, 6, __pyx_L1_error)
6629 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6630
6631 /* "pysam/libcsamfile.pyx":7
6632 * import os
6633 * import sys
6634 * import types # <<<<<<<<<<<<<<
6635 * import itertools
6636 * import struct
6637 */
6638 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_types, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7, __pyx_L1_error)
6639 __Pyx_GOTREF(__pyx_t_2);
6640 if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_t_2) < 0) __PYX_ERR(3, 7, __pyx_L1_error)
6641 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6642
6643 /* "pysam/libcsamfile.pyx":8
6644 * import sys
6645 * import types
6646 * import itertools # <<<<<<<<<<<<<<
6647 * import struct
6648 * import ctypes
6649 */
6650 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_itertools, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8, __pyx_L1_error)
6651 __Pyx_GOTREF(__pyx_t_2);
6652 if (PyDict_SetItem(__pyx_d, __pyx_n_s_itertools, __pyx_t_2) < 0) __PYX_ERR(3, 8, __pyx_L1_error)
6653 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6654
6655 /* "pysam/libcsamfile.pyx":9
6656 * import types
6657 * import itertools
6658 * import struct # <<<<<<<<<<<<<<
6659 * import ctypes
6660 * import collections
6661 */
6662 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9, __pyx_L1_error)
6663 __Pyx_GOTREF(__pyx_t_2);
6664 if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_2) < 0) __PYX_ERR(3, 9, __pyx_L1_error)
6665 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6666
6667 /* "pysam/libcsamfile.pyx":10
6668 * import itertools
6669 * import struct
6670 * import ctypes # <<<<<<<<<<<<<<
6671 * import collections
6672 * import re
6673 */
6674 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_ctypes, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10, __pyx_L1_error)
6675 __Pyx_GOTREF(__pyx_t_2);
6676 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ctypes, __pyx_t_2) < 0) __PYX_ERR(3, 10, __pyx_L1_error)
6677 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6678
6679 /* "pysam/libcsamfile.pyx":11
6680 * import struct
6681 * import ctypes
6682 * import collections # <<<<<<<<<<<<<<
6683 * import re
6684 * import platform
6685 */
6686 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_collections, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 11, __pyx_L1_error)
6687 __Pyx_GOTREF(__pyx_t_2);
6688 if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_2) < 0) __PYX_ERR(3, 11, __pyx_L1_error)
6689 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6690
6691 /* "pysam/libcsamfile.pyx":12
6692 * import ctypes
6693 * import collections
6694 * import re # <<<<<<<<<<<<<<
6695 * import platform
6696 * import warnings
6697 */
6698 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_re, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 12, __pyx_L1_error)
6699 __Pyx_GOTREF(__pyx_t_2);
6700 if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_2) < 0) __PYX_ERR(3, 12, __pyx_L1_error)
6701 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6702
6703 /* "pysam/libcsamfile.pyx":13
6704 * import collections
6705 * import re
6706 * import platform # <<<<<<<<<<<<<<
6707 * import warnings
6708 * from cpython cimport PyErr_SetString, \
6709 */
6710 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_platform, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 13, __pyx_L1_error)
6711 __Pyx_GOTREF(__pyx_t_2);
6712 if (PyDict_SetItem(__pyx_d, __pyx_n_s_platform, __pyx_t_2) < 0) __PYX_ERR(3, 13, __pyx_L1_error)
6713 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6714
6715 /* "pysam/libcsamfile.pyx":14
6716 * import re
6717 * import platform
6718 * import warnings # <<<<<<<<<<<<<<
6719 * from cpython cimport PyErr_SetString, \
6720 * PyBytes_Check, \
6721 */
6722 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_warnings, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 14, __pyx_L1_error)
6723 __Pyx_GOTREF(__pyx_t_2);
6724 if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_2) < 0) __PYX_ERR(3, 14, __pyx_L1_error)
6725 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6726
6727 /* "(tree fragment)":1
6728 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6729 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
6730 * def __setstate_cython__(self, __pyx_state):
6731 */
6732 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_11libcsamfile_7Samfile_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Samfile___reduce_cython, NULL, __pyx_n_s_pysam_libcsamfile, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
6733 __Pyx_GOTREF(__pyx_t_2);
6734 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6735 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6736
6737 /* "(tree fragment)":3
6738 * def __reduce_cython__(self):
6739 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
6740 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6741 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
6742 */
6743 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_11libcsamfile_7Samfile_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Samfile___setstate_cython, NULL, __pyx_n_s_pysam_libcsamfile, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
6744 __Pyx_GOTREF(__pyx_t_2);
6745 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
6746 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6747
6748 /* "(tree fragment)":1
6749 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6750 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
6751 * def __setstate_cython__(self, __pyx_state):
6752 */
6753 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_11libcsamfile_11AlignedRead_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AlignedRead___reduce_cython, NULL, __pyx_n_s_pysam_libcsamfile, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
6754 __Pyx_GOTREF(__pyx_t_2);
6755 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6756 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6757
6758 /* "(tree fragment)":3
6759 * def __reduce_cython__(self):
6760 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
6761 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6762 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
6763 */
6764 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_11libcsamfile_11AlignedRead_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AlignedRead___setstate_cython, NULL, __pyx_n_s_pysam_libcsamfile, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
6765 __Pyx_GOTREF(__pyx_t_2);
6766 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
6767 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6768
6769 /* "pysam/libcsamfile.pyx":39
6770 *
6771 *
6772 * __all__ = ['Samfile', 'AlignedRead'] # <<<<<<<<<<<<<<
6773 *
6774 *
6775 */
6776 __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 39, __pyx_L1_error)
6777 __Pyx_GOTREF(__pyx_t_2);
6778 __Pyx_INCREF(__pyx_n_u_Samfile);
6779 __Pyx_GIVEREF(__pyx_n_u_Samfile);
6780 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_Samfile)) __PYX_ERR(3, 39, __pyx_L1_error);
6781 __Pyx_INCREF(__pyx_n_u_AlignedRead);
6782 __Pyx_GIVEREF(__pyx_n_u_AlignedRead);
6783 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_AlignedRead)) __PYX_ERR(3, 39, __pyx_L1_error);
6784 if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(3, 39, __pyx_L1_error)
6785 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6786
6787 /* "pysam/libcsamfile.pyx":1
6788 * # cython: embedsignature=True # <<<<<<<<<<<<<<
6789 * # cython: profile=True
6790 * # adds doc-strings for sphinx
6791 */
6792 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1, __pyx_L1_error)
6793 __Pyx_GOTREF(__pyx_t_2);
6794 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
6795 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6796 __Pyx_TraceReturn(Py_None, 0);
6797
6798 /*--- Wrapped vars code ---*/
6799
6800 goto __pyx_L0;
6801 __pyx_L1_error:;
6802 __Pyx_XDECREF(__pyx_t_2);
6803 if (__pyx_m) {
6804 if (__pyx_d && stringtab_initialized) {
6805 __Pyx_AddTraceback("init pysam.libcsamfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
6806 }
6807 #if !CYTHON_USE_MODULE_STATE
6808 Py_CLEAR(__pyx_m);
6809 #else
6810 Py_DECREF(__pyx_m);
6811 if (pystate_addmodule_run) {
6812 PyObject *tp, *value, *tb;
6813 PyErr_Fetch(&tp, &value, &tb);
6814 PyState_RemoveModule(&__pyx_moduledef);
6815 PyErr_Restore(tp, value, tb);
6816 }
6817 #endif
6818 } else if (!PyErr_Occurred()) {
6819 PyErr_SetString(PyExc_ImportError, "init pysam.libcsamfile");
6820 }
6821 __pyx_L0:;
6822 __Pyx_RefNannyFinishContext();
6823 #if CYTHON_PEP489_MULTI_PHASE_INIT
6824 return (__pyx_m != NULL) ? 0 : -1;
6825 #elif PY_MAJOR_VERSION >= 3
6826 return __pyx_m;
6827 #else
6828 return;
6829 #endif
6830 }
6831 /* #### Code section: cleanup_globals ### */
6832 /* #### Code section: cleanup_module ### */
6833 /* #### Code section: main_method ### */
6834 /* #### Code section: utility_code_pragmas ### */
6835 #ifdef _MSC_VER
6836 #pragma warning( push )
6837 /* Warning 4127: conditional expression is constant
6838 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
6839 * compile-time, so this warning is not useful
6840 */
6841 #pragma warning( disable : 4127 )
6842 #endif
6843
6844
6845
6846 /* #### Code section: utility_code_def ### */
6847
6848 /* --- Runtime support code --- */
6849 /* Refnanny */
6850 #if CYTHON_REFNANNY
6851 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
6852 PyObject *m = NULL, *p = NULL;
6853 void *r = NULL;
6854 m = PyImport_ImportModule(modname);
6855 if (!m) goto end;
6856 p = PyObject_GetAttrString(m, "RefNannyAPI");
6857 if (!p) goto end;
6858 r = PyLong_AsVoidPtr(p);
6859 end:
6860 Py_XDECREF(p);
6861 Py_XDECREF(m);
6862 return (__Pyx_RefNannyAPIStruct *)r;
6863 }
6864 #endif
6865
6866 /* PyErrExceptionMatches */
6867 #if CYTHON_FAST_THREAD_STATE
6868 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
6869 Py_ssize_t i, n;
6870 n = PyTuple_GET_SIZE(tuple);
6871 #if PY_MAJOR_VERSION >= 3
6872 for (i=0; i<n; i++) {
6873 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
6874 }
6875 #endif
6876 for (i=0; i<n; i++) {
6877 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
6878 }
6879 return 0;
6880 }
6881 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
6882 int result;
6883 PyObject *exc_type;
6884 #if PY_VERSION_HEX >= 0x030C00A6
6885 PyObject *current_exception = tstate->current_exception;
6886 if (unlikely(!current_exception)) return 0;
6887 exc_type = (PyObject*) Py_TYPE(current_exception);
6888 if (exc_type == err) return 1;
6889 #else
6890 exc_type = tstate->curexc_type;
6891 if (exc_type == err) return 1;
6892 if (unlikely(!exc_type)) return 0;
6893 #endif
6894 #if CYTHON_AVOID_BORROWED_REFS
6895 Py_INCREF(exc_type);
6896 #endif
6897 if (unlikely(PyTuple_Check(err))) {
6898 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
6899 } else {
6900 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
6901 }
6902 #if CYTHON_AVOID_BORROWED_REFS
6903 Py_DECREF(exc_type);
6904 #endif
6905 return result;
6906 }
6907 #endif
6908
6909 /* PyErrFetchRestore */
6910 #if CYTHON_FAST_THREAD_STATE
6911 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
6912 #if PY_VERSION_HEX >= 0x030C00A6
6913 PyObject *tmp_value;
6914 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
6915 if (value) {
6916 #if CYTHON_COMPILING_IN_CPYTHON
6917 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
6918 #endif
6919 PyException_SetTraceback(value, tb);
6920 }
6921 tmp_value = tstate->current_exception;
6922 tstate->current_exception = value;
6923 Py_XDECREF(tmp_value);
6924 Py_XDECREF(type);
6925 Py_XDECREF(tb);
6926 #else
6927 PyObject *tmp_type, *tmp_value, *tmp_tb;
6928 tmp_type = tstate->curexc_type;
6929 tmp_value = tstate->curexc_value;
6930 tmp_tb = tstate->curexc_traceback;
6931 tstate->curexc_type = type;
6932 tstate->curexc_value = value;
6933 tstate->curexc_traceback = tb;
6934 Py_XDECREF(tmp_type);
6935 Py_XDECREF(tmp_value);
6936 Py_XDECREF(tmp_tb);
6937 #endif
6938 }
6939 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
6940 #if PY_VERSION_HEX >= 0x030C00A6
6941 PyObject* exc_value;
6942 exc_value = tstate->current_exception;
6943 tstate->current_exception = 0;
6944 *value = exc_value;
6945 *type = NULL;
6946 *tb = NULL;
6947 if (exc_value) {
6948 *type = (PyObject*) Py_TYPE(exc_value);
6949 Py_INCREF(*type);
6950 #if CYTHON_COMPILING_IN_CPYTHON
6951 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
6952 Py_XINCREF(*tb);
6953 #else
6954 *tb = PyException_GetTraceback(exc_value);
6955 #endif
6956 }
6957 #else
6958 *type = tstate->curexc_type;
6959 *value = tstate->curexc_value;
6960 *tb = tstate->curexc_traceback;
6961 tstate->curexc_type = 0;
6962 tstate->curexc_value = 0;
6963 tstate->curexc_traceback = 0;
6964 #endif
6965 }
6966 #endif
6967
6968 /* PyObjectGetAttrStr */
6969 #if CYTHON_USE_TYPE_SLOTS
6970 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
6971 PyTypeObject* tp = Py_TYPE(obj);
6972 if (likely(tp->tp_getattro))
6973 return tp->tp_getattro(obj, attr_name);
6974 #if PY_MAJOR_VERSION < 3
6975 if (likely(tp->tp_getattr))
6976 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
6977 #endif
6978 return PyObject_GetAttr(obj, attr_name);
6979 }
6980 #endif
6981
6982 /* PyObjectGetAttrStrNoError */
6983 #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
6984 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
6985 __Pyx_PyThreadState_declare
6986 __Pyx_PyThreadState_assign
6987 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
6988 __Pyx_PyErr_Clear();
6989 }
6990 #endif
6991 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
6992 PyObject *result;
6993 #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
6994 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
6995 return result;
6996 #else
6997 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
6998 PyTypeObject* tp = Py_TYPE(obj);
6999 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
7000 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
7001 }
7002 #endif
7003 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
7004 if (unlikely(!result)) {
7005 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
7006 }
7007 return result;
7008 #endif
7009 }
7010
7011 /* GetBuiltinName */
7012 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
7013 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
7014 if (unlikely(!result) && !PyErr_Occurred()) {
7015 PyErr_Format(PyExc_NameError,
7016 #if PY_MAJOR_VERSION >= 3
7017 "name '%U' is not defined", name);
7018 #else
7019 "name '%.200s' is not defined", PyString_AS_STRING(name));
7020 #endif
7021 }
7022 return result;
7023 }
7024
7025 /* TupleAndListFromArray */
7026 #if CYTHON_COMPILING_IN_CPYTHON
7027 static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
7028 PyObject *v;
7029 Py_ssize_t i;
7030 for (i = 0; i < length; i++) {
7031 v = dest[i] = src[i];
7032 Py_INCREF(v);
7033 }
7034 }
7035 static CYTHON_INLINE PyObject *
7036 __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
7037 {
7038 PyObject *res;
7039 if (n <= 0) {
7040 Py_INCREF(__pyx_empty_tuple);
7041 return __pyx_empty_tuple;
7042 }
7043 res = PyTuple_New(n);
7044 if (unlikely(res == NULL)) return NULL;
7045 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
7046 return res;
7047 }
7048 static CYTHON_INLINE PyObject *
7049 __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
7050 {
7051 PyObject *res;
7052 if (n <= 0) {
7053 return PyList_New(0);
7054 }
7055 res = PyList_New(n);
7056 if (unlikely(res == NULL)) return NULL;
7057 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
7058 return res;
7059 }
7060 #endif
7061
7062 /* BytesEquals */
7063 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
7064 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
7065 return PyObject_RichCompareBool(s1, s2, equals);
7066 #else
7067 if (s1 == s2) {
7068 return (equals == Py_EQ);
7069 } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
7070 const char *ps1, *ps2;
7071 Py_ssize_t length = PyBytes_GET_SIZE(s1);
7072 if (length != PyBytes_GET_SIZE(s2))
7073 return (equals == Py_NE);
7074 ps1 = PyBytes_AS_STRING(s1);
7075 ps2 = PyBytes_AS_STRING(s2);
7076 if (ps1[0] != ps2[0]) {
7077 return (equals == Py_NE);
7078 } else if (length == 1) {
7079 return (equals == Py_EQ);
7080 } else {
7081 int result;
7082 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
7083 Py_hash_t hash1, hash2;
7084 hash1 = ((PyBytesObject*)s1)->ob_shash;
7085 hash2 = ((PyBytesObject*)s2)->ob_shash;
7086 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
7087 return (equals == Py_NE);
7088 }
7089 #endif
7090 result = memcmp(ps1, ps2, (size_t)length);
7091 return (equals == Py_EQ) ? (result == 0) : (result != 0);
7092 }
7093 } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
7094 return (equals == Py_NE);
7095 } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
7096 return (equals == Py_NE);
7097 } else {
7098 int result;
7099 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
7100 if (!py_result)
7101 return -1;
7102 result = __Pyx_PyObject_IsTrue(py_result);
7103 Py_DECREF(py_result);
7104 return result;
7105 }
7106 #endif
7107 }
7108
7109 /* UnicodeEquals */
7110 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
7111 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
7112 return PyObject_RichCompareBool(s1, s2, equals);
7113 #else
7114 #if PY_MAJOR_VERSION < 3
7115 PyObject* owned_ref = NULL;
7116 #endif
7117 int s1_is_unicode, s2_is_unicode;
7118 if (s1 == s2) {
7119 goto return_eq;
7120 }
7121 s1_is_unicode = PyUnicode_CheckExact(s1);
7122 s2_is_unicode = PyUnicode_CheckExact(s2);
7123 #if PY_MAJOR_VERSION < 3
7124 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
7125 owned_ref = PyUnicode_FromObject(s2);
7126 if (unlikely(!owned_ref))
7127 return -1;
7128 s2 = owned_ref;
7129 s2_is_unicode = 1;
7130 } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
7131 owned_ref = PyUnicode_FromObject(s1);
7132 if (unlikely(!owned_ref))
7133 return -1;
7134 s1 = owned_ref;
7135 s1_is_unicode = 1;
7136 } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
7137 return __Pyx_PyBytes_Equals(s1, s2, equals);
7138 }
7139 #endif
7140 if (s1_is_unicode & s2_is_unicode) {
7141 Py_ssize_t length;
7142 int kind;
7143 void *data1, *data2;
7144 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
7145 return -1;
7146 length = __Pyx_PyUnicode_GET_LENGTH(s1);
7147 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
7148 goto return_ne;
7149 }
7150 #if CYTHON_USE_UNICODE_INTERNALS
7151 {
7152 Py_hash_t hash1, hash2;
7153 #if CYTHON_PEP393_ENABLED
7154 hash1 = ((PyASCIIObject*)s1)->hash;
7155 hash2 = ((PyASCIIObject*)s2)->hash;
7156 #else
7157 hash1 = ((PyUnicodeObject*)s1)->hash;
7158 hash2 = ((PyUnicodeObject*)s2)->hash;
7159 #endif
7160 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
7161 goto return_ne;
7162 }
7163 }
7164 #endif
7165 kind = __Pyx_PyUnicode_KIND(s1);
7166 if (kind != __Pyx_PyUnicode_KIND(s2)) {
7167 goto return_ne;
7168 }
7169 data1 = __Pyx_PyUnicode_DATA(s1);
7170 data2 = __Pyx_PyUnicode_DATA(s2);
7171 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
7172 goto return_ne;
7173 } else if (length == 1) {
7174 goto return_eq;
7175 } else {
7176 int result = memcmp(data1, data2, (size_t)(length * kind));
7177 #if PY_MAJOR_VERSION < 3
7178 Py_XDECREF(owned_ref);
7179 #endif
7180 return (equals == Py_EQ) ? (result == 0) : (result != 0);
7181 }
7182 } else if ((s1 == Py_None) & s2_is_unicode) {
7183 goto return_ne;
7184 } else if ((s2 == Py_None) & s1_is_unicode) {
7185 goto return_ne;
7186 } else {
7187 int result;
7188 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
7189 #if PY_MAJOR_VERSION < 3
7190 Py_XDECREF(owned_ref);
7191 #endif
7192 if (!py_result)
7193 return -1;
7194 result = __Pyx_PyObject_IsTrue(py_result);
7195 Py_DECREF(py_result);
7196 return result;
7197 }
7198 return_eq:
7199 #if PY_MAJOR_VERSION < 3
7200 Py_XDECREF(owned_ref);
7201 #endif
7202 return (equals == Py_EQ);
7203 return_ne:
7204 #if PY_MAJOR_VERSION < 3
7205 Py_XDECREF(owned_ref);
7206 #endif
7207 return (equals == Py_NE);
7208 #endif
7209 }
7210
7211 /* fastcall */
7212 #if CYTHON_METH_FASTCALL
7213 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
7214 {
7215 Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
7216 for (i = 0; i < n; i++)
7217 {
7218 if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
7219 }
7220 for (i = 0; i < n; i++)
7221 {
7222 int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
7223 if (unlikely(eq != 0)) {
7224 if (unlikely(eq < 0)) return NULL;
7225 return kwvalues[i];
7226 }
7227 }
7228 return NULL;
7229 }
7230 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
7231 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
7232 Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
7233 PyObject *dict;
7234 dict = PyDict_New();
7235 if (unlikely(!dict))
7236 return NULL;
7237 for (i=0; i<nkwargs; i++) {
7238 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
7239 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
7240 goto bad;
7241 }
7242 return dict;
7243 bad:
7244 Py_DECREF(dict);
7245 return NULL;
7246 }
7247 #endif
7248 #endif
7249
7250 /* RaiseArgTupleInvalid */
7251 static void __Pyx_RaiseArgtupleInvalid(
7252 const char* func_name,
7253 int exact,
7254 Py_ssize_t num_min,
7255 Py_ssize_t num_max,
7256 Py_ssize_t num_found)
7257 {
7258 Py_ssize_t num_expected;
7259 const char *more_or_less;
7260 if (num_found < num_min) {
7261 num_expected = num_min;
7262 more_or_less = "at least";
7263 } else {
7264 num_expected = num_max;
7265 more_or_less = "at most";
7266 }
7267 if (exact) {
7268 more_or_less = "exactly";
7269 }
7270 PyErr_Format(PyExc_TypeError,
7271 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
7272 func_name, more_or_less, num_expected,
7273 (num_expected == 1) ? "" : "s", num_found);
7274 }
7275
7276 /* KeywordStringCheck */
7277 static int __Pyx_CheckKeywordStrings(
7278 PyObject *kw,
7279 const char* function_name,
7280 int kw_allowed)
7281 {
7282 PyObject* key = 0;
7283 Py_ssize_t pos = 0;
7284 #if CYTHON_COMPILING_IN_PYPY
7285 if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
7286 goto invalid_keyword;
7287 return 1;
7288 #else
7289 if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
7290 Py_ssize_t kwsize;
7291 #if CYTHON_ASSUME_SAFE_MACROS
7292 kwsize = PyTuple_GET_SIZE(kw);
7293 #else
7294 kwsize = PyTuple_Size(kw);
7295 if (kwsize < 0) return 0;
7296 #endif
7297 if (unlikely(kwsize == 0))
7298 return 1;
7299 if (!kw_allowed) {
7300 #if CYTHON_ASSUME_SAFE_MACROS
7301 key = PyTuple_GET_ITEM(kw, 0);
7302 #else
7303 key = PyTuple_GetItem(kw, pos);
7304 if (!key) return 0;
7305 #endif
7306 goto invalid_keyword;
7307 }
7308 #if PY_VERSION_HEX < 0x03090000
7309 for (pos = 0; pos < kwsize; pos++) {
7310 #if CYTHON_ASSUME_SAFE_MACROS
7311 key = PyTuple_GET_ITEM(kw, pos);
7312 #else
7313 key = PyTuple_GetItem(kw, pos);
7314 if (!key) return 0;
7315 #endif
7316 if (unlikely(!PyUnicode_Check(key)))
7317 goto invalid_keyword_type;
7318 }
7319 #endif
7320 return 1;
7321 }
7322 while (PyDict_Next(kw, &pos, &key, 0)) {
7323 #if PY_MAJOR_VERSION < 3
7324 if (unlikely(!PyString_Check(key)))
7325 #endif
7326 if (unlikely(!PyUnicode_Check(key)))
7327 goto invalid_keyword_type;
7328 }
7329 if (!kw_allowed && unlikely(key))
7330 goto invalid_keyword;
7331 return 1;
7332 invalid_keyword_type:
7333 PyErr_Format(PyExc_TypeError,
7334 "%.200s() keywords must be strings", function_name);
7335 return 0;
7336 #endif
7337 invalid_keyword:
7338 #if PY_MAJOR_VERSION < 3
7339 PyErr_Format(PyExc_TypeError,
7340 "%.200s() got an unexpected keyword argument '%.200s'",
7341 function_name, PyString_AsString(key));
7342 #else
7343 PyErr_Format(PyExc_TypeError,
7344 "%s() got an unexpected keyword argument '%U'",
7345 function_name, key);
7346 #endif
7347 return 0;
7348 }
7349
7350 /* Profile */
7351 #if CYTHON_PROFILE
7352 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
7353 PyFrameObject** frame,
7354 PyThreadState* tstate,
7355 const char *funcname,
7356 const char *srcfile,
7357 int firstlineno) {
7358 PyObject *type, *value, *traceback;
7359 int retval;
7360 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
7361 if (*code == NULL) {
7362 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
7363 if (*code == NULL) return 0;
7364 }
7365 *frame = PyFrame_New(
7366 tstate, /*PyThreadState *tstate*/
7367 *code, /*PyCodeObject *code*/
7368 __pyx_d, /*PyObject *globals*/
7369 0 /*PyObject *locals*/
7370 );
7371 if (*frame == NULL) return 0;
7372 if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
7373 Py_INCREF(Py_None);
7374 (*frame)->f_trace = Py_None;
7375 }
7376 #if PY_VERSION_HEX < 0x030400B1
7377 } else {
7378 (*frame)->f_tstate = tstate;
7379 #endif
7380 }
7381 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
7382 retval = 1;
7383 __Pyx_EnterTracing(tstate);
7384 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
7385 #if CYTHON_TRACE
7386 if (tstate->c_tracefunc)
7387 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
7388 if (retval && tstate->c_profilefunc)
7389 #endif
7390 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
7391 __Pyx_LeaveTracing(tstate);
7392 if (retval) {
7393 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
7394 return __Pyx_IsTracing(tstate, 0, 0) && retval;
7395 } else {
7396 Py_XDECREF(type);
7397 Py_XDECREF(value);
7398 Py_XDECREF(traceback);
7399 return -1;
7400 }
7401 }
7402 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
7403 PyCodeObject *py_code = 0;
7404 #if PY_MAJOR_VERSION >= 3
7405 py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
7406 if (likely(py_code)) {
7407 py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
7408 }
7409 #else
7410 PyObject *py_srcfile = 0;
7411 PyObject *py_funcname = 0;
7412 py_funcname = PyString_FromString(funcname);
7413 if (unlikely(!py_funcname)) goto bad;
7414 py_srcfile = PyString_FromString(srcfile);
7415 if (unlikely(!py_srcfile)) goto bad;
7416 py_code = PyCode_New(
7417 0,
7418 0,
7419 0,
7420 CO_OPTIMIZED | CO_NEWLOCALS,
7421 __pyx_empty_bytes, /*PyObject *code,*/
7422 __pyx_empty_tuple, /*PyObject *consts,*/
7423 __pyx_empty_tuple, /*PyObject *names,*/
7424 __pyx_empty_tuple, /*PyObject *varnames,*/
7425 __pyx_empty_tuple, /*PyObject *freevars,*/
7426 __pyx_empty_tuple, /*PyObject *cellvars,*/
7427 py_srcfile, /*PyObject *filename,*/
7428 py_funcname, /*PyObject *name,*/
7429 firstlineno,
7430 __pyx_empty_bytes /*PyObject *lnotab*/
7431 );
7432 bad:
7433 Py_XDECREF(py_srcfile);
7434 Py_XDECREF(py_funcname);
7435 #endif
7436 return py_code;
7437 }
7438 #endif
7439
7440 /* RaiseException */
7441 #if PY_MAJOR_VERSION < 3
7442 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
7443 __Pyx_PyThreadState_declare
7444 CYTHON_UNUSED_VAR(cause);
7445 Py_XINCREF(type);
7446 if (!value || value == Py_None)
7447 value = NULL;
7448 else
7449 Py_INCREF(value);
7450 if (!tb || tb == Py_None)
7451 tb = NULL;
7452 else {
7453 Py_INCREF(tb);
7454 if (!PyTraceBack_Check(tb)) {
7455 PyErr_SetString(PyExc_TypeError,
7456 "raise: arg 3 must be a traceback or None");
7457 goto raise_error;
7458 }
7459 }
7460 if (PyType_Check(type)) {
7461 #if CYTHON_COMPILING_IN_PYPY
7462 if (!value) {
7463 Py_INCREF(Py_None);
7464 value = Py_None;
7465 }
7466 #endif
7467 PyErr_NormalizeException(&type, &value, &tb);
7468 } else {
7469 if (value) {
7470 PyErr_SetString(PyExc_TypeError,
7471 "instance exception may not have a separate value");
7472 goto raise_error;
7473 }
7474 value = type;
7475 type = (PyObject*) Py_TYPE(type);
7476 Py_INCREF(type);
7477 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
7478 PyErr_SetString(PyExc_TypeError,
7479 "raise: exception class must be a subclass of BaseException");
7480 goto raise_error;
7481 }
7482 }
7483 __Pyx_PyThreadState_assign
7484 __Pyx_ErrRestore(type, value, tb);
7485 return;
7486 raise_error:
7487 Py_XDECREF(value);
7488 Py_XDECREF(type);
7489 Py_XDECREF(tb);
7490 return;
7491 }
7492 #else
7493 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
7494 PyObject* owned_instance = NULL;
7495 if (tb == Py_None) {
7496 tb = 0;
7497 } else if (tb && !PyTraceBack_Check(tb)) {
7498 PyErr_SetString(PyExc_TypeError,
7499 "raise: arg 3 must be a traceback or None");
7500 goto bad;
7501 }
7502 if (value == Py_None)
7503 value = 0;
7504 if (PyExceptionInstance_Check(type)) {
7505 if (value) {
7506 PyErr_SetString(PyExc_TypeError,
7507 "instance exception may not have a separate value");
7508 goto bad;
7509 }
7510 value = type;
7511 type = (PyObject*) Py_TYPE(value);
7512 } else if (PyExceptionClass_Check(type)) {
7513 PyObject *instance_class = NULL;
7514 if (value && PyExceptionInstance_Check(value)) {
7515 instance_class = (PyObject*) Py_TYPE(value);
7516 if (instance_class != type) {
7517 int is_subclass = PyObject_IsSubclass(instance_class, type);
7518 if (!is_subclass) {
7519 instance_class = NULL;
7520 } else if (unlikely(is_subclass == -1)) {
7521 goto bad;
7522 } else {
7523 type = instance_class;
7524 }
7525 }
7526 }
7527 if (!instance_class) {
7528 PyObject *args;
7529 if (!value)
7530 args = PyTuple_New(0);
7531 else if (PyTuple_Check(value)) {
7532 Py_INCREF(value);
7533 args = value;
7534 } else
7535 args = PyTuple_Pack(1, value);
7536 if (!args)
7537 goto bad;
7538 owned_instance = PyObject_Call(type, args, NULL);
7539 Py_DECREF(args);
7540 if (!owned_instance)
7541 goto bad;
7542 value = owned_instance;
7543 if (!PyExceptionInstance_Check(value)) {
7544 PyErr_Format(PyExc_TypeError,
7545 "calling %R should have returned an instance of "
7546 "BaseException, not %R",
7547 type, Py_TYPE(value));
7548 goto bad;
7549 }
7550 }
7551 } else {
7552 PyErr_SetString(PyExc_TypeError,
7553 "raise: exception class must be a subclass of BaseException");
7554 goto bad;
7555 }
7556 if (cause) {
7557 PyObject *fixed_cause;
7558 if (cause == Py_None) {
7559 fixed_cause = NULL;
7560 } else if (PyExceptionClass_Check(cause)) {
7561 fixed_cause = PyObject_CallObject(cause, NULL);
7562 if (fixed_cause == NULL)
7563 goto bad;
7564 } else if (PyExceptionInstance_Check(cause)) {
7565 fixed_cause = cause;
7566 Py_INCREF(fixed_cause);
7567 } else {
7568 PyErr_SetString(PyExc_TypeError,
7569 "exception causes must derive from "
7570 "BaseException");
7571 goto bad;
7572 }
7573 PyException_SetCause(value, fixed_cause);
7574 }
7575 PyErr_SetObject(type, value);
7576 if (tb) {
7577 #if PY_VERSION_HEX >= 0x030C00A6
7578 PyException_SetTraceback(value, tb);
7579 #elif CYTHON_FAST_THREAD_STATE
7580 PyThreadState *tstate = __Pyx_PyThreadState_Current;
7581 PyObject* tmp_tb = tstate->curexc_traceback;
7582 if (tb != tmp_tb) {
7583 Py_INCREF(tb);
7584 tstate->curexc_traceback = tb;
7585 Py_XDECREF(tmp_tb);
7586 }
7587 #else
7588 PyObject *tmp_type, *tmp_value, *tmp_tb;
7589 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
7590 Py_INCREF(tb);
7591 PyErr_Restore(tmp_type, tmp_value, tb);
7592 Py_XDECREF(tmp_tb);
7593 #endif
7594 }
7595 bad:
7596 Py_XDECREF(owned_instance);
7597 return;
7598 }
7599 #endif
7600
7601 /* RaiseDoubleKeywords */
7602 static void __Pyx_RaiseDoubleKeywordsError(
7603 const char* func_name,
7604 PyObject* kw_name)
7605 {
7606 PyErr_Format(PyExc_TypeError,
7607 #if PY_MAJOR_VERSION >= 3
7608 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
7609 #else
7610 "%s() got multiple values for keyword argument '%s'", func_name,
7611 PyString_AsString(kw_name));
7612 #endif
7613 }
7614
7615 /* ParseKeywords */
7616 static int __Pyx_ParseOptionalKeywords(
7617 PyObject *kwds,
7618 PyObject *const *kwvalues,
7619 PyObject **argnames[],
7620 PyObject *kwds2,
7621 PyObject *values[],
7622 Py_ssize_t num_pos_args,
7623 const char* function_name)
7624 {
7625 PyObject *key = 0, *value = 0;
7626 Py_ssize_t pos = 0;
7627 PyObject*** name;
7628 PyObject*** first_kw_arg = argnames + num_pos_args;
7629 int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
7630 while (1) {
7631 Py_XDECREF(key); key = NULL;
7632 Py_XDECREF(value); value = NULL;
7633 if (kwds_is_tuple) {
7634 Py_ssize_t size;
7635 #if CYTHON_ASSUME_SAFE_MACROS
7636 size = PyTuple_GET_SIZE(kwds);
7637 #else
7638 size = PyTuple_Size(kwds);
7639 if (size < 0) goto bad;
7640 #endif
7641 if (pos >= size) break;
7642 #if CYTHON_AVOID_BORROWED_REFS
7643 key = __Pyx_PySequence_ITEM(kwds, pos);
7644 if (!key) goto bad;
7645 #elif CYTHON_ASSUME_SAFE_MACROS
7646 key = PyTuple_GET_ITEM(kwds, pos);
7647 #else
7648 key = PyTuple_GetItem(kwds, pos);
7649 if (!key) goto bad;
7650 #endif
7651 value = kwvalues[pos];
7652 pos++;
7653 }
7654 else
7655 {
7656 if (!PyDict_Next(kwds, &pos, &key, &value)) break;
7657 #if CYTHON_AVOID_BORROWED_REFS
7658 Py_INCREF(key);
7659 #endif
7660 }
7661 name = first_kw_arg;
7662 while (*name && (**name != key)) name++;
7663 if (*name) {
7664 values[name-argnames] = value;
7665 #if CYTHON_AVOID_BORROWED_REFS
7666 Py_INCREF(value);
7667 Py_DECREF(key);
7668 #endif
7669 key = NULL;
7670 value = NULL;
7671 continue;
7672 }
7673 #if !CYTHON_AVOID_BORROWED_REFS
7674 Py_INCREF(key);
7675 #endif
7676 Py_INCREF(value);
7677 name = first_kw_arg;
7678 #if PY_MAJOR_VERSION < 3
7679 if (likely(PyString_Check(key))) {
7680 while (*name) {
7681 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
7682 && _PyString_Eq(**name, key)) {
7683 values[name-argnames] = value;
7684 #if CYTHON_AVOID_BORROWED_REFS
7685 value = NULL;
7686 #endif
7687 break;
7688 }
7689 name++;
7690 }
7691 if (*name) continue;
7692 else {
7693 PyObject*** argname = argnames;
7694 while (argname != first_kw_arg) {
7695 if ((**argname == key) || (
7696 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
7697 && _PyString_Eq(**argname, key))) {
7698 goto arg_passed_twice;
7699 }
7700 argname++;
7701 }
7702 }
7703 } else
7704 #endif
7705 if (likely(PyUnicode_Check(key))) {
7706 while (*name) {
7707 int cmp = (
7708 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
7709 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
7710 #endif
7711 PyUnicode_Compare(**name, key)
7712 );
7713 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
7714 if (cmp == 0) {
7715 values[name-argnames] = value;
7716 #if CYTHON_AVOID_BORROWED_REFS
7717 value = NULL;
7718 #endif
7719 break;
7720 }
7721 name++;
7722 }
7723 if (*name) continue;
7724 else {
7725 PyObject*** argname = argnames;
7726 while (argname != first_kw_arg) {
7727 int cmp = (**argname == key) ? 0 :
7728 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
7729 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
7730 #endif
7731 PyUnicode_Compare(**argname, key);
7732 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
7733 if (cmp == 0) goto arg_passed_twice;
7734 argname++;
7735 }
7736 }
7737 } else
7738 goto invalid_keyword_type;
7739 if (kwds2) {
7740 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
7741 } else {
7742 goto invalid_keyword;
7743 }
7744 }
7745 Py_XDECREF(key);
7746 Py_XDECREF(value);
7747 return 0;
7748 arg_passed_twice:
7749 __Pyx_RaiseDoubleKeywordsError(function_name, key);
7750 goto bad;
7751 invalid_keyword_type:
7752 PyErr_Format(PyExc_TypeError,
7753 "%.200s() keywords must be strings", function_name);
7754 goto bad;
7755 invalid_keyword:
7756 #if PY_MAJOR_VERSION < 3
7757 PyErr_Format(PyExc_TypeError,
7758 "%.200s() got an unexpected keyword argument '%.200s'",
7759 function_name, PyString_AsString(key));
7760 #else
7761 PyErr_Format(PyExc_TypeError,
7762 "%s() got an unexpected keyword argument '%U'",
7763 function_name, key);
7764 #endif
7765 bad:
7766 Py_XDECREF(key);
7767 Py_XDECREF(value);
7768 return -1;
7769 }
7770
7771 /* CallNextTpTraverse */
7772 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
7773 PyTypeObject* type = Py_TYPE(obj);
7774 traverseproc tp_traverse = NULL;
7775 while (type && __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc) != current_tp_traverse)
7776 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
7777 while (type && (tp_traverse = __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc)) == current_tp_traverse)
7778 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
7779 if (type && tp_traverse)
7780 return tp_traverse(obj, v, a);
7781 return 0;
7782 }
7783
7784 /* CallNextTpClear */
7785 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
7786 PyTypeObject* type = Py_TYPE(obj);
7787 inquiry tp_clear = NULL;
7788 while (type && __Pyx_PyType_GetSlot(type, tp_clear, inquiry) != current_tp_clear)
7789 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
7790 while (type && (tp_clear = __Pyx_PyType_GetSlot(type, tp_clear, inquiry)) == current_tp_clear)
7791 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
7792 if (type && tp_clear)
7793 tp_clear(obj);
7794 }
7795
7796 /* TypeImport */
7797 #ifndef __PYX_HAVE_RT_ImportType_3_0_11
7798 #define __PYX_HAVE_RT_ImportType_3_0_11
7799 static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name,
7800 size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size)
7801 {
7802 PyObject *result = 0;
7803 char warning[200];
7804 Py_ssize_t basicsize;
7805 Py_ssize_t itemsize;
7806 #if CYTHON_COMPILING_IN_LIMITED_API
7807 PyObject *py_basicsize;
7808 PyObject *py_itemsize;
7809 #endif
7810 result = PyObject_GetAttrString(module, class_name);
7811 if (!result)
7812 goto bad;
7813 if (!PyType_Check(result)) {
7814 PyErr_Format(PyExc_TypeError,
7815 "%.200s.%.200s is not a type object",
7816 module_name, class_name);
7817 goto bad;
7818 }
7819 #if !CYTHON_COMPILING_IN_LIMITED_API
7820 basicsize = ((PyTypeObject *)result)->tp_basicsize;
7821 itemsize = ((PyTypeObject *)result)->tp_itemsize;
7822 #else
7823 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
7824 if (!py_basicsize)
7825 goto bad;
7826 basicsize = PyLong_AsSsize_t(py_basicsize);
7827 Py_DECREF(py_basicsize);
7828 py_basicsize = 0;
7829 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
7830 goto bad;
7831 py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
7832 if (!py_itemsize)
7833 goto bad;
7834 itemsize = PyLong_AsSsize_t(py_itemsize);
7835 Py_DECREF(py_itemsize);
7836 py_itemsize = 0;
7837 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
7838 goto bad;
7839 #endif
7840 if (itemsize) {
7841 if (size % alignment) {
7842 alignment = size % alignment;
7843 }
7844 if (itemsize < (Py_ssize_t)alignment)
7845 itemsize = (Py_ssize_t)alignment;
7846 }
7847 if ((size_t)(basicsize + itemsize) < size) {
7848 PyErr_Format(PyExc_ValueError,
7849 "%.200s.%.200s size changed, may indicate binary incompatibility. "
7850 "Expected %zd from C header, got %zd from PyObject",
7851 module_name, class_name, size, basicsize+itemsize);
7852 goto bad;
7853 }
7854 if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 &&
7855 ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
7856 PyErr_Format(PyExc_ValueError,
7857 "%.200s.%.200s size changed, may indicate binary incompatibility. "
7858 "Expected %zd from C header, got %zd-%zd from PyObject",
7859 module_name, class_name, size, basicsize, basicsize+itemsize);
7860 goto bad;
7861 }
7862 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) {
7863 PyOS_snprintf(warning, sizeof(warning),
7864 "%s.%s size changed, may indicate binary incompatibility. "
7865 "Expected %zd from C header, got %zd from PyObject",
7866 module_name, class_name, size, basicsize);
7867 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
7868 }
7869 return (PyTypeObject *)result;
7870 bad:
7871 Py_XDECREF(result);
7872 return NULL;
7873 }
7874 #endif
7875
7876 /* GetVTable */
7877 static void* __Pyx_GetVtable(PyTypeObject *type) {
7878 void* ptr;
7879 #if CYTHON_COMPILING_IN_LIMITED_API
7880 PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
7881 #else
7882 PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
7883 #endif
7884 if (!ob)
7885 goto bad;
7886 ptr = PyCapsule_GetPointer(ob, 0);
7887 if (!ptr && !PyErr_Occurred())
7888 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
7889 Py_DECREF(ob);
7890 return ptr;
7891 bad:
7892 Py_XDECREF(ob);
7893 return NULL;
7894 }
7895
7896 /* FixUpExtensionType */
7897 #if CYTHON_USE_TYPE_SPECS
7898 static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
7899 #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
7900 CYTHON_UNUSED_VAR(spec);
7901 CYTHON_UNUSED_VAR(type);
7902 #else
7903 const PyType_Slot *slot = spec->slots;
7904 while (slot && slot->slot && slot->slot != Py_tp_members)
7905 slot++;
7906 if (slot && slot->slot == Py_tp_members) {
7907 int changed = 0;
7908 #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
7909 const
7910 #endif
7911 PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
7912 while (memb && memb->name) {
7913 if (memb->name[0] == '_' && memb->name[1] == '_') {
7914 #if PY_VERSION_HEX < 0x030900b1
7915 if (strcmp(memb->name, "__weaklistoffset__") == 0) {
7916 assert(memb->type == T_PYSSIZET);
7917 assert(memb->flags == READONLY);
7918 type->tp_weaklistoffset = memb->offset;
7919 changed = 1;
7920 }
7921 else if (strcmp(memb->name, "__dictoffset__") == 0) {
7922 assert(memb->type == T_PYSSIZET);
7923 assert(memb->flags == READONLY);
7924 type->tp_dictoffset = memb->offset;
7925 changed = 1;
7926 }
7927 #if CYTHON_METH_FASTCALL
7928 else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
7929 assert(memb->type == T_PYSSIZET);
7930 assert(memb->flags == READONLY);
7931 #if PY_VERSION_HEX >= 0x030800b4
7932 type->tp_vectorcall_offset = memb->offset;
7933 #else
7934 type->tp_print = (printfunc) memb->offset;
7935 #endif
7936 changed = 1;
7937 }
7938 #endif
7939 #else
7940 if ((0));
7941 #endif
7942 #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
7943 else if (strcmp(memb->name, "__module__") == 0) {
7944 PyObject *descr;
7945 assert(memb->type == T_OBJECT);
7946 assert(memb->flags == 0 || memb->flags == READONLY);
7947 descr = PyDescr_NewMember(type, memb);
7948 if (unlikely(!descr))
7949 return -1;
7950 if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
7951 Py_DECREF(descr);
7952 return -1;
7953 }
7954 Py_DECREF(descr);
7955 changed = 1;
7956 }
7957 #endif
7958 }
7959 memb++;
7960 }
7961 if (changed)
7962 PyType_Modified(type);
7963 }
7964 #endif
7965 return 0;
7966 }
7967 #endif
7968
7969 /* PyFunctionFastCall */
7970 #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
7971 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
7972 PyObject *globals) {
7973 PyFrameObject *f;
7974 PyThreadState *tstate = __Pyx_PyThreadState_Current;
7975 PyObject **fastlocals;
7976 Py_ssize_t i;
7977 PyObject *result;
7978 assert(globals != NULL);
7979 /* XXX Perhaps we should create a specialized
7980 PyFrame_New() that doesn't take locals, but does
7981 take builtins without sanity checking them.
7982 */
7983 assert(tstate != NULL);
7984 f = PyFrame_New(tstate, co, globals, NULL);
7985 if (f == NULL) {
7986 return NULL;
7987 }
7988 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
7989 for (i = 0; i < na; i++) {
7990 Py_INCREF(*args);
7991 fastlocals[i] = *args++;
7992 }
7993 result = PyEval_EvalFrameEx(f,0);
7994 ++tstate->recursion_depth;
7995 Py_DECREF(f);
7996 --tstate->recursion_depth;
7997 return result;
7998 }
7999 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
8000 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
8001 PyObject *globals = PyFunction_GET_GLOBALS(func);
8002 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
8003 PyObject *closure;
8004 #if PY_MAJOR_VERSION >= 3
8005 PyObject *kwdefs;
8006 #endif
8007 PyObject *kwtuple, **k;
8008 PyObject **d;
8009 Py_ssize_t nd;
8010 Py_ssize_t nk;
8011 PyObject *result;
8012 assert(kwargs == NULL || PyDict_Check(kwargs));
8013 nk = kwargs ? PyDict_Size(kwargs) : 0;
8014 #if PY_MAJOR_VERSION < 3
8015 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
8016 return NULL;
8017 }
8018 #else
8019 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
8020 return NULL;
8021 }
8022 #endif
8023 if (
8024 #if PY_MAJOR_VERSION >= 3
8025 co->co_kwonlyargcount == 0 &&
8026 #endif
8027 likely(kwargs == NULL || nk == 0) &&
8028 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
8029 if (argdefs == NULL && co->co_argcount == nargs) {
8030 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
8031 goto done;
8032 }
8033 else if (nargs == 0 && argdefs != NULL
8034 && co->co_argcount == Py_SIZE(argdefs)) {
8035 /* function called with no arguments, but all parameters have
8036 a default value: use default values as arguments .*/
8037 args = &PyTuple_GET_ITEM(argdefs, 0);
8038 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
8039 goto done;
8040 }
8041 }
8042 if (kwargs != NULL) {
8043 Py_ssize_t pos, i;
8044 kwtuple = PyTuple_New(2 * nk);
8045 if (kwtuple == NULL) {
8046 result = NULL;
8047 goto done;
8048 }
8049 k = &PyTuple_GET_ITEM(kwtuple, 0);
8050 pos = i = 0;
8051 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
8052 Py_INCREF(k[i]);
8053 Py_INCREF(k[i+1]);
8054 i += 2;
8055 }
8056 nk = i / 2;
8057 }
8058 else {
8059 kwtuple = NULL;
8060 k = NULL;
8061 }
8062 closure = PyFunction_GET_CLOSURE(func);
8063 #if PY_MAJOR_VERSION >= 3
8064 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
8065 #endif
8066 if (argdefs != NULL) {
8067 d = &PyTuple_GET_ITEM(argdefs, 0);
8068 nd = Py_SIZE(argdefs);
8069 }
8070 else {
8071 d = NULL;
8072 nd = 0;
8073 }
8074 #if PY_MAJOR_VERSION >= 3
8075 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
8076 args, (int)nargs,
8077 k, (int)nk,
8078 d, (int)nd, kwdefs, closure);
8079 #else
8080 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
8081 args, (int)nargs,
8082 k, (int)nk,
8083 d, (int)nd, closure);
8084 #endif
8085 Py_XDECREF(kwtuple);
8086 done:
8087 Py_LeaveRecursiveCall();
8088 return result;
8089 }
8090 #endif
8091
8092 /* PyObjectCall */
8093 #if CYTHON_COMPILING_IN_CPYTHON
8094 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
8095 PyObject *result;
8096 ternaryfunc call = Py_TYPE(func)->tp_call;
8097 if (unlikely(!call))
8098 return PyObject_Call(func, arg, kw);
8099 #if PY_MAJOR_VERSION < 3
8100 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
8101 return NULL;
8102 #else
8103 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
8104 return NULL;
8105 #endif
8106 result = (*call)(func, arg, kw);
8107 Py_LeaveRecursiveCall();
8108 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
8109 PyErr_SetString(
8110 PyExc_SystemError,
8111 "NULL result without error in PyObject_Call");
8112 }
8113 return result;
8114 }
8115 #endif
8116
8117 /* PyObjectCallMethO */
8118 #if CYTHON_COMPILING_IN_CPYTHON
8119 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
8120 PyObject *self, *result;
8121 PyCFunction cfunc;
8122 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
8123 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
8124 #if PY_MAJOR_VERSION < 3
8125 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
8126 return NULL;
8127 #else
8128 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
8129 return NULL;
8130 #endif
8131 result = cfunc(self, arg);
8132 Py_LeaveRecursiveCall();
8133 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
8134 PyErr_SetString(
8135 PyExc_SystemError,
8136 "NULL result without error in PyObject_Call");
8137 }
8138 return result;
8139 }
8140 #endif
8141
8142 /* PyObjectFastCall */
8143 #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
8144 static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
8145 PyObject *argstuple;
8146 PyObject *result = 0;
8147 size_t i;
8148 argstuple = PyTuple_New((Py_ssize_t)nargs);
8149 if (unlikely(!argstuple)) return NULL;
8150 for (i = 0; i < nargs; i++) {
8151 Py_INCREF(args[i]);
8152 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
8153 }
8154 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
8155 bad:
8156 Py_DECREF(argstuple);
8157 return result;
8158 }
8159 #endif
8160 static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
8161 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
8162 #if CYTHON_COMPILING_IN_CPYTHON
8163 if (nargs == 0 && kwargs == NULL) {
8164 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
8165 return __Pyx_PyObject_CallMethO(func, NULL);
8166 }
8167 else if (nargs == 1 && kwargs == NULL) {
8168 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
8169 return __Pyx_PyObject_CallMethO(func, args[0]);
8170 }
8171 #endif
8172 #if PY_VERSION_HEX < 0x030800B1
8173 #if CYTHON_FAST_PYCCALL
8174 if (PyCFunction_Check(func)) {
8175 if (kwargs) {
8176 return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
8177 } else {
8178 return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
8179 }
8180 }
8181 #if PY_VERSION_HEX >= 0x030700A1
8182 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
8183 return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
8184 }
8185 #endif
8186 #endif
8187 #if CYTHON_FAST_PYCALL
8188 if (PyFunction_Check(func)) {
8189 return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
8190 }
8191 #endif
8192 #endif
8193 if (kwargs == NULL) {
8194 #if CYTHON_VECTORCALL
8195 #if PY_VERSION_HEX < 0x03090000
8196 vectorcallfunc f = _PyVectorcall_Function(func);
8197 #else
8198 vectorcallfunc f = PyVectorcall_Function(func);
8199 #endif
8200 if (f) {
8201 return f(func, args, (size_t)nargs, NULL);
8202 }
8203 #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
8204 if (__Pyx_CyFunction_CheckExact(func)) {
8205 __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
8206 if (f) return f(func, args, (size_t)nargs, NULL);
8207 }
8208 #endif
8209 }
8210 if (nargs == 0) {
8211 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
8212 }
8213 #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
8214 return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
8215 #else
8216 return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
8217 #endif
8218 }
8219
8220 /* PyObjectCallNoArg */
8221 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
8222 PyObject *arg[2] = {NULL, NULL};
8223 return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
8224 }
8225
8226 /* PyObjectCallOneArg */
8227 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
8228 PyObject *args[2] = {NULL, arg};
8229 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
8230 }
8231
8232 /* PyObjectGetMethod */
8233 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
8234 PyObject *attr;
8235 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
8236 __Pyx_TypeName type_name;
8237 PyTypeObject *tp = Py_TYPE(obj);
8238 PyObject *descr;
8239 descrgetfunc f = NULL;
8240 PyObject **dictptr, *dict;
8241 int meth_found = 0;
8242 assert (*method == NULL);
8243 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
8244 attr = __Pyx_PyObject_GetAttrStr(obj, name);
8245 goto try_unpack;
8246 }
8247 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
8248 return 0;
8249 }
8250 descr = _PyType_Lookup(tp, name);
8251 if (likely(descr != NULL)) {
8252 Py_INCREF(descr);
8253 #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
8254 if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
8255 #elif PY_MAJOR_VERSION >= 3
8256 #ifdef __Pyx_CyFunction_USED
8257 if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
8258 #else
8259 if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
8260 #endif
8261 #else
8262 #ifdef __Pyx_CyFunction_USED
8263 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
8264 #else
8265 if (likely(PyFunction_Check(descr)))
8266 #endif
8267 #endif
8268 {
8269 meth_found = 1;
8270 } else {
8271 f = Py_TYPE(descr)->tp_descr_get;
8272 if (f != NULL && PyDescr_IsData(descr)) {
8273 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
8274 Py_DECREF(descr);
8275 goto try_unpack;
8276 }
8277 }
8278 }
8279 dictptr = _PyObject_GetDictPtr(obj);
8280 if (dictptr != NULL && (dict = *dictptr) != NULL) {
8281 Py_INCREF(dict);
8282 attr = __Pyx_PyDict_GetItemStr(dict, name);
8283 if (attr != NULL) {
8284 Py_INCREF(attr);
8285 Py_DECREF(dict);
8286 Py_XDECREF(descr);
8287 goto try_unpack;
8288 }
8289 Py_DECREF(dict);
8290 }
8291 if (meth_found) {
8292 *method = descr;
8293 return 1;
8294 }
8295 if (f != NULL) {
8296 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
8297 Py_DECREF(descr);
8298 goto try_unpack;
8299 }
8300 if (likely(descr != NULL)) {
8301 *method = descr;
8302 return 0;
8303 }
8304 type_name = __Pyx_PyType_GetName(tp);
8305 PyErr_Format(PyExc_AttributeError,
8306 #if PY_MAJOR_VERSION >= 3
8307 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
8308 type_name, name);
8309 #else
8310 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
8311 type_name, PyString_AS_STRING(name));
8312 #endif
8313 __Pyx_DECREF_TypeName(type_name);
8314 return 0;
8315 #else
8316 attr = __Pyx_PyObject_GetAttrStr(obj, name);
8317 goto try_unpack;
8318 #endif
8319 try_unpack:
8320 #if CYTHON_UNPACK_METHODS
8321 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
8322 PyObject *function = PyMethod_GET_FUNCTION(attr);
8323 Py_INCREF(function);
8324 Py_DECREF(attr);
8325 *method = function;
8326 return 1;
8327 }
8328 #endif
8329 *method = attr;
8330 return 0;
8331 }
8332
8333 /* PyObjectCallMethod0 */
8334 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
8335 PyObject *method = NULL, *result = NULL;
8336 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
8337 if (likely(is_method)) {
8338 result = __Pyx_PyObject_CallOneArg(method, obj);
8339 Py_DECREF(method);
8340 return result;
8341 }
8342 if (unlikely(!method)) goto bad;
8343 result = __Pyx_PyObject_CallNoArg(method);
8344 Py_DECREF(method);
8345 bad:
8346 return result;
8347 }
8348
8349 /* ValidateBasesTuple */
8350 #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
8351 static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
8352 Py_ssize_t i, n;
8353 #if CYTHON_ASSUME_SAFE_MACROS
8354 n = PyTuple_GET_SIZE(bases);
8355 #else
8356 n = PyTuple_Size(bases);
8357 if (n < 0) return -1;
8358 #endif
8359 for (i = 1; i < n; i++)
8360 {
8361 #if CYTHON_AVOID_BORROWED_REFS
8362 PyObject *b0 = PySequence_GetItem(bases, i);
8363 if (!b0) return -1;
8364 #elif CYTHON_ASSUME_SAFE_MACROS
8365 PyObject *b0 = PyTuple_GET_ITEM(bases, i);
8366 #else
8367 PyObject *b0 = PyTuple_GetItem(bases, i);
8368 if (!b0) return -1;
8369 #endif
8370 PyTypeObject *b;
8371 #if PY_MAJOR_VERSION < 3
8372 if (PyClass_Check(b0))
8373 {
8374 PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
8375 PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
8376 #if CYTHON_AVOID_BORROWED_REFS
8377 Py_DECREF(b0);
8378 #endif
8379 return -1;
8380 }
8381 #endif
8382 b = (PyTypeObject*) b0;
8383 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
8384 {
8385 __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
8386 PyErr_Format(PyExc_TypeError,
8387 "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
8388 __Pyx_DECREF_TypeName(b_name);
8389 #if CYTHON_AVOID_BORROWED_REFS
8390 Py_DECREF(b0);
8391 #endif
8392 return -1;
8393 }
8394 if (dictoffset == 0)
8395 {
8396 Py_ssize_t b_dictoffset = 0;
8397 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
8398 b_dictoffset = b->tp_dictoffset;
8399 #else
8400 PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
8401 if (!py_b_dictoffset) goto dictoffset_return;
8402 b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
8403 Py_DECREF(py_b_dictoffset);
8404 if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
8405 #endif
8406 if (b_dictoffset) {
8407 {
8408 __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
8409 PyErr_Format(PyExc_TypeError,
8410 "extension type '%.200s' has no __dict__ slot, "
8411 "but base type '" __Pyx_FMT_TYPENAME "' has: "
8412 "either add 'cdef dict __dict__' to the extension type "
8413 "or add '__slots__ = [...]' to the base type",
8414 type_name, b_name);
8415 __Pyx_DECREF_TypeName(b_name);
8416 }
8417 #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
8418 dictoffset_return:
8419 #endif
8420 #if CYTHON_AVOID_BORROWED_REFS
8421 Py_DECREF(b0);
8422 #endif
8423 return -1;
8424 }
8425 }
8426 #if CYTHON_AVOID_BORROWED_REFS
8427 Py_DECREF(b0);
8428 #endif
8429 }
8430 return 0;
8431 }
8432 #endif
8433
8434 /* PyType_Ready */
8435 static int __Pyx_PyType_Ready(PyTypeObject *t) {
8436 #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
8437 (void)__Pyx_PyObject_CallMethod0;
8438 #if CYTHON_USE_TYPE_SPECS
8439 (void)__Pyx_validate_bases_tuple;
8440 #endif
8441 return PyType_Ready(t);
8442 #else
8443 int r;
8444 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
8445 if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
8446 return -1;
8447 #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
8448 {
8449 int gc_was_enabled;
8450 #if PY_VERSION_HEX >= 0x030A00b1
8451 gc_was_enabled = PyGC_Disable();
8452 (void)__Pyx_PyObject_CallMethod0;
8453 #else
8454 PyObject *ret, *py_status;
8455 PyObject *gc = NULL;
8456 #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
8457 gc = PyImport_GetModule(__pyx_kp_u_gc);
8458 #endif
8459 if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
8460 if (unlikely(!gc)) return -1;
8461 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
8462 if (unlikely(!py_status)) {
8463 Py_DECREF(gc);
8464 return -1;
8465 }
8466 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
8467 Py_DECREF(py_status);
8468 if (gc_was_enabled > 0) {
8469 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
8470 if (unlikely(!ret)) {
8471 Py_DECREF(gc);
8472 return -1;
8473 }
8474 Py_DECREF(ret);
8475 } else if (unlikely(gc_was_enabled == -1)) {
8476 Py_DECREF(gc);
8477 return -1;
8478 }
8479 #endif
8480 t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
8481 #if PY_VERSION_HEX >= 0x030A0000
8482 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
8483 #endif
8484 #else
8485 (void)__Pyx_PyObject_CallMethod0;
8486 #endif
8487 r = PyType_Ready(t);
8488 #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
8489 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
8490 #if PY_VERSION_HEX >= 0x030A00b1
8491 if (gc_was_enabled)
8492 PyGC_Enable();
8493 #else
8494 if (gc_was_enabled) {
8495 PyObject *tp, *v, *tb;
8496 PyErr_Fetch(&tp, &v, &tb);
8497 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
8498 if (likely(ret || r == -1)) {
8499 Py_XDECREF(ret);
8500 PyErr_Restore(tp, v, tb);
8501 } else {
8502 Py_XDECREF(tp);
8503 Py_XDECREF(v);
8504 Py_XDECREF(tb);
8505 r = -1;
8506 }
8507 }
8508 Py_DECREF(gc);
8509 #endif
8510 }
8511 #endif
8512 return r;
8513 #endif
8514 }
8515
8516 /* PyObject_GenericGetAttrNoDict */
8517 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
8518 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
8519 __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
8520 PyErr_Format(PyExc_AttributeError,
8521 #if PY_MAJOR_VERSION >= 3
8522 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
8523 type_name, attr_name);
8524 #else
8525 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
8526 type_name, PyString_AS_STRING(attr_name));
8527 #endif
8528 __Pyx_DECREF_TypeName(type_name);
8529 return NULL;
8530 }
8531 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
8532 PyObject *descr;
8533 PyTypeObject *tp = Py_TYPE(obj);
8534 if (unlikely(!PyString_Check(attr_name))) {
8535 return PyObject_GenericGetAttr(obj, attr_name);
8536 }
8537 assert(!tp->tp_dictoffset);
8538 descr = _PyType_Lookup(tp, attr_name);
8539 if (unlikely(!descr)) {
8540 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
8541 }
8542 Py_INCREF(descr);
8543 #if PY_MAJOR_VERSION < 3
8544 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
8545 #endif
8546 {
8547 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
8548 if (unlikely(f)) {
8549 PyObject *res = f(descr, obj, (PyObject *)tp);
8550 Py_DECREF(descr);
8551 return res;
8552 }
8553 }
8554 return descr;
8555 }
8556 #endif
8557
8558 /* PyObject_GenericGetAttr */
8559 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
8560 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
8561 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
8562 return PyObject_GenericGetAttr(obj, attr_name);
8563 }
8564 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
8565 }
8566 #endif
8567
8568 /* SetVTable */
8569 static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
8570 PyObject *ob = PyCapsule_New(vtable, 0, 0);
8571 if (unlikely(!ob))
8572 goto bad;
8573 #if CYTHON_COMPILING_IN_LIMITED_API
8574 if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0))
8575 #else
8576 if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0))
8577 #endif
8578 goto bad;
8579 Py_DECREF(ob);
8580 return 0;
8581 bad:
8582 Py_XDECREF(ob);
8583 return -1;
8584 }
8585
8586 /* MergeVTables */
8587 #if !CYTHON_COMPILING_IN_LIMITED_API
8588 static int __Pyx_MergeVtables(PyTypeObject *type) {
8589 int i;
8590 void** base_vtables;
8591 __Pyx_TypeName tp_base_name;
8592 __Pyx_TypeName base_name;
8593 void* unknown = (void*)-1;
8594 PyObject* bases = type->tp_bases;
8595 int base_depth = 0;
8596 {
8597 PyTypeObject* base = type->tp_base;
8598 while (base) {
8599 base_depth += 1;
8600 base = base->tp_base;
8601 }
8602 }
8603 base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1));
8604 base_vtables[0] = unknown;
8605 for (i = 1; i < PyTuple_GET_SIZE(bases); i++) {
8606 void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i)));
8607 if (base_vtable != NULL) {
8608 int j;
8609 PyTypeObject* base = type->tp_base;
8610 for (j = 0; j < base_depth; j++) {
8611 if (base_vtables[j] == unknown) {
8612 base_vtables[j] = __Pyx_GetVtable(base);
8613 base_vtables[j + 1] = unknown;
8614 }
8615 if (base_vtables[j] == base_vtable) {
8616 break;
8617 } else if (base_vtables[j] == NULL) {
8618 goto bad;
8619 }
8620 base = base->tp_base;
8621 }
8622 }
8623 }
8624 PyErr_Clear();
8625 free(base_vtables);
8626 return 0;
8627 bad:
8628 tp_base_name = __Pyx_PyType_GetName(type->tp_base);
8629 base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i));
8630 PyErr_Format(PyExc_TypeError,
8631 "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
8632 __Pyx_DECREF_TypeName(tp_base_name);
8633 __Pyx_DECREF_TypeName(base_name);
8634 free(base_vtables);
8635 return -1;
8636 }
8637 #endif
8638
8639 /* SetupReduce */
8640 #if !CYTHON_COMPILING_IN_LIMITED_API
8641 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
8642 int ret;
8643 PyObject *name_attr;
8644 name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name);
8645 if (likely(name_attr)) {
8646 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
8647 } else {
8648 ret = -1;
8649 }
8650 if (unlikely(ret < 0)) {
8651 PyErr_Clear();
8652 ret = 0;
8653 }
8654 Py_XDECREF(name_attr);
8655 return ret;
8656 }
8657 static int __Pyx_setup_reduce(PyObject* type_obj) {
8658 int ret = 0;
8659 PyObject *object_reduce = NULL;
8660 PyObject *object_getstate = NULL;
8661 PyObject *object_reduce_ex = NULL;
8662 PyObject *reduce = NULL;
8663 PyObject *reduce_ex = NULL;
8664 PyObject *reduce_cython = NULL;
8665 PyObject *setstate = NULL;
8666 PyObject *setstate_cython = NULL;
8667 PyObject *getstate = NULL;
8668 #if CYTHON_USE_PYTYPE_LOOKUP
8669 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
8670 #else
8671 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
8672 if (!getstate && PyErr_Occurred()) {
8673 goto __PYX_BAD;
8674 }
8675 #endif
8676 if (getstate) {
8677 #if CYTHON_USE_PYTYPE_LOOKUP
8678 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
8679 #else
8680 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
8681 if (!object_getstate && PyErr_Occurred()) {
8682 goto __PYX_BAD;
8683 }
8684 #endif
8685 if (object_getstate != getstate) {
8686 goto __PYX_GOOD;
8687 }
8688 }
8689 #if CYTHON_USE_PYTYPE_LOOKUP
8690 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
8691 #else
8692 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
8693 #endif
8694 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
8695 if (reduce_ex == object_reduce_ex) {
8696 #if CYTHON_USE_PYTYPE_LOOKUP
8697 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
8698 #else
8699 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
8700 #endif
8701 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
8702 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
8703 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
8704 if (likely(reduce_cython)) {
8705 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
8706 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
8707 } else if (reduce == object_reduce || PyErr_Occurred()) {
8708 goto __PYX_BAD;
8709 }
8710 setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
8711 if (!setstate) PyErr_Clear();
8712 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
8713 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
8714 if (likely(setstate_cython)) {
8715 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
8716 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
8717 } else if (!setstate || PyErr_Occurred()) {
8718 goto __PYX_BAD;
8719 }
8720 }
8721 PyType_Modified((PyTypeObject*)type_obj);
8722 }
8723 }
8724 goto __PYX_GOOD;
8725 __PYX_BAD:
8726 if (!PyErr_Occurred()) {
8727 __Pyx_TypeName type_obj_name =
8728 __Pyx_PyType_GetName((PyTypeObject*)type_obj);
8729 PyErr_Format(PyExc_RuntimeError,
8730 "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
8731 __Pyx_DECREF_TypeName(type_obj_name);
8732 }
8733 ret = -1;
8734 __PYX_GOOD:
8735 #if !CYTHON_USE_PYTYPE_LOOKUP
8736 Py_XDECREF(object_reduce);
8737 Py_XDECREF(object_reduce_ex);
8738 Py_XDECREF(object_getstate);
8739 Py_XDECREF(getstate);
8740 #endif
8741 Py_XDECREF(reduce);
8742 Py_XDECREF(reduce_ex);
8743 Py_XDECREF(reduce_cython);
8744 Py_XDECREF(setstate);
8745 Py_XDECREF(setstate_cython);
8746 return ret;
8747 }
8748 #endif
8749
8750 /* Import */
8751 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
8752 PyObject *module = 0;
8753 PyObject *empty_dict = 0;
8754 PyObject *empty_list = 0;
8755 #if PY_MAJOR_VERSION < 3
8756 PyObject *py_import;
8757 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
8758 if (unlikely(!py_import))
8759 goto bad;
8760 if (!from_list) {
8761 empty_list = PyList_New(0);
8762 if (unlikely(!empty_list))
8763 goto bad;
8764 from_list = empty_list;
8765 }
8766 #endif
8767 empty_dict = PyDict_New();
8768 if (unlikely(!empty_dict))
8769 goto bad;
8770 {
8771 #if PY_MAJOR_VERSION >= 3
8772 if (level == -1) {
8773 if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
8774 module = PyImport_ImportModuleLevelObject(
8775 name, __pyx_d, empty_dict, from_list, 1);
8776 if (unlikely(!module)) {
8777 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
8778 goto bad;
8779 PyErr_Clear();
8780 }
8781 }
8782 level = 0;
8783 }
8784 #endif
8785 if (!module) {
8786 #if PY_MAJOR_VERSION < 3
8787 PyObject *py_level = PyInt_FromLong(level);
8788 if (unlikely(!py_level))
8789 goto bad;
8790 module = PyObject_CallFunctionObjArgs(py_import,
8791 name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
8792 Py_DECREF(py_level);
8793 #else
8794 module = PyImport_ImportModuleLevelObject(
8795 name, __pyx_d, empty_dict, from_list, level);
8796 #endif
8797 }
8798 }
8799 bad:
8800 Py_XDECREF(empty_dict);
8801 Py_XDECREF(empty_list);
8802 #if PY_MAJOR_VERSION < 3
8803 Py_XDECREF(py_import);
8804 #endif
8805 return module;
8806 }
8807
8808 /* ImportDottedModule */
8809 #if PY_MAJOR_VERSION >= 3
8810 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
8811 PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
8812 if (unlikely(PyErr_Occurred())) {
8813 PyErr_Clear();
8814 }
8815 if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
8816 partial_name = name;
8817 } else {
8818 slice = PySequence_GetSlice(parts_tuple, 0, count);
8819 if (unlikely(!slice))
8820 goto bad;
8821 sep = PyUnicode_FromStringAndSize(".", 1);
8822 if (unlikely(!sep))
8823 goto bad;
8824 partial_name = PyUnicode_Join(sep, slice);
8825 }
8826 PyErr_Format(
8827 #if PY_MAJOR_VERSION < 3
8828 PyExc_ImportError,
8829 "No module named '%s'", PyString_AS_STRING(partial_name));
8830 #else
8831 #if PY_VERSION_HEX >= 0x030600B1
8832 PyExc_ModuleNotFoundError,
8833 #else
8834 PyExc_ImportError,
8835 #endif
8836 "No module named '%U'", partial_name);
8837 #endif
8838 bad:
8839 Py_XDECREF(sep);
8840 Py_XDECREF(slice);
8841 Py_XDECREF(partial_name);
8842 return NULL;
8843 }
8844 #endif
8845 #if PY_MAJOR_VERSION >= 3
8846 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
8847 PyObject *imported_module;
8848 #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
8849 PyObject *modules = PyImport_GetModuleDict();
8850 if (unlikely(!modules))
8851 return NULL;
8852 imported_module = __Pyx_PyDict_GetItemStr(modules, name);
8853 Py_XINCREF(imported_module);
8854 #else
8855 imported_module = PyImport_GetModule(name);
8856 #endif
8857 return imported_module;
8858 }
8859 #endif
8860 #if PY_MAJOR_VERSION >= 3
8861 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
8862 Py_ssize_t i, nparts;
8863 nparts = PyTuple_GET_SIZE(parts_tuple);
8864 for (i=1; i < nparts && module; i++) {
8865 PyObject *part, *submodule;
8866 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8867 part = PyTuple_GET_ITEM(parts_tuple, i);
8868 #else
8869 part = PySequence_ITEM(parts_tuple, i);
8870 #endif
8871 submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
8872 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
8873 Py_DECREF(part);
8874 #endif
8875 Py_DECREF(module);
8876 module = submodule;
8877 }
8878 if (unlikely(!module)) {
8879 return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
8880 }
8881 return module;
8882 }
8883 #endif
8884 static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
8885 #if PY_MAJOR_VERSION < 3
8886 PyObject *module, *from_list, *star = __pyx_n_s__5;
8887 CYTHON_UNUSED_VAR(parts_tuple);
8888 from_list = PyList_New(1);
8889 if (unlikely(!from_list))
8890 return NULL;
8891 Py_INCREF(star);
8892 PyList_SET_ITEM(from_list, 0, star);
8893 module = __Pyx_Import(name, from_list, 0);
8894 Py_DECREF(from_list);
8895 return module;
8896 #else
8897 PyObject *imported_module;
8898 PyObject *module = __Pyx_Import(name, NULL, 0);
8899 if (!parts_tuple || unlikely(!module))
8900 return module;
8901 imported_module = __Pyx__ImportDottedModule_Lookup(name);
8902 if (likely(imported_module)) {
8903 Py_DECREF(module);
8904 return imported_module;
8905 }
8906 PyErr_Clear();
8907 return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
8908 #endif
8909 }
8910 static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
8911 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
8912 PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
8913 if (likely(module)) {
8914 PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
8915 if (likely(spec)) {
8916 PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
8917 if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
8918 Py_DECREF(spec);
8919 spec = NULL;
8920 }
8921 Py_XDECREF(unsafe);
8922 }
8923 if (likely(!spec)) {
8924 PyErr_Clear();
8925 return module;
8926 }
8927 Py_DECREF(spec);
8928 Py_DECREF(module);
8929 } else if (PyErr_Occurred()) {
8930 PyErr_Clear();
8931 }
8932 #endif
8933 return __Pyx__ImportDottedModule(name, parts_tuple);
8934 }
8935
8936 /* FetchSharedCythonModule */
8937 static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
8938 return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
8939 }
8940
8941 /* FetchCommonType */
8942 static int __Pyx_VerifyCachedType(PyObject *cached_type,
8943 const char *name,
8944 Py_ssize_t basicsize,
8945 Py_ssize_t expected_basicsize) {
8946 if (!PyType_Check(cached_type)) {
8947 PyErr_Format(PyExc_TypeError,
8948 "Shared Cython type %.200s is not a type object", name);
8949 return -1;
8950 }
8951 if (basicsize != expected_basicsize) {
8952 PyErr_Format(PyExc_TypeError,
8953 "Shared Cython type %.200s has the wrong size, try recompiling",
8954 name);
8955 return -1;
8956 }
8957 return 0;
8958 }
8959 #if !CYTHON_USE_TYPE_SPECS
8960 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
8961 PyObject* abi_module;
8962 const char* object_name;
8963 PyTypeObject *cached_type = NULL;
8964 abi_module = __Pyx_FetchSharedCythonABIModule();
8965 if (!abi_module) return NULL;
8966 object_name = strrchr(type->tp_name, '.');
8967 object_name = object_name ? object_name+1 : type->tp_name;
8968 cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
8969 if (cached_type) {
8970 if (__Pyx_VerifyCachedType(
8971 (PyObject *)cached_type,
8972 object_name,
8973 cached_type->tp_basicsize,
8974 type->tp_basicsize) < 0) {
8975 goto bad;
8976 }
8977 goto done;
8978 }
8979 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
8980 PyErr_Clear();
8981 if (PyType_Ready(type) < 0) goto bad;
8982 if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
8983 goto bad;
8984 Py_INCREF(type);
8985 cached_type = type;
8986 done:
8987 Py_DECREF(abi_module);
8988 return cached_type;
8989 bad:
8990 Py_XDECREF(cached_type);
8991 cached_type = NULL;
8992 goto done;
8993 }
8994 #else
8995 static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
8996 PyObject *abi_module, *cached_type = NULL;
8997 const char* object_name = strrchr(spec->name, '.');
8998 object_name = object_name ? object_name+1 : spec->name;
8999 abi_module = __Pyx_FetchSharedCythonABIModule();
9000 if (!abi_module) return NULL;
9001 cached_type = PyObject_GetAttrString(abi_module, object_name);
9002 if (cached_type) {
9003 Py_ssize_t basicsize;
9004 #if CYTHON_COMPILING_IN_LIMITED_API
9005 PyObject *py_basicsize;
9006 py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
9007 if (unlikely(!py_basicsize)) goto bad;
9008 basicsize = PyLong_AsSsize_t(py_basicsize);
9009 Py_DECREF(py_basicsize);
9010 py_basicsize = 0;
9011 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
9012 #else
9013 basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
9014 #endif
9015 if (__Pyx_VerifyCachedType(
9016 cached_type,
9017 object_name,
9018 basicsize,
9019 spec->basicsize) < 0) {
9020 goto bad;
9021 }
9022 goto done;
9023 }
9024 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
9025 PyErr_Clear();
9026 CYTHON_UNUSED_VAR(module);
9027 cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
9028 if (unlikely(!cached_type)) goto bad;
9029 if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
9030 if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
9031 done:
9032 Py_DECREF(abi_module);
9033 assert(cached_type == NULL || PyType_Check(cached_type));
9034 return (PyTypeObject *) cached_type;
9035 bad:
9036 Py_XDECREF(cached_type);
9037 cached_type = NULL;
9038 goto done;
9039 }
9040 #endif
9041
9042 /* PyVectorcallFastCallDict */
9043 #if CYTHON_METH_FASTCALL
9044 static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
9045 {
9046 PyObject *res = NULL;
9047 PyObject *kwnames;
9048 PyObject **newargs;
9049 PyObject **kwvalues;
9050 Py_ssize_t i, pos;
9051 size_t j;
9052 PyObject *key, *value;
9053 unsigned long keys_are_strings;
9054 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
9055 newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
9056 if (unlikely(newargs == NULL)) {
9057 PyErr_NoMemory();
9058 return NULL;
9059 }
9060 for (j = 0; j < nargs; j++) newargs[j] = args[j];
9061 kwnames = PyTuple_New(nkw);
9062 if (unlikely(kwnames == NULL)) {
9063 PyMem_Free(newargs);
9064 return NULL;
9065 }
9066 kwvalues = newargs + nargs;
9067 pos = i = 0;
9068 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
9069 while (PyDict_Next(kw, &pos, &key, &value)) {
9070 keys_are_strings &= Py_TYPE(key)->tp_flags;
9071 Py_INCREF(key);
9072 Py_INCREF(value);
9073 PyTuple_SET_ITEM(kwnames, i, key);
9074 kwvalues[i] = value;
9075 i++;
9076 }
9077 if (unlikely(!keys_are_strings)) {
9078 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
9079 goto cleanup;
9080 }
9081 res = vc(func, newargs, nargs, kwnames);
9082 cleanup:
9083 Py_DECREF(kwnames);
9084 for (i = 0; i < nkw; i++)
9085 Py_DECREF(kwvalues[i]);
9086 PyMem_Free(newargs);
9087 return res;
9088 }
9089 static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
9090 {
9091 if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
9092 return vc(func, args, nargs, NULL);
9093 }
9094 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
9095 }
9096 #endif
9097
9098 /* CythonFunctionShared */
9099 #if CYTHON_COMPILING_IN_LIMITED_API
9100 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
9101 if (__Pyx_CyFunction_Check(func)) {
9102 return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
9103 } else if (PyCFunction_Check(func)) {
9104 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
9105 }
9106 return 0;
9107 }
9108 #else
9109 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
9110 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
9111 }
9112 #endif
9113 static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
9114 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
9115 __Pyx_Py_XDECREF_SET(
9116 __Pyx_CyFunction_GetClassObj(f),
9117 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
9118 #else
9119 __Pyx_Py_XDECREF_SET(
9120 ((PyCMethodObject *) (f))->mm_class,
9121 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
9122 #endif
9123 }
9124 static PyObject *
9125 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
9126 {
9127 CYTHON_UNUSED_VAR(closure);
9128 if (unlikely(op->func_doc == NULL)) {
9129 #if CYTHON_COMPILING_IN_LIMITED_API
9130 op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
9131 if (unlikely(!op->func_doc)) return NULL;
9132 #else
9133 if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
9134 #if PY_MAJOR_VERSION >= 3
9135 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
9136 #else
9137 op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
9138 #endif
9139 if (unlikely(op->func_doc == NULL))
9140 return NULL;
9141 } else {
9142 Py_INCREF(Py_None);
9143 return Py_None;
9144 }
9145 #endif
9146 }
9147 Py_INCREF(op->func_doc);
9148 return op->func_doc;
9149 }
9150 static int
9151 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
9152 {
9153 CYTHON_UNUSED_VAR(context);
9154 if (value == NULL) {
9155 value = Py_None;
9156 }
9157 Py_INCREF(value);
9158 __Pyx_Py_XDECREF_SET(op->func_doc, value);
9159 return 0;
9160 }
9161 static PyObject *
9162 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
9163 {
9164 CYTHON_UNUSED_VAR(context);
9165 if (unlikely(op->func_name == NULL)) {
9166 #if CYTHON_COMPILING_IN_LIMITED_API
9167 op->func_name = PyObject_GetAttrString(op->func, "__name__");
9168 #elif PY_MAJOR_VERSION >= 3
9169 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
9170 #else
9171 op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
9172 #endif
9173 if (unlikely(op->func_name == NULL))
9174 return NULL;
9175 }
9176 Py_INCREF(op->func_name);
9177 return op->func_name;
9178 }
9179 static int
9180 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
9181 {
9182 CYTHON_UNUSED_VAR(context);
9183 #if PY_MAJOR_VERSION >= 3
9184 if (unlikely(value == NULL || !PyUnicode_Check(value)))
9185 #else
9186 if (unlikely(value == NULL || !PyString_Check(value)))
9187 #endif
9188 {
9189 PyErr_SetString(PyExc_TypeError,
9190 "__name__ must be set to a string object");
9191 return -1;
9192 }
9193 Py_INCREF(value);
9194 __Pyx_Py_XDECREF_SET(op->func_name, value);
9195 return 0;
9196 }
9197 static PyObject *
9198 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
9199 {
9200 CYTHON_UNUSED_VAR(context);
9201 Py_INCREF(op->func_qualname);
9202 return op->func_qualname;
9203 }
9204 static int
9205 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
9206 {
9207 CYTHON_UNUSED_VAR(context);
9208 #if PY_MAJOR_VERSION >= 3
9209 if (unlikely(value == NULL || !PyUnicode_Check(value)))
9210 #else
9211 if (unlikely(value == NULL || !PyString_Check(value)))
9212 #endif
9213 {
9214 PyErr_SetString(PyExc_TypeError,
9215 "__qualname__ must be set to a string object");
9216 return -1;
9217 }
9218 Py_INCREF(value);
9219 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
9220 return 0;
9221 }
9222 static PyObject *
9223 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
9224 {
9225 CYTHON_UNUSED_VAR(context);
9226 if (unlikely(op->func_dict == NULL)) {
9227 op->func_dict = PyDict_New();
9228 if (unlikely(op->func_dict == NULL))
9229 return NULL;
9230 }
9231 Py_INCREF(op->func_dict);
9232 return op->func_dict;
9233 }
9234 static int
9235 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
9236 {
9237 CYTHON_UNUSED_VAR(context);
9238 if (unlikely(value == NULL)) {
9239 PyErr_SetString(PyExc_TypeError,
9240 "function's dictionary may not be deleted");
9241 return -1;
9242 }
9243 if (unlikely(!PyDict_Check(value))) {
9244 PyErr_SetString(PyExc_TypeError,
9245 "setting function's dictionary to a non-dict");
9246 return -1;
9247 }
9248 Py_INCREF(value);
9249 __Pyx_Py_XDECREF_SET(op->func_dict, value);
9250 return 0;
9251 }
9252 static PyObject *
9253 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
9254 {
9255 CYTHON_UNUSED_VAR(context);
9256 Py_INCREF(op->func_globals);
9257 return op->func_globals;
9258 }
9259 static PyObject *
9260 __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
9261 {
9262 CYTHON_UNUSED_VAR(op);
9263 CYTHON_UNUSED_VAR(context);
9264 Py_INCREF(Py_None);
9265 return Py_None;
9266 }
9267 static PyObject *
9268 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
9269 {
9270 PyObject* result = (op->func_code) ? op->func_code : Py_None;
9271 CYTHON_UNUSED_VAR(context);
9272 Py_INCREF(result);
9273 return result;
9274 }
9275 static int
9276 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
9277 int result = 0;
9278 PyObject *res = op->defaults_getter((PyObject *) op);
9279 if (unlikely(!res))
9280 return -1;
9281 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9282 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
9283 Py_INCREF(op->defaults_tuple);
9284 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
9285 Py_INCREF(op->defaults_kwdict);
9286 #else
9287 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
9288 if (unlikely(!op->defaults_tuple)) result = -1;
9289 else {
9290 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
9291 if (unlikely(!op->defaults_kwdict)) result = -1;
9292 }
9293 #endif
9294 Py_DECREF(res);
9295 return result;
9296 }
9297 static int
9298 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
9299 CYTHON_UNUSED_VAR(context);
9300 if (!value) {
9301 value = Py_None;
9302 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
9303 PyErr_SetString(PyExc_TypeError,
9304 "__defaults__ must be set to a tuple object");
9305 return -1;
9306 }
9307 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
9308 "currently affect the values used in function calls", 1);
9309 Py_INCREF(value);
9310 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
9311 return 0;
9312 }
9313 static PyObject *
9314 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
9315 PyObject* result = op->defaults_tuple;
9316 CYTHON_UNUSED_VAR(context);
9317 if (unlikely(!result)) {
9318 if (op->defaults_getter) {
9319 if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
9320 result = op->defaults_tuple;
9321 } else {
9322 result = Py_None;
9323 }
9324 }
9325 Py_INCREF(result);
9326 return result;
9327 }
9328 static int
9329 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
9330 CYTHON_UNUSED_VAR(context);
9331 if (!value) {
9332 value = Py_None;
9333 } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
9334 PyErr_SetString(PyExc_TypeError,
9335 "__kwdefaults__ must be set to a dict object");
9336 return -1;
9337 }
9338 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
9339 "currently affect the values used in function calls", 1);
9340 Py_INCREF(value);
9341 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
9342 return 0;
9343 }
9344 static PyObject *
9345 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
9346 PyObject* result = op->defaults_kwdict;
9347 CYTHON_UNUSED_VAR(context);
9348 if (unlikely(!result)) {
9349 if (op->defaults_getter) {
9350 if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
9351 result = op->defaults_kwdict;
9352 } else {
9353 result = Py_None;
9354 }
9355 }
9356 Py_INCREF(result);
9357 return result;
9358 }
9359 static int
9360 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
9361 CYTHON_UNUSED_VAR(context);
9362 if (!value || value == Py_None) {
9363 value = NULL;
9364 } else if (unlikely(!PyDict_Check(value))) {
9365 PyErr_SetString(PyExc_TypeError,
9366 "__annotations__ must be set to a dict object");
9367 return -1;
9368 }
9369 Py_XINCREF(value);
9370 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
9371 return 0;
9372 }
9373 static PyObject *
9374 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
9375 PyObject* result = op->func_annotations;
9376 CYTHON_UNUSED_VAR(context);
9377 if (unlikely(!result)) {
9378 result = PyDict_New();
9379 if (unlikely(!result)) return NULL;
9380 op->func_annotations = result;
9381 }
9382 Py_INCREF(result);
9383 return result;
9384 }
9385 static PyObject *
9386 __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
9387 int is_coroutine;
9388 CYTHON_UNUSED_VAR(context);
9389 if (op->func_is_coroutine) {
9390 return __Pyx_NewRef(op->func_is_coroutine);
9391 }
9392 is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
9393 #if PY_VERSION_HEX >= 0x03050000
9394 if (is_coroutine) {
9395 PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
9396 fromlist = PyList_New(1);
9397 if (unlikely(!fromlist)) return NULL;
9398 Py_INCREF(marker);
9399 #if CYTHON_ASSUME_SAFE_MACROS
9400 PyList_SET_ITEM(fromlist, 0, marker);
9401 #else
9402 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
9403 Py_DECREF(marker);
9404 Py_DECREF(fromlist);
9405 return NULL;
9406 }
9407 #endif
9408 module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
9409 Py_DECREF(fromlist);
9410 if (unlikely(!module)) goto ignore;
9411 op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
9412 Py_DECREF(module);
9413 if (likely(op->func_is_coroutine)) {
9414 return __Pyx_NewRef(op->func_is_coroutine);
9415 }
9416 ignore:
9417 PyErr_Clear();
9418 }
9419 #endif
9420 op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
9421 return __Pyx_NewRef(op->func_is_coroutine);
9422 }
9423 #if CYTHON_COMPILING_IN_LIMITED_API
9424 static PyObject *
9425 __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
9426 CYTHON_UNUSED_VAR(context);
9427 return PyObject_GetAttrString(op->func, "__module__");
9428 }
9429 static int
9430 __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
9431 CYTHON_UNUSED_VAR(context);
9432 return PyObject_SetAttrString(op->func, "__module__", value);
9433 }
9434 #endif
9435 static PyGetSetDef __pyx_CyFunction_getsets[] = {
9436 {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
9437 {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
9438 {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
9439 {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
9440 {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
9441 {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
9442 {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
9443 {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
9444 {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
9445 {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
9446 {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
9447 {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
9448 {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
9449 {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
9450 {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
9451 {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
9452 {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
9453 {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
9454 #if CYTHON_COMPILING_IN_LIMITED_API
9455 {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
9456 #endif
9457 {0, 0, 0, 0, 0}
9458 };
9459 static PyMemberDef __pyx_CyFunction_members[] = {
9460 #if !CYTHON_COMPILING_IN_LIMITED_API
9461 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
9462 #endif
9463 #if CYTHON_USE_TYPE_SPECS
9464 {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
9465 #if CYTHON_METH_FASTCALL
9466 #if CYTHON_BACKPORT_VECTORCALL
9467 {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
9468 #else
9469 #if !CYTHON_COMPILING_IN_LIMITED_API
9470 {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
9471 #endif
9472 #endif
9473 #endif
9474 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
9475 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
9476 #else
9477 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
9478 #endif
9479 #endif
9480 {0, 0, 0, 0, 0}
9481 };
9482 static PyObject *
9483 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
9484 {
9485 CYTHON_UNUSED_VAR(args);
9486 #if PY_MAJOR_VERSION >= 3
9487 Py_INCREF(m->func_qualname);
9488 return m->func_qualname;
9489 #else
9490 return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
9491 #endif
9492 }
9493 static PyMethodDef __pyx_CyFunction_methods[] = {
9494 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
9495 {0, 0, 0, 0}
9496 };
9497 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
9498 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
9499 #else
9500 #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
9501 #endif
9502 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
9503 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
9504 #if !CYTHON_COMPILING_IN_LIMITED_API
9505 PyCFunctionObject *cf = (PyCFunctionObject*) op;
9506 #endif
9507 if (unlikely(op == NULL))
9508 return NULL;
9509 #if CYTHON_COMPILING_IN_LIMITED_API
9510 op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
9511 if (unlikely(!op->func)) return NULL;
9512 #endif
9513 op->flags = flags;
9514 __Pyx_CyFunction_weakreflist(op) = NULL;
9515 #if !CYTHON_COMPILING_IN_LIMITED_API
9516 cf->m_ml = ml;
9517 cf->m_self = (PyObject *) op;
9518 #endif
9519 Py_XINCREF(closure);
9520 op->func_closure = closure;
9521 #if !CYTHON_COMPILING_IN_LIMITED_API
9522 Py_XINCREF(module);
9523 cf->m_module = module;
9524 #endif
9525 op->func_dict = NULL;
9526 op->func_name = NULL;
9527 Py_INCREF(qualname);
9528 op->func_qualname = qualname;
9529 op->func_doc = NULL;
9530 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
9531 op->func_classobj = NULL;
9532 #else
9533 ((PyCMethodObject*)op)->mm_class = NULL;
9534 #endif
9535 op->func_globals = globals;
9536 Py_INCREF(op->func_globals);
9537 Py_XINCREF(code);
9538 op->func_code = code;
9539 op->defaults_pyobjects = 0;
9540 op->defaults_size = 0;
9541 op->defaults = NULL;
9542 op->defaults_tuple = NULL;
9543 op->defaults_kwdict = NULL;
9544 op->defaults_getter = NULL;
9545 op->func_annotations = NULL;
9546 op->func_is_coroutine = NULL;
9547 #if CYTHON_METH_FASTCALL
9548 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
9549 case METH_NOARGS:
9550 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
9551 break;
9552 case METH_O:
9553 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
9554 break;
9555 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
9556 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
9557 break;
9558 case METH_FASTCALL | METH_KEYWORDS:
9559 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
9560 break;
9561 case METH_VARARGS | METH_KEYWORDS:
9562 __Pyx_CyFunction_func_vectorcall(op) = NULL;
9563 break;
9564 default:
9565 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
9566 Py_DECREF(op);
9567 return NULL;
9568 }
9569 #endif
9570 return (PyObject *) op;
9571 }
9572 static int
9573 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
9574 {
9575 Py_CLEAR(m->func_closure);
9576 #if CYTHON_COMPILING_IN_LIMITED_API
9577 Py_CLEAR(m->func);
9578 #else
9579 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
9580 #endif
9581 Py_CLEAR(m->func_dict);
9582 Py_CLEAR(m->func_name);
9583 Py_CLEAR(m->func_qualname);
9584 Py_CLEAR(m->func_doc);
9585 Py_CLEAR(m->func_globals);
9586 Py_CLEAR(m->func_code);
9587 #if !CYTHON_COMPILING_IN_LIMITED_API
9588 #if PY_VERSION_HEX < 0x030900B1
9589 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
9590 #else
9591 {
9592 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
9593 ((PyCMethodObject *) (m))->mm_class = NULL;
9594 Py_XDECREF(cls);
9595 }
9596 #endif
9597 #endif
9598 Py_CLEAR(m->defaults_tuple);
9599 Py_CLEAR(m->defaults_kwdict);
9600 Py_CLEAR(m->func_annotations);
9601 Py_CLEAR(m->func_is_coroutine);
9602 if (m->defaults) {
9603 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
9604 int i;
9605 for (i = 0; i < m->defaults_pyobjects; i++)
9606 Py_XDECREF(pydefaults[i]);
9607 PyObject_Free(m->defaults);
9608 m->defaults = NULL;
9609 }
9610 return 0;
9611 }
9612 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
9613 {
9614 if (__Pyx_CyFunction_weakreflist(m) != NULL)
9615 PyObject_ClearWeakRefs((PyObject *) m);
9616 __Pyx_CyFunction_clear(m);
9617 __Pyx_PyHeapTypeObject_GC_Del(m);
9618 }
9619 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
9620 {
9621 PyObject_GC_UnTrack(m);
9622 __Pyx__CyFunction_dealloc(m);
9623 }
9624 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
9625 {
9626 Py_VISIT(m->func_closure);
9627 #if CYTHON_COMPILING_IN_LIMITED_API
9628 Py_VISIT(m->func);
9629 #else
9630 Py_VISIT(((PyCFunctionObject*)m)->m_module);
9631 #endif
9632 Py_VISIT(m->func_dict);
9633 Py_VISIT(m->func_name);
9634 Py_VISIT(m->func_qualname);
9635 Py_VISIT(m->func_doc);
9636 Py_VISIT(m->func_globals);
9637 Py_VISIT(m->func_code);
9638 #if !CYTHON_COMPILING_IN_LIMITED_API
9639 Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
9640 #endif
9641 Py_VISIT(m->defaults_tuple);
9642 Py_VISIT(m->defaults_kwdict);
9643 Py_VISIT(m->func_is_coroutine);
9644 if (m->defaults) {
9645 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
9646 int i;
9647 for (i = 0; i < m->defaults_pyobjects; i++)
9648 Py_VISIT(pydefaults[i]);
9649 }
9650 return 0;
9651 }
9652 static PyObject*
9653 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
9654 {
9655 #if PY_MAJOR_VERSION >= 3
9656 return PyUnicode_FromFormat("<cyfunction %U at %p>",
9657 op->func_qualname, (void *)op);
9658 #else
9659 return PyString_FromFormat("<cyfunction %s at %p>",
9660 PyString_AsString(op->func_qualname), (void *)op);
9661 #endif
9662 }
9663 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
9664 #if CYTHON_COMPILING_IN_LIMITED_API
9665 PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
9666 PyObject *py_name = NULL;
9667 PyCFunction meth;
9668 int flags;
9669 meth = PyCFunction_GetFunction(f);
9670 if (unlikely(!meth)) return NULL;
9671 flags = PyCFunction_GetFlags(f);
9672 if (unlikely(flags < 0)) return NULL;
9673 #else
9674 PyCFunctionObject* f = (PyCFunctionObject*)func;
9675 PyCFunction meth = f->m_ml->ml_meth;
9676 int flags = f->m_ml->ml_flags;
9677 #endif
9678 Py_ssize_t size;
9679 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
9680 case METH_VARARGS:
9681 if (likely(kw == NULL || PyDict_Size(kw) == 0))
9682 return (*meth)(self, arg);
9683 break;
9684 case METH_VARARGS | METH_KEYWORDS:
9685 return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
9686 case METH_NOARGS:
9687 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
9688 #if CYTHON_ASSUME_SAFE_MACROS
9689 size = PyTuple_GET_SIZE(arg);
9690 #else
9691 size = PyTuple_Size(arg);
9692 if (unlikely(size < 0)) return NULL;
9693 #endif
9694 if (likely(size == 0))
9695 return (*meth)(self, NULL);
9696 #if CYTHON_COMPILING_IN_LIMITED_API
9697 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
9698 if (!py_name) return NULL;
9699 PyErr_Format(PyExc_TypeError,
9700 "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
9701 py_name, size);
9702 Py_DECREF(py_name);
9703 #else
9704 PyErr_Format(PyExc_TypeError,
9705 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
9706 f->m_ml->ml_name, size);
9707 #endif
9708 return NULL;
9709 }
9710 break;
9711 case METH_O:
9712 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
9713 #if CYTHON_ASSUME_SAFE_MACROS
9714 size = PyTuple_GET_SIZE(arg);
9715 #else
9716 size = PyTuple_Size(arg);
9717 if (unlikely(size < 0)) return NULL;
9718 #endif
9719 if (likely(size == 1)) {
9720 PyObject *result, *arg0;
9721 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9722 arg0 = PyTuple_GET_ITEM(arg, 0);
9723 #else
9724 arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
9725 #endif
9726 result = (*meth)(self, arg0);
9727 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
9728 Py_DECREF(arg0);
9729 #endif
9730 return result;
9731 }
9732 #if CYTHON_COMPILING_IN_LIMITED_API
9733 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
9734 if (!py_name) return NULL;
9735 PyErr_Format(PyExc_TypeError,
9736 "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
9737 py_name, size);
9738 Py_DECREF(py_name);
9739 #else
9740 PyErr_Format(PyExc_TypeError,
9741 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
9742 f->m_ml->ml_name, size);
9743 #endif
9744 return NULL;
9745 }
9746 break;
9747 default:
9748 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
9749 return NULL;
9750 }
9751 #if CYTHON_COMPILING_IN_LIMITED_API
9752 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
9753 if (!py_name) return NULL;
9754 PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
9755 py_name);
9756 Py_DECREF(py_name);
9757 #else
9758 PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
9759 f->m_ml->ml_name);
9760 #endif
9761 return NULL;
9762 }
9763 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
9764 PyObject *self, *result;
9765 #if CYTHON_COMPILING_IN_LIMITED_API
9766 self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
9767 if (unlikely(!self) && PyErr_Occurred()) return NULL;
9768 #else
9769 self = ((PyCFunctionObject*)func)->m_self;
9770 #endif
9771 result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
9772 return result;
9773 }
9774 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
9775 PyObject *result;
9776 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
9777 #if CYTHON_METH_FASTCALL
9778 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
9779 if (vc) {
9780 #if CYTHON_ASSUME_SAFE_MACROS
9781 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
9782 #else
9783 (void) &__Pyx_PyVectorcall_FastCallDict;
9784 return PyVectorcall_Call(func, args, kw);
9785 #endif
9786 }
9787 #endif
9788 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
9789 Py_ssize_t argc;
9790 PyObject *new_args;
9791 PyObject *self;
9792 #if CYTHON_ASSUME_SAFE_MACROS
9793 argc = PyTuple_GET_SIZE(args);
9794 #else
9795 argc = PyTuple_Size(args);
9796 if (unlikely(!argc) < 0) return NULL;
9797 #endif
9798 new_args = PyTuple_GetSlice(args, 1, argc);
9799 if (unlikely(!new_args))
9800 return NULL;
9801 self = PyTuple_GetItem(args, 0);
9802 if (unlikely(!self)) {
9803 Py_DECREF(new_args);
9804 #if PY_MAJOR_VERSION > 2
9805 PyErr_Format(PyExc_TypeError,
9806 "unbound method %.200S() needs an argument",
9807 cyfunc->func_qualname);
9808 #else
9809 PyErr_SetString(PyExc_TypeError,
9810 "unbound method needs an argument");
9811 #endif
9812 return NULL;
9813 }
9814 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
9815 Py_DECREF(new_args);
9816 } else {
9817 result = __Pyx_CyFunction_Call(func, args, kw);
9818 }
9819 return result;
9820 }
9821 #if CYTHON_METH_FASTCALL
9822 static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
9823 {
9824 int ret = 0;
9825 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
9826 if (unlikely(nargs < 1)) {
9827 PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
9828 ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
9829 return -1;
9830 }
9831 ret = 1;
9832 }
9833 if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
9834 PyErr_Format(PyExc_TypeError,
9835 "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
9836 return -1;
9837 }
9838 return ret;
9839 }
9840 static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
9841 {
9842 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
9843 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
9844 #if CYTHON_BACKPORT_VECTORCALL
9845 Py_ssize_t nargs = (Py_ssize_t)nargsf;
9846 #else
9847 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
9848 #endif
9849 PyObject *self;
9850 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
9851 case 1:
9852 self = args[0];
9853 args += 1;
9854 nargs -= 1;
9855 break;
9856 case 0:
9857 self = ((PyCFunctionObject*)cyfunc)->m_self;
9858 break;
9859 default:
9860 return NULL;
9861 }
9862 if (unlikely(nargs != 0)) {
9863 PyErr_Format(PyExc_TypeError,
9864 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
9865 def->ml_name, nargs);
9866 return NULL;
9867 }
9868 return def->ml_meth(self, NULL);
9869 }
9870 static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
9871 {
9872 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
9873 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
9874 #if CYTHON_BACKPORT_VECTORCALL
9875 Py_ssize_t nargs = (Py_ssize_t)nargsf;
9876 #else
9877 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
9878 #endif
9879 PyObject *self;
9880 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
9881 case 1:
9882 self = args[0];
9883 args += 1;
9884 nargs -= 1;
9885 break;
9886 case 0:
9887 self = ((PyCFunctionObject*)cyfunc)->m_self;
9888 break;
9889 default:
9890 return NULL;
9891 }
9892 if (unlikely(nargs != 1)) {
9893 PyErr_Format(PyExc_TypeError,
9894 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
9895 def->ml_name, nargs);
9896 return NULL;
9897 }
9898 return def->ml_meth(self, args[0]);
9899 }
9900 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
9901 {
9902 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
9903 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
9904 #if CYTHON_BACKPORT_VECTORCALL
9905 Py_ssize_t nargs = (Py_ssize_t)nargsf;
9906 #else
9907 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
9908 #endif
9909 PyObject *self;
9910 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
9911 case 1:
9912 self = args[0];
9913 args += 1;
9914 nargs -= 1;
9915 break;
9916 case 0:
9917 self = ((PyCFunctionObject*)cyfunc)->m_self;
9918 break;
9919 default:
9920 return NULL;
9921 }
9922 return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
9923 }
9924 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
9925 {
9926 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
9927 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
9928 PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
9929 #if CYTHON_BACKPORT_VECTORCALL
9930 Py_ssize_t nargs = (Py_ssize_t)nargsf;
9931 #else
9932 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
9933 #endif
9934 PyObject *self;
9935 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
9936 case 1:
9937 self = args[0];
9938 args += 1;
9939 nargs -= 1;
9940 break;
9941 case 0:
9942 self = ((PyCFunctionObject*)cyfunc)->m_self;
9943 break;
9944 default:
9945 return NULL;
9946 }
9947 return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
9948 }
9949 #endif
9950 #if CYTHON_USE_TYPE_SPECS
9951 static PyType_Slot __pyx_CyFunctionType_slots[] = {
9952 {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
9953 {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
9954 {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
9955 {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
9956 {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
9957 {Py_tp_methods, (void *)__pyx_CyFunction_methods},
9958 {Py_tp_members, (void *)__pyx_CyFunction_members},
9959 {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
9960 {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
9961 {0, 0},
9962 };
9963 static PyType_Spec __pyx_CyFunctionType_spec = {
9964 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
9965 sizeof(__pyx_CyFunctionObject),
9966 0,
9967 #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
9968 Py_TPFLAGS_METHOD_DESCRIPTOR |
9969 #endif
9970 #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
9971 _Py_TPFLAGS_HAVE_VECTORCALL |
9972 #endif
9973 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
9974 __pyx_CyFunctionType_slots
9975 };
9976 #else
9977 static PyTypeObject __pyx_CyFunctionType_type = {
9978 PyVarObject_HEAD_INIT(0, 0)
9979 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
9980 sizeof(__pyx_CyFunctionObject),
9981 0,
9982 (destructor) __Pyx_CyFunction_dealloc,
9983 #if !CYTHON_METH_FASTCALL
9984 0,
9985 #elif CYTHON_BACKPORT_VECTORCALL
9986 (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
9987 #else
9988 offsetof(PyCFunctionObject, vectorcall),
9989 #endif
9990 0,
9991 0,
9992 #if PY_MAJOR_VERSION < 3
9993 0,
9994 #else
9995 0,
9996 #endif
9997 (reprfunc) __Pyx_CyFunction_repr,
9998 0,
9999 0,
10000 0,
10001 0,
10002 __Pyx_CyFunction_CallAsMethod,
10003 0,
10004 0,
10005 0,
10006 0,
10007 #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
10008 Py_TPFLAGS_METHOD_DESCRIPTOR |
10009 #endif
10010 #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
10011 _Py_TPFLAGS_HAVE_VECTORCALL |
10012 #endif
10013 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
10014 0,
10015 (traverseproc) __Pyx_CyFunction_traverse,
10016 (inquiry) __Pyx_CyFunction_clear,
10017 0,
10018 #if PY_VERSION_HEX < 0x030500A0
10019 offsetof(__pyx_CyFunctionObject, func_weakreflist),
10020 #else
10021 offsetof(PyCFunctionObject, m_weakreflist),
10022 #endif
10023 0,
10024 0,
10025 __pyx_CyFunction_methods,
10026 __pyx_CyFunction_members,
10027 __pyx_CyFunction_getsets,
10028 0,
10029 0,
10030 __Pyx_PyMethod_New,
10031 0,
10032 offsetof(__pyx_CyFunctionObject, func_dict),
10033 0,
10034 0,
10035 0,
10036 0,
10037 0,
10038 0,
10039 0,
10040 0,
10041 0,
10042 0,
10043 0,
10044 0,
10045 #if PY_VERSION_HEX >= 0x030400a1
10046 0,
10047 #endif
10048 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
10049 0,
10050 #endif
10051 #if __PYX_NEED_TP_PRINT_SLOT
10052 0,
10053 #endif
10054 #if PY_VERSION_HEX >= 0x030C0000
10055 0,
10056 #endif
10057 #if PY_VERSION_HEX >= 0x030d00A4
10058 0,
10059 #endif
10060 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
10061 0,
10062 #endif
10063 };
10064 #endif
10065 static int __pyx_CyFunction_init(PyObject *module) {
10066 #if CYTHON_USE_TYPE_SPECS
10067 __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
10068 #else
10069 CYTHON_UNUSED_VAR(module);
10070 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
10071 #endif
10072 if (unlikely(__pyx_CyFunctionType == NULL)) {
10073 return -1;
10074 }
10075 return 0;
10076 }
10077 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
10078 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
10079 m->defaults = PyObject_Malloc(size);
10080 if (unlikely(!m->defaults))
10081 return PyErr_NoMemory();
10082 memset(m->defaults, 0, size);
10083 m->defaults_pyobjects = pyobjects;
10084 m->defaults_size = size;
10085 return m->defaults;
10086 }
10087 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
10088 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
10089 m->defaults_tuple = tuple;
10090 Py_INCREF(tuple);
10091 }
10092 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
10093 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
10094 m->defaults_kwdict = dict;
10095 Py_INCREF(dict);
10096 }
10097 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
10098 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
10099 m->func_annotations = dict;
10100 Py_INCREF(dict);
10101 }
10102
10103 /* CythonFunction */
10104 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
10105 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
10106 PyObject *op = __Pyx_CyFunction_Init(
10107 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
10108 ml, flags, qualname, closure, module, globals, code
10109 );
10110 if (likely(op)) {
10111 PyObject_GC_Track(op);
10112 }
10113 return op;
10114 }
10115
10116 /* PyDictVersioning */
10117 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
10118 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
10119 PyObject *dict = Py_TYPE(obj)->tp_dict;
10120 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
10121 }
10122 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
10123 PyObject **dictptr = NULL;
10124 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
10125 if (offset) {
10126 #if CYTHON_COMPILING_IN_CPYTHON
10127 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
10128 #else
10129 dictptr = _PyObject_GetDictPtr(obj);
10130 #endif
10131 }
10132 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
10133 }
10134 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
10135 PyObject *dict = Py_TYPE(obj)->tp_dict;
10136 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
10137 return 0;
10138 return obj_dict_version == __Pyx_get_object_dict_version(obj);
10139 }
10140 #endif
10141
10142 /* CLineInTraceback */
10143 #ifndef CYTHON_CLINE_IN_TRACEBACK
10144 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
10145 PyObject *use_cline;
10146 PyObject *ptype, *pvalue, *ptraceback;
10147 #if CYTHON_COMPILING_IN_CPYTHON
10148 PyObject **cython_runtime_dict;
10149 #endif
10150 CYTHON_MAYBE_UNUSED_VAR(tstate);
10151 if (unlikely(!__pyx_cython_runtime)) {
10152 return c_line;
10153 }
10154 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
10155 #if CYTHON_COMPILING_IN_CPYTHON
10156 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
10157 if (likely(cython_runtime_dict)) {
10158 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
10159 use_cline, *cython_runtime_dict,
10160 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
10161 } else
10162 #endif
10163 {
10164 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
10165 if (use_cline_obj) {
10166 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
10167 Py_DECREF(use_cline_obj);
10168 } else {
10169 PyErr_Clear();
10170 use_cline = NULL;
10171 }
10172 }
10173 if (!use_cline) {
10174 c_line = 0;
10175 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
10176 }
10177 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
10178 c_line = 0;
10179 }
10180 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
10181 return c_line;
10182 }
10183 #endif
10184
10185 /* CodeObjectCache */
10186 #if !CYTHON_COMPILING_IN_LIMITED_API
10187 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
10188 int start = 0, mid = 0, end = count - 1;
10189 if (end >= 0 && code_line > entries[end].code_line) {
10190 return count;
10191 }
10192 while (start < end) {
10193 mid = start + (end - start) / 2;
10194 if (code_line < entries[mid].code_line) {
10195 end = mid;
10196 } else if (code_line > entries[mid].code_line) {
10197 start = mid + 1;
10198 } else {
10199 return mid;
10200 }
10201 }
10202 if (code_line <= entries[mid].code_line) {
10203 return mid;
10204 } else {
10205 return mid + 1;
10206 }
10207 }
10208 static PyCodeObject *__pyx_find_code_object(int code_line) {
10209 PyCodeObject* code_object;
10210 int pos;
10211 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
10212 return NULL;
10213 }
10214 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
10215 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
10216 return NULL;
10217 }
10218 code_object = __pyx_code_cache.entries[pos].code_object;
10219 Py_INCREF(code_object);
10220 return code_object;
10221 }
10222 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
10223 int pos, i;
10224 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
10225 if (unlikely(!code_line)) {
10226 return;
10227 }
10228 if (unlikely(!entries)) {
10229 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
10230 if (likely(entries)) {
10231 __pyx_code_cache.entries = entries;
10232 __pyx_code_cache.max_count = 64;
10233 __pyx_code_cache.count = 1;
10234 entries[0].code_line = code_line;
10235 entries[0].code_object = code_object;
10236 Py_INCREF(code_object);
10237 }
10238 return;
10239 }
10240 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
10241 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
10242 PyCodeObject* tmp = entries[pos].code_object;
10243 entries[pos].code_object = code_object;
10244 Py_DECREF(tmp);
10245 return;
10246 }
10247 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
10248 int new_max = __pyx_code_cache.max_count + 64;
10249 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
10250 __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
10251 if (unlikely(!entries)) {
10252 return;
10253 }
10254 __pyx_code_cache.entries = entries;
10255 __pyx_code_cache.max_count = new_max;
10256 }
10257 for (i=__pyx_code_cache.count; i>pos; i--) {
10258 entries[i] = entries[i-1];
10259 }
10260 entries[pos].code_line = code_line;
10261 entries[pos].code_object = code_object;
10262 __pyx_code_cache.count++;
10263 Py_INCREF(code_object);
10264 }
10265 #endif
10266
10267 /* AddTraceback */
10268 #include "compile.h"
10269 #include "frameobject.h"
10270 #include "traceback.h"
10271 #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
10272 #ifndef Py_BUILD_CORE
10273 #define Py_BUILD_CORE 1
10274 #endif
10275 #include "internal/pycore_frame.h"
10276 #endif
10277 #if CYTHON_COMPILING_IN_LIMITED_API
10278 static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
10279 PyObject *firstlineno, PyObject *name) {
10280 PyObject *replace = NULL;
10281 if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
10282 if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
10283 replace = PyObject_GetAttrString(code, "replace");
10284 if (likely(replace)) {
10285 PyObject *result;
10286 result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
10287 Py_DECREF(replace);
10288 return result;
10289 }
10290 PyErr_Clear();
10291 #if __PYX_LIMITED_VERSION_HEX < 0x030780000
10292 {
10293 PyObject *compiled = NULL, *result = NULL;
10294 if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
10295 if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
10296 compiled = Py_CompileString(
10297 "out = type(code)(\n"
10298 " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
10299 " code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
10300 " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
10301 " code.co_lnotab)\n", "<dummy>", Py_file_input);
10302 if (!compiled) return NULL;
10303 result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
10304 Py_DECREF(compiled);
10305 if (!result) PyErr_Print();
10306 Py_DECREF(result);
10307 result = PyDict_GetItemString(scratch_dict, "out");
10308 if (result) Py_INCREF(result);
10309 return result;
10310 }
10311 #else
10312 return NULL;
10313 #endif
10314 }
10315 static void __Pyx_AddTraceback(const char *funcname, int c_line,
10316 int py_line, const char *filename) {
10317 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
10318 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
10319 PyObject *exc_type, *exc_value, *exc_traceback;
10320 int success = 0;
10321 if (c_line) {
10322 (void) __pyx_cfilenm;
10323 (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
10324 }
10325 PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
10326 code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
10327 if (unlikely(!code_object)) goto bad;
10328 py_py_line = PyLong_FromLong(py_line);
10329 if (unlikely(!py_py_line)) goto bad;
10330 py_funcname = PyUnicode_FromString(funcname);
10331 if (unlikely(!py_funcname)) goto bad;
10332 dict = PyDict_New();
10333 if (unlikely(!dict)) goto bad;
10334 {
10335 PyObject *old_code_object = code_object;
10336 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
10337 Py_DECREF(old_code_object);
10338 }
10339 if (unlikely(!code_object)) goto bad;
10340 getframe = PySys_GetObject("_getframe");
10341 if (unlikely(!getframe)) goto bad;
10342 if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
10343 frame = PyEval_EvalCode(code_object, dict, dict);
10344 if (unlikely(!frame) || frame == Py_None) goto bad;
10345 success = 1;
10346 bad:
10347 PyErr_Restore(exc_type, exc_value, exc_traceback);
10348 Py_XDECREF(code_object);
10349 Py_XDECREF(py_py_line);
10350 Py_XDECREF(py_funcname);
10351 Py_XDECREF(dict);
10352 Py_XDECREF(replace);
10353 if (success) {
10354 PyTraceBack_Here(
10355 (struct _frame*)frame);
10356 }
10357 Py_XDECREF(frame);
10358 }
10359 #else
10360 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
10361 const char *funcname, int c_line,
10362 int py_line, const char *filename) {
10363 PyCodeObject *py_code = NULL;
10364 PyObject *py_funcname = NULL;
10365 #if PY_MAJOR_VERSION < 3
10366 PyObject *py_srcfile = NULL;
10367 py_srcfile = PyString_FromString(filename);
10368 if (!py_srcfile) goto bad;
10369 #endif
10370 if (c_line) {
10371 #if PY_MAJOR_VERSION < 3
10372 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
10373 if (!py_funcname) goto bad;
10374 #else
10375 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
10376 if (!py_funcname) goto bad;
10377 funcname = PyUnicode_AsUTF8(py_funcname);
10378 if (!funcname) goto bad;
10379 #endif
10380 }
10381 else {
10382 #if PY_MAJOR_VERSION < 3
10383 py_funcname = PyString_FromString(funcname);
10384 if (!py_funcname) goto bad;
10385 #endif
10386 }
10387 #if PY_MAJOR_VERSION < 3
10388 py_code = __Pyx_PyCode_New(
10389 0,
10390 0,
10391 0,
10392 0,
10393 0,
10394 0,
10395 __pyx_empty_bytes, /*PyObject *code,*/
10396 __pyx_empty_tuple, /*PyObject *consts,*/
10397 __pyx_empty_tuple, /*PyObject *names,*/
10398 __pyx_empty_tuple, /*PyObject *varnames,*/
10399 __pyx_empty_tuple, /*PyObject *freevars,*/
10400 __pyx_empty_tuple, /*PyObject *cellvars,*/
10401 py_srcfile, /*PyObject *filename,*/
10402 py_funcname, /*PyObject *name,*/
10403 py_line,
10404 __pyx_empty_bytes /*PyObject *lnotab*/
10405 );
10406 Py_DECREF(py_srcfile);
10407 #else
10408 py_code = PyCode_NewEmpty(filename, funcname, py_line);
10409 #endif
10410 Py_XDECREF(py_funcname);
10411 return py_code;
10412 bad:
10413 Py_XDECREF(py_funcname);
10414 #if PY_MAJOR_VERSION < 3
10415 Py_XDECREF(py_srcfile);
10416 #endif
10417 return NULL;
10418 }
10419 static void __Pyx_AddTraceback(const char *funcname, int c_line,
10420 int py_line, const char *filename) {
10421 PyCodeObject *py_code = 0;
10422 PyFrameObject *py_frame = 0;
10423 PyThreadState *tstate = __Pyx_PyThreadState_Current;
10424 PyObject *ptype, *pvalue, *ptraceback;
10425 if (c_line) {
10426 c_line = __Pyx_CLineForTraceback(tstate, c_line);
10427 }
10428 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
10429 if (!py_code) {
10430 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
10431 py_code = __Pyx_CreateCodeObjectForTraceback(
10432 funcname, c_line, py_line, filename);
10433 if (!py_code) {
10434 /* If the code object creation fails, then we should clear the
10435 fetched exception references and propagate the new exception */
10436 Py_XDECREF(ptype);
10437 Py_XDECREF(pvalue);
10438 Py_XDECREF(ptraceback);
10439 goto bad;
10440 }
10441 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
10442 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
10443 }
10444 py_frame = PyFrame_New(
10445 tstate, /*PyThreadState *tstate,*/
10446 py_code, /*PyCodeObject *code,*/
10447 __pyx_d, /*PyObject *globals,*/
10448 0 /*PyObject *locals*/
10449 );
10450 if (!py_frame) goto bad;
10451 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
10452 PyTraceBack_Here(py_frame);
10453 bad:
10454 Py_XDECREF(py_code);
10455 Py_XDECREF(py_frame);
10456 }
10457 #endif
10458
10459 /* CIntFromPyVerify */
10460 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
10461 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
10462 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
10463 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
10464 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
10465 {\
10466 func_type value = func_value;\
10467 if (sizeof(target_type) < sizeof(func_type)) {\
10468 if (unlikely(value != (func_type) (target_type) value)) {\
10469 func_type zero = 0;\
10470 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
10471 return (target_type) -1;\
10472 if (is_unsigned && unlikely(value < zero))\
10473 goto raise_neg_overflow;\
10474 else\
10475 goto raise_overflow;\
10476 }\
10477 }\
10478 return (target_type) value;\
10479 }
10480
10481 /* CIntFromPy */
10482 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
10483 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
10484 #pragma GCC diagnostic push
10485 #pragma GCC diagnostic ignored "-Wconversion"
10486 #endif
10487 const int neg_one = (int) -1, const_zero = (int) 0;
10488 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
10489 #pragma GCC diagnostic pop
10490 #endif
10491 const int is_unsigned = neg_one > const_zero;
10492 #if PY_MAJOR_VERSION < 3
10493 if (likely(PyInt_Check(x))) {
10494 if ((sizeof(int) < sizeof(long))) {
10495 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
10496 } else {
10497 long val = PyInt_AS_LONG(x);
10498 if (is_unsigned && unlikely(val < 0)) {
10499 goto raise_neg_overflow;
10500 }
10501 return (int) val;
10502 }
10503 }
10504 #endif
10505 if (unlikely(!PyLong_Check(x))) {
10506 int val;
10507 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
10508 if (!tmp) return (int) -1;
10509 val = __Pyx_PyInt_As_int(tmp);
10510 Py_DECREF(tmp);
10511 return val;
10512 }
10513 if (is_unsigned) {
10514 #if CYTHON_USE_PYLONG_INTERNALS
10515 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
10516 goto raise_neg_overflow;
10517 } else if (__Pyx_PyLong_IsCompact(x)) {
10518 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
10519 } else {
10520 const digit* digits = __Pyx_PyLong_Digits(x);
10521 assert(__Pyx_PyLong_DigitCount(x) > 1);
10522 switch (__Pyx_PyLong_DigitCount(x)) {
10523 case 2:
10524 if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
10525 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
10526 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10527 } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
10528 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
10529 }
10530 }
10531 break;
10532 case 3:
10533 if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
10534 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
10535 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10536 } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
10537 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
10538 }
10539 }
10540 break;
10541 case 4:
10542 if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
10543 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
10544 __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])))
10545 } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
10546 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
10547 }
10548 }
10549 break;
10550 }
10551 }
10552 #endif
10553 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
10554 if (unlikely(Py_SIZE(x) < 0)) {
10555 goto raise_neg_overflow;
10556 }
10557 #else
10558 {
10559 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
10560 if (unlikely(result < 0))
10561 return (int) -1;
10562 if (unlikely(result == 1))
10563 goto raise_neg_overflow;
10564 }
10565 #endif
10566 if ((sizeof(int) <= sizeof(unsigned long))) {
10567 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
10568 #ifdef HAVE_LONG_LONG
10569 } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
10570 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
10571 #endif
10572 }
10573 } else {
10574 #if CYTHON_USE_PYLONG_INTERNALS
10575 if (__Pyx_PyLong_IsCompact(x)) {
10576 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
10577 } else {
10578 const digit* digits = __Pyx_PyLong_Digits(x);
10579 assert(__Pyx_PyLong_DigitCount(x) > 1);
10580 switch (__Pyx_PyLong_SignedDigitCount(x)) {
10581 case -2:
10582 if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
10583 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
10584 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10585 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
10586 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10587 }
10588 }
10589 break;
10590 case 2:
10591 if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
10592 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
10593 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10594 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
10595 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10596 }
10597 }
10598 break;
10599 case -3:
10600 if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
10601 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
10602 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10603 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
10604 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10605 }
10606 }
10607 break;
10608 case 3:
10609 if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
10610 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
10611 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10612 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
10613 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10614 }
10615 }
10616 break;
10617 case -4:
10618 if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
10619 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
10620 __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])))
10621 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
10622 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10623 }
10624 }
10625 break;
10626 case 4:
10627 if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
10628 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
10629 __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])))
10630 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
10631 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10632 }
10633 }
10634 break;
10635 }
10636 }
10637 #endif
10638 if ((sizeof(int) <= sizeof(long))) {
10639 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
10640 #ifdef HAVE_LONG_LONG
10641 } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
10642 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
10643 #endif
10644 }
10645 }
10646 {
10647 int val;
10648 int ret = -1;
10649 #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
10650 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
10651 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
10652 if (unlikely(bytes_copied == -1)) {
10653 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
10654 goto raise_overflow;
10655 } else {
10656 ret = 0;
10657 }
10658 #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
10659 int one = 1; int is_little = (int)*(unsigned char *)&one;
10660 unsigned char *bytes = (unsigned char *)&val;
10661 ret = _PyLong_AsByteArray((PyLongObject *)x,
10662 bytes, sizeof(val),
10663 is_little, !is_unsigned);
10664 #else
10665 PyObject *v;
10666 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
10667 int bits, remaining_bits, is_negative = 0;
10668 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
10669 if (likely(PyLong_CheckExact(x))) {
10670 v = __Pyx_NewRef(x);
10671 } else {
10672 v = PyNumber_Long(x);
10673 if (unlikely(!v)) return (int) -1;
10674 assert(PyLong_CheckExact(v));
10675 }
10676 {
10677 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
10678 if (unlikely(result < 0)) {
10679 Py_DECREF(v);
10680 return (int) -1;
10681 }
10682 is_negative = result == 1;
10683 }
10684 if (is_unsigned && unlikely(is_negative)) {
10685 Py_DECREF(v);
10686 goto raise_neg_overflow;
10687 } else if (is_negative) {
10688 stepval = PyNumber_Invert(v);
10689 Py_DECREF(v);
10690 if (unlikely(!stepval))
10691 return (int) -1;
10692 } else {
10693 stepval = v;
10694 }
10695 v = NULL;
10696 val = (int) 0;
10697 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
10698 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
10699 for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
10700 PyObject *tmp, *digit;
10701 long idigit;
10702 digit = PyNumber_And(stepval, mask);
10703 if (unlikely(!digit)) goto done;
10704 idigit = PyLong_AsLong(digit);
10705 Py_DECREF(digit);
10706 if (unlikely(idigit < 0)) goto done;
10707 val |= ((int) idigit) << bits;
10708 tmp = PyNumber_Rshift(stepval, shift);
10709 if (unlikely(!tmp)) goto done;
10710 Py_DECREF(stepval); stepval = tmp;
10711 }
10712 Py_DECREF(shift); shift = NULL;
10713 Py_DECREF(mask); mask = NULL;
10714 {
10715 long idigit = PyLong_AsLong(stepval);
10716 if (unlikely(idigit < 0)) goto done;
10717 remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
10718 if (unlikely(idigit >= (1L << remaining_bits)))
10719 goto raise_overflow;
10720 val |= ((int) idigit) << bits;
10721 }
10722 if (!is_unsigned) {
10723 if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
10724 goto raise_overflow;
10725 if (is_negative)
10726 val = ~val;
10727 }
10728 ret = 0;
10729 done:
10730 Py_XDECREF(shift);
10731 Py_XDECREF(mask);
10732 Py_XDECREF(stepval);
10733 #endif
10734 if (unlikely(ret))
10735 return (int) -1;
10736 return val;
10737 }
10738 raise_overflow:
10739 PyErr_SetString(PyExc_OverflowError,
10740 "value too large to convert to int");
10741 return (int) -1;
10742 raise_neg_overflow:
10743 PyErr_SetString(PyExc_OverflowError,
10744 "can't convert negative value to int");
10745 return (int) -1;
10746 }
10747
10748 /* FormatTypeName */
10749 #if CYTHON_COMPILING_IN_LIMITED_API
10750 static __Pyx_TypeName
10751 __Pyx_PyType_GetName(PyTypeObject* tp)
10752 {
10753 PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
10754 __pyx_n_s_name);
10755 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
10756 PyErr_Clear();
10757 Py_XDECREF(name);
10758 name = __Pyx_NewRef(__pyx_n_s__8);
10759 }
10760 return name;
10761 }
10762 #endif
10763
10764 /* CIntToPy */
10765 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
10766 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
10767 #pragma GCC diagnostic push
10768 #pragma GCC diagnostic ignored "-Wconversion"
10769 #endif
10770 const long neg_one = (long) -1, const_zero = (long) 0;
10771 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
10772 #pragma GCC diagnostic pop
10773 #endif
10774 const int is_unsigned = neg_one > const_zero;
10775 if (is_unsigned) {
10776 if (sizeof(long) < sizeof(long)) {
10777 return PyInt_FromLong((long) value);
10778 } else if (sizeof(long) <= sizeof(unsigned long)) {
10779 return PyLong_FromUnsignedLong((unsigned long) value);
10780 #ifdef HAVE_LONG_LONG
10781 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
10782 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
10783 #endif
10784 }
10785 } else {
10786 if (sizeof(long) <= sizeof(long)) {
10787 return PyInt_FromLong((long) value);
10788 #ifdef HAVE_LONG_LONG
10789 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
10790 return PyLong_FromLongLong((PY_LONG_LONG) value);
10791 #endif
10792 }
10793 }
10794 {
10795 unsigned char *bytes = (unsigned char *)&value;
10796 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
10797 if (is_unsigned) {
10798 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
10799 } else {
10800 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
10801 }
10802 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
10803 int one = 1; int little = (int)*(unsigned char *)&one;
10804 return _PyLong_FromByteArray(bytes, sizeof(long),
10805 little, !is_unsigned);
10806 #else
10807 int one = 1; int little = (int)*(unsigned char *)&one;
10808 PyObject *from_bytes, *result = NULL;
10809 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
10810 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
10811 if (!from_bytes) return NULL;
10812 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
10813 if (!py_bytes) goto limited_bad;
10814 order_str = PyUnicode_FromString(little ? "little" : "big");
10815 if (!order_str) goto limited_bad;
10816 arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
10817 if (!arg_tuple) goto limited_bad;
10818 if (!is_unsigned) {
10819 kwds = PyDict_New();
10820 if (!kwds) goto limited_bad;
10821 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
10822 }
10823 result = PyObject_Call(from_bytes, arg_tuple, kwds);
10824 limited_bad:
10825 Py_XDECREF(kwds);
10826 Py_XDECREF(arg_tuple);
10827 Py_XDECREF(order_str);
10828 Py_XDECREF(py_bytes);
10829 Py_XDECREF(from_bytes);
10830 return result;
10831 #endif
10832 }
10833 }
10834
10835 /* CIntFromPy */
10836 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
10837 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
10838 #pragma GCC diagnostic push
10839 #pragma GCC diagnostic ignored "-Wconversion"
10840 #endif
10841 const long neg_one = (long) -1, const_zero = (long) 0;
10842 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
10843 #pragma GCC diagnostic pop
10844 #endif
10845 const int is_unsigned = neg_one > const_zero;
10846 #if PY_MAJOR_VERSION < 3
10847 if (likely(PyInt_Check(x))) {
10848 if ((sizeof(long) < sizeof(long))) {
10849 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
10850 } else {
10851 long val = PyInt_AS_LONG(x);
10852 if (is_unsigned && unlikely(val < 0)) {
10853 goto raise_neg_overflow;
10854 }
10855 return (long) val;
10856 }
10857 }
10858 #endif
10859 if (unlikely(!PyLong_Check(x))) {
10860 long val;
10861 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
10862 if (!tmp) return (long) -1;
10863 val = __Pyx_PyInt_As_long(tmp);
10864 Py_DECREF(tmp);
10865 return val;
10866 }
10867 if (is_unsigned) {
10868 #if CYTHON_USE_PYLONG_INTERNALS
10869 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
10870 goto raise_neg_overflow;
10871 } else if (__Pyx_PyLong_IsCompact(x)) {
10872 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
10873 } else {
10874 const digit* digits = __Pyx_PyLong_Digits(x);
10875 assert(__Pyx_PyLong_DigitCount(x) > 1);
10876 switch (__Pyx_PyLong_DigitCount(x)) {
10877 case 2:
10878 if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
10879 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
10880 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10881 } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
10882 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
10883 }
10884 }
10885 break;
10886 case 3:
10887 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
10888 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
10889 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10890 } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
10891 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
10892 }
10893 }
10894 break;
10895 case 4:
10896 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
10897 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
10898 __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])))
10899 } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
10900 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
10901 }
10902 }
10903 break;
10904 }
10905 }
10906 #endif
10907 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
10908 if (unlikely(Py_SIZE(x) < 0)) {
10909 goto raise_neg_overflow;
10910 }
10911 #else
10912 {
10913 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
10914 if (unlikely(result < 0))
10915 return (long) -1;
10916 if (unlikely(result == 1))
10917 goto raise_neg_overflow;
10918 }
10919 #endif
10920 if ((sizeof(long) <= sizeof(unsigned long))) {
10921 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
10922 #ifdef HAVE_LONG_LONG
10923 } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
10924 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
10925 #endif
10926 }
10927 } else {
10928 #if CYTHON_USE_PYLONG_INTERNALS
10929 if (__Pyx_PyLong_IsCompact(x)) {
10930 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
10931 } else {
10932 const digit* digits = __Pyx_PyLong_Digits(x);
10933 assert(__Pyx_PyLong_DigitCount(x) > 1);
10934 switch (__Pyx_PyLong_SignedDigitCount(x)) {
10935 case -2:
10936 if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
10937 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
10938 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10939 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
10940 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10941 }
10942 }
10943 break;
10944 case 2:
10945 if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
10946 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
10947 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10948 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
10949 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10950 }
10951 }
10952 break;
10953 case -3:
10954 if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
10955 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
10956 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10957 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
10958 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10959 }
10960 }
10961 break;
10962 case 3:
10963 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
10964 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
10965 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10966 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
10967 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10968 }
10969 }
10970 break;
10971 case -4:
10972 if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
10973 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
10974 __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])))
10975 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
10976 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10977 }
10978 }
10979 break;
10980 case 4:
10981 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
10982 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
10983 __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])))
10984 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
10985 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10986 }
10987 }
10988 break;
10989 }
10990 }
10991 #endif
10992 if ((sizeof(long) <= sizeof(long))) {
10993 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
10994 #ifdef HAVE_LONG_LONG
10995 } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
10996 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
10997 #endif
10998 }
10999 }
11000 {
11001 long val;
11002 int ret = -1;
11003 #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
11004 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
11005 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
11006 if (unlikely(bytes_copied == -1)) {
11007 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
11008 goto raise_overflow;
11009 } else {
11010 ret = 0;
11011 }
11012 #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
11013 int one = 1; int is_little = (int)*(unsigned char *)&one;
11014 unsigned char *bytes = (unsigned char *)&val;
11015 ret = _PyLong_AsByteArray((PyLongObject *)x,
11016 bytes, sizeof(val),
11017 is_little, !is_unsigned);
11018 #else
11019 PyObject *v;
11020 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
11021 int bits, remaining_bits, is_negative = 0;
11022 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
11023 if (likely(PyLong_CheckExact(x))) {
11024 v = __Pyx_NewRef(x);
11025 } else {
11026 v = PyNumber_Long(x);
11027 if (unlikely(!v)) return (long) -1;
11028 assert(PyLong_CheckExact(v));
11029 }
11030 {
11031 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
11032 if (unlikely(result < 0)) {
11033 Py_DECREF(v);
11034 return (long) -1;
11035 }
11036 is_negative = result == 1;
11037 }
11038 if (is_unsigned && unlikely(is_negative)) {
11039 Py_DECREF(v);
11040 goto raise_neg_overflow;
11041 } else if (is_negative) {
11042 stepval = PyNumber_Invert(v);
11043 Py_DECREF(v);
11044 if (unlikely(!stepval))
11045 return (long) -1;
11046 } else {
11047 stepval = v;
11048 }
11049 v = NULL;
11050 val = (long) 0;
11051 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
11052 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
11053 for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
11054 PyObject *tmp, *digit;
11055 long idigit;
11056 digit = PyNumber_And(stepval, mask);
11057 if (unlikely(!digit)) goto done;
11058 idigit = PyLong_AsLong(digit);
11059 Py_DECREF(digit);
11060 if (unlikely(idigit < 0)) goto done;
11061 val |= ((long) idigit) << bits;
11062 tmp = PyNumber_Rshift(stepval, shift);
11063 if (unlikely(!tmp)) goto done;
11064 Py_DECREF(stepval); stepval = tmp;
11065 }
11066 Py_DECREF(shift); shift = NULL;
11067 Py_DECREF(mask); mask = NULL;
11068 {
11069 long idigit = PyLong_AsLong(stepval);
11070 if (unlikely(idigit < 0)) goto done;
11071 remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
11072 if (unlikely(idigit >= (1L << remaining_bits)))
11073 goto raise_overflow;
11074 val |= ((long) idigit) << bits;
11075 }
11076 if (!is_unsigned) {
11077 if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
11078 goto raise_overflow;
11079 if (is_negative)
11080 val = ~val;
11081 }
11082 ret = 0;
11083 done:
11084 Py_XDECREF(shift);
11085 Py_XDECREF(mask);
11086 Py_XDECREF(stepval);
11087 #endif
11088 if (unlikely(ret))
11089 return (long) -1;
11090 return val;
11091 }
11092 raise_overflow:
11093 PyErr_SetString(PyExc_OverflowError,
11094 "value too large to convert to long");
11095 return (long) -1;
11096 raise_neg_overflow:
11097 PyErr_SetString(PyExc_OverflowError,
11098 "can't convert negative value to long");
11099 return (long) -1;
11100 }
11101
11102 /* FastTypeChecks */
11103 #if CYTHON_COMPILING_IN_CPYTHON
11104 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
11105 while (a) {
11106 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
11107 if (a == b)
11108 return 1;
11109 }
11110 return b == &PyBaseObject_Type;
11111 }
11112 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
11113 PyObject *mro;
11114 if (a == b) return 1;
11115 mro = a->tp_mro;
11116 if (likely(mro)) {
11117 Py_ssize_t i, n;
11118 n = PyTuple_GET_SIZE(mro);
11119 for (i = 0; i < n; i++) {
11120 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
11121 return 1;
11122 }
11123 return 0;
11124 }
11125 return __Pyx_InBases(a, b);
11126 }
11127 static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
11128 PyObject *mro;
11129 if (cls == a || cls == b) return 1;
11130 mro = cls->tp_mro;
11131 if (likely(mro)) {
11132 Py_ssize_t i, n;
11133 n = PyTuple_GET_SIZE(mro);
11134 for (i = 0; i < n; i++) {
11135 PyObject *base = PyTuple_GET_ITEM(mro, i);
11136 if (base == (PyObject *)a || base == (PyObject *)b)
11137 return 1;
11138 }
11139 return 0;
11140 }
11141 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
11142 }
11143 #if PY_MAJOR_VERSION == 2
11144 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
11145 PyObject *exception, *value, *tb;
11146 int res;
11147 __Pyx_PyThreadState_declare
11148 __Pyx_PyThreadState_assign
11149 __Pyx_ErrFetch(&exception, &value, &tb);
11150 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
11151 if (unlikely(res == -1)) {
11152 PyErr_WriteUnraisable(err);
11153 res = 0;
11154 }
11155 if (!res) {
11156 res = PyObject_IsSubclass(err, exc_type2);
11157 if (unlikely(res == -1)) {
11158 PyErr_WriteUnraisable(err);
11159 res = 0;
11160 }
11161 }
11162 __Pyx_ErrRestore(exception, value, tb);
11163 return res;
11164 }
11165 #else
11166 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
11167 if (exc_type1) {
11168 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
11169 } else {
11170 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
11171 }
11172 }
11173 #endif
11174 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
11175 Py_ssize_t i, n;
11176 assert(PyExceptionClass_Check(exc_type));
11177 n = PyTuple_GET_SIZE(tuple);
11178 #if PY_MAJOR_VERSION >= 3
11179 for (i=0; i<n; i++) {
11180 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
11181 }
11182 #endif
11183 for (i=0; i<n; i++) {
11184 PyObject *t = PyTuple_GET_ITEM(tuple, i);
11185 #if PY_MAJOR_VERSION < 3
11186 if (likely(exc_type == t)) return 1;
11187 #endif
11188 if (likely(PyExceptionClass_Check(t))) {
11189 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
11190 } else {
11191 }
11192 }
11193 return 0;
11194 }
11195 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
11196 if (likely(err == exc_type)) return 1;
11197 if (likely(PyExceptionClass_Check(err))) {
11198 if (likely(PyExceptionClass_Check(exc_type))) {
11199 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
11200 } else if (likely(PyTuple_Check(exc_type))) {
11201 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
11202 } else {
11203 }
11204 }
11205 return PyErr_GivenExceptionMatches(err, exc_type);
11206 }
11207 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
11208 assert(PyExceptionClass_Check(exc_type1));
11209 assert(PyExceptionClass_Check(exc_type2));
11210 if (likely(err == exc_type1 || err == exc_type2)) return 1;
11211 if (likely(PyExceptionClass_Check(err))) {
11212 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
11213 }
11214 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
11215 }
11216 #endif
11217
11218 /* CheckBinaryVersion */
11219 static unsigned long __Pyx_get_runtime_version(void) {
11220 #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
11221 return Py_Version & ~0xFFUL;
11222 #else
11223 const char* rt_version = Py_GetVersion();
11224 unsigned long version = 0;
11225 unsigned long factor = 0x01000000UL;
11226 unsigned int digit = 0;
11227 int i = 0;
11228 while (factor) {
11229 while ('0' <= rt_version[i] && rt_version[i] <= '9') {
11230 digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
11231 ++i;
11232 }
11233 version += factor * digit;
11234 if (rt_version[i] != '.')
11235 break;
11236 digit = 0;
11237 factor >>= 8;
11238 ++i;
11239 }
11240 return version;
11241 #endif
11242 }
11243 static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
11244 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
11245 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
11246 return 0;
11247 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
11248 return 1;
11249 {
11250 char message[200];
11251 PyOS_snprintf(message, sizeof(message),
11252 "compile time Python version %d.%d "
11253 "of module '%.100s' "
11254 "%s "
11255 "runtime version %d.%d",
11256 (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
11257 __Pyx_MODULE_NAME,
11258 (allow_newer) ? "was newer than" : "does not match",
11259 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
11260 );
11261 return PyErr_WarnEx(NULL, message, 1);
11262 }
11263 }
11264
11265 /* InitStrings */
11266 #if PY_MAJOR_VERSION >= 3
11267 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
11268 if (t.is_unicode | t.is_str) {
11269 if (t.intern) {
11270 *str = PyUnicode_InternFromString(t.s);
11271 } else if (t.encoding) {
11272 *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
11273 } else {
11274 *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
11275 }
11276 } else {
11277 *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
11278 }
11279 if (!*str)
11280 return -1;
11281 if (PyObject_Hash(*str) == -1)
11282 return -1;
11283 return 0;
11284 }
11285 #endif
11286 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
11287 while (t->p) {
11288 #if PY_MAJOR_VERSION >= 3
11289 __Pyx_InitString(*t, t->p);
11290 #else
11291 if (t->is_unicode) {
11292 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
11293 } else if (t->intern) {
11294 *t->p = PyString_InternFromString(t->s);
11295 } else {
11296 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
11297 }
11298 if (!*t->p)
11299 return -1;
11300 if (PyObject_Hash(*t->p) == -1)
11301 return -1;
11302 #endif
11303 ++t;
11304 }
11305 return 0;
11306 }
11307
11308 #include <string.h>
11309 static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
11310 size_t len = strlen(s);
11311 if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
11312 PyErr_SetString(PyExc_OverflowError, "byte string is too long");
11313 return -1;
11314 }
11315 return (Py_ssize_t) len;
11316 }
11317 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
11318 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
11319 if (unlikely(len < 0)) return NULL;
11320 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
11321 }
11322 static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
11323 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
11324 if (unlikely(len < 0)) return NULL;
11325 return PyByteArray_FromStringAndSize(c_str, len);
11326 }
11327 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
11328 Py_ssize_t ignore;
11329 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
11330 }
11331 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
11332 #if !CYTHON_PEP393_ENABLED
11333 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
11334 char* defenc_c;
11335 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
11336 if (!defenc) return NULL;
11337 defenc_c = PyBytes_AS_STRING(defenc);
11338 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
11339 {
11340 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
11341 char* c;
11342 for (c = defenc_c; c < end; c++) {
11343 if ((unsigned char) (*c) >= 128) {
11344 PyUnicode_AsASCIIString(o);
11345 return NULL;
11346 }
11347 }
11348 }
11349 #endif
11350 *length = PyBytes_GET_SIZE(defenc);
11351 return defenc_c;
11352 }
11353 #else
11354 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
11355 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
11356 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
11357 if (likely(PyUnicode_IS_ASCII(o))) {
11358 *length = PyUnicode_GET_LENGTH(o);
11359 return PyUnicode_AsUTF8(o);
11360 } else {
11361 PyUnicode_AsASCIIString(o);
11362 return NULL;
11363 }
11364 #else
11365 return PyUnicode_AsUTF8AndSize(o, length);
11366 #endif
11367 }
11368 #endif
11369 #endif
11370 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
11371 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
11372 if (
11373 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
11374 __Pyx_sys_getdefaultencoding_not_ascii &&
11375 #endif
11376 PyUnicode_Check(o)) {
11377 return __Pyx_PyUnicode_AsStringAndSize(o, length);
11378 } else
11379 #endif
11380 #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
11381 if (PyByteArray_Check(o)) {
11382 *length = PyByteArray_GET_SIZE(o);
11383 return PyByteArray_AS_STRING(o);
11384 } else
11385 #endif
11386 {
11387 char* result;
11388 int r = PyBytes_AsStringAndSize(o, &result, length);
11389 if (unlikely(r < 0)) {
11390 return NULL;
11391 } else {
11392 return result;
11393 }
11394 }
11395 }
11396 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
11397 int is_true = x == Py_True;
11398 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
11399 else return PyObject_IsTrue(x);
11400 }
11401 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
11402 int retval;
11403 if (unlikely(!x)) return -1;
11404 retval = __Pyx_PyObject_IsTrue(x);
11405 Py_DECREF(x);
11406 return retval;
11407 }
11408 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
11409 __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
11410 #if PY_MAJOR_VERSION >= 3
11411 if (PyLong_Check(result)) {
11412 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
11413 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
11414 "The ability to return an instance of a strict subclass of int is deprecated, "
11415 "and may be removed in a future version of Python.",
11416 result_type_name)) {
11417 __Pyx_DECREF_TypeName(result_type_name);
11418 Py_DECREF(result);
11419 return NULL;
11420 }
11421 __Pyx_DECREF_TypeName(result_type_name);
11422 return result;
11423 }
11424 #endif
11425 PyErr_Format(PyExc_TypeError,
11426 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
11427 type_name, type_name, result_type_name);
11428 __Pyx_DECREF_TypeName(result_type_name);
11429 Py_DECREF(result);
11430 return NULL;
11431 }
11432 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
11433 #if CYTHON_USE_TYPE_SLOTS
11434 PyNumberMethods *m;
11435 #endif
11436 const char *name = NULL;
11437 PyObject *res = NULL;
11438 #if PY_MAJOR_VERSION < 3
11439 if (likely(PyInt_Check(x) || PyLong_Check(x)))
11440 #else
11441 if (likely(PyLong_Check(x)))
11442 #endif
11443 return __Pyx_NewRef(x);
11444 #if CYTHON_USE_TYPE_SLOTS
11445 m = Py_TYPE(x)->tp_as_number;
11446 #if PY_MAJOR_VERSION < 3
11447 if (m && m->nb_int) {
11448 name = "int";
11449 res = m->nb_int(x);
11450 }
11451 else if (m && m->nb_long) {
11452 name = "long";
11453 res = m->nb_long(x);
11454 }
11455 #else
11456 if (likely(m && m->nb_int)) {
11457 name = "int";
11458 res = m->nb_int(x);
11459 }
11460 #endif
11461 #else
11462 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
11463 res = PyNumber_Int(x);
11464 }
11465 #endif
11466 if (likely(res)) {
11467 #if PY_MAJOR_VERSION < 3
11468 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
11469 #else
11470 if (unlikely(!PyLong_CheckExact(res))) {
11471 #endif
11472 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
11473 }
11474 }
11475 else if (!PyErr_Occurred()) {
11476 PyErr_SetString(PyExc_TypeError,
11477 "an integer is required");
11478 }
11479 return res;
11480 }
11481 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
11482 Py_ssize_t ival;
11483 PyObject *x;
11484 #if PY_MAJOR_VERSION < 3
11485 if (likely(PyInt_CheckExact(b))) {
11486 if (sizeof(Py_ssize_t) >= sizeof(long))
11487 return PyInt_AS_LONG(b);
11488 else
11489 return PyInt_AsSsize_t(b);
11490 }
11491 #endif
11492 if (likely(PyLong_CheckExact(b))) {
11493 #if CYTHON_USE_PYLONG_INTERNALS
11494 if (likely(__Pyx_PyLong_IsCompact(b))) {
11495 return __Pyx_PyLong_CompactValue(b);
11496 } else {
11497 const digit* digits = __Pyx_PyLong_Digits(b);
11498 const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
11499 switch (size) {
11500 case 2:
11501 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
11502 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
11503 }
11504 break;
11505 case -2:
11506 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
11507 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
11508 }
11509 break;
11510 case 3:
11511 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
11512 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
11513 }
11514 break;
11515 case -3:
11516 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
11517 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
11518 }
11519 break;
11520 case 4:
11521 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
11522 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]));
11523 }
11524 break;
11525 case -4:
11526 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
11527 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]));
11528 }
11529 break;
11530 }
11531 }
11532 #endif
11533 return PyLong_AsSsize_t(b);
11534 }
11535 x = PyNumber_Index(b);
11536 if (!x) return -1;
11537 ival = PyInt_AsSsize_t(x);
11538 Py_DECREF(x);
11539 return ival;
11540 }
11541 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
11542 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
11543 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
11544 #if PY_MAJOR_VERSION < 3
11545 } else if (likely(PyInt_CheckExact(o))) {
11546 return PyInt_AS_LONG(o);
11547 #endif
11548 } else {
11549 Py_ssize_t ival;
11550 PyObject *x;
11551 x = PyNumber_Index(o);
11552 if (!x) return -1;
11553 ival = PyInt_AsLong(x);
11554 Py_DECREF(x);
11555 return ival;
11556 }
11557 }
11558 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
11559 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
11560 }
11561 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
11562 return PyInt_FromSize_t(ival);
11563 }
11564
11565
11566 /* #### Code section: utility_code_pragmas_end ### */
11567 #ifdef _MSC_VER
11568 #pragma warning( pop )
11569 #endif
11570
11571
11572
11573 /* #### Code section: end ### */
11574 #endif /* Py_PYTHON_H */