Mercurial > repos > rliterman > csp2
comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/site-packages/pysam/libctabix.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 "build/lib.linux-x86_64-cpython-37/pysam", | |
66 "build/lib.linux-x86_64-cpython-37/pysam" | |
67 ], | |
68 "name": "pysam.libctabix", | |
69 "sources": [ | |
70 "pysam/libctabix.pyx" | |
71 ] | |
72 }, | |
73 "module_name": "pysam.libctabix" | |
74 } | |
75 END: Cython Metadata */ | |
76 | |
77 #ifndef PY_SSIZE_T_CLEAN | |
78 #define PY_SSIZE_T_CLEAN | |
79 #endif /* PY_SSIZE_T_CLEAN */ | |
80 #if defined(CYTHON_LIMITED_API) && 0 | |
81 #ifndef Py_LIMITED_API | |
82 #if CYTHON_LIMITED_API+0 > 0x03030000 | |
83 #define Py_LIMITED_API CYTHON_LIMITED_API | |
84 #else | |
85 #define Py_LIMITED_API 0x03030000 | |
86 #endif | |
87 #endif | |
88 #endif | |
89 | |
90 #include "Python.h" | |
91 | |
92 #if PY_MAJOR_VERSION >= 3 | |
93 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj) | |
94 #else | |
95 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL) | |
96 #endif | |
97 | |
98 | |
99 #if PY_MAJOR_VERSION <= 2 | |
100 #define PyDict_GetItemWithError _PyDict_GetItemWithError | |
101 #endif | |
102 | |
103 | |
104 #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get) | |
105 #define PyContextVar_Get(var, d, v) ((d) ? ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) : ((v)[0] = NULL, 0) ) | |
106 #endif | |
107 | |
108 #ifndef Py_PYTHON_H | |
109 #error Python headers needed to compile C extensions, please install development version of Python. | |
110 #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) | |
111 #error Cython requires Python 2.7+ or Python 3.3+. | |
112 #else | |
113 #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API | |
114 #define __PYX_EXTRA_ABI_MODULE_NAME "limited" | |
115 #else | |
116 #define __PYX_EXTRA_ABI_MODULE_NAME "" | |
117 #endif | |
118 #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME | |
119 #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI | |
120 #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." | |
121 #define CYTHON_HEX_VERSION 0x03000BF0 | |
122 #define CYTHON_FUTURE_DIVISION 1 | |
123 #include <stddef.h> | |
124 #ifndef offsetof | |
125 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) | |
126 #endif | |
127 #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) | |
128 #ifndef __stdcall | |
129 #define __stdcall | |
130 #endif | |
131 #ifndef __cdecl | |
132 #define __cdecl | |
133 #endif | |
134 #ifndef __fastcall | |
135 #define __fastcall | |
136 #endif | |
137 #endif | |
138 #ifndef DL_IMPORT | |
139 #define DL_IMPORT(t) t | |
140 #endif | |
141 #ifndef DL_EXPORT | |
142 #define DL_EXPORT(t) t | |
143 #endif | |
144 #define __PYX_COMMA , | |
145 #ifndef HAVE_LONG_LONG | |
146 #define HAVE_LONG_LONG | |
147 #endif | |
148 #ifndef PY_LONG_LONG | |
149 #define PY_LONG_LONG LONG_LONG | |
150 #endif | |
151 #ifndef Py_HUGE_VAL | |
152 #define Py_HUGE_VAL HUGE_VAL | |
153 #endif | |
154 #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX | |
155 #if defined(GRAALVM_PYTHON) | |
156 /* For very preliminary testing purposes. Most variables are set the same as PyPy. | |
157 The existence of this section does not imply that anything works or is even tested */ | |
158 #define CYTHON_COMPILING_IN_PYPY 0 | |
159 #define CYTHON_COMPILING_IN_CPYTHON 0 | |
160 #define CYTHON_COMPILING_IN_LIMITED_API 0 | |
161 #define CYTHON_COMPILING_IN_GRAAL 1 | |
162 #define CYTHON_COMPILING_IN_NOGIL 0 | |
163 #undef CYTHON_USE_TYPE_SLOTS | |
164 #define CYTHON_USE_TYPE_SLOTS 0 | |
165 #undef CYTHON_USE_TYPE_SPECS | |
166 #define CYTHON_USE_TYPE_SPECS 0 | |
167 #undef CYTHON_USE_PYTYPE_LOOKUP | |
168 #define CYTHON_USE_PYTYPE_LOOKUP 0 | |
169 #if PY_VERSION_HEX < 0x03050000 | |
170 #undef CYTHON_USE_ASYNC_SLOTS | |
171 #define CYTHON_USE_ASYNC_SLOTS 0 | |
172 #elif !defined(CYTHON_USE_ASYNC_SLOTS) | |
173 #define CYTHON_USE_ASYNC_SLOTS 1 | |
174 #endif | |
175 #undef CYTHON_USE_PYLIST_INTERNALS | |
176 #define CYTHON_USE_PYLIST_INTERNALS 0 | |
177 #undef CYTHON_USE_UNICODE_INTERNALS | |
178 #define CYTHON_USE_UNICODE_INTERNALS 0 | |
179 #undef CYTHON_USE_UNICODE_WRITER | |
180 #define CYTHON_USE_UNICODE_WRITER 0 | |
181 #undef CYTHON_USE_PYLONG_INTERNALS | |
182 #define CYTHON_USE_PYLONG_INTERNALS 0 | |
183 #undef CYTHON_AVOID_BORROWED_REFS | |
184 #define CYTHON_AVOID_BORROWED_REFS 1 | |
185 #undef CYTHON_ASSUME_SAFE_MACROS | |
186 #define CYTHON_ASSUME_SAFE_MACROS 0 | |
187 #undef CYTHON_UNPACK_METHODS | |
188 #define CYTHON_UNPACK_METHODS 0 | |
189 #undef CYTHON_FAST_THREAD_STATE | |
190 #define CYTHON_FAST_THREAD_STATE 0 | |
191 #undef CYTHON_FAST_GIL | |
192 #define CYTHON_FAST_GIL 0 | |
193 #undef CYTHON_METH_FASTCALL | |
194 #define CYTHON_METH_FASTCALL 0 | |
195 #undef CYTHON_FAST_PYCALL | |
196 #define CYTHON_FAST_PYCALL 0 | |
197 #ifndef CYTHON_PEP487_INIT_SUBCLASS | |
198 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) | |
199 #endif | |
200 #undef CYTHON_PEP489_MULTI_PHASE_INIT | |
201 #define CYTHON_PEP489_MULTI_PHASE_INIT 1 | |
202 #undef CYTHON_USE_MODULE_STATE | |
203 #define CYTHON_USE_MODULE_STATE 0 | |
204 #undef CYTHON_USE_TP_FINALIZE | |
205 #define CYTHON_USE_TP_FINALIZE 0 | |
206 #undef CYTHON_USE_DICT_VERSIONS | |
207 #define CYTHON_USE_DICT_VERSIONS 0 | |
208 #undef CYTHON_USE_EXC_INFO_STACK | |
209 #define CYTHON_USE_EXC_INFO_STACK 0 | |
210 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC | |
211 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 | |
212 #endif | |
213 #undef CYTHON_USE_FREELISTS | |
214 #define CYTHON_USE_FREELISTS 0 | |
215 #elif defined(PYPY_VERSION) | |
216 #define CYTHON_COMPILING_IN_PYPY 1 | |
217 #define CYTHON_COMPILING_IN_CPYTHON 0 | |
218 #define CYTHON_COMPILING_IN_LIMITED_API 0 | |
219 #define CYTHON_COMPILING_IN_GRAAL 0 | |
220 #define CYTHON_COMPILING_IN_NOGIL 0 | |
221 #undef CYTHON_USE_TYPE_SLOTS | |
222 #define CYTHON_USE_TYPE_SLOTS 0 | |
223 #ifndef CYTHON_USE_TYPE_SPECS | |
224 #define CYTHON_USE_TYPE_SPECS 0 | |
225 #endif | |
226 #undef CYTHON_USE_PYTYPE_LOOKUP | |
227 #define CYTHON_USE_PYTYPE_LOOKUP 0 | |
228 #if PY_VERSION_HEX < 0x03050000 | |
229 #undef CYTHON_USE_ASYNC_SLOTS | |
230 #define CYTHON_USE_ASYNC_SLOTS 0 | |
231 #elif !defined(CYTHON_USE_ASYNC_SLOTS) | |
232 #define CYTHON_USE_ASYNC_SLOTS 1 | |
233 #endif | |
234 #undef CYTHON_USE_PYLIST_INTERNALS | |
235 #define CYTHON_USE_PYLIST_INTERNALS 0 | |
236 #undef CYTHON_USE_UNICODE_INTERNALS | |
237 #define CYTHON_USE_UNICODE_INTERNALS 0 | |
238 #undef CYTHON_USE_UNICODE_WRITER | |
239 #define CYTHON_USE_UNICODE_WRITER 0 | |
240 #undef CYTHON_USE_PYLONG_INTERNALS | |
241 #define CYTHON_USE_PYLONG_INTERNALS 0 | |
242 #undef CYTHON_AVOID_BORROWED_REFS | |
243 #define CYTHON_AVOID_BORROWED_REFS 1 | |
244 #undef CYTHON_ASSUME_SAFE_MACROS | |
245 #define CYTHON_ASSUME_SAFE_MACROS 0 | |
246 #undef CYTHON_UNPACK_METHODS | |
247 #define CYTHON_UNPACK_METHODS 0 | |
248 #undef CYTHON_FAST_THREAD_STATE | |
249 #define CYTHON_FAST_THREAD_STATE 0 | |
250 #undef CYTHON_FAST_GIL | |
251 #define CYTHON_FAST_GIL 0 | |
252 #undef CYTHON_METH_FASTCALL | |
253 #define CYTHON_METH_FASTCALL 0 | |
254 #undef CYTHON_FAST_PYCALL | |
255 #define CYTHON_FAST_PYCALL 0 | |
256 #ifndef CYTHON_PEP487_INIT_SUBCLASS | |
257 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) | |
258 #endif | |
259 #if PY_VERSION_HEX < 0x03090000 | |
260 #undef CYTHON_PEP489_MULTI_PHASE_INIT | |
261 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 | |
262 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) | |
263 #define CYTHON_PEP489_MULTI_PHASE_INIT 1 | |
264 #endif | |
265 #undef CYTHON_USE_MODULE_STATE | |
266 #define CYTHON_USE_MODULE_STATE 0 | |
267 #undef CYTHON_USE_TP_FINALIZE | |
268 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) | |
269 #undef CYTHON_USE_DICT_VERSIONS | |
270 #define CYTHON_USE_DICT_VERSIONS 0 | |
271 #undef CYTHON_USE_EXC_INFO_STACK | |
272 #define CYTHON_USE_EXC_INFO_STACK 0 | |
273 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC | |
274 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 | |
275 #endif | |
276 #undef CYTHON_USE_FREELISTS | |
277 #define CYTHON_USE_FREELISTS 0 | |
278 #elif defined(CYTHON_LIMITED_API) | |
279 #ifdef Py_LIMITED_API | |
280 #undef __PYX_LIMITED_VERSION_HEX | |
281 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API | |
282 #endif | |
283 #define CYTHON_COMPILING_IN_PYPY 0 | |
284 #define CYTHON_COMPILING_IN_CPYTHON 0 | |
285 #define CYTHON_COMPILING_IN_LIMITED_API 1 | |
286 #define CYTHON_COMPILING_IN_GRAAL 0 | |
287 #define CYTHON_COMPILING_IN_NOGIL 0 | |
288 #undef CYTHON_CLINE_IN_TRACEBACK | |
289 #define CYTHON_CLINE_IN_TRACEBACK 0 | |
290 #undef CYTHON_USE_TYPE_SLOTS | |
291 #define CYTHON_USE_TYPE_SLOTS 0 | |
292 #undef CYTHON_USE_TYPE_SPECS | |
293 #define CYTHON_USE_TYPE_SPECS 1 | |
294 #undef CYTHON_USE_PYTYPE_LOOKUP | |
295 #define CYTHON_USE_PYTYPE_LOOKUP 0 | |
296 #undef CYTHON_USE_ASYNC_SLOTS | |
297 #define CYTHON_USE_ASYNC_SLOTS 0 | |
298 #undef CYTHON_USE_PYLIST_INTERNALS | |
299 #define CYTHON_USE_PYLIST_INTERNALS 0 | |
300 #undef CYTHON_USE_UNICODE_INTERNALS | |
301 #define CYTHON_USE_UNICODE_INTERNALS 0 | |
302 #ifndef CYTHON_USE_UNICODE_WRITER | |
303 #define CYTHON_USE_UNICODE_WRITER 0 | |
304 #endif | |
305 #undef CYTHON_USE_PYLONG_INTERNALS | |
306 #define CYTHON_USE_PYLONG_INTERNALS 0 | |
307 #ifndef CYTHON_AVOID_BORROWED_REFS | |
308 #define CYTHON_AVOID_BORROWED_REFS 0 | |
309 #endif | |
310 #undef CYTHON_ASSUME_SAFE_MACROS | |
311 #define CYTHON_ASSUME_SAFE_MACROS 0 | |
312 #undef CYTHON_UNPACK_METHODS | |
313 #define CYTHON_UNPACK_METHODS 0 | |
314 #undef CYTHON_FAST_THREAD_STATE | |
315 #define CYTHON_FAST_THREAD_STATE 0 | |
316 #undef CYTHON_FAST_GIL | |
317 #define CYTHON_FAST_GIL 0 | |
318 #undef CYTHON_METH_FASTCALL | |
319 #define CYTHON_METH_FASTCALL 0 | |
320 #undef CYTHON_FAST_PYCALL | |
321 #define CYTHON_FAST_PYCALL 0 | |
322 #ifndef CYTHON_PEP487_INIT_SUBCLASS | |
323 #define CYTHON_PEP487_INIT_SUBCLASS 1 | |
324 #endif | |
325 #undef CYTHON_PEP489_MULTI_PHASE_INIT | |
326 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 | |
327 #undef CYTHON_USE_MODULE_STATE | |
328 #define CYTHON_USE_MODULE_STATE 1 | |
329 #ifndef CYTHON_USE_TP_FINALIZE | |
330 #define CYTHON_USE_TP_FINALIZE 0 | |
331 #endif | |
332 #undef CYTHON_USE_DICT_VERSIONS | |
333 #define CYTHON_USE_DICT_VERSIONS 0 | |
334 #undef CYTHON_USE_EXC_INFO_STACK | |
335 #define CYTHON_USE_EXC_INFO_STACK 0 | |
336 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC | |
337 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 | |
338 #endif | |
339 #undef CYTHON_USE_FREELISTS | |
340 #define CYTHON_USE_FREELISTS 0 | |
341 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) | |
342 #define CYTHON_COMPILING_IN_PYPY 0 | |
343 #define CYTHON_COMPILING_IN_CPYTHON 0 | |
344 #define CYTHON_COMPILING_IN_LIMITED_API 0 | |
345 #define CYTHON_COMPILING_IN_GRAAL 0 | |
346 #define CYTHON_COMPILING_IN_NOGIL 1 | |
347 #ifndef CYTHON_USE_TYPE_SLOTS | |
348 #define CYTHON_USE_TYPE_SLOTS 1 | |
349 #endif | |
350 #ifndef CYTHON_USE_TYPE_SPECS | |
351 #define CYTHON_USE_TYPE_SPECS 0 | |
352 #endif | |
353 #undef CYTHON_USE_PYTYPE_LOOKUP | |
354 #define CYTHON_USE_PYTYPE_LOOKUP 0 | |
355 #ifndef CYTHON_USE_ASYNC_SLOTS | |
356 #define CYTHON_USE_ASYNC_SLOTS 1 | |
357 #endif | |
358 #ifndef CYTHON_USE_PYLONG_INTERNALS | |
359 #define CYTHON_USE_PYLONG_INTERNALS 0 | |
360 #endif | |
361 #undef CYTHON_USE_PYLIST_INTERNALS | |
362 #define CYTHON_USE_PYLIST_INTERNALS 0 | |
363 #ifndef CYTHON_USE_UNICODE_INTERNALS | |
364 #define CYTHON_USE_UNICODE_INTERNALS 1 | |
365 #endif | |
366 #undef CYTHON_USE_UNICODE_WRITER | |
367 #define CYTHON_USE_UNICODE_WRITER 0 | |
368 #ifndef CYTHON_AVOID_BORROWED_REFS | |
369 #define CYTHON_AVOID_BORROWED_REFS 0 | |
370 #endif | |
371 #ifndef CYTHON_ASSUME_SAFE_MACROS | |
372 #define CYTHON_ASSUME_SAFE_MACROS 1 | |
373 #endif | |
374 #ifndef CYTHON_UNPACK_METHODS | |
375 #define CYTHON_UNPACK_METHODS 1 | |
376 #endif | |
377 #undef CYTHON_FAST_THREAD_STATE | |
378 #define CYTHON_FAST_THREAD_STATE 0 | |
379 #undef CYTHON_FAST_GIL | |
380 #define CYTHON_FAST_GIL 0 | |
381 #ifndef CYTHON_METH_FASTCALL | |
382 #define CYTHON_METH_FASTCALL 1 | |
383 #endif | |
384 #undef CYTHON_FAST_PYCALL | |
385 #define CYTHON_FAST_PYCALL 0 | |
386 #ifndef CYTHON_PEP487_INIT_SUBCLASS | |
387 #define CYTHON_PEP487_INIT_SUBCLASS 1 | |
388 #endif | |
389 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT | |
390 #define CYTHON_PEP489_MULTI_PHASE_INIT 1 | |
391 #endif | |
392 #ifndef CYTHON_USE_MODULE_STATE | |
393 #define CYTHON_USE_MODULE_STATE 0 | |
394 #endif | |
395 #ifndef CYTHON_USE_TP_FINALIZE | |
396 #define CYTHON_USE_TP_FINALIZE 1 | |
397 #endif | |
398 #undef CYTHON_USE_DICT_VERSIONS | |
399 #define CYTHON_USE_DICT_VERSIONS 0 | |
400 #undef CYTHON_USE_EXC_INFO_STACK | |
401 #define CYTHON_USE_EXC_INFO_STACK 0 | |
402 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC | |
403 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 | |
404 #endif | |
405 #ifndef CYTHON_USE_FREELISTS | |
406 #define CYTHON_USE_FREELISTS 0 | |
407 #endif | |
408 #else | |
409 #define CYTHON_COMPILING_IN_PYPY 0 | |
410 #define CYTHON_COMPILING_IN_CPYTHON 1 | |
411 #define CYTHON_COMPILING_IN_LIMITED_API 0 | |
412 #define CYTHON_COMPILING_IN_GRAAL 0 | |
413 #define CYTHON_COMPILING_IN_NOGIL 0 | |
414 #ifndef CYTHON_USE_TYPE_SLOTS | |
415 #define CYTHON_USE_TYPE_SLOTS 1 | |
416 #endif | |
417 #ifndef CYTHON_USE_TYPE_SPECS | |
418 #define CYTHON_USE_TYPE_SPECS 0 | |
419 #endif | |
420 #ifndef CYTHON_USE_PYTYPE_LOOKUP | |
421 #define CYTHON_USE_PYTYPE_LOOKUP 1 | |
422 #endif | |
423 #if PY_MAJOR_VERSION < 3 | |
424 #undef CYTHON_USE_ASYNC_SLOTS | |
425 #define CYTHON_USE_ASYNC_SLOTS 0 | |
426 #elif !defined(CYTHON_USE_ASYNC_SLOTS) | |
427 #define CYTHON_USE_ASYNC_SLOTS 1 | |
428 #endif | |
429 #ifndef CYTHON_USE_PYLONG_INTERNALS | |
430 #define CYTHON_USE_PYLONG_INTERNALS 1 | |
431 #endif | |
432 #ifndef CYTHON_USE_PYLIST_INTERNALS | |
433 #define CYTHON_USE_PYLIST_INTERNALS 1 | |
434 #endif | |
435 #ifndef CYTHON_USE_UNICODE_INTERNALS | |
436 #define CYTHON_USE_UNICODE_INTERNALS 1 | |
437 #endif | |
438 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 | |
439 #undef CYTHON_USE_UNICODE_WRITER | |
440 #define CYTHON_USE_UNICODE_WRITER 0 | |
441 #elif !defined(CYTHON_USE_UNICODE_WRITER) | |
442 #define CYTHON_USE_UNICODE_WRITER 1 | |
443 #endif | |
444 #ifndef CYTHON_AVOID_BORROWED_REFS | |
445 #define CYTHON_AVOID_BORROWED_REFS 0 | |
446 #endif | |
447 #ifndef CYTHON_ASSUME_SAFE_MACROS | |
448 #define CYTHON_ASSUME_SAFE_MACROS 1 | |
449 #endif | |
450 #ifndef CYTHON_UNPACK_METHODS | |
451 #define CYTHON_UNPACK_METHODS 1 | |
452 #endif | |
453 #ifndef CYTHON_FAST_THREAD_STATE | |
454 #define CYTHON_FAST_THREAD_STATE 1 | |
455 #endif | |
456 #ifndef CYTHON_FAST_GIL | |
457 #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) | |
458 #endif | |
459 #ifndef CYTHON_METH_FASTCALL | |
460 #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) | |
461 #endif | |
462 #ifndef CYTHON_FAST_PYCALL | |
463 #define CYTHON_FAST_PYCALL 1 | |
464 #endif | |
465 #ifndef CYTHON_PEP487_INIT_SUBCLASS | |
466 #define CYTHON_PEP487_INIT_SUBCLASS 1 | |
467 #endif | |
468 #if PY_VERSION_HEX < 0x03050000 | |
469 #undef CYTHON_PEP489_MULTI_PHASE_INIT | |
470 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 | |
471 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) | |
472 #define CYTHON_PEP489_MULTI_PHASE_INIT 1 | |
473 #endif | |
474 #ifndef CYTHON_USE_MODULE_STATE | |
475 #define CYTHON_USE_MODULE_STATE 0 | |
476 #endif | |
477 #if PY_VERSION_HEX < 0x030400a1 | |
478 #undef CYTHON_USE_TP_FINALIZE | |
479 #define CYTHON_USE_TP_FINALIZE 0 | |
480 #elif !defined(CYTHON_USE_TP_FINALIZE) | |
481 #define CYTHON_USE_TP_FINALIZE 1 | |
482 #endif | |
483 #if PY_VERSION_HEX < 0x030600B1 | |
484 #undef CYTHON_USE_DICT_VERSIONS | |
485 #define CYTHON_USE_DICT_VERSIONS 0 | |
486 #elif !defined(CYTHON_USE_DICT_VERSIONS) | |
487 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) | |
488 #endif | |
489 #if PY_VERSION_HEX < 0x030700A3 | |
490 #undef CYTHON_USE_EXC_INFO_STACK | |
491 #define CYTHON_USE_EXC_INFO_STACK 0 | |
492 #elif !defined(CYTHON_USE_EXC_INFO_STACK) | |
493 #define CYTHON_USE_EXC_INFO_STACK 1 | |
494 #endif | |
495 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC | |
496 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 | |
497 #endif | |
498 #ifndef CYTHON_USE_FREELISTS | |
499 #define CYTHON_USE_FREELISTS 1 | |
500 #endif | |
501 #endif | |
502 #if !defined(CYTHON_FAST_PYCCALL) | |
503 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) | |
504 #endif | |
505 #if !defined(CYTHON_VECTORCALL) | |
506 #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) | |
507 #endif | |
508 #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) | |
509 #if CYTHON_USE_PYLONG_INTERNALS | |
510 #if PY_MAJOR_VERSION < 3 | |
511 #include "longintrepr.h" | |
512 #endif | |
513 #undef SHIFT | |
514 #undef BASE | |
515 #undef MASK | |
516 #ifdef SIZEOF_VOID_P | |
517 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; | |
518 #endif | |
519 #endif | |
520 #ifndef __has_attribute | |
521 #define __has_attribute(x) 0 | |
522 #endif | |
523 #ifndef __has_cpp_attribute | |
524 #define __has_cpp_attribute(x) 0 | |
525 #endif | |
526 #ifndef CYTHON_RESTRICT | |
527 #if defined(__GNUC__) | |
528 #define CYTHON_RESTRICT __restrict__ | |
529 #elif defined(_MSC_VER) && _MSC_VER >= 1400 | |
530 #define CYTHON_RESTRICT __restrict | |
531 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | |
532 #define CYTHON_RESTRICT restrict | |
533 #else | |
534 #define CYTHON_RESTRICT | |
535 #endif | |
536 #endif | |
537 #ifndef CYTHON_UNUSED | |
538 #if defined(__cplusplus) | |
539 /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 | |
540 * but leads to warnings with -pedantic, since it is a C++17 feature */ | |
541 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) | |
542 #if __has_cpp_attribute(maybe_unused) | |
543 #define CYTHON_UNUSED [[maybe_unused]] | |
544 #endif | |
545 #endif | |
546 #endif | |
547 #endif | |
548 #ifndef CYTHON_UNUSED | |
549 # if defined(__GNUC__) | |
550 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) | |
551 # define CYTHON_UNUSED __attribute__ ((__unused__)) | |
552 # else | |
553 # define CYTHON_UNUSED | |
554 # endif | |
555 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) | |
556 # define CYTHON_UNUSED __attribute__ ((__unused__)) | |
557 # else | |
558 # define CYTHON_UNUSED | |
559 # endif | |
560 #endif | |
561 #ifndef CYTHON_UNUSED_VAR | |
562 # if defined(__cplusplus) | |
563 template<class T> void CYTHON_UNUSED_VAR( const T& ) { } | |
564 # else | |
565 # define CYTHON_UNUSED_VAR(x) (void)(x) | |
566 # endif | |
567 #endif | |
568 #ifndef CYTHON_MAYBE_UNUSED_VAR | |
569 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) | |
570 #endif | |
571 #ifndef CYTHON_NCP_UNUSED | |
572 # if CYTHON_COMPILING_IN_CPYTHON | |
573 # define CYTHON_NCP_UNUSED | |
574 # else | |
575 # define CYTHON_NCP_UNUSED CYTHON_UNUSED | |
576 # endif | |
577 #endif | |
578 #ifndef CYTHON_USE_CPP_STD_MOVE | |
579 #if defined(__cplusplus) && (\ | |
580 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) | |
581 #define CYTHON_USE_CPP_STD_MOVE 1 | |
582 #else | |
583 #define CYTHON_USE_CPP_STD_MOVE 0 | |
584 #endif | |
585 #endif | |
586 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) | |
587 #ifdef _MSC_VER | |
588 #ifndef _MSC_STDINT_H_ | |
589 #if _MSC_VER < 1300 | |
590 typedef unsigned char uint8_t; | |
591 typedef unsigned short uint16_t; | |
592 typedef unsigned int uint32_t; | |
593 #else | |
594 typedef unsigned __int8 uint8_t; | |
595 typedef unsigned __int16 uint16_t; | |
596 typedef unsigned __int32 uint32_t; | |
597 #endif | |
598 #endif | |
599 #if _MSC_VER < 1300 | |
600 #ifdef _WIN64 | |
601 typedef unsigned long long __pyx_uintptr_t; | |
602 #else | |
603 typedef unsigned int __pyx_uintptr_t; | |
604 #endif | |
605 #else | |
606 #ifdef _WIN64 | |
607 typedef unsigned __int64 __pyx_uintptr_t; | |
608 #else | |
609 typedef unsigned __int32 __pyx_uintptr_t; | |
610 #endif | |
611 #endif | |
612 #else | |
613 #include <stdint.h> | |
614 typedef uintptr_t __pyx_uintptr_t; | |
615 #endif | |
616 #ifndef CYTHON_FALLTHROUGH | |
617 #if defined(__cplusplus) | |
618 /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 | |
619 * but leads to warnings with -pedantic, since it is a C++17 feature */ | |
620 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) | |
621 #if __has_cpp_attribute(fallthrough) | |
622 #define CYTHON_FALLTHROUGH [[fallthrough]] | |
623 #endif | |
624 #endif | |
625 #ifndef CYTHON_FALLTHROUGH | |
626 #if __has_cpp_attribute(clang::fallthrough) | |
627 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] | |
628 #elif __has_cpp_attribute(gnu::fallthrough) | |
629 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] | |
630 #endif | |
631 #endif | |
632 #endif | |
633 #ifndef CYTHON_FALLTHROUGH | |
634 #if __has_attribute(fallthrough) | |
635 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) | |
636 #else | |
637 #define CYTHON_FALLTHROUGH | |
638 #endif | |
639 #endif | |
640 #if defined(__clang__) && defined(__apple_build_version__) | |
641 #if __apple_build_version__ < 7000000 | |
642 #undef CYTHON_FALLTHROUGH | |
643 #define CYTHON_FALLTHROUGH | |
644 #endif | |
645 #endif | |
646 #endif | |
647 #ifdef __cplusplus | |
648 template <typename T> | |
649 struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; | |
650 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value) | |
651 #else | |
652 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) | |
653 #endif | |
654 #if CYTHON_COMPILING_IN_PYPY == 1 | |
655 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) | |
656 #else | |
657 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) | |
658 #endif | |
659 #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) | |
660 | |
661 #ifndef CYTHON_INLINE | |
662 #if defined(__clang__) | |
663 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) | |
664 #elif defined(__GNUC__) | |
665 #define CYTHON_INLINE __inline__ | |
666 #elif defined(_MSC_VER) | |
667 #define CYTHON_INLINE __inline | |
668 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | |
669 #define CYTHON_INLINE inline | |
670 #else | |
671 #define CYTHON_INLINE | |
672 #endif | |
673 #endif | |
674 | |
675 #define __PYX_BUILD_PY_SSIZE_T "n" | |
676 #define CYTHON_FORMAT_SSIZE_T "z" | |
677 #if PY_MAJOR_VERSION < 3 | |
678 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" | |
679 #define __Pyx_DefaultClassType PyClass_Type | |
680 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ | |
681 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) | |
682 #else | |
683 #define __Pyx_BUILTIN_MODULE_NAME "builtins" | |
684 #define __Pyx_DefaultClassType PyType_Type | |
685 #if CYTHON_COMPILING_IN_LIMITED_API | |
686 static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, | |
687 PyObject *code, PyObject *c, PyObject* n, PyObject *v, | |
688 PyObject *fv, PyObject *cell, PyObject* fn, | |
689 PyObject *name, int fline, PyObject *lnos) { | |
690 PyObject *exception_table = NULL; | |
691 PyObject *types_module=NULL, *code_type=NULL, *result=NULL; | |
692 #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 | |
693 PyObject *version_info; | |
694 PyObject *py_minor_version = NULL; | |
695 #endif | |
696 long minor_version = 0; | |
697 PyObject *type, *value, *traceback; | |
698 PyErr_Fetch(&type, &value, &traceback); | |
699 #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 | |
700 minor_version = 11; | |
701 #else | |
702 if (!(version_info = PySys_GetObject("version_info"))) goto end; | |
703 if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; | |
704 minor_version = PyLong_AsLong(py_minor_version); | |
705 Py_DECREF(py_minor_version); | |
706 if (minor_version == -1 && PyErr_Occurred()) goto end; | |
707 #endif | |
708 if (!(types_module = PyImport_ImportModule("types"))) goto end; | |
709 if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; | |
710 if (minor_version <= 7) { | |
711 (void)p; | |
712 result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, | |
713 c, n, v, fn, name, fline, lnos, fv, cell); | |
714 } else if (minor_version <= 10) { | |
715 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, | |
716 c, n, v, fn, name, fline, lnos, fv, cell); | |
717 } else { | |
718 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; | |
719 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, | |
720 c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); | |
721 } | |
722 end: | |
723 Py_XDECREF(code_type); | |
724 Py_XDECREF(exception_table); | |
725 Py_XDECREF(types_module); | |
726 if (type) { | |
727 PyErr_Restore(type, value, traceback); | |
728 } | |
729 return result; | |
730 } | |
731 #ifndef CO_OPTIMIZED | |
732 #define CO_OPTIMIZED 0x0001 | |
733 #endif | |
734 #ifndef CO_NEWLOCALS | |
735 #define CO_NEWLOCALS 0x0002 | |
736 #endif | |
737 #ifndef CO_VARARGS | |
738 #define CO_VARARGS 0x0004 | |
739 #endif | |
740 #ifndef CO_VARKEYWORDS | |
741 #define CO_VARKEYWORDS 0x0008 | |
742 #endif | |
743 #ifndef CO_ASYNC_GENERATOR | |
744 #define CO_ASYNC_GENERATOR 0x0200 | |
745 #endif | |
746 #ifndef CO_GENERATOR | |
747 #define CO_GENERATOR 0x0020 | |
748 #endif | |
749 #ifndef CO_COROUTINE | |
750 #define CO_COROUTINE 0x0080 | |
751 #endif | |
752 #elif PY_VERSION_HEX >= 0x030B0000 | |
753 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, | |
754 PyObject *code, PyObject *c, PyObject* n, PyObject *v, | |
755 PyObject *fv, PyObject *cell, PyObject* fn, | |
756 PyObject *name, int fline, PyObject *lnos) { | |
757 PyCodeObject *result; | |
758 PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); | |
759 if (!empty_bytes) return NULL; | |
760 result = | |
761 #if PY_VERSION_HEX >= 0x030C0000 | |
762 PyUnstable_Code_NewWithPosOnlyArgs | |
763 #else | |
764 PyCode_NewWithPosOnlyArgs | |
765 #endif | |
766 (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); | |
767 Py_DECREF(empty_bytes); | |
768 return result; | |
769 } | |
770 #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY | |
771 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ | |
772 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) | |
773 #else | |
774 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ | |
775 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) | |
776 #endif | |
777 #endif | |
778 #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) | |
779 #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) | |
780 #else | |
781 #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) | |
782 #endif | |
783 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) | |
784 #define __Pyx_Py_Is(x, y) Py_Is(x, y) | |
785 #else | |
786 #define __Pyx_Py_Is(x, y) ((x) == (y)) | |
787 #endif | |
788 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) | |
789 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) | |
790 #else | |
791 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) | |
792 #endif | |
793 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) | |
794 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) | |
795 #else | |
796 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) | |
797 #endif | |
798 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) | |
799 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) | |
800 #else | |
801 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) | |
802 #endif | |
803 #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) | |
804 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY | |
805 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) | |
806 #else | |
807 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) | |
808 #endif | |
809 #ifndef CO_COROUTINE | |
810 #define CO_COROUTINE 0x80 | |
811 #endif | |
812 #ifndef CO_ASYNC_GENERATOR | |
813 #define CO_ASYNC_GENERATOR 0x200 | |
814 #endif | |
815 #ifndef Py_TPFLAGS_CHECKTYPES | |
816 #define Py_TPFLAGS_CHECKTYPES 0 | |
817 #endif | |
818 #ifndef Py_TPFLAGS_HAVE_INDEX | |
819 #define Py_TPFLAGS_HAVE_INDEX 0 | |
820 #endif | |
821 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER | |
822 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 | |
823 #endif | |
824 #ifndef Py_TPFLAGS_HAVE_FINALIZE | |
825 #define Py_TPFLAGS_HAVE_FINALIZE 0 | |
826 #endif | |
827 #ifndef Py_TPFLAGS_SEQUENCE | |
828 #define Py_TPFLAGS_SEQUENCE 0 | |
829 #endif | |
830 #ifndef Py_TPFLAGS_MAPPING | |
831 #define Py_TPFLAGS_MAPPING 0 | |
832 #endif | |
833 #ifndef METH_STACKLESS | |
834 #define METH_STACKLESS 0 | |
835 #endif | |
836 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) | |
837 #ifndef METH_FASTCALL | |
838 #define METH_FASTCALL 0x80 | |
839 #endif | |
840 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); | |
841 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, | |
842 Py_ssize_t nargs, PyObject *kwnames); | |
843 #else | |
844 #if PY_VERSION_HEX >= 0x030d00A4 | |
845 # define __Pyx_PyCFunctionFast PyCFunctionFast | |
846 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords | |
847 #else | |
848 # define __Pyx_PyCFunctionFast _PyCFunctionFast | |
849 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords | |
850 #endif | |
851 #endif | |
852 #if CYTHON_METH_FASTCALL | |
853 #define __Pyx_METH_FASTCALL METH_FASTCALL | |
854 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast | |
855 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords | |
856 #else | |
857 #define __Pyx_METH_FASTCALL METH_VARARGS | |
858 #define __Pyx_PyCFunction_FastCall PyCFunction | |
859 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords | |
860 #endif | |
861 #if CYTHON_VECTORCALL | |
862 #define __pyx_vectorcallfunc vectorcallfunc | |
863 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET | |
864 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) | |
865 #elif CYTHON_BACKPORT_VECTORCALL | |
866 typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, | |
867 size_t nargsf, PyObject *kwnames); | |
868 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) | |
869 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) | |
870 #else | |
871 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 | |
872 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) | |
873 #endif | |
874 #if PY_MAJOR_VERSION >= 0x030900B1 | |
875 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) | |
876 #else | |
877 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) | |
878 #endif | |
879 #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) | |
880 #if CYTHON_COMPILING_IN_CPYTHON | |
881 #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) | |
882 #elif !CYTHON_COMPILING_IN_LIMITED_API | |
883 #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) | |
884 #endif | |
885 #if CYTHON_COMPILING_IN_CPYTHON | |
886 #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) | |
887 static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { | |
888 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; | |
889 } | |
890 #endif | |
891 static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { | |
892 #if CYTHON_COMPILING_IN_LIMITED_API | |
893 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; | |
894 #else | |
895 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; | |
896 #endif | |
897 } | |
898 #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) | |
899 #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 | |
900 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) | |
901 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); | |
902 #else | |
903 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) | |
904 #define __Pyx_PyCMethod PyCMethod | |
905 #endif | |
906 #ifndef METH_METHOD | |
907 #define METH_METHOD 0x200 | |
908 #endif | |
909 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) | |
910 #define PyObject_Malloc(s) PyMem_Malloc(s) | |
911 #define PyObject_Free(p) PyMem_Free(p) | |
912 #define PyObject_Realloc(p) PyMem_Realloc(p) | |
913 #endif | |
914 #if CYTHON_COMPILING_IN_LIMITED_API | |
915 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) | |
916 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) | |
917 #else | |
918 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) | |
919 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) | |
920 #endif | |
921 #if CYTHON_COMPILING_IN_LIMITED_API | |
922 #define __Pyx_PyThreadState_Current PyThreadState_Get() | |
923 #elif !CYTHON_FAST_THREAD_STATE | |
924 #define __Pyx_PyThreadState_Current PyThreadState_GET() | |
925 #elif PY_VERSION_HEX >= 0x030d00A1 | |
926 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() | |
927 #elif PY_VERSION_HEX >= 0x03060000 | |
928 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() | |
929 #elif PY_VERSION_HEX >= 0x03000000 | |
930 #define __Pyx_PyThreadState_Current PyThreadState_GET() | |
931 #else | |
932 #define __Pyx_PyThreadState_Current _PyThreadState_Current | |
933 #endif | |
934 #if CYTHON_COMPILING_IN_LIMITED_API | |
935 static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) | |
936 { | |
937 void *result; | |
938 result = PyModule_GetState(op); | |
939 if (!result) | |
940 Py_FatalError("Couldn't find the module state"); | |
941 return result; | |
942 } | |
943 #endif | |
944 #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) | |
945 #if CYTHON_COMPILING_IN_LIMITED_API | |
946 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) | |
947 #else | |
948 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) | |
949 #endif | |
950 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) | |
951 #include "pythread.h" | |
952 #define Py_tss_NEEDS_INIT 0 | |
953 typedef int Py_tss_t; | |
954 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { | |
955 *key = PyThread_create_key(); | |
956 return 0; | |
957 } | |
958 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { | |
959 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); | |
960 *key = Py_tss_NEEDS_INIT; | |
961 return key; | |
962 } | |
963 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { | |
964 PyObject_Free(key); | |
965 } | |
966 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { | |
967 return *key != Py_tss_NEEDS_INIT; | |
968 } | |
969 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { | |
970 PyThread_delete_key(*key); | |
971 *key = Py_tss_NEEDS_INIT; | |
972 } | |
973 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { | |
974 return PyThread_set_key_value(*key, value); | |
975 } | |
976 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { | |
977 return PyThread_get_key_value(*key); | |
978 } | |
979 #endif | |
980 #if PY_MAJOR_VERSION < 3 | |
981 #if CYTHON_COMPILING_IN_PYPY | |
982 #if PYPY_VERSION_NUM < 0x07030600 | |
983 #if defined(__cplusplus) && __cplusplus >= 201402L | |
984 [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] | |
985 #elif defined(__GNUC__) || defined(__clang__) | |
986 __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) | |
987 #elif defined(_MSC_VER) | |
988 __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) | |
989 #endif | |
990 static CYTHON_INLINE int PyGILState_Check(void) { | |
991 return 0; | |
992 } | |
993 #else // PYPY_VERSION_NUM < 0x07030600 | |
994 #endif // PYPY_VERSION_NUM < 0x07030600 | |
995 #else | |
996 static CYTHON_INLINE int PyGILState_Check(void) { | |
997 PyThreadState * tstate = _PyThreadState_Current; | |
998 return tstate && (tstate == PyGILState_GetThisThreadState()); | |
999 } | |
1000 #endif | |
1001 #endif | |
1002 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) | |
1003 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) | |
1004 #else | |
1005 #define __Pyx_PyDict_NewPresized(n) PyDict_New() | |
1006 #endif | |
1007 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION | |
1008 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) | |
1009 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) | |
1010 #else | |
1011 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) | |
1012 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) | |
1013 #endif | |
1014 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS | |
1015 #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) | |
1016 static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { | |
1017 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); | |
1018 if (res == NULL) PyErr_Clear(); | |
1019 return res; | |
1020 } | |
1021 #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) | |
1022 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError | |
1023 #define __Pyx_PyDict_GetItemStr PyDict_GetItem | |
1024 #else | |
1025 static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { | |
1026 #if CYTHON_COMPILING_IN_PYPY | |
1027 return PyDict_GetItem(dict, name); | |
1028 #else | |
1029 PyDictEntry *ep; | |
1030 PyDictObject *mp = (PyDictObject*) dict; | |
1031 long hash = ((PyStringObject *) name)->ob_shash; | |
1032 assert(hash != -1); | |
1033 ep = (mp->ma_lookup)(mp, name, hash); | |
1034 if (ep == NULL) { | |
1035 return NULL; | |
1036 } | |
1037 return ep->me_value; | |
1038 #endif | |
1039 } | |
1040 #define __Pyx_PyDict_GetItemStr PyDict_GetItem | |
1041 #endif | |
1042 #if CYTHON_USE_TYPE_SLOTS | |
1043 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) | |
1044 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) | |
1045 #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) | |
1046 #else | |
1047 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) | |
1048 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) | |
1049 #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next | |
1050 #endif | |
1051 #if CYTHON_COMPILING_IN_LIMITED_API | |
1052 #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) | |
1053 #else | |
1054 #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) | |
1055 #endif | |
1056 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 | |
1057 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ | |
1058 PyTypeObject *type = Py_TYPE((PyObject*)obj);\ | |
1059 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ | |
1060 PyObject_GC_Del(obj);\ | |
1061 Py_DECREF(type);\ | |
1062 } | |
1063 #else | |
1064 #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) | |
1065 #endif | |
1066 #if CYTHON_COMPILING_IN_LIMITED_API | |
1067 #define CYTHON_PEP393_ENABLED 1 | |
1068 #define __Pyx_PyUnicode_READY(op) (0) | |
1069 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) | |
1070 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) | |
1071 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) | |
1072 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) | |
1073 #define __Pyx_PyUnicode_DATA(u) ((void*)u) | |
1074 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) | |
1075 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) | |
1076 #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) | |
1077 #define CYTHON_PEP393_ENABLED 1 | |
1078 #if PY_VERSION_HEX >= 0x030C0000 | |
1079 #define __Pyx_PyUnicode_READY(op) (0) | |
1080 #else | |
1081 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ | |
1082 0 : _PyUnicode_Ready((PyObject *)(op))) | |
1083 #endif | |
1084 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) | |
1085 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) | |
1086 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) | |
1087 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) | |
1088 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) | |
1089 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) | |
1090 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) | |
1091 #if PY_VERSION_HEX >= 0x030C0000 | |
1092 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) | |
1093 #else | |
1094 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 | |
1095 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) | |
1096 #else | |
1097 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) | |
1098 #endif | |
1099 #endif | |
1100 #else | |
1101 #define CYTHON_PEP393_ENABLED 0 | |
1102 #define PyUnicode_1BYTE_KIND 1 | |
1103 #define PyUnicode_2BYTE_KIND 2 | |
1104 #define PyUnicode_4BYTE_KIND 4 | |
1105 #define __Pyx_PyUnicode_READY(op) (0) | |
1106 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) | |
1107 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) | |
1108 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) | |
1109 #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) | |
1110 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) | |
1111 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) | |
1112 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) | |
1113 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) | |
1114 #endif | |
1115 #if CYTHON_COMPILING_IN_PYPY | |
1116 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) | |
1117 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) | |
1118 #else | |
1119 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) | |
1120 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ | |
1121 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) | |
1122 #endif | |
1123 #if CYTHON_COMPILING_IN_PYPY | |
1124 #if !defined(PyUnicode_DecodeUnicodeEscape) | |
1125 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) | |
1126 #endif | |
1127 #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) | |
1128 #undef PyUnicode_Contains | |
1129 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) | |
1130 #endif | |
1131 #if !defined(PyByteArray_Check) | |
1132 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) | |
1133 #endif | |
1134 #if !defined(PyObject_Format) | |
1135 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) | |
1136 #endif | |
1137 #endif | |
1138 #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)) | |
1139 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) | |
1140 #if PY_MAJOR_VERSION >= 3 | |
1141 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) | |
1142 #else | |
1143 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) | |
1144 #endif | |
1145 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) | |
1146 #define PyObject_ASCII(o) PyObject_Repr(o) | |
1147 #endif | |
1148 #if PY_MAJOR_VERSION >= 3 | |
1149 #define PyBaseString_Type PyUnicode_Type | |
1150 #define PyStringObject PyUnicodeObject | |
1151 #define PyString_Type PyUnicode_Type | |
1152 #define PyString_Check PyUnicode_Check | |
1153 #define PyString_CheckExact PyUnicode_CheckExact | |
1154 #ifndef PyObject_Unicode | |
1155 #define PyObject_Unicode PyObject_Str | |
1156 #endif | |
1157 #endif | |
1158 #if PY_MAJOR_VERSION >= 3 | |
1159 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) | |
1160 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) | |
1161 #else | |
1162 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) | |
1163 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) | |
1164 #endif | |
1165 #if CYTHON_COMPILING_IN_CPYTHON | |
1166 #define __Pyx_PySequence_ListKeepNew(obj)\ | |
1167 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) | |
1168 #else | |
1169 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) | |
1170 #endif | |
1171 #ifndef PySet_CheckExact | |
1172 #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) | |
1173 #endif | |
1174 #if PY_VERSION_HEX >= 0x030900A4 | |
1175 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) | |
1176 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) | |
1177 #else | |
1178 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) | |
1179 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) | |
1180 #endif | |
1181 #if CYTHON_ASSUME_SAFE_MACROS | |
1182 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) | |
1183 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) | |
1184 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) | |
1185 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) | |
1186 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) | |
1187 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) | |
1188 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) | |
1189 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) | |
1190 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) | |
1191 #else | |
1192 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) | |
1193 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) | |
1194 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) | |
1195 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) | |
1196 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) | |
1197 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) | |
1198 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) | |
1199 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) | |
1200 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) | |
1201 #endif | |
1202 #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 | |
1203 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) | |
1204 #else | |
1205 static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { | |
1206 PyObject *module = PyImport_AddModule(name); | |
1207 Py_XINCREF(module); | |
1208 return module; | |
1209 } | |
1210 #endif | |
1211 #if PY_MAJOR_VERSION >= 3 | |
1212 #define PyIntObject PyLongObject | |
1213 #define PyInt_Type PyLong_Type | |
1214 #define PyInt_Check(op) PyLong_Check(op) | |
1215 #define PyInt_CheckExact(op) PyLong_CheckExact(op) | |
1216 #define __Pyx_Py3Int_Check(op) PyLong_Check(op) | |
1217 #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) | |
1218 #define PyInt_FromString PyLong_FromString | |
1219 #define PyInt_FromUnicode PyLong_FromUnicode | |
1220 #define PyInt_FromLong PyLong_FromLong | |
1221 #define PyInt_FromSize_t PyLong_FromSize_t | |
1222 #define PyInt_FromSsize_t PyLong_FromSsize_t | |
1223 #define PyInt_AsLong PyLong_AsLong | |
1224 #define PyInt_AS_LONG PyLong_AS_LONG | |
1225 #define PyInt_AsSsize_t PyLong_AsSsize_t | |
1226 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask | |
1227 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask | |
1228 #define PyNumber_Int PyNumber_Long | |
1229 #else | |
1230 #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) | |
1231 #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) | |
1232 #endif | |
1233 #if PY_MAJOR_VERSION >= 3 | |
1234 #define PyBoolObject PyLongObject | |
1235 #endif | |
1236 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY | |
1237 #ifndef PyUnicode_InternFromString | |
1238 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) | |
1239 #endif | |
1240 #endif | |
1241 #if PY_VERSION_HEX < 0x030200A4 | |
1242 typedef long Py_hash_t; | |
1243 #define __Pyx_PyInt_FromHash_t PyInt_FromLong | |
1244 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t | |
1245 #else | |
1246 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t | |
1247 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t | |
1248 #endif | |
1249 #if CYTHON_USE_ASYNC_SLOTS | |
1250 #if PY_VERSION_HEX >= 0x030500B1 | |
1251 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods | |
1252 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) | |
1253 #else | |
1254 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) | |
1255 #endif | |
1256 #else | |
1257 #define __Pyx_PyType_AsAsync(obj) NULL | |
1258 #endif | |
1259 #ifndef __Pyx_PyAsyncMethodsStruct | |
1260 typedef struct { | |
1261 unaryfunc am_await; | |
1262 unaryfunc am_aiter; | |
1263 unaryfunc am_anext; | |
1264 } __Pyx_PyAsyncMethodsStruct; | |
1265 #endif | |
1266 | |
1267 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) | |
1268 #if !defined(_USE_MATH_DEFINES) | |
1269 #define _USE_MATH_DEFINES | |
1270 #endif | |
1271 #endif | |
1272 #include <math.h> | |
1273 #ifdef NAN | |
1274 #define __PYX_NAN() ((float) NAN) | |
1275 #else | |
1276 static CYTHON_INLINE float __PYX_NAN() { | |
1277 float value; | |
1278 memset(&value, 0xFF, sizeof(value)); | |
1279 return value; | |
1280 } | |
1281 #endif | |
1282 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) | |
1283 #define __Pyx_truncl trunc | |
1284 #else | |
1285 #define __Pyx_truncl truncl | |
1286 #endif | |
1287 | |
1288 #define __PYX_MARK_ERR_POS(f_index, lineno) \ | |
1289 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } | |
1290 #define __PYX_ERR(f_index, lineno, Ln_error) \ | |
1291 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } | |
1292 | |
1293 #ifdef CYTHON_EXTERN_C | |
1294 #undef __PYX_EXTERN_C | |
1295 #define __PYX_EXTERN_C CYTHON_EXTERN_C | |
1296 #elif defined(__PYX_EXTERN_C) | |
1297 #ifdef _MSC_VER | |
1298 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") | |
1299 #else | |
1300 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. | |
1301 #endif | |
1302 #else | |
1303 #ifdef __cplusplus | |
1304 #define __PYX_EXTERN_C extern "C" | |
1305 #else | |
1306 #define __PYX_EXTERN_C extern | |
1307 #endif | |
1308 #endif | |
1309 | |
1310 #define __PYX_HAVE__pysam__libctabix | |
1311 #define __PYX_HAVE_API__pysam__libctabix | |
1312 /* Early includes */ | |
1313 #include <stdint.h> | |
1314 #include <string.h> | |
1315 #include <stdlib.h> | |
1316 #include <stdio.h> | |
1317 #include "fcntl.h" | |
1318 #include "unistd.h" | |
1319 #include <sys/types.h> | |
1320 #include "stdarg.h" | |
1321 #include "htslib/kstring.h" | |
1322 #include "htslib_util.h" | |
1323 #include "htslib/hfile.h" | |
1324 #include "htslib/bgzf.h" | |
1325 #include "htslib/hts.h" | |
1326 #include "htslib/sam.h" | |
1327 #include "htslib/faidx.h" | |
1328 #include "htslib/tbx.h" | |
1329 #include "htslib/vcf.h" | |
1330 #include "htslib/vcfutils.h" | |
1331 #include "htslib/cram.h" | |
1332 #include "pysam_stream.h" | |
1333 #include <errno.h> | |
1334 #include <unistd.h> | |
1335 #include <stddef.h> | |
1336 #include "pythread.h" | |
1337 | |
1338 #if CYTHON_COMPILING_IN_PYPY | |
1339 #ifdef _MSC_VER | |
1340 #pragma message ("This module uses CPython specific internals of 'array.array', which are not available in PyPy.") | |
1341 #else | |
1342 #warning This module uses CPython specific internals of 'array.array', which are not available in PyPy. | |
1343 #endif | |
1344 #endif | |
1345 | |
1346 #ifdef _OPENMP | |
1347 #include <omp.h> | |
1348 #endif /* _OPENMP */ | |
1349 | |
1350 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) | |
1351 #define CYTHON_WITHOUT_ASSERTIONS | |
1352 #endif | |
1353 | |
1354 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; | |
1355 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; | |
1356 | |
1357 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 | |
1358 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 | |
1359 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) | |
1360 #define __PYX_DEFAULT_STRING_ENCODING "" | |
1361 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString | |
1362 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize | |
1363 #define __Pyx_uchar_cast(c) ((unsigned char)c) | |
1364 #define __Pyx_long_cast(x) ((long)x) | |
1365 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ | |
1366 (sizeof(type) < sizeof(Py_ssize_t)) ||\ | |
1367 (sizeof(type) > sizeof(Py_ssize_t) &&\ | |
1368 likely(v < (type)PY_SSIZE_T_MAX ||\ | |
1369 v == (type)PY_SSIZE_T_MAX) &&\ | |
1370 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ | |
1371 v == (type)PY_SSIZE_T_MIN))) ||\ | |
1372 (sizeof(type) == sizeof(Py_ssize_t) &&\ | |
1373 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ | |
1374 v == (type)PY_SSIZE_T_MAX))) ) | |
1375 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { | |
1376 return (size_t) i < (size_t) limit; | |
1377 } | |
1378 #if defined (__cplusplus) && __cplusplus >= 201103L | |
1379 #include <cstdlib> | |
1380 #define __Pyx_sst_abs(value) std::abs(value) | |
1381 #elif SIZEOF_INT >= SIZEOF_SIZE_T | |
1382 #define __Pyx_sst_abs(value) abs(value) | |
1383 #elif SIZEOF_LONG >= SIZEOF_SIZE_T | |
1384 #define __Pyx_sst_abs(value) labs(value) | |
1385 #elif defined (_MSC_VER) | |
1386 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) | |
1387 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | |
1388 #define __Pyx_sst_abs(value) llabs(value) | |
1389 #elif defined (__GNUC__) | |
1390 #define __Pyx_sst_abs(value) __builtin_llabs(value) | |
1391 #else | |
1392 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) | |
1393 #endif | |
1394 static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); | |
1395 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); | |
1396 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); | |
1397 static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); | |
1398 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) | |
1399 #define __Pyx_PyBytes_FromString PyBytes_FromString | |
1400 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize | |
1401 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); | |
1402 #if PY_MAJOR_VERSION < 3 | |
1403 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString | |
1404 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize | |
1405 #else | |
1406 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString | |
1407 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize | |
1408 #endif | |
1409 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) | |
1410 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) | |
1411 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) | |
1412 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) | |
1413 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) | |
1414 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) | |
1415 #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) | |
1416 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) | |
1417 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) | |
1418 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) | |
1419 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) | |
1420 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) | |
1421 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) | |
1422 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) | |
1423 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) | |
1424 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) | |
1425 #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) | |
1426 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode | |
1427 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) | |
1428 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) | |
1429 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); | |
1430 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); | |
1431 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); | |
1432 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); | |
1433 #define __Pyx_PySequence_Tuple(obj)\ | |
1434 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) | |
1435 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); | |
1436 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); | |
1437 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); | |
1438 #if CYTHON_ASSUME_SAFE_MACROS | |
1439 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) | |
1440 #else | |
1441 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) | |
1442 #endif | |
1443 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) | |
1444 #if PY_MAJOR_VERSION >= 3 | |
1445 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) | |
1446 #else | |
1447 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) | |
1448 #endif | |
1449 #if CYTHON_USE_PYLONG_INTERNALS | |
1450 #if PY_VERSION_HEX >= 0x030C00A7 | |
1451 #ifndef _PyLong_SIGN_MASK | |
1452 #define _PyLong_SIGN_MASK 3 | |
1453 #endif | |
1454 #ifndef _PyLong_NON_SIZE_BITS | |
1455 #define _PyLong_NON_SIZE_BITS 3 | |
1456 #endif | |
1457 #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) | |
1458 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) | |
1459 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) | |
1460 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) | |
1461 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) | |
1462 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) | |
1463 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) | |
1464 #define __Pyx_PyLong_SignedDigitCount(x)\ | |
1465 ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) | |
1466 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) | |
1467 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) | |
1468 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) | |
1469 #else | |
1470 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) | |
1471 #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) | |
1472 #endif | |
1473 typedef Py_ssize_t __Pyx_compact_pylong; | |
1474 typedef size_t __Pyx_compact_upylong; | |
1475 #else | |
1476 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) | |
1477 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) | |
1478 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) | |
1479 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) | |
1480 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) | |
1481 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) | |
1482 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) | |
1483 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) | |
1484 #define __Pyx_PyLong_CompactValue(x)\ | |
1485 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) | |
1486 typedef sdigit __Pyx_compact_pylong; | |
1487 typedef digit __Pyx_compact_upylong; | |
1488 #endif | |
1489 #if PY_VERSION_HEX >= 0x030C00A5 | |
1490 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) | |
1491 #else | |
1492 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) | |
1493 #endif | |
1494 #endif | |
1495 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
1496 #include <string.h> | |
1497 static int __Pyx_sys_getdefaultencoding_not_ascii; | |
1498 static int __Pyx_init_sys_getdefaultencoding_params(void) { | |
1499 PyObject* sys; | |
1500 PyObject* default_encoding = NULL; | |
1501 PyObject* ascii_chars_u = NULL; | |
1502 PyObject* ascii_chars_b = NULL; | |
1503 const char* default_encoding_c; | |
1504 sys = PyImport_ImportModule("sys"); | |
1505 if (!sys) goto bad; | |
1506 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); | |
1507 Py_DECREF(sys); | |
1508 if (!default_encoding) goto bad; | |
1509 default_encoding_c = PyBytes_AsString(default_encoding); | |
1510 if (!default_encoding_c) goto bad; | |
1511 if (strcmp(default_encoding_c, "ascii") == 0) { | |
1512 __Pyx_sys_getdefaultencoding_not_ascii = 0; | |
1513 } else { | |
1514 char ascii_chars[128]; | |
1515 int c; | |
1516 for (c = 0; c < 128; c++) { | |
1517 ascii_chars[c] = (char) c; | |
1518 } | |
1519 __Pyx_sys_getdefaultencoding_not_ascii = 1; | |
1520 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); | |
1521 if (!ascii_chars_u) goto bad; | |
1522 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); | |
1523 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { | |
1524 PyErr_Format( | |
1525 PyExc_ValueError, | |
1526 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", | |
1527 default_encoding_c); | |
1528 goto bad; | |
1529 } | |
1530 Py_DECREF(ascii_chars_u); | |
1531 Py_DECREF(ascii_chars_b); | |
1532 } | |
1533 Py_DECREF(default_encoding); | |
1534 return 0; | |
1535 bad: | |
1536 Py_XDECREF(default_encoding); | |
1537 Py_XDECREF(ascii_chars_u); | |
1538 Py_XDECREF(ascii_chars_b); | |
1539 return -1; | |
1540 } | |
1541 #endif | |
1542 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 | |
1543 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) | |
1544 #else | |
1545 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) | |
1546 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT | |
1547 #include <string.h> | |
1548 static char* __PYX_DEFAULT_STRING_ENCODING; | |
1549 static int __Pyx_init_sys_getdefaultencoding_params(void) { | |
1550 PyObject* sys; | |
1551 PyObject* default_encoding = NULL; | |
1552 char* default_encoding_c; | |
1553 sys = PyImport_ImportModule("sys"); | |
1554 if (!sys) goto bad; | |
1555 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); | |
1556 Py_DECREF(sys); | |
1557 if (!default_encoding) goto bad; | |
1558 default_encoding_c = PyBytes_AsString(default_encoding); | |
1559 if (!default_encoding_c) goto bad; | |
1560 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); | |
1561 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; | |
1562 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); | |
1563 Py_DECREF(default_encoding); | |
1564 return 0; | |
1565 bad: | |
1566 Py_XDECREF(default_encoding); | |
1567 return -1; | |
1568 } | |
1569 #endif | |
1570 #endif | |
1571 | |
1572 | |
1573 /* Test for GCC > 2.95 */ | |
1574 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) | |
1575 #define likely(x) __builtin_expect(!!(x), 1) | |
1576 #define unlikely(x) __builtin_expect(!!(x), 0) | |
1577 #else /* !__GNUC__ or GCC < 2.95 */ | |
1578 #define likely(x) (x) | |
1579 #define unlikely(x) (x) | |
1580 #endif /* __GNUC__ */ | |
1581 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } | |
1582 | |
1583 #if !CYTHON_USE_MODULE_STATE | |
1584 static PyObject *__pyx_m = NULL; | |
1585 #endif | |
1586 static int __pyx_lineno; | |
1587 static int __pyx_clineno = 0; | |
1588 static const char * __pyx_cfilenm = __FILE__; | |
1589 static const char *__pyx_filename; | |
1590 | |
1591 /* #### Code section: filename_table ### */ | |
1592 | |
1593 static const char *__pyx_f[] = { | |
1594 "pysam/libctabix.pyx", | |
1595 "<stringsource>", | |
1596 "contextvars.pxd", | |
1597 "array.pxd", | |
1598 "pysam/libctabix.pxd", | |
1599 "type.pxd", | |
1600 "bool.pxd", | |
1601 "complex.pxd", | |
1602 "pysam/libctabixproxies.pxd", | |
1603 }; | |
1604 /* #### Code section: utility_code_proto_before_types ### */ | |
1605 /* ForceInitThreads.proto */ | |
1606 #ifndef __PYX_FORCE_INIT_THREADS | |
1607 #define __PYX_FORCE_INIT_THREADS 0 | |
1608 #endif | |
1609 | |
1610 /* NoFastGil.proto */ | |
1611 #define __Pyx_PyGILState_Ensure PyGILState_Ensure | |
1612 #define __Pyx_PyGILState_Release PyGILState_Release | |
1613 #define __Pyx_FastGIL_Remember() | |
1614 #define __Pyx_FastGIL_Forget() | |
1615 #define __Pyx_FastGilFuncInit() | |
1616 | |
1617 /* #### Code section: numeric_typedefs ### */ | |
1618 /* #### Code section: complex_type_declarations ### */ | |
1619 /* #### Code section: type_declarations ### */ | |
1620 | |
1621 /*--- Type declarations ---*/ | |
1622 #ifndef _ARRAYARRAY_H | |
1623 struct arrayobject; | |
1624 typedef struct arrayobject arrayobject; | |
1625 #endif | |
1626 struct __pyx_obj_5pysam_10libchtslib_HTSFile; | |
1627 struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy; | |
1628 struct __pyx_obj_5pysam_16libctabixproxies_TupleProxyIterator; | |
1629 struct __pyx_obj_5pysam_16libctabixproxies_NamedTupleProxy; | |
1630 struct __pyx_obj_5pysam_16libctabixproxies_GTFProxy; | |
1631 struct __pyx_obj_5pysam_16libctabixproxies_GFF3Proxy; | |
1632 struct __pyx_obj_5pysam_16libctabixproxies_BedProxy; | |
1633 struct __pyx_obj_5pysam_16libctabixproxies_VCFProxy; | |
1634 struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator; | |
1635 struct __pyx_obj_5pysam_9libctabix_TabixFile; | |
1636 struct __pyx_obj_5pysam_9libctabix_Parser; | |
1637 struct __pyx_obj_5pysam_9libctabix_asTuple; | |
1638 struct __pyx_obj_5pysam_9libctabix_asGTF; | |
1639 struct __pyx_obj_5pysam_9libctabix_asGFF3; | |
1640 struct __pyx_obj_5pysam_9libctabix_asBed; | |
1641 struct __pyx_obj_5pysam_9libctabix_asVCF; | |
1642 struct __pyx_obj_5pysam_9libctabix_TabixIterator; | |
1643 struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed; | |
1644 struct __pyx_obj_5pysam_9libctabix_GZIterator; | |
1645 struct __pyx_obj_5pysam_9libctabix_GZIteratorHead; | |
1646 struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed; | |
1647 struct __pyx_obj_5pysam_9libctabix_Tabixfile; | |
1648 struct __pyx_opt_args_7cpython_11contextvars_get_value; | |
1649 struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default; | |
1650 | |
1651 /* "cpython/contextvars.pxd":112 | |
1652 * | |
1653 * | |
1654 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< | |
1655 * """Return a new reference to the value of the context variable, | |
1656 * or the default value of the context variable, | |
1657 */ | |
1658 struct __pyx_opt_args_7cpython_11contextvars_get_value { | |
1659 int __pyx_n; | |
1660 PyObject *default_value; | |
1661 }; | |
1662 | |
1663 /* "cpython/contextvars.pxd":129 | |
1664 * | |
1665 * | |
1666 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< | |
1667 * """Return a new reference to the value of the context variable, | |
1668 * or the provided default value if no such value was found. | |
1669 */ | |
1670 struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default { | |
1671 int __pyx_n; | |
1672 PyObject *default_value; | |
1673 }; | |
1674 struct __pyx_opt_args_5pysam_16libctabixproxies_10TupleProxy_copy; | |
1675 | |
1676 /* "pysam/libctabixproxies.pxd":23 | |
1677 * cdef take(self, char * buffer, size_t nbytes) | |
1678 * cdef present(self, char * buffer, size_t nbytes) | |
1679 * cdef copy(self, char * buffer, size_t nbytes, bint reset=*) # <<<<<<<<<<<<<< | |
1680 * cdef update(self, char * buffer, size_t nbytes) | |
1681 * | |
1682 */ | |
1683 struct __pyx_opt_args_5pysam_16libctabixproxies_10TupleProxy_copy { | |
1684 int __pyx_n; | |
1685 int reset; | |
1686 }; | |
1687 struct __pyx_opt_args_5pysam_9libcutils_parse_region; | |
1688 struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array; | |
1689 struct __pyx_opt_args_5pysam_9libcutils_array_to_qualitystring; | |
1690 struct __pyx_opt_args_5pysam_9libcutils_qualities_to_qualitystring; | |
1691 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str; | |
1692 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_bytes; | |
1693 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str_w_len; | |
1694 struct __pyx_opt_args_5pysam_9libcutils_force_str; | |
1695 struct __pyx_opt_args_5pysam_9libcutils_force_bytes; | |
1696 struct __pyx_opt_args_5pysam_9libcutils_decode_bytes; | |
1697 | |
1698 /* "pysam/libcutils.pxd":8 | |
1699 * from cpython cimport array as c_array | |
1700 * | |
1701 * cpdef parse_region(contig=*, start=*, stop=*, region=*, reference=*, end=*) # <<<<<<<<<<<<<< | |
1702 * | |
1703 * cdef int libc_whence_from_io(int whence) | |
1704 */ | |
1705 struct __pyx_opt_args_5pysam_9libcutils_parse_region { | |
1706 int __pyx_n; | |
1707 PyObject *contig; | |
1708 PyObject *start; | |
1709 PyObject *stop; | |
1710 PyObject *region; | |
1711 PyObject *reference; | |
1712 PyObject *end; | |
1713 }; | |
1714 | |
1715 /* "pysam/libcutils.pxd":15 | |
1716 * # Utility functions for quality string conversions | |
1717 * | |
1718 * cpdef c_array.array qualitystring_to_array(input_str, int offset=*) # <<<<<<<<<<<<<< | |
1719 * cpdef array_to_qualitystring(c_array.array arr, int offset=*) | |
1720 * cpdef qualities_to_qualitystring(qualities, int offset=*) | |
1721 */ | |
1722 struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array { | |
1723 int __pyx_n; | |
1724 int offset; | |
1725 }; | |
1726 | |
1727 /* "pysam/libcutils.pxd":16 | |
1728 * | |
1729 * cpdef c_array.array qualitystring_to_array(input_str, int offset=*) | |
1730 * cpdef array_to_qualitystring(c_array.array arr, int offset=*) # <<<<<<<<<<<<<< | |
1731 * cpdef qualities_to_qualitystring(qualities, int offset=*) | |
1732 * | |
1733 */ | |
1734 struct __pyx_opt_args_5pysam_9libcutils_array_to_qualitystring { | |
1735 int __pyx_n; | |
1736 int offset; | |
1737 }; | |
1738 | |
1739 /* "pysam/libcutils.pxd":17 | |
1740 * cpdef c_array.array qualitystring_to_array(input_str, int offset=*) | |
1741 * cpdef array_to_qualitystring(c_array.array arr, int offset=*) | |
1742 * cpdef qualities_to_qualitystring(qualities, int offset=*) # <<<<<<<<<<<<<< | |
1743 * | |
1744 * ######################################################################## | |
1745 */ | |
1746 struct __pyx_opt_args_5pysam_9libcutils_qualities_to_qualitystring { | |
1747 int __pyx_n; | |
1748 int offset; | |
1749 }; | |
1750 | |
1751 /* "pysam/libcutils.pxd":29 | |
1752 * ## Python 3 compatibility functions | |
1753 * ######################################################################## | |
1754 * cdef charptr_to_str(const char *s, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1755 * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) | |
1756 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) | |
1757 */ | |
1758 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str { | |
1759 int __pyx_n; | |
1760 PyObject *encoding; | |
1761 PyObject *errors; | |
1762 }; | |
1763 | |
1764 /* "pysam/libcutils.pxd":30 | |
1765 * ######################################################################## | |
1766 * cdef charptr_to_str(const char *s, encoding=*, errors=*) | |
1767 * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1768 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) | |
1769 * cdef force_str(object s, encoding=*, errors=*) | |
1770 */ | |
1771 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_bytes { | |
1772 int __pyx_n; | |
1773 PyObject *encoding; | |
1774 PyObject *errors; | |
1775 }; | |
1776 | |
1777 /* "pysam/libcutils.pxd":31 | |
1778 * cdef charptr_to_str(const char *s, encoding=*, errors=*) | |
1779 * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) | |
1780 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1781 * cdef force_str(object s, encoding=*, errors=*) | |
1782 * cdef bytes force_bytes(object s, encoding=*, errors=*) | |
1783 */ | |
1784 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str_w_len { | |
1785 int __pyx_n; | |
1786 PyObject *encoding; | |
1787 PyObject *errors; | |
1788 }; | |
1789 | |
1790 /* "pysam/libcutils.pxd":32 | |
1791 * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) | |
1792 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) | |
1793 * cdef force_str(object s, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1794 * cdef bytes force_bytes(object s, encoding=*, errors=*) | |
1795 * cdef decode_bytes(bytes s, encoding=*, errors=*) | |
1796 */ | |
1797 struct __pyx_opt_args_5pysam_9libcutils_force_str { | |
1798 int __pyx_n; | |
1799 PyObject *encoding; | |
1800 PyObject *errors; | |
1801 }; | |
1802 | |
1803 /* "pysam/libcutils.pxd":33 | |
1804 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) | |
1805 * cdef force_str(object s, encoding=*, errors=*) | |
1806 * cdef bytes force_bytes(object s, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1807 * cdef decode_bytes(bytes s, encoding=*, errors=*) | |
1808 * cdef bytes encode_filename(object filename) | |
1809 */ | |
1810 struct __pyx_opt_args_5pysam_9libcutils_force_bytes { | |
1811 int __pyx_n; | |
1812 PyObject *encoding; | |
1813 PyObject *errors; | |
1814 }; | |
1815 | |
1816 /* "pysam/libcutils.pxd":34 | |
1817 * cdef force_str(object s, encoding=*, errors=*) | |
1818 * cdef bytes force_bytes(object s, encoding=*, errors=*) | |
1819 * cdef decode_bytes(bytes s, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1820 * cdef bytes encode_filename(object filename) | |
1821 * cdef from_string_and_size(const char *s, size_t length) | |
1822 */ | |
1823 struct __pyx_opt_args_5pysam_9libcutils_decode_bytes { | |
1824 int __pyx_n; | |
1825 PyObject *encoding; | |
1826 PyObject *errors; | |
1827 }; | |
1828 | |
1829 /* "pysam/libchtslib.pxd":2706 | |
1830 * | |
1831 * | |
1832 * cdef class HTSFile(object): # <<<<<<<<<<<<<< | |
1833 * cdef htsFile *htsfile # pointer to htsFile structure | |
1834 * cdef int64_t start_offset # BGZF offset of first record | |
1835 */ | |
1836 struct __pyx_obj_5pysam_10libchtslib_HTSFile { | |
1837 PyObject_HEAD | |
1838 struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile *__pyx_vtab; | |
1839 htsFile *htsfile; | |
1840 int64_t start_offset; | |
1841 PyObject *filename; | |
1842 PyObject *mode; | |
1843 PyObject *threads; | |
1844 PyObject *index_filename; | |
1845 int is_stream; | |
1846 int is_remote; | |
1847 int duplicate_filehandle; | |
1848 }; | |
1849 | |
1850 | |
1851 /* "pysam/libctabixproxies.pxd":5 | |
1852 * from libc.stdint cimport uint8_t, int32_t, uint32_t, int64_t, uint64_t | |
1853 * | |
1854 * cdef class TupleProxy: # <<<<<<<<<<<<<< | |
1855 * | |
1856 * cdef: | |
1857 */ | |
1858 struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy { | |
1859 PyObject_HEAD | |
1860 struct __pyx_vtabstruct_5pysam_16libctabixproxies_TupleProxy *__pyx_vtab; | |
1861 char *data; | |
1862 char **fields; | |
1863 int nfields; | |
1864 int nbytes; | |
1865 int offset; | |
1866 int is_modified; | |
1867 PyObject *encoding; | |
1868 }; | |
1869 | |
1870 | |
1871 /* "pysam/libctabixproxies.pxd":27 | |
1872 * | |
1873 * | |
1874 * cdef class TupleProxyIterator: # <<<<<<<<<<<<<< | |
1875 * cdef TupleProxy proxy | |
1876 * cdef int index | |
1877 */ | |
1878 struct __pyx_obj_5pysam_16libctabixproxies_TupleProxyIterator { | |
1879 PyObject_HEAD | |
1880 struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *proxy; | |
1881 int index; | |
1882 }; | |
1883 | |
1884 | |
1885 /* "pysam/libctabixproxies.pxd":32 | |
1886 * | |
1887 * | |
1888 * cdef class NamedTupleProxy(TupleProxy): # <<<<<<<<<<<<<< | |
1889 * pass | |
1890 * | |
1891 */ | |
1892 struct __pyx_obj_5pysam_16libctabixproxies_NamedTupleProxy { | |
1893 struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy __pyx_base; | |
1894 }; | |
1895 | |
1896 | |
1897 /* "pysam/libctabixproxies.pxd":36 | |
1898 * | |
1899 * | |
1900 * cdef class GTFProxy(NamedTupleProxy): # <<<<<<<<<<<<<< | |
1901 * cdef object attribute_dict | |
1902 * cpdef int getMaxFields(self) | |
1903 */ | |
1904 struct __pyx_obj_5pysam_16libctabixproxies_GTFProxy { | |
1905 struct __pyx_obj_5pysam_16libctabixproxies_NamedTupleProxy __pyx_base; | |
1906 PyObject *attribute_dict; | |
1907 }; | |
1908 | |
1909 | |
1910 /* "pysam/libctabixproxies.pxd":42 | |
1911 * | |
1912 * | |
1913 * cdef class GFF3Proxy(GTFProxy): # <<<<<<<<<<<<<< | |
1914 * pass | |
1915 * | |
1916 */ | |
1917 struct __pyx_obj_5pysam_16libctabixproxies_GFF3Proxy { | |
1918 struct __pyx_obj_5pysam_16libctabixproxies_GTFProxy __pyx_base; | |
1919 }; | |
1920 | |
1921 | |
1922 /* "pysam/libctabixproxies.pxd":46 | |
1923 * | |
1924 * | |
1925 * cdef class BedProxy(NamedTupleProxy): # <<<<<<<<<<<<<< | |
1926 * | |
1927 * cdef: | |
1928 */ | |
1929 struct __pyx_obj_5pysam_16libctabixproxies_BedProxy { | |
1930 struct __pyx_obj_5pysam_16libctabixproxies_NamedTupleProxy __pyx_base; | |
1931 char *contig; | |
1932 uint32_t start; | |
1933 uint32_t end; | |
1934 int bedfields; | |
1935 }; | |
1936 | |
1937 | |
1938 /* "pysam/libctabixproxies.pxd":58 | |
1939 * cdef update(self, char * buffer, size_t nbytes) | |
1940 * | |
1941 * cdef class VCFProxy(NamedTupleProxy) : # <<<<<<<<<<<<<< | |
1942 * | |
1943 * cdef: | |
1944 */ | |
1945 struct __pyx_obj_5pysam_16libctabixproxies_VCFProxy { | |
1946 struct __pyx_obj_5pysam_16libctabixproxies_NamedTupleProxy __pyx_base; | |
1947 char *contig; | |
1948 uint32_t pos; | |
1949 }; | |
1950 | |
1951 | |
1952 /* "pysam/libctabix.pxd":48 | |
1953 * | |
1954 * | |
1955 * cdef class tabix_file_iterator: # <<<<<<<<<<<<<< | |
1956 * cdef BGZF * fh | |
1957 * cdef kstream_t * kstream | |
1958 */ | |
1959 struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator { | |
1960 PyObject_HEAD | |
1961 struct __pyx_vtabstruct_5pysam_9libctabix_tabix_file_iterator *__pyx_vtab; | |
1962 BGZF *fh; | |
1963 kstream_t *kstream; | |
1964 kstring_t buffer; | |
1965 size_t size; | |
1966 struct __pyx_obj_5pysam_9libctabix_Parser *parser; | |
1967 int fd; | |
1968 int duplicated_fd; | |
1969 PyObject *infile; | |
1970 }; | |
1971 | |
1972 | |
1973 /* "pysam/libctabix.pxd":61 | |
1974 * | |
1975 * | |
1976 * cdef class TabixFile(HTSFile): # <<<<<<<<<<<<<< | |
1977 * # pointer to index structure | |
1978 * cdef tbx_t * index | |
1979 */ | |
1980 struct __pyx_obj_5pysam_9libctabix_TabixFile { | |
1981 struct __pyx_obj_5pysam_10libchtslib_HTSFile __pyx_base; | |
1982 tbx_t *index; | |
1983 PyObject *filename_index; | |
1984 struct __pyx_obj_5pysam_9libctabix_Parser *parser; | |
1985 PyObject *encoding; | |
1986 }; | |
1987 | |
1988 | |
1989 /* "pysam/libctabix.pxd":72 | |
1990 * | |
1991 * | |
1992 * cdef class Parser: # <<<<<<<<<<<<<< | |
1993 * cdef encoding | |
1994 * cdef parse(self, char * buffer, int len) | |
1995 */ | |
1996 struct __pyx_obj_5pysam_9libctabix_Parser { | |
1997 PyObject_HEAD | |
1998 struct __pyx_vtabstruct_5pysam_9libctabix_Parser *__pyx_vtab; | |
1999 PyObject *encoding; | |
2000 }; | |
2001 | |
2002 | |
2003 /* "pysam/libctabix.pxd":77 | |
2004 * | |
2005 * | |
2006 * cdef class asTuple(Parser): # <<<<<<<<<<<<<< | |
2007 * cdef parse(self, char * buffer, int len) | |
2008 * | |
2009 */ | |
2010 struct __pyx_obj_5pysam_9libctabix_asTuple { | |
2011 struct __pyx_obj_5pysam_9libctabix_Parser __pyx_base; | |
2012 }; | |
2013 | |
2014 | |
2015 /* "pysam/libctabix.pxd":81 | |
2016 * | |
2017 * | |
2018 * cdef class asGTF(Parser): # <<<<<<<<<<<<<< | |
2019 * pass | |
2020 * | |
2021 */ | |
2022 struct __pyx_obj_5pysam_9libctabix_asGTF { | |
2023 struct __pyx_obj_5pysam_9libctabix_Parser __pyx_base; | |
2024 }; | |
2025 | |
2026 | |
2027 /* "pysam/libctabix.pxd":85 | |
2028 * | |
2029 * | |
2030 * cdef class asGFF3(Parser): # <<<<<<<<<<<<<< | |
2031 * pass | |
2032 * | |
2033 */ | |
2034 struct __pyx_obj_5pysam_9libctabix_asGFF3 { | |
2035 struct __pyx_obj_5pysam_9libctabix_Parser __pyx_base; | |
2036 }; | |
2037 | |
2038 | |
2039 /* "pysam/libctabix.pxd":89 | |
2040 * | |
2041 * | |
2042 * cdef class asBed(Parser): # <<<<<<<<<<<<<< | |
2043 * pass | |
2044 * | |
2045 */ | |
2046 struct __pyx_obj_5pysam_9libctabix_asBed { | |
2047 struct __pyx_obj_5pysam_9libctabix_Parser __pyx_base; | |
2048 }; | |
2049 | |
2050 | |
2051 /* "pysam/libctabix.pxd":93 | |
2052 * | |
2053 * | |
2054 * cdef class asVCF(Parser): # <<<<<<<<<<<<<< | |
2055 * pass | |
2056 * | |
2057 */ | |
2058 struct __pyx_obj_5pysam_9libctabix_asVCF { | |
2059 struct __pyx_obj_5pysam_9libctabix_Parser __pyx_base; | |
2060 }; | |
2061 | |
2062 | |
2063 /* "pysam/libctabix.pxd":97 | |
2064 * | |
2065 * | |
2066 * cdef class TabixIterator: # <<<<<<<<<<<<<< | |
2067 * cdef hts_itr_t * iterator | |
2068 * cdef TabixFile tabixfile | |
2069 */ | |
2070 struct __pyx_obj_5pysam_9libctabix_TabixIterator { | |
2071 PyObject_HEAD | |
2072 struct __pyx_vtabstruct_5pysam_9libctabix_TabixIterator *__pyx_vtab; | |
2073 hts_itr_t *iterator; | |
2074 struct __pyx_obj_5pysam_9libctabix_TabixFile *tabixfile; | |
2075 kstring_t buffer; | |
2076 PyObject *encoding; | |
2077 }; | |
2078 | |
2079 | |
2080 /* "pysam/libctabix.pxd":105 | |
2081 * | |
2082 * | |
2083 * cdef class TabixIteratorParsed(TabixIterator): # <<<<<<<<<<<<<< | |
2084 * cdef Parser parser | |
2085 * | |
2086 */ | |
2087 struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed { | |
2088 struct __pyx_obj_5pysam_9libctabix_TabixIterator __pyx_base; | |
2089 struct __pyx_obj_5pysam_9libctabix_Parser *parser; | |
2090 }; | |
2091 | |
2092 | |
2093 /* "pysam/libctabix.pxd":109 | |
2094 * | |
2095 * | |
2096 * cdef class GZIterator: # <<<<<<<<<<<<<< | |
2097 * cdef object _filename | |
2098 * cdef BGZF * gzipfile | |
2099 */ | |
2100 struct __pyx_obj_5pysam_9libctabix_GZIterator { | |
2101 PyObject_HEAD | |
2102 struct __pyx_vtabstruct_5pysam_9libctabix_GZIterator *__pyx_vtab; | |
2103 PyObject *_filename; | |
2104 BGZF *gzipfile; | |
2105 kstream_t *kstream; | |
2106 kstring_t buffer; | |
2107 PyObject *encoding; | |
2108 }; | |
2109 | |
2110 | |
2111 /* "pysam/libctabix.pxd":118 | |
2112 * | |
2113 * | |
2114 * cdef class GZIteratorHead(GZIterator): # <<<<<<<<<<<<<< | |
2115 * pass | |
2116 * | |
2117 */ | |
2118 struct __pyx_obj_5pysam_9libctabix_GZIteratorHead { | |
2119 struct __pyx_obj_5pysam_9libctabix_GZIterator __pyx_base; | |
2120 }; | |
2121 | |
2122 | |
2123 /* "pysam/libctabix.pxd":122 | |
2124 * | |
2125 * | |
2126 * cdef class GZIteratorParsed(GZIterator): # <<<<<<<<<<<<<< | |
2127 * cdef Parser parser | |
2128 * | |
2129 */ | |
2130 struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed { | |
2131 struct __pyx_obj_5pysam_9libctabix_GZIterator __pyx_base; | |
2132 struct __pyx_obj_5pysam_9libctabix_Parser *parser; | |
2133 }; | |
2134 | |
2135 | |
2136 /* "pysam/libctabix.pxd":127 | |
2137 * | |
2138 * # Compatibility Layer for pysam < 0.8 | |
2139 * cdef class Tabixfile(TabixFile): # <<<<<<<<<<<<<< | |
2140 * pass | |
2141 */ | |
2142 struct __pyx_obj_5pysam_9libctabix_Tabixfile { | |
2143 struct __pyx_obj_5pysam_9libctabix_TabixFile __pyx_base; | |
2144 }; | |
2145 | |
2146 | |
2147 | |
2148 /* "pysam/libchtslib.pxd":2706 | |
2149 * | |
2150 * | |
2151 * cdef class HTSFile(object): # <<<<<<<<<<<<<< | |
2152 * cdef htsFile *htsfile # pointer to htsFile structure | |
2153 * cdef int64_t start_offset # BGZF offset of first record | |
2154 */ | |
2155 | |
2156 struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile { | |
2157 htsFile *(*_open_htsfile)(struct __pyx_obj_5pysam_10libchtslib_HTSFile *); | |
2158 }; | |
2159 static struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile *__pyx_vtabptr_5pysam_10libchtslib_HTSFile; | |
2160 | |
2161 | |
2162 /* "pysam/libctabixproxies.pxd":5 | |
2163 * from libc.stdint cimport uint8_t, int32_t, uint32_t, int64_t, uint64_t | |
2164 * | |
2165 * cdef class TupleProxy: # <<<<<<<<<<<<<< | |
2166 * | |
2167 * cdef: | |
2168 */ | |
2169 | |
2170 struct __pyx_vtabstruct_5pysam_16libctabixproxies_TupleProxy { | |
2171 int (*getMaxFields)(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *, int __pyx_skip_dispatch); | |
2172 int (*getMinFields)(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *, int __pyx_skip_dispatch); | |
2173 PyObject *(*take)(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *, char *, size_t); | |
2174 PyObject *(*present)(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *, char *, size_t); | |
2175 PyObject *(*copy)(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *, char *, size_t, struct __pyx_opt_args_5pysam_16libctabixproxies_10TupleProxy_copy *__pyx_optional_args); | |
2176 PyObject *(*update)(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *, char *, size_t); | |
2177 }; | |
2178 static struct __pyx_vtabstruct_5pysam_16libctabixproxies_TupleProxy *__pyx_vtabptr_5pysam_16libctabixproxies_TupleProxy; | |
2179 | |
2180 | |
2181 /* "pysam/libctabixproxies.pxd":32 | |
2182 * | |
2183 * | |
2184 * cdef class NamedTupleProxy(TupleProxy): # <<<<<<<<<<<<<< | |
2185 * pass | |
2186 * | |
2187 */ | |
2188 | |
2189 struct __pyx_vtabstruct_5pysam_16libctabixproxies_NamedTupleProxy { | |
2190 struct __pyx_vtabstruct_5pysam_16libctabixproxies_TupleProxy __pyx_base; | |
2191 }; | |
2192 static struct __pyx_vtabstruct_5pysam_16libctabixproxies_NamedTupleProxy *__pyx_vtabptr_5pysam_16libctabixproxies_NamedTupleProxy; | |
2193 | |
2194 | |
2195 /* "pysam/libctabixproxies.pxd":36 | |
2196 * | |
2197 * | |
2198 * cdef class GTFProxy(NamedTupleProxy): # <<<<<<<<<<<<<< | |
2199 * cdef object attribute_dict | |
2200 * cpdef int getMaxFields(self) | |
2201 */ | |
2202 | |
2203 struct __pyx_vtabstruct_5pysam_16libctabixproxies_GTFProxy { | |
2204 struct __pyx_vtabstruct_5pysam_16libctabixproxies_NamedTupleProxy __pyx_base; | |
2205 }; | |
2206 static struct __pyx_vtabstruct_5pysam_16libctabixproxies_GTFProxy *__pyx_vtabptr_5pysam_16libctabixproxies_GTFProxy; | |
2207 | |
2208 | |
2209 /* "pysam/libctabixproxies.pxd":42 | |
2210 * | |
2211 * | |
2212 * cdef class GFF3Proxy(GTFProxy): # <<<<<<<<<<<<<< | |
2213 * pass | |
2214 * | |
2215 */ | |
2216 | |
2217 struct __pyx_vtabstruct_5pysam_16libctabixproxies_GFF3Proxy { | |
2218 struct __pyx_vtabstruct_5pysam_16libctabixproxies_GTFProxy __pyx_base; | |
2219 }; | |
2220 static struct __pyx_vtabstruct_5pysam_16libctabixproxies_GFF3Proxy *__pyx_vtabptr_5pysam_16libctabixproxies_GFF3Proxy; | |
2221 | |
2222 | |
2223 /* "pysam/libctabixproxies.pxd":46 | |
2224 * | |
2225 * | |
2226 * cdef class BedProxy(NamedTupleProxy): # <<<<<<<<<<<<<< | |
2227 * | |
2228 * cdef: | |
2229 */ | |
2230 | |
2231 struct __pyx_vtabstruct_5pysam_16libctabixproxies_BedProxy { | |
2232 struct __pyx_vtabstruct_5pysam_16libctabixproxies_NamedTupleProxy __pyx_base; | |
2233 }; | |
2234 static struct __pyx_vtabstruct_5pysam_16libctabixproxies_BedProxy *__pyx_vtabptr_5pysam_16libctabixproxies_BedProxy; | |
2235 | |
2236 | |
2237 /* "pysam/libctabixproxies.pxd":58 | |
2238 * cdef update(self, char * buffer, size_t nbytes) | |
2239 * | |
2240 * cdef class VCFProxy(NamedTupleProxy) : # <<<<<<<<<<<<<< | |
2241 * | |
2242 * cdef: | |
2243 */ | |
2244 | |
2245 struct __pyx_vtabstruct_5pysam_16libctabixproxies_VCFProxy { | |
2246 struct __pyx_vtabstruct_5pysam_16libctabixproxies_NamedTupleProxy __pyx_base; | |
2247 }; | |
2248 static struct __pyx_vtabstruct_5pysam_16libctabixproxies_VCFProxy *__pyx_vtabptr_5pysam_16libctabixproxies_VCFProxy; | |
2249 | |
2250 | |
2251 /* "pysam/libctabix.pyx":1098 | |
2252 * | |
2253 * | |
2254 * cdef class tabix_file_iterator: # <<<<<<<<<<<<<< | |
2255 * '''iterate over a compressed or uncompressed ``infile``. | |
2256 * ''' | |
2257 */ | |
2258 | |
2259 struct __pyx_vtabstruct_5pysam_9libctabix_tabix_file_iterator { | |
2260 PyObject *(*__pyx___cnext__)(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *); | |
2261 }; | |
2262 static struct __pyx_vtabstruct_5pysam_9libctabix_tabix_file_iterator *__pyx_vtabptr_5pysam_9libctabix_tabix_file_iterator; | |
2263 | |
2264 | |
2265 /* "pysam/libctabix.pyx":287 | |
2266 * | |
2267 * | |
2268 * cdef class TabixFile: # <<<<<<<<<<<<<< | |
2269 * """Random access to bgzf formatted files that | |
2270 * have been indexed by :term:`tabix`. | |
2271 */ | |
2272 | |
2273 struct __pyx_vtabstruct_5pysam_9libctabix_TabixFile { | |
2274 struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile __pyx_base; | |
2275 }; | |
2276 static struct __pyx_vtabstruct_5pysam_9libctabix_TabixFile *__pyx_vtabptr_5pysam_9libctabix_TabixFile; | |
2277 | |
2278 | |
2279 /* "pysam/libctabix.pyx":82 | |
2280 * from pysam.libcutils cimport encode_filename, from_string_and_size | |
2281 * | |
2282 * cdef class Parser: # <<<<<<<<<<<<<< | |
2283 * | |
2284 * def __init__(self, encoding="ascii"): | |
2285 */ | |
2286 | |
2287 struct __pyx_vtabstruct_5pysam_9libctabix_Parser { | |
2288 PyObject *(*parse)(struct __pyx_obj_5pysam_9libctabix_Parser *, char *, int); | |
2289 }; | |
2290 static struct __pyx_vtabstruct_5pysam_9libctabix_Parser *__pyx_vtabptr_5pysam_9libctabix_Parser; | |
2291 | |
2292 | |
2293 /* "pysam/libctabix.pyx":101 | |
2294 * | |
2295 * | |
2296 * cdef class asTuple(Parser): # <<<<<<<<<<<<<< | |
2297 * '''converts a :term:`tabix row` into a python tuple. | |
2298 * | |
2299 */ | |
2300 | |
2301 struct __pyx_vtabstruct_5pysam_9libctabix_asTuple { | |
2302 struct __pyx_vtabstruct_5pysam_9libctabix_Parser __pyx_base; | |
2303 }; | |
2304 static struct __pyx_vtabstruct_5pysam_9libctabix_asTuple *__pyx_vtabptr_5pysam_9libctabix_asTuple; | |
2305 | |
2306 | |
2307 /* "pysam/libctabix.pyx":151 | |
2308 * | |
2309 * | |
2310 * cdef class asGTF(Parser): # <<<<<<<<<<<<<< | |
2311 * '''converts a :term:`tabix row` into a GTF record with the following | |
2312 * fields: | |
2313 */ | |
2314 | |
2315 struct __pyx_vtabstruct_5pysam_9libctabix_asGTF { | |
2316 struct __pyx_vtabstruct_5pysam_9libctabix_Parser __pyx_base; | |
2317 }; | |
2318 static struct __pyx_vtabstruct_5pysam_9libctabix_asGTF *__pyx_vtabptr_5pysam_9libctabix_asGTF; | |
2319 | |
2320 | |
2321 /* "pysam/libctabix.pyx":115 | |
2322 * | |
2323 * | |
2324 * cdef class asGFF3(Parser): # <<<<<<<<<<<<<< | |
2325 * '''converts a :term:`tabix row` into a GFF record with the following | |
2326 * fields: | |
2327 */ | |
2328 | |
2329 struct __pyx_vtabstruct_5pysam_9libctabix_asGFF3 { | |
2330 struct __pyx_vtabstruct_5pysam_9libctabix_Parser __pyx_base; | |
2331 }; | |
2332 static struct __pyx_vtabstruct_5pysam_9libctabix_asGFF3 *__pyx_vtabptr_5pysam_9libctabix_asGFF3; | |
2333 | |
2334 | |
2335 /* "pysam/libctabix.pyx":198 | |
2336 * | |
2337 * | |
2338 * cdef class asBed(Parser): # <<<<<<<<<<<<<< | |
2339 * '''converts a :term:`tabix row` into a bed record | |
2340 * with the following fields: | |
2341 */ | |
2342 | |
2343 struct __pyx_vtabstruct_5pysam_9libctabix_asBed { | |
2344 struct __pyx_vtabstruct_5pysam_9libctabix_Parser __pyx_base; | |
2345 }; | |
2346 static struct __pyx_vtabstruct_5pysam_9libctabix_asBed *__pyx_vtabptr_5pysam_9libctabix_asBed; | |
2347 | |
2348 | |
2349 /* "pysam/libctabix.pyx":246 | |
2350 * | |
2351 * | |
2352 * cdef class asVCF(Parser): # <<<<<<<<<<<<<< | |
2353 * '''converts a :term:`tabix row` into a VCF record with | |
2354 * the following fields: | |
2355 */ | |
2356 | |
2357 struct __pyx_vtabstruct_5pysam_9libctabix_asVCF { | |
2358 struct __pyx_vtabstruct_5pysam_9libctabix_Parser __pyx_base; | |
2359 }; | |
2360 static struct __pyx_vtabstruct_5pysam_9libctabix_asVCF *__pyx_vtabptr_5pysam_9libctabix_asVCF; | |
2361 | |
2362 | |
2363 /* "pysam/libctabix.pyx":619 | |
2364 * | |
2365 * | |
2366 * cdef class TabixIterator: # <<<<<<<<<<<<<< | |
2367 * """iterates over rows in *tabixfile* in region | |
2368 * given by *tid*, *start* and *end*. | |
2369 */ | |
2370 | |
2371 struct __pyx_vtabstruct_5pysam_9libctabix_TabixIterator { | |
2372 int (*__pyx___cnext__)(struct __pyx_obj_5pysam_9libctabix_TabixIterator *); | |
2373 }; | |
2374 static struct __pyx_vtabstruct_5pysam_9libctabix_TabixIterator *__pyx_vtabptr_5pysam_9libctabix_TabixIterator; | |
2375 | |
2376 | |
2377 /* "pysam/libctabix.pyx":692 | |
2378 * | |
2379 * | |
2380 * cdef class TabixIteratorParsed(TabixIterator): # <<<<<<<<<<<<<< | |
2381 * """iterates over mapped reads in a region. | |
2382 * | |
2383 */ | |
2384 | |
2385 struct __pyx_vtabstruct_5pysam_9libctabix_TabixIteratorParsed { | |
2386 struct __pyx_vtabstruct_5pysam_9libctabix_TabixIterator __pyx_base; | |
2387 }; | |
2388 static struct __pyx_vtabstruct_5pysam_9libctabix_TabixIteratorParsed *__pyx_vtabptr_5pysam_9libctabix_TabixIteratorParsed; | |
2389 | |
2390 | |
2391 /* "pysam/libctabix.pyx":720 | |
2392 * | |
2393 * | |
2394 * cdef class GZIterator: # <<<<<<<<<<<<<< | |
2395 * def __init__(self, filename, int buffer_size=65536, encoding="ascii"): | |
2396 * '''iterate line-by-line through gzip (or bgzip) | |
2397 */ | |
2398 | |
2399 struct __pyx_vtabstruct_5pysam_9libctabix_GZIterator { | |
2400 int (*__pyx___cnext__)(struct __pyx_obj_5pysam_9libctabix_GZIterator *); | |
2401 }; | |
2402 static struct __pyx_vtabstruct_5pysam_9libctabix_GZIterator *__pyx_vtabptr_5pysam_9libctabix_GZIterator; | |
2403 | |
2404 | |
2405 /* "pysam/libctabix.pyx":775 | |
2406 * | |
2407 * | |
2408 * cdef class GZIteratorHead(GZIterator): # <<<<<<<<<<<<<< | |
2409 * '''iterate line-by-line through gzip (or bgzip) | |
2410 * compressed file returning comments at top of file. | |
2411 */ | |
2412 | |
2413 struct __pyx_vtabstruct_5pysam_9libctabix_GZIteratorHead { | |
2414 struct __pyx_vtabstruct_5pysam_9libctabix_GZIterator __pyx_base; | |
2415 }; | |
2416 static struct __pyx_vtabstruct_5pysam_9libctabix_GZIteratorHead *__pyx_vtabptr_5pysam_9libctabix_GZIteratorHead; | |
2417 | |
2418 | |
2419 /* "pysam/libctabix.pyx":792 | |
2420 * | |
2421 * | |
2422 * cdef class GZIteratorParsed(GZIterator): # <<<<<<<<<<<<<< | |
2423 * '''iterate line-by-line through gzip (or bgzip) | |
2424 * compressed file returning comments at top of file. | |
2425 */ | |
2426 | |
2427 struct __pyx_vtabstruct_5pysam_9libctabix_GZIteratorParsed { | |
2428 struct __pyx_vtabstruct_5pysam_9libctabix_GZIterator __pyx_base; | |
2429 }; | |
2430 static struct __pyx_vtabstruct_5pysam_9libctabix_GZIteratorParsed *__pyx_vtabptr_5pysam_9libctabix_GZIteratorParsed; | |
2431 | |
2432 | |
2433 /* "pysam/libctabix.pyx":1251 | |
2434 * | |
2435 * | |
2436 * cdef class Tabixfile(TabixFile): # <<<<<<<<<<<<<< | |
2437 * """Tabixfile is deprecated: use TabixFile instead""" | |
2438 * pass | |
2439 */ | |
2440 | |
2441 struct __pyx_vtabstruct_5pysam_9libctabix_Tabixfile { | |
2442 struct __pyx_vtabstruct_5pysam_9libctabix_TabixFile __pyx_base; | |
2443 }; | |
2444 static struct __pyx_vtabstruct_5pysam_9libctabix_Tabixfile *__pyx_vtabptr_5pysam_9libctabix_Tabixfile; | |
2445 /* #### Code section: utility_code_proto ### */ | |
2446 | |
2447 /* --- Runtime support code (head) --- */ | |
2448 /* Refnanny.proto */ | |
2449 #ifndef CYTHON_REFNANNY | |
2450 #define CYTHON_REFNANNY 0 | |
2451 #endif | |
2452 #if CYTHON_REFNANNY | |
2453 typedef struct { | |
2454 void (*INCREF)(void*, PyObject*, Py_ssize_t); | |
2455 void (*DECREF)(void*, PyObject*, Py_ssize_t); | |
2456 void (*GOTREF)(void*, PyObject*, Py_ssize_t); | |
2457 void (*GIVEREF)(void*, PyObject*, Py_ssize_t); | |
2458 void* (*SetupContext)(const char*, Py_ssize_t, const char*); | |
2459 void (*FinishContext)(void**); | |
2460 } __Pyx_RefNannyAPIStruct; | |
2461 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; | |
2462 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); | |
2463 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; | |
2464 #ifdef WITH_THREAD | |
2465 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ | |
2466 if (acquire_gil) {\ | |
2467 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ | |
2468 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ | |
2469 PyGILState_Release(__pyx_gilstate_save);\ | |
2470 } else {\ | |
2471 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ | |
2472 } | |
2473 #define __Pyx_RefNannyFinishContextNogil() {\ | |
2474 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ | |
2475 __Pyx_RefNannyFinishContext();\ | |
2476 PyGILState_Release(__pyx_gilstate_save);\ | |
2477 } | |
2478 #else | |
2479 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ | |
2480 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) | |
2481 #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() | |
2482 #endif | |
2483 #define __Pyx_RefNannyFinishContextNogil() {\ | |
2484 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ | |
2485 __Pyx_RefNannyFinishContext();\ | |
2486 PyGILState_Release(__pyx_gilstate_save);\ | |
2487 } | |
2488 #define __Pyx_RefNannyFinishContext()\ | |
2489 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) | |
2490 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) | |
2491 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) | |
2492 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) | |
2493 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) | |
2494 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) | |
2495 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) | |
2496 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) | |
2497 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) | |
2498 #else | |
2499 #define __Pyx_RefNannyDeclarations | |
2500 #define __Pyx_RefNannySetupContext(name, acquire_gil) | |
2501 #define __Pyx_RefNannyFinishContextNogil() | |
2502 #define __Pyx_RefNannyFinishContext() | |
2503 #define __Pyx_INCREF(r) Py_INCREF(r) | |
2504 #define __Pyx_DECREF(r) Py_DECREF(r) | |
2505 #define __Pyx_GOTREF(r) | |
2506 #define __Pyx_GIVEREF(r) | |
2507 #define __Pyx_XINCREF(r) Py_XINCREF(r) | |
2508 #define __Pyx_XDECREF(r) Py_XDECREF(r) | |
2509 #define __Pyx_XGOTREF(r) | |
2510 #define __Pyx_XGIVEREF(r) | |
2511 #endif | |
2512 #define __Pyx_Py_XDECREF_SET(r, v) do {\ | |
2513 PyObject *tmp = (PyObject *) r;\ | |
2514 r = v; Py_XDECREF(tmp);\ | |
2515 } while (0) | |
2516 #define __Pyx_XDECREF_SET(r, v) do {\ | |
2517 PyObject *tmp = (PyObject *) r;\ | |
2518 r = v; __Pyx_XDECREF(tmp);\ | |
2519 } while (0) | |
2520 #define __Pyx_DECREF_SET(r, v) do {\ | |
2521 PyObject *tmp = (PyObject *) r;\ | |
2522 r = v; __Pyx_DECREF(tmp);\ | |
2523 } while (0) | |
2524 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) | |
2525 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) | |
2526 | |
2527 /* PyErrExceptionMatches.proto */ | |
2528 #if CYTHON_FAST_THREAD_STATE | |
2529 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) | |
2530 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); | |
2531 #else | |
2532 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) | |
2533 #endif | |
2534 | |
2535 /* PyThreadStateGet.proto */ | |
2536 #if CYTHON_FAST_THREAD_STATE | |
2537 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; | |
2538 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; | |
2539 #if PY_VERSION_HEX >= 0x030C00A6 | |
2540 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) | |
2541 #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) | |
2542 #else | |
2543 #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) | |
2544 #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) | |
2545 #endif | |
2546 #else | |
2547 #define __Pyx_PyThreadState_declare | |
2548 #define __Pyx_PyThreadState_assign | |
2549 #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) | |
2550 #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() | |
2551 #endif | |
2552 | |
2553 /* PyErrFetchRestore.proto */ | |
2554 #if CYTHON_FAST_THREAD_STATE | |
2555 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) | |
2556 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) | |
2557 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) | |
2558 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) | |
2559 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) | |
2560 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); | |
2561 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); | |
2562 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 | |
2563 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) | |
2564 #else | |
2565 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) | |
2566 #endif | |
2567 #else | |
2568 #define __Pyx_PyErr_Clear() PyErr_Clear() | |
2569 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) | |
2570 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) | |
2571 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) | |
2572 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) | |
2573 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) | |
2574 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) | |
2575 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) | |
2576 #endif | |
2577 | |
2578 /* PyObjectGetAttrStr.proto */ | |
2579 #if CYTHON_USE_TYPE_SLOTS | |
2580 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); | |
2581 #else | |
2582 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) | |
2583 #endif | |
2584 | |
2585 /* PyObjectGetAttrStrNoError.proto */ | |
2586 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); | |
2587 | |
2588 /* GetBuiltinName.proto */ | |
2589 static PyObject *__Pyx_GetBuiltinName(PyObject *name); | |
2590 | |
2591 /* TupleAndListFromArray.proto */ | |
2592 #if CYTHON_COMPILING_IN_CPYTHON | |
2593 static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); | |
2594 static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); | |
2595 #endif | |
2596 | |
2597 /* IncludeStringH.proto */ | |
2598 #include <string.h> | |
2599 | |
2600 /* BytesEquals.proto */ | |
2601 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); | |
2602 | |
2603 /* UnicodeEquals.proto */ | |
2604 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); | |
2605 | |
2606 /* fastcall.proto */ | |
2607 #if CYTHON_AVOID_BORROWED_REFS | |
2608 #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) | |
2609 #elif CYTHON_ASSUME_SAFE_MACROS | |
2610 #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) | |
2611 #else | |
2612 #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) | |
2613 #endif | |
2614 #if CYTHON_AVOID_BORROWED_REFS | |
2615 #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) | |
2616 #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) | |
2617 #else | |
2618 #define __Pyx_Arg_NewRef_VARARGS(arg) arg | |
2619 #define __Pyx_Arg_XDECREF_VARARGS(arg) | |
2620 #endif | |
2621 #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) | |
2622 #define __Pyx_KwValues_VARARGS(args, nargs) NULL | |
2623 #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) | |
2624 #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) | |
2625 #if CYTHON_METH_FASTCALL | |
2626 #define __Pyx_Arg_FASTCALL(args, i) args[i] | |
2627 #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) | |
2628 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) | |
2629 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); | |
2630 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 | |
2631 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); | |
2632 #else | |
2633 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) | |
2634 #endif | |
2635 #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs | |
2636 to have the same reference counting */ | |
2637 #define __Pyx_Arg_XDECREF_FASTCALL(arg) | |
2638 #else | |
2639 #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS | |
2640 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS | |
2641 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS | |
2642 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS | |
2643 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS | |
2644 #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) | |
2645 #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) | |
2646 #endif | |
2647 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
2648 #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) | |
2649 #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) | |
2650 #else | |
2651 #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) | |
2652 #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) | |
2653 #endif | |
2654 | |
2655 /* RaiseDoubleKeywords.proto */ | |
2656 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); | |
2657 | |
2658 /* ParseKeywords.proto */ | |
2659 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, | |
2660 PyObject **argnames[], | |
2661 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, | |
2662 const char* function_name); | |
2663 | |
2664 /* RaiseArgTupleInvalid.proto */ | |
2665 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, | |
2666 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); | |
2667 | |
2668 /* Profile.proto */ | |
2669 #ifndef CYTHON_PROFILE | |
2670 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY | |
2671 #define CYTHON_PROFILE 0 | |
2672 #else | |
2673 #define CYTHON_PROFILE 1 | |
2674 #endif | |
2675 #endif | |
2676 #ifndef CYTHON_TRACE_NOGIL | |
2677 #define CYTHON_TRACE_NOGIL 0 | |
2678 #else | |
2679 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) | |
2680 #define CYTHON_TRACE 1 | |
2681 #endif | |
2682 #endif | |
2683 #ifndef CYTHON_TRACE | |
2684 #define CYTHON_TRACE 0 | |
2685 #endif | |
2686 #if CYTHON_TRACE | |
2687 #undef CYTHON_PROFILE_REUSE_FRAME | |
2688 #endif | |
2689 #ifndef CYTHON_PROFILE_REUSE_FRAME | |
2690 #define CYTHON_PROFILE_REUSE_FRAME 0 | |
2691 #endif | |
2692 #if CYTHON_PROFILE || CYTHON_TRACE | |
2693 #include "compile.h" | |
2694 #include "frameobject.h" | |
2695 #include "traceback.h" | |
2696 #if PY_VERSION_HEX >= 0x030b00a6 | |
2697 #ifndef Py_BUILD_CORE | |
2698 #define Py_BUILD_CORE 1 | |
2699 #endif | |
2700 #include "internal/pycore_frame.h" | |
2701 #endif | |
2702 #if CYTHON_PROFILE_REUSE_FRAME | |
2703 #define CYTHON_FRAME_MODIFIER static | |
2704 #define CYTHON_FRAME_DEL(frame) | |
2705 #else | |
2706 #define CYTHON_FRAME_MODIFIER | |
2707 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) | |
2708 #endif | |
2709 #define __Pyx_TraceDeclarations\ | |
2710 static PyCodeObject *__pyx_frame_code = NULL;\ | |
2711 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ | |
2712 int __Pyx_use_tracing = 0; | |
2713 #define __Pyx_TraceFrameInit(codeobj)\ | |
2714 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; | |
2715 #if PY_VERSION_HEX >= 0x030b00a2 | |
2716 #if PY_VERSION_HEX >= 0x030C00b1 | |
2717 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ | |
2718 ((!(check_tracing) || !(tstate)->tracing) &&\ | |
2719 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) | |
2720 #else | |
2721 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ | |
2722 (unlikely((tstate)->cframe->use_tracing) &&\ | |
2723 (!(check_tracing) || !(tstate)->tracing) &&\ | |
2724 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) | |
2725 #endif | |
2726 #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) | |
2727 #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) | |
2728 #elif PY_VERSION_HEX >= 0x030a00b1 | |
2729 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ | |
2730 (unlikely((tstate)->cframe->use_tracing) &&\ | |
2731 (!(check_tracing) || !(tstate)->tracing) &&\ | |
2732 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) | |
2733 #define __Pyx_EnterTracing(tstate)\ | |
2734 do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) | |
2735 #define __Pyx_LeaveTracing(tstate)\ | |
2736 do {\ | |
2737 tstate->tracing--;\ | |
2738 tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ | |
2739 || tstate->c_profilefunc != NULL);\ | |
2740 } while (0) | |
2741 #else | |
2742 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ | |
2743 (unlikely((tstate)->use_tracing) &&\ | |
2744 (!(check_tracing) || !(tstate)->tracing) &&\ | |
2745 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) | |
2746 #define __Pyx_EnterTracing(tstate)\ | |
2747 do { tstate->tracing++; tstate->use_tracing = 0; } while (0) | |
2748 #define __Pyx_LeaveTracing(tstate)\ | |
2749 do {\ | |
2750 tstate->tracing--;\ | |
2751 tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ | |
2752 || tstate->c_profilefunc != NULL);\ | |
2753 } while (0) | |
2754 #endif | |
2755 #ifdef WITH_THREAD | |
2756 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ | |
2757 if (nogil) {\ | |
2758 if (CYTHON_TRACE_NOGIL) {\ | |
2759 PyThreadState *tstate;\ | |
2760 PyGILState_STATE state = PyGILState_Ensure();\ | |
2761 tstate = __Pyx_PyThreadState_Current;\ | |
2762 if (__Pyx_IsTracing(tstate, 1, 1)) {\ | |
2763 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ | |
2764 }\ | |
2765 PyGILState_Release(state);\ | |
2766 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ | |
2767 }\ | |
2768 } else {\ | |
2769 PyThreadState* tstate = PyThreadState_GET();\ | |
2770 if (__Pyx_IsTracing(tstate, 1, 1)) {\ | |
2771 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ | |
2772 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ | |
2773 }\ | |
2774 } | |
2775 #else | |
2776 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ | |
2777 { PyThreadState* tstate = PyThreadState_GET();\ | |
2778 if (__Pyx_IsTracing(tstate, 1, 1)) {\ | |
2779 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ | |
2780 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ | |
2781 }\ | |
2782 } | |
2783 #endif | |
2784 #define __Pyx_TraceException()\ | |
2785 if (likely(!__Pyx_use_tracing)); else {\ | |
2786 PyThreadState* tstate = __Pyx_PyThreadState_Current;\ | |
2787 if (__Pyx_IsTracing(tstate, 0, 1)) {\ | |
2788 __Pyx_EnterTracing(tstate);\ | |
2789 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ | |
2790 if (exc_info) {\ | |
2791 if (CYTHON_TRACE && tstate->c_tracefunc)\ | |
2792 tstate->c_tracefunc(\ | |
2793 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ | |
2794 tstate->c_profilefunc(\ | |
2795 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ | |
2796 Py_DECREF(exc_info);\ | |
2797 }\ | |
2798 __Pyx_LeaveTracing(tstate);\ | |
2799 }\ | |
2800 } | |
2801 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { | |
2802 PyObject *type, *value, *traceback; | |
2803 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); | |
2804 __Pyx_EnterTracing(tstate); | |
2805 if (CYTHON_TRACE && tstate->c_tracefunc) | |
2806 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); | |
2807 if (tstate->c_profilefunc) | |
2808 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); | |
2809 CYTHON_FRAME_DEL(frame); | |
2810 __Pyx_LeaveTracing(tstate); | |
2811 __Pyx_ErrRestoreInState(tstate, type, value, traceback); | |
2812 } | |
2813 #ifdef WITH_THREAD | |
2814 #define __Pyx_TraceReturn(result, nogil)\ | |
2815 if (likely(!__Pyx_use_tracing)); else {\ | |
2816 if (nogil) {\ | |
2817 if (CYTHON_TRACE_NOGIL) {\ | |
2818 PyThreadState *tstate;\ | |
2819 PyGILState_STATE state = PyGILState_Ensure();\ | |
2820 tstate = __Pyx_PyThreadState_Current;\ | |
2821 if (__Pyx_IsTracing(tstate, 0, 0)) {\ | |
2822 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ | |
2823 }\ | |
2824 PyGILState_Release(state);\ | |
2825 }\ | |
2826 } else {\ | |
2827 PyThreadState* tstate = __Pyx_PyThreadState_Current;\ | |
2828 if (__Pyx_IsTracing(tstate, 0, 0)) {\ | |
2829 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ | |
2830 }\ | |
2831 }\ | |
2832 } | |
2833 #else | |
2834 #define __Pyx_TraceReturn(result, nogil)\ | |
2835 if (likely(!__Pyx_use_tracing)); else {\ | |
2836 PyThreadState* tstate = __Pyx_PyThreadState_Current;\ | |
2837 if (__Pyx_IsTracing(tstate, 0, 0)) {\ | |
2838 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ | |
2839 }\ | |
2840 } | |
2841 #endif | |
2842 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); | |
2843 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); | |
2844 #else | |
2845 #define __Pyx_TraceDeclarations | |
2846 #define __Pyx_TraceFrameInit(codeobj) | |
2847 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; | |
2848 #define __Pyx_TraceException() | |
2849 #define __Pyx_TraceReturn(result, nogil) | |
2850 #endif | |
2851 #if CYTHON_TRACE | |
2852 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { | |
2853 int ret; | |
2854 PyObject *type, *value, *traceback; | |
2855 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); | |
2856 __Pyx_PyFrame_SetLineNumber(frame, lineno); | |
2857 __Pyx_EnterTracing(tstate); | |
2858 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); | |
2859 __Pyx_LeaveTracing(tstate); | |
2860 if (likely(!ret)) { | |
2861 __Pyx_ErrRestoreInState(tstate, type, value, traceback); | |
2862 } else { | |
2863 Py_XDECREF(type); | |
2864 Py_XDECREF(value); | |
2865 Py_XDECREF(traceback); | |
2866 } | |
2867 return ret; | |
2868 } | |
2869 #ifdef WITH_THREAD | |
2870 #define __Pyx_TraceLine(lineno, nogil, goto_error)\ | |
2871 if (likely(!__Pyx_use_tracing)); else {\ | |
2872 if (nogil) {\ | |
2873 if (CYTHON_TRACE_NOGIL) {\ | |
2874 int ret = 0;\ | |
2875 PyThreadState *tstate;\ | |
2876 PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ | |
2877 tstate = __Pyx_PyThreadState_Current;\ | |
2878 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ | |
2879 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ | |
2880 }\ | |
2881 __Pyx_PyGILState_Release(state);\ | |
2882 if (unlikely(ret)) goto_error;\ | |
2883 }\ | |
2884 } else {\ | |
2885 PyThreadState* tstate = __Pyx_PyThreadState_Current;\ | |
2886 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ | |
2887 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ | |
2888 if (unlikely(ret)) goto_error;\ | |
2889 }\ | |
2890 }\ | |
2891 } | |
2892 #else | |
2893 #define __Pyx_TraceLine(lineno, nogil, goto_error)\ | |
2894 if (likely(!__Pyx_use_tracing)); else {\ | |
2895 PyThreadState* tstate = __Pyx_PyThreadState_Current;\ | |
2896 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ | |
2897 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ | |
2898 if (unlikely(ret)) goto_error;\ | |
2899 }\ | |
2900 } | |
2901 #endif | |
2902 #else | |
2903 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; | |
2904 #endif | |
2905 | |
2906 /* KeywordStringCheck.proto */ | |
2907 static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); | |
2908 | |
2909 /* PyObject_Unicode.proto */ | |
2910 #if PY_MAJOR_VERSION >= 3 | |
2911 #define __Pyx_PyObject_Unicode(obj)\ | |
2912 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) | |
2913 #else | |
2914 #define __Pyx_PyObject_Unicode(obj)\ | |
2915 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj)) | |
2916 #endif | |
2917 | |
2918 /* PyFunctionFastCall.proto */ | |
2919 #if CYTHON_FAST_PYCALL | |
2920 #if !CYTHON_VECTORCALL | |
2921 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ | |
2922 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) | |
2923 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); | |
2924 #endif | |
2925 #define __Pyx_BUILD_ASSERT_EXPR(cond)\ | |
2926 (sizeof(char [1 - 2*!(cond)]) - 1) | |
2927 #ifndef Py_MEMBER_SIZE | |
2928 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) | |
2929 #endif | |
2930 #if !CYTHON_VECTORCALL | |
2931 #if PY_VERSION_HEX >= 0x03080000 | |
2932 #include "frameobject.h" | |
2933 #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API | |
2934 #ifndef Py_BUILD_CORE | |
2935 #define Py_BUILD_CORE 1 | |
2936 #endif | |
2937 #include "internal/pycore_frame.h" | |
2938 #endif | |
2939 #define __Pxy_PyFrame_Initialize_Offsets() | |
2940 #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) | |
2941 #else | |
2942 static size_t __pyx_pyframe_localsplus_offset = 0; | |
2943 #include "frameobject.h" | |
2944 #define __Pxy_PyFrame_Initialize_Offsets()\ | |
2945 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ | |
2946 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) | |
2947 #define __Pyx_PyFrame_GetLocalsplus(frame)\ | |
2948 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) | |
2949 #endif | |
2950 #endif | |
2951 #endif | |
2952 | |
2953 /* PyObjectCall.proto */ | |
2954 #if CYTHON_COMPILING_IN_CPYTHON | |
2955 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); | |
2956 #else | |
2957 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) | |
2958 #endif | |
2959 | |
2960 /* PyObjectCallMethO.proto */ | |
2961 #if CYTHON_COMPILING_IN_CPYTHON | |
2962 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); | |
2963 #endif | |
2964 | |
2965 /* PyObjectFastCall.proto */ | |
2966 #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) | |
2967 static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); | |
2968 | |
2969 /* PyObjectCallOneArg.proto */ | |
2970 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); | |
2971 | |
2972 /* RaiseException.proto */ | |
2973 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); | |
2974 | |
2975 /* GetAttr3.proto */ | |
2976 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); | |
2977 | |
2978 /* PyDictVersioning.proto */ | |
2979 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS | |
2980 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) | |
2981 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) | |
2982 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ | |
2983 (version_var) = __PYX_GET_DICT_VERSION(dict);\ | |
2984 (cache_var) = (value); | |
2985 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ | |
2986 static PY_UINT64_T __pyx_dict_version = 0;\ | |
2987 static PyObject *__pyx_dict_cached_value = NULL;\ | |
2988 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ | |
2989 (VAR) = __pyx_dict_cached_value;\ | |
2990 } else {\ | |
2991 (VAR) = __pyx_dict_cached_value = (LOOKUP);\ | |
2992 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ | |
2993 }\ | |
2994 } | |
2995 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); | |
2996 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); | |
2997 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); | |
2998 #else | |
2999 #define __PYX_GET_DICT_VERSION(dict) (0) | |
3000 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) | |
3001 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); | |
3002 #endif | |
3003 | |
3004 /* GetModuleGlobalName.proto */ | |
3005 #if CYTHON_USE_DICT_VERSIONS | |
3006 #define __Pyx_GetModuleGlobalName(var, name) do {\ | |
3007 static PY_UINT64_T __pyx_dict_version = 0;\ | |
3008 static PyObject *__pyx_dict_cached_value = NULL;\ | |
3009 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ | |
3010 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ | |
3011 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ | |
3012 } while(0) | |
3013 #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ | |
3014 PY_UINT64_T __pyx_dict_version;\ | |
3015 PyObject *__pyx_dict_cached_value;\ | |
3016 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ | |
3017 } while(0) | |
3018 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); | |
3019 #else | |
3020 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) | |
3021 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) | |
3022 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); | |
3023 #endif | |
3024 | |
3025 /* RaiseUnexpectedTypeError.proto */ | |
3026 static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); | |
3027 | |
3028 /* ExtTypeTest.proto */ | |
3029 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); | |
3030 | |
3031 /* PyIntBinop.proto */ | |
3032 #if !CYTHON_COMPILING_IN_PYPY | |
3033 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); | |
3034 #else | |
3035 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ | |
3036 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) | |
3037 #endif | |
3038 | |
3039 /* ListAppend.proto */ | |
3040 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS | |
3041 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { | |
3042 PyListObject* L = (PyListObject*) list; | |
3043 Py_ssize_t len = Py_SIZE(list); | |
3044 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { | |
3045 Py_INCREF(x); | |
3046 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 | |
3047 L->ob_item[len] = x; | |
3048 #else | |
3049 PyList_SET_ITEM(list, len, x); | |
3050 #endif | |
3051 __Pyx_SET_SIZE(list, len + 1); | |
3052 return 0; | |
3053 } | |
3054 return PyList_Append(list, x); | |
3055 } | |
3056 #else | |
3057 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) | |
3058 #endif | |
3059 | |
3060 /* WriteUnraisableException.proto */ | |
3061 static void __Pyx_WriteUnraisable(const char *name, int clineno, | |
3062 int lineno, const char *filename, | |
3063 int full_traceback, int nogil); | |
3064 | |
3065 /* PyObjectCallNoArg.proto */ | |
3066 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); | |
3067 | |
3068 /* ArgTypeTest.proto */ | |
3069 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ | |
3070 ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ | |
3071 __Pyx__ArgTypeTest(obj, type, name, exact)) | |
3072 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); | |
3073 | |
3074 /* PyObjectFormatAndDecref.proto */ | |
3075 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); | |
3076 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); | |
3077 | |
3078 /* JoinPyUnicode.proto */ | |
3079 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, | |
3080 Py_UCS4 max_char); | |
3081 | |
3082 /* DictGetItem.proto */ | |
3083 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY | |
3084 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); | |
3085 #define __Pyx_PyObject_Dict_GetItem(obj, name)\ | |
3086 (likely(PyDict_CheckExact(obj)) ?\ | |
3087 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) | |
3088 #else | |
3089 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) | |
3090 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) | |
3091 #endif | |
3092 | |
3093 /* GetTopmostException.proto */ | |
3094 #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE | |
3095 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); | |
3096 #endif | |
3097 | |
3098 /* SaveResetException.proto */ | |
3099 #if CYTHON_FAST_THREAD_STATE | |
3100 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) | |
3101 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); | |
3102 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) | |
3103 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); | |
3104 #else | |
3105 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) | |
3106 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) | |
3107 #endif | |
3108 | |
3109 /* GetException.proto */ | |
3110 #if CYTHON_FAST_THREAD_STATE | |
3111 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) | |
3112 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); | |
3113 #else | |
3114 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); | |
3115 #endif | |
3116 | |
3117 /* py_dict_keys.proto */ | |
3118 static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); | |
3119 | |
3120 /* UnpackUnboundCMethod.proto */ | |
3121 typedef struct { | |
3122 PyObject *type; | |
3123 PyObject **method_name; | |
3124 PyCFunction func; | |
3125 PyObject *method; | |
3126 int flag; | |
3127 } __Pyx_CachedCFunction; | |
3128 | |
3129 /* CallUnboundCMethod0.proto */ | |
3130 static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); | |
3131 #if CYTHON_COMPILING_IN_CPYTHON | |
3132 #define __Pyx_CallUnboundCMethod0(cfunc, self)\ | |
3133 (likely((cfunc)->func) ?\ | |
3134 (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ | |
3135 (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\ | |
3136 (PY_VERSION_HEX >= 0x030700A0 ?\ | |
3137 (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\ | |
3138 (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\ | |
3139 (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ | |
3140 (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\ | |
3141 (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ | |
3142 ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ | |
3143 __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\ | |
3144 __Pyx__CallUnboundCMethod0(cfunc, self)) | |
3145 #else | |
3146 #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) | |
3147 #endif | |
3148 | |
3149 /* UnicodeAsUCS4.proto */ | |
3150 static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*); | |
3151 | |
3152 /* object_ord.proto */ | |
3153 #if PY_MAJOR_VERSION >= 3 | |
3154 #define __Pyx_PyObject_Ord(c)\ | |
3155 (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c)) | |
3156 #else | |
3157 #define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c) | |
3158 #endif | |
3159 static long __Pyx__PyObject_Ord(PyObject* c); | |
3160 | |
3161 /* RaiseTooManyValuesToUnpack.proto */ | |
3162 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); | |
3163 | |
3164 /* RaiseNeedMoreValuesToUnpack.proto */ | |
3165 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); | |
3166 | |
3167 /* IterFinish.proto */ | |
3168 static CYTHON_INLINE int __Pyx_IterFinish(void); | |
3169 | |
3170 /* UnpackItemEndCheck.proto */ | |
3171 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); | |
3172 | |
3173 /* PyObjectSetAttrStr.proto */ | |
3174 #if CYTHON_USE_TYPE_SLOTS | |
3175 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) | |
3176 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); | |
3177 #else | |
3178 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) | |
3179 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) | |
3180 #endif | |
3181 | |
3182 /* AssertionsEnabled.proto */ | |
3183 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) | |
3184 #define __Pyx_init_assertions_enabled() (0) | |
3185 #define __pyx_assertions_enabled() (1) | |
3186 #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) | |
3187 static int __pyx_assertions_enabled_flag; | |
3188 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) | |
3189 static int __Pyx_init_assertions_enabled(void) { | |
3190 PyObject *builtins, *debug, *debug_str; | |
3191 int flag; | |
3192 builtins = PyEval_GetBuiltins(); | |
3193 if (!builtins) goto bad; | |
3194 debug_str = PyUnicode_FromStringAndSize("__debug__", 9); | |
3195 if (!debug_str) goto bad; | |
3196 debug = PyObject_GetItem(builtins, debug_str); | |
3197 Py_DECREF(debug_str); | |
3198 if (!debug) goto bad; | |
3199 flag = PyObject_IsTrue(debug); | |
3200 Py_DECREF(debug); | |
3201 if (flag == -1) goto bad; | |
3202 __pyx_assertions_enabled_flag = flag; | |
3203 return 0; | |
3204 bad: | |
3205 __pyx_assertions_enabled_flag = 1; | |
3206 return -1; | |
3207 } | |
3208 #else | |
3209 #define __Pyx_init_assertions_enabled() (0) | |
3210 #define __pyx_assertions_enabled() (!Py_OptimizeFlag) | |
3211 #endif | |
3212 | |
3213 /* PySequenceContains.proto */ | |
3214 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { | |
3215 int result = PySequence_Contains(seq, item); | |
3216 return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); | |
3217 } | |
3218 | |
3219 /* Import.proto */ | |
3220 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); | |
3221 | |
3222 /* ImportFrom.proto */ | |
3223 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); | |
3224 | |
3225 /* GetItemInt.proto */ | |
3226 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ | |
3227 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ | |
3228 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ | |
3229 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ | |
3230 __Pyx_GetItemInt_Generic(o, to_py_func(i)))) | |
3231 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ | |
3232 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ | |
3233 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ | |
3234 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) | |
3235 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, | |
3236 int wraparound, int boundscheck); | |
3237 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ | |
3238 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ | |
3239 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ | |
3240 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) | |
3241 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, | |
3242 int wraparound, int boundscheck); | |
3243 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); | |
3244 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, | |
3245 int is_list, int wraparound, int boundscheck); | |
3246 | |
3247 /* GetAttr.proto */ | |
3248 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); | |
3249 | |
3250 /* HasAttr.proto */ | |
3251 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); | |
3252 | |
3253 /* CallNextTpDealloc.proto */ | |
3254 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); | |
3255 | |
3256 /* CallNextTpTraverse.proto */ | |
3257 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); | |
3258 | |
3259 /* CallNextTpClear.proto */ | |
3260 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear); | |
3261 | |
3262 /* IncludeStructmemberH.proto */ | |
3263 #include <structmember.h> | |
3264 | |
3265 /* FixUpExtensionType.proto */ | |
3266 #if CYTHON_USE_TYPE_SPECS | |
3267 static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); | |
3268 #endif | |
3269 | |
3270 /* PyObjectGetMethod.proto */ | |
3271 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); | |
3272 | |
3273 /* PyObjectCallMethod0.proto */ | |
3274 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); | |
3275 | |
3276 /* ValidateBasesTuple.proto */ | |
3277 #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS | |
3278 static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); | |
3279 #endif | |
3280 | |
3281 /* PyType_Ready.proto */ | |
3282 CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); | |
3283 | |
3284 /* PyObject_GenericGetAttrNoDict.proto */ | |
3285 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 | |
3286 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); | |
3287 #else | |
3288 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr | |
3289 #endif | |
3290 | |
3291 /* PyObject_GenericGetAttr.proto */ | |
3292 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 | |
3293 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); | |
3294 #else | |
3295 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr | |
3296 #endif | |
3297 | |
3298 /* SetVTable.proto */ | |
3299 static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable); | |
3300 | |
3301 /* GetVTable.proto */ | |
3302 static void* __Pyx_GetVtable(PyTypeObject *type); | |
3303 | |
3304 /* MergeVTables.proto */ | |
3305 #if !CYTHON_COMPILING_IN_LIMITED_API | |
3306 static int __Pyx_MergeVtables(PyTypeObject *type); | |
3307 #endif | |
3308 | |
3309 /* SetupReduce.proto */ | |
3310 #if !CYTHON_COMPILING_IN_LIMITED_API | |
3311 static int __Pyx_setup_reduce(PyObject* type_obj); | |
3312 #endif | |
3313 | |
3314 /* TypeImport.proto */ | |
3315 #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11 | |
3316 #define __PYX_HAVE_RT_ImportType_proto_3_0_11 | |
3317 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L | |
3318 #include <stdalign.h> | |
3319 #endif | |
3320 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L | |
3321 #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s) | |
3322 #else | |
3323 #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*) | |
3324 #endif | |
3325 enum __Pyx_ImportType_CheckSize_3_0_11 { | |
3326 __Pyx_ImportType_CheckSize_Error_3_0_11 = 0, | |
3327 __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1, | |
3328 __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2 | |
3329 }; | |
3330 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); | |
3331 #endif | |
3332 | |
3333 /* ImportDottedModule.proto */ | |
3334 static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); | |
3335 #if PY_MAJOR_VERSION >= 3 | |
3336 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); | |
3337 #endif | |
3338 | |
3339 /* FetchSharedCythonModule.proto */ | |
3340 static PyObject *__Pyx_FetchSharedCythonABIModule(void); | |
3341 | |
3342 /* FetchCommonType.proto */ | |
3343 #if !CYTHON_USE_TYPE_SPECS | |
3344 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); | |
3345 #else | |
3346 static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); | |
3347 #endif | |
3348 | |
3349 /* PyMethodNew.proto */ | |
3350 #if CYTHON_COMPILING_IN_LIMITED_API | |
3351 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { | |
3352 PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; | |
3353 CYTHON_UNUSED_VAR(typ); | |
3354 if (!self) | |
3355 return __Pyx_NewRef(func); | |
3356 typesModule = PyImport_ImportModule("types"); | |
3357 if (!typesModule) return NULL; | |
3358 methodType = PyObject_GetAttrString(typesModule, "MethodType"); | |
3359 Py_DECREF(typesModule); | |
3360 if (!methodType) return NULL; | |
3361 result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); | |
3362 Py_DECREF(methodType); | |
3363 return result; | |
3364 } | |
3365 #elif PY_MAJOR_VERSION >= 3 | |
3366 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { | |
3367 CYTHON_UNUSED_VAR(typ); | |
3368 if (!self) | |
3369 return __Pyx_NewRef(func); | |
3370 return PyMethod_New(func, self); | |
3371 } | |
3372 #else | |
3373 #define __Pyx_PyMethod_New PyMethod_New | |
3374 #endif | |
3375 | |
3376 /* PyVectorcallFastCallDict.proto */ | |
3377 #if CYTHON_METH_FASTCALL | |
3378 static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); | |
3379 #endif | |
3380 | |
3381 /* CythonFunctionShared.proto */ | |
3382 #define __Pyx_CyFunction_USED | |
3383 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 | |
3384 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 | |
3385 #define __Pyx_CYFUNCTION_CCLASS 0x04 | |
3386 #define __Pyx_CYFUNCTION_COROUTINE 0x08 | |
3387 #define __Pyx_CyFunction_GetClosure(f)\ | |
3388 (((__pyx_CyFunctionObject *) (f))->func_closure) | |
3389 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API | |
3390 #define __Pyx_CyFunction_GetClassObj(f)\ | |
3391 (((__pyx_CyFunctionObject *) (f))->func_classobj) | |
3392 #else | |
3393 #define __Pyx_CyFunction_GetClassObj(f)\ | |
3394 ((PyObject*) ((PyCMethodObject *) (f))->mm_class) | |
3395 #endif | |
3396 #define __Pyx_CyFunction_SetClassObj(f, classobj)\ | |
3397 __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) | |
3398 #define __Pyx_CyFunction_Defaults(type, f)\ | |
3399 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) | |
3400 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ | |
3401 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) | |
3402 typedef struct { | |
3403 #if CYTHON_COMPILING_IN_LIMITED_API | |
3404 PyObject_HEAD | |
3405 PyObject *func; | |
3406 #elif PY_VERSION_HEX < 0x030900B1 | |
3407 PyCFunctionObject func; | |
3408 #else | |
3409 PyCMethodObject func; | |
3410 #endif | |
3411 #if CYTHON_BACKPORT_VECTORCALL | |
3412 __pyx_vectorcallfunc func_vectorcall; | |
3413 #endif | |
3414 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API | |
3415 PyObject *func_weakreflist; | |
3416 #endif | |
3417 PyObject *func_dict; | |
3418 PyObject *func_name; | |
3419 PyObject *func_qualname; | |
3420 PyObject *func_doc; | |
3421 PyObject *func_globals; | |
3422 PyObject *func_code; | |
3423 PyObject *func_closure; | |
3424 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API | |
3425 PyObject *func_classobj; | |
3426 #endif | |
3427 void *defaults; | |
3428 int defaults_pyobjects; | |
3429 size_t defaults_size; | |
3430 int flags; | |
3431 PyObject *defaults_tuple; | |
3432 PyObject *defaults_kwdict; | |
3433 PyObject *(*defaults_getter)(PyObject *); | |
3434 PyObject *func_annotations; | |
3435 PyObject *func_is_coroutine; | |
3436 } __pyx_CyFunctionObject; | |
3437 #undef __Pyx_CyOrPyCFunction_Check | |
3438 #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) | |
3439 #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) | |
3440 #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) | |
3441 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); | |
3442 #undef __Pyx_IsSameCFunction | |
3443 #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) | |
3444 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, | |
3445 int flags, PyObject* qualname, | |
3446 PyObject *closure, | |
3447 PyObject *module, PyObject *globals, | |
3448 PyObject* code); | |
3449 static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); | |
3450 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, | |
3451 size_t size, | |
3452 int pyobjects); | |
3453 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, | |
3454 PyObject *tuple); | |
3455 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, | |
3456 PyObject *dict); | |
3457 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, | |
3458 PyObject *dict); | |
3459 static int __pyx_CyFunction_init(PyObject *module); | |
3460 #if CYTHON_METH_FASTCALL | |
3461 static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); | |
3462 static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); | |
3463 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); | |
3464 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); | |
3465 #if CYTHON_BACKPORT_VECTORCALL | |
3466 #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) | |
3467 #else | |
3468 #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) | |
3469 #endif | |
3470 #endif | |
3471 | |
3472 /* CythonFunction.proto */ | |
3473 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, | |
3474 int flags, PyObject* qualname, | |
3475 PyObject *closure, | |
3476 PyObject *module, PyObject *globals, | |
3477 PyObject* code); | |
3478 | |
3479 /* SetNameInClass.proto */ | |
3480 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 | |
3481 #define __Pyx_SetNameInClass(ns, name, value)\ | |
3482 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) | |
3483 #elif CYTHON_COMPILING_IN_CPYTHON | |
3484 #define __Pyx_SetNameInClass(ns, name, value)\ | |
3485 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) | |
3486 #else | |
3487 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) | |
3488 #endif | |
3489 | |
3490 /* CalculateMetaclass.proto */ | |
3491 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); | |
3492 | |
3493 /* PyObjectCall2Args.proto */ | |
3494 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); | |
3495 | |
3496 /* PyObjectLookupSpecial.proto */ | |
3497 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS | |
3498 #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) | |
3499 #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) | |
3500 static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); | |
3501 #else | |
3502 #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) | |
3503 #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) | |
3504 #endif | |
3505 | |
3506 /* Py3ClassCreate.proto */ | |
3507 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, | |
3508 PyObject *mkw, PyObject *modname, PyObject *doc); | |
3509 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, | |
3510 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); | |
3511 | |
3512 /* CLineInTraceback.proto */ | |
3513 #ifdef CYTHON_CLINE_IN_TRACEBACK | |
3514 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) | |
3515 #else | |
3516 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); | |
3517 #endif | |
3518 | |
3519 /* CodeObjectCache.proto */ | |
3520 #if !CYTHON_COMPILING_IN_LIMITED_API | |
3521 typedef struct { | |
3522 PyCodeObject* code_object; | |
3523 int code_line; | |
3524 } __Pyx_CodeObjectCacheEntry; | |
3525 struct __Pyx_CodeObjectCache { | |
3526 int count; | |
3527 int max_count; | |
3528 __Pyx_CodeObjectCacheEntry* entries; | |
3529 }; | |
3530 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; | |
3531 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); | |
3532 static PyCodeObject *__pyx_find_code_object(int code_line); | |
3533 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); | |
3534 #endif | |
3535 | |
3536 /* AddTraceback.proto */ | |
3537 static void __Pyx_AddTraceback(const char *funcname, int c_line, | |
3538 int py_line, const char *filename); | |
3539 | |
3540 /* GCCDiagnostics.proto */ | |
3541 #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |
3542 #define __Pyx_HAS_GCC_DIAGNOSTIC | |
3543 #endif | |
3544 | |
3545 /* ArrayAPI.proto */ | |
3546 #ifndef _ARRAYARRAY_H | |
3547 #define _ARRAYARRAY_H | |
3548 typedef struct arraydescr { | |
3549 int typecode; | |
3550 int itemsize; | |
3551 PyObject * (*getitem)(struct arrayobject *, Py_ssize_t); | |
3552 int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *); | |
3553 #if PY_MAJOR_VERSION >= 3 | |
3554 char *formats; | |
3555 #endif | |
3556 } arraydescr; | |
3557 struct arrayobject { | |
3558 PyObject_HEAD | |
3559 Py_ssize_t ob_size; | |
3560 union { | |
3561 char *ob_item; | |
3562 float *as_floats; | |
3563 double *as_doubles; | |
3564 int *as_ints; | |
3565 unsigned int *as_uints; | |
3566 unsigned char *as_uchars; | |
3567 signed char *as_schars; | |
3568 char *as_chars; | |
3569 unsigned long *as_ulongs; | |
3570 long *as_longs; | |
3571 #if PY_MAJOR_VERSION >= 3 | |
3572 unsigned long long *as_ulonglongs; | |
3573 long long *as_longlongs; | |
3574 #endif | |
3575 short *as_shorts; | |
3576 unsigned short *as_ushorts; | |
3577 Py_UNICODE *as_pyunicodes; | |
3578 void *as_voidptr; | |
3579 } data; | |
3580 Py_ssize_t allocated; | |
3581 struct arraydescr *ob_descr; | |
3582 PyObject *weakreflist; | |
3583 #if PY_MAJOR_VERSION >= 3 | |
3584 int ob_exports; | |
3585 #endif | |
3586 }; | |
3587 #ifndef NO_NEWARRAY_INLINE | |
3588 static CYTHON_INLINE PyObject * newarrayobject(PyTypeObject *type, Py_ssize_t size, | |
3589 struct arraydescr *descr) { | |
3590 arrayobject *op; | |
3591 size_t nbytes; | |
3592 if (size < 0) { | |
3593 PyErr_BadInternalCall(); | |
3594 return NULL; | |
3595 } | |
3596 nbytes = size * descr->itemsize; | |
3597 if (nbytes / descr->itemsize != (size_t)size) { | |
3598 return PyErr_NoMemory(); | |
3599 } | |
3600 op = (arrayobject *) type->tp_alloc(type, 0); | |
3601 if (op == NULL) { | |
3602 return NULL; | |
3603 } | |
3604 op->ob_descr = descr; | |
3605 op->allocated = size; | |
3606 op->weakreflist = NULL; | |
3607 __Pyx_SET_SIZE(op, size); | |
3608 if (size <= 0) { | |
3609 op->data.ob_item = NULL; | |
3610 } | |
3611 else { | |
3612 op->data.ob_item = PyMem_NEW(char, nbytes); | |
3613 if (op->data.ob_item == NULL) { | |
3614 Py_DECREF(op); | |
3615 return PyErr_NoMemory(); | |
3616 } | |
3617 } | |
3618 return (PyObject *) op; | |
3619 } | |
3620 #else | |
3621 PyObject* newarrayobject(PyTypeObject *type, Py_ssize_t size, | |
3622 struct arraydescr *descr); | |
3623 #endif | |
3624 static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) { | |
3625 void *items = (void*) self->data.ob_item; | |
3626 PyMem_Resize(items, char, (size_t)(n * self->ob_descr->itemsize)); | |
3627 if (items == NULL) { | |
3628 PyErr_NoMemory(); | |
3629 return -1; | |
3630 } | |
3631 self->data.ob_item = (char*) items; | |
3632 __Pyx_SET_SIZE(self, n); | |
3633 self->allocated = n; | |
3634 return 0; | |
3635 } | |
3636 static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) { | |
3637 void *items = (void*) self->data.ob_item; | |
3638 Py_ssize_t newsize; | |
3639 if (n < self->allocated && n*4 > self->allocated) { | |
3640 __Pyx_SET_SIZE(self, n); | |
3641 return 0; | |
3642 } | |
3643 newsize = n + (n / 2) + 1; | |
3644 if (newsize <= n) { | |
3645 PyErr_NoMemory(); | |
3646 return -1; | |
3647 } | |
3648 PyMem_Resize(items, char, (size_t)(newsize * self->ob_descr->itemsize)); | |
3649 if (items == NULL) { | |
3650 PyErr_NoMemory(); | |
3651 return -1; | |
3652 } | |
3653 self->data.ob_item = (char*) items; | |
3654 __Pyx_SET_SIZE(self, n); | |
3655 self->allocated = newsize; | |
3656 return 0; | |
3657 } | |
3658 #endif | |
3659 | |
3660 /* CIntFromPy.proto */ | |
3661 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); | |
3662 | |
3663 /* CIntToPy.proto */ | |
3664 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); | |
3665 | |
3666 /* CIntFromPy.proto */ | |
3667 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); | |
3668 | |
3669 /* CIntFromPy.proto */ | |
3670 static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *); | |
3671 | |
3672 /* CIntToPy.proto */ | |
3673 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); | |
3674 | |
3675 /* CIntToPy.proto */ | |
3676 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); | |
3677 | |
3678 /* CIntFromPy.proto */ | |
3679 static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *); | |
3680 | |
3681 /* FormatTypeName.proto */ | |
3682 #if CYTHON_COMPILING_IN_LIMITED_API | |
3683 typedef PyObject *__Pyx_TypeName; | |
3684 #define __Pyx_FMT_TYPENAME "%U" | |
3685 static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); | |
3686 #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) | |
3687 #else | |
3688 typedef const char *__Pyx_TypeName; | |
3689 #define __Pyx_FMT_TYPENAME "%.200s" | |
3690 #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) | |
3691 #define __Pyx_DECREF_TypeName(obj) | |
3692 #endif | |
3693 | |
3694 /* FastTypeChecks.proto */ | |
3695 #if CYTHON_COMPILING_IN_CPYTHON | |
3696 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) | |
3697 #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) | |
3698 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); | |
3699 static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); | |
3700 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); | |
3701 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); | |
3702 #else | |
3703 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) | |
3704 #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) | |
3705 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) | |
3706 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) | |
3707 #endif | |
3708 #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) | |
3709 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) | |
3710 | |
3711 /* CheckBinaryVersion.proto */ | |
3712 static unsigned long __Pyx_get_runtime_version(void); | |
3713 static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); | |
3714 | |
3715 /* FunctionImport.proto */ | |
3716 static int __Pyx_ImportFunction_3_0_11(PyObject *module, const char *funcname, void (**f)(void), const char *sig); | |
3717 | |
3718 /* InitStrings.proto */ | |
3719 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); | |
3720 | |
3721 /* #### Code section: module_declarations ### */ | |
3722 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/ | |
3723 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/ | |
3724 static PyObject *__pyx_f_5pysam_9libctabix_6Parser_parse(struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_self, CYTHON_UNUSED char *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_length); /* proto*/ | |
3725 static PyObject *__pyx_f_5pysam_9libctabix_7asTuple_parse(struct __pyx_obj_5pysam_9libctabix_asTuple *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len); /* proto*/ | |
3726 static PyObject *__pyx_f_5pysam_9libctabix_6asGFF3_parse(struct __pyx_obj_5pysam_9libctabix_asGFF3 *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len); /* proto*/ | |
3727 static PyObject *__pyx_f_5pysam_9libctabix_5asGTF_parse(struct __pyx_obj_5pysam_9libctabix_asGTF *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len); /* proto*/ | |
3728 static PyObject *__pyx_f_5pysam_9libctabix_5asBed_parse(struct __pyx_obj_5pysam_9libctabix_asBed *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len); /* proto*/ | |
3729 static PyObject *__pyx_f_5pysam_9libctabix_5asVCF_parse(struct __pyx_obj_5pysam_9libctabix_asVCF *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len); /* proto*/ | |
3730 static int __pyx_f_5pysam_9libctabix_13TabixIterator___cnext__(struct __pyx_obj_5pysam_9libctabix_TabixIterator *__pyx_v_self); /* proto*/ | |
3731 static int __pyx_f_5pysam_9libctabix_10GZIterator___cnext__(struct __pyx_obj_5pysam_9libctabix_GZIterator *__pyx_v_self); /* proto*/ | |
3732 static PyObject *__pyx_f_5pysam_9libctabix_19tabix_file_iterator___cnext__(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *__pyx_v_self); /* proto*/ | |
3733 | |
3734 /* Module declarations from "libc.stdint" */ | |
3735 | |
3736 /* Module declarations from "libc.string" */ | |
3737 | |
3738 /* Module declarations from "libc.stdlib" */ | |
3739 | |
3740 /* Module declarations from "libc.stdio" */ | |
3741 | |
3742 /* Module declarations from "posix.types" */ | |
3743 | |
3744 /* Module declarations from "pysam.libchtslib" */ | |
3745 | |
3746 /* Module declarations from "libc.errno" */ | |
3747 | |
3748 /* Module declarations from "posix.unistd" */ | |
3749 | |
3750 /* Module declarations from "cpython.version" */ | |
3751 | |
3752 /* Module declarations from "__builtin__" */ | |
3753 | |
3754 /* Module declarations from "cpython.type" */ | |
3755 | |
3756 /* Module declarations from "cpython.object" */ | |
3757 | |
3758 /* Module declarations from "cpython.ref" */ | |
3759 | |
3760 /* Module declarations from "cpython.exc" */ | |
3761 | |
3762 /* Module declarations from "cpython.module" */ | |
3763 | |
3764 /* Module declarations from "cpython.mem" */ | |
3765 | |
3766 /* Module declarations from "cpython.tuple" */ | |
3767 | |
3768 /* Module declarations from "cpython.list" */ | |
3769 | |
3770 /* Module declarations from "cpython.sequence" */ | |
3771 | |
3772 /* Module declarations from "cpython.mapping" */ | |
3773 | |
3774 /* Module declarations from "cpython.iterator" */ | |
3775 | |
3776 /* Module declarations from "cpython.number" */ | |
3777 | |
3778 /* Module declarations from "cpython.int" */ | |
3779 | |
3780 /* Module declarations from "__builtin__" */ | |
3781 | |
3782 /* Module declarations from "cpython.bool" */ | |
3783 | |
3784 /* Module declarations from "cpython.long" */ | |
3785 | |
3786 /* Module declarations from "cpython.float" */ | |
3787 | |
3788 /* Module declarations from "__builtin__" */ | |
3789 | |
3790 /* Module declarations from "cpython.complex" */ | |
3791 | |
3792 /* Module declarations from "cpython.string" */ | |
3793 | |
3794 /* Module declarations from "libc.stddef" */ | |
3795 | |
3796 /* Module declarations from "cpython.unicode" */ | |
3797 | |
3798 /* Module declarations from "cpython.pyport" */ | |
3799 | |
3800 /* Module declarations from "cpython.dict" */ | |
3801 | |
3802 /* Module declarations from "cpython.instance" */ | |
3803 | |
3804 /* Module declarations from "cpython.function" */ | |
3805 | |
3806 /* Module declarations from "cpython.method" */ | |
3807 | |
3808 /* Module declarations from "cpython.weakref" */ | |
3809 | |
3810 /* Module declarations from "cpython.getargs" */ | |
3811 | |
3812 /* Module declarations from "cpython.pythread" */ | |
3813 | |
3814 /* Module declarations from "cpython.pystate" */ | |
3815 | |
3816 /* Module declarations from "cpython.cobject" */ | |
3817 | |
3818 /* Module declarations from "cpython.oldbuffer" */ | |
3819 | |
3820 /* Module declarations from "cpython.set" */ | |
3821 | |
3822 /* Module declarations from "cpython.buffer" */ | |
3823 | |
3824 /* Module declarations from "cpython.bytes" */ | |
3825 | |
3826 /* Module declarations from "cpython.pycapsule" */ | |
3827 | |
3828 /* Module declarations from "cpython.contextvars" */ | |
3829 | |
3830 /* Module declarations from "cpython" */ | |
3831 | |
3832 /* Module declarations from "pysam.libctabixproxies" */ | |
3833 | |
3834 /* Module declarations from "cython" */ | |
3835 | |
3836 /* Module declarations from "array" */ | |
3837 | |
3838 /* Module declarations from "cpython.array" */ | |
3839 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *, char *, Py_ssize_t); /*proto*/ | |
3840 | |
3841 /* Module declarations from "pysam.libcutils" */ | |
3842 static PyObject *(*__pyx_f_5pysam_9libcutils_charptr_to_str)(char const *, struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str *__pyx_optional_args); /*proto*/ | |
3843 static PyObject *(*__pyx_f_5pysam_9libcutils_force_str)(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_force_str *__pyx_optional_args); /*proto*/ | |
3844 static PyObject *(*__pyx_f_5pysam_9libcutils_force_bytes)(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_force_bytes *__pyx_optional_args); /*proto*/ | |
3845 static PyObject *(*__pyx_f_5pysam_9libcutils_encode_filename)(PyObject *); /*proto*/ | |
3846 static PyObject *(*__pyx_f_5pysam_9libcutils_from_string_and_size)(char const *, size_t); /*proto*/ | |
3847 | |
3848 /* Module declarations from "pysam.libctabix" */ | |
3849 static PyObject *__pyx_f_5pysam_9libctabix___pyx_unpickle_Parser__set_state(struct __pyx_obj_5pysam_9libctabix_Parser *, PyObject *); /*proto*/ | |
3850 static PyObject *__pyx_f_5pysam_9libctabix___pyx_unpickle_asTuple__set_state(struct __pyx_obj_5pysam_9libctabix_asTuple *, PyObject *); /*proto*/ | |
3851 static PyObject *__pyx_f_5pysam_9libctabix___pyx_unpickle_asGFF3__set_state(struct __pyx_obj_5pysam_9libctabix_asGFF3 *, PyObject *); /*proto*/ | |
3852 static PyObject *__pyx_f_5pysam_9libctabix___pyx_unpickle_asGTF__set_state(struct __pyx_obj_5pysam_9libctabix_asGTF *, PyObject *); /*proto*/ | |
3853 static PyObject *__pyx_f_5pysam_9libctabix___pyx_unpickle_asBed__set_state(struct __pyx_obj_5pysam_9libctabix_asBed *, PyObject *); /*proto*/ | |
3854 static PyObject *__pyx_f_5pysam_9libctabix___pyx_unpickle_asVCF__set_state(struct __pyx_obj_5pysam_9libctabix_asVCF *, PyObject *); /*proto*/ | |
3855 /* #### Code section: typeinfo ### */ | |
3856 /* #### Code section: before_global_var ### */ | |
3857 #define __Pyx_MODULE_NAME "pysam.libctabix" | |
3858 extern int __pyx_module_is_main_pysam__libctabix; | |
3859 int __pyx_module_is_main_pysam__libctabix = 0; | |
3860 | |
3861 /* Implementation of "pysam.libctabix" */ | |
3862 /* #### Code section: global_var ### */ | |
3863 static PyObject *__pyx_builtin_NotImplementedError; | |
3864 static PyObject *__pyx_builtin_ValueError; | |
3865 static PyObject *__pyx_builtin_IOError; | |
3866 static PyObject *__pyx_builtin_OSError; | |
3867 static PyObject *__pyx_builtin_TypeError; | |
3868 static PyObject *__pyx_builtin_StopIteration; | |
3869 static PyObject *__pyx_builtin_super; | |
3870 static PyObject *__pyx_builtin_KeyError; | |
3871 static PyObject *__pyx_builtin_AssertionError; | |
3872 static PyObject *__pyx_builtin_MemoryError; | |
3873 /* #### Code section: string_decls ### */ | |
3874 static const char __pyx_k_a[] = "a"; | |
3875 static const char __pyx_k_b[] = "b"; | |
3876 static const char __pyx_k_c[] = "c"; | |
3877 static const char __pyx_k_r[] = "r"; | |
3878 static const char __pyx_k_s[] = "%s"; | |
3879 static const char __pyx_k_fn[] = "fn"; | |
3880 static const char __pyx_k_fp[] = "fp"; | |
3881 static const char __pyx_k_gc[] = "gc"; | |
3882 static const char __pyx_k_gz[] = ".gz"; | |
3883 static const char __pyx_k_os[] = "os"; | |
3884 static const char __pyx_k__16[] = "-"; | |
3885 static const char __pyx_k__39[] = "#"; | |
3886 static const char __pyx_k__42[] = "': "; | |
3887 static const char __pyx_k__43[] = ","; | |
3888 static const char __pyx_k__44[] = "'"; | |
3889 static const char __pyx_k__56[] = "."; | |
3890 static const char __pyx_k__62[] = "*"; | |
3891 static const char __pyx_k__78[] = "?"; | |
3892 static const char __pyx_k_all[] = "__all__"; | |
3893 static const char __pyx_k_bcf[] = "bcf"; | |
3894 static const char __pyx_k_bed[] = "bed"; | |
3895 static const char __pyx_k_cfn[] = "cfn"; | |
3896 static const char __pyx_k_cpy[] = "cpy"; | |
3897 static const char __pyx_k_csi[] = "csi"; | |
3898 static const char __pyx_k_doc[] = "__doc__"; | |
3899 static const char __pyx_k_dup[] = "_dup"; | |
3900 static const char __pyx_k_end[] = "end"; | |
3901 static const char __pyx_k_fmt[] = "fmt"; | |
3902 static const char __pyx_k_gff[] = "gff"; | |
3903 static const char __pyx_k_itr[] = "itr"; | |
3904 static const char __pyx_k_new[] = "__new__"; | |
3905 static const char __pyx_k_s_2[] = "s"; | |
3906 static const char __pyx_k_s_i[] = "%s:%i"; | |
3907 static const char __pyx_k_sam[] = "sam"; | |
3908 static const char __pyx_k_sys[] = "sys"; | |
3909 static const char __pyx_k_tbi[] = ".tbi"; | |
3910 static const char __pyx_k_vcf[] = "vcf"; | |
3911 static const char __pyx_k_conf[] = "conf"; | |
3912 static const char __pyx_k_cstr[] = "cstr"; | |
3913 static const char __pyx_k_dict[] = "__dict__"; | |
3914 static const char __pyx_k_init[] = "__init__"; | |
3915 static const char __pyx_k_iter[] = "__iter__"; | |
3916 static const char __pyx_k_keys[] = "keys"; | |
3917 static const char __pyx_k_line[] = "line"; | |
3918 static const char __pyx_k_main[] = "__main__"; | |
3919 static const char __pyx_k_mode[] = "mode"; | |
3920 static const char __pyx_k_name[] = "__name__"; | |
3921 static const char __pyx_k_next[] = "__next__"; | |
3922 static const char __pyx_k_open[] = "_open"; | |
3923 static const char __pyx_k_path[] = "path"; | |
3924 static const char __pyx_k_self[] = "self"; | |
3925 static const char __pyx_k_spec[] = "__spec__"; | |
3926 static const char __pyx_k_tell[] = "tell"; | |
3927 static const char __pyx_k_test[] = "__test__"; | |
3928 static const char __pyx_k_asBed[] = "asBed"; | |
3929 static const char __pyx_k_asGTF[] = "asGTF"; | |
3930 static const char __pyx_k_asVCF[] = "asVCF"; | |
3931 static const char __pyx_k_ascii[] = "ascii"; | |
3932 static const char __pyx_k_close[] = "close"; | |
3933 static const char __pyx_k_csi_2[] = ".csi"; | |
3934 static const char __pyx_k_fetch[] = "fetch"; | |
3935 static const char __pyx_k_fnidx[] = "fnidx"; | |
3936 static const char __pyx_k_force[] = "force"; | |
3937 static const char __pyx_k_index[] = "index"; | |
3938 static const char __pyx_k_s_i_i[] = "%s:%i-%i"; | |
3939 static const char __pyx_k_start[] = "start"; | |
3940 static const char __pyx_k_state[] = "state"; | |
3941 static const char __pyx_k_super[] = "super"; | |
3942 static const char __pyx_k_Parser[] = "Parser"; | |
3943 static const char __pyx_k_asGFF3[] = "asGFF3"; | |
3944 static const char __pyx_k_buffer[] = "buffer"; | |
3945 static const char __pyx_k_closed[] = "closed"; | |
3946 static const char __pyx_k_dict_2[] = "_dict"; | |
3947 static const char __pyx_k_enable[] = "enable"; | |
3948 static const char __pyx_k_exists[] = "exists"; | |
3949 static const char __pyx_k_fd_src[] = "fd_src"; | |
3950 static const char __pyx_k_format[] = "format"; | |
3951 static const char __pyx_k_import[] = "__import__"; | |
3952 static const char __pyx_k_infile[] = "infile"; | |
3953 static const char __pyx_k_length[] = "length"; | |
3954 static const char __pyx_k_module[] = "__module__"; | |
3955 static const char __pyx_k_nbytes[] = "nbytes"; | |
3956 static const char __pyx_k_parser[] = "parser"; | |
3957 static const char __pyx_k_pickle[] = "pickle"; | |
3958 static const char __pyx_k_preset[] = "preset"; | |
3959 static const char __pyx_k_psltbl[] = "psltbl"; | |
3960 static const char __pyx_k_reduce[] = "__reduce__"; | |
3961 static const char __pyx_k_region[] = "region"; | |
3962 static const char __pyx_k_retval[] = "retval"; | |
3963 static const char __pyx_k_suffix[] = "suffix"; | |
3964 static const char __pyx_k_unlink[] = "unlink"; | |
3965 static const char __pyx_k_update[] = "update"; | |
3966 static const char __pyx_k_IOError[] = "IOError"; | |
3967 static const char __pyx_k_OSError[] = "OSError"; | |
3968 static const char __pyx_k_asTuple[] = "asTuple"; | |
3969 static const char __pyx_k_contigs[] = "contigs"; | |
3970 static const char __pyx_k_disable[] = "disable"; | |
3971 static const char __pyx_k_end_col[] = "end_col"; | |
3972 static const char __pyx_k_fileobj[] = "fileobj"; | |
3973 static const char __pyx_k_is_open[] = "is_open"; | |
3974 static const char __pyx_k_prepare[] = "__prepare__"; | |
3975 static const char __pyx_k_seq_col[] = "seq_col"; | |
3976 static const char __pyx_k_threads[] = "threads"; | |
3977 static const char __pyx_k_KeyError[] = "KeyError"; | |
3978 static const char __pyx_k_O_RDONLY[] = "O_RDONLY"; | |
3979 static const char __pyx_k_encoding[] = "encoding"; | |
3980 static const char __pyx_k_filename[] = "filename"; | |
3981 static const char __pyx_k_fn_index[] = "fn_index"; | |
3982 static const char __pyx_k_getstate[] = "__getstate__"; | |
3983 static const char __pyx_k_is_empty[] = "is_empty"; | |
3984 static const char __pyx_k_pyx_type[] = "__pyx_type"; | |
3985 static const char __pyx_k_qualname[] = "__qualname__"; | |
3986 static const char __pyx_k_readline[] = "readline"; | |
3987 static const char __pyx_k_set_name[] = "__set_name__"; | |
3988 static const char __pyx_k_setstate[] = "__setstate__"; | |
3989 static const char __pyx_k_TabixFile[] = "TabixFile"; | |
3990 static const char __pyx_k_Tabixfile[] = "Tabixfile"; | |
3991 static const char __pyx_k_TypeError[] = "TypeError"; | |
3992 static const char __pyx_k_bytes_cpy[] = "bytes_cpy"; | |
3993 static const char __pyx_k_cfilename[] = "cfilename"; | |
3994 static const char __pyx_k_conf_data[] = "conf_data"; | |
3995 static const char __pyx_k_isenabled[] = "isenabled"; | |
3996 static const char __pyx_k_line_skip[] = "line_skip"; | |
3997 static const char __pyx_k_meta_char[] = "meta_char"; | |
3998 static const char __pyx_k_metaclass[] = "__metaclass__"; | |
3999 static const char __pyx_k_min_shift[] = "min_shift"; | |
4000 static const char __pyx_k_pyx_state[] = "__pyx_state"; | |
4001 static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; | |
4002 static const char __pyx_k_reference[] = "reference"; | |
4003 static const char __pyx_k_start_col[] = "start_col"; | |
4004 static const char __pyx_k_zerobased[] = "zerobased"; | |
4005 static const char __pyx_k_GZIterator[] = "GZIterator"; | |
4006 static const char __pyx_k_ValueError[] = "ValueError"; | |
4007 static const char __pyx_k_pyx_result[] = "__pyx_result"; | |
4008 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; | |
4009 static const char __pyx_k_MemoryError[] = "MemoryError"; | |
4010 static const char __pyx_k_PickleError[] = "PickleError"; | |
4011 static const char __pyx_k_WINDOW_SIZE[] = "WINDOW_SIZE"; | |
4012 static const char __pyx_k_buffer_size[] = "buffer_size"; | |
4013 static const char __pyx_k_filename_in[] = "filename_in"; | |
4014 static const char __pyx_k_preset2conf[] = "preset2conf"; | |
4015 static const char __pyx_k_tabix_index[] = "tabix_index"; | |
4016 static const char __pyx_k_filename_out[] = "filename_out"; | |
4017 static const char __pyx_k_get_encoding[] = "get_encoding"; | |
4018 static const char __pyx_k_initializing[] = "_initializing"; | |
4019 static const char __pyx_k_is_coroutine[] = "_is_coroutine"; | |
4020 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; | |
4021 static const char __pyx_k_set_encoding[] = "set_encoding"; | |
4022 static const char __pyx_k_stringsource[] = "<stringsource>"; | |
4023 static const char __pyx_k_use_setstate[] = "use_setstate"; | |
4024 static const char __pyx_k_EmptyIterator[] = "EmptyIterator"; | |
4025 static const char __pyx_k_StopIteration[] = "StopIteration"; | |
4026 static const char __pyx_k_TabixIterator[] = "TabixIterator"; | |
4027 static const char __pyx_k_init_subclass[] = "__init_subclass__"; | |
4028 static const char __pyx_k_keep_original[] = "keep_original"; | |
4029 static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; | |
4030 static const char __pyx_k_start_i_end_i[] = "start (%i) >= end (%i)"; | |
4031 static const char __pyx_k_AssertionError[] = "AssertionError"; | |
4032 static const char __pyx_k_GZIteratorHead[] = "GZIteratorHead"; | |
4033 static const char __pyx_k_TabixFile__dup[] = "TabixFile._dup"; | |
4034 static const char __pyx_k_empty_iterator[] = "empty iterator"; | |
4035 static const char __pyx_k_filename_index[] = "filename_index"; | |
4036 static const char __pyx_k_tabix_compress[] = "tabix_compress"; | |
4037 static const char __pyx_k_tabix_iterator[] = "tabix_iterator"; | |
4038 static const char __pyx_k_unknown_preset[] = "unknown preset '"; | |
4039 static const char __pyx_k_writing_failed[] = "writing failed"; | |
4040 static const char __pyx_k_TabixFile__open[] = "TabixFile._open"; | |
4041 static const char __pyx_k_TabixFile_close[] = "TabixFile.close"; | |
4042 static const char __pyx_k_TabixFile_fetch[] = "TabixFile.fetch"; | |
4043 static const char __pyx_k_cfilename_index[] = "cfilename_index"; | |
4044 static const char __pyx_k_pysam_libctabix[] = "pysam.libctabix"; | |
4045 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; | |
4046 static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; | |
4047 static const char __pyx_k_GZIteratorParsed[] = "GZIteratorParsed"; | |
4048 static const char __pyx_k_file_s_not_found[] = "file `%s` not found"; | |
4049 static const char __pyx_k_index_s_not_found[] = "index `%s` not found"; | |
4050 static const char __pyx_k_valid_presets_are[] = "', valid presets are '"; | |
4051 static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; | |
4052 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; | |
4053 static const char __pyx_k_end_out_of_range_i[] = "end out of range (%i)"; | |
4054 static const char __pyx_k_multiple_iterators[] = "multiple_iterators"; | |
4055 static const char __pyx_k_pyx_unpickle_asBed[] = "__pyx_unpickle_asBed"; | |
4056 static const char __pyx_k_pyx_unpickle_asGTF[] = "__pyx_unpickle_asGTF"; | |
4057 static const char __pyx_k_pyx_unpickle_asVCF[] = "__pyx_unpickle_asVCF"; | |
4058 static const char __pyx_k_Could_not_open_file[] = "Could not open file '"; | |
4059 static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; | |
4060 static const char __pyx_k_Parser_get_encoding[] = "Parser.get_encoding"; | |
4061 static const char __pyx_k_Parser_set_encoding[] = "Parser.set_encoding"; | |
4062 static const char __pyx_k_TabixIteratorParsed[] = "TabixIteratorParsed"; | |
4063 static const char __pyx_k_pysam_libctabix_pyx[] = "pysam/libctabix.pyx"; | |
4064 static const char __pyx_k_pyx_unpickle_Parser[] = "__pyx_unpickle_Parser"; | |
4065 static const char __pyx_k_pyx_unpickle_asGFF3[] = "__pyx_unpickle_asGFF3"; | |
4066 static const char __pyx_k_tabix_file_iterator[] = "tabix_file_iterator"; | |
4067 static const char __pyx_k_EmptyIterator___iter[] = "EmptyIterator.__iter__"; | |
4068 static const char __pyx_k_EmptyIterator___next[] = "EmptyIterator.__next__"; | |
4069 static const char __pyx_k_incomplete_line_at_s[] = "incomplete line at %s"; | |
4070 static const char __pyx_k_pyx_unpickle_asTuple[] = "__pyx_unpickle_asTuple"; | |
4071 static const char __pyx_k_start_out_of_range_i[] = "start out of range (%i)"; | |
4072 static const char __pyx_k_asBed___reduce_cython[] = "asBed.__reduce_cython__"; | |
4073 static const char __pyx_k_asGTF___reduce_cython[] = "asGTF.__reduce_cython__"; | |
4074 static const char __pyx_k_asVCF___reduce_cython[] = "asVCF.__reduce_cython__"; | |
4075 static const char __pyx_k_could_not_open_file_s[] = "could not open file `%s`"; | |
4076 static const char __pyx_k_Parser___reduce_cython[] = "Parser.__reduce_cython__"; | |
4077 static const char __pyx_k_asGFF3___reduce_cython[] = "asGFF3.__reduce_cython__"; | |
4078 static const char __pyx_k_tabix_generic_iterator[] = "tabix_generic_iterator"; | |
4079 static const char __pyx_k_asBed___setstate_cython[] = "asBed.__setstate_cython__"; | |
4080 static const char __pyx_k_asGTF___setstate_cython[] = "asGTF.__setstate_cython__"; | |
4081 static const char __pyx_k_asTuple___reduce_cython[] = "asTuple.__reduce_cython__"; | |
4082 static const char __pyx_k_asVCF___setstate_cython[] = "asVCF.__setstate_cython__"; | |
4083 static const char __pyx_k_Parser___setstate_cython[] = "Parser.__setstate_cython__"; | |
4084 static const char __pyx_k_asGFF3___setstate_cython[] = "asGFF3.__setstate_cython__"; | |
4085 static const char __pyx_k_iteration_on_closed_file[] = "iteration on closed file"; | |
4086 static const char __pyx_k_TabixFile___reduce_cython[] = "TabixFile.__reduce_cython__"; | |
4087 static const char __pyx_k_Tabixfile___reduce_cython[] = "Tabixfile.__reduce_cython__"; | |
4088 static const char __pyx_k_asTuple___setstate_cython[] = "asTuple.__setstate_cython__"; | |
4089 static const char __pyx_k_GZIterator___reduce_cython[] = "GZIterator.__reduce_cython__"; | |
4090 static const char __pyx_k_could_not_open_index_for_s[] = "could not open index for `%s`"; | |
4091 static const char __pyx_k_No_such_file_or_directory_s[] = "No such file or directory: %s"; | |
4092 static const char __pyx_k_TabixFile___setstate_cython[] = "TabixFile.__setstate_cython__"; | |
4093 static const char __pyx_k_Tabixfile___setstate_cython[] = "Tabixfile.__setstate_cython__"; | |
4094 static const char __pyx_k_error_i_when_closing_file_s[] = "error %i when closing file %s"; | |
4095 static const char __pyx_k_invalid_file_opening_mode_s[] = "invalid file opening mode `%s`"; | |
4096 static const char __pyx_k_GZIterator___setstate_cython[] = "GZIterator.__setstate_cython__"; | |
4097 static const char __pyx_k_I_O_operation_on_closed_file[] = "I/O operation on closed file"; | |
4098 static const char __pyx_k_building_of_index_for_failed[] = "building of index for {} failed"; | |
4099 static const char __pyx_k_could_not_open_s_for_reading[] = "could not open '%s' for reading"; | |
4100 static const char __pyx_k_could_not_open_s_for_writing[] = "could not open '%s' for writing"; | |
4101 static const char __pyx_k_TabixIterator___reduce_cython[] = "TabixIterator.__reduce_cython__"; | |
4102 static const char __pyx_k_tabix_generic_iterator___init[] = "tabix_generic_iterator.__init__"; | |
4103 static const char __pyx_k_tabix_generic_iterator___iter[] = "tabix_generic_iterator.__iter__"; | |
4104 static const char __pyx_k_tabix_generic_iterator___next[] = "tabix_generic_iterator.__next__"; | |
4105 static const char __pyx_k_GZIteratorHead___reduce_cython[] = "GZIteratorHead.__reduce_cython__"; | |
4106 static const char __pyx_k_I_O_operation_on_closed_file_2[] = "I/O operation on closed file."; | |
4107 static const char __pyx_k_error_i_when_writing_to_file_s[] = "error %i when writing to file %s"; | |
4108 static const char __pyx_k_TabixIterator___setstate_cython[] = "TabixIterator.__setstate_cython__"; | |
4109 static const char __pyx_k_could_not_load_tbi_csi_index_of[] = "could not load .tbi/.csi index of {}"; | |
4110 static const char __pyx_k_iterate_over_infile_Permits_the[] = "iterate over ``infile``.\n \n Permits the use of file-like objects for example from the gzip module.\n "; | |
4111 static const char __pyx_k_Filename_s_already_exists_use_fo[] = "Filename '%s' already exists, use *force* to overwrite"; | |
4112 static const char __pyx_k_GZIteratorHead___setstate_cython[] = "GZIteratorHead.__setstate_cython__"; | |
4113 static const char __pyx_k_GZIteratorParsed___reduce_cython[] = "GZIteratorParsed.__reduce_cython__"; | |
4114 static const char __pyx_k_GZIteratorParsed___setstate_cyth[] = "GZIteratorParsed.__setstate_cython__"; | |
4115 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))"; | |
4116 static const char __pyx_k_TabixIteratorParsed___reduce_cyt[] = "TabixIteratorParsed.__reduce_cython__"; | |
4117 static const char __pyx_k_TabixIteratorParsed___setstate_c[] = "TabixIteratorParsed.__setstate_cython__"; | |
4118 static const char __pyx_k_could_not_create_iterator_for_re[] = "could not create iterator for region '%s'"; | |
4119 static const char __pyx_k_could_not_create_iterator_possib[] = "could not create iterator, possible tabix version mismatch"; | |
4120 static const char __pyx_k_could_not_open_for_reading_heade[] = "could not open {} for reading header"; | |
4121 static const char __pyx_k_filename_s_already_exists_use_fo[] = "filename '%s' already exists, use *force* to overwrite"; | |
4122 static const char __pyx_k_neither_preset_nor_seq_col_start[] = "neither preset nor seq_col,start_col and end_col given"; | |
4123 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; | |
4124 static const char __pyx_k_parse_method_of_s_not_implemente[] = "parse method of %s not implemented"; | |
4125 static const char __pyx_k_self_gzipfile_self_kstream_canno[] = "self.gzipfile,self.kstream cannot be converted to a Python object for pickling"; | |
4126 static const char __pyx_k_self_iterator_cannot_be_converte[] = "self.iterator cannot be converted to a Python object for pickling"; | |
4127 static const char __pyx_k_tabix_file_iterator___reduce_cyt[] = "tabix_file_iterator.__reduce_cython__"; | |
4128 static const char __pyx_k_tabix_file_iterator___setstate_c[] = "tabix_file_iterator.__setstate_cython__"; | |
4129 /* #### Code section: decls ### */ | |
4130 static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */ | |
4131 static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ | |
4132 static int __pyx_pf_5pysam_9libctabix_6Parser___init__(struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_self, PyObject *__pyx_v_encoding); /* proto */ | |
4133 static PyObject *__pyx_pf_5pysam_9libctabix_6Parser_2set_encoding(struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_self, PyObject *__pyx_v_encoding); /* proto */ | |
4134 static PyObject *__pyx_pf_5pysam_9libctabix_6Parser_4get_encoding(struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_self); /* proto */ | |
4135 static PyObject *__pyx_pf_5pysam_9libctabix_6Parser_6__call__(struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_length); /* proto */ | |
4136 static PyObject *__pyx_pf_5pysam_9libctabix_6Parser_8__reduce_cython__(struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_self); /* proto */ | |
4137 static PyObject *__pyx_pf_5pysam_9libctabix_6Parser_10__setstate_cython__(struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ | |
4138 static PyObject *__pyx_pf_5pysam_9libctabix_7asTuple___reduce_cython__(struct __pyx_obj_5pysam_9libctabix_asTuple *__pyx_v_self); /* proto */ | |
4139 static PyObject *__pyx_pf_5pysam_9libctabix_7asTuple_2__setstate_cython__(struct __pyx_obj_5pysam_9libctabix_asTuple *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ | |
4140 static PyObject *__pyx_pf_5pysam_9libctabix_6asGFF3___reduce_cython__(struct __pyx_obj_5pysam_9libctabix_asGFF3 *__pyx_v_self); /* proto */ | |
4141 static PyObject *__pyx_pf_5pysam_9libctabix_6asGFF3_2__setstate_cython__(struct __pyx_obj_5pysam_9libctabix_asGFF3 *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ | |
4142 static PyObject *__pyx_pf_5pysam_9libctabix_5asGTF___reduce_cython__(struct __pyx_obj_5pysam_9libctabix_asGTF *__pyx_v_self); /* proto */ | |
4143 static PyObject *__pyx_pf_5pysam_9libctabix_5asGTF_2__setstate_cython__(struct __pyx_obj_5pysam_9libctabix_asGTF *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ | |
4144 static PyObject *__pyx_pf_5pysam_9libctabix_5asBed___reduce_cython__(struct __pyx_obj_5pysam_9libctabix_asBed *__pyx_v_self); /* proto */ | |
4145 static PyObject *__pyx_pf_5pysam_9libctabix_5asBed_2__setstate_cython__(struct __pyx_obj_5pysam_9libctabix_asBed *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ | |
4146 static PyObject *__pyx_pf_5pysam_9libctabix_5asVCF___reduce_cython__(struct __pyx_obj_5pysam_9libctabix_asVCF *__pyx_v_self); /* proto */ | |
4147 static PyObject *__pyx_pf_5pysam_9libctabix_5asVCF_2__setstate_cython__(struct __pyx_obj_5pysam_9libctabix_asVCF *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ | |
4148 static int __pyx_pf_5pysam_9libctabix_9TabixFile___cinit__(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode, PyObject *__pyx_v_parser, PyObject *__pyx_v_index, PyObject *__pyx_v_encoding, PyObject *__pyx_v_threads, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ | |
4149 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_2_open(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode, PyObject *__pyx_v_index, PyObject *__pyx_v_threads); /* proto */ | |
4150 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_4_dup(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self); /* proto */ | |
4151 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_6fetch(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region, PyObject *__pyx_v_parser, PyObject *__pyx_v_multiple_iterators); /* proto */ | |
4152 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_6header___get__(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self); /* proto */ | |
4153 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_7contigs___get__(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self); /* proto */ | |
4154 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_8close(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self); /* proto */ | |
4155 static void __pyx_pf_5pysam_9libctabix_9TabixFile_10__dealloc__(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self); /* proto */ | |
4156 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_14filename_index___get__(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self); /* proto */ | |
4157 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self); /* proto */ | |
4158 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
4159 static int __pyx_pf_5pysam_9libctabix_13TabixIterator___init__(struct __pyx_obj_5pysam_9libctabix_TabixIterator *__pyx_v_self, PyObject *__pyx_v_encoding); /* proto */ | |
4160 static PyObject *__pyx_pf_5pysam_9libctabix_13TabixIterator_2__iter__(struct __pyx_obj_5pysam_9libctabix_TabixIterator *__pyx_v_self); /* proto */ | |
4161 static PyObject *__pyx_pf_5pysam_9libctabix_13TabixIterator_4__next__(struct __pyx_obj_5pysam_9libctabix_TabixIterator *__pyx_v_self); /* proto */ | |
4162 static void __pyx_pf_5pysam_9libctabix_13TabixIterator_6__dealloc__(struct __pyx_obj_5pysam_9libctabix_TabixIterator *__pyx_v_self); /* proto */ | |
4163 static PyObject *__pyx_pf_5pysam_9libctabix_13TabixIterator_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_TabixIterator *__pyx_v_self); /* proto */ | |
4164 static PyObject *__pyx_pf_5pysam_9libctabix_13TabixIterator_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_TabixIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
4165 static PyObject *__pyx_pf_5pysam_9libctabix_13EmptyIterator___iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ | |
4166 static PyObject *__pyx_pf_5pysam_9libctabix_13EmptyIterator_2__next__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ | |
4167 static int __pyx_pf_5pysam_9libctabix_19TabixIteratorParsed___init__(struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *__pyx_v_self, struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_parser); /* proto */ | |
4168 static PyObject *__pyx_pf_5pysam_9libctabix_19TabixIteratorParsed_2__next__(struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *__pyx_v_self); /* proto */ | |
4169 static PyObject *__pyx_pf_5pysam_9libctabix_19TabixIteratorParsed_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *__pyx_v_self); /* proto */ | |
4170 static PyObject *__pyx_pf_5pysam_9libctabix_19TabixIteratorParsed_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
4171 static int __pyx_pf_5pysam_9libctabix_10GZIterator___init__(struct __pyx_obj_5pysam_9libctabix_GZIterator *__pyx_v_self, PyObject *__pyx_v_filename, int __pyx_v_buffer_size, PyObject *__pyx_v_encoding); /* proto */ | |
4172 static void __pyx_pf_5pysam_9libctabix_10GZIterator_2__dealloc__(struct __pyx_obj_5pysam_9libctabix_GZIterator *__pyx_v_self); /* proto */ | |
4173 static PyObject *__pyx_pf_5pysam_9libctabix_10GZIterator_4__iter__(struct __pyx_obj_5pysam_9libctabix_GZIterator *__pyx_v_self); /* proto */ | |
4174 static PyObject *__pyx_pf_5pysam_9libctabix_10GZIterator_6__next__(struct __pyx_obj_5pysam_9libctabix_GZIterator *__pyx_v_self); /* proto */ | |
4175 static PyObject *__pyx_pf_5pysam_9libctabix_10GZIterator_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_GZIterator *__pyx_v_self); /* proto */ | |
4176 static PyObject *__pyx_pf_5pysam_9libctabix_10GZIterator_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_GZIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
4177 static PyObject *__pyx_pf_5pysam_9libctabix_14GZIteratorHead___next__(struct __pyx_obj_5pysam_9libctabix_GZIteratorHead *__pyx_v_self); /* proto */ | |
4178 static PyObject *__pyx_pf_5pysam_9libctabix_14GZIteratorHead_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_GZIteratorHead *__pyx_v_self); /* proto */ | |
4179 static PyObject *__pyx_pf_5pysam_9libctabix_14GZIteratorHead_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_GZIteratorHead *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
4180 static int __pyx_pf_5pysam_9libctabix_16GZIteratorParsed___init__(struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *__pyx_v_self, PyObject *__pyx_v_parser); /* proto */ | |
4181 static PyObject *__pyx_pf_5pysam_9libctabix_16GZIteratorParsed_2__next__(struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *__pyx_v_self); /* proto */ | |
4182 static PyObject *__pyx_pf_5pysam_9libctabix_16GZIteratorParsed_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *__pyx_v_self); /* proto */ | |
4183 static PyObject *__pyx_pf_5pysam_9libctabix_16GZIteratorParsed_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
4184 static PyObject *__pyx_pf_5pysam_9libctabix_tabix_compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename_in, PyObject *__pyx_v_filename_out, PyObject *__pyx_v_force); /* proto */ | |
4185 static PyObject *__pyx_pf_5pysam_9libctabix_2tabix_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_force, PyObject *__pyx_v_seq_col, PyObject *__pyx_v_start_col, PyObject *__pyx_v_end_col, PyObject *__pyx_v_preset, PyObject *__pyx_v_meta_char, int __pyx_v_line_skip, PyObject *__pyx_v_zerobased, int __pyx_v_min_shift, PyObject *__pyx_v_index, PyObject *__pyx_v_keep_original, PyObject *__pyx_v_csi); /* proto */ | |
4186 static int __pyx_pf_5pysam_9libctabix_19tabix_file_iterator___cinit__(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *__pyx_v_self, PyObject *__pyx_v_infile, struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_parser, int __pyx_v_buffer_size); /* proto */ | |
4187 static PyObject *__pyx_pf_5pysam_9libctabix_19tabix_file_iterator_2__iter__(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *__pyx_v_self); /* proto */ | |
4188 static void __pyx_pf_5pysam_9libctabix_19tabix_file_iterator_4__dealloc__(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *__pyx_v_self); /* proto */ | |
4189 static PyObject *__pyx_pf_5pysam_9libctabix_19tabix_file_iterator_6__next__(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *__pyx_v_self); /* proto */ | |
4190 static PyObject *__pyx_pf_5pysam_9libctabix_19tabix_file_iterator_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *__pyx_v_self); /* proto */ | |
4191 static PyObject *__pyx_pf_5pysam_9libctabix_19tabix_file_iterator_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
4192 static PyObject *__pyx_pf_5pysam_9libctabix_22tabix_generic_iterator___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_infile, PyObject *__pyx_v_parser); /* proto */ | |
4193 static PyObject *__pyx_pf_5pysam_9libctabix_22tabix_generic_iterator_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ | |
4194 static PyObject *__pyx_pf_5pysam_9libctabix_22tabix_generic_iterator_4__next__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ | |
4195 static PyObject *__pyx_pf_5pysam_9libctabix_4tabix_iterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_infile, PyObject *__pyx_v_parser); /* proto */ | |
4196 static PyObject *__pyx_pf_5pysam_9libctabix_9Tabixfile___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_Tabixfile *__pyx_v_self); /* proto */ | |
4197 static PyObject *__pyx_pf_5pysam_9libctabix_9Tabixfile_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_Tabixfile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
4198 static PyObject *__pyx_pf_5pysam_9libctabix_6__pyx_unpickle_Parser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ | |
4199 static PyObject *__pyx_pf_5pysam_9libctabix_8__pyx_unpickle_asTuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ | |
4200 static PyObject *__pyx_pf_5pysam_9libctabix_10__pyx_unpickle_asGFF3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ | |
4201 static PyObject *__pyx_pf_5pysam_9libctabix_12__pyx_unpickle_asGTF(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ | |
4202 static PyObject *__pyx_pf_5pysam_9libctabix_14__pyx_unpickle_asBed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ | |
4203 static PyObject *__pyx_pf_5pysam_9libctabix_16__pyx_unpickle_asVCF(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ | |
4204 static PyObject *__pyx_tp_new_5pysam_9libctabix_tabix_file_iterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4205 static PyObject *__pyx_tp_new_5pysam_9libctabix_TabixFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4206 static PyObject *__pyx_tp_new_5pysam_9libctabix_Parser(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4207 static PyObject *__pyx_tp_new_5pysam_9libctabix_asTuple(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4208 static PyObject *__pyx_tp_new_5pysam_9libctabix_asGTF(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4209 static PyObject *__pyx_tp_new_5pysam_9libctabix_asGFF3(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4210 static PyObject *__pyx_tp_new_5pysam_9libctabix_asBed(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4211 static PyObject *__pyx_tp_new_5pysam_9libctabix_asVCF(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4212 static PyObject *__pyx_tp_new_5pysam_9libctabix_TabixIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4213 static PyObject *__pyx_tp_new_5pysam_9libctabix_TabixIteratorParsed(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4214 static PyObject *__pyx_tp_new_5pysam_9libctabix_GZIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4215 static PyObject *__pyx_tp_new_5pysam_9libctabix_GZIteratorHead(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4216 static PyObject *__pyx_tp_new_5pysam_9libctabix_GZIteratorParsed(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4217 static PyObject *__pyx_tp_new_5pysam_9libctabix_Tabixfile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
4218 static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys = {0, 0, 0, 0, 0}; | |
4219 /* #### Code section: late_includes ### */ | |
4220 /* #### Code section: module_state ### */ | |
4221 typedef struct { | |
4222 PyObject *__pyx_d; | |
4223 PyObject *__pyx_b; | |
4224 PyObject *__pyx_cython_runtime; | |
4225 PyObject *__pyx_empty_tuple; | |
4226 PyObject *__pyx_empty_bytes; | |
4227 PyObject *__pyx_empty_unicode; | |
4228 #ifdef __Pyx_CyFunction_USED | |
4229 PyTypeObject *__pyx_CyFunctionType; | |
4230 #endif | |
4231 #ifdef __Pyx_FusedFunction_USED | |
4232 PyTypeObject *__pyx_FusedFunctionType; | |
4233 #endif | |
4234 #ifdef __Pyx_Generator_USED | |
4235 PyTypeObject *__pyx_GeneratorType; | |
4236 #endif | |
4237 #ifdef __Pyx_IterableCoroutine_USED | |
4238 PyTypeObject *__pyx_IterableCoroutineType; | |
4239 #endif | |
4240 #ifdef __Pyx_Coroutine_USED | |
4241 PyTypeObject *__pyx_CoroutineAwaitType; | |
4242 #endif | |
4243 #ifdef __Pyx_Coroutine_USED | |
4244 PyTypeObject *__pyx_CoroutineType; | |
4245 #endif | |
4246 #if CYTHON_USE_MODULE_STATE | |
4247 #endif | |
4248 #if CYTHON_USE_MODULE_STATE | |
4249 #endif | |
4250 #if CYTHON_USE_MODULE_STATE | |
4251 #endif | |
4252 #if CYTHON_USE_MODULE_STATE | |
4253 #endif | |
4254 #if CYTHON_USE_MODULE_STATE | |
4255 #endif | |
4256 #if CYTHON_USE_MODULE_STATE | |
4257 #endif | |
4258 PyTypeObject *__pyx_ptype_5pysam_10libchtslib_HTSFile; | |
4259 #if CYTHON_USE_MODULE_STATE | |
4260 #endif | |
4261 #if CYTHON_USE_MODULE_STATE | |
4262 #endif | |
4263 #if CYTHON_USE_MODULE_STATE | |
4264 #endif | |
4265 #if CYTHON_USE_MODULE_STATE | |
4266 #endif | |
4267 #if CYTHON_USE_MODULE_STATE | |
4268 #endif | |
4269 PyTypeObject *__pyx_ptype_7cpython_4type_type; | |
4270 #if CYTHON_USE_MODULE_STATE | |
4271 #endif | |
4272 #if CYTHON_USE_MODULE_STATE | |
4273 #endif | |
4274 #if CYTHON_USE_MODULE_STATE | |
4275 #endif | |
4276 #if CYTHON_USE_MODULE_STATE | |
4277 #endif | |
4278 #if CYTHON_USE_MODULE_STATE | |
4279 #endif | |
4280 #if CYTHON_USE_MODULE_STATE | |
4281 #endif | |
4282 #if CYTHON_USE_MODULE_STATE | |
4283 #endif | |
4284 #if CYTHON_USE_MODULE_STATE | |
4285 #endif | |
4286 #if CYTHON_USE_MODULE_STATE | |
4287 #endif | |
4288 #if CYTHON_USE_MODULE_STATE | |
4289 #endif | |
4290 #if CYTHON_USE_MODULE_STATE | |
4291 #endif | |
4292 #if CYTHON_USE_MODULE_STATE | |
4293 #endif | |
4294 #if CYTHON_USE_MODULE_STATE | |
4295 #endif | |
4296 #if CYTHON_USE_MODULE_STATE | |
4297 #endif | |
4298 PyTypeObject *__pyx_ptype_7cpython_4bool_bool; | |
4299 #if CYTHON_USE_MODULE_STATE | |
4300 #endif | |
4301 #if CYTHON_USE_MODULE_STATE | |
4302 #endif | |
4303 #if CYTHON_USE_MODULE_STATE | |
4304 #endif | |
4305 #if CYTHON_USE_MODULE_STATE | |
4306 #endif | |
4307 PyTypeObject *__pyx_ptype_7cpython_7complex_complex; | |
4308 #if CYTHON_USE_MODULE_STATE | |
4309 #endif | |
4310 #if CYTHON_USE_MODULE_STATE | |
4311 #endif | |
4312 #if CYTHON_USE_MODULE_STATE | |
4313 #endif | |
4314 #if CYTHON_USE_MODULE_STATE | |
4315 #endif | |
4316 #if CYTHON_USE_MODULE_STATE | |
4317 #endif | |
4318 #if CYTHON_USE_MODULE_STATE | |
4319 #endif | |
4320 #if CYTHON_USE_MODULE_STATE | |
4321 #endif | |
4322 #if CYTHON_USE_MODULE_STATE | |
4323 #endif | |
4324 #if CYTHON_USE_MODULE_STATE | |
4325 #endif | |
4326 #if CYTHON_USE_MODULE_STATE | |
4327 #endif | |
4328 #if CYTHON_USE_MODULE_STATE | |
4329 #endif | |
4330 #if CYTHON_USE_MODULE_STATE | |
4331 #endif | |
4332 #if CYTHON_USE_MODULE_STATE | |
4333 #endif | |
4334 #if CYTHON_USE_MODULE_STATE | |
4335 #endif | |
4336 #if CYTHON_USE_MODULE_STATE | |
4337 #endif | |
4338 #if CYTHON_USE_MODULE_STATE | |
4339 #endif | |
4340 #if CYTHON_USE_MODULE_STATE | |
4341 #endif | |
4342 #if CYTHON_USE_MODULE_STATE | |
4343 #endif | |
4344 #if CYTHON_USE_MODULE_STATE | |
4345 #endif | |
4346 #if CYTHON_USE_MODULE_STATE | |
4347 #endif | |
4348 #if CYTHON_USE_MODULE_STATE | |
4349 #endif | |
4350 PyTypeObject *__pyx_ptype_5pysam_16libctabixproxies_TupleProxy; | |
4351 PyTypeObject *__pyx_ptype_5pysam_16libctabixproxies_TupleProxyIterator; | |
4352 PyTypeObject *__pyx_ptype_5pysam_16libctabixproxies_NamedTupleProxy; | |
4353 PyTypeObject *__pyx_ptype_5pysam_16libctabixproxies_GTFProxy; | |
4354 PyTypeObject *__pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy; | |
4355 PyTypeObject *__pyx_ptype_5pysam_16libctabixproxies_BedProxy; | |
4356 PyTypeObject *__pyx_ptype_5pysam_16libctabixproxies_VCFProxy; | |
4357 #if CYTHON_USE_MODULE_STATE | |
4358 #endif | |
4359 #if CYTHON_USE_MODULE_STATE | |
4360 #endif | |
4361 #if CYTHON_USE_MODULE_STATE | |
4362 #endif | |
4363 PyTypeObject *__pyx_ptype_7cpython_5array_array; | |
4364 #if CYTHON_USE_MODULE_STATE | |
4365 #endif | |
4366 #if CYTHON_USE_MODULE_STATE | |
4367 PyObject *__pyx_type_5pysam_9libctabix_tabix_file_iterator; | |
4368 PyObject *__pyx_type_5pysam_9libctabix_TabixFile; | |
4369 PyObject *__pyx_type_5pysam_9libctabix_Parser; | |
4370 PyObject *__pyx_type_5pysam_9libctabix_asTuple; | |
4371 PyObject *__pyx_type_5pysam_9libctabix_asGTF; | |
4372 PyObject *__pyx_type_5pysam_9libctabix_asGFF3; | |
4373 PyObject *__pyx_type_5pysam_9libctabix_asBed; | |
4374 PyObject *__pyx_type_5pysam_9libctabix_asVCF; | |
4375 PyObject *__pyx_type_5pysam_9libctabix_TabixIterator; | |
4376 PyObject *__pyx_type_5pysam_9libctabix_TabixIteratorParsed; | |
4377 PyObject *__pyx_type_5pysam_9libctabix_GZIterator; | |
4378 PyObject *__pyx_type_5pysam_9libctabix_GZIteratorHead; | |
4379 PyObject *__pyx_type_5pysam_9libctabix_GZIteratorParsed; | |
4380 PyObject *__pyx_type_5pysam_9libctabix_Tabixfile; | |
4381 #endif | |
4382 PyTypeObject *__pyx_ptype_5pysam_9libctabix_tabix_file_iterator; | |
4383 PyTypeObject *__pyx_ptype_5pysam_9libctabix_TabixFile; | |
4384 PyTypeObject *__pyx_ptype_5pysam_9libctabix_Parser; | |
4385 PyTypeObject *__pyx_ptype_5pysam_9libctabix_asTuple; | |
4386 PyTypeObject *__pyx_ptype_5pysam_9libctabix_asGTF; | |
4387 PyTypeObject *__pyx_ptype_5pysam_9libctabix_asGFF3; | |
4388 PyTypeObject *__pyx_ptype_5pysam_9libctabix_asBed; | |
4389 PyTypeObject *__pyx_ptype_5pysam_9libctabix_asVCF; | |
4390 PyTypeObject *__pyx_ptype_5pysam_9libctabix_TabixIterator; | |
4391 PyTypeObject *__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed; | |
4392 PyTypeObject *__pyx_ptype_5pysam_9libctabix_GZIterator; | |
4393 PyTypeObject *__pyx_ptype_5pysam_9libctabix_GZIteratorHead; | |
4394 PyTypeObject *__pyx_ptype_5pysam_9libctabix_GZIteratorParsed; | |
4395 PyTypeObject *__pyx_ptype_5pysam_9libctabix_Tabixfile; | |
4396 PyObject *__pyx_n_s_AssertionError; | |
4397 PyObject *__pyx_kp_u_Could_not_open_file; | |
4398 PyObject *__pyx_n_s_EmptyIterator; | |
4399 PyObject *__pyx_n_s_EmptyIterator___iter; | |
4400 PyObject *__pyx_n_s_EmptyIterator___next; | |
4401 PyObject *__pyx_kp_u_Filename_s_already_exists_use_fo; | |
4402 PyObject *__pyx_n_s_GZIterator; | |
4403 PyObject *__pyx_n_u_GZIterator; | |
4404 PyObject *__pyx_n_s_GZIteratorHead; | |
4405 PyObject *__pyx_n_u_GZIteratorHead; | |
4406 PyObject *__pyx_n_s_GZIteratorHead___reduce_cython; | |
4407 PyObject *__pyx_n_s_GZIteratorHead___setstate_cython; | |
4408 PyObject *__pyx_n_s_GZIteratorParsed; | |
4409 PyObject *__pyx_n_s_GZIteratorParsed___reduce_cython; | |
4410 PyObject *__pyx_n_s_GZIteratorParsed___setstate_cyth; | |
4411 PyObject *__pyx_n_s_GZIterator___reduce_cython; | |
4412 PyObject *__pyx_n_s_GZIterator___setstate_cython; | |
4413 PyObject *__pyx_n_s_IOError; | |
4414 PyObject *__pyx_kp_u_I_O_operation_on_closed_file; | |
4415 PyObject *__pyx_kp_u_I_O_operation_on_closed_file_2; | |
4416 PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; | |
4417 PyObject *__pyx_n_s_KeyError; | |
4418 PyObject *__pyx_n_s_MemoryError; | |
4419 PyObject *__pyx_kp_u_No_such_file_or_directory_s; | |
4420 PyObject *__pyx_n_s_NotImplementedError; | |
4421 PyObject *__pyx_n_s_OSError; | |
4422 PyObject *__pyx_n_s_O_RDONLY; | |
4423 PyObject *__pyx_n_s_Parser; | |
4424 PyObject *__pyx_n_s_Parser___reduce_cython; | |
4425 PyObject *__pyx_n_s_Parser___setstate_cython; | |
4426 PyObject *__pyx_n_s_Parser_get_encoding; | |
4427 PyObject *__pyx_n_s_Parser_set_encoding; | |
4428 PyObject *__pyx_n_s_PickleError; | |
4429 PyObject *__pyx_n_s_StopIteration; | |
4430 PyObject *__pyx_n_s_TabixFile; | |
4431 PyObject *__pyx_n_u_TabixFile; | |
4432 PyObject *__pyx_n_s_TabixFile___reduce_cython; | |
4433 PyObject *__pyx_n_s_TabixFile___setstate_cython; | |
4434 PyObject *__pyx_n_s_TabixFile__dup; | |
4435 PyObject *__pyx_n_s_TabixFile__open; | |
4436 PyObject *__pyx_n_s_TabixFile_close; | |
4437 PyObject *__pyx_n_s_TabixFile_fetch; | |
4438 PyObject *__pyx_n_s_TabixIterator; | |
4439 PyObject *__pyx_n_s_TabixIteratorParsed; | |
4440 PyObject *__pyx_n_s_TabixIteratorParsed___reduce_cyt; | |
4441 PyObject *__pyx_n_s_TabixIteratorParsed___setstate_c; | |
4442 PyObject *__pyx_n_s_TabixIterator___reduce_cython; | |
4443 PyObject *__pyx_n_s_TabixIterator___setstate_cython; | |
4444 PyObject *__pyx_n_s_Tabixfile; | |
4445 PyObject *__pyx_n_u_Tabixfile; | |
4446 PyObject *__pyx_n_s_Tabixfile___reduce_cython; | |
4447 PyObject *__pyx_n_s_Tabixfile___setstate_cython; | |
4448 PyObject *__pyx_n_s_TypeError; | |
4449 PyObject *__pyx_n_s_ValueError; | |
4450 PyObject *__pyx_n_s_WINDOW_SIZE; | |
4451 PyObject *__pyx_kp_b__16; | |
4452 PyObject *__pyx_kp_u__39; | |
4453 PyObject *__pyx_kp_u__42; | |
4454 PyObject *__pyx_kp_u__43; | |
4455 PyObject *__pyx_kp_u__44; | |
4456 PyObject *__pyx_kp_u__56; | |
4457 PyObject *__pyx_n_s__62; | |
4458 PyObject *__pyx_n_s__78; | |
4459 PyObject *__pyx_n_s_a; | |
4460 PyObject *__pyx_n_s_all; | |
4461 PyObject *__pyx_n_s_asBed; | |
4462 PyObject *__pyx_n_u_asBed; | |
4463 PyObject *__pyx_n_s_asBed___reduce_cython; | |
4464 PyObject *__pyx_n_s_asBed___setstate_cython; | |
4465 PyObject *__pyx_n_s_asGFF3; | |
4466 PyObject *__pyx_n_u_asGFF3; | |
4467 PyObject *__pyx_n_s_asGFF3___reduce_cython; | |
4468 PyObject *__pyx_n_s_asGFF3___setstate_cython; | |
4469 PyObject *__pyx_n_s_asGTF; | |
4470 PyObject *__pyx_n_u_asGTF; | |
4471 PyObject *__pyx_n_s_asGTF___reduce_cython; | |
4472 PyObject *__pyx_n_s_asGTF___setstate_cython; | |
4473 PyObject *__pyx_n_s_asTuple; | |
4474 PyObject *__pyx_n_u_asTuple; | |
4475 PyObject *__pyx_n_s_asTuple___reduce_cython; | |
4476 PyObject *__pyx_n_s_asTuple___setstate_cython; | |
4477 PyObject *__pyx_n_s_asVCF; | |
4478 PyObject *__pyx_n_u_asVCF; | |
4479 PyObject *__pyx_n_s_asVCF___reduce_cython; | |
4480 PyObject *__pyx_n_s_asVCF___setstate_cython; | |
4481 PyObject *__pyx_n_u_ascii; | |
4482 PyObject *__pyx_n_s_asyncio_coroutines; | |
4483 PyObject *__pyx_n_s_b; | |
4484 PyObject *__pyx_n_u_bcf; | |
4485 PyObject *__pyx_n_u_bed; | |
4486 PyObject *__pyx_n_s_buffer; | |
4487 PyObject *__pyx_n_s_buffer_size; | |
4488 PyObject *__pyx_kp_u_building_of_index_for_failed; | |
4489 PyObject *__pyx_n_s_bytes_cpy; | |
4490 PyObject *__pyx_n_s_c; | |
4491 PyObject *__pyx_n_s_cfilename; | |
4492 PyObject *__pyx_n_s_cfilename_index; | |
4493 PyObject *__pyx_n_s_cfn; | |
4494 PyObject *__pyx_n_s_cline_in_traceback; | |
4495 PyObject *__pyx_n_s_close; | |
4496 PyObject *__pyx_n_s_closed; | |
4497 PyObject *__pyx_n_s_conf; | |
4498 PyObject *__pyx_n_s_conf_data; | |
4499 PyObject *__pyx_n_s_contigs; | |
4500 PyObject *__pyx_kp_u_could_not_create_iterator_for_re; | |
4501 PyObject *__pyx_kp_u_could_not_create_iterator_possib; | |
4502 PyObject *__pyx_kp_u_could_not_load_tbi_csi_index_of; | |
4503 PyObject *__pyx_kp_u_could_not_open_file_s; | |
4504 PyObject *__pyx_kp_u_could_not_open_for_reading_heade; | |
4505 PyObject *__pyx_kp_u_could_not_open_index_for_s; | |
4506 PyObject *__pyx_kp_u_could_not_open_s_for_reading; | |
4507 PyObject *__pyx_kp_u_could_not_open_s_for_writing; | |
4508 PyObject *__pyx_n_s_cpy; | |
4509 PyObject *__pyx_n_s_csi; | |
4510 PyObject *__pyx_kp_u_csi_2; | |
4511 PyObject *__pyx_n_s_cstr; | |
4512 PyObject *__pyx_n_s_dict; | |
4513 PyObject *__pyx_n_s_dict_2; | |
4514 PyObject *__pyx_kp_u_disable; | |
4515 PyObject *__pyx_n_s_doc; | |
4516 PyObject *__pyx_n_s_dup; | |
4517 PyObject *__pyx_kp_s_empty_iterator; | |
4518 PyObject *__pyx_kp_u_enable; | |
4519 PyObject *__pyx_n_s_encoding; | |
4520 PyObject *__pyx_n_s_end; | |
4521 PyObject *__pyx_n_s_end_col; | |
4522 PyObject *__pyx_kp_u_end_out_of_range_i; | |
4523 PyObject *__pyx_kp_u_error_i_when_closing_file_s; | |
4524 PyObject *__pyx_kp_u_error_i_when_writing_to_file_s; | |
4525 PyObject *__pyx_n_s_exists; | |
4526 PyObject *__pyx_n_s_fd_src; | |
4527 PyObject *__pyx_n_s_fetch; | |
4528 PyObject *__pyx_kp_u_file_s_not_found; | |
4529 PyObject *__pyx_n_s_filename; | |
4530 PyObject *__pyx_n_s_filename_in; | |
4531 PyObject *__pyx_n_s_filename_index; | |
4532 PyObject *__pyx_n_s_filename_out; | |
4533 PyObject *__pyx_kp_u_filename_s_already_exists_use_fo; | |
4534 PyObject *__pyx_n_s_fileobj; | |
4535 PyObject *__pyx_n_s_fmt; | |
4536 PyObject *__pyx_n_s_fn; | |
4537 PyObject *__pyx_n_s_fn_index; | |
4538 PyObject *__pyx_n_s_fnidx; | |
4539 PyObject *__pyx_n_s_force; | |
4540 PyObject *__pyx_n_s_format; | |
4541 PyObject *__pyx_n_s_fp; | |
4542 PyObject *__pyx_kp_u_gc; | |
4543 PyObject *__pyx_n_s_get_encoding; | |
4544 PyObject *__pyx_n_s_getstate; | |
4545 PyObject *__pyx_n_u_gff; | |
4546 PyObject *__pyx_kp_u_gz; | |
4547 PyObject *__pyx_n_s_import; | |
4548 PyObject *__pyx_kp_u_incomplete_line_at_s; | |
4549 PyObject *__pyx_n_s_index; | |
4550 PyObject *__pyx_kp_u_index_s_not_found; | |
4551 PyObject *__pyx_n_s_infile; | |
4552 PyObject *__pyx_n_s_init; | |
4553 PyObject *__pyx_n_s_init_subclass; | |
4554 PyObject *__pyx_n_s_initializing; | |
4555 PyObject *__pyx_kp_u_invalid_file_opening_mode_s; | |
4556 PyObject *__pyx_n_s_is_coroutine; | |
4557 PyObject *__pyx_n_s_is_empty; | |
4558 PyObject *__pyx_n_s_is_open; | |
4559 PyObject *__pyx_kp_u_isenabled; | |
4560 PyObject *__pyx_n_s_iter; | |
4561 PyObject *__pyx_kp_s_iterate_over_infile_Permits_the; | |
4562 PyObject *__pyx_kp_u_iteration_on_closed_file; | |
4563 PyObject *__pyx_n_s_itr; | |
4564 PyObject *__pyx_n_s_keep_original; | |
4565 PyObject *__pyx_n_s_keys; | |
4566 PyObject *__pyx_n_s_length; | |
4567 PyObject *__pyx_n_s_line; | |
4568 PyObject *__pyx_n_s_line_skip; | |
4569 PyObject *__pyx_n_s_main; | |
4570 PyObject *__pyx_n_s_meta_char; | |
4571 PyObject *__pyx_n_s_metaclass; | |
4572 PyObject *__pyx_n_s_min_shift; | |
4573 PyObject *__pyx_n_s_mode; | |
4574 PyObject *__pyx_n_s_module; | |
4575 PyObject *__pyx_n_s_multiple_iterators; | |
4576 PyObject *__pyx_n_s_name; | |
4577 PyObject *__pyx_n_s_nbytes; | |
4578 PyObject *__pyx_kp_u_neither_preset_nor_seq_col_start; | |
4579 PyObject *__pyx_n_s_new; | |
4580 PyObject *__pyx_n_s_next; | |
4581 PyObject *__pyx_kp_s_no_default___reduce___due_to_non; | |
4582 PyObject *__pyx_n_s_open; | |
4583 PyObject *__pyx_n_s_os; | |
4584 PyObject *__pyx_kp_u_parse_method_of_s_not_implemente; | |
4585 PyObject *__pyx_n_s_parser; | |
4586 PyObject *__pyx_n_s_path; | |
4587 PyObject *__pyx_n_s_pickle; | |
4588 PyObject *__pyx_n_s_prepare; | |
4589 PyObject *__pyx_n_s_preset; | |
4590 PyObject *__pyx_n_s_preset2conf; | |
4591 PyObject *__pyx_n_u_psltbl; | |
4592 PyObject *__pyx_n_s_pysam_libctabix; | |
4593 PyObject *__pyx_kp_s_pysam_libctabix_pyx; | |
4594 PyObject *__pyx_n_s_pyx_PickleError; | |
4595 PyObject *__pyx_n_s_pyx_checksum; | |
4596 PyObject *__pyx_n_s_pyx_result; | |
4597 PyObject *__pyx_n_s_pyx_state; | |
4598 PyObject *__pyx_n_s_pyx_type; | |
4599 PyObject *__pyx_n_s_pyx_unpickle_Parser; | |
4600 PyObject *__pyx_n_s_pyx_unpickle_asBed; | |
4601 PyObject *__pyx_n_s_pyx_unpickle_asGFF3; | |
4602 PyObject *__pyx_n_s_pyx_unpickle_asGTF; | |
4603 PyObject *__pyx_n_s_pyx_unpickle_asTuple; | |
4604 PyObject *__pyx_n_s_pyx_unpickle_asVCF; | |
4605 PyObject *__pyx_n_s_pyx_vtable; | |
4606 PyObject *__pyx_n_s_qualname; | |
4607 PyObject *__pyx_n_s_r; | |
4608 PyObject *__pyx_n_u_r; | |
4609 PyObject *__pyx_n_s_readline; | |
4610 PyObject *__pyx_n_s_reduce; | |
4611 PyObject *__pyx_n_s_reduce_cython; | |
4612 PyObject *__pyx_n_s_reduce_ex; | |
4613 PyObject *__pyx_n_s_reference; | |
4614 PyObject *__pyx_n_s_region; | |
4615 PyObject *__pyx_n_s_retval; | |
4616 PyObject *__pyx_kp_u_s; | |
4617 PyObject *__pyx_n_s_s_2; | |
4618 PyObject *__pyx_kp_u_s_i; | |
4619 PyObject *__pyx_kp_u_s_i_i; | |
4620 PyObject *__pyx_n_u_sam; | |
4621 PyObject *__pyx_n_s_self; | |
4622 PyObject *__pyx_kp_s_self_gzipfile_self_kstream_canno; | |
4623 PyObject *__pyx_kp_s_self_iterator_cannot_be_converte; | |
4624 PyObject *__pyx_n_s_seq_col; | |
4625 PyObject *__pyx_n_s_set_encoding; | |
4626 PyObject *__pyx_n_s_set_name; | |
4627 PyObject *__pyx_n_s_setstate; | |
4628 PyObject *__pyx_n_s_setstate_cython; | |
4629 PyObject *__pyx_n_s_spec; | |
4630 PyObject *__pyx_n_s_start; | |
4631 PyObject *__pyx_n_s_start_col; | |
4632 PyObject *__pyx_kp_u_start_i_end_i; | |
4633 PyObject *__pyx_kp_u_start_out_of_range_i; | |
4634 PyObject *__pyx_n_s_state; | |
4635 PyObject *__pyx_kp_s_stringsource; | |
4636 PyObject *__pyx_n_s_suffix; | |
4637 PyObject *__pyx_n_s_super; | |
4638 PyObject *__pyx_n_s_sys; | |
4639 PyObject *__pyx_n_s_tabix_compress; | |
4640 PyObject *__pyx_n_u_tabix_compress; | |
4641 PyObject *__pyx_n_s_tabix_file_iterator; | |
4642 PyObject *__pyx_n_u_tabix_file_iterator; | |
4643 PyObject *__pyx_n_s_tabix_file_iterator___reduce_cyt; | |
4644 PyObject *__pyx_n_s_tabix_file_iterator___setstate_c; | |
4645 PyObject *__pyx_n_s_tabix_generic_iterator; | |
4646 PyObject *__pyx_n_u_tabix_generic_iterator; | |
4647 PyObject *__pyx_n_s_tabix_generic_iterator___init; | |
4648 PyObject *__pyx_n_s_tabix_generic_iterator___iter; | |
4649 PyObject *__pyx_n_s_tabix_generic_iterator___next; | |
4650 PyObject *__pyx_n_s_tabix_index; | |
4651 PyObject *__pyx_n_u_tabix_index; | |
4652 PyObject *__pyx_n_s_tabix_iterator; | |
4653 PyObject *__pyx_n_u_tabix_iterator; | |
4654 PyObject *__pyx_kp_u_tbi; | |
4655 PyObject *__pyx_n_s_tell; | |
4656 PyObject *__pyx_n_s_test; | |
4657 PyObject *__pyx_n_s_threads; | |
4658 PyObject *__pyx_kp_u_unknown_preset; | |
4659 PyObject *__pyx_n_s_unlink; | |
4660 PyObject *__pyx_n_s_update; | |
4661 PyObject *__pyx_n_s_use_setstate; | |
4662 PyObject *__pyx_kp_u_valid_presets_are; | |
4663 PyObject *__pyx_n_u_vcf; | |
4664 PyObject *__pyx_kp_u_writing_failed; | |
4665 PyObject *__pyx_n_s_zerobased; | |
4666 PyObject *__pyx_int_0; | |
4667 PyObject *__pyx_int_1; | |
4668 PyObject *__pyx_int_2; | |
4669 PyObject *__pyx_int_3; | |
4670 PyObject *__pyx_int_4; | |
4671 PyObject *__pyx_int_5; | |
4672 PyObject *__pyx_int_15; | |
4673 PyObject *__pyx_int_17; | |
4674 PyObject *__pyx_int_18; | |
4675 PyObject *__pyx_int_35; | |
4676 PyObject *__pyx_int_64; | |
4677 PyObject *__pyx_int_21667264; | |
4678 PyObject *__pyx_int_139192863; | |
4679 PyObject *__pyx_int_243541226; | |
4680 PyObject *__pyx_int_neg_1; | |
4681 PyObject *__pyx_codeobj_; | |
4682 PyObject *__pyx_tuple__19; | |
4683 PyObject *__pyx_tuple__20; | |
4684 PyObject *__pyx_tuple__24; | |
4685 PyObject *__pyx_tuple__38; | |
4686 PyObject *__pyx_tuple__41; | |
4687 PyObject *__pyx_tuple__45; | |
4688 PyObject *__pyx_tuple__55; | |
4689 PyObject *__pyx_tuple__63; | |
4690 PyObject *__pyx_tuple__64; | |
4691 PyObject *__pyx_tuple__65; | |
4692 PyObject *__pyx_tuple__66; | |
4693 PyObject *__pyx_tuple__67; | |
4694 PyObject *__pyx_tuple__68; | |
4695 PyObject *__pyx_tuple__69; | |
4696 PyObject *__pyx_tuple__70; | |
4697 PyObject *__pyx_tuple__71; | |
4698 PyObject *__pyx_tuple__72; | |
4699 PyObject *__pyx_tuple__73; | |
4700 PyObject *__pyx_tuple__74; | |
4701 PyObject *__pyx_tuple__75; | |
4702 PyObject *__pyx_tuple__76; | |
4703 PyObject *__pyx_tuple__77; | |
4704 PyObject *__pyx_codeobj__2; | |
4705 PyObject *__pyx_codeobj__3; | |
4706 PyObject *__pyx_codeobj__4; | |
4707 PyObject *__pyx_codeobj__5; | |
4708 PyObject *__pyx_codeobj__6; | |
4709 PyObject *__pyx_codeobj__7; | |
4710 PyObject *__pyx_codeobj__8; | |
4711 PyObject *__pyx_codeobj__9; | |
4712 PyObject *__pyx_codeobj__10; | |
4713 PyObject *__pyx_codeobj__11; | |
4714 PyObject *__pyx_codeobj__12; | |
4715 PyObject *__pyx_codeobj__13; | |
4716 PyObject *__pyx_codeobj__14; | |
4717 PyObject *__pyx_codeobj__15; | |
4718 PyObject *__pyx_codeobj__17; | |
4719 PyObject *__pyx_codeobj__18; | |
4720 PyObject *__pyx_codeobj__21; | |
4721 PyObject *__pyx_codeobj__22; | |
4722 PyObject *__pyx_codeobj__23; | |
4723 PyObject *__pyx_codeobj__25; | |
4724 PyObject *__pyx_codeobj__26; | |
4725 PyObject *__pyx_codeobj__27; | |
4726 PyObject *__pyx_codeobj__28; | |
4727 PyObject *__pyx_codeobj__29; | |
4728 PyObject *__pyx_codeobj__30; | |
4729 PyObject *__pyx_codeobj__31; | |
4730 PyObject *__pyx_codeobj__32; | |
4731 PyObject *__pyx_codeobj__33; | |
4732 PyObject *__pyx_codeobj__34; | |
4733 PyObject *__pyx_codeobj__35; | |
4734 PyObject *__pyx_codeobj__36; | |
4735 PyObject *__pyx_codeobj__37; | |
4736 PyObject *__pyx_codeobj__40; | |
4737 PyObject *__pyx_codeobj__46; | |
4738 PyObject *__pyx_codeobj__47; | |
4739 PyObject *__pyx_codeobj__48; | |
4740 PyObject *__pyx_codeobj__49; | |
4741 PyObject *__pyx_codeobj__50; | |
4742 PyObject *__pyx_codeobj__51; | |
4743 PyObject *__pyx_codeobj__52; | |
4744 PyObject *__pyx_codeobj__53; | |
4745 PyObject *__pyx_codeobj__54; | |
4746 PyObject *__pyx_codeobj__57; | |
4747 PyObject *__pyx_codeobj__58; | |
4748 PyObject *__pyx_codeobj__59; | |
4749 PyObject *__pyx_codeobj__60; | |
4750 PyObject *__pyx_codeobj__61; | |
4751 } __pyx_mstate; | |
4752 | |
4753 #if CYTHON_USE_MODULE_STATE | |
4754 #ifdef __cplusplus | |
4755 namespace { | |
4756 extern struct PyModuleDef __pyx_moduledef; | |
4757 } /* anonymous namespace */ | |
4758 #else | |
4759 static struct PyModuleDef __pyx_moduledef; | |
4760 #endif | |
4761 | |
4762 #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) | |
4763 | |
4764 #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) | |
4765 | |
4766 #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) | |
4767 #else | |
4768 static __pyx_mstate __pyx_mstate_global_static = | |
4769 #ifdef __cplusplus | |
4770 {}; | |
4771 #else | |
4772 {0}; | |
4773 #endif | |
4774 static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; | |
4775 #endif | |
4776 /* #### Code section: module_state_clear ### */ | |
4777 #if CYTHON_USE_MODULE_STATE | |
4778 static int __pyx_m_clear(PyObject *m) { | |
4779 __pyx_mstate *clear_module_state = __pyx_mstate(m); | |
4780 if (!clear_module_state) return 0; | |
4781 Py_CLEAR(clear_module_state->__pyx_d); | |
4782 Py_CLEAR(clear_module_state->__pyx_b); | |
4783 Py_CLEAR(clear_module_state->__pyx_cython_runtime); | |
4784 Py_CLEAR(clear_module_state->__pyx_empty_tuple); | |
4785 Py_CLEAR(clear_module_state->__pyx_empty_bytes); | |
4786 Py_CLEAR(clear_module_state->__pyx_empty_unicode); | |
4787 #ifdef __Pyx_CyFunction_USED | |
4788 Py_CLEAR(clear_module_state->__pyx_CyFunctionType); | |
4789 #endif | |
4790 #ifdef __Pyx_FusedFunction_USED | |
4791 Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); | |
4792 #endif | |
4793 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_10libchtslib_HTSFile); | |
4794 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); | |
4795 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool); | |
4796 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex); | |
4797 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_16libctabixproxies_TupleProxy); | |
4798 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_16libctabixproxies_TupleProxyIterator); | |
4799 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_16libctabixproxies_NamedTupleProxy); | |
4800 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_16libctabixproxies_GTFProxy); | |
4801 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy); | |
4802 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_16libctabixproxies_BedProxy); | |
4803 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_16libctabixproxies_VCFProxy); | |
4804 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_5array_array); | |
4805 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_tabix_file_iterator); | |
4806 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libctabix_tabix_file_iterator); | |
4807 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_TabixFile); | |
4808 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libctabix_TabixFile); | |
4809 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_Parser); | |
4810 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libctabix_Parser); | |
4811 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_asTuple); | |
4812 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libctabix_asTuple); | |
4813 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_asGTF); | |
4814 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libctabix_asGTF); | |
4815 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_asGFF3); | |
4816 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libctabix_asGFF3); | |
4817 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_asBed); | |
4818 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libctabix_asBed); | |
4819 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_asVCF); | |
4820 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libctabix_asVCF); | |
4821 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_TabixIterator); | |
4822 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libctabix_TabixIterator); | |
4823 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed); | |
4824 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libctabix_TabixIteratorParsed); | |
4825 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_GZIterator); | |
4826 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libctabix_GZIterator); | |
4827 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_GZIteratorHead); | |
4828 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libctabix_GZIteratorHead); | |
4829 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_GZIteratorParsed); | |
4830 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libctabix_GZIteratorParsed); | |
4831 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libctabix_Tabixfile); | |
4832 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libctabix_Tabixfile); | |
4833 Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); | |
4834 Py_CLEAR(clear_module_state->__pyx_kp_u_Could_not_open_file); | |
4835 Py_CLEAR(clear_module_state->__pyx_n_s_EmptyIterator); | |
4836 Py_CLEAR(clear_module_state->__pyx_n_s_EmptyIterator___iter); | |
4837 Py_CLEAR(clear_module_state->__pyx_n_s_EmptyIterator___next); | |
4838 Py_CLEAR(clear_module_state->__pyx_kp_u_Filename_s_already_exists_use_fo); | |
4839 Py_CLEAR(clear_module_state->__pyx_n_s_GZIterator); | |
4840 Py_CLEAR(clear_module_state->__pyx_n_u_GZIterator); | |
4841 Py_CLEAR(clear_module_state->__pyx_n_s_GZIteratorHead); | |
4842 Py_CLEAR(clear_module_state->__pyx_n_u_GZIteratorHead); | |
4843 Py_CLEAR(clear_module_state->__pyx_n_s_GZIteratorHead___reduce_cython); | |
4844 Py_CLEAR(clear_module_state->__pyx_n_s_GZIteratorHead___setstate_cython); | |
4845 Py_CLEAR(clear_module_state->__pyx_n_s_GZIteratorParsed); | |
4846 Py_CLEAR(clear_module_state->__pyx_n_s_GZIteratorParsed___reduce_cython); | |
4847 Py_CLEAR(clear_module_state->__pyx_n_s_GZIteratorParsed___setstate_cyth); | |
4848 Py_CLEAR(clear_module_state->__pyx_n_s_GZIterator___reduce_cython); | |
4849 Py_CLEAR(clear_module_state->__pyx_n_s_GZIterator___setstate_cython); | |
4850 Py_CLEAR(clear_module_state->__pyx_n_s_IOError); | |
4851 Py_CLEAR(clear_module_state->__pyx_kp_u_I_O_operation_on_closed_file); | |
4852 Py_CLEAR(clear_module_state->__pyx_kp_u_I_O_operation_on_closed_file_2); | |
4853 Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); | |
4854 Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); | |
4855 Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError); | |
4856 Py_CLEAR(clear_module_state->__pyx_kp_u_No_such_file_or_directory_s); | |
4857 Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError); | |
4858 Py_CLEAR(clear_module_state->__pyx_n_s_OSError); | |
4859 Py_CLEAR(clear_module_state->__pyx_n_s_O_RDONLY); | |
4860 Py_CLEAR(clear_module_state->__pyx_n_s_Parser); | |
4861 Py_CLEAR(clear_module_state->__pyx_n_s_Parser___reduce_cython); | |
4862 Py_CLEAR(clear_module_state->__pyx_n_s_Parser___setstate_cython); | |
4863 Py_CLEAR(clear_module_state->__pyx_n_s_Parser_get_encoding); | |
4864 Py_CLEAR(clear_module_state->__pyx_n_s_Parser_set_encoding); | |
4865 Py_CLEAR(clear_module_state->__pyx_n_s_PickleError); | |
4866 Py_CLEAR(clear_module_state->__pyx_n_s_StopIteration); | |
4867 Py_CLEAR(clear_module_state->__pyx_n_s_TabixFile); | |
4868 Py_CLEAR(clear_module_state->__pyx_n_u_TabixFile); | |
4869 Py_CLEAR(clear_module_state->__pyx_n_s_TabixFile___reduce_cython); | |
4870 Py_CLEAR(clear_module_state->__pyx_n_s_TabixFile___setstate_cython); | |
4871 Py_CLEAR(clear_module_state->__pyx_n_s_TabixFile__dup); | |
4872 Py_CLEAR(clear_module_state->__pyx_n_s_TabixFile__open); | |
4873 Py_CLEAR(clear_module_state->__pyx_n_s_TabixFile_close); | |
4874 Py_CLEAR(clear_module_state->__pyx_n_s_TabixFile_fetch); | |
4875 Py_CLEAR(clear_module_state->__pyx_n_s_TabixIterator); | |
4876 Py_CLEAR(clear_module_state->__pyx_n_s_TabixIteratorParsed); | |
4877 Py_CLEAR(clear_module_state->__pyx_n_s_TabixIteratorParsed___reduce_cyt); | |
4878 Py_CLEAR(clear_module_state->__pyx_n_s_TabixIteratorParsed___setstate_c); | |
4879 Py_CLEAR(clear_module_state->__pyx_n_s_TabixIterator___reduce_cython); | |
4880 Py_CLEAR(clear_module_state->__pyx_n_s_TabixIterator___setstate_cython); | |
4881 Py_CLEAR(clear_module_state->__pyx_n_s_Tabixfile); | |
4882 Py_CLEAR(clear_module_state->__pyx_n_u_Tabixfile); | |
4883 Py_CLEAR(clear_module_state->__pyx_n_s_Tabixfile___reduce_cython); | |
4884 Py_CLEAR(clear_module_state->__pyx_n_s_Tabixfile___setstate_cython); | |
4885 Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); | |
4886 Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); | |
4887 Py_CLEAR(clear_module_state->__pyx_n_s_WINDOW_SIZE); | |
4888 Py_CLEAR(clear_module_state->__pyx_kp_b__16); | |
4889 Py_CLEAR(clear_module_state->__pyx_kp_u__39); | |
4890 Py_CLEAR(clear_module_state->__pyx_kp_u__42); | |
4891 Py_CLEAR(clear_module_state->__pyx_kp_u__43); | |
4892 Py_CLEAR(clear_module_state->__pyx_kp_u__44); | |
4893 Py_CLEAR(clear_module_state->__pyx_kp_u__56); | |
4894 Py_CLEAR(clear_module_state->__pyx_n_s__62); | |
4895 Py_CLEAR(clear_module_state->__pyx_n_s__78); | |
4896 Py_CLEAR(clear_module_state->__pyx_n_s_a); | |
4897 Py_CLEAR(clear_module_state->__pyx_n_s_all); | |
4898 Py_CLEAR(clear_module_state->__pyx_n_s_asBed); | |
4899 Py_CLEAR(clear_module_state->__pyx_n_u_asBed); | |
4900 Py_CLEAR(clear_module_state->__pyx_n_s_asBed___reduce_cython); | |
4901 Py_CLEAR(clear_module_state->__pyx_n_s_asBed___setstate_cython); | |
4902 Py_CLEAR(clear_module_state->__pyx_n_s_asGFF3); | |
4903 Py_CLEAR(clear_module_state->__pyx_n_u_asGFF3); | |
4904 Py_CLEAR(clear_module_state->__pyx_n_s_asGFF3___reduce_cython); | |
4905 Py_CLEAR(clear_module_state->__pyx_n_s_asGFF3___setstate_cython); | |
4906 Py_CLEAR(clear_module_state->__pyx_n_s_asGTF); | |
4907 Py_CLEAR(clear_module_state->__pyx_n_u_asGTF); | |
4908 Py_CLEAR(clear_module_state->__pyx_n_s_asGTF___reduce_cython); | |
4909 Py_CLEAR(clear_module_state->__pyx_n_s_asGTF___setstate_cython); | |
4910 Py_CLEAR(clear_module_state->__pyx_n_s_asTuple); | |
4911 Py_CLEAR(clear_module_state->__pyx_n_u_asTuple); | |
4912 Py_CLEAR(clear_module_state->__pyx_n_s_asTuple___reduce_cython); | |
4913 Py_CLEAR(clear_module_state->__pyx_n_s_asTuple___setstate_cython); | |
4914 Py_CLEAR(clear_module_state->__pyx_n_s_asVCF); | |
4915 Py_CLEAR(clear_module_state->__pyx_n_u_asVCF); | |
4916 Py_CLEAR(clear_module_state->__pyx_n_s_asVCF___reduce_cython); | |
4917 Py_CLEAR(clear_module_state->__pyx_n_s_asVCF___setstate_cython); | |
4918 Py_CLEAR(clear_module_state->__pyx_n_u_ascii); | |
4919 Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); | |
4920 Py_CLEAR(clear_module_state->__pyx_n_s_b); | |
4921 Py_CLEAR(clear_module_state->__pyx_n_u_bcf); | |
4922 Py_CLEAR(clear_module_state->__pyx_n_u_bed); | |
4923 Py_CLEAR(clear_module_state->__pyx_n_s_buffer); | |
4924 Py_CLEAR(clear_module_state->__pyx_n_s_buffer_size); | |
4925 Py_CLEAR(clear_module_state->__pyx_kp_u_building_of_index_for_failed); | |
4926 Py_CLEAR(clear_module_state->__pyx_n_s_bytes_cpy); | |
4927 Py_CLEAR(clear_module_state->__pyx_n_s_c); | |
4928 Py_CLEAR(clear_module_state->__pyx_n_s_cfilename); | |
4929 Py_CLEAR(clear_module_state->__pyx_n_s_cfilename_index); | |
4930 Py_CLEAR(clear_module_state->__pyx_n_s_cfn); | |
4931 Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); | |
4932 Py_CLEAR(clear_module_state->__pyx_n_s_close); | |
4933 Py_CLEAR(clear_module_state->__pyx_n_s_closed); | |
4934 Py_CLEAR(clear_module_state->__pyx_n_s_conf); | |
4935 Py_CLEAR(clear_module_state->__pyx_n_s_conf_data); | |
4936 Py_CLEAR(clear_module_state->__pyx_n_s_contigs); | |
4937 Py_CLEAR(clear_module_state->__pyx_kp_u_could_not_create_iterator_for_re); | |
4938 Py_CLEAR(clear_module_state->__pyx_kp_u_could_not_create_iterator_possib); | |
4939 Py_CLEAR(clear_module_state->__pyx_kp_u_could_not_load_tbi_csi_index_of); | |
4940 Py_CLEAR(clear_module_state->__pyx_kp_u_could_not_open_file_s); | |
4941 Py_CLEAR(clear_module_state->__pyx_kp_u_could_not_open_for_reading_heade); | |
4942 Py_CLEAR(clear_module_state->__pyx_kp_u_could_not_open_index_for_s); | |
4943 Py_CLEAR(clear_module_state->__pyx_kp_u_could_not_open_s_for_reading); | |
4944 Py_CLEAR(clear_module_state->__pyx_kp_u_could_not_open_s_for_writing); | |
4945 Py_CLEAR(clear_module_state->__pyx_n_s_cpy); | |
4946 Py_CLEAR(clear_module_state->__pyx_n_s_csi); | |
4947 Py_CLEAR(clear_module_state->__pyx_kp_u_csi_2); | |
4948 Py_CLEAR(clear_module_state->__pyx_n_s_cstr); | |
4949 Py_CLEAR(clear_module_state->__pyx_n_s_dict); | |
4950 Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); | |
4951 Py_CLEAR(clear_module_state->__pyx_kp_u_disable); | |
4952 Py_CLEAR(clear_module_state->__pyx_n_s_doc); | |
4953 Py_CLEAR(clear_module_state->__pyx_n_s_dup); | |
4954 Py_CLEAR(clear_module_state->__pyx_kp_s_empty_iterator); | |
4955 Py_CLEAR(clear_module_state->__pyx_kp_u_enable); | |
4956 Py_CLEAR(clear_module_state->__pyx_n_s_encoding); | |
4957 Py_CLEAR(clear_module_state->__pyx_n_s_end); | |
4958 Py_CLEAR(clear_module_state->__pyx_n_s_end_col); | |
4959 Py_CLEAR(clear_module_state->__pyx_kp_u_end_out_of_range_i); | |
4960 Py_CLEAR(clear_module_state->__pyx_kp_u_error_i_when_closing_file_s); | |
4961 Py_CLEAR(clear_module_state->__pyx_kp_u_error_i_when_writing_to_file_s); | |
4962 Py_CLEAR(clear_module_state->__pyx_n_s_exists); | |
4963 Py_CLEAR(clear_module_state->__pyx_n_s_fd_src); | |
4964 Py_CLEAR(clear_module_state->__pyx_n_s_fetch); | |
4965 Py_CLEAR(clear_module_state->__pyx_kp_u_file_s_not_found); | |
4966 Py_CLEAR(clear_module_state->__pyx_n_s_filename); | |
4967 Py_CLEAR(clear_module_state->__pyx_n_s_filename_in); | |
4968 Py_CLEAR(clear_module_state->__pyx_n_s_filename_index); | |
4969 Py_CLEAR(clear_module_state->__pyx_n_s_filename_out); | |
4970 Py_CLEAR(clear_module_state->__pyx_kp_u_filename_s_already_exists_use_fo); | |
4971 Py_CLEAR(clear_module_state->__pyx_n_s_fileobj); | |
4972 Py_CLEAR(clear_module_state->__pyx_n_s_fmt); | |
4973 Py_CLEAR(clear_module_state->__pyx_n_s_fn); | |
4974 Py_CLEAR(clear_module_state->__pyx_n_s_fn_index); | |
4975 Py_CLEAR(clear_module_state->__pyx_n_s_fnidx); | |
4976 Py_CLEAR(clear_module_state->__pyx_n_s_force); | |
4977 Py_CLEAR(clear_module_state->__pyx_n_s_format); | |
4978 Py_CLEAR(clear_module_state->__pyx_n_s_fp); | |
4979 Py_CLEAR(clear_module_state->__pyx_kp_u_gc); | |
4980 Py_CLEAR(clear_module_state->__pyx_n_s_get_encoding); | |
4981 Py_CLEAR(clear_module_state->__pyx_n_s_getstate); | |
4982 Py_CLEAR(clear_module_state->__pyx_n_u_gff); | |
4983 Py_CLEAR(clear_module_state->__pyx_kp_u_gz); | |
4984 Py_CLEAR(clear_module_state->__pyx_n_s_import); | |
4985 Py_CLEAR(clear_module_state->__pyx_kp_u_incomplete_line_at_s); | |
4986 Py_CLEAR(clear_module_state->__pyx_n_s_index); | |
4987 Py_CLEAR(clear_module_state->__pyx_kp_u_index_s_not_found); | |
4988 Py_CLEAR(clear_module_state->__pyx_n_s_infile); | |
4989 Py_CLEAR(clear_module_state->__pyx_n_s_init); | |
4990 Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); | |
4991 Py_CLEAR(clear_module_state->__pyx_n_s_initializing); | |
4992 Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_file_opening_mode_s); | |
4993 Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); | |
4994 Py_CLEAR(clear_module_state->__pyx_n_s_is_empty); | |
4995 Py_CLEAR(clear_module_state->__pyx_n_s_is_open); | |
4996 Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); | |
4997 Py_CLEAR(clear_module_state->__pyx_n_s_iter); | |
4998 Py_CLEAR(clear_module_state->__pyx_kp_s_iterate_over_infile_Permits_the); | |
4999 Py_CLEAR(clear_module_state->__pyx_kp_u_iteration_on_closed_file); | |
5000 Py_CLEAR(clear_module_state->__pyx_n_s_itr); | |
5001 Py_CLEAR(clear_module_state->__pyx_n_s_keep_original); | |
5002 Py_CLEAR(clear_module_state->__pyx_n_s_keys); | |
5003 Py_CLEAR(clear_module_state->__pyx_n_s_length); | |
5004 Py_CLEAR(clear_module_state->__pyx_n_s_line); | |
5005 Py_CLEAR(clear_module_state->__pyx_n_s_line_skip); | |
5006 Py_CLEAR(clear_module_state->__pyx_n_s_main); | |
5007 Py_CLEAR(clear_module_state->__pyx_n_s_meta_char); | |
5008 Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); | |
5009 Py_CLEAR(clear_module_state->__pyx_n_s_min_shift); | |
5010 Py_CLEAR(clear_module_state->__pyx_n_s_mode); | |
5011 Py_CLEAR(clear_module_state->__pyx_n_s_module); | |
5012 Py_CLEAR(clear_module_state->__pyx_n_s_multiple_iterators); | |
5013 Py_CLEAR(clear_module_state->__pyx_n_s_name); | |
5014 Py_CLEAR(clear_module_state->__pyx_n_s_nbytes); | |
5015 Py_CLEAR(clear_module_state->__pyx_kp_u_neither_preset_nor_seq_col_start); | |
5016 Py_CLEAR(clear_module_state->__pyx_n_s_new); | |
5017 Py_CLEAR(clear_module_state->__pyx_n_s_next); | |
5018 Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); | |
5019 Py_CLEAR(clear_module_state->__pyx_n_s_open); | |
5020 Py_CLEAR(clear_module_state->__pyx_n_s_os); | |
5021 Py_CLEAR(clear_module_state->__pyx_kp_u_parse_method_of_s_not_implemente); | |
5022 Py_CLEAR(clear_module_state->__pyx_n_s_parser); | |
5023 Py_CLEAR(clear_module_state->__pyx_n_s_path); | |
5024 Py_CLEAR(clear_module_state->__pyx_n_s_pickle); | |
5025 Py_CLEAR(clear_module_state->__pyx_n_s_prepare); | |
5026 Py_CLEAR(clear_module_state->__pyx_n_s_preset); | |
5027 Py_CLEAR(clear_module_state->__pyx_n_s_preset2conf); | |
5028 Py_CLEAR(clear_module_state->__pyx_n_u_psltbl); | |
5029 Py_CLEAR(clear_module_state->__pyx_n_s_pysam_libctabix); | |
5030 Py_CLEAR(clear_module_state->__pyx_kp_s_pysam_libctabix_pyx); | |
5031 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError); | |
5032 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum); | |
5033 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result); | |
5034 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); | |
5035 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type); | |
5036 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Parser); | |
5037 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_asBed); | |
5038 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_asGFF3); | |
5039 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_asGTF); | |
5040 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_asTuple); | |
5041 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_asVCF); | |
5042 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); | |
5043 Py_CLEAR(clear_module_state->__pyx_n_s_qualname); | |
5044 Py_CLEAR(clear_module_state->__pyx_n_s_r); | |
5045 Py_CLEAR(clear_module_state->__pyx_n_u_r); | |
5046 Py_CLEAR(clear_module_state->__pyx_n_s_readline); | |
5047 Py_CLEAR(clear_module_state->__pyx_n_s_reduce); | |
5048 Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); | |
5049 Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); | |
5050 Py_CLEAR(clear_module_state->__pyx_n_s_reference); | |
5051 Py_CLEAR(clear_module_state->__pyx_n_s_region); | |
5052 Py_CLEAR(clear_module_state->__pyx_n_s_retval); | |
5053 Py_CLEAR(clear_module_state->__pyx_kp_u_s); | |
5054 Py_CLEAR(clear_module_state->__pyx_n_s_s_2); | |
5055 Py_CLEAR(clear_module_state->__pyx_kp_u_s_i); | |
5056 Py_CLEAR(clear_module_state->__pyx_kp_u_s_i_i); | |
5057 Py_CLEAR(clear_module_state->__pyx_n_u_sam); | |
5058 Py_CLEAR(clear_module_state->__pyx_n_s_self); | |
5059 Py_CLEAR(clear_module_state->__pyx_kp_s_self_gzipfile_self_kstream_canno); | |
5060 Py_CLEAR(clear_module_state->__pyx_kp_s_self_iterator_cannot_be_converte); | |
5061 Py_CLEAR(clear_module_state->__pyx_n_s_seq_col); | |
5062 Py_CLEAR(clear_module_state->__pyx_n_s_set_encoding); | |
5063 Py_CLEAR(clear_module_state->__pyx_n_s_set_name); | |
5064 Py_CLEAR(clear_module_state->__pyx_n_s_setstate); | |
5065 Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); | |
5066 Py_CLEAR(clear_module_state->__pyx_n_s_spec); | |
5067 Py_CLEAR(clear_module_state->__pyx_n_s_start); | |
5068 Py_CLEAR(clear_module_state->__pyx_n_s_start_col); | |
5069 Py_CLEAR(clear_module_state->__pyx_kp_u_start_i_end_i); | |
5070 Py_CLEAR(clear_module_state->__pyx_kp_u_start_out_of_range_i); | |
5071 Py_CLEAR(clear_module_state->__pyx_n_s_state); | |
5072 Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); | |
5073 Py_CLEAR(clear_module_state->__pyx_n_s_suffix); | |
5074 Py_CLEAR(clear_module_state->__pyx_n_s_super); | |
5075 Py_CLEAR(clear_module_state->__pyx_n_s_sys); | |
5076 Py_CLEAR(clear_module_state->__pyx_n_s_tabix_compress); | |
5077 Py_CLEAR(clear_module_state->__pyx_n_u_tabix_compress); | |
5078 Py_CLEAR(clear_module_state->__pyx_n_s_tabix_file_iterator); | |
5079 Py_CLEAR(clear_module_state->__pyx_n_u_tabix_file_iterator); | |
5080 Py_CLEAR(clear_module_state->__pyx_n_s_tabix_file_iterator___reduce_cyt); | |
5081 Py_CLEAR(clear_module_state->__pyx_n_s_tabix_file_iterator___setstate_c); | |
5082 Py_CLEAR(clear_module_state->__pyx_n_s_tabix_generic_iterator); | |
5083 Py_CLEAR(clear_module_state->__pyx_n_u_tabix_generic_iterator); | |
5084 Py_CLEAR(clear_module_state->__pyx_n_s_tabix_generic_iterator___init); | |
5085 Py_CLEAR(clear_module_state->__pyx_n_s_tabix_generic_iterator___iter); | |
5086 Py_CLEAR(clear_module_state->__pyx_n_s_tabix_generic_iterator___next); | |
5087 Py_CLEAR(clear_module_state->__pyx_n_s_tabix_index); | |
5088 Py_CLEAR(clear_module_state->__pyx_n_u_tabix_index); | |
5089 Py_CLEAR(clear_module_state->__pyx_n_s_tabix_iterator); | |
5090 Py_CLEAR(clear_module_state->__pyx_n_u_tabix_iterator); | |
5091 Py_CLEAR(clear_module_state->__pyx_kp_u_tbi); | |
5092 Py_CLEAR(clear_module_state->__pyx_n_s_tell); | |
5093 Py_CLEAR(clear_module_state->__pyx_n_s_test); | |
5094 Py_CLEAR(clear_module_state->__pyx_n_s_threads); | |
5095 Py_CLEAR(clear_module_state->__pyx_kp_u_unknown_preset); | |
5096 Py_CLEAR(clear_module_state->__pyx_n_s_unlink); | |
5097 Py_CLEAR(clear_module_state->__pyx_n_s_update); | |
5098 Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate); | |
5099 Py_CLEAR(clear_module_state->__pyx_kp_u_valid_presets_are); | |
5100 Py_CLEAR(clear_module_state->__pyx_n_u_vcf); | |
5101 Py_CLEAR(clear_module_state->__pyx_kp_u_writing_failed); | |
5102 Py_CLEAR(clear_module_state->__pyx_n_s_zerobased); | |
5103 Py_CLEAR(clear_module_state->__pyx_int_0); | |
5104 Py_CLEAR(clear_module_state->__pyx_int_1); | |
5105 Py_CLEAR(clear_module_state->__pyx_int_2); | |
5106 Py_CLEAR(clear_module_state->__pyx_int_3); | |
5107 Py_CLEAR(clear_module_state->__pyx_int_4); | |
5108 Py_CLEAR(clear_module_state->__pyx_int_5); | |
5109 Py_CLEAR(clear_module_state->__pyx_int_15); | |
5110 Py_CLEAR(clear_module_state->__pyx_int_17); | |
5111 Py_CLEAR(clear_module_state->__pyx_int_18); | |
5112 Py_CLEAR(clear_module_state->__pyx_int_35); | |
5113 Py_CLEAR(clear_module_state->__pyx_int_64); | |
5114 Py_CLEAR(clear_module_state->__pyx_int_21667264); | |
5115 Py_CLEAR(clear_module_state->__pyx_int_139192863); | |
5116 Py_CLEAR(clear_module_state->__pyx_int_243541226); | |
5117 Py_CLEAR(clear_module_state->__pyx_int_neg_1); | |
5118 Py_CLEAR(clear_module_state->__pyx_codeobj_); | |
5119 Py_CLEAR(clear_module_state->__pyx_tuple__19); | |
5120 Py_CLEAR(clear_module_state->__pyx_tuple__20); | |
5121 Py_CLEAR(clear_module_state->__pyx_tuple__24); | |
5122 Py_CLEAR(clear_module_state->__pyx_tuple__38); | |
5123 Py_CLEAR(clear_module_state->__pyx_tuple__41); | |
5124 Py_CLEAR(clear_module_state->__pyx_tuple__45); | |
5125 Py_CLEAR(clear_module_state->__pyx_tuple__55); | |
5126 Py_CLEAR(clear_module_state->__pyx_tuple__63); | |
5127 Py_CLEAR(clear_module_state->__pyx_tuple__64); | |
5128 Py_CLEAR(clear_module_state->__pyx_tuple__65); | |
5129 Py_CLEAR(clear_module_state->__pyx_tuple__66); | |
5130 Py_CLEAR(clear_module_state->__pyx_tuple__67); | |
5131 Py_CLEAR(clear_module_state->__pyx_tuple__68); | |
5132 Py_CLEAR(clear_module_state->__pyx_tuple__69); | |
5133 Py_CLEAR(clear_module_state->__pyx_tuple__70); | |
5134 Py_CLEAR(clear_module_state->__pyx_tuple__71); | |
5135 Py_CLEAR(clear_module_state->__pyx_tuple__72); | |
5136 Py_CLEAR(clear_module_state->__pyx_tuple__73); | |
5137 Py_CLEAR(clear_module_state->__pyx_tuple__74); | |
5138 Py_CLEAR(clear_module_state->__pyx_tuple__75); | |
5139 Py_CLEAR(clear_module_state->__pyx_tuple__76); | |
5140 Py_CLEAR(clear_module_state->__pyx_tuple__77); | |
5141 Py_CLEAR(clear_module_state->__pyx_codeobj__2); | |
5142 Py_CLEAR(clear_module_state->__pyx_codeobj__3); | |
5143 Py_CLEAR(clear_module_state->__pyx_codeobj__4); | |
5144 Py_CLEAR(clear_module_state->__pyx_codeobj__5); | |
5145 Py_CLEAR(clear_module_state->__pyx_codeobj__6); | |
5146 Py_CLEAR(clear_module_state->__pyx_codeobj__7); | |
5147 Py_CLEAR(clear_module_state->__pyx_codeobj__8); | |
5148 Py_CLEAR(clear_module_state->__pyx_codeobj__9); | |
5149 Py_CLEAR(clear_module_state->__pyx_codeobj__10); | |
5150 Py_CLEAR(clear_module_state->__pyx_codeobj__11); | |
5151 Py_CLEAR(clear_module_state->__pyx_codeobj__12); | |
5152 Py_CLEAR(clear_module_state->__pyx_codeobj__13); | |
5153 Py_CLEAR(clear_module_state->__pyx_codeobj__14); | |
5154 Py_CLEAR(clear_module_state->__pyx_codeobj__15); | |
5155 Py_CLEAR(clear_module_state->__pyx_codeobj__17); | |
5156 Py_CLEAR(clear_module_state->__pyx_codeobj__18); | |
5157 Py_CLEAR(clear_module_state->__pyx_codeobj__21); | |
5158 Py_CLEAR(clear_module_state->__pyx_codeobj__22); | |
5159 Py_CLEAR(clear_module_state->__pyx_codeobj__23); | |
5160 Py_CLEAR(clear_module_state->__pyx_codeobj__25); | |
5161 Py_CLEAR(clear_module_state->__pyx_codeobj__26); | |
5162 Py_CLEAR(clear_module_state->__pyx_codeobj__27); | |
5163 Py_CLEAR(clear_module_state->__pyx_codeobj__28); | |
5164 Py_CLEAR(clear_module_state->__pyx_codeobj__29); | |
5165 Py_CLEAR(clear_module_state->__pyx_codeobj__30); | |
5166 Py_CLEAR(clear_module_state->__pyx_codeobj__31); | |
5167 Py_CLEAR(clear_module_state->__pyx_codeobj__32); | |
5168 Py_CLEAR(clear_module_state->__pyx_codeobj__33); | |
5169 Py_CLEAR(clear_module_state->__pyx_codeobj__34); | |
5170 Py_CLEAR(clear_module_state->__pyx_codeobj__35); | |
5171 Py_CLEAR(clear_module_state->__pyx_codeobj__36); | |
5172 Py_CLEAR(clear_module_state->__pyx_codeobj__37); | |
5173 Py_CLEAR(clear_module_state->__pyx_codeobj__40); | |
5174 Py_CLEAR(clear_module_state->__pyx_codeobj__46); | |
5175 Py_CLEAR(clear_module_state->__pyx_codeobj__47); | |
5176 Py_CLEAR(clear_module_state->__pyx_codeobj__48); | |
5177 Py_CLEAR(clear_module_state->__pyx_codeobj__49); | |
5178 Py_CLEAR(clear_module_state->__pyx_codeobj__50); | |
5179 Py_CLEAR(clear_module_state->__pyx_codeobj__51); | |
5180 Py_CLEAR(clear_module_state->__pyx_codeobj__52); | |
5181 Py_CLEAR(clear_module_state->__pyx_codeobj__53); | |
5182 Py_CLEAR(clear_module_state->__pyx_codeobj__54); | |
5183 Py_CLEAR(clear_module_state->__pyx_codeobj__57); | |
5184 Py_CLEAR(clear_module_state->__pyx_codeobj__58); | |
5185 Py_CLEAR(clear_module_state->__pyx_codeobj__59); | |
5186 Py_CLEAR(clear_module_state->__pyx_codeobj__60); | |
5187 Py_CLEAR(clear_module_state->__pyx_codeobj__61); | |
5188 return 0; | |
5189 } | |
5190 #endif | |
5191 /* #### Code section: module_state_traverse ### */ | |
5192 #if CYTHON_USE_MODULE_STATE | |
5193 static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { | |
5194 __pyx_mstate *traverse_module_state = __pyx_mstate(m); | |
5195 if (!traverse_module_state) return 0; | |
5196 Py_VISIT(traverse_module_state->__pyx_d); | |
5197 Py_VISIT(traverse_module_state->__pyx_b); | |
5198 Py_VISIT(traverse_module_state->__pyx_cython_runtime); | |
5199 Py_VISIT(traverse_module_state->__pyx_empty_tuple); | |
5200 Py_VISIT(traverse_module_state->__pyx_empty_bytes); | |
5201 Py_VISIT(traverse_module_state->__pyx_empty_unicode); | |
5202 #ifdef __Pyx_CyFunction_USED | |
5203 Py_VISIT(traverse_module_state->__pyx_CyFunctionType); | |
5204 #endif | |
5205 #ifdef __Pyx_FusedFunction_USED | |
5206 Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); | |
5207 #endif | |
5208 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_10libchtslib_HTSFile); | |
5209 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); | |
5210 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool); | |
5211 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex); | |
5212 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_16libctabixproxies_TupleProxy); | |
5213 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_16libctabixproxies_TupleProxyIterator); | |
5214 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_16libctabixproxies_NamedTupleProxy); | |
5215 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_16libctabixproxies_GTFProxy); | |
5216 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy); | |
5217 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_16libctabixproxies_BedProxy); | |
5218 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_16libctabixproxies_VCFProxy); | |
5219 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_5array_array); | |
5220 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_tabix_file_iterator); | |
5221 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libctabix_tabix_file_iterator); | |
5222 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_TabixFile); | |
5223 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libctabix_TabixFile); | |
5224 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_Parser); | |
5225 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libctabix_Parser); | |
5226 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_asTuple); | |
5227 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libctabix_asTuple); | |
5228 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_asGTF); | |
5229 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libctabix_asGTF); | |
5230 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_asGFF3); | |
5231 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libctabix_asGFF3); | |
5232 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_asBed); | |
5233 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libctabix_asBed); | |
5234 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_asVCF); | |
5235 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libctabix_asVCF); | |
5236 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_TabixIterator); | |
5237 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libctabix_TabixIterator); | |
5238 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed); | |
5239 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libctabix_TabixIteratorParsed); | |
5240 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_GZIterator); | |
5241 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libctabix_GZIterator); | |
5242 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_GZIteratorHead); | |
5243 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libctabix_GZIteratorHead); | |
5244 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_GZIteratorParsed); | |
5245 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libctabix_GZIteratorParsed); | |
5246 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libctabix_Tabixfile); | |
5247 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libctabix_Tabixfile); | |
5248 Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); | |
5249 Py_VISIT(traverse_module_state->__pyx_kp_u_Could_not_open_file); | |
5250 Py_VISIT(traverse_module_state->__pyx_n_s_EmptyIterator); | |
5251 Py_VISIT(traverse_module_state->__pyx_n_s_EmptyIterator___iter); | |
5252 Py_VISIT(traverse_module_state->__pyx_n_s_EmptyIterator___next); | |
5253 Py_VISIT(traverse_module_state->__pyx_kp_u_Filename_s_already_exists_use_fo); | |
5254 Py_VISIT(traverse_module_state->__pyx_n_s_GZIterator); | |
5255 Py_VISIT(traverse_module_state->__pyx_n_u_GZIterator); | |
5256 Py_VISIT(traverse_module_state->__pyx_n_s_GZIteratorHead); | |
5257 Py_VISIT(traverse_module_state->__pyx_n_u_GZIteratorHead); | |
5258 Py_VISIT(traverse_module_state->__pyx_n_s_GZIteratorHead___reduce_cython); | |
5259 Py_VISIT(traverse_module_state->__pyx_n_s_GZIteratorHead___setstate_cython); | |
5260 Py_VISIT(traverse_module_state->__pyx_n_s_GZIteratorParsed); | |
5261 Py_VISIT(traverse_module_state->__pyx_n_s_GZIteratorParsed___reduce_cython); | |
5262 Py_VISIT(traverse_module_state->__pyx_n_s_GZIteratorParsed___setstate_cyth); | |
5263 Py_VISIT(traverse_module_state->__pyx_n_s_GZIterator___reduce_cython); | |
5264 Py_VISIT(traverse_module_state->__pyx_n_s_GZIterator___setstate_cython); | |
5265 Py_VISIT(traverse_module_state->__pyx_n_s_IOError); | |
5266 Py_VISIT(traverse_module_state->__pyx_kp_u_I_O_operation_on_closed_file); | |
5267 Py_VISIT(traverse_module_state->__pyx_kp_u_I_O_operation_on_closed_file_2); | |
5268 Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); | |
5269 Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); | |
5270 Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError); | |
5271 Py_VISIT(traverse_module_state->__pyx_kp_u_No_such_file_or_directory_s); | |
5272 Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError); | |
5273 Py_VISIT(traverse_module_state->__pyx_n_s_OSError); | |
5274 Py_VISIT(traverse_module_state->__pyx_n_s_O_RDONLY); | |
5275 Py_VISIT(traverse_module_state->__pyx_n_s_Parser); | |
5276 Py_VISIT(traverse_module_state->__pyx_n_s_Parser___reduce_cython); | |
5277 Py_VISIT(traverse_module_state->__pyx_n_s_Parser___setstate_cython); | |
5278 Py_VISIT(traverse_module_state->__pyx_n_s_Parser_get_encoding); | |
5279 Py_VISIT(traverse_module_state->__pyx_n_s_Parser_set_encoding); | |
5280 Py_VISIT(traverse_module_state->__pyx_n_s_PickleError); | |
5281 Py_VISIT(traverse_module_state->__pyx_n_s_StopIteration); | |
5282 Py_VISIT(traverse_module_state->__pyx_n_s_TabixFile); | |
5283 Py_VISIT(traverse_module_state->__pyx_n_u_TabixFile); | |
5284 Py_VISIT(traverse_module_state->__pyx_n_s_TabixFile___reduce_cython); | |
5285 Py_VISIT(traverse_module_state->__pyx_n_s_TabixFile___setstate_cython); | |
5286 Py_VISIT(traverse_module_state->__pyx_n_s_TabixFile__dup); | |
5287 Py_VISIT(traverse_module_state->__pyx_n_s_TabixFile__open); | |
5288 Py_VISIT(traverse_module_state->__pyx_n_s_TabixFile_close); | |
5289 Py_VISIT(traverse_module_state->__pyx_n_s_TabixFile_fetch); | |
5290 Py_VISIT(traverse_module_state->__pyx_n_s_TabixIterator); | |
5291 Py_VISIT(traverse_module_state->__pyx_n_s_TabixIteratorParsed); | |
5292 Py_VISIT(traverse_module_state->__pyx_n_s_TabixIteratorParsed___reduce_cyt); | |
5293 Py_VISIT(traverse_module_state->__pyx_n_s_TabixIteratorParsed___setstate_c); | |
5294 Py_VISIT(traverse_module_state->__pyx_n_s_TabixIterator___reduce_cython); | |
5295 Py_VISIT(traverse_module_state->__pyx_n_s_TabixIterator___setstate_cython); | |
5296 Py_VISIT(traverse_module_state->__pyx_n_s_Tabixfile); | |
5297 Py_VISIT(traverse_module_state->__pyx_n_u_Tabixfile); | |
5298 Py_VISIT(traverse_module_state->__pyx_n_s_Tabixfile___reduce_cython); | |
5299 Py_VISIT(traverse_module_state->__pyx_n_s_Tabixfile___setstate_cython); | |
5300 Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); | |
5301 Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); | |
5302 Py_VISIT(traverse_module_state->__pyx_n_s_WINDOW_SIZE); | |
5303 Py_VISIT(traverse_module_state->__pyx_kp_b__16); | |
5304 Py_VISIT(traverse_module_state->__pyx_kp_u__39); | |
5305 Py_VISIT(traverse_module_state->__pyx_kp_u__42); | |
5306 Py_VISIT(traverse_module_state->__pyx_kp_u__43); | |
5307 Py_VISIT(traverse_module_state->__pyx_kp_u__44); | |
5308 Py_VISIT(traverse_module_state->__pyx_kp_u__56); | |
5309 Py_VISIT(traverse_module_state->__pyx_n_s__62); | |
5310 Py_VISIT(traverse_module_state->__pyx_n_s__78); | |
5311 Py_VISIT(traverse_module_state->__pyx_n_s_a); | |
5312 Py_VISIT(traverse_module_state->__pyx_n_s_all); | |
5313 Py_VISIT(traverse_module_state->__pyx_n_s_asBed); | |
5314 Py_VISIT(traverse_module_state->__pyx_n_u_asBed); | |
5315 Py_VISIT(traverse_module_state->__pyx_n_s_asBed___reduce_cython); | |
5316 Py_VISIT(traverse_module_state->__pyx_n_s_asBed___setstate_cython); | |
5317 Py_VISIT(traverse_module_state->__pyx_n_s_asGFF3); | |
5318 Py_VISIT(traverse_module_state->__pyx_n_u_asGFF3); | |
5319 Py_VISIT(traverse_module_state->__pyx_n_s_asGFF3___reduce_cython); | |
5320 Py_VISIT(traverse_module_state->__pyx_n_s_asGFF3___setstate_cython); | |
5321 Py_VISIT(traverse_module_state->__pyx_n_s_asGTF); | |
5322 Py_VISIT(traverse_module_state->__pyx_n_u_asGTF); | |
5323 Py_VISIT(traverse_module_state->__pyx_n_s_asGTF___reduce_cython); | |
5324 Py_VISIT(traverse_module_state->__pyx_n_s_asGTF___setstate_cython); | |
5325 Py_VISIT(traverse_module_state->__pyx_n_s_asTuple); | |
5326 Py_VISIT(traverse_module_state->__pyx_n_u_asTuple); | |
5327 Py_VISIT(traverse_module_state->__pyx_n_s_asTuple___reduce_cython); | |
5328 Py_VISIT(traverse_module_state->__pyx_n_s_asTuple___setstate_cython); | |
5329 Py_VISIT(traverse_module_state->__pyx_n_s_asVCF); | |
5330 Py_VISIT(traverse_module_state->__pyx_n_u_asVCF); | |
5331 Py_VISIT(traverse_module_state->__pyx_n_s_asVCF___reduce_cython); | |
5332 Py_VISIT(traverse_module_state->__pyx_n_s_asVCF___setstate_cython); | |
5333 Py_VISIT(traverse_module_state->__pyx_n_u_ascii); | |
5334 Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); | |
5335 Py_VISIT(traverse_module_state->__pyx_n_s_b); | |
5336 Py_VISIT(traverse_module_state->__pyx_n_u_bcf); | |
5337 Py_VISIT(traverse_module_state->__pyx_n_u_bed); | |
5338 Py_VISIT(traverse_module_state->__pyx_n_s_buffer); | |
5339 Py_VISIT(traverse_module_state->__pyx_n_s_buffer_size); | |
5340 Py_VISIT(traverse_module_state->__pyx_kp_u_building_of_index_for_failed); | |
5341 Py_VISIT(traverse_module_state->__pyx_n_s_bytes_cpy); | |
5342 Py_VISIT(traverse_module_state->__pyx_n_s_c); | |
5343 Py_VISIT(traverse_module_state->__pyx_n_s_cfilename); | |
5344 Py_VISIT(traverse_module_state->__pyx_n_s_cfilename_index); | |
5345 Py_VISIT(traverse_module_state->__pyx_n_s_cfn); | |
5346 Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); | |
5347 Py_VISIT(traverse_module_state->__pyx_n_s_close); | |
5348 Py_VISIT(traverse_module_state->__pyx_n_s_closed); | |
5349 Py_VISIT(traverse_module_state->__pyx_n_s_conf); | |
5350 Py_VISIT(traverse_module_state->__pyx_n_s_conf_data); | |
5351 Py_VISIT(traverse_module_state->__pyx_n_s_contigs); | |
5352 Py_VISIT(traverse_module_state->__pyx_kp_u_could_not_create_iterator_for_re); | |
5353 Py_VISIT(traverse_module_state->__pyx_kp_u_could_not_create_iterator_possib); | |
5354 Py_VISIT(traverse_module_state->__pyx_kp_u_could_not_load_tbi_csi_index_of); | |
5355 Py_VISIT(traverse_module_state->__pyx_kp_u_could_not_open_file_s); | |
5356 Py_VISIT(traverse_module_state->__pyx_kp_u_could_not_open_for_reading_heade); | |
5357 Py_VISIT(traverse_module_state->__pyx_kp_u_could_not_open_index_for_s); | |
5358 Py_VISIT(traverse_module_state->__pyx_kp_u_could_not_open_s_for_reading); | |
5359 Py_VISIT(traverse_module_state->__pyx_kp_u_could_not_open_s_for_writing); | |
5360 Py_VISIT(traverse_module_state->__pyx_n_s_cpy); | |
5361 Py_VISIT(traverse_module_state->__pyx_n_s_csi); | |
5362 Py_VISIT(traverse_module_state->__pyx_kp_u_csi_2); | |
5363 Py_VISIT(traverse_module_state->__pyx_n_s_cstr); | |
5364 Py_VISIT(traverse_module_state->__pyx_n_s_dict); | |
5365 Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); | |
5366 Py_VISIT(traverse_module_state->__pyx_kp_u_disable); | |
5367 Py_VISIT(traverse_module_state->__pyx_n_s_doc); | |
5368 Py_VISIT(traverse_module_state->__pyx_n_s_dup); | |
5369 Py_VISIT(traverse_module_state->__pyx_kp_s_empty_iterator); | |
5370 Py_VISIT(traverse_module_state->__pyx_kp_u_enable); | |
5371 Py_VISIT(traverse_module_state->__pyx_n_s_encoding); | |
5372 Py_VISIT(traverse_module_state->__pyx_n_s_end); | |
5373 Py_VISIT(traverse_module_state->__pyx_n_s_end_col); | |
5374 Py_VISIT(traverse_module_state->__pyx_kp_u_end_out_of_range_i); | |
5375 Py_VISIT(traverse_module_state->__pyx_kp_u_error_i_when_closing_file_s); | |
5376 Py_VISIT(traverse_module_state->__pyx_kp_u_error_i_when_writing_to_file_s); | |
5377 Py_VISIT(traverse_module_state->__pyx_n_s_exists); | |
5378 Py_VISIT(traverse_module_state->__pyx_n_s_fd_src); | |
5379 Py_VISIT(traverse_module_state->__pyx_n_s_fetch); | |
5380 Py_VISIT(traverse_module_state->__pyx_kp_u_file_s_not_found); | |
5381 Py_VISIT(traverse_module_state->__pyx_n_s_filename); | |
5382 Py_VISIT(traverse_module_state->__pyx_n_s_filename_in); | |
5383 Py_VISIT(traverse_module_state->__pyx_n_s_filename_index); | |
5384 Py_VISIT(traverse_module_state->__pyx_n_s_filename_out); | |
5385 Py_VISIT(traverse_module_state->__pyx_kp_u_filename_s_already_exists_use_fo); | |
5386 Py_VISIT(traverse_module_state->__pyx_n_s_fileobj); | |
5387 Py_VISIT(traverse_module_state->__pyx_n_s_fmt); | |
5388 Py_VISIT(traverse_module_state->__pyx_n_s_fn); | |
5389 Py_VISIT(traverse_module_state->__pyx_n_s_fn_index); | |
5390 Py_VISIT(traverse_module_state->__pyx_n_s_fnidx); | |
5391 Py_VISIT(traverse_module_state->__pyx_n_s_force); | |
5392 Py_VISIT(traverse_module_state->__pyx_n_s_format); | |
5393 Py_VISIT(traverse_module_state->__pyx_n_s_fp); | |
5394 Py_VISIT(traverse_module_state->__pyx_kp_u_gc); | |
5395 Py_VISIT(traverse_module_state->__pyx_n_s_get_encoding); | |
5396 Py_VISIT(traverse_module_state->__pyx_n_s_getstate); | |
5397 Py_VISIT(traverse_module_state->__pyx_n_u_gff); | |
5398 Py_VISIT(traverse_module_state->__pyx_kp_u_gz); | |
5399 Py_VISIT(traverse_module_state->__pyx_n_s_import); | |
5400 Py_VISIT(traverse_module_state->__pyx_kp_u_incomplete_line_at_s); | |
5401 Py_VISIT(traverse_module_state->__pyx_n_s_index); | |
5402 Py_VISIT(traverse_module_state->__pyx_kp_u_index_s_not_found); | |
5403 Py_VISIT(traverse_module_state->__pyx_n_s_infile); | |
5404 Py_VISIT(traverse_module_state->__pyx_n_s_init); | |
5405 Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); | |
5406 Py_VISIT(traverse_module_state->__pyx_n_s_initializing); | |
5407 Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_file_opening_mode_s); | |
5408 Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); | |
5409 Py_VISIT(traverse_module_state->__pyx_n_s_is_empty); | |
5410 Py_VISIT(traverse_module_state->__pyx_n_s_is_open); | |
5411 Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); | |
5412 Py_VISIT(traverse_module_state->__pyx_n_s_iter); | |
5413 Py_VISIT(traverse_module_state->__pyx_kp_s_iterate_over_infile_Permits_the); | |
5414 Py_VISIT(traverse_module_state->__pyx_kp_u_iteration_on_closed_file); | |
5415 Py_VISIT(traverse_module_state->__pyx_n_s_itr); | |
5416 Py_VISIT(traverse_module_state->__pyx_n_s_keep_original); | |
5417 Py_VISIT(traverse_module_state->__pyx_n_s_keys); | |
5418 Py_VISIT(traverse_module_state->__pyx_n_s_length); | |
5419 Py_VISIT(traverse_module_state->__pyx_n_s_line); | |
5420 Py_VISIT(traverse_module_state->__pyx_n_s_line_skip); | |
5421 Py_VISIT(traverse_module_state->__pyx_n_s_main); | |
5422 Py_VISIT(traverse_module_state->__pyx_n_s_meta_char); | |
5423 Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); | |
5424 Py_VISIT(traverse_module_state->__pyx_n_s_min_shift); | |
5425 Py_VISIT(traverse_module_state->__pyx_n_s_mode); | |
5426 Py_VISIT(traverse_module_state->__pyx_n_s_module); | |
5427 Py_VISIT(traverse_module_state->__pyx_n_s_multiple_iterators); | |
5428 Py_VISIT(traverse_module_state->__pyx_n_s_name); | |
5429 Py_VISIT(traverse_module_state->__pyx_n_s_nbytes); | |
5430 Py_VISIT(traverse_module_state->__pyx_kp_u_neither_preset_nor_seq_col_start); | |
5431 Py_VISIT(traverse_module_state->__pyx_n_s_new); | |
5432 Py_VISIT(traverse_module_state->__pyx_n_s_next); | |
5433 Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); | |
5434 Py_VISIT(traverse_module_state->__pyx_n_s_open); | |
5435 Py_VISIT(traverse_module_state->__pyx_n_s_os); | |
5436 Py_VISIT(traverse_module_state->__pyx_kp_u_parse_method_of_s_not_implemente); | |
5437 Py_VISIT(traverse_module_state->__pyx_n_s_parser); | |
5438 Py_VISIT(traverse_module_state->__pyx_n_s_path); | |
5439 Py_VISIT(traverse_module_state->__pyx_n_s_pickle); | |
5440 Py_VISIT(traverse_module_state->__pyx_n_s_prepare); | |
5441 Py_VISIT(traverse_module_state->__pyx_n_s_preset); | |
5442 Py_VISIT(traverse_module_state->__pyx_n_s_preset2conf); | |
5443 Py_VISIT(traverse_module_state->__pyx_n_u_psltbl); | |
5444 Py_VISIT(traverse_module_state->__pyx_n_s_pysam_libctabix); | |
5445 Py_VISIT(traverse_module_state->__pyx_kp_s_pysam_libctabix_pyx); | |
5446 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError); | |
5447 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum); | |
5448 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result); | |
5449 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); | |
5450 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type); | |
5451 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Parser); | |
5452 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_asBed); | |
5453 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_asGFF3); | |
5454 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_asGTF); | |
5455 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_asTuple); | |
5456 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_asVCF); | |
5457 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); | |
5458 Py_VISIT(traverse_module_state->__pyx_n_s_qualname); | |
5459 Py_VISIT(traverse_module_state->__pyx_n_s_r); | |
5460 Py_VISIT(traverse_module_state->__pyx_n_u_r); | |
5461 Py_VISIT(traverse_module_state->__pyx_n_s_readline); | |
5462 Py_VISIT(traverse_module_state->__pyx_n_s_reduce); | |
5463 Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); | |
5464 Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); | |
5465 Py_VISIT(traverse_module_state->__pyx_n_s_reference); | |
5466 Py_VISIT(traverse_module_state->__pyx_n_s_region); | |
5467 Py_VISIT(traverse_module_state->__pyx_n_s_retval); | |
5468 Py_VISIT(traverse_module_state->__pyx_kp_u_s); | |
5469 Py_VISIT(traverse_module_state->__pyx_n_s_s_2); | |
5470 Py_VISIT(traverse_module_state->__pyx_kp_u_s_i); | |
5471 Py_VISIT(traverse_module_state->__pyx_kp_u_s_i_i); | |
5472 Py_VISIT(traverse_module_state->__pyx_n_u_sam); | |
5473 Py_VISIT(traverse_module_state->__pyx_n_s_self); | |
5474 Py_VISIT(traverse_module_state->__pyx_kp_s_self_gzipfile_self_kstream_canno); | |
5475 Py_VISIT(traverse_module_state->__pyx_kp_s_self_iterator_cannot_be_converte); | |
5476 Py_VISIT(traverse_module_state->__pyx_n_s_seq_col); | |
5477 Py_VISIT(traverse_module_state->__pyx_n_s_set_encoding); | |
5478 Py_VISIT(traverse_module_state->__pyx_n_s_set_name); | |
5479 Py_VISIT(traverse_module_state->__pyx_n_s_setstate); | |
5480 Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); | |
5481 Py_VISIT(traverse_module_state->__pyx_n_s_spec); | |
5482 Py_VISIT(traverse_module_state->__pyx_n_s_start); | |
5483 Py_VISIT(traverse_module_state->__pyx_n_s_start_col); | |
5484 Py_VISIT(traverse_module_state->__pyx_kp_u_start_i_end_i); | |
5485 Py_VISIT(traverse_module_state->__pyx_kp_u_start_out_of_range_i); | |
5486 Py_VISIT(traverse_module_state->__pyx_n_s_state); | |
5487 Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); | |
5488 Py_VISIT(traverse_module_state->__pyx_n_s_suffix); | |
5489 Py_VISIT(traverse_module_state->__pyx_n_s_super); | |
5490 Py_VISIT(traverse_module_state->__pyx_n_s_sys); | |
5491 Py_VISIT(traverse_module_state->__pyx_n_s_tabix_compress); | |
5492 Py_VISIT(traverse_module_state->__pyx_n_u_tabix_compress); | |
5493 Py_VISIT(traverse_module_state->__pyx_n_s_tabix_file_iterator); | |
5494 Py_VISIT(traverse_module_state->__pyx_n_u_tabix_file_iterator); | |
5495 Py_VISIT(traverse_module_state->__pyx_n_s_tabix_file_iterator___reduce_cyt); | |
5496 Py_VISIT(traverse_module_state->__pyx_n_s_tabix_file_iterator___setstate_c); | |
5497 Py_VISIT(traverse_module_state->__pyx_n_s_tabix_generic_iterator); | |
5498 Py_VISIT(traverse_module_state->__pyx_n_u_tabix_generic_iterator); | |
5499 Py_VISIT(traverse_module_state->__pyx_n_s_tabix_generic_iterator___init); | |
5500 Py_VISIT(traverse_module_state->__pyx_n_s_tabix_generic_iterator___iter); | |
5501 Py_VISIT(traverse_module_state->__pyx_n_s_tabix_generic_iterator___next); | |
5502 Py_VISIT(traverse_module_state->__pyx_n_s_tabix_index); | |
5503 Py_VISIT(traverse_module_state->__pyx_n_u_tabix_index); | |
5504 Py_VISIT(traverse_module_state->__pyx_n_s_tabix_iterator); | |
5505 Py_VISIT(traverse_module_state->__pyx_n_u_tabix_iterator); | |
5506 Py_VISIT(traverse_module_state->__pyx_kp_u_tbi); | |
5507 Py_VISIT(traverse_module_state->__pyx_n_s_tell); | |
5508 Py_VISIT(traverse_module_state->__pyx_n_s_test); | |
5509 Py_VISIT(traverse_module_state->__pyx_n_s_threads); | |
5510 Py_VISIT(traverse_module_state->__pyx_kp_u_unknown_preset); | |
5511 Py_VISIT(traverse_module_state->__pyx_n_s_unlink); | |
5512 Py_VISIT(traverse_module_state->__pyx_n_s_update); | |
5513 Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate); | |
5514 Py_VISIT(traverse_module_state->__pyx_kp_u_valid_presets_are); | |
5515 Py_VISIT(traverse_module_state->__pyx_n_u_vcf); | |
5516 Py_VISIT(traverse_module_state->__pyx_kp_u_writing_failed); | |
5517 Py_VISIT(traverse_module_state->__pyx_n_s_zerobased); | |
5518 Py_VISIT(traverse_module_state->__pyx_int_0); | |
5519 Py_VISIT(traverse_module_state->__pyx_int_1); | |
5520 Py_VISIT(traverse_module_state->__pyx_int_2); | |
5521 Py_VISIT(traverse_module_state->__pyx_int_3); | |
5522 Py_VISIT(traverse_module_state->__pyx_int_4); | |
5523 Py_VISIT(traverse_module_state->__pyx_int_5); | |
5524 Py_VISIT(traverse_module_state->__pyx_int_15); | |
5525 Py_VISIT(traverse_module_state->__pyx_int_17); | |
5526 Py_VISIT(traverse_module_state->__pyx_int_18); | |
5527 Py_VISIT(traverse_module_state->__pyx_int_35); | |
5528 Py_VISIT(traverse_module_state->__pyx_int_64); | |
5529 Py_VISIT(traverse_module_state->__pyx_int_21667264); | |
5530 Py_VISIT(traverse_module_state->__pyx_int_139192863); | |
5531 Py_VISIT(traverse_module_state->__pyx_int_243541226); | |
5532 Py_VISIT(traverse_module_state->__pyx_int_neg_1); | |
5533 Py_VISIT(traverse_module_state->__pyx_codeobj_); | |
5534 Py_VISIT(traverse_module_state->__pyx_tuple__19); | |
5535 Py_VISIT(traverse_module_state->__pyx_tuple__20); | |
5536 Py_VISIT(traverse_module_state->__pyx_tuple__24); | |
5537 Py_VISIT(traverse_module_state->__pyx_tuple__38); | |
5538 Py_VISIT(traverse_module_state->__pyx_tuple__41); | |
5539 Py_VISIT(traverse_module_state->__pyx_tuple__45); | |
5540 Py_VISIT(traverse_module_state->__pyx_tuple__55); | |
5541 Py_VISIT(traverse_module_state->__pyx_tuple__63); | |
5542 Py_VISIT(traverse_module_state->__pyx_tuple__64); | |
5543 Py_VISIT(traverse_module_state->__pyx_tuple__65); | |
5544 Py_VISIT(traverse_module_state->__pyx_tuple__66); | |
5545 Py_VISIT(traverse_module_state->__pyx_tuple__67); | |
5546 Py_VISIT(traverse_module_state->__pyx_tuple__68); | |
5547 Py_VISIT(traverse_module_state->__pyx_tuple__69); | |
5548 Py_VISIT(traverse_module_state->__pyx_tuple__70); | |
5549 Py_VISIT(traverse_module_state->__pyx_tuple__71); | |
5550 Py_VISIT(traverse_module_state->__pyx_tuple__72); | |
5551 Py_VISIT(traverse_module_state->__pyx_tuple__73); | |
5552 Py_VISIT(traverse_module_state->__pyx_tuple__74); | |
5553 Py_VISIT(traverse_module_state->__pyx_tuple__75); | |
5554 Py_VISIT(traverse_module_state->__pyx_tuple__76); | |
5555 Py_VISIT(traverse_module_state->__pyx_tuple__77); | |
5556 Py_VISIT(traverse_module_state->__pyx_codeobj__2); | |
5557 Py_VISIT(traverse_module_state->__pyx_codeobj__3); | |
5558 Py_VISIT(traverse_module_state->__pyx_codeobj__4); | |
5559 Py_VISIT(traverse_module_state->__pyx_codeobj__5); | |
5560 Py_VISIT(traverse_module_state->__pyx_codeobj__6); | |
5561 Py_VISIT(traverse_module_state->__pyx_codeobj__7); | |
5562 Py_VISIT(traverse_module_state->__pyx_codeobj__8); | |
5563 Py_VISIT(traverse_module_state->__pyx_codeobj__9); | |
5564 Py_VISIT(traverse_module_state->__pyx_codeobj__10); | |
5565 Py_VISIT(traverse_module_state->__pyx_codeobj__11); | |
5566 Py_VISIT(traverse_module_state->__pyx_codeobj__12); | |
5567 Py_VISIT(traverse_module_state->__pyx_codeobj__13); | |
5568 Py_VISIT(traverse_module_state->__pyx_codeobj__14); | |
5569 Py_VISIT(traverse_module_state->__pyx_codeobj__15); | |
5570 Py_VISIT(traverse_module_state->__pyx_codeobj__17); | |
5571 Py_VISIT(traverse_module_state->__pyx_codeobj__18); | |
5572 Py_VISIT(traverse_module_state->__pyx_codeobj__21); | |
5573 Py_VISIT(traverse_module_state->__pyx_codeobj__22); | |
5574 Py_VISIT(traverse_module_state->__pyx_codeobj__23); | |
5575 Py_VISIT(traverse_module_state->__pyx_codeobj__25); | |
5576 Py_VISIT(traverse_module_state->__pyx_codeobj__26); | |
5577 Py_VISIT(traverse_module_state->__pyx_codeobj__27); | |
5578 Py_VISIT(traverse_module_state->__pyx_codeobj__28); | |
5579 Py_VISIT(traverse_module_state->__pyx_codeobj__29); | |
5580 Py_VISIT(traverse_module_state->__pyx_codeobj__30); | |
5581 Py_VISIT(traverse_module_state->__pyx_codeobj__31); | |
5582 Py_VISIT(traverse_module_state->__pyx_codeobj__32); | |
5583 Py_VISIT(traverse_module_state->__pyx_codeobj__33); | |
5584 Py_VISIT(traverse_module_state->__pyx_codeobj__34); | |
5585 Py_VISIT(traverse_module_state->__pyx_codeobj__35); | |
5586 Py_VISIT(traverse_module_state->__pyx_codeobj__36); | |
5587 Py_VISIT(traverse_module_state->__pyx_codeobj__37); | |
5588 Py_VISIT(traverse_module_state->__pyx_codeobj__40); | |
5589 Py_VISIT(traverse_module_state->__pyx_codeobj__46); | |
5590 Py_VISIT(traverse_module_state->__pyx_codeobj__47); | |
5591 Py_VISIT(traverse_module_state->__pyx_codeobj__48); | |
5592 Py_VISIT(traverse_module_state->__pyx_codeobj__49); | |
5593 Py_VISIT(traverse_module_state->__pyx_codeobj__50); | |
5594 Py_VISIT(traverse_module_state->__pyx_codeobj__51); | |
5595 Py_VISIT(traverse_module_state->__pyx_codeobj__52); | |
5596 Py_VISIT(traverse_module_state->__pyx_codeobj__53); | |
5597 Py_VISIT(traverse_module_state->__pyx_codeobj__54); | |
5598 Py_VISIT(traverse_module_state->__pyx_codeobj__57); | |
5599 Py_VISIT(traverse_module_state->__pyx_codeobj__58); | |
5600 Py_VISIT(traverse_module_state->__pyx_codeobj__59); | |
5601 Py_VISIT(traverse_module_state->__pyx_codeobj__60); | |
5602 Py_VISIT(traverse_module_state->__pyx_codeobj__61); | |
5603 return 0; | |
5604 } | |
5605 #endif | |
5606 /* #### Code section: module_state_defines ### */ | |
5607 #define __pyx_d __pyx_mstate_global->__pyx_d | |
5608 #define __pyx_b __pyx_mstate_global->__pyx_b | |
5609 #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime | |
5610 #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple | |
5611 #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes | |
5612 #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode | |
5613 #ifdef __Pyx_CyFunction_USED | |
5614 #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType | |
5615 #endif | |
5616 #ifdef __Pyx_FusedFunction_USED | |
5617 #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType | |
5618 #endif | |
5619 #ifdef __Pyx_Generator_USED | |
5620 #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType | |
5621 #endif | |
5622 #ifdef __Pyx_IterableCoroutine_USED | |
5623 #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType | |
5624 #endif | |
5625 #ifdef __Pyx_Coroutine_USED | |
5626 #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType | |
5627 #endif | |
5628 #ifdef __Pyx_Coroutine_USED | |
5629 #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType | |
5630 #endif | |
5631 #if CYTHON_USE_MODULE_STATE | |
5632 #endif | |
5633 #if CYTHON_USE_MODULE_STATE | |
5634 #endif | |
5635 #if CYTHON_USE_MODULE_STATE | |
5636 #endif | |
5637 #if CYTHON_USE_MODULE_STATE | |
5638 #endif | |
5639 #if CYTHON_USE_MODULE_STATE | |
5640 #endif | |
5641 #if CYTHON_USE_MODULE_STATE | |
5642 #endif | |
5643 #define __pyx_ptype_5pysam_10libchtslib_HTSFile __pyx_mstate_global->__pyx_ptype_5pysam_10libchtslib_HTSFile | |
5644 #if CYTHON_USE_MODULE_STATE | |
5645 #endif | |
5646 #if CYTHON_USE_MODULE_STATE | |
5647 #endif | |
5648 #if CYTHON_USE_MODULE_STATE | |
5649 #endif | |
5650 #if CYTHON_USE_MODULE_STATE | |
5651 #endif | |
5652 #if CYTHON_USE_MODULE_STATE | |
5653 #endif | |
5654 #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type | |
5655 #if CYTHON_USE_MODULE_STATE | |
5656 #endif | |
5657 #if CYTHON_USE_MODULE_STATE | |
5658 #endif | |
5659 #if CYTHON_USE_MODULE_STATE | |
5660 #endif | |
5661 #if CYTHON_USE_MODULE_STATE | |
5662 #endif | |
5663 #if CYTHON_USE_MODULE_STATE | |
5664 #endif | |
5665 #if CYTHON_USE_MODULE_STATE | |
5666 #endif | |
5667 #if CYTHON_USE_MODULE_STATE | |
5668 #endif | |
5669 #if CYTHON_USE_MODULE_STATE | |
5670 #endif | |
5671 #if CYTHON_USE_MODULE_STATE | |
5672 #endif | |
5673 #if CYTHON_USE_MODULE_STATE | |
5674 #endif | |
5675 #if CYTHON_USE_MODULE_STATE | |
5676 #endif | |
5677 #if CYTHON_USE_MODULE_STATE | |
5678 #endif | |
5679 #if CYTHON_USE_MODULE_STATE | |
5680 #endif | |
5681 #if CYTHON_USE_MODULE_STATE | |
5682 #endif | |
5683 #define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool | |
5684 #if CYTHON_USE_MODULE_STATE | |
5685 #endif | |
5686 #if CYTHON_USE_MODULE_STATE | |
5687 #endif | |
5688 #if CYTHON_USE_MODULE_STATE | |
5689 #endif | |
5690 #if CYTHON_USE_MODULE_STATE | |
5691 #endif | |
5692 #define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex | |
5693 #if CYTHON_USE_MODULE_STATE | |
5694 #endif | |
5695 #if CYTHON_USE_MODULE_STATE | |
5696 #endif | |
5697 #if CYTHON_USE_MODULE_STATE | |
5698 #endif | |
5699 #if CYTHON_USE_MODULE_STATE | |
5700 #endif | |
5701 #if CYTHON_USE_MODULE_STATE | |
5702 #endif | |
5703 #if CYTHON_USE_MODULE_STATE | |
5704 #endif | |
5705 #if CYTHON_USE_MODULE_STATE | |
5706 #endif | |
5707 #if CYTHON_USE_MODULE_STATE | |
5708 #endif | |
5709 #if CYTHON_USE_MODULE_STATE | |
5710 #endif | |
5711 #if CYTHON_USE_MODULE_STATE | |
5712 #endif | |
5713 #if CYTHON_USE_MODULE_STATE | |
5714 #endif | |
5715 #if CYTHON_USE_MODULE_STATE | |
5716 #endif | |
5717 #if CYTHON_USE_MODULE_STATE | |
5718 #endif | |
5719 #if CYTHON_USE_MODULE_STATE | |
5720 #endif | |
5721 #if CYTHON_USE_MODULE_STATE | |
5722 #endif | |
5723 #if CYTHON_USE_MODULE_STATE | |
5724 #endif | |
5725 #if CYTHON_USE_MODULE_STATE | |
5726 #endif | |
5727 #if CYTHON_USE_MODULE_STATE | |
5728 #endif | |
5729 #if CYTHON_USE_MODULE_STATE | |
5730 #endif | |
5731 #if CYTHON_USE_MODULE_STATE | |
5732 #endif | |
5733 #if CYTHON_USE_MODULE_STATE | |
5734 #endif | |
5735 #define __pyx_ptype_5pysam_16libctabixproxies_TupleProxy __pyx_mstate_global->__pyx_ptype_5pysam_16libctabixproxies_TupleProxy | |
5736 #define __pyx_ptype_5pysam_16libctabixproxies_TupleProxyIterator __pyx_mstate_global->__pyx_ptype_5pysam_16libctabixproxies_TupleProxyIterator | |
5737 #define __pyx_ptype_5pysam_16libctabixproxies_NamedTupleProxy __pyx_mstate_global->__pyx_ptype_5pysam_16libctabixproxies_NamedTupleProxy | |
5738 #define __pyx_ptype_5pysam_16libctabixproxies_GTFProxy __pyx_mstate_global->__pyx_ptype_5pysam_16libctabixproxies_GTFProxy | |
5739 #define __pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy __pyx_mstate_global->__pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy | |
5740 #define __pyx_ptype_5pysam_16libctabixproxies_BedProxy __pyx_mstate_global->__pyx_ptype_5pysam_16libctabixproxies_BedProxy | |
5741 #define __pyx_ptype_5pysam_16libctabixproxies_VCFProxy __pyx_mstate_global->__pyx_ptype_5pysam_16libctabixproxies_VCFProxy | |
5742 #if CYTHON_USE_MODULE_STATE | |
5743 #endif | |
5744 #if CYTHON_USE_MODULE_STATE | |
5745 #endif | |
5746 #if CYTHON_USE_MODULE_STATE | |
5747 #endif | |
5748 #define __pyx_ptype_7cpython_5array_array __pyx_mstate_global->__pyx_ptype_7cpython_5array_array | |
5749 #if CYTHON_USE_MODULE_STATE | |
5750 #endif | |
5751 #if CYTHON_USE_MODULE_STATE | |
5752 #define __pyx_type_5pysam_9libctabix_tabix_file_iterator __pyx_mstate_global->__pyx_type_5pysam_9libctabix_tabix_file_iterator | |
5753 #define __pyx_type_5pysam_9libctabix_TabixFile __pyx_mstate_global->__pyx_type_5pysam_9libctabix_TabixFile | |
5754 #define __pyx_type_5pysam_9libctabix_Parser __pyx_mstate_global->__pyx_type_5pysam_9libctabix_Parser | |
5755 #define __pyx_type_5pysam_9libctabix_asTuple __pyx_mstate_global->__pyx_type_5pysam_9libctabix_asTuple | |
5756 #define __pyx_type_5pysam_9libctabix_asGTF __pyx_mstate_global->__pyx_type_5pysam_9libctabix_asGTF | |
5757 #define __pyx_type_5pysam_9libctabix_asGFF3 __pyx_mstate_global->__pyx_type_5pysam_9libctabix_asGFF3 | |
5758 #define __pyx_type_5pysam_9libctabix_asBed __pyx_mstate_global->__pyx_type_5pysam_9libctabix_asBed | |
5759 #define __pyx_type_5pysam_9libctabix_asVCF __pyx_mstate_global->__pyx_type_5pysam_9libctabix_asVCF | |
5760 #define __pyx_type_5pysam_9libctabix_TabixIterator __pyx_mstate_global->__pyx_type_5pysam_9libctabix_TabixIterator | |
5761 #define __pyx_type_5pysam_9libctabix_TabixIteratorParsed __pyx_mstate_global->__pyx_type_5pysam_9libctabix_TabixIteratorParsed | |
5762 #define __pyx_type_5pysam_9libctabix_GZIterator __pyx_mstate_global->__pyx_type_5pysam_9libctabix_GZIterator | |
5763 #define __pyx_type_5pysam_9libctabix_GZIteratorHead __pyx_mstate_global->__pyx_type_5pysam_9libctabix_GZIteratorHead | |
5764 #define __pyx_type_5pysam_9libctabix_GZIteratorParsed __pyx_mstate_global->__pyx_type_5pysam_9libctabix_GZIteratorParsed | |
5765 #define __pyx_type_5pysam_9libctabix_Tabixfile __pyx_mstate_global->__pyx_type_5pysam_9libctabix_Tabixfile | |
5766 #endif | |
5767 #define __pyx_ptype_5pysam_9libctabix_tabix_file_iterator __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_tabix_file_iterator | |
5768 #define __pyx_ptype_5pysam_9libctabix_TabixFile __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_TabixFile | |
5769 #define __pyx_ptype_5pysam_9libctabix_Parser __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_Parser | |
5770 #define __pyx_ptype_5pysam_9libctabix_asTuple __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_asTuple | |
5771 #define __pyx_ptype_5pysam_9libctabix_asGTF __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_asGTF | |
5772 #define __pyx_ptype_5pysam_9libctabix_asGFF3 __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_asGFF3 | |
5773 #define __pyx_ptype_5pysam_9libctabix_asBed __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_asBed | |
5774 #define __pyx_ptype_5pysam_9libctabix_asVCF __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_asVCF | |
5775 #define __pyx_ptype_5pysam_9libctabix_TabixIterator __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_TabixIterator | |
5776 #define __pyx_ptype_5pysam_9libctabix_TabixIteratorParsed __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed | |
5777 #define __pyx_ptype_5pysam_9libctabix_GZIterator __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_GZIterator | |
5778 #define __pyx_ptype_5pysam_9libctabix_GZIteratorHead __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_GZIteratorHead | |
5779 #define __pyx_ptype_5pysam_9libctabix_GZIteratorParsed __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_GZIteratorParsed | |
5780 #define __pyx_ptype_5pysam_9libctabix_Tabixfile __pyx_mstate_global->__pyx_ptype_5pysam_9libctabix_Tabixfile | |
5781 #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError | |
5782 #define __pyx_kp_u_Could_not_open_file __pyx_mstate_global->__pyx_kp_u_Could_not_open_file | |
5783 #define __pyx_n_s_EmptyIterator __pyx_mstate_global->__pyx_n_s_EmptyIterator | |
5784 #define __pyx_n_s_EmptyIterator___iter __pyx_mstate_global->__pyx_n_s_EmptyIterator___iter | |
5785 #define __pyx_n_s_EmptyIterator___next __pyx_mstate_global->__pyx_n_s_EmptyIterator___next | |
5786 #define __pyx_kp_u_Filename_s_already_exists_use_fo __pyx_mstate_global->__pyx_kp_u_Filename_s_already_exists_use_fo | |
5787 #define __pyx_n_s_GZIterator __pyx_mstate_global->__pyx_n_s_GZIterator | |
5788 #define __pyx_n_u_GZIterator __pyx_mstate_global->__pyx_n_u_GZIterator | |
5789 #define __pyx_n_s_GZIteratorHead __pyx_mstate_global->__pyx_n_s_GZIteratorHead | |
5790 #define __pyx_n_u_GZIteratorHead __pyx_mstate_global->__pyx_n_u_GZIteratorHead | |
5791 #define __pyx_n_s_GZIteratorHead___reduce_cython __pyx_mstate_global->__pyx_n_s_GZIteratorHead___reduce_cython | |
5792 #define __pyx_n_s_GZIteratorHead___setstate_cython __pyx_mstate_global->__pyx_n_s_GZIteratorHead___setstate_cython | |
5793 #define __pyx_n_s_GZIteratorParsed __pyx_mstate_global->__pyx_n_s_GZIteratorParsed | |
5794 #define __pyx_n_s_GZIteratorParsed___reduce_cython __pyx_mstate_global->__pyx_n_s_GZIteratorParsed___reduce_cython | |
5795 #define __pyx_n_s_GZIteratorParsed___setstate_cyth __pyx_mstate_global->__pyx_n_s_GZIteratorParsed___setstate_cyth | |
5796 #define __pyx_n_s_GZIterator___reduce_cython __pyx_mstate_global->__pyx_n_s_GZIterator___reduce_cython | |
5797 #define __pyx_n_s_GZIterator___setstate_cython __pyx_mstate_global->__pyx_n_s_GZIterator___setstate_cython | |
5798 #define __pyx_n_s_IOError __pyx_mstate_global->__pyx_n_s_IOError | |
5799 #define __pyx_kp_u_I_O_operation_on_closed_file __pyx_mstate_global->__pyx_kp_u_I_O_operation_on_closed_file | |
5800 #define __pyx_kp_u_I_O_operation_on_closed_file_2 __pyx_mstate_global->__pyx_kp_u_I_O_operation_on_closed_file_2 | |
5801 #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0 | |
5802 #define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError | |
5803 #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError | |
5804 #define __pyx_kp_u_No_such_file_or_directory_s __pyx_mstate_global->__pyx_kp_u_No_such_file_or_directory_s | |
5805 #define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError | |
5806 #define __pyx_n_s_OSError __pyx_mstate_global->__pyx_n_s_OSError | |
5807 #define __pyx_n_s_O_RDONLY __pyx_mstate_global->__pyx_n_s_O_RDONLY | |
5808 #define __pyx_n_s_Parser __pyx_mstate_global->__pyx_n_s_Parser | |
5809 #define __pyx_n_s_Parser___reduce_cython __pyx_mstate_global->__pyx_n_s_Parser___reduce_cython | |
5810 #define __pyx_n_s_Parser___setstate_cython __pyx_mstate_global->__pyx_n_s_Parser___setstate_cython | |
5811 #define __pyx_n_s_Parser_get_encoding __pyx_mstate_global->__pyx_n_s_Parser_get_encoding | |
5812 #define __pyx_n_s_Parser_set_encoding __pyx_mstate_global->__pyx_n_s_Parser_set_encoding | |
5813 #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError | |
5814 #define __pyx_n_s_StopIteration __pyx_mstate_global->__pyx_n_s_StopIteration | |
5815 #define __pyx_n_s_TabixFile __pyx_mstate_global->__pyx_n_s_TabixFile | |
5816 #define __pyx_n_u_TabixFile __pyx_mstate_global->__pyx_n_u_TabixFile | |
5817 #define __pyx_n_s_TabixFile___reduce_cython __pyx_mstate_global->__pyx_n_s_TabixFile___reduce_cython | |
5818 #define __pyx_n_s_TabixFile___setstate_cython __pyx_mstate_global->__pyx_n_s_TabixFile___setstate_cython | |
5819 #define __pyx_n_s_TabixFile__dup __pyx_mstate_global->__pyx_n_s_TabixFile__dup | |
5820 #define __pyx_n_s_TabixFile__open __pyx_mstate_global->__pyx_n_s_TabixFile__open | |
5821 #define __pyx_n_s_TabixFile_close __pyx_mstate_global->__pyx_n_s_TabixFile_close | |
5822 #define __pyx_n_s_TabixFile_fetch __pyx_mstate_global->__pyx_n_s_TabixFile_fetch | |
5823 #define __pyx_n_s_TabixIterator __pyx_mstate_global->__pyx_n_s_TabixIterator | |
5824 #define __pyx_n_s_TabixIteratorParsed __pyx_mstate_global->__pyx_n_s_TabixIteratorParsed | |
5825 #define __pyx_n_s_TabixIteratorParsed___reduce_cyt __pyx_mstate_global->__pyx_n_s_TabixIteratorParsed___reduce_cyt | |
5826 #define __pyx_n_s_TabixIteratorParsed___setstate_c __pyx_mstate_global->__pyx_n_s_TabixIteratorParsed___setstate_c | |
5827 #define __pyx_n_s_TabixIterator___reduce_cython __pyx_mstate_global->__pyx_n_s_TabixIterator___reduce_cython | |
5828 #define __pyx_n_s_TabixIterator___setstate_cython __pyx_mstate_global->__pyx_n_s_TabixIterator___setstate_cython | |
5829 #define __pyx_n_s_Tabixfile __pyx_mstate_global->__pyx_n_s_Tabixfile | |
5830 #define __pyx_n_u_Tabixfile __pyx_mstate_global->__pyx_n_u_Tabixfile | |
5831 #define __pyx_n_s_Tabixfile___reduce_cython __pyx_mstate_global->__pyx_n_s_Tabixfile___reduce_cython | |
5832 #define __pyx_n_s_Tabixfile___setstate_cython __pyx_mstate_global->__pyx_n_s_Tabixfile___setstate_cython | |
5833 #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError | |
5834 #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError | |
5835 #define __pyx_n_s_WINDOW_SIZE __pyx_mstate_global->__pyx_n_s_WINDOW_SIZE | |
5836 #define __pyx_kp_b__16 __pyx_mstate_global->__pyx_kp_b__16 | |
5837 #define __pyx_kp_u__39 __pyx_mstate_global->__pyx_kp_u__39 | |
5838 #define __pyx_kp_u__42 __pyx_mstate_global->__pyx_kp_u__42 | |
5839 #define __pyx_kp_u__43 __pyx_mstate_global->__pyx_kp_u__43 | |
5840 #define __pyx_kp_u__44 __pyx_mstate_global->__pyx_kp_u__44 | |
5841 #define __pyx_kp_u__56 __pyx_mstate_global->__pyx_kp_u__56 | |
5842 #define __pyx_n_s__62 __pyx_mstate_global->__pyx_n_s__62 | |
5843 #define __pyx_n_s__78 __pyx_mstate_global->__pyx_n_s__78 | |
5844 #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a | |
5845 #define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all | |
5846 #define __pyx_n_s_asBed __pyx_mstate_global->__pyx_n_s_asBed | |
5847 #define __pyx_n_u_asBed __pyx_mstate_global->__pyx_n_u_asBed | |
5848 #define __pyx_n_s_asBed___reduce_cython __pyx_mstate_global->__pyx_n_s_asBed___reduce_cython | |
5849 #define __pyx_n_s_asBed___setstate_cython __pyx_mstate_global->__pyx_n_s_asBed___setstate_cython | |
5850 #define __pyx_n_s_asGFF3 __pyx_mstate_global->__pyx_n_s_asGFF3 | |
5851 #define __pyx_n_u_asGFF3 __pyx_mstate_global->__pyx_n_u_asGFF3 | |
5852 #define __pyx_n_s_asGFF3___reduce_cython __pyx_mstate_global->__pyx_n_s_asGFF3___reduce_cython | |
5853 #define __pyx_n_s_asGFF3___setstate_cython __pyx_mstate_global->__pyx_n_s_asGFF3___setstate_cython | |
5854 #define __pyx_n_s_asGTF __pyx_mstate_global->__pyx_n_s_asGTF | |
5855 #define __pyx_n_u_asGTF __pyx_mstate_global->__pyx_n_u_asGTF | |
5856 #define __pyx_n_s_asGTF___reduce_cython __pyx_mstate_global->__pyx_n_s_asGTF___reduce_cython | |
5857 #define __pyx_n_s_asGTF___setstate_cython __pyx_mstate_global->__pyx_n_s_asGTF___setstate_cython | |
5858 #define __pyx_n_s_asTuple __pyx_mstate_global->__pyx_n_s_asTuple | |
5859 #define __pyx_n_u_asTuple __pyx_mstate_global->__pyx_n_u_asTuple | |
5860 #define __pyx_n_s_asTuple___reduce_cython __pyx_mstate_global->__pyx_n_s_asTuple___reduce_cython | |
5861 #define __pyx_n_s_asTuple___setstate_cython __pyx_mstate_global->__pyx_n_s_asTuple___setstate_cython | |
5862 #define __pyx_n_s_asVCF __pyx_mstate_global->__pyx_n_s_asVCF | |
5863 #define __pyx_n_u_asVCF __pyx_mstate_global->__pyx_n_u_asVCF | |
5864 #define __pyx_n_s_asVCF___reduce_cython __pyx_mstate_global->__pyx_n_s_asVCF___reduce_cython | |
5865 #define __pyx_n_s_asVCF___setstate_cython __pyx_mstate_global->__pyx_n_s_asVCF___setstate_cython | |
5866 #define __pyx_n_u_ascii __pyx_mstate_global->__pyx_n_u_ascii | |
5867 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines | |
5868 #define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b | |
5869 #define __pyx_n_u_bcf __pyx_mstate_global->__pyx_n_u_bcf | |
5870 #define __pyx_n_u_bed __pyx_mstate_global->__pyx_n_u_bed | |
5871 #define __pyx_n_s_buffer __pyx_mstate_global->__pyx_n_s_buffer | |
5872 #define __pyx_n_s_buffer_size __pyx_mstate_global->__pyx_n_s_buffer_size | |
5873 #define __pyx_kp_u_building_of_index_for_failed __pyx_mstate_global->__pyx_kp_u_building_of_index_for_failed | |
5874 #define __pyx_n_s_bytes_cpy __pyx_mstate_global->__pyx_n_s_bytes_cpy | |
5875 #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c | |
5876 #define __pyx_n_s_cfilename __pyx_mstate_global->__pyx_n_s_cfilename | |
5877 #define __pyx_n_s_cfilename_index __pyx_mstate_global->__pyx_n_s_cfilename_index | |
5878 #define __pyx_n_s_cfn __pyx_mstate_global->__pyx_n_s_cfn | |
5879 #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback | |
5880 #define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close | |
5881 #define __pyx_n_s_closed __pyx_mstate_global->__pyx_n_s_closed | |
5882 #define __pyx_n_s_conf __pyx_mstate_global->__pyx_n_s_conf | |
5883 #define __pyx_n_s_conf_data __pyx_mstate_global->__pyx_n_s_conf_data | |
5884 #define __pyx_n_s_contigs __pyx_mstate_global->__pyx_n_s_contigs | |
5885 #define __pyx_kp_u_could_not_create_iterator_for_re __pyx_mstate_global->__pyx_kp_u_could_not_create_iterator_for_re | |
5886 #define __pyx_kp_u_could_not_create_iterator_possib __pyx_mstate_global->__pyx_kp_u_could_not_create_iterator_possib | |
5887 #define __pyx_kp_u_could_not_load_tbi_csi_index_of __pyx_mstate_global->__pyx_kp_u_could_not_load_tbi_csi_index_of | |
5888 #define __pyx_kp_u_could_not_open_file_s __pyx_mstate_global->__pyx_kp_u_could_not_open_file_s | |
5889 #define __pyx_kp_u_could_not_open_for_reading_heade __pyx_mstate_global->__pyx_kp_u_could_not_open_for_reading_heade | |
5890 #define __pyx_kp_u_could_not_open_index_for_s __pyx_mstate_global->__pyx_kp_u_could_not_open_index_for_s | |
5891 #define __pyx_kp_u_could_not_open_s_for_reading __pyx_mstate_global->__pyx_kp_u_could_not_open_s_for_reading | |
5892 #define __pyx_kp_u_could_not_open_s_for_writing __pyx_mstate_global->__pyx_kp_u_could_not_open_s_for_writing | |
5893 #define __pyx_n_s_cpy __pyx_mstate_global->__pyx_n_s_cpy | |
5894 #define __pyx_n_s_csi __pyx_mstate_global->__pyx_n_s_csi | |
5895 #define __pyx_kp_u_csi_2 __pyx_mstate_global->__pyx_kp_u_csi_2 | |
5896 #define __pyx_n_s_cstr __pyx_mstate_global->__pyx_n_s_cstr | |
5897 #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict | |
5898 #define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 | |
5899 #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable | |
5900 #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc | |
5901 #define __pyx_n_s_dup __pyx_mstate_global->__pyx_n_s_dup | |
5902 #define __pyx_kp_s_empty_iterator __pyx_mstate_global->__pyx_kp_s_empty_iterator | |
5903 #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable | |
5904 #define __pyx_n_s_encoding __pyx_mstate_global->__pyx_n_s_encoding | |
5905 #define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end | |
5906 #define __pyx_n_s_end_col __pyx_mstate_global->__pyx_n_s_end_col | |
5907 #define __pyx_kp_u_end_out_of_range_i __pyx_mstate_global->__pyx_kp_u_end_out_of_range_i | |
5908 #define __pyx_kp_u_error_i_when_closing_file_s __pyx_mstate_global->__pyx_kp_u_error_i_when_closing_file_s | |
5909 #define __pyx_kp_u_error_i_when_writing_to_file_s __pyx_mstate_global->__pyx_kp_u_error_i_when_writing_to_file_s | |
5910 #define __pyx_n_s_exists __pyx_mstate_global->__pyx_n_s_exists | |
5911 #define __pyx_n_s_fd_src __pyx_mstate_global->__pyx_n_s_fd_src | |
5912 #define __pyx_n_s_fetch __pyx_mstate_global->__pyx_n_s_fetch | |
5913 #define __pyx_kp_u_file_s_not_found __pyx_mstate_global->__pyx_kp_u_file_s_not_found | |
5914 #define __pyx_n_s_filename __pyx_mstate_global->__pyx_n_s_filename | |
5915 #define __pyx_n_s_filename_in __pyx_mstate_global->__pyx_n_s_filename_in | |
5916 #define __pyx_n_s_filename_index __pyx_mstate_global->__pyx_n_s_filename_index | |
5917 #define __pyx_n_s_filename_out __pyx_mstate_global->__pyx_n_s_filename_out | |
5918 #define __pyx_kp_u_filename_s_already_exists_use_fo __pyx_mstate_global->__pyx_kp_u_filename_s_already_exists_use_fo | |
5919 #define __pyx_n_s_fileobj __pyx_mstate_global->__pyx_n_s_fileobj | |
5920 #define __pyx_n_s_fmt __pyx_mstate_global->__pyx_n_s_fmt | |
5921 #define __pyx_n_s_fn __pyx_mstate_global->__pyx_n_s_fn | |
5922 #define __pyx_n_s_fn_index __pyx_mstate_global->__pyx_n_s_fn_index | |
5923 #define __pyx_n_s_fnidx __pyx_mstate_global->__pyx_n_s_fnidx | |
5924 #define __pyx_n_s_force __pyx_mstate_global->__pyx_n_s_force | |
5925 #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format | |
5926 #define __pyx_n_s_fp __pyx_mstate_global->__pyx_n_s_fp | |
5927 #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc | |
5928 #define __pyx_n_s_get_encoding __pyx_mstate_global->__pyx_n_s_get_encoding | |
5929 #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate | |
5930 #define __pyx_n_u_gff __pyx_mstate_global->__pyx_n_u_gff | |
5931 #define __pyx_kp_u_gz __pyx_mstate_global->__pyx_kp_u_gz | |
5932 #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import | |
5933 #define __pyx_kp_u_incomplete_line_at_s __pyx_mstate_global->__pyx_kp_u_incomplete_line_at_s | |
5934 #define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index | |
5935 #define __pyx_kp_u_index_s_not_found __pyx_mstate_global->__pyx_kp_u_index_s_not_found | |
5936 #define __pyx_n_s_infile __pyx_mstate_global->__pyx_n_s_infile | |
5937 #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init | |
5938 #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass | |
5939 #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing | |
5940 #define __pyx_kp_u_invalid_file_opening_mode_s __pyx_mstate_global->__pyx_kp_u_invalid_file_opening_mode_s | |
5941 #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine | |
5942 #define __pyx_n_s_is_empty __pyx_mstate_global->__pyx_n_s_is_empty | |
5943 #define __pyx_n_s_is_open __pyx_mstate_global->__pyx_n_s_is_open | |
5944 #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled | |
5945 #define __pyx_n_s_iter __pyx_mstate_global->__pyx_n_s_iter | |
5946 #define __pyx_kp_s_iterate_over_infile_Permits_the __pyx_mstate_global->__pyx_kp_s_iterate_over_infile_Permits_the | |
5947 #define __pyx_kp_u_iteration_on_closed_file __pyx_mstate_global->__pyx_kp_u_iteration_on_closed_file | |
5948 #define __pyx_n_s_itr __pyx_mstate_global->__pyx_n_s_itr | |
5949 #define __pyx_n_s_keep_original __pyx_mstate_global->__pyx_n_s_keep_original | |
5950 #define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys | |
5951 #define __pyx_n_s_length __pyx_mstate_global->__pyx_n_s_length | |
5952 #define __pyx_n_s_line __pyx_mstate_global->__pyx_n_s_line | |
5953 #define __pyx_n_s_line_skip __pyx_mstate_global->__pyx_n_s_line_skip | |
5954 #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main | |
5955 #define __pyx_n_s_meta_char __pyx_mstate_global->__pyx_n_s_meta_char | |
5956 #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass | |
5957 #define __pyx_n_s_min_shift __pyx_mstate_global->__pyx_n_s_min_shift | |
5958 #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode | |
5959 #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module | |
5960 #define __pyx_n_s_multiple_iterators __pyx_mstate_global->__pyx_n_s_multiple_iterators | |
5961 #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name | |
5962 #define __pyx_n_s_nbytes __pyx_mstate_global->__pyx_n_s_nbytes | |
5963 #define __pyx_kp_u_neither_preset_nor_seq_col_start __pyx_mstate_global->__pyx_kp_u_neither_preset_nor_seq_col_start | |
5964 #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new | |
5965 #define __pyx_n_s_next __pyx_mstate_global->__pyx_n_s_next | |
5966 #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non | |
5967 #define __pyx_n_s_open __pyx_mstate_global->__pyx_n_s_open | |
5968 #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os | |
5969 #define __pyx_kp_u_parse_method_of_s_not_implemente __pyx_mstate_global->__pyx_kp_u_parse_method_of_s_not_implemente | |
5970 #define __pyx_n_s_parser __pyx_mstate_global->__pyx_n_s_parser | |
5971 #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path | |
5972 #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle | |
5973 #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare | |
5974 #define __pyx_n_s_preset __pyx_mstate_global->__pyx_n_s_preset | |
5975 #define __pyx_n_s_preset2conf __pyx_mstate_global->__pyx_n_s_preset2conf | |
5976 #define __pyx_n_u_psltbl __pyx_mstate_global->__pyx_n_u_psltbl | |
5977 #define __pyx_n_s_pysam_libctabix __pyx_mstate_global->__pyx_n_s_pysam_libctabix | |
5978 #define __pyx_kp_s_pysam_libctabix_pyx __pyx_mstate_global->__pyx_kp_s_pysam_libctabix_pyx | |
5979 #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError | |
5980 #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum | |
5981 #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result | |
5982 #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state | |
5983 #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type | |
5984 #define __pyx_n_s_pyx_unpickle_Parser __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Parser | |
5985 #define __pyx_n_s_pyx_unpickle_asBed __pyx_mstate_global->__pyx_n_s_pyx_unpickle_asBed | |
5986 #define __pyx_n_s_pyx_unpickle_asGFF3 __pyx_mstate_global->__pyx_n_s_pyx_unpickle_asGFF3 | |
5987 #define __pyx_n_s_pyx_unpickle_asGTF __pyx_mstate_global->__pyx_n_s_pyx_unpickle_asGTF | |
5988 #define __pyx_n_s_pyx_unpickle_asTuple __pyx_mstate_global->__pyx_n_s_pyx_unpickle_asTuple | |
5989 #define __pyx_n_s_pyx_unpickle_asVCF __pyx_mstate_global->__pyx_n_s_pyx_unpickle_asVCF | |
5990 #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable | |
5991 #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname | |
5992 #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r | |
5993 #define __pyx_n_u_r __pyx_mstate_global->__pyx_n_u_r | |
5994 #define __pyx_n_s_readline __pyx_mstate_global->__pyx_n_s_readline | |
5995 #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce | |
5996 #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython | |
5997 #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex | |
5998 #define __pyx_n_s_reference __pyx_mstate_global->__pyx_n_s_reference | |
5999 #define __pyx_n_s_region __pyx_mstate_global->__pyx_n_s_region | |
6000 #define __pyx_n_s_retval __pyx_mstate_global->__pyx_n_s_retval | |
6001 #define __pyx_kp_u_s __pyx_mstate_global->__pyx_kp_u_s | |
6002 #define __pyx_n_s_s_2 __pyx_mstate_global->__pyx_n_s_s_2 | |
6003 #define __pyx_kp_u_s_i __pyx_mstate_global->__pyx_kp_u_s_i | |
6004 #define __pyx_kp_u_s_i_i __pyx_mstate_global->__pyx_kp_u_s_i_i | |
6005 #define __pyx_n_u_sam __pyx_mstate_global->__pyx_n_u_sam | |
6006 #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self | |
6007 #define __pyx_kp_s_self_gzipfile_self_kstream_canno __pyx_mstate_global->__pyx_kp_s_self_gzipfile_self_kstream_canno | |
6008 #define __pyx_kp_s_self_iterator_cannot_be_converte __pyx_mstate_global->__pyx_kp_s_self_iterator_cannot_be_converte | |
6009 #define __pyx_n_s_seq_col __pyx_mstate_global->__pyx_n_s_seq_col | |
6010 #define __pyx_n_s_set_encoding __pyx_mstate_global->__pyx_n_s_set_encoding | |
6011 #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name | |
6012 #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate | |
6013 #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython | |
6014 #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec | |
6015 #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start | |
6016 #define __pyx_n_s_start_col __pyx_mstate_global->__pyx_n_s_start_col | |
6017 #define __pyx_kp_u_start_i_end_i __pyx_mstate_global->__pyx_kp_u_start_i_end_i | |
6018 #define __pyx_kp_u_start_out_of_range_i __pyx_mstate_global->__pyx_kp_u_start_out_of_range_i | |
6019 #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state | |
6020 #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource | |
6021 #define __pyx_n_s_suffix __pyx_mstate_global->__pyx_n_s_suffix | |
6022 #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super | |
6023 #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys | |
6024 #define __pyx_n_s_tabix_compress __pyx_mstate_global->__pyx_n_s_tabix_compress | |
6025 #define __pyx_n_u_tabix_compress __pyx_mstate_global->__pyx_n_u_tabix_compress | |
6026 #define __pyx_n_s_tabix_file_iterator __pyx_mstate_global->__pyx_n_s_tabix_file_iterator | |
6027 #define __pyx_n_u_tabix_file_iterator __pyx_mstate_global->__pyx_n_u_tabix_file_iterator | |
6028 #define __pyx_n_s_tabix_file_iterator___reduce_cyt __pyx_mstate_global->__pyx_n_s_tabix_file_iterator___reduce_cyt | |
6029 #define __pyx_n_s_tabix_file_iterator___setstate_c __pyx_mstate_global->__pyx_n_s_tabix_file_iterator___setstate_c | |
6030 #define __pyx_n_s_tabix_generic_iterator __pyx_mstate_global->__pyx_n_s_tabix_generic_iterator | |
6031 #define __pyx_n_u_tabix_generic_iterator __pyx_mstate_global->__pyx_n_u_tabix_generic_iterator | |
6032 #define __pyx_n_s_tabix_generic_iterator___init __pyx_mstate_global->__pyx_n_s_tabix_generic_iterator___init | |
6033 #define __pyx_n_s_tabix_generic_iterator___iter __pyx_mstate_global->__pyx_n_s_tabix_generic_iterator___iter | |
6034 #define __pyx_n_s_tabix_generic_iterator___next __pyx_mstate_global->__pyx_n_s_tabix_generic_iterator___next | |
6035 #define __pyx_n_s_tabix_index __pyx_mstate_global->__pyx_n_s_tabix_index | |
6036 #define __pyx_n_u_tabix_index __pyx_mstate_global->__pyx_n_u_tabix_index | |
6037 #define __pyx_n_s_tabix_iterator __pyx_mstate_global->__pyx_n_s_tabix_iterator | |
6038 #define __pyx_n_u_tabix_iterator __pyx_mstate_global->__pyx_n_u_tabix_iterator | |
6039 #define __pyx_kp_u_tbi __pyx_mstate_global->__pyx_kp_u_tbi | |
6040 #define __pyx_n_s_tell __pyx_mstate_global->__pyx_n_s_tell | |
6041 #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test | |
6042 #define __pyx_n_s_threads __pyx_mstate_global->__pyx_n_s_threads | |
6043 #define __pyx_kp_u_unknown_preset __pyx_mstate_global->__pyx_kp_u_unknown_preset | |
6044 #define __pyx_n_s_unlink __pyx_mstate_global->__pyx_n_s_unlink | |
6045 #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update | |
6046 #define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate | |
6047 #define __pyx_kp_u_valid_presets_are __pyx_mstate_global->__pyx_kp_u_valid_presets_are | |
6048 #define __pyx_n_u_vcf __pyx_mstate_global->__pyx_n_u_vcf | |
6049 #define __pyx_kp_u_writing_failed __pyx_mstate_global->__pyx_kp_u_writing_failed | |
6050 #define __pyx_n_s_zerobased __pyx_mstate_global->__pyx_n_s_zerobased | |
6051 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 | |
6052 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 | |
6053 #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2 | |
6054 #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 | |
6055 #define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 | |
6056 #define __pyx_int_5 __pyx_mstate_global->__pyx_int_5 | |
6057 #define __pyx_int_15 __pyx_mstate_global->__pyx_int_15 | |
6058 #define __pyx_int_17 __pyx_mstate_global->__pyx_int_17 | |
6059 #define __pyx_int_18 __pyx_mstate_global->__pyx_int_18 | |
6060 #define __pyx_int_35 __pyx_mstate_global->__pyx_int_35 | |
6061 #define __pyx_int_64 __pyx_mstate_global->__pyx_int_64 | |
6062 #define __pyx_int_21667264 __pyx_mstate_global->__pyx_int_21667264 | |
6063 #define __pyx_int_139192863 __pyx_mstate_global->__pyx_int_139192863 | |
6064 #define __pyx_int_243541226 __pyx_mstate_global->__pyx_int_243541226 | |
6065 #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 | |
6066 #define __pyx_codeobj_ __pyx_mstate_global->__pyx_codeobj_ | |
6067 #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 | |
6068 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 | |
6069 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 | |
6070 #define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 | |
6071 #define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 | |
6072 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 | |
6073 #define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55 | |
6074 #define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63 | |
6075 #define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64 | |
6076 #define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 | |
6077 #define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66 | |
6078 #define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 | |
6079 #define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68 | |
6080 #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 | |
6081 #define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70 | |
6082 #define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 | |
6083 #define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72 | |
6084 #define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 | |
6085 #define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74 | |
6086 #define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75 | |
6087 #define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76 | |
6088 #define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77 | |
6089 #define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 | |
6090 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 | |
6091 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 | |
6092 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 | |
6093 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 | |
6094 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 | |
6095 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 | |
6096 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 | |
6097 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 | |
6098 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 | |
6099 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 | |
6100 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 | |
6101 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 | |
6102 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 | |
6103 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 | |
6104 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 | |
6105 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 | |
6106 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 | |
6107 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 | |
6108 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 | |
6109 #define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 | |
6110 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 | |
6111 #define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 | |
6112 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 | |
6113 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 | |
6114 #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 | |
6115 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 | |
6116 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 | |
6117 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 | |
6118 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 | |
6119 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 | |
6120 #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 | |
6121 #define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 | |
6122 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 | |
6123 #define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47 | |
6124 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 | |
6125 #define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49 | |
6126 #define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 | |
6127 #define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 | |
6128 #define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 | |
6129 #define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 | |
6130 #define __pyx_codeobj__54 __pyx_mstate_global->__pyx_codeobj__54 | |
6131 #define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 | |
6132 #define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58 | |
6133 #define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 | |
6134 #define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 | |
6135 #define __pyx_codeobj__61 __pyx_mstate_global->__pyx_codeobj__61 | |
6136 /* #### Code section: module_code ### */ | |
6137 | |
6138 /* "cpython/complex.pxd":19 | |
6139 * | |
6140 * @property | |
6141 * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< | |
6142 * return self.cval.real | |
6143 * | |
6144 */ | |
6145 | |
6146 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) { | |
6147 double __pyx_r; | |
6148 | |
6149 /* "cpython/complex.pxd":20 | |
6150 * @property | |
6151 * cdef inline double real(self) noexcept: | |
6152 * return self.cval.real # <<<<<<<<<<<<<< | |
6153 * | |
6154 * @property | |
6155 */ | |
6156 __pyx_r = __pyx_v_self->cval.real; | |
6157 goto __pyx_L0; | |
6158 | |
6159 /* "cpython/complex.pxd":19 | |
6160 * | |
6161 * @property | |
6162 * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< | |
6163 * return self.cval.real | |
6164 * | |
6165 */ | |
6166 | |
6167 /* function exit code */ | |
6168 __pyx_L0:; | |
6169 return __pyx_r; | |
6170 } | |
6171 | |
6172 /* "cpython/complex.pxd":23 | |
6173 * | |
6174 * @property | |
6175 * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< | |
6176 * return self.cval.imag | |
6177 * | |
6178 */ | |
6179 | |
6180 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) { | |
6181 double __pyx_r; | |
6182 | |
6183 /* "cpython/complex.pxd":24 | |
6184 * @property | |
6185 * cdef inline double imag(self) noexcept: | |
6186 * return self.cval.imag # <<<<<<<<<<<<<< | |
6187 * | |
6188 * # PyTypeObject PyComplex_Type | |
6189 */ | |
6190 __pyx_r = __pyx_v_self->cval.imag; | |
6191 goto __pyx_L0; | |
6192 | |
6193 /* "cpython/complex.pxd":23 | |
6194 * | |
6195 * @property | |
6196 * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< | |
6197 * return self.cval.imag | |
6198 * | |
6199 */ | |
6200 | |
6201 /* function exit code */ | |
6202 __pyx_L0:; | |
6203 return __pyx_r; | |
6204 } | |
6205 | |
6206 /* "cpython/contextvars.pxd":112 | |
6207 * | |
6208 * | |
6209 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< | |
6210 * """Return a new reference to the value of the context variable, | |
6211 * or the default value of the context variable, | |
6212 */ | |
6213 | |
6214 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) { | |
6215 PyObject *__pyx_v_default_value = ((PyObject *)Py_None); | |
6216 PyObject *__pyx_v_value; | |
6217 PyObject *__pyx_v_pyvalue = NULL; | |
6218 PyObject *__pyx_r = NULL; | |
6219 __Pyx_RefNannyDeclarations | |
6220 int __pyx_t_1; | |
6221 int __pyx_t_2; | |
6222 PyObject *__pyx_t_3 = NULL; | |
6223 int __pyx_lineno = 0; | |
6224 const char *__pyx_filename = NULL; | |
6225 int __pyx_clineno = 0; | |
6226 __Pyx_RefNannySetupContext("get_value", 1); | |
6227 if (__pyx_optional_args) { | |
6228 if (__pyx_optional_args->__pyx_n > 0) { | |
6229 __pyx_v_default_value = __pyx_optional_args->default_value; | |
6230 } | |
6231 } | |
6232 | |
6233 /* "cpython/contextvars.pxd":117 | |
6234 * or None if no such value or default was found. | |
6235 * """ | |
6236 * cdef PyObject *value = NULL # <<<<<<<<<<<<<< | |
6237 * PyContextVar_Get(var, NULL, &value) | |
6238 * if value is NULL: | |
6239 */ | |
6240 __pyx_v_value = NULL; | |
6241 | |
6242 /* "cpython/contextvars.pxd":118 | |
6243 * """ | |
6244 * cdef PyObject *value = NULL | |
6245 * PyContextVar_Get(var, NULL, &value) # <<<<<<<<<<<<<< | |
6246 * if value is NULL: | |
6247 * # context variable does not have a default | |
6248 */ | |
6249 __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 118, __pyx_L1_error) | |
6250 | |
6251 /* "cpython/contextvars.pxd":119 | |
6252 * cdef PyObject *value = NULL | |
6253 * PyContextVar_Get(var, NULL, &value) | |
6254 * if value is NULL: # <<<<<<<<<<<<<< | |
6255 * # context variable does not have a default | |
6256 * pyvalue = default_value | |
6257 */ | |
6258 __pyx_t_2 = (__pyx_v_value == NULL); | |
6259 if (__pyx_t_2) { | |
6260 | |
6261 /* "cpython/contextvars.pxd":121 | |
6262 * if value is NULL: | |
6263 * # context variable does not have a default | |
6264 * pyvalue = default_value # <<<<<<<<<<<<<< | |
6265 * else: | |
6266 * # value or default value of context variable | |
6267 */ | |
6268 __Pyx_INCREF(__pyx_v_default_value); | |
6269 __pyx_v_pyvalue = __pyx_v_default_value; | |
6270 | |
6271 /* "cpython/contextvars.pxd":119 | |
6272 * cdef PyObject *value = NULL | |
6273 * PyContextVar_Get(var, NULL, &value) | |
6274 * if value is NULL: # <<<<<<<<<<<<<< | |
6275 * # context variable does not have a default | |
6276 * pyvalue = default_value | |
6277 */ | |
6278 goto __pyx_L3; | |
6279 } | |
6280 | |
6281 /* "cpython/contextvars.pxd":124 | |
6282 * else: | |
6283 * # value or default value of context variable | |
6284 * pyvalue = <object>value # <<<<<<<<<<<<<< | |
6285 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' | |
6286 * return pyvalue | |
6287 */ | |
6288 /*else*/ { | |
6289 __pyx_t_3 = ((PyObject *)__pyx_v_value); | |
6290 __Pyx_INCREF(__pyx_t_3); | |
6291 __pyx_v_pyvalue = __pyx_t_3; | |
6292 __pyx_t_3 = 0; | |
6293 | |
6294 /* "cpython/contextvars.pxd":125 | |
6295 * # value or default value of context variable | |
6296 * pyvalue = <object>value | |
6297 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< | |
6298 * return pyvalue | |
6299 * | |
6300 */ | |
6301 Py_XDECREF(__pyx_v_value); | |
6302 } | |
6303 __pyx_L3:; | |
6304 | |
6305 /* "cpython/contextvars.pxd":126 | |
6306 * pyvalue = <object>value | |
6307 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' | |
6308 * return pyvalue # <<<<<<<<<<<<<< | |
6309 * | |
6310 * | |
6311 */ | |
6312 __Pyx_XDECREF(__pyx_r); | |
6313 __Pyx_INCREF(__pyx_v_pyvalue); | |
6314 __pyx_r = __pyx_v_pyvalue; | |
6315 goto __pyx_L0; | |
6316 | |
6317 /* "cpython/contextvars.pxd":112 | |
6318 * | |
6319 * | |
6320 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< | |
6321 * """Return a new reference to the value of the context variable, | |
6322 * or the default value of the context variable, | |
6323 */ | |
6324 | |
6325 /* function exit code */ | |
6326 __pyx_L1_error:; | |
6327 __Pyx_XDECREF(__pyx_t_3); | |
6328 __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
6329 __pyx_r = 0; | |
6330 __pyx_L0:; | |
6331 __Pyx_XDECREF(__pyx_v_pyvalue); | |
6332 __Pyx_XGIVEREF(__pyx_r); | |
6333 __Pyx_RefNannyFinishContext(); | |
6334 return __pyx_r; | |
6335 } | |
6336 | |
6337 /* "cpython/contextvars.pxd":129 | |
6338 * | |
6339 * | |
6340 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< | |
6341 * """Return a new reference to the value of the context variable, | |
6342 * or the provided default value if no such value was found. | |
6343 */ | |
6344 | |
6345 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) { | |
6346 PyObject *__pyx_v_default_value = ((PyObject *)Py_None); | |
6347 PyObject *__pyx_v_value; | |
6348 PyObject *__pyx_v_pyvalue = NULL; | |
6349 PyObject *__pyx_r = NULL; | |
6350 __Pyx_RefNannyDeclarations | |
6351 int __pyx_t_1; | |
6352 PyObject *__pyx_t_2 = NULL; | |
6353 int __pyx_lineno = 0; | |
6354 const char *__pyx_filename = NULL; | |
6355 int __pyx_clineno = 0; | |
6356 __Pyx_RefNannySetupContext("get_value_no_default", 1); | |
6357 if (__pyx_optional_args) { | |
6358 if (__pyx_optional_args->__pyx_n > 0) { | |
6359 __pyx_v_default_value = __pyx_optional_args->default_value; | |
6360 } | |
6361 } | |
6362 | |
6363 /* "cpython/contextvars.pxd":135 | |
6364 * Ignores the default value of the context variable, if any. | |
6365 * """ | |
6366 * cdef PyObject *value = NULL # <<<<<<<<<<<<<< | |
6367 * PyContextVar_Get(var, <PyObject*>default_value, &value) | |
6368 * # value of context variable or 'default_value' | |
6369 */ | |
6370 __pyx_v_value = NULL; | |
6371 | |
6372 /* "cpython/contextvars.pxd":136 | |
6373 * """ | |
6374 * cdef PyObject *value = NULL | |
6375 * PyContextVar_Get(var, <PyObject*>default_value, &value) # <<<<<<<<<<<<<< | |
6376 * # value of context variable or 'default_value' | |
6377 * pyvalue = <object>value | |
6378 */ | |
6379 __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(2, 136, __pyx_L1_error) | |
6380 | |
6381 /* "cpython/contextvars.pxd":138 | |
6382 * PyContextVar_Get(var, <PyObject*>default_value, &value) | |
6383 * # value of context variable or 'default_value' | |
6384 * pyvalue = <object>value # <<<<<<<<<<<<<< | |
6385 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' | |
6386 * return pyvalue | |
6387 */ | |
6388 __pyx_t_2 = ((PyObject *)__pyx_v_value); | |
6389 __Pyx_INCREF(__pyx_t_2); | |
6390 __pyx_v_pyvalue = __pyx_t_2; | |
6391 __pyx_t_2 = 0; | |
6392 | |
6393 /* "cpython/contextvars.pxd":139 | |
6394 * # value of context variable or 'default_value' | |
6395 * pyvalue = <object>value | |
6396 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< | |
6397 * return pyvalue | |
6398 */ | |
6399 Py_XDECREF(__pyx_v_value); | |
6400 | |
6401 /* "cpython/contextvars.pxd":140 | |
6402 * pyvalue = <object>value | |
6403 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' | |
6404 * return pyvalue # <<<<<<<<<<<<<< | |
6405 */ | |
6406 __Pyx_XDECREF(__pyx_r); | |
6407 __Pyx_INCREF(__pyx_v_pyvalue); | |
6408 __pyx_r = __pyx_v_pyvalue; | |
6409 goto __pyx_L0; | |
6410 | |
6411 /* "cpython/contextvars.pxd":129 | |
6412 * | |
6413 * | |
6414 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< | |
6415 * """Return a new reference to the value of the context variable, | |
6416 * or the provided default value if no such value was found. | |
6417 */ | |
6418 | |
6419 /* function exit code */ | |
6420 __pyx_L1_error:; | |
6421 __Pyx_XDECREF(__pyx_t_2); | |
6422 __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
6423 __pyx_r = 0; | |
6424 __pyx_L0:; | |
6425 __Pyx_XDECREF(__pyx_v_pyvalue); | |
6426 __Pyx_XGIVEREF(__pyx_r); | |
6427 __Pyx_RefNannyFinishContext(); | |
6428 return __pyx_r; | |
6429 } | |
6430 | |
6431 /* "array.pxd":104 | |
6432 * __data_union data | |
6433 * | |
6434 * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< | |
6435 * # This implementation of getbuffer is geared towards Cython | |
6436 * # requirements, and does not yet fulfill the PEP. | |
6437 */ | |
6438 | |
6439 /* Python wrapper */ | |
6440 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*/ | |
6441 CYTHON_UNUSED static int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { | |
6442 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
6443 int __pyx_r; | |
6444 __Pyx_RefNannyDeclarations | |
6445 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); | |
6446 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
6447 __pyx_r = __pyx_pf_7cpython_5array_5array___getbuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); | |
6448 | |
6449 /* function exit code */ | |
6450 __Pyx_RefNannyFinishContext(); | |
6451 return __pyx_r; | |
6452 } | |
6453 | |
6454 static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags) { | |
6455 PyObject *__pyx_v_item_count = NULL; | |
6456 int __pyx_r; | |
6457 __Pyx_RefNannyDeclarations | |
6458 PyObject *__pyx_t_1 = NULL; | |
6459 char *__pyx_t_2; | |
6460 int __pyx_t_3; | |
6461 PyObject *__pyx_t_4 = NULL; | |
6462 Py_ssize_t __pyx_t_5; | |
6463 int __pyx_t_6; | |
6464 char __pyx_t_7; | |
6465 int __pyx_lineno = 0; | |
6466 const char *__pyx_filename = NULL; | |
6467 int __pyx_clineno = 0; | |
6468 if (unlikely(__pyx_v_info == NULL)) { | |
6469 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); | |
6470 return -1; | |
6471 } | |
6472 __Pyx_RefNannySetupContext("__getbuffer__", 0); | |
6473 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); | |
6474 __Pyx_GIVEREF(__pyx_v_info->obj); | |
6475 | |
6476 /* "array.pxd":109 | |
6477 * # In particular strided access is always provided regardless | |
6478 * # of flags | |
6479 * item_count = Py_SIZE(self) # <<<<<<<<<<<<<< | |
6480 * | |
6481 * info.suboffsets = NULL | |
6482 */ | |
6483 __pyx_t_1 = PyInt_FromSsize_t(Py_SIZE(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 109, __pyx_L1_error) | |
6484 __Pyx_GOTREF(__pyx_t_1); | |
6485 __pyx_v_item_count = __pyx_t_1; | |
6486 __pyx_t_1 = 0; | |
6487 | |
6488 /* "array.pxd":111 | |
6489 * item_count = Py_SIZE(self) | |
6490 * | |
6491 * info.suboffsets = NULL # <<<<<<<<<<<<<< | |
6492 * info.buf = self.data.as_chars | |
6493 * info.readonly = 0 | |
6494 */ | |
6495 __pyx_v_info->suboffsets = NULL; | |
6496 | |
6497 /* "array.pxd":112 | |
6498 * | |
6499 * info.suboffsets = NULL | |
6500 * info.buf = self.data.as_chars # <<<<<<<<<<<<<< | |
6501 * info.readonly = 0 | |
6502 * info.ndim = 1 | |
6503 */ | |
6504 __pyx_t_2 = __pyx_v_self->data.as_chars; | |
6505 __pyx_v_info->buf = __pyx_t_2; | |
6506 | |
6507 /* "array.pxd":113 | |
6508 * info.suboffsets = NULL | |
6509 * info.buf = self.data.as_chars | |
6510 * info.readonly = 0 # <<<<<<<<<<<<<< | |
6511 * info.ndim = 1 | |
6512 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) | |
6513 */ | |
6514 __pyx_v_info->readonly = 0; | |
6515 | |
6516 /* "array.pxd":114 | |
6517 * info.buf = self.data.as_chars | |
6518 * info.readonly = 0 | |
6519 * info.ndim = 1 # <<<<<<<<<<<<<< | |
6520 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) | |
6521 * info.len = info.itemsize * item_count | |
6522 */ | |
6523 __pyx_v_info->ndim = 1; | |
6524 | |
6525 /* "array.pxd":115 | |
6526 * info.readonly = 0 | |
6527 * info.ndim = 1 | |
6528 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) # <<<<<<<<<<<<<< | |
6529 * info.len = info.itemsize * item_count | |
6530 * | |
6531 */ | |
6532 __pyx_t_3 = __pyx_v_self->ob_descr->itemsize; | |
6533 __pyx_v_info->itemsize = __pyx_t_3; | |
6534 | |
6535 /* "array.pxd":116 | |
6536 * info.ndim = 1 | |
6537 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) | |
6538 * info.len = info.itemsize * item_count # <<<<<<<<<<<<<< | |
6539 * | |
6540 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) | |
6541 */ | |
6542 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_info->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 116, __pyx_L1_error) | |
6543 __Pyx_GOTREF(__pyx_t_1); | |
6544 __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_item_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 116, __pyx_L1_error) | |
6545 __Pyx_GOTREF(__pyx_t_4); | |
6546 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
6547 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 116, __pyx_L1_error) | |
6548 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
6549 __pyx_v_info->len = __pyx_t_5; | |
6550 | |
6551 /* "array.pxd":118 | |
6552 * info.len = info.itemsize * item_count | |
6553 * | |
6554 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) # <<<<<<<<<<<<<< | |
6555 * if not info.shape: | |
6556 * raise MemoryError() | |
6557 */ | |
6558 __pyx_v_info->shape = ((Py_ssize_t *)PyObject_Malloc(((sizeof(Py_ssize_t)) + 2))); | |
6559 | |
6560 /* "array.pxd":119 | |
6561 * | |
6562 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) | |
6563 * if not info.shape: # <<<<<<<<<<<<<< | |
6564 * raise MemoryError() | |
6565 * info.shape[0] = item_count # constant regardless of resizing | |
6566 */ | |
6567 __pyx_t_6 = (!(__pyx_v_info->shape != 0)); | |
6568 if (unlikely(__pyx_t_6)) { | |
6569 | |
6570 /* "array.pxd":120 | |
6571 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) | |
6572 * if not info.shape: | |
6573 * raise MemoryError() # <<<<<<<<<<<<<< | |
6574 * info.shape[0] = item_count # constant regardless of resizing | |
6575 * info.strides = &info.itemsize | |
6576 */ | |
6577 PyErr_NoMemory(); __PYX_ERR(3, 120, __pyx_L1_error) | |
6578 | |
6579 /* "array.pxd":119 | |
6580 * | |
6581 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) | |
6582 * if not info.shape: # <<<<<<<<<<<<<< | |
6583 * raise MemoryError() | |
6584 * info.shape[0] = item_count # constant regardless of resizing | |
6585 */ | |
6586 } | |
6587 | |
6588 /* "array.pxd":121 | |
6589 * if not info.shape: | |
6590 * raise MemoryError() | |
6591 * info.shape[0] = item_count # constant regardless of resizing # <<<<<<<<<<<<<< | |
6592 * info.strides = &info.itemsize | |
6593 * | |
6594 */ | |
6595 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_item_count); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 121, __pyx_L1_error) | |
6596 (__pyx_v_info->shape[0]) = __pyx_t_5; | |
6597 | |
6598 /* "array.pxd":122 | |
6599 * raise MemoryError() | |
6600 * info.shape[0] = item_count # constant regardless of resizing | |
6601 * info.strides = &info.itemsize # <<<<<<<<<<<<<< | |
6602 * | |
6603 * info.format = <char*> (info.shape + 1) | |
6604 */ | |
6605 __pyx_v_info->strides = (&__pyx_v_info->itemsize); | |
6606 | |
6607 /* "array.pxd":124 | |
6608 * info.strides = &info.itemsize | |
6609 * | |
6610 * info.format = <char*> (info.shape + 1) # <<<<<<<<<<<<<< | |
6611 * info.format[0] = self.ob_descr.typecode | |
6612 * info.format[1] = 0 | |
6613 */ | |
6614 __pyx_v_info->format = ((char *)(__pyx_v_info->shape + 1)); | |
6615 | |
6616 /* "array.pxd":125 | |
6617 * | |
6618 * info.format = <char*> (info.shape + 1) | |
6619 * info.format[0] = self.ob_descr.typecode # <<<<<<<<<<<<<< | |
6620 * info.format[1] = 0 | |
6621 * info.obj = self | |
6622 */ | |
6623 __pyx_t_7 = __pyx_v_self->ob_descr->typecode; | |
6624 (__pyx_v_info->format[0]) = __pyx_t_7; | |
6625 | |
6626 /* "array.pxd":126 | |
6627 * info.format = <char*> (info.shape + 1) | |
6628 * info.format[0] = self.ob_descr.typecode | |
6629 * info.format[1] = 0 # <<<<<<<<<<<<<< | |
6630 * info.obj = self | |
6631 * | |
6632 */ | |
6633 (__pyx_v_info->format[1]) = 0; | |
6634 | |
6635 /* "array.pxd":127 | |
6636 * info.format[0] = self.ob_descr.typecode | |
6637 * info.format[1] = 0 | |
6638 * info.obj = self # <<<<<<<<<<<<<< | |
6639 * | |
6640 * def __releasebuffer__(self, Py_buffer* info): | |
6641 */ | |
6642 __Pyx_INCREF((PyObject *)__pyx_v_self); | |
6643 __Pyx_GIVEREF((PyObject *)__pyx_v_self); | |
6644 __Pyx_GOTREF(__pyx_v_info->obj); | |
6645 __Pyx_DECREF(__pyx_v_info->obj); | |
6646 __pyx_v_info->obj = ((PyObject *)__pyx_v_self); | |
6647 | |
6648 /* "array.pxd":104 | |
6649 * __data_union data | |
6650 * | |
6651 * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< | |
6652 * # This implementation of getbuffer is geared towards Cython | |
6653 * # requirements, and does not yet fulfill the PEP. | |
6654 */ | |
6655 | |
6656 /* function exit code */ | |
6657 __pyx_r = 0; | |
6658 goto __pyx_L0; | |
6659 __pyx_L1_error:; | |
6660 __Pyx_XDECREF(__pyx_t_1); | |
6661 __Pyx_XDECREF(__pyx_t_4); | |
6662 __Pyx_AddTraceback("cpython.array.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
6663 __pyx_r = -1; | |
6664 if (__pyx_v_info->obj != NULL) { | |
6665 __Pyx_GOTREF(__pyx_v_info->obj); | |
6666 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; | |
6667 } | |
6668 goto __pyx_L2; | |
6669 __pyx_L0:; | |
6670 if (__pyx_v_info->obj == Py_None) { | |
6671 __Pyx_GOTREF(__pyx_v_info->obj); | |
6672 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; | |
6673 } | |
6674 __pyx_L2:; | |
6675 __Pyx_XDECREF(__pyx_v_item_count); | |
6676 __Pyx_RefNannyFinishContext(); | |
6677 return __pyx_r; | |
6678 } | |
6679 | |
6680 /* "array.pxd":129 | |
6681 * info.obj = self | |
6682 * | |
6683 * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<< | |
6684 * PyObject_Free(info.shape) | |
6685 * | |
6686 */ | |
6687 | |
6688 /* Python wrapper */ | |
6689 CYTHON_UNUSED static void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ | |
6690 CYTHON_UNUSED static void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { | |
6691 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
6692 __Pyx_RefNannyDeclarations | |
6693 __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); | |
6694 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
6695 __pyx_pf_7cpython_5array_5array_2__releasebuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); | |
6696 | |
6697 /* function exit code */ | |
6698 __Pyx_RefNannyFinishContext(); | |
6699 } | |
6700 | |
6701 static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info) { | |
6702 | |
6703 /* "array.pxd":130 | |
6704 * | |
6705 * def __releasebuffer__(self, Py_buffer* info): | |
6706 * PyObject_Free(info.shape) # <<<<<<<<<<<<<< | |
6707 * | |
6708 * array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr) | |
6709 */ | |
6710 PyObject_Free(__pyx_v_info->shape); | |
6711 | |
6712 /* "array.pxd":129 | |
6713 * info.obj = self | |
6714 * | |
6715 * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<< | |
6716 * PyObject_Free(info.shape) | |
6717 * | |
6718 */ | |
6719 | |
6720 /* function exit code */ | |
6721 } | |
6722 | |
6723 /* "array.pxd":141 | |
6724 * | |
6725 * | |
6726 * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<< | |
6727 * """ fast creation of a new array, given a template array. | |
6728 * type will be same as template. | |
6729 */ | |
6730 | |
6731 static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) { | |
6732 arrayobject *__pyx_v_op = 0; | |
6733 arrayobject *__pyx_r = NULL; | |
6734 __Pyx_RefNannyDeclarations | |
6735 PyObject *__pyx_t_1 = NULL; | |
6736 int __pyx_t_2; | |
6737 int __pyx_t_3; | |
6738 int __pyx_lineno = 0; | |
6739 const char *__pyx_filename = NULL; | |
6740 int __pyx_clineno = 0; | |
6741 __Pyx_RefNannySetupContext("clone", 1); | |
6742 | |
6743 /* "array.pxd":145 | |
6744 * type will be same as template. | |
6745 * if zero is true, new array will be initialized with zeroes.""" | |
6746 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) # <<<<<<<<<<<<<< | |
6747 * if zero and op is not None: | |
6748 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) | |
6749 */ | |
6750 __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(3, 145, __pyx_L1_error) | |
6751 __Pyx_GOTREF(__pyx_t_1); | |
6752 __pyx_v_op = ((arrayobject *)__pyx_t_1); | |
6753 __pyx_t_1 = 0; | |
6754 | |
6755 /* "array.pxd":146 | |
6756 * if zero is true, new array will be initialized with zeroes.""" | |
6757 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) | |
6758 * if zero and op is not None: # <<<<<<<<<<<<<< | |
6759 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) | |
6760 * return op | |
6761 */ | |
6762 if (__pyx_v_zero) { | |
6763 } else { | |
6764 __pyx_t_2 = __pyx_v_zero; | |
6765 goto __pyx_L4_bool_binop_done; | |
6766 } | |
6767 __pyx_t_3 = (((PyObject *)__pyx_v_op) != Py_None); | |
6768 __pyx_t_2 = __pyx_t_3; | |
6769 __pyx_L4_bool_binop_done:; | |
6770 if (__pyx_t_2) { | |
6771 | |
6772 /* "array.pxd":147 | |
6773 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) | |
6774 * if zero and op is not None: | |
6775 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) # <<<<<<<<<<<<<< | |
6776 * return op | |
6777 * | |
6778 */ | |
6779 (void)(memset(__pyx_v_op->data.as_chars, 0, (__pyx_v_length * __pyx_v_op->ob_descr->itemsize))); | |
6780 | |
6781 /* "array.pxd":146 | |
6782 * if zero is true, new array will be initialized with zeroes.""" | |
6783 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) | |
6784 * if zero and op is not None: # <<<<<<<<<<<<<< | |
6785 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) | |
6786 * return op | |
6787 */ | |
6788 } | |
6789 | |
6790 /* "array.pxd":148 | |
6791 * if zero and op is not None: | |
6792 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) | |
6793 * return op # <<<<<<<<<<<<<< | |
6794 * | |
6795 * cdef inline array copy(array self): | |
6796 */ | |
6797 __Pyx_XDECREF((PyObject *)__pyx_r); | |
6798 __Pyx_INCREF((PyObject *)__pyx_v_op); | |
6799 __pyx_r = __pyx_v_op; | |
6800 goto __pyx_L0; | |
6801 | |
6802 /* "array.pxd":141 | |
6803 * | |
6804 * | |
6805 * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<< | |
6806 * """ fast creation of a new array, given a template array. | |
6807 * type will be same as template. | |
6808 */ | |
6809 | |
6810 /* function exit code */ | |
6811 __pyx_L1_error:; | |
6812 __Pyx_XDECREF(__pyx_t_1); | |
6813 __Pyx_AddTraceback("cpython.array.clone", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
6814 __pyx_r = 0; | |
6815 __pyx_L0:; | |
6816 __Pyx_XDECREF((PyObject *)__pyx_v_op); | |
6817 __Pyx_XGIVEREF((PyObject *)__pyx_r); | |
6818 __Pyx_RefNannyFinishContext(); | |
6819 return __pyx_r; | |
6820 } | |
6821 | |
6822 /* "array.pxd":150 | |
6823 * return op | |
6824 * | |
6825 * cdef inline array copy(array self): # <<<<<<<<<<<<<< | |
6826 * """ make a copy of an array. """ | |
6827 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) | |
6828 */ | |
6829 | |
6830 static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) { | |
6831 arrayobject *__pyx_v_op = 0; | |
6832 arrayobject *__pyx_r = NULL; | |
6833 __Pyx_RefNannyDeclarations | |
6834 PyObject *__pyx_t_1 = NULL; | |
6835 int __pyx_lineno = 0; | |
6836 const char *__pyx_filename = NULL; | |
6837 int __pyx_clineno = 0; | |
6838 __Pyx_RefNannySetupContext("copy", 1); | |
6839 | |
6840 /* "array.pxd":152 | |
6841 * cdef inline array copy(array self): | |
6842 * """ make a copy of an array. """ | |
6843 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) # <<<<<<<<<<<<<< | |
6844 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) | |
6845 * return op | |
6846 */ | |
6847 __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(3, 152, __pyx_L1_error) | |
6848 __Pyx_GOTREF(__pyx_t_1); | |
6849 __pyx_v_op = ((arrayobject *)__pyx_t_1); | |
6850 __pyx_t_1 = 0; | |
6851 | |
6852 /* "array.pxd":153 | |
6853 * """ make a copy of an array. """ | |
6854 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) | |
6855 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) # <<<<<<<<<<<<<< | |
6856 * return op | |
6857 * | |
6858 */ | |
6859 (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))); | |
6860 | |
6861 /* "array.pxd":154 | |
6862 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) | |
6863 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) | |
6864 * return op # <<<<<<<<<<<<<< | |
6865 * | |
6866 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: | |
6867 */ | |
6868 __Pyx_XDECREF((PyObject *)__pyx_r); | |
6869 __Pyx_INCREF((PyObject *)__pyx_v_op); | |
6870 __pyx_r = __pyx_v_op; | |
6871 goto __pyx_L0; | |
6872 | |
6873 /* "array.pxd":150 | |
6874 * return op | |
6875 * | |
6876 * cdef inline array copy(array self): # <<<<<<<<<<<<<< | |
6877 * """ make a copy of an array. """ | |
6878 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) | |
6879 */ | |
6880 | |
6881 /* function exit code */ | |
6882 __pyx_L1_error:; | |
6883 __Pyx_XDECREF(__pyx_t_1); | |
6884 __Pyx_AddTraceback("cpython.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
6885 __pyx_r = 0; | |
6886 __pyx_L0:; | |
6887 __Pyx_XDECREF((PyObject *)__pyx_v_op); | |
6888 __Pyx_XGIVEREF((PyObject *)__pyx_r); | |
6889 __Pyx_RefNannyFinishContext(); | |
6890 return __pyx_r; | |
6891 } | |
6892 | |
6893 /* "array.pxd":156 | |
6894 * return op | |
6895 * | |
6896 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<< | |
6897 * """ efficient appending of new stuff of same type | |
6898 * (e.g. of same array type) | |
6899 */ | |
6900 | |
6901 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) { | |
6902 Py_ssize_t __pyx_v_itemsize; | |
6903 Py_ssize_t __pyx_v_origsize; | |
6904 int __pyx_r; | |
6905 int __pyx_t_1; | |
6906 int __pyx_lineno = 0; | |
6907 const char *__pyx_filename = NULL; | |
6908 int __pyx_clineno = 0; | |
6909 | |
6910 /* "array.pxd":160 | |
6911 * (e.g. of same array type) | |
6912 * n: number of elements (not number of bytes!) """ | |
6913 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize # <<<<<<<<<<<<<< | |
6914 * cdef Py_ssize_t origsize = Py_SIZE(self) | |
6915 * resize_smart(self, origsize + n) | |
6916 */ | |
6917 __pyx_t_1 = __pyx_v_self->ob_descr->itemsize; | |
6918 __pyx_v_itemsize = __pyx_t_1; | |
6919 | |
6920 /* "array.pxd":161 | |
6921 * n: number of elements (not number of bytes!) """ | |
6922 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize | |
6923 * cdef Py_ssize_t origsize = Py_SIZE(self) # <<<<<<<<<<<<<< | |
6924 * resize_smart(self, origsize + n) | |
6925 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) | |
6926 */ | |
6927 __pyx_v_origsize = Py_SIZE(((PyObject *)__pyx_v_self)); | |
6928 | |
6929 /* "array.pxd":162 | |
6930 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize | |
6931 * cdef Py_ssize_t origsize = Py_SIZE(self) | |
6932 * resize_smart(self, origsize + n) # <<<<<<<<<<<<<< | |
6933 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) | |
6934 * return 0 | |
6935 */ | |
6936 __pyx_t_1 = resize_smart(__pyx_v_self, (__pyx_v_origsize + __pyx_v_n)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 162, __pyx_L1_error) | |
6937 | |
6938 /* "array.pxd":163 | |
6939 * cdef Py_ssize_t origsize = Py_SIZE(self) | |
6940 * resize_smart(self, origsize + n) | |
6941 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) # <<<<<<<<<<<<<< | |
6942 * return 0 | |
6943 * | |
6944 */ | |
6945 (void)(memcpy((__pyx_v_self->data.as_chars + (__pyx_v_origsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize))); | |
6946 | |
6947 /* "array.pxd":164 | |
6948 * resize_smart(self, origsize + n) | |
6949 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) | |
6950 * return 0 # <<<<<<<<<<<<<< | |
6951 * | |
6952 * cdef inline int extend(array self, array other) except -1: | |
6953 */ | |
6954 __pyx_r = 0; | |
6955 goto __pyx_L0; | |
6956 | |
6957 /* "array.pxd":156 | |
6958 * return op | |
6959 * | |
6960 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<< | |
6961 * """ efficient appending of new stuff of same type | |
6962 * (e.g. of same array type) | |
6963 */ | |
6964 | |
6965 /* function exit code */ | |
6966 __pyx_L1_error:; | |
6967 __Pyx_AddTraceback("cpython.array.extend_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
6968 __pyx_r = -1; | |
6969 __pyx_L0:; | |
6970 return __pyx_r; | |
6971 } | |
6972 | |
6973 /* "array.pxd":166 | |
6974 * return 0 | |
6975 * | |
6976 * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<< | |
6977 * """ extend array with data from another array; types must match. """ | |
6978 * if self.ob_descr.typecode != other.ob_descr.typecode: | |
6979 */ | |
6980 | |
6981 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) { | |
6982 int __pyx_r; | |
6983 int __pyx_t_1; | |
6984 int __pyx_t_2; | |
6985 int __pyx_lineno = 0; | |
6986 const char *__pyx_filename = NULL; | |
6987 int __pyx_clineno = 0; | |
6988 | |
6989 /* "array.pxd":168 | |
6990 * cdef inline int extend(array self, array other) except -1: | |
6991 * """ extend array with data from another array; types must match. """ | |
6992 * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<< | |
6993 * PyErr_BadArgument() | |
6994 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) | |
6995 */ | |
6996 __pyx_t_1 = (__pyx_v_self->ob_descr->typecode != __pyx_v_other->ob_descr->typecode); | |
6997 if (__pyx_t_1) { | |
6998 | |
6999 /* "array.pxd":169 | |
7000 * """ extend array with data from another array; types must match. """ | |
7001 * if self.ob_descr.typecode != other.ob_descr.typecode: | |
7002 * PyErr_BadArgument() # <<<<<<<<<<<<<< | |
7003 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) | |
7004 * | |
7005 */ | |
7006 __pyx_t_2 = PyErr_BadArgument(); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(3, 169, __pyx_L1_error) | |
7007 | |
7008 /* "array.pxd":168 | |
7009 * cdef inline int extend(array self, array other) except -1: | |
7010 * """ extend array with data from another array; types must match. """ | |
7011 * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<< | |
7012 * PyErr_BadArgument() | |
7013 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) | |
7014 */ | |
7015 } | |
7016 | |
7017 /* "array.pxd":170 | |
7018 * if self.ob_descr.typecode != other.ob_descr.typecode: | |
7019 * PyErr_BadArgument() | |
7020 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) # <<<<<<<<<<<<<< | |
7021 * | |
7022 * cdef inline void zero(array self) noexcept: | |
7023 */ | |
7024 __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(3, 170, __pyx_L1_error) | |
7025 __pyx_r = __pyx_t_2; | |
7026 goto __pyx_L0; | |
7027 | |
7028 /* "array.pxd":166 | |
7029 * return 0 | |
7030 * | |
7031 * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<< | |
7032 * """ extend array with data from another array; types must match. """ | |
7033 * if self.ob_descr.typecode != other.ob_descr.typecode: | |
7034 */ | |
7035 | |
7036 /* function exit code */ | |
7037 __pyx_L1_error:; | |
7038 __Pyx_AddTraceback("cpython.array.extend", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7039 __pyx_r = -1; | |
7040 __pyx_L0:; | |
7041 return __pyx_r; | |
7042 } | |
7043 | |
7044 /* "array.pxd":172 | |
7045 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) | |
7046 * | |
7047 * cdef inline void zero(array self) noexcept: # <<<<<<<<<<<<<< | |
7048 * """ set all elements of array to zero. """ | |
7049 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) | |
7050 */ | |
7051 | |
7052 static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) { | |
7053 | |
7054 /* "array.pxd":174 | |
7055 * cdef inline void zero(array self) noexcept: | |
7056 * """ set all elements of array to zero. """ | |
7057 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) # <<<<<<<<<<<<<< | |
7058 */ | |
7059 (void)(memset(__pyx_v_self->data.as_chars, 0, (Py_SIZE(((PyObject *)__pyx_v_self)) * __pyx_v_self->ob_descr->itemsize))); | |
7060 | |
7061 /* "array.pxd":172 | |
7062 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) | |
7063 * | |
7064 * cdef inline void zero(array self) noexcept: # <<<<<<<<<<<<<< | |
7065 * """ set all elements of array to zero. """ | |
7066 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) | |
7067 */ | |
7068 | |
7069 /* function exit code */ | |
7070 } | |
7071 | |
7072 /* "pysam/libctabix.pyx":84 | |
7073 * cdef class Parser: | |
7074 * | |
7075 * def __init__(self, encoding="ascii"): # <<<<<<<<<<<<<< | |
7076 * self.encoding = encoding | |
7077 * | |
7078 */ | |
7079 | |
7080 /* Python wrapper */ | |
7081 static int __pyx_pw_5pysam_9libctabix_6Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
7082 static int __pyx_pw_5pysam_9libctabix_6Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
7083 PyObject *__pyx_v_encoding = 0; | |
7084 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
7085 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
7086 PyObject* values[1] = {0}; | |
7087 int __pyx_lineno = 0; | |
7088 const char *__pyx_filename = NULL; | |
7089 int __pyx_clineno = 0; | |
7090 int __pyx_r; | |
7091 __Pyx_RefNannyDeclarations | |
7092 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); | |
7093 #if CYTHON_ASSUME_SAFE_MACROS | |
7094 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
7095 #else | |
7096 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; | |
7097 #endif | |
7098 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
7099 { | |
7100 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_encoding,0}; | |
7101 values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_u_ascii)); | |
7102 if (__pyx_kwds) { | |
7103 Py_ssize_t kw_args; | |
7104 switch (__pyx_nargs) { | |
7105 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
7106 CYTHON_FALLTHROUGH; | |
7107 case 0: break; | |
7108 default: goto __pyx_L5_argtuple_error; | |
7109 } | |
7110 kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); | |
7111 switch (__pyx_nargs) { | |
7112 case 0: | |
7113 if (kw_args > 0) { | |
7114 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding); | |
7115 if (value) { values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } | |
7116 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error) | |
7117 } | |
7118 } | |
7119 if (unlikely(kw_args > 0)) { | |
7120 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
7121 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 84, __pyx_L3_error) | |
7122 } | |
7123 } else { | |
7124 switch (__pyx_nargs) { | |
7125 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
7126 CYTHON_FALLTHROUGH; | |
7127 case 0: break; | |
7128 default: goto __pyx_L5_argtuple_error; | |
7129 } | |
7130 } | |
7131 __pyx_v_encoding = values[0]; | |
7132 } | |
7133 goto __pyx_L6_skip; | |
7134 __pyx_L5_argtuple_error:; | |
7135 __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 84, __pyx_L3_error) | |
7136 __pyx_L6_skip:; | |
7137 goto __pyx_L4_argument_unpacking_done; | |
7138 __pyx_L3_error:; | |
7139 { | |
7140 Py_ssize_t __pyx_temp; | |
7141 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
7142 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
7143 } | |
7144 } | |
7145 __Pyx_AddTraceback("pysam.libctabix.Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7146 __Pyx_RefNannyFinishContext(); | |
7147 return -1; | |
7148 __pyx_L4_argument_unpacking_done:; | |
7149 __pyx_r = __pyx_pf_5pysam_9libctabix_6Parser___init__(((struct __pyx_obj_5pysam_9libctabix_Parser *)__pyx_v_self), __pyx_v_encoding); | |
7150 | |
7151 /* function exit code */ | |
7152 { | |
7153 Py_ssize_t __pyx_temp; | |
7154 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
7155 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
7156 } | |
7157 } | |
7158 __Pyx_RefNannyFinishContext(); | |
7159 return __pyx_r; | |
7160 } | |
7161 | |
7162 static int __pyx_pf_5pysam_9libctabix_6Parser___init__(struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_self, PyObject *__pyx_v_encoding) { | |
7163 int __pyx_r; | |
7164 __Pyx_TraceDeclarations | |
7165 __Pyx_RefNannyDeclarations | |
7166 int __pyx_lineno = 0; | |
7167 const char *__pyx_filename = NULL; | |
7168 int __pyx_clineno = 0; | |
7169 __Pyx_RefNannySetupContext("__init__", 1); | |
7170 __Pyx_TraceCall("__init__", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error)); | |
7171 | |
7172 /* "pysam/libctabix.pyx":85 | |
7173 * | |
7174 * def __init__(self, encoding="ascii"): | |
7175 * self.encoding = encoding # <<<<<<<<<<<<<< | |
7176 * | |
7177 * def set_encoding(self, encoding): | |
7178 */ | |
7179 __Pyx_INCREF(__pyx_v_encoding); | |
7180 __Pyx_GIVEREF(__pyx_v_encoding); | |
7181 __Pyx_GOTREF(__pyx_v_self->encoding); | |
7182 __Pyx_DECREF(__pyx_v_self->encoding); | |
7183 __pyx_v_self->encoding = __pyx_v_encoding; | |
7184 | |
7185 /* "pysam/libctabix.pyx":84 | |
7186 * cdef class Parser: | |
7187 * | |
7188 * def __init__(self, encoding="ascii"): # <<<<<<<<<<<<<< | |
7189 * self.encoding = encoding | |
7190 * | |
7191 */ | |
7192 | |
7193 /* function exit code */ | |
7194 __pyx_r = 0; | |
7195 goto __pyx_L0; | |
7196 __pyx_L1_error:; | |
7197 __Pyx_AddTraceback("pysam.libctabix.Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7198 __pyx_r = -1; | |
7199 __pyx_L0:; | |
7200 __Pyx_TraceReturn(Py_None, 0); | |
7201 __Pyx_RefNannyFinishContext(); | |
7202 return __pyx_r; | |
7203 } | |
7204 | |
7205 /* "pysam/libctabix.pyx":87 | |
7206 * self.encoding = encoding | |
7207 * | |
7208 * def set_encoding(self, encoding): # <<<<<<<<<<<<<< | |
7209 * self.encoding = encoding | |
7210 * | |
7211 */ | |
7212 | |
7213 /* Python wrapper */ | |
7214 static PyObject *__pyx_pw_5pysam_9libctabix_6Parser_3set_encoding(PyObject *__pyx_v_self, | |
7215 #if CYTHON_METH_FASTCALL | |
7216 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
7217 #else | |
7218 PyObject *__pyx_args, PyObject *__pyx_kwds | |
7219 #endif | |
7220 ); /*proto*/ | |
7221 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_6Parser_2set_encoding, "Parser.set_encoding(self, encoding)"); | |
7222 static PyMethodDef __pyx_mdef_5pysam_9libctabix_6Parser_3set_encoding = {"set_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_6Parser_3set_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_6Parser_2set_encoding}; | |
7223 static PyObject *__pyx_pw_5pysam_9libctabix_6Parser_3set_encoding(PyObject *__pyx_v_self, | |
7224 #if CYTHON_METH_FASTCALL | |
7225 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
7226 #else | |
7227 PyObject *__pyx_args, PyObject *__pyx_kwds | |
7228 #endif | |
7229 ) { | |
7230 PyObject *__pyx_v_encoding = 0; | |
7231 #if !CYTHON_METH_FASTCALL | |
7232 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
7233 #endif | |
7234 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
7235 PyObject* values[1] = {0}; | |
7236 int __pyx_lineno = 0; | |
7237 const char *__pyx_filename = NULL; | |
7238 int __pyx_clineno = 0; | |
7239 PyObject *__pyx_r = 0; | |
7240 __Pyx_RefNannyDeclarations | |
7241 __Pyx_RefNannySetupContext("set_encoding (wrapper)", 0); | |
7242 #if !CYTHON_METH_FASTCALL | |
7243 #if CYTHON_ASSUME_SAFE_MACROS | |
7244 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
7245 #else | |
7246 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
7247 #endif | |
7248 #endif | |
7249 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
7250 { | |
7251 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_encoding,0}; | |
7252 if (__pyx_kwds) { | |
7253 Py_ssize_t kw_args; | |
7254 switch (__pyx_nargs) { | |
7255 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
7256 CYTHON_FALLTHROUGH; | |
7257 case 0: break; | |
7258 default: goto __pyx_L5_argtuple_error; | |
7259 } | |
7260 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
7261 switch (__pyx_nargs) { | |
7262 case 0: | |
7263 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding)) != 0)) { | |
7264 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
7265 kw_args--; | |
7266 } | |
7267 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) | |
7268 else goto __pyx_L5_argtuple_error; | |
7269 } | |
7270 if (unlikely(kw_args > 0)) { | |
7271 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
7272 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_encoding") < 0)) __PYX_ERR(0, 87, __pyx_L3_error) | |
7273 } | |
7274 } else if (unlikely(__pyx_nargs != 1)) { | |
7275 goto __pyx_L5_argtuple_error; | |
7276 } else { | |
7277 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
7278 } | |
7279 __pyx_v_encoding = values[0]; | |
7280 } | |
7281 goto __pyx_L6_skip; | |
7282 __pyx_L5_argtuple_error:; | |
7283 __Pyx_RaiseArgtupleInvalid("set_encoding", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 87, __pyx_L3_error) | |
7284 __pyx_L6_skip:; | |
7285 goto __pyx_L4_argument_unpacking_done; | |
7286 __pyx_L3_error:; | |
7287 { | |
7288 Py_ssize_t __pyx_temp; | |
7289 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
7290 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
7291 } | |
7292 } | |
7293 __Pyx_AddTraceback("pysam.libctabix.Parser.set_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7294 __Pyx_RefNannyFinishContext(); | |
7295 return NULL; | |
7296 __pyx_L4_argument_unpacking_done:; | |
7297 __pyx_r = __pyx_pf_5pysam_9libctabix_6Parser_2set_encoding(((struct __pyx_obj_5pysam_9libctabix_Parser *)__pyx_v_self), __pyx_v_encoding); | |
7298 | |
7299 /* function exit code */ | |
7300 { | |
7301 Py_ssize_t __pyx_temp; | |
7302 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
7303 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
7304 } | |
7305 } | |
7306 __Pyx_RefNannyFinishContext(); | |
7307 return __pyx_r; | |
7308 } | |
7309 | |
7310 static PyObject *__pyx_pf_5pysam_9libctabix_6Parser_2set_encoding(struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_self, PyObject *__pyx_v_encoding) { | |
7311 PyObject *__pyx_r = NULL; | |
7312 __Pyx_TraceDeclarations | |
7313 __Pyx_RefNannyDeclarations | |
7314 int __pyx_lineno = 0; | |
7315 const char *__pyx_filename = NULL; | |
7316 int __pyx_clineno = 0; | |
7317 __Pyx_TraceFrameInit(__pyx_codeobj_) | |
7318 __Pyx_RefNannySetupContext("set_encoding", 1); | |
7319 __Pyx_TraceCall("set_encoding", __pyx_f[0], 87, 0, __PYX_ERR(0, 87, __pyx_L1_error)); | |
7320 | |
7321 /* "pysam/libctabix.pyx":88 | |
7322 * | |
7323 * def set_encoding(self, encoding): | |
7324 * self.encoding = encoding # <<<<<<<<<<<<<< | |
7325 * | |
7326 * def get_encoding(self): | |
7327 */ | |
7328 __Pyx_INCREF(__pyx_v_encoding); | |
7329 __Pyx_GIVEREF(__pyx_v_encoding); | |
7330 __Pyx_GOTREF(__pyx_v_self->encoding); | |
7331 __Pyx_DECREF(__pyx_v_self->encoding); | |
7332 __pyx_v_self->encoding = __pyx_v_encoding; | |
7333 | |
7334 /* "pysam/libctabix.pyx":87 | |
7335 * self.encoding = encoding | |
7336 * | |
7337 * def set_encoding(self, encoding): # <<<<<<<<<<<<<< | |
7338 * self.encoding = encoding | |
7339 * | |
7340 */ | |
7341 | |
7342 /* function exit code */ | |
7343 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
7344 goto __pyx_L0; | |
7345 __pyx_L1_error:; | |
7346 __Pyx_AddTraceback("pysam.libctabix.Parser.set_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7347 __pyx_r = NULL; | |
7348 __pyx_L0:; | |
7349 __Pyx_XGIVEREF(__pyx_r); | |
7350 __Pyx_TraceReturn(__pyx_r, 0); | |
7351 __Pyx_RefNannyFinishContext(); | |
7352 return __pyx_r; | |
7353 } | |
7354 | |
7355 /* "pysam/libctabix.pyx":90 | |
7356 * self.encoding = encoding | |
7357 * | |
7358 * def get_encoding(self): # <<<<<<<<<<<<<< | |
7359 * return self.encoding | |
7360 * | |
7361 */ | |
7362 | |
7363 /* Python wrapper */ | |
7364 static PyObject *__pyx_pw_5pysam_9libctabix_6Parser_5get_encoding(PyObject *__pyx_v_self, | |
7365 #if CYTHON_METH_FASTCALL | |
7366 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
7367 #else | |
7368 PyObject *__pyx_args, PyObject *__pyx_kwds | |
7369 #endif | |
7370 ); /*proto*/ | |
7371 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_6Parser_4get_encoding, "Parser.get_encoding(self)"); | |
7372 static PyMethodDef __pyx_mdef_5pysam_9libctabix_6Parser_5get_encoding = {"get_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_6Parser_5get_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_6Parser_4get_encoding}; | |
7373 static PyObject *__pyx_pw_5pysam_9libctabix_6Parser_5get_encoding(PyObject *__pyx_v_self, | |
7374 #if CYTHON_METH_FASTCALL | |
7375 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
7376 #else | |
7377 PyObject *__pyx_args, PyObject *__pyx_kwds | |
7378 #endif | |
7379 ) { | |
7380 #if !CYTHON_METH_FASTCALL | |
7381 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
7382 #endif | |
7383 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
7384 PyObject *__pyx_r = 0; | |
7385 __Pyx_RefNannyDeclarations | |
7386 __Pyx_RefNannySetupContext("get_encoding (wrapper)", 0); | |
7387 #if !CYTHON_METH_FASTCALL | |
7388 #if CYTHON_ASSUME_SAFE_MACROS | |
7389 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
7390 #else | |
7391 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
7392 #endif | |
7393 #endif | |
7394 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
7395 if (unlikely(__pyx_nargs > 0)) { | |
7396 __Pyx_RaiseArgtupleInvalid("get_encoding", 1, 0, 0, __pyx_nargs); return NULL;} | |
7397 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_encoding", 0))) return NULL; | |
7398 __pyx_r = __pyx_pf_5pysam_9libctabix_6Parser_4get_encoding(((struct __pyx_obj_5pysam_9libctabix_Parser *)__pyx_v_self)); | |
7399 | |
7400 /* function exit code */ | |
7401 __Pyx_RefNannyFinishContext(); | |
7402 return __pyx_r; | |
7403 } | |
7404 | |
7405 static PyObject *__pyx_pf_5pysam_9libctabix_6Parser_4get_encoding(struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_self) { | |
7406 PyObject *__pyx_r = NULL; | |
7407 __Pyx_TraceDeclarations | |
7408 __Pyx_RefNannyDeclarations | |
7409 int __pyx_lineno = 0; | |
7410 const char *__pyx_filename = NULL; | |
7411 int __pyx_clineno = 0; | |
7412 __Pyx_TraceFrameInit(__pyx_codeobj__2) | |
7413 __Pyx_RefNannySetupContext("get_encoding", 1); | |
7414 __Pyx_TraceCall("get_encoding", __pyx_f[0], 90, 0, __PYX_ERR(0, 90, __pyx_L1_error)); | |
7415 | |
7416 /* "pysam/libctabix.pyx":91 | |
7417 * | |
7418 * def get_encoding(self): | |
7419 * return self.encoding # <<<<<<<<<<<<<< | |
7420 * | |
7421 * cdef parse(self, char * buffer, int length): | |
7422 */ | |
7423 __Pyx_XDECREF(__pyx_r); | |
7424 __Pyx_INCREF(__pyx_v_self->encoding); | |
7425 __pyx_r = __pyx_v_self->encoding; | |
7426 goto __pyx_L0; | |
7427 | |
7428 /* "pysam/libctabix.pyx":90 | |
7429 * self.encoding = encoding | |
7430 * | |
7431 * def get_encoding(self): # <<<<<<<<<<<<<< | |
7432 * return self.encoding | |
7433 * | |
7434 */ | |
7435 | |
7436 /* function exit code */ | |
7437 __pyx_L1_error:; | |
7438 __Pyx_AddTraceback("pysam.libctabix.Parser.get_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7439 __pyx_r = NULL; | |
7440 __pyx_L0:; | |
7441 __Pyx_XGIVEREF(__pyx_r); | |
7442 __Pyx_TraceReturn(__pyx_r, 0); | |
7443 __Pyx_RefNannyFinishContext(); | |
7444 return __pyx_r; | |
7445 } | |
7446 | |
7447 /* "pysam/libctabix.pyx":93 | |
7448 * return self.encoding | |
7449 * | |
7450 * cdef parse(self, char * buffer, int length): # <<<<<<<<<<<<<< | |
7451 * raise NotImplementedError( | |
7452 * 'parse method of %s not implemented' % str(self)) | |
7453 */ | |
7454 | |
7455 static PyObject *__pyx_f_5pysam_9libctabix_6Parser_parse(struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_self, CYTHON_UNUSED char *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_length) { | |
7456 PyObject *__pyx_r = NULL; | |
7457 __Pyx_TraceDeclarations | |
7458 __Pyx_RefNannyDeclarations | |
7459 PyObject *__pyx_t_1 = NULL; | |
7460 PyObject *__pyx_t_2 = NULL; | |
7461 int __pyx_lineno = 0; | |
7462 const char *__pyx_filename = NULL; | |
7463 int __pyx_clineno = 0; | |
7464 __Pyx_RefNannySetupContext("parse", 1); | |
7465 __Pyx_TraceCall("parse", __pyx_f[0], 93, 0, __PYX_ERR(0, 93, __pyx_L1_error)); | |
7466 | |
7467 /* "pysam/libctabix.pyx":95 | |
7468 * cdef parse(self, char * buffer, int length): | |
7469 * raise NotImplementedError( | |
7470 * 'parse method of %s not implemented' % str(self)) # <<<<<<<<<<<<<< | |
7471 * | |
7472 * def __call__(self, char * buffer, int length): | |
7473 */ | |
7474 __pyx_t_1 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) | |
7475 __Pyx_GOTREF(__pyx_t_1); | |
7476 __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_parse_method_of_s_not_implemente, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) | |
7477 __Pyx_GOTREF(__pyx_t_2); | |
7478 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
7479 | |
7480 /* "pysam/libctabix.pyx":94 | |
7481 * | |
7482 * cdef parse(self, char * buffer, int length): | |
7483 * raise NotImplementedError( # <<<<<<<<<<<<<< | |
7484 * 'parse method of %s not implemented' % str(self)) | |
7485 * | |
7486 */ | |
7487 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) | |
7488 __Pyx_GOTREF(__pyx_t_1); | |
7489 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
7490 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
7491 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
7492 __PYX_ERR(0, 94, __pyx_L1_error) | |
7493 | |
7494 /* "pysam/libctabix.pyx":93 | |
7495 * return self.encoding | |
7496 * | |
7497 * cdef parse(self, char * buffer, int length): # <<<<<<<<<<<<<< | |
7498 * raise NotImplementedError( | |
7499 * 'parse method of %s not implemented' % str(self)) | |
7500 */ | |
7501 | |
7502 /* function exit code */ | |
7503 __pyx_L1_error:; | |
7504 __Pyx_XDECREF(__pyx_t_1); | |
7505 __Pyx_XDECREF(__pyx_t_2); | |
7506 __Pyx_AddTraceback("pysam.libctabix.Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7507 __pyx_r = 0; | |
7508 __Pyx_XGIVEREF(__pyx_r); | |
7509 __Pyx_TraceReturn(__pyx_r, 0); | |
7510 __Pyx_RefNannyFinishContext(); | |
7511 return __pyx_r; | |
7512 } | |
7513 | |
7514 /* "pysam/libctabix.pyx":97 | |
7515 * 'parse method of %s not implemented' % str(self)) | |
7516 * | |
7517 * def __call__(self, char * buffer, int length): # <<<<<<<<<<<<<< | |
7518 * return self.parse(buffer, length) | |
7519 * | |
7520 */ | |
7521 | |
7522 /* Python wrapper */ | |
7523 static PyObject *__pyx_pw_5pysam_9libctabix_6Parser_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
7524 static PyObject *__pyx_pw_5pysam_9libctabix_6Parser_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
7525 char *__pyx_v_buffer; | |
7526 int __pyx_v_length; | |
7527 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
7528 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
7529 PyObject* values[2] = {0,0}; | |
7530 int __pyx_lineno = 0; | |
7531 const char *__pyx_filename = NULL; | |
7532 int __pyx_clineno = 0; | |
7533 PyObject *__pyx_r = 0; | |
7534 __Pyx_RefNannyDeclarations | |
7535 __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); | |
7536 #if CYTHON_ASSUME_SAFE_MACROS | |
7537 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
7538 #else | |
7539 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
7540 #endif | |
7541 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
7542 { | |
7543 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buffer,&__pyx_n_s_length,0}; | |
7544 if (__pyx_kwds) { | |
7545 Py_ssize_t kw_args; | |
7546 switch (__pyx_nargs) { | |
7547 case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); | |
7548 CYTHON_FALLTHROUGH; | |
7549 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
7550 CYTHON_FALLTHROUGH; | |
7551 case 0: break; | |
7552 default: goto __pyx_L5_argtuple_error; | |
7553 } | |
7554 kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); | |
7555 switch (__pyx_nargs) { | |
7556 case 0: | |
7557 if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buffer)) != 0)) { | |
7558 (void)__Pyx_Arg_NewRef_VARARGS(values[0]); | |
7559 kw_args--; | |
7560 } | |
7561 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L3_error) | |
7562 else goto __pyx_L5_argtuple_error; | |
7563 CYTHON_FALLTHROUGH; | |
7564 case 1: | |
7565 if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_length)) != 0)) { | |
7566 (void)__Pyx_Arg_NewRef_VARARGS(values[1]); | |
7567 kw_args--; | |
7568 } | |
7569 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L3_error) | |
7570 else { | |
7571 __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); __PYX_ERR(0, 97, __pyx_L3_error) | |
7572 } | |
7573 } | |
7574 if (unlikely(kw_args > 0)) { | |
7575 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
7576 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 97, __pyx_L3_error) | |
7577 } | |
7578 } else if (unlikely(__pyx_nargs != 2)) { | |
7579 goto __pyx_L5_argtuple_error; | |
7580 } else { | |
7581 values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
7582 values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); | |
7583 } | |
7584 __pyx_v_buffer = __Pyx_PyObject_AsWritableString(values[0]); if (unlikely((!__pyx_v_buffer) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L3_error) | |
7585 __pyx_v_length = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_length == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L3_error) | |
7586 } | |
7587 goto __pyx_L6_skip; | |
7588 __pyx_L5_argtuple_error:; | |
7589 __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 97, __pyx_L3_error) | |
7590 __pyx_L6_skip:; | |
7591 goto __pyx_L4_argument_unpacking_done; | |
7592 __pyx_L3_error:; | |
7593 { | |
7594 Py_ssize_t __pyx_temp; | |
7595 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
7596 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
7597 } | |
7598 } | |
7599 __Pyx_AddTraceback("pysam.libctabix.Parser.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7600 __Pyx_RefNannyFinishContext(); | |
7601 return NULL; | |
7602 __pyx_L4_argument_unpacking_done:; | |
7603 __pyx_r = __pyx_pf_5pysam_9libctabix_6Parser_6__call__(((struct __pyx_obj_5pysam_9libctabix_Parser *)__pyx_v_self), __pyx_v_buffer, __pyx_v_length); | |
7604 | |
7605 /* function exit code */ | |
7606 { | |
7607 Py_ssize_t __pyx_temp; | |
7608 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
7609 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
7610 } | |
7611 } | |
7612 __Pyx_RefNannyFinishContext(); | |
7613 return __pyx_r; | |
7614 } | |
7615 | |
7616 static PyObject *__pyx_pf_5pysam_9libctabix_6Parser_6__call__(struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_length) { | |
7617 PyObject *__pyx_r = NULL; | |
7618 __Pyx_TraceDeclarations | |
7619 __Pyx_RefNannyDeclarations | |
7620 PyObject *__pyx_t_1 = NULL; | |
7621 int __pyx_lineno = 0; | |
7622 const char *__pyx_filename = NULL; | |
7623 int __pyx_clineno = 0; | |
7624 __Pyx_RefNannySetupContext("__call__", 1); | |
7625 __Pyx_TraceCall("__call__", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error)); | |
7626 | |
7627 /* "pysam/libctabix.pyx":98 | |
7628 * | |
7629 * def __call__(self, char * buffer, int length): | |
7630 * return self.parse(buffer, length) # <<<<<<<<<<<<<< | |
7631 * | |
7632 * | |
7633 */ | |
7634 __Pyx_XDECREF(__pyx_r); | |
7635 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_9libctabix_Parser *)__pyx_v_self->__pyx_vtab)->parse(__pyx_v_self, __pyx_v_buffer, __pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) | |
7636 __Pyx_GOTREF(__pyx_t_1); | |
7637 __pyx_r = __pyx_t_1; | |
7638 __pyx_t_1 = 0; | |
7639 goto __pyx_L0; | |
7640 | |
7641 /* "pysam/libctabix.pyx":97 | |
7642 * 'parse method of %s not implemented' % str(self)) | |
7643 * | |
7644 * def __call__(self, char * buffer, int length): # <<<<<<<<<<<<<< | |
7645 * return self.parse(buffer, length) | |
7646 * | |
7647 */ | |
7648 | |
7649 /* function exit code */ | |
7650 __pyx_L1_error:; | |
7651 __Pyx_XDECREF(__pyx_t_1); | |
7652 __Pyx_AddTraceback("pysam.libctabix.Parser.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7653 __pyx_r = NULL; | |
7654 __pyx_L0:; | |
7655 __Pyx_XGIVEREF(__pyx_r); | |
7656 __Pyx_TraceReturn(__pyx_r, 0); | |
7657 __Pyx_RefNannyFinishContext(); | |
7658 return __pyx_r; | |
7659 } | |
7660 | |
7661 /* "(tree fragment)":1 | |
7662 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
7663 * cdef tuple state | |
7664 * cdef object _dict | |
7665 */ | |
7666 | |
7667 /* Python wrapper */ | |
7668 static PyObject *__pyx_pw_5pysam_9libctabix_6Parser_9__reduce_cython__(PyObject *__pyx_v_self, | |
7669 #if CYTHON_METH_FASTCALL | |
7670 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
7671 #else | |
7672 PyObject *__pyx_args, PyObject *__pyx_kwds | |
7673 #endif | |
7674 ); /*proto*/ | |
7675 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_6Parser_8__reduce_cython__, "Parser.__reduce_cython__(self)"); | |
7676 static PyMethodDef __pyx_mdef_5pysam_9libctabix_6Parser_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_6Parser_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_6Parser_8__reduce_cython__}; | |
7677 static PyObject *__pyx_pw_5pysam_9libctabix_6Parser_9__reduce_cython__(PyObject *__pyx_v_self, | |
7678 #if CYTHON_METH_FASTCALL | |
7679 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
7680 #else | |
7681 PyObject *__pyx_args, PyObject *__pyx_kwds | |
7682 #endif | |
7683 ) { | |
7684 #if !CYTHON_METH_FASTCALL | |
7685 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
7686 #endif | |
7687 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
7688 PyObject *__pyx_r = 0; | |
7689 __Pyx_RefNannyDeclarations | |
7690 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
7691 #if !CYTHON_METH_FASTCALL | |
7692 #if CYTHON_ASSUME_SAFE_MACROS | |
7693 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
7694 #else | |
7695 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
7696 #endif | |
7697 #endif | |
7698 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
7699 if (unlikely(__pyx_nargs > 0)) { | |
7700 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
7701 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
7702 __pyx_r = __pyx_pf_5pysam_9libctabix_6Parser_8__reduce_cython__(((struct __pyx_obj_5pysam_9libctabix_Parser *)__pyx_v_self)); | |
7703 | |
7704 /* function exit code */ | |
7705 __Pyx_RefNannyFinishContext(); | |
7706 return __pyx_r; | |
7707 } | |
7708 | |
7709 static PyObject *__pyx_pf_5pysam_9libctabix_6Parser_8__reduce_cython__(struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_self) { | |
7710 PyObject *__pyx_v_state = 0; | |
7711 PyObject *__pyx_v__dict = 0; | |
7712 int __pyx_v_use_setstate; | |
7713 PyObject *__pyx_r = NULL; | |
7714 __Pyx_TraceDeclarations | |
7715 __Pyx_RefNannyDeclarations | |
7716 PyObject *__pyx_t_1 = NULL; | |
7717 int __pyx_t_2; | |
7718 PyObject *__pyx_t_3 = NULL; | |
7719 PyObject *__pyx_t_4 = NULL; | |
7720 int __pyx_lineno = 0; | |
7721 const char *__pyx_filename = NULL; | |
7722 int __pyx_clineno = 0; | |
7723 __Pyx_TraceFrameInit(__pyx_codeobj__3) | |
7724 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
7725 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
7726 | |
7727 /* "(tree fragment)":5 | |
7728 * cdef object _dict | |
7729 * cdef bint use_setstate | |
7730 * state = (self.encoding,) # <<<<<<<<<<<<<< | |
7731 * _dict = getattr(self, '__dict__', None) | |
7732 * if _dict is not None: | |
7733 */ | |
7734 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
7735 __Pyx_GOTREF(__pyx_t_1); | |
7736 __Pyx_INCREF(__pyx_v_self->encoding); | |
7737 __Pyx_GIVEREF(__pyx_v_self->encoding); | |
7738 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->encoding)) __PYX_ERR(1, 5, __pyx_L1_error); | |
7739 __pyx_v_state = ((PyObject*)__pyx_t_1); | |
7740 __pyx_t_1 = 0; | |
7741 | |
7742 /* "(tree fragment)":6 | |
7743 * cdef bint use_setstate | |
7744 * state = (self.encoding,) | |
7745 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< | |
7746 * if _dict is not None: | |
7747 * state += (_dict,) | |
7748 */ | |
7749 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) | |
7750 __Pyx_GOTREF(__pyx_t_1); | |
7751 __pyx_v__dict = __pyx_t_1; | |
7752 __pyx_t_1 = 0; | |
7753 | |
7754 /* "(tree fragment)":7 | |
7755 * state = (self.encoding,) | |
7756 * _dict = getattr(self, '__dict__', None) | |
7757 * if _dict is not None: # <<<<<<<<<<<<<< | |
7758 * state += (_dict,) | |
7759 * use_setstate = True | |
7760 */ | |
7761 __pyx_t_2 = (__pyx_v__dict != Py_None); | |
7762 if (__pyx_t_2) { | |
7763 | |
7764 /* "(tree fragment)":8 | |
7765 * _dict = getattr(self, '__dict__', None) | |
7766 * if _dict is not None: | |
7767 * state += (_dict,) # <<<<<<<<<<<<<< | |
7768 * use_setstate = True | |
7769 * else: | |
7770 */ | |
7771 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) | |
7772 __Pyx_GOTREF(__pyx_t_1); | |
7773 __Pyx_INCREF(__pyx_v__dict); | |
7774 __Pyx_GIVEREF(__pyx_v__dict); | |
7775 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error); | |
7776 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) | |
7777 __Pyx_GOTREF(__pyx_t_3); | |
7778 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
7779 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); | |
7780 __pyx_t_3 = 0; | |
7781 | |
7782 /* "(tree fragment)":9 | |
7783 * if _dict is not None: | |
7784 * state += (_dict,) | |
7785 * use_setstate = True # <<<<<<<<<<<<<< | |
7786 * else: | |
7787 * use_setstate = self.encoding is not None | |
7788 */ | |
7789 __pyx_v_use_setstate = 1; | |
7790 | |
7791 /* "(tree fragment)":7 | |
7792 * state = (self.encoding,) | |
7793 * _dict = getattr(self, '__dict__', None) | |
7794 * if _dict is not None: # <<<<<<<<<<<<<< | |
7795 * state += (_dict,) | |
7796 * use_setstate = True | |
7797 */ | |
7798 goto __pyx_L3; | |
7799 } | |
7800 | |
7801 /* "(tree fragment)":11 | |
7802 * use_setstate = True | |
7803 * else: | |
7804 * use_setstate = self.encoding is not None # <<<<<<<<<<<<<< | |
7805 * if use_setstate: | |
7806 * return __pyx_unpickle_Parser, (type(self), 0xe8424ea, None), state | |
7807 */ | |
7808 /*else*/ { | |
7809 __pyx_t_2 = (__pyx_v_self->encoding != Py_None); | |
7810 __pyx_v_use_setstate = __pyx_t_2; | |
7811 } | |
7812 __pyx_L3:; | |
7813 | |
7814 /* "(tree fragment)":12 | |
7815 * else: | |
7816 * use_setstate = self.encoding is not None | |
7817 * if use_setstate: # <<<<<<<<<<<<<< | |
7818 * return __pyx_unpickle_Parser, (type(self), 0xe8424ea, None), state | |
7819 * else: | |
7820 */ | |
7821 if (__pyx_v_use_setstate) { | |
7822 | |
7823 /* "(tree fragment)":13 | |
7824 * use_setstate = self.encoding is not None | |
7825 * if use_setstate: | |
7826 * return __pyx_unpickle_Parser, (type(self), 0xe8424ea, None), state # <<<<<<<<<<<<<< | |
7827 * else: | |
7828 * return __pyx_unpickle_Parser, (type(self), 0xe8424ea, state) | |
7829 */ | |
7830 __Pyx_XDECREF(__pyx_r); | |
7831 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Parser); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) | |
7832 __Pyx_GOTREF(__pyx_t_3); | |
7833 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) | |
7834 __Pyx_GOTREF(__pyx_t_1); | |
7835 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
7836 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
7837 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error); | |
7838 __Pyx_INCREF(__pyx_int_243541226); | |
7839 __Pyx_GIVEREF(__pyx_int_243541226); | |
7840 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_243541226)) __PYX_ERR(1, 13, __pyx_L1_error); | |
7841 __Pyx_INCREF(Py_None); | |
7842 __Pyx_GIVEREF(Py_None); | |
7843 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error); | |
7844 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) | |
7845 __Pyx_GOTREF(__pyx_t_4); | |
7846 __Pyx_GIVEREF(__pyx_t_3); | |
7847 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error); | |
7848 __Pyx_GIVEREF(__pyx_t_1); | |
7849 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error); | |
7850 __Pyx_INCREF(__pyx_v_state); | |
7851 __Pyx_GIVEREF(__pyx_v_state); | |
7852 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error); | |
7853 __pyx_t_3 = 0; | |
7854 __pyx_t_1 = 0; | |
7855 __pyx_r = __pyx_t_4; | |
7856 __pyx_t_4 = 0; | |
7857 goto __pyx_L0; | |
7858 | |
7859 /* "(tree fragment)":12 | |
7860 * else: | |
7861 * use_setstate = self.encoding is not None | |
7862 * if use_setstate: # <<<<<<<<<<<<<< | |
7863 * return __pyx_unpickle_Parser, (type(self), 0xe8424ea, None), state | |
7864 * else: | |
7865 */ | |
7866 } | |
7867 | |
7868 /* "(tree fragment)":15 | |
7869 * return __pyx_unpickle_Parser, (type(self), 0xe8424ea, None), state | |
7870 * else: | |
7871 * return __pyx_unpickle_Parser, (type(self), 0xe8424ea, state) # <<<<<<<<<<<<<< | |
7872 * def __setstate_cython__(self, __pyx_state): | |
7873 * __pyx_unpickle_Parser__set_state(self, __pyx_state) | |
7874 */ | |
7875 /*else*/ { | |
7876 __Pyx_XDECREF(__pyx_r); | |
7877 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Parser); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) | |
7878 __Pyx_GOTREF(__pyx_t_4); | |
7879 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) | |
7880 __Pyx_GOTREF(__pyx_t_1); | |
7881 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
7882 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
7883 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error); | |
7884 __Pyx_INCREF(__pyx_int_243541226); | |
7885 __Pyx_GIVEREF(__pyx_int_243541226); | |
7886 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_243541226)) __PYX_ERR(1, 15, __pyx_L1_error); | |
7887 __Pyx_INCREF(__pyx_v_state); | |
7888 __Pyx_GIVEREF(__pyx_v_state); | |
7889 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error); | |
7890 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) | |
7891 __Pyx_GOTREF(__pyx_t_3); | |
7892 __Pyx_GIVEREF(__pyx_t_4); | |
7893 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error); | |
7894 __Pyx_GIVEREF(__pyx_t_1); | |
7895 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error); | |
7896 __pyx_t_4 = 0; | |
7897 __pyx_t_1 = 0; | |
7898 __pyx_r = __pyx_t_3; | |
7899 __pyx_t_3 = 0; | |
7900 goto __pyx_L0; | |
7901 } | |
7902 | |
7903 /* "(tree fragment)":1 | |
7904 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
7905 * cdef tuple state | |
7906 * cdef object _dict | |
7907 */ | |
7908 | |
7909 /* function exit code */ | |
7910 __pyx_L1_error:; | |
7911 __Pyx_XDECREF(__pyx_t_1); | |
7912 __Pyx_XDECREF(__pyx_t_3); | |
7913 __Pyx_XDECREF(__pyx_t_4); | |
7914 __Pyx_AddTraceback("pysam.libctabix.Parser.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7915 __pyx_r = NULL; | |
7916 __pyx_L0:; | |
7917 __Pyx_XDECREF(__pyx_v_state); | |
7918 __Pyx_XDECREF(__pyx_v__dict); | |
7919 __Pyx_XGIVEREF(__pyx_r); | |
7920 __Pyx_TraceReturn(__pyx_r, 0); | |
7921 __Pyx_RefNannyFinishContext(); | |
7922 return __pyx_r; | |
7923 } | |
7924 | |
7925 /* "(tree fragment)":16 | |
7926 * else: | |
7927 * return __pyx_unpickle_Parser, (type(self), 0xe8424ea, state) | |
7928 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
7929 * __pyx_unpickle_Parser__set_state(self, __pyx_state) | |
7930 */ | |
7931 | |
7932 /* Python wrapper */ | |
7933 static PyObject *__pyx_pw_5pysam_9libctabix_6Parser_11__setstate_cython__(PyObject *__pyx_v_self, | |
7934 #if CYTHON_METH_FASTCALL | |
7935 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
7936 #else | |
7937 PyObject *__pyx_args, PyObject *__pyx_kwds | |
7938 #endif | |
7939 ); /*proto*/ | |
7940 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_6Parser_10__setstate_cython__, "Parser.__setstate_cython__(self, __pyx_state)"); | |
7941 static PyMethodDef __pyx_mdef_5pysam_9libctabix_6Parser_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_6Parser_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_6Parser_10__setstate_cython__}; | |
7942 static PyObject *__pyx_pw_5pysam_9libctabix_6Parser_11__setstate_cython__(PyObject *__pyx_v_self, | |
7943 #if CYTHON_METH_FASTCALL | |
7944 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
7945 #else | |
7946 PyObject *__pyx_args, PyObject *__pyx_kwds | |
7947 #endif | |
7948 ) { | |
7949 PyObject *__pyx_v___pyx_state = 0; | |
7950 #if !CYTHON_METH_FASTCALL | |
7951 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
7952 #endif | |
7953 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
7954 PyObject* values[1] = {0}; | |
7955 int __pyx_lineno = 0; | |
7956 const char *__pyx_filename = NULL; | |
7957 int __pyx_clineno = 0; | |
7958 PyObject *__pyx_r = 0; | |
7959 __Pyx_RefNannyDeclarations | |
7960 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
7961 #if !CYTHON_METH_FASTCALL | |
7962 #if CYTHON_ASSUME_SAFE_MACROS | |
7963 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
7964 #else | |
7965 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
7966 #endif | |
7967 #endif | |
7968 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
7969 { | |
7970 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
7971 if (__pyx_kwds) { | |
7972 Py_ssize_t kw_args; | |
7973 switch (__pyx_nargs) { | |
7974 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
7975 CYTHON_FALLTHROUGH; | |
7976 case 0: break; | |
7977 default: goto __pyx_L5_argtuple_error; | |
7978 } | |
7979 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
7980 switch (__pyx_nargs) { | |
7981 case 0: | |
7982 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
7983 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
7984 kw_args--; | |
7985 } | |
7986 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error) | |
7987 else goto __pyx_L5_argtuple_error; | |
7988 } | |
7989 if (unlikely(kw_args > 0)) { | |
7990 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
7991 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error) | |
7992 } | |
7993 } else if (unlikely(__pyx_nargs != 1)) { | |
7994 goto __pyx_L5_argtuple_error; | |
7995 } else { | |
7996 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
7997 } | |
7998 __pyx_v___pyx_state = values[0]; | |
7999 } | |
8000 goto __pyx_L6_skip; | |
8001 __pyx_L5_argtuple_error:; | |
8002 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) | |
8003 __pyx_L6_skip:; | |
8004 goto __pyx_L4_argument_unpacking_done; | |
8005 __pyx_L3_error:; | |
8006 { | |
8007 Py_ssize_t __pyx_temp; | |
8008 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
8009 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
8010 } | |
8011 } | |
8012 __Pyx_AddTraceback("pysam.libctabix.Parser.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8013 __Pyx_RefNannyFinishContext(); | |
8014 return NULL; | |
8015 __pyx_L4_argument_unpacking_done:; | |
8016 __pyx_r = __pyx_pf_5pysam_9libctabix_6Parser_10__setstate_cython__(((struct __pyx_obj_5pysam_9libctabix_Parser *)__pyx_v_self), __pyx_v___pyx_state); | |
8017 | |
8018 /* function exit code */ | |
8019 { | |
8020 Py_ssize_t __pyx_temp; | |
8021 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
8022 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
8023 } | |
8024 } | |
8025 __Pyx_RefNannyFinishContext(); | |
8026 return __pyx_r; | |
8027 } | |
8028 | |
8029 static PyObject *__pyx_pf_5pysam_9libctabix_6Parser_10__setstate_cython__(struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_self, PyObject *__pyx_v___pyx_state) { | |
8030 PyObject *__pyx_r = NULL; | |
8031 __Pyx_TraceDeclarations | |
8032 __Pyx_RefNannyDeclarations | |
8033 PyObject *__pyx_t_1 = NULL; | |
8034 int __pyx_lineno = 0; | |
8035 const char *__pyx_filename = NULL; | |
8036 int __pyx_clineno = 0; | |
8037 __Pyx_TraceFrameInit(__pyx_codeobj__4) | |
8038 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
8039 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error)); | |
8040 | |
8041 /* "(tree fragment)":17 | |
8042 * return __pyx_unpickle_Parser, (type(self), 0xe8424ea, state) | |
8043 * def __setstate_cython__(self, __pyx_state): | |
8044 * __pyx_unpickle_Parser__set_state(self, __pyx_state) # <<<<<<<<<<<<<< | |
8045 */ | |
8046 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error) | |
8047 __pyx_t_1 = __pyx_f_5pysam_9libctabix___pyx_unpickle_Parser__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) | |
8048 __Pyx_GOTREF(__pyx_t_1); | |
8049 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8050 | |
8051 /* "(tree fragment)":16 | |
8052 * else: | |
8053 * return __pyx_unpickle_Parser, (type(self), 0xe8424ea, state) | |
8054 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
8055 * __pyx_unpickle_Parser__set_state(self, __pyx_state) | |
8056 */ | |
8057 | |
8058 /* function exit code */ | |
8059 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
8060 goto __pyx_L0; | |
8061 __pyx_L1_error:; | |
8062 __Pyx_XDECREF(__pyx_t_1); | |
8063 __Pyx_AddTraceback("pysam.libctabix.Parser.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8064 __pyx_r = NULL; | |
8065 __pyx_L0:; | |
8066 __Pyx_XGIVEREF(__pyx_r); | |
8067 __Pyx_TraceReturn(__pyx_r, 0); | |
8068 __Pyx_RefNannyFinishContext(); | |
8069 return __pyx_r; | |
8070 } | |
8071 | |
8072 /* "pysam/libctabix.pyx":106 | |
8073 * A field in a row is accessed by numeric index. | |
8074 * ''' | |
8075 * cdef parse(self, char * buffer, int len): # <<<<<<<<<<<<<< | |
8076 * cdef ctabixproxies.TupleProxy r | |
8077 * r = ctabixproxies.TupleProxy(self.encoding) | |
8078 */ | |
8079 | |
8080 static PyObject *__pyx_f_5pysam_9libctabix_7asTuple_parse(struct __pyx_obj_5pysam_9libctabix_asTuple *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len) { | |
8081 struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *__pyx_v_r = 0; | |
8082 PyObject *__pyx_r = NULL; | |
8083 __Pyx_TraceDeclarations | |
8084 __Pyx_RefNannyDeclarations | |
8085 PyObject *__pyx_t_1 = NULL; | |
8086 int __pyx_lineno = 0; | |
8087 const char *__pyx_filename = NULL; | |
8088 int __pyx_clineno = 0; | |
8089 __Pyx_RefNannySetupContext("parse", 1); | |
8090 __Pyx_TraceCall("parse", __pyx_f[0], 106, 0, __PYX_ERR(0, 106, __pyx_L1_error)); | |
8091 | |
8092 /* "pysam/libctabix.pyx":108 | |
8093 * cdef parse(self, char * buffer, int len): | |
8094 * cdef ctabixproxies.TupleProxy r | |
8095 * r = ctabixproxies.TupleProxy(self.encoding) # <<<<<<<<<<<<<< | |
8096 * # need to copy - there were some | |
8097 * # persistence issues with "present" | |
8098 */ | |
8099 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5pysam_16libctabixproxies_TupleProxy), __pyx_v_self->__pyx_base.encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) | |
8100 __Pyx_GOTREF(__pyx_t_1); | |
8101 __pyx_v_r = ((struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *)__pyx_t_1); | |
8102 __pyx_t_1 = 0; | |
8103 | |
8104 /* "pysam/libctabix.pyx":111 | |
8105 * # need to copy - there were some | |
8106 * # persistence issues with "present" | |
8107 * r.copy(buffer, len) # <<<<<<<<<<<<<< | |
8108 * return r | |
8109 * | |
8110 */ | |
8111 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_16libctabixproxies_TupleProxy *)__pyx_v_r->__pyx_vtab)->copy(__pyx_v_r, __pyx_v_buffer, __pyx_v_len, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) | |
8112 __Pyx_GOTREF(__pyx_t_1); | |
8113 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8114 | |
8115 /* "pysam/libctabix.pyx":112 | |
8116 * # persistence issues with "present" | |
8117 * r.copy(buffer, len) | |
8118 * return r # <<<<<<<<<<<<<< | |
8119 * | |
8120 * | |
8121 */ | |
8122 __Pyx_XDECREF(__pyx_r); | |
8123 __Pyx_INCREF((PyObject *)__pyx_v_r); | |
8124 __pyx_r = ((PyObject *)__pyx_v_r); | |
8125 goto __pyx_L0; | |
8126 | |
8127 /* "pysam/libctabix.pyx":106 | |
8128 * A field in a row is accessed by numeric index. | |
8129 * ''' | |
8130 * cdef parse(self, char * buffer, int len): # <<<<<<<<<<<<<< | |
8131 * cdef ctabixproxies.TupleProxy r | |
8132 * r = ctabixproxies.TupleProxy(self.encoding) | |
8133 */ | |
8134 | |
8135 /* function exit code */ | |
8136 __pyx_L1_error:; | |
8137 __Pyx_XDECREF(__pyx_t_1); | |
8138 __Pyx_AddTraceback("pysam.libctabix.asTuple.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8139 __pyx_r = 0; | |
8140 __pyx_L0:; | |
8141 __Pyx_XDECREF((PyObject *)__pyx_v_r); | |
8142 __Pyx_XGIVEREF(__pyx_r); | |
8143 __Pyx_TraceReturn(__pyx_r, 0); | |
8144 __Pyx_RefNannyFinishContext(); | |
8145 return __pyx_r; | |
8146 } | |
8147 | |
8148 /* "(tree fragment)":1 | |
8149 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
8150 * cdef tuple state | |
8151 * cdef object _dict | |
8152 */ | |
8153 | |
8154 /* Python wrapper */ | |
8155 static PyObject *__pyx_pw_5pysam_9libctabix_7asTuple_1__reduce_cython__(PyObject *__pyx_v_self, | |
8156 #if CYTHON_METH_FASTCALL | |
8157 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
8158 #else | |
8159 PyObject *__pyx_args, PyObject *__pyx_kwds | |
8160 #endif | |
8161 ); /*proto*/ | |
8162 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_7asTuple___reduce_cython__, "asTuple.__reduce_cython__(self)"); | |
8163 static PyMethodDef __pyx_mdef_5pysam_9libctabix_7asTuple_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_7asTuple_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_7asTuple___reduce_cython__}; | |
8164 static PyObject *__pyx_pw_5pysam_9libctabix_7asTuple_1__reduce_cython__(PyObject *__pyx_v_self, | |
8165 #if CYTHON_METH_FASTCALL | |
8166 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
8167 #else | |
8168 PyObject *__pyx_args, PyObject *__pyx_kwds | |
8169 #endif | |
8170 ) { | |
8171 #if !CYTHON_METH_FASTCALL | |
8172 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
8173 #endif | |
8174 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
8175 PyObject *__pyx_r = 0; | |
8176 __Pyx_RefNannyDeclarations | |
8177 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
8178 #if !CYTHON_METH_FASTCALL | |
8179 #if CYTHON_ASSUME_SAFE_MACROS | |
8180 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
8181 #else | |
8182 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
8183 #endif | |
8184 #endif | |
8185 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
8186 if (unlikely(__pyx_nargs > 0)) { | |
8187 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
8188 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
8189 __pyx_r = __pyx_pf_5pysam_9libctabix_7asTuple___reduce_cython__(((struct __pyx_obj_5pysam_9libctabix_asTuple *)__pyx_v_self)); | |
8190 | |
8191 /* function exit code */ | |
8192 __Pyx_RefNannyFinishContext(); | |
8193 return __pyx_r; | |
8194 } | |
8195 | |
8196 static PyObject *__pyx_pf_5pysam_9libctabix_7asTuple___reduce_cython__(struct __pyx_obj_5pysam_9libctabix_asTuple *__pyx_v_self) { | |
8197 PyObject *__pyx_v_state = 0; | |
8198 PyObject *__pyx_v__dict = 0; | |
8199 int __pyx_v_use_setstate; | |
8200 PyObject *__pyx_r = NULL; | |
8201 __Pyx_TraceDeclarations | |
8202 __Pyx_RefNannyDeclarations | |
8203 PyObject *__pyx_t_1 = NULL; | |
8204 int __pyx_t_2; | |
8205 PyObject *__pyx_t_3 = NULL; | |
8206 PyObject *__pyx_t_4 = NULL; | |
8207 int __pyx_lineno = 0; | |
8208 const char *__pyx_filename = NULL; | |
8209 int __pyx_clineno = 0; | |
8210 __Pyx_TraceFrameInit(__pyx_codeobj__5) | |
8211 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
8212 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
8213 | |
8214 /* "(tree fragment)":5 | |
8215 * cdef object _dict | |
8216 * cdef bint use_setstate | |
8217 * state = (self.encoding,) # <<<<<<<<<<<<<< | |
8218 * _dict = getattr(self, '__dict__', None) | |
8219 * if _dict is not None: | |
8220 */ | |
8221 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
8222 __Pyx_GOTREF(__pyx_t_1); | |
8223 __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding); | |
8224 __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding); | |
8225 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.encoding)) __PYX_ERR(1, 5, __pyx_L1_error); | |
8226 __pyx_v_state = ((PyObject*)__pyx_t_1); | |
8227 __pyx_t_1 = 0; | |
8228 | |
8229 /* "(tree fragment)":6 | |
8230 * cdef bint use_setstate | |
8231 * state = (self.encoding,) | |
8232 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< | |
8233 * if _dict is not None: | |
8234 * state += (_dict,) | |
8235 */ | |
8236 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) | |
8237 __Pyx_GOTREF(__pyx_t_1); | |
8238 __pyx_v__dict = __pyx_t_1; | |
8239 __pyx_t_1 = 0; | |
8240 | |
8241 /* "(tree fragment)":7 | |
8242 * state = (self.encoding,) | |
8243 * _dict = getattr(self, '__dict__', None) | |
8244 * if _dict is not None: # <<<<<<<<<<<<<< | |
8245 * state += (_dict,) | |
8246 * use_setstate = True | |
8247 */ | |
8248 __pyx_t_2 = (__pyx_v__dict != Py_None); | |
8249 if (__pyx_t_2) { | |
8250 | |
8251 /* "(tree fragment)":8 | |
8252 * _dict = getattr(self, '__dict__', None) | |
8253 * if _dict is not None: | |
8254 * state += (_dict,) # <<<<<<<<<<<<<< | |
8255 * use_setstate = True | |
8256 * else: | |
8257 */ | |
8258 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) | |
8259 __Pyx_GOTREF(__pyx_t_1); | |
8260 __Pyx_INCREF(__pyx_v__dict); | |
8261 __Pyx_GIVEREF(__pyx_v__dict); | |
8262 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error); | |
8263 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) | |
8264 __Pyx_GOTREF(__pyx_t_3); | |
8265 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8266 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); | |
8267 __pyx_t_3 = 0; | |
8268 | |
8269 /* "(tree fragment)":9 | |
8270 * if _dict is not None: | |
8271 * state += (_dict,) | |
8272 * use_setstate = True # <<<<<<<<<<<<<< | |
8273 * else: | |
8274 * use_setstate = self.encoding is not None | |
8275 */ | |
8276 __pyx_v_use_setstate = 1; | |
8277 | |
8278 /* "(tree fragment)":7 | |
8279 * state = (self.encoding,) | |
8280 * _dict = getattr(self, '__dict__', None) | |
8281 * if _dict is not None: # <<<<<<<<<<<<<< | |
8282 * state += (_dict,) | |
8283 * use_setstate = True | |
8284 */ | |
8285 goto __pyx_L3; | |
8286 } | |
8287 | |
8288 /* "(tree fragment)":11 | |
8289 * use_setstate = True | |
8290 * else: | |
8291 * use_setstate = self.encoding is not None # <<<<<<<<<<<<<< | |
8292 * if use_setstate: | |
8293 * return __pyx_unpickle_asTuple, (type(self), 0xe8424ea, None), state | |
8294 */ | |
8295 /*else*/ { | |
8296 __pyx_t_2 = (__pyx_v_self->__pyx_base.encoding != Py_None); | |
8297 __pyx_v_use_setstate = __pyx_t_2; | |
8298 } | |
8299 __pyx_L3:; | |
8300 | |
8301 /* "(tree fragment)":12 | |
8302 * else: | |
8303 * use_setstate = self.encoding is not None | |
8304 * if use_setstate: # <<<<<<<<<<<<<< | |
8305 * return __pyx_unpickle_asTuple, (type(self), 0xe8424ea, None), state | |
8306 * else: | |
8307 */ | |
8308 if (__pyx_v_use_setstate) { | |
8309 | |
8310 /* "(tree fragment)":13 | |
8311 * use_setstate = self.encoding is not None | |
8312 * if use_setstate: | |
8313 * return __pyx_unpickle_asTuple, (type(self), 0xe8424ea, None), state # <<<<<<<<<<<<<< | |
8314 * else: | |
8315 * return __pyx_unpickle_asTuple, (type(self), 0xe8424ea, state) | |
8316 */ | |
8317 __Pyx_XDECREF(__pyx_r); | |
8318 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_asTuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) | |
8319 __Pyx_GOTREF(__pyx_t_3); | |
8320 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) | |
8321 __Pyx_GOTREF(__pyx_t_1); | |
8322 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
8323 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
8324 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error); | |
8325 __Pyx_INCREF(__pyx_int_243541226); | |
8326 __Pyx_GIVEREF(__pyx_int_243541226); | |
8327 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_243541226)) __PYX_ERR(1, 13, __pyx_L1_error); | |
8328 __Pyx_INCREF(Py_None); | |
8329 __Pyx_GIVEREF(Py_None); | |
8330 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error); | |
8331 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) | |
8332 __Pyx_GOTREF(__pyx_t_4); | |
8333 __Pyx_GIVEREF(__pyx_t_3); | |
8334 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error); | |
8335 __Pyx_GIVEREF(__pyx_t_1); | |
8336 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error); | |
8337 __Pyx_INCREF(__pyx_v_state); | |
8338 __Pyx_GIVEREF(__pyx_v_state); | |
8339 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error); | |
8340 __pyx_t_3 = 0; | |
8341 __pyx_t_1 = 0; | |
8342 __pyx_r = __pyx_t_4; | |
8343 __pyx_t_4 = 0; | |
8344 goto __pyx_L0; | |
8345 | |
8346 /* "(tree fragment)":12 | |
8347 * else: | |
8348 * use_setstate = self.encoding is not None | |
8349 * if use_setstate: # <<<<<<<<<<<<<< | |
8350 * return __pyx_unpickle_asTuple, (type(self), 0xe8424ea, None), state | |
8351 * else: | |
8352 */ | |
8353 } | |
8354 | |
8355 /* "(tree fragment)":15 | |
8356 * return __pyx_unpickle_asTuple, (type(self), 0xe8424ea, None), state | |
8357 * else: | |
8358 * return __pyx_unpickle_asTuple, (type(self), 0xe8424ea, state) # <<<<<<<<<<<<<< | |
8359 * def __setstate_cython__(self, __pyx_state): | |
8360 * __pyx_unpickle_asTuple__set_state(self, __pyx_state) | |
8361 */ | |
8362 /*else*/ { | |
8363 __Pyx_XDECREF(__pyx_r); | |
8364 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_asTuple); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) | |
8365 __Pyx_GOTREF(__pyx_t_4); | |
8366 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) | |
8367 __Pyx_GOTREF(__pyx_t_1); | |
8368 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
8369 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
8370 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error); | |
8371 __Pyx_INCREF(__pyx_int_243541226); | |
8372 __Pyx_GIVEREF(__pyx_int_243541226); | |
8373 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_243541226)) __PYX_ERR(1, 15, __pyx_L1_error); | |
8374 __Pyx_INCREF(__pyx_v_state); | |
8375 __Pyx_GIVEREF(__pyx_v_state); | |
8376 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error); | |
8377 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) | |
8378 __Pyx_GOTREF(__pyx_t_3); | |
8379 __Pyx_GIVEREF(__pyx_t_4); | |
8380 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error); | |
8381 __Pyx_GIVEREF(__pyx_t_1); | |
8382 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error); | |
8383 __pyx_t_4 = 0; | |
8384 __pyx_t_1 = 0; | |
8385 __pyx_r = __pyx_t_3; | |
8386 __pyx_t_3 = 0; | |
8387 goto __pyx_L0; | |
8388 } | |
8389 | |
8390 /* "(tree fragment)":1 | |
8391 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
8392 * cdef tuple state | |
8393 * cdef object _dict | |
8394 */ | |
8395 | |
8396 /* function exit code */ | |
8397 __pyx_L1_error:; | |
8398 __Pyx_XDECREF(__pyx_t_1); | |
8399 __Pyx_XDECREF(__pyx_t_3); | |
8400 __Pyx_XDECREF(__pyx_t_4); | |
8401 __Pyx_AddTraceback("pysam.libctabix.asTuple.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8402 __pyx_r = NULL; | |
8403 __pyx_L0:; | |
8404 __Pyx_XDECREF(__pyx_v_state); | |
8405 __Pyx_XDECREF(__pyx_v__dict); | |
8406 __Pyx_XGIVEREF(__pyx_r); | |
8407 __Pyx_TraceReturn(__pyx_r, 0); | |
8408 __Pyx_RefNannyFinishContext(); | |
8409 return __pyx_r; | |
8410 } | |
8411 | |
8412 /* "(tree fragment)":16 | |
8413 * else: | |
8414 * return __pyx_unpickle_asTuple, (type(self), 0xe8424ea, state) | |
8415 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
8416 * __pyx_unpickle_asTuple__set_state(self, __pyx_state) | |
8417 */ | |
8418 | |
8419 /* Python wrapper */ | |
8420 static PyObject *__pyx_pw_5pysam_9libctabix_7asTuple_3__setstate_cython__(PyObject *__pyx_v_self, | |
8421 #if CYTHON_METH_FASTCALL | |
8422 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
8423 #else | |
8424 PyObject *__pyx_args, PyObject *__pyx_kwds | |
8425 #endif | |
8426 ); /*proto*/ | |
8427 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_7asTuple_2__setstate_cython__, "asTuple.__setstate_cython__(self, __pyx_state)"); | |
8428 static PyMethodDef __pyx_mdef_5pysam_9libctabix_7asTuple_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_7asTuple_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_7asTuple_2__setstate_cython__}; | |
8429 static PyObject *__pyx_pw_5pysam_9libctabix_7asTuple_3__setstate_cython__(PyObject *__pyx_v_self, | |
8430 #if CYTHON_METH_FASTCALL | |
8431 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
8432 #else | |
8433 PyObject *__pyx_args, PyObject *__pyx_kwds | |
8434 #endif | |
8435 ) { | |
8436 PyObject *__pyx_v___pyx_state = 0; | |
8437 #if !CYTHON_METH_FASTCALL | |
8438 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
8439 #endif | |
8440 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
8441 PyObject* values[1] = {0}; | |
8442 int __pyx_lineno = 0; | |
8443 const char *__pyx_filename = NULL; | |
8444 int __pyx_clineno = 0; | |
8445 PyObject *__pyx_r = 0; | |
8446 __Pyx_RefNannyDeclarations | |
8447 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
8448 #if !CYTHON_METH_FASTCALL | |
8449 #if CYTHON_ASSUME_SAFE_MACROS | |
8450 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
8451 #else | |
8452 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
8453 #endif | |
8454 #endif | |
8455 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
8456 { | |
8457 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
8458 if (__pyx_kwds) { | |
8459 Py_ssize_t kw_args; | |
8460 switch (__pyx_nargs) { | |
8461 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
8462 CYTHON_FALLTHROUGH; | |
8463 case 0: break; | |
8464 default: goto __pyx_L5_argtuple_error; | |
8465 } | |
8466 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
8467 switch (__pyx_nargs) { | |
8468 case 0: | |
8469 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
8470 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
8471 kw_args--; | |
8472 } | |
8473 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error) | |
8474 else goto __pyx_L5_argtuple_error; | |
8475 } | |
8476 if (unlikely(kw_args > 0)) { | |
8477 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
8478 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error) | |
8479 } | |
8480 } else if (unlikely(__pyx_nargs != 1)) { | |
8481 goto __pyx_L5_argtuple_error; | |
8482 } else { | |
8483 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
8484 } | |
8485 __pyx_v___pyx_state = values[0]; | |
8486 } | |
8487 goto __pyx_L6_skip; | |
8488 __pyx_L5_argtuple_error:; | |
8489 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) | |
8490 __pyx_L6_skip:; | |
8491 goto __pyx_L4_argument_unpacking_done; | |
8492 __pyx_L3_error:; | |
8493 { | |
8494 Py_ssize_t __pyx_temp; | |
8495 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
8496 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
8497 } | |
8498 } | |
8499 __Pyx_AddTraceback("pysam.libctabix.asTuple.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8500 __Pyx_RefNannyFinishContext(); | |
8501 return NULL; | |
8502 __pyx_L4_argument_unpacking_done:; | |
8503 __pyx_r = __pyx_pf_5pysam_9libctabix_7asTuple_2__setstate_cython__(((struct __pyx_obj_5pysam_9libctabix_asTuple *)__pyx_v_self), __pyx_v___pyx_state); | |
8504 | |
8505 /* function exit code */ | |
8506 { | |
8507 Py_ssize_t __pyx_temp; | |
8508 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
8509 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
8510 } | |
8511 } | |
8512 __Pyx_RefNannyFinishContext(); | |
8513 return __pyx_r; | |
8514 } | |
8515 | |
8516 static PyObject *__pyx_pf_5pysam_9libctabix_7asTuple_2__setstate_cython__(struct __pyx_obj_5pysam_9libctabix_asTuple *__pyx_v_self, PyObject *__pyx_v___pyx_state) { | |
8517 PyObject *__pyx_r = NULL; | |
8518 __Pyx_TraceDeclarations | |
8519 __Pyx_RefNannyDeclarations | |
8520 PyObject *__pyx_t_1 = NULL; | |
8521 int __pyx_lineno = 0; | |
8522 const char *__pyx_filename = NULL; | |
8523 int __pyx_clineno = 0; | |
8524 __Pyx_TraceFrameInit(__pyx_codeobj__6) | |
8525 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
8526 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error)); | |
8527 | |
8528 /* "(tree fragment)":17 | |
8529 * return __pyx_unpickle_asTuple, (type(self), 0xe8424ea, state) | |
8530 * def __setstate_cython__(self, __pyx_state): | |
8531 * __pyx_unpickle_asTuple__set_state(self, __pyx_state) # <<<<<<<<<<<<<< | |
8532 */ | |
8533 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error) | |
8534 __pyx_t_1 = __pyx_f_5pysam_9libctabix___pyx_unpickle_asTuple__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) | |
8535 __Pyx_GOTREF(__pyx_t_1); | |
8536 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8537 | |
8538 /* "(tree fragment)":16 | |
8539 * else: | |
8540 * return __pyx_unpickle_asTuple, (type(self), 0xe8424ea, state) | |
8541 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
8542 * __pyx_unpickle_asTuple__set_state(self, __pyx_state) | |
8543 */ | |
8544 | |
8545 /* function exit code */ | |
8546 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
8547 goto __pyx_L0; | |
8548 __pyx_L1_error:; | |
8549 __Pyx_XDECREF(__pyx_t_1); | |
8550 __Pyx_AddTraceback("pysam.libctabix.asTuple.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8551 __pyx_r = NULL; | |
8552 __pyx_L0:; | |
8553 __Pyx_XGIVEREF(__pyx_r); | |
8554 __Pyx_TraceReturn(__pyx_r, 0); | |
8555 __Pyx_RefNannyFinishContext(); | |
8556 return __pyx_r; | |
8557 } | |
8558 | |
8559 /* "pysam/libctabix.pyx":144 | |
8560 * | |
8561 * ''' | |
8562 * cdef parse(self, char * buffer, int len): # <<<<<<<<<<<<<< | |
8563 * cdef ctabixproxies.GFF3Proxy r | |
8564 * r = ctabixproxies.GFF3Proxy(self.encoding) | |
8565 */ | |
8566 | |
8567 static PyObject *__pyx_f_5pysam_9libctabix_6asGFF3_parse(struct __pyx_obj_5pysam_9libctabix_asGFF3 *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len) { | |
8568 struct __pyx_obj_5pysam_16libctabixproxies_GFF3Proxy *__pyx_v_r = 0; | |
8569 PyObject *__pyx_r = NULL; | |
8570 __Pyx_TraceDeclarations | |
8571 __Pyx_RefNannyDeclarations | |
8572 PyObject *__pyx_t_1 = NULL; | |
8573 int __pyx_lineno = 0; | |
8574 const char *__pyx_filename = NULL; | |
8575 int __pyx_clineno = 0; | |
8576 __Pyx_RefNannySetupContext("parse", 1); | |
8577 __Pyx_TraceCall("parse", __pyx_f[0], 144, 0, __PYX_ERR(0, 144, __pyx_L1_error)); | |
8578 | |
8579 /* "pysam/libctabix.pyx":146 | |
8580 * cdef parse(self, char * buffer, int len): | |
8581 * cdef ctabixproxies.GFF3Proxy r | |
8582 * r = ctabixproxies.GFF3Proxy(self.encoding) # <<<<<<<<<<<<<< | |
8583 * r.copy(buffer, len) | |
8584 * return r | |
8585 */ | |
8586 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy), __pyx_v_self->__pyx_base.encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) | |
8587 __Pyx_GOTREF(__pyx_t_1); | |
8588 __pyx_v_r = ((struct __pyx_obj_5pysam_16libctabixproxies_GFF3Proxy *)__pyx_t_1); | |
8589 __pyx_t_1 = 0; | |
8590 | |
8591 /* "pysam/libctabix.pyx":147 | |
8592 * cdef ctabixproxies.GFF3Proxy r | |
8593 * r = ctabixproxies.GFF3Proxy(self.encoding) | |
8594 * r.copy(buffer, len) # <<<<<<<<<<<<<< | |
8595 * return r | |
8596 * | |
8597 */ | |
8598 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_16libctabixproxies_GFF3Proxy *)__pyx_v_r->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base.copy(((struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *)__pyx_v_r), __pyx_v_buffer, __pyx_v_len, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) | |
8599 __Pyx_GOTREF(__pyx_t_1); | |
8600 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8601 | |
8602 /* "pysam/libctabix.pyx":148 | |
8603 * r = ctabixproxies.GFF3Proxy(self.encoding) | |
8604 * r.copy(buffer, len) | |
8605 * return r # <<<<<<<<<<<<<< | |
8606 * | |
8607 * | |
8608 */ | |
8609 __Pyx_XDECREF(__pyx_r); | |
8610 __Pyx_INCREF((PyObject *)__pyx_v_r); | |
8611 __pyx_r = ((PyObject *)__pyx_v_r); | |
8612 goto __pyx_L0; | |
8613 | |
8614 /* "pysam/libctabix.pyx":144 | |
8615 * | |
8616 * ''' | |
8617 * cdef parse(self, char * buffer, int len): # <<<<<<<<<<<<<< | |
8618 * cdef ctabixproxies.GFF3Proxy r | |
8619 * r = ctabixproxies.GFF3Proxy(self.encoding) | |
8620 */ | |
8621 | |
8622 /* function exit code */ | |
8623 __pyx_L1_error:; | |
8624 __Pyx_XDECREF(__pyx_t_1); | |
8625 __Pyx_AddTraceback("pysam.libctabix.asGFF3.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8626 __pyx_r = 0; | |
8627 __pyx_L0:; | |
8628 __Pyx_XDECREF((PyObject *)__pyx_v_r); | |
8629 __Pyx_XGIVEREF(__pyx_r); | |
8630 __Pyx_TraceReturn(__pyx_r, 0); | |
8631 __Pyx_RefNannyFinishContext(); | |
8632 return __pyx_r; | |
8633 } | |
8634 | |
8635 /* "(tree fragment)":1 | |
8636 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
8637 * cdef tuple state | |
8638 * cdef object _dict | |
8639 */ | |
8640 | |
8641 /* Python wrapper */ | |
8642 static PyObject *__pyx_pw_5pysam_9libctabix_6asGFF3_1__reduce_cython__(PyObject *__pyx_v_self, | |
8643 #if CYTHON_METH_FASTCALL | |
8644 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
8645 #else | |
8646 PyObject *__pyx_args, PyObject *__pyx_kwds | |
8647 #endif | |
8648 ); /*proto*/ | |
8649 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_6asGFF3___reduce_cython__, "asGFF3.__reduce_cython__(self)"); | |
8650 static PyMethodDef __pyx_mdef_5pysam_9libctabix_6asGFF3_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_6asGFF3_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_6asGFF3___reduce_cython__}; | |
8651 static PyObject *__pyx_pw_5pysam_9libctabix_6asGFF3_1__reduce_cython__(PyObject *__pyx_v_self, | |
8652 #if CYTHON_METH_FASTCALL | |
8653 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
8654 #else | |
8655 PyObject *__pyx_args, PyObject *__pyx_kwds | |
8656 #endif | |
8657 ) { | |
8658 #if !CYTHON_METH_FASTCALL | |
8659 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
8660 #endif | |
8661 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
8662 PyObject *__pyx_r = 0; | |
8663 __Pyx_RefNannyDeclarations | |
8664 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
8665 #if !CYTHON_METH_FASTCALL | |
8666 #if CYTHON_ASSUME_SAFE_MACROS | |
8667 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
8668 #else | |
8669 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
8670 #endif | |
8671 #endif | |
8672 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
8673 if (unlikely(__pyx_nargs > 0)) { | |
8674 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
8675 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
8676 __pyx_r = __pyx_pf_5pysam_9libctabix_6asGFF3___reduce_cython__(((struct __pyx_obj_5pysam_9libctabix_asGFF3 *)__pyx_v_self)); | |
8677 | |
8678 /* function exit code */ | |
8679 __Pyx_RefNannyFinishContext(); | |
8680 return __pyx_r; | |
8681 } | |
8682 | |
8683 static PyObject *__pyx_pf_5pysam_9libctabix_6asGFF3___reduce_cython__(struct __pyx_obj_5pysam_9libctabix_asGFF3 *__pyx_v_self) { | |
8684 PyObject *__pyx_v_state = 0; | |
8685 PyObject *__pyx_v__dict = 0; | |
8686 int __pyx_v_use_setstate; | |
8687 PyObject *__pyx_r = NULL; | |
8688 __Pyx_TraceDeclarations | |
8689 __Pyx_RefNannyDeclarations | |
8690 PyObject *__pyx_t_1 = NULL; | |
8691 int __pyx_t_2; | |
8692 PyObject *__pyx_t_3 = NULL; | |
8693 PyObject *__pyx_t_4 = NULL; | |
8694 int __pyx_lineno = 0; | |
8695 const char *__pyx_filename = NULL; | |
8696 int __pyx_clineno = 0; | |
8697 __Pyx_TraceFrameInit(__pyx_codeobj__7) | |
8698 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
8699 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
8700 | |
8701 /* "(tree fragment)":5 | |
8702 * cdef object _dict | |
8703 * cdef bint use_setstate | |
8704 * state = (self.encoding,) # <<<<<<<<<<<<<< | |
8705 * _dict = getattr(self, '__dict__', None) | |
8706 * if _dict is not None: | |
8707 */ | |
8708 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
8709 __Pyx_GOTREF(__pyx_t_1); | |
8710 __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding); | |
8711 __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding); | |
8712 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.encoding)) __PYX_ERR(1, 5, __pyx_L1_error); | |
8713 __pyx_v_state = ((PyObject*)__pyx_t_1); | |
8714 __pyx_t_1 = 0; | |
8715 | |
8716 /* "(tree fragment)":6 | |
8717 * cdef bint use_setstate | |
8718 * state = (self.encoding,) | |
8719 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< | |
8720 * if _dict is not None: | |
8721 * state += (_dict,) | |
8722 */ | |
8723 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) | |
8724 __Pyx_GOTREF(__pyx_t_1); | |
8725 __pyx_v__dict = __pyx_t_1; | |
8726 __pyx_t_1 = 0; | |
8727 | |
8728 /* "(tree fragment)":7 | |
8729 * state = (self.encoding,) | |
8730 * _dict = getattr(self, '__dict__', None) | |
8731 * if _dict is not None: # <<<<<<<<<<<<<< | |
8732 * state += (_dict,) | |
8733 * use_setstate = True | |
8734 */ | |
8735 __pyx_t_2 = (__pyx_v__dict != Py_None); | |
8736 if (__pyx_t_2) { | |
8737 | |
8738 /* "(tree fragment)":8 | |
8739 * _dict = getattr(self, '__dict__', None) | |
8740 * if _dict is not None: | |
8741 * state += (_dict,) # <<<<<<<<<<<<<< | |
8742 * use_setstate = True | |
8743 * else: | |
8744 */ | |
8745 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) | |
8746 __Pyx_GOTREF(__pyx_t_1); | |
8747 __Pyx_INCREF(__pyx_v__dict); | |
8748 __Pyx_GIVEREF(__pyx_v__dict); | |
8749 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error); | |
8750 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) | |
8751 __Pyx_GOTREF(__pyx_t_3); | |
8752 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8753 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); | |
8754 __pyx_t_3 = 0; | |
8755 | |
8756 /* "(tree fragment)":9 | |
8757 * if _dict is not None: | |
8758 * state += (_dict,) | |
8759 * use_setstate = True # <<<<<<<<<<<<<< | |
8760 * else: | |
8761 * use_setstate = self.encoding is not None | |
8762 */ | |
8763 __pyx_v_use_setstate = 1; | |
8764 | |
8765 /* "(tree fragment)":7 | |
8766 * state = (self.encoding,) | |
8767 * _dict = getattr(self, '__dict__', None) | |
8768 * if _dict is not None: # <<<<<<<<<<<<<< | |
8769 * state += (_dict,) | |
8770 * use_setstate = True | |
8771 */ | |
8772 goto __pyx_L3; | |
8773 } | |
8774 | |
8775 /* "(tree fragment)":11 | |
8776 * use_setstate = True | |
8777 * else: | |
8778 * use_setstate = self.encoding is not None # <<<<<<<<<<<<<< | |
8779 * if use_setstate: | |
8780 * return __pyx_unpickle_asGFF3, (type(self), 0xe8424ea, None), state | |
8781 */ | |
8782 /*else*/ { | |
8783 __pyx_t_2 = (__pyx_v_self->__pyx_base.encoding != Py_None); | |
8784 __pyx_v_use_setstate = __pyx_t_2; | |
8785 } | |
8786 __pyx_L3:; | |
8787 | |
8788 /* "(tree fragment)":12 | |
8789 * else: | |
8790 * use_setstate = self.encoding is not None | |
8791 * if use_setstate: # <<<<<<<<<<<<<< | |
8792 * return __pyx_unpickle_asGFF3, (type(self), 0xe8424ea, None), state | |
8793 * else: | |
8794 */ | |
8795 if (__pyx_v_use_setstate) { | |
8796 | |
8797 /* "(tree fragment)":13 | |
8798 * use_setstate = self.encoding is not None | |
8799 * if use_setstate: | |
8800 * return __pyx_unpickle_asGFF3, (type(self), 0xe8424ea, None), state # <<<<<<<<<<<<<< | |
8801 * else: | |
8802 * return __pyx_unpickle_asGFF3, (type(self), 0xe8424ea, state) | |
8803 */ | |
8804 __Pyx_XDECREF(__pyx_r); | |
8805 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_asGFF3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) | |
8806 __Pyx_GOTREF(__pyx_t_3); | |
8807 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) | |
8808 __Pyx_GOTREF(__pyx_t_1); | |
8809 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
8810 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
8811 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error); | |
8812 __Pyx_INCREF(__pyx_int_243541226); | |
8813 __Pyx_GIVEREF(__pyx_int_243541226); | |
8814 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_243541226)) __PYX_ERR(1, 13, __pyx_L1_error); | |
8815 __Pyx_INCREF(Py_None); | |
8816 __Pyx_GIVEREF(Py_None); | |
8817 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error); | |
8818 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) | |
8819 __Pyx_GOTREF(__pyx_t_4); | |
8820 __Pyx_GIVEREF(__pyx_t_3); | |
8821 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error); | |
8822 __Pyx_GIVEREF(__pyx_t_1); | |
8823 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error); | |
8824 __Pyx_INCREF(__pyx_v_state); | |
8825 __Pyx_GIVEREF(__pyx_v_state); | |
8826 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error); | |
8827 __pyx_t_3 = 0; | |
8828 __pyx_t_1 = 0; | |
8829 __pyx_r = __pyx_t_4; | |
8830 __pyx_t_4 = 0; | |
8831 goto __pyx_L0; | |
8832 | |
8833 /* "(tree fragment)":12 | |
8834 * else: | |
8835 * use_setstate = self.encoding is not None | |
8836 * if use_setstate: # <<<<<<<<<<<<<< | |
8837 * return __pyx_unpickle_asGFF3, (type(self), 0xe8424ea, None), state | |
8838 * else: | |
8839 */ | |
8840 } | |
8841 | |
8842 /* "(tree fragment)":15 | |
8843 * return __pyx_unpickle_asGFF3, (type(self), 0xe8424ea, None), state | |
8844 * else: | |
8845 * return __pyx_unpickle_asGFF3, (type(self), 0xe8424ea, state) # <<<<<<<<<<<<<< | |
8846 * def __setstate_cython__(self, __pyx_state): | |
8847 * __pyx_unpickle_asGFF3__set_state(self, __pyx_state) | |
8848 */ | |
8849 /*else*/ { | |
8850 __Pyx_XDECREF(__pyx_r); | |
8851 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_asGFF3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) | |
8852 __Pyx_GOTREF(__pyx_t_4); | |
8853 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) | |
8854 __Pyx_GOTREF(__pyx_t_1); | |
8855 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
8856 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
8857 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error); | |
8858 __Pyx_INCREF(__pyx_int_243541226); | |
8859 __Pyx_GIVEREF(__pyx_int_243541226); | |
8860 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_243541226)) __PYX_ERR(1, 15, __pyx_L1_error); | |
8861 __Pyx_INCREF(__pyx_v_state); | |
8862 __Pyx_GIVEREF(__pyx_v_state); | |
8863 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error); | |
8864 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) | |
8865 __Pyx_GOTREF(__pyx_t_3); | |
8866 __Pyx_GIVEREF(__pyx_t_4); | |
8867 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error); | |
8868 __Pyx_GIVEREF(__pyx_t_1); | |
8869 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error); | |
8870 __pyx_t_4 = 0; | |
8871 __pyx_t_1 = 0; | |
8872 __pyx_r = __pyx_t_3; | |
8873 __pyx_t_3 = 0; | |
8874 goto __pyx_L0; | |
8875 } | |
8876 | |
8877 /* "(tree fragment)":1 | |
8878 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
8879 * cdef tuple state | |
8880 * cdef object _dict | |
8881 */ | |
8882 | |
8883 /* function exit code */ | |
8884 __pyx_L1_error:; | |
8885 __Pyx_XDECREF(__pyx_t_1); | |
8886 __Pyx_XDECREF(__pyx_t_3); | |
8887 __Pyx_XDECREF(__pyx_t_4); | |
8888 __Pyx_AddTraceback("pysam.libctabix.asGFF3.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8889 __pyx_r = NULL; | |
8890 __pyx_L0:; | |
8891 __Pyx_XDECREF(__pyx_v_state); | |
8892 __Pyx_XDECREF(__pyx_v__dict); | |
8893 __Pyx_XGIVEREF(__pyx_r); | |
8894 __Pyx_TraceReturn(__pyx_r, 0); | |
8895 __Pyx_RefNannyFinishContext(); | |
8896 return __pyx_r; | |
8897 } | |
8898 | |
8899 /* "(tree fragment)":16 | |
8900 * else: | |
8901 * return __pyx_unpickle_asGFF3, (type(self), 0xe8424ea, state) | |
8902 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
8903 * __pyx_unpickle_asGFF3__set_state(self, __pyx_state) | |
8904 */ | |
8905 | |
8906 /* Python wrapper */ | |
8907 static PyObject *__pyx_pw_5pysam_9libctabix_6asGFF3_3__setstate_cython__(PyObject *__pyx_v_self, | |
8908 #if CYTHON_METH_FASTCALL | |
8909 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
8910 #else | |
8911 PyObject *__pyx_args, PyObject *__pyx_kwds | |
8912 #endif | |
8913 ); /*proto*/ | |
8914 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_6asGFF3_2__setstate_cython__, "asGFF3.__setstate_cython__(self, __pyx_state)"); | |
8915 static PyMethodDef __pyx_mdef_5pysam_9libctabix_6asGFF3_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_6asGFF3_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_6asGFF3_2__setstate_cython__}; | |
8916 static PyObject *__pyx_pw_5pysam_9libctabix_6asGFF3_3__setstate_cython__(PyObject *__pyx_v_self, | |
8917 #if CYTHON_METH_FASTCALL | |
8918 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
8919 #else | |
8920 PyObject *__pyx_args, PyObject *__pyx_kwds | |
8921 #endif | |
8922 ) { | |
8923 PyObject *__pyx_v___pyx_state = 0; | |
8924 #if !CYTHON_METH_FASTCALL | |
8925 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
8926 #endif | |
8927 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
8928 PyObject* values[1] = {0}; | |
8929 int __pyx_lineno = 0; | |
8930 const char *__pyx_filename = NULL; | |
8931 int __pyx_clineno = 0; | |
8932 PyObject *__pyx_r = 0; | |
8933 __Pyx_RefNannyDeclarations | |
8934 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
8935 #if !CYTHON_METH_FASTCALL | |
8936 #if CYTHON_ASSUME_SAFE_MACROS | |
8937 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
8938 #else | |
8939 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
8940 #endif | |
8941 #endif | |
8942 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
8943 { | |
8944 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
8945 if (__pyx_kwds) { | |
8946 Py_ssize_t kw_args; | |
8947 switch (__pyx_nargs) { | |
8948 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
8949 CYTHON_FALLTHROUGH; | |
8950 case 0: break; | |
8951 default: goto __pyx_L5_argtuple_error; | |
8952 } | |
8953 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
8954 switch (__pyx_nargs) { | |
8955 case 0: | |
8956 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
8957 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
8958 kw_args--; | |
8959 } | |
8960 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error) | |
8961 else goto __pyx_L5_argtuple_error; | |
8962 } | |
8963 if (unlikely(kw_args > 0)) { | |
8964 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
8965 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error) | |
8966 } | |
8967 } else if (unlikely(__pyx_nargs != 1)) { | |
8968 goto __pyx_L5_argtuple_error; | |
8969 } else { | |
8970 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
8971 } | |
8972 __pyx_v___pyx_state = values[0]; | |
8973 } | |
8974 goto __pyx_L6_skip; | |
8975 __pyx_L5_argtuple_error:; | |
8976 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) | |
8977 __pyx_L6_skip:; | |
8978 goto __pyx_L4_argument_unpacking_done; | |
8979 __pyx_L3_error:; | |
8980 { | |
8981 Py_ssize_t __pyx_temp; | |
8982 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
8983 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
8984 } | |
8985 } | |
8986 __Pyx_AddTraceback("pysam.libctabix.asGFF3.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8987 __Pyx_RefNannyFinishContext(); | |
8988 return NULL; | |
8989 __pyx_L4_argument_unpacking_done:; | |
8990 __pyx_r = __pyx_pf_5pysam_9libctabix_6asGFF3_2__setstate_cython__(((struct __pyx_obj_5pysam_9libctabix_asGFF3 *)__pyx_v_self), __pyx_v___pyx_state); | |
8991 | |
8992 /* function exit code */ | |
8993 { | |
8994 Py_ssize_t __pyx_temp; | |
8995 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
8996 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
8997 } | |
8998 } | |
8999 __Pyx_RefNannyFinishContext(); | |
9000 return __pyx_r; | |
9001 } | |
9002 | |
9003 static PyObject *__pyx_pf_5pysam_9libctabix_6asGFF3_2__setstate_cython__(struct __pyx_obj_5pysam_9libctabix_asGFF3 *__pyx_v_self, PyObject *__pyx_v___pyx_state) { | |
9004 PyObject *__pyx_r = NULL; | |
9005 __Pyx_TraceDeclarations | |
9006 __Pyx_RefNannyDeclarations | |
9007 PyObject *__pyx_t_1 = NULL; | |
9008 int __pyx_lineno = 0; | |
9009 const char *__pyx_filename = NULL; | |
9010 int __pyx_clineno = 0; | |
9011 __Pyx_TraceFrameInit(__pyx_codeobj__8) | |
9012 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
9013 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error)); | |
9014 | |
9015 /* "(tree fragment)":17 | |
9016 * return __pyx_unpickle_asGFF3, (type(self), 0xe8424ea, state) | |
9017 * def __setstate_cython__(self, __pyx_state): | |
9018 * __pyx_unpickle_asGFF3__set_state(self, __pyx_state) # <<<<<<<<<<<<<< | |
9019 */ | |
9020 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error) | |
9021 __pyx_t_1 = __pyx_f_5pysam_9libctabix___pyx_unpickle_asGFF3__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) | |
9022 __Pyx_GOTREF(__pyx_t_1); | |
9023 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9024 | |
9025 /* "(tree fragment)":16 | |
9026 * else: | |
9027 * return __pyx_unpickle_asGFF3, (type(self), 0xe8424ea, state) | |
9028 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
9029 * __pyx_unpickle_asGFF3__set_state(self, __pyx_state) | |
9030 */ | |
9031 | |
9032 /* function exit code */ | |
9033 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
9034 goto __pyx_L0; | |
9035 __pyx_L1_error:; | |
9036 __Pyx_XDECREF(__pyx_t_1); | |
9037 __Pyx_AddTraceback("pysam.libctabix.asGFF3.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9038 __pyx_r = NULL; | |
9039 __pyx_L0:; | |
9040 __Pyx_XGIVEREF(__pyx_r); | |
9041 __Pyx_TraceReturn(__pyx_r, 0); | |
9042 __Pyx_RefNannyFinishContext(); | |
9043 return __pyx_r; | |
9044 } | |
9045 | |
9046 /* "pysam/libctabix.pyx":191 | |
9047 * | |
9048 * ''' | |
9049 * cdef parse(self, char * buffer, int len): # <<<<<<<<<<<<<< | |
9050 * cdef ctabixproxies.GTFProxy r | |
9051 * r = ctabixproxies.GTFProxy(self.encoding) | |
9052 */ | |
9053 | |
9054 static PyObject *__pyx_f_5pysam_9libctabix_5asGTF_parse(struct __pyx_obj_5pysam_9libctabix_asGTF *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len) { | |
9055 struct __pyx_obj_5pysam_16libctabixproxies_GTFProxy *__pyx_v_r = 0; | |
9056 PyObject *__pyx_r = NULL; | |
9057 __Pyx_TraceDeclarations | |
9058 __Pyx_RefNannyDeclarations | |
9059 PyObject *__pyx_t_1 = NULL; | |
9060 int __pyx_lineno = 0; | |
9061 const char *__pyx_filename = NULL; | |
9062 int __pyx_clineno = 0; | |
9063 __Pyx_RefNannySetupContext("parse", 1); | |
9064 __Pyx_TraceCall("parse", __pyx_f[0], 191, 0, __PYX_ERR(0, 191, __pyx_L1_error)); | |
9065 | |
9066 /* "pysam/libctabix.pyx":193 | |
9067 * cdef parse(self, char * buffer, int len): | |
9068 * cdef ctabixproxies.GTFProxy r | |
9069 * r = ctabixproxies.GTFProxy(self.encoding) # <<<<<<<<<<<<<< | |
9070 * r.copy(buffer, len) | |
9071 * return r | |
9072 */ | |
9073 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5pysam_16libctabixproxies_GTFProxy), __pyx_v_self->__pyx_base.encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) | |
9074 __Pyx_GOTREF(__pyx_t_1); | |
9075 __pyx_v_r = ((struct __pyx_obj_5pysam_16libctabixproxies_GTFProxy *)__pyx_t_1); | |
9076 __pyx_t_1 = 0; | |
9077 | |
9078 /* "pysam/libctabix.pyx":194 | |
9079 * cdef ctabixproxies.GTFProxy r | |
9080 * r = ctabixproxies.GTFProxy(self.encoding) | |
9081 * r.copy(buffer, len) # <<<<<<<<<<<<<< | |
9082 * return r | |
9083 * | |
9084 */ | |
9085 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_16libctabixproxies_GTFProxy *)__pyx_v_r->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.copy(((struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *)__pyx_v_r), __pyx_v_buffer, __pyx_v_len, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) | |
9086 __Pyx_GOTREF(__pyx_t_1); | |
9087 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9088 | |
9089 /* "pysam/libctabix.pyx":195 | |
9090 * r = ctabixproxies.GTFProxy(self.encoding) | |
9091 * r.copy(buffer, len) | |
9092 * return r # <<<<<<<<<<<<<< | |
9093 * | |
9094 * | |
9095 */ | |
9096 __Pyx_XDECREF(__pyx_r); | |
9097 __Pyx_INCREF((PyObject *)__pyx_v_r); | |
9098 __pyx_r = ((PyObject *)__pyx_v_r); | |
9099 goto __pyx_L0; | |
9100 | |
9101 /* "pysam/libctabix.pyx":191 | |
9102 * | |
9103 * ''' | |
9104 * cdef parse(self, char * buffer, int len): # <<<<<<<<<<<<<< | |
9105 * cdef ctabixproxies.GTFProxy r | |
9106 * r = ctabixproxies.GTFProxy(self.encoding) | |
9107 */ | |
9108 | |
9109 /* function exit code */ | |
9110 __pyx_L1_error:; | |
9111 __Pyx_XDECREF(__pyx_t_1); | |
9112 __Pyx_AddTraceback("pysam.libctabix.asGTF.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9113 __pyx_r = 0; | |
9114 __pyx_L0:; | |
9115 __Pyx_XDECREF((PyObject *)__pyx_v_r); | |
9116 __Pyx_XGIVEREF(__pyx_r); | |
9117 __Pyx_TraceReturn(__pyx_r, 0); | |
9118 __Pyx_RefNannyFinishContext(); | |
9119 return __pyx_r; | |
9120 } | |
9121 | |
9122 /* "(tree fragment)":1 | |
9123 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
9124 * cdef tuple state | |
9125 * cdef object _dict | |
9126 */ | |
9127 | |
9128 /* Python wrapper */ | |
9129 static PyObject *__pyx_pw_5pysam_9libctabix_5asGTF_1__reduce_cython__(PyObject *__pyx_v_self, | |
9130 #if CYTHON_METH_FASTCALL | |
9131 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
9132 #else | |
9133 PyObject *__pyx_args, PyObject *__pyx_kwds | |
9134 #endif | |
9135 ); /*proto*/ | |
9136 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_5asGTF___reduce_cython__, "asGTF.__reduce_cython__(self)"); | |
9137 static PyMethodDef __pyx_mdef_5pysam_9libctabix_5asGTF_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_5asGTF_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_5asGTF___reduce_cython__}; | |
9138 static PyObject *__pyx_pw_5pysam_9libctabix_5asGTF_1__reduce_cython__(PyObject *__pyx_v_self, | |
9139 #if CYTHON_METH_FASTCALL | |
9140 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
9141 #else | |
9142 PyObject *__pyx_args, PyObject *__pyx_kwds | |
9143 #endif | |
9144 ) { | |
9145 #if !CYTHON_METH_FASTCALL | |
9146 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
9147 #endif | |
9148 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9149 PyObject *__pyx_r = 0; | |
9150 __Pyx_RefNannyDeclarations | |
9151 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
9152 #if !CYTHON_METH_FASTCALL | |
9153 #if CYTHON_ASSUME_SAFE_MACROS | |
9154 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
9155 #else | |
9156 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
9157 #endif | |
9158 #endif | |
9159 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
9160 if (unlikely(__pyx_nargs > 0)) { | |
9161 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
9162 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
9163 __pyx_r = __pyx_pf_5pysam_9libctabix_5asGTF___reduce_cython__(((struct __pyx_obj_5pysam_9libctabix_asGTF *)__pyx_v_self)); | |
9164 | |
9165 /* function exit code */ | |
9166 __Pyx_RefNannyFinishContext(); | |
9167 return __pyx_r; | |
9168 } | |
9169 | |
9170 static PyObject *__pyx_pf_5pysam_9libctabix_5asGTF___reduce_cython__(struct __pyx_obj_5pysam_9libctabix_asGTF *__pyx_v_self) { | |
9171 PyObject *__pyx_v_state = 0; | |
9172 PyObject *__pyx_v__dict = 0; | |
9173 int __pyx_v_use_setstate; | |
9174 PyObject *__pyx_r = NULL; | |
9175 __Pyx_TraceDeclarations | |
9176 __Pyx_RefNannyDeclarations | |
9177 PyObject *__pyx_t_1 = NULL; | |
9178 int __pyx_t_2; | |
9179 PyObject *__pyx_t_3 = NULL; | |
9180 PyObject *__pyx_t_4 = NULL; | |
9181 int __pyx_lineno = 0; | |
9182 const char *__pyx_filename = NULL; | |
9183 int __pyx_clineno = 0; | |
9184 __Pyx_TraceFrameInit(__pyx_codeobj__9) | |
9185 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
9186 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
9187 | |
9188 /* "(tree fragment)":5 | |
9189 * cdef object _dict | |
9190 * cdef bint use_setstate | |
9191 * state = (self.encoding,) # <<<<<<<<<<<<<< | |
9192 * _dict = getattr(self, '__dict__', None) | |
9193 * if _dict is not None: | |
9194 */ | |
9195 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
9196 __Pyx_GOTREF(__pyx_t_1); | |
9197 __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding); | |
9198 __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding); | |
9199 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.encoding)) __PYX_ERR(1, 5, __pyx_L1_error); | |
9200 __pyx_v_state = ((PyObject*)__pyx_t_1); | |
9201 __pyx_t_1 = 0; | |
9202 | |
9203 /* "(tree fragment)":6 | |
9204 * cdef bint use_setstate | |
9205 * state = (self.encoding,) | |
9206 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< | |
9207 * if _dict is not None: | |
9208 * state += (_dict,) | |
9209 */ | |
9210 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) | |
9211 __Pyx_GOTREF(__pyx_t_1); | |
9212 __pyx_v__dict = __pyx_t_1; | |
9213 __pyx_t_1 = 0; | |
9214 | |
9215 /* "(tree fragment)":7 | |
9216 * state = (self.encoding,) | |
9217 * _dict = getattr(self, '__dict__', None) | |
9218 * if _dict is not None: # <<<<<<<<<<<<<< | |
9219 * state += (_dict,) | |
9220 * use_setstate = True | |
9221 */ | |
9222 __pyx_t_2 = (__pyx_v__dict != Py_None); | |
9223 if (__pyx_t_2) { | |
9224 | |
9225 /* "(tree fragment)":8 | |
9226 * _dict = getattr(self, '__dict__', None) | |
9227 * if _dict is not None: | |
9228 * state += (_dict,) # <<<<<<<<<<<<<< | |
9229 * use_setstate = True | |
9230 * else: | |
9231 */ | |
9232 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) | |
9233 __Pyx_GOTREF(__pyx_t_1); | |
9234 __Pyx_INCREF(__pyx_v__dict); | |
9235 __Pyx_GIVEREF(__pyx_v__dict); | |
9236 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error); | |
9237 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) | |
9238 __Pyx_GOTREF(__pyx_t_3); | |
9239 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9240 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); | |
9241 __pyx_t_3 = 0; | |
9242 | |
9243 /* "(tree fragment)":9 | |
9244 * if _dict is not None: | |
9245 * state += (_dict,) | |
9246 * use_setstate = True # <<<<<<<<<<<<<< | |
9247 * else: | |
9248 * use_setstate = self.encoding is not None | |
9249 */ | |
9250 __pyx_v_use_setstate = 1; | |
9251 | |
9252 /* "(tree fragment)":7 | |
9253 * state = (self.encoding,) | |
9254 * _dict = getattr(self, '__dict__', None) | |
9255 * if _dict is not None: # <<<<<<<<<<<<<< | |
9256 * state += (_dict,) | |
9257 * use_setstate = True | |
9258 */ | |
9259 goto __pyx_L3; | |
9260 } | |
9261 | |
9262 /* "(tree fragment)":11 | |
9263 * use_setstate = True | |
9264 * else: | |
9265 * use_setstate = self.encoding is not None # <<<<<<<<<<<<<< | |
9266 * if use_setstate: | |
9267 * return __pyx_unpickle_asGTF, (type(self), 0xe8424ea, None), state | |
9268 */ | |
9269 /*else*/ { | |
9270 __pyx_t_2 = (__pyx_v_self->__pyx_base.encoding != Py_None); | |
9271 __pyx_v_use_setstate = __pyx_t_2; | |
9272 } | |
9273 __pyx_L3:; | |
9274 | |
9275 /* "(tree fragment)":12 | |
9276 * else: | |
9277 * use_setstate = self.encoding is not None | |
9278 * if use_setstate: # <<<<<<<<<<<<<< | |
9279 * return __pyx_unpickle_asGTF, (type(self), 0xe8424ea, None), state | |
9280 * else: | |
9281 */ | |
9282 if (__pyx_v_use_setstate) { | |
9283 | |
9284 /* "(tree fragment)":13 | |
9285 * use_setstate = self.encoding is not None | |
9286 * if use_setstate: | |
9287 * return __pyx_unpickle_asGTF, (type(self), 0xe8424ea, None), state # <<<<<<<<<<<<<< | |
9288 * else: | |
9289 * return __pyx_unpickle_asGTF, (type(self), 0xe8424ea, state) | |
9290 */ | |
9291 __Pyx_XDECREF(__pyx_r); | |
9292 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_asGTF); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) | |
9293 __Pyx_GOTREF(__pyx_t_3); | |
9294 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) | |
9295 __Pyx_GOTREF(__pyx_t_1); | |
9296 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
9297 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
9298 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error); | |
9299 __Pyx_INCREF(__pyx_int_243541226); | |
9300 __Pyx_GIVEREF(__pyx_int_243541226); | |
9301 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_243541226)) __PYX_ERR(1, 13, __pyx_L1_error); | |
9302 __Pyx_INCREF(Py_None); | |
9303 __Pyx_GIVEREF(Py_None); | |
9304 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error); | |
9305 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) | |
9306 __Pyx_GOTREF(__pyx_t_4); | |
9307 __Pyx_GIVEREF(__pyx_t_3); | |
9308 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error); | |
9309 __Pyx_GIVEREF(__pyx_t_1); | |
9310 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error); | |
9311 __Pyx_INCREF(__pyx_v_state); | |
9312 __Pyx_GIVEREF(__pyx_v_state); | |
9313 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error); | |
9314 __pyx_t_3 = 0; | |
9315 __pyx_t_1 = 0; | |
9316 __pyx_r = __pyx_t_4; | |
9317 __pyx_t_4 = 0; | |
9318 goto __pyx_L0; | |
9319 | |
9320 /* "(tree fragment)":12 | |
9321 * else: | |
9322 * use_setstate = self.encoding is not None | |
9323 * if use_setstate: # <<<<<<<<<<<<<< | |
9324 * return __pyx_unpickle_asGTF, (type(self), 0xe8424ea, None), state | |
9325 * else: | |
9326 */ | |
9327 } | |
9328 | |
9329 /* "(tree fragment)":15 | |
9330 * return __pyx_unpickle_asGTF, (type(self), 0xe8424ea, None), state | |
9331 * else: | |
9332 * return __pyx_unpickle_asGTF, (type(self), 0xe8424ea, state) # <<<<<<<<<<<<<< | |
9333 * def __setstate_cython__(self, __pyx_state): | |
9334 * __pyx_unpickle_asGTF__set_state(self, __pyx_state) | |
9335 */ | |
9336 /*else*/ { | |
9337 __Pyx_XDECREF(__pyx_r); | |
9338 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_asGTF); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) | |
9339 __Pyx_GOTREF(__pyx_t_4); | |
9340 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) | |
9341 __Pyx_GOTREF(__pyx_t_1); | |
9342 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
9343 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
9344 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error); | |
9345 __Pyx_INCREF(__pyx_int_243541226); | |
9346 __Pyx_GIVEREF(__pyx_int_243541226); | |
9347 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_243541226)) __PYX_ERR(1, 15, __pyx_L1_error); | |
9348 __Pyx_INCREF(__pyx_v_state); | |
9349 __Pyx_GIVEREF(__pyx_v_state); | |
9350 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error); | |
9351 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) | |
9352 __Pyx_GOTREF(__pyx_t_3); | |
9353 __Pyx_GIVEREF(__pyx_t_4); | |
9354 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error); | |
9355 __Pyx_GIVEREF(__pyx_t_1); | |
9356 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error); | |
9357 __pyx_t_4 = 0; | |
9358 __pyx_t_1 = 0; | |
9359 __pyx_r = __pyx_t_3; | |
9360 __pyx_t_3 = 0; | |
9361 goto __pyx_L0; | |
9362 } | |
9363 | |
9364 /* "(tree fragment)":1 | |
9365 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
9366 * cdef tuple state | |
9367 * cdef object _dict | |
9368 */ | |
9369 | |
9370 /* function exit code */ | |
9371 __pyx_L1_error:; | |
9372 __Pyx_XDECREF(__pyx_t_1); | |
9373 __Pyx_XDECREF(__pyx_t_3); | |
9374 __Pyx_XDECREF(__pyx_t_4); | |
9375 __Pyx_AddTraceback("pysam.libctabix.asGTF.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9376 __pyx_r = NULL; | |
9377 __pyx_L0:; | |
9378 __Pyx_XDECREF(__pyx_v_state); | |
9379 __Pyx_XDECREF(__pyx_v__dict); | |
9380 __Pyx_XGIVEREF(__pyx_r); | |
9381 __Pyx_TraceReturn(__pyx_r, 0); | |
9382 __Pyx_RefNannyFinishContext(); | |
9383 return __pyx_r; | |
9384 } | |
9385 | |
9386 /* "(tree fragment)":16 | |
9387 * else: | |
9388 * return __pyx_unpickle_asGTF, (type(self), 0xe8424ea, state) | |
9389 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
9390 * __pyx_unpickle_asGTF__set_state(self, __pyx_state) | |
9391 */ | |
9392 | |
9393 /* Python wrapper */ | |
9394 static PyObject *__pyx_pw_5pysam_9libctabix_5asGTF_3__setstate_cython__(PyObject *__pyx_v_self, | |
9395 #if CYTHON_METH_FASTCALL | |
9396 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
9397 #else | |
9398 PyObject *__pyx_args, PyObject *__pyx_kwds | |
9399 #endif | |
9400 ); /*proto*/ | |
9401 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_5asGTF_2__setstate_cython__, "asGTF.__setstate_cython__(self, __pyx_state)"); | |
9402 static PyMethodDef __pyx_mdef_5pysam_9libctabix_5asGTF_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_5asGTF_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_5asGTF_2__setstate_cython__}; | |
9403 static PyObject *__pyx_pw_5pysam_9libctabix_5asGTF_3__setstate_cython__(PyObject *__pyx_v_self, | |
9404 #if CYTHON_METH_FASTCALL | |
9405 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
9406 #else | |
9407 PyObject *__pyx_args, PyObject *__pyx_kwds | |
9408 #endif | |
9409 ) { | |
9410 PyObject *__pyx_v___pyx_state = 0; | |
9411 #if !CYTHON_METH_FASTCALL | |
9412 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
9413 #endif | |
9414 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9415 PyObject* values[1] = {0}; | |
9416 int __pyx_lineno = 0; | |
9417 const char *__pyx_filename = NULL; | |
9418 int __pyx_clineno = 0; | |
9419 PyObject *__pyx_r = 0; | |
9420 __Pyx_RefNannyDeclarations | |
9421 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
9422 #if !CYTHON_METH_FASTCALL | |
9423 #if CYTHON_ASSUME_SAFE_MACROS | |
9424 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
9425 #else | |
9426 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
9427 #endif | |
9428 #endif | |
9429 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
9430 { | |
9431 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
9432 if (__pyx_kwds) { | |
9433 Py_ssize_t kw_args; | |
9434 switch (__pyx_nargs) { | |
9435 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
9436 CYTHON_FALLTHROUGH; | |
9437 case 0: break; | |
9438 default: goto __pyx_L5_argtuple_error; | |
9439 } | |
9440 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
9441 switch (__pyx_nargs) { | |
9442 case 0: | |
9443 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
9444 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
9445 kw_args--; | |
9446 } | |
9447 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error) | |
9448 else goto __pyx_L5_argtuple_error; | |
9449 } | |
9450 if (unlikely(kw_args > 0)) { | |
9451 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
9452 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error) | |
9453 } | |
9454 } else if (unlikely(__pyx_nargs != 1)) { | |
9455 goto __pyx_L5_argtuple_error; | |
9456 } else { | |
9457 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
9458 } | |
9459 __pyx_v___pyx_state = values[0]; | |
9460 } | |
9461 goto __pyx_L6_skip; | |
9462 __pyx_L5_argtuple_error:; | |
9463 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) | |
9464 __pyx_L6_skip:; | |
9465 goto __pyx_L4_argument_unpacking_done; | |
9466 __pyx_L3_error:; | |
9467 { | |
9468 Py_ssize_t __pyx_temp; | |
9469 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
9470 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
9471 } | |
9472 } | |
9473 __Pyx_AddTraceback("pysam.libctabix.asGTF.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9474 __Pyx_RefNannyFinishContext(); | |
9475 return NULL; | |
9476 __pyx_L4_argument_unpacking_done:; | |
9477 __pyx_r = __pyx_pf_5pysam_9libctabix_5asGTF_2__setstate_cython__(((struct __pyx_obj_5pysam_9libctabix_asGTF *)__pyx_v_self), __pyx_v___pyx_state); | |
9478 | |
9479 /* function exit code */ | |
9480 { | |
9481 Py_ssize_t __pyx_temp; | |
9482 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
9483 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
9484 } | |
9485 } | |
9486 __Pyx_RefNannyFinishContext(); | |
9487 return __pyx_r; | |
9488 } | |
9489 | |
9490 static PyObject *__pyx_pf_5pysam_9libctabix_5asGTF_2__setstate_cython__(struct __pyx_obj_5pysam_9libctabix_asGTF *__pyx_v_self, PyObject *__pyx_v___pyx_state) { | |
9491 PyObject *__pyx_r = NULL; | |
9492 __Pyx_TraceDeclarations | |
9493 __Pyx_RefNannyDeclarations | |
9494 PyObject *__pyx_t_1 = NULL; | |
9495 int __pyx_lineno = 0; | |
9496 const char *__pyx_filename = NULL; | |
9497 int __pyx_clineno = 0; | |
9498 __Pyx_TraceFrameInit(__pyx_codeobj__10) | |
9499 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
9500 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error)); | |
9501 | |
9502 /* "(tree fragment)":17 | |
9503 * return __pyx_unpickle_asGTF, (type(self), 0xe8424ea, state) | |
9504 * def __setstate_cython__(self, __pyx_state): | |
9505 * __pyx_unpickle_asGTF__set_state(self, __pyx_state) # <<<<<<<<<<<<<< | |
9506 */ | |
9507 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error) | |
9508 __pyx_t_1 = __pyx_f_5pysam_9libctabix___pyx_unpickle_asGTF__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) | |
9509 __Pyx_GOTREF(__pyx_t_1); | |
9510 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9511 | |
9512 /* "(tree fragment)":16 | |
9513 * else: | |
9514 * return __pyx_unpickle_asGTF, (type(self), 0xe8424ea, state) | |
9515 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
9516 * __pyx_unpickle_asGTF__set_state(self, __pyx_state) | |
9517 */ | |
9518 | |
9519 /* function exit code */ | |
9520 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
9521 goto __pyx_L0; | |
9522 __pyx_L1_error:; | |
9523 __Pyx_XDECREF(__pyx_t_1); | |
9524 __Pyx_AddTraceback("pysam.libctabix.asGTF.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9525 __pyx_r = NULL; | |
9526 __pyx_L0:; | |
9527 __Pyx_XGIVEREF(__pyx_r); | |
9528 __Pyx_TraceReturn(__pyx_r, 0); | |
9529 __Pyx_RefNannyFinishContext(); | |
9530 return __pyx_r; | |
9531 } | |
9532 | |
9533 /* "pysam/libctabix.pyx":239 | |
9534 * | |
9535 * ''' | |
9536 * cdef parse(self, char * buffer, int len): # <<<<<<<<<<<<<< | |
9537 * cdef ctabixproxies.BedProxy r | |
9538 * r = ctabixproxies.BedProxy(self.encoding) | |
9539 */ | |
9540 | |
9541 static PyObject *__pyx_f_5pysam_9libctabix_5asBed_parse(struct __pyx_obj_5pysam_9libctabix_asBed *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len) { | |
9542 struct __pyx_obj_5pysam_16libctabixproxies_BedProxy *__pyx_v_r = 0; | |
9543 PyObject *__pyx_r = NULL; | |
9544 __Pyx_TraceDeclarations | |
9545 __Pyx_RefNannyDeclarations | |
9546 PyObject *__pyx_t_1 = NULL; | |
9547 int __pyx_lineno = 0; | |
9548 const char *__pyx_filename = NULL; | |
9549 int __pyx_clineno = 0; | |
9550 __Pyx_RefNannySetupContext("parse", 1); | |
9551 __Pyx_TraceCall("parse", __pyx_f[0], 239, 0, __PYX_ERR(0, 239, __pyx_L1_error)); | |
9552 | |
9553 /* "pysam/libctabix.pyx":241 | |
9554 * cdef parse(self, char * buffer, int len): | |
9555 * cdef ctabixproxies.BedProxy r | |
9556 * r = ctabixproxies.BedProxy(self.encoding) # <<<<<<<<<<<<<< | |
9557 * r.copy(buffer, len) | |
9558 * return r | |
9559 */ | |
9560 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5pysam_16libctabixproxies_BedProxy), __pyx_v_self->__pyx_base.encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) | |
9561 __Pyx_GOTREF(__pyx_t_1); | |
9562 __pyx_v_r = ((struct __pyx_obj_5pysam_16libctabixproxies_BedProxy *)__pyx_t_1); | |
9563 __pyx_t_1 = 0; | |
9564 | |
9565 /* "pysam/libctabix.pyx":242 | |
9566 * cdef ctabixproxies.BedProxy r | |
9567 * r = ctabixproxies.BedProxy(self.encoding) | |
9568 * r.copy(buffer, len) # <<<<<<<<<<<<<< | |
9569 * return r | |
9570 * | |
9571 */ | |
9572 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_16libctabixproxies_BedProxy *)__pyx_v_r->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.copy(((struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *)__pyx_v_r), __pyx_v_buffer, __pyx_v_len, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) | |
9573 __Pyx_GOTREF(__pyx_t_1); | |
9574 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9575 | |
9576 /* "pysam/libctabix.pyx":243 | |
9577 * r = ctabixproxies.BedProxy(self.encoding) | |
9578 * r.copy(buffer, len) | |
9579 * return r # <<<<<<<<<<<<<< | |
9580 * | |
9581 * | |
9582 */ | |
9583 __Pyx_XDECREF(__pyx_r); | |
9584 __Pyx_INCREF((PyObject *)__pyx_v_r); | |
9585 __pyx_r = ((PyObject *)__pyx_v_r); | |
9586 goto __pyx_L0; | |
9587 | |
9588 /* "pysam/libctabix.pyx":239 | |
9589 * | |
9590 * ''' | |
9591 * cdef parse(self, char * buffer, int len): # <<<<<<<<<<<<<< | |
9592 * cdef ctabixproxies.BedProxy r | |
9593 * r = ctabixproxies.BedProxy(self.encoding) | |
9594 */ | |
9595 | |
9596 /* function exit code */ | |
9597 __pyx_L1_error:; | |
9598 __Pyx_XDECREF(__pyx_t_1); | |
9599 __Pyx_AddTraceback("pysam.libctabix.asBed.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9600 __pyx_r = 0; | |
9601 __pyx_L0:; | |
9602 __Pyx_XDECREF((PyObject *)__pyx_v_r); | |
9603 __Pyx_XGIVEREF(__pyx_r); | |
9604 __Pyx_TraceReturn(__pyx_r, 0); | |
9605 __Pyx_RefNannyFinishContext(); | |
9606 return __pyx_r; | |
9607 } | |
9608 | |
9609 /* "(tree fragment)":1 | |
9610 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
9611 * cdef tuple state | |
9612 * cdef object _dict | |
9613 */ | |
9614 | |
9615 /* Python wrapper */ | |
9616 static PyObject *__pyx_pw_5pysam_9libctabix_5asBed_1__reduce_cython__(PyObject *__pyx_v_self, | |
9617 #if CYTHON_METH_FASTCALL | |
9618 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
9619 #else | |
9620 PyObject *__pyx_args, PyObject *__pyx_kwds | |
9621 #endif | |
9622 ); /*proto*/ | |
9623 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_5asBed___reduce_cython__, "asBed.__reduce_cython__(self)"); | |
9624 static PyMethodDef __pyx_mdef_5pysam_9libctabix_5asBed_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_5asBed_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_5asBed___reduce_cython__}; | |
9625 static PyObject *__pyx_pw_5pysam_9libctabix_5asBed_1__reduce_cython__(PyObject *__pyx_v_self, | |
9626 #if CYTHON_METH_FASTCALL | |
9627 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
9628 #else | |
9629 PyObject *__pyx_args, PyObject *__pyx_kwds | |
9630 #endif | |
9631 ) { | |
9632 #if !CYTHON_METH_FASTCALL | |
9633 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
9634 #endif | |
9635 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9636 PyObject *__pyx_r = 0; | |
9637 __Pyx_RefNannyDeclarations | |
9638 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
9639 #if !CYTHON_METH_FASTCALL | |
9640 #if CYTHON_ASSUME_SAFE_MACROS | |
9641 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
9642 #else | |
9643 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
9644 #endif | |
9645 #endif | |
9646 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
9647 if (unlikely(__pyx_nargs > 0)) { | |
9648 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
9649 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
9650 __pyx_r = __pyx_pf_5pysam_9libctabix_5asBed___reduce_cython__(((struct __pyx_obj_5pysam_9libctabix_asBed *)__pyx_v_self)); | |
9651 | |
9652 /* function exit code */ | |
9653 __Pyx_RefNannyFinishContext(); | |
9654 return __pyx_r; | |
9655 } | |
9656 | |
9657 static PyObject *__pyx_pf_5pysam_9libctabix_5asBed___reduce_cython__(struct __pyx_obj_5pysam_9libctabix_asBed *__pyx_v_self) { | |
9658 PyObject *__pyx_v_state = 0; | |
9659 PyObject *__pyx_v__dict = 0; | |
9660 int __pyx_v_use_setstate; | |
9661 PyObject *__pyx_r = NULL; | |
9662 __Pyx_TraceDeclarations | |
9663 __Pyx_RefNannyDeclarations | |
9664 PyObject *__pyx_t_1 = NULL; | |
9665 int __pyx_t_2; | |
9666 PyObject *__pyx_t_3 = NULL; | |
9667 PyObject *__pyx_t_4 = NULL; | |
9668 int __pyx_lineno = 0; | |
9669 const char *__pyx_filename = NULL; | |
9670 int __pyx_clineno = 0; | |
9671 __Pyx_TraceFrameInit(__pyx_codeobj__11) | |
9672 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
9673 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
9674 | |
9675 /* "(tree fragment)":5 | |
9676 * cdef object _dict | |
9677 * cdef bint use_setstate | |
9678 * state = (self.encoding,) # <<<<<<<<<<<<<< | |
9679 * _dict = getattr(self, '__dict__', None) | |
9680 * if _dict is not None: | |
9681 */ | |
9682 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
9683 __Pyx_GOTREF(__pyx_t_1); | |
9684 __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding); | |
9685 __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding); | |
9686 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.encoding)) __PYX_ERR(1, 5, __pyx_L1_error); | |
9687 __pyx_v_state = ((PyObject*)__pyx_t_1); | |
9688 __pyx_t_1 = 0; | |
9689 | |
9690 /* "(tree fragment)":6 | |
9691 * cdef bint use_setstate | |
9692 * state = (self.encoding,) | |
9693 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< | |
9694 * if _dict is not None: | |
9695 * state += (_dict,) | |
9696 */ | |
9697 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) | |
9698 __Pyx_GOTREF(__pyx_t_1); | |
9699 __pyx_v__dict = __pyx_t_1; | |
9700 __pyx_t_1 = 0; | |
9701 | |
9702 /* "(tree fragment)":7 | |
9703 * state = (self.encoding,) | |
9704 * _dict = getattr(self, '__dict__', None) | |
9705 * if _dict is not None: # <<<<<<<<<<<<<< | |
9706 * state += (_dict,) | |
9707 * use_setstate = True | |
9708 */ | |
9709 __pyx_t_2 = (__pyx_v__dict != Py_None); | |
9710 if (__pyx_t_2) { | |
9711 | |
9712 /* "(tree fragment)":8 | |
9713 * _dict = getattr(self, '__dict__', None) | |
9714 * if _dict is not None: | |
9715 * state += (_dict,) # <<<<<<<<<<<<<< | |
9716 * use_setstate = True | |
9717 * else: | |
9718 */ | |
9719 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) | |
9720 __Pyx_GOTREF(__pyx_t_1); | |
9721 __Pyx_INCREF(__pyx_v__dict); | |
9722 __Pyx_GIVEREF(__pyx_v__dict); | |
9723 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error); | |
9724 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) | |
9725 __Pyx_GOTREF(__pyx_t_3); | |
9726 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9727 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); | |
9728 __pyx_t_3 = 0; | |
9729 | |
9730 /* "(tree fragment)":9 | |
9731 * if _dict is not None: | |
9732 * state += (_dict,) | |
9733 * use_setstate = True # <<<<<<<<<<<<<< | |
9734 * else: | |
9735 * use_setstate = self.encoding is not None | |
9736 */ | |
9737 __pyx_v_use_setstate = 1; | |
9738 | |
9739 /* "(tree fragment)":7 | |
9740 * state = (self.encoding,) | |
9741 * _dict = getattr(self, '__dict__', None) | |
9742 * if _dict is not None: # <<<<<<<<<<<<<< | |
9743 * state += (_dict,) | |
9744 * use_setstate = True | |
9745 */ | |
9746 goto __pyx_L3; | |
9747 } | |
9748 | |
9749 /* "(tree fragment)":11 | |
9750 * use_setstate = True | |
9751 * else: | |
9752 * use_setstate = self.encoding is not None # <<<<<<<<<<<<<< | |
9753 * if use_setstate: | |
9754 * return __pyx_unpickle_asBed, (type(self), 0xe8424ea, None), state | |
9755 */ | |
9756 /*else*/ { | |
9757 __pyx_t_2 = (__pyx_v_self->__pyx_base.encoding != Py_None); | |
9758 __pyx_v_use_setstate = __pyx_t_2; | |
9759 } | |
9760 __pyx_L3:; | |
9761 | |
9762 /* "(tree fragment)":12 | |
9763 * else: | |
9764 * use_setstate = self.encoding is not None | |
9765 * if use_setstate: # <<<<<<<<<<<<<< | |
9766 * return __pyx_unpickle_asBed, (type(self), 0xe8424ea, None), state | |
9767 * else: | |
9768 */ | |
9769 if (__pyx_v_use_setstate) { | |
9770 | |
9771 /* "(tree fragment)":13 | |
9772 * use_setstate = self.encoding is not None | |
9773 * if use_setstate: | |
9774 * return __pyx_unpickle_asBed, (type(self), 0xe8424ea, None), state # <<<<<<<<<<<<<< | |
9775 * else: | |
9776 * return __pyx_unpickle_asBed, (type(self), 0xe8424ea, state) | |
9777 */ | |
9778 __Pyx_XDECREF(__pyx_r); | |
9779 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_asBed); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) | |
9780 __Pyx_GOTREF(__pyx_t_3); | |
9781 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) | |
9782 __Pyx_GOTREF(__pyx_t_1); | |
9783 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
9784 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
9785 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error); | |
9786 __Pyx_INCREF(__pyx_int_243541226); | |
9787 __Pyx_GIVEREF(__pyx_int_243541226); | |
9788 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_243541226)) __PYX_ERR(1, 13, __pyx_L1_error); | |
9789 __Pyx_INCREF(Py_None); | |
9790 __Pyx_GIVEREF(Py_None); | |
9791 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error); | |
9792 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) | |
9793 __Pyx_GOTREF(__pyx_t_4); | |
9794 __Pyx_GIVEREF(__pyx_t_3); | |
9795 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error); | |
9796 __Pyx_GIVEREF(__pyx_t_1); | |
9797 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error); | |
9798 __Pyx_INCREF(__pyx_v_state); | |
9799 __Pyx_GIVEREF(__pyx_v_state); | |
9800 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error); | |
9801 __pyx_t_3 = 0; | |
9802 __pyx_t_1 = 0; | |
9803 __pyx_r = __pyx_t_4; | |
9804 __pyx_t_4 = 0; | |
9805 goto __pyx_L0; | |
9806 | |
9807 /* "(tree fragment)":12 | |
9808 * else: | |
9809 * use_setstate = self.encoding is not None | |
9810 * if use_setstate: # <<<<<<<<<<<<<< | |
9811 * return __pyx_unpickle_asBed, (type(self), 0xe8424ea, None), state | |
9812 * else: | |
9813 */ | |
9814 } | |
9815 | |
9816 /* "(tree fragment)":15 | |
9817 * return __pyx_unpickle_asBed, (type(self), 0xe8424ea, None), state | |
9818 * else: | |
9819 * return __pyx_unpickle_asBed, (type(self), 0xe8424ea, state) # <<<<<<<<<<<<<< | |
9820 * def __setstate_cython__(self, __pyx_state): | |
9821 * __pyx_unpickle_asBed__set_state(self, __pyx_state) | |
9822 */ | |
9823 /*else*/ { | |
9824 __Pyx_XDECREF(__pyx_r); | |
9825 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_asBed); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) | |
9826 __Pyx_GOTREF(__pyx_t_4); | |
9827 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) | |
9828 __Pyx_GOTREF(__pyx_t_1); | |
9829 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
9830 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
9831 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error); | |
9832 __Pyx_INCREF(__pyx_int_243541226); | |
9833 __Pyx_GIVEREF(__pyx_int_243541226); | |
9834 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_243541226)) __PYX_ERR(1, 15, __pyx_L1_error); | |
9835 __Pyx_INCREF(__pyx_v_state); | |
9836 __Pyx_GIVEREF(__pyx_v_state); | |
9837 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error); | |
9838 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) | |
9839 __Pyx_GOTREF(__pyx_t_3); | |
9840 __Pyx_GIVEREF(__pyx_t_4); | |
9841 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error); | |
9842 __Pyx_GIVEREF(__pyx_t_1); | |
9843 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error); | |
9844 __pyx_t_4 = 0; | |
9845 __pyx_t_1 = 0; | |
9846 __pyx_r = __pyx_t_3; | |
9847 __pyx_t_3 = 0; | |
9848 goto __pyx_L0; | |
9849 } | |
9850 | |
9851 /* "(tree fragment)":1 | |
9852 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
9853 * cdef tuple state | |
9854 * cdef object _dict | |
9855 */ | |
9856 | |
9857 /* function exit code */ | |
9858 __pyx_L1_error:; | |
9859 __Pyx_XDECREF(__pyx_t_1); | |
9860 __Pyx_XDECREF(__pyx_t_3); | |
9861 __Pyx_XDECREF(__pyx_t_4); | |
9862 __Pyx_AddTraceback("pysam.libctabix.asBed.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9863 __pyx_r = NULL; | |
9864 __pyx_L0:; | |
9865 __Pyx_XDECREF(__pyx_v_state); | |
9866 __Pyx_XDECREF(__pyx_v__dict); | |
9867 __Pyx_XGIVEREF(__pyx_r); | |
9868 __Pyx_TraceReturn(__pyx_r, 0); | |
9869 __Pyx_RefNannyFinishContext(); | |
9870 return __pyx_r; | |
9871 } | |
9872 | |
9873 /* "(tree fragment)":16 | |
9874 * else: | |
9875 * return __pyx_unpickle_asBed, (type(self), 0xe8424ea, state) | |
9876 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
9877 * __pyx_unpickle_asBed__set_state(self, __pyx_state) | |
9878 */ | |
9879 | |
9880 /* Python wrapper */ | |
9881 static PyObject *__pyx_pw_5pysam_9libctabix_5asBed_3__setstate_cython__(PyObject *__pyx_v_self, | |
9882 #if CYTHON_METH_FASTCALL | |
9883 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
9884 #else | |
9885 PyObject *__pyx_args, PyObject *__pyx_kwds | |
9886 #endif | |
9887 ); /*proto*/ | |
9888 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_5asBed_2__setstate_cython__, "asBed.__setstate_cython__(self, __pyx_state)"); | |
9889 static PyMethodDef __pyx_mdef_5pysam_9libctabix_5asBed_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_5asBed_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_5asBed_2__setstate_cython__}; | |
9890 static PyObject *__pyx_pw_5pysam_9libctabix_5asBed_3__setstate_cython__(PyObject *__pyx_v_self, | |
9891 #if CYTHON_METH_FASTCALL | |
9892 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
9893 #else | |
9894 PyObject *__pyx_args, PyObject *__pyx_kwds | |
9895 #endif | |
9896 ) { | |
9897 PyObject *__pyx_v___pyx_state = 0; | |
9898 #if !CYTHON_METH_FASTCALL | |
9899 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
9900 #endif | |
9901 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9902 PyObject* values[1] = {0}; | |
9903 int __pyx_lineno = 0; | |
9904 const char *__pyx_filename = NULL; | |
9905 int __pyx_clineno = 0; | |
9906 PyObject *__pyx_r = 0; | |
9907 __Pyx_RefNannyDeclarations | |
9908 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
9909 #if !CYTHON_METH_FASTCALL | |
9910 #if CYTHON_ASSUME_SAFE_MACROS | |
9911 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
9912 #else | |
9913 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
9914 #endif | |
9915 #endif | |
9916 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
9917 { | |
9918 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
9919 if (__pyx_kwds) { | |
9920 Py_ssize_t kw_args; | |
9921 switch (__pyx_nargs) { | |
9922 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
9923 CYTHON_FALLTHROUGH; | |
9924 case 0: break; | |
9925 default: goto __pyx_L5_argtuple_error; | |
9926 } | |
9927 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
9928 switch (__pyx_nargs) { | |
9929 case 0: | |
9930 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
9931 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
9932 kw_args--; | |
9933 } | |
9934 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error) | |
9935 else goto __pyx_L5_argtuple_error; | |
9936 } | |
9937 if (unlikely(kw_args > 0)) { | |
9938 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
9939 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error) | |
9940 } | |
9941 } else if (unlikely(__pyx_nargs != 1)) { | |
9942 goto __pyx_L5_argtuple_error; | |
9943 } else { | |
9944 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
9945 } | |
9946 __pyx_v___pyx_state = values[0]; | |
9947 } | |
9948 goto __pyx_L6_skip; | |
9949 __pyx_L5_argtuple_error:; | |
9950 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) | |
9951 __pyx_L6_skip:; | |
9952 goto __pyx_L4_argument_unpacking_done; | |
9953 __pyx_L3_error:; | |
9954 { | |
9955 Py_ssize_t __pyx_temp; | |
9956 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
9957 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
9958 } | |
9959 } | |
9960 __Pyx_AddTraceback("pysam.libctabix.asBed.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9961 __Pyx_RefNannyFinishContext(); | |
9962 return NULL; | |
9963 __pyx_L4_argument_unpacking_done:; | |
9964 __pyx_r = __pyx_pf_5pysam_9libctabix_5asBed_2__setstate_cython__(((struct __pyx_obj_5pysam_9libctabix_asBed *)__pyx_v_self), __pyx_v___pyx_state); | |
9965 | |
9966 /* function exit code */ | |
9967 { | |
9968 Py_ssize_t __pyx_temp; | |
9969 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
9970 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
9971 } | |
9972 } | |
9973 __Pyx_RefNannyFinishContext(); | |
9974 return __pyx_r; | |
9975 } | |
9976 | |
9977 static PyObject *__pyx_pf_5pysam_9libctabix_5asBed_2__setstate_cython__(struct __pyx_obj_5pysam_9libctabix_asBed *__pyx_v_self, PyObject *__pyx_v___pyx_state) { | |
9978 PyObject *__pyx_r = NULL; | |
9979 __Pyx_TraceDeclarations | |
9980 __Pyx_RefNannyDeclarations | |
9981 PyObject *__pyx_t_1 = NULL; | |
9982 int __pyx_lineno = 0; | |
9983 const char *__pyx_filename = NULL; | |
9984 int __pyx_clineno = 0; | |
9985 __Pyx_TraceFrameInit(__pyx_codeobj__12) | |
9986 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
9987 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error)); | |
9988 | |
9989 /* "(tree fragment)":17 | |
9990 * return __pyx_unpickle_asBed, (type(self), 0xe8424ea, state) | |
9991 * def __setstate_cython__(self, __pyx_state): | |
9992 * __pyx_unpickle_asBed__set_state(self, __pyx_state) # <<<<<<<<<<<<<< | |
9993 */ | |
9994 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error) | |
9995 __pyx_t_1 = __pyx_f_5pysam_9libctabix___pyx_unpickle_asBed__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) | |
9996 __Pyx_GOTREF(__pyx_t_1); | |
9997 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9998 | |
9999 /* "(tree fragment)":16 | |
10000 * else: | |
10001 * return __pyx_unpickle_asBed, (type(self), 0xe8424ea, state) | |
10002 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
10003 * __pyx_unpickle_asBed__set_state(self, __pyx_state) | |
10004 */ | |
10005 | |
10006 /* function exit code */ | |
10007 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
10008 goto __pyx_L0; | |
10009 __pyx_L1_error:; | |
10010 __Pyx_XDECREF(__pyx_t_1); | |
10011 __Pyx_AddTraceback("pysam.libctabix.asBed.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10012 __pyx_r = NULL; | |
10013 __pyx_L0:; | |
10014 __Pyx_XGIVEREF(__pyx_r); | |
10015 __Pyx_TraceReturn(__pyx_r, 0); | |
10016 __Pyx_RefNannyFinishContext(); | |
10017 return __pyx_r; | |
10018 } | |
10019 | |
10020 /* "pysam/libctabix.pyx":280 | |
10021 * | |
10022 * ''' | |
10023 * cdef parse(self, char * buffer, int len): # <<<<<<<<<<<<<< | |
10024 * cdef ctabixproxies.VCFProxy r | |
10025 * r = ctabixproxies.VCFProxy(self.encoding) | |
10026 */ | |
10027 | |
10028 static PyObject *__pyx_f_5pysam_9libctabix_5asVCF_parse(struct __pyx_obj_5pysam_9libctabix_asVCF *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len) { | |
10029 struct __pyx_obj_5pysam_16libctabixproxies_VCFProxy *__pyx_v_r = 0; | |
10030 PyObject *__pyx_r = NULL; | |
10031 __Pyx_TraceDeclarations | |
10032 __Pyx_RefNannyDeclarations | |
10033 PyObject *__pyx_t_1 = NULL; | |
10034 int __pyx_lineno = 0; | |
10035 const char *__pyx_filename = NULL; | |
10036 int __pyx_clineno = 0; | |
10037 __Pyx_RefNannySetupContext("parse", 1); | |
10038 __Pyx_TraceCall("parse", __pyx_f[0], 280, 0, __PYX_ERR(0, 280, __pyx_L1_error)); | |
10039 | |
10040 /* "pysam/libctabix.pyx":282 | |
10041 * cdef parse(self, char * buffer, int len): | |
10042 * cdef ctabixproxies.VCFProxy r | |
10043 * r = ctabixproxies.VCFProxy(self.encoding) # <<<<<<<<<<<<<< | |
10044 * r.copy(buffer, len) | |
10045 * return r | |
10046 */ | |
10047 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5pysam_16libctabixproxies_VCFProxy), __pyx_v_self->__pyx_base.encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) | |
10048 __Pyx_GOTREF(__pyx_t_1); | |
10049 __pyx_v_r = ((struct __pyx_obj_5pysam_16libctabixproxies_VCFProxy *)__pyx_t_1); | |
10050 __pyx_t_1 = 0; | |
10051 | |
10052 /* "pysam/libctabix.pyx":283 | |
10053 * cdef ctabixproxies.VCFProxy r | |
10054 * r = ctabixproxies.VCFProxy(self.encoding) | |
10055 * r.copy(buffer, len) # <<<<<<<<<<<<<< | |
10056 * return r | |
10057 * | |
10058 */ | |
10059 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_16libctabixproxies_VCFProxy *)__pyx_v_r->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.copy(((struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy *)__pyx_v_r), __pyx_v_buffer, __pyx_v_len, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) | |
10060 __Pyx_GOTREF(__pyx_t_1); | |
10061 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
10062 | |
10063 /* "pysam/libctabix.pyx":284 | |
10064 * r = ctabixproxies.VCFProxy(self.encoding) | |
10065 * r.copy(buffer, len) | |
10066 * return r # <<<<<<<<<<<<<< | |
10067 * | |
10068 * | |
10069 */ | |
10070 __Pyx_XDECREF(__pyx_r); | |
10071 __Pyx_INCREF((PyObject *)__pyx_v_r); | |
10072 __pyx_r = ((PyObject *)__pyx_v_r); | |
10073 goto __pyx_L0; | |
10074 | |
10075 /* "pysam/libctabix.pyx":280 | |
10076 * | |
10077 * ''' | |
10078 * cdef parse(self, char * buffer, int len): # <<<<<<<<<<<<<< | |
10079 * cdef ctabixproxies.VCFProxy r | |
10080 * r = ctabixproxies.VCFProxy(self.encoding) | |
10081 */ | |
10082 | |
10083 /* function exit code */ | |
10084 __pyx_L1_error:; | |
10085 __Pyx_XDECREF(__pyx_t_1); | |
10086 __Pyx_AddTraceback("pysam.libctabix.asVCF.parse", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10087 __pyx_r = 0; | |
10088 __pyx_L0:; | |
10089 __Pyx_XDECREF((PyObject *)__pyx_v_r); | |
10090 __Pyx_XGIVEREF(__pyx_r); | |
10091 __Pyx_TraceReturn(__pyx_r, 0); | |
10092 __Pyx_RefNannyFinishContext(); | |
10093 return __pyx_r; | |
10094 } | |
10095 | |
10096 /* "(tree fragment)":1 | |
10097 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
10098 * cdef tuple state | |
10099 * cdef object _dict | |
10100 */ | |
10101 | |
10102 /* Python wrapper */ | |
10103 static PyObject *__pyx_pw_5pysam_9libctabix_5asVCF_1__reduce_cython__(PyObject *__pyx_v_self, | |
10104 #if CYTHON_METH_FASTCALL | |
10105 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
10106 #else | |
10107 PyObject *__pyx_args, PyObject *__pyx_kwds | |
10108 #endif | |
10109 ); /*proto*/ | |
10110 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_5asVCF___reduce_cython__, "asVCF.__reduce_cython__(self)"); | |
10111 static PyMethodDef __pyx_mdef_5pysam_9libctabix_5asVCF_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_5asVCF_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_5asVCF___reduce_cython__}; | |
10112 static PyObject *__pyx_pw_5pysam_9libctabix_5asVCF_1__reduce_cython__(PyObject *__pyx_v_self, | |
10113 #if CYTHON_METH_FASTCALL | |
10114 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
10115 #else | |
10116 PyObject *__pyx_args, PyObject *__pyx_kwds | |
10117 #endif | |
10118 ) { | |
10119 #if !CYTHON_METH_FASTCALL | |
10120 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
10121 #endif | |
10122 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10123 PyObject *__pyx_r = 0; | |
10124 __Pyx_RefNannyDeclarations | |
10125 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
10126 #if !CYTHON_METH_FASTCALL | |
10127 #if CYTHON_ASSUME_SAFE_MACROS | |
10128 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
10129 #else | |
10130 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
10131 #endif | |
10132 #endif | |
10133 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
10134 if (unlikely(__pyx_nargs > 0)) { | |
10135 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
10136 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
10137 __pyx_r = __pyx_pf_5pysam_9libctabix_5asVCF___reduce_cython__(((struct __pyx_obj_5pysam_9libctabix_asVCF *)__pyx_v_self)); | |
10138 | |
10139 /* function exit code */ | |
10140 __Pyx_RefNannyFinishContext(); | |
10141 return __pyx_r; | |
10142 } | |
10143 | |
10144 static PyObject *__pyx_pf_5pysam_9libctabix_5asVCF___reduce_cython__(struct __pyx_obj_5pysam_9libctabix_asVCF *__pyx_v_self) { | |
10145 PyObject *__pyx_v_state = 0; | |
10146 PyObject *__pyx_v__dict = 0; | |
10147 int __pyx_v_use_setstate; | |
10148 PyObject *__pyx_r = NULL; | |
10149 __Pyx_TraceDeclarations | |
10150 __Pyx_RefNannyDeclarations | |
10151 PyObject *__pyx_t_1 = NULL; | |
10152 int __pyx_t_2; | |
10153 PyObject *__pyx_t_3 = NULL; | |
10154 PyObject *__pyx_t_4 = NULL; | |
10155 int __pyx_lineno = 0; | |
10156 const char *__pyx_filename = NULL; | |
10157 int __pyx_clineno = 0; | |
10158 __Pyx_TraceFrameInit(__pyx_codeobj__13) | |
10159 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
10160 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
10161 | |
10162 /* "(tree fragment)":5 | |
10163 * cdef object _dict | |
10164 * cdef bint use_setstate | |
10165 * state = (self.encoding,) # <<<<<<<<<<<<<< | |
10166 * _dict = getattr(self, '__dict__', None) | |
10167 * if _dict is not None: | |
10168 */ | |
10169 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
10170 __Pyx_GOTREF(__pyx_t_1); | |
10171 __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding); | |
10172 __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding); | |
10173 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.encoding)) __PYX_ERR(1, 5, __pyx_L1_error); | |
10174 __pyx_v_state = ((PyObject*)__pyx_t_1); | |
10175 __pyx_t_1 = 0; | |
10176 | |
10177 /* "(tree fragment)":6 | |
10178 * cdef bint use_setstate | |
10179 * state = (self.encoding,) | |
10180 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< | |
10181 * if _dict is not None: | |
10182 * state += (_dict,) | |
10183 */ | |
10184 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) | |
10185 __Pyx_GOTREF(__pyx_t_1); | |
10186 __pyx_v__dict = __pyx_t_1; | |
10187 __pyx_t_1 = 0; | |
10188 | |
10189 /* "(tree fragment)":7 | |
10190 * state = (self.encoding,) | |
10191 * _dict = getattr(self, '__dict__', None) | |
10192 * if _dict is not None: # <<<<<<<<<<<<<< | |
10193 * state += (_dict,) | |
10194 * use_setstate = True | |
10195 */ | |
10196 __pyx_t_2 = (__pyx_v__dict != Py_None); | |
10197 if (__pyx_t_2) { | |
10198 | |
10199 /* "(tree fragment)":8 | |
10200 * _dict = getattr(self, '__dict__', None) | |
10201 * if _dict is not None: | |
10202 * state += (_dict,) # <<<<<<<<<<<<<< | |
10203 * use_setstate = True | |
10204 * else: | |
10205 */ | |
10206 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) | |
10207 __Pyx_GOTREF(__pyx_t_1); | |
10208 __Pyx_INCREF(__pyx_v__dict); | |
10209 __Pyx_GIVEREF(__pyx_v__dict); | |
10210 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error); | |
10211 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) | |
10212 __Pyx_GOTREF(__pyx_t_3); | |
10213 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
10214 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); | |
10215 __pyx_t_3 = 0; | |
10216 | |
10217 /* "(tree fragment)":9 | |
10218 * if _dict is not None: | |
10219 * state += (_dict,) | |
10220 * use_setstate = True # <<<<<<<<<<<<<< | |
10221 * else: | |
10222 * use_setstate = self.encoding is not None | |
10223 */ | |
10224 __pyx_v_use_setstate = 1; | |
10225 | |
10226 /* "(tree fragment)":7 | |
10227 * state = (self.encoding,) | |
10228 * _dict = getattr(self, '__dict__', None) | |
10229 * if _dict is not None: # <<<<<<<<<<<<<< | |
10230 * state += (_dict,) | |
10231 * use_setstate = True | |
10232 */ | |
10233 goto __pyx_L3; | |
10234 } | |
10235 | |
10236 /* "(tree fragment)":11 | |
10237 * use_setstate = True | |
10238 * else: | |
10239 * use_setstate = self.encoding is not None # <<<<<<<<<<<<<< | |
10240 * if use_setstate: | |
10241 * return __pyx_unpickle_asVCF, (type(self), 0xe8424ea, None), state | |
10242 */ | |
10243 /*else*/ { | |
10244 __pyx_t_2 = (__pyx_v_self->__pyx_base.encoding != Py_None); | |
10245 __pyx_v_use_setstate = __pyx_t_2; | |
10246 } | |
10247 __pyx_L3:; | |
10248 | |
10249 /* "(tree fragment)":12 | |
10250 * else: | |
10251 * use_setstate = self.encoding is not None | |
10252 * if use_setstate: # <<<<<<<<<<<<<< | |
10253 * return __pyx_unpickle_asVCF, (type(self), 0xe8424ea, None), state | |
10254 * else: | |
10255 */ | |
10256 if (__pyx_v_use_setstate) { | |
10257 | |
10258 /* "(tree fragment)":13 | |
10259 * use_setstate = self.encoding is not None | |
10260 * if use_setstate: | |
10261 * return __pyx_unpickle_asVCF, (type(self), 0xe8424ea, None), state # <<<<<<<<<<<<<< | |
10262 * else: | |
10263 * return __pyx_unpickle_asVCF, (type(self), 0xe8424ea, state) | |
10264 */ | |
10265 __Pyx_XDECREF(__pyx_r); | |
10266 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_asVCF); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) | |
10267 __Pyx_GOTREF(__pyx_t_3); | |
10268 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) | |
10269 __Pyx_GOTREF(__pyx_t_1); | |
10270 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
10271 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
10272 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error); | |
10273 __Pyx_INCREF(__pyx_int_243541226); | |
10274 __Pyx_GIVEREF(__pyx_int_243541226); | |
10275 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_243541226)) __PYX_ERR(1, 13, __pyx_L1_error); | |
10276 __Pyx_INCREF(Py_None); | |
10277 __Pyx_GIVEREF(Py_None); | |
10278 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error); | |
10279 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) | |
10280 __Pyx_GOTREF(__pyx_t_4); | |
10281 __Pyx_GIVEREF(__pyx_t_3); | |
10282 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error); | |
10283 __Pyx_GIVEREF(__pyx_t_1); | |
10284 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error); | |
10285 __Pyx_INCREF(__pyx_v_state); | |
10286 __Pyx_GIVEREF(__pyx_v_state); | |
10287 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error); | |
10288 __pyx_t_3 = 0; | |
10289 __pyx_t_1 = 0; | |
10290 __pyx_r = __pyx_t_4; | |
10291 __pyx_t_4 = 0; | |
10292 goto __pyx_L0; | |
10293 | |
10294 /* "(tree fragment)":12 | |
10295 * else: | |
10296 * use_setstate = self.encoding is not None | |
10297 * if use_setstate: # <<<<<<<<<<<<<< | |
10298 * return __pyx_unpickle_asVCF, (type(self), 0xe8424ea, None), state | |
10299 * else: | |
10300 */ | |
10301 } | |
10302 | |
10303 /* "(tree fragment)":15 | |
10304 * return __pyx_unpickle_asVCF, (type(self), 0xe8424ea, None), state | |
10305 * else: | |
10306 * return __pyx_unpickle_asVCF, (type(self), 0xe8424ea, state) # <<<<<<<<<<<<<< | |
10307 * def __setstate_cython__(self, __pyx_state): | |
10308 * __pyx_unpickle_asVCF__set_state(self, __pyx_state) | |
10309 */ | |
10310 /*else*/ { | |
10311 __Pyx_XDECREF(__pyx_r); | |
10312 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_asVCF); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) | |
10313 __Pyx_GOTREF(__pyx_t_4); | |
10314 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) | |
10315 __Pyx_GOTREF(__pyx_t_1); | |
10316 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
10317 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
10318 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error); | |
10319 __Pyx_INCREF(__pyx_int_243541226); | |
10320 __Pyx_GIVEREF(__pyx_int_243541226); | |
10321 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_243541226)) __PYX_ERR(1, 15, __pyx_L1_error); | |
10322 __Pyx_INCREF(__pyx_v_state); | |
10323 __Pyx_GIVEREF(__pyx_v_state); | |
10324 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error); | |
10325 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) | |
10326 __Pyx_GOTREF(__pyx_t_3); | |
10327 __Pyx_GIVEREF(__pyx_t_4); | |
10328 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error); | |
10329 __Pyx_GIVEREF(__pyx_t_1); | |
10330 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error); | |
10331 __pyx_t_4 = 0; | |
10332 __pyx_t_1 = 0; | |
10333 __pyx_r = __pyx_t_3; | |
10334 __pyx_t_3 = 0; | |
10335 goto __pyx_L0; | |
10336 } | |
10337 | |
10338 /* "(tree fragment)":1 | |
10339 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
10340 * cdef tuple state | |
10341 * cdef object _dict | |
10342 */ | |
10343 | |
10344 /* function exit code */ | |
10345 __pyx_L1_error:; | |
10346 __Pyx_XDECREF(__pyx_t_1); | |
10347 __Pyx_XDECREF(__pyx_t_3); | |
10348 __Pyx_XDECREF(__pyx_t_4); | |
10349 __Pyx_AddTraceback("pysam.libctabix.asVCF.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10350 __pyx_r = NULL; | |
10351 __pyx_L0:; | |
10352 __Pyx_XDECREF(__pyx_v_state); | |
10353 __Pyx_XDECREF(__pyx_v__dict); | |
10354 __Pyx_XGIVEREF(__pyx_r); | |
10355 __Pyx_TraceReturn(__pyx_r, 0); | |
10356 __Pyx_RefNannyFinishContext(); | |
10357 return __pyx_r; | |
10358 } | |
10359 | |
10360 /* "(tree fragment)":16 | |
10361 * else: | |
10362 * return __pyx_unpickle_asVCF, (type(self), 0xe8424ea, state) | |
10363 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
10364 * __pyx_unpickle_asVCF__set_state(self, __pyx_state) | |
10365 */ | |
10366 | |
10367 /* Python wrapper */ | |
10368 static PyObject *__pyx_pw_5pysam_9libctabix_5asVCF_3__setstate_cython__(PyObject *__pyx_v_self, | |
10369 #if CYTHON_METH_FASTCALL | |
10370 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
10371 #else | |
10372 PyObject *__pyx_args, PyObject *__pyx_kwds | |
10373 #endif | |
10374 ); /*proto*/ | |
10375 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_5asVCF_2__setstate_cython__, "asVCF.__setstate_cython__(self, __pyx_state)"); | |
10376 static PyMethodDef __pyx_mdef_5pysam_9libctabix_5asVCF_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_5asVCF_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_5asVCF_2__setstate_cython__}; | |
10377 static PyObject *__pyx_pw_5pysam_9libctabix_5asVCF_3__setstate_cython__(PyObject *__pyx_v_self, | |
10378 #if CYTHON_METH_FASTCALL | |
10379 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
10380 #else | |
10381 PyObject *__pyx_args, PyObject *__pyx_kwds | |
10382 #endif | |
10383 ) { | |
10384 PyObject *__pyx_v___pyx_state = 0; | |
10385 #if !CYTHON_METH_FASTCALL | |
10386 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
10387 #endif | |
10388 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10389 PyObject* values[1] = {0}; | |
10390 int __pyx_lineno = 0; | |
10391 const char *__pyx_filename = NULL; | |
10392 int __pyx_clineno = 0; | |
10393 PyObject *__pyx_r = 0; | |
10394 __Pyx_RefNannyDeclarations | |
10395 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
10396 #if !CYTHON_METH_FASTCALL | |
10397 #if CYTHON_ASSUME_SAFE_MACROS | |
10398 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
10399 #else | |
10400 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
10401 #endif | |
10402 #endif | |
10403 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
10404 { | |
10405 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
10406 if (__pyx_kwds) { | |
10407 Py_ssize_t kw_args; | |
10408 switch (__pyx_nargs) { | |
10409 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
10410 CYTHON_FALLTHROUGH; | |
10411 case 0: break; | |
10412 default: goto __pyx_L5_argtuple_error; | |
10413 } | |
10414 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
10415 switch (__pyx_nargs) { | |
10416 case 0: | |
10417 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
10418 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
10419 kw_args--; | |
10420 } | |
10421 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error) | |
10422 else goto __pyx_L5_argtuple_error; | |
10423 } | |
10424 if (unlikely(kw_args > 0)) { | |
10425 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
10426 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error) | |
10427 } | |
10428 } else if (unlikely(__pyx_nargs != 1)) { | |
10429 goto __pyx_L5_argtuple_error; | |
10430 } else { | |
10431 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
10432 } | |
10433 __pyx_v___pyx_state = values[0]; | |
10434 } | |
10435 goto __pyx_L6_skip; | |
10436 __pyx_L5_argtuple_error:; | |
10437 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) | |
10438 __pyx_L6_skip:; | |
10439 goto __pyx_L4_argument_unpacking_done; | |
10440 __pyx_L3_error:; | |
10441 { | |
10442 Py_ssize_t __pyx_temp; | |
10443 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
10444 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
10445 } | |
10446 } | |
10447 __Pyx_AddTraceback("pysam.libctabix.asVCF.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10448 __Pyx_RefNannyFinishContext(); | |
10449 return NULL; | |
10450 __pyx_L4_argument_unpacking_done:; | |
10451 __pyx_r = __pyx_pf_5pysam_9libctabix_5asVCF_2__setstate_cython__(((struct __pyx_obj_5pysam_9libctabix_asVCF *)__pyx_v_self), __pyx_v___pyx_state); | |
10452 | |
10453 /* function exit code */ | |
10454 { | |
10455 Py_ssize_t __pyx_temp; | |
10456 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
10457 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
10458 } | |
10459 } | |
10460 __Pyx_RefNannyFinishContext(); | |
10461 return __pyx_r; | |
10462 } | |
10463 | |
10464 static PyObject *__pyx_pf_5pysam_9libctabix_5asVCF_2__setstate_cython__(struct __pyx_obj_5pysam_9libctabix_asVCF *__pyx_v_self, PyObject *__pyx_v___pyx_state) { | |
10465 PyObject *__pyx_r = NULL; | |
10466 __Pyx_TraceDeclarations | |
10467 __Pyx_RefNannyDeclarations | |
10468 PyObject *__pyx_t_1 = NULL; | |
10469 int __pyx_lineno = 0; | |
10470 const char *__pyx_filename = NULL; | |
10471 int __pyx_clineno = 0; | |
10472 __Pyx_TraceFrameInit(__pyx_codeobj__14) | |
10473 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
10474 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error)); | |
10475 | |
10476 /* "(tree fragment)":17 | |
10477 * return __pyx_unpickle_asVCF, (type(self), 0xe8424ea, state) | |
10478 * def __setstate_cython__(self, __pyx_state): | |
10479 * __pyx_unpickle_asVCF__set_state(self, __pyx_state) # <<<<<<<<<<<<<< | |
10480 */ | |
10481 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error) | |
10482 __pyx_t_1 = __pyx_f_5pysam_9libctabix___pyx_unpickle_asVCF__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) | |
10483 __Pyx_GOTREF(__pyx_t_1); | |
10484 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
10485 | |
10486 /* "(tree fragment)":16 | |
10487 * else: | |
10488 * return __pyx_unpickle_asVCF, (type(self), 0xe8424ea, state) | |
10489 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
10490 * __pyx_unpickle_asVCF__set_state(self, __pyx_state) | |
10491 */ | |
10492 | |
10493 /* function exit code */ | |
10494 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
10495 goto __pyx_L0; | |
10496 __pyx_L1_error:; | |
10497 __Pyx_XDECREF(__pyx_t_1); | |
10498 __Pyx_AddTraceback("pysam.libctabix.asVCF.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10499 __pyx_r = NULL; | |
10500 __pyx_L0:; | |
10501 __Pyx_XGIVEREF(__pyx_r); | |
10502 __Pyx_TraceReturn(__pyx_r, 0); | |
10503 __Pyx_RefNannyFinishContext(); | |
10504 return __pyx_r; | |
10505 } | |
10506 | |
10507 /* "pysam/libctabix.pyx":334 | |
10508 * if file could not be opened | |
10509 * """ | |
10510 * def __cinit__(self, # <<<<<<<<<<<<<< | |
10511 * filename, | |
10512 * mode='r', | |
10513 */ | |
10514 | |
10515 /* Python wrapper */ | |
10516 static int __pyx_pw_5pysam_9libctabix_9TabixFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
10517 static int __pyx_pw_5pysam_9libctabix_9TabixFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
10518 PyObject *__pyx_v_filename = 0; | |
10519 PyObject *__pyx_v_mode = 0; | |
10520 PyObject *__pyx_v_parser = 0; | |
10521 PyObject *__pyx_v_index = 0; | |
10522 PyObject *__pyx_v_encoding = 0; | |
10523 PyObject *__pyx_v_threads = 0; | |
10524 PyObject *__pyx_v_args = 0; | |
10525 PyObject *__pyx_v_kwargs = 0; | |
10526 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
10527 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10528 PyObject* values[6] = {0,0,0,0,0,0}; | |
10529 int __pyx_lineno = 0; | |
10530 const char *__pyx_filename = NULL; | |
10531 int __pyx_clineno = 0; | |
10532 int __pyx_r; | |
10533 __Pyx_RefNannyDeclarations | |
10534 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); | |
10535 #if CYTHON_ASSUME_SAFE_MACROS | |
10536 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
10537 #else | |
10538 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; | |
10539 #endif | |
10540 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
10541 __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; | |
10542 __Pyx_GOTREF(__pyx_v_kwargs); | |
10543 __pyx_v_args = __Pyx_ArgsSlice_VARARGS(__pyx_args, 6, __pyx_nargs); | |
10544 if (unlikely(!__pyx_v_args)) { | |
10545 __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; | |
10546 __Pyx_RefNannyFinishContext(); | |
10547 return -1; | |
10548 } | |
10549 __Pyx_GOTREF(__pyx_v_args); | |
10550 { | |
10551 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_mode,&__pyx_n_s_parser,&__pyx_n_s_index,&__pyx_n_s_encoding,&__pyx_n_s_threads,0}; | |
10552 values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_u_r)); | |
10553 | |
10554 /* "pysam/libctabix.pyx":337 | |
10555 * filename, | |
10556 * mode='r', | |
10557 * parser=None, # <<<<<<<<<<<<<< | |
10558 * index=None, | |
10559 * encoding="ascii", | |
10560 */ | |
10561 values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); | |
10562 | |
10563 /* "pysam/libctabix.pyx":338 | |
10564 * mode='r', | |
10565 * parser=None, | |
10566 * index=None, # <<<<<<<<<<<<<< | |
10567 * encoding="ascii", | |
10568 * threads=1, | |
10569 */ | |
10570 values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); | |
10571 values[4] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_u_ascii)); | |
10572 values[5] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1)); | |
10573 if (__pyx_kwds) { | |
10574 Py_ssize_t kw_args; | |
10575 switch (__pyx_nargs) { | |
10576 default: | |
10577 case 6: values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5); | |
10578 CYTHON_FALLTHROUGH; | |
10579 case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); | |
10580 CYTHON_FALLTHROUGH; | |
10581 case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); | |
10582 CYTHON_FALLTHROUGH; | |
10583 case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); | |
10584 CYTHON_FALLTHROUGH; | |
10585 case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); | |
10586 CYTHON_FALLTHROUGH; | |
10587 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
10588 CYTHON_FALLTHROUGH; | |
10589 case 0: break; | |
10590 } | |
10591 kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); | |
10592 switch (__pyx_nargs) { | |
10593 case 0: | |
10594 if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) { | |
10595 (void)__Pyx_Arg_NewRef_VARARGS(values[0]); | |
10596 kw_args--; | |
10597 } | |
10598 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 334, __pyx_L3_error) | |
10599 else goto __pyx_L5_argtuple_error; | |
10600 CYTHON_FALLTHROUGH; | |
10601 case 1: | |
10602 if (kw_args > 0) { | |
10603 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); | |
10604 if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } | |
10605 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 334, __pyx_L3_error) | |
10606 } | |
10607 CYTHON_FALLTHROUGH; | |
10608 case 2: | |
10609 if (kw_args > 0) { | |
10610 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_parser); | |
10611 if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } | |
10612 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 334, __pyx_L3_error) | |
10613 } | |
10614 CYTHON_FALLTHROUGH; | |
10615 case 3: | |
10616 if (kw_args > 0) { | |
10617 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index); | |
10618 if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } | |
10619 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 334, __pyx_L3_error) | |
10620 } | |
10621 CYTHON_FALLTHROUGH; | |
10622 case 4: | |
10623 if (kw_args > 0) { | |
10624 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding); | |
10625 if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } | |
10626 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 334, __pyx_L3_error) | |
10627 } | |
10628 CYTHON_FALLTHROUGH; | |
10629 case 5: | |
10630 if (kw_args > 0) { | |
10631 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_threads); | |
10632 if (value) { values[5] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } | |
10633 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 334, __pyx_L3_error) | |
10634 } | |
10635 } | |
10636 if (unlikely(kw_args > 0)) { | |
10637 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
10638 const Py_ssize_t used_pos_args = (kwd_pos_args < 6) ? kwd_pos_args : 6; | |
10639 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, used_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 334, __pyx_L3_error) | |
10640 } | |
10641 } else { | |
10642 switch (__pyx_nargs) { | |
10643 default: | |
10644 case 6: values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5); | |
10645 CYTHON_FALLTHROUGH; | |
10646 case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); | |
10647 CYTHON_FALLTHROUGH; | |
10648 case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); | |
10649 CYTHON_FALLTHROUGH; | |
10650 case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); | |
10651 CYTHON_FALLTHROUGH; | |
10652 case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); | |
10653 CYTHON_FALLTHROUGH; | |
10654 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
10655 break; | |
10656 case 0: | |
10657 goto __pyx_L5_argtuple_error; | |
10658 } | |
10659 } | |
10660 __pyx_v_filename = values[0]; | |
10661 __pyx_v_mode = values[1]; | |
10662 __pyx_v_parser = values[2]; | |
10663 __pyx_v_index = values[3]; | |
10664 __pyx_v_encoding = values[4]; | |
10665 __pyx_v_threads = values[5]; | |
10666 } | |
10667 goto __pyx_L6_skip; | |
10668 __pyx_L5_argtuple_error:; | |
10669 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 6, __pyx_nargs); __PYX_ERR(0, 334, __pyx_L3_error) | |
10670 __pyx_L6_skip:; | |
10671 goto __pyx_L4_argument_unpacking_done; | |
10672 __pyx_L3_error:; | |
10673 { | |
10674 Py_ssize_t __pyx_temp; | |
10675 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
10676 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
10677 } | |
10678 } | |
10679 __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; | |
10680 __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; | |
10681 __Pyx_AddTraceback("pysam.libctabix.TabixFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10682 __Pyx_RefNannyFinishContext(); | |
10683 return -1; | |
10684 __pyx_L4_argument_unpacking_done:; | |
10685 __pyx_r = __pyx_pf_5pysam_9libctabix_9TabixFile___cinit__(((struct __pyx_obj_5pysam_9libctabix_TabixFile *)__pyx_v_self), __pyx_v_filename, __pyx_v_mode, __pyx_v_parser, __pyx_v_index, __pyx_v_encoding, __pyx_v_threads, __pyx_v_args, __pyx_v_kwargs); | |
10686 | |
10687 /* "pysam/libctabix.pyx":334 | |
10688 * if file could not be opened | |
10689 * """ | |
10690 * def __cinit__(self, # <<<<<<<<<<<<<< | |
10691 * filename, | |
10692 * mode='r', | |
10693 */ | |
10694 | |
10695 /* function exit code */ | |
10696 __Pyx_DECREF(__pyx_v_args); | |
10697 __Pyx_DECREF(__pyx_v_kwargs); | |
10698 { | |
10699 Py_ssize_t __pyx_temp; | |
10700 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
10701 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
10702 } | |
10703 } | |
10704 __Pyx_RefNannyFinishContext(); | |
10705 return __pyx_r; | |
10706 } | |
10707 | |
10708 static int __pyx_pf_5pysam_9libctabix_9TabixFile___cinit__(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode, PyObject *__pyx_v_parser, PyObject *__pyx_v_index, PyObject *__pyx_v_encoding, PyObject *__pyx_v_threads, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { | |
10709 int __pyx_r; | |
10710 __Pyx_TraceDeclarations | |
10711 __Pyx_RefNannyDeclarations | |
10712 PyObject *__pyx_t_1 = NULL; | |
10713 PyObject *__pyx_t_2 = NULL; | |
10714 PyObject *__pyx_t_3 = NULL; | |
10715 PyObject *__pyx_t_4 = NULL; | |
10716 int __pyx_lineno = 0; | |
10717 const char *__pyx_filename = NULL; | |
10718 int __pyx_clineno = 0; | |
10719 __Pyx_RefNannySetupContext("__cinit__", 1); | |
10720 __Pyx_TraceCall("__cinit__", __pyx_f[0], 334, 0, __PYX_ERR(0, 334, __pyx_L1_error)); | |
10721 | |
10722 /* "pysam/libctabix.pyx":344 | |
10723 * **kwargs ): | |
10724 * | |
10725 * self.htsfile = NULL # <<<<<<<<<<<<<< | |
10726 * self.is_remote = False | |
10727 * self.is_stream = False | |
10728 */ | |
10729 __pyx_v_self->__pyx_base.htsfile = NULL; | |
10730 | |
10731 /* "pysam/libctabix.pyx":345 | |
10732 * | |
10733 * self.htsfile = NULL | |
10734 * self.is_remote = False # <<<<<<<<<<<<<< | |
10735 * self.is_stream = False | |
10736 * self.parser = parser | |
10737 */ | |
10738 __pyx_v_self->__pyx_base.is_remote = 0; | |
10739 | |
10740 /* "pysam/libctabix.pyx":346 | |
10741 * self.htsfile = NULL | |
10742 * self.is_remote = False | |
10743 * self.is_stream = False # <<<<<<<<<<<<<< | |
10744 * self.parser = parser | |
10745 * self.threads = threads | |
10746 */ | |
10747 __pyx_v_self->__pyx_base.is_stream = 0; | |
10748 | |
10749 /* "pysam/libctabix.pyx":347 | |
10750 * self.is_remote = False | |
10751 * self.is_stream = False | |
10752 * self.parser = parser # <<<<<<<<<<<<<< | |
10753 * self.threads = threads | |
10754 * self._open(filename, mode, index, *args, **kwargs) | |
10755 */ | |
10756 if (!(likely(((__pyx_v_parser) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_5pysam_9libctabix_Parser))))) __PYX_ERR(0, 347, __pyx_L1_error) | |
10757 __pyx_t_1 = __pyx_v_parser; | |
10758 __Pyx_INCREF(__pyx_t_1); | |
10759 __Pyx_GIVEREF(__pyx_t_1); | |
10760 __Pyx_GOTREF((PyObject *)__pyx_v_self->parser); | |
10761 __Pyx_DECREF((PyObject *)__pyx_v_self->parser); | |
10762 __pyx_v_self->parser = ((struct __pyx_obj_5pysam_9libctabix_Parser *)__pyx_t_1); | |
10763 __pyx_t_1 = 0; | |
10764 | |
10765 /* "pysam/libctabix.pyx":348 | |
10766 * self.is_stream = False | |
10767 * self.parser = parser | |
10768 * self.threads = threads # <<<<<<<<<<<<<< | |
10769 * self._open(filename, mode, index, *args, **kwargs) | |
10770 * self.encoding = encoding | |
10771 */ | |
10772 __Pyx_INCREF(__pyx_v_threads); | |
10773 __Pyx_GIVEREF(__pyx_v_threads); | |
10774 __Pyx_GOTREF(__pyx_v_self->__pyx_base.threads); | |
10775 __Pyx_DECREF(__pyx_v_self->__pyx_base.threads); | |
10776 __pyx_v_self->__pyx_base.threads = __pyx_v_threads; | |
10777 | |
10778 /* "pysam/libctabix.pyx":349 | |
10779 * self.parser = parser | |
10780 * self.threads = threads | |
10781 * self._open(filename, mode, index, *args, **kwargs) # <<<<<<<<<<<<<< | |
10782 * self.encoding = encoding | |
10783 * | |
10784 */ | |
10785 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) | |
10786 __Pyx_GOTREF(__pyx_t_1); | |
10787 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) | |
10788 __Pyx_GOTREF(__pyx_t_2); | |
10789 __Pyx_INCREF(__pyx_v_filename); | |
10790 __Pyx_GIVEREF(__pyx_v_filename); | |
10791 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_filename)) __PYX_ERR(0, 349, __pyx_L1_error); | |
10792 __Pyx_INCREF(__pyx_v_mode); | |
10793 __Pyx_GIVEREF(__pyx_v_mode); | |
10794 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_mode)) __PYX_ERR(0, 349, __pyx_L1_error); | |
10795 __Pyx_INCREF(__pyx_v_index); | |
10796 __Pyx_GIVEREF(__pyx_v_index); | |
10797 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_index)) __PYX_ERR(0, 349, __pyx_L1_error); | |
10798 __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 349, __pyx_L1_error) | |
10799 __Pyx_GOTREF(__pyx_t_3); | |
10800 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
10801 __pyx_t_2 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) | |
10802 __Pyx_GOTREF(__pyx_t_2); | |
10803 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 349, __pyx_L1_error) | |
10804 __Pyx_GOTREF(__pyx_t_4); | |
10805 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
10806 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
10807 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
10808 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
10809 | |
10810 /* "pysam/libctabix.pyx":350 | |
10811 * self.threads = threads | |
10812 * self._open(filename, mode, index, *args, **kwargs) | |
10813 * self.encoding = encoding # <<<<<<<<<<<<<< | |
10814 * | |
10815 * def _open( self, | |
10816 */ | |
10817 __Pyx_INCREF(__pyx_v_encoding); | |
10818 __Pyx_GIVEREF(__pyx_v_encoding); | |
10819 __Pyx_GOTREF(__pyx_v_self->encoding); | |
10820 __Pyx_DECREF(__pyx_v_self->encoding); | |
10821 __pyx_v_self->encoding = __pyx_v_encoding; | |
10822 | |
10823 /* "pysam/libctabix.pyx":334 | |
10824 * if file could not be opened | |
10825 * """ | |
10826 * def __cinit__(self, # <<<<<<<<<<<<<< | |
10827 * filename, | |
10828 * mode='r', | |
10829 */ | |
10830 | |
10831 /* function exit code */ | |
10832 __pyx_r = 0; | |
10833 goto __pyx_L0; | |
10834 __pyx_L1_error:; | |
10835 __Pyx_XDECREF(__pyx_t_1); | |
10836 __Pyx_XDECREF(__pyx_t_2); | |
10837 __Pyx_XDECREF(__pyx_t_3); | |
10838 __Pyx_XDECREF(__pyx_t_4); | |
10839 __Pyx_AddTraceback("pysam.libctabix.TabixFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10840 __pyx_r = -1; | |
10841 __pyx_L0:; | |
10842 __Pyx_TraceReturn(Py_None, 0); | |
10843 __Pyx_RefNannyFinishContext(); | |
10844 return __pyx_r; | |
10845 } | |
10846 | |
10847 /* "pysam/libctabix.pyx":352 | |
10848 * self.encoding = encoding | |
10849 * | |
10850 * def _open( self, # <<<<<<<<<<<<<< | |
10851 * filename, | |
10852 * mode='r', | |
10853 */ | |
10854 | |
10855 /* Python wrapper */ | |
10856 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_3_open(PyObject *__pyx_v_self, | |
10857 #if CYTHON_METH_FASTCALL | |
10858 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
10859 #else | |
10860 PyObject *__pyx_args, PyObject *__pyx_kwds | |
10861 #endif | |
10862 ); /*proto*/ | |
10863 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_9TabixFile_2_open, "TabixFile._open(self, filename, mode=u'r', index=None, threads=1)\nopen a :term:`tabix file` for reading."); | |
10864 static PyMethodDef __pyx_mdef_5pysam_9libctabix_9TabixFile_3_open = {"_open", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9TabixFile_3_open, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_9TabixFile_2_open}; | |
10865 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_3_open(PyObject *__pyx_v_self, | |
10866 #if CYTHON_METH_FASTCALL | |
10867 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
10868 #else | |
10869 PyObject *__pyx_args, PyObject *__pyx_kwds | |
10870 #endif | |
10871 ) { | |
10872 PyObject *__pyx_v_filename = 0; | |
10873 PyObject *__pyx_v_mode = 0; | |
10874 PyObject *__pyx_v_index = 0; | |
10875 PyObject *__pyx_v_threads = 0; | |
10876 #if !CYTHON_METH_FASTCALL | |
10877 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
10878 #endif | |
10879 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10880 PyObject* values[4] = {0,0,0,0}; | |
10881 int __pyx_lineno = 0; | |
10882 const char *__pyx_filename = NULL; | |
10883 int __pyx_clineno = 0; | |
10884 PyObject *__pyx_r = 0; | |
10885 __Pyx_RefNannyDeclarations | |
10886 __Pyx_RefNannySetupContext("_open (wrapper)", 0); | |
10887 #if !CYTHON_METH_FASTCALL | |
10888 #if CYTHON_ASSUME_SAFE_MACROS | |
10889 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
10890 #else | |
10891 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
10892 #endif | |
10893 #endif | |
10894 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
10895 { | |
10896 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_mode,&__pyx_n_s_index,&__pyx_n_s_threads,0}; | |
10897 values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_n_u_r)); | |
10898 | |
10899 /* "pysam/libctabix.pyx":355 | |
10900 * filename, | |
10901 * mode='r', | |
10902 * index=None, # <<<<<<<<<<<<<< | |
10903 * threads=1, | |
10904 * ): | |
10905 */ | |
10906 values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
10907 values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)__pyx_int_1)); | |
10908 if (__pyx_kwds) { | |
10909 Py_ssize_t kw_args; | |
10910 switch (__pyx_nargs) { | |
10911 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
10912 CYTHON_FALLTHROUGH; | |
10913 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
10914 CYTHON_FALLTHROUGH; | |
10915 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
10916 CYTHON_FALLTHROUGH; | |
10917 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
10918 CYTHON_FALLTHROUGH; | |
10919 case 0: break; | |
10920 default: goto __pyx_L5_argtuple_error; | |
10921 } | |
10922 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
10923 switch (__pyx_nargs) { | |
10924 case 0: | |
10925 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) { | |
10926 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
10927 kw_args--; | |
10928 } | |
10929 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 352, __pyx_L3_error) | |
10930 else goto __pyx_L5_argtuple_error; | |
10931 CYTHON_FALLTHROUGH; | |
10932 case 1: | |
10933 if (kw_args > 0) { | |
10934 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode); | |
10935 if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
10936 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 352, __pyx_L3_error) | |
10937 } | |
10938 CYTHON_FALLTHROUGH; | |
10939 case 2: | |
10940 if (kw_args > 0) { | |
10941 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index); | |
10942 if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
10943 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 352, __pyx_L3_error) | |
10944 } | |
10945 CYTHON_FALLTHROUGH; | |
10946 case 3: | |
10947 if (kw_args > 0) { | |
10948 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_threads); | |
10949 if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
10950 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 352, __pyx_L3_error) | |
10951 } | |
10952 } | |
10953 if (unlikely(kw_args > 0)) { | |
10954 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
10955 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_open") < 0)) __PYX_ERR(0, 352, __pyx_L3_error) | |
10956 } | |
10957 } else { | |
10958 switch (__pyx_nargs) { | |
10959 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
10960 CYTHON_FALLTHROUGH; | |
10961 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
10962 CYTHON_FALLTHROUGH; | |
10963 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
10964 CYTHON_FALLTHROUGH; | |
10965 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
10966 break; | |
10967 default: goto __pyx_L5_argtuple_error; | |
10968 } | |
10969 } | |
10970 __pyx_v_filename = values[0]; | |
10971 __pyx_v_mode = values[1]; | |
10972 __pyx_v_index = values[2]; | |
10973 __pyx_v_threads = values[3]; | |
10974 } | |
10975 goto __pyx_L6_skip; | |
10976 __pyx_L5_argtuple_error:; | |
10977 __Pyx_RaiseArgtupleInvalid("_open", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 352, __pyx_L3_error) | |
10978 __pyx_L6_skip:; | |
10979 goto __pyx_L4_argument_unpacking_done; | |
10980 __pyx_L3_error:; | |
10981 { | |
10982 Py_ssize_t __pyx_temp; | |
10983 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
10984 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
10985 } | |
10986 } | |
10987 __Pyx_AddTraceback("pysam.libctabix.TabixFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10988 __Pyx_RefNannyFinishContext(); | |
10989 return NULL; | |
10990 __pyx_L4_argument_unpacking_done:; | |
10991 __pyx_r = __pyx_pf_5pysam_9libctabix_9TabixFile_2_open(((struct __pyx_obj_5pysam_9libctabix_TabixFile *)__pyx_v_self), __pyx_v_filename, __pyx_v_mode, __pyx_v_index, __pyx_v_threads); | |
10992 | |
10993 /* "pysam/libctabix.pyx":352 | |
10994 * self.encoding = encoding | |
10995 * | |
10996 * def _open( self, # <<<<<<<<<<<<<< | |
10997 * filename, | |
10998 * mode='r', | |
10999 */ | |
11000 | |
11001 /* function exit code */ | |
11002 { | |
11003 Py_ssize_t __pyx_temp; | |
11004 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
11005 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
11006 } | |
11007 } | |
11008 __Pyx_RefNannyFinishContext(); | |
11009 return __pyx_r; | |
11010 } | |
11011 | |
11012 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_2_open(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode, PyObject *__pyx_v_index, PyObject *__pyx_v_threads) { | |
11013 PyObject *__pyx_v_filename_index = NULL; | |
11014 char *__pyx_v_cfilename; | |
11015 char *__pyx_v_cfilename_index; | |
11016 PyObject *__pyx_r = NULL; | |
11017 __Pyx_TraceDeclarations | |
11018 __Pyx_RefNannyDeclarations | |
11019 int __pyx_t_1; | |
11020 PyObject *__pyx_t_2 = NULL; | |
11021 PyObject *__pyx_t_3 = NULL; | |
11022 PyObject *__pyx_t_4 = NULL; | |
11023 unsigned int __pyx_t_5; | |
11024 char const *__pyx_t_6; | |
11025 int __pyx_t_7; | |
11026 char *__pyx_t_8; | |
11027 int64_t __pyx_t_9; | |
11028 int __pyx_lineno = 0; | |
11029 const char *__pyx_filename = NULL; | |
11030 int __pyx_clineno = 0; | |
11031 __Pyx_TraceFrameInit(__pyx_codeobj__15) | |
11032 __Pyx_RefNannySetupContext("_open", 1); | |
11033 __Pyx_TraceCall("_open", __pyx_f[0], 352, 0, __PYX_ERR(0, 352, __pyx_L1_error)); | |
11034 | |
11035 /* "pysam/libctabix.pyx":360 | |
11036 * '''open a :term:`tabix file` for reading.''' | |
11037 * | |
11038 * if mode != 'r': # <<<<<<<<<<<<<< | |
11039 * raise ValueError("invalid file opening mode `%s`" % mode) | |
11040 * | |
11041 */ | |
11042 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_n_u_r, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 360, __pyx_L1_error) | |
11043 if (unlikely(__pyx_t_1)) { | |
11044 | |
11045 /* "pysam/libctabix.pyx":361 | |
11046 * | |
11047 * if mode != 'r': | |
11048 * raise ValueError("invalid file opening mode `%s`" % mode) # <<<<<<<<<<<<<< | |
11049 * | |
11050 * if self.htsfile != NULL: | |
11051 */ | |
11052 __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_invalid_file_opening_mode_s, __pyx_v_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) | |
11053 __Pyx_GOTREF(__pyx_t_2); | |
11054 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) | |
11055 __Pyx_GOTREF(__pyx_t_3); | |
11056 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11057 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
11058 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11059 __PYX_ERR(0, 361, __pyx_L1_error) | |
11060 | |
11061 /* "pysam/libctabix.pyx":360 | |
11062 * '''open a :term:`tabix file` for reading.''' | |
11063 * | |
11064 * if mode != 'r': # <<<<<<<<<<<<<< | |
11065 * raise ValueError("invalid file opening mode `%s`" % mode) | |
11066 * | |
11067 */ | |
11068 } | |
11069 | |
11070 /* "pysam/libctabix.pyx":363 | |
11071 * raise ValueError("invalid file opening mode `%s`" % mode) | |
11072 * | |
11073 * if self.htsfile != NULL: # <<<<<<<<<<<<<< | |
11074 * self.close() | |
11075 * self.htsfile = NULL | |
11076 */ | |
11077 __pyx_t_1 = (__pyx_v_self->__pyx_base.htsfile != NULL); | |
11078 if (__pyx_t_1) { | |
11079 | |
11080 /* "pysam/libctabix.pyx":364 | |
11081 * | |
11082 * if self.htsfile != NULL: | |
11083 * self.close() # <<<<<<<<<<<<<< | |
11084 * self.htsfile = NULL | |
11085 * self.threads=threads | |
11086 */ | |
11087 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) | |
11088 __Pyx_GOTREF(__pyx_t_2); | |
11089 __pyx_t_4 = NULL; | |
11090 __pyx_t_5 = 0; | |
11091 #if CYTHON_UNPACK_METHODS | |
11092 if (likely(PyMethod_Check(__pyx_t_2))) { | |
11093 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); | |
11094 if (likely(__pyx_t_4)) { | |
11095 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
11096 __Pyx_INCREF(__pyx_t_4); | |
11097 __Pyx_INCREF(function); | |
11098 __Pyx_DECREF_SET(__pyx_t_2, function); | |
11099 __pyx_t_5 = 1; | |
11100 } | |
11101 } | |
11102 #endif | |
11103 { | |
11104 PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; | |
11105 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); | |
11106 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
11107 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error) | |
11108 __Pyx_GOTREF(__pyx_t_3); | |
11109 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11110 } | |
11111 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11112 | |
11113 /* "pysam/libctabix.pyx":363 | |
11114 * raise ValueError("invalid file opening mode `%s`" % mode) | |
11115 * | |
11116 * if self.htsfile != NULL: # <<<<<<<<<<<<<< | |
11117 * self.close() | |
11118 * self.htsfile = NULL | |
11119 */ | |
11120 } | |
11121 | |
11122 /* "pysam/libctabix.pyx":365 | |
11123 * if self.htsfile != NULL: | |
11124 * self.close() | |
11125 * self.htsfile = NULL # <<<<<<<<<<<<<< | |
11126 * self.threads=threads | |
11127 * | |
11128 */ | |
11129 __pyx_v_self->__pyx_base.htsfile = NULL; | |
11130 | |
11131 /* "pysam/libctabix.pyx":366 | |
11132 * self.close() | |
11133 * self.htsfile = NULL | |
11134 * self.threads=threads # <<<<<<<<<<<<<< | |
11135 * | |
11136 * filename_index = index or (filename + ".tbi") | |
11137 */ | |
11138 __Pyx_INCREF(__pyx_v_threads); | |
11139 __Pyx_GIVEREF(__pyx_v_threads); | |
11140 __Pyx_GOTREF(__pyx_v_self->__pyx_base.threads); | |
11141 __Pyx_DECREF(__pyx_v_self->__pyx_base.threads); | |
11142 __pyx_v_self->__pyx_base.threads = __pyx_v_threads; | |
11143 | |
11144 /* "pysam/libctabix.pyx":368 | |
11145 * self.threads=threads | |
11146 * | |
11147 * filename_index = index or (filename + ".tbi") # <<<<<<<<<<<<<< | |
11148 * # encode all the strings to pass to tabix | |
11149 * self.filename = encode_filename(filename) | |
11150 */ | |
11151 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_index); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 368, __pyx_L1_error) | |
11152 if (!__pyx_t_1) { | |
11153 } else { | |
11154 __Pyx_INCREF(__pyx_v_index); | |
11155 __pyx_t_3 = __pyx_v_index; | |
11156 goto __pyx_L5_bool_binop_done; | |
11157 } | |
11158 __pyx_t_2 = PyNumber_Add(__pyx_v_filename, __pyx_kp_u_tbi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error) | |
11159 __Pyx_GOTREF(__pyx_t_2); | |
11160 __Pyx_INCREF(__pyx_t_2); | |
11161 __pyx_t_3 = __pyx_t_2; | |
11162 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11163 __pyx_L5_bool_binop_done:; | |
11164 __pyx_v_filename_index = __pyx_t_3; | |
11165 __pyx_t_3 = 0; | |
11166 | |
11167 /* "pysam/libctabix.pyx":370 | |
11168 * filename_index = index or (filename + ".tbi") | |
11169 * # encode all the strings to pass to tabix | |
11170 * self.filename = encode_filename(filename) # <<<<<<<<<<<<<< | |
11171 * self.filename_index = encode_filename(filename_index) | |
11172 * | |
11173 */ | |
11174 __pyx_t_3 = __pyx_f_5pysam_9libcutils_encode_filename(__pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error) | |
11175 __Pyx_GOTREF(__pyx_t_3); | |
11176 __Pyx_GIVEREF(__pyx_t_3); | |
11177 __Pyx_GOTREF(__pyx_v_self->__pyx_base.filename); | |
11178 __Pyx_DECREF(__pyx_v_self->__pyx_base.filename); | |
11179 __pyx_v_self->__pyx_base.filename = __pyx_t_3; | |
11180 __pyx_t_3 = 0; | |
11181 | |
11182 /* "pysam/libctabix.pyx":371 | |
11183 * # encode all the strings to pass to tabix | |
11184 * self.filename = encode_filename(filename) | |
11185 * self.filename_index = encode_filename(filename_index) # <<<<<<<<<<<<<< | |
11186 * | |
11187 * self.is_stream = self.filename == b'-' | |
11188 */ | |
11189 __pyx_t_3 = __pyx_f_5pysam_9libcutils_encode_filename(__pyx_v_filename_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) | |
11190 __Pyx_GOTREF(__pyx_t_3); | |
11191 __Pyx_GIVEREF(__pyx_t_3); | |
11192 __Pyx_GOTREF(__pyx_v_self->filename_index); | |
11193 __Pyx_DECREF(__pyx_v_self->filename_index); | |
11194 __pyx_v_self->filename_index = __pyx_t_3; | |
11195 __pyx_t_3 = 0; | |
11196 | |
11197 /* "pysam/libctabix.pyx":373 | |
11198 * self.filename_index = encode_filename(filename_index) | |
11199 * | |
11200 * self.is_stream = self.filename == b'-' # <<<<<<<<<<<<<< | |
11201 * self.is_remote = hisremote(self.filename) | |
11202 * | |
11203 */ | |
11204 __pyx_t_3 = PyObject_RichCompare(__pyx_v_self->__pyx_base.filename, __pyx_kp_b__16, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error) | |
11205 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 373, __pyx_L1_error) | |
11206 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11207 __pyx_v_self->__pyx_base.is_stream = __pyx_t_1; | |
11208 | |
11209 /* "pysam/libctabix.pyx":374 | |
11210 * | |
11211 * self.is_stream = self.filename == b'-' | |
11212 * self.is_remote = hisremote(self.filename) # <<<<<<<<<<<<<< | |
11213 * | |
11214 * if not self.is_remote: | |
11215 */ | |
11216 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->__pyx_base.filename); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 374, __pyx_L1_error) | |
11217 __pyx_v_self->__pyx_base.is_remote = hisremote(__pyx_t_6); | |
11218 | |
11219 /* "pysam/libctabix.pyx":376 | |
11220 * self.is_remote = hisremote(self.filename) | |
11221 * | |
11222 * if not self.is_remote: # <<<<<<<<<<<<<< | |
11223 * if not os.path.exists(filename): | |
11224 * raise IOError("file `%s` not found" % filename) | |
11225 */ | |
11226 __pyx_t_1 = (!__pyx_v_self->__pyx_base.is_remote); | |
11227 if (__pyx_t_1) { | |
11228 | |
11229 /* "pysam/libctabix.pyx":377 | |
11230 * | |
11231 * if not self.is_remote: | |
11232 * if not os.path.exists(filename): # <<<<<<<<<<<<<< | |
11233 * raise IOError("file `%s` not found" % filename) | |
11234 * | |
11235 */ | |
11236 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error) | |
11237 __Pyx_GOTREF(__pyx_t_2); | |
11238 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error) | |
11239 __Pyx_GOTREF(__pyx_t_4); | |
11240 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11241 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error) | |
11242 __Pyx_GOTREF(__pyx_t_2); | |
11243 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
11244 __pyx_t_4 = NULL; | |
11245 __pyx_t_5 = 0; | |
11246 #if CYTHON_UNPACK_METHODS | |
11247 if (likely(PyMethod_Check(__pyx_t_2))) { | |
11248 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); | |
11249 if (likely(__pyx_t_4)) { | |
11250 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
11251 __Pyx_INCREF(__pyx_t_4); | |
11252 __Pyx_INCREF(function); | |
11253 __Pyx_DECREF_SET(__pyx_t_2, function); | |
11254 __pyx_t_5 = 1; | |
11255 } | |
11256 } | |
11257 #endif | |
11258 { | |
11259 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_filename}; | |
11260 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
11261 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
11262 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error) | |
11263 __Pyx_GOTREF(__pyx_t_3); | |
11264 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11265 } | |
11266 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 377, __pyx_L1_error) | |
11267 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11268 __pyx_t_7 = (!__pyx_t_1); | |
11269 if (unlikely(__pyx_t_7)) { | |
11270 | |
11271 /* "pysam/libctabix.pyx":378 | |
11272 * if not self.is_remote: | |
11273 * if not os.path.exists(filename): | |
11274 * raise IOError("file `%s` not found" % filename) # <<<<<<<<<<<<<< | |
11275 * | |
11276 * if not os.path.exists(filename_index): | |
11277 */ | |
11278 __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_file_s_not_found, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error) | |
11279 __Pyx_GOTREF(__pyx_t_3); | |
11280 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error) | |
11281 __Pyx_GOTREF(__pyx_t_2); | |
11282 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11283 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
11284 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11285 __PYX_ERR(0, 378, __pyx_L1_error) | |
11286 | |
11287 /* "pysam/libctabix.pyx":377 | |
11288 * | |
11289 * if not self.is_remote: | |
11290 * if not os.path.exists(filename): # <<<<<<<<<<<<<< | |
11291 * raise IOError("file `%s` not found" % filename) | |
11292 * | |
11293 */ | |
11294 } | |
11295 | |
11296 /* "pysam/libctabix.pyx":380 | |
11297 * raise IOError("file `%s` not found" % filename) | |
11298 * | |
11299 * if not os.path.exists(filename_index): # <<<<<<<<<<<<<< | |
11300 * raise IOError("index `%s` not found" % filename_index) | |
11301 * | |
11302 */ | |
11303 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) | |
11304 __Pyx_GOTREF(__pyx_t_3); | |
11305 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error) | |
11306 __Pyx_GOTREF(__pyx_t_4); | |
11307 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11308 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) | |
11309 __Pyx_GOTREF(__pyx_t_3); | |
11310 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
11311 __pyx_t_4 = NULL; | |
11312 __pyx_t_5 = 0; | |
11313 #if CYTHON_UNPACK_METHODS | |
11314 if (likely(PyMethod_Check(__pyx_t_3))) { | |
11315 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
11316 if (likely(__pyx_t_4)) { | |
11317 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
11318 __Pyx_INCREF(__pyx_t_4); | |
11319 __Pyx_INCREF(function); | |
11320 __Pyx_DECREF_SET(__pyx_t_3, function); | |
11321 __pyx_t_5 = 1; | |
11322 } | |
11323 } | |
11324 #endif | |
11325 { | |
11326 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_filename_index}; | |
11327 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
11328 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
11329 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) | |
11330 __Pyx_GOTREF(__pyx_t_2); | |
11331 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11332 } | |
11333 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 380, __pyx_L1_error) | |
11334 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11335 __pyx_t_1 = (!__pyx_t_7); | |
11336 if (unlikely(__pyx_t_1)) { | |
11337 | |
11338 /* "pysam/libctabix.pyx":381 | |
11339 * | |
11340 * if not os.path.exists(filename_index): | |
11341 * raise IOError("index `%s` not found" % filename_index) # <<<<<<<<<<<<<< | |
11342 * | |
11343 * # open file | |
11344 */ | |
11345 __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_index_s_not_found, __pyx_v_filename_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) | |
11346 __Pyx_GOTREF(__pyx_t_2); | |
11347 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error) | |
11348 __Pyx_GOTREF(__pyx_t_3); | |
11349 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11350 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
11351 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11352 __PYX_ERR(0, 381, __pyx_L1_error) | |
11353 | |
11354 /* "pysam/libctabix.pyx":380 | |
11355 * raise IOError("file `%s` not found" % filename) | |
11356 * | |
11357 * if not os.path.exists(filename_index): # <<<<<<<<<<<<<< | |
11358 * raise IOError("index `%s` not found" % filename_index) | |
11359 * | |
11360 */ | |
11361 } | |
11362 | |
11363 /* "pysam/libctabix.pyx":376 | |
11364 * self.is_remote = hisremote(self.filename) | |
11365 * | |
11366 * if not self.is_remote: # <<<<<<<<<<<<<< | |
11367 * if not os.path.exists(filename): | |
11368 * raise IOError("file `%s` not found" % filename) | |
11369 */ | |
11370 } | |
11371 | |
11372 /* "pysam/libctabix.pyx":384 | |
11373 * | |
11374 * # open file | |
11375 * cdef char *cfilename = self.filename # <<<<<<<<<<<<<< | |
11376 * cdef char *cfilename_index = self.filename_index | |
11377 * with nogil: | |
11378 */ | |
11379 __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_v_self->__pyx_base.filename); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 384, __pyx_L1_error) | |
11380 __pyx_v_cfilename = __pyx_t_8; | |
11381 | |
11382 /* "pysam/libctabix.pyx":385 | |
11383 * # open file | |
11384 * cdef char *cfilename = self.filename | |
11385 * cdef char *cfilename_index = self.filename_index # <<<<<<<<<<<<<< | |
11386 * with nogil: | |
11387 * self.htsfile = hts_open(cfilename, 'r') | |
11388 */ | |
11389 __pyx_t_8 = __Pyx_PyObject_AsWritableString(__pyx_v_self->filename_index); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 385, __pyx_L1_error) | |
11390 __pyx_v_cfilename_index = __pyx_t_8; | |
11391 | |
11392 /* "pysam/libctabix.pyx":386 | |
11393 * cdef char *cfilename = self.filename | |
11394 * cdef char *cfilename_index = self.filename_index | |
11395 * with nogil: # <<<<<<<<<<<<<< | |
11396 * self.htsfile = hts_open(cfilename, 'r') | |
11397 * | |
11398 */ | |
11399 { | |
11400 #ifdef WITH_THREAD | |
11401 PyThreadState *_save; | |
11402 _save = NULL; | |
11403 Py_UNBLOCK_THREADS | |
11404 __Pyx_FastGIL_Remember(); | |
11405 #endif | |
11406 /*try:*/ { | |
11407 | |
11408 /* "pysam/libctabix.pyx":387 | |
11409 * cdef char *cfilename_index = self.filename_index | |
11410 * with nogil: | |
11411 * self.htsfile = hts_open(cfilename, 'r') # <<<<<<<<<<<<<< | |
11412 * | |
11413 * if self.htsfile == NULL: | |
11414 */ | |
11415 __pyx_v_self->__pyx_base.htsfile = hts_open(__pyx_v_cfilename, ((char const *)"r")); | |
11416 } | |
11417 | |
11418 /* "pysam/libctabix.pyx":386 | |
11419 * cdef char *cfilename = self.filename | |
11420 * cdef char *cfilename_index = self.filename_index | |
11421 * with nogil: # <<<<<<<<<<<<<< | |
11422 * self.htsfile = hts_open(cfilename, 'r') | |
11423 * | |
11424 */ | |
11425 /*finally:*/ { | |
11426 /*normal exit:*/{ | |
11427 #ifdef WITH_THREAD | |
11428 __Pyx_FastGIL_Forget(); | |
11429 Py_BLOCK_THREADS | |
11430 #endif | |
11431 goto __pyx_L12; | |
11432 } | |
11433 __pyx_L12:; | |
11434 } | |
11435 } | |
11436 | |
11437 /* "pysam/libctabix.pyx":389 | |
11438 * self.htsfile = hts_open(cfilename, 'r') | |
11439 * | |
11440 * if self.htsfile == NULL: # <<<<<<<<<<<<<< | |
11441 * raise IOError("could not open file `%s`" % filename) | |
11442 * | |
11443 */ | |
11444 __pyx_t_1 = (__pyx_v_self->__pyx_base.htsfile == NULL); | |
11445 if (unlikely(__pyx_t_1)) { | |
11446 | |
11447 /* "pysam/libctabix.pyx":390 | |
11448 * | |
11449 * if self.htsfile == NULL: | |
11450 * raise IOError("could not open file `%s`" % filename) # <<<<<<<<<<<<<< | |
11451 * | |
11452 * #if self.htsfile.format.category != region_list: | |
11453 */ | |
11454 __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_could_not_open_file_s, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 390, __pyx_L1_error) | |
11455 __Pyx_GOTREF(__pyx_t_3); | |
11456 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) | |
11457 __Pyx_GOTREF(__pyx_t_2); | |
11458 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11459 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
11460 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11461 __PYX_ERR(0, 390, __pyx_L1_error) | |
11462 | |
11463 /* "pysam/libctabix.pyx":389 | |
11464 * self.htsfile = hts_open(cfilename, 'r') | |
11465 * | |
11466 * if self.htsfile == NULL: # <<<<<<<<<<<<<< | |
11467 * raise IOError("could not open file `%s`" % filename) | |
11468 * | |
11469 */ | |
11470 } | |
11471 | |
11472 /* "pysam/libctabix.pyx":395 | |
11473 * # raise ValueError("file does not contain region data") | |
11474 * | |
11475 * with nogil: # <<<<<<<<<<<<<< | |
11476 * self.index = tbx_index_load2(cfilename, cfilename_index) | |
11477 * | |
11478 */ | |
11479 { | |
11480 #ifdef WITH_THREAD | |
11481 PyThreadState *_save; | |
11482 _save = NULL; | |
11483 Py_UNBLOCK_THREADS | |
11484 __Pyx_FastGIL_Remember(); | |
11485 #endif | |
11486 /*try:*/ { | |
11487 | |
11488 /* "pysam/libctabix.pyx":396 | |
11489 * | |
11490 * with nogil: | |
11491 * self.index = tbx_index_load2(cfilename, cfilename_index) # <<<<<<<<<<<<<< | |
11492 * | |
11493 * if self.index == NULL: | |
11494 */ | |
11495 __pyx_v_self->index = tbx_index_load2(__pyx_v_cfilename, __pyx_v_cfilename_index); | |
11496 } | |
11497 | |
11498 /* "pysam/libctabix.pyx":395 | |
11499 * # raise ValueError("file does not contain region data") | |
11500 * | |
11501 * with nogil: # <<<<<<<<<<<<<< | |
11502 * self.index = tbx_index_load2(cfilename, cfilename_index) | |
11503 * | |
11504 */ | |
11505 /*finally:*/ { | |
11506 /*normal exit:*/{ | |
11507 #ifdef WITH_THREAD | |
11508 __Pyx_FastGIL_Forget(); | |
11509 Py_BLOCK_THREADS | |
11510 #endif | |
11511 goto __pyx_L16; | |
11512 } | |
11513 __pyx_L16:; | |
11514 } | |
11515 } | |
11516 | |
11517 /* "pysam/libctabix.pyx":398 | |
11518 * self.index = tbx_index_load2(cfilename, cfilename_index) | |
11519 * | |
11520 * if self.index == NULL: # <<<<<<<<<<<<<< | |
11521 * raise IOError("could not open index for `%s`" % filename) | |
11522 * | |
11523 */ | |
11524 __pyx_t_1 = (__pyx_v_self->index == NULL); | |
11525 if (unlikely(__pyx_t_1)) { | |
11526 | |
11527 /* "pysam/libctabix.pyx":399 | |
11528 * | |
11529 * if self.index == NULL: | |
11530 * raise IOError("could not open index for `%s`" % filename) # <<<<<<<<<<<<<< | |
11531 * | |
11532 * if not self.is_stream: | |
11533 */ | |
11534 __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_could_not_open_index_for_s, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error) | |
11535 __Pyx_GOTREF(__pyx_t_2); | |
11536 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error) | |
11537 __Pyx_GOTREF(__pyx_t_3); | |
11538 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11539 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
11540 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11541 __PYX_ERR(0, 399, __pyx_L1_error) | |
11542 | |
11543 /* "pysam/libctabix.pyx":398 | |
11544 * self.index = tbx_index_load2(cfilename, cfilename_index) | |
11545 * | |
11546 * if self.index == NULL: # <<<<<<<<<<<<<< | |
11547 * raise IOError("could not open index for `%s`" % filename) | |
11548 * | |
11549 */ | |
11550 } | |
11551 | |
11552 /* "pysam/libctabix.pyx":401 | |
11553 * raise IOError("could not open index for `%s`" % filename) | |
11554 * | |
11555 * if not self.is_stream: # <<<<<<<<<<<<<< | |
11556 * self.start_offset = self.tell() | |
11557 * | |
11558 */ | |
11559 __pyx_t_1 = (!__pyx_v_self->__pyx_base.is_stream); | |
11560 if (__pyx_t_1) { | |
11561 | |
11562 /* "pysam/libctabix.pyx":402 | |
11563 * | |
11564 * if not self.is_stream: | |
11565 * self.start_offset = self.tell() # <<<<<<<<<<<<<< | |
11566 * | |
11567 * def _dup(self): | |
11568 */ | |
11569 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tell); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error) | |
11570 __Pyx_GOTREF(__pyx_t_2); | |
11571 __pyx_t_4 = NULL; | |
11572 __pyx_t_5 = 0; | |
11573 #if CYTHON_UNPACK_METHODS | |
11574 if (likely(PyMethod_Check(__pyx_t_2))) { | |
11575 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); | |
11576 if (likely(__pyx_t_4)) { | |
11577 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
11578 __Pyx_INCREF(__pyx_t_4); | |
11579 __Pyx_INCREF(function); | |
11580 __Pyx_DECREF_SET(__pyx_t_2, function); | |
11581 __pyx_t_5 = 1; | |
11582 } | |
11583 } | |
11584 #endif | |
11585 { | |
11586 PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; | |
11587 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); | |
11588 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
11589 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error) | |
11590 __Pyx_GOTREF(__pyx_t_3); | |
11591 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11592 } | |
11593 __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 402, __pyx_L1_error) | |
11594 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
11595 __pyx_v_self->__pyx_base.start_offset = __pyx_t_9; | |
11596 | |
11597 /* "pysam/libctabix.pyx":401 | |
11598 * raise IOError("could not open index for `%s`" % filename) | |
11599 * | |
11600 * if not self.is_stream: # <<<<<<<<<<<<<< | |
11601 * self.start_offset = self.tell() | |
11602 * | |
11603 */ | |
11604 } | |
11605 | |
11606 /* "pysam/libctabix.pyx":352 | |
11607 * self.encoding = encoding | |
11608 * | |
11609 * def _open( self, # <<<<<<<<<<<<<< | |
11610 * filename, | |
11611 * mode='r', | |
11612 */ | |
11613 | |
11614 /* function exit code */ | |
11615 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
11616 goto __pyx_L0; | |
11617 __pyx_L1_error:; | |
11618 __Pyx_XDECREF(__pyx_t_2); | |
11619 __Pyx_XDECREF(__pyx_t_3); | |
11620 __Pyx_XDECREF(__pyx_t_4); | |
11621 __Pyx_AddTraceback("pysam.libctabix.TabixFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
11622 __pyx_r = NULL; | |
11623 __pyx_L0:; | |
11624 __Pyx_XDECREF(__pyx_v_filename_index); | |
11625 __Pyx_XGIVEREF(__pyx_r); | |
11626 __Pyx_TraceReturn(__pyx_r, 0); | |
11627 __Pyx_RefNannyFinishContext(); | |
11628 return __pyx_r; | |
11629 } | |
11630 | |
11631 /* "pysam/libctabix.pyx":404 | |
11632 * self.start_offset = self.tell() | |
11633 * | |
11634 * def _dup(self): # <<<<<<<<<<<<<< | |
11635 * '''return a copy of this tabix file. | |
11636 * | |
11637 */ | |
11638 | |
11639 /* Python wrapper */ | |
11640 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_5_dup(PyObject *__pyx_v_self, | |
11641 #if CYTHON_METH_FASTCALL | |
11642 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
11643 #else | |
11644 PyObject *__pyx_args, PyObject *__pyx_kwds | |
11645 #endif | |
11646 ); /*proto*/ | |
11647 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_9TabixFile_4_dup, "TabixFile._dup(self)\nreturn a copy of this tabix file.\n \n The file is being re-opened.\n "); | |
11648 static PyMethodDef __pyx_mdef_5pysam_9libctabix_9TabixFile_5_dup = {"_dup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9TabixFile_5_dup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_9TabixFile_4_dup}; | |
11649 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_5_dup(PyObject *__pyx_v_self, | |
11650 #if CYTHON_METH_FASTCALL | |
11651 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
11652 #else | |
11653 PyObject *__pyx_args, PyObject *__pyx_kwds | |
11654 #endif | |
11655 ) { | |
11656 #if !CYTHON_METH_FASTCALL | |
11657 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
11658 #endif | |
11659 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
11660 PyObject *__pyx_r = 0; | |
11661 __Pyx_RefNannyDeclarations | |
11662 __Pyx_RefNannySetupContext("_dup (wrapper)", 0); | |
11663 #if !CYTHON_METH_FASTCALL | |
11664 #if CYTHON_ASSUME_SAFE_MACROS | |
11665 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
11666 #else | |
11667 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
11668 #endif | |
11669 #endif | |
11670 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
11671 if (unlikely(__pyx_nargs > 0)) { | |
11672 __Pyx_RaiseArgtupleInvalid("_dup", 1, 0, 0, __pyx_nargs); return NULL;} | |
11673 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_dup", 0))) return NULL; | |
11674 __pyx_r = __pyx_pf_5pysam_9libctabix_9TabixFile_4_dup(((struct __pyx_obj_5pysam_9libctabix_TabixFile *)__pyx_v_self)); | |
11675 | |
11676 /* function exit code */ | |
11677 __Pyx_RefNannyFinishContext(); | |
11678 return __pyx_r; | |
11679 } | |
11680 | |
11681 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_4_dup(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self) { | |
11682 PyObject *__pyx_r = NULL; | |
11683 __Pyx_TraceDeclarations | |
11684 __Pyx_RefNannyDeclarations | |
11685 PyObject *__pyx_t_1 = NULL; | |
11686 PyObject *__pyx_t_2 = NULL; | |
11687 PyObject *__pyx_t_3 = NULL; | |
11688 int __pyx_lineno = 0; | |
11689 const char *__pyx_filename = NULL; | |
11690 int __pyx_clineno = 0; | |
11691 __Pyx_TraceFrameInit(__pyx_codeobj__17) | |
11692 __Pyx_RefNannySetupContext("_dup", 1); | |
11693 __Pyx_TraceCall("_dup", __pyx_f[0], 404, 0, __PYX_ERR(0, 404, __pyx_L1_error)); | |
11694 | |
11695 /* "pysam/libctabix.pyx":409 | |
11696 * The file is being re-opened. | |
11697 * ''' | |
11698 * return TabixFile(self.filename, # <<<<<<<<<<<<<< | |
11699 * mode="r", | |
11700 * threads=self.threads, | |
11701 */ | |
11702 __Pyx_XDECREF(__pyx_r); | |
11703 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L1_error) | |
11704 __Pyx_GOTREF(__pyx_t_1); | |
11705 __Pyx_INCREF(__pyx_v_self->__pyx_base.filename); | |
11706 __Pyx_GIVEREF(__pyx_v_self->__pyx_base.filename); | |
11707 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.filename)) __PYX_ERR(0, 409, __pyx_L1_error); | |
11708 | |
11709 /* "pysam/libctabix.pyx":410 | |
11710 * ''' | |
11711 * return TabixFile(self.filename, | |
11712 * mode="r", # <<<<<<<<<<<<<< | |
11713 * threads=self.threads, | |
11714 * parser=self.parser, | |
11715 */ | |
11716 __pyx_t_2 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L1_error) | |
11717 __Pyx_GOTREF(__pyx_t_2); | |
11718 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(0, 410, __pyx_L1_error) | |
11719 | |
11720 /* "pysam/libctabix.pyx":411 | |
11721 * return TabixFile(self.filename, | |
11722 * mode="r", | |
11723 * threads=self.threads, # <<<<<<<<<<<<<< | |
11724 * parser=self.parser, | |
11725 * index=self.filename_index, | |
11726 */ | |
11727 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_threads, __pyx_v_self->__pyx_base.threads) < 0) __PYX_ERR(0, 410, __pyx_L1_error) | |
11728 | |
11729 /* "pysam/libctabix.pyx":412 | |
11730 * mode="r", | |
11731 * threads=self.threads, | |
11732 * parser=self.parser, # <<<<<<<<<<<<<< | |
11733 * index=self.filename_index, | |
11734 * encoding=self.encoding) | |
11735 */ | |
11736 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_parser, ((PyObject *)__pyx_v_self->parser)) < 0) __PYX_ERR(0, 410, __pyx_L1_error) | |
11737 | |
11738 /* "pysam/libctabix.pyx":413 | |
11739 * threads=self.threads, | |
11740 * parser=self.parser, | |
11741 * index=self.filename_index, # <<<<<<<<<<<<<< | |
11742 * encoding=self.encoding) | |
11743 * | |
11744 */ | |
11745 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_index, __pyx_v_self->filename_index) < 0) __PYX_ERR(0, 410, __pyx_L1_error) | |
11746 | |
11747 /* "pysam/libctabix.pyx":414 | |
11748 * parser=self.parser, | |
11749 * index=self.filename_index, | |
11750 * encoding=self.encoding) # <<<<<<<<<<<<<< | |
11751 * | |
11752 * def fetch(self, | |
11753 */ | |
11754 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_v_self->encoding) < 0) __PYX_ERR(0, 410, __pyx_L1_error) | |
11755 | |
11756 /* "pysam/libctabix.pyx":409 | |
11757 * The file is being re-opened. | |
11758 * ''' | |
11759 * return TabixFile(self.filename, # <<<<<<<<<<<<<< | |
11760 * mode="r", | |
11761 * threads=self.threads, | |
11762 */ | |
11763 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5pysam_9libctabix_TabixFile), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error) | |
11764 __Pyx_GOTREF(__pyx_t_3); | |
11765 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
11766 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11767 __pyx_r = __pyx_t_3; | |
11768 __pyx_t_3 = 0; | |
11769 goto __pyx_L0; | |
11770 | |
11771 /* "pysam/libctabix.pyx":404 | |
11772 * self.start_offset = self.tell() | |
11773 * | |
11774 * def _dup(self): # <<<<<<<<<<<<<< | |
11775 * '''return a copy of this tabix file. | |
11776 * | |
11777 */ | |
11778 | |
11779 /* function exit code */ | |
11780 __pyx_L1_error:; | |
11781 __Pyx_XDECREF(__pyx_t_1); | |
11782 __Pyx_XDECREF(__pyx_t_2); | |
11783 __Pyx_XDECREF(__pyx_t_3); | |
11784 __Pyx_AddTraceback("pysam.libctabix.TabixFile._dup", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
11785 __pyx_r = NULL; | |
11786 __pyx_L0:; | |
11787 __Pyx_XGIVEREF(__pyx_r); | |
11788 __Pyx_TraceReturn(__pyx_r, 0); | |
11789 __Pyx_RefNannyFinishContext(); | |
11790 return __pyx_r; | |
11791 } | |
11792 | |
11793 /* "pysam/libctabix.pyx":416 | |
11794 * encoding=self.encoding) | |
11795 * | |
11796 * def fetch(self, # <<<<<<<<<<<<<< | |
11797 * reference=None, | |
11798 * start=None, | |
11799 */ | |
11800 | |
11801 /* Python wrapper */ | |
11802 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_7fetch(PyObject *__pyx_v_self, | |
11803 #if CYTHON_METH_FASTCALL | |
11804 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
11805 #else | |
11806 PyObject *__pyx_args, PyObject *__pyx_kwds | |
11807 #endif | |
11808 ); /*proto*/ | |
11809 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_9TabixFile_6fetch, "TabixFile.fetch(self, reference=None, start=None, end=None, region=None, parser=None, multiple_iterators=False)\nfetch one or more rows in a :term:`region` using 0-based\n indexing. The region is specified by :term:`reference`,\n *start* and *end*. Alternatively, a samtools :term:`region`\n string can be supplied.\n\n Without *reference* or *region* all entries will be fetched. \n \n If only *reference* is set, all reads matching on *reference*\n will be fetched.\n\n If *parser* is None, the default parser will be used for\n parsing.\n \n Set *multiple_iterators* to true if you will be using multiple\n iterators on the same file at the same time. The iterator\n returned will receive its own copy of a filehandle to the file\n effectively re-opening the file. Re-opening a file creates\n some overhead, so beware.\n\n "); | |
11810 static PyMethodDef __pyx_mdef_5pysam_9libctabix_9TabixFile_7fetch = {"fetch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9TabixFile_7fetch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_9TabixFile_6fetch}; | |
11811 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_7fetch(PyObject *__pyx_v_self, | |
11812 #if CYTHON_METH_FASTCALL | |
11813 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
11814 #else | |
11815 PyObject *__pyx_args, PyObject *__pyx_kwds | |
11816 #endif | |
11817 ) { | |
11818 PyObject *__pyx_v_reference = 0; | |
11819 PyObject *__pyx_v_start = 0; | |
11820 PyObject *__pyx_v_end = 0; | |
11821 PyObject *__pyx_v_region = 0; | |
11822 PyObject *__pyx_v_parser = 0; | |
11823 PyObject *__pyx_v_multiple_iterators = 0; | |
11824 #if !CYTHON_METH_FASTCALL | |
11825 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
11826 #endif | |
11827 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
11828 PyObject* values[6] = {0,0,0,0,0,0}; | |
11829 int __pyx_lineno = 0; | |
11830 const char *__pyx_filename = NULL; | |
11831 int __pyx_clineno = 0; | |
11832 PyObject *__pyx_r = 0; | |
11833 __Pyx_RefNannyDeclarations | |
11834 __Pyx_RefNannySetupContext("fetch (wrapper)", 0); | |
11835 #if !CYTHON_METH_FASTCALL | |
11836 #if CYTHON_ASSUME_SAFE_MACROS | |
11837 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
11838 #else | |
11839 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
11840 #endif | |
11841 #endif | |
11842 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
11843 { | |
11844 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reference,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_region,&__pyx_n_s_parser,&__pyx_n_s_multiple_iterators,0}; | |
11845 | |
11846 /* "pysam/libctabix.pyx":417 | |
11847 * | |
11848 * def fetch(self, | |
11849 * reference=None, # <<<<<<<<<<<<<< | |
11850 * start=None, | |
11851 * end=None, | |
11852 */ | |
11853 values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
11854 | |
11855 /* "pysam/libctabix.pyx":418 | |
11856 * def fetch(self, | |
11857 * reference=None, | |
11858 * start=None, # <<<<<<<<<<<<<< | |
11859 * end=None, | |
11860 * region=None, | |
11861 */ | |
11862 values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
11863 | |
11864 /* "pysam/libctabix.pyx":419 | |
11865 * reference=None, | |
11866 * start=None, | |
11867 * end=None, # <<<<<<<<<<<<<< | |
11868 * region=None, | |
11869 * parser=None, | |
11870 */ | |
11871 values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
11872 | |
11873 /* "pysam/libctabix.pyx":420 | |
11874 * start=None, | |
11875 * end=None, | |
11876 * region=None, # <<<<<<<<<<<<<< | |
11877 * parser=None, | |
11878 * multiple_iterators=False): | |
11879 */ | |
11880 values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
11881 | |
11882 /* "pysam/libctabix.pyx":421 | |
11883 * end=None, | |
11884 * region=None, | |
11885 * parser=None, # <<<<<<<<<<<<<< | |
11886 * multiple_iterators=False): | |
11887 * '''fetch one or more rows in a :term:`region` using 0-based | |
11888 */ | |
11889 values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
11890 | |
11891 /* "pysam/libctabix.pyx":422 | |
11892 * region=None, | |
11893 * parser=None, | |
11894 * multiple_iterators=False): # <<<<<<<<<<<<<< | |
11895 * '''fetch one or more rows in a :term:`region` using 0-based | |
11896 * indexing. The region is specified by :term:`reference`, | |
11897 */ | |
11898 values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False)); | |
11899 if (__pyx_kwds) { | |
11900 Py_ssize_t kw_args; | |
11901 switch (__pyx_nargs) { | |
11902 case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); | |
11903 CYTHON_FALLTHROUGH; | |
11904 case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); | |
11905 CYTHON_FALLTHROUGH; | |
11906 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
11907 CYTHON_FALLTHROUGH; | |
11908 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
11909 CYTHON_FALLTHROUGH; | |
11910 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
11911 CYTHON_FALLTHROUGH; | |
11912 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
11913 CYTHON_FALLTHROUGH; | |
11914 case 0: break; | |
11915 default: goto __pyx_L5_argtuple_error; | |
11916 } | |
11917 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
11918 switch (__pyx_nargs) { | |
11919 case 0: | |
11920 if (kw_args > 0) { | |
11921 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reference); | |
11922 if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
11923 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) | |
11924 } | |
11925 CYTHON_FALLTHROUGH; | |
11926 case 1: | |
11927 if (kw_args > 0) { | |
11928 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start); | |
11929 if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
11930 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) | |
11931 } | |
11932 CYTHON_FALLTHROUGH; | |
11933 case 2: | |
11934 if (kw_args > 0) { | |
11935 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end); | |
11936 if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
11937 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) | |
11938 } | |
11939 CYTHON_FALLTHROUGH; | |
11940 case 3: | |
11941 if (kw_args > 0) { | |
11942 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_region); | |
11943 if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
11944 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) | |
11945 } | |
11946 CYTHON_FALLTHROUGH; | |
11947 case 4: | |
11948 if (kw_args > 0) { | |
11949 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_parser); | |
11950 if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
11951 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) | |
11952 } | |
11953 CYTHON_FALLTHROUGH; | |
11954 case 5: | |
11955 if (kw_args > 0) { | |
11956 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multiple_iterators); | |
11957 if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
11958 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) | |
11959 } | |
11960 } | |
11961 if (unlikely(kw_args > 0)) { | |
11962 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
11963 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fetch") < 0)) __PYX_ERR(0, 416, __pyx_L3_error) | |
11964 } | |
11965 } else { | |
11966 switch (__pyx_nargs) { | |
11967 case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); | |
11968 CYTHON_FALLTHROUGH; | |
11969 case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); | |
11970 CYTHON_FALLTHROUGH; | |
11971 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
11972 CYTHON_FALLTHROUGH; | |
11973 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
11974 CYTHON_FALLTHROUGH; | |
11975 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
11976 CYTHON_FALLTHROUGH; | |
11977 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
11978 CYTHON_FALLTHROUGH; | |
11979 case 0: break; | |
11980 default: goto __pyx_L5_argtuple_error; | |
11981 } | |
11982 } | |
11983 __pyx_v_reference = values[0]; | |
11984 __pyx_v_start = values[1]; | |
11985 __pyx_v_end = values[2]; | |
11986 __pyx_v_region = values[3]; | |
11987 __pyx_v_parser = values[4]; | |
11988 __pyx_v_multiple_iterators = values[5]; | |
11989 } | |
11990 goto __pyx_L6_skip; | |
11991 __pyx_L5_argtuple_error:; | |
11992 __Pyx_RaiseArgtupleInvalid("fetch", 0, 0, 6, __pyx_nargs); __PYX_ERR(0, 416, __pyx_L3_error) | |
11993 __pyx_L6_skip:; | |
11994 goto __pyx_L4_argument_unpacking_done; | |
11995 __pyx_L3_error:; | |
11996 { | |
11997 Py_ssize_t __pyx_temp; | |
11998 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
11999 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
12000 } | |
12001 } | |
12002 __Pyx_AddTraceback("pysam.libctabix.TabixFile.fetch", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
12003 __Pyx_RefNannyFinishContext(); | |
12004 return NULL; | |
12005 __pyx_L4_argument_unpacking_done:; | |
12006 __pyx_r = __pyx_pf_5pysam_9libctabix_9TabixFile_6fetch(((struct __pyx_obj_5pysam_9libctabix_TabixFile *)__pyx_v_self), __pyx_v_reference, __pyx_v_start, __pyx_v_end, __pyx_v_region, __pyx_v_parser, __pyx_v_multiple_iterators); | |
12007 | |
12008 /* "pysam/libctabix.pyx":416 | |
12009 * encoding=self.encoding) | |
12010 * | |
12011 * def fetch(self, # <<<<<<<<<<<<<< | |
12012 * reference=None, | |
12013 * start=None, | |
12014 */ | |
12015 | |
12016 /* function exit code */ | |
12017 { | |
12018 Py_ssize_t __pyx_temp; | |
12019 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
12020 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
12021 } | |
12022 } | |
12023 __Pyx_RefNannyFinishContext(); | |
12024 return __pyx_r; | |
12025 } | |
12026 | |
12027 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_6fetch(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region, PyObject *__pyx_v_parser, PyObject *__pyx_v_multiple_iterators) { | |
12028 hts_itr_t *__pyx_v_itr; | |
12029 char *__pyx_v_cstr; | |
12030 struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_fileobj = 0; | |
12031 PyObject *__pyx_v_s = NULL; | |
12032 struct __pyx_obj_5pysam_9libctabix_TabixIterator *__pyx_v_a = 0; | |
12033 PyObject *__pyx_r = NULL; | |
12034 __Pyx_TraceDeclarations | |
12035 __Pyx_RefNannyDeclarations | |
12036 PyObject *__pyx_t_1 = NULL; | |
12037 PyObject *__pyx_t_2 = NULL; | |
12038 PyObject *__pyx_t_3 = NULL; | |
12039 unsigned int __pyx_t_4; | |
12040 int __pyx_t_5; | |
12041 int __pyx_t_6; | |
12042 struct __pyx_opt_args_5pysam_9libcutils_force_bytes __pyx_t_7; | |
12043 char *__pyx_t_8; | |
12044 Py_ssize_t __pyx_t_9; | |
12045 int __pyx_lineno = 0; | |
12046 const char *__pyx_filename = NULL; | |
12047 int __pyx_clineno = 0; | |
12048 __Pyx_TraceFrameInit(__pyx_codeobj__18) | |
12049 __Pyx_RefNannySetupContext("fetch", 0); | |
12050 __Pyx_TraceCall("fetch", __pyx_f[0], 416, 0, __PYX_ERR(0, 416, __pyx_L1_error)); | |
12051 __Pyx_INCREF(__pyx_v_start); | |
12052 __Pyx_INCREF(__pyx_v_region); | |
12053 __Pyx_INCREF(__pyx_v_parser); | |
12054 | |
12055 /* "pysam/libctabix.pyx":443 | |
12056 * | |
12057 * ''' | |
12058 * if not self.is_open(): # <<<<<<<<<<<<<< | |
12059 * raise ValueError("I/O operation on closed file") | |
12060 * | |
12061 */ | |
12062 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) | |
12063 __Pyx_GOTREF(__pyx_t_2); | |
12064 __pyx_t_3 = NULL; | |
12065 __pyx_t_4 = 0; | |
12066 #if CYTHON_UNPACK_METHODS | |
12067 if (likely(PyMethod_Check(__pyx_t_2))) { | |
12068 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
12069 if (likely(__pyx_t_3)) { | |
12070 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
12071 __Pyx_INCREF(__pyx_t_3); | |
12072 __Pyx_INCREF(function); | |
12073 __Pyx_DECREF_SET(__pyx_t_2, function); | |
12074 __pyx_t_4 = 1; | |
12075 } | |
12076 } | |
12077 #endif | |
12078 { | |
12079 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
12080 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
12081 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
12082 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) | |
12083 __Pyx_GOTREF(__pyx_t_1); | |
12084 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12085 } | |
12086 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 443, __pyx_L1_error) | |
12087 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12088 __pyx_t_6 = (!__pyx_t_5); | |
12089 if (unlikely(__pyx_t_6)) { | |
12090 | |
12091 /* "pysam/libctabix.pyx":444 | |
12092 * ''' | |
12093 * if not self.is_open(): | |
12094 * raise ValueError("I/O operation on closed file") # <<<<<<<<<<<<<< | |
12095 * | |
12096 * # convert coordinates to region string, which is one-based | |
12097 */ | |
12098 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) | |
12099 __Pyx_GOTREF(__pyx_t_1); | |
12100 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
12101 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12102 __PYX_ERR(0, 444, __pyx_L1_error) | |
12103 | |
12104 /* "pysam/libctabix.pyx":443 | |
12105 * | |
12106 * ''' | |
12107 * if not self.is_open(): # <<<<<<<<<<<<<< | |
12108 * raise ValueError("I/O operation on closed file") | |
12109 * | |
12110 */ | |
12111 } | |
12112 | |
12113 /* "pysam/libctabix.pyx":447 | |
12114 * | |
12115 * # convert coordinates to region string, which is one-based | |
12116 * if reference: # <<<<<<<<<<<<<< | |
12117 * if end is not None: | |
12118 * if end < 0: | |
12119 */ | |
12120 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_reference); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 447, __pyx_L1_error) | |
12121 if (__pyx_t_6) { | |
12122 | |
12123 /* "pysam/libctabix.pyx":448 | |
12124 * # convert coordinates to region string, which is one-based | |
12125 * if reference: | |
12126 * if end is not None: # <<<<<<<<<<<<<< | |
12127 * if end < 0: | |
12128 * raise ValueError("end out of range (%i)" % end) | |
12129 */ | |
12130 __pyx_t_6 = (__pyx_v_end != Py_None); | |
12131 if (__pyx_t_6) { | |
12132 | |
12133 /* "pysam/libctabix.pyx":449 | |
12134 * if reference: | |
12135 * if end is not None: | |
12136 * if end < 0: # <<<<<<<<<<<<<< | |
12137 * raise ValueError("end out of range (%i)" % end) | |
12138 * if start is None: | |
12139 */ | |
12140 __pyx_t_1 = PyObject_RichCompare(__pyx_v_end, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) | |
12141 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 449, __pyx_L1_error) | |
12142 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12143 if (unlikely(__pyx_t_6)) { | |
12144 | |
12145 /* "pysam/libctabix.pyx":450 | |
12146 * if end is not None: | |
12147 * if end < 0: | |
12148 * raise ValueError("end out of range (%i)" % end) # <<<<<<<<<<<<<< | |
12149 * if start is None: | |
12150 * start = 0 | |
12151 */ | |
12152 __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_end_out_of_range_i, __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) | |
12153 __Pyx_GOTREF(__pyx_t_1); | |
12154 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) | |
12155 __Pyx_GOTREF(__pyx_t_2); | |
12156 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12157 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
12158 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12159 __PYX_ERR(0, 450, __pyx_L1_error) | |
12160 | |
12161 /* "pysam/libctabix.pyx":449 | |
12162 * if reference: | |
12163 * if end is not None: | |
12164 * if end < 0: # <<<<<<<<<<<<<< | |
12165 * raise ValueError("end out of range (%i)" % end) | |
12166 * if start is None: | |
12167 */ | |
12168 } | |
12169 | |
12170 /* "pysam/libctabix.pyx":451 | |
12171 * if end < 0: | |
12172 * raise ValueError("end out of range (%i)" % end) | |
12173 * if start is None: # <<<<<<<<<<<<<< | |
12174 * start = 0 | |
12175 * | |
12176 */ | |
12177 __pyx_t_6 = (__pyx_v_start == Py_None); | |
12178 if (__pyx_t_6) { | |
12179 | |
12180 /* "pysam/libctabix.pyx":452 | |
12181 * raise ValueError("end out of range (%i)" % end) | |
12182 * if start is None: | |
12183 * start = 0 # <<<<<<<<<<<<<< | |
12184 * | |
12185 * if start < 0: | |
12186 */ | |
12187 __Pyx_INCREF(__pyx_int_0); | |
12188 __Pyx_DECREF_SET(__pyx_v_start, __pyx_int_0); | |
12189 | |
12190 /* "pysam/libctabix.pyx":451 | |
12191 * if end < 0: | |
12192 * raise ValueError("end out of range (%i)" % end) | |
12193 * if start is None: # <<<<<<<<<<<<<< | |
12194 * start = 0 | |
12195 * | |
12196 */ | |
12197 } | |
12198 | |
12199 /* "pysam/libctabix.pyx":454 | |
12200 * start = 0 | |
12201 * | |
12202 * if start < 0: # <<<<<<<<<<<<<< | |
12203 * raise ValueError("start out of range (%i)" % end) | |
12204 * elif start > end: | |
12205 */ | |
12206 __pyx_t_2 = PyObject_RichCompare(__pyx_v_start, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) | |
12207 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 454, __pyx_L1_error) | |
12208 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12209 if (unlikely(__pyx_t_6)) { | |
12210 | |
12211 /* "pysam/libctabix.pyx":455 | |
12212 * | |
12213 * if start < 0: | |
12214 * raise ValueError("start out of range (%i)" % end) # <<<<<<<<<<<<<< | |
12215 * elif start > end: | |
12216 * raise ValueError( | |
12217 */ | |
12218 __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_start_out_of_range_i, __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) | |
12219 __Pyx_GOTREF(__pyx_t_2); | |
12220 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error) | |
12221 __Pyx_GOTREF(__pyx_t_1); | |
12222 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12223 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
12224 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12225 __PYX_ERR(0, 455, __pyx_L1_error) | |
12226 | |
12227 /* "pysam/libctabix.pyx":454 | |
12228 * start = 0 | |
12229 * | |
12230 * if start < 0: # <<<<<<<<<<<<<< | |
12231 * raise ValueError("start out of range (%i)" % end) | |
12232 * elif start > end: | |
12233 */ | |
12234 } | |
12235 | |
12236 /* "pysam/libctabix.pyx":456 | |
12237 * if start < 0: | |
12238 * raise ValueError("start out of range (%i)" % end) | |
12239 * elif start > end: # <<<<<<<<<<<<<< | |
12240 * raise ValueError( | |
12241 * 'start (%i) >= end (%i)' % (start, end)) | |
12242 */ | |
12243 __pyx_t_1 = PyObject_RichCompare(__pyx_v_start, __pyx_v_end, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) | |
12244 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 456, __pyx_L1_error) | |
12245 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12246 if (unlikely(__pyx_t_6)) { | |
12247 | |
12248 /* "pysam/libctabix.pyx":458 | |
12249 * elif start > end: | |
12250 * raise ValueError( | |
12251 * 'start (%i) >= end (%i)' % (start, end)) # <<<<<<<<<<<<<< | |
12252 * elif start == end: | |
12253 * return EmptyIterator() | |
12254 */ | |
12255 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) | |
12256 __Pyx_GOTREF(__pyx_t_1); | |
12257 __Pyx_INCREF(__pyx_v_start); | |
12258 __Pyx_GIVEREF(__pyx_v_start); | |
12259 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_start)) __PYX_ERR(0, 458, __pyx_L1_error); | |
12260 __Pyx_INCREF(__pyx_v_end); | |
12261 __Pyx_GIVEREF(__pyx_v_end); | |
12262 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_end)) __PYX_ERR(0, 458, __pyx_L1_error); | |
12263 __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_start_i_end_i, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) | |
12264 __Pyx_GOTREF(__pyx_t_2); | |
12265 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12266 | |
12267 /* "pysam/libctabix.pyx":457 | |
12268 * raise ValueError("start out of range (%i)" % end) | |
12269 * elif start > end: | |
12270 * raise ValueError( # <<<<<<<<<<<<<< | |
12271 * 'start (%i) >= end (%i)' % (start, end)) | |
12272 * elif start == end: | |
12273 */ | |
12274 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) | |
12275 __Pyx_GOTREF(__pyx_t_1); | |
12276 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12277 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
12278 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12279 __PYX_ERR(0, 457, __pyx_L1_error) | |
12280 | |
12281 /* "pysam/libctabix.pyx":456 | |
12282 * if start < 0: | |
12283 * raise ValueError("start out of range (%i)" % end) | |
12284 * elif start > end: # <<<<<<<<<<<<<< | |
12285 * raise ValueError( | |
12286 * 'start (%i) >= end (%i)' % (start, end)) | |
12287 */ | |
12288 } | |
12289 | |
12290 /* "pysam/libctabix.pyx":459 | |
12291 * raise ValueError( | |
12292 * 'start (%i) >= end (%i)' % (start, end)) | |
12293 * elif start == end: # <<<<<<<<<<<<<< | |
12294 * return EmptyIterator() | |
12295 * else: | |
12296 */ | |
12297 __pyx_t_1 = PyObject_RichCompare(__pyx_v_start, __pyx_v_end, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error) | |
12298 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 459, __pyx_L1_error) | |
12299 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12300 if (__pyx_t_6) { | |
12301 | |
12302 /* "pysam/libctabix.pyx":460 | |
12303 * 'start (%i) >= end (%i)' % (start, end)) | |
12304 * elif start == end: | |
12305 * return EmptyIterator() # <<<<<<<<<<<<<< | |
12306 * else: | |
12307 * region = '%s:%i-%i' % (reference, start + 1, end) | |
12308 */ | |
12309 __Pyx_XDECREF(__pyx_r); | |
12310 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EmptyIterator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error) | |
12311 __Pyx_GOTREF(__pyx_t_2); | |
12312 __pyx_t_3 = NULL; | |
12313 __pyx_t_4 = 0; | |
12314 #if CYTHON_UNPACK_METHODS | |
12315 if (unlikely(PyMethod_Check(__pyx_t_2))) { | |
12316 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
12317 if (likely(__pyx_t_3)) { | |
12318 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
12319 __Pyx_INCREF(__pyx_t_3); | |
12320 __Pyx_INCREF(function); | |
12321 __Pyx_DECREF_SET(__pyx_t_2, function); | |
12322 __pyx_t_4 = 1; | |
12323 } | |
12324 } | |
12325 #endif | |
12326 { | |
12327 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
12328 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
12329 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
12330 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) | |
12331 __Pyx_GOTREF(__pyx_t_1); | |
12332 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12333 } | |
12334 __pyx_r = __pyx_t_1; | |
12335 __pyx_t_1 = 0; | |
12336 goto __pyx_L0; | |
12337 | |
12338 /* "pysam/libctabix.pyx":459 | |
12339 * raise ValueError( | |
12340 * 'start (%i) >= end (%i)' % (start, end)) | |
12341 * elif start == end: # <<<<<<<<<<<<<< | |
12342 * return EmptyIterator() | |
12343 * else: | |
12344 */ | |
12345 } | |
12346 | |
12347 /* "pysam/libctabix.pyx":462 | |
12348 * return EmptyIterator() | |
12349 * else: | |
12350 * region = '%s:%i-%i' % (reference, start + 1, end) # <<<<<<<<<<<<<< | |
12351 * elif start is not None: | |
12352 * if start < 0: | |
12353 */ | |
12354 /*else*/ { | |
12355 __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_start, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) | |
12356 __Pyx_GOTREF(__pyx_t_1); | |
12357 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error) | |
12358 __Pyx_GOTREF(__pyx_t_2); | |
12359 __Pyx_INCREF(__pyx_v_reference); | |
12360 __Pyx_GIVEREF(__pyx_v_reference); | |
12361 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_reference)) __PYX_ERR(0, 462, __pyx_L1_error); | |
12362 __Pyx_GIVEREF(__pyx_t_1); | |
12363 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error); | |
12364 __Pyx_INCREF(__pyx_v_end); | |
12365 __Pyx_GIVEREF(__pyx_v_end); | |
12366 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_end)) __PYX_ERR(0, 462, __pyx_L1_error); | |
12367 __pyx_t_1 = 0; | |
12368 __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s_i_i, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) | |
12369 __Pyx_GOTREF(__pyx_t_1); | |
12370 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12371 __Pyx_DECREF_SET(__pyx_v_region, __pyx_t_1); | |
12372 __pyx_t_1 = 0; | |
12373 } | |
12374 | |
12375 /* "pysam/libctabix.pyx":448 | |
12376 * # convert coordinates to region string, which is one-based | |
12377 * if reference: | |
12378 * if end is not None: # <<<<<<<<<<<<<< | |
12379 * if end < 0: | |
12380 * raise ValueError("end out of range (%i)" % end) | |
12381 */ | |
12382 goto __pyx_L5; | |
12383 } | |
12384 | |
12385 /* "pysam/libctabix.pyx":463 | |
12386 * else: | |
12387 * region = '%s:%i-%i' % (reference, start + 1, end) | |
12388 * elif start is not None: # <<<<<<<<<<<<<< | |
12389 * if start < 0: | |
12390 * raise ValueError("start out of range (%i)" % end) | |
12391 */ | |
12392 __pyx_t_6 = (__pyx_v_start != Py_None); | |
12393 if (__pyx_t_6) { | |
12394 | |
12395 /* "pysam/libctabix.pyx":464 | |
12396 * region = '%s:%i-%i' % (reference, start + 1, end) | |
12397 * elif start is not None: | |
12398 * if start < 0: # <<<<<<<<<<<<<< | |
12399 * raise ValueError("start out of range (%i)" % end) | |
12400 * region = '%s:%i' % (reference, start + 1) | |
12401 */ | |
12402 __pyx_t_1 = PyObject_RichCompare(__pyx_v_start, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) | |
12403 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 464, __pyx_L1_error) | |
12404 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12405 if (unlikely(__pyx_t_6)) { | |
12406 | |
12407 /* "pysam/libctabix.pyx":465 | |
12408 * elif start is not None: | |
12409 * if start < 0: | |
12410 * raise ValueError("start out of range (%i)" % end) # <<<<<<<<<<<<<< | |
12411 * region = '%s:%i' % (reference, start + 1) | |
12412 * else: | |
12413 */ | |
12414 __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_start_out_of_range_i, __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) | |
12415 __Pyx_GOTREF(__pyx_t_1); | |
12416 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error) | |
12417 __Pyx_GOTREF(__pyx_t_2); | |
12418 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12419 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
12420 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12421 __PYX_ERR(0, 465, __pyx_L1_error) | |
12422 | |
12423 /* "pysam/libctabix.pyx":464 | |
12424 * region = '%s:%i-%i' % (reference, start + 1, end) | |
12425 * elif start is not None: | |
12426 * if start < 0: # <<<<<<<<<<<<<< | |
12427 * raise ValueError("start out of range (%i)" % end) | |
12428 * region = '%s:%i' % (reference, start + 1) | |
12429 */ | |
12430 } | |
12431 | |
12432 /* "pysam/libctabix.pyx":466 | |
12433 * if start < 0: | |
12434 * raise ValueError("start out of range (%i)" % end) | |
12435 * region = '%s:%i' % (reference, start + 1) # <<<<<<<<<<<<<< | |
12436 * else: | |
12437 * region = reference | |
12438 */ | |
12439 __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_start, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error) | |
12440 __Pyx_GOTREF(__pyx_t_2); | |
12441 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) | |
12442 __Pyx_GOTREF(__pyx_t_1); | |
12443 __Pyx_INCREF(__pyx_v_reference); | |
12444 __Pyx_GIVEREF(__pyx_v_reference); | |
12445 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_reference)) __PYX_ERR(0, 466, __pyx_L1_error); | |
12446 __Pyx_GIVEREF(__pyx_t_2); | |
12447 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error); | |
12448 __pyx_t_2 = 0; | |
12449 __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_s_i, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error) | |
12450 __Pyx_GOTREF(__pyx_t_2); | |
12451 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12452 __Pyx_DECREF_SET(__pyx_v_region, __pyx_t_2); | |
12453 __pyx_t_2 = 0; | |
12454 | |
12455 /* "pysam/libctabix.pyx":463 | |
12456 * else: | |
12457 * region = '%s:%i-%i' % (reference, start + 1, end) | |
12458 * elif start is not None: # <<<<<<<<<<<<<< | |
12459 * if start < 0: | |
12460 * raise ValueError("start out of range (%i)" % end) | |
12461 */ | |
12462 goto __pyx_L5; | |
12463 } | |
12464 | |
12465 /* "pysam/libctabix.pyx":468 | |
12466 * region = '%s:%i' % (reference, start + 1) | |
12467 * else: | |
12468 * region = reference # <<<<<<<<<<<<<< | |
12469 * | |
12470 * # get iterator | |
12471 */ | |
12472 /*else*/ { | |
12473 __Pyx_INCREF(__pyx_v_reference); | |
12474 __Pyx_DECREF_SET(__pyx_v_region, __pyx_v_reference); | |
12475 } | |
12476 __pyx_L5:; | |
12477 | |
12478 /* "pysam/libctabix.pyx":447 | |
12479 * | |
12480 * # convert coordinates to region string, which is one-based | |
12481 * if reference: # <<<<<<<<<<<<<< | |
12482 * if end is not None: | |
12483 * if end < 0: | |
12484 */ | |
12485 } | |
12486 | |
12487 /* "pysam/libctabix.pyx":476 | |
12488 * | |
12489 * # reopen the same file if necessary | |
12490 * if multiple_iterators: # <<<<<<<<<<<<<< | |
12491 * fileobj = self._dup() | |
12492 * else: | |
12493 */ | |
12494 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multiple_iterators); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 476, __pyx_L1_error) | |
12495 if (__pyx_t_6) { | |
12496 | |
12497 /* "pysam/libctabix.pyx":477 | |
12498 * # reopen the same file if necessary | |
12499 * if multiple_iterators: | |
12500 * fileobj = self._dup() # <<<<<<<<<<<<<< | |
12501 * else: | |
12502 * fileobj = self | |
12503 */ | |
12504 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dup); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error) | |
12505 __Pyx_GOTREF(__pyx_t_1); | |
12506 __pyx_t_3 = NULL; | |
12507 __pyx_t_4 = 0; | |
12508 #if CYTHON_UNPACK_METHODS | |
12509 if (likely(PyMethod_Check(__pyx_t_1))) { | |
12510 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); | |
12511 if (likely(__pyx_t_3)) { | |
12512 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); | |
12513 __Pyx_INCREF(__pyx_t_3); | |
12514 __Pyx_INCREF(function); | |
12515 __Pyx_DECREF_SET(__pyx_t_1, function); | |
12516 __pyx_t_4 = 1; | |
12517 } | |
12518 } | |
12519 #endif | |
12520 { | |
12521 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
12522 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
12523 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
12524 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error) | |
12525 __Pyx_GOTREF(__pyx_t_2); | |
12526 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12527 } | |
12528 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5pysam_9libctabix_TabixFile))))) __PYX_ERR(0, 477, __pyx_L1_error) | |
12529 __pyx_v_fileobj = ((struct __pyx_obj_5pysam_9libctabix_TabixFile *)__pyx_t_2); | |
12530 __pyx_t_2 = 0; | |
12531 | |
12532 /* "pysam/libctabix.pyx":476 | |
12533 * | |
12534 * # reopen the same file if necessary | |
12535 * if multiple_iterators: # <<<<<<<<<<<<<< | |
12536 * fileobj = self._dup() | |
12537 * else: | |
12538 */ | |
12539 goto __pyx_L10; | |
12540 } | |
12541 | |
12542 /* "pysam/libctabix.pyx":479 | |
12543 * fileobj = self._dup() | |
12544 * else: | |
12545 * fileobj = self # <<<<<<<<<<<<<< | |
12546 * | |
12547 * if region is None: | |
12548 */ | |
12549 /*else*/ { | |
12550 __Pyx_INCREF((PyObject *)__pyx_v_self); | |
12551 __pyx_v_fileobj = __pyx_v_self; | |
12552 } | |
12553 __pyx_L10:; | |
12554 | |
12555 /* "pysam/libctabix.pyx":481 | |
12556 * fileobj = self | |
12557 * | |
12558 * if region is None: # <<<<<<<<<<<<<< | |
12559 * # without region or reference - iterate from start | |
12560 * with nogil: | |
12561 */ | |
12562 __pyx_t_6 = (__pyx_v_region == Py_None); | |
12563 if (__pyx_t_6) { | |
12564 | |
12565 /* "pysam/libctabix.pyx":483 | |
12566 * if region is None: | |
12567 * # without region or reference - iterate from start | |
12568 * with nogil: # <<<<<<<<<<<<<< | |
12569 * itr = tbx_itr_queryi(fileobj.index, | |
12570 * HTS_IDX_START, | |
12571 */ | |
12572 { | |
12573 #ifdef WITH_THREAD | |
12574 PyThreadState *_save; | |
12575 _save = NULL; | |
12576 Py_UNBLOCK_THREADS | |
12577 __Pyx_FastGIL_Remember(); | |
12578 #endif | |
12579 /*try:*/ { | |
12580 | |
12581 /* "pysam/libctabix.pyx":484 | |
12582 * # without region or reference - iterate from start | |
12583 * with nogil: | |
12584 * itr = tbx_itr_queryi(fileobj.index, # <<<<<<<<<<<<<< | |
12585 * HTS_IDX_START, | |
12586 * 0, | |
12587 */ | |
12588 __pyx_v_itr = tbx_itr_queryi(__pyx_v_fileobj->index, HTS_IDX_START, 0, 0); | |
12589 } | |
12590 | |
12591 /* "pysam/libctabix.pyx":483 | |
12592 * if region is None: | |
12593 * # without region or reference - iterate from start | |
12594 * with nogil: # <<<<<<<<<<<<<< | |
12595 * itr = tbx_itr_queryi(fileobj.index, | |
12596 * HTS_IDX_START, | |
12597 */ | |
12598 /*finally:*/ { | |
12599 /*normal exit:*/{ | |
12600 #ifdef WITH_THREAD | |
12601 __Pyx_FastGIL_Forget(); | |
12602 Py_BLOCK_THREADS | |
12603 #endif | |
12604 goto __pyx_L14; | |
12605 } | |
12606 __pyx_L14:; | |
12607 } | |
12608 } | |
12609 | |
12610 /* "pysam/libctabix.pyx":481 | |
12611 * fileobj = self | |
12612 * | |
12613 * if region is None: # <<<<<<<<<<<<<< | |
12614 * # without region or reference - iterate from start | |
12615 * with nogil: | |
12616 */ | |
12617 goto __pyx_L11; | |
12618 } | |
12619 | |
12620 /* "pysam/libctabix.pyx":489 | |
12621 * 0) | |
12622 * else: | |
12623 * s = force_bytes(region, encoding=fileobj.encoding) # <<<<<<<<<<<<<< | |
12624 * cstr = s | |
12625 * with nogil: | |
12626 */ | |
12627 /*else*/ { | |
12628 __pyx_t_2 = __pyx_v_fileobj->encoding; | |
12629 __Pyx_INCREF(__pyx_t_2); | |
12630 __pyx_t_7.__pyx_n = 1; | |
12631 __pyx_t_7.encoding = __pyx_t_2; | |
12632 __pyx_t_1 = __pyx_f_5pysam_9libcutils_force_bytes(__pyx_v_region, &__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error) | |
12633 __Pyx_GOTREF(__pyx_t_1); | |
12634 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12635 __pyx_v_s = ((PyObject*)__pyx_t_1); | |
12636 __pyx_t_1 = 0; | |
12637 | |
12638 /* "pysam/libctabix.pyx":490 | |
12639 * else: | |
12640 * s = force_bytes(region, encoding=fileobj.encoding) | |
12641 * cstr = s # <<<<<<<<<<<<<< | |
12642 * with nogil: | |
12643 * itr = tbx_itr_querys(fileobj.index, cstr) | |
12644 */ | |
12645 if (unlikely(__pyx_v_s == Py_None)) { | |
12646 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); | |
12647 __PYX_ERR(0, 490, __pyx_L1_error) | |
12648 } | |
12649 __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_s); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L1_error) | |
12650 __pyx_v_cstr = __pyx_t_8; | |
12651 | |
12652 /* "pysam/libctabix.pyx":491 | |
12653 * s = force_bytes(region, encoding=fileobj.encoding) | |
12654 * cstr = s | |
12655 * with nogil: # <<<<<<<<<<<<<< | |
12656 * itr = tbx_itr_querys(fileobj.index, cstr) | |
12657 * | |
12658 */ | |
12659 { | |
12660 #ifdef WITH_THREAD | |
12661 PyThreadState *_save; | |
12662 _save = NULL; | |
12663 Py_UNBLOCK_THREADS | |
12664 __Pyx_FastGIL_Remember(); | |
12665 #endif | |
12666 /*try:*/ { | |
12667 | |
12668 /* "pysam/libctabix.pyx":492 | |
12669 * cstr = s | |
12670 * with nogil: | |
12671 * itr = tbx_itr_querys(fileobj.index, cstr) # <<<<<<<<<<<<<< | |
12672 * | |
12673 * if itr == NULL: | |
12674 */ | |
12675 __pyx_v_itr = tbx_itr_querys(__pyx_v_fileobj->index, __pyx_v_cstr); | |
12676 } | |
12677 | |
12678 /* "pysam/libctabix.pyx":491 | |
12679 * s = force_bytes(region, encoding=fileobj.encoding) | |
12680 * cstr = s | |
12681 * with nogil: # <<<<<<<<<<<<<< | |
12682 * itr = tbx_itr_querys(fileobj.index, cstr) | |
12683 * | |
12684 */ | |
12685 /*finally:*/ { | |
12686 /*normal exit:*/{ | |
12687 #ifdef WITH_THREAD | |
12688 __Pyx_FastGIL_Forget(); | |
12689 Py_BLOCK_THREADS | |
12690 #endif | |
12691 goto __pyx_L17; | |
12692 } | |
12693 __pyx_L17:; | |
12694 } | |
12695 } | |
12696 } | |
12697 __pyx_L11:; | |
12698 | |
12699 /* "pysam/libctabix.pyx":494 | |
12700 * itr = tbx_itr_querys(fileobj.index, cstr) | |
12701 * | |
12702 * if itr == NULL: # <<<<<<<<<<<<<< | |
12703 * if region is None: | |
12704 * if len(self.contigs) > 0: | |
12705 */ | |
12706 __pyx_t_6 = (__pyx_v_itr == NULL); | |
12707 if (__pyx_t_6) { | |
12708 | |
12709 /* "pysam/libctabix.pyx":495 | |
12710 * | |
12711 * if itr == NULL: | |
12712 * if region is None: # <<<<<<<<<<<<<< | |
12713 * if len(self.contigs) > 0: | |
12714 * # when accessing a tabix file created prior tabix 1.0 | |
12715 */ | |
12716 __pyx_t_6 = (__pyx_v_region == Py_None); | |
12717 if (likely(__pyx_t_6)) { | |
12718 | |
12719 /* "pysam/libctabix.pyx":496 | |
12720 * if itr == NULL: | |
12721 * if region is None: | |
12722 * if len(self.contigs) > 0: # <<<<<<<<<<<<<< | |
12723 * # when accessing a tabix file created prior tabix 1.0 | |
12724 * # the full-file iterator is empty. | |
12725 */ | |
12726 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_contigs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error) | |
12727 __Pyx_GOTREF(__pyx_t_1); | |
12728 __pyx_t_9 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 496, __pyx_L1_error) | |
12729 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12730 __pyx_t_6 = (__pyx_t_9 > 0); | |
12731 if (unlikely(__pyx_t_6)) { | |
12732 | |
12733 /* "pysam/libctabix.pyx":499 | |
12734 * # when accessing a tabix file created prior tabix 1.0 | |
12735 * # the full-file iterator is empty. | |
12736 * raise ValueError( # <<<<<<<<<<<<<< | |
12737 * "could not create iterator, possible " | |
12738 * "tabix version mismatch") | |
12739 */ | |
12740 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error) | |
12741 __Pyx_GOTREF(__pyx_t_1); | |
12742 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
12743 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12744 __PYX_ERR(0, 499, __pyx_L1_error) | |
12745 | |
12746 /* "pysam/libctabix.pyx":496 | |
12747 * if itr == NULL: | |
12748 * if region is None: | |
12749 * if len(self.contigs) > 0: # <<<<<<<<<<<<<< | |
12750 * # when accessing a tabix file created prior tabix 1.0 | |
12751 * # the full-file iterator is empty. | |
12752 */ | |
12753 } | |
12754 | |
12755 /* "pysam/libctabix.pyx":505 | |
12756 * # possible reason is that the file is empty - | |
12757 * # return an empty iterator | |
12758 * return EmptyIterator() # <<<<<<<<<<<<<< | |
12759 * else: | |
12760 * raise ValueError( | |
12761 */ | |
12762 /*else*/ { | |
12763 __Pyx_XDECREF(__pyx_r); | |
12764 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EmptyIterator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error) | |
12765 __Pyx_GOTREF(__pyx_t_2); | |
12766 __pyx_t_3 = NULL; | |
12767 __pyx_t_4 = 0; | |
12768 #if CYTHON_UNPACK_METHODS | |
12769 if (unlikely(PyMethod_Check(__pyx_t_2))) { | |
12770 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
12771 if (likely(__pyx_t_3)) { | |
12772 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
12773 __Pyx_INCREF(__pyx_t_3); | |
12774 __Pyx_INCREF(function); | |
12775 __Pyx_DECREF_SET(__pyx_t_2, function); | |
12776 __pyx_t_4 = 1; | |
12777 } | |
12778 } | |
12779 #endif | |
12780 { | |
12781 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
12782 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
12783 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
12784 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error) | |
12785 __Pyx_GOTREF(__pyx_t_1); | |
12786 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12787 } | |
12788 __pyx_r = __pyx_t_1; | |
12789 __pyx_t_1 = 0; | |
12790 goto __pyx_L0; | |
12791 } | |
12792 | |
12793 /* "pysam/libctabix.pyx":495 | |
12794 * | |
12795 * if itr == NULL: | |
12796 * if region is None: # <<<<<<<<<<<<<< | |
12797 * if len(self.contigs) > 0: | |
12798 * # when accessing a tabix file created prior tabix 1.0 | |
12799 */ | |
12800 } | |
12801 | |
12802 /* "pysam/libctabix.pyx":507 | |
12803 * return EmptyIterator() | |
12804 * else: | |
12805 * raise ValueError( # <<<<<<<<<<<<<< | |
12806 * "could not create iterator for region '%s'" % | |
12807 * region) | |
12808 */ | |
12809 /*else*/ { | |
12810 | |
12811 /* "pysam/libctabix.pyx":508 | |
12812 * else: | |
12813 * raise ValueError( | |
12814 * "could not create iterator for region '%s'" % # <<<<<<<<<<<<<< | |
12815 * region) | |
12816 * | |
12817 */ | |
12818 __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_could_not_create_iterator_for_re, __pyx_v_region); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) | |
12819 __Pyx_GOTREF(__pyx_t_1); | |
12820 | |
12821 /* "pysam/libctabix.pyx":507 | |
12822 * return EmptyIterator() | |
12823 * else: | |
12824 * raise ValueError( # <<<<<<<<<<<<<< | |
12825 * "could not create iterator for region '%s'" % | |
12826 * region) | |
12827 */ | |
12828 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error) | |
12829 __Pyx_GOTREF(__pyx_t_2); | |
12830 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12831 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
12832 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12833 __PYX_ERR(0, 507, __pyx_L1_error) | |
12834 } | |
12835 | |
12836 /* "pysam/libctabix.pyx":494 | |
12837 * itr = tbx_itr_querys(fileobj.index, cstr) | |
12838 * | |
12839 * if itr == NULL: # <<<<<<<<<<<<<< | |
12840 * if region is None: | |
12841 * if len(self.contigs) > 0: | |
12842 */ | |
12843 } | |
12844 | |
12845 /* "pysam/libctabix.pyx":512 | |
12846 * | |
12847 * # use default parser if no parser is specified | |
12848 * if parser is None: # <<<<<<<<<<<<<< | |
12849 * parser = fileobj.parser | |
12850 * | |
12851 */ | |
12852 __pyx_t_6 = (__pyx_v_parser == Py_None); | |
12853 if (__pyx_t_6) { | |
12854 | |
12855 /* "pysam/libctabix.pyx":513 | |
12856 * # use default parser if no parser is specified | |
12857 * if parser is None: | |
12858 * parser = fileobj.parser # <<<<<<<<<<<<<< | |
12859 * | |
12860 * cdef TabixIterator a | |
12861 */ | |
12862 __pyx_t_2 = ((PyObject *)__pyx_v_fileobj->parser); | |
12863 __Pyx_INCREF(__pyx_t_2); | |
12864 __Pyx_DECREF_SET(__pyx_v_parser, __pyx_t_2); | |
12865 __pyx_t_2 = 0; | |
12866 | |
12867 /* "pysam/libctabix.pyx":512 | |
12868 * | |
12869 * # use default parser if no parser is specified | |
12870 * if parser is None: # <<<<<<<<<<<<<< | |
12871 * parser = fileobj.parser | |
12872 * | |
12873 */ | |
12874 } | |
12875 | |
12876 /* "pysam/libctabix.pyx":516 | |
12877 * | |
12878 * cdef TabixIterator a | |
12879 * if parser is None: # <<<<<<<<<<<<<< | |
12880 * a = TabixIterator(encoding=fileobj.encoding) | |
12881 * else: | |
12882 */ | |
12883 __pyx_t_6 = (__pyx_v_parser == Py_None); | |
12884 if (__pyx_t_6) { | |
12885 | |
12886 /* "pysam/libctabix.pyx":517 | |
12887 * cdef TabixIterator a | |
12888 * if parser is None: | |
12889 * a = TabixIterator(encoding=fileobj.encoding) # <<<<<<<<<<<<<< | |
12890 * else: | |
12891 * parser.set_encoding(fileobj.encoding) | |
12892 */ | |
12893 __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) | |
12894 __Pyx_GOTREF(__pyx_t_2); | |
12895 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_v_fileobj->encoding) < 0) __PYX_ERR(0, 517, __pyx_L1_error) | |
12896 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5pysam_9libctabix_TabixIterator), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) | |
12897 __Pyx_GOTREF(__pyx_t_1); | |
12898 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12899 __pyx_v_a = ((struct __pyx_obj_5pysam_9libctabix_TabixIterator *)__pyx_t_1); | |
12900 __pyx_t_1 = 0; | |
12901 | |
12902 /* "pysam/libctabix.pyx":516 | |
12903 * | |
12904 * cdef TabixIterator a | |
12905 * if parser is None: # <<<<<<<<<<<<<< | |
12906 * a = TabixIterator(encoding=fileobj.encoding) | |
12907 * else: | |
12908 */ | |
12909 goto __pyx_L22; | |
12910 } | |
12911 | |
12912 /* "pysam/libctabix.pyx":519 | |
12913 * a = TabixIterator(encoding=fileobj.encoding) | |
12914 * else: | |
12915 * parser.set_encoding(fileobj.encoding) # <<<<<<<<<<<<<< | |
12916 * a = TabixIteratorParsed(parser) | |
12917 * | |
12918 */ | |
12919 /*else*/ { | |
12920 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_set_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error) | |
12921 __Pyx_GOTREF(__pyx_t_2); | |
12922 __pyx_t_3 = NULL; | |
12923 __pyx_t_4 = 0; | |
12924 #if CYTHON_UNPACK_METHODS | |
12925 if (likely(PyMethod_Check(__pyx_t_2))) { | |
12926 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
12927 if (likely(__pyx_t_3)) { | |
12928 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
12929 __Pyx_INCREF(__pyx_t_3); | |
12930 __Pyx_INCREF(function); | |
12931 __Pyx_DECREF_SET(__pyx_t_2, function); | |
12932 __pyx_t_4 = 1; | |
12933 } | |
12934 } | |
12935 #endif | |
12936 { | |
12937 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_fileobj->encoding}; | |
12938 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
12939 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
12940 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) | |
12941 __Pyx_GOTREF(__pyx_t_1); | |
12942 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12943 } | |
12944 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12945 | |
12946 /* "pysam/libctabix.pyx":520 | |
12947 * else: | |
12948 * parser.set_encoding(fileobj.encoding) | |
12949 * a = TabixIteratorParsed(parser) # <<<<<<<<<<<<<< | |
12950 * | |
12951 * a.tabixfile = fileobj | |
12952 */ | |
12953 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed), __pyx_v_parser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) | |
12954 __Pyx_GOTREF(__pyx_t_1); | |
12955 __pyx_v_a = ((struct __pyx_obj_5pysam_9libctabix_TabixIterator *)__pyx_t_1); | |
12956 __pyx_t_1 = 0; | |
12957 } | |
12958 __pyx_L22:; | |
12959 | |
12960 /* "pysam/libctabix.pyx":522 | |
12961 * a = TabixIteratorParsed(parser) | |
12962 * | |
12963 * a.tabixfile = fileobj # <<<<<<<<<<<<<< | |
12964 * a.iterator = itr | |
12965 * | |
12966 */ | |
12967 __Pyx_INCREF((PyObject *)__pyx_v_fileobj); | |
12968 __Pyx_GIVEREF((PyObject *)__pyx_v_fileobj); | |
12969 __Pyx_GOTREF((PyObject *)__pyx_v_a->tabixfile); | |
12970 __Pyx_DECREF((PyObject *)__pyx_v_a->tabixfile); | |
12971 __pyx_v_a->tabixfile = __pyx_v_fileobj; | |
12972 | |
12973 /* "pysam/libctabix.pyx":523 | |
12974 * | |
12975 * a.tabixfile = fileobj | |
12976 * a.iterator = itr # <<<<<<<<<<<<<< | |
12977 * | |
12978 * return a | |
12979 */ | |
12980 __pyx_v_a->iterator = __pyx_v_itr; | |
12981 | |
12982 /* "pysam/libctabix.pyx":525 | |
12983 * a.iterator = itr | |
12984 * | |
12985 * return a # <<<<<<<<<<<<<< | |
12986 * | |
12987 * ############################################################### | |
12988 */ | |
12989 __Pyx_XDECREF(__pyx_r); | |
12990 __Pyx_INCREF((PyObject *)__pyx_v_a); | |
12991 __pyx_r = ((PyObject *)__pyx_v_a); | |
12992 goto __pyx_L0; | |
12993 | |
12994 /* "pysam/libctabix.pyx":416 | |
12995 * encoding=self.encoding) | |
12996 * | |
12997 * def fetch(self, # <<<<<<<<<<<<<< | |
12998 * reference=None, | |
12999 * start=None, | |
13000 */ | |
13001 | |
13002 /* function exit code */ | |
13003 __pyx_L1_error:; | |
13004 __Pyx_XDECREF(__pyx_t_1); | |
13005 __Pyx_XDECREF(__pyx_t_2); | |
13006 __Pyx_XDECREF(__pyx_t_3); | |
13007 __Pyx_AddTraceback("pysam.libctabix.TabixFile.fetch", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13008 __pyx_r = NULL; | |
13009 __pyx_L0:; | |
13010 __Pyx_XDECREF((PyObject *)__pyx_v_fileobj); | |
13011 __Pyx_XDECREF(__pyx_v_s); | |
13012 __Pyx_XDECREF((PyObject *)__pyx_v_a); | |
13013 __Pyx_XDECREF(__pyx_v_start); | |
13014 __Pyx_XDECREF(__pyx_v_region); | |
13015 __Pyx_XDECREF(__pyx_v_parser); | |
13016 __Pyx_XGIVEREF(__pyx_r); | |
13017 __Pyx_TraceReturn(__pyx_r, 0); | |
13018 __Pyx_RefNannyFinishContext(); | |
13019 return __pyx_r; | |
13020 } | |
13021 | |
13022 /* "pysam/libctabix.pyx":543 | |
13023 * ''' | |
13024 * | |
13025 * def __get__(self): # <<<<<<<<<<<<<< | |
13026 * | |
13027 * cdef char *cfilename = self.filename | |
13028 */ | |
13029 | |
13030 /* Python wrapper */ | |
13031 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_6header_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
13032 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_6header_1__get__(PyObject *__pyx_v_self) { | |
13033 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13034 PyObject *__pyx_r = 0; | |
13035 __Pyx_RefNannyDeclarations | |
13036 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
13037 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
13038 __pyx_r = __pyx_pf_5pysam_9libctabix_9TabixFile_6header___get__(((struct __pyx_obj_5pysam_9libctabix_TabixFile *)__pyx_v_self)); | |
13039 | |
13040 /* function exit code */ | |
13041 __Pyx_RefNannyFinishContext(); | |
13042 return __pyx_r; | |
13043 } | |
13044 | |
13045 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_6header___get__(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self) { | |
13046 char *__pyx_v_cfilename; | |
13047 char *__pyx_v_cfilename_index; | |
13048 kstring_t __pyx_v_buffer; | |
13049 htsFile *__pyx_v_fp; | |
13050 int __pyx_v_KS_SEP_LINE; | |
13051 tbx_t *__pyx_v_tbx; | |
13052 PyObject *__pyx_v_lines = NULL; | |
13053 PyObject *__pyx_r = NULL; | |
13054 __Pyx_TraceDeclarations | |
13055 __Pyx_RefNannyDeclarations | |
13056 char *__pyx_t_1; | |
13057 PyObject *__pyx_t_2 = NULL; | |
13058 int __pyx_t_3; | |
13059 PyObject *__pyx_t_4 = NULL; | |
13060 PyObject *__pyx_t_5 = NULL; | |
13061 unsigned int __pyx_t_6; | |
13062 int __pyx_t_7; | |
13063 struct __pyx_opt_args_5pysam_9libcutils_force_str __pyx_t_8; | |
13064 int __pyx_t_9; | |
13065 int __pyx_lineno = 0; | |
13066 const char *__pyx_filename = NULL; | |
13067 int __pyx_clineno = 0; | |
13068 __Pyx_RefNannySetupContext("__get__", 1); | |
13069 __Pyx_TraceCall("__get__", __pyx_f[0], 543, 0, __PYX_ERR(0, 543, __pyx_L1_error)); | |
13070 | |
13071 /* "pysam/libctabix.pyx":545 | |
13072 * def __get__(self): | |
13073 * | |
13074 * cdef char *cfilename = self.filename # <<<<<<<<<<<<<< | |
13075 * cdef char *cfilename_index = self.filename_index | |
13076 * | |
13077 */ | |
13078 __pyx_t_1 = __Pyx_PyObject_AsWritableString(__pyx_v_self->__pyx_base.filename); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L1_error) | |
13079 __pyx_v_cfilename = __pyx_t_1; | |
13080 | |
13081 /* "pysam/libctabix.pyx":546 | |
13082 * | |
13083 * cdef char *cfilename = self.filename | |
13084 * cdef char *cfilename_index = self.filename_index # <<<<<<<<<<<<<< | |
13085 * | |
13086 * cdef kstring_t buffer | |
13087 */ | |
13088 __pyx_t_1 = __Pyx_PyObject_AsWritableString(__pyx_v_self->filename_index); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 546, __pyx_L1_error) | |
13089 __pyx_v_cfilename_index = __pyx_t_1; | |
13090 | |
13091 /* "pysam/libctabix.pyx":549 | |
13092 * | |
13093 * cdef kstring_t buffer | |
13094 * buffer.l = buffer.m = 0 # <<<<<<<<<<<<<< | |
13095 * buffer.s = NULL | |
13096 * | |
13097 */ | |
13098 __pyx_v_buffer.l = 0; | |
13099 __pyx_v_buffer.m = 0; | |
13100 | |
13101 /* "pysam/libctabix.pyx":550 | |
13102 * cdef kstring_t buffer | |
13103 * buffer.l = buffer.m = 0 | |
13104 * buffer.s = NULL # <<<<<<<<<<<<<< | |
13105 * | |
13106 * cdef htsFile * fp = NULL | |
13107 */ | |
13108 __pyx_v_buffer.s = NULL; | |
13109 | |
13110 /* "pysam/libctabix.pyx":552 | |
13111 * buffer.s = NULL | |
13112 * | |
13113 * cdef htsFile * fp = NULL # <<<<<<<<<<<<<< | |
13114 * cdef int KS_SEP_LINE = 2 | |
13115 * cdef tbx_t * tbx = NULL | |
13116 */ | |
13117 __pyx_v_fp = NULL; | |
13118 | |
13119 /* "pysam/libctabix.pyx":553 | |
13120 * | |
13121 * cdef htsFile * fp = NULL | |
13122 * cdef int KS_SEP_LINE = 2 # <<<<<<<<<<<<<< | |
13123 * cdef tbx_t * tbx = NULL | |
13124 * lines = [] | |
13125 */ | |
13126 __pyx_v_KS_SEP_LINE = 2; | |
13127 | |
13128 /* "pysam/libctabix.pyx":554 | |
13129 * cdef htsFile * fp = NULL | |
13130 * cdef int KS_SEP_LINE = 2 | |
13131 * cdef tbx_t * tbx = NULL # <<<<<<<<<<<<<< | |
13132 * lines = [] | |
13133 * with nogil: | |
13134 */ | |
13135 __pyx_v_tbx = NULL; | |
13136 | |
13137 /* "pysam/libctabix.pyx":555 | |
13138 * cdef int KS_SEP_LINE = 2 | |
13139 * cdef tbx_t * tbx = NULL | |
13140 * lines = [] # <<<<<<<<<<<<<< | |
13141 * with nogil: | |
13142 * fp = hts_open(cfilename, 'r') | |
13143 */ | |
13144 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error) | |
13145 __Pyx_GOTREF(__pyx_t_2); | |
13146 __pyx_v_lines = ((PyObject*)__pyx_t_2); | |
13147 __pyx_t_2 = 0; | |
13148 | |
13149 /* "pysam/libctabix.pyx":556 | |
13150 * cdef tbx_t * tbx = NULL | |
13151 * lines = [] | |
13152 * with nogil: # <<<<<<<<<<<<<< | |
13153 * fp = hts_open(cfilename, 'r') | |
13154 * | |
13155 */ | |
13156 { | |
13157 #ifdef WITH_THREAD | |
13158 PyThreadState *_save; | |
13159 _save = NULL; | |
13160 Py_UNBLOCK_THREADS | |
13161 __Pyx_FastGIL_Remember(); | |
13162 #endif | |
13163 /*try:*/ { | |
13164 | |
13165 /* "pysam/libctabix.pyx":557 | |
13166 * lines = [] | |
13167 * with nogil: | |
13168 * fp = hts_open(cfilename, 'r') # <<<<<<<<<<<<<< | |
13169 * | |
13170 * if fp == NULL: | |
13171 */ | |
13172 __pyx_v_fp = hts_open(__pyx_v_cfilename, ((char const *)"r")); | |
13173 } | |
13174 | |
13175 /* "pysam/libctabix.pyx":556 | |
13176 * cdef tbx_t * tbx = NULL | |
13177 * lines = [] | |
13178 * with nogil: # <<<<<<<<<<<<<< | |
13179 * fp = hts_open(cfilename, 'r') | |
13180 * | |
13181 */ | |
13182 /*finally:*/ { | |
13183 /*normal exit:*/{ | |
13184 #ifdef WITH_THREAD | |
13185 __Pyx_FastGIL_Forget(); | |
13186 Py_BLOCK_THREADS | |
13187 #endif | |
13188 goto __pyx_L5; | |
13189 } | |
13190 __pyx_L5:; | |
13191 } | |
13192 } | |
13193 | |
13194 /* "pysam/libctabix.pyx":559 | |
13195 * fp = hts_open(cfilename, 'r') | |
13196 * | |
13197 * if fp == NULL: # <<<<<<<<<<<<<< | |
13198 * raise OSError("could not open {} for reading header".format(self.filename)) | |
13199 * | |
13200 */ | |
13201 __pyx_t_3 = (__pyx_v_fp == NULL); | |
13202 if (unlikely(__pyx_t_3)) { | |
13203 | |
13204 /* "pysam/libctabix.pyx":560 | |
13205 * | |
13206 * if fp == NULL: | |
13207 * raise OSError("could not open {} for reading header".format(self.filename)) # <<<<<<<<<<<<<< | |
13208 * | |
13209 * with nogil: | |
13210 */ | |
13211 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_could_not_open_for_reading_heade, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error) | |
13212 __Pyx_GOTREF(__pyx_t_4); | |
13213 __pyx_t_5 = NULL; | |
13214 __pyx_t_6 = 0; | |
13215 #if CYTHON_UNPACK_METHODS | |
13216 if (likely(PyMethod_Check(__pyx_t_4))) { | |
13217 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); | |
13218 if (likely(__pyx_t_5)) { | |
13219 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
13220 __Pyx_INCREF(__pyx_t_5); | |
13221 __Pyx_INCREF(function); | |
13222 __Pyx_DECREF_SET(__pyx_t_4, function); | |
13223 __pyx_t_6 = 1; | |
13224 } | |
13225 } | |
13226 #endif | |
13227 { | |
13228 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_self->__pyx_base.filename}; | |
13229 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); | |
13230 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
13231 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) | |
13232 __Pyx_GOTREF(__pyx_t_2); | |
13233 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
13234 } | |
13235 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_OSError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error) | |
13236 __Pyx_GOTREF(__pyx_t_4); | |
13237 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
13238 __Pyx_Raise(__pyx_t_4, 0, 0, 0); | |
13239 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
13240 __PYX_ERR(0, 560, __pyx_L1_error) | |
13241 | |
13242 /* "pysam/libctabix.pyx":559 | |
13243 * fp = hts_open(cfilename, 'r') | |
13244 * | |
13245 * if fp == NULL: # <<<<<<<<<<<<<< | |
13246 * raise OSError("could not open {} for reading header".format(self.filename)) | |
13247 * | |
13248 */ | |
13249 } | |
13250 | |
13251 /* "pysam/libctabix.pyx":562 | |
13252 * raise OSError("could not open {} for reading header".format(self.filename)) | |
13253 * | |
13254 * with nogil: # <<<<<<<<<<<<<< | |
13255 * tbx = tbx_index_load2(cfilename, cfilename_index) | |
13256 * | |
13257 */ | |
13258 { | |
13259 #ifdef WITH_THREAD | |
13260 PyThreadState *_save; | |
13261 _save = NULL; | |
13262 Py_UNBLOCK_THREADS | |
13263 __Pyx_FastGIL_Remember(); | |
13264 #endif | |
13265 /*try:*/ { | |
13266 | |
13267 /* "pysam/libctabix.pyx":563 | |
13268 * | |
13269 * with nogil: | |
13270 * tbx = tbx_index_load2(cfilename, cfilename_index) # <<<<<<<<<<<<<< | |
13271 * | |
13272 * if tbx == NULL: | |
13273 */ | |
13274 __pyx_v_tbx = tbx_index_load2(__pyx_v_cfilename, __pyx_v_cfilename_index); | |
13275 } | |
13276 | |
13277 /* "pysam/libctabix.pyx":562 | |
13278 * raise OSError("could not open {} for reading header".format(self.filename)) | |
13279 * | |
13280 * with nogil: # <<<<<<<<<<<<<< | |
13281 * tbx = tbx_index_load2(cfilename, cfilename_index) | |
13282 * | |
13283 */ | |
13284 /*finally:*/ { | |
13285 /*normal exit:*/{ | |
13286 #ifdef WITH_THREAD | |
13287 __Pyx_FastGIL_Forget(); | |
13288 Py_BLOCK_THREADS | |
13289 #endif | |
13290 goto __pyx_L9; | |
13291 } | |
13292 __pyx_L9:; | |
13293 } | |
13294 } | |
13295 | |
13296 /* "pysam/libctabix.pyx":565 | |
13297 * tbx = tbx_index_load2(cfilename, cfilename_index) | |
13298 * | |
13299 * if tbx == NULL: # <<<<<<<<<<<<<< | |
13300 * raise OSError("could not load .tbi/.csi index of {}".format(self.filename)) | |
13301 * | |
13302 */ | |
13303 __pyx_t_3 = (__pyx_v_tbx == NULL); | |
13304 if (unlikely(__pyx_t_3)) { | |
13305 | |
13306 /* "pysam/libctabix.pyx":566 | |
13307 * | |
13308 * if tbx == NULL: | |
13309 * raise OSError("could not load .tbi/.csi index of {}".format(self.filename)) # <<<<<<<<<<<<<< | |
13310 * | |
13311 * while hts_getline(fp, KS_SEP_LINE, &buffer) >= 0: | |
13312 */ | |
13313 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_could_not_load_tbi_csi_index_of, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) | |
13314 __Pyx_GOTREF(__pyx_t_2); | |
13315 __pyx_t_5 = NULL; | |
13316 __pyx_t_6 = 0; | |
13317 #if CYTHON_UNPACK_METHODS | |
13318 if (likely(PyMethod_Check(__pyx_t_2))) { | |
13319 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); | |
13320 if (likely(__pyx_t_5)) { | |
13321 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
13322 __Pyx_INCREF(__pyx_t_5); | |
13323 __Pyx_INCREF(function); | |
13324 __Pyx_DECREF_SET(__pyx_t_2, function); | |
13325 __pyx_t_6 = 1; | |
13326 } | |
13327 } | |
13328 #endif | |
13329 { | |
13330 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_self->__pyx_base.filename}; | |
13331 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); | |
13332 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
13333 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L1_error) | |
13334 __Pyx_GOTREF(__pyx_t_4); | |
13335 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
13336 } | |
13337 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_OSError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) | |
13338 __Pyx_GOTREF(__pyx_t_2); | |
13339 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
13340 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
13341 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
13342 __PYX_ERR(0, 566, __pyx_L1_error) | |
13343 | |
13344 /* "pysam/libctabix.pyx":565 | |
13345 * tbx = tbx_index_load2(cfilename, cfilename_index) | |
13346 * | |
13347 * if tbx == NULL: # <<<<<<<<<<<<<< | |
13348 * raise OSError("could not load .tbi/.csi index of {}".format(self.filename)) | |
13349 * | |
13350 */ | |
13351 } | |
13352 | |
13353 /* "pysam/libctabix.pyx":568 | |
13354 * raise OSError("could not load .tbi/.csi index of {}".format(self.filename)) | |
13355 * | |
13356 * while hts_getline(fp, KS_SEP_LINE, &buffer) >= 0: # <<<<<<<<<<<<<< | |
13357 * if not buffer.l or buffer.s[0] != tbx.conf.meta_char: | |
13358 * break | |
13359 */ | |
13360 while (1) { | |
13361 __pyx_t_3 = (hts_getline(__pyx_v_fp, __pyx_v_KS_SEP_LINE, (&__pyx_v_buffer)) >= 0); | |
13362 if (!__pyx_t_3) break; | |
13363 | |
13364 /* "pysam/libctabix.pyx":569 | |
13365 * | |
13366 * while hts_getline(fp, KS_SEP_LINE, &buffer) >= 0: | |
13367 * if not buffer.l or buffer.s[0] != tbx.conf.meta_char: # <<<<<<<<<<<<<< | |
13368 * break | |
13369 * lines.append(force_str(buffer.s, self.encoding)) | |
13370 */ | |
13371 __pyx_t_7 = (!(__pyx_v_buffer.l != 0)); | |
13372 if (!__pyx_t_7) { | |
13373 } else { | |
13374 __pyx_t_3 = __pyx_t_7; | |
13375 goto __pyx_L14_bool_binop_done; | |
13376 } | |
13377 __pyx_t_7 = ((__pyx_v_buffer.s[0]) != __pyx_v_tbx->conf.meta_char); | |
13378 __pyx_t_3 = __pyx_t_7; | |
13379 __pyx_L14_bool_binop_done:; | |
13380 if (__pyx_t_3) { | |
13381 | |
13382 /* "pysam/libctabix.pyx":570 | |
13383 * while hts_getline(fp, KS_SEP_LINE, &buffer) >= 0: | |
13384 * if not buffer.l or buffer.s[0] != tbx.conf.meta_char: | |
13385 * break # <<<<<<<<<<<<<< | |
13386 * lines.append(force_str(buffer.s, self.encoding)) | |
13387 * | |
13388 */ | |
13389 goto __pyx_L12_break; | |
13390 | |
13391 /* "pysam/libctabix.pyx":569 | |
13392 * | |
13393 * while hts_getline(fp, KS_SEP_LINE, &buffer) >= 0: | |
13394 * if not buffer.l or buffer.s[0] != tbx.conf.meta_char: # <<<<<<<<<<<<<< | |
13395 * break | |
13396 * lines.append(force_str(buffer.s, self.encoding)) | |
13397 */ | |
13398 } | |
13399 | |
13400 /* "pysam/libctabix.pyx":571 | |
13401 * if not buffer.l or buffer.s[0] != tbx.conf.meta_char: | |
13402 * break | |
13403 * lines.append(force_str(buffer.s, self.encoding)) # <<<<<<<<<<<<<< | |
13404 * | |
13405 * with nogil: | |
13406 */ | |
13407 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_buffer.s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error) | |
13408 __Pyx_GOTREF(__pyx_t_2); | |
13409 __pyx_t_4 = __pyx_v_self->encoding; | |
13410 __Pyx_INCREF(__pyx_t_4); | |
13411 __pyx_t_8.__pyx_n = 1; | |
13412 __pyx_t_8.encoding = __pyx_t_4; | |
13413 __pyx_t_5 = __pyx_f_5pysam_9libcutils_force_str(__pyx_t_2, &__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error) | |
13414 __Pyx_GOTREF(__pyx_t_5); | |
13415 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
13416 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
13417 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_lines, __pyx_t_5); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 571, __pyx_L1_error) | |
13418 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
13419 } | |
13420 __pyx_L12_break:; | |
13421 | |
13422 /* "pysam/libctabix.pyx":573 | |
13423 * lines.append(force_str(buffer.s, self.encoding)) | |
13424 * | |
13425 * with nogil: # <<<<<<<<<<<<<< | |
13426 * hts_close(fp) | |
13427 * free(buffer.s) | |
13428 */ | |
13429 { | |
13430 #ifdef WITH_THREAD | |
13431 PyThreadState *_save; | |
13432 _save = NULL; | |
13433 Py_UNBLOCK_THREADS | |
13434 __Pyx_FastGIL_Remember(); | |
13435 #endif | |
13436 /*try:*/ { | |
13437 | |
13438 /* "pysam/libctabix.pyx":574 | |
13439 * | |
13440 * with nogil: | |
13441 * hts_close(fp) # <<<<<<<<<<<<<< | |
13442 * free(buffer.s) | |
13443 * | |
13444 */ | |
13445 (void)(hts_close(__pyx_v_fp)); | |
13446 | |
13447 /* "pysam/libctabix.pyx":575 | |
13448 * with nogil: | |
13449 * hts_close(fp) | |
13450 * free(buffer.s) # <<<<<<<<<<<<<< | |
13451 * | |
13452 * return lines | |
13453 */ | |
13454 free(__pyx_v_buffer.s); | |
13455 } | |
13456 | |
13457 /* "pysam/libctabix.pyx":573 | |
13458 * lines.append(force_str(buffer.s, self.encoding)) | |
13459 * | |
13460 * with nogil: # <<<<<<<<<<<<<< | |
13461 * hts_close(fp) | |
13462 * free(buffer.s) | |
13463 */ | |
13464 /*finally:*/ { | |
13465 /*normal exit:*/{ | |
13466 #ifdef WITH_THREAD | |
13467 __Pyx_FastGIL_Forget(); | |
13468 Py_BLOCK_THREADS | |
13469 #endif | |
13470 goto __pyx_L18; | |
13471 } | |
13472 __pyx_L18:; | |
13473 } | |
13474 } | |
13475 | |
13476 /* "pysam/libctabix.pyx":577 | |
13477 * free(buffer.s) | |
13478 * | |
13479 * return lines # <<<<<<<<<<<<<< | |
13480 * | |
13481 * property contigs: | |
13482 */ | |
13483 __Pyx_XDECREF(__pyx_r); | |
13484 __Pyx_INCREF(__pyx_v_lines); | |
13485 __pyx_r = __pyx_v_lines; | |
13486 goto __pyx_L0; | |
13487 | |
13488 /* "pysam/libctabix.pyx":543 | |
13489 * ''' | |
13490 * | |
13491 * def __get__(self): # <<<<<<<<<<<<<< | |
13492 * | |
13493 * cdef char *cfilename = self.filename | |
13494 */ | |
13495 | |
13496 /* function exit code */ | |
13497 __pyx_L1_error:; | |
13498 __Pyx_XDECREF(__pyx_t_2); | |
13499 __Pyx_XDECREF(__pyx_t_4); | |
13500 __Pyx_XDECREF(__pyx_t_5); | |
13501 __Pyx_AddTraceback("pysam.libctabix.TabixFile.header.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13502 __pyx_r = NULL; | |
13503 __pyx_L0:; | |
13504 __Pyx_XDECREF(__pyx_v_lines); | |
13505 __Pyx_XGIVEREF(__pyx_r); | |
13506 __Pyx_TraceReturn(__pyx_r, 0); | |
13507 __Pyx_RefNannyFinishContext(); | |
13508 return __pyx_r; | |
13509 } | |
13510 | |
13511 /* "pysam/libctabix.pyx":581 | |
13512 * property contigs: | |
13513 * '''list of chromosome names''' | |
13514 * def __get__(self): # <<<<<<<<<<<<<< | |
13515 * cdef const char ** sequences | |
13516 * cdef int nsequences | |
13517 */ | |
13518 | |
13519 /* Python wrapper */ | |
13520 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_7contigs_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
13521 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_7contigs_1__get__(PyObject *__pyx_v_self) { | |
13522 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13523 PyObject *__pyx_r = 0; | |
13524 __Pyx_RefNannyDeclarations | |
13525 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
13526 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
13527 __pyx_r = __pyx_pf_5pysam_9libctabix_9TabixFile_7contigs___get__(((struct __pyx_obj_5pysam_9libctabix_TabixFile *)__pyx_v_self)); | |
13528 | |
13529 /* function exit code */ | |
13530 __Pyx_RefNannyFinishContext(); | |
13531 return __pyx_r; | |
13532 } | |
13533 | |
13534 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_7contigs___get__(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self) { | |
13535 char const **__pyx_v_sequences; | |
13536 int __pyx_v_nsequences; | |
13537 int __pyx_v_x; | |
13538 PyObject *__pyx_v_result = NULL; | |
13539 PyObject *__pyx_r = NULL; | |
13540 __Pyx_TraceDeclarations | |
13541 __Pyx_RefNannyDeclarations | |
13542 PyObject *__pyx_t_1 = NULL; | |
13543 int __pyx_t_2; | |
13544 PyObject *__pyx_t_3 = NULL; | |
13545 int __pyx_t_4; | |
13546 int __pyx_lineno = 0; | |
13547 const char *__pyx_filename = NULL; | |
13548 int __pyx_clineno = 0; | |
13549 __Pyx_RefNannySetupContext("__get__", 1); | |
13550 __Pyx_TraceCall("__get__", __pyx_f[0], 581, 0, __PYX_ERR(0, 581, __pyx_L1_error)); | |
13551 | |
13552 /* "pysam/libctabix.pyx":585 | |
13553 * cdef int nsequences | |
13554 * | |
13555 * with nogil: # <<<<<<<<<<<<<< | |
13556 * sequences = tbx_seqnames(self.index, &nsequences) | |
13557 * cdef int x | |
13558 */ | |
13559 { | |
13560 #ifdef WITH_THREAD | |
13561 PyThreadState *_save; | |
13562 _save = NULL; | |
13563 Py_UNBLOCK_THREADS | |
13564 __Pyx_FastGIL_Remember(); | |
13565 #endif | |
13566 /*try:*/ { | |
13567 | |
13568 /* "pysam/libctabix.pyx":586 | |
13569 * | |
13570 * with nogil: | |
13571 * sequences = tbx_seqnames(self.index, &nsequences) # <<<<<<<<<<<<<< | |
13572 * cdef int x | |
13573 * result = [] | |
13574 */ | |
13575 __pyx_v_sequences = tbx_seqnames(__pyx_v_self->index, (&__pyx_v_nsequences)); | |
13576 } | |
13577 | |
13578 /* "pysam/libctabix.pyx":585 | |
13579 * cdef int nsequences | |
13580 * | |
13581 * with nogil: # <<<<<<<<<<<<<< | |
13582 * sequences = tbx_seqnames(self.index, &nsequences) | |
13583 * cdef int x | |
13584 */ | |
13585 /*finally:*/ { | |
13586 /*normal exit:*/{ | |
13587 #ifdef WITH_THREAD | |
13588 __Pyx_FastGIL_Forget(); | |
13589 Py_BLOCK_THREADS | |
13590 #endif | |
13591 goto __pyx_L5; | |
13592 } | |
13593 __pyx_L5:; | |
13594 } | |
13595 } | |
13596 | |
13597 /* "pysam/libctabix.pyx":588 | |
13598 * sequences = tbx_seqnames(self.index, &nsequences) | |
13599 * cdef int x | |
13600 * result = [] # <<<<<<<<<<<<<< | |
13601 * for x from 0 <= x < nsequences: | |
13602 * result.append(force_str(sequences[x])) | |
13603 */ | |
13604 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error) | |
13605 __Pyx_GOTREF(__pyx_t_1); | |
13606 __pyx_v_result = ((PyObject*)__pyx_t_1); | |
13607 __pyx_t_1 = 0; | |
13608 | |
13609 /* "pysam/libctabix.pyx":589 | |
13610 * cdef int x | |
13611 * result = [] | |
13612 * for x from 0 <= x < nsequences: # <<<<<<<<<<<<<< | |
13613 * result.append(force_str(sequences[x])) | |
13614 * | |
13615 */ | |
13616 __pyx_t_2 = __pyx_v_nsequences; | |
13617 for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_2; __pyx_v_x++) { | |
13618 | |
13619 /* "pysam/libctabix.pyx":590 | |
13620 * result = [] | |
13621 * for x from 0 <= x < nsequences: | |
13622 * result.append(force_str(sequences[x])) # <<<<<<<<<<<<<< | |
13623 * | |
13624 * # htslib instructions: | |
13625 */ | |
13626 __pyx_t_1 = __Pyx_PyBytes_FromString((__pyx_v_sequences[__pyx_v_x])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error) | |
13627 __Pyx_GOTREF(__pyx_t_1); | |
13628 __pyx_t_3 = __pyx_f_5pysam_9libcutils_force_str(__pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error) | |
13629 __Pyx_GOTREF(__pyx_t_3); | |
13630 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13631 __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 590, __pyx_L1_error) | |
13632 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
13633 } | |
13634 | |
13635 /* "pysam/libctabix.pyx":594 | |
13636 * # htslib instructions: | |
13637 * # only free container, not the sequences themselves | |
13638 * free(sequences) # <<<<<<<<<<<<<< | |
13639 * | |
13640 * return result | |
13641 */ | |
13642 free(__pyx_v_sequences); | |
13643 | |
13644 /* "pysam/libctabix.pyx":596 | |
13645 * free(sequences) | |
13646 * | |
13647 * return result # <<<<<<<<<<<<<< | |
13648 * | |
13649 * def close(self): | |
13650 */ | |
13651 __Pyx_XDECREF(__pyx_r); | |
13652 __Pyx_INCREF(__pyx_v_result); | |
13653 __pyx_r = __pyx_v_result; | |
13654 goto __pyx_L0; | |
13655 | |
13656 /* "pysam/libctabix.pyx":581 | |
13657 * property contigs: | |
13658 * '''list of chromosome names''' | |
13659 * def __get__(self): # <<<<<<<<<<<<<< | |
13660 * cdef const char ** sequences | |
13661 * cdef int nsequences | |
13662 */ | |
13663 | |
13664 /* function exit code */ | |
13665 __pyx_L1_error:; | |
13666 __Pyx_XDECREF(__pyx_t_1); | |
13667 __Pyx_XDECREF(__pyx_t_3); | |
13668 __Pyx_AddTraceback("pysam.libctabix.TabixFile.contigs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13669 __pyx_r = NULL; | |
13670 __pyx_L0:; | |
13671 __Pyx_XDECREF(__pyx_v_result); | |
13672 __Pyx_XGIVEREF(__pyx_r); | |
13673 __Pyx_TraceReturn(__pyx_r, 0); | |
13674 __Pyx_RefNannyFinishContext(); | |
13675 return __pyx_r; | |
13676 } | |
13677 | |
13678 /* "pysam/libctabix.pyx":598 | |
13679 * return result | |
13680 * | |
13681 * def close(self): # <<<<<<<<<<<<<< | |
13682 * ''' | |
13683 * closes the :class:`pysam.TabixFile`.''' | |
13684 */ | |
13685 | |
13686 /* Python wrapper */ | |
13687 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_9close(PyObject *__pyx_v_self, | |
13688 #if CYTHON_METH_FASTCALL | |
13689 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
13690 #else | |
13691 PyObject *__pyx_args, PyObject *__pyx_kwds | |
13692 #endif | |
13693 ); /*proto*/ | |
13694 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_9TabixFile_8close, "TabixFile.close(self)\n\n closes the :class:`pysam.TabixFile`."); | |
13695 static PyMethodDef __pyx_mdef_5pysam_9libctabix_9TabixFile_9close = {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9TabixFile_9close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_9TabixFile_8close}; | |
13696 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_9close(PyObject *__pyx_v_self, | |
13697 #if CYTHON_METH_FASTCALL | |
13698 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
13699 #else | |
13700 PyObject *__pyx_args, PyObject *__pyx_kwds | |
13701 #endif | |
13702 ) { | |
13703 #if !CYTHON_METH_FASTCALL | |
13704 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
13705 #endif | |
13706 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13707 PyObject *__pyx_r = 0; | |
13708 __Pyx_RefNannyDeclarations | |
13709 __Pyx_RefNannySetupContext("close (wrapper)", 0); | |
13710 #if !CYTHON_METH_FASTCALL | |
13711 #if CYTHON_ASSUME_SAFE_MACROS | |
13712 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
13713 #else | |
13714 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
13715 #endif | |
13716 #endif | |
13717 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
13718 if (unlikely(__pyx_nargs > 0)) { | |
13719 __Pyx_RaiseArgtupleInvalid("close", 1, 0, 0, __pyx_nargs); return NULL;} | |
13720 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "close", 0))) return NULL; | |
13721 __pyx_r = __pyx_pf_5pysam_9libctabix_9TabixFile_8close(((struct __pyx_obj_5pysam_9libctabix_TabixFile *)__pyx_v_self)); | |
13722 | |
13723 /* function exit code */ | |
13724 __Pyx_RefNannyFinishContext(); | |
13725 return __pyx_r; | |
13726 } | |
13727 | |
13728 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_8close(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self) { | |
13729 PyObject *__pyx_r = NULL; | |
13730 __Pyx_TraceDeclarations | |
13731 __Pyx_RefNannyDeclarations | |
13732 int __pyx_t_1; | |
13733 int __pyx_lineno = 0; | |
13734 const char *__pyx_filename = NULL; | |
13735 int __pyx_clineno = 0; | |
13736 __Pyx_TraceFrameInit(__pyx_codeobj__21) | |
13737 __Pyx_RefNannySetupContext("close", 1); | |
13738 __Pyx_TraceCall("close", __pyx_f[0], 598, 0, __PYX_ERR(0, 598, __pyx_L1_error)); | |
13739 | |
13740 /* "pysam/libctabix.pyx":601 | |
13741 * ''' | |
13742 * closes the :class:`pysam.TabixFile`.''' | |
13743 * if self.htsfile != NULL: # <<<<<<<<<<<<<< | |
13744 * hts_close(self.htsfile) | |
13745 * self.htsfile = NULL | |
13746 */ | |
13747 __pyx_t_1 = (__pyx_v_self->__pyx_base.htsfile != NULL); | |
13748 if (__pyx_t_1) { | |
13749 | |
13750 /* "pysam/libctabix.pyx":602 | |
13751 * closes the :class:`pysam.TabixFile`.''' | |
13752 * if self.htsfile != NULL: | |
13753 * hts_close(self.htsfile) # <<<<<<<<<<<<<< | |
13754 * self.htsfile = NULL | |
13755 * if self.index != NULL: | |
13756 */ | |
13757 (void)(hts_close(__pyx_v_self->__pyx_base.htsfile)); | |
13758 | |
13759 /* "pysam/libctabix.pyx":603 | |
13760 * if self.htsfile != NULL: | |
13761 * hts_close(self.htsfile) | |
13762 * self.htsfile = NULL # <<<<<<<<<<<<<< | |
13763 * if self.index != NULL: | |
13764 * tbx_destroy(self.index) | |
13765 */ | |
13766 __pyx_v_self->__pyx_base.htsfile = NULL; | |
13767 | |
13768 /* "pysam/libctabix.pyx":601 | |
13769 * ''' | |
13770 * closes the :class:`pysam.TabixFile`.''' | |
13771 * if self.htsfile != NULL: # <<<<<<<<<<<<<< | |
13772 * hts_close(self.htsfile) | |
13773 * self.htsfile = NULL | |
13774 */ | |
13775 } | |
13776 | |
13777 /* "pysam/libctabix.pyx":604 | |
13778 * hts_close(self.htsfile) | |
13779 * self.htsfile = NULL | |
13780 * if self.index != NULL: # <<<<<<<<<<<<<< | |
13781 * tbx_destroy(self.index) | |
13782 * self.index = NULL | |
13783 */ | |
13784 __pyx_t_1 = (__pyx_v_self->index != NULL); | |
13785 if (__pyx_t_1) { | |
13786 | |
13787 /* "pysam/libctabix.pyx":605 | |
13788 * self.htsfile = NULL | |
13789 * if self.index != NULL: | |
13790 * tbx_destroy(self.index) # <<<<<<<<<<<<<< | |
13791 * self.index = NULL | |
13792 * | |
13793 */ | |
13794 tbx_destroy(__pyx_v_self->index); | |
13795 | |
13796 /* "pysam/libctabix.pyx":606 | |
13797 * if self.index != NULL: | |
13798 * tbx_destroy(self.index) | |
13799 * self.index = NULL # <<<<<<<<<<<<<< | |
13800 * | |
13801 * def __dealloc__( self ): | |
13802 */ | |
13803 __pyx_v_self->index = NULL; | |
13804 | |
13805 /* "pysam/libctabix.pyx":604 | |
13806 * hts_close(self.htsfile) | |
13807 * self.htsfile = NULL | |
13808 * if self.index != NULL: # <<<<<<<<<<<<<< | |
13809 * tbx_destroy(self.index) | |
13810 * self.index = NULL | |
13811 */ | |
13812 } | |
13813 | |
13814 /* "pysam/libctabix.pyx":598 | |
13815 * return result | |
13816 * | |
13817 * def close(self): # <<<<<<<<<<<<<< | |
13818 * ''' | |
13819 * closes the :class:`pysam.TabixFile`.''' | |
13820 */ | |
13821 | |
13822 /* function exit code */ | |
13823 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
13824 goto __pyx_L0; | |
13825 __pyx_L1_error:; | |
13826 __Pyx_AddTraceback("pysam.libctabix.TabixFile.close", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13827 __pyx_r = NULL; | |
13828 __pyx_L0:; | |
13829 __Pyx_XGIVEREF(__pyx_r); | |
13830 __Pyx_TraceReturn(__pyx_r, 0); | |
13831 __Pyx_RefNannyFinishContext(); | |
13832 return __pyx_r; | |
13833 } | |
13834 | |
13835 /* "pysam/libctabix.pyx":608 | |
13836 * self.index = NULL | |
13837 * | |
13838 * def __dealloc__( self ): # <<<<<<<<<<<<<< | |
13839 * # remember: dealloc cannot call other python methods | |
13840 * # note: no doc string | |
13841 */ | |
13842 | |
13843 /* Python wrapper */ | |
13844 static void __pyx_pw_5pysam_9libctabix_9TabixFile_11__dealloc__(PyObject *__pyx_v_self); /*proto*/ | |
13845 static void __pyx_pw_5pysam_9libctabix_9TabixFile_11__dealloc__(PyObject *__pyx_v_self) { | |
13846 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13847 __Pyx_RefNannyDeclarations | |
13848 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); | |
13849 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
13850 __pyx_pf_5pysam_9libctabix_9TabixFile_10__dealloc__(((struct __pyx_obj_5pysam_9libctabix_TabixFile *)__pyx_v_self)); | |
13851 | |
13852 /* function exit code */ | |
13853 __Pyx_RefNannyFinishContext(); | |
13854 } | |
13855 | |
13856 static void __pyx_pf_5pysam_9libctabix_9TabixFile_10__dealloc__(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self) { | |
13857 __Pyx_TraceDeclarations | |
13858 int __pyx_t_1; | |
13859 int __pyx_lineno = 0; | |
13860 const char *__pyx_filename = NULL; | |
13861 int __pyx_clineno = 0; | |
13862 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 608, 0, __PYX_ERR(0, 608, __pyx_L1_error)); | |
13863 | |
13864 /* "pysam/libctabix.pyx":612 | |
13865 * # note: no doc string | |
13866 * # note: __del__ is not called. | |
13867 * if self.htsfile != NULL: # <<<<<<<<<<<<<< | |
13868 * hts_close(self.htsfile) | |
13869 * self.htsfile = NULL | |
13870 */ | |
13871 __pyx_t_1 = (__pyx_v_self->__pyx_base.htsfile != NULL); | |
13872 if (__pyx_t_1) { | |
13873 | |
13874 /* "pysam/libctabix.pyx":613 | |
13875 * # note: __del__ is not called. | |
13876 * if self.htsfile != NULL: | |
13877 * hts_close(self.htsfile) # <<<<<<<<<<<<<< | |
13878 * self.htsfile = NULL | |
13879 * if self.index != NULL: | |
13880 */ | |
13881 (void)(hts_close(__pyx_v_self->__pyx_base.htsfile)); | |
13882 | |
13883 /* "pysam/libctabix.pyx":614 | |
13884 * if self.htsfile != NULL: | |
13885 * hts_close(self.htsfile) | |
13886 * self.htsfile = NULL # <<<<<<<<<<<<<< | |
13887 * if self.index != NULL: | |
13888 * tbx_destroy(self.index) | |
13889 */ | |
13890 __pyx_v_self->__pyx_base.htsfile = NULL; | |
13891 | |
13892 /* "pysam/libctabix.pyx":612 | |
13893 * # note: no doc string | |
13894 * # note: __del__ is not called. | |
13895 * if self.htsfile != NULL: # <<<<<<<<<<<<<< | |
13896 * hts_close(self.htsfile) | |
13897 * self.htsfile = NULL | |
13898 */ | |
13899 } | |
13900 | |
13901 /* "pysam/libctabix.pyx":615 | |
13902 * hts_close(self.htsfile) | |
13903 * self.htsfile = NULL | |
13904 * if self.index != NULL: # <<<<<<<<<<<<<< | |
13905 * tbx_destroy(self.index) | |
13906 * | |
13907 */ | |
13908 __pyx_t_1 = (__pyx_v_self->index != NULL); | |
13909 if (__pyx_t_1) { | |
13910 | |
13911 /* "pysam/libctabix.pyx":616 | |
13912 * self.htsfile = NULL | |
13913 * if self.index != NULL: | |
13914 * tbx_destroy(self.index) # <<<<<<<<<<<<<< | |
13915 * | |
13916 * | |
13917 */ | |
13918 tbx_destroy(__pyx_v_self->index); | |
13919 | |
13920 /* "pysam/libctabix.pyx":615 | |
13921 * hts_close(self.htsfile) | |
13922 * self.htsfile = NULL | |
13923 * if self.index != NULL: # <<<<<<<<<<<<<< | |
13924 * tbx_destroy(self.index) | |
13925 * | |
13926 */ | |
13927 } | |
13928 | |
13929 /* "pysam/libctabix.pyx":608 | |
13930 * self.index = NULL | |
13931 * | |
13932 * def __dealloc__( self ): # <<<<<<<<<<<<<< | |
13933 * # remember: dealloc cannot call other python methods | |
13934 * # note: no doc string | |
13935 */ | |
13936 | |
13937 /* function exit code */ | |
13938 goto __pyx_L0; | |
13939 __pyx_L1_error:; | |
13940 __Pyx_WriteUnraisable("pysam.libctabix.TabixFile.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); | |
13941 __pyx_L0:; | |
13942 __Pyx_TraceReturn(Py_None, 0); | |
13943 } | |
13944 | |
13945 /* "pysam/libctabix.pxd":65 | |
13946 * cdef tbx_t * index | |
13947 * | |
13948 * cdef readonly object filename_index # <<<<<<<<<<<<<< | |
13949 * | |
13950 * cdef Parser parser | |
13951 */ | |
13952 | |
13953 /* Python wrapper */ | |
13954 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_14filename_index_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
13955 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_14filename_index_1__get__(PyObject *__pyx_v_self) { | |
13956 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13957 PyObject *__pyx_r = 0; | |
13958 __Pyx_RefNannyDeclarations | |
13959 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
13960 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
13961 __pyx_r = __pyx_pf_5pysam_9libctabix_9TabixFile_14filename_index___get__(((struct __pyx_obj_5pysam_9libctabix_TabixFile *)__pyx_v_self)); | |
13962 | |
13963 /* function exit code */ | |
13964 __Pyx_RefNannyFinishContext(); | |
13965 return __pyx_r; | |
13966 } | |
13967 | |
13968 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_14filename_index___get__(struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self) { | |
13969 PyObject *__pyx_r = NULL; | |
13970 __Pyx_TraceDeclarations | |
13971 __Pyx_RefNannyDeclarations | |
13972 int __pyx_lineno = 0; | |
13973 const char *__pyx_filename = NULL; | |
13974 int __pyx_clineno = 0; | |
13975 __Pyx_RefNannySetupContext("__get__", 1); | |
13976 __Pyx_TraceCall("__get__", __pyx_f[4], 65, 0, __PYX_ERR(4, 65, __pyx_L1_error)); | |
13977 __Pyx_XDECREF(__pyx_r); | |
13978 __Pyx_INCREF(__pyx_v_self->filename_index); | |
13979 __pyx_r = __pyx_v_self->filename_index; | |
13980 goto __pyx_L0; | |
13981 | |
13982 /* function exit code */ | |
13983 __pyx_L1_error:; | |
13984 __Pyx_AddTraceback("pysam.libctabix.TabixFile.filename_index.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13985 __pyx_r = NULL; | |
13986 __pyx_L0:; | |
13987 __Pyx_XGIVEREF(__pyx_r); | |
13988 __Pyx_TraceReturn(__pyx_r, 0); | |
13989 __Pyx_RefNannyFinishContext(); | |
13990 return __pyx_r; | |
13991 } | |
13992 | |
13993 /* "(tree fragment)":1 | |
13994 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
13995 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
13996 * def __setstate_cython__(self, __pyx_state): | |
13997 */ | |
13998 | |
13999 /* Python wrapper */ | |
14000 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_13__reduce_cython__(PyObject *__pyx_v_self, | |
14001 #if CYTHON_METH_FASTCALL | |
14002 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14003 #else | |
14004 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14005 #endif | |
14006 ); /*proto*/ | |
14007 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_9TabixFile_12__reduce_cython__, "TabixFile.__reduce_cython__(self)"); | |
14008 static PyMethodDef __pyx_mdef_5pysam_9libctabix_9TabixFile_13__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9TabixFile_13__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_9TabixFile_12__reduce_cython__}; | |
14009 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_13__reduce_cython__(PyObject *__pyx_v_self, | |
14010 #if CYTHON_METH_FASTCALL | |
14011 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14012 #else | |
14013 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14014 #endif | |
14015 ) { | |
14016 #if !CYTHON_METH_FASTCALL | |
14017 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
14018 #endif | |
14019 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
14020 PyObject *__pyx_r = 0; | |
14021 __Pyx_RefNannyDeclarations | |
14022 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
14023 #if !CYTHON_METH_FASTCALL | |
14024 #if CYTHON_ASSUME_SAFE_MACROS | |
14025 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
14026 #else | |
14027 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
14028 #endif | |
14029 #endif | |
14030 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
14031 if (unlikely(__pyx_nargs > 0)) { | |
14032 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
14033 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
14034 __pyx_r = __pyx_pf_5pysam_9libctabix_9TabixFile_12__reduce_cython__(((struct __pyx_obj_5pysam_9libctabix_TabixFile *)__pyx_v_self)); | |
14035 | |
14036 /* function exit code */ | |
14037 __Pyx_RefNannyFinishContext(); | |
14038 return __pyx_r; | |
14039 } | |
14040 | |
14041 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self) { | |
14042 PyObject *__pyx_r = NULL; | |
14043 __Pyx_TraceDeclarations | |
14044 __Pyx_RefNannyDeclarations | |
14045 int __pyx_lineno = 0; | |
14046 const char *__pyx_filename = NULL; | |
14047 int __pyx_clineno = 0; | |
14048 __Pyx_TraceFrameInit(__pyx_codeobj__22) | |
14049 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
14050 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
14051 | |
14052 /* "(tree fragment)":2 | |
14053 * def __reduce_cython__(self): | |
14054 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< | |
14055 * def __setstate_cython__(self, __pyx_state): | |
14056 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
14057 */ | |
14058 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); | |
14059 __PYX_ERR(1, 2, __pyx_L1_error) | |
14060 | |
14061 /* "(tree fragment)":1 | |
14062 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
14063 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
14064 * def __setstate_cython__(self, __pyx_state): | |
14065 */ | |
14066 | |
14067 /* function exit code */ | |
14068 __pyx_L1_error:; | |
14069 __Pyx_AddTraceback("pysam.libctabix.TabixFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14070 __pyx_r = NULL; | |
14071 __Pyx_XGIVEREF(__pyx_r); | |
14072 __Pyx_TraceReturn(__pyx_r, 0); | |
14073 __Pyx_RefNannyFinishContext(); | |
14074 return __pyx_r; | |
14075 } | |
14076 | |
14077 /* "(tree fragment)":3 | |
14078 * def __reduce_cython__(self): | |
14079 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
14080 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
14081 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
14082 */ | |
14083 | |
14084 /* Python wrapper */ | |
14085 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_15__setstate_cython__(PyObject *__pyx_v_self, | |
14086 #if CYTHON_METH_FASTCALL | |
14087 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14088 #else | |
14089 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14090 #endif | |
14091 ); /*proto*/ | |
14092 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_9TabixFile_14__setstate_cython__, "TabixFile.__setstate_cython__(self, __pyx_state)"); | |
14093 static PyMethodDef __pyx_mdef_5pysam_9libctabix_9TabixFile_15__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9TabixFile_15__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_9TabixFile_14__setstate_cython__}; | |
14094 static PyObject *__pyx_pw_5pysam_9libctabix_9TabixFile_15__setstate_cython__(PyObject *__pyx_v_self, | |
14095 #if CYTHON_METH_FASTCALL | |
14096 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14097 #else | |
14098 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14099 #endif | |
14100 ) { | |
14101 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; | |
14102 #if !CYTHON_METH_FASTCALL | |
14103 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
14104 #endif | |
14105 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
14106 PyObject* values[1] = {0}; | |
14107 int __pyx_lineno = 0; | |
14108 const char *__pyx_filename = NULL; | |
14109 int __pyx_clineno = 0; | |
14110 PyObject *__pyx_r = 0; | |
14111 __Pyx_RefNannyDeclarations | |
14112 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
14113 #if !CYTHON_METH_FASTCALL | |
14114 #if CYTHON_ASSUME_SAFE_MACROS | |
14115 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
14116 #else | |
14117 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
14118 #endif | |
14119 #endif | |
14120 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
14121 { | |
14122 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
14123 if (__pyx_kwds) { | |
14124 Py_ssize_t kw_args; | |
14125 switch (__pyx_nargs) { | |
14126 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
14127 CYTHON_FALLTHROUGH; | |
14128 case 0: break; | |
14129 default: goto __pyx_L5_argtuple_error; | |
14130 } | |
14131 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
14132 switch (__pyx_nargs) { | |
14133 case 0: | |
14134 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
14135 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
14136 kw_args--; | |
14137 } | |
14138 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) | |
14139 else goto __pyx_L5_argtuple_error; | |
14140 } | |
14141 if (unlikely(kw_args > 0)) { | |
14142 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
14143 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) | |
14144 } | |
14145 } else if (unlikely(__pyx_nargs != 1)) { | |
14146 goto __pyx_L5_argtuple_error; | |
14147 } else { | |
14148 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
14149 } | |
14150 __pyx_v___pyx_state = values[0]; | |
14151 } | |
14152 goto __pyx_L6_skip; | |
14153 __pyx_L5_argtuple_error:; | |
14154 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) | |
14155 __pyx_L6_skip:; | |
14156 goto __pyx_L4_argument_unpacking_done; | |
14157 __pyx_L3_error:; | |
14158 { | |
14159 Py_ssize_t __pyx_temp; | |
14160 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
14161 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
14162 } | |
14163 } | |
14164 __Pyx_AddTraceback("pysam.libctabix.TabixFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14165 __Pyx_RefNannyFinishContext(); | |
14166 return NULL; | |
14167 __pyx_L4_argument_unpacking_done:; | |
14168 __pyx_r = __pyx_pf_5pysam_9libctabix_9TabixFile_14__setstate_cython__(((struct __pyx_obj_5pysam_9libctabix_TabixFile *)__pyx_v_self), __pyx_v___pyx_state); | |
14169 | |
14170 /* function exit code */ | |
14171 { | |
14172 Py_ssize_t __pyx_temp; | |
14173 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
14174 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
14175 } | |
14176 } | |
14177 __Pyx_RefNannyFinishContext(); | |
14178 return __pyx_r; | |
14179 } | |
14180 | |
14181 static PyObject *__pyx_pf_5pysam_9libctabix_9TabixFile_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_TabixFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { | |
14182 PyObject *__pyx_r = NULL; | |
14183 __Pyx_TraceDeclarations | |
14184 __Pyx_RefNannyDeclarations | |
14185 int __pyx_lineno = 0; | |
14186 const char *__pyx_filename = NULL; | |
14187 int __pyx_clineno = 0; | |
14188 __Pyx_TraceFrameInit(__pyx_codeobj__23) | |
14189 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
14190 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); | |
14191 | |
14192 /* "(tree fragment)":4 | |
14193 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
14194 * def __setstate_cython__(self, __pyx_state): | |
14195 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< | |
14196 */ | |
14197 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); | |
14198 __PYX_ERR(1, 4, __pyx_L1_error) | |
14199 | |
14200 /* "(tree fragment)":3 | |
14201 * def __reduce_cython__(self): | |
14202 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
14203 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
14204 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
14205 */ | |
14206 | |
14207 /* function exit code */ | |
14208 __pyx_L1_error:; | |
14209 __Pyx_AddTraceback("pysam.libctabix.TabixFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14210 __pyx_r = NULL; | |
14211 __Pyx_XGIVEREF(__pyx_r); | |
14212 __Pyx_TraceReturn(__pyx_r, 0); | |
14213 __Pyx_RefNannyFinishContext(); | |
14214 return __pyx_r; | |
14215 } | |
14216 | |
14217 /* "pysam/libctabix.pyx":624 | |
14218 * """ | |
14219 * | |
14220 * def __init__(self, encoding="ascii"): # <<<<<<<<<<<<<< | |
14221 * self.encoding = encoding | |
14222 * | |
14223 */ | |
14224 | |
14225 /* Python wrapper */ | |
14226 static int __pyx_pw_5pysam_9libctabix_13TabixIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
14227 static int __pyx_pw_5pysam_9libctabix_13TabixIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
14228 PyObject *__pyx_v_encoding = 0; | |
14229 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
14230 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
14231 PyObject* values[1] = {0}; | |
14232 int __pyx_lineno = 0; | |
14233 const char *__pyx_filename = NULL; | |
14234 int __pyx_clineno = 0; | |
14235 int __pyx_r; | |
14236 __Pyx_RefNannyDeclarations | |
14237 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); | |
14238 #if CYTHON_ASSUME_SAFE_MACROS | |
14239 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
14240 #else | |
14241 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; | |
14242 #endif | |
14243 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
14244 { | |
14245 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_encoding,0}; | |
14246 values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_u_ascii)); | |
14247 if (__pyx_kwds) { | |
14248 Py_ssize_t kw_args; | |
14249 switch (__pyx_nargs) { | |
14250 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
14251 CYTHON_FALLTHROUGH; | |
14252 case 0: break; | |
14253 default: goto __pyx_L5_argtuple_error; | |
14254 } | |
14255 kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); | |
14256 switch (__pyx_nargs) { | |
14257 case 0: | |
14258 if (kw_args > 0) { | |
14259 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding); | |
14260 if (value) { values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } | |
14261 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L3_error) | |
14262 } | |
14263 } | |
14264 if (unlikely(kw_args > 0)) { | |
14265 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
14266 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 624, __pyx_L3_error) | |
14267 } | |
14268 } else { | |
14269 switch (__pyx_nargs) { | |
14270 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
14271 CYTHON_FALLTHROUGH; | |
14272 case 0: break; | |
14273 default: goto __pyx_L5_argtuple_error; | |
14274 } | |
14275 } | |
14276 __pyx_v_encoding = values[0]; | |
14277 } | |
14278 goto __pyx_L6_skip; | |
14279 __pyx_L5_argtuple_error:; | |
14280 __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 624, __pyx_L3_error) | |
14281 __pyx_L6_skip:; | |
14282 goto __pyx_L4_argument_unpacking_done; | |
14283 __pyx_L3_error:; | |
14284 { | |
14285 Py_ssize_t __pyx_temp; | |
14286 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
14287 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
14288 } | |
14289 } | |
14290 __Pyx_AddTraceback("pysam.libctabix.TabixIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14291 __Pyx_RefNannyFinishContext(); | |
14292 return -1; | |
14293 __pyx_L4_argument_unpacking_done:; | |
14294 __pyx_r = __pyx_pf_5pysam_9libctabix_13TabixIterator___init__(((struct __pyx_obj_5pysam_9libctabix_TabixIterator *)__pyx_v_self), __pyx_v_encoding); | |
14295 | |
14296 /* function exit code */ | |
14297 { | |
14298 Py_ssize_t __pyx_temp; | |
14299 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
14300 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
14301 } | |
14302 } | |
14303 __Pyx_RefNannyFinishContext(); | |
14304 return __pyx_r; | |
14305 } | |
14306 | |
14307 static int __pyx_pf_5pysam_9libctabix_13TabixIterator___init__(struct __pyx_obj_5pysam_9libctabix_TabixIterator *__pyx_v_self, PyObject *__pyx_v_encoding) { | |
14308 int __pyx_r; | |
14309 __Pyx_TraceDeclarations | |
14310 __Pyx_RefNannyDeclarations | |
14311 int __pyx_lineno = 0; | |
14312 const char *__pyx_filename = NULL; | |
14313 int __pyx_clineno = 0; | |
14314 __Pyx_RefNannySetupContext("__init__", 1); | |
14315 __Pyx_TraceCall("__init__", __pyx_f[0], 624, 0, __PYX_ERR(0, 624, __pyx_L1_error)); | |
14316 | |
14317 /* "pysam/libctabix.pyx":625 | |
14318 * | |
14319 * def __init__(self, encoding="ascii"): | |
14320 * self.encoding = encoding # <<<<<<<<<<<<<< | |
14321 * | |
14322 * def __iter__(self): | |
14323 */ | |
14324 __Pyx_INCREF(__pyx_v_encoding); | |
14325 __Pyx_GIVEREF(__pyx_v_encoding); | |
14326 __Pyx_GOTREF(__pyx_v_self->encoding); | |
14327 __Pyx_DECREF(__pyx_v_self->encoding); | |
14328 __pyx_v_self->encoding = __pyx_v_encoding; | |
14329 | |
14330 /* "pysam/libctabix.pyx":624 | |
14331 * """ | |
14332 * | |
14333 * def __init__(self, encoding="ascii"): # <<<<<<<<<<<<<< | |
14334 * self.encoding = encoding | |
14335 * | |
14336 */ | |
14337 | |
14338 /* function exit code */ | |
14339 __pyx_r = 0; | |
14340 goto __pyx_L0; | |
14341 __pyx_L1_error:; | |
14342 __Pyx_AddTraceback("pysam.libctabix.TabixIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14343 __pyx_r = -1; | |
14344 __pyx_L0:; | |
14345 __Pyx_TraceReturn(Py_None, 0); | |
14346 __Pyx_RefNannyFinishContext(); | |
14347 return __pyx_r; | |
14348 } | |
14349 | |
14350 /* "pysam/libctabix.pyx":627 | |
14351 * self.encoding = encoding | |
14352 * | |
14353 * def __iter__(self): # <<<<<<<<<<<<<< | |
14354 * self.buffer.s = NULL | |
14355 * self.buffer.l = 0 | |
14356 */ | |
14357 | |
14358 /* Python wrapper */ | |
14359 static PyObject *__pyx_pw_5pysam_9libctabix_13TabixIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/ | |
14360 static PyObject *__pyx_pw_5pysam_9libctabix_13TabixIterator_3__iter__(PyObject *__pyx_v_self) { | |
14361 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
14362 PyObject *__pyx_r = 0; | |
14363 __Pyx_RefNannyDeclarations | |
14364 __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); | |
14365 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
14366 __pyx_r = __pyx_pf_5pysam_9libctabix_13TabixIterator_2__iter__(((struct __pyx_obj_5pysam_9libctabix_TabixIterator *)__pyx_v_self)); | |
14367 | |
14368 /* function exit code */ | |
14369 __Pyx_RefNannyFinishContext(); | |
14370 return __pyx_r; | |
14371 } | |
14372 | |
14373 static PyObject *__pyx_pf_5pysam_9libctabix_13TabixIterator_2__iter__(struct __pyx_obj_5pysam_9libctabix_TabixIterator *__pyx_v_self) { | |
14374 PyObject *__pyx_r = NULL; | |
14375 __Pyx_TraceDeclarations | |
14376 __Pyx_RefNannyDeclarations | |
14377 int __pyx_lineno = 0; | |
14378 const char *__pyx_filename = NULL; | |
14379 int __pyx_clineno = 0; | |
14380 __Pyx_RefNannySetupContext("__iter__", 1); | |
14381 __Pyx_TraceCall("__iter__", __pyx_f[0], 627, 0, __PYX_ERR(0, 627, __pyx_L1_error)); | |
14382 | |
14383 /* "pysam/libctabix.pyx":628 | |
14384 * | |
14385 * def __iter__(self): | |
14386 * self.buffer.s = NULL # <<<<<<<<<<<<<< | |
14387 * self.buffer.l = 0 | |
14388 * self.buffer.m = 0 | |
14389 */ | |
14390 __pyx_v_self->buffer.s = NULL; | |
14391 | |
14392 /* "pysam/libctabix.pyx":629 | |
14393 * def __iter__(self): | |
14394 * self.buffer.s = NULL | |
14395 * self.buffer.l = 0 # <<<<<<<<<<<<<< | |
14396 * self.buffer.m = 0 | |
14397 * | |
14398 */ | |
14399 __pyx_v_self->buffer.l = 0; | |
14400 | |
14401 /* "pysam/libctabix.pyx":630 | |
14402 * self.buffer.s = NULL | |
14403 * self.buffer.l = 0 | |
14404 * self.buffer.m = 0 # <<<<<<<<<<<<<< | |
14405 * | |
14406 * return self | |
14407 */ | |
14408 __pyx_v_self->buffer.m = 0; | |
14409 | |
14410 /* "pysam/libctabix.pyx":632 | |
14411 * self.buffer.m = 0 | |
14412 * | |
14413 * return self # <<<<<<<<<<<<<< | |
14414 * | |
14415 * cdef int __cnext__(self): | |
14416 */ | |
14417 __Pyx_XDECREF(__pyx_r); | |
14418 __Pyx_INCREF((PyObject *)__pyx_v_self); | |
14419 __pyx_r = ((PyObject *)__pyx_v_self); | |
14420 goto __pyx_L0; | |
14421 | |
14422 /* "pysam/libctabix.pyx":627 | |
14423 * self.encoding = encoding | |
14424 * | |
14425 * def __iter__(self): # <<<<<<<<<<<<<< | |
14426 * self.buffer.s = NULL | |
14427 * self.buffer.l = 0 | |
14428 */ | |
14429 | |
14430 /* function exit code */ | |
14431 __pyx_L1_error:; | |
14432 __Pyx_AddTraceback("pysam.libctabix.TabixIterator.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14433 __pyx_r = NULL; | |
14434 __pyx_L0:; | |
14435 __Pyx_XGIVEREF(__pyx_r); | |
14436 __Pyx_TraceReturn(__pyx_r, 0); | |
14437 __Pyx_RefNannyFinishContext(); | |
14438 return __pyx_r; | |
14439 } | |
14440 | |
14441 /* "pysam/libctabix.pyx":634 | |
14442 * return self | |
14443 * | |
14444 * cdef int __cnext__(self): # <<<<<<<<<<<<<< | |
14445 * '''iterate to next element. | |
14446 * | |
14447 */ | |
14448 | |
14449 static int __pyx_f_5pysam_9libctabix_13TabixIterator___cnext__(struct __pyx_obj_5pysam_9libctabix_TabixIterator *__pyx_v_self) { | |
14450 int __pyx_v_retval; | |
14451 int __pyx_r; | |
14452 __Pyx_TraceDeclarations | |
14453 int __pyx_t_1; | |
14454 int __pyx_lineno = 0; | |
14455 const char *__pyx_filename = NULL; | |
14456 int __pyx_clineno = 0; | |
14457 __Pyx_TraceCall("__cnext__", __pyx_f[0], 634, 0, __PYX_ERR(0, 634, __pyx_L1_error)); | |
14458 | |
14459 /* "pysam/libctabix.pyx":640 | |
14460 * was called. | |
14461 * ''' | |
14462 * if self.tabixfile.htsfile == NULL: # <<<<<<<<<<<<<< | |
14463 * return -5 | |
14464 * | |
14465 */ | |
14466 __pyx_t_1 = (__pyx_v_self->tabixfile->__pyx_base.htsfile == NULL); | |
14467 if (__pyx_t_1) { | |
14468 | |
14469 /* "pysam/libctabix.pyx":641 | |
14470 * ''' | |
14471 * if self.tabixfile.htsfile == NULL: | |
14472 * return -5 # <<<<<<<<<<<<<< | |
14473 * | |
14474 * cdef int retval | |
14475 */ | |
14476 __pyx_r = -5; | |
14477 goto __pyx_L0; | |
14478 | |
14479 /* "pysam/libctabix.pyx":640 | |
14480 * was called. | |
14481 * ''' | |
14482 * if self.tabixfile.htsfile == NULL: # <<<<<<<<<<<<<< | |
14483 * return -5 | |
14484 * | |
14485 */ | |
14486 } | |
14487 | |
14488 /* "pysam/libctabix.pyx":645 | |
14489 * cdef int retval | |
14490 * | |
14491 * while 1: # <<<<<<<<<<<<<< | |
14492 * with nogil: | |
14493 * retval = tbx_itr_next( | |
14494 */ | |
14495 while (1) { | |
14496 | |
14497 /* "pysam/libctabix.pyx":646 | |
14498 * | |
14499 * while 1: | |
14500 * with nogil: # <<<<<<<<<<<<<< | |
14501 * retval = tbx_itr_next( | |
14502 * self.tabixfile.htsfile, | |
14503 */ | |
14504 { | |
14505 #ifdef WITH_THREAD | |
14506 PyThreadState *_save; | |
14507 _save = NULL; | |
14508 Py_UNBLOCK_THREADS | |
14509 __Pyx_FastGIL_Remember(); | |
14510 #endif | |
14511 /*try:*/ { | |
14512 | |
14513 /* "pysam/libctabix.pyx":647 | |
14514 * while 1: | |
14515 * with nogil: | |
14516 * retval = tbx_itr_next( # <<<<<<<<<<<<<< | |
14517 * self.tabixfile.htsfile, | |
14518 * self.tabixfile.index, | |
14519 */ | |
14520 __pyx_v_retval = tbx_itr_next(__pyx_v_self->tabixfile->__pyx_base.htsfile, __pyx_v_self->tabixfile->index, __pyx_v_self->iterator, (&__pyx_v_self->buffer)); | |
14521 } | |
14522 | |
14523 /* "pysam/libctabix.pyx":646 | |
14524 * | |
14525 * while 1: | |
14526 * with nogil: # <<<<<<<<<<<<<< | |
14527 * retval = tbx_itr_next( | |
14528 * self.tabixfile.htsfile, | |
14529 */ | |
14530 /*finally:*/ { | |
14531 /*normal exit:*/{ | |
14532 #ifdef WITH_THREAD | |
14533 __Pyx_FastGIL_Forget(); | |
14534 Py_BLOCK_THREADS | |
14535 #endif | |
14536 goto __pyx_L10; | |
14537 } | |
14538 __pyx_L10:; | |
14539 } | |
14540 } | |
14541 | |
14542 /* "pysam/libctabix.pyx":653 | |
14543 * &self.buffer) | |
14544 * | |
14545 * if retval < 0: # <<<<<<<<<<<<<< | |
14546 * break | |
14547 * | |
14548 */ | |
14549 __pyx_t_1 = (__pyx_v_retval < 0); | |
14550 if (__pyx_t_1) { | |
14551 | |
14552 /* "pysam/libctabix.pyx":654 | |
14553 * | |
14554 * if retval < 0: | |
14555 * break # <<<<<<<<<<<<<< | |
14556 * | |
14557 * if self.buffer.s[0] != b'#': | |
14558 */ | |
14559 goto __pyx_L5_break; | |
14560 | |
14561 /* "pysam/libctabix.pyx":653 | |
14562 * &self.buffer) | |
14563 * | |
14564 * if retval < 0: # <<<<<<<<<<<<<< | |
14565 * break | |
14566 * | |
14567 */ | |
14568 } | |
14569 | |
14570 /* "pysam/libctabix.pyx":656 | |
14571 * break | |
14572 * | |
14573 * if self.buffer.s[0] != b'#': # <<<<<<<<<<<<<< | |
14574 * break | |
14575 * | |
14576 */ | |
14577 __pyx_t_1 = ((__pyx_v_self->buffer.s[0]) != '#'); | |
14578 if (__pyx_t_1) { | |
14579 | |
14580 /* "pysam/libctabix.pyx":657 | |
14581 * | |
14582 * if self.buffer.s[0] != b'#': | |
14583 * break # <<<<<<<<<<<<<< | |
14584 * | |
14585 * return retval | |
14586 */ | |
14587 goto __pyx_L5_break; | |
14588 | |
14589 /* "pysam/libctabix.pyx":656 | |
14590 * break | |
14591 * | |
14592 * if self.buffer.s[0] != b'#': # <<<<<<<<<<<<<< | |
14593 * break | |
14594 * | |
14595 */ | |
14596 } | |
14597 } | |
14598 __pyx_L5_break:; | |
14599 | |
14600 /* "pysam/libctabix.pyx":659 | |
14601 * break | |
14602 * | |
14603 * return retval # <<<<<<<<<<<<<< | |
14604 * | |
14605 * def __next__(self): | |
14606 */ | |
14607 __pyx_r = __pyx_v_retval; | |
14608 goto __pyx_L0; | |
14609 | |
14610 /* "pysam/libctabix.pyx":634 | |
14611 * return self | |
14612 * | |
14613 * cdef int __cnext__(self): # <<<<<<<<<<<<<< | |
14614 * '''iterate to next element. | |
14615 * | |
14616 */ | |
14617 | |
14618 /* function exit code */ | |
14619 __pyx_L1_error:; | |
14620 __Pyx_AddTraceback("pysam.libctabix.TabixIterator.__cnext__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14621 __pyx_r = 0; | |
14622 __pyx_L0:; | |
14623 __Pyx_TraceReturn(Py_None, 0); | |
14624 return __pyx_r; | |
14625 } | |
14626 | |
14627 /* "pysam/libctabix.pyx":661 | |
14628 * return retval | |
14629 * | |
14630 * def __next__(self): # <<<<<<<<<<<<<< | |
14631 * """python version of next(). | |
14632 * | |
14633 */ | |
14634 | |
14635 /* Python wrapper */ | |
14636 static PyObject *__pyx_pw_5pysam_9libctabix_13TabixIterator_5__next__(PyObject *__pyx_v_self); /*proto*/ | |
14637 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_13TabixIterator_4__next__, "python version of next().\n\n pyrex uses this non-standard name instead of next()\n "); | |
14638 #if CYTHON_UPDATE_DESCRIPTOR_DOC | |
14639 struct wrapperbase __pyx_wrapperbase_5pysam_9libctabix_13TabixIterator_4__next__; | |
14640 #endif | |
14641 static PyObject *__pyx_pw_5pysam_9libctabix_13TabixIterator_5__next__(PyObject *__pyx_v_self) { | |
14642 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
14643 PyObject *__pyx_r = 0; | |
14644 __Pyx_RefNannyDeclarations | |
14645 __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); | |
14646 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
14647 __pyx_r = __pyx_pf_5pysam_9libctabix_13TabixIterator_4__next__(((struct __pyx_obj_5pysam_9libctabix_TabixIterator *)__pyx_v_self)); | |
14648 | |
14649 /* function exit code */ | |
14650 __Pyx_RefNannyFinishContext(); | |
14651 return __pyx_r; | |
14652 } | |
14653 | |
14654 static PyObject *__pyx_pf_5pysam_9libctabix_13TabixIterator_4__next__(struct __pyx_obj_5pysam_9libctabix_TabixIterator *__pyx_v_self) { | |
14655 int __pyx_v_retval; | |
14656 PyObject *__pyx_r = NULL; | |
14657 __Pyx_TraceDeclarations | |
14658 __Pyx_RefNannyDeclarations | |
14659 int __pyx_error_without_exception = 0; /* StopIteration */ | |
14660 int __pyx_t_1; | |
14661 int __pyx_t_2; | |
14662 PyObject *__pyx_t_3 = NULL; | |
14663 PyObject *__pyx_t_4 = NULL; | |
14664 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str __pyx_t_5; | |
14665 int __pyx_lineno = 0; | |
14666 const char *__pyx_filename = NULL; | |
14667 int __pyx_clineno = 0; | |
14668 __Pyx_RefNannySetupContext("__next__", 1); | |
14669 __Pyx_TraceCall("__next__", __pyx_f[0], 661, 0, __PYX_ERR(0, 661, __pyx_L1_error)); | |
14670 | |
14671 /* "pysam/libctabix.pyx":667 | |
14672 * """ | |
14673 * | |
14674 * cdef int retval = self.__cnext__() # <<<<<<<<<<<<<< | |
14675 * if retval == -5: | |
14676 * raise IOError("iteration on closed file") | |
14677 */ | |
14678 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_9libctabix_TabixIterator *)__pyx_v_self->__pyx_vtab)->__pyx___cnext__(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 667, __pyx_L1_error) | |
14679 __pyx_v_retval = __pyx_t_1; | |
14680 | |
14681 /* "pysam/libctabix.pyx":668 | |
14682 * | |
14683 * cdef int retval = self.__cnext__() | |
14684 * if retval == -5: # <<<<<<<<<<<<<< | |
14685 * raise IOError("iteration on closed file") | |
14686 * elif retval < 0: | |
14687 */ | |
14688 __pyx_t_2 = (__pyx_v_retval == -5L); | |
14689 if (unlikely(__pyx_t_2)) { | |
14690 | |
14691 /* "pysam/libctabix.pyx":669 | |
14692 * cdef int retval = self.__cnext__() | |
14693 * if retval == -5: | |
14694 * raise IOError("iteration on closed file") # <<<<<<<<<<<<<< | |
14695 * elif retval < 0: | |
14696 * raise StopIteration | |
14697 */ | |
14698 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 669, __pyx_L1_error) | |
14699 __Pyx_GOTREF(__pyx_t_3); | |
14700 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
14701 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14702 __PYX_ERR(0, 669, __pyx_L1_error) | |
14703 | |
14704 /* "pysam/libctabix.pyx":668 | |
14705 * | |
14706 * cdef int retval = self.__cnext__() | |
14707 * if retval == -5: # <<<<<<<<<<<<<< | |
14708 * raise IOError("iteration on closed file") | |
14709 * elif retval < 0: | |
14710 */ | |
14711 } | |
14712 | |
14713 /* "pysam/libctabix.pyx":670 | |
14714 * if retval == -5: | |
14715 * raise IOError("iteration on closed file") | |
14716 * elif retval < 0: # <<<<<<<<<<<<<< | |
14717 * raise StopIteration | |
14718 * | |
14719 */ | |
14720 __pyx_t_2 = (__pyx_v_retval < 0); | |
14721 if (unlikely(__pyx_t_2)) { | |
14722 | |
14723 /* "pysam/libctabix.pyx":671 | |
14724 * raise IOError("iteration on closed file") | |
14725 * elif retval < 0: | |
14726 * raise StopIteration # <<<<<<<<<<<<<< | |
14727 * | |
14728 * return charptr_to_str(self.buffer.s, self.encoding) | |
14729 */ | |
14730 __pyx_error_without_exception = 1; | |
14731 goto __pyx_L1_error;; | |
14732 | |
14733 /* "pysam/libctabix.pyx":670 | |
14734 * if retval == -5: | |
14735 * raise IOError("iteration on closed file") | |
14736 * elif retval < 0: # <<<<<<<<<<<<<< | |
14737 * raise StopIteration | |
14738 * | |
14739 */ | |
14740 } | |
14741 | |
14742 /* "pysam/libctabix.pyx":673 | |
14743 * raise StopIteration | |
14744 * | |
14745 * return charptr_to_str(self.buffer.s, self.encoding) # <<<<<<<<<<<<<< | |
14746 * | |
14747 * def __dealloc__(self): | |
14748 */ | |
14749 __Pyx_XDECREF(__pyx_r); | |
14750 __pyx_t_3 = __pyx_v_self->encoding; | |
14751 __Pyx_INCREF(__pyx_t_3); | |
14752 __pyx_t_5.__pyx_n = 1; | |
14753 __pyx_t_5.encoding = __pyx_t_3; | |
14754 __pyx_t_4 = __pyx_f_5pysam_9libcutils_charptr_to_str(__pyx_v_self->buffer.s, &__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 673, __pyx_L1_error) | |
14755 __Pyx_GOTREF(__pyx_t_4); | |
14756 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14757 __pyx_r = __pyx_t_4; | |
14758 __pyx_t_4 = 0; | |
14759 goto __pyx_L0; | |
14760 | |
14761 /* "pysam/libctabix.pyx":661 | |
14762 * return retval | |
14763 * | |
14764 * def __next__(self): # <<<<<<<<<<<<<< | |
14765 * """python version of next(). | |
14766 * | |
14767 */ | |
14768 | |
14769 /* function exit code */ | |
14770 __pyx_L1_error:; | |
14771 __Pyx_XDECREF(__pyx_t_3); | |
14772 __Pyx_XDECREF(__pyx_t_4); | |
14773 if (!__pyx_error_without_exception) { | |
14774 __Pyx_AddTraceback("pysam.libctabix.TabixIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14775 } | |
14776 __pyx_r = NULL; | |
14777 __pyx_L0:; | |
14778 __Pyx_XGIVEREF(__pyx_r); | |
14779 __Pyx_TraceReturn(__pyx_r, 0); | |
14780 __Pyx_RefNannyFinishContext(); | |
14781 return __pyx_r; | |
14782 } | |
14783 | |
14784 /* "pysam/libctabix.pyx":675 | |
14785 * return charptr_to_str(self.buffer.s, self.encoding) | |
14786 * | |
14787 * def __dealloc__(self): # <<<<<<<<<<<<<< | |
14788 * if <void*>self.iterator != NULL: | |
14789 * tbx_itr_destroy(self.iterator) | |
14790 */ | |
14791 | |
14792 /* Python wrapper */ | |
14793 static void __pyx_pw_5pysam_9libctabix_13TabixIterator_7__dealloc__(PyObject *__pyx_v_self); /*proto*/ | |
14794 static void __pyx_pw_5pysam_9libctabix_13TabixIterator_7__dealloc__(PyObject *__pyx_v_self) { | |
14795 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
14796 __Pyx_RefNannyDeclarations | |
14797 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); | |
14798 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
14799 __pyx_pf_5pysam_9libctabix_13TabixIterator_6__dealloc__(((struct __pyx_obj_5pysam_9libctabix_TabixIterator *)__pyx_v_self)); | |
14800 | |
14801 /* function exit code */ | |
14802 __Pyx_RefNannyFinishContext(); | |
14803 } | |
14804 | |
14805 static void __pyx_pf_5pysam_9libctabix_13TabixIterator_6__dealloc__(struct __pyx_obj_5pysam_9libctabix_TabixIterator *__pyx_v_self) { | |
14806 __Pyx_TraceDeclarations | |
14807 int __pyx_t_1; | |
14808 int __pyx_lineno = 0; | |
14809 const char *__pyx_filename = NULL; | |
14810 int __pyx_clineno = 0; | |
14811 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 675, 0, __PYX_ERR(0, 675, __pyx_L1_error)); | |
14812 | |
14813 /* "pysam/libctabix.pyx":676 | |
14814 * | |
14815 * def __dealloc__(self): | |
14816 * if <void*>self.iterator != NULL: # <<<<<<<<<<<<<< | |
14817 * tbx_itr_destroy(self.iterator) | |
14818 * if self.buffer.s != NULL: | |
14819 */ | |
14820 __pyx_t_1 = (((void *)__pyx_v_self->iterator) != NULL); | |
14821 if (__pyx_t_1) { | |
14822 | |
14823 /* "pysam/libctabix.pyx":677 | |
14824 * def __dealloc__(self): | |
14825 * if <void*>self.iterator != NULL: | |
14826 * tbx_itr_destroy(self.iterator) # <<<<<<<<<<<<<< | |
14827 * if self.buffer.s != NULL: | |
14828 * free(self.buffer.s) | |
14829 */ | |
14830 tbx_itr_destroy(__pyx_v_self->iterator); | |
14831 | |
14832 /* "pysam/libctabix.pyx":676 | |
14833 * | |
14834 * def __dealloc__(self): | |
14835 * if <void*>self.iterator != NULL: # <<<<<<<<<<<<<< | |
14836 * tbx_itr_destroy(self.iterator) | |
14837 * if self.buffer.s != NULL: | |
14838 */ | |
14839 } | |
14840 | |
14841 /* "pysam/libctabix.pyx":678 | |
14842 * if <void*>self.iterator != NULL: | |
14843 * tbx_itr_destroy(self.iterator) | |
14844 * if self.buffer.s != NULL: # <<<<<<<<<<<<<< | |
14845 * free(self.buffer.s) | |
14846 * | |
14847 */ | |
14848 __pyx_t_1 = (__pyx_v_self->buffer.s != NULL); | |
14849 if (__pyx_t_1) { | |
14850 | |
14851 /* "pysam/libctabix.pyx":679 | |
14852 * tbx_itr_destroy(self.iterator) | |
14853 * if self.buffer.s != NULL: | |
14854 * free(self.buffer.s) # <<<<<<<<<<<<<< | |
14855 * | |
14856 * | |
14857 */ | |
14858 free(__pyx_v_self->buffer.s); | |
14859 | |
14860 /* "pysam/libctabix.pyx":678 | |
14861 * if <void*>self.iterator != NULL: | |
14862 * tbx_itr_destroy(self.iterator) | |
14863 * if self.buffer.s != NULL: # <<<<<<<<<<<<<< | |
14864 * free(self.buffer.s) | |
14865 * | |
14866 */ | |
14867 } | |
14868 | |
14869 /* "pysam/libctabix.pyx":675 | |
14870 * return charptr_to_str(self.buffer.s, self.encoding) | |
14871 * | |
14872 * def __dealloc__(self): # <<<<<<<<<<<<<< | |
14873 * if <void*>self.iterator != NULL: | |
14874 * tbx_itr_destroy(self.iterator) | |
14875 */ | |
14876 | |
14877 /* function exit code */ | |
14878 goto __pyx_L0; | |
14879 __pyx_L1_error:; | |
14880 __Pyx_WriteUnraisable("pysam.libctabix.TabixIterator.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); | |
14881 __pyx_L0:; | |
14882 __Pyx_TraceReturn(Py_None, 0); | |
14883 } | |
14884 | |
14885 /* "(tree fragment)":1 | |
14886 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
14887 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
14888 * def __setstate_cython__(self, __pyx_state): | |
14889 */ | |
14890 | |
14891 /* Python wrapper */ | |
14892 static PyObject *__pyx_pw_5pysam_9libctabix_13TabixIterator_9__reduce_cython__(PyObject *__pyx_v_self, | |
14893 #if CYTHON_METH_FASTCALL | |
14894 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14895 #else | |
14896 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14897 #endif | |
14898 ); /*proto*/ | |
14899 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_13TabixIterator_8__reduce_cython__, "TabixIterator.__reduce_cython__(self)"); | |
14900 static PyMethodDef __pyx_mdef_5pysam_9libctabix_13TabixIterator_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_13TabixIterator_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_13TabixIterator_8__reduce_cython__}; | |
14901 static PyObject *__pyx_pw_5pysam_9libctabix_13TabixIterator_9__reduce_cython__(PyObject *__pyx_v_self, | |
14902 #if CYTHON_METH_FASTCALL | |
14903 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14904 #else | |
14905 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14906 #endif | |
14907 ) { | |
14908 #if !CYTHON_METH_FASTCALL | |
14909 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
14910 #endif | |
14911 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
14912 PyObject *__pyx_r = 0; | |
14913 __Pyx_RefNannyDeclarations | |
14914 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
14915 #if !CYTHON_METH_FASTCALL | |
14916 #if CYTHON_ASSUME_SAFE_MACROS | |
14917 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
14918 #else | |
14919 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
14920 #endif | |
14921 #endif | |
14922 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
14923 if (unlikely(__pyx_nargs > 0)) { | |
14924 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
14925 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
14926 __pyx_r = __pyx_pf_5pysam_9libctabix_13TabixIterator_8__reduce_cython__(((struct __pyx_obj_5pysam_9libctabix_TabixIterator *)__pyx_v_self)); | |
14927 | |
14928 /* function exit code */ | |
14929 __Pyx_RefNannyFinishContext(); | |
14930 return __pyx_r; | |
14931 } | |
14932 | |
14933 static PyObject *__pyx_pf_5pysam_9libctabix_13TabixIterator_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_TabixIterator *__pyx_v_self) { | |
14934 PyObject *__pyx_r = NULL; | |
14935 __Pyx_TraceDeclarations | |
14936 __Pyx_RefNannyDeclarations | |
14937 int __pyx_lineno = 0; | |
14938 const char *__pyx_filename = NULL; | |
14939 int __pyx_clineno = 0; | |
14940 __Pyx_TraceFrameInit(__pyx_codeobj__25) | |
14941 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
14942 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
14943 | |
14944 /* "(tree fragment)":2 | |
14945 * def __reduce_cython__(self): | |
14946 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< | |
14947 * def __setstate_cython__(self, __pyx_state): | |
14948 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
14949 */ | |
14950 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_iterator_cannot_be_converte, 0, 0); | |
14951 __PYX_ERR(1, 2, __pyx_L1_error) | |
14952 | |
14953 /* "(tree fragment)":1 | |
14954 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
14955 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
14956 * def __setstate_cython__(self, __pyx_state): | |
14957 */ | |
14958 | |
14959 /* function exit code */ | |
14960 __pyx_L1_error:; | |
14961 __Pyx_AddTraceback("pysam.libctabix.TabixIterator.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14962 __pyx_r = NULL; | |
14963 __Pyx_XGIVEREF(__pyx_r); | |
14964 __Pyx_TraceReturn(__pyx_r, 0); | |
14965 __Pyx_RefNannyFinishContext(); | |
14966 return __pyx_r; | |
14967 } | |
14968 | |
14969 /* "(tree fragment)":3 | |
14970 * def __reduce_cython__(self): | |
14971 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
14972 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
14973 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
14974 */ | |
14975 | |
14976 /* Python wrapper */ | |
14977 static PyObject *__pyx_pw_5pysam_9libctabix_13TabixIterator_11__setstate_cython__(PyObject *__pyx_v_self, | |
14978 #if CYTHON_METH_FASTCALL | |
14979 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14980 #else | |
14981 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14982 #endif | |
14983 ); /*proto*/ | |
14984 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_13TabixIterator_10__setstate_cython__, "TabixIterator.__setstate_cython__(self, __pyx_state)"); | |
14985 static PyMethodDef __pyx_mdef_5pysam_9libctabix_13TabixIterator_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_13TabixIterator_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_13TabixIterator_10__setstate_cython__}; | |
14986 static PyObject *__pyx_pw_5pysam_9libctabix_13TabixIterator_11__setstate_cython__(PyObject *__pyx_v_self, | |
14987 #if CYTHON_METH_FASTCALL | |
14988 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14989 #else | |
14990 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14991 #endif | |
14992 ) { | |
14993 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; | |
14994 #if !CYTHON_METH_FASTCALL | |
14995 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
14996 #endif | |
14997 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
14998 PyObject* values[1] = {0}; | |
14999 int __pyx_lineno = 0; | |
15000 const char *__pyx_filename = NULL; | |
15001 int __pyx_clineno = 0; | |
15002 PyObject *__pyx_r = 0; | |
15003 __Pyx_RefNannyDeclarations | |
15004 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
15005 #if !CYTHON_METH_FASTCALL | |
15006 #if CYTHON_ASSUME_SAFE_MACROS | |
15007 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
15008 #else | |
15009 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
15010 #endif | |
15011 #endif | |
15012 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
15013 { | |
15014 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
15015 if (__pyx_kwds) { | |
15016 Py_ssize_t kw_args; | |
15017 switch (__pyx_nargs) { | |
15018 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
15019 CYTHON_FALLTHROUGH; | |
15020 case 0: break; | |
15021 default: goto __pyx_L5_argtuple_error; | |
15022 } | |
15023 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
15024 switch (__pyx_nargs) { | |
15025 case 0: | |
15026 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
15027 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
15028 kw_args--; | |
15029 } | |
15030 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) | |
15031 else goto __pyx_L5_argtuple_error; | |
15032 } | |
15033 if (unlikely(kw_args > 0)) { | |
15034 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
15035 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) | |
15036 } | |
15037 } else if (unlikely(__pyx_nargs != 1)) { | |
15038 goto __pyx_L5_argtuple_error; | |
15039 } else { | |
15040 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
15041 } | |
15042 __pyx_v___pyx_state = values[0]; | |
15043 } | |
15044 goto __pyx_L6_skip; | |
15045 __pyx_L5_argtuple_error:; | |
15046 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) | |
15047 __pyx_L6_skip:; | |
15048 goto __pyx_L4_argument_unpacking_done; | |
15049 __pyx_L3_error:; | |
15050 { | |
15051 Py_ssize_t __pyx_temp; | |
15052 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
15053 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
15054 } | |
15055 } | |
15056 __Pyx_AddTraceback("pysam.libctabix.TabixIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15057 __Pyx_RefNannyFinishContext(); | |
15058 return NULL; | |
15059 __pyx_L4_argument_unpacking_done:; | |
15060 __pyx_r = __pyx_pf_5pysam_9libctabix_13TabixIterator_10__setstate_cython__(((struct __pyx_obj_5pysam_9libctabix_TabixIterator *)__pyx_v_self), __pyx_v___pyx_state); | |
15061 | |
15062 /* function exit code */ | |
15063 { | |
15064 Py_ssize_t __pyx_temp; | |
15065 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
15066 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
15067 } | |
15068 } | |
15069 __Pyx_RefNannyFinishContext(); | |
15070 return __pyx_r; | |
15071 } | |
15072 | |
15073 static PyObject *__pyx_pf_5pysam_9libctabix_13TabixIterator_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_TabixIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { | |
15074 PyObject *__pyx_r = NULL; | |
15075 __Pyx_TraceDeclarations | |
15076 __Pyx_RefNannyDeclarations | |
15077 int __pyx_lineno = 0; | |
15078 const char *__pyx_filename = NULL; | |
15079 int __pyx_clineno = 0; | |
15080 __Pyx_TraceFrameInit(__pyx_codeobj__26) | |
15081 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
15082 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); | |
15083 | |
15084 /* "(tree fragment)":4 | |
15085 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
15086 * def __setstate_cython__(self, __pyx_state): | |
15087 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< | |
15088 */ | |
15089 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_iterator_cannot_be_converte, 0, 0); | |
15090 __PYX_ERR(1, 4, __pyx_L1_error) | |
15091 | |
15092 /* "(tree fragment)":3 | |
15093 * def __reduce_cython__(self): | |
15094 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
15095 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
15096 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
15097 */ | |
15098 | |
15099 /* function exit code */ | |
15100 __pyx_L1_error:; | |
15101 __Pyx_AddTraceback("pysam.libctabix.TabixIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15102 __pyx_r = NULL; | |
15103 __Pyx_XGIVEREF(__pyx_r); | |
15104 __Pyx_TraceReturn(__pyx_r, 0); | |
15105 __Pyx_RefNannyFinishContext(); | |
15106 return __pyx_r; | |
15107 } | |
15108 | |
15109 /* "pysam/libctabix.pyx":685 | |
15110 * '''empty iterator''' | |
15111 * | |
15112 * def __iter__(self): # <<<<<<<<<<<<<< | |
15113 * return self | |
15114 * | |
15115 */ | |
15116 | |
15117 /* Python wrapper */ | |
15118 static PyObject *__pyx_pw_5pysam_9libctabix_13EmptyIterator_1__iter__(PyObject *__pyx_self, | |
15119 #if CYTHON_METH_FASTCALL | |
15120 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
15121 #else | |
15122 PyObject *__pyx_args, PyObject *__pyx_kwds | |
15123 #endif | |
15124 ); /*proto*/ | |
15125 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_13EmptyIterator___iter__, "EmptyIterator.__iter__(self)"); | |
15126 static PyMethodDef __pyx_mdef_5pysam_9libctabix_13EmptyIterator_1__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_13EmptyIterator_1__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_13EmptyIterator___iter__}; | |
15127 static PyObject *__pyx_pw_5pysam_9libctabix_13EmptyIterator_1__iter__(PyObject *__pyx_self, | |
15128 #if CYTHON_METH_FASTCALL | |
15129 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
15130 #else | |
15131 PyObject *__pyx_args, PyObject *__pyx_kwds | |
15132 #endif | |
15133 ) { | |
15134 PyObject *__pyx_v_self = 0; | |
15135 #if !CYTHON_METH_FASTCALL | |
15136 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
15137 #endif | |
15138 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
15139 PyObject* values[1] = {0}; | |
15140 int __pyx_lineno = 0; | |
15141 const char *__pyx_filename = NULL; | |
15142 int __pyx_clineno = 0; | |
15143 PyObject *__pyx_r = 0; | |
15144 __Pyx_RefNannyDeclarations | |
15145 __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); | |
15146 #if !CYTHON_METH_FASTCALL | |
15147 #if CYTHON_ASSUME_SAFE_MACROS | |
15148 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
15149 #else | |
15150 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
15151 #endif | |
15152 #endif | |
15153 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
15154 { | |
15155 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; | |
15156 if (__pyx_kwds) { | |
15157 Py_ssize_t kw_args; | |
15158 switch (__pyx_nargs) { | |
15159 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
15160 CYTHON_FALLTHROUGH; | |
15161 case 0: break; | |
15162 default: goto __pyx_L5_argtuple_error; | |
15163 } | |
15164 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
15165 switch (__pyx_nargs) { | |
15166 case 0: | |
15167 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
15168 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
15169 kw_args--; | |
15170 } | |
15171 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 685, __pyx_L3_error) | |
15172 else goto __pyx_L5_argtuple_error; | |
15173 } | |
15174 if (unlikely(kw_args > 0)) { | |
15175 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
15176 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 685, __pyx_L3_error) | |
15177 } | |
15178 } else if (unlikely(__pyx_nargs != 1)) { | |
15179 goto __pyx_L5_argtuple_error; | |
15180 } else { | |
15181 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
15182 } | |
15183 __pyx_v_self = values[0]; | |
15184 } | |
15185 goto __pyx_L6_skip; | |
15186 __pyx_L5_argtuple_error:; | |
15187 __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 685, __pyx_L3_error) | |
15188 __pyx_L6_skip:; | |
15189 goto __pyx_L4_argument_unpacking_done; | |
15190 __pyx_L3_error:; | |
15191 { | |
15192 Py_ssize_t __pyx_temp; | |
15193 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
15194 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
15195 } | |
15196 } | |
15197 __Pyx_AddTraceback("pysam.libctabix.EmptyIterator.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15198 __Pyx_RefNannyFinishContext(); | |
15199 return NULL; | |
15200 __pyx_L4_argument_unpacking_done:; | |
15201 __pyx_r = __pyx_pf_5pysam_9libctabix_13EmptyIterator___iter__(__pyx_self, __pyx_v_self); | |
15202 | |
15203 /* function exit code */ | |
15204 { | |
15205 Py_ssize_t __pyx_temp; | |
15206 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
15207 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
15208 } | |
15209 } | |
15210 __Pyx_RefNannyFinishContext(); | |
15211 return __pyx_r; | |
15212 } | |
15213 | |
15214 static PyObject *__pyx_pf_5pysam_9libctabix_13EmptyIterator___iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { | |
15215 PyObject *__pyx_r = NULL; | |
15216 __Pyx_TraceDeclarations | |
15217 __Pyx_RefNannyDeclarations | |
15218 int __pyx_lineno = 0; | |
15219 const char *__pyx_filename = NULL; | |
15220 int __pyx_clineno = 0; | |
15221 __Pyx_TraceFrameInit(__pyx_codeobj__27) | |
15222 __Pyx_RefNannySetupContext("__iter__", 1); | |
15223 __Pyx_TraceCall("__iter__", __pyx_f[0], 685, 0, __PYX_ERR(0, 685, __pyx_L1_error)); | |
15224 | |
15225 /* "pysam/libctabix.pyx":686 | |
15226 * | |
15227 * def __iter__(self): | |
15228 * return self # <<<<<<<<<<<<<< | |
15229 * | |
15230 * def __next__(self): | |
15231 */ | |
15232 __Pyx_XDECREF(__pyx_r); | |
15233 __Pyx_INCREF(__pyx_v_self); | |
15234 __pyx_r = __pyx_v_self; | |
15235 goto __pyx_L0; | |
15236 | |
15237 /* "pysam/libctabix.pyx":685 | |
15238 * '''empty iterator''' | |
15239 * | |
15240 * def __iter__(self): # <<<<<<<<<<<<<< | |
15241 * return self | |
15242 * | |
15243 */ | |
15244 | |
15245 /* function exit code */ | |
15246 __pyx_L1_error:; | |
15247 __Pyx_AddTraceback("pysam.libctabix.EmptyIterator.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15248 __pyx_r = NULL; | |
15249 __pyx_L0:; | |
15250 __Pyx_XGIVEREF(__pyx_r); | |
15251 __Pyx_TraceReturn(__pyx_r, 0); | |
15252 __Pyx_RefNannyFinishContext(); | |
15253 return __pyx_r; | |
15254 } | |
15255 | |
15256 /* "pysam/libctabix.pyx":688 | |
15257 * return self | |
15258 * | |
15259 * def __next__(self): # <<<<<<<<<<<<<< | |
15260 * raise StopIteration() | |
15261 * | |
15262 */ | |
15263 | |
15264 /* Python wrapper */ | |
15265 static PyObject *__pyx_pw_5pysam_9libctabix_13EmptyIterator_3__next__(PyObject *__pyx_self, | |
15266 #if CYTHON_METH_FASTCALL | |
15267 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
15268 #else | |
15269 PyObject *__pyx_args, PyObject *__pyx_kwds | |
15270 #endif | |
15271 ); /*proto*/ | |
15272 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_13EmptyIterator_2__next__, "EmptyIterator.__next__(self)"); | |
15273 static PyMethodDef __pyx_mdef_5pysam_9libctabix_13EmptyIterator_3__next__ = {"__next__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_13EmptyIterator_3__next__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_13EmptyIterator_2__next__}; | |
15274 static PyObject *__pyx_pw_5pysam_9libctabix_13EmptyIterator_3__next__(PyObject *__pyx_self, | |
15275 #if CYTHON_METH_FASTCALL | |
15276 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
15277 #else | |
15278 PyObject *__pyx_args, PyObject *__pyx_kwds | |
15279 #endif | |
15280 ) { | |
15281 CYTHON_UNUSED PyObject *__pyx_v_self = 0; | |
15282 #if !CYTHON_METH_FASTCALL | |
15283 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
15284 #endif | |
15285 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
15286 PyObject* values[1] = {0}; | |
15287 int __pyx_lineno = 0; | |
15288 const char *__pyx_filename = NULL; | |
15289 int __pyx_clineno = 0; | |
15290 PyObject *__pyx_r = 0; | |
15291 __Pyx_RefNannyDeclarations | |
15292 __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); | |
15293 #if !CYTHON_METH_FASTCALL | |
15294 #if CYTHON_ASSUME_SAFE_MACROS | |
15295 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
15296 #else | |
15297 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
15298 #endif | |
15299 #endif | |
15300 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
15301 { | |
15302 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; | |
15303 if (__pyx_kwds) { | |
15304 Py_ssize_t kw_args; | |
15305 switch (__pyx_nargs) { | |
15306 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
15307 CYTHON_FALLTHROUGH; | |
15308 case 0: break; | |
15309 default: goto __pyx_L5_argtuple_error; | |
15310 } | |
15311 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
15312 switch (__pyx_nargs) { | |
15313 case 0: | |
15314 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
15315 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
15316 kw_args--; | |
15317 } | |
15318 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L3_error) | |
15319 else goto __pyx_L5_argtuple_error; | |
15320 } | |
15321 if (unlikely(kw_args > 0)) { | |
15322 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
15323 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__next__") < 0)) __PYX_ERR(0, 688, __pyx_L3_error) | |
15324 } | |
15325 } else if (unlikely(__pyx_nargs != 1)) { | |
15326 goto __pyx_L5_argtuple_error; | |
15327 } else { | |
15328 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
15329 } | |
15330 __pyx_v_self = values[0]; | |
15331 } | |
15332 goto __pyx_L6_skip; | |
15333 __pyx_L5_argtuple_error:; | |
15334 __Pyx_RaiseArgtupleInvalid("__next__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 688, __pyx_L3_error) | |
15335 __pyx_L6_skip:; | |
15336 goto __pyx_L4_argument_unpacking_done; | |
15337 __pyx_L3_error:; | |
15338 { | |
15339 Py_ssize_t __pyx_temp; | |
15340 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
15341 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
15342 } | |
15343 } | |
15344 __Pyx_AddTraceback("pysam.libctabix.EmptyIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15345 __Pyx_RefNannyFinishContext(); | |
15346 return NULL; | |
15347 __pyx_L4_argument_unpacking_done:; | |
15348 __pyx_r = __pyx_pf_5pysam_9libctabix_13EmptyIterator_2__next__(__pyx_self, __pyx_v_self); | |
15349 | |
15350 /* function exit code */ | |
15351 { | |
15352 Py_ssize_t __pyx_temp; | |
15353 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
15354 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
15355 } | |
15356 } | |
15357 __Pyx_RefNannyFinishContext(); | |
15358 return __pyx_r; | |
15359 } | |
15360 | |
15361 static PyObject *__pyx_pf_5pysam_9libctabix_13EmptyIterator_2__next__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { | |
15362 PyObject *__pyx_r = NULL; | |
15363 __Pyx_TraceDeclarations | |
15364 __Pyx_RefNannyDeclarations | |
15365 PyObject *__pyx_t_1 = NULL; | |
15366 int __pyx_lineno = 0; | |
15367 const char *__pyx_filename = NULL; | |
15368 int __pyx_clineno = 0; | |
15369 __Pyx_TraceFrameInit(__pyx_codeobj__28) | |
15370 __Pyx_RefNannySetupContext("__next__", 1); | |
15371 __Pyx_TraceCall("__next__", __pyx_f[0], 688, 0, __PYX_ERR(0, 688, __pyx_L1_error)); | |
15372 | |
15373 /* "pysam/libctabix.pyx":689 | |
15374 * | |
15375 * def __next__(self): | |
15376 * raise StopIteration() # <<<<<<<<<<<<<< | |
15377 * | |
15378 * | |
15379 */ | |
15380 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) | |
15381 __Pyx_GOTREF(__pyx_t_1); | |
15382 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
15383 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15384 __PYX_ERR(0, 689, __pyx_L1_error) | |
15385 | |
15386 /* "pysam/libctabix.pyx":688 | |
15387 * return self | |
15388 * | |
15389 * def __next__(self): # <<<<<<<<<<<<<< | |
15390 * raise StopIteration() | |
15391 * | |
15392 */ | |
15393 | |
15394 /* function exit code */ | |
15395 __pyx_L1_error:; | |
15396 __Pyx_XDECREF(__pyx_t_1); | |
15397 __Pyx_AddTraceback("pysam.libctabix.EmptyIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15398 __pyx_r = NULL; | |
15399 __Pyx_XGIVEREF(__pyx_r); | |
15400 __Pyx_TraceReturn(__pyx_r, 0); | |
15401 __Pyx_RefNannyFinishContext(); | |
15402 return __pyx_r; | |
15403 } | |
15404 | |
15405 /* "pysam/libctabix.pyx":700 | |
15406 * """ | |
15407 * | |
15408 * def __init__(self, Parser parser): # <<<<<<<<<<<<<< | |
15409 * super().__init__() | |
15410 * self.parser = parser | |
15411 */ | |
15412 | |
15413 /* Python wrapper */ | |
15414 static int __pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
15415 static int __pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
15416 struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_parser = 0; | |
15417 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
15418 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
15419 PyObject* values[1] = {0}; | |
15420 int __pyx_lineno = 0; | |
15421 const char *__pyx_filename = NULL; | |
15422 int __pyx_clineno = 0; | |
15423 int __pyx_r; | |
15424 __Pyx_RefNannyDeclarations | |
15425 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); | |
15426 #if CYTHON_ASSUME_SAFE_MACROS | |
15427 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
15428 #else | |
15429 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; | |
15430 #endif | |
15431 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
15432 { | |
15433 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_parser,0}; | |
15434 if (__pyx_kwds) { | |
15435 Py_ssize_t kw_args; | |
15436 switch (__pyx_nargs) { | |
15437 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
15438 CYTHON_FALLTHROUGH; | |
15439 case 0: break; | |
15440 default: goto __pyx_L5_argtuple_error; | |
15441 } | |
15442 kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); | |
15443 switch (__pyx_nargs) { | |
15444 case 0: | |
15445 if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_parser)) != 0)) { | |
15446 (void)__Pyx_Arg_NewRef_VARARGS(values[0]); | |
15447 kw_args--; | |
15448 } | |
15449 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L3_error) | |
15450 else goto __pyx_L5_argtuple_error; | |
15451 } | |
15452 if (unlikely(kw_args > 0)) { | |
15453 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
15454 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 700, __pyx_L3_error) | |
15455 } | |
15456 } else if (unlikely(__pyx_nargs != 1)) { | |
15457 goto __pyx_L5_argtuple_error; | |
15458 } else { | |
15459 values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
15460 } | |
15461 __pyx_v_parser = ((struct __pyx_obj_5pysam_9libctabix_Parser *)values[0]); | |
15462 } | |
15463 goto __pyx_L6_skip; | |
15464 __pyx_L5_argtuple_error:; | |
15465 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 700, __pyx_L3_error) | |
15466 __pyx_L6_skip:; | |
15467 goto __pyx_L4_argument_unpacking_done; | |
15468 __pyx_L3_error:; | |
15469 { | |
15470 Py_ssize_t __pyx_temp; | |
15471 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
15472 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
15473 } | |
15474 } | |
15475 __Pyx_AddTraceback("pysam.libctabix.TabixIteratorParsed.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15476 __Pyx_RefNannyFinishContext(); | |
15477 return -1; | |
15478 __pyx_L4_argument_unpacking_done:; | |
15479 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_5pysam_9libctabix_Parser, 1, "parser", 0))) __PYX_ERR(0, 700, __pyx_L1_error) | |
15480 __pyx_r = __pyx_pf_5pysam_9libctabix_19TabixIteratorParsed___init__(((struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *)__pyx_v_self), __pyx_v_parser); | |
15481 | |
15482 /* function exit code */ | |
15483 goto __pyx_L0; | |
15484 __pyx_L1_error:; | |
15485 __pyx_r = -1; | |
15486 __pyx_L0:; | |
15487 { | |
15488 Py_ssize_t __pyx_temp; | |
15489 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
15490 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
15491 } | |
15492 } | |
15493 __Pyx_RefNannyFinishContext(); | |
15494 return __pyx_r; | |
15495 } | |
15496 | |
15497 static int __pyx_pf_5pysam_9libctabix_19TabixIteratorParsed___init__(struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *__pyx_v_self, struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_parser) { | |
15498 int __pyx_r; | |
15499 __Pyx_TraceDeclarations | |
15500 __Pyx_RefNannyDeclarations | |
15501 PyObject *__pyx_t_1 = NULL; | |
15502 PyObject *__pyx_t_2 = NULL; | |
15503 PyObject *__pyx_t_3 = NULL; | |
15504 unsigned int __pyx_t_4; | |
15505 int __pyx_lineno = 0; | |
15506 const char *__pyx_filename = NULL; | |
15507 int __pyx_clineno = 0; | |
15508 __Pyx_RefNannySetupContext("__init__", 1); | |
15509 __Pyx_TraceCall("__init__", __pyx_f[0], 700, 0, __PYX_ERR(0, 700, __pyx_L1_error)); | |
15510 | |
15511 /* "pysam/libctabix.pyx":701 | |
15512 * | |
15513 * def __init__(self, Parser parser): | |
15514 * super().__init__() # <<<<<<<<<<<<<< | |
15515 * self.parser = parser | |
15516 * | |
15517 */ | |
15518 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error) | |
15519 __Pyx_GOTREF(__pyx_t_2); | |
15520 __Pyx_INCREF((PyObject *)__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed); | |
15521 __Pyx_GIVEREF((PyObject *)__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed); | |
15522 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed))) __PYX_ERR(0, 701, __pyx_L1_error); | |
15523 __Pyx_INCREF((PyObject *)__pyx_v_self); | |
15524 __Pyx_GIVEREF((PyObject *)__pyx_v_self); | |
15525 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 701, __pyx_L1_error); | |
15526 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error) | |
15527 __Pyx_GOTREF(__pyx_t_3); | |
15528 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
15529 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error) | |
15530 __Pyx_GOTREF(__pyx_t_2); | |
15531 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15532 __pyx_t_3 = NULL; | |
15533 __pyx_t_4 = 0; | |
15534 #if CYTHON_UNPACK_METHODS | |
15535 if (likely(PyMethod_Check(__pyx_t_2))) { | |
15536 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
15537 if (likely(__pyx_t_3)) { | |
15538 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
15539 __Pyx_INCREF(__pyx_t_3); | |
15540 __Pyx_INCREF(function); | |
15541 __Pyx_DECREF_SET(__pyx_t_2, function); | |
15542 __pyx_t_4 = 1; | |
15543 } | |
15544 } | |
15545 #endif | |
15546 { | |
15547 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
15548 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
15549 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15550 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error) | |
15551 __Pyx_GOTREF(__pyx_t_1); | |
15552 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
15553 } | |
15554 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15555 | |
15556 /* "pysam/libctabix.pyx":702 | |
15557 * def __init__(self, Parser parser): | |
15558 * super().__init__() | |
15559 * self.parser = parser # <<<<<<<<<<<<<< | |
15560 * | |
15561 * def __next__(self): | |
15562 */ | |
15563 __Pyx_INCREF((PyObject *)__pyx_v_parser); | |
15564 __Pyx_GIVEREF((PyObject *)__pyx_v_parser); | |
15565 __Pyx_GOTREF((PyObject *)__pyx_v_self->parser); | |
15566 __Pyx_DECREF((PyObject *)__pyx_v_self->parser); | |
15567 __pyx_v_self->parser = __pyx_v_parser; | |
15568 | |
15569 /* "pysam/libctabix.pyx":700 | |
15570 * """ | |
15571 * | |
15572 * def __init__(self, Parser parser): # <<<<<<<<<<<<<< | |
15573 * super().__init__() | |
15574 * self.parser = parser | |
15575 */ | |
15576 | |
15577 /* function exit code */ | |
15578 __pyx_r = 0; | |
15579 goto __pyx_L0; | |
15580 __pyx_L1_error:; | |
15581 __Pyx_XDECREF(__pyx_t_1); | |
15582 __Pyx_XDECREF(__pyx_t_2); | |
15583 __Pyx_XDECREF(__pyx_t_3); | |
15584 __Pyx_AddTraceback("pysam.libctabix.TabixIteratorParsed.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15585 __pyx_r = -1; | |
15586 __pyx_L0:; | |
15587 __Pyx_TraceReturn(Py_None, 0); | |
15588 __Pyx_RefNannyFinishContext(); | |
15589 return __pyx_r; | |
15590 } | |
15591 | |
15592 /* "pysam/libctabix.pyx":704 | |
15593 * self.parser = parser | |
15594 * | |
15595 * def __next__(self): # <<<<<<<<<<<<<< | |
15596 * """python version of next(). | |
15597 * | |
15598 */ | |
15599 | |
15600 /* Python wrapper */ | |
15601 static PyObject *__pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_3__next__(PyObject *__pyx_v_self); /*proto*/ | |
15602 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_19TabixIteratorParsed_2__next__, "python version of next().\n\n pyrex uses this non-standard name instead of next()\n "); | |
15603 #if CYTHON_UPDATE_DESCRIPTOR_DOC | |
15604 struct wrapperbase __pyx_wrapperbase_5pysam_9libctabix_19TabixIteratorParsed_2__next__; | |
15605 #endif | |
15606 static PyObject *__pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_3__next__(PyObject *__pyx_v_self) { | |
15607 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
15608 PyObject *__pyx_r = 0; | |
15609 __Pyx_RefNannyDeclarations | |
15610 __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); | |
15611 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
15612 __pyx_r = __pyx_pf_5pysam_9libctabix_19TabixIteratorParsed_2__next__(((struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *)__pyx_v_self)); | |
15613 | |
15614 /* function exit code */ | |
15615 __Pyx_RefNannyFinishContext(); | |
15616 return __pyx_r; | |
15617 } | |
15618 | |
15619 static PyObject *__pyx_pf_5pysam_9libctabix_19TabixIteratorParsed_2__next__(struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *__pyx_v_self) { | |
15620 int __pyx_v_retval; | |
15621 PyObject *__pyx_r = NULL; | |
15622 __Pyx_TraceDeclarations | |
15623 __Pyx_RefNannyDeclarations | |
15624 int __pyx_error_without_exception = 0; /* StopIteration */ | |
15625 int __pyx_t_1; | |
15626 int __pyx_t_2; | |
15627 PyObject *__pyx_t_3 = NULL; | |
15628 int __pyx_lineno = 0; | |
15629 const char *__pyx_filename = NULL; | |
15630 int __pyx_clineno = 0; | |
15631 __Pyx_RefNannySetupContext("__next__", 1); | |
15632 __Pyx_TraceCall("__next__", __pyx_f[0], 704, 0, __PYX_ERR(0, 704, __pyx_L1_error)); | |
15633 | |
15634 /* "pysam/libctabix.pyx":710 | |
15635 * """ | |
15636 * | |
15637 * cdef int retval = self.__cnext__() # <<<<<<<<<<<<<< | |
15638 * if retval == -5: | |
15639 * raise IOError("iteration on closed file") | |
15640 */ | |
15641 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_9libctabix_TabixIteratorParsed *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.__pyx___cnext__(((struct __pyx_obj_5pysam_9libctabix_TabixIterator *)__pyx_v_self)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 710, __pyx_L1_error) | |
15642 __pyx_v_retval = __pyx_t_1; | |
15643 | |
15644 /* "pysam/libctabix.pyx":711 | |
15645 * | |
15646 * cdef int retval = self.__cnext__() | |
15647 * if retval == -5: # <<<<<<<<<<<<<< | |
15648 * raise IOError("iteration on closed file") | |
15649 * elif retval < 0: | |
15650 */ | |
15651 __pyx_t_2 = (__pyx_v_retval == -5L); | |
15652 if (unlikely(__pyx_t_2)) { | |
15653 | |
15654 /* "pysam/libctabix.pyx":712 | |
15655 * cdef int retval = self.__cnext__() | |
15656 * if retval == -5: | |
15657 * raise IOError("iteration on closed file") # <<<<<<<<<<<<<< | |
15658 * elif retval < 0: | |
15659 * raise StopIteration | |
15660 */ | |
15661 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) | |
15662 __Pyx_GOTREF(__pyx_t_3); | |
15663 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
15664 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15665 __PYX_ERR(0, 712, __pyx_L1_error) | |
15666 | |
15667 /* "pysam/libctabix.pyx":711 | |
15668 * | |
15669 * cdef int retval = self.__cnext__() | |
15670 * if retval == -5: # <<<<<<<<<<<<<< | |
15671 * raise IOError("iteration on closed file") | |
15672 * elif retval < 0: | |
15673 */ | |
15674 } | |
15675 | |
15676 /* "pysam/libctabix.pyx":713 | |
15677 * if retval == -5: | |
15678 * raise IOError("iteration on closed file") | |
15679 * elif retval < 0: # <<<<<<<<<<<<<< | |
15680 * raise StopIteration | |
15681 * | |
15682 */ | |
15683 __pyx_t_2 = (__pyx_v_retval < 0); | |
15684 if (unlikely(__pyx_t_2)) { | |
15685 | |
15686 /* "pysam/libctabix.pyx":714 | |
15687 * raise IOError("iteration on closed file") | |
15688 * elif retval < 0: | |
15689 * raise StopIteration # <<<<<<<<<<<<<< | |
15690 * | |
15691 * return self.parser.parse(self.buffer.s, | |
15692 */ | |
15693 __pyx_error_without_exception = 1; | |
15694 goto __pyx_L1_error;; | |
15695 | |
15696 /* "pysam/libctabix.pyx":713 | |
15697 * if retval == -5: | |
15698 * raise IOError("iteration on closed file") | |
15699 * elif retval < 0: # <<<<<<<<<<<<<< | |
15700 * raise StopIteration | |
15701 * | |
15702 */ | |
15703 } | |
15704 | |
15705 /* "pysam/libctabix.pyx":716 | |
15706 * raise StopIteration | |
15707 * | |
15708 * return self.parser.parse(self.buffer.s, # <<<<<<<<<<<<<< | |
15709 * self.buffer.l) | |
15710 * | |
15711 */ | |
15712 __Pyx_XDECREF(__pyx_r); | |
15713 | |
15714 /* "pysam/libctabix.pyx":717 | |
15715 * | |
15716 * return self.parser.parse(self.buffer.s, | |
15717 * self.buffer.l) # <<<<<<<<<<<<<< | |
15718 * | |
15719 * | |
15720 */ | |
15721 __pyx_t_3 = ((struct __pyx_vtabstruct_5pysam_9libctabix_Parser *)__pyx_v_self->parser->__pyx_vtab)->parse(__pyx_v_self->parser, __pyx_v_self->__pyx_base.buffer.s, __pyx_v_self->__pyx_base.buffer.l); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 716, __pyx_L1_error) | |
15722 __Pyx_GOTREF(__pyx_t_3); | |
15723 __pyx_r = __pyx_t_3; | |
15724 __pyx_t_3 = 0; | |
15725 goto __pyx_L0; | |
15726 | |
15727 /* "pysam/libctabix.pyx":704 | |
15728 * self.parser = parser | |
15729 * | |
15730 * def __next__(self): # <<<<<<<<<<<<<< | |
15731 * """python version of next(). | |
15732 * | |
15733 */ | |
15734 | |
15735 /* function exit code */ | |
15736 __pyx_L1_error:; | |
15737 __Pyx_XDECREF(__pyx_t_3); | |
15738 if (!__pyx_error_without_exception) { | |
15739 __Pyx_AddTraceback("pysam.libctabix.TabixIteratorParsed.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15740 } | |
15741 __pyx_r = NULL; | |
15742 __pyx_L0:; | |
15743 __Pyx_XGIVEREF(__pyx_r); | |
15744 __Pyx_TraceReturn(__pyx_r, 0); | |
15745 __Pyx_RefNannyFinishContext(); | |
15746 return __pyx_r; | |
15747 } | |
15748 | |
15749 /* "(tree fragment)":1 | |
15750 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
15751 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
15752 * def __setstate_cython__(self, __pyx_state): | |
15753 */ | |
15754 | |
15755 /* Python wrapper */ | |
15756 static PyObject *__pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_5__reduce_cython__(PyObject *__pyx_v_self, | |
15757 #if CYTHON_METH_FASTCALL | |
15758 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
15759 #else | |
15760 PyObject *__pyx_args, PyObject *__pyx_kwds | |
15761 #endif | |
15762 ); /*proto*/ | |
15763 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_19TabixIteratorParsed_4__reduce_cython__, "TabixIteratorParsed.__reduce_cython__(self)"); | |
15764 static PyMethodDef __pyx_mdef_5pysam_9libctabix_19TabixIteratorParsed_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_19TabixIteratorParsed_4__reduce_cython__}; | |
15765 static PyObject *__pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_5__reduce_cython__(PyObject *__pyx_v_self, | |
15766 #if CYTHON_METH_FASTCALL | |
15767 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
15768 #else | |
15769 PyObject *__pyx_args, PyObject *__pyx_kwds | |
15770 #endif | |
15771 ) { | |
15772 #if !CYTHON_METH_FASTCALL | |
15773 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
15774 #endif | |
15775 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
15776 PyObject *__pyx_r = 0; | |
15777 __Pyx_RefNannyDeclarations | |
15778 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
15779 #if !CYTHON_METH_FASTCALL | |
15780 #if CYTHON_ASSUME_SAFE_MACROS | |
15781 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
15782 #else | |
15783 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
15784 #endif | |
15785 #endif | |
15786 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
15787 if (unlikely(__pyx_nargs > 0)) { | |
15788 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
15789 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
15790 __pyx_r = __pyx_pf_5pysam_9libctabix_19TabixIteratorParsed_4__reduce_cython__(((struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *)__pyx_v_self)); | |
15791 | |
15792 /* function exit code */ | |
15793 __Pyx_RefNannyFinishContext(); | |
15794 return __pyx_r; | |
15795 } | |
15796 | |
15797 static PyObject *__pyx_pf_5pysam_9libctabix_19TabixIteratorParsed_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *__pyx_v_self) { | |
15798 PyObject *__pyx_r = NULL; | |
15799 __Pyx_TraceDeclarations | |
15800 __Pyx_RefNannyDeclarations | |
15801 int __pyx_lineno = 0; | |
15802 const char *__pyx_filename = NULL; | |
15803 int __pyx_clineno = 0; | |
15804 __Pyx_TraceFrameInit(__pyx_codeobj__29) | |
15805 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
15806 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
15807 | |
15808 /* "(tree fragment)":2 | |
15809 * def __reduce_cython__(self): | |
15810 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< | |
15811 * def __setstate_cython__(self, __pyx_state): | |
15812 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
15813 */ | |
15814 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_iterator_cannot_be_converte, 0, 0); | |
15815 __PYX_ERR(1, 2, __pyx_L1_error) | |
15816 | |
15817 /* "(tree fragment)":1 | |
15818 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
15819 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
15820 * def __setstate_cython__(self, __pyx_state): | |
15821 */ | |
15822 | |
15823 /* function exit code */ | |
15824 __pyx_L1_error:; | |
15825 __Pyx_AddTraceback("pysam.libctabix.TabixIteratorParsed.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15826 __pyx_r = NULL; | |
15827 __Pyx_XGIVEREF(__pyx_r); | |
15828 __Pyx_TraceReturn(__pyx_r, 0); | |
15829 __Pyx_RefNannyFinishContext(); | |
15830 return __pyx_r; | |
15831 } | |
15832 | |
15833 /* "(tree fragment)":3 | |
15834 * def __reduce_cython__(self): | |
15835 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
15836 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
15837 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
15838 */ | |
15839 | |
15840 /* Python wrapper */ | |
15841 static PyObject *__pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_7__setstate_cython__(PyObject *__pyx_v_self, | |
15842 #if CYTHON_METH_FASTCALL | |
15843 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
15844 #else | |
15845 PyObject *__pyx_args, PyObject *__pyx_kwds | |
15846 #endif | |
15847 ); /*proto*/ | |
15848 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_19TabixIteratorParsed_6__setstate_cython__, "TabixIteratorParsed.__setstate_cython__(self, __pyx_state)"); | |
15849 static PyMethodDef __pyx_mdef_5pysam_9libctabix_19TabixIteratorParsed_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_19TabixIteratorParsed_6__setstate_cython__}; | |
15850 static PyObject *__pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_7__setstate_cython__(PyObject *__pyx_v_self, | |
15851 #if CYTHON_METH_FASTCALL | |
15852 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
15853 #else | |
15854 PyObject *__pyx_args, PyObject *__pyx_kwds | |
15855 #endif | |
15856 ) { | |
15857 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; | |
15858 #if !CYTHON_METH_FASTCALL | |
15859 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
15860 #endif | |
15861 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
15862 PyObject* values[1] = {0}; | |
15863 int __pyx_lineno = 0; | |
15864 const char *__pyx_filename = NULL; | |
15865 int __pyx_clineno = 0; | |
15866 PyObject *__pyx_r = 0; | |
15867 __Pyx_RefNannyDeclarations | |
15868 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
15869 #if !CYTHON_METH_FASTCALL | |
15870 #if CYTHON_ASSUME_SAFE_MACROS | |
15871 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
15872 #else | |
15873 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
15874 #endif | |
15875 #endif | |
15876 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
15877 { | |
15878 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
15879 if (__pyx_kwds) { | |
15880 Py_ssize_t kw_args; | |
15881 switch (__pyx_nargs) { | |
15882 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
15883 CYTHON_FALLTHROUGH; | |
15884 case 0: break; | |
15885 default: goto __pyx_L5_argtuple_error; | |
15886 } | |
15887 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
15888 switch (__pyx_nargs) { | |
15889 case 0: | |
15890 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
15891 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
15892 kw_args--; | |
15893 } | |
15894 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) | |
15895 else goto __pyx_L5_argtuple_error; | |
15896 } | |
15897 if (unlikely(kw_args > 0)) { | |
15898 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
15899 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) | |
15900 } | |
15901 } else if (unlikely(__pyx_nargs != 1)) { | |
15902 goto __pyx_L5_argtuple_error; | |
15903 } else { | |
15904 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
15905 } | |
15906 __pyx_v___pyx_state = values[0]; | |
15907 } | |
15908 goto __pyx_L6_skip; | |
15909 __pyx_L5_argtuple_error:; | |
15910 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) | |
15911 __pyx_L6_skip:; | |
15912 goto __pyx_L4_argument_unpacking_done; | |
15913 __pyx_L3_error:; | |
15914 { | |
15915 Py_ssize_t __pyx_temp; | |
15916 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
15917 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
15918 } | |
15919 } | |
15920 __Pyx_AddTraceback("pysam.libctabix.TabixIteratorParsed.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15921 __Pyx_RefNannyFinishContext(); | |
15922 return NULL; | |
15923 __pyx_L4_argument_unpacking_done:; | |
15924 __pyx_r = __pyx_pf_5pysam_9libctabix_19TabixIteratorParsed_6__setstate_cython__(((struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *)__pyx_v_self), __pyx_v___pyx_state); | |
15925 | |
15926 /* function exit code */ | |
15927 { | |
15928 Py_ssize_t __pyx_temp; | |
15929 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
15930 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
15931 } | |
15932 } | |
15933 __Pyx_RefNannyFinishContext(); | |
15934 return __pyx_r; | |
15935 } | |
15936 | |
15937 static PyObject *__pyx_pf_5pysam_9libctabix_19TabixIteratorParsed_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { | |
15938 PyObject *__pyx_r = NULL; | |
15939 __Pyx_TraceDeclarations | |
15940 __Pyx_RefNannyDeclarations | |
15941 int __pyx_lineno = 0; | |
15942 const char *__pyx_filename = NULL; | |
15943 int __pyx_clineno = 0; | |
15944 __Pyx_TraceFrameInit(__pyx_codeobj__30) | |
15945 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
15946 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); | |
15947 | |
15948 /* "(tree fragment)":4 | |
15949 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
15950 * def __setstate_cython__(self, __pyx_state): | |
15951 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< | |
15952 */ | |
15953 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_iterator_cannot_be_converte, 0, 0); | |
15954 __PYX_ERR(1, 4, __pyx_L1_error) | |
15955 | |
15956 /* "(tree fragment)":3 | |
15957 * def __reduce_cython__(self): | |
15958 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
15959 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
15960 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
15961 */ | |
15962 | |
15963 /* function exit code */ | |
15964 __pyx_L1_error:; | |
15965 __Pyx_AddTraceback("pysam.libctabix.TabixIteratorParsed.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15966 __pyx_r = NULL; | |
15967 __Pyx_XGIVEREF(__pyx_r); | |
15968 __Pyx_TraceReturn(__pyx_r, 0); | |
15969 __Pyx_RefNannyFinishContext(); | |
15970 return __pyx_r; | |
15971 } | |
15972 | |
15973 /* "pysam/libctabix.pyx":721 | |
15974 * | |
15975 * cdef class GZIterator: | |
15976 * def __init__(self, filename, int buffer_size=65536, encoding="ascii"): # <<<<<<<<<<<<<< | |
15977 * '''iterate line-by-line through gzip (or bgzip) | |
15978 * compressed file. | |
15979 */ | |
15980 | |
15981 /* Python wrapper */ | |
15982 static int __pyx_pw_5pysam_9libctabix_10GZIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
15983 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_10GZIterator___init__, "iterate line-by-line through gzip (or bgzip)\n compressed file.\n "); | |
15984 #if CYTHON_UPDATE_DESCRIPTOR_DOC | |
15985 struct wrapperbase __pyx_wrapperbase_5pysam_9libctabix_10GZIterator___init__; | |
15986 #endif | |
15987 static int __pyx_pw_5pysam_9libctabix_10GZIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
15988 PyObject *__pyx_v_filename = 0; | |
15989 int __pyx_v_buffer_size; | |
15990 PyObject *__pyx_v_encoding = 0; | |
15991 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
15992 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
15993 PyObject* values[3] = {0,0,0}; | |
15994 int __pyx_lineno = 0; | |
15995 const char *__pyx_filename = NULL; | |
15996 int __pyx_clineno = 0; | |
15997 int __pyx_r; | |
15998 __Pyx_RefNannyDeclarations | |
15999 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); | |
16000 #if CYTHON_ASSUME_SAFE_MACROS | |
16001 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
16002 #else | |
16003 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; | |
16004 #endif | |
16005 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
16006 { | |
16007 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_buffer_size,&__pyx_n_s_encoding,0}; | |
16008 values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_u_ascii)); | |
16009 if (__pyx_kwds) { | |
16010 Py_ssize_t kw_args; | |
16011 switch (__pyx_nargs) { | |
16012 case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); | |
16013 CYTHON_FALLTHROUGH; | |
16014 case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); | |
16015 CYTHON_FALLTHROUGH; | |
16016 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
16017 CYTHON_FALLTHROUGH; | |
16018 case 0: break; | |
16019 default: goto __pyx_L5_argtuple_error; | |
16020 } | |
16021 kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); | |
16022 switch (__pyx_nargs) { | |
16023 case 0: | |
16024 if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) { | |
16025 (void)__Pyx_Arg_NewRef_VARARGS(values[0]); | |
16026 kw_args--; | |
16027 } | |
16028 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 721, __pyx_L3_error) | |
16029 else goto __pyx_L5_argtuple_error; | |
16030 CYTHON_FALLTHROUGH; | |
16031 case 1: | |
16032 if (kw_args > 0) { | |
16033 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buffer_size); | |
16034 if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } | |
16035 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 721, __pyx_L3_error) | |
16036 } | |
16037 CYTHON_FALLTHROUGH; | |
16038 case 2: | |
16039 if (kw_args > 0) { | |
16040 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoding); | |
16041 if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } | |
16042 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 721, __pyx_L3_error) | |
16043 } | |
16044 } | |
16045 if (unlikely(kw_args > 0)) { | |
16046 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
16047 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 721, __pyx_L3_error) | |
16048 } | |
16049 } else { | |
16050 switch (__pyx_nargs) { | |
16051 case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); | |
16052 CYTHON_FALLTHROUGH; | |
16053 case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); | |
16054 CYTHON_FALLTHROUGH; | |
16055 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
16056 break; | |
16057 default: goto __pyx_L5_argtuple_error; | |
16058 } | |
16059 } | |
16060 __pyx_v_filename = values[0]; | |
16061 if (values[1]) { | |
16062 __pyx_v_buffer_size = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_buffer_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 721, __pyx_L3_error) | |
16063 } else { | |
16064 __pyx_v_buffer_size = ((int)0x10000); | |
16065 } | |
16066 __pyx_v_encoding = values[2]; | |
16067 } | |
16068 goto __pyx_L6_skip; | |
16069 __pyx_L5_argtuple_error:; | |
16070 __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 721, __pyx_L3_error) | |
16071 __pyx_L6_skip:; | |
16072 goto __pyx_L4_argument_unpacking_done; | |
16073 __pyx_L3_error:; | |
16074 { | |
16075 Py_ssize_t __pyx_temp; | |
16076 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
16077 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
16078 } | |
16079 } | |
16080 __Pyx_AddTraceback("pysam.libctabix.GZIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16081 __Pyx_RefNannyFinishContext(); | |
16082 return -1; | |
16083 __pyx_L4_argument_unpacking_done:; | |
16084 __pyx_r = __pyx_pf_5pysam_9libctabix_10GZIterator___init__(((struct __pyx_obj_5pysam_9libctabix_GZIterator *)__pyx_v_self), __pyx_v_filename, __pyx_v_buffer_size, __pyx_v_encoding); | |
16085 | |
16086 /* function exit code */ | |
16087 { | |
16088 Py_ssize_t __pyx_temp; | |
16089 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
16090 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
16091 } | |
16092 } | |
16093 __Pyx_RefNannyFinishContext(); | |
16094 return __pyx_r; | |
16095 } | |
16096 | |
16097 static int __pyx_pf_5pysam_9libctabix_10GZIterator___init__(struct __pyx_obj_5pysam_9libctabix_GZIterator *__pyx_v_self, PyObject *__pyx_v_filename, int __pyx_v_buffer_size, PyObject *__pyx_v_encoding) { | |
16098 char *__pyx_v_cfilename; | |
16099 int __pyx_r; | |
16100 __Pyx_TraceDeclarations | |
16101 __Pyx_RefNannyDeclarations | |
16102 PyObject *__pyx_t_1 = NULL; | |
16103 PyObject *__pyx_t_2 = NULL; | |
16104 PyObject *__pyx_t_3 = NULL; | |
16105 unsigned int __pyx_t_4; | |
16106 int __pyx_t_5; | |
16107 int __pyx_t_6; | |
16108 char *__pyx_t_7; | |
16109 int __pyx_lineno = 0; | |
16110 const char *__pyx_filename = NULL; | |
16111 int __pyx_clineno = 0; | |
16112 __Pyx_RefNannySetupContext("__init__", 0); | |
16113 __Pyx_TraceCall("__init__", __pyx_f[0], 721, 0, __PYX_ERR(0, 721, __pyx_L1_error)); | |
16114 __Pyx_INCREF(__pyx_v_filename); | |
16115 | |
16116 /* "pysam/libctabix.pyx":725 | |
16117 * compressed file. | |
16118 * ''' | |
16119 * if not os.path.exists(filename): # <<<<<<<<<<<<<< | |
16120 * raise IOError("No such file or directory: %s" % filename) | |
16121 * | |
16122 */ | |
16123 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error) | |
16124 __Pyx_GOTREF(__pyx_t_2); | |
16125 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error) | |
16126 __Pyx_GOTREF(__pyx_t_3); | |
16127 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
16128 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error) | |
16129 __Pyx_GOTREF(__pyx_t_2); | |
16130 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
16131 __pyx_t_3 = NULL; | |
16132 __pyx_t_4 = 0; | |
16133 #if CYTHON_UNPACK_METHODS | |
16134 if (likely(PyMethod_Check(__pyx_t_2))) { | |
16135 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
16136 if (likely(__pyx_t_3)) { | |
16137 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
16138 __Pyx_INCREF(__pyx_t_3); | |
16139 __Pyx_INCREF(function); | |
16140 __Pyx_DECREF_SET(__pyx_t_2, function); | |
16141 __pyx_t_4 = 1; | |
16142 } | |
16143 } | |
16144 #endif | |
16145 { | |
16146 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_filename}; | |
16147 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
16148 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
16149 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error) | |
16150 __Pyx_GOTREF(__pyx_t_1); | |
16151 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
16152 } | |
16153 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 725, __pyx_L1_error) | |
16154 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16155 __pyx_t_6 = (!__pyx_t_5); | |
16156 if (unlikely(__pyx_t_6)) { | |
16157 | |
16158 /* "pysam/libctabix.pyx":726 | |
16159 * ''' | |
16160 * if not os.path.exists(filename): | |
16161 * raise IOError("No such file or directory: %s" % filename) # <<<<<<<<<<<<<< | |
16162 * | |
16163 * filename = encode_filename(filename) | |
16164 */ | |
16165 __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_No_such_file_or_directory_s, __pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) | |
16166 __Pyx_GOTREF(__pyx_t_1); | |
16167 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error) | |
16168 __Pyx_GOTREF(__pyx_t_2); | |
16169 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16170 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
16171 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
16172 __PYX_ERR(0, 726, __pyx_L1_error) | |
16173 | |
16174 /* "pysam/libctabix.pyx":725 | |
16175 * compressed file. | |
16176 * ''' | |
16177 * if not os.path.exists(filename): # <<<<<<<<<<<<<< | |
16178 * raise IOError("No such file or directory: %s" % filename) | |
16179 * | |
16180 */ | |
16181 } | |
16182 | |
16183 /* "pysam/libctabix.pyx":728 | |
16184 * raise IOError("No such file or directory: %s" % filename) | |
16185 * | |
16186 * filename = encode_filename(filename) # <<<<<<<<<<<<<< | |
16187 * cdef char *cfilename = filename | |
16188 * with nogil: | |
16189 */ | |
16190 __pyx_t_2 = __pyx_f_5pysam_9libcutils_encode_filename(__pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error) | |
16191 __Pyx_GOTREF(__pyx_t_2); | |
16192 __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_2); | |
16193 __pyx_t_2 = 0; | |
16194 | |
16195 /* "pysam/libctabix.pyx":729 | |
16196 * | |
16197 * filename = encode_filename(filename) | |
16198 * cdef char *cfilename = filename # <<<<<<<<<<<<<< | |
16199 * with nogil: | |
16200 * self.gzipfile = bgzf_open(cfilename, "r") | |
16201 */ | |
16202 __pyx_t_7 = __Pyx_PyObject_AsWritableString(__pyx_v_filename); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 729, __pyx_L1_error) | |
16203 __pyx_v_cfilename = __pyx_t_7; | |
16204 | |
16205 /* "pysam/libctabix.pyx":730 | |
16206 * filename = encode_filename(filename) | |
16207 * cdef char *cfilename = filename | |
16208 * with nogil: # <<<<<<<<<<<<<< | |
16209 * self.gzipfile = bgzf_open(cfilename, "r") | |
16210 * self._filename = filename | |
16211 */ | |
16212 { | |
16213 #ifdef WITH_THREAD | |
16214 PyThreadState *_save; | |
16215 _save = NULL; | |
16216 Py_UNBLOCK_THREADS | |
16217 __Pyx_FastGIL_Remember(); | |
16218 #endif | |
16219 /*try:*/ { | |
16220 | |
16221 /* "pysam/libctabix.pyx":731 | |
16222 * cdef char *cfilename = filename | |
16223 * with nogil: | |
16224 * self.gzipfile = bgzf_open(cfilename, "r") # <<<<<<<<<<<<<< | |
16225 * self._filename = filename | |
16226 * self.kstream = ks_init(self.gzipfile) | |
16227 */ | |
16228 __pyx_v_self->gzipfile = bgzf_open(__pyx_v_cfilename, ((char const *)"r")); | |
16229 } | |
16230 | |
16231 /* "pysam/libctabix.pyx":730 | |
16232 * filename = encode_filename(filename) | |
16233 * cdef char *cfilename = filename | |
16234 * with nogil: # <<<<<<<<<<<<<< | |
16235 * self.gzipfile = bgzf_open(cfilename, "r") | |
16236 * self._filename = filename | |
16237 */ | |
16238 /*finally:*/ { | |
16239 /*normal exit:*/{ | |
16240 #ifdef WITH_THREAD | |
16241 __Pyx_FastGIL_Forget(); | |
16242 Py_BLOCK_THREADS | |
16243 #endif | |
16244 goto __pyx_L6; | |
16245 } | |
16246 __pyx_L6:; | |
16247 } | |
16248 } | |
16249 | |
16250 /* "pysam/libctabix.pyx":732 | |
16251 * with nogil: | |
16252 * self.gzipfile = bgzf_open(cfilename, "r") | |
16253 * self._filename = filename # <<<<<<<<<<<<<< | |
16254 * self.kstream = ks_init(self.gzipfile) | |
16255 * self.encoding = encoding | |
16256 */ | |
16257 __Pyx_INCREF(__pyx_v_filename); | |
16258 __Pyx_GIVEREF(__pyx_v_filename); | |
16259 __Pyx_GOTREF(__pyx_v_self->_filename); | |
16260 __Pyx_DECREF(__pyx_v_self->_filename); | |
16261 __pyx_v_self->_filename = __pyx_v_filename; | |
16262 | |
16263 /* "pysam/libctabix.pyx":733 | |
16264 * self.gzipfile = bgzf_open(cfilename, "r") | |
16265 * self._filename = filename | |
16266 * self.kstream = ks_init(self.gzipfile) # <<<<<<<<<<<<<< | |
16267 * self.encoding = encoding | |
16268 * | |
16269 */ | |
16270 __pyx_v_self->kstream = ks_init(__pyx_v_self->gzipfile); | |
16271 | |
16272 /* "pysam/libctabix.pyx":734 | |
16273 * self._filename = filename | |
16274 * self.kstream = ks_init(self.gzipfile) | |
16275 * self.encoding = encoding # <<<<<<<<<<<<<< | |
16276 * | |
16277 * self.buffer.l = 0 | |
16278 */ | |
16279 __Pyx_INCREF(__pyx_v_encoding); | |
16280 __Pyx_GIVEREF(__pyx_v_encoding); | |
16281 __Pyx_GOTREF(__pyx_v_self->encoding); | |
16282 __Pyx_DECREF(__pyx_v_self->encoding); | |
16283 __pyx_v_self->encoding = __pyx_v_encoding; | |
16284 | |
16285 /* "pysam/libctabix.pyx":736 | |
16286 * self.encoding = encoding | |
16287 * | |
16288 * self.buffer.l = 0 # <<<<<<<<<<<<<< | |
16289 * self.buffer.m = 0 | |
16290 * self.buffer.s = <char*>malloc(buffer_size) | |
16291 */ | |
16292 __pyx_v_self->buffer.l = 0; | |
16293 | |
16294 /* "pysam/libctabix.pyx":737 | |
16295 * | |
16296 * self.buffer.l = 0 | |
16297 * self.buffer.m = 0 # <<<<<<<<<<<<<< | |
16298 * self.buffer.s = <char*>malloc(buffer_size) | |
16299 * | |
16300 */ | |
16301 __pyx_v_self->buffer.m = 0; | |
16302 | |
16303 /* "pysam/libctabix.pyx":738 | |
16304 * self.buffer.l = 0 | |
16305 * self.buffer.m = 0 | |
16306 * self.buffer.s = <char*>malloc(buffer_size) # <<<<<<<<<<<<<< | |
16307 * | |
16308 * def __dealloc__(self): | |
16309 */ | |
16310 __pyx_v_self->buffer.s = ((char *)malloc(__pyx_v_buffer_size)); | |
16311 | |
16312 /* "pysam/libctabix.pyx":721 | |
16313 * | |
16314 * cdef class GZIterator: | |
16315 * def __init__(self, filename, int buffer_size=65536, encoding="ascii"): # <<<<<<<<<<<<<< | |
16316 * '''iterate line-by-line through gzip (or bgzip) | |
16317 * compressed file. | |
16318 */ | |
16319 | |
16320 /* function exit code */ | |
16321 __pyx_r = 0; | |
16322 goto __pyx_L0; | |
16323 __pyx_L1_error:; | |
16324 __Pyx_XDECREF(__pyx_t_1); | |
16325 __Pyx_XDECREF(__pyx_t_2); | |
16326 __Pyx_XDECREF(__pyx_t_3); | |
16327 __Pyx_AddTraceback("pysam.libctabix.GZIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16328 __pyx_r = -1; | |
16329 __pyx_L0:; | |
16330 __Pyx_XDECREF(__pyx_v_filename); | |
16331 __Pyx_TraceReturn(Py_None, 0); | |
16332 __Pyx_RefNannyFinishContext(); | |
16333 return __pyx_r; | |
16334 } | |
16335 | |
16336 /* "pysam/libctabix.pyx":740 | |
16337 * self.buffer.s = <char*>malloc(buffer_size) | |
16338 * | |
16339 * def __dealloc__(self): # <<<<<<<<<<<<<< | |
16340 * '''close file.''' | |
16341 * if self.gzipfile != NULL: | |
16342 */ | |
16343 | |
16344 /* Python wrapper */ | |
16345 static void __pyx_pw_5pysam_9libctabix_10GZIterator_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ | |
16346 static void __pyx_pw_5pysam_9libctabix_10GZIterator_3__dealloc__(PyObject *__pyx_v_self) { | |
16347 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
16348 __Pyx_RefNannyDeclarations | |
16349 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); | |
16350 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
16351 __pyx_pf_5pysam_9libctabix_10GZIterator_2__dealloc__(((struct __pyx_obj_5pysam_9libctabix_GZIterator *)__pyx_v_self)); | |
16352 | |
16353 /* function exit code */ | |
16354 __Pyx_RefNannyFinishContext(); | |
16355 } | |
16356 | |
16357 static void __pyx_pf_5pysam_9libctabix_10GZIterator_2__dealloc__(struct __pyx_obj_5pysam_9libctabix_GZIterator *__pyx_v_self) { | |
16358 __Pyx_TraceDeclarations | |
16359 int __pyx_t_1; | |
16360 int __pyx_lineno = 0; | |
16361 const char *__pyx_filename = NULL; | |
16362 int __pyx_clineno = 0; | |
16363 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 740, 0, __PYX_ERR(0, 740, __pyx_L1_error)); | |
16364 | |
16365 /* "pysam/libctabix.pyx":742 | |
16366 * def __dealloc__(self): | |
16367 * '''close file.''' | |
16368 * if self.gzipfile != NULL: # <<<<<<<<<<<<<< | |
16369 * bgzf_close(self.gzipfile) | |
16370 * self.gzipfile = NULL | |
16371 */ | |
16372 __pyx_t_1 = (__pyx_v_self->gzipfile != NULL); | |
16373 if (__pyx_t_1) { | |
16374 | |
16375 /* "pysam/libctabix.pyx":743 | |
16376 * '''close file.''' | |
16377 * if self.gzipfile != NULL: | |
16378 * bgzf_close(self.gzipfile) # <<<<<<<<<<<<<< | |
16379 * self.gzipfile = NULL | |
16380 * if self.buffer.s != NULL: | |
16381 */ | |
16382 (void)(bgzf_close(__pyx_v_self->gzipfile)); | |
16383 | |
16384 /* "pysam/libctabix.pyx":744 | |
16385 * if self.gzipfile != NULL: | |
16386 * bgzf_close(self.gzipfile) | |
16387 * self.gzipfile = NULL # <<<<<<<<<<<<<< | |
16388 * if self.buffer.s != NULL: | |
16389 * free(self.buffer.s) | |
16390 */ | |
16391 __pyx_v_self->gzipfile = NULL; | |
16392 | |
16393 /* "pysam/libctabix.pyx":742 | |
16394 * def __dealloc__(self): | |
16395 * '''close file.''' | |
16396 * if self.gzipfile != NULL: # <<<<<<<<<<<<<< | |
16397 * bgzf_close(self.gzipfile) | |
16398 * self.gzipfile = NULL | |
16399 */ | |
16400 } | |
16401 | |
16402 /* "pysam/libctabix.pyx":745 | |
16403 * bgzf_close(self.gzipfile) | |
16404 * self.gzipfile = NULL | |
16405 * if self.buffer.s != NULL: # <<<<<<<<<<<<<< | |
16406 * free(self.buffer.s) | |
16407 * if self.kstream != NULL: | |
16408 */ | |
16409 __pyx_t_1 = (__pyx_v_self->buffer.s != NULL); | |
16410 if (__pyx_t_1) { | |
16411 | |
16412 /* "pysam/libctabix.pyx":746 | |
16413 * self.gzipfile = NULL | |
16414 * if self.buffer.s != NULL: | |
16415 * free(self.buffer.s) # <<<<<<<<<<<<<< | |
16416 * if self.kstream != NULL: | |
16417 * ks_destroy(self.kstream) | |
16418 */ | |
16419 free(__pyx_v_self->buffer.s); | |
16420 | |
16421 /* "pysam/libctabix.pyx":745 | |
16422 * bgzf_close(self.gzipfile) | |
16423 * self.gzipfile = NULL | |
16424 * if self.buffer.s != NULL: # <<<<<<<<<<<<<< | |
16425 * free(self.buffer.s) | |
16426 * if self.kstream != NULL: | |
16427 */ | |
16428 } | |
16429 | |
16430 /* "pysam/libctabix.pyx":747 | |
16431 * if self.buffer.s != NULL: | |
16432 * free(self.buffer.s) | |
16433 * if self.kstream != NULL: # <<<<<<<<<<<<<< | |
16434 * ks_destroy(self.kstream) | |
16435 * | |
16436 */ | |
16437 __pyx_t_1 = (__pyx_v_self->kstream != NULL); | |
16438 if (__pyx_t_1) { | |
16439 | |
16440 /* "pysam/libctabix.pyx":748 | |
16441 * free(self.buffer.s) | |
16442 * if self.kstream != NULL: | |
16443 * ks_destroy(self.kstream) # <<<<<<<<<<<<<< | |
16444 * | |
16445 * def __iter__(self): | |
16446 */ | |
16447 ks_destroy(__pyx_v_self->kstream); | |
16448 | |
16449 /* "pysam/libctabix.pyx":747 | |
16450 * if self.buffer.s != NULL: | |
16451 * free(self.buffer.s) | |
16452 * if self.kstream != NULL: # <<<<<<<<<<<<<< | |
16453 * ks_destroy(self.kstream) | |
16454 * | |
16455 */ | |
16456 } | |
16457 | |
16458 /* "pysam/libctabix.pyx":740 | |
16459 * self.buffer.s = <char*>malloc(buffer_size) | |
16460 * | |
16461 * def __dealloc__(self): # <<<<<<<<<<<<<< | |
16462 * '''close file.''' | |
16463 * if self.gzipfile != NULL: | |
16464 */ | |
16465 | |
16466 /* function exit code */ | |
16467 goto __pyx_L0; | |
16468 __pyx_L1_error:; | |
16469 __Pyx_WriteUnraisable("pysam.libctabix.GZIterator.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); | |
16470 __pyx_L0:; | |
16471 __Pyx_TraceReturn(Py_None, 0); | |
16472 } | |
16473 | |
16474 /* "pysam/libctabix.pyx":750 | |
16475 * ks_destroy(self.kstream) | |
16476 * | |
16477 * def __iter__(self): # <<<<<<<<<<<<<< | |
16478 * return self | |
16479 * | |
16480 */ | |
16481 | |
16482 /* Python wrapper */ | |
16483 static PyObject *__pyx_pw_5pysam_9libctabix_10GZIterator_5__iter__(PyObject *__pyx_v_self); /*proto*/ | |
16484 static PyObject *__pyx_pw_5pysam_9libctabix_10GZIterator_5__iter__(PyObject *__pyx_v_self) { | |
16485 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
16486 PyObject *__pyx_r = 0; | |
16487 __Pyx_RefNannyDeclarations | |
16488 __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); | |
16489 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
16490 __pyx_r = __pyx_pf_5pysam_9libctabix_10GZIterator_4__iter__(((struct __pyx_obj_5pysam_9libctabix_GZIterator *)__pyx_v_self)); | |
16491 | |
16492 /* function exit code */ | |
16493 __Pyx_RefNannyFinishContext(); | |
16494 return __pyx_r; | |
16495 } | |
16496 | |
16497 static PyObject *__pyx_pf_5pysam_9libctabix_10GZIterator_4__iter__(struct __pyx_obj_5pysam_9libctabix_GZIterator *__pyx_v_self) { | |
16498 PyObject *__pyx_r = NULL; | |
16499 __Pyx_TraceDeclarations | |
16500 __Pyx_RefNannyDeclarations | |
16501 int __pyx_lineno = 0; | |
16502 const char *__pyx_filename = NULL; | |
16503 int __pyx_clineno = 0; | |
16504 __Pyx_RefNannySetupContext("__iter__", 1); | |
16505 __Pyx_TraceCall("__iter__", __pyx_f[0], 750, 0, __PYX_ERR(0, 750, __pyx_L1_error)); | |
16506 | |
16507 /* "pysam/libctabix.pyx":751 | |
16508 * | |
16509 * def __iter__(self): | |
16510 * return self # <<<<<<<<<<<<<< | |
16511 * | |
16512 * cdef int __cnext__(self): | |
16513 */ | |
16514 __Pyx_XDECREF(__pyx_r); | |
16515 __Pyx_INCREF((PyObject *)__pyx_v_self); | |
16516 __pyx_r = ((PyObject *)__pyx_v_self); | |
16517 goto __pyx_L0; | |
16518 | |
16519 /* "pysam/libctabix.pyx":750 | |
16520 * ks_destroy(self.kstream) | |
16521 * | |
16522 * def __iter__(self): # <<<<<<<<<<<<<< | |
16523 * return self | |
16524 * | |
16525 */ | |
16526 | |
16527 /* function exit code */ | |
16528 __pyx_L1_error:; | |
16529 __Pyx_AddTraceback("pysam.libctabix.GZIterator.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16530 __pyx_r = NULL; | |
16531 __pyx_L0:; | |
16532 __Pyx_XGIVEREF(__pyx_r); | |
16533 __Pyx_TraceReturn(__pyx_r, 0); | |
16534 __Pyx_RefNannyFinishContext(); | |
16535 return __pyx_r; | |
16536 } | |
16537 | |
16538 /* "pysam/libctabix.pyx":753 | |
16539 * return self | |
16540 * | |
16541 * cdef int __cnext__(self): # <<<<<<<<<<<<<< | |
16542 * cdef int dret = 0 | |
16543 * cdef int retval = 0 | |
16544 */ | |
16545 | |
16546 static int __pyx_f_5pysam_9libctabix_10GZIterator___cnext__(struct __pyx_obj_5pysam_9libctabix_GZIterator *__pyx_v_self) { | |
16547 int __pyx_v_dret; | |
16548 int __pyx_v_retval; | |
16549 int __pyx_r; | |
16550 __Pyx_TraceDeclarations | |
16551 int __pyx_t_1; | |
16552 int __pyx_lineno = 0; | |
16553 const char *__pyx_filename = NULL; | |
16554 int __pyx_clineno = 0; | |
16555 __Pyx_TraceCall("__cnext__", __pyx_f[0], 753, 0, __PYX_ERR(0, 753, __pyx_L1_error)); | |
16556 | |
16557 /* "pysam/libctabix.pyx":754 | |
16558 * | |
16559 * cdef int __cnext__(self): | |
16560 * cdef int dret = 0 # <<<<<<<<<<<<<< | |
16561 * cdef int retval = 0 | |
16562 * while 1: | |
16563 */ | |
16564 __pyx_v_dret = 0; | |
16565 | |
16566 /* "pysam/libctabix.pyx":755 | |
16567 * cdef int __cnext__(self): | |
16568 * cdef int dret = 0 | |
16569 * cdef int retval = 0 # <<<<<<<<<<<<<< | |
16570 * while 1: | |
16571 * with nogil: | |
16572 */ | |
16573 __pyx_v_retval = 0; | |
16574 | |
16575 /* "pysam/libctabix.pyx":756 | |
16576 * cdef int dret = 0 | |
16577 * cdef int retval = 0 | |
16578 * while 1: # <<<<<<<<<<<<<< | |
16579 * with nogil: | |
16580 * retval = ks_getuntil(self.kstream, b'\n', &self.buffer, &dret) | |
16581 */ | |
16582 while (1) { | |
16583 | |
16584 /* "pysam/libctabix.pyx":757 | |
16585 * cdef int retval = 0 | |
16586 * while 1: | |
16587 * with nogil: # <<<<<<<<<<<<<< | |
16588 * retval = ks_getuntil(self.kstream, b'\n', &self.buffer, &dret) | |
16589 * | |
16590 */ | |
16591 { | |
16592 #ifdef WITH_THREAD | |
16593 PyThreadState *_save; | |
16594 _save = NULL; | |
16595 Py_UNBLOCK_THREADS | |
16596 __Pyx_FastGIL_Remember(); | |
16597 #endif | |
16598 /*try:*/ { | |
16599 | |
16600 /* "pysam/libctabix.pyx":758 | |
16601 * while 1: | |
16602 * with nogil: | |
16603 * retval = ks_getuntil(self.kstream, b'\n', &self.buffer, &dret) # <<<<<<<<<<<<<< | |
16604 * | |
16605 * if retval < 0: | |
16606 */ | |
16607 __pyx_v_retval = ks_getuntil(__pyx_v_self->kstream, '\n', (&__pyx_v_self->buffer), (&__pyx_v_dret)); | |
16608 } | |
16609 | |
16610 /* "pysam/libctabix.pyx":757 | |
16611 * cdef int retval = 0 | |
16612 * while 1: | |
16613 * with nogil: # <<<<<<<<<<<<<< | |
16614 * retval = ks_getuntil(self.kstream, b'\n', &self.buffer, &dret) | |
16615 * | |
16616 */ | |
16617 /*finally:*/ { | |
16618 /*normal exit:*/{ | |
16619 #ifdef WITH_THREAD | |
16620 __Pyx_FastGIL_Forget(); | |
16621 Py_BLOCK_THREADS | |
16622 #endif | |
16623 goto __pyx_L9; | |
16624 } | |
16625 __pyx_L9:; | |
16626 } | |
16627 } | |
16628 | |
16629 /* "pysam/libctabix.pyx":760 | |
16630 * retval = ks_getuntil(self.kstream, b'\n', &self.buffer, &dret) | |
16631 * | |
16632 * if retval < 0: # <<<<<<<<<<<<<< | |
16633 * break | |
16634 * | |
16635 */ | |
16636 __pyx_t_1 = (__pyx_v_retval < 0); | |
16637 if (__pyx_t_1) { | |
16638 | |
16639 /* "pysam/libctabix.pyx":761 | |
16640 * | |
16641 * if retval < 0: | |
16642 * break # <<<<<<<<<<<<<< | |
16643 * | |
16644 * return dret | |
16645 */ | |
16646 goto __pyx_L4_break; | |
16647 | |
16648 /* "pysam/libctabix.pyx":760 | |
16649 * retval = ks_getuntil(self.kstream, b'\n', &self.buffer, &dret) | |
16650 * | |
16651 * if retval < 0: # <<<<<<<<<<<<<< | |
16652 * break | |
16653 * | |
16654 */ | |
16655 } | |
16656 | |
16657 /* "pysam/libctabix.pyx":763 | |
16658 * break | |
16659 * | |
16660 * return dret # <<<<<<<<<<<<<< | |
16661 * return -1 | |
16662 * | |
16663 */ | |
16664 __pyx_r = __pyx_v_dret; | |
16665 goto __pyx_L0; | |
16666 } | |
16667 __pyx_L4_break:; | |
16668 | |
16669 /* "pysam/libctabix.pyx":764 | |
16670 * | |
16671 * return dret | |
16672 * return -1 # <<<<<<<<<<<<<< | |
16673 * | |
16674 * def __next__(self): | |
16675 */ | |
16676 __pyx_r = -1; | |
16677 goto __pyx_L0; | |
16678 | |
16679 /* "pysam/libctabix.pyx":753 | |
16680 * return self | |
16681 * | |
16682 * cdef int __cnext__(self): # <<<<<<<<<<<<<< | |
16683 * cdef int dret = 0 | |
16684 * cdef int retval = 0 | |
16685 */ | |
16686 | |
16687 /* function exit code */ | |
16688 __pyx_L1_error:; | |
16689 __Pyx_AddTraceback("pysam.libctabix.GZIterator.__cnext__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16690 __pyx_r = 0; | |
16691 __pyx_L0:; | |
16692 __Pyx_TraceReturn(Py_None, 0); | |
16693 return __pyx_r; | |
16694 } | |
16695 | |
16696 /* "pysam/libctabix.pyx":766 | |
16697 * return -1 | |
16698 * | |
16699 * def __next__(self): # <<<<<<<<<<<<<< | |
16700 * """python version of next(). | |
16701 * """ | |
16702 */ | |
16703 | |
16704 /* Python wrapper */ | |
16705 static PyObject *__pyx_pw_5pysam_9libctabix_10GZIterator_7__next__(PyObject *__pyx_v_self); /*proto*/ | |
16706 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_10GZIterator_6__next__, "python version of next().\n "); | |
16707 #if CYTHON_UPDATE_DESCRIPTOR_DOC | |
16708 struct wrapperbase __pyx_wrapperbase_5pysam_9libctabix_10GZIterator_6__next__; | |
16709 #endif | |
16710 static PyObject *__pyx_pw_5pysam_9libctabix_10GZIterator_7__next__(PyObject *__pyx_v_self) { | |
16711 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
16712 PyObject *__pyx_r = 0; | |
16713 __Pyx_RefNannyDeclarations | |
16714 __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); | |
16715 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
16716 __pyx_r = __pyx_pf_5pysam_9libctabix_10GZIterator_6__next__(((struct __pyx_obj_5pysam_9libctabix_GZIterator *)__pyx_v_self)); | |
16717 | |
16718 /* function exit code */ | |
16719 __Pyx_RefNannyFinishContext(); | |
16720 return __pyx_r; | |
16721 } | |
16722 | |
16723 static PyObject *__pyx_pf_5pysam_9libctabix_10GZIterator_6__next__(struct __pyx_obj_5pysam_9libctabix_GZIterator *__pyx_v_self) { | |
16724 int __pyx_v_retval; | |
16725 PyObject *__pyx_r = NULL; | |
16726 __Pyx_TraceDeclarations | |
16727 __Pyx_RefNannyDeclarations | |
16728 int __pyx_error_without_exception = 0; /* StopIteration */ | |
16729 int __pyx_t_1; | |
16730 int __pyx_t_2; | |
16731 PyObject *__pyx_t_3 = NULL; | |
16732 PyObject *__pyx_t_4 = NULL; | |
16733 PyObject *__pyx_t_5 = NULL; | |
16734 struct __pyx_opt_args_5pysam_9libcutils_force_str __pyx_t_6; | |
16735 int __pyx_lineno = 0; | |
16736 const char *__pyx_filename = NULL; | |
16737 int __pyx_clineno = 0; | |
16738 __Pyx_RefNannySetupContext("__next__", 1); | |
16739 __Pyx_TraceCall("__next__", __pyx_f[0], 766, 0, __PYX_ERR(0, 766, __pyx_L1_error)); | |
16740 | |
16741 /* "pysam/libctabix.pyx":769 | |
16742 * """python version of next(). | |
16743 * """ | |
16744 * cdef int retval = self.__cnext__() # <<<<<<<<<<<<<< | |
16745 * if retval < 0: | |
16746 * raise StopIteration | |
16747 */ | |
16748 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_9libctabix_GZIterator *)__pyx_v_self->__pyx_vtab)->__pyx___cnext__(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 769, __pyx_L1_error) | |
16749 __pyx_v_retval = __pyx_t_1; | |
16750 | |
16751 /* "pysam/libctabix.pyx":770 | |
16752 * """ | |
16753 * cdef int retval = self.__cnext__() | |
16754 * if retval < 0: # <<<<<<<<<<<<<< | |
16755 * raise StopIteration | |
16756 * return force_str(self.buffer.s, self.encoding) | |
16757 */ | |
16758 __pyx_t_2 = (__pyx_v_retval < 0); | |
16759 if (unlikely(__pyx_t_2)) { | |
16760 | |
16761 /* "pysam/libctabix.pyx":771 | |
16762 * cdef int retval = self.__cnext__() | |
16763 * if retval < 0: | |
16764 * raise StopIteration # <<<<<<<<<<<<<< | |
16765 * return force_str(self.buffer.s, self.encoding) | |
16766 * | |
16767 */ | |
16768 __pyx_error_without_exception = 1; | |
16769 goto __pyx_L1_error;; | |
16770 | |
16771 /* "pysam/libctabix.pyx":770 | |
16772 * """ | |
16773 * cdef int retval = self.__cnext__() | |
16774 * if retval < 0: # <<<<<<<<<<<<<< | |
16775 * raise StopIteration | |
16776 * return force_str(self.buffer.s, self.encoding) | |
16777 */ | |
16778 } | |
16779 | |
16780 /* "pysam/libctabix.pyx":772 | |
16781 * if retval < 0: | |
16782 * raise StopIteration | |
16783 * return force_str(self.buffer.s, self.encoding) # <<<<<<<<<<<<<< | |
16784 * | |
16785 * | |
16786 */ | |
16787 __Pyx_XDECREF(__pyx_r); | |
16788 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_self->buffer.s); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 772, __pyx_L1_error) | |
16789 __Pyx_GOTREF(__pyx_t_3); | |
16790 __pyx_t_4 = __pyx_v_self->encoding; | |
16791 __Pyx_INCREF(__pyx_t_4); | |
16792 __pyx_t_6.__pyx_n = 1; | |
16793 __pyx_t_6.encoding = __pyx_t_4; | |
16794 __pyx_t_5 = __pyx_f_5pysam_9libcutils_force_str(__pyx_t_3, &__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 772, __pyx_L1_error) | |
16795 __Pyx_GOTREF(__pyx_t_5); | |
16796 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
16797 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
16798 __pyx_r = __pyx_t_5; | |
16799 __pyx_t_5 = 0; | |
16800 goto __pyx_L0; | |
16801 | |
16802 /* "pysam/libctabix.pyx":766 | |
16803 * return -1 | |
16804 * | |
16805 * def __next__(self): # <<<<<<<<<<<<<< | |
16806 * """python version of next(). | |
16807 * """ | |
16808 */ | |
16809 | |
16810 /* function exit code */ | |
16811 __pyx_L1_error:; | |
16812 __Pyx_XDECREF(__pyx_t_3); | |
16813 __Pyx_XDECREF(__pyx_t_4); | |
16814 __Pyx_XDECREF(__pyx_t_5); | |
16815 if (!__pyx_error_without_exception) { | |
16816 __Pyx_AddTraceback("pysam.libctabix.GZIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16817 } | |
16818 __pyx_r = NULL; | |
16819 __pyx_L0:; | |
16820 __Pyx_XGIVEREF(__pyx_r); | |
16821 __Pyx_TraceReturn(__pyx_r, 0); | |
16822 __Pyx_RefNannyFinishContext(); | |
16823 return __pyx_r; | |
16824 } | |
16825 | |
16826 /* "(tree fragment)":1 | |
16827 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
16828 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
16829 * def __setstate_cython__(self, __pyx_state): | |
16830 */ | |
16831 | |
16832 /* Python wrapper */ | |
16833 static PyObject *__pyx_pw_5pysam_9libctabix_10GZIterator_9__reduce_cython__(PyObject *__pyx_v_self, | |
16834 #if CYTHON_METH_FASTCALL | |
16835 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16836 #else | |
16837 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16838 #endif | |
16839 ); /*proto*/ | |
16840 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_10GZIterator_8__reduce_cython__, "GZIterator.__reduce_cython__(self)"); | |
16841 static PyMethodDef __pyx_mdef_5pysam_9libctabix_10GZIterator_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_10GZIterator_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_10GZIterator_8__reduce_cython__}; | |
16842 static PyObject *__pyx_pw_5pysam_9libctabix_10GZIterator_9__reduce_cython__(PyObject *__pyx_v_self, | |
16843 #if CYTHON_METH_FASTCALL | |
16844 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16845 #else | |
16846 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16847 #endif | |
16848 ) { | |
16849 #if !CYTHON_METH_FASTCALL | |
16850 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
16851 #endif | |
16852 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
16853 PyObject *__pyx_r = 0; | |
16854 __Pyx_RefNannyDeclarations | |
16855 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
16856 #if !CYTHON_METH_FASTCALL | |
16857 #if CYTHON_ASSUME_SAFE_MACROS | |
16858 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
16859 #else | |
16860 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
16861 #endif | |
16862 #endif | |
16863 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
16864 if (unlikely(__pyx_nargs > 0)) { | |
16865 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
16866 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
16867 __pyx_r = __pyx_pf_5pysam_9libctabix_10GZIterator_8__reduce_cython__(((struct __pyx_obj_5pysam_9libctabix_GZIterator *)__pyx_v_self)); | |
16868 | |
16869 /* function exit code */ | |
16870 __Pyx_RefNannyFinishContext(); | |
16871 return __pyx_r; | |
16872 } | |
16873 | |
16874 static PyObject *__pyx_pf_5pysam_9libctabix_10GZIterator_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_GZIterator *__pyx_v_self) { | |
16875 PyObject *__pyx_r = NULL; | |
16876 __Pyx_TraceDeclarations | |
16877 __Pyx_RefNannyDeclarations | |
16878 int __pyx_lineno = 0; | |
16879 const char *__pyx_filename = NULL; | |
16880 int __pyx_clineno = 0; | |
16881 __Pyx_TraceFrameInit(__pyx_codeobj__31) | |
16882 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
16883 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
16884 | |
16885 /* "(tree fragment)":2 | |
16886 * def __reduce_cython__(self): | |
16887 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< | |
16888 * def __setstate_cython__(self, __pyx_state): | |
16889 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
16890 */ | |
16891 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_gzipfile_self_kstream_canno, 0, 0); | |
16892 __PYX_ERR(1, 2, __pyx_L1_error) | |
16893 | |
16894 /* "(tree fragment)":1 | |
16895 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
16896 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
16897 * def __setstate_cython__(self, __pyx_state): | |
16898 */ | |
16899 | |
16900 /* function exit code */ | |
16901 __pyx_L1_error:; | |
16902 __Pyx_AddTraceback("pysam.libctabix.GZIterator.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16903 __pyx_r = NULL; | |
16904 __Pyx_XGIVEREF(__pyx_r); | |
16905 __Pyx_TraceReturn(__pyx_r, 0); | |
16906 __Pyx_RefNannyFinishContext(); | |
16907 return __pyx_r; | |
16908 } | |
16909 | |
16910 /* "(tree fragment)":3 | |
16911 * def __reduce_cython__(self): | |
16912 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
16913 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
16914 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
16915 */ | |
16916 | |
16917 /* Python wrapper */ | |
16918 static PyObject *__pyx_pw_5pysam_9libctabix_10GZIterator_11__setstate_cython__(PyObject *__pyx_v_self, | |
16919 #if CYTHON_METH_FASTCALL | |
16920 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16921 #else | |
16922 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16923 #endif | |
16924 ); /*proto*/ | |
16925 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_10GZIterator_10__setstate_cython__, "GZIterator.__setstate_cython__(self, __pyx_state)"); | |
16926 static PyMethodDef __pyx_mdef_5pysam_9libctabix_10GZIterator_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_10GZIterator_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_10GZIterator_10__setstate_cython__}; | |
16927 static PyObject *__pyx_pw_5pysam_9libctabix_10GZIterator_11__setstate_cython__(PyObject *__pyx_v_self, | |
16928 #if CYTHON_METH_FASTCALL | |
16929 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16930 #else | |
16931 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16932 #endif | |
16933 ) { | |
16934 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; | |
16935 #if !CYTHON_METH_FASTCALL | |
16936 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
16937 #endif | |
16938 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
16939 PyObject* values[1] = {0}; | |
16940 int __pyx_lineno = 0; | |
16941 const char *__pyx_filename = NULL; | |
16942 int __pyx_clineno = 0; | |
16943 PyObject *__pyx_r = 0; | |
16944 __Pyx_RefNannyDeclarations | |
16945 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
16946 #if !CYTHON_METH_FASTCALL | |
16947 #if CYTHON_ASSUME_SAFE_MACROS | |
16948 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
16949 #else | |
16950 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
16951 #endif | |
16952 #endif | |
16953 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
16954 { | |
16955 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
16956 if (__pyx_kwds) { | |
16957 Py_ssize_t kw_args; | |
16958 switch (__pyx_nargs) { | |
16959 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
16960 CYTHON_FALLTHROUGH; | |
16961 case 0: break; | |
16962 default: goto __pyx_L5_argtuple_error; | |
16963 } | |
16964 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
16965 switch (__pyx_nargs) { | |
16966 case 0: | |
16967 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
16968 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
16969 kw_args--; | |
16970 } | |
16971 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) | |
16972 else goto __pyx_L5_argtuple_error; | |
16973 } | |
16974 if (unlikely(kw_args > 0)) { | |
16975 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
16976 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) | |
16977 } | |
16978 } else if (unlikely(__pyx_nargs != 1)) { | |
16979 goto __pyx_L5_argtuple_error; | |
16980 } else { | |
16981 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
16982 } | |
16983 __pyx_v___pyx_state = values[0]; | |
16984 } | |
16985 goto __pyx_L6_skip; | |
16986 __pyx_L5_argtuple_error:; | |
16987 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) | |
16988 __pyx_L6_skip:; | |
16989 goto __pyx_L4_argument_unpacking_done; | |
16990 __pyx_L3_error:; | |
16991 { | |
16992 Py_ssize_t __pyx_temp; | |
16993 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
16994 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
16995 } | |
16996 } | |
16997 __Pyx_AddTraceback("pysam.libctabix.GZIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16998 __Pyx_RefNannyFinishContext(); | |
16999 return NULL; | |
17000 __pyx_L4_argument_unpacking_done:; | |
17001 __pyx_r = __pyx_pf_5pysam_9libctabix_10GZIterator_10__setstate_cython__(((struct __pyx_obj_5pysam_9libctabix_GZIterator *)__pyx_v_self), __pyx_v___pyx_state); | |
17002 | |
17003 /* function exit code */ | |
17004 { | |
17005 Py_ssize_t __pyx_temp; | |
17006 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
17007 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
17008 } | |
17009 } | |
17010 __Pyx_RefNannyFinishContext(); | |
17011 return __pyx_r; | |
17012 } | |
17013 | |
17014 static PyObject *__pyx_pf_5pysam_9libctabix_10GZIterator_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_GZIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { | |
17015 PyObject *__pyx_r = NULL; | |
17016 __Pyx_TraceDeclarations | |
17017 __Pyx_RefNannyDeclarations | |
17018 int __pyx_lineno = 0; | |
17019 const char *__pyx_filename = NULL; | |
17020 int __pyx_clineno = 0; | |
17021 __Pyx_TraceFrameInit(__pyx_codeobj__32) | |
17022 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
17023 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); | |
17024 | |
17025 /* "(tree fragment)":4 | |
17026 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17027 * def __setstate_cython__(self, __pyx_state): | |
17028 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< | |
17029 */ | |
17030 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_gzipfile_self_kstream_canno, 0, 0); | |
17031 __PYX_ERR(1, 4, __pyx_L1_error) | |
17032 | |
17033 /* "(tree fragment)":3 | |
17034 * def __reduce_cython__(self): | |
17035 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17036 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
17037 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17038 */ | |
17039 | |
17040 /* function exit code */ | |
17041 __pyx_L1_error:; | |
17042 __Pyx_AddTraceback("pysam.libctabix.GZIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
17043 __pyx_r = NULL; | |
17044 __Pyx_XGIVEREF(__pyx_r); | |
17045 __Pyx_TraceReturn(__pyx_r, 0); | |
17046 __Pyx_RefNannyFinishContext(); | |
17047 return __pyx_r; | |
17048 } | |
17049 | |
17050 /* "pysam/libctabix.pyx":780 | |
17051 * ''' | |
17052 * | |
17053 * def __next__(self): # <<<<<<<<<<<<<< | |
17054 * """python version of next(). | |
17055 * """ | |
17056 */ | |
17057 | |
17058 /* Python wrapper */ | |
17059 static PyObject *__pyx_pw_5pysam_9libctabix_14GZIteratorHead_1__next__(PyObject *__pyx_v_self); /*proto*/ | |
17060 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_14GZIteratorHead___next__, "python version of next().\n "); | |
17061 #if CYTHON_UPDATE_DESCRIPTOR_DOC | |
17062 struct wrapperbase __pyx_wrapperbase_5pysam_9libctabix_14GZIteratorHead___next__; | |
17063 #endif | |
17064 static PyObject *__pyx_pw_5pysam_9libctabix_14GZIteratorHead_1__next__(PyObject *__pyx_v_self) { | |
17065 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
17066 PyObject *__pyx_r = 0; | |
17067 __Pyx_RefNannyDeclarations | |
17068 __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); | |
17069 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
17070 __pyx_r = __pyx_pf_5pysam_9libctabix_14GZIteratorHead___next__(((struct __pyx_obj_5pysam_9libctabix_GZIteratorHead *)__pyx_v_self)); | |
17071 | |
17072 /* function exit code */ | |
17073 __Pyx_RefNannyFinishContext(); | |
17074 return __pyx_r; | |
17075 } | |
17076 | |
17077 static PyObject *__pyx_pf_5pysam_9libctabix_14GZIteratorHead___next__(struct __pyx_obj_5pysam_9libctabix_GZIteratorHead *__pyx_v_self) { | |
17078 int __pyx_v_retval; | |
17079 PyObject *__pyx_r = NULL; | |
17080 __Pyx_TraceDeclarations | |
17081 __Pyx_RefNannyDeclarations | |
17082 int __pyx_error_without_exception = 0; /* StopIteration */ | |
17083 int __pyx_t_1; | |
17084 int __pyx_t_2; | |
17085 PyObject *__pyx_t_3 = NULL; | |
17086 int __pyx_lineno = 0; | |
17087 const char *__pyx_filename = NULL; | |
17088 int __pyx_clineno = 0; | |
17089 __Pyx_RefNannySetupContext("__next__", 1); | |
17090 __Pyx_TraceCall("__next__", __pyx_f[0], 780, 0, __PYX_ERR(0, 780, __pyx_L1_error)); | |
17091 | |
17092 /* "pysam/libctabix.pyx":783 | |
17093 * """python version of next(). | |
17094 * """ | |
17095 * cdef int retval = self.__cnext__() # <<<<<<<<<<<<<< | |
17096 * if retval < 0: | |
17097 * raise StopIteration | |
17098 */ | |
17099 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_9libctabix_GZIteratorHead *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.__pyx___cnext__(((struct __pyx_obj_5pysam_9libctabix_GZIterator *)__pyx_v_self)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 783, __pyx_L1_error) | |
17100 __pyx_v_retval = __pyx_t_1; | |
17101 | |
17102 /* "pysam/libctabix.pyx":784 | |
17103 * """ | |
17104 * cdef int retval = self.__cnext__() | |
17105 * if retval < 0: # <<<<<<<<<<<<<< | |
17106 * raise StopIteration | |
17107 * if self.buffer.s[0] == b'#': | |
17108 */ | |
17109 __pyx_t_2 = (__pyx_v_retval < 0); | |
17110 if (unlikely(__pyx_t_2)) { | |
17111 | |
17112 /* "pysam/libctabix.pyx":785 | |
17113 * cdef int retval = self.__cnext__() | |
17114 * if retval < 0: | |
17115 * raise StopIteration # <<<<<<<<<<<<<< | |
17116 * if self.buffer.s[0] == b'#': | |
17117 * return self.buffer.s | |
17118 */ | |
17119 __pyx_error_without_exception = 1; | |
17120 goto __pyx_L1_error;; | |
17121 | |
17122 /* "pysam/libctabix.pyx":784 | |
17123 * """ | |
17124 * cdef int retval = self.__cnext__() | |
17125 * if retval < 0: # <<<<<<<<<<<<<< | |
17126 * raise StopIteration | |
17127 * if self.buffer.s[0] == b'#': | |
17128 */ | |
17129 } | |
17130 | |
17131 /* "pysam/libctabix.pyx":786 | |
17132 * if retval < 0: | |
17133 * raise StopIteration | |
17134 * if self.buffer.s[0] == b'#': # <<<<<<<<<<<<<< | |
17135 * return self.buffer.s | |
17136 * else: | |
17137 */ | |
17138 __pyx_t_2 = ((__pyx_v_self->__pyx_base.buffer.s[0]) == '#'); | |
17139 if (likely(__pyx_t_2)) { | |
17140 | |
17141 /* "pysam/libctabix.pyx":787 | |
17142 * raise StopIteration | |
17143 * if self.buffer.s[0] == b'#': | |
17144 * return self.buffer.s # <<<<<<<<<<<<<< | |
17145 * else: | |
17146 * raise StopIteration | |
17147 */ | |
17148 __Pyx_XDECREF(__pyx_r); | |
17149 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.buffer.s); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 787, __pyx_L1_error) | |
17150 __Pyx_GOTREF(__pyx_t_3); | |
17151 __pyx_r = __pyx_t_3; | |
17152 __pyx_t_3 = 0; | |
17153 goto __pyx_L0; | |
17154 | |
17155 /* "pysam/libctabix.pyx":786 | |
17156 * if retval < 0: | |
17157 * raise StopIteration | |
17158 * if self.buffer.s[0] == b'#': # <<<<<<<<<<<<<< | |
17159 * return self.buffer.s | |
17160 * else: | |
17161 */ | |
17162 } | |
17163 | |
17164 /* "pysam/libctabix.pyx":789 | |
17165 * return self.buffer.s | |
17166 * else: | |
17167 * raise StopIteration # <<<<<<<<<<<<<< | |
17168 * | |
17169 * | |
17170 */ | |
17171 /*else*/ { | |
17172 __pyx_error_without_exception = 1; | |
17173 goto __pyx_L1_error;; | |
17174 } | |
17175 | |
17176 /* "pysam/libctabix.pyx":780 | |
17177 * ''' | |
17178 * | |
17179 * def __next__(self): # <<<<<<<<<<<<<< | |
17180 * """python version of next(). | |
17181 * """ | |
17182 */ | |
17183 | |
17184 /* function exit code */ | |
17185 __pyx_L1_error:; | |
17186 __Pyx_XDECREF(__pyx_t_3); | |
17187 if (!__pyx_error_without_exception) { | |
17188 __Pyx_AddTraceback("pysam.libctabix.GZIteratorHead.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
17189 } | |
17190 __pyx_r = NULL; | |
17191 __pyx_L0:; | |
17192 __Pyx_XGIVEREF(__pyx_r); | |
17193 __Pyx_TraceReturn(__pyx_r, 0); | |
17194 __Pyx_RefNannyFinishContext(); | |
17195 return __pyx_r; | |
17196 } | |
17197 | |
17198 /* "(tree fragment)":1 | |
17199 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
17200 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17201 * def __setstate_cython__(self, __pyx_state): | |
17202 */ | |
17203 | |
17204 /* Python wrapper */ | |
17205 static PyObject *__pyx_pw_5pysam_9libctabix_14GZIteratorHead_3__reduce_cython__(PyObject *__pyx_v_self, | |
17206 #if CYTHON_METH_FASTCALL | |
17207 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
17208 #else | |
17209 PyObject *__pyx_args, PyObject *__pyx_kwds | |
17210 #endif | |
17211 ); /*proto*/ | |
17212 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_14GZIteratorHead_2__reduce_cython__, "GZIteratorHead.__reduce_cython__(self)"); | |
17213 static PyMethodDef __pyx_mdef_5pysam_9libctabix_14GZIteratorHead_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_14GZIteratorHead_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_14GZIteratorHead_2__reduce_cython__}; | |
17214 static PyObject *__pyx_pw_5pysam_9libctabix_14GZIteratorHead_3__reduce_cython__(PyObject *__pyx_v_self, | |
17215 #if CYTHON_METH_FASTCALL | |
17216 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
17217 #else | |
17218 PyObject *__pyx_args, PyObject *__pyx_kwds | |
17219 #endif | |
17220 ) { | |
17221 #if !CYTHON_METH_FASTCALL | |
17222 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
17223 #endif | |
17224 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
17225 PyObject *__pyx_r = 0; | |
17226 __Pyx_RefNannyDeclarations | |
17227 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
17228 #if !CYTHON_METH_FASTCALL | |
17229 #if CYTHON_ASSUME_SAFE_MACROS | |
17230 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
17231 #else | |
17232 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
17233 #endif | |
17234 #endif | |
17235 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
17236 if (unlikely(__pyx_nargs > 0)) { | |
17237 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
17238 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
17239 __pyx_r = __pyx_pf_5pysam_9libctabix_14GZIteratorHead_2__reduce_cython__(((struct __pyx_obj_5pysam_9libctabix_GZIteratorHead *)__pyx_v_self)); | |
17240 | |
17241 /* function exit code */ | |
17242 __Pyx_RefNannyFinishContext(); | |
17243 return __pyx_r; | |
17244 } | |
17245 | |
17246 static PyObject *__pyx_pf_5pysam_9libctabix_14GZIteratorHead_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_GZIteratorHead *__pyx_v_self) { | |
17247 PyObject *__pyx_r = NULL; | |
17248 __Pyx_TraceDeclarations | |
17249 __Pyx_RefNannyDeclarations | |
17250 int __pyx_lineno = 0; | |
17251 const char *__pyx_filename = NULL; | |
17252 int __pyx_clineno = 0; | |
17253 __Pyx_TraceFrameInit(__pyx_codeobj__33) | |
17254 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
17255 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
17256 | |
17257 /* "(tree fragment)":2 | |
17258 * def __reduce_cython__(self): | |
17259 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< | |
17260 * def __setstate_cython__(self, __pyx_state): | |
17261 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17262 */ | |
17263 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_gzipfile_self_kstream_canno, 0, 0); | |
17264 __PYX_ERR(1, 2, __pyx_L1_error) | |
17265 | |
17266 /* "(tree fragment)":1 | |
17267 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
17268 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17269 * def __setstate_cython__(self, __pyx_state): | |
17270 */ | |
17271 | |
17272 /* function exit code */ | |
17273 __pyx_L1_error:; | |
17274 __Pyx_AddTraceback("pysam.libctabix.GZIteratorHead.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
17275 __pyx_r = NULL; | |
17276 __Pyx_XGIVEREF(__pyx_r); | |
17277 __Pyx_TraceReturn(__pyx_r, 0); | |
17278 __Pyx_RefNannyFinishContext(); | |
17279 return __pyx_r; | |
17280 } | |
17281 | |
17282 /* "(tree fragment)":3 | |
17283 * def __reduce_cython__(self): | |
17284 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17285 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
17286 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17287 */ | |
17288 | |
17289 /* Python wrapper */ | |
17290 static PyObject *__pyx_pw_5pysam_9libctabix_14GZIteratorHead_5__setstate_cython__(PyObject *__pyx_v_self, | |
17291 #if CYTHON_METH_FASTCALL | |
17292 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
17293 #else | |
17294 PyObject *__pyx_args, PyObject *__pyx_kwds | |
17295 #endif | |
17296 ); /*proto*/ | |
17297 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_14GZIteratorHead_4__setstate_cython__, "GZIteratorHead.__setstate_cython__(self, __pyx_state)"); | |
17298 static PyMethodDef __pyx_mdef_5pysam_9libctabix_14GZIteratorHead_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_14GZIteratorHead_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_14GZIteratorHead_4__setstate_cython__}; | |
17299 static PyObject *__pyx_pw_5pysam_9libctabix_14GZIteratorHead_5__setstate_cython__(PyObject *__pyx_v_self, | |
17300 #if CYTHON_METH_FASTCALL | |
17301 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
17302 #else | |
17303 PyObject *__pyx_args, PyObject *__pyx_kwds | |
17304 #endif | |
17305 ) { | |
17306 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; | |
17307 #if !CYTHON_METH_FASTCALL | |
17308 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
17309 #endif | |
17310 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
17311 PyObject* values[1] = {0}; | |
17312 int __pyx_lineno = 0; | |
17313 const char *__pyx_filename = NULL; | |
17314 int __pyx_clineno = 0; | |
17315 PyObject *__pyx_r = 0; | |
17316 __Pyx_RefNannyDeclarations | |
17317 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
17318 #if !CYTHON_METH_FASTCALL | |
17319 #if CYTHON_ASSUME_SAFE_MACROS | |
17320 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
17321 #else | |
17322 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
17323 #endif | |
17324 #endif | |
17325 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
17326 { | |
17327 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
17328 if (__pyx_kwds) { | |
17329 Py_ssize_t kw_args; | |
17330 switch (__pyx_nargs) { | |
17331 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
17332 CYTHON_FALLTHROUGH; | |
17333 case 0: break; | |
17334 default: goto __pyx_L5_argtuple_error; | |
17335 } | |
17336 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
17337 switch (__pyx_nargs) { | |
17338 case 0: | |
17339 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
17340 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
17341 kw_args--; | |
17342 } | |
17343 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) | |
17344 else goto __pyx_L5_argtuple_error; | |
17345 } | |
17346 if (unlikely(kw_args > 0)) { | |
17347 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
17348 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) | |
17349 } | |
17350 } else if (unlikely(__pyx_nargs != 1)) { | |
17351 goto __pyx_L5_argtuple_error; | |
17352 } else { | |
17353 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
17354 } | |
17355 __pyx_v___pyx_state = values[0]; | |
17356 } | |
17357 goto __pyx_L6_skip; | |
17358 __pyx_L5_argtuple_error:; | |
17359 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) | |
17360 __pyx_L6_skip:; | |
17361 goto __pyx_L4_argument_unpacking_done; | |
17362 __pyx_L3_error:; | |
17363 { | |
17364 Py_ssize_t __pyx_temp; | |
17365 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
17366 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
17367 } | |
17368 } | |
17369 __Pyx_AddTraceback("pysam.libctabix.GZIteratorHead.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
17370 __Pyx_RefNannyFinishContext(); | |
17371 return NULL; | |
17372 __pyx_L4_argument_unpacking_done:; | |
17373 __pyx_r = __pyx_pf_5pysam_9libctabix_14GZIteratorHead_4__setstate_cython__(((struct __pyx_obj_5pysam_9libctabix_GZIteratorHead *)__pyx_v_self), __pyx_v___pyx_state); | |
17374 | |
17375 /* function exit code */ | |
17376 { | |
17377 Py_ssize_t __pyx_temp; | |
17378 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
17379 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
17380 } | |
17381 } | |
17382 __Pyx_RefNannyFinishContext(); | |
17383 return __pyx_r; | |
17384 } | |
17385 | |
17386 static PyObject *__pyx_pf_5pysam_9libctabix_14GZIteratorHead_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_GZIteratorHead *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { | |
17387 PyObject *__pyx_r = NULL; | |
17388 __Pyx_TraceDeclarations | |
17389 __Pyx_RefNannyDeclarations | |
17390 int __pyx_lineno = 0; | |
17391 const char *__pyx_filename = NULL; | |
17392 int __pyx_clineno = 0; | |
17393 __Pyx_TraceFrameInit(__pyx_codeobj__34) | |
17394 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
17395 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); | |
17396 | |
17397 /* "(tree fragment)":4 | |
17398 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17399 * def __setstate_cython__(self, __pyx_state): | |
17400 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< | |
17401 */ | |
17402 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_gzipfile_self_kstream_canno, 0, 0); | |
17403 __PYX_ERR(1, 4, __pyx_L1_error) | |
17404 | |
17405 /* "(tree fragment)":3 | |
17406 * def __reduce_cython__(self): | |
17407 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17408 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
17409 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17410 */ | |
17411 | |
17412 /* function exit code */ | |
17413 __pyx_L1_error:; | |
17414 __Pyx_AddTraceback("pysam.libctabix.GZIteratorHead.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
17415 __pyx_r = NULL; | |
17416 __Pyx_XGIVEREF(__pyx_r); | |
17417 __Pyx_TraceReturn(__pyx_r, 0); | |
17418 __Pyx_RefNannyFinishContext(); | |
17419 return __pyx_r; | |
17420 } | |
17421 | |
17422 /* "pysam/libctabix.pyx":797 | |
17423 * ''' | |
17424 * | |
17425 * def __init__(self, parser): # <<<<<<<<<<<<<< | |
17426 * self.parser = parser | |
17427 * | |
17428 */ | |
17429 | |
17430 /* Python wrapper */ | |
17431 static int __pyx_pw_5pysam_9libctabix_16GZIteratorParsed_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
17432 static int __pyx_pw_5pysam_9libctabix_16GZIteratorParsed_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
17433 PyObject *__pyx_v_parser = 0; | |
17434 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
17435 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
17436 PyObject* values[1] = {0}; | |
17437 int __pyx_lineno = 0; | |
17438 const char *__pyx_filename = NULL; | |
17439 int __pyx_clineno = 0; | |
17440 int __pyx_r; | |
17441 __Pyx_RefNannyDeclarations | |
17442 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); | |
17443 #if CYTHON_ASSUME_SAFE_MACROS | |
17444 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
17445 #else | |
17446 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; | |
17447 #endif | |
17448 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
17449 { | |
17450 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_parser,0}; | |
17451 if (__pyx_kwds) { | |
17452 Py_ssize_t kw_args; | |
17453 switch (__pyx_nargs) { | |
17454 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
17455 CYTHON_FALLTHROUGH; | |
17456 case 0: break; | |
17457 default: goto __pyx_L5_argtuple_error; | |
17458 } | |
17459 kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); | |
17460 switch (__pyx_nargs) { | |
17461 case 0: | |
17462 if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_parser)) != 0)) { | |
17463 (void)__Pyx_Arg_NewRef_VARARGS(values[0]); | |
17464 kw_args--; | |
17465 } | |
17466 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 797, __pyx_L3_error) | |
17467 else goto __pyx_L5_argtuple_error; | |
17468 } | |
17469 if (unlikely(kw_args > 0)) { | |
17470 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
17471 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 797, __pyx_L3_error) | |
17472 } | |
17473 } else if (unlikely(__pyx_nargs != 1)) { | |
17474 goto __pyx_L5_argtuple_error; | |
17475 } else { | |
17476 values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
17477 } | |
17478 __pyx_v_parser = values[0]; | |
17479 } | |
17480 goto __pyx_L6_skip; | |
17481 __pyx_L5_argtuple_error:; | |
17482 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 797, __pyx_L3_error) | |
17483 __pyx_L6_skip:; | |
17484 goto __pyx_L4_argument_unpacking_done; | |
17485 __pyx_L3_error:; | |
17486 { | |
17487 Py_ssize_t __pyx_temp; | |
17488 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
17489 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
17490 } | |
17491 } | |
17492 __Pyx_AddTraceback("pysam.libctabix.GZIteratorParsed.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
17493 __Pyx_RefNannyFinishContext(); | |
17494 return -1; | |
17495 __pyx_L4_argument_unpacking_done:; | |
17496 __pyx_r = __pyx_pf_5pysam_9libctabix_16GZIteratorParsed___init__(((struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *)__pyx_v_self), __pyx_v_parser); | |
17497 | |
17498 /* function exit code */ | |
17499 { | |
17500 Py_ssize_t __pyx_temp; | |
17501 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
17502 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
17503 } | |
17504 } | |
17505 __Pyx_RefNannyFinishContext(); | |
17506 return __pyx_r; | |
17507 } | |
17508 | |
17509 static int __pyx_pf_5pysam_9libctabix_16GZIteratorParsed___init__(struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *__pyx_v_self, PyObject *__pyx_v_parser) { | |
17510 int __pyx_r; | |
17511 __Pyx_TraceDeclarations | |
17512 __Pyx_RefNannyDeclarations | |
17513 PyObject *__pyx_t_1 = NULL; | |
17514 int __pyx_lineno = 0; | |
17515 const char *__pyx_filename = NULL; | |
17516 int __pyx_clineno = 0; | |
17517 __Pyx_RefNannySetupContext("__init__", 1); | |
17518 __Pyx_TraceCall("__init__", __pyx_f[0], 797, 0, __PYX_ERR(0, 797, __pyx_L1_error)); | |
17519 | |
17520 /* "pysam/libctabix.pyx":798 | |
17521 * | |
17522 * def __init__(self, parser): | |
17523 * self.parser = parser # <<<<<<<<<<<<<< | |
17524 * | |
17525 * def __next__(self): | |
17526 */ | |
17527 if (!(likely(((__pyx_v_parser) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_5pysam_9libctabix_Parser))))) __PYX_ERR(0, 798, __pyx_L1_error) | |
17528 __pyx_t_1 = __pyx_v_parser; | |
17529 __Pyx_INCREF(__pyx_t_1); | |
17530 __Pyx_GIVEREF(__pyx_t_1); | |
17531 __Pyx_GOTREF((PyObject *)__pyx_v_self->parser); | |
17532 __Pyx_DECREF((PyObject *)__pyx_v_self->parser); | |
17533 __pyx_v_self->parser = ((struct __pyx_obj_5pysam_9libctabix_Parser *)__pyx_t_1); | |
17534 __pyx_t_1 = 0; | |
17535 | |
17536 /* "pysam/libctabix.pyx":797 | |
17537 * ''' | |
17538 * | |
17539 * def __init__(self, parser): # <<<<<<<<<<<<<< | |
17540 * self.parser = parser | |
17541 * | |
17542 */ | |
17543 | |
17544 /* function exit code */ | |
17545 __pyx_r = 0; | |
17546 goto __pyx_L0; | |
17547 __pyx_L1_error:; | |
17548 __Pyx_XDECREF(__pyx_t_1); | |
17549 __Pyx_AddTraceback("pysam.libctabix.GZIteratorParsed.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
17550 __pyx_r = -1; | |
17551 __pyx_L0:; | |
17552 __Pyx_TraceReturn(Py_None, 0); | |
17553 __Pyx_RefNannyFinishContext(); | |
17554 return __pyx_r; | |
17555 } | |
17556 | |
17557 /* "pysam/libctabix.pyx":800 | |
17558 * self.parser = parser | |
17559 * | |
17560 * def __next__(self): # <<<<<<<<<<<<<< | |
17561 * """python version of next(). | |
17562 * """ | |
17563 */ | |
17564 | |
17565 /* Python wrapper */ | |
17566 static PyObject *__pyx_pw_5pysam_9libctabix_16GZIteratorParsed_3__next__(PyObject *__pyx_v_self); /*proto*/ | |
17567 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_16GZIteratorParsed_2__next__, "python version of next().\n "); | |
17568 #if CYTHON_UPDATE_DESCRIPTOR_DOC | |
17569 struct wrapperbase __pyx_wrapperbase_5pysam_9libctabix_16GZIteratorParsed_2__next__; | |
17570 #endif | |
17571 static PyObject *__pyx_pw_5pysam_9libctabix_16GZIteratorParsed_3__next__(PyObject *__pyx_v_self) { | |
17572 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
17573 PyObject *__pyx_r = 0; | |
17574 __Pyx_RefNannyDeclarations | |
17575 __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); | |
17576 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
17577 __pyx_r = __pyx_pf_5pysam_9libctabix_16GZIteratorParsed_2__next__(((struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *)__pyx_v_self)); | |
17578 | |
17579 /* function exit code */ | |
17580 __Pyx_RefNannyFinishContext(); | |
17581 return __pyx_r; | |
17582 } | |
17583 | |
17584 static PyObject *__pyx_pf_5pysam_9libctabix_16GZIteratorParsed_2__next__(struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *__pyx_v_self) { | |
17585 int __pyx_v_retval; | |
17586 PyObject *__pyx_r = NULL; | |
17587 __Pyx_TraceDeclarations | |
17588 __Pyx_RefNannyDeclarations | |
17589 int __pyx_error_without_exception = 0; /* StopIteration */ | |
17590 int __pyx_t_1; | |
17591 int __pyx_t_2; | |
17592 PyObject *__pyx_t_3 = NULL; | |
17593 int __pyx_lineno = 0; | |
17594 const char *__pyx_filename = NULL; | |
17595 int __pyx_clineno = 0; | |
17596 __Pyx_RefNannySetupContext("__next__", 1); | |
17597 __Pyx_TraceCall("__next__", __pyx_f[0], 800, 0, __PYX_ERR(0, 800, __pyx_L1_error)); | |
17598 | |
17599 /* "pysam/libctabix.pyx":803 | |
17600 * """python version of next(). | |
17601 * """ | |
17602 * cdef int retval = self.__cnext__() # <<<<<<<<<<<<<< | |
17603 * if retval < 0: | |
17604 * raise StopIteration | |
17605 */ | |
17606 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_9libctabix_GZIteratorParsed *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.__pyx___cnext__(((struct __pyx_obj_5pysam_9libctabix_GZIterator *)__pyx_v_self)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 803, __pyx_L1_error) | |
17607 __pyx_v_retval = __pyx_t_1; | |
17608 | |
17609 /* "pysam/libctabix.pyx":804 | |
17610 * """ | |
17611 * cdef int retval = self.__cnext__() | |
17612 * if retval < 0: # <<<<<<<<<<<<<< | |
17613 * raise StopIteration | |
17614 * | |
17615 */ | |
17616 __pyx_t_2 = (__pyx_v_retval < 0); | |
17617 if (unlikely(__pyx_t_2)) { | |
17618 | |
17619 /* "pysam/libctabix.pyx":805 | |
17620 * cdef int retval = self.__cnext__() | |
17621 * if retval < 0: | |
17622 * raise StopIteration # <<<<<<<<<<<<<< | |
17623 * | |
17624 * return self.parser.parse(self.buffer.s, | |
17625 */ | |
17626 __pyx_error_without_exception = 1; | |
17627 goto __pyx_L1_error;; | |
17628 | |
17629 /* "pysam/libctabix.pyx":804 | |
17630 * """ | |
17631 * cdef int retval = self.__cnext__() | |
17632 * if retval < 0: # <<<<<<<<<<<<<< | |
17633 * raise StopIteration | |
17634 * | |
17635 */ | |
17636 } | |
17637 | |
17638 /* "pysam/libctabix.pyx":807 | |
17639 * raise StopIteration | |
17640 * | |
17641 * return self.parser.parse(self.buffer.s, # <<<<<<<<<<<<<< | |
17642 * self.buffer.l) | |
17643 * | |
17644 */ | |
17645 __Pyx_XDECREF(__pyx_r); | |
17646 | |
17647 /* "pysam/libctabix.pyx":808 | |
17648 * | |
17649 * return self.parser.parse(self.buffer.s, | |
17650 * self.buffer.l) # <<<<<<<<<<<<<< | |
17651 * | |
17652 * | |
17653 */ | |
17654 __pyx_t_3 = ((struct __pyx_vtabstruct_5pysam_9libctabix_Parser *)__pyx_v_self->parser->__pyx_vtab)->parse(__pyx_v_self->parser, __pyx_v_self->__pyx_base.buffer.s, __pyx_v_self->__pyx_base.buffer.l); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error) | |
17655 __Pyx_GOTREF(__pyx_t_3); | |
17656 __pyx_r = __pyx_t_3; | |
17657 __pyx_t_3 = 0; | |
17658 goto __pyx_L0; | |
17659 | |
17660 /* "pysam/libctabix.pyx":800 | |
17661 * self.parser = parser | |
17662 * | |
17663 * def __next__(self): # <<<<<<<<<<<<<< | |
17664 * """python version of next(). | |
17665 * """ | |
17666 */ | |
17667 | |
17668 /* function exit code */ | |
17669 __pyx_L1_error:; | |
17670 __Pyx_XDECREF(__pyx_t_3); | |
17671 if (!__pyx_error_without_exception) { | |
17672 __Pyx_AddTraceback("pysam.libctabix.GZIteratorParsed.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
17673 } | |
17674 __pyx_r = NULL; | |
17675 __pyx_L0:; | |
17676 __Pyx_XGIVEREF(__pyx_r); | |
17677 __Pyx_TraceReturn(__pyx_r, 0); | |
17678 __Pyx_RefNannyFinishContext(); | |
17679 return __pyx_r; | |
17680 } | |
17681 | |
17682 /* "(tree fragment)":1 | |
17683 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
17684 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17685 * def __setstate_cython__(self, __pyx_state): | |
17686 */ | |
17687 | |
17688 /* Python wrapper */ | |
17689 static PyObject *__pyx_pw_5pysam_9libctabix_16GZIteratorParsed_5__reduce_cython__(PyObject *__pyx_v_self, | |
17690 #if CYTHON_METH_FASTCALL | |
17691 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
17692 #else | |
17693 PyObject *__pyx_args, PyObject *__pyx_kwds | |
17694 #endif | |
17695 ); /*proto*/ | |
17696 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_16GZIteratorParsed_4__reduce_cython__, "GZIteratorParsed.__reduce_cython__(self)"); | |
17697 static PyMethodDef __pyx_mdef_5pysam_9libctabix_16GZIteratorParsed_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_16GZIteratorParsed_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_16GZIteratorParsed_4__reduce_cython__}; | |
17698 static PyObject *__pyx_pw_5pysam_9libctabix_16GZIteratorParsed_5__reduce_cython__(PyObject *__pyx_v_self, | |
17699 #if CYTHON_METH_FASTCALL | |
17700 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
17701 #else | |
17702 PyObject *__pyx_args, PyObject *__pyx_kwds | |
17703 #endif | |
17704 ) { | |
17705 #if !CYTHON_METH_FASTCALL | |
17706 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
17707 #endif | |
17708 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
17709 PyObject *__pyx_r = 0; | |
17710 __Pyx_RefNannyDeclarations | |
17711 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
17712 #if !CYTHON_METH_FASTCALL | |
17713 #if CYTHON_ASSUME_SAFE_MACROS | |
17714 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
17715 #else | |
17716 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
17717 #endif | |
17718 #endif | |
17719 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
17720 if (unlikely(__pyx_nargs > 0)) { | |
17721 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
17722 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
17723 __pyx_r = __pyx_pf_5pysam_9libctabix_16GZIteratorParsed_4__reduce_cython__(((struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *)__pyx_v_self)); | |
17724 | |
17725 /* function exit code */ | |
17726 __Pyx_RefNannyFinishContext(); | |
17727 return __pyx_r; | |
17728 } | |
17729 | |
17730 static PyObject *__pyx_pf_5pysam_9libctabix_16GZIteratorParsed_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *__pyx_v_self) { | |
17731 PyObject *__pyx_r = NULL; | |
17732 __Pyx_TraceDeclarations | |
17733 __Pyx_RefNannyDeclarations | |
17734 int __pyx_lineno = 0; | |
17735 const char *__pyx_filename = NULL; | |
17736 int __pyx_clineno = 0; | |
17737 __Pyx_TraceFrameInit(__pyx_codeobj__35) | |
17738 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
17739 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
17740 | |
17741 /* "(tree fragment)":2 | |
17742 * def __reduce_cython__(self): | |
17743 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< | |
17744 * def __setstate_cython__(self, __pyx_state): | |
17745 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17746 */ | |
17747 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_gzipfile_self_kstream_canno, 0, 0); | |
17748 __PYX_ERR(1, 2, __pyx_L1_error) | |
17749 | |
17750 /* "(tree fragment)":1 | |
17751 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
17752 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17753 * def __setstate_cython__(self, __pyx_state): | |
17754 */ | |
17755 | |
17756 /* function exit code */ | |
17757 __pyx_L1_error:; | |
17758 __Pyx_AddTraceback("pysam.libctabix.GZIteratorParsed.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
17759 __pyx_r = NULL; | |
17760 __Pyx_XGIVEREF(__pyx_r); | |
17761 __Pyx_TraceReturn(__pyx_r, 0); | |
17762 __Pyx_RefNannyFinishContext(); | |
17763 return __pyx_r; | |
17764 } | |
17765 | |
17766 /* "(tree fragment)":3 | |
17767 * def __reduce_cython__(self): | |
17768 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17769 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
17770 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17771 */ | |
17772 | |
17773 /* Python wrapper */ | |
17774 static PyObject *__pyx_pw_5pysam_9libctabix_16GZIteratorParsed_7__setstate_cython__(PyObject *__pyx_v_self, | |
17775 #if CYTHON_METH_FASTCALL | |
17776 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
17777 #else | |
17778 PyObject *__pyx_args, PyObject *__pyx_kwds | |
17779 #endif | |
17780 ); /*proto*/ | |
17781 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_16GZIteratorParsed_6__setstate_cython__, "GZIteratorParsed.__setstate_cython__(self, __pyx_state)"); | |
17782 static PyMethodDef __pyx_mdef_5pysam_9libctabix_16GZIteratorParsed_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_16GZIteratorParsed_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_16GZIteratorParsed_6__setstate_cython__}; | |
17783 static PyObject *__pyx_pw_5pysam_9libctabix_16GZIteratorParsed_7__setstate_cython__(PyObject *__pyx_v_self, | |
17784 #if CYTHON_METH_FASTCALL | |
17785 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
17786 #else | |
17787 PyObject *__pyx_args, PyObject *__pyx_kwds | |
17788 #endif | |
17789 ) { | |
17790 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; | |
17791 #if !CYTHON_METH_FASTCALL | |
17792 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
17793 #endif | |
17794 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
17795 PyObject* values[1] = {0}; | |
17796 int __pyx_lineno = 0; | |
17797 const char *__pyx_filename = NULL; | |
17798 int __pyx_clineno = 0; | |
17799 PyObject *__pyx_r = 0; | |
17800 __Pyx_RefNannyDeclarations | |
17801 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
17802 #if !CYTHON_METH_FASTCALL | |
17803 #if CYTHON_ASSUME_SAFE_MACROS | |
17804 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
17805 #else | |
17806 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
17807 #endif | |
17808 #endif | |
17809 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
17810 { | |
17811 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
17812 if (__pyx_kwds) { | |
17813 Py_ssize_t kw_args; | |
17814 switch (__pyx_nargs) { | |
17815 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
17816 CYTHON_FALLTHROUGH; | |
17817 case 0: break; | |
17818 default: goto __pyx_L5_argtuple_error; | |
17819 } | |
17820 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
17821 switch (__pyx_nargs) { | |
17822 case 0: | |
17823 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
17824 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
17825 kw_args--; | |
17826 } | |
17827 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) | |
17828 else goto __pyx_L5_argtuple_error; | |
17829 } | |
17830 if (unlikely(kw_args > 0)) { | |
17831 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
17832 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) | |
17833 } | |
17834 } else if (unlikely(__pyx_nargs != 1)) { | |
17835 goto __pyx_L5_argtuple_error; | |
17836 } else { | |
17837 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
17838 } | |
17839 __pyx_v___pyx_state = values[0]; | |
17840 } | |
17841 goto __pyx_L6_skip; | |
17842 __pyx_L5_argtuple_error:; | |
17843 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) | |
17844 __pyx_L6_skip:; | |
17845 goto __pyx_L4_argument_unpacking_done; | |
17846 __pyx_L3_error:; | |
17847 { | |
17848 Py_ssize_t __pyx_temp; | |
17849 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
17850 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
17851 } | |
17852 } | |
17853 __Pyx_AddTraceback("pysam.libctabix.GZIteratorParsed.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
17854 __Pyx_RefNannyFinishContext(); | |
17855 return NULL; | |
17856 __pyx_L4_argument_unpacking_done:; | |
17857 __pyx_r = __pyx_pf_5pysam_9libctabix_16GZIteratorParsed_6__setstate_cython__(((struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *)__pyx_v_self), __pyx_v___pyx_state); | |
17858 | |
17859 /* function exit code */ | |
17860 { | |
17861 Py_ssize_t __pyx_temp; | |
17862 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
17863 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
17864 } | |
17865 } | |
17866 __Pyx_RefNannyFinishContext(); | |
17867 return __pyx_r; | |
17868 } | |
17869 | |
17870 static PyObject *__pyx_pf_5pysam_9libctabix_16GZIteratorParsed_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { | |
17871 PyObject *__pyx_r = NULL; | |
17872 __Pyx_TraceDeclarations | |
17873 __Pyx_RefNannyDeclarations | |
17874 int __pyx_lineno = 0; | |
17875 const char *__pyx_filename = NULL; | |
17876 int __pyx_clineno = 0; | |
17877 __Pyx_TraceFrameInit(__pyx_codeobj__36) | |
17878 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
17879 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); | |
17880 | |
17881 /* "(tree fragment)":4 | |
17882 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17883 * def __setstate_cython__(self, __pyx_state): | |
17884 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< | |
17885 */ | |
17886 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_gzipfile_self_kstream_canno, 0, 0); | |
17887 __PYX_ERR(1, 4, __pyx_L1_error) | |
17888 | |
17889 /* "(tree fragment)":3 | |
17890 * def __reduce_cython__(self): | |
17891 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17892 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
17893 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
17894 */ | |
17895 | |
17896 /* function exit code */ | |
17897 __pyx_L1_error:; | |
17898 __Pyx_AddTraceback("pysam.libctabix.GZIteratorParsed.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
17899 __pyx_r = NULL; | |
17900 __Pyx_XGIVEREF(__pyx_r); | |
17901 __Pyx_TraceReturn(__pyx_r, 0); | |
17902 __Pyx_RefNannyFinishContext(); | |
17903 return __pyx_r; | |
17904 } | |
17905 | |
17906 /* "pysam/libctabix.pyx":811 | |
17907 * | |
17908 * | |
17909 * def tabix_compress(filename_in, # <<<<<<<<<<<<<< | |
17910 * filename_out, | |
17911 * force=False): | |
17912 */ | |
17913 | |
17914 /* Python wrapper */ | |
17915 static PyObject *__pyx_pw_5pysam_9libctabix_1tabix_compress(PyObject *__pyx_self, | |
17916 #if CYTHON_METH_FASTCALL | |
17917 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
17918 #else | |
17919 PyObject *__pyx_args, PyObject *__pyx_kwds | |
17920 #endif | |
17921 ); /*proto*/ | |
17922 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_tabix_compress, "tabix_compress(filename_in, filename_out, force=False)\ncompress *filename_in* writing the output to *filename_out*.\n \n Raise an IOError if *filename_out* already exists, unless *force*\n is set.\n "); | |
17923 static PyMethodDef __pyx_mdef_5pysam_9libctabix_1tabix_compress = {"tabix_compress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_1tabix_compress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_tabix_compress}; | |
17924 static PyObject *__pyx_pw_5pysam_9libctabix_1tabix_compress(PyObject *__pyx_self, | |
17925 #if CYTHON_METH_FASTCALL | |
17926 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
17927 #else | |
17928 PyObject *__pyx_args, PyObject *__pyx_kwds | |
17929 #endif | |
17930 ) { | |
17931 PyObject *__pyx_v_filename_in = 0; | |
17932 PyObject *__pyx_v_filename_out = 0; | |
17933 PyObject *__pyx_v_force = 0; | |
17934 #if !CYTHON_METH_FASTCALL | |
17935 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
17936 #endif | |
17937 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
17938 PyObject* values[3] = {0,0,0}; | |
17939 int __pyx_lineno = 0; | |
17940 const char *__pyx_filename = NULL; | |
17941 int __pyx_clineno = 0; | |
17942 PyObject *__pyx_r = 0; | |
17943 __Pyx_RefNannyDeclarations | |
17944 __Pyx_RefNannySetupContext("tabix_compress (wrapper)", 0); | |
17945 #if !CYTHON_METH_FASTCALL | |
17946 #if CYTHON_ASSUME_SAFE_MACROS | |
17947 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
17948 #else | |
17949 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
17950 #endif | |
17951 #endif | |
17952 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
17953 { | |
17954 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename_in,&__pyx_n_s_filename_out,&__pyx_n_s_force,0}; | |
17955 | |
17956 /* "pysam/libctabix.pyx":813 | |
17957 * def tabix_compress(filename_in, | |
17958 * filename_out, | |
17959 * force=False): # <<<<<<<<<<<<<< | |
17960 * '''compress *filename_in* writing the output to *filename_out*. | |
17961 * | |
17962 */ | |
17963 values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); | |
17964 if (__pyx_kwds) { | |
17965 Py_ssize_t kw_args; | |
17966 switch (__pyx_nargs) { | |
17967 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
17968 CYTHON_FALLTHROUGH; | |
17969 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
17970 CYTHON_FALLTHROUGH; | |
17971 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
17972 CYTHON_FALLTHROUGH; | |
17973 case 0: break; | |
17974 default: goto __pyx_L5_argtuple_error; | |
17975 } | |
17976 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
17977 switch (__pyx_nargs) { | |
17978 case 0: | |
17979 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename_in)) != 0)) { | |
17980 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
17981 kw_args--; | |
17982 } | |
17983 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 811, __pyx_L3_error) | |
17984 else goto __pyx_L5_argtuple_error; | |
17985 CYTHON_FALLTHROUGH; | |
17986 case 1: | |
17987 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename_out)) != 0)) { | |
17988 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
17989 kw_args--; | |
17990 } | |
17991 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 811, __pyx_L3_error) | |
17992 else { | |
17993 __Pyx_RaiseArgtupleInvalid("tabix_compress", 0, 2, 3, 1); __PYX_ERR(0, 811, __pyx_L3_error) | |
17994 } | |
17995 CYTHON_FALLTHROUGH; | |
17996 case 2: | |
17997 if (kw_args > 0) { | |
17998 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_force); | |
17999 if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
18000 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 811, __pyx_L3_error) | |
18001 } | |
18002 } | |
18003 if (unlikely(kw_args > 0)) { | |
18004 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
18005 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tabix_compress") < 0)) __PYX_ERR(0, 811, __pyx_L3_error) | |
18006 } | |
18007 } else { | |
18008 switch (__pyx_nargs) { | |
18009 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
18010 CYTHON_FALLTHROUGH; | |
18011 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
18012 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
18013 break; | |
18014 default: goto __pyx_L5_argtuple_error; | |
18015 } | |
18016 } | |
18017 __pyx_v_filename_in = values[0]; | |
18018 __pyx_v_filename_out = values[1]; | |
18019 __pyx_v_force = values[2]; | |
18020 } | |
18021 goto __pyx_L6_skip; | |
18022 __pyx_L5_argtuple_error:; | |
18023 __Pyx_RaiseArgtupleInvalid("tabix_compress", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 811, __pyx_L3_error) | |
18024 __pyx_L6_skip:; | |
18025 goto __pyx_L4_argument_unpacking_done; | |
18026 __pyx_L3_error:; | |
18027 { | |
18028 Py_ssize_t __pyx_temp; | |
18029 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
18030 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
18031 } | |
18032 } | |
18033 __Pyx_AddTraceback("pysam.libctabix.tabix_compress", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
18034 __Pyx_RefNannyFinishContext(); | |
18035 return NULL; | |
18036 __pyx_L4_argument_unpacking_done:; | |
18037 __pyx_r = __pyx_pf_5pysam_9libctabix_tabix_compress(__pyx_self, __pyx_v_filename_in, __pyx_v_filename_out, __pyx_v_force); | |
18038 | |
18039 /* "pysam/libctabix.pyx":811 | |
18040 * | |
18041 * | |
18042 * def tabix_compress(filename_in, # <<<<<<<<<<<<<< | |
18043 * filename_out, | |
18044 * force=False): | |
18045 */ | |
18046 | |
18047 /* function exit code */ | |
18048 { | |
18049 Py_ssize_t __pyx_temp; | |
18050 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
18051 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
18052 } | |
18053 } | |
18054 __Pyx_RefNannyFinishContext(); | |
18055 return __pyx_r; | |
18056 } | |
18057 | |
18058 static PyObject *__pyx_pf_5pysam_9libctabix_tabix_compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename_in, PyObject *__pyx_v_filename_out, PyObject *__pyx_v_force) { | |
18059 int __pyx_v_WINDOW_SIZE; | |
18060 int __pyx_v_c; | |
18061 int __pyx_v_r; | |
18062 void *__pyx_v_buffer; | |
18063 BGZF *__pyx_v_fp; | |
18064 int __pyx_v_fd_src; | |
18065 int __pyx_v_is_empty; | |
18066 int __pyx_v_O_RDONLY; | |
18067 PyObject *__pyx_v_fn = NULL; | |
18068 char *__pyx_v_cfn; | |
18069 PyObject *__pyx_r = NULL; | |
18070 __Pyx_TraceDeclarations | |
18071 __Pyx_RefNannyDeclarations | |
18072 int __pyx_t_1; | |
18073 int __pyx_t_2; | |
18074 int __pyx_t_3; | |
18075 PyObject *__pyx_t_4 = NULL; | |
18076 PyObject *__pyx_t_5 = NULL; | |
18077 PyObject *__pyx_t_6 = NULL; | |
18078 unsigned int __pyx_t_7; | |
18079 int __pyx_t_8; | |
18080 char *__pyx_t_9; | |
18081 int __pyx_lineno = 0; | |
18082 const char *__pyx_filename = NULL; | |
18083 int __pyx_clineno = 0; | |
18084 __Pyx_TraceFrameInit(__pyx_codeobj__37) | |
18085 __Pyx_RefNannySetupContext("tabix_compress", 1); | |
18086 __Pyx_TraceCall("tabix_compress", __pyx_f[0], 811, 0, __PYX_ERR(0, 811, __pyx_L1_error)); | |
18087 | |
18088 /* "pysam/libctabix.pyx":820 | |
18089 * ''' | |
18090 * | |
18091 * if not force and os.path.exists(filename_out): # <<<<<<<<<<<<<< | |
18092 * raise IOError( | |
18093 * "Filename '%s' already exists, use *force* to " | |
18094 */ | |
18095 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 820, __pyx_L1_error) | |
18096 __pyx_t_3 = (!__pyx_t_2); | |
18097 if (__pyx_t_3) { | |
18098 } else { | |
18099 __pyx_t_1 = __pyx_t_3; | |
18100 goto __pyx_L4_bool_binop_done; | |
18101 } | |
18102 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 820, __pyx_L1_error) | |
18103 __Pyx_GOTREF(__pyx_t_5); | |
18104 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 820, __pyx_L1_error) | |
18105 __Pyx_GOTREF(__pyx_t_6); | |
18106 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
18107 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exists); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 820, __pyx_L1_error) | |
18108 __Pyx_GOTREF(__pyx_t_5); | |
18109 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
18110 __pyx_t_6 = NULL; | |
18111 __pyx_t_7 = 0; | |
18112 #if CYTHON_UNPACK_METHODS | |
18113 if (likely(PyMethod_Check(__pyx_t_5))) { | |
18114 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); | |
18115 if (likely(__pyx_t_6)) { | |
18116 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); | |
18117 __Pyx_INCREF(__pyx_t_6); | |
18118 __Pyx_INCREF(function); | |
18119 __Pyx_DECREF_SET(__pyx_t_5, function); | |
18120 __pyx_t_7 = 1; | |
18121 } | |
18122 } | |
18123 #endif | |
18124 { | |
18125 PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_filename_out}; | |
18126 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); | |
18127 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; | |
18128 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 820, __pyx_L1_error) | |
18129 __Pyx_GOTREF(__pyx_t_4); | |
18130 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
18131 } | |
18132 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 820, __pyx_L1_error) | |
18133 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
18134 __pyx_t_1 = __pyx_t_3; | |
18135 __pyx_L4_bool_binop_done:; | |
18136 if (unlikely(__pyx_t_1)) { | |
18137 | |
18138 /* "pysam/libctabix.pyx":823 | |
18139 * raise IOError( | |
18140 * "Filename '%s' already exists, use *force* to " | |
18141 * "overwrite" % filename_out) # <<<<<<<<<<<<<< | |
18142 * | |
18143 * cdef int WINDOW_SIZE | |
18144 */ | |
18145 __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Filename_s_already_exists_use_fo, __pyx_v_filename_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 823, __pyx_L1_error) | |
18146 __Pyx_GOTREF(__pyx_t_4); | |
18147 | |
18148 /* "pysam/libctabix.pyx":821 | |
18149 * | |
18150 * if not force and os.path.exists(filename_out): | |
18151 * raise IOError( # <<<<<<<<<<<<<< | |
18152 * "Filename '%s' already exists, use *force* to " | |
18153 * "overwrite" % filename_out) | |
18154 */ | |
18155 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 821, __pyx_L1_error) | |
18156 __Pyx_GOTREF(__pyx_t_5); | |
18157 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
18158 __Pyx_Raise(__pyx_t_5, 0, 0, 0); | |
18159 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
18160 __PYX_ERR(0, 821, __pyx_L1_error) | |
18161 | |
18162 /* "pysam/libctabix.pyx":820 | |
18163 * ''' | |
18164 * | |
18165 * if not force and os.path.exists(filename_out): # <<<<<<<<<<<<<< | |
18166 * raise IOError( | |
18167 * "Filename '%s' already exists, use *force* to " | |
18168 */ | |
18169 } | |
18170 | |
18171 /* "pysam/libctabix.pyx":830 | |
18172 * cdef BGZF * fp | |
18173 * cdef int fd_src | |
18174 * cdef bint is_empty = True # <<<<<<<<<<<<<< | |
18175 * cdef int O_RDONLY | |
18176 * O_RDONLY = os.O_RDONLY | |
18177 */ | |
18178 __pyx_v_is_empty = 1; | |
18179 | |
18180 /* "pysam/libctabix.pyx":832 | |
18181 * cdef bint is_empty = True | |
18182 * cdef int O_RDONLY | |
18183 * O_RDONLY = os.O_RDONLY # <<<<<<<<<<<<<< | |
18184 * | |
18185 * WINDOW_SIZE = 64 * 1024 | |
18186 */ | |
18187 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 832, __pyx_L1_error) | |
18188 __Pyx_GOTREF(__pyx_t_5); | |
18189 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_O_RDONLY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 832, __pyx_L1_error) | |
18190 __Pyx_GOTREF(__pyx_t_4); | |
18191 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
18192 __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L1_error) | |
18193 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
18194 __pyx_v_O_RDONLY = __pyx_t_8; | |
18195 | |
18196 /* "pysam/libctabix.pyx":834 | |
18197 * O_RDONLY = os.O_RDONLY | |
18198 * | |
18199 * WINDOW_SIZE = 64 * 1024 # <<<<<<<<<<<<<< | |
18200 * | |
18201 * fn = encode_filename(filename_out) | |
18202 */ | |
18203 __pyx_v_WINDOW_SIZE = 0x10000; | |
18204 | |
18205 /* "pysam/libctabix.pyx":836 | |
18206 * WINDOW_SIZE = 64 * 1024 | |
18207 * | |
18208 * fn = encode_filename(filename_out) # <<<<<<<<<<<<<< | |
18209 * cdef char *cfn = fn | |
18210 * with nogil: | |
18211 */ | |
18212 __pyx_t_4 = __pyx_f_5pysam_9libcutils_encode_filename(__pyx_v_filename_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 836, __pyx_L1_error) | |
18213 __Pyx_GOTREF(__pyx_t_4); | |
18214 __pyx_v_fn = ((PyObject*)__pyx_t_4); | |
18215 __pyx_t_4 = 0; | |
18216 | |
18217 /* "pysam/libctabix.pyx":837 | |
18218 * | |
18219 * fn = encode_filename(filename_out) | |
18220 * cdef char *cfn = fn # <<<<<<<<<<<<<< | |
18221 * with nogil: | |
18222 * fp = bgzf_open(cfn, "w") | |
18223 */ | |
18224 if (unlikely(__pyx_v_fn == Py_None)) { | |
18225 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); | |
18226 __PYX_ERR(0, 837, __pyx_L1_error) | |
18227 } | |
18228 __pyx_t_9 = __Pyx_PyBytes_AsWritableString(__pyx_v_fn); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 837, __pyx_L1_error) | |
18229 __pyx_v_cfn = __pyx_t_9; | |
18230 | |
18231 /* "pysam/libctabix.pyx":838 | |
18232 * fn = encode_filename(filename_out) | |
18233 * cdef char *cfn = fn | |
18234 * with nogil: # <<<<<<<<<<<<<< | |
18235 * fp = bgzf_open(cfn, "w") | |
18236 * if fp == NULL: | |
18237 */ | |
18238 { | |
18239 #ifdef WITH_THREAD | |
18240 PyThreadState *_save; | |
18241 _save = NULL; | |
18242 Py_UNBLOCK_THREADS | |
18243 __Pyx_FastGIL_Remember(); | |
18244 #endif | |
18245 /*try:*/ { | |
18246 | |
18247 /* "pysam/libctabix.pyx":839 | |
18248 * cdef char *cfn = fn | |
18249 * with nogil: | |
18250 * fp = bgzf_open(cfn, "w") # <<<<<<<<<<<<<< | |
18251 * if fp == NULL: | |
18252 * raise IOError("could not open '%s' for writing" % filename_out) | |
18253 */ | |
18254 __pyx_v_fp = bgzf_open(__pyx_v_cfn, ((char const *)"w")); | |
18255 } | |
18256 | |
18257 /* "pysam/libctabix.pyx":838 | |
18258 * fn = encode_filename(filename_out) | |
18259 * cdef char *cfn = fn | |
18260 * with nogil: # <<<<<<<<<<<<<< | |
18261 * fp = bgzf_open(cfn, "w") | |
18262 * if fp == NULL: | |
18263 */ | |
18264 /*finally:*/ { | |
18265 /*normal exit:*/{ | |
18266 #ifdef WITH_THREAD | |
18267 __Pyx_FastGIL_Forget(); | |
18268 Py_BLOCK_THREADS | |
18269 #endif | |
18270 goto __pyx_L8; | |
18271 } | |
18272 __pyx_L8:; | |
18273 } | |
18274 } | |
18275 | |
18276 /* "pysam/libctabix.pyx":840 | |
18277 * with nogil: | |
18278 * fp = bgzf_open(cfn, "w") | |
18279 * if fp == NULL: # <<<<<<<<<<<<<< | |
18280 * raise IOError("could not open '%s' for writing" % filename_out) | |
18281 * | |
18282 */ | |
18283 __pyx_t_1 = (__pyx_v_fp == NULL); | |
18284 if (unlikely(__pyx_t_1)) { | |
18285 | |
18286 /* "pysam/libctabix.pyx":841 | |
18287 * fp = bgzf_open(cfn, "w") | |
18288 * if fp == NULL: | |
18289 * raise IOError("could not open '%s' for writing" % filename_out) # <<<<<<<<<<<<<< | |
18290 * | |
18291 * fn = encode_filename(filename_in) | |
18292 */ | |
18293 __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_could_not_open_s_for_writing, __pyx_v_filename_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error) | |
18294 __Pyx_GOTREF(__pyx_t_4); | |
18295 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 841, __pyx_L1_error) | |
18296 __Pyx_GOTREF(__pyx_t_5); | |
18297 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
18298 __Pyx_Raise(__pyx_t_5, 0, 0, 0); | |
18299 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
18300 __PYX_ERR(0, 841, __pyx_L1_error) | |
18301 | |
18302 /* "pysam/libctabix.pyx":840 | |
18303 * with nogil: | |
18304 * fp = bgzf_open(cfn, "w") | |
18305 * if fp == NULL: # <<<<<<<<<<<<<< | |
18306 * raise IOError("could not open '%s' for writing" % filename_out) | |
18307 * | |
18308 */ | |
18309 } | |
18310 | |
18311 /* "pysam/libctabix.pyx":843 | |
18312 * raise IOError("could not open '%s' for writing" % filename_out) | |
18313 * | |
18314 * fn = encode_filename(filename_in) # <<<<<<<<<<<<<< | |
18315 * fd_src = open(fn, O_RDONLY) | |
18316 * if fd_src == 0: | |
18317 */ | |
18318 __pyx_t_5 = __pyx_f_5pysam_9libcutils_encode_filename(__pyx_v_filename_in); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 843, __pyx_L1_error) | |
18319 __Pyx_GOTREF(__pyx_t_5); | |
18320 __Pyx_DECREF_SET(__pyx_v_fn, ((PyObject*)__pyx_t_5)); | |
18321 __pyx_t_5 = 0; | |
18322 | |
18323 /* "pysam/libctabix.pyx":844 | |
18324 * | |
18325 * fn = encode_filename(filename_in) | |
18326 * fd_src = open(fn, O_RDONLY) # <<<<<<<<<<<<<< | |
18327 * if fd_src == 0: | |
18328 * raise IOError("could not open '%s' for reading" % filename_in) | |
18329 */ | |
18330 if (unlikely(__pyx_v_fn == Py_None)) { | |
18331 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); | |
18332 __PYX_ERR(0, 844, __pyx_L1_error) | |
18333 } | |
18334 __pyx_t_9 = __Pyx_PyBytes_AsWritableString(__pyx_v_fn); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 844, __pyx_L1_error) | |
18335 __pyx_v_fd_src = open(__pyx_t_9, __pyx_v_O_RDONLY); | |
18336 | |
18337 /* "pysam/libctabix.pyx":845 | |
18338 * fn = encode_filename(filename_in) | |
18339 * fd_src = open(fn, O_RDONLY) | |
18340 * if fd_src == 0: # <<<<<<<<<<<<<< | |
18341 * raise IOError("could not open '%s' for reading" % filename_in) | |
18342 * | |
18343 */ | |
18344 __pyx_t_1 = (__pyx_v_fd_src == 0); | |
18345 if (unlikely(__pyx_t_1)) { | |
18346 | |
18347 /* "pysam/libctabix.pyx":846 | |
18348 * fd_src = open(fn, O_RDONLY) | |
18349 * if fd_src == 0: | |
18350 * raise IOError("could not open '%s' for reading" % filename_in) # <<<<<<<<<<<<<< | |
18351 * | |
18352 * buffer = malloc(WINDOW_SIZE) | |
18353 */ | |
18354 __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_could_not_open_s_for_reading, __pyx_v_filename_in); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 846, __pyx_L1_error) | |
18355 __Pyx_GOTREF(__pyx_t_5); | |
18356 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 846, __pyx_L1_error) | |
18357 __Pyx_GOTREF(__pyx_t_4); | |
18358 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
18359 __Pyx_Raise(__pyx_t_4, 0, 0, 0); | |
18360 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
18361 __PYX_ERR(0, 846, __pyx_L1_error) | |
18362 | |
18363 /* "pysam/libctabix.pyx":845 | |
18364 * fn = encode_filename(filename_in) | |
18365 * fd_src = open(fn, O_RDONLY) | |
18366 * if fd_src == 0: # <<<<<<<<<<<<<< | |
18367 * raise IOError("could not open '%s' for reading" % filename_in) | |
18368 * | |
18369 */ | |
18370 } | |
18371 | |
18372 /* "pysam/libctabix.pyx":848 | |
18373 * raise IOError("could not open '%s' for reading" % filename_in) | |
18374 * | |
18375 * buffer = malloc(WINDOW_SIZE) # <<<<<<<<<<<<<< | |
18376 * c = 1 | |
18377 * | |
18378 */ | |
18379 __pyx_v_buffer = malloc(__pyx_v_WINDOW_SIZE); | |
18380 | |
18381 /* "pysam/libctabix.pyx":849 | |
18382 * | |
18383 * buffer = malloc(WINDOW_SIZE) | |
18384 * c = 1 # <<<<<<<<<<<<<< | |
18385 * | |
18386 * while c > 0: | |
18387 */ | |
18388 __pyx_v_c = 1; | |
18389 | |
18390 /* "pysam/libctabix.pyx":851 | |
18391 * c = 1 | |
18392 * | |
18393 * while c > 0: # <<<<<<<<<<<<<< | |
18394 * with nogil: | |
18395 * c = read(fd_src, buffer, WINDOW_SIZE) | |
18396 */ | |
18397 while (1) { | |
18398 __pyx_t_1 = (__pyx_v_c > 0); | |
18399 if (!__pyx_t_1) break; | |
18400 | |
18401 /* "pysam/libctabix.pyx":852 | |
18402 * | |
18403 * while c > 0: | |
18404 * with nogil: # <<<<<<<<<<<<<< | |
18405 * c = read(fd_src, buffer, WINDOW_SIZE) | |
18406 * if c > 0: | |
18407 */ | |
18408 { | |
18409 #ifdef WITH_THREAD | |
18410 PyThreadState *_save; | |
18411 _save = NULL; | |
18412 Py_UNBLOCK_THREADS | |
18413 __Pyx_FastGIL_Remember(); | |
18414 #endif | |
18415 /*try:*/ { | |
18416 | |
18417 /* "pysam/libctabix.pyx":853 | |
18418 * while c > 0: | |
18419 * with nogil: | |
18420 * c = read(fd_src, buffer, WINDOW_SIZE) # <<<<<<<<<<<<<< | |
18421 * if c > 0: | |
18422 * is_empty = False | |
18423 */ | |
18424 __pyx_v_c = read(__pyx_v_fd_src, __pyx_v_buffer, __pyx_v_WINDOW_SIZE); | |
18425 | |
18426 /* "pysam/libctabix.pyx":854 | |
18427 * with nogil: | |
18428 * c = read(fd_src, buffer, WINDOW_SIZE) | |
18429 * if c > 0: # <<<<<<<<<<<<<< | |
18430 * is_empty = False | |
18431 * r = bgzf_write(fp, buffer, c) | |
18432 */ | |
18433 __pyx_t_1 = (__pyx_v_c > 0); | |
18434 if (__pyx_t_1) { | |
18435 | |
18436 /* "pysam/libctabix.pyx":855 | |
18437 * c = read(fd_src, buffer, WINDOW_SIZE) | |
18438 * if c > 0: | |
18439 * is_empty = False # <<<<<<<<<<<<<< | |
18440 * r = bgzf_write(fp, buffer, c) | |
18441 * if r < 0: | |
18442 */ | |
18443 __pyx_v_is_empty = 0; | |
18444 | |
18445 /* "pysam/libctabix.pyx":854 | |
18446 * with nogil: | |
18447 * c = read(fd_src, buffer, WINDOW_SIZE) | |
18448 * if c > 0: # <<<<<<<<<<<<<< | |
18449 * is_empty = False | |
18450 * r = bgzf_write(fp, buffer, c) | |
18451 */ | |
18452 } | |
18453 | |
18454 /* "pysam/libctabix.pyx":856 | |
18455 * if c > 0: | |
18456 * is_empty = False | |
18457 * r = bgzf_write(fp, buffer, c) # <<<<<<<<<<<<<< | |
18458 * if r < 0: | |
18459 * free(buffer) | |
18460 */ | |
18461 __pyx_v_r = bgzf_write(__pyx_v_fp, __pyx_v_buffer, __pyx_v_c); | |
18462 } | |
18463 | |
18464 /* "pysam/libctabix.pyx":852 | |
18465 * | |
18466 * while c > 0: | |
18467 * with nogil: # <<<<<<<<<<<<<< | |
18468 * c = read(fd_src, buffer, WINDOW_SIZE) | |
18469 * if c > 0: | |
18470 */ | |
18471 /*finally:*/ { | |
18472 /*normal exit:*/{ | |
18473 #ifdef WITH_THREAD | |
18474 __Pyx_FastGIL_Forget(); | |
18475 Py_BLOCK_THREADS | |
18476 #endif | |
18477 goto __pyx_L17; | |
18478 } | |
18479 __pyx_L17:; | |
18480 } | |
18481 } | |
18482 | |
18483 /* "pysam/libctabix.pyx":857 | |
18484 * is_empty = False | |
18485 * r = bgzf_write(fp, buffer, c) | |
18486 * if r < 0: # <<<<<<<<<<<<<< | |
18487 * free(buffer) | |
18488 * raise IOError("writing failed") | |
18489 */ | |
18490 __pyx_t_1 = (__pyx_v_r < 0); | |
18491 if (unlikely(__pyx_t_1)) { | |
18492 | |
18493 /* "pysam/libctabix.pyx":858 | |
18494 * r = bgzf_write(fp, buffer, c) | |
18495 * if r < 0: | |
18496 * free(buffer) # <<<<<<<<<<<<<< | |
18497 * raise IOError("writing failed") | |
18498 * | |
18499 */ | |
18500 free(__pyx_v_buffer); | |
18501 | |
18502 /* "pysam/libctabix.pyx":859 | |
18503 * if r < 0: | |
18504 * free(buffer) | |
18505 * raise IOError("writing failed") # <<<<<<<<<<<<<< | |
18506 * | |
18507 * free(buffer) | |
18508 */ | |
18509 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error) | |
18510 __Pyx_GOTREF(__pyx_t_4); | |
18511 __Pyx_Raise(__pyx_t_4, 0, 0, 0); | |
18512 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
18513 __PYX_ERR(0, 859, __pyx_L1_error) | |
18514 | |
18515 /* "pysam/libctabix.pyx":857 | |
18516 * is_empty = False | |
18517 * r = bgzf_write(fp, buffer, c) | |
18518 * if r < 0: # <<<<<<<<<<<<<< | |
18519 * free(buffer) | |
18520 * raise IOError("writing failed") | |
18521 */ | |
18522 } | |
18523 } | |
18524 | |
18525 /* "pysam/libctabix.pyx":861 | |
18526 * raise IOError("writing failed") | |
18527 * | |
18528 * free(buffer) # <<<<<<<<<<<<<< | |
18529 * r = bgzf_close(fp) | |
18530 * if r < 0: | |
18531 */ | |
18532 free(__pyx_v_buffer); | |
18533 | |
18534 /* "pysam/libctabix.pyx":862 | |
18535 * | |
18536 * free(buffer) | |
18537 * r = bgzf_close(fp) # <<<<<<<<<<<<<< | |
18538 * if r < 0: | |
18539 * raise IOError("error %i when writing to file %s" % (r, filename_out)) | |
18540 */ | |
18541 __pyx_v_r = bgzf_close(__pyx_v_fp); | |
18542 | |
18543 /* "pysam/libctabix.pyx":863 | |
18544 * free(buffer) | |
18545 * r = bgzf_close(fp) | |
18546 * if r < 0: # <<<<<<<<<<<<<< | |
18547 * raise IOError("error %i when writing to file %s" % (r, filename_out)) | |
18548 * | |
18549 */ | |
18550 __pyx_t_1 = (__pyx_v_r < 0); | |
18551 if (unlikely(__pyx_t_1)) { | |
18552 | |
18553 /* "pysam/libctabix.pyx":864 | |
18554 * r = bgzf_close(fp) | |
18555 * if r < 0: | |
18556 * raise IOError("error %i when writing to file %s" % (r, filename_out)) # <<<<<<<<<<<<<< | |
18557 * | |
18558 * r = close(fd_src) | |
18559 */ | |
18560 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 864, __pyx_L1_error) | |
18561 __Pyx_GOTREF(__pyx_t_4); | |
18562 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 864, __pyx_L1_error) | |
18563 __Pyx_GOTREF(__pyx_t_5); | |
18564 __Pyx_GIVEREF(__pyx_t_4); | |
18565 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 864, __pyx_L1_error); | |
18566 __Pyx_INCREF(__pyx_v_filename_out); | |
18567 __Pyx_GIVEREF(__pyx_v_filename_out); | |
18568 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_filename_out)) __PYX_ERR(0, 864, __pyx_L1_error); | |
18569 __pyx_t_4 = 0; | |
18570 __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_error_i_when_writing_to_file_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 864, __pyx_L1_error) | |
18571 __Pyx_GOTREF(__pyx_t_4); | |
18572 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
18573 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 864, __pyx_L1_error) | |
18574 __Pyx_GOTREF(__pyx_t_5); | |
18575 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
18576 __Pyx_Raise(__pyx_t_5, 0, 0, 0); | |
18577 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
18578 __PYX_ERR(0, 864, __pyx_L1_error) | |
18579 | |
18580 /* "pysam/libctabix.pyx":863 | |
18581 * free(buffer) | |
18582 * r = bgzf_close(fp) | |
18583 * if r < 0: # <<<<<<<<<<<<<< | |
18584 * raise IOError("error %i when writing to file %s" % (r, filename_out)) | |
18585 * | |
18586 */ | |
18587 } | |
18588 | |
18589 /* "pysam/libctabix.pyx":866 | |
18590 * raise IOError("error %i when writing to file %s" % (r, filename_out)) | |
18591 * | |
18592 * r = close(fd_src) # <<<<<<<<<<<<<< | |
18593 * # an empty file will return with -1, thus ignore this. | |
18594 * if r < 0: | |
18595 */ | |
18596 __pyx_v_r = close(__pyx_v_fd_src); | |
18597 | |
18598 /* "pysam/libctabix.pyx":868 | |
18599 * r = close(fd_src) | |
18600 * # an empty file will return with -1, thus ignore this. | |
18601 * if r < 0: # <<<<<<<<<<<<<< | |
18602 * if not (r == -1 and is_empty): | |
18603 * raise IOError("error %i when closing file %s" % (r, filename_in)) | |
18604 */ | |
18605 __pyx_t_1 = (__pyx_v_r < 0); | |
18606 if (__pyx_t_1) { | |
18607 | |
18608 /* "pysam/libctabix.pyx":869 | |
18609 * # an empty file will return with -1, thus ignore this. | |
18610 * if r < 0: | |
18611 * if not (r == -1 and is_empty): # <<<<<<<<<<<<<< | |
18612 * raise IOError("error %i when closing file %s" % (r, filename_in)) | |
18613 * | |
18614 */ | |
18615 __pyx_t_3 = (__pyx_v_r == -1L); | |
18616 if (__pyx_t_3) { | |
18617 } else { | |
18618 __pyx_t_1 = __pyx_t_3; | |
18619 goto __pyx_L23_bool_binop_done; | |
18620 } | |
18621 __pyx_t_1 = __pyx_v_is_empty; | |
18622 __pyx_L23_bool_binop_done:; | |
18623 __pyx_t_3 = (!__pyx_t_1); | |
18624 if (unlikely(__pyx_t_3)) { | |
18625 | |
18626 /* "pysam/libctabix.pyx":870 | |
18627 * if r < 0: | |
18628 * if not (r == -1 and is_empty): | |
18629 * raise IOError("error %i when closing file %s" % (r, filename_in)) # <<<<<<<<<<<<<< | |
18630 * | |
18631 * | |
18632 */ | |
18633 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 870, __pyx_L1_error) | |
18634 __Pyx_GOTREF(__pyx_t_5); | |
18635 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error) | |
18636 __Pyx_GOTREF(__pyx_t_4); | |
18637 __Pyx_GIVEREF(__pyx_t_5); | |
18638 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5)) __PYX_ERR(0, 870, __pyx_L1_error); | |
18639 __Pyx_INCREF(__pyx_v_filename_in); | |
18640 __Pyx_GIVEREF(__pyx_v_filename_in); | |
18641 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_filename_in)) __PYX_ERR(0, 870, __pyx_L1_error); | |
18642 __pyx_t_5 = 0; | |
18643 __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_error_i_when_closing_file_s, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 870, __pyx_L1_error) | |
18644 __Pyx_GOTREF(__pyx_t_5); | |
18645 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
18646 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error) | |
18647 __Pyx_GOTREF(__pyx_t_4); | |
18648 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
18649 __Pyx_Raise(__pyx_t_4, 0, 0, 0); | |
18650 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
18651 __PYX_ERR(0, 870, __pyx_L1_error) | |
18652 | |
18653 /* "pysam/libctabix.pyx":869 | |
18654 * # an empty file will return with -1, thus ignore this. | |
18655 * if r < 0: | |
18656 * if not (r == -1 and is_empty): # <<<<<<<<<<<<<< | |
18657 * raise IOError("error %i when closing file %s" % (r, filename_in)) | |
18658 * | |
18659 */ | |
18660 } | |
18661 | |
18662 /* "pysam/libctabix.pyx":868 | |
18663 * r = close(fd_src) | |
18664 * # an empty file will return with -1, thus ignore this. | |
18665 * if r < 0: # <<<<<<<<<<<<<< | |
18666 * if not (r == -1 and is_empty): | |
18667 * raise IOError("error %i when closing file %s" % (r, filename_in)) | |
18668 */ | |
18669 } | |
18670 | |
18671 /* "pysam/libctabix.pyx":811 | |
18672 * | |
18673 * | |
18674 * def tabix_compress(filename_in, # <<<<<<<<<<<<<< | |
18675 * filename_out, | |
18676 * force=False): | |
18677 */ | |
18678 | |
18679 /* function exit code */ | |
18680 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
18681 goto __pyx_L0; | |
18682 __pyx_L1_error:; | |
18683 __Pyx_XDECREF(__pyx_t_4); | |
18684 __Pyx_XDECREF(__pyx_t_5); | |
18685 __Pyx_XDECREF(__pyx_t_6); | |
18686 __Pyx_AddTraceback("pysam.libctabix.tabix_compress", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
18687 __pyx_r = NULL; | |
18688 __pyx_L0:; | |
18689 __Pyx_XDECREF(__pyx_v_fn); | |
18690 __Pyx_XGIVEREF(__pyx_r); | |
18691 __Pyx_TraceReturn(__pyx_r, 0); | |
18692 __Pyx_RefNannyFinishContext(); | |
18693 return __pyx_r; | |
18694 } | |
18695 | |
18696 /* "pysam/libctabix.pyx":873 | |
18697 * | |
18698 * | |
18699 * def tabix_index(filename, # <<<<<<<<<<<<<< | |
18700 * force=False, | |
18701 * seq_col=None, | |
18702 */ | |
18703 | |
18704 /* Python wrapper */ | |
18705 static PyObject *__pyx_pw_5pysam_9libctabix_3tabix_index(PyObject *__pyx_self, | |
18706 #if CYTHON_METH_FASTCALL | |
18707 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
18708 #else | |
18709 PyObject *__pyx_args, PyObject *__pyx_kwds | |
18710 #endif | |
18711 ); /*proto*/ | |
18712 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_2tabix_index, "tabix_index(filename, force=False, seq_col=None, start_col=None, end_col=None, preset=None, meta_char=u'#', int line_skip=0, zerobased=False, int min_shift=-1, index=None, keep_original=False, csi=False)\nindex tab-separated *filename* using tabix.\n\n An existing index will not be overwritten unless *force* is set.\n\n The index will be built from coordinates in columns *seq_col*,\n *start_col* and *end_col*.\n\n The contents of *filename* have to be sorted by contig and\n position - the method does not check if the file is sorted.\n\n Column indices are 0-based. Note that this is different from the\n tabix command line utility where column indices start at 1.\n \n Coordinates in the file are assumed to be 1-based unless\n *zerobased* is set.\n\n If *preset* is provided, the column coordinates are taken from a\n preset. Valid values for preset are \"gff\", \"bed\", \"sam\", \"vcf\",\n psltbl\", \"pileup\".\n \n Lines beginning with *meta_char* and the first *line_skip* lines\n will be skipped.\n\n If *filename* is not detected as a gzip file it will be automatically\n compressed. The original file will be removed and only the compressed\n file will be retained.\n\n By default or when *min_shift* is 0, creates a TBI index. If *min_shift*\n is greater than zero and/or *csi* is True, creates a CSI index with a\n minimal interval size of 1<<*min_shift* (1<<14 if only *csi* is set).\n\n *index* controls the filename which should be used for creating the index.\n If not set, the default is to append ``.tbi`` to *filename*.\n\n When automatically compressing files, if *keep_original* is set the\n uncompressed file will not be deleted.\n\n returns the filename of the compressed data\n\n "); | |
18713 static PyMethodDef __pyx_mdef_5pysam_9libctabix_3tabix_index = {"tabix_index", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_3tabix_index, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_2tabix_index}; | |
18714 static PyObject *__pyx_pw_5pysam_9libctabix_3tabix_index(PyObject *__pyx_self, | |
18715 #if CYTHON_METH_FASTCALL | |
18716 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
18717 #else | |
18718 PyObject *__pyx_args, PyObject *__pyx_kwds | |
18719 #endif | |
18720 ) { | |
18721 PyObject *__pyx_v_filename = 0; | |
18722 PyObject *__pyx_v_force = 0; | |
18723 PyObject *__pyx_v_seq_col = 0; | |
18724 PyObject *__pyx_v_start_col = 0; | |
18725 PyObject *__pyx_v_end_col = 0; | |
18726 PyObject *__pyx_v_preset = 0; | |
18727 PyObject *__pyx_v_meta_char = 0; | |
18728 int __pyx_v_line_skip; | |
18729 PyObject *__pyx_v_zerobased = 0; | |
18730 int __pyx_v_min_shift; | |
18731 PyObject *__pyx_v_index = 0; | |
18732 PyObject *__pyx_v_keep_original = 0; | |
18733 PyObject *__pyx_v_csi = 0; | |
18734 #if !CYTHON_METH_FASTCALL | |
18735 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
18736 #endif | |
18737 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
18738 PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; | |
18739 int __pyx_lineno = 0; | |
18740 const char *__pyx_filename = NULL; | |
18741 int __pyx_clineno = 0; | |
18742 PyObject *__pyx_r = 0; | |
18743 __Pyx_RefNannyDeclarations | |
18744 __Pyx_RefNannySetupContext("tabix_index (wrapper)", 0); | |
18745 #if !CYTHON_METH_FASTCALL | |
18746 #if CYTHON_ASSUME_SAFE_MACROS | |
18747 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
18748 #else | |
18749 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
18750 #endif | |
18751 #endif | |
18752 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
18753 { | |
18754 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_force,&__pyx_n_s_seq_col,&__pyx_n_s_start_col,&__pyx_n_s_end_col,&__pyx_n_s_preset,&__pyx_n_s_meta_char,&__pyx_n_s_line_skip,&__pyx_n_s_zerobased,&__pyx_n_s_min_shift,&__pyx_n_s_index,&__pyx_n_s_keep_original,&__pyx_n_s_csi,0}; | |
18755 | |
18756 /* "pysam/libctabix.pyx":874 | |
18757 * | |
18758 * def tabix_index(filename, | |
18759 * force=False, # <<<<<<<<<<<<<< | |
18760 * seq_col=None, | |
18761 * start_col=None, | |
18762 */ | |
18763 values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); | |
18764 | |
18765 /* "pysam/libctabix.pyx":875 | |
18766 * def tabix_index(filename, | |
18767 * force=False, | |
18768 * seq_col=None, # <<<<<<<<<<<<<< | |
18769 * start_col=None, | |
18770 * end_col=None, | |
18771 */ | |
18772 values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
18773 | |
18774 /* "pysam/libctabix.pyx":876 | |
18775 * force=False, | |
18776 * seq_col=None, | |
18777 * start_col=None, # <<<<<<<<<<<<<< | |
18778 * end_col=None, | |
18779 * preset=None, | |
18780 */ | |
18781 values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
18782 | |
18783 /* "pysam/libctabix.pyx":877 | |
18784 * seq_col=None, | |
18785 * start_col=None, | |
18786 * end_col=None, # <<<<<<<<<<<<<< | |
18787 * preset=None, | |
18788 * meta_char="#", | |
18789 */ | |
18790 values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
18791 | |
18792 /* "pysam/libctabix.pyx":878 | |
18793 * start_col=None, | |
18794 * end_col=None, | |
18795 * preset=None, # <<<<<<<<<<<<<< | |
18796 * meta_char="#", | |
18797 * int line_skip=0, | |
18798 */ | |
18799 values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
18800 values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_kp_u__39))); | |
18801 | |
18802 /* "pysam/libctabix.pyx":881 | |
18803 * meta_char="#", | |
18804 * int line_skip=0, | |
18805 * zerobased=False, # <<<<<<<<<<<<<< | |
18806 * int min_shift=-1, | |
18807 * index=None, | |
18808 */ | |
18809 values[8] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); | |
18810 | |
18811 /* "pysam/libctabix.pyx":883 | |
18812 * zerobased=False, | |
18813 * int min_shift=-1, | |
18814 * index=None, # <<<<<<<<<<<<<< | |
18815 * keep_original=False, | |
18816 * csi=False, | |
18817 */ | |
18818 values[10] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
18819 | |
18820 /* "pysam/libctabix.pyx":884 | |
18821 * int min_shift=-1, | |
18822 * index=None, | |
18823 * keep_original=False, # <<<<<<<<<<<<<< | |
18824 * csi=False, | |
18825 * ): | |
18826 */ | |
18827 values[11] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); | |
18828 | |
18829 /* "pysam/libctabix.pyx":885 | |
18830 * index=None, | |
18831 * keep_original=False, | |
18832 * csi=False, # <<<<<<<<<<<<<< | |
18833 * ): | |
18834 * '''index tab-separated *filename* using tabix. | |
18835 */ | |
18836 values[12] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); | |
18837 if (__pyx_kwds) { | |
18838 Py_ssize_t kw_args; | |
18839 switch (__pyx_nargs) { | |
18840 case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); | |
18841 CYTHON_FALLTHROUGH; | |
18842 case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); | |
18843 CYTHON_FALLTHROUGH; | |
18844 case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); | |
18845 CYTHON_FALLTHROUGH; | |
18846 case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); | |
18847 CYTHON_FALLTHROUGH; | |
18848 case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); | |
18849 CYTHON_FALLTHROUGH; | |
18850 case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); | |
18851 CYTHON_FALLTHROUGH; | |
18852 case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); | |
18853 CYTHON_FALLTHROUGH; | |
18854 case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); | |
18855 CYTHON_FALLTHROUGH; | |
18856 case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); | |
18857 CYTHON_FALLTHROUGH; | |
18858 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
18859 CYTHON_FALLTHROUGH; | |
18860 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
18861 CYTHON_FALLTHROUGH; | |
18862 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
18863 CYTHON_FALLTHROUGH; | |
18864 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
18865 CYTHON_FALLTHROUGH; | |
18866 case 0: break; | |
18867 default: goto __pyx_L5_argtuple_error; | |
18868 } | |
18869 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
18870 switch (__pyx_nargs) { | |
18871 case 0: | |
18872 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) { | |
18873 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
18874 kw_args--; | |
18875 } | |
18876 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L3_error) | |
18877 else goto __pyx_L5_argtuple_error; | |
18878 CYTHON_FALLTHROUGH; | |
18879 case 1: | |
18880 if (kw_args > 0) { | |
18881 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_force); | |
18882 if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
18883 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L3_error) | |
18884 } | |
18885 CYTHON_FALLTHROUGH; | |
18886 case 2: | |
18887 if (kw_args > 0) { | |
18888 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seq_col); | |
18889 if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
18890 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L3_error) | |
18891 } | |
18892 CYTHON_FALLTHROUGH; | |
18893 case 3: | |
18894 if (kw_args > 0) { | |
18895 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start_col); | |
18896 if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
18897 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L3_error) | |
18898 } | |
18899 CYTHON_FALLTHROUGH; | |
18900 case 4: | |
18901 if (kw_args > 0) { | |
18902 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end_col); | |
18903 if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
18904 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L3_error) | |
18905 } | |
18906 CYTHON_FALLTHROUGH; | |
18907 case 5: | |
18908 if (kw_args > 0) { | |
18909 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_preset); | |
18910 if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
18911 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L3_error) | |
18912 } | |
18913 CYTHON_FALLTHROUGH; | |
18914 case 6: | |
18915 if (kw_args > 0) { | |
18916 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_meta_char); | |
18917 if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
18918 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L3_error) | |
18919 } | |
18920 CYTHON_FALLTHROUGH; | |
18921 case 7: | |
18922 if (kw_args > 0) { | |
18923 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_line_skip); | |
18924 if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
18925 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L3_error) | |
18926 } | |
18927 CYTHON_FALLTHROUGH; | |
18928 case 8: | |
18929 if (kw_args > 0) { | |
18930 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_zerobased); | |
18931 if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
18932 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L3_error) | |
18933 } | |
18934 CYTHON_FALLTHROUGH; | |
18935 case 9: | |
18936 if (kw_args > 0) { | |
18937 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_min_shift); | |
18938 if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
18939 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L3_error) | |
18940 } | |
18941 CYTHON_FALLTHROUGH; | |
18942 case 10: | |
18943 if (kw_args > 0) { | |
18944 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index); | |
18945 if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
18946 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L3_error) | |
18947 } | |
18948 CYTHON_FALLTHROUGH; | |
18949 case 11: | |
18950 if (kw_args > 0) { | |
18951 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_keep_original); | |
18952 if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
18953 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L3_error) | |
18954 } | |
18955 CYTHON_FALLTHROUGH; | |
18956 case 12: | |
18957 if (kw_args > 0) { | |
18958 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_csi); | |
18959 if (value) { values[12] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
18960 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L3_error) | |
18961 } | |
18962 } | |
18963 if (unlikely(kw_args > 0)) { | |
18964 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
18965 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tabix_index") < 0)) __PYX_ERR(0, 873, __pyx_L3_error) | |
18966 } | |
18967 } else { | |
18968 switch (__pyx_nargs) { | |
18969 case 13: values[12] = __Pyx_Arg_FASTCALL(__pyx_args, 12); | |
18970 CYTHON_FALLTHROUGH; | |
18971 case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11); | |
18972 CYTHON_FALLTHROUGH; | |
18973 case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10); | |
18974 CYTHON_FALLTHROUGH; | |
18975 case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); | |
18976 CYTHON_FALLTHROUGH; | |
18977 case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); | |
18978 CYTHON_FALLTHROUGH; | |
18979 case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); | |
18980 CYTHON_FALLTHROUGH; | |
18981 case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); | |
18982 CYTHON_FALLTHROUGH; | |
18983 case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); | |
18984 CYTHON_FALLTHROUGH; | |
18985 case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); | |
18986 CYTHON_FALLTHROUGH; | |
18987 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
18988 CYTHON_FALLTHROUGH; | |
18989 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
18990 CYTHON_FALLTHROUGH; | |
18991 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
18992 CYTHON_FALLTHROUGH; | |
18993 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
18994 break; | |
18995 default: goto __pyx_L5_argtuple_error; | |
18996 } | |
18997 } | |
18998 __pyx_v_filename = values[0]; | |
18999 __pyx_v_force = values[1]; | |
19000 __pyx_v_seq_col = values[2]; | |
19001 __pyx_v_start_col = values[3]; | |
19002 __pyx_v_end_col = values[4]; | |
19003 __pyx_v_preset = values[5]; | |
19004 __pyx_v_meta_char = values[6]; | |
19005 if (values[7]) { | |
19006 __pyx_v_line_skip = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_line_skip == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 880, __pyx_L3_error) | |
19007 } else { | |
19008 __pyx_v_line_skip = ((int)((int)0)); | |
19009 } | |
19010 __pyx_v_zerobased = values[8]; | |
19011 if (values[9]) { | |
19012 __pyx_v_min_shift = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_min_shift == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 882, __pyx_L3_error) | |
19013 } else { | |
19014 __pyx_v_min_shift = ((int)((int)-1)); | |
19015 } | |
19016 __pyx_v_index = values[10]; | |
19017 __pyx_v_keep_original = values[11]; | |
19018 __pyx_v_csi = values[12]; | |
19019 } | |
19020 goto __pyx_L6_skip; | |
19021 __pyx_L5_argtuple_error:; | |
19022 __Pyx_RaiseArgtupleInvalid("tabix_index", 0, 1, 13, __pyx_nargs); __PYX_ERR(0, 873, __pyx_L3_error) | |
19023 __pyx_L6_skip:; | |
19024 goto __pyx_L4_argument_unpacking_done; | |
19025 __pyx_L3_error:; | |
19026 { | |
19027 Py_ssize_t __pyx_temp; | |
19028 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
19029 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
19030 } | |
19031 } | |
19032 __Pyx_AddTraceback("pysam.libctabix.tabix_index", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
19033 __Pyx_RefNannyFinishContext(); | |
19034 return NULL; | |
19035 __pyx_L4_argument_unpacking_done:; | |
19036 __pyx_r = __pyx_pf_5pysam_9libctabix_2tabix_index(__pyx_self, __pyx_v_filename, __pyx_v_force, __pyx_v_seq_col, __pyx_v_start_col, __pyx_v_end_col, __pyx_v_preset, __pyx_v_meta_char, __pyx_v_line_skip, __pyx_v_zerobased, __pyx_v_min_shift, __pyx_v_index, __pyx_v_keep_original, __pyx_v_csi); | |
19037 | |
19038 /* "pysam/libctabix.pyx":873 | |
19039 * | |
19040 * | |
19041 * def tabix_index(filename, # <<<<<<<<<<<<<< | |
19042 * force=False, | |
19043 * seq_col=None, | |
19044 */ | |
19045 | |
19046 /* function exit code */ | |
19047 { | |
19048 Py_ssize_t __pyx_temp; | |
19049 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
19050 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
19051 } | |
19052 } | |
19053 __Pyx_RefNannyFinishContext(); | |
19054 return __pyx_r; | |
19055 } | |
19056 | |
19057 static PyObject *__pyx_pf_5pysam_9libctabix_2tabix_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_force, PyObject *__pyx_v_seq_col, PyObject *__pyx_v_start_col, PyObject *__pyx_v_end_col, PyObject *__pyx_v_preset, PyObject *__pyx_v_meta_char, int __pyx_v_line_skip, PyObject *__pyx_v_zerobased, int __pyx_v_min_shift, PyObject *__pyx_v_index, PyObject *__pyx_v_keep_original, PyObject *__pyx_v_csi) { | |
19058 PyObject *__pyx_v_fn = NULL; | |
19059 char *__pyx_v_cfn; | |
19060 htsFile *__pyx_v_fp; | |
19061 htsFormat __pyx_v_fmt; | |
19062 PyObject *__pyx_v_preset2conf = NULL; | |
19063 PyObject *__pyx_v_conf_data = NULL; | |
19064 tbx_conf_t __pyx_v_conf; | |
19065 PyObject *__pyx_v_suffix = NULL; | |
19066 PyObject *__pyx_v_fn_index = NULL; | |
19067 char *__pyx_v_fnidx; | |
19068 int __pyx_v_retval; | |
19069 PyObject *__pyx_r = NULL; | |
19070 __Pyx_TraceDeclarations | |
19071 __Pyx_RefNannyDeclarations | |
19072 int __pyx_t_1; | |
19073 int __pyx_t_2; | |
19074 PyObject *__pyx_t_3 = NULL; | |
19075 char *__pyx_t_4; | |
19076 Py_ssize_t __pyx_t_5; | |
19077 Py_UCS4 __pyx_t_6; | |
19078 PyObject *__pyx_t_7 = NULL; | |
19079 PyObject *__pyx_t_8 = NULL; | |
19080 PyObject *__pyx_t_9 = NULL; | |
19081 unsigned int __pyx_t_10; | |
19082 PyObject *__pyx_t_11 = NULL; | |
19083 PyObject *__pyx_t_12 = NULL; | |
19084 PyObject *__pyx_t_13 = NULL; | |
19085 int __pyx_t_14; | |
19086 PyObject *__pyx_t_15 = NULL; | |
19087 PyObject *__pyx_t_16 = NULL; | |
19088 long __pyx_t_17; | |
19089 PyObject *__pyx_t_18 = NULL; | |
19090 PyObject *(*__pyx_t_19)(PyObject *); | |
19091 int32_t __pyx_t_20; | |
19092 int32_t __pyx_t_21; | |
19093 int32_t __pyx_t_22; | |
19094 int32_t __pyx_t_23; | |
19095 int32_t __pyx_t_24; | |
19096 int32_t __pyx_t_25; | |
19097 int __pyx_t_26; | |
19098 int __pyx_lineno = 0; | |
19099 const char *__pyx_filename = NULL; | |
19100 int __pyx_clineno = 0; | |
19101 __Pyx_TraceFrameInit(__pyx_codeobj__40) | |
19102 __Pyx_RefNannySetupContext("tabix_index", 0); | |
19103 __Pyx_TraceCall("tabix_index", __pyx_f[0], 873, 0, __PYX_ERR(0, 873, __pyx_L1_error)); | |
19104 __Pyx_INCREF(__pyx_v_filename); | |
19105 __Pyx_INCREF(__pyx_v_end_col); | |
19106 __Pyx_INCREF(__pyx_v_preset); | |
19107 __Pyx_INCREF(__pyx_v_index); | |
19108 __Pyx_INCREF(__pyx_v_csi); | |
19109 | |
19110 /* "pysam/libctabix.pyx":928 | |
19111 * ''' | |
19112 * | |
19113 * if preset is None and \ # <<<<<<<<<<<<<< | |
19114 * (seq_col is None or start_col is None or end_col is None): | |
19115 * raise ValueError( | |
19116 */ | |
19117 __pyx_t_2 = (__pyx_v_preset == Py_None); | |
19118 if (__pyx_t_2) { | |
19119 } else { | |
19120 __pyx_t_1 = __pyx_t_2; | |
19121 goto __pyx_L4_bool_binop_done; | |
19122 } | |
19123 | |
19124 /* "pysam/libctabix.pyx":929 | |
19125 * | |
19126 * if preset is None and \ | |
19127 * (seq_col is None or start_col is None or end_col is None): # <<<<<<<<<<<<<< | |
19128 * raise ValueError( | |
19129 * "neither preset nor seq_col,start_col and end_col given") | |
19130 */ | |
19131 __pyx_t_2 = (__pyx_v_seq_col == Py_None); | |
19132 if (!__pyx_t_2) { | |
19133 } else { | |
19134 __pyx_t_1 = __pyx_t_2; | |
19135 goto __pyx_L4_bool_binop_done; | |
19136 } | |
19137 __pyx_t_2 = (__pyx_v_start_col == Py_None); | |
19138 if (!__pyx_t_2) { | |
19139 } else { | |
19140 __pyx_t_1 = __pyx_t_2; | |
19141 goto __pyx_L4_bool_binop_done; | |
19142 } | |
19143 __pyx_t_2 = (__pyx_v_end_col == Py_None); | |
19144 __pyx_t_1 = __pyx_t_2; | |
19145 __pyx_L4_bool_binop_done:; | |
19146 | |
19147 /* "pysam/libctabix.pyx":928 | |
19148 * ''' | |
19149 * | |
19150 * if preset is None and \ # <<<<<<<<<<<<<< | |
19151 * (seq_col is None or start_col is None or end_col is None): | |
19152 * raise ValueError( | |
19153 */ | |
19154 if (unlikely(__pyx_t_1)) { | |
19155 | |
19156 /* "pysam/libctabix.pyx":930 | |
19157 * if preset is None and \ | |
19158 * (seq_col is None or start_col is None or end_col is None): | |
19159 * raise ValueError( # <<<<<<<<<<<<<< | |
19160 * "neither preset nor seq_col,start_col and end_col given") | |
19161 * | |
19162 */ | |
19163 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 930, __pyx_L1_error) | |
19164 __Pyx_GOTREF(__pyx_t_3); | |
19165 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
19166 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
19167 __PYX_ERR(0, 930, __pyx_L1_error) | |
19168 | |
19169 /* "pysam/libctabix.pyx":928 | |
19170 * ''' | |
19171 * | |
19172 * if preset is None and \ # <<<<<<<<<<<<<< | |
19173 * (seq_col is None or start_col is None or end_col is None): | |
19174 * raise ValueError( | |
19175 */ | |
19176 } | |
19177 | |
19178 /* "pysam/libctabix.pyx":933 | |
19179 * "neither preset nor seq_col,start_col and end_col given") | |
19180 * | |
19181 * fn = encode_filename(filename) # <<<<<<<<<<<<<< | |
19182 * cdef char *cfn = fn | |
19183 * | |
19184 */ | |
19185 __pyx_t_3 = __pyx_f_5pysam_9libcutils_encode_filename(__pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 933, __pyx_L1_error) | |
19186 __Pyx_GOTREF(__pyx_t_3); | |
19187 __pyx_v_fn = ((PyObject*)__pyx_t_3); | |
19188 __pyx_t_3 = 0; | |
19189 | |
19190 /* "pysam/libctabix.pyx":934 | |
19191 * | |
19192 * fn = encode_filename(filename) | |
19193 * cdef char *cfn = fn # <<<<<<<<<<<<<< | |
19194 * | |
19195 * cdef htsFile *fp = hts_open(cfn, "r") | |
19196 */ | |
19197 if (unlikely(__pyx_v_fn == Py_None)) { | |
19198 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); | |
19199 __PYX_ERR(0, 934, __pyx_L1_error) | |
19200 } | |
19201 __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_fn); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 934, __pyx_L1_error) | |
19202 __pyx_v_cfn = __pyx_t_4; | |
19203 | |
19204 /* "pysam/libctabix.pyx":936 | |
19205 * cdef char *cfn = fn | |
19206 * | |
19207 * cdef htsFile *fp = hts_open(cfn, "r") # <<<<<<<<<<<<<< | |
19208 * if fp == NULL: | |
19209 * raise IOError("Could not open file '%s': %s" % (filename, force_str(strerror(errno)))) | |
19210 */ | |
19211 __pyx_v_fp = hts_open(__pyx_v_cfn, ((char const *)"r")); | |
19212 | |
19213 /* "pysam/libctabix.pyx":937 | |
19214 * | |
19215 * cdef htsFile *fp = hts_open(cfn, "r") | |
19216 * if fp == NULL: # <<<<<<<<<<<<<< | |
19217 * raise IOError("Could not open file '%s': %s" % (filename, force_str(strerror(errno)))) | |
19218 * | |
19219 */ | |
19220 __pyx_t_1 = (__pyx_v_fp == NULL); | |
19221 if (unlikely(__pyx_t_1)) { | |
19222 | |
19223 /* "pysam/libctabix.pyx":938 | |
19224 * cdef htsFile *fp = hts_open(cfn, "r") | |
19225 * if fp == NULL: | |
19226 * raise IOError("Could not open file '%s': %s" % (filename, force_str(strerror(errno)))) # <<<<<<<<<<<<<< | |
19227 * | |
19228 * cdef htsFormat fmt = hts_get_format(fp)[0] | |
19229 */ | |
19230 __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 938, __pyx_L1_error) | |
19231 __Pyx_GOTREF(__pyx_t_3); | |
19232 __pyx_t_5 = 0; | |
19233 __pyx_t_6 = 127; | |
19234 __Pyx_INCREF(__pyx_kp_u_Could_not_open_file); | |
19235 __pyx_t_5 += 21; | |
19236 __Pyx_GIVEREF(__pyx_kp_u_Could_not_open_file); | |
19237 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Could_not_open_file); | |
19238 __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_filename), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 938, __pyx_L1_error) | |
19239 __Pyx_GOTREF(__pyx_t_7); | |
19240 __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6; | |
19241 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); | |
19242 __Pyx_GIVEREF(__pyx_t_7); | |
19243 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7); | |
19244 __pyx_t_7 = 0; | |
19245 __Pyx_INCREF(__pyx_kp_u__42); | |
19246 __pyx_t_5 += 3; | |
19247 __Pyx_GIVEREF(__pyx_kp_u__42); | |
19248 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__42); | |
19249 __pyx_t_7 = __Pyx_PyBytes_FromString(strerror(errno)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 938, __pyx_L1_error) | |
19250 __Pyx_GOTREF(__pyx_t_7); | |
19251 __pyx_t_8 = __pyx_f_5pysam_9libcutils_force_str(__pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 938, __pyx_L1_error) | |
19252 __Pyx_GOTREF(__pyx_t_8); | |
19253 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
19254 __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_8), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 938, __pyx_L1_error) | |
19255 __Pyx_GOTREF(__pyx_t_7); | |
19256 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
19257 __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6; | |
19258 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); | |
19259 __Pyx_GIVEREF(__pyx_t_7); | |
19260 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_7); | |
19261 __pyx_t_7 = 0; | |
19262 __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 938, __pyx_L1_error) | |
19263 __Pyx_GOTREF(__pyx_t_7); | |
19264 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
19265 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 938, __pyx_L1_error) | |
19266 __Pyx_GOTREF(__pyx_t_3); | |
19267 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
19268 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
19269 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
19270 __PYX_ERR(0, 938, __pyx_L1_error) | |
19271 | |
19272 /* "pysam/libctabix.pyx":937 | |
19273 * | |
19274 * cdef htsFile *fp = hts_open(cfn, "r") | |
19275 * if fp == NULL: # <<<<<<<<<<<<<< | |
19276 * raise IOError("Could not open file '%s': %s" % (filename, force_str(strerror(errno)))) | |
19277 * | |
19278 */ | |
19279 } | |
19280 | |
19281 /* "pysam/libctabix.pyx":940 | |
19282 * raise IOError("Could not open file '%s': %s" % (filename, force_str(strerror(errno)))) | |
19283 * | |
19284 * cdef htsFormat fmt = hts_get_format(fp)[0] # <<<<<<<<<<<<<< | |
19285 * hts_close(fp) | |
19286 * | |
19287 */ | |
19288 __pyx_v_fmt = (hts_get_format(__pyx_v_fp)[0]); | |
19289 | |
19290 /* "pysam/libctabix.pyx":941 | |
19291 * | |
19292 * cdef htsFormat fmt = hts_get_format(fp)[0] | |
19293 * hts_close(fp) # <<<<<<<<<<<<<< | |
19294 * | |
19295 * if fmt.compression == no_compression: | |
19296 */ | |
19297 (void)(hts_close(__pyx_v_fp)); | |
19298 | |
19299 /* "pysam/libctabix.pyx":943 | |
19300 * hts_close(fp) | |
19301 * | |
19302 * if fmt.compression == no_compression: # <<<<<<<<<<<<<< | |
19303 * tabix_compress(filename, filename + ".gz", force=force) | |
19304 * if not keep_original: | |
19305 */ | |
19306 __pyx_t_1 = (__pyx_v_fmt.compression == no_compression); | |
19307 if (__pyx_t_1) { | |
19308 | |
19309 /* "pysam/libctabix.pyx":944 | |
19310 * | |
19311 * if fmt.compression == no_compression: | |
19312 * tabix_compress(filename, filename + ".gz", force=force) # <<<<<<<<<<<<<< | |
19313 * if not keep_original: | |
19314 * os.unlink(filename) | |
19315 */ | |
19316 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_tabix_compress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 944, __pyx_L1_error) | |
19317 __Pyx_GOTREF(__pyx_t_3); | |
19318 __pyx_t_7 = PyNumber_Add(__pyx_v_filename, __pyx_kp_u_gz); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 944, __pyx_L1_error) | |
19319 __Pyx_GOTREF(__pyx_t_7); | |
19320 __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 944, __pyx_L1_error) | |
19321 __Pyx_GOTREF(__pyx_t_8); | |
19322 __Pyx_INCREF(__pyx_v_filename); | |
19323 __Pyx_GIVEREF(__pyx_v_filename); | |
19324 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_filename)) __PYX_ERR(0, 944, __pyx_L1_error); | |
19325 __Pyx_GIVEREF(__pyx_t_7); | |
19326 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 944, __pyx_L1_error); | |
19327 __pyx_t_7 = 0; | |
19328 __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 944, __pyx_L1_error) | |
19329 __Pyx_GOTREF(__pyx_t_7); | |
19330 if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_force, __pyx_v_force) < 0) __PYX_ERR(0, 944, __pyx_L1_error) | |
19331 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 944, __pyx_L1_error) | |
19332 __Pyx_GOTREF(__pyx_t_9); | |
19333 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
19334 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
19335 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
19336 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
19337 | |
19338 /* "pysam/libctabix.pyx":945 | |
19339 * if fmt.compression == no_compression: | |
19340 * tabix_compress(filename, filename + ".gz", force=force) | |
19341 * if not keep_original: # <<<<<<<<<<<<<< | |
19342 * os.unlink(filename) | |
19343 * filename += ".gz" | |
19344 */ | |
19345 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_keep_original); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 945, __pyx_L1_error) | |
19346 __pyx_t_2 = (!__pyx_t_1); | |
19347 if (__pyx_t_2) { | |
19348 | |
19349 /* "pysam/libctabix.pyx":946 | |
19350 * tabix_compress(filename, filename + ".gz", force=force) | |
19351 * if not keep_original: | |
19352 * os.unlink(filename) # <<<<<<<<<<<<<< | |
19353 * filename += ".gz" | |
19354 * fn = encode_filename(filename) | |
19355 */ | |
19356 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 946, __pyx_L1_error) | |
19357 __Pyx_GOTREF(__pyx_t_7); | |
19358 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_unlink); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 946, __pyx_L1_error) | |
19359 __Pyx_GOTREF(__pyx_t_8); | |
19360 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
19361 __pyx_t_7 = NULL; | |
19362 __pyx_t_10 = 0; | |
19363 #if CYTHON_UNPACK_METHODS | |
19364 if (unlikely(PyMethod_Check(__pyx_t_8))) { | |
19365 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); | |
19366 if (likely(__pyx_t_7)) { | |
19367 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); | |
19368 __Pyx_INCREF(__pyx_t_7); | |
19369 __Pyx_INCREF(function); | |
19370 __Pyx_DECREF_SET(__pyx_t_8, function); | |
19371 __pyx_t_10 = 1; | |
19372 } | |
19373 } | |
19374 #endif | |
19375 { | |
19376 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_filename}; | |
19377 __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); | |
19378 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
19379 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 946, __pyx_L1_error) | |
19380 __Pyx_GOTREF(__pyx_t_9); | |
19381 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
19382 } | |
19383 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
19384 | |
19385 /* "pysam/libctabix.pyx":945 | |
19386 * if fmt.compression == no_compression: | |
19387 * tabix_compress(filename, filename + ".gz", force=force) | |
19388 * if not keep_original: # <<<<<<<<<<<<<< | |
19389 * os.unlink(filename) | |
19390 * filename += ".gz" | |
19391 */ | |
19392 } | |
19393 | |
19394 /* "pysam/libctabix.pyx":947 | |
19395 * if not keep_original: | |
19396 * os.unlink(filename) | |
19397 * filename += ".gz" # <<<<<<<<<<<<<< | |
19398 * fn = encode_filename(filename) | |
19399 * cfn = fn | |
19400 */ | |
19401 __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_filename, __pyx_kp_u_gz); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 947, __pyx_L1_error) | |
19402 __Pyx_GOTREF(__pyx_t_9); | |
19403 __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_9); | |
19404 __pyx_t_9 = 0; | |
19405 | |
19406 /* "pysam/libctabix.pyx":948 | |
19407 * os.unlink(filename) | |
19408 * filename += ".gz" | |
19409 * fn = encode_filename(filename) # <<<<<<<<<<<<<< | |
19410 * cfn = fn | |
19411 * | |
19412 */ | |
19413 __pyx_t_9 = __pyx_f_5pysam_9libcutils_encode_filename(__pyx_v_filename); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 948, __pyx_L1_error) | |
19414 __Pyx_GOTREF(__pyx_t_9); | |
19415 __Pyx_DECREF_SET(__pyx_v_fn, ((PyObject*)__pyx_t_9)); | |
19416 __pyx_t_9 = 0; | |
19417 | |
19418 /* "pysam/libctabix.pyx":949 | |
19419 * filename += ".gz" | |
19420 * fn = encode_filename(filename) | |
19421 * cfn = fn # <<<<<<<<<<<<<< | |
19422 * | |
19423 * # columns (1-based): | |
19424 */ | |
19425 if (unlikely(__pyx_v_fn == Py_None)) { | |
19426 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); | |
19427 __PYX_ERR(0, 949, __pyx_L1_error) | |
19428 } | |
19429 __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_fn); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 949, __pyx_L1_error) | |
19430 __pyx_v_cfn = __pyx_t_4; | |
19431 | |
19432 /* "pysam/libctabix.pyx":943 | |
19433 * hts_close(fp) | |
19434 * | |
19435 * if fmt.compression == no_compression: # <<<<<<<<<<<<<< | |
19436 * tabix_compress(filename, filename + ".gz", force=force) | |
19437 * if not keep_original: | |
19438 */ | |
19439 } | |
19440 | |
19441 /* "pysam/libctabix.pyx":956 | |
19442 * # 0 is a missing column | |
19443 * preset2conf = { | |
19444 * 'gff' : (TBX_GENERIC, 1, 4, 5, ord('#'), 0), # <<<<<<<<<<<<<< | |
19445 * 'bed' : (TBX_UCSC, 1, 2, 3, ord('#'), 0), | |
19446 * 'psltbl' : (TBX_UCSC, 15, 17, 18, ord('#'), 0), | |
19447 */ | |
19448 __pyx_t_9 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 956, __pyx_L1_error) | |
19449 __Pyx_GOTREF(__pyx_t_9); | |
19450 __pyx_t_8 = __Pyx_PyInt_From_int32_t(TBX_GENERIC); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 956, __pyx_L1_error) | |
19451 __Pyx_GOTREF(__pyx_t_8); | |
19452 __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 956, __pyx_L1_error) | |
19453 __Pyx_GOTREF(__pyx_t_7); | |
19454 __Pyx_GIVEREF(__pyx_t_8); | |
19455 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8)) __PYX_ERR(0, 956, __pyx_L1_error); | |
19456 __Pyx_INCREF(__pyx_int_1); | |
19457 __Pyx_GIVEREF(__pyx_int_1); | |
19458 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_1)) __PYX_ERR(0, 956, __pyx_L1_error); | |
19459 __Pyx_INCREF(__pyx_int_4); | |
19460 __Pyx_GIVEREF(__pyx_int_4); | |
19461 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_int_4)) __PYX_ERR(0, 956, __pyx_L1_error); | |
19462 __Pyx_INCREF(__pyx_int_5); | |
19463 __Pyx_GIVEREF(__pyx_int_5); | |
19464 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_int_5)) __PYX_ERR(0, 956, __pyx_L1_error); | |
19465 __Pyx_INCREF(__pyx_int_35); | |
19466 __Pyx_GIVEREF(__pyx_int_35); | |
19467 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_int_35)) __PYX_ERR(0, 956, __pyx_L1_error); | |
19468 __Pyx_INCREF(__pyx_int_0); | |
19469 __Pyx_GIVEREF(__pyx_int_0); | |
19470 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_int_0)) __PYX_ERR(0, 956, __pyx_L1_error); | |
19471 __pyx_t_8 = 0; | |
19472 if (PyDict_SetItem(__pyx_t_9, __pyx_n_u_gff, __pyx_t_7) < 0) __PYX_ERR(0, 956, __pyx_L1_error) | |
19473 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
19474 | |
19475 /* "pysam/libctabix.pyx":957 | |
19476 * preset2conf = { | |
19477 * 'gff' : (TBX_GENERIC, 1, 4, 5, ord('#'), 0), | |
19478 * 'bed' : (TBX_UCSC, 1, 2, 3, ord('#'), 0), # <<<<<<<<<<<<<< | |
19479 * 'psltbl' : (TBX_UCSC, 15, 17, 18, ord('#'), 0), | |
19480 * 'sam' : (TBX_SAM, 3, 4, 0, ord('@'), 0), | |
19481 */ | |
19482 __pyx_t_7 = __Pyx_PyInt_From_int32_t(TBX_UCSC); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 957, __pyx_L1_error) | |
19483 __Pyx_GOTREF(__pyx_t_7); | |
19484 __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 957, __pyx_L1_error) | |
19485 __Pyx_GOTREF(__pyx_t_8); | |
19486 __Pyx_GIVEREF(__pyx_t_7); | |
19487 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7)) __PYX_ERR(0, 957, __pyx_L1_error); | |
19488 __Pyx_INCREF(__pyx_int_1); | |
19489 __Pyx_GIVEREF(__pyx_int_1); | |
19490 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_1)) __PYX_ERR(0, 957, __pyx_L1_error); | |
19491 __Pyx_INCREF(__pyx_int_2); | |
19492 __Pyx_GIVEREF(__pyx_int_2); | |
19493 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_int_2)) __PYX_ERR(0, 957, __pyx_L1_error); | |
19494 __Pyx_INCREF(__pyx_int_3); | |
19495 __Pyx_GIVEREF(__pyx_int_3); | |
19496 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_int_3)) __PYX_ERR(0, 957, __pyx_L1_error); | |
19497 __Pyx_INCREF(__pyx_int_35); | |
19498 __Pyx_GIVEREF(__pyx_int_35); | |
19499 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_int_35)) __PYX_ERR(0, 957, __pyx_L1_error); | |
19500 __Pyx_INCREF(__pyx_int_0); | |
19501 __Pyx_GIVEREF(__pyx_int_0); | |
19502 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_int_0)) __PYX_ERR(0, 957, __pyx_L1_error); | |
19503 __pyx_t_7 = 0; | |
19504 if (PyDict_SetItem(__pyx_t_9, __pyx_n_u_bed, __pyx_t_8) < 0) __PYX_ERR(0, 956, __pyx_L1_error) | |
19505 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
19506 | |
19507 /* "pysam/libctabix.pyx":958 | |
19508 * 'gff' : (TBX_GENERIC, 1, 4, 5, ord('#'), 0), | |
19509 * 'bed' : (TBX_UCSC, 1, 2, 3, ord('#'), 0), | |
19510 * 'psltbl' : (TBX_UCSC, 15, 17, 18, ord('#'), 0), # <<<<<<<<<<<<<< | |
19511 * 'sam' : (TBX_SAM, 3, 4, 0, ord('@'), 0), | |
19512 * 'vcf' : (TBX_VCF, 1, 2, 0, ord('#'), 0), | |
19513 */ | |
19514 __pyx_t_8 = __Pyx_PyInt_From_int32_t(TBX_UCSC); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 958, __pyx_L1_error) | |
19515 __Pyx_GOTREF(__pyx_t_8); | |
19516 __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 958, __pyx_L1_error) | |
19517 __Pyx_GOTREF(__pyx_t_7); | |
19518 __Pyx_GIVEREF(__pyx_t_8); | |
19519 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8)) __PYX_ERR(0, 958, __pyx_L1_error); | |
19520 __Pyx_INCREF(__pyx_int_15); | |
19521 __Pyx_GIVEREF(__pyx_int_15); | |
19522 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_15)) __PYX_ERR(0, 958, __pyx_L1_error); | |
19523 __Pyx_INCREF(__pyx_int_17); | |
19524 __Pyx_GIVEREF(__pyx_int_17); | |
19525 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_int_17)) __PYX_ERR(0, 958, __pyx_L1_error); | |
19526 __Pyx_INCREF(__pyx_int_18); | |
19527 __Pyx_GIVEREF(__pyx_int_18); | |
19528 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_int_18)) __PYX_ERR(0, 958, __pyx_L1_error); | |
19529 __Pyx_INCREF(__pyx_int_35); | |
19530 __Pyx_GIVEREF(__pyx_int_35); | |
19531 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_int_35)) __PYX_ERR(0, 958, __pyx_L1_error); | |
19532 __Pyx_INCREF(__pyx_int_0); | |
19533 __Pyx_GIVEREF(__pyx_int_0); | |
19534 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_int_0)) __PYX_ERR(0, 958, __pyx_L1_error); | |
19535 __pyx_t_8 = 0; | |
19536 if (PyDict_SetItem(__pyx_t_9, __pyx_n_u_psltbl, __pyx_t_7) < 0) __PYX_ERR(0, 956, __pyx_L1_error) | |
19537 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
19538 | |
19539 /* "pysam/libctabix.pyx":959 | |
19540 * 'bed' : (TBX_UCSC, 1, 2, 3, ord('#'), 0), | |
19541 * 'psltbl' : (TBX_UCSC, 15, 17, 18, ord('#'), 0), | |
19542 * 'sam' : (TBX_SAM, 3, 4, 0, ord('@'), 0), # <<<<<<<<<<<<<< | |
19543 * 'vcf' : (TBX_VCF, 1, 2, 0, ord('#'), 0), | |
19544 * } | |
19545 */ | |
19546 __pyx_t_7 = __Pyx_PyInt_From_int32_t(TBX_SAM); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 959, __pyx_L1_error) | |
19547 __Pyx_GOTREF(__pyx_t_7); | |
19548 __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 959, __pyx_L1_error) | |
19549 __Pyx_GOTREF(__pyx_t_8); | |
19550 __Pyx_GIVEREF(__pyx_t_7); | |
19551 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7)) __PYX_ERR(0, 959, __pyx_L1_error); | |
19552 __Pyx_INCREF(__pyx_int_3); | |
19553 __Pyx_GIVEREF(__pyx_int_3); | |
19554 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_3)) __PYX_ERR(0, 959, __pyx_L1_error); | |
19555 __Pyx_INCREF(__pyx_int_4); | |
19556 __Pyx_GIVEREF(__pyx_int_4); | |
19557 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_int_4)) __PYX_ERR(0, 959, __pyx_L1_error); | |
19558 __Pyx_INCREF(__pyx_int_0); | |
19559 __Pyx_GIVEREF(__pyx_int_0); | |
19560 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_int_0)) __PYX_ERR(0, 959, __pyx_L1_error); | |
19561 __Pyx_INCREF(__pyx_int_64); | |
19562 __Pyx_GIVEREF(__pyx_int_64); | |
19563 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_int_64)) __PYX_ERR(0, 959, __pyx_L1_error); | |
19564 __Pyx_INCREF(__pyx_int_0); | |
19565 __Pyx_GIVEREF(__pyx_int_0); | |
19566 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_int_0)) __PYX_ERR(0, 959, __pyx_L1_error); | |
19567 __pyx_t_7 = 0; | |
19568 if (PyDict_SetItem(__pyx_t_9, __pyx_n_u_sam, __pyx_t_8) < 0) __PYX_ERR(0, 956, __pyx_L1_error) | |
19569 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
19570 | |
19571 /* "pysam/libctabix.pyx":960 | |
19572 * 'psltbl' : (TBX_UCSC, 15, 17, 18, ord('#'), 0), | |
19573 * 'sam' : (TBX_SAM, 3, 4, 0, ord('@'), 0), | |
19574 * 'vcf' : (TBX_VCF, 1, 2, 0, ord('#'), 0), # <<<<<<<<<<<<<< | |
19575 * } | |
19576 * | |
19577 */ | |
19578 __pyx_t_8 = __Pyx_PyInt_From_int32_t(TBX_VCF); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 960, __pyx_L1_error) | |
19579 __Pyx_GOTREF(__pyx_t_8); | |
19580 __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 960, __pyx_L1_error) | |
19581 __Pyx_GOTREF(__pyx_t_7); | |
19582 __Pyx_GIVEREF(__pyx_t_8); | |
19583 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8)) __PYX_ERR(0, 960, __pyx_L1_error); | |
19584 __Pyx_INCREF(__pyx_int_1); | |
19585 __Pyx_GIVEREF(__pyx_int_1); | |
19586 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_1)) __PYX_ERR(0, 960, __pyx_L1_error); | |
19587 __Pyx_INCREF(__pyx_int_2); | |
19588 __Pyx_GIVEREF(__pyx_int_2); | |
19589 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_int_2)) __PYX_ERR(0, 960, __pyx_L1_error); | |
19590 __Pyx_INCREF(__pyx_int_0); | |
19591 __Pyx_GIVEREF(__pyx_int_0); | |
19592 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_int_0)) __PYX_ERR(0, 960, __pyx_L1_error); | |
19593 __Pyx_INCREF(__pyx_int_35); | |
19594 __Pyx_GIVEREF(__pyx_int_35); | |
19595 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_int_35)) __PYX_ERR(0, 960, __pyx_L1_error); | |
19596 __Pyx_INCREF(__pyx_int_0); | |
19597 __Pyx_GIVEREF(__pyx_int_0); | |
19598 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_int_0)) __PYX_ERR(0, 960, __pyx_L1_error); | |
19599 __pyx_t_8 = 0; | |
19600 if (PyDict_SetItem(__pyx_t_9, __pyx_n_u_vcf, __pyx_t_7) < 0) __PYX_ERR(0, 956, __pyx_L1_error) | |
19601 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
19602 __pyx_v_preset2conf = ((PyObject*)__pyx_t_9); | |
19603 __pyx_t_9 = 0; | |
19604 | |
19605 /* "pysam/libctabix.pyx":963 | |
19606 * } | |
19607 * | |
19608 * conf_data = None # <<<<<<<<<<<<<< | |
19609 * if preset == "bcf" or fmt.format == bcf: | |
19610 * csi = True | |
19611 */ | |
19612 __Pyx_INCREF(Py_None); | |
19613 __pyx_v_conf_data = Py_None; | |
19614 | |
19615 /* "pysam/libctabix.pyx":964 | |
19616 * | |
19617 * conf_data = None | |
19618 * if preset == "bcf" or fmt.format == bcf: # <<<<<<<<<<<<<< | |
19619 * csi = True | |
19620 * elif preset: | |
19621 */ | |
19622 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_preset, __pyx_n_u_bcf, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 964, __pyx_L1_error) | |
19623 if (!__pyx_t_1) { | |
19624 } else { | |
19625 __pyx_t_2 = __pyx_t_1; | |
19626 goto __pyx_L12_bool_binop_done; | |
19627 } | |
19628 __pyx_t_1 = (__pyx_v_fmt.format == bcf); | |
19629 __pyx_t_2 = __pyx_t_1; | |
19630 __pyx_L12_bool_binop_done:; | |
19631 if (__pyx_t_2) { | |
19632 | |
19633 /* "pysam/libctabix.pyx":965 | |
19634 * conf_data = None | |
19635 * if preset == "bcf" or fmt.format == bcf: | |
19636 * csi = True # <<<<<<<<<<<<<< | |
19637 * elif preset: | |
19638 * try: | |
19639 */ | |
19640 __Pyx_INCREF(Py_True); | |
19641 __Pyx_DECREF_SET(__pyx_v_csi, Py_True); | |
19642 | |
19643 /* "pysam/libctabix.pyx":964 | |
19644 * | |
19645 * conf_data = None | |
19646 * if preset == "bcf" or fmt.format == bcf: # <<<<<<<<<<<<<< | |
19647 * csi = True | |
19648 * elif preset: | |
19649 */ | |
19650 goto __pyx_L11; | |
19651 } | |
19652 | |
19653 /* "pysam/libctabix.pyx":966 | |
19654 * if preset == "bcf" or fmt.format == bcf: | |
19655 * csi = True | |
19656 * elif preset: # <<<<<<<<<<<<<< | |
19657 * try: | |
19658 * conf_data = preset2conf[preset] | |
19659 */ | |
19660 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_preset); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 966, __pyx_L1_error) | |
19661 if (__pyx_t_2) { | |
19662 | |
19663 /* "pysam/libctabix.pyx":967 | |
19664 * csi = True | |
19665 * elif preset: | |
19666 * try: # <<<<<<<<<<<<<< | |
19667 * conf_data = preset2conf[preset] | |
19668 * except KeyError: | |
19669 */ | |
19670 { | |
19671 __Pyx_PyThreadState_declare | |
19672 __Pyx_PyThreadState_assign | |
19673 __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); | |
19674 __Pyx_XGOTREF(__pyx_t_11); | |
19675 __Pyx_XGOTREF(__pyx_t_12); | |
19676 __Pyx_XGOTREF(__pyx_t_13); | |
19677 /*try:*/ { | |
19678 | |
19679 /* "pysam/libctabix.pyx":968 | |
19680 * elif preset: | |
19681 * try: | |
19682 * conf_data = preset2conf[preset] # <<<<<<<<<<<<<< | |
19683 * except KeyError: | |
19684 * raise KeyError( | |
19685 */ | |
19686 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_preset2conf, __pyx_v_preset); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 968, __pyx_L14_error) | |
19687 __Pyx_GOTREF(__pyx_t_9); | |
19688 __Pyx_DECREF_SET(__pyx_v_conf_data, __pyx_t_9); | |
19689 __pyx_t_9 = 0; | |
19690 | |
19691 /* "pysam/libctabix.pyx":967 | |
19692 * csi = True | |
19693 * elif preset: | |
19694 * try: # <<<<<<<<<<<<<< | |
19695 * conf_data = preset2conf[preset] | |
19696 * except KeyError: | |
19697 */ | |
19698 } | |
19699 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; | |
19700 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; | |
19701 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; | |
19702 goto __pyx_L19_try_end; | |
19703 __pyx_L14_error:; | |
19704 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
19705 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
19706 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; | |
19707 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
19708 | |
19709 /* "pysam/libctabix.pyx":969 | |
19710 * try: | |
19711 * conf_data = preset2conf[preset] | |
19712 * except KeyError: # <<<<<<<<<<<<<< | |
19713 * raise KeyError( | |
19714 * "unknown preset '%s', valid presets are '%s'" % | |
19715 */ | |
19716 __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); | |
19717 if (__pyx_t_14) { | |
19718 __Pyx_AddTraceback("pysam.libctabix.tabix_index", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
19719 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 969, __pyx_L16_except_error) | |
19720 __Pyx_XGOTREF(__pyx_t_9); | |
19721 __Pyx_XGOTREF(__pyx_t_7); | |
19722 __Pyx_XGOTREF(__pyx_t_8); | |
19723 | |
19724 /* "pysam/libctabix.pyx":971 | |
19725 * except KeyError: | |
19726 * raise KeyError( | |
19727 * "unknown preset '%s', valid presets are '%s'" % # <<<<<<<<<<<<<< | |
19728 * (preset, ",".join(preset2conf.keys()))) | |
19729 * else: | |
19730 */ | |
19731 __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 971, __pyx_L16_except_error) | |
19732 __Pyx_GOTREF(__pyx_t_3); | |
19733 __pyx_t_5 = 0; | |
19734 __pyx_t_6 = 127; | |
19735 __Pyx_INCREF(__pyx_kp_u_unknown_preset); | |
19736 __pyx_t_5 += 16; | |
19737 __Pyx_GIVEREF(__pyx_kp_u_unknown_preset); | |
19738 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_unknown_preset); | |
19739 | |
19740 /* "pysam/libctabix.pyx":972 | |
19741 * raise KeyError( | |
19742 * "unknown preset '%s', valid presets are '%s'" % | |
19743 * (preset, ",".join(preset2conf.keys()))) # <<<<<<<<<<<<<< | |
19744 * else: | |
19745 * if end_col is None: | |
19746 */ | |
19747 __pyx_t_15 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_preset), __pyx_empty_unicode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 972, __pyx_L16_except_error) | |
19748 __Pyx_GOTREF(__pyx_t_15); | |
19749 __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) : __pyx_t_6; | |
19750 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15); | |
19751 __Pyx_GIVEREF(__pyx_t_15); | |
19752 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_15); | |
19753 __pyx_t_15 = 0; | |
19754 __Pyx_INCREF(__pyx_kp_u_valid_presets_are); | |
19755 __pyx_t_5 += 22; | |
19756 __Pyx_GIVEREF(__pyx_kp_u_valid_presets_are); | |
19757 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_valid_presets_are); | |
19758 __pyx_t_15 = __Pyx_PyDict_Keys(__pyx_v_preset2conf); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 972, __pyx_L16_except_error) | |
19759 __Pyx_GOTREF(__pyx_t_15); | |
19760 __pyx_t_16 = PyUnicode_Join(__pyx_kp_u__43, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 972, __pyx_L16_except_error) | |
19761 __Pyx_GOTREF(__pyx_t_16); | |
19762 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; | |
19763 __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_16) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_16) : __pyx_t_6; | |
19764 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_16); | |
19765 __Pyx_GIVEREF(__pyx_t_16); | |
19766 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_16); | |
19767 __pyx_t_16 = 0; | |
19768 __Pyx_INCREF(__pyx_kp_u__44); | |
19769 __pyx_t_5 += 1; | |
19770 __Pyx_GIVEREF(__pyx_kp_u__44); | |
19771 PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__44); | |
19772 | |
19773 /* "pysam/libctabix.pyx":971 | |
19774 * except KeyError: | |
19775 * raise KeyError( | |
19776 * "unknown preset '%s', valid presets are '%s'" % # <<<<<<<<<<<<<< | |
19777 * (preset, ",".join(preset2conf.keys()))) | |
19778 * else: | |
19779 */ | |
19780 __pyx_t_16 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 971, __pyx_L16_except_error) | |
19781 __Pyx_GOTREF(__pyx_t_16); | |
19782 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
19783 | |
19784 /* "pysam/libctabix.pyx":970 | |
19785 * conf_data = preset2conf[preset] | |
19786 * except KeyError: | |
19787 * raise KeyError( # <<<<<<<<<<<<<< | |
19788 * "unknown preset '%s', valid presets are '%s'" % | |
19789 * (preset, ",".join(preset2conf.keys()))) | |
19790 */ | |
19791 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 970, __pyx_L16_except_error) | |
19792 __Pyx_GOTREF(__pyx_t_3); | |
19793 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; | |
19794 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
19795 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
19796 __PYX_ERR(0, 970, __pyx_L16_except_error) | |
19797 } | |
19798 goto __pyx_L16_except_error; | |
19799 | |
19800 /* "pysam/libctabix.pyx":967 | |
19801 * csi = True | |
19802 * elif preset: | |
19803 * try: # <<<<<<<<<<<<<< | |
19804 * conf_data = preset2conf[preset] | |
19805 * except KeyError: | |
19806 */ | |
19807 __pyx_L16_except_error:; | |
19808 __Pyx_XGIVEREF(__pyx_t_11); | |
19809 __Pyx_XGIVEREF(__pyx_t_12); | |
19810 __Pyx_XGIVEREF(__pyx_t_13); | |
19811 __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); | |
19812 goto __pyx_L1_error; | |
19813 __pyx_L19_try_end:; | |
19814 } | |
19815 | |
19816 /* "pysam/libctabix.pyx":966 | |
19817 * if preset == "bcf" or fmt.format == bcf: | |
19818 * csi = True | |
19819 * elif preset: # <<<<<<<<<<<<<< | |
19820 * try: | |
19821 * conf_data = preset2conf[preset] | |
19822 */ | |
19823 goto __pyx_L11; | |
19824 } | |
19825 | |
19826 /* "pysam/libctabix.pyx":974 | |
19827 * (preset, ",".join(preset2conf.keys()))) | |
19828 * else: | |
19829 * if end_col is None: # <<<<<<<<<<<<<< | |
19830 * end_col = -1 | |
19831 * | |
19832 */ | |
19833 /*else*/ { | |
19834 __pyx_t_2 = (__pyx_v_end_col == Py_None); | |
19835 if (__pyx_t_2) { | |
19836 | |
19837 /* "pysam/libctabix.pyx":975 | |
19838 * else: | |
19839 * if end_col is None: | |
19840 * end_col = -1 # <<<<<<<<<<<<<< | |
19841 * | |
19842 * preset = 0 | |
19843 */ | |
19844 __Pyx_INCREF(__pyx_int_neg_1); | |
19845 __Pyx_DECREF_SET(__pyx_v_end_col, __pyx_int_neg_1); | |
19846 | |
19847 /* "pysam/libctabix.pyx":974 | |
19848 * (preset, ",".join(preset2conf.keys()))) | |
19849 * else: | |
19850 * if end_col is None: # <<<<<<<<<<<<<< | |
19851 * end_col = -1 | |
19852 * | |
19853 */ | |
19854 } | |
19855 | |
19856 /* "pysam/libctabix.pyx":977 | |
19857 * end_col = -1 | |
19858 * | |
19859 * preset = 0 # <<<<<<<<<<<<<< | |
19860 * # tabix internally works with 0-based coordinates and | |
19861 * # open/closed intervals. When using a preset, conversion is | |
19862 */ | |
19863 __Pyx_INCREF(__pyx_int_0); | |
19864 __Pyx_DECREF_SET(__pyx_v_preset, __pyx_int_0); | |
19865 | |
19866 /* "pysam/libctabix.pyx":984 | |
19867 * # from the start coordinate. To avoid doing this, set the | |
19868 * # TI_FLAG_UCSC=0x10000 flag: | |
19869 * if zerobased: # <<<<<<<<<<<<<< | |
19870 * preset = preset | TBX_UCSC | |
19871 * | |
19872 */ | |
19873 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_zerobased); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 984, __pyx_L1_error) | |
19874 if (__pyx_t_2) { | |
19875 | |
19876 /* "pysam/libctabix.pyx":985 | |
19877 * # TI_FLAG_UCSC=0x10000 flag: | |
19878 * if zerobased: | |
19879 * preset = preset | TBX_UCSC # <<<<<<<<<<<<<< | |
19880 * | |
19881 * conf_data = (preset, seq_col + 1, start_col + 1, end_col + 1, ord(meta_char), line_skip) | |
19882 */ | |
19883 __pyx_t_8 = __Pyx_PyInt_From_int32_t(TBX_UCSC); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 985, __pyx_L1_error) | |
19884 __Pyx_GOTREF(__pyx_t_8); | |
19885 __pyx_t_7 = PyNumber_Or(__pyx_v_preset, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 985, __pyx_L1_error) | |
19886 __Pyx_GOTREF(__pyx_t_7); | |
19887 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
19888 __Pyx_DECREF_SET(__pyx_v_preset, __pyx_t_7); | |
19889 __pyx_t_7 = 0; | |
19890 | |
19891 /* "pysam/libctabix.pyx":984 | |
19892 * # from the start coordinate. To avoid doing this, set the | |
19893 * # TI_FLAG_UCSC=0x10000 flag: | |
19894 * if zerobased: # <<<<<<<<<<<<<< | |
19895 * preset = preset | TBX_UCSC | |
19896 * | |
19897 */ | |
19898 } | |
19899 | |
19900 /* "pysam/libctabix.pyx":987 | |
19901 * preset = preset | TBX_UCSC | |
19902 * | |
19903 * conf_data = (preset, seq_col + 1, start_col + 1, end_col + 1, ord(meta_char), line_skip) # <<<<<<<<<<<<<< | |
19904 * | |
19905 * cdef tbx_conf_t conf | |
19906 */ | |
19907 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_seq_col, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 987, __pyx_L1_error) | |
19908 __Pyx_GOTREF(__pyx_t_7); | |
19909 __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_v_start_col, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 987, __pyx_L1_error) | |
19910 __Pyx_GOTREF(__pyx_t_8); | |
19911 __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_v_end_col, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 987, __pyx_L1_error) | |
19912 __Pyx_GOTREF(__pyx_t_9); | |
19913 __pyx_t_17 = __Pyx_PyObject_Ord(__pyx_v_meta_char); if (unlikely(__pyx_t_17 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 987, __pyx_L1_error) | |
19914 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 987, __pyx_L1_error) | |
19915 __Pyx_GOTREF(__pyx_t_3); | |
19916 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_line_skip); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 987, __pyx_L1_error) | |
19917 __Pyx_GOTREF(__pyx_t_16); | |
19918 __pyx_t_15 = PyTuple_New(6); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 987, __pyx_L1_error) | |
19919 __Pyx_GOTREF(__pyx_t_15); | |
19920 __Pyx_INCREF(__pyx_v_preset); | |
19921 __Pyx_GIVEREF(__pyx_v_preset); | |
19922 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_preset)) __PYX_ERR(0, 987, __pyx_L1_error); | |
19923 __Pyx_GIVEREF(__pyx_t_7); | |
19924 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_7)) __PYX_ERR(0, 987, __pyx_L1_error); | |
19925 __Pyx_GIVEREF(__pyx_t_8); | |
19926 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_8)) __PYX_ERR(0, 987, __pyx_L1_error); | |
19927 __Pyx_GIVEREF(__pyx_t_9); | |
19928 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_9)) __PYX_ERR(0, 987, __pyx_L1_error); | |
19929 __Pyx_GIVEREF(__pyx_t_3); | |
19930 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_t_3)) __PYX_ERR(0, 987, __pyx_L1_error); | |
19931 __Pyx_GIVEREF(__pyx_t_16); | |
19932 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 5, __pyx_t_16)) __PYX_ERR(0, 987, __pyx_L1_error); | |
19933 __pyx_t_7 = 0; | |
19934 __pyx_t_8 = 0; | |
19935 __pyx_t_9 = 0; | |
19936 __pyx_t_3 = 0; | |
19937 __pyx_t_16 = 0; | |
19938 __Pyx_DECREF_SET(__pyx_v_conf_data, __pyx_t_15); | |
19939 __pyx_t_15 = 0; | |
19940 } | |
19941 __pyx_L11:; | |
19942 | |
19943 /* "pysam/libctabix.pyx":990 | |
19944 * | |
19945 * cdef tbx_conf_t conf | |
19946 * if conf_data: # <<<<<<<<<<<<<< | |
19947 * conf.preset, conf.sc, conf.bc, conf.ec, conf.meta_char, conf.line_skip = conf_data | |
19948 * | |
19949 */ | |
19950 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_conf_data); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 990, __pyx_L1_error) | |
19951 if (__pyx_t_2) { | |
19952 | |
19953 /* "pysam/libctabix.pyx":991 | |
19954 * cdef tbx_conf_t conf | |
19955 * if conf_data: | |
19956 * conf.preset, conf.sc, conf.bc, conf.ec, conf.meta_char, conf.line_skip = conf_data # <<<<<<<<<<<<<< | |
19957 * | |
19958 * if csi or min_shift > 0: | |
19959 */ | |
19960 if ((likely(PyTuple_CheckExact(__pyx_v_conf_data))) || (PyList_CheckExact(__pyx_v_conf_data))) { | |
19961 PyObject* sequence = __pyx_v_conf_data; | |
19962 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); | |
19963 if (unlikely(size != 6)) { | |
19964 if (size > 6) __Pyx_RaiseTooManyValuesError(6); | |
19965 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
19966 __PYX_ERR(0, 991, __pyx_L1_error) | |
19967 } | |
19968 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
19969 if (likely(PyTuple_CheckExact(sequence))) { | |
19970 __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); | |
19971 __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); | |
19972 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); | |
19973 __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); | |
19974 __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4); | |
19975 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 5); | |
19976 } else { | |
19977 __pyx_t_15 = PyList_GET_ITEM(sequence, 0); | |
19978 __pyx_t_16 = PyList_GET_ITEM(sequence, 1); | |
19979 __pyx_t_3 = PyList_GET_ITEM(sequence, 2); | |
19980 __pyx_t_9 = PyList_GET_ITEM(sequence, 3); | |
19981 __pyx_t_8 = PyList_GET_ITEM(sequence, 4); | |
19982 __pyx_t_7 = PyList_GET_ITEM(sequence, 5); | |
19983 } | |
19984 __Pyx_INCREF(__pyx_t_15); | |
19985 __Pyx_INCREF(__pyx_t_16); | |
19986 __Pyx_INCREF(__pyx_t_3); | |
19987 __Pyx_INCREF(__pyx_t_9); | |
19988 __Pyx_INCREF(__pyx_t_8); | |
19989 __Pyx_INCREF(__pyx_t_7); | |
19990 #else | |
19991 { | |
19992 Py_ssize_t i; | |
19993 PyObject** temps[6] = {&__pyx_t_15,&__pyx_t_16,&__pyx_t_3,&__pyx_t_9,&__pyx_t_8,&__pyx_t_7}; | |
19994 for (i=0; i < 6; i++) { | |
19995 PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 991, __pyx_L1_error) | |
19996 __Pyx_GOTREF(item); | |
19997 *(temps[i]) = item; | |
19998 } | |
19999 } | |
20000 #endif | |
20001 } else { | |
20002 Py_ssize_t index = -1; | |
20003 PyObject** temps[6] = {&__pyx_t_15,&__pyx_t_16,&__pyx_t_3,&__pyx_t_9,&__pyx_t_8,&__pyx_t_7}; | |
20004 __pyx_t_18 = PyObject_GetIter(__pyx_v_conf_data); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 991, __pyx_L1_error) | |
20005 __Pyx_GOTREF(__pyx_t_18); | |
20006 __pyx_t_19 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_18); | |
20007 for (index=0; index < 6; index++) { | |
20008 PyObject* item = __pyx_t_19(__pyx_t_18); if (unlikely(!item)) goto __pyx_L25_unpacking_failed; | |
20009 __Pyx_GOTREF(item); | |
20010 *(temps[index]) = item; | |
20011 } | |
20012 if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_18), 6) < 0) __PYX_ERR(0, 991, __pyx_L1_error) | |
20013 __pyx_t_19 = NULL; | |
20014 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; | |
20015 goto __pyx_L26_unpacking_done; | |
20016 __pyx_L25_unpacking_failed:; | |
20017 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; | |
20018 __pyx_t_19 = NULL; | |
20019 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); | |
20020 __PYX_ERR(0, 991, __pyx_L1_error) | |
20021 __pyx_L26_unpacking_done:; | |
20022 } | |
20023 __pyx_t_20 = __Pyx_PyInt_As_int32_t(__pyx_t_15); if (unlikely((__pyx_t_20 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L1_error) | |
20024 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; | |
20025 __pyx_t_21 = __Pyx_PyInt_As_int32_t(__pyx_t_16); if (unlikely((__pyx_t_21 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L1_error) | |
20026 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; | |
20027 __pyx_t_22 = __Pyx_PyInt_As_int32_t(__pyx_t_3); if (unlikely((__pyx_t_22 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L1_error) | |
20028 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
20029 __pyx_t_23 = __Pyx_PyInt_As_int32_t(__pyx_t_9); if (unlikely((__pyx_t_23 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L1_error) | |
20030 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
20031 __pyx_t_24 = __Pyx_PyInt_As_int32_t(__pyx_t_8); if (unlikely((__pyx_t_24 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L1_error) | |
20032 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
20033 __pyx_t_25 = __Pyx_PyInt_As_int32_t(__pyx_t_7); if (unlikely((__pyx_t_25 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L1_error) | |
20034 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
20035 __pyx_v_conf.preset = __pyx_t_20; | |
20036 __pyx_v_conf.sc = __pyx_t_21; | |
20037 __pyx_v_conf.bc = __pyx_t_22; | |
20038 __pyx_v_conf.ec = __pyx_t_23; | |
20039 __pyx_v_conf.meta_char = __pyx_t_24; | |
20040 __pyx_v_conf.line_skip = __pyx_t_25; | |
20041 | |
20042 /* "pysam/libctabix.pyx":990 | |
20043 * | |
20044 * cdef tbx_conf_t conf | |
20045 * if conf_data: # <<<<<<<<<<<<<< | |
20046 * conf.preset, conf.sc, conf.bc, conf.ec, conf.meta_char, conf.line_skip = conf_data | |
20047 * | |
20048 */ | |
20049 } | |
20050 | |
20051 /* "pysam/libctabix.pyx":993 | |
20052 * conf.preset, conf.sc, conf.bc, conf.ec, conf.meta_char, conf.line_skip = conf_data | |
20053 * | |
20054 * if csi or min_shift > 0: # <<<<<<<<<<<<<< | |
20055 * suffix = ".csi" | |
20056 * if min_shift <= 0: min_shift = 14 | |
20057 */ | |
20058 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_csi); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 993, __pyx_L1_error) | |
20059 if (!__pyx_t_1) { | |
20060 } else { | |
20061 __pyx_t_2 = __pyx_t_1; | |
20062 goto __pyx_L28_bool_binop_done; | |
20063 } | |
20064 __pyx_t_1 = (__pyx_v_min_shift > 0); | |
20065 __pyx_t_2 = __pyx_t_1; | |
20066 __pyx_L28_bool_binop_done:; | |
20067 if (__pyx_t_2) { | |
20068 | |
20069 /* "pysam/libctabix.pyx":994 | |
20070 * | |
20071 * if csi or min_shift > 0: | |
20072 * suffix = ".csi" # <<<<<<<<<<<<<< | |
20073 * if min_shift <= 0: min_shift = 14 | |
20074 * else: | |
20075 */ | |
20076 __Pyx_INCREF(__pyx_kp_u_csi_2); | |
20077 __pyx_v_suffix = __pyx_kp_u_csi_2; | |
20078 | |
20079 /* "pysam/libctabix.pyx":995 | |
20080 * if csi or min_shift > 0: | |
20081 * suffix = ".csi" | |
20082 * if min_shift <= 0: min_shift = 14 # <<<<<<<<<<<<<< | |
20083 * else: | |
20084 * suffix = ".tbi" | |
20085 */ | |
20086 __pyx_t_2 = (__pyx_v_min_shift <= 0); | |
20087 if (__pyx_t_2) { | |
20088 __pyx_v_min_shift = 14; | |
20089 } | |
20090 | |
20091 /* "pysam/libctabix.pyx":993 | |
20092 * conf.preset, conf.sc, conf.bc, conf.ec, conf.meta_char, conf.line_skip = conf_data | |
20093 * | |
20094 * if csi or min_shift > 0: # <<<<<<<<<<<<<< | |
20095 * suffix = ".csi" | |
20096 * if min_shift <= 0: min_shift = 14 | |
20097 */ | |
20098 goto __pyx_L27; | |
20099 } | |
20100 | |
20101 /* "pysam/libctabix.pyx":997 | |
20102 * if min_shift <= 0: min_shift = 14 | |
20103 * else: | |
20104 * suffix = ".tbi" # <<<<<<<<<<<<<< | |
20105 * min_shift = 0 | |
20106 * | |
20107 */ | |
20108 /*else*/ { | |
20109 __Pyx_INCREF(__pyx_kp_u_tbi); | |
20110 __pyx_v_suffix = __pyx_kp_u_tbi; | |
20111 | |
20112 /* "pysam/libctabix.pyx":998 | |
20113 * else: | |
20114 * suffix = ".tbi" | |
20115 * min_shift = 0 # <<<<<<<<<<<<<< | |
20116 * | |
20117 * index = index or filename + suffix | |
20118 */ | |
20119 __pyx_v_min_shift = 0; | |
20120 } | |
20121 __pyx_L27:; | |
20122 | |
20123 /* "pysam/libctabix.pyx":1000 | |
20124 * min_shift = 0 | |
20125 * | |
20126 * index = index or filename + suffix # <<<<<<<<<<<<<< | |
20127 * fn_index = encode_filename(index) | |
20128 * | |
20129 */ | |
20130 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_index); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1000, __pyx_L1_error) | |
20131 if (!__pyx_t_2) { | |
20132 } else { | |
20133 __Pyx_INCREF(__pyx_v_index); | |
20134 __pyx_t_7 = __pyx_v_index; | |
20135 goto __pyx_L31_bool_binop_done; | |
20136 } | |
20137 __pyx_t_8 = PyNumber_Add(__pyx_v_filename, __pyx_v_suffix); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1000, __pyx_L1_error) | |
20138 __Pyx_GOTREF(__pyx_t_8); | |
20139 __Pyx_INCREF(__pyx_t_8); | |
20140 __pyx_t_7 = __pyx_t_8; | |
20141 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
20142 __pyx_L31_bool_binop_done:; | |
20143 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_7); | |
20144 __pyx_t_7 = 0; | |
20145 | |
20146 /* "pysam/libctabix.pyx":1001 | |
20147 * | |
20148 * index = index or filename + suffix | |
20149 * fn_index = encode_filename(index) # <<<<<<<<<<<<<< | |
20150 * | |
20151 * if not force and os.path.exists(index): | |
20152 */ | |
20153 __pyx_t_7 = __pyx_f_5pysam_9libcutils_encode_filename(__pyx_v_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1001, __pyx_L1_error) | |
20154 __Pyx_GOTREF(__pyx_t_7); | |
20155 __pyx_v_fn_index = ((PyObject*)__pyx_t_7); | |
20156 __pyx_t_7 = 0; | |
20157 | |
20158 /* "pysam/libctabix.pyx":1003 | |
20159 * fn_index = encode_filename(index) | |
20160 * | |
20161 * if not force and os.path.exists(index): # <<<<<<<<<<<<<< | |
20162 * raise IOError( | |
20163 * "filename '%s' already exists, use *force* to overwrite" % index) | |
20164 */ | |
20165 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1003, __pyx_L1_error) | |
20166 __pyx_t_26 = (!__pyx_t_1); | |
20167 if (__pyx_t_26) { | |
20168 } else { | |
20169 __pyx_t_2 = __pyx_t_26; | |
20170 goto __pyx_L34_bool_binop_done; | |
20171 } | |
20172 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1003, __pyx_L1_error) | |
20173 __Pyx_GOTREF(__pyx_t_8); | |
20174 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1003, __pyx_L1_error) | |
20175 __Pyx_GOTREF(__pyx_t_9); | |
20176 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
20177 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exists); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1003, __pyx_L1_error) | |
20178 __Pyx_GOTREF(__pyx_t_8); | |
20179 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
20180 __pyx_t_9 = NULL; | |
20181 __pyx_t_10 = 0; | |
20182 #if CYTHON_UNPACK_METHODS | |
20183 if (likely(PyMethod_Check(__pyx_t_8))) { | |
20184 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); | |
20185 if (likely(__pyx_t_9)) { | |
20186 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); | |
20187 __Pyx_INCREF(__pyx_t_9); | |
20188 __Pyx_INCREF(function); | |
20189 __Pyx_DECREF_SET(__pyx_t_8, function); | |
20190 __pyx_t_10 = 1; | |
20191 } | |
20192 } | |
20193 #endif | |
20194 { | |
20195 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_index}; | |
20196 __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); | |
20197 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
20198 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1003, __pyx_L1_error) | |
20199 __Pyx_GOTREF(__pyx_t_7); | |
20200 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
20201 } | |
20202 __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_26 < 0))) __PYX_ERR(0, 1003, __pyx_L1_error) | |
20203 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
20204 __pyx_t_2 = __pyx_t_26; | |
20205 __pyx_L34_bool_binop_done:; | |
20206 if (unlikely(__pyx_t_2)) { | |
20207 | |
20208 /* "pysam/libctabix.pyx":1005 | |
20209 * if not force and os.path.exists(index): | |
20210 * raise IOError( | |
20211 * "filename '%s' already exists, use *force* to overwrite" % index) # <<<<<<<<<<<<<< | |
20212 * | |
20213 * cdef char *fnidx = fn_index | |
20214 */ | |
20215 __pyx_t_7 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_filename_s_already_exists_use_fo, __pyx_v_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1005, __pyx_L1_error) | |
20216 __Pyx_GOTREF(__pyx_t_7); | |
20217 | |
20218 /* "pysam/libctabix.pyx":1004 | |
20219 * | |
20220 * if not force and os.path.exists(index): | |
20221 * raise IOError( # <<<<<<<<<<<<<< | |
20222 * "filename '%s' already exists, use *force* to overwrite" % index) | |
20223 * | |
20224 */ | |
20225 __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1004, __pyx_L1_error) | |
20226 __Pyx_GOTREF(__pyx_t_8); | |
20227 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
20228 __Pyx_Raise(__pyx_t_8, 0, 0, 0); | |
20229 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
20230 __PYX_ERR(0, 1004, __pyx_L1_error) | |
20231 | |
20232 /* "pysam/libctabix.pyx":1003 | |
20233 * fn_index = encode_filename(index) | |
20234 * | |
20235 * if not force and os.path.exists(index): # <<<<<<<<<<<<<< | |
20236 * raise IOError( | |
20237 * "filename '%s' already exists, use *force* to overwrite" % index) | |
20238 */ | |
20239 } | |
20240 | |
20241 /* "pysam/libctabix.pyx":1007 | |
20242 * "filename '%s' already exists, use *force* to overwrite" % index) | |
20243 * | |
20244 * cdef char *fnidx = fn_index # <<<<<<<<<<<<<< | |
20245 * cdef int retval = 0 | |
20246 * | |
20247 */ | |
20248 if (unlikely(__pyx_v_fn_index == Py_None)) { | |
20249 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); | |
20250 __PYX_ERR(0, 1007, __pyx_L1_error) | |
20251 } | |
20252 __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_fn_index); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 1007, __pyx_L1_error) | |
20253 __pyx_v_fnidx = __pyx_t_4; | |
20254 | |
20255 /* "pysam/libctabix.pyx":1008 | |
20256 * | |
20257 * cdef char *fnidx = fn_index | |
20258 * cdef int retval = 0 # <<<<<<<<<<<<<< | |
20259 * | |
20260 * if csi and fmt.format == bcf: | |
20261 */ | |
20262 __pyx_v_retval = 0; | |
20263 | |
20264 /* "pysam/libctabix.pyx":1010 | |
20265 * cdef int retval = 0 | |
20266 * | |
20267 * if csi and fmt.format == bcf: # <<<<<<<<<<<<<< | |
20268 * with nogil: | |
20269 * retval = bcf_index_build2(cfn, fnidx, min_shift) | |
20270 */ | |
20271 __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_v_csi); if (unlikely((__pyx_t_26 < 0))) __PYX_ERR(0, 1010, __pyx_L1_error) | |
20272 if (__pyx_t_26) { | |
20273 } else { | |
20274 __pyx_t_2 = __pyx_t_26; | |
20275 goto __pyx_L37_bool_binop_done; | |
20276 } | |
20277 __pyx_t_26 = (__pyx_v_fmt.format == bcf); | |
20278 __pyx_t_2 = __pyx_t_26; | |
20279 __pyx_L37_bool_binop_done:; | |
20280 if (__pyx_t_2) { | |
20281 | |
20282 /* "pysam/libctabix.pyx":1011 | |
20283 * | |
20284 * if csi and fmt.format == bcf: | |
20285 * with nogil: # <<<<<<<<<<<<<< | |
20286 * retval = bcf_index_build2(cfn, fnidx, min_shift) | |
20287 * else: | |
20288 */ | |
20289 { | |
20290 #ifdef WITH_THREAD | |
20291 PyThreadState *_save; | |
20292 _save = NULL; | |
20293 Py_UNBLOCK_THREADS | |
20294 __Pyx_FastGIL_Remember(); | |
20295 #endif | |
20296 /*try:*/ { | |
20297 | |
20298 /* "pysam/libctabix.pyx":1012 | |
20299 * if csi and fmt.format == bcf: | |
20300 * with nogil: | |
20301 * retval = bcf_index_build2(cfn, fnidx, min_shift) # <<<<<<<<<<<<<< | |
20302 * else: | |
20303 * with nogil: | |
20304 */ | |
20305 __pyx_v_retval = bcf_index_build2(__pyx_v_cfn, __pyx_v_fnidx, __pyx_v_min_shift); | |
20306 } | |
20307 | |
20308 /* "pysam/libctabix.pyx":1011 | |
20309 * | |
20310 * if csi and fmt.format == bcf: | |
20311 * with nogil: # <<<<<<<<<<<<<< | |
20312 * retval = bcf_index_build2(cfn, fnidx, min_shift) | |
20313 * else: | |
20314 */ | |
20315 /*finally:*/ { | |
20316 /*normal exit:*/{ | |
20317 #ifdef WITH_THREAD | |
20318 __Pyx_FastGIL_Forget(); | |
20319 Py_BLOCK_THREADS | |
20320 #endif | |
20321 goto __pyx_L41; | |
20322 } | |
20323 __pyx_L41:; | |
20324 } | |
20325 } | |
20326 | |
20327 /* "pysam/libctabix.pyx":1010 | |
20328 * cdef int retval = 0 | |
20329 * | |
20330 * if csi and fmt.format == bcf: # <<<<<<<<<<<<<< | |
20331 * with nogil: | |
20332 * retval = bcf_index_build2(cfn, fnidx, min_shift) | |
20333 */ | |
20334 goto __pyx_L36; | |
20335 } | |
20336 | |
20337 /* "pysam/libctabix.pyx":1014 | |
20338 * retval = bcf_index_build2(cfn, fnidx, min_shift) | |
20339 * else: | |
20340 * with nogil: # <<<<<<<<<<<<<< | |
20341 * retval = tbx_index_build2(cfn, fnidx, min_shift, &conf) | |
20342 * | |
20343 */ | |
20344 /*else*/ { | |
20345 { | |
20346 #ifdef WITH_THREAD | |
20347 PyThreadState *_save; | |
20348 _save = NULL; | |
20349 Py_UNBLOCK_THREADS | |
20350 __Pyx_FastGIL_Remember(); | |
20351 #endif | |
20352 /*try:*/ { | |
20353 | |
20354 /* "pysam/libctabix.pyx":1015 | |
20355 * else: | |
20356 * with nogil: | |
20357 * retval = tbx_index_build2(cfn, fnidx, min_shift, &conf) # <<<<<<<<<<<<<< | |
20358 * | |
20359 * if retval != 0: | |
20360 */ | |
20361 __pyx_v_retval = tbx_index_build2(__pyx_v_cfn, __pyx_v_fnidx, __pyx_v_min_shift, (&__pyx_v_conf)); | |
20362 } | |
20363 | |
20364 /* "pysam/libctabix.pyx":1014 | |
20365 * retval = bcf_index_build2(cfn, fnidx, min_shift) | |
20366 * else: | |
20367 * with nogil: # <<<<<<<<<<<<<< | |
20368 * retval = tbx_index_build2(cfn, fnidx, min_shift, &conf) | |
20369 * | |
20370 */ | |
20371 /*finally:*/ { | |
20372 /*normal exit:*/{ | |
20373 #ifdef WITH_THREAD | |
20374 __Pyx_FastGIL_Forget(); | |
20375 Py_BLOCK_THREADS | |
20376 #endif | |
20377 goto __pyx_L44; | |
20378 } | |
20379 __pyx_L44:; | |
20380 } | |
20381 } | |
20382 } | |
20383 __pyx_L36:; | |
20384 | |
20385 /* "pysam/libctabix.pyx":1017 | |
20386 * retval = tbx_index_build2(cfn, fnidx, min_shift, &conf) | |
20387 * | |
20388 * if retval != 0: # <<<<<<<<<<<<<< | |
20389 * raise OSError("building of index for {} failed".format(filename)) | |
20390 * | |
20391 */ | |
20392 __pyx_t_2 = (__pyx_v_retval != 0); | |
20393 if (unlikely(__pyx_t_2)) { | |
20394 | |
20395 /* "pysam/libctabix.pyx":1018 | |
20396 * | |
20397 * if retval != 0: | |
20398 * raise OSError("building of index for {} failed".format(filename)) # <<<<<<<<<<<<<< | |
20399 * | |
20400 * return filename | |
20401 */ | |
20402 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_building_of_index_for_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1018, __pyx_L1_error) | |
20403 __Pyx_GOTREF(__pyx_t_7); | |
20404 __pyx_t_9 = NULL; | |
20405 __pyx_t_10 = 0; | |
20406 #if CYTHON_UNPACK_METHODS | |
20407 if (likely(PyMethod_Check(__pyx_t_7))) { | |
20408 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); | |
20409 if (likely(__pyx_t_9)) { | |
20410 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); | |
20411 __Pyx_INCREF(__pyx_t_9); | |
20412 __Pyx_INCREF(function); | |
20413 __Pyx_DECREF_SET(__pyx_t_7, function); | |
20414 __pyx_t_10 = 1; | |
20415 } | |
20416 } | |
20417 #endif | |
20418 { | |
20419 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_filename}; | |
20420 __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); | |
20421 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
20422 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1018, __pyx_L1_error) | |
20423 __Pyx_GOTREF(__pyx_t_8); | |
20424 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
20425 } | |
20426 __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_OSError, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1018, __pyx_L1_error) | |
20427 __Pyx_GOTREF(__pyx_t_7); | |
20428 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
20429 __Pyx_Raise(__pyx_t_7, 0, 0, 0); | |
20430 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
20431 __PYX_ERR(0, 1018, __pyx_L1_error) | |
20432 | |
20433 /* "pysam/libctabix.pyx":1017 | |
20434 * retval = tbx_index_build2(cfn, fnidx, min_shift, &conf) | |
20435 * | |
20436 * if retval != 0: # <<<<<<<<<<<<<< | |
20437 * raise OSError("building of index for {} failed".format(filename)) | |
20438 * | |
20439 */ | |
20440 } | |
20441 | |
20442 /* "pysam/libctabix.pyx":1020 | |
20443 * raise OSError("building of index for {} failed".format(filename)) | |
20444 * | |
20445 * return filename # <<<<<<<<<<<<<< | |
20446 * | |
20447 * # ######################################################### | |
20448 */ | |
20449 __Pyx_XDECREF(__pyx_r); | |
20450 __Pyx_INCREF(__pyx_v_filename); | |
20451 __pyx_r = __pyx_v_filename; | |
20452 goto __pyx_L0; | |
20453 | |
20454 /* "pysam/libctabix.pyx":873 | |
20455 * | |
20456 * | |
20457 * def tabix_index(filename, # <<<<<<<<<<<<<< | |
20458 * force=False, | |
20459 * seq_col=None, | |
20460 */ | |
20461 | |
20462 /* function exit code */ | |
20463 __pyx_L1_error:; | |
20464 __Pyx_XDECREF(__pyx_t_3); | |
20465 __Pyx_XDECREF(__pyx_t_7); | |
20466 __Pyx_XDECREF(__pyx_t_8); | |
20467 __Pyx_XDECREF(__pyx_t_9); | |
20468 __Pyx_XDECREF(__pyx_t_15); | |
20469 __Pyx_XDECREF(__pyx_t_16); | |
20470 __Pyx_XDECREF(__pyx_t_18); | |
20471 __Pyx_AddTraceback("pysam.libctabix.tabix_index", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
20472 __pyx_r = NULL; | |
20473 __pyx_L0:; | |
20474 __Pyx_XDECREF(__pyx_v_fn); | |
20475 __Pyx_XDECREF(__pyx_v_preset2conf); | |
20476 __Pyx_XDECREF(__pyx_v_conf_data); | |
20477 __Pyx_XDECREF(__pyx_v_suffix); | |
20478 __Pyx_XDECREF(__pyx_v_fn_index); | |
20479 __Pyx_XDECREF(__pyx_v_filename); | |
20480 __Pyx_XDECREF(__pyx_v_end_col); | |
20481 __Pyx_XDECREF(__pyx_v_preset); | |
20482 __Pyx_XDECREF(__pyx_v_index); | |
20483 __Pyx_XDECREF(__pyx_v_csi); | |
20484 __Pyx_XGIVEREF(__pyx_r); | |
20485 __Pyx_TraceReturn(__pyx_r, 0); | |
20486 __Pyx_RefNannyFinishContext(); | |
20487 return __pyx_r; | |
20488 } | |
20489 | |
20490 /* "pysam/libctabix.pyx":1102 | |
20491 * ''' | |
20492 * | |
20493 * def __cinit__(self, # <<<<<<<<<<<<<< | |
20494 * infile, | |
20495 * Parser parser, | |
20496 */ | |
20497 | |
20498 /* Python wrapper */ | |
20499 static int __pyx_pw_5pysam_9libctabix_19tabix_file_iterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
20500 static int __pyx_pw_5pysam_9libctabix_19tabix_file_iterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
20501 PyObject *__pyx_v_infile = 0; | |
20502 struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_parser = 0; | |
20503 int __pyx_v_buffer_size; | |
20504 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
20505 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
20506 PyObject* values[3] = {0,0,0}; | |
20507 int __pyx_lineno = 0; | |
20508 const char *__pyx_filename = NULL; | |
20509 int __pyx_clineno = 0; | |
20510 int __pyx_r; | |
20511 __Pyx_RefNannyDeclarations | |
20512 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); | |
20513 #if CYTHON_ASSUME_SAFE_MACROS | |
20514 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
20515 #else | |
20516 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; | |
20517 #endif | |
20518 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
20519 { | |
20520 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_infile,&__pyx_n_s_parser,&__pyx_n_s_buffer_size,0}; | |
20521 if (__pyx_kwds) { | |
20522 Py_ssize_t kw_args; | |
20523 switch (__pyx_nargs) { | |
20524 case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); | |
20525 CYTHON_FALLTHROUGH; | |
20526 case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); | |
20527 CYTHON_FALLTHROUGH; | |
20528 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
20529 CYTHON_FALLTHROUGH; | |
20530 case 0: break; | |
20531 default: goto __pyx_L5_argtuple_error; | |
20532 } | |
20533 kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); | |
20534 switch (__pyx_nargs) { | |
20535 case 0: | |
20536 if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_infile)) != 0)) { | |
20537 (void)__Pyx_Arg_NewRef_VARARGS(values[0]); | |
20538 kw_args--; | |
20539 } | |
20540 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1102, __pyx_L3_error) | |
20541 else goto __pyx_L5_argtuple_error; | |
20542 CYTHON_FALLTHROUGH; | |
20543 case 1: | |
20544 if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_parser)) != 0)) { | |
20545 (void)__Pyx_Arg_NewRef_VARARGS(values[1]); | |
20546 kw_args--; | |
20547 } | |
20548 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1102, __pyx_L3_error) | |
20549 else { | |
20550 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(0, 1102, __pyx_L3_error) | |
20551 } | |
20552 CYTHON_FALLTHROUGH; | |
20553 case 2: | |
20554 if (kw_args > 0) { | |
20555 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_buffer_size); | |
20556 if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } | |
20557 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1102, __pyx_L3_error) | |
20558 } | |
20559 } | |
20560 if (unlikely(kw_args > 0)) { | |
20561 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
20562 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1102, __pyx_L3_error) | |
20563 } | |
20564 } else { | |
20565 switch (__pyx_nargs) { | |
20566 case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); | |
20567 CYTHON_FALLTHROUGH; | |
20568 case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); | |
20569 values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
20570 break; | |
20571 default: goto __pyx_L5_argtuple_error; | |
20572 } | |
20573 } | |
20574 __pyx_v_infile = values[0]; | |
20575 __pyx_v_parser = ((struct __pyx_obj_5pysam_9libctabix_Parser *)values[1]); | |
20576 if (values[2]) { | |
20577 __pyx_v_buffer_size = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_buffer_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1105, __pyx_L3_error) | |
20578 } else { | |
20579 __pyx_v_buffer_size = ((int)0x10000); | |
20580 } | |
20581 } | |
20582 goto __pyx_L6_skip; | |
20583 __pyx_L5_argtuple_error:; | |
20584 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1102, __pyx_L3_error) | |
20585 __pyx_L6_skip:; | |
20586 goto __pyx_L4_argument_unpacking_done; | |
20587 __pyx_L3_error:; | |
20588 { | |
20589 Py_ssize_t __pyx_temp; | |
20590 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
20591 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
20592 } | |
20593 } | |
20594 __Pyx_AddTraceback("pysam.libctabix.tabix_file_iterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
20595 __Pyx_RefNannyFinishContext(); | |
20596 return -1; | |
20597 __pyx_L4_argument_unpacking_done:; | |
20598 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_5pysam_9libctabix_Parser, 1, "parser", 0))) __PYX_ERR(0, 1104, __pyx_L1_error) | |
20599 __pyx_r = __pyx_pf_5pysam_9libctabix_19tabix_file_iterator___cinit__(((struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *)__pyx_v_self), __pyx_v_infile, __pyx_v_parser, __pyx_v_buffer_size); | |
20600 | |
20601 /* function exit code */ | |
20602 goto __pyx_L0; | |
20603 __pyx_L1_error:; | |
20604 __pyx_r = -1; | |
20605 __pyx_L0:; | |
20606 { | |
20607 Py_ssize_t __pyx_temp; | |
20608 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
20609 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
20610 } | |
20611 } | |
20612 __Pyx_RefNannyFinishContext(); | |
20613 return __pyx_r; | |
20614 } | |
20615 | |
20616 static int __pyx_pf_5pysam_9libctabix_19tabix_file_iterator___cinit__(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *__pyx_v_self, PyObject *__pyx_v_infile, struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v_parser, int __pyx_v_buffer_size) { | |
20617 int __pyx_v_fd; | |
20618 int __pyx_r; | |
20619 __Pyx_TraceDeclarations | |
20620 __Pyx_RefNannyDeclarations | |
20621 PyObject *__pyx_t_1 = NULL; | |
20622 int __pyx_t_2; | |
20623 int __pyx_t_3; | |
20624 PyObject *__pyx_t_4 = NULL; | |
20625 int __pyx_lineno = 0; | |
20626 const char *__pyx_filename = NULL; | |
20627 int __pyx_clineno = 0; | |
20628 __Pyx_RefNannySetupContext("__cinit__", 1); | |
20629 __Pyx_TraceCall("__cinit__", __pyx_f[0], 1102, 0, __PYX_ERR(0, 1102, __pyx_L1_error)); | |
20630 | |
20631 /* "pysam/libctabix.pyx":1107 | |
20632 * int buffer_size=65536): | |
20633 * | |
20634 * if infile.closed: # <<<<<<<<<<<<<< | |
20635 * raise ValueError("I/O operation on closed file.") | |
20636 * | |
20637 */ | |
20638 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_infile, __pyx_n_s_closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1107, __pyx_L1_error) | |
20639 __Pyx_GOTREF(__pyx_t_1); | |
20640 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1107, __pyx_L1_error) | |
20641 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
20642 if (unlikely(__pyx_t_2)) { | |
20643 | |
20644 /* "pysam/libctabix.pyx":1108 | |
20645 * | |
20646 * if infile.closed: | |
20647 * raise ValueError("I/O operation on closed file.") # <<<<<<<<<<<<<< | |
20648 * | |
20649 * self.infile = infile | |
20650 */ | |
20651 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1108, __pyx_L1_error) | |
20652 __Pyx_GOTREF(__pyx_t_1); | |
20653 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
20654 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
20655 __PYX_ERR(0, 1108, __pyx_L1_error) | |
20656 | |
20657 /* "pysam/libctabix.pyx":1107 | |
20658 * int buffer_size=65536): | |
20659 * | |
20660 * if infile.closed: # <<<<<<<<<<<<<< | |
20661 * raise ValueError("I/O operation on closed file.") | |
20662 * | |
20663 */ | |
20664 } | |
20665 | |
20666 /* "pysam/libctabix.pyx":1110 | |
20667 * raise ValueError("I/O operation on closed file.") | |
20668 * | |
20669 * self.infile = infile # <<<<<<<<<<<<<< | |
20670 * | |
20671 * cdef int fd = PyObject_AsFileDescriptor(infile) | |
20672 */ | |
20673 __Pyx_INCREF(__pyx_v_infile); | |
20674 __Pyx_GIVEREF(__pyx_v_infile); | |
20675 __Pyx_GOTREF(__pyx_v_self->infile); | |
20676 __Pyx_DECREF(__pyx_v_self->infile); | |
20677 __pyx_v_self->infile = __pyx_v_infile; | |
20678 | |
20679 /* "pysam/libctabix.pyx":1112 | |
20680 * self.infile = infile | |
20681 * | |
20682 * cdef int fd = PyObject_AsFileDescriptor(infile) # <<<<<<<<<<<<<< | |
20683 * if fd == -1: | |
20684 * raise ValueError("I/O operation on closed file.") | |
20685 */ | |
20686 __pyx_t_3 = PyObject_AsFileDescriptor(__pyx_v_infile); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1112, __pyx_L1_error) | |
20687 __pyx_v_fd = __pyx_t_3; | |
20688 | |
20689 /* "pysam/libctabix.pyx":1113 | |
20690 * | |
20691 * cdef int fd = PyObject_AsFileDescriptor(infile) | |
20692 * if fd == -1: # <<<<<<<<<<<<<< | |
20693 * raise ValueError("I/O operation on closed file.") | |
20694 * | |
20695 */ | |
20696 __pyx_t_2 = (__pyx_v_fd == -1L); | |
20697 if (unlikely(__pyx_t_2)) { | |
20698 | |
20699 /* "pysam/libctabix.pyx":1114 | |
20700 * cdef int fd = PyObject_AsFileDescriptor(infile) | |
20701 * if fd == -1: | |
20702 * raise ValueError("I/O operation on closed file.") # <<<<<<<<<<<<<< | |
20703 * | |
20704 * self.duplicated_fd = dup(fd) | |
20705 */ | |
20706 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __pyx_L1_error) | |
20707 __Pyx_GOTREF(__pyx_t_1); | |
20708 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
20709 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
20710 __PYX_ERR(0, 1114, __pyx_L1_error) | |
20711 | |
20712 /* "pysam/libctabix.pyx":1113 | |
20713 * | |
20714 * cdef int fd = PyObject_AsFileDescriptor(infile) | |
20715 * if fd == -1: # <<<<<<<<<<<<<< | |
20716 * raise ValueError("I/O operation on closed file.") | |
20717 * | |
20718 */ | |
20719 } | |
20720 | |
20721 /* "pysam/libctabix.pyx":1116 | |
20722 * raise ValueError("I/O operation on closed file.") | |
20723 * | |
20724 * self.duplicated_fd = dup(fd) # <<<<<<<<<<<<<< | |
20725 * | |
20726 * # From the manual: | |
20727 */ | |
20728 __pyx_v_self->duplicated_fd = dup(__pyx_v_fd); | |
20729 | |
20730 /* "pysam/libctabix.pyx":1123 | |
20731 * # When reading, this will be detected automatically by looking | |
20732 * # for the magic two-byte gzip header. | |
20733 * self.fh = bgzf_dopen(self.duplicated_fd, 'r') # <<<<<<<<<<<<<< | |
20734 * | |
20735 * if self.fh == NULL: | |
20736 */ | |
20737 __pyx_v_self->fh = bgzf_dopen(__pyx_v_self->duplicated_fd, ((char const *)"r")); | |
20738 | |
20739 /* "pysam/libctabix.pyx":1125 | |
20740 * self.fh = bgzf_dopen(self.duplicated_fd, 'r') | |
20741 * | |
20742 * if self.fh == NULL: # <<<<<<<<<<<<<< | |
20743 * raise IOError('%s' % strerror(errno)) | |
20744 * | |
20745 */ | |
20746 __pyx_t_2 = (__pyx_v_self->fh == NULL); | |
20747 if (unlikely(__pyx_t_2)) { | |
20748 | |
20749 /* "pysam/libctabix.pyx":1126 | |
20750 * | |
20751 * if self.fh == NULL: | |
20752 * raise IOError('%s' % strerror(errno)) # <<<<<<<<<<<<<< | |
20753 * | |
20754 * self.kstream = ks_init(self.fh) | |
20755 */ | |
20756 __pyx_t_1 = __Pyx_PyBytes_FromString(strerror(errno)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error) | |
20757 __Pyx_GOTREF(__pyx_t_1); | |
20758 __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L1_error) | |
20759 __Pyx_GOTREF(__pyx_t_4); | |
20760 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
20761 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error) | |
20762 __Pyx_GOTREF(__pyx_t_1); | |
20763 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
20764 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
20765 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
20766 __PYX_ERR(0, 1126, __pyx_L1_error) | |
20767 | |
20768 /* "pysam/libctabix.pyx":1125 | |
20769 * self.fh = bgzf_dopen(self.duplicated_fd, 'r') | |
20770 * | |
20771 * if self.fh == NULL: # <<<<<<<<<<<<<< | |
20772 * raise IOError('%s' % strerror(errno)) | |
20773 * | |
20774 */ | |
20775 } | |
20776 | |
20777 /* "pysam/libctabix.pyx":1128 | |
20778 * raise IOError('%s' % strerror(errno)) | |
20779 * | |
20780 * self.kstream = ks_init(self.fh) # <<<<<<<<<<<<<< | |
20781 * | |
20782 * self.buffer.s = <char*>malloc(buffer_size) | |
20783 */ | |
20784 __pyx_v_self->kstream = ks_init(__pyx_v_self->fh); | |
20785 | |
20786 /* "pysam/libctabix.pyx":1130 | |
20787 * self.kstream = ks_init(self.fh) | |
20788 * | |
20789 * self.buffer.s = <char*>malloc(buffer_size) # <<<<<<<<<<<<<< | |
20790 * #if self.buffer == NULL: | |
20791 * # raise MemoryError( "tabix_file_iterator: could not allocate %i bytes" % buffer_size) | |
20792 */ | |
20793 __pyx_v_self->buffer.s = ((char *)malloc(__pyx_v_buffer_size)); | |
20794 | |
20795 /* "pysam/libctabix.pyx":1134 | |
20796 * # raise MemoryError( "tabix_file_iterator: could not allocate %i bytes" % buffer_size) | |
20797 * #self.size = buffer_size | |
20798 * self.parser = parser # <<<<<<<<<<<<<< | |
20799 * | |
20800 * def __iter__(self): | |
20801 */ | |
20802 __Pyx_INCREF((PyObject *)__pyx_v_parser); | |
20803 __Pyx_GIVEREF((PyObject *)__pyx_v_parser); | |
20804 __Pyx_GOTREF((PyObject *)__pyx_v_self->parser); | |
20805 __Pyx_DECREF((PyObject *)__pyx_v_self->parser); | |
20806 __pyx_v_self->parser = __pyx_v_parser; | |
20807 | |
20808 /* "pysam/libctabix.pyx":1102 | |
20809 * ''' | |
20810 * | |
20811 * def __cinit__(self, # <<<<<<<<<<<<<< | |
20812 * infile, | |
20813 * Parser parser, | |
20814 */ | |
20815 | |
20816 /* function exit code */ | |
20817 __pyx_r = 0; | |
20818 goto __pyx_L0; | |
20819 __pyx_L1_error:; | |
20820 __Pyx_XDECREF(__pyx_t_1); | |
20821 __Pyx_XDECREF(__pyx_t_4); | |
20822 __Pyx_AddTraceback("pysam.libctabix.tabix_file_iterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
20823 __pyx_r = -1; | |
20824 __pyx_L0:; | |
20825 __Pyx_TraceReturn(Py_None, 0); | |
20826 __Pyx_RefNannyFinishContext(); | |
20827 return __pyx_r; | |
20828 } | |
20829 | |
20830 /* "pysam/libctabix.pyx":1136 | |
20831 * self.parser = parser | |
20832 * | |
20833 * def __iter__(self): # <<<<<<<<<<<<<< | |
20834 * return self | |
20835 * | |
20836 */ | |
20837 | |
20838 /* Python wrapper */ | |
20839 static PyObject *__pyx_pw_5pysam_9libctabix_19tabix_file_iterator_3__iter__(PyObject *__pyx_v_self); /*proto*/ | |
20840 static PyObject *__pyx_pw_5pysam_9libctabix_19tabix_file_iterator_3__iter__(PyObject *__pyx_v_self) { | |
20841 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
20842 PyObject *__pyx_r = 0; | |
20843 __Pyx_RefNannyDeclarations | |
20844 __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); | |
20845 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
20846 __pyx_r = __pyx_pf_5pysam_9libctabix_19tabix_file_iterator_2__iter__(((struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *)__pyx_v_self)); | |
20847 | |
20848 /* function exit code */ | |
20849 __Pyx_RefNannyFinishContext(); | |
20850 return __pyx_r; | |
20851 } | |
20852 | |
20853 static PyObject *__pyx_pf_5pysam_9libctabix_19tabix_file_iterator_2__iter__(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *__pyx_v_self) { | |
20854 PyObject *__pyx_r = NULL; | |
20855 __Pyx_TraceDeclarations | |
20856 __Pyx_RefNannyDeclarations | |
20857 int __pyx_lineno = 0; | |
20858 const char *__pyx_filename = NULL; | |
20859 int __pyx_clineno = 0; | |
20860 __Pyx_RefNannySetupContext("__iter__", 1); | |
20861 __Pyx_TraceCall("__iter__", __pyx_f[0], 1136, 0, __PYX_ERR(0, 1136, __pyx_L1_error)); | |
20862 | |
20863 /* "pysam/libctabix.pyx":1137 | |
20864 * | |
20865 * def __iter__(self): | |
20866 * return self # <<<<<<<<<<<<<< | |
20867 * | |
20868 * cdef __cnext__(self): | |
20869 */ | |
20870 __Pyx_XDECREF(__pyx_r); | |
20871 __Pyx_INCREF((PyObject *)__pyx_v_self); | |
20872 __pyx_r = ((PyObject *)__pyx_v_self); | |
20873 goto __pyx_L0; | |
20874 | |
20875 /* "pysam/libctabix.pyx":1136 | |
20876 * self.parser = parser | |
20877 * | |
20878 * def __iter__(self): # <<<<<<<<<<<<<< | |
20879 * return self | |
20880 * | |
20881 */ | |
20882 | |
20883 /* function exit code */ | |
20884 __pyx_L1_error:; | |
20885 __Pyx_AddTraceback("pysam.libctabix.tabix_file_iterator.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
20886 __pyx_r = NULL; | |
20887 __pyx_L0:; | |
20888 __Pyx_XGIVEREF(__pyx_r); | |
20889 __Pyx_TraceReturn(__pyx_r, 0); | |
20890 __Pyx_RefNannyFinishContext(); | |
20891 return __pyx_r; | |
20892 } | |
20893 | |
20894 /* "pysam/libctabix.pyx":1139 | |
20895 * return self | |
20896 * | |
20897 * cdef __cnext__(self): # <<<<<<<<<<<<<< | |
20898 * | |
20899 * cdef char * b | |
20900 */ | |
20901 | |
20902 static PyObject *__pyx_f_5pysam_9libctabix_19tabix_file_iterator___cnext__(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *__pyx_v_self) { | |
20903 char *__pyx_v_b; | |
20904 int __pyx_v_dret; | |
20905 int __pyx_v_retval; | |
20906 PyObject *__pyx_r = NULL; | |
20907 __Pyx_TraceDeclarations | |
20908 __Pyx_RefNannyDeclarations | |
20909 int __pyx_t_1; | |
20910 char *__pyx_t_2; | |
20911 int __pyx_t_3; | |
20912 PyObject *__pyx_t_4 = NULL; | |
20913 int __pyx_lineno = 0; | |
20914 const char *__pyx_filename = NULL; | |
20915 int __pyx_clineno = 0; | |
20916 __Pyx_RefNannySetupContext("__cnext__", 1); | |
20917 __Pyx_TraceCall("__cnext__", __pyx_f[0], 1139, 0, __PYX_ERR(0, 1139, __pyx_L1_error)); | |
20918 | |
20919 /* "pysam/libctabix.pyx":1142 | |
20920 * | |
20921 * cdef char * b | |
20922 * cdef int dret = 0 # <<<<<<<<<<<<<< | |
20923 * cdef int retval = 0 | |
20924 * while 1: | |
20925 */ | |
20926 __pyx_v_dret = 0; | |
20927 | |
20928 /* "pysam/libctabix.pyx":1143 | |
20929 * cdef char * b | |
20930 * cdef int dret = 0 | |
20931 * cdef int retval = 0 # <<<<<<<<<<<<<< | |
20932 * while 1: | |
20933 * with nogil: | |
20934 */ | |
20935 __pyx_v_retval = 0; | |
20936 | |
20937 /* "pysam/libctabix.pyx":1144 | |
20938 * cdef int dret = 0 | |
20939 * cdef int retval = 0 | |
20940 * while 1: # <<<<<<<<<<<<<< | |
20941 * with nogil: | |
20942 * retval = ks_getuntil(self.kstream, b'\n', &self.buffer, &dret) | |
20943 */ | |
20944 while (1) { | |
20945 | |
20946 /* "pysam/libctabix.pyx":1145 | |
20947 * cdef int retval = 0 | |
20948 * while 1: | |
20949 * with nogil: # <<<<<<<<<<<<<< | |
20950 * retval = ks_getuntil(self.kstream, b'\n', &self.buffer, &dret) | |
20951 * | |
20952 */ | |
20953 { | |
20954 #ifdef WITH_THREAD | |
20955 PyThreadState *_save; | |
20956 _save = NULL; | |
20957 Py_UNBLOCK_THREADS | |
20958 __Pyx_FastGIL_Remember(); | |
20959 #endif | |
20960 /*try:*/ { | |
20961 | |
20962 /* "pysam/libctabix.pyx":1146 | |
20963 * while 1: | |
20964 * with nogil: | |
20965 * retval = ks_getuntil(self.kstream, b'\n', &self.buffer, &dret) # <<<<<<<<<<<<<< | |
20966 * | |
20967 * if retval < 0: | |
20968 */ | |
20969 __pyx_v_retval = ks_getuntil(__pyx_v_self->kstream, '\n', (&__pyx_v_self->buffer), (&__pyx_v_dret)); | |
20970 } | |
20971 | |
20972 /* "pysam/libctabix.pyx":1145 | |
20973 * cdef int retval = 0 | |
20974 * while 1: | |
20975 * with nogil: # <<<<<<<<<<<<<< | |
20976 * retval = ks_getuntil(self.kstream, b'\n', &self.buffer, &dret) | |
20977 * | |
20978 */ | |
20979 /*finally:*/ { | |
20980 /*normal exit:*/{ | |
20981 #ifdef WITH_THREAD | |
20982 __Pyx_FastGIL_Forget(); | |
20983 Py_BLOCK_THREADS | |
20984 #endif | |
20985 goto __pyx_L9; | |
20986 } | |
20987 __pyx_L9:; | |
20988 } | |
20989 } | |
20990 | |
20991 /* "pysam/libctabix.pyx":1148 | |
20992 * retval = ks_getuntil(self.kstream, b'\n', &self.buffer, &dret) | |
20993 * | |
20994 * if retval < 0: # <<<<<<<<<<<<<< | |
20995 * break | |
20996 * #raise IOError('gzip error: %s' % buildGzipError( self.fh )) | |
20997 */ | |
20998 __pyx_t_1 = (__pyx_v_retval < 0); | |
20999 if (__pyx_t_1) { | |
21000 | |
21001 /* "pysam/libctabix.pyx":1149 | |
21002 * | |
21003 * if retval < 0: | |
21004 * break # <<<<<<<<<<<<<< | |
21005 * #raise IOError('gzip error: %s' % buildGzipError( self.fh )) | |
21006 * | |
21007 */ | |
21008 goto __pyx_L4_break; | |
21009 | |
21010 /* "pysam/libctabix.pyx":1148 | |
21011 * retval = ks_getuntil(self.kstream, b'\n', &self.buffer, &dret) | |
21012 * | |
21013 * if retval < 0: # <<<<<<<<<<<<<< | |
21014 * break | |
21015 * #raise IOError('gzip error: %s' % buildGzipError( self.fh )) | |
21016 */ | |
21017 } | |
21018 | |
21019 /* "pysam/libctabix.pyx":1152 | |
21020 * #raise IOError('gzip error: %s' % buildGzipError( self.fh )) | |
21021 * | |
21022 * b = self.buffer.s # <<<<<<<<<<<<<< | |
21023 * | |
21024 * # skip comments | |
21025 */ | |
21026 __pyx_t_2 = __pyx_v_self->buffer.s; | |
21027 __pyx_v_b = __pyx_t_2; | |
21028 | |
21029 /* "pysam/libctabix.pyx":1155 | |
21030 * | |
21031 * # skip comments | |
21032 * if (b[0] == b'#'): # <<<<<<<<<<<<<< | |
21033 * continue | |
21034 * | |
21035 */ | |
21036 __pyx_t_1 = ((__pyx_v_b[0]) == '#'); | |
21037 if (__pyx_t_1) { | |
21038 | |
21039 /* "pysam/libctabix.pyx":1156 | |
21040 * # skip comments | |
21041 * if (b[0] == b'#'): | |
21042 * continue # <<<<<<<<<<<<<< | |
21043 * | |
21044 * # skip empty lines | |
21045 */ | |
21046 goto __pyx_L3_continue; | |
21047 | |
21048 /* "pysam/libctabix.pyx":1155 | |
21049 * | |
21050 * # skip comments | |
21051 * if (b[0] == b'#'): # <<<<<<<<<<<<<< | |
21052 * continue | |
21053 * | |
21054 */ | |
21055 } | |
21056 | |
21057 /* "pysam/libctabix.pyx":1159 | |
21058 * | |
21059 * # skip empty lines | |
21060 * if b[0] == b'\0' or b[0] == b'\n' or b[0] == b'\r': # <<<<<<<<<<<<<< | |
21061 * continue | |
21062 * | |
21063 */ | |
21064 __pyx_t_3 = ((__pyx_v_b[0]) == '\x00'); | |
21065 if (!__pyx_t_3) { | |
21066 } else { | |
21067 __pyx_t_1 = __pyx_t_3; | |
21068 goto __pyx_L13_bool_binop_done; | |
21069 } | |
21070 __pyx_t_3 = ((__pyx_v_b[0]) == '\n'); | |
21071 if (!__pyx_t_3) { | |
21072 } else { | |
21073 __pyx_t_1 = __pyx_t_3; | |
21074 goto __pyx_L13_bool_binop_done; | |
21075 } | |
21076 __pyx_t_3 = ((__pyx_v_b[0]) == '\r'); | |
21077 __pyx_t_1 = __pyx_t_3; | |
21078 __pyx_L13_bool_binop_done:; | |
21079 if (__pyx_t_1) { | |
21080 | |
21081 /* "pysam/libctabix.pyx":1160 | |
21082 * # skip empty lines | |
21083 * if b[0] == b'\0' or b[0] == b'\n' or b[0] == b'\r': | |
21084 * continue # <<<<<<<<<<<<<< | |
21085 * | |
21086 * # gzgets terminates at \n, no need to test | |
21087 */ | |
21088 goto __pyx_L3_continue; | |
21089 | |
21090 /* "pysam/libctabix.pyx":1159 | |
21091 * | |
21092 * # skip empty lines | |
21093 * if b[0] == b'\0' or b[0] == b'\n' or b[0] == b'\r': # <<<<<<<<<<<<<< | |
21094 * continue | |
21095 * | |
21096 */ | |
21097 } | |
21098 | |
21099 /* "pysam/libctabix.pyx":1165 | |
21100 * | |
21101 * # parser creates a copy | |
21102 * return self.parser.parse(b, self.buffer.l) # <<<<<<<<<<<<<< | |
21103 * | |
21104 * raise StopIteration | |
21105 */ | |
21106 __Pyx_XDECREF(__pyx_r); | |
21107 __pyx_t_4 = ((struct __pyx_vtabstruct_5pysam_9libctabix_Parser *)__pyx_v_self->parser->__pyx_vtab)->parse(__pyx_v_self->parser, __pyx_v_b, __pyx_v_self->buffer.l); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1165, __pyx_L1_error) | |
21108 __Pyx_GOTREF(__pyx_t_4); | |
21109 __pyx_r = __pyx_t_4; | |
21110 __pyx_t_4 = 0; | |
21111 goto __pyx_L0; | |
21112 __pyx_L3_continue:; | |
21113 } | |
21114 __pyx_L4_break:; | |
21115 | |
21116 /* "pysam/libctabix.pyx":1167 | |
21117 * return self.parser.parse(b, self.buffer.l) | |
21118 * | |
21119 * raise StopIteration # <<<<<<<<<<<<<< | |
21120 * | |
21121 * def __dealloc__(self): | |
21122 */ | |
21123 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); | |
21124 __PYX_ERR(0, 1167, __pyx_L1_error) | |
21125 | |
21126 /* "pysam/libctabix.pyx":1139 | |
21127 * return self | |
21128 * | |
21129 * cdef __cnext__(self): # <<<<<<<<<<<<<< | |
21130 * | |
21131 * cdef char * b | |
21132 */ | |
21133 | |
21134 /* function exit code */ | |
21135 __pyx_L1_error:; | |
21136 __Pyx_XDECREF(__pyx_t_4); | |
21137 __Pyx_AddTraceback("pysam.libctabix.tabix_file_iterator.__cnext__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
21138 __pyx_r = 0; | |
21139 __pyx_L0:; | |
21140 __Pyx_XGIVEREF(__pyx_r); | |
21141 __Pyx_TraceReturn(__pyx_r, 0); | |
21142 __Pyx_RefNannyFinishContext(); | |
21143 return __pyx_r; | |
21144 } | |
21145 | |
21146 /* "pysam/libctabix.pyx":1169 | |
21147 * raise StopIteration | |
21148 * | |
21149 * def __dealloc__(self): # <<<<<<<<<<<<<< | |
21150 * free(self.buffer.s) | |
21151 * ks_destroy(self.kstream) | |
21152 */ | |
21153 | |
21154 /* Python wrapper */ | |
21155 static void __pyx_pw_5pysam_9libctabix_19tabix_file_iterator_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ | |
21156 static void __pyx_pw_5pysam_9libctabix_19tabix_file_iterator_5__dealloc__(PyObject *__pyx_v_self) { | |
21157 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
21158 __Pyx_RefNannyDeclarations | |
21159 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); | |
21160 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
21161 __pyx_pf_5pysam_9libctabix_19tabix_file_iterator_4__dealloc__(((struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *)__pyx_v_self)); | |
21162 | |
21163 /* function exit code */ | |
21164 __Pyx_RefNannyFinishContext(); | |
21165 } | |
21166 | |
21167 static void __pyx_pf_5pysam_9libctabix_19tabix_file_iterator_4__dealloc__(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *__pyx_v_self) { | |
21168 __Pyx_TraceDeclarations | |
21169 int __pyx_lineno = 0; | |
21170 const char *__pyx_filename = NULL; | |
21171 int __pyx_clineno = 0; | |
21172 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 1169, 0, __PYX_ERR(0, 1169, __pyx_L1_error)); | |
21173 | |
21174 /* "pysam/libctabix.pyx":1170 | |
21175 * | |
21176 * def __dealloc__(self): | |
21177 * free(self.buffer.s) # <<<<<<<<<<<<<< | |
21178 * ks_destroy(self.kstream) | |
21179 * bgzf_close(self.fh) | |
21180 */ | |
21181 free(__pyx_v_self->buffer.s); | |
21182 | |
21183 /* "pysam/libctabix.pyx":1171 | |
21184 * def __dealloc__(self): | |
21185 * free(self.buffer.s) | |
21186 * ks_destroy(self.kstream) # <<<<<<<<<<<<<< | |
21187 * bgzf_close(self.fh) | |
21188 * | |
21189 */ | |
21190 ks_destroy(__pyx_v_self->kstream); | |
21191 | |
21192 /* "pysam/libctabix.pyx":1172 | |
21193 * free(self.buffer.s) | |
21194 * ks_destroy(self.kstream) | |
21195 * bgzf_close(self.fh) # <<<<<<<<<<<<<< | |
21196 * | |
21197 * def __next__(self): | |
21198 */ | |
21199 (void)(bgzf_close(__pyx_v_self->fh)); | |
21200 | |
21201 /* "pysam/libctabix.pyx":1169 | |
21202 * raise StopIteration | |
21203 * | |
21204 * def __dealloc__(self): # <<<<<<<<<<<<<< | |
21205 * free(self.buffer.s) | |
21206 * ks_destroy(self.kstream) | |
21207 */ | |
21208 | |
21209 /* function exit code */ | |
21210 goto __pyx_L0; | |
21211 __pyx_L1_error:; | |
21212 __Pyx_WriteUnraisable("pysam.libctabix.tabix_file_iterator.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); | |
21213 __pyx_L0:; | |
21214 __Pyx_TraceReturn(Py_None, 0); | |
21215 } | |
21216 | |
21217 /* "pysam/libctabix.pyx":1174 | |
21218 * bgzf_close(self.fh) | |
21219 * | |
21220 * def __next__(self): # <<<<<<<<<<<<<< | |
21221 * return self.__cnext__() | |
21222 * | |
21223 */ | |
21224 | |
21225 /* Python wrapper */ | |
21226 static PyObject *__pyx_pw_5pysam_9libctabix_19tabix_file_iterator_7__next__(PyObject *__pyx_v_self); /*proto*/ | |
21227 static PyObject *__pyx_pw_5pysam_9libctabix_19tabix_file_iterator_7__next__(PyObject *__pyx_v_self) { | |
21228 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
21229 PyObject *__pyx_r = 0; | |
21230 __Pyx_RefNannyDeclarations | |
21231 __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); | |
21232 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
21233 __pyx_r = __pyx_pf_5pysam_9libctabix_19tabix_file_iterator_6__next__(((struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *)__pyx_v_self)); | |
21234 | |
21235 /* function exit code */ | |
21236 __Pyx_RefNannyFinishContext(); | |
21237 return __pyx_r; | |
21238 } | |
21239 | |
21240 static PyObject *__pyx_pf_5pysam_9libctabix_19tabix_file_iterator_6__next__(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *__pyx_v_self) { | |
21241 PyObject *__pyx_r = NULL; | |
21242 __Pyx_TraceDeclarations | |
21243 __Pyx_RefNannyDeclarations | |
21244 PyObject *__pyx_t_1 = NULL; | |
21245 int __pyx_lineno = 0; | |
21246 const char *__pyx_filename = NULL; | |
21247 int __pyx_clineno = 0; | |
21248 __Pyx_RefNannySetupContext("__next__", 1); | |
21249 __Pyx_TraceCall("__next__", __pyx_f[0], 1174, 0, __PYX_ERR(0, 1174, __pyx_L1_error)); | |
21250 | |
21251 /* "pysam/libctabix.pyx":1175 | |
21252 * | |
21253 * def __next__(self): | |
21254 * return self.__cnext__() # <<<<<<<<<<<<<< | |
21255 * | |
21256 * | |
21257 */ | |
21258 __Pyx_XDECREF(__pyx_r); | |
21259 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_9libctabix_tabix_file_iterator *)__pyx_v_self->__pyx_vtab)->__pyx___cnext__(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1175, __pyx_L1_error) | |
21260 __Pyx_GOTREF(__pyx_t_1); | |
21261 __pyx_r = __pyx_t_1; | |
21262 __pyx_t_1 = 0; | |
21263 goto __pyx_L0; | |
21264 | |
21265 /* "pysam/libctabix.pyx":1174 | |
21266 * bgzf_close(self.fh) | |
21267 * | |
21268 * def __next__(self): # <<<<<<<<<<<<<< | |
21269 * return self.__cnext__() | |
21270 * | |
21271 */ | |
21272 | |
21273 /* function exit code */ | |
21274 __pyx_L1_error:; | |
21275 __Pyx_XDECREF(__pyx_t_1); | |
21276 __Pyx_AddTraceback("pysam.libctabix.tabix_file_iterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
21277 __pyx_r = NULL; | |
21278 __pyx_L0:; | |
21279 __Pyx_XGIVEREF(__pyx_r); | |
21280 __Pyx_TraceReturn(__pyx_r, 0); | |
21281 __Pyx_RefNannyFinishContext(); | |
21282 return __pyx_r; | |
21283 } | |
21284 | |
21285 /* "(tree fragment)":1 | |
21286 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
21287 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
21288 * def __setstate_cython__(self, __pyx_state): | |
21289 */ | |
21290 | |
21291 /* Python wrapper */ | |
21292 static PyObject *__pyx_pw_5pysam_9libctabix_19tabix_file_iterator_9__reduce_cython__(PyObject *__pyx_v_self, | |
21293 #if CYTHON_METH_FASTCALL | |
21294 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
21295 #else | |
21296 PyObject *__pyx_args, PyObject *__pyx_kwds | |
21297 #endif | |
21298 ); /*proto*/ | |
21299 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_19tabix_file_iterator_8__reduce_cython__, "tabix_file_iterator.__reduce_cython__(self)"); | |
21300 static PyMethodDef __pyx_mdef_5pysam_9libctabix_19tabix_file_iterator_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_19tabix_file_iterator_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_19tabix_file_iterator_8__reduce_cython__}; | |
21301 static PyObject *__pyx_pw_5pysam_9libctabix_19tabix_file_iterator_9__reduce_cython__(PyObject *__pyx_v_self, | |
21302 #if CYTHON_METH_FASTCALL | |
21303 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
21304 #else | |
21305 PyObject *__pyx_args, PyObject *__pyx_kwds | |
21306 #endif | |
21307 ) { | |
21308 #if !CYTHON_METH_FASTCALL | |
21309 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
21310 #endif | |
21311 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
21312 PyObject *__pyx_r = 0; | |
21313 __Pyx_RefNannyDeclarations | |
21314 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
21315 #if !CYTHON_METH_FASTCALL | |
21316 #if CYTHON_ASSUME_SAFE_MACROS | |
21317 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
21318 #else | |
21319 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
21320 #endif | |
21321 #endif | |
21322 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
21323 if (unlikely(__pyx_nargs > 0)) { | |
21324 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
21325 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
21326 __pyx_r = __pyx_pf_5pysam_9libctabix_19tabix_file_iterator_8__reduce_cython__(((struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *)__pyx_v_self)); | |
21327 | |
21328 /* function exit code */ | |
21329 __Pyx_RefNannyFinishContext(); | |
21330 return __pyx_r; | |
21331 } | |
21332 | |
21333 static PyObject *__pyx_pf_5pysam_9libctabix_19tabix_file_iterator_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *__pyx_v_self) { | |
21334 PyObject *__pyx_r = NULL; | |
21335 __Pyx_TraceDeclarations | |
21336 __Pyx_RefNannyDeclarations | |
21337 int __pyx_lineno = 0; | |
21338 const char *__pyx_filename = NULL; | |
21339 int __pyx_clineno = 0; | |
21340 __Pyx_TraceFrameInit(__pyx_codeobj__46) | |
21341 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
21342 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
21343 | |
21344 /* "(tree fragment)":2 | |
21345 * def __reduce_cython__(self): | |
21346 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< | |
21347 * def __setstate_cython__(self, __pyx_state): | |
21348 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
21349 */ | |
21350 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); | |
21351 __PYX_ERR(1, 2, __pyx_L1_error) | |
21352 | |
21353 /* "(tree fragment)":1 | |
21354 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
21355 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
21356 * def __setstate_cython__(self, __pyx_state): | |
21357 */ | |
21358 | |
21359 /* function exit code */ | |
21360 __pyx_L1_error:; | |
21361 __Pyx_AddTraceback("pysam.libctabix.tabix_file_iterator.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
21362 __pyx_r = NULL; | |
21363 __Pyx_XGIVEREF(__pyx_r); | |
21364 __Pyx_TraceReturn(__pyx_r, 0); | |
21365 __Pyx_RefNannyFinishContext(); | |
21366 return __pyx_r; | |
21367 } | |
21368 | |
21369 /* "(tree fragment)":3 | |
21370 * def __reduce_cython__(self): | |
21371 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
21372 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
21373 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
21374 */ | |
21375 | |
21376 /* Python wrapper */ | |
21377 static PyObject *__pyx_pw_5pysam_9libctabix_19tabix_file_iterator_11__setstate_cython__(PyObject *__pyx_v_self, | |
21378 #if CYTHON_METH_FASTCALL | |
21379 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
21380 #else | |
21381 PyObject *__pyx_args, PyObject *__pyx_kwds | |
21382 #endif | |
21383 ); /*proto*/ | |
21384 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_19tabix_file_iterator_10__setstate_cython__, "tabix_file_iterator.__setstate_cython__(self, __pyx_state)"); | |
21385 static PyMethodDef __pyx_mdef_5pysam_9libctabix_19tabix_file_iterator_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_19tabix_file_iterator_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_19tabix_file_iterator_10__setstate_cython__}; | |
21386 static PyObject *__pyx_pw_5pysam_9libctabix_19tabix_file_iterator_11__setstate_cython__(PyObject *__pyx_v_self, | |
21387 #if CYTHON_METH_FASTCALL | |
21388 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
21389 #else | |
21390 PyObject *__pyx_args, PyObject *__pyx_kwds | |
21391 #endif | |
21392 ) { | |
21393 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; | |
21394 #if !CYTHON_METH_FASTCALL | |
21395 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
21396 #endif | |
21397 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
21398 PyObject* values[1] = {0}; | |
21399 int __pyx_lineno = 0; | |
21400 const char *__pyx_filename = NULL; | |
21401 int __pyx_clineno = 0; | |
21402 PyObject *__pyx_r = 0; | |
21403 __Pyx_RefNannyDeclarations | |
21404 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
21405 #if !CYTHON_METH_FASTCALL | |
21406 #if CYTHON_ASSUME_SAFE_MACROS | |
21407 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
21408 #else | |
21409 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
21410 #endif | |
21411 #endif | |
21412 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
21413 { | |
21414 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
21415 if (__pyx_kwds) { | |
21416 Py_ssize_t kw_args; | |
21417 switch (__pyx_nargs) { | |
21418 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
21419 CYTHON_FALLTHROUGH; | |
21420 case 0: break; | |
21421 default: goto __pyx_L5_argtuple_error; | |
21422 } | |
21423 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
21424 switch (__pyx_nargs) { | |
21425 case 0: | |
21426 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
21427 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
21428 kw_args--; | |
21429 } | |
21430 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) | |
21431 else goto __pyx_L5_argtuple_error; | |
21432 } | |
21433 if (unlikely(kw_args > 0)) { | |
21434 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
21435 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) | |
21436 } | |
21437 } else if (unlikely(__pyx_nargs != 1)) { | |
21438 goto __pyx_L5_argtuple_error; | |
21439 } else { | |
21440 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
21441 } | |
21442 __pyx_v___pyx_state = values[0]; | |
21443 } | |
21444 goto __pyx_L6_skip; | |
21445 __pyx_L5_argtuple_error:; | |
21446 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) | |
21447 __pyx_L6_skip:; | |
21448 goto __pyx_L4_argument_unpacking_done; | |
21449 __pyx_L3_error:; | |
21450 { | |
21451 Py_ssize_t __pyx_temp; | |
21452 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
21453 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
21454 } | |
21455 } | |
21456 __Pyx_AddTraceback("pysam.libctabix.tabix_file_iterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
21457 __Pyx_RefNannyFinishContext(); | |
21458 return NULL; | |
21459 __pyx_L4_argument_unpacking_done:; | |
21460 __pyx_r = __pyx_pf_5pysam_9libctabix_19tabix_file_iterator_10__setstate_cython__(((struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *)__pyx_v_self), __pyx_v___pyx_state); | |
21461 | |
21462 /* function exit code */ | |
21463 { | |
21464 Py_ssize_t __pyx_temp; | |
21465 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
21466 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
21467 } | |
21468 } | |
21469 __Pyx_RefNannyFinishContext(); | |
21470 return __pyx_r; | |
21471 } | |
21472 | |
21473 static PyObject *__pyx_pf_5pysam_9libctabix_19tabix_file_iterator_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { | |
21474 PyObject *__pyx_r = NULL; | |
21475 __Pyx_TraceDeclarations | |
21476 __Pyx_RefNannyDeclarations | |
21477 int __pyx_lineno = 0; | |
21478 const char *__pyx_filename = NULL; | |
21479 int __pyx_clineno = 0; | |
21480 __Pyx_TraceFrameInit(__pyx_codeobj__47) | |
21481 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
21482 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); | |
21483 | |
21484 /* "(tree fragment)":4 | |
21485 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
21486 * def __setstate_cython__(self, __pyx_state): | |
21487 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< | |
21488 */ | |
21489 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); | |
21490 __PYX_ERR(1, 4, __pyx_L1_error) | |
21491 | |
21492 /* "(tree fragment)":3 | |
21493 * def __reduce_cython__(self): | |
21494 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
21495 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
21496 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
21497 */ | |
21498 | |
21499 /* function exit code */ | |
21500 __pyx_L1_error:; | |
21501 __Pyx_AddTraceback("pysam.libctabix.tabix_file_iterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
21502 __pyx_r = NULL; | |
21503 __Pyx_XGIVEREF(__pyx_r); | |
21504 __Pyx_TraceReturn(__pyx_r, 0); | |
21505 __Pyx_RefNannyFinishContext(); | |
21506 return __pyx_r; | |
21507 } | |
21508 | |
21509 /* "pysam/libctabix.pyx":1183 | |
21510 * Permits the use of file-like objects for example from the gzip module. | |
21511 * ''' | |
21512 * def __init__(self, infile, parser): # <<<<<<<<<<<<<< | |
21513 * | |
21514 * self.infile = infile | |
21515 */ | |
21516 | |
21517 /* Python wrapper */ | |
21518 static PyObject *__pyx_pw_5pysam_9libctabix_22tabix_generic_iterator_1__init__(PyObject *__pyx_self, | |
21519 #if CYTHON_METH_FASTCALL | |
21520 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
21521 #else | |
21522 PyObject *__pyx_args, PyObject *__pyx_kwds | |
21523 #endif | |
21524 ); /*proto*/ | |
21525 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_22tabix_generic_iterator___init__, "tabix_generic_iterator.__init__(self, infile, parser)"); | |
21526 static PyMethodDef __pyx_mdef_5pysam_9libctabix_22tabix_generic_iterator_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_22tabix_generic_iterator_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_22tabix_generic_iterator___init__}; | |
21527 static PyObject *__pyx_pw_5pysam_9libctabix_22tabix_generic_iterator_1__init__(PyObject *__pyx_self, | |
21528 #if CYTHON_METH_FASTCALL | |
21529 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
21530 #else | |
21531 PyObject *__pyx_args, PyObject *__pyx_kwds | |
21532 #endif | |
21533 ) { | |
21534 PyObject *__pyx_v_self = 0; | |
21535 PyObject *__pyx_v_infile = 0; | |
21536 PyObject *__pyx_v_parser = 0; | |
21537 #if !CYTHON_METH_FASTCALL | |
21538 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
21539 #endif | |
21540 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
21541 PyObject* values[3] = {0,0,0}; | |
21542 int __pyx_lineno = 0; | |
21543 const char *__pyx_filename = NULL; | |
21544 int __pyx_clineno = 0; | |
21545 PyObject *__pyx_r = 0; | |
21546 __Pyx_RefNannyDeclarations | |
21547 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); | |
21548 #if !CYTHON_METH_FASTCALL | |
21549 #if CYTHON_ASSUME_SAFE_MACROS | |
21550 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
21551 #else | |
21552 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
21553 #endif | |
21554 #endif | |
21555 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
21556 { | |
21557 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_infile,&__pyx_n_s_parser,0}; | |
21558 if (__pyx_kwds) { | |
21559 Py_ssize_t kw_args; | |
21560 switch (__pyx_nargs) { | |
21561 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
21562 CYTHON_FALLTHROUGH; | |
21563 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
21564 CYTHON_FALLTHROUGH; | |
21565 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
21566 CYTHON_FALLTHROUGH; | |
21567 case 0: break; | |
21568 default: goto __pyx_L5_argtuple_error; | |
21569 } | |
21570 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
21571 switch (__pyx_nargs) { | |
21572 case 0: | |
21573 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
21574 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
21575 kw_args--; | |
21576 } | |
21577 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1183, __pyx_L3_error) | |
21578 else goto __pyx_L5_argtuple_error; | |
21579 CYTHON_FALLTHROUGH; | |
21580 case 1: | |
21581 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_infile)) != 0)) { | |
21582 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
21583 kw_args--; | |
21584 } | |
21585 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1183, __pyx_L3_error) | |
21586 else { | |
21587 __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 1183, __pyx_L3_error) | |
21588 } | |
21589 CYTHON_FALLTHROUGH; | |
21590 case 2: | |
21591 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_parser)) != 0)) { | |
21592 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
21593 kw_args--; | |
21594 } | |
21595 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1183, __pyx_L3_error) | |
21596 else { | |
21597 __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 1183, __pyx_L3_error) | |
21598 } | |
21599 } | |
21600 if (unlikely(kw_args > 0)) { | |
21601 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
21602 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 1183, __pyx_L3_error) | |
21603 } | |
21604 } else if (unlikely(__pyx_nargs != 3)) { | |
21605 goto __pyx_L5_argtuple_error; | |
21606 } else { | |
21607 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
21608 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
21609 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
21610 } | |
21611 __pyx_v_self = values[0]; | |
21612 __pyx_v_infile = values[1]; | |
21613 __pyx_v_parser = values[2]; | |
21614 } | |
21615 goto __pyx_L6_skip; | |
21616 __pyx_L5_argtuple_error:; | |
21617 __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1183, __pyx_L3_error) | |
21618 __pyx_L6_skip:; | |
21619 goto __pyx_L4_argument_unpacking_done; | |
21620 __pyx_L3_error:; | |
21621 { | |
21622 Py_ssize_t __pyx_temp; | |
21623 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
21624 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
21625 } | |
21626 } | |
21627 __Pyx_AddTraceback("pysam.libctabix.tabix_generic_iterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
21628 __Pyx_RefNannyFinishContext(); | |
21629 return NULL; | |
21630 __pyx_L4_argument_unpacking_done:; | |
21631 __pyx_r = __pyx_pf_5pysam_9libctabix_22tabix_generic_iterator___init__(__pyx_self, __pyx_v_self, __pyx_v_infile, __pyx_v_parser); | |
21632 | |
21633 /* function exit code */ | |
21634 { | |
21635 Py_ssize_t __pyx_temp; | |
21636 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
21637 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
21638 } | |
21639 } | |
21640 __Pyx_RefNannyFinishContext(); | |
21641 return __pyx_r; | |
21642 } | |
21643 | |
21644 static PyObject *__pyx_pf_5pysam_9libctabix_22tabix_generic_iterator___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_infile, PyObject *__pyx_v_parser) { | |
21645 PyObject *__pyx_r = NULL; | |
21646 __Pyx_TraceDeclarations | |
21647 __Pyx_RefNannyDeclarations | |
21648 PyObject *__pyx_t_1 = NULL; | |
21649 PyObject *__pyx_t_2 = NULL; | |
21650 int __pyx_t_3; | |
21651 int __pyx_lineno = 0; | |
21652 const char *__pyx_filename = NULL; | |
21653 int __pyx_clineno = 0; | |
21654 __Pyx_TraceFrameInit(__pyx_codeobj__48) | |
21655 __Pyx_RefNannySetupContext("__init__", 1); | |
21656 __Pyx_TraceCall("__init__", __pyx_f[0], 1183, 0, __PYX_ERR(0, 1183, __pyx_L1_error)); | |
21657 | |
21658 /* "pysam/libctabix.pyx":1185 | |
21659 * def __init__(self, infile, parser): | |
21660 * | |
21661 * self.infile = infile # <<<<<<<<<<<<<< | |
21662 * if self.infile.closed: | |
21663 * raise ValueError("I/O operation on closed file.") | |
21664 */ | |
21665 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_infile, __pyx_v_infile) < 0) __PYX_ERR(0, 1185, __pyx_L1_error) | |
21666 | |
21667 /* "pysam/libctabix.pyx":1186 | |
21668 * | |
21669 * self.infile = infile | |
21670 * if self.infile.closed: # <<<<<<<<<<<<<< | |
21671 * raise ValueError("I/O operation on closed file.") | |
21672 * self.parser = parser | |
21673 */ | |
21674 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_infile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1186, __pyx_L1_error) | |
21675 __Pyx_GOTREF(__pyx_t_1); | |
21676 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_closed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1186, __pyx_L1_error) | |
21677 __Pyx_GOTREF(__pyx_t_2); | |
21678 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
21679 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1186, __pyx_L1_error) | |
21680 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
21681 if (unlikely(__pyx_t_3)) { | |
21682 | |
21683 /* "pysam/libctabix.pyx":1187 | |
21684 * self.infile = infile | |
21685 * if self.infile.closed: | |
21686 * raise ValueError("I/O operation on closed file.") # <<<<<<<<<<<<<< | |
21687 * self.parser = parser | |
21688 * | |
21689 */ | |
21690 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1187, __pyx_L1_error) | |
21691 __Pyx_GOTREF(__pyx_t_2); | |
21692 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
21693 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
21694 __PYX_ERR(0, 1187, __pyx_L1_error) | |
21695 | |
21696 /* "pysam/libctabix.pyx":1186 | |
21697 * | |
21698 * self.infile = infile | |
21699 * if self.infile.closed: # <<<<<<<<<<<<<< | |
21700 * raise ValueError("I/O operation on closed file.") | |
21701 * self.parser = parser | |
21702 */ | |
21703 } | |
21704 | |
21705 /* "pysam/libctabix.pyx":1188 | |
21706 * if self.infile.closed: | |
21707 * raise ValueError("I/O operation on closed file.") | |
21708 * self.parser = parser # <<<<<<<<<<<<<< | |
21709 * | |
21710 * def __iter__(self): | |
21711 */ | |
21712 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_parser, __pyx_v_parser) < 0) __PYX_ERR(0, 1188, __pyx_L1_error) | |
21713 | |
21714 /* "pysam/libctabix.pyx":1183 | |
21715 * Permits the use of file-like objects for example from the gzip module. | |
21716 * ''' | |
21717 * def __init__(self, infile, parser): # <<<<<<<<<<<<<< | |
21718 * | |
21719 * self.infile = infile | |
21720 */ | |
21721 | |
21722 /* function exit code */ | |
21723 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
21724 goto __pyx_L0; | |
21725 __pyx_L1_error:; | |
21726 __Pyx_XDECREF(__pyx_t_1); | |
21727 __Pyx_XDECREF(__pyx_t_2); | |
21728 __Pyx_AddTraceback("pysam.libctabix.tabix_generic_iterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
21729 __pyx_r = NULL; | |
21730 __pyx_L0:; | |
21731 __Pyx_XGIVEREF(__pyx_r); | |
21732 __Pyx_TraceReturn(__pyx_r, 0); | |
21733 __Pyx_RefNannyFinishContext(); | |
21734 return __pyx_r; | |
21735 } | |
21736 | |
21737 /* "pysam/libctabix.pyx":1190 | |
21738 * self.parser = parser | |
21739 * | |
21740 * def __iter__(self): # <<<<<<<<<<<<<< | |
21741 * return self | |
21742 * | |
21743 */ | |
21744 | |
21745 /* Python wrapper */ | |
21746 static PyObject *__pyx_pw_5pysam_9libctabix_22tabix_generic_iterator_3__iter__(PyObject *__pyx_self, | |
21747 #if CYTHON_METH_FASTCALL | |
21748 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
21749 #else | |
21750 PyObject *__pyx_args, PyObject *__pyx_kwds | |
21751 #endif | |
21752 ); /*proto*/ | |
21753 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_22tabix_generic_iterator_2__iter__, "tabix_generic_iterator.__iter__(self)"); | |
21754 static PyMethodDef __pyx_mdef_5pysam_9libctabix_22tabix_generic_iterator_3__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_22tabix_generic_iterator_3__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_22tabix_generic_iterator_2__iter__}; | |
21755 static PyObject *__pyx_pw_5pysam_9libctabix_22tabix_generic_iterator_3__iter__(PyObject *__pyx_self, | |
21756 #if CYTHON_METH_FASTCALL | |
21757 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
21758 #else | |
21759 PyObject *__pyx_args, PyObject *__pyx_kwds | |
21760 #endif | |
21761 ) { | |
21762 PyObject *__pyx_v_self = 0; | |
21763 #if !CYTHON_METH_FASTCALL | |
21764 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
21765 #endif | |
21766 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
21767 PyObject* values[1] = {0}; | |
21768 int __pyx_lineno = 0; | |
21769 const char *__pyx_filename = NULL; | |
21770 int __pyx_clineno = 0; | |
21771 PyObject *__pyx_r = 0; | |
21772 __Pyx_RefNannyDeclarations | |
21773 __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); | |
21774 #if !CYTHON_METH_FASTCALL | |
21775 #if CYTHON_ASSUME_SAFE_MACROS | |
21776 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
21777 #else | |
21778 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
21779 #endif | |
21780 #endif | |
21781 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
21782 { | |
21783 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; | |
21784 if (__pyx_kwds) { | |
21785 Py_ssize_t kw_args; | |
21786 switch (__pyx_nargs) { | |
21787 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
21788 CYTHON_FALLTHROUGH; | |
21789 case 0: break; | |
21790 default: goto __pyx_L5_argtuple_error; | |
21791 } | |
21792 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
21793 switch (__pyx_nargs) { | |
21794 case 0: | |
21795 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
21796 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
21797 kw_args--; | |
21798 } | |
21799 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1190, __pyx_L3_error) | |
21800 else goto __pyx_L5_argtuple_error; | |
21801 } | |
21802 if (unlikely(kw_args > 0)) { | |
21803 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
21804 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 1190, __pyx_L3_error) | |
21805 } | |
21806 } else if (unlikely(__pyx_nargs != 1)) { | |
21807 goto __pyx_L5_argtuple_error; | |
21808 } else { | |
21809 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
21810 } | |
21811 __pyx_v_self = values[0]; | |
21812 } | |
21813 goto __pyx_L6_skip; | |
21814 __pyx_L5_argtuple_error:; | |
21815 __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1190, __pyx_L3_error) | |
21816 __pyx_L6_skip:; | |
21817 goto __pyx_L4_argument_unpacking_done; | |
21818 __pyx_L3_error:; | |
21819 { | |
21820 Py_ssize_t __pyx_temp; | |
21821 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
21822 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
21823 } | |
21824 } | |
21825 __Pyx_AddTraceback("pysam.libctabix.tabix_generic_iterator.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
21826 __Pyx_RefNannyFinishContext(); | |
21827 return NULL; | |
21828 __pyx_L4_argument_unpacking_done:; | |
21829 __pyx_r = __pyx_pf_5pysam_9libctabix_22tabix_generic_iterator_2__iter__(__pyx_self, __pyx_v_self); | |
21830 | |
21831 /* function exit code */ | |
21832 { | |
21833 Py_ssize_t __pyx_temp; | |
21834 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
21835 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
21836 } | |
21837 } | |
21838 __Pyx_RefNannyFinishContext(); | |
21839 return __pyx_r; | |
21840 } | |
21841 | |
21842 static PyObject *__pyx_pf_5pysam_9libctabix_22tabix_generic_iterator_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { | |
21843 PyObject *__pyx_r = NULL; | |
21844 __Pyx_TraceDeclarations | |
21845 __Pyx_RefNannyDeclarations | |
21846 int __pyx_lineno = 0; | |
21847 const char *__pyx_filename = NULL; | |
21848 int __pyx_clineno = 0; | |
21849 __Pyx_TraceFrameInit(__pyx_codeobj__49) | |
21850 __Pyx_RefNannySetupContext("__iter__", 1); | |
21851 __Pyx_TraceCall("__iter__", __pyx_f[0], 1190, 0, __PYX_ERR(0, 1190, __pyx_L1_error)); | |
21852 | |
21853 /* "pysam/libctabix.pyx":1191 | |
21854 * | |
21855 * def __iter__(self): | |
21856 * return self # <<<<<<<<<<<<<< | |
21857 * | |
21858 * # cython version - required for python 3 | |
21859 */ | |
21860 __Pyx_XDECREF(__pyx_r); | |
21861 __Pyx_INCREF(__pyx_v_self); | |
21862 __pyx_r = __pyx_v_self; | |
21863 goto __pyx_L0; | |
21864 | |
21865 /* "pysam/libctabix.pyx":1190 | |
21866 * self.parser = parser | |
21867 * | |
21868 * def __iter__(self): # <<<<<<<<<<<<<< | |
21869 * return self | |
21870 * | |
21871 */ | |
21872 | |
21873 /* function exit code */ | |
21874 __pyx_L1_error:; | |
21875 __Pyx_AddTraceback("pysam.libctabix.tabix_generic_iterator.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
21876 __pyx_r = NULL; | |
21877 __pyx_L0:; | |
21878 __Pyx_XGIVEREF(__pyx_r); | |
21879 __Pyx_TraceReturn(__pyx_r, 0); | |
21880 __Pyx_RefNannyFinishContext(); | |
21881 return __pyx_r; | |
21882 } | |
21883 | |
21884 /* "pysam/libctabix.pyx":1194 | |
21885 * | |
21886 * # cython version - required for python 3 | |
21887 * def __next__(self): # <<<<<<<<<<<<<< | |
21888 * | |
21889 * cdef char * b | |
21890 */ | |
21891 | |
21892 /* Python wrapper */ | |
21893 static PyObject *__pyx_pw_5pysam_9libctabix_22tabix_generic_iterator_5__next__(PyObject *__pyx_self, | |
21894 #if CYTHON_METH_FASTCALL | |
21895 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
21896 #else | |
21897 PyObject *__pyx_args, PyObject *__pyx_kwds | |
21898 #endif | |
21899 ); /*proto*/ | |
21900 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_22tabix_generic_iterator_4__next__, "tabix_generic_iterator.__next__(self)"); | |
21901 static PyMethodDef __pyx_mdef_5pysam_9libctabix_22tabix_generic_iterator_5__next__ = {"__next__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_22tabix_generic_iterator_5__next__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_22tabix_generic_iterator_4__next__}; | |
21902 static PyObject *__pyx_pw_5pysam_9libctabix_22tabix_generic_iterator_5__next__(PyObject *__pyx_self, | |
21903 #if CYTHON_METH_FASTCALL | |
21904 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
21905 #else | |
21906 PyObject *__pyx_args, PyObject *__pyx_kwds | |
21907 #endif | |
21908 ) { | |
21909 PyObject *__pyx_v_self = 0; | |
21910 #if !CYTHON_METH_FASTCALL | |
21911 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
21912 #endif | |
21913 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
21914 PyObject* values[1] = {0}; | |
21915 int __pyx_lineno = 0; | |
21916 const char *__pyx_filename = NULL; | |
21917 int __pyx_clineno = 0; | |
21918 PyObject *__pyx_r = 0; | |
21919 __Pyx_RefNannyDeclarations | |
21920 __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); | |
21921 #if !CYTHON_METH_FASTCALL | |
21922 #if CYTHON_ASSUME_SAFE_MACROS | |
21923 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
21924 #else | |
21925 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
21926 #endif | |
21927 #endif | |
21928 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
21929 { | |
21930 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; | |
21931 if (__pyx_kwds) { | |
21932 Py_ssize_t kw_args; | |
21933 switch (__pyx_nargs) { | |
21934 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
21935 CYTHON_FALLTHROUGH; | |
21936 case 0: break; | |
21937 default: goto __pyx_L5_argtuple_error; | |
21938 } | |
21939 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
21940 switch (__pyx_nargs) { | |
21941 case 0: | |
21942 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { | |
21943 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
21944 kw_args--; | |
21945 } | |
21946 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1194, __pyx_L3_error) | |
21947 else goto __pyx_L5_argtuple_error; | |
21948 } | |
21949 if (unlikely(kw_args > 0)) { | |
21950 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
21951 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__next__") < 0)) __PYX_ERR(0, 1194, __pyx_L3_error) | |
21952 } | |
21953 } else if (unlikely(__pyx_nargs != 1)) { | |
21954 goto __pyx_L5_argtuple_error; | |
21955 } else { | |
21956 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
21957 } | |
21958 __pyx_v_self = values[0]; | |
21959 } | |
21960 goto __pyx_L6_skip; | |
21961 __pyx_L5_argtuple_error:; | |
21962 __Pyx_RaiseArgtupleInvalid("__next__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1194, __pyx_L3_error) | |
21963 __pyx_L6_skip:; | |
21964 goto __pyx_L4_argument_unpacking_done; | |
21965 __pyx_L3_error:; | |
21966 { | |
21967 Py_ssize_t __pyx_temp; | |
21968 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
21969 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
21970 } | |
21971 } | |
21972 __Pyx_AddTraceback("pysam.libctabix.tabix_generic_iterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
21973 __Pyx_RefNannyFinishContext(); | |
21974 return NULL; | |
21975 __pyx_L4_argument_unpacking_done:; | |
21976 __pyx_r = __pyx_pf_5pysam_9libctabix_22tabix_generic_iterator_4__next__(__pyx_self, __pyx_v_self); | |
21977 | |
21978 /* function exit code */ | |
21979 { | |
21980 Py_ssize_t __pyx_temp; | |
21981 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
21982 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
21983 } | |
21984 } | |
21985 __Pyx_RefNannyFinishContext(); | |
21986 return __pyx_r; | |
21987 } | |
21988 | |
21989 static PyObject *__pyx_pf_5pysam_9libctabix_22tabix_generic_iterator_4__next__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { | |
21990 char *__pyx_v_b; | |
21991 char *__pyx_v_cpy; | |
21992 size_t __pyx_v_nbytes; | |
21993 PyObject *__pyx_v_encoding = NULL; | |
21994 PyObject *__pyx_v_line = NULL; | |
21995 PyObject *__pyx_v_s = NULL; | |
21996 PyObject *__pyx_v_bytes_cpy = NULL; | |
21997 PyObject *__pyx_r = NULL; | |
21998 __Pyx_TraceDeclarations | |
21999 __Pyx_RefNannyDeclarations | |
22000 PyObject *__pyx_t_1 = NULL; | |
22001 PyObject *__pyx_t_2 = NULL; | |
22002 PyObject *__pyx_t_3 = NULL; | |
22003 unsigned int __pyx_t_4; | |
22004 int __pyx_t_5; | |
22005 int __pyx_t_6; | |
22006 struct __pyx_opt_args_5pysam_9libcutils_force_bytes __pyx_t_7; | |
22007 char *__pyx_t_8; | |
22008 Py_ssize_t __pyx_t_9; | |
22009 PyObject *__pyx_t_10 = NULL; | |
22010 PyObject *__pyx_t_11 = NULL; | |
22011 int __pyx_lineno = 0; | |
22012 const char *__pyx_filename = NULL; | |
22013 int __pyx_clineno = 0; | |
22014 __Pyx_TraceFrameInit(__pyx_codeobj__50) | |
22015 __Pyx_RefNannySetupContext("__next__", 1); | |
22016 __Pyx_TraceCall("__next__", __pyx_f[0], 1194, 0, __PYX_ERR(0, 1194, __pyx_L1_error)); | |
22017 | |
22018 /* "pysam/libctabix.pyx":1200 | |
22019 * cdef size_t nbytes | |
22020 * | |
22021 * encoding = self.parser.get_encoding() # <<<<<<<<<<<<<< | |
22022 * | |
22023 * # note that GzipFile.close() does not close the file | |
22024 */ | |
22025 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1200, __pyx_L1_error) | |
22026 __Pyx_GOTREF(__pyx_t_2); | |
22027 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1200, __pyx_L1_error) | |
22028 __Pyx_GOTREF(__pyx_t_3); | |
22029 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22030 __pyx_t_2 = NULL; | |
22031 __pyx_t_4 = 0; | |
22032 #if CYTHON_UNPACK_METHODS | |
22033 if (likely(PyMethod_Check(__pyx_t_3))) { | |
22034 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); | |
22035 if (likely(__pyx_t_2)) { | |
22036 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
22037 __Pyx_INCREF(__pyx_t_2); | |
22038 __Pyx_INCREF(function); | |
22039 __Pyx_DECREF_SET(__pyx_t_3, function); | |
22040 __pyx_t_4 = 1; | |
22041 } | |
22042 } | |
22043 #endif | |
22044 { | |
22045 PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; | |
22046 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
22047 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22048 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1200, __pyx_L1_error) | |
22049 __Pyx_GOTREF(__pyx_t_1); | |
22050 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
22051 } | |
22052 __pyx_v_encoding = __pyx_t_1; | |
22053 __pyx_t_1 = 0; | |
22054 | |
22055 /* "pysam/libctabix.pyx":1204 | |
22056 * # note that GzipFile.close() does not close the file | |
22057 * # reading is still possible. | |
22058 * if self.infile.closed: # <<<<<<<<<<<<<< | |
22059 * raise ValueError("I/O operation on closed file.") | |
22060 * | |
22061 */ | |
22062 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_infile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1204, __pyx_L1_error) | |
22063 __Pyx_GOTREF(__pyx_t_1); | |
22064 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_closed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1204, __pyx_L1_error) | |
22065 __Pyx_GOTREF(__pyx_t_3); | |
22066 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
22067 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1204, __pyx_L1_error) | |
22068 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
22069 if (unlikely(__pyx_t_5)) { | |
22070 | |
22071 /* "pysam/libctabix.pyx":1205 | |
22072 * # reading is still possible. | |
22073 * if self.infile.closed: | |
22074 * raise ValueError("I/O operation on closed file.") # <<<<<<<<<<<<<< | |
22075 * | |
22076 * while 1: | |
22077 */ | |
22078 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1205, __pyx_L1_error) | |
22079 __Pyx_GOTREF(__pyx_t_3); | |
22080 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
22081 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
22082 __PYX_ERR(0, 1205, __pyx_L1_error) | |
22083 | |
22084 /* "pysam/libctabix.pyx":1204 | |
22085 * # note that GzipFile.close() does not close the file | |
22086 * # reading is still possible. | |
22087 * if self.infile.closed: # <<<<<<<<<<<<<< | |
22088 * raise ValueError("I/O operation on closed file.") | |
22089 * | |
22090 */ | |
22091 } | |
22092 | |
22093 /* "pysam/libctabix.pyx":1207 | |
22094 * raise ValueError("I/O operation on closed file.") | |
22095 * | |
22096 * while 1: # <<<<<<<<<<<<<< | |
22097 * | |
22098 * line = self.infile.readline() | |
22099 */ | |
22100 while (1) { | |
22101 | |
22102 /* "pysam/libctabix.pyx":1209 | |
22103 * while 1: | |
22104 * | |
22105 * line = self.infile.readline() # <<<<<<<<<<<<<< | |
22106 * if not line: | |
22107 * break | |
22108 */ | |
22109 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_infile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1209, __pyx_L1_error) | |
22110 __Pyx_GOTREF(__pyx_t_1); | |
22111 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_readline); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1209, __pyx_L1_error) | |
22112 __Pyx_GOTREF(__pyx_t_2); | |
22113 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
22114 __pyx_t_1 = NULL; | |
22115 __pyx_t_4 = 0; | |
22116 #if CYTHON_UNPACK_METHODS | |
22117 if (likely(PyMethod_Check(__pyx_t_2))) { | |
22118 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); | |
22119 if (likely(__pyx_t_1)) { | |
22120 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
22121 __Pyx_INCREF(__pyx_t_1); | |
22122 __Pyx_INCREF(function); | |
22123 __Pyx_DECREF_SET(__pyx_t_2, function); | |
22124 __pyx_t_4 = 1; | |
22125 } | |
22126 } | |
22127 #endif | |
22128 { | |
22129 PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; | |
22130 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
22131 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
22132 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1209, __pyx_L1_error) | |
22133 __Pyx_GOTREF(__pyx_t_3); | |
22134 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22135 } | |
22136 __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_3); | |
22137 __pyx_t_3 = 0; | |
22138 | |
22139 /* "pysam/libctabix.pyx":1210 | |
22140 * | |
22141 * line = self.infile.readline() | |
22142 * if not line: # <<<<<<<<<<<<<< | |
22143 * break | |
22144 * | |
22145 */ | |
22146 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_line); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1210, __pyx_L1_error) | |
22147 __pyx_t_6 = (!__pyx_t_5); | |
22148 if (__pyx_t_6) { | |
22149 | |
22150 /* "pysam/libctabix.pyx":1211 | |
22151 * line = self.infile.readline() | |
22152 * if not line: | |
22153 * break # <<<<<<<<<<<<<< | |
22154 * | |
22155 * s = force_bytes(line, encoding) | |
22156 */ | |
22157 goto __pyx_L5_break; | |
22158 | |
22159 /* "pysam/libctabix.pyx":1210 | |
22160 * | |
22161 * line = self.infile.readline() | |
22162 * if not line: # <<<<<<<<<<<<<< | |
22163 * break | |
22164 * | |
22165 */ | |
22166 } | |
22167 | |
22168 /* "pysam/libctabix.pyx":1213 | |
22169 * break | |
22170 * | |
22171 * s = force_bytes(line, encoding) # <<<<<<<<<<<<<< | |
22172 * b = s | |
22173 * nbytes = len(line) | |
22174 */ | |
22175 __pyx_t_7.__pyx_n = 1; | |
22176 __pyx_t_7.encoding = __pyx_v_encoding; | |
22177 __pyx_t_3 = __pyx_f_5pysam_9libcutils_force_bytes(__pyx_v_line, &__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1213, __pyx_L1_error) | |
22178 __Pyx_GOTREF(__pyx_t_3); | |
22179 __Pyx_XDECREF_SET(__pyx_v_s, ((PyObject*)__pyx_t_3)); | |
22180 __pyx_t_3 = 0; | |
22181 | |
22182 /* "pysam/libctabix.pyx":1214 | |
22183 * | |
22184 * s = force_bytes(line, encoding) | |
22185 * b = s # <<<<<<<<<<<<<< | |
22186 * nbytes = len(line) | |
22187 * assert b[nbytes] == b'\0' | |
22188 */ | |
22189 if (unlikely(__pyx_v_s == Py_None)) { | |
22190 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); | |
22191 __PYX_ERR(0, 1214, __pyx_L1_error) | |
22192 } | |
22193 __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_s); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 1214, __pyx_L1_error) | |
22194 __pyx_v_b = __pyx_t_8; | |
22195 | |
22196 /* "pysam/libctabix.pyx":1215 | |
22197 * s = force_bytes(line, encoding) | |
22198 * b = s | |
22199 * nbytes = len(line) # <<<<<<<<<<<<<< | |
22200 * assert b[nbytes] == b'\0' | |
22201 * | |
22202 */ | |
22203 __pyx_t_9 = PyObject_Length(__pyx_v_line); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1215, __pyx_L1_error) | |
22204 __pyx_v_nbytes = __pyx_t_9; | |
22205 | |
22206 /* "pysam/libctabix.pyx":1216 | |
22207 * b = s | |
22208 * nbytes = len(line) | |
22209 * assert b[nbytes] == b'\0' # <<<<<<<<<<<<<< | |
22210 * | |
22211 * # skip comments | |
22212 */ | |
22213 #ifndef CYTHON_WITHOUT_ASSERTIONS | |
22214 if (unlikely(__pyx_assertions_enabled())) { | |
22215 __pyx_t_6 = ((__pyx_v_b[__pyx_v_nbytes]) == '\x00'); | |
22216 if (unlikely(!__pyx_t_6)) { | |
22217 __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); | |
22218 __PYX_ERR(0, 1216, __pyx_L1_error) | |
22219 } | |
22220 } | |
22221 #else | |
22222 if ((1)); else __PYX_ERR(0, 1216, __pyx_L1_error) | |
22223 #endif | |
22224 | |
22225 /* "pysam/libctabix.pyx":1219 | |
22226 * | |
22227 * # skip comments | |
22228 * if b[0] == b'#': # <<<<<<<<<<<<<< | |
22229 * continue | |
22230 * | |
22231 */ | |
22232 __pyx_t_6 = ((__pyx_v_b[0]) == '#'); | |
22233 if (__pyx_t_6) { | |
22234 | |
22235 /* "pysam/libctabix.pyx":1220 | |
22236 * # skip comments | |
22237 * if b[0] == b'#': | |
22238 * continue # <<<<<<<<<<<<<< | |
22239 * | |
22240 * # skip empty lines | |
22241 */ | |
22242 goto __pyx_L4_continue; | |
22243 | |
22244 /* "pysam/libctabix.pyx":1219 | |
22245 * | |
22246 * # skip comments | |
22247 * if b[0] == b'#': # <<<<<<<<<<<<<< | |
22248 * continue | |
22249 * | |
22250 */ | |
22251 } | |
22252 | |
22253 /* "pysam/libctabix.pyx":1223 | |
22254 * | |
22255 * # skip empty lines | |
22256 * if b[0] == b'\0' or b[0] == b'\n' or b[0] == b'\r': # <<<<<<<<<<<<<< | |
22257 * continue | |
22258 * | |
22259 */ | |
22260 __pyx_t_5 = ((__pyx_v_b[0]) == '\x00'); | |
22261 if (!__pyx_t_5) { | |
22262 } else { | |
22263 __pyx_t_6 = __pyx_t_5; | |
22264 goto __pyx_L9_bool_binop_done; | |
22265 } | |
22266 __pyx_t_5 = ((__pyx_v_b[0]) == '\n'); | |
22267 if (!__pyx_t_5) { | |
22268 } else { | |
22269 __pyx_t_6 = __pyx_t_5; | |
22270 goto __pyx_L9_bool_binop_done; | |
22271 } | |
22272 __pyx_t_5 = ((__pyx_v_b[0]) == '\r'); | |
22273 __pyx_t_6 = __pyx_t_5; | |
22274 __pyx_L9_bool_binop_done:; | |
22275 if (__pyx_t_6) { | |
22276 | |
22277 /* "pysam/libctabix.pyx":1224 | |
22278 * # skip empty lines | |
22279 * if b[0] == b'\0' or b[0] == b'\n' or b[0] == b'\r': | |
22280 * continue # <<<<<<<<<<<<<< | |
22281 * | |
22282 * # make sure that entry is complete | |
22283 */ | |
22284 goto __pyx_L4_continue; | |
22285 | |
22286 /* "pysam/libctabix.pyx":1223 | |
22287 * | |
22288 * # skip empty lines | |
22289 * if b[0] == b'\0' or b[0] == b'\n' or b[0] == b'\r': # <<<<<<<<<<<<<< | |
22290 * continue | |
22291 * | |
22292 */ | |
22293 } | |
22294 | |
22295 /* "pysam/libctabix.pyx":1227 | |
22296 * | |
22297 * # make sure that entry is complete | |
22298 * if b[nbytes-1] != b'\n' and b[nbytes-1] != b'\r': # <<<<<<<<<<<<<< | |
22299 * raise ValueError("incomplete line at %s" % line) | |
22300 * | |
22301 */ | |
22302 __pyx_t_5 = ((__pyx_v_b[(__pyx_v_nbytes - 1)]) != '\n'); | |
22303 if (__pyx_t_5) { | |
22304 } else { | |
22305 __pyx_t_6 = __pyx_t_5; | |
22306 goto __pyx_L13_bool_binop_done; | |
22307 } | |
22308 __pyx_t_5 = ((__pyx_v_b[(__pyx_v_nbytes - 1)]) != '\r'); | |
22309 __pyx_t_6 = __pyx_t_5; | |
22310 __pyx_L13_bool_binop_done:; | |
22311 if (unlikely(__pyx_t_6)) { | |
22312 | |
22313 /* "pysam/libctabix.pyx":1228 | |
22314 * # make sure that entry is complete | |
22315 * if b[nbytes-1] != b'\n' and b[nbytes-1] != b'\r': | |
22316 * raise ValueError("incomplete line at %s" % line) # <<<<<<<<<<<<<< | |
22317 * | |
22318 * bytes_cpy = <bytes> b | |
22319 */ | |
22320 __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_incomplete_line_at_s, __pyx_v_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1228, __pyx_L1_error) | |
22321 __Pyx_GOTREF(__pyx_t_3); | |
22322 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L1_error) | |
22323 __Pyx_GOTREF(__pyx_t_2); | |
22324 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
22325 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
22326 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22327 __PYX_ERR(0, 1228, __pyx_L1_error) | |
22328 | |
22329 /* "pysam/libctabix.pyx":1227 | |
22330 * | |
22331 * # make sure that entry is complete | |
22332 * if b[nbytes-1] != b'\n' and b[nbytes-1] != b'\r': # <<<<<<<<<<<<<< | |
22333 * raise ValueError("incomplete line at %s" % line) | |
22334 * | |
22335 */ | |
22336 } | |
22337 | |
22338 /* "pysam/libctabix.pyx":1230 | |
22339 * raise ValueError("incomplete line at %s" % line) | |
22340 * | |
22341 * bytes_cpy = <bytes> b # <<<<<<<<<<<<<< | |
22342 * cpy = <char *> bytes_cpy | |
22343 * | |
22344 */ | |
22345 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1230, __pyx_L1_error) | |
22346 __Pyx_GOTREF(__pyx_t_2); | |
22347 __pyx_t_3 = __pyx_t_2; | |
22348 __Pyx_INCREF(__pyx_t_3); | |
22349 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22350 __pyx_v_bytes_cpy = ((PyObject*)__pyx_t_3); | |
22351 __pyx_t_3 = 0; | |
22352 | |
22353 /* "pysam/libctabix.pyx":1231 | |
22354 * | |
22355 * bytes_cpy = <bytes> b | |
22356 * cpy = <char *> bytes_cpy # <<<<<<<<<<<<<< | |
22357 * | |
22358 * return self.parser(cpy, nbytes) | |
22359 */ | |
22360 if (unlikely(__pyx_v_bytes_cpy == Py_None)) { | |
22361 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); | |
22362 __PYX_ERR(0, 1231, __pyx_L1_error) | |
22363 } | |
22364 __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_bytes_cpy); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 1231, __pyx_L1_error) | |
22365 __pyx_v_cpy = ((char *)__pyx_t_8); | |
22366 | |
22367 /* "pysam/libctabix.pyx":1233 | |
22368 * cpy = <char *> bytes_cpy | |
22369 * | |
22370 * return self.parser(cpy, nbytes) # <<<<<<<<<<<<<< | |
22371 * | |
22372 * raise StopIteration | |
22373 */ | |
22374 __Pyx_XDECREF(__pyx_r); | |
22375 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1233, __pyx_L1_error) | |
22376 __Pyx_GOTREF(__pyx_t_2); | |
22377 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_cpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L1_error) | |
22378 __Pyx_GOTREF(__pyx_t_1); | |
22379 __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1233, __pyx_L1_error) | |
22380 __Pyx_GOTREF(__pyx_t_10); | |
22381 __pyx_t_11 = NULL; | |
22382 __pyx_t_4 = 0; | |
22383 #if CYTHON_UNPACK_METHODS | |
22384 if (likely(PyMethod_Check(__pyx_t_2))) { | |
22385 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); | |
22386 if (likely(__pyx_t_11)) { | |
22387 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
22388 __Pyx_INCREF(__pyx_t_11); | |
22389 __Pyx_INCREF(function); | |
22390 __Pyx_DECREF_SET(__pyx_t_2, function); | |
22391 __pyx_t_4 = 1; | |
22392 } | |
22393 } | |
22394 #endif | |
22395 { | |
22396 PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_1, __pyx_t_10}; | |
22397 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
22398 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; | |
22399 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
22400 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; | |
22401 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1233, __pyx_L1_error) | |
22402 __Pyx_GOTREF(__pyx_t_3); | |
22403 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22404 } | |
22405 __pyx_r = __pyx_t_3; | |
22406 __pyx_t_3 = 0; | |
22407 goto __pyx_L0; | |
22408 __pyx_L4_continue:; | |
22409 } | |
22410 __pyx_L5_break:; | |
22411 | |
22412 /* "pysam/libctabix.pyx":1235 | |
22413 * return self.parser(cpy, nbytes) | |
22414 * | |
22415 * raise StopIteration # <<<<<<<<<<<<<< | |
22416 * | |
22417 * | |
22418 */ | |
22419 __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); | |
22420 __PYX_ERR(0, 1235, __pyx_L1_error) | |
22421 | |
22422 /* "pysam/libctabix.pyx":1194 | |
22423 * | |
22424 * # cython version - required for python 3 | |
22425 * def __next__(self): # <<<<<<<<<<<<<< | |
22426 * | |
22427 * cdef char * b | |
22428 */ | |
22429 | |
22430 /* function exit code */ | |
22431 __pyx_L1_error:; | |
22432 __Pyx_XDECREF(__pyx_t_1); | |
22433 __Pyx_XDECREF(__pyx_t_2); | |
22434 __Pyx_XDECREF(__pyx_t_3); | |
22435 __Pyx_XDECREF(__pyx_t_10); | |
22436 __Pyx_XDECREF(__pyx_t_11); | |
22437 __Pyx_AddTraceback("pysam.libctabix.tabix_generic_iterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
22438 __pyx_r = NULL; | |
22439 __pyx_L0:; | |
22440 __Pyx_XDECREF(__pyx_v_encoding); | |
22441 __Pyx_XDECREF(__pyx_v_line); | |
22442 __Pyx_XDECREF(__pyx_v_s); | |
22443 __Pyx_XDECREF(__pyx_v_bytes_cpy); | |
22444 __Pyx_XGIVEREF(__pyx_r); | |
22445 __Pyx_TraceReturn(__pyx_r, 0); | |
22446 __Pyx_RefNannyFinishContext(); | |
22447 return __pyx_r; | |
22448 } | |
22449 | |
22450 /* "pysam/libctabix.pyx":1238 | |
22451 * | |
22452 * | |
22453 * def tabix_iterator(infile, parser): # <<<<<<<<<<<<<< | |
22454 * """return an iterator over all entries in a file. | |
22455 * | |
22456 */ | |
22457 | |
22458 /* Python wrapper */ | |
22459 static PyObject *__pyx_pw_5pysam_9libctabix_5tabix_iterator(PyObject *__pyx_self, | |
22460 #if CYTHON_METH_FASTCALL | |
22461 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
22462 #else | |
22463 PyObject *__pyx_args, PyObject *__pyx_kwds | |
22464 #endif | |
22465 ); /*proto*/ | |
22466 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_4tabix_iterator, "tabix_iterator(infile, parser)\nreturn an iterator over all entries in a file.\n \n Results are returned parsed as specified by the *parser*. If\n *parser* is None, the results are returned as an unparsed string.\n Otherwise, *parser* is assumed to be a functor that will return\n parsed data (see for example :class:`~pysam.asTuple` and\n :class:`~pysam.asGTF`).\n\n "); | |
22467 static PyMethodDef __pyx_mdef_5pysam_9libctabix_5tabix_iterator = {"tabix_iterator", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_5tabix_iterator, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_4tabix_iterator}; | |
22468 static PyObject *__pyx_pw_5pysam_9libctabix_5tabix_iterator(PyObject *__pyx_self, | |
22469 #if CYTHON_METH_FASTCALL | |
22470 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
22471 #else | |
22472 PyObject *__pyx_args, PyObject *__pyx_kwds | |
22473 #endif | |
22474 ) { | |
22475 PyObject *__pyx_v_infile = 0; | |
22476 PyObject *__pyx_v_parser = 0; | |
22477 #if !CYTHON_METH_FASTCALL | |
22478 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
22479 #endif | |
22480 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
22481 PyObject* values[2] = {0,0}; | |
22482 int __pyx_lineno = 0; | |
22483 const char *__pyx_filename = NULL; | |
22484 int __pyx_clineno = 0; | |
22485 PyObject *__pyx_r = 0; | |
22486 __Pyx_RefNannyDeclarations | |
22487 __Pyx_RefNannySetupContext("tabix_iterator (wrapper)", 0); | |
22488 #if !CYTHON_METH_FASTCALL | |
22489 #if CYTHON_ASSUME_SAFE_MACROS | |
22490 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
22491 #else | |
22492 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
22493 #endif | |
22494 #endif | |
22495 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
22496 { | |
22497 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_infile,&__pyx_n_s_parser,0}; | |
22498 if (__pyx_kwds) { | |
22499 Py_ssize_t kw_args; | |
22500 switch (__pyx_nargs) { | |
22501 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
22502 CYTHON_FALLTHROUGH; | |
22503 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
22504 CYTHON_FALLTHROUGH; | |
22505 case 0: break; | |
22506 default: goto __pyx_L5_argtuple_error; | |
22507 } | |
22508 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
22509 switch (__pyx_nargs) { | |
22510 case 0: | |
22511 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_infile)) != 0)) { | |
22512 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
22513 kw_args--; | |
22514 } | |
22515 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1238, __pyx_L3_error) | |
22516 else goto __pyx_L5_argtuple_error; | |
22517 CYTHON_FALLTHROUGH; | |
22518 case 1: | |
22519 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_parser)) != 0)) { | |
22520 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
22521 kw_args--; | |
22522 } | |
22523 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1238, __pyx_L3_error) | |
22524 else { | |
22525 __Pyx_RaiseArgtupleInvalid("tabix_iterator", 1, 2, 2, 1); __PYX_ERR(0, 1238, __pyx_L3_error) | |
22526 } | |
22527 } | |
22528 if (unlikely(kw_args > 0)) { | |
22529 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
22530 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tabix_iterator") < 0)) __PYX_ERR(0, 1238, __pyx_L3_error) | |
22531 } | |
22532 } else if (unlikely(__pyx_nargs != 2)) { | |
22533 goto __pyx_L5_argtuple_error; | |
22534 } else { | |
22535 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
22536 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
22537 } | |
22538 __pyx_v_infile = values[0]; | |
22539 __pyx_v_parser = values[1]; | |
22540 } | |
22541 goto __pyx_L6_skip; | |
22542 __pyx_L5_argtuple_error:; | |
22543 __Pyx_RaiseArgtupleInvalid("tabix_iterator", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1238, __pyx_L3_error) | |
22544 __pyx_L6_skip:; | |
22545 goto __pyx_L4_argument_unpacking_done; | |
22546 __pyx_L3_error:; | |
22547 { | |
22548 Py_ssize_t __pyx_temp; | |
22549 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
22550 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
22551 } | |
22552 } | |
22553 __Pyx_AddTraceback("pysam.libctabix.tabix_iterator", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
22554 __Pyx_RefNannyFinishContext(); | |
22555 return NULL; | |
22556 __pyx_L4_argument_unpacking_done:; | |
22557 __pyx_r = __pyx_pf_5pysam_9libctabix_4tabix_iterator(__pyx_self, __pyx_v_infile, __pyx_v_parser); | |
22558 | |
22559 /* function exit code */ | |
22560 { | |
22561 Py_ssize_t __pyx_temp; | |
22562 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
22563 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
22564 } | |
22565 } | |
22566 __Pyx_RefNannyFinishContext(); | |
22567 return __pyx_r; | |
22568 } | |
22569 | |
22570 static PyObject *__pyx_pf_5pysam_9libctabix_4tabix_iterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_infile, PyObject *__pyx_v_parser) { | |
22571 PyObject *__pyx_r = NULL; | |
22572 __Pyx_TraceDeclarations | |
22573 __Pyx_RefNannyDeclarations | |
22574 PyObject *__pyx_t_1 = NULL; | |
22575 PyObject *__pyx_t_2 = NULL; | |
22576 PyObject *__pyx_t_3 = NULL; | |
22577 unsigned int __pyx_t_4; | |
22578 int __pyx_lineno = 0; | |
22579 const char *__pyx_filename = NULL; | |
22580 int __pyx_clineno = 0; | |
22581 __Pyx_TraceFrameInit(__pyx_codeobj__51) | |
22582 __Pyx_RefNannySetupContext("tabix_iterator", 1); | |
22583 __Pyx_TraceCall("tabix_iterator", __pyx_f[0], 1238, 0, __PYX_ERR(0, 1238, __pyx_L1_error)); | |
22584 | |
22585 /* "pysam/libctabix.pyx":1248 | |
22586 * | |
22587 * """ | |
22588 * return tabix_generic_iterator(infile, parser) # <<<<<<<<<<<<<< | |
22589 * | |
22590 * | |
22591 */ | |
22592 __Pyx_XDECREF(__pyx_r); | |
22593 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tabix_generic_iterator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1248, __pyx_L1_error) | |
22594 __Pyx_GOTREF(__pyx_t_2); | |
22595 __pyx_t_3 = NULL; | |
22596 __pyx_t_4 = 0; | |
22597 #if CYTHON_UNPACK_METHODS | |
22598 if (unlikely(PyMethod_Check(__pyx_t_2))) { | |
22599 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
22600 if (likely(__pyx_t_3)) { | |
22601 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
22602 __Pyx_INCREF(__pyx_t_3); | |
22603 __Pyx_INCREF(function); | |
22604 __Pyx_DECREF_SET(__pyx_t_2, function); | |
22605 __pyx_t_4 = 1; | |
22606 } | |
22607 } | |
22608 #endif | |
22609 { | |
22610 PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_infile, __pyx_v_parser}; | |
22611 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); | |
22612 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
22613 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error) | |
22614 __Pyx_GOTREF(__pyx_t_1); | |
22615 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
22616 } | |
22617 __pyx_r = __pyx_t_1; | |
22618 __pyx_t_1 = 0; | |
22619 goto __pyx_L0; | |
22620 | |
22621 /* "pysam/libctabix.pyx":1238 | |
22622 * | |
22623 * | |
22624 * def tabix_iterator(infile, parser): # <<<<<<<<<<<<<< | |
22625 * """return an iterator over all entries in a file. | |
22626 * | |
22627 */ | |
22628 | |
22629 /* function exit code */ | |
22630 __pyx_L1_error:; | |
22631 __Pyx_XDECREF(__pyx_t_1); | |
22632 __Pyx_XDECREF(__pyx_t_2); | |
22633 __Pyx_XDECREF(__pyx_t_3); | |
22634 __Pyx_AddTraceback("pysam.libctabix.tabix_iterator", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
22635 __pyx_r = NULL; | |
22636 __pyx_L0:; | |
22637 __Pyx_XGIVEREF(__pyx_r); | |
22638 __Pyx_TraceReturn(__pyx_r, 0); | |
22639 __Pyx_RefNannyFinishContext(); | |
22640 return __pyx_r; | |
22641 } | |
22642 | |
22643 /* "(tree fragment)":1 | |
22644 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
22645 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
22646 * def __setstate_cython__(self, __pyx_state): | |
22647 */ | |
22648 | |
22649 /* Python wrapper */ | |
22650 static PyObject *__pyx_pw_5pysam_9libctabix_9Tabixfile_1__reduce_cython__(PyObject *__pyx_v_self, | |
22651 #if CYTHON_METH_FASTCALL | |
22652 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
22653 #else | |
22654 PyObject *__pyx_args, PyObject *__pyx_kwds | |
22655 #endif | |
22656 ); /*proto*/ | |
22657 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_9Tabixfile___reduce_cython__, "Tabixfile.__reduce_cython__(self)"); | |
22658 static PyMethodDef __pyx_mdef_5pysam_9libctabix_9Tabixfile_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9Tabixfile_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_9Tabixfile___reduce_cython__}; | |
22659 static PyObject *__pyx_pw_5pysam_9libctabix_9Tabixfile_1__reduce_cython__(PyObject *__pyx_v_self, | |
22660 #if CYTHON_METH_FASTCALL | |
22661 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
22662 #else | |
22663 PyObject *__pyx_args, PyObject *__pyx_kwds | |
22664 #endif | |
22665 ) { | |
22666 #if !CYTHON_METH_FASTCALL | |
22667 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
22668 #endif | |
22669 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
22670 PyObject *__pyx_r = 0; | |
22671 __Pyx_RefNannyDeclarations | |
22672 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
22673 #if !CYTHON_METH_FASTCALL | |
22674 #if CYTHON_ASSUME_SAFE_MACROS | |
22675 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
22676 #else | |
22677 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
22678 #endif | |
22679 #endif | |
22680 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
22681 if (unlikely(__pyx_nargs > 0)) { | |
22682 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
22683 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
22684 __pyx_r = __pyx_pf_5pysam_9libctabix_9Tabixfile___reduce_cython__(((struct __pyx_obj_5pysam_9libctabix_Tabixfile *)__pyx_v_self)); | |
22685 | |
22686 /* function exit code */ | |
22687 __Pyx_RefNannyFinishContext(); | |
22688 return __pyx_r; | |
22689 } | |
22690 | |
22691 static PyObject *__pyx_pf_5pysam_9libctabix_9Tabixfile___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_Tabixfile *__pyx_v_self) { | |
22692 PyObject *__pyx_r = NULL; | |
22693 __Pyx_TraceDeclarations | |
22694 __Pyx_RefNannyDeclarations | |
22695 int __pyx_lineno = 0; | |
22696 const char *__pyx_filename = NULL; | |
22697 int __pyx_clineno = 0; | |
22698 __Pyx_TraceFrameInit(__pyx_codeobj__52) | |
22699 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
22700 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
22701 | |
22702 /* "(tree fragment)":2 | |
22703 * def __reduce_cython__(self): | |
22704 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< | |
22705 * def __setstate_cython__(self, __pyx_state): | |
22706 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
22707 */ | |
22708 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); | |
22709 __PYX_ERR(1, 2, __pyx_L1_error) | |
22710 | |
22711 /* "(tree fragment)":1 | |
22712 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
22713 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
22714 * def __setstate_cython__(self, __pyx_state): | |
22715 */ | |
22716 | |
22717 /* function exit code */ | |
22718 __pyx_L1_error:; | |
22719 __Pyx_AddTraceback("pysam.libctabix.Tabixfile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
22720 __pyx_r = NULL; | |
22721 __Pyx_XGIVEREF(__pyx_r); | |
22722 __Pyx_TraceReturn(__pyx_r, 0); | |
22723 __Pyx_RefNannyFinishContext(); | |
22724 return __pyx_r; | |
22725 } | |
22726 | |
22727 /* "(tree fragment)":3 | |
22728 * def __reduce_cython__(self): | |
22729 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
22730 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
22731 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
22732 */ | |
22733 | |
22734 /* Python wrapper */ | |
22735 static PyObject *__pyx_pw_5pysam_9libctabix_9Tabixfile_3__setstate_cython__(PyObject *__pyx_v_self, | |
22736 #if CYTHON_METH_FASTCALL | |
22737 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
22738 #else | |
22739 PyObject *__pyx_args, PyObject *__pyx_kwds | |
22740 #endif | |
22741 ); /*proto*/ | |
22742 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_9Tabixfile_2__setstate_cython__, "Tabixfile.__setstate_cython__(self, __pyx_state)"); | |
22743 static PyMethodDef __pyx_mdef_5pysam_9libctabix_9Tabixfile_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9Tabixfile_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_9Tabixfile_2__setstate_cython__}; | |
22744 static PyObject *__pyx_pw_5pysam_9libctabix_9Tabixfile_3__setstate_cython__(PyObject *__pyx_v_self, | |
22745 #if CYTHON_METH_FASTCALL | |
22746 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
22747 #else | |
22748 PyObject *__pyx_args, PyObject *__pyx_kwds | |
22749 #endif | |
22750 ) { | |
22751 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; | |
22752 #if !CYTHON_METH_FASTCALL | |
22753 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
22754 #endif | |
22755 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
22756 PyObject* values[1] = {0}; | |
22757 int __pyx_lineno = 0; | |
22758 const char *__pyx_filename = NULL; | |
22759 int __pyx_clineno = 0; | |
22760 PyObject *__pyx_r = 0; | |
22761 __Pyx_RefNannyDeclarations | |
22762 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
22763 #if !CYTHON_METH_FASTCALL | |
22764 #if CYTHON_ASSUME_SAFE_MACROS | |
22765 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
22766 #else | |
22767 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
22768 #endif | |
22769 #endif | |
22770 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
22771 { | |
22772 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
22773 if (__pyx_kwds) { | |
22774 Py_ssize_t kw_args; | |
22775 switch (__pyx_nargs) { | |
22776 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
22777 CYTHON_FALLTHROUGH; | |
22778 case 0: break; | |
22779 default: goto __pyx_L5_argtuple_error; | |
22780 } | |
22781 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
22782 switch (__pyx_nargs) { | |
22783 case 0: | |
22784 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
22785 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
22786 kw_args--; | |
22787 } | |
22788 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) | |
22789 else goto __pyx_L5_argtuple_error; | |
22790 } | |
22791 if (unlikely(kw_args > 0)) { | |
22792 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
22793 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error) | |
22794 } | |
22795 } else if (unlikely(__pyx_nargs != 1)) { | |
22796 goto __pyx_L5_argtuple_error; | |
22797 } else { | |
22798 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
22799 } | |
22800 __pyx_v___pyx_state = values[0]; | |
22801 } | |
22802 goto __pyx_L6_skip; | |
22803 __pyx_L5_argtuple_error:; | |
22804 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) | |
22805 __pyx_L6_skip:; | |
22806 goto __pyx_L4_argument_unpacking_done; | |
22807 __pyx_L3_error:; | |
22808 { | |
22809 Py_ssize_t __pyx_temp; | |
22810 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
22811 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
22812 } | |
22813 } | |
22814 __Pyx_AddTraceback("pysam.libctabix.Tabixfile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
22815 __Pyx_RefNannyFinishContext(); | |
22816 return NULL; | |
22817 __pyx_L4_argument_unpacking_done:; | |
22818 __pyx_r = __pyx_pf_5pysam_9libctabix_9Tabixfile_2__setstate_cython__(((struct __pyx_obj_5pysam_9libctabix_Tabixfile *)__pyx_v_self), __pyx_v___pyx_state); | |
22819 | |
22820 /* function exit code */ | |
22821 { | |
22822 Py_ssize_t __pyx_temp; | |
22823 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
22824 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
22825 } | |
22826 } | |
22827 __Pyx_RefNannyFinishContext(); | |
22828 return __pyx_r; | |
22829 } | |
22830 | |
22831 static PyObject *__pyx_pf_5pysam_9libctabix_9Tabixfile_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libctabix_Tabixfile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { | |
22832 PyObject *__pyx_r = NULL; | |
22833 __Pyx_TraceDeclarations | |
22834 __Pyx_RefNannyDeclarations | |
22835 int __pyx_lineno = 0; | |
22836 const char *__pyx_filename = NULL; | |
22837 int __pyx_clineno = 0; | |
22838 __Pyx_TraceFrameInit(__pyx_codeobj__53) | |
22839 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
22840 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); | |
22841 | |
22842 /* "(tree fragment)":4 | |
22843 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
22844 * def __setstate_cython__(self, __pyx_state): | |
22845 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< | |
22846 */ | |
22847 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); | |
22848 __PYX_ERR(1, 4, __pyx_L1_error) | |
22849 | |
22850 /* "(tree fragment)":3 | |
22851 * def __reduce_cython__(self): | |
22852 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
22853 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
22854 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
22855 */ | |
22856 | |
22857 /* function exit code */ | |
22858 __pyx_L1_error:; | |
22859 __Pyx_AddTraceback("pysam.libctabix.Tabixfile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
22860 __pyx_r = NULL; | |
22861 __Pyx_XGIVEREF(__pyx_r); | |
22862 __Pyx_TraceReturn(__pyx_r, 0); | |
22863 __Pyx_RefNannyFinishContext(); | |
22864 return __pyx_r; | |
22865 } | |
22866 | |
22867 /* "(tree fragment)":1 | |
22868 * def __pyx_unpickle_Parser(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
22869 * cdef object __pyx_PickleError | |
22870 * cdef object __pyx_result | |
22871 */ | |
22872 | |
22873 /* Python wrapper */ | |
22874 static PyObject *__pyx_pw_5pysam_9libctabix_7__pyx_unpickle_Parser(PyObject *__pyx_self, | |
22875 #if CYTHON_METH_FASTCALL | |
22876 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
22877 #else | |
22878 PyObject *__pyx_args, PyObject *__pyx_kwds | |
22879 #endif | |
22880 ); /*proto*/ | |
22881 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_6__pyx_unpickle_Parser, "__pyx_unpickle_Parser(__pyx_type, long __pyx_checksum, __pyx_state)"); | |
22882 static PyMethodDef __pyx_mdef_5pysam_9libctabix_7__pyx_unpickle_Parser = {"__pyx_unpickle_Parser", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_7__pyx_unpickle_Parser, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_6__pyx_unpickle_Parser}; | |
22883 static PyObject *__pyx_pw_5pysam_9libctabix_7__pyx_unpickle_Parser(PyObject *__pyx_self, | |
22884 #if CYTHON_METH_FASTCALL | |
22885 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
22886 #else | |
22887 PyObject *__pyx_args, PyObject *__pyx_kwds | |
22888 #endif | |
22889 ) { | |
22890 PyObject *__pyx_v___pyx_type = 0; | |
22891 long __pyx_v___pyx_checksum; | |
22892 PyObject *__pyx_v___pyx_state = 0; | |
22893 #if !CYTHON_METH_FASTCALL | |
22894 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
22895 #endif | |
22896 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
22897 PyObject* values[3] = {0,0,0}; | |
22898 int __pyx_lineno = 0; | |
22899 const char *__pyx_filename = NULL; | |
22900 int __pyx_clineno = 0; | |
22901 PyObject *__pyx_r = 0; | |
22902 __Pyx_RefNannyDeclarations | |
22903 __Pyx_RefNannySetupContext("__pyx_unpickle_Parser (wrapper)", 0); | |
22904 #if !CYTHON_METH_FASTCALL | |
22905 #if CYTHON_ASSUME_SAFE_MACROS | |
22906 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
22907 #else | |
22908 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
22909 #endif | |
22910 #endif | |
22911 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
22912 { | |
22913 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; | |
22914 if (__pyx_kwds) { | |
22915 Py_ssize_t kw_args; | |
22916 switch (__pyx_nargs) { | |
22917 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
22918 CYTHON_FALLTHROUGH; | |
22919 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
22920 CYTHON_FALLTHROUGH; | |
22921 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
22922 CYTHON_FALLTHROUGH; | |
22923 case 0: break; | |
22924 default: goto __pyx_L5_argtuple_error; | |
22925 } | |
22926 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
22927 switch (__pyx_nargs) { | |
22928 case 0: | |
22929 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { | |
22930 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
22931 kw_args--; | |
22932 } | |
22933 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
22934 else goto __pyx_L5_argtuple_error; | |
22935 CYTHON_FALLTHROUGH; | |
22936 case 1: | |
22937 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { | |
22938 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
22939 kw_args--; | |
22940 } | |
22941 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
22942 else { | |
22943 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Parser", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) | |
22944 } | |
22945 CYTHON_FALLTHROUGH; | |
22946 case 2: | |
22947 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
22948 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
22949 kw_args--; | |
22950 } | |
22951 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
22952 else { | |
22953 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Parser", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) | |
22954 } | |
22955 } | |
22956 if (unlikely(kw_args > 0)) { | |
22957 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
22958 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_Parser") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) | |
22959 } | |
22960 } else if (unlikely(__pyx_nargs != 3)) { | |
22961 goto __pyx_L5_argtuple_error; | |
22962 } else { | |
22963 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
22964 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
22965 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
22966 } | |
22967 __pyx_v___pyx_type = values[0]; | |
22968 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
22969 __pyx_v___pyx_state = values[2]; | |
22970 } | |
22971 goto __pyx_L6_skip; | |
22972 __pyx_L5_argtuple_error:; | |
22973 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Parser", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) | |
22974 __pyx_L6_skip:; | |
22975 goto __pyx_L4_argument_unpacking_done; | |
22976 __pyx_L3_error:; | |
22977 { | |
22978 Py_ssize_t __pyx_temp; | |
22979 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
22980 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
22981 } | |
22982 } | |
22983 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_Parser", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
22984 __Pyx_RefNannyFinishContext(); | |
22985 return NULL; | |
22986 __pyx_L4_argument_unpacking_done:; | |
22987 __pyx_r = __pyx_pf_5pysam_9libctabix_6__pyx_unpickle_Parser(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); | |
22988 | |
22989 /* function exit code */ | |
22990 { | |
22991 Py_ssize_t __pyx_temp; | |
22992 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
22993 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
22994 } | |
22995 } | |
22996 __Pyx_RefNannyFinishContext(); | |
22997 return __pyx_r; | |
22998 } | |
22999 | |
23000 static PyObject *__pyx_pf_5pysam_9libctabix_6__pyx_unpickle_Parser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { | |
23001 PyObject *__pyx_v___pyx_PickleError = 0; | |
23002 PyObject *__pyx_v___pyx_result = 0; | |
23003 PyObject *__pyx_r = NULL; | |
23004 __Pyx_TraceDeclarations | |
23005 __Pyx_RefNannyDeclarations | |
23006 PyObject *__pyx_t_1 = NULL; | |
23007 int __pyx_t_2; | |
23008 PyObject *__pyx_t_3 = NULL; | |
23009 PyObject *__pyx_t_4 = NULL; | |
23010 unsigned int __pyx_t_5; | |
23011 int __pyx_lineno = 0; | |
23012 const char *__pyx_filename = NULL; | |
23013 int __pyx_clineno = 0; | |
23014 __Pyx_TraceFrameInit(__pyx_codeobj__54) | |
23015 __Pyx_RefNannySetupContext("__pyx_unpickle_Parser", 1); | |
23016 __Pyx_TraceCall("__pyx_unpickle_Parser", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
23017 | |
23018 /* "(tree fragment)":4 | |
23019 * cdef object __pyx_PickleError | |
23020 * cdef object __pyx_result | |
23021 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): # <<<<<<<<<<<<<< | |
23022 * from pickle import PickleError as __pyx_PickleError | |
23023 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
23024 */ | |
23025 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) | |
23026 __Pyx_GOTREF(__pyx_t_1); | |
23027 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__55, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error) | |
23028 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23029 if (__pyx_t_2) { | |
23030 | |
23031 /* "(tree fragment)":5 | |
23032 * cdef object __pyx_result | |
23033 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): | |
23034 * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< | |
23035 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
23036 * __pyx_result = Parser.__new__(__pyx_type) | |
23037 */ | |
23038 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
23039 __Pyx_GOTREF(__pyx_t_1); | |
23040 __Pyx_INCREF(__pyx_n_s_PickleError); | |
23041 __Pyx_GIVEREF(__pyx_n_s_PickleError); | |
23042 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error); | |
23043 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) | |
23044 __Pyx_GOTREF(__pyx_t_3); | |
23045 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23046 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
23047 __Pyx_GOTREF(__pyx_t_1); | |
23048 __Pyx_INCREF(__pyx_t_1); | |
23049 __pyx_v___pyx_PickleError = __pyx_t_1; | |
23050 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23051 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23052 | |
23053 /* "(tree fragment)":6 | |
23054 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): | |
23055 * from pickle import PickleError as __pyx_PickleError | |
23056 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum # <<<<<<<<<<<<<< | |
23057 * __pyx_result = Parser.__new__(__pyx_type) | |
23058 * if __pyx_state is not None: | |
23059 */ | |
23060 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) | |
23061 __Pyx_GOTREF(__pyx_t_3); | |
23062 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) | |
23063 __Pyx_GOTREF(__pyx_t_1); | |
23064 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23065 __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); | |
23066 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23067 __PYX_ERR(1, 6, __pyx_L1_error) | |
23068 | |
23069 /* "(tree fragment)":4 | |
23070 * cdef object __pyx_PickleError | |
23071 * cdef object __pyx_result | |
23072 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): # <<<<<<<<<<<<<< | |
23073 * from pickle import PickleError as __pyx_PickleError | |
23074 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
23075 */ | |
23076 } | |
23077 | |
23078 /* "(tree fragment)":7 | |
23079 * from pickle import PickleError as __pyx_PickleError | |
23080 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
23081 * __pyx_result = Parser.__new__(__pyx_type) # <<<<<<<<<<<<<< | |
23082 * if __pyx_state is not None: | |
23083 * __pyx_unpickle_Parser__set_state(<Parser> __pyx_result, __pyx_state) | |
23084 */ | |
23085 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5pysam_9libctabix_Parser), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) | |
23086 __Pyx_GOTREF(__pyx_t_3); | |
23087 __pyx_t_4 = NULL; | |
23088 __pyx_t_5 = 0; | |
23089 #if CYTHON_UNPACK_METHODS | |
23090 if (likely(PyMethod_Check(__pyx_t_3))) { | |
23091 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
23092 if (likely(__pyx_t_4)) { | |
23093 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
23094 __Pyx_INCREF(__pyx_t_4); | |
23095 __Pyx_INCREF(function); | |
23096 __Pyx_DECREF_SET(__pyx_t_3, function); | |
23097 __pyx_t_5 = 1; | |
23098 } | |
23099 } | |
23100 #endif | |
23101 { | |
23102 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; | |
23103 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
23104 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
23105 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) | |
23106 __Pyx_GOTREF(__pyx_t_1); | |
23107 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23108 } | |
23109 __pyx_v___pyx_result = __pyx_t_1; | |
23110 __pyx_t_1 = 0; | |
23111 | |
23112 /* "(tree fragment)":8 | |
23113 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
23114 * __pyx_result = Parser.__new__(__pyx_type) | |
23115 * if __pyx_state is not None: # <<<<<<<<<<<<<< | |
23116 * __pyx_unpickle_Parser__set_state(<Parser> __pyx_result, __pyx_state) | |
23117 * return __pyx_result | |
23118 */ | |
23119 __pyx_t_2 = (__pyx_v___pyx_state != Py_None); | |
23120 if (__pyx_t_2) { | |
23121 | |
23122 /* "(tree fragment)":9 | |
23123 * __pyx_result = Parser.__new__(__pyx_type) | |
23124 * if __pyx_state is not None: | |
23125 * __pyx_unpickle_Parser__set_state(<Parser> __pyx_result, __pyx_state) # <<<<<<<<<<<<<< | |
23126 * return __pyx_result | |
23127 * cdef __pyx_unpickle_Parser__set_state(Parser __pyx_result, tuple __pyx_state): | |
23128 */ | |
23129 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error) | |
23130 __pyx_t_1 = __pyx_f_5pysam_9libctabix___pyx_unpickle_Parser__set_state(((struct __pyx_obj_5pysam_9libctabix_Parser *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) | |
23131 __Pyx_GOTREF(__pyx_t_1); | |
23132 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23133 | |
23134 /* "(tree fragment)":8 | |
23135 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
23136 * __pyx_result = Parser.__new__(__pyx_type) | |
23137 * if __pyx_state is not None: # <<<<<<<<<<<<<< | |
23138 * __pyx_unpickle_Parser__set_state(<Parser> __pyx_result, __pyx_state) | |
23139 * return __pyx_result | |
23140 */ | |
23141 } | |
23142 | |
23143 /* "(tree fragment)":10 | |
23144 * if __pyx_state is not None: | |
23145 * __pyx_unpickle_Parser__set_state(<Parser> __pyx_result, __pyx_state) | |
23146 * return __pyx_result # <<<<<<<<<<<<<< | |
23147 * cdef __pyx_unpickle_Parser__set_state(Parser __pyx_result, tuple __pyx_state): | |
23148 * __pyx_result.encoding = __pyx_state[0] | |
23149 */ | |
23150 __Pyx_XDECREF(__pyx_r); | |
23151 __Pyx_INCREF(__pyx_v___pyx_result); | |
23152 __pyx_r = __pyx_v___pyx_result; | |
23153 goto __pyx_L0; | |
23154 | |
23155 /* "(tree fragment)":1 | |
23156 * def __pyx_unpickle_Parser(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
23157 * cdef object __pyx_PickleError | |
23158 * cdef object __pyx_result | |
23159 */ | |
23160 | |
23161 /* function exit code */ | |
23162 __pyx_L1_error:; | |
23163 __Pyx_XDECREF(__pyx_t_1); | |
23164 __Pyx_XDECREF(__pyx_t_3); | |
23165 __Pyx_XDECREF(__pyx_t_4); | |
23166 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_Parser", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
23167 __pyx_r = NULL; | |
23168 __pyx_L0:; | |
23169 __Pyx_XDECREF(__pyx_v___pyx_PickleError); | |
23170 __Pyx_XDECREF(__pyx_v___pyx_result); | |
23171 __Pyx_XGIVEREF(__pyx_r); | |
23172 __Pyx_TraceReturn(__pyx_r, 0); | |
23173 __Pyx_RefNannyFinishContext(); | |
23174 return __pyx_r; | |
23175 } | |
23176 | |
23177 /* "(tree fragment)":11 | |
23178 * __pyx_unpickle_Parser__set_state(<Parser> __pyx_result, __pyx_state) | |
23179 * return __pyx_result | |
23180 * cdef __pyx_unpickle_Parser__set_state(Parser __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
23181 * __pyx_result.encoding = __pyx_state[0] | |
23182 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
23183 */ | |
23184 | |
23185 static PyObject *__pyx_f_5pysam_9libctabix___pyx_unpickle_Parser__set_state(struct __pyx_obj_5pysam_9libctabix_Parser *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { | |
23186 PyObject *__pyx_r = NULL; | |
23187 __Pyx_TraceDeclarations | |
23188 __Pyx_RefNannyDeclarations | |
23189 PyObject *__pyx_t_1 = NULL; | |
23190 int __pyx_t_2; | |
23191 Py_ssize_t __pyx_t_3; | |
23192 int __pyx_t_4; | |
23193 PyObject *__pyx_t_5 = NULL; | |
23194 PyObject *__pyx_t_6 = NULL; | |
23195 PyObject *__pyx_t_7 = NULL; | |
23196 unsigned int __pyx_t_8; | |
23197 int __pyx_lineno = 0; | |
23198 const char *__pyx_filename = NULL; | |
23199 int __pyx_clineno = 0; | |
23200 __Pyx_RefNannySetupContext("__pyx_unpickle_Parser__set_state", 1); | |
23201 __Pyx_TraceCall("__pyx_unpickle_Parser__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error)); | |
23202 | |
23203 /* "(tree fragment)":12 | |
23204 * return __pyx_result | |
23205 * cdef __pyx_unpickle_Parser__set_state(Parser __pyx_result, tuple __pyx_state): | |
23206 * __pyx_result.encoding = __pyx_state[0] # <<<<<<<<<<<<<< | |
23207 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
23208 * __pyx_result.__dict__.update(__pyx_state[1]) | |
23209 */ | |
23210 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
23211 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
23212 __PYX_ERR(1, 12, __pyx_L1_error) | |
23213 } | |
23214 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) | |
23215 __Pyx_GOTREF(__pyx_t_1); | |
23216 __Pyx_GIVEREF(__pyx_t_1); | |
23217 __Pyx_GOTREF(__pyx_v___pyx_result->encoding); | |
23218 __Pyx_DECREF(__pyx_v___pyx_result->encoding); | |
23219 __pyx_v___pyx_result->encoding = __pyx_t_1; | |
23220 __pyx_t_1 = 0; | |
23221 | |
23222 /* "(tree fragment)":13 | |
23223 * cdef __pyx_unpickle_Parser__set_state(Parser __pyx_result, tuple __pyx_state): | |
23224 * __pyx_result.encoding = __pyx_state[0] | |
23225 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< | |
23226 * __pyx_result.__dict__.update(__pyx_state[1]) | |
23227 */ | |
23228 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
23229 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); | |
23230 __PYX_ERR(1, 13, __pyx_L1_error) | |
23231 } | |
23232 __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) | |
23233 __pyx_t_4 = (__pyx_t_3 > 1); | |
23234 if (__pyx_t_4) { | |
23235 } else { | |
23236 __pyx_t_2 = __pyx_t_4; | |
23237 goto __pyx_L4_bool_binop_done; | |
23238 } | |
23239 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) | |
23240 __pyx_t_2 = __pyx_t_4; | |
23241 __pyx_L4_bool_binop_done:; | |
23242 if (__pyx_t_2) { | |
23243 | |
23244 /* "(tree fragment)":14 | |
23245 * __pyx_result.encoding = __pyx_state[0] | |
23246 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
23247 * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< | |
23248 */ | |
23249 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) | |
23250 __Pyx_GOTREF(__pyx_t_5); | |
23251 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) | |
23252 __Pyx_GOTREF(__pyx_t_6); | |
23253 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
23254 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
23255 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
23256 __PYX_ERR(1, 14, __pyx_L1_error) | |
23257 } | |
23258 __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) | |
23259 __Pyx_GOTREF(__pyx_t_5); | |
23260 __pyx_t_7 = NULL; | |
23261 __pyx_t_8 = 0; | |
23262 #if CYTHON_UNPACK_METHODS | |
23263 if (likely(PyMethod_Check(__pyx_t_6))) { | |
23264 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); | |
23265 if (likely(__pyx_t_7)) { | |
23266 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
23267 __Pyx_INCREF(__pyx_t_7); | |
23268 __Pyx_INCREF(function); | |
23269 __Pyx_DECREF_SET(__pyx_t_6, function); | |
23270 __pyx_t_8 = 1; | |
23271 } | |
23272 } | |
23273 #endif | |
23274 { | |
23275 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; | |
23276 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
23277 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
23278 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
23279 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) | |
23280 __Pyx_GOTREF(__pyx_t_1); | |
23281 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
23282 } | |
23283 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23284 | |
23285 /* "(tree fragment)":13 | |
23286 * cdef __pyx_unpickle_Parser__set_state(Parser __pyx_result, tuple __pyx_state): | |
23287 * __pyx_result.encoding = __pyx_state[0] | |
23288 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< | |
23289 * __pyx_result.__dict__.update(__pyx_state[1]) | |
23290 */ | |
23291 } | |
23292 | |
23293 /* "(tree fragment)":11 | |
23294 * __pyx_unpickle_Parser__set_state(<Parser> __pyx_result, __pyx_state) | |
23295 * return __pyx_result | |
23296 * cdef __pyx_unpickle_Parser__set_state(Parser __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
23297 * __pyx_result.encoding = __pyx_state[0] | |
23298 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
23299 */ | |
23300 | |
23301 /* function exit code */ | |
23302 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
23303 goto __pyx_L0; | |
23304 __pyx_L1_error:; | |
23305 __Pyx_XDECREF(__pyx_t_1); | |
23306 __Pyx_XDECREF(__pyx_t_5); | |
23307 __Pyx_XDECREF(__pyx_t_6); | |
23308 __Pyx_XDECREF(__pyx_t_7); | |
23309 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_Parser__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
23310 __pyx_r = 0; | |
23311 __pyx_L0:; | |
23312 __Pyx_XGIVEREF(__pyx_r); | |
23313 __Pyx_TraceReturn(__pyx_r, 0); | |
23314 __Pyx_RefNannyFinishContext(); | |
23315 return __pyx_r; | |
23316 } | |
23317 | |
23318 /* "(tree fragment)":1 | |
23319 * def __pyx_unpickle_asTuple(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
23320 * cdef object __pyx_PickleError | |
23321 * cdef object __pyx_result | |
23322 */ | |
23323 | |
23324 /* Python wrapper */ | |
23325 static PyObject *__pyx_pw_5pysam_9libctabix_9__pyx_unpickle_asTuple(PyObject *__pyx_self, | |
23326 #if CYTHON_METH_FASTCALL | |
23327 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
23328 #else | |
23329 PyObject *__pyx_args, PyObject *__pyx_kwds | |
23330 #endif | |
23331 ); /*proto*/ | |
23332 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_8__pyx_unpickle_asTuple, "__pyx_unpickle_asTuple(__pyx_type, long __pyx_checksum, __pyx_state)"); | |
23333 static PyMethodDef __pyx_mdef_5pysam_9libctabix_9__pyx_unpickle_asTuple = {"__pyx_unpickle_asTuple", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9__pyx_unpickle_asTuple, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_8__pyx_unpickle_asTuple}; | |
23334 static PyObject *__pyx_pw_5pysam_9libctabix_9__pyx_unpickle_asTuple(PyObject *__pyx_self, | |
23335 #if CYTHON_METH_FASTCALL | |
23336 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
23337 #else | |
23338 PyObject *__pyx_args, PyObject *__pyx_kwds | |
23339 #endif | |
23340 ) { | |
23341 PyObject *__pyx_v___pyx_type = 0; | |
23342 long __pyx_v___pyx_checksum; | |
23343 PyObject *__pyx_v___pyx_state = 0; | |
23344 #if !CYTHON_METH_FASTCALL | |
23345 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
23346 #endif | |
23347 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
23348 PyObject* values[3] = {0,0,0}; | |
23349 int __pyx_lineno = 0; | |
23350 const char *__pyx_filename = NULL; | |
23351 int __pyx_clineno = 0; | |
23352 PyObject *__pyx_r = 0; | |
23353 __Pyx_RefNannyDeclarations | |
23354 __Pyx_RefNannySetupContext("__pyx_unpickle_asTuple (wrapper)", 0); | |
23355 #if !CYTHON_METH_FASTCALL | |
23356 #if CYTHON_ASSUME_SAFE_MACROS | |
23357 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
23358 #else | |
23359 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
23360 #endif | |
23361 #endif | |
23362 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
23363 { | |
23364 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; | |
23365 if (__pyx_kwds) { | |
23366 Py_ssize_t kw_args; | |
23367 switch (__pyx_nargs) { | |
23368 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
23369 CYTHON_FALLTHROUGH; | |
23370 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
23371 CYTHON_FALLTHROUGH; | |
23372 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
23373 CYTHON_FALLTHROUGH; | |
23374 case 0: break; | |
23375 default: goto __pyx_L5_argtuple_error; | |
23376 } | |
23377 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
23378 switch (__pyx_nargs) { | |
23379 case 0: | |
23380 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { | |
23381 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
23382 kw_args--; | |
23383 } | |
23384 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
23385 else goto __pyx_L5_argtuple_error; | |
23386 CYTHON_FALLTHROUGH; | |
23387 case 1: | |
23388 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { | |
23389 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
23390 kw_args--; | |
23391 } | |
23392 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
23393 else { | |
23394 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asTuple", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) | |
23395 } | |
23396 CYTHON_FALLTHROUGH; | |
23397 case 2: | |
23398 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
23399 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
23400 kw_args--; | |
23401 } | |
23402 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
23403 else { | |
23404 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asTuple", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) | |
23405 } | |
23406 } | |
23407 if (unlikely(kw_args > 0)) { | |
23408 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
23409 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_asTuple") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) | |
23410 } | |
23411 } else if (unlikely(__pyx_nargs != 3)) { | |
23412 goto __pyx_L5_argtuple_error; | |
23413 } else { | |
23414 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
23415 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
23416 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
23417 } | |
23418 __pyx_v___pyx_type = values[0]; | |
23419 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
23420 __pyx_v___pyx_state = values[2]; | |
23421 } | |
23422 goto __pyx_L6_skip; | |
23423 __pyx_L5_argtuple_error:; | |
23424 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asTuple", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) | |
23425 __pyx_L6_skip:; | |
23426 goto __pyx_L4_argument_unpacking_done; | |
23427 __pyx_L3_error:; | |
23428 { | |
23429 Py_ssize_t __pyx_temp; | |
23430 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
23431 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
23432 } | |
23433 } | |
23434 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_asTuple", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
23435 __Pyx_RefNannyFinishContext(); | |
23436 return NULL; | |
23437 __pyx_L4_argument_unpacking_done:; | |
23438 __pyx_r = __pyx_pf_5pysam_9libctabix_8__pyx_unpickle_asTuple(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); | |
23439 | |
23440 /* function exit code */ | |
23441 { | |
23442 Py_ssize_t __pyx_temp; | |
23443 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
23444 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
23445 } | |
23446 } | |
23447 __Pyx_RefNannyFinishContext(); | |
23448 return __pyx_r; | |
23449 } | |
23450 | |
23451 static PyObject *__pyx_pf_5pysam_9libctabix_8__pyx_unpickle_asTuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { | |
23452 PyObject *__pyx_v___pyx_PickleError = 0; | |
23453 PyObject *__pyx_v___pyx_result = 0; | |
23454 PyObject *__pyx_r = NULL; | |
23455 __Pyx_TraceDeclarations | |
23456 __Pyx_RefNannyDeclarations | |
23457 PyObject *__pyx_t_1 = NULL; | |
23458 int __pyx_t_2; | |
23459 PyObject *__pyx_t_3 = NULL; | |
23460 PyObject *__pyx_t_4 = NULL; | |
23461 unsigned int __pyx_t_5; | |
23462 int __pyx_lineno = 0; | |
23463 const char *__pyx_filename = NULL; | |
23464 int __pyx_clineno = 0; | |
23465 __Pyx_TraceFrameInit(__pyx_codeobj__57) | |
23466 __Pyx_RefNannySetupContext("__pyx_unpickle_asTuple", 1); | |
23467 __Pyx_TraceCall("__pyx_unpickle_asTuple", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
23468 | |
23469 /* "(tree fragment)":4 | |
23470 * cdef object __pyx_PickleError | |
23471 * cdef object __pyx_result | |
23472 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): # <<<<<<<<<<<<<< | |
23473 * from pickle import PickleError as __pyx_PickleError | |
23474 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
23475 */ | |
23476 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) | |
23477 __Pyx_GOTREF(__pyx_t_1); | |
23478 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__55, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error) | |
23479 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23480 if (__pyx_t_2) { | |
23481 | |
23482 /* "(tree fragment)":5 | |
23483 * cdef object __pyx_result | |
23484 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): | |
23485 * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< | |
23486 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
23487 * __pyx_result = asTuple.__new__(__pyx_type) | |
23488 */ | |
23489 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
23490 __Pyx_GOTREF(__pyx_t_1); | |
23491 __Pyx_INCREF(__pyx_n_s_PickleError); | |
23492 __Pyx_GIVEREF(__pyx_n_s_PickleError); | |
23493 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error); | |
23494 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) | |
23495 __Pyx_GOTREF(__pyx_t_3); | |
23496 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23497 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
23498 __Pyx_GOTREF(__pyx_t_1); | |
23499 __Pyx_INCREF(__pyx_t_1); | |
23500 __pyx_v___pyx_PickleError = __pyx_t_1; | |
23501 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23502 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23503 | |
23504 /* "(tree fragment)":6 | |
23505 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): | |
23506 * from pickle import PickleError as __pyx_PickleError | |
23507 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum # <<<<<<<<<<<<<< | |
23508 * __pyx_result = asTuple.__new__(__pyx_type) | |
23509 * if __pyx_state is not None: | |
23510 */ | |
23511 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) | |
23512 __Pyx_GOTREF(__pyx_t_3); | |
23513 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) | |
23514 __Pyx_GOTREF(__pyx_t_1); | |
23515 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23516 __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); | |
23517 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23518 __PYX_ERR(1, 6, __pyx_L1_error) | |
23519 | |
23520 /* "(tree fragment)":4 | |
23521 * cdef object __pyx_PickleError | |
23522 * cdef object __pyx_result | |
23523 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): # <<<<<<<<<<<<<< | |
23524 * from pickle import PickleError as __pyx_PickleError | |
23525 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
23526 */ | |
23527 } | |
23528 | |
23529 /* "(tree fragment)":7 | |
23530 * from pickle import PickleError as __pyx_PickleError | |
23531 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
23532 * __pyx_result = asTuple.__new__(__pyx_type) # <<<<<<<<<<<<<< | |
23533 * if __pyx_state is not None: | |
23534 * __pyx_unpickle_asTuple__set_state(<asTuple> __pyx_result, __pyx_state) | |
23535 */ | |
23536 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5pysam_9libctabix_asTuple), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) | |
23537 __Pyx_GOTREF(__pyx_t_3); | |
23538 __pyx_t_4 = NULL; | |
23539 __pyx_t_5 = 0; | |
23540 #if CYTHON_UNPACK_METHODS | |
23541 if (likely(PyMethod_Check(__pyx_t_3))) { | |
23542 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
23543 if (likely(__pyx_t_4)) { | |
23544 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
23545 __Pyx_INCREF(__pyx_t_4); | |
23546 __Pyx_INCREF(function); | |
23547 __Pyx_DECREF_SET(__pyx_t_3, function); | |
23548 __pyx_t_5 = 1; | |
23549 } | |
23550 } | |
23551 #endif | |
23552 { | |
23553 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; | |
23554 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
23555 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
23556 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) | |
23557 __Pyx_GOTREF(__pyx_t_1); | |
23558 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23559 } | |
23560 __pyx_v___pyx_result = __pyx_t_1; | |
23561 __pyx_t_1 = 0; | |
23562 | |
23563 /* "(tree fragment)":8 | |
23564 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
23565 * __pyx_result = asTuple.__new__(__pyx_type) | |
23566 * if __pyx_state is not None: # <<<<<<<<<<<<<< | |
23567 * __pyx_unpickle_asTuple__set_state(<asTuple> __pyx_result, __pyx_state) | |
23568 * return __pyx_result | |
23569 */ | |
23570 __pyx_t_2 = (__pyx_v___pyx_state != Py_None); | |
23571 if (__pyx_t_2) { | |
23572 | |
23573 /* "(tree fragment)":9 | |
23574 * __pyx_result = asTuple.__new__(__pyx_type) | |
23575 * if __pyx_state is not None: | |
23576 * __pyx_unpickle_asTuple__set_state(<asTuple> __pyx_result, __pyx_state) # <<<<<<<<<<<<<< | |
23577 * return __pyx_result | |
23578 * cdef __pyx_unpickle_asTuple__set_state(asTuple __pyx_result, tuple __pyx_state): | |
23579 */ | |
23580 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error) | |
23581 __pyx_t_1 = __pyx_f_5pysam_9libctabix___pyx_unpickle_asTuple__set_state(((struct __pyx_obj_5pysam_9libctabix_asTuple *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) | |
23582 __Pyx_GOTREF(__pyx_t_1); | |
23583 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23584 | |
23585 /* "(tree fragment)":8 | |
23586 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
23587 * __pyx_result = asTuple.__new__(__pyx_type) | |
23588 * if __pyx_state is not None: # <<<<<<<<<<<<<< | |
23589 * __pyx_unpickle_asTuple__set_state(<asTuple> __pyx_result, __pyx_state) | |
23590 * return __pyx_result | |
23591 */ | |
23592 } | |
23593 | |
23594 /* "(tree fragment)":10 | |
23595 * if __pyx_state is not None: | |
23596 * __pyx_unpickle_asTuple__set_state(<asTuple> __pyx_result, __pyx_state) | |
23597 * return __pyx_result # <<<<<<<<<<<<<< | |
23598 * cdef __pyx_unpickle_asTuple__set_state(asTuple __pyx_result, tuple __pyx_state): | |
23599 * __pyx_result.encoding = __pyx_state[0] | |
23600 */ | |
23601 __Pyx_XDECREF(__pyx_r); | |
23602 __Pyx_INCREF(__pyx_v___pyx_result); | |
23603 __pyx_r = __pyx_v___pyx_result; | |
23604 goto __pyx_L0; | |
23605 | |
23606 /* "(tree fragment)":1 | |
23607 * def __pyx_unpickle_asTuple(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
23608 * cdef object __pyx_PickleError | |
23609 * cdef object __pyx_result | |
23610 */ | |
23611 | |
23612 /* function exit code */ | |
23613 __pyx_L1_error:; | |
23614 __Pyx_XDECREF(__pyx_t_1); | |
23615 __Pyx_XDECREF(__pyx_t_3); | |
23616 __Pyx_XDECREF(__pyx_t_4); | |
23617 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_asTuple", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
23618 __pyx_r = NULL; | |
23619 __pyx_L0:; | |
23620 __Pyx_XDECREF(__pyx_v___pyx_PickleError); | |
23621 __Pyx_XDECREF(__pyx_v___pyx_result); | |
23622 __Pyx_XGIVEREF(__pyx_r); | |
23623 __Pyx_TraceReturn(__pyx_r, 0); | |
23624 __Pyx_RefNannyFinishContext(); | |
23625 return __pyx_r; | |
23626 } | |
23627 | |
23628 /* "(tree fragment)":11 | |
23629 * __pyx_unpickle_asTuple__set_state(<asTuple> __pyx_result, __pyx_state) | |
23630 * return __pyx_result | |
23631 * cdef __pyx_unpickle_asTuple__set_state(asTuple __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
23632 * __pyx_result.encoding = __pyx_state[0] | |
23633 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
23634 */ | |
23635 | |
23636 static PyObject *__pyx_f_5pysam_9libctabix___pyx_unpickle_asTuple__set_state(struct __pyx_obj_5pysam_9libctabix_asTuple *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { | |
23637 PyObject *__pyx_r = NULL; | |
23638 __Pyx_TraceDeclarations | |
23639 __Pyx_RefNannyDeclarations | |
23640 PyObject *__pyx_t_1 = NULL; | |
23641 int __pyx_t_2; | |
23642 Py_ssize_t __pyx_t_3; | |
23643 int __pyx_t_4; | |
23644 PyObject *__pyx_t_5 = NULL; | |
23645 PyObject *__pyx_t_6 = NULL; | |
23646 PyObject *__pyx_t_7 = NULL; | |
23647 unsigned int __pyx_t_8; | |
23648 int __pyx_lineno = 0; | |
23649 const char *__pyx_filename = NULL; | |
23650 int __pyx_clineno = 0; | |
23651 __Pyx_RefNannySetupContext("__pyx_unpickle_asTuple__set_state", 1); | |
23652 __Pyx_TraceCall("__pyx_unpickle_asTuple__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error)); | |
23653 | |
23654 /* "(tree fragment)":12 | |
23655 * return __pyx_result | |
23656 * cdef __pyx_unpickle_asTuple__set_state(asTuple __pyx_result, tuple __pyx_state): | |
23657 * __pyx_result.encoding = __pyx_state[0] # <<<<<<<<<<<<<< | |
23658 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
23659 * __pyx_result.__dict__.update(__pyx_state[1]) | |
23660 */ | |
23661 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
23662 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
23663 __PYX_ERR(1, 12, __pyx_L1_error) | |
23664 } | |
23665 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) | |
23666 __Pyx_GOTREF(__pyx_t_1); | |
23667 __Pyx_GIVEREF(__pyx_t_1); | |
23668 __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.encoding); | |
23669 __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.encoding); | |
23670 __pyx_v___pyx_result->__pyx_base.encoding = __pyx_t_1; | |
23671 __pyx_t_1 = 0; | |
23672 | |
23673 /* "(tree fragment)":13 | |
23674 * cdef __pyx_unpickle_asTuple__set_state(asTuple __pyx_result, tuple __pyx_state): | |
23675 * __pyx_result.encoding = __pyx_state[0] | |
23676 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< | |
23677 * __pyx_result.__dict__.update(__pyx_state[1]) | |
23678 */ | |
23679 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
23680 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); | |
23681 __PYX_ERR(1, 13, __pyx_L1_error) | |
23682 } | |
23683 __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) | |
23684 __pyx_t_4 = (__pyx_t_3 > 1); | |
23685 if (__pyx_t_4) { | |
23686 } else { | |
23687 __pyx_t_2 = __pyx_t_4; | |
23688 goto __pyx_L4_bool_binop_done; | |
23689 } | |
23690 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) | |
23691 __pyx_t_2 = __pyx_t_4; | |
23692 __pyx_L4_bool_binop_done:; | |
23693 if (__pyx_t_2) { | |
23694 | |
23695 /* "(tree fragment)":14 | |
23696 * __pyx_result.encoding = __pyx_state[0] | |
23697 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
23698 * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< | |
23699 */ | |
23700 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) | |
23701 __Pyx_GOTREF(__pyx_t_5); | |
23702 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) | |
23703 __Pyx_GOTREF(__pyx_t_6); | |
23704 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
23705 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
23706 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
23707 __PYX_ERR(1, 14, __pyx_L1_error) | |
23708 } | |
23709 __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) | |
23710 __Pyx_GOTREF(__pyx_t_5); | |
23711 __pyx_t_7 = NULL; | |
23712 __pyx_t_8 = 0; | |
23713 #if CYTHON_UNPACK_METHODS | |
23714 if (likely(PyMethod_Check(__pyx_t_6))) { | |
23715 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); | |
23716 if (likely(__pyx_t_7)) { | |
23717 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
23718 __Pyx_INCREF(__pyx_t_7); | |
23719 __Pyx_INCREF(function); | |
23720 __Pyx_DECREF_SET(__pyx_t_6, function); | |
23721 __pyx_t_8 = 1; | |
23722 } | |
23723 } | |
23724 #endif | |
23725 { | |
23726 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; | |
23727 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
23728 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
23729 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
23730 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) | |
23731 __Pyx_GOTREF(__pyx_t_1); | |
23732 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
23733 } | |
23734 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23735 | |
23736 /* "(tree fragment)":13 | |
23737 * cdef __pyx_unpickle_asTuple__set_state(asTuple __pyx_result, tuple __pyx_state): | |
23738 * __pyx_result.encoding = __pyx_state[0] | |
23739 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< | |
23740 * __pyx_result.__dict__.update(__pyx_state[1]) | |
23741 */ | |
23742 } | |
23743 | |
23744 /* "(tree fragment)":11 | |
23745 * __pyx_unpickle_asTuple__set_state(<asTuple> __pyx_result, __pyx_state) | |
23746 * return __pyx_result | |
23747 * cdef __pyx_unpickle_asTuple__set_state(asTuple __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
23748 * __pyx_result.encoding = __pyx_state[0] | |
23749 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
23750 */ | |
23751 | |
23752 /* function exit code */ | |
23753 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
23754 goto __pyx_L0; | |
23755 __pyx_L1_error:; | |
23756 __Pyx_XDECREF(__pyx_t_1); | |
23757 __Pyx_XDECREF(__pyx_t_5); | |
23758 __Pyx_XDECREF(__pyx_t_6); | |
23759 __Pyx_XDECREF(__pyx_t_7); | |
23760 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_asTuple__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
23761 __pyx_r = 0; | |
23762 __pyx_L0:; | |
23763 __Pyx_XGIVEREF(__pyx_r); | |
23764 __Pyx_TraceReturn(__pyx_r, 0); | |
23765 __Pyx_RefNannyFinishContext(); | |
23766 return __pyx_r; | |
23767 } | |
23768 | |
23769 /* "(tree fragment)":1 | |
23770 * def __pyx_unpickle_asGFF3(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
23771 * cdef object __pyx_PickleError | |
23772 * cdef object __pyx_result | |
23773 */ | |
23774 | |
23775 /* Python wrapper */ | |
23776 static PyObject *__pyx_pw_5pysam_9libctabix_11__pyx_unpickle_asGFF3(PyObject *__pyx_self, | |
23777 #if CYTHON_METH_FASTCALL | |
23778 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
23779 #else | |
23780 PyObject *__pyx_args, PyObject *__pyx_kwds | |
23781 #endif | |
23782 ); /*proto*/ | |
23783 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_10__pyx_unpickle_asGFF3, "__pyx_unpickle_asGFF3(__pyx_type, long __pyx_checksum, __pyx_state)"); | |
23784 static PyMethodDef __pyx_mdef_5pysam_9libctabix_11__pyx_unpickle_asGFF3 = {"__pyx_unpickle_asGFF3", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_11__pyx_unpickle_asGFF3, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_10__pyx_unpickle_asGFF3}; | |
23785 static PyObject *__pyx_pw_5pysam_9libctabix_11__pyx_unpickle_asGFF3(PyObject *__pyx_self, | |
23786 #if CYTHON_METH_FASTCALL | |
23787 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
23788 #else | |
23789 PyObject *__pyx_args, PyObject *__pyx_kwds | |
23790 #endif | |
23791 ) { | |
23792 PyObject *__pyx_v___pyx_type = 0; | |
23793 long __pyx_v___pyx_checksum; | |
23794 PyObject *__pyx_v___pyx_state = 0; | |
23795 #if !CYTHON_METH_FASTCALL | |
23796 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
23797 #endif | |
23798 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
23799 PyObject* values[3] = {0,0,0}; | |
23800 int __pyx_lineno = 0; | |
23801 const char *__pyx_filename = NULL; | |
23802 int __pyx_clineno = 0; | |
23803 PyObject *__pyx_r = 0; | |
23804 __Pyx_RefNannyDeclarations | |
23805 __Pyx_RefNannySetupContext("__pyx_unpickle_asGFF3 (wrapper)", 0); | |
23806 #if !CYTHON_METH_FASTCALL | |
23807 #if CYTHON_ASSUME_SAFE_MACROS | |
23808 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
23809 #else | |
23810 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
23811 #endif | |
23812 #endif | |
23813 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
23814 { | |
23815 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; | |
23816 if (__pyx_kwds) { | |
23817 Py_ssize_t kw_args; | |
23818 switch (__pyx_nargs) { | |
23819 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
23820 CYTHON_FALLTHROUGH; | |
23821 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
23822 CYTHON_FALLTHROUGH; | |
23823 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
23824 CYTHON_FALLTHROUGH; | |
23825 case 0: break; | |
23826 default: goto __pyx_L5_argtuple_error; | |
23827 } | |
23828 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
23829 switch (__pyx_nargs) { | |
23830 case 0: | |
23831 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { | |
23832 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
23833 kw_args--; | |
23834 } | |
23835 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
23836 else goto __pyx_L5_argtuple_error; | |
23837 CYTHON_FALLTHROUGH; | |
23838 case 1: | |
23839 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { | |
23840 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
23841 kw_args--; | |
23842 } | |
23843 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
23844 else { | |
23845 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asGFF3", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) | |
23846 } | |
23847 CYTHON_FALLTHROUGH; | |
23848 case 2: | |
23849 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
23850 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
23851 kw_args--; | |
23852 } | |
23853 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
23854 else { | |
23855 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asGFF3", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) | |
23856 } | |
23857 } | |
23858 if (unlikely(kw_args > 0)) { | |
23859 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
23860 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_asGFF3") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) | |
23861 } | |
23862 } else if (unlikely(__pyx_nargs != 3)) { | |
23863 goto __pyx_L5_argtuple_error; | |
23864 } else { | |
23865 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
23866 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
23867 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
23868 } | |
23869 __pyx_v___pyx_type = values[0]; | |
23870 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
23871 __pyx_v___pyx_state = values[2]; | |
23872 } | |
23873 goto __pyx_L6_skip; | |
23874 __pyx_L5_argtuple_error:; | |
23875 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asGFF3", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) | |
23876 __pyx_L6_skip:; | |
23877 goto __pyx_L4_argument_unpacking_done; | |
23878 __pyx_L3_error:; | |
23879 { | |
23880 Py_ssize_t __pyx_temp; | |
23881 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
23882 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
23883 } | |
23884 } | |
23885 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_asGFF3", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
23886 __Pyx_RefNannyFinishContext(); | |
23887 return NULL; | |
23888 __pyx_L4_argument_unpacking_done:; | |
23889 __pyx_r = __pyx_pf_5pysam_9libctabix_10__pyx_unpickle_asGFF3(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); | |
23890 | |
23891 /* function exit code */ | |
23892 { | |
23893 Py_ssize_t __pyx_temp; | |
23894 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
23895 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
23896 } | |
23897 } | |
23898 __Pyx_RefNannyFinishContext(); | |
23899 return __pyx_r; | |
23900 } | |
23901 | |
23902 static PyObject *__pyx_pf_5pysam_9libctabix_10__pyx_unpickle_asGFF3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { | |
23903 PyObject *__pyx_v___pyx_PickleError = 0; | |
23904 PyObject *__pyx_v___pyx_result = 0; | |
23905 PyObject *__pyx_r = NULL; | |
23906 __Pyx_TraceDeclarations | |
23907 __Pyx_RefNannyDeclarations | |
23908 PyObject *__pyx_t_1 = NULL; | |
23909 int __pyx_t_2; | |
23910 PyObject *__pyx_t_3 = NULL; | |
23911 PyObject *__pyx_t_4 = NULL; | |
23912 unsigned int __pyx_t_5; | |
23913 int __pyx_lineno = 0; | |
23914 const char *__pyx_filename = NULL; | |
23915 int __pyx_clineno = 0; | |
23916 __Pyx_TraceFrameInit(__pyx_codeobj__58) | |
23917 __Pyx_RefNannySetupContext("__pyx_unpickle_asGFF3", 1); | |
23918 __Pyx_TraceCall("__pyx_unpickle_asGFF3", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
23919 | |
23920 /* "(tree fragment)":4 | |
23921 * cdef object __pyx_PickleError | |
23922 * cdef object __pyx_result | |
23923 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): # <<<<<<<<<<<<<< | |
23924 * from pickle import PickleError as __pyx_PickleError | |
23925 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
23926 */ | |
23927 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) | |
23928 __Pyx_GOTREF(__pyx_t_1); | |
23929 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__55, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error) | |
23930 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23931 if (__pyx_t_2) { | |
23932 | |
23933 /* "(tree fragment)":5 | |
23934 * cdef object __pyx_result | |
23935 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): | |
23936 * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< | |
23937 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
23938 * __pyx_result = asGFF3.__new__(__pyx_type) | |
23939 */ | |
23940 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
23941 __Pyx_GOTREF(__pyx_t_1); | |
23942 __Pyx_INCREF(__pyx_n_s_PickleError); | |
23943 __Pyx_GIVEREF(__pyx_n_s_PickleError); | |
23944 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error); | |
23945 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) | |
23946 __Pyx_GOTREF(__pyx_t_3); | |
23947 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23948 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
23949 __Pyx_GOTREF(__pyx_t_1); | |
23950 __Pyx_INCREF(__pyx_t_1); | |
23951 __pyx_v___pyx_PickleError = __pyx_t_1; | |
23952 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23953 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23954 | |
23955 /* "(tree fragment)":6 | |
23956 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): | |
23957 * from pickle import PickleError as __pyx_PickleError | |
23958 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum # <<<<<<<<<<<<<< | |
23959 * __pyx_result = asGFF3.__new__(__pyx_type) | |
23960 * if __pyx_state is not None: | |
23961 */ | |
23962 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) | |
23963 __Pyx_GOTREF(__pyx_t_3); | |
23964 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) | |
23965 __Pyx_GOTREF(__pyx_t_1); | |
23966 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
23967 __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); | |
23968 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
23969 __PYX_ERR(1, 6, __pyx_L1_error) | |
23970 | |
23971 /* "(tree fragment)":4 | |
23972 * cdef object __pyx_PickleError | |
23973 * cdef object __pyx_result | |
23974 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): # <<<<<<<<<<<<<< | |
23975 * from pickle import PickleError as __pyx_PickleError | |
23976 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
23977 */ | |
23978 } | |
23979 | |
23980 /* "(tree fragment)":7 | |
23981 * from pickle import PickleError as __pyx_PickleError | |
23982 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
23983 * __pyx_result = asGFF3.__new__(__pyx_type) # <<<<<<<<<<<<<< | |
23984 * if __pyx_state is not None: | |
23985 * __pyx_unpickle_asGFF3__set_state(<asGFF3> __pyx_result, __pyx_state) | |
23986 */ | |
23987 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5pysam_9libctabix_asGFF3), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) | |
23988 __Pyx_GOTREF(__pyx_t_3); | |
23989 __pyx_t_4 = NULL; | |
23990 __pyx_t_5 = 0; | |
23991 #if CYTHON_UNPACK_METHODS | |
23992 if (likely(PyMethod_Check(__pyx_t_3))) { | |
23993 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
23994 if (likely(__pyx_t_4)) { | |
23995 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
23996 __Pyx_INCREF(__pyx_t_4); | |
23997 __Pyx_INCREF(function); | |
23998 __Pyx_DECREF_SET(__pyx_t_3, function); | |
23999 __pyx_t_5 = 1; | |
24000 } | |
24001 } | |
24002 #endif | |
24003 { | |
24004 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; | |
24005 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
24006 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
24007 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) | |
24008 __Pyx_GOTREF(__pyx_t_1); | |
24009 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
24010 } | |
24011 __pyx_v___pyx_result = __pyx_t_1; | |
24012 __pyx_t_1 = 0; | |
24013 | |
24014 /* "(tree fragment)":8 | |
24015 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
24016 * __pyx_result = asGFF3.__new__(__pyx_type) | |
24017 * if __pyx_state is not None: # <<<<<<<<<<<<<< | |
24018 * __pyx_unpickle_asGFF3__set_state(<asGFF3> __pyx_result, __pyx_state) | |
24019 * return __pyx_result | |
24020 */ | |
24021 __pyx_t_2 = (__pyx_v___pyx_state != Py_None); | |
24022 if (__pyx_t_2) { | |
24023 | |
24024 /* "(tree fragment)":9 | |
24025 * __pyx_result = asGFF3.__new__(__pyx_type) | |
24026 * if __pyx_state is not None: | |
24027 * __pyx_unpickle_asGFF3__set_state(<asGFF3> __pyx_result, __pyx_state) # <<<<<<<<<<<<<< | |
24028 * return __pyx_result | |
24029 * cdef __pyx_unpickle_asGFF3__set_state(asGFF3 __pyx_result, tuple __pyx_state): | |
24030 */ | |
24031 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error) | |
24032 __pyx_t_1 = __pyx_f_5pysam_9libctabix___pyx_unpickle_asGFF3__set_state(((struct __pyx_obj_5pysam_9libctabix_asGFF3 *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) | |
24033 __Pyx_GOTREF(__pyx_t_1); | |
24034 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24035 | |
24036 /* "(tree fragment)":8 | |
24037 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
24038 * __pyx_result = asGFF3.__new__(__pyx_type) | |
24039 * if __pyx_state is not None: # <<<<<<<<<<<<<< | |
24040 * __pyx_unpickle_asGFF3__set_state(<asGFF3> __pyx_result, __pyx_state) | |
24041 * return __pyx_result | |
24042 */ | |
24043 } | |
24044 | |
24045 /* "(tree fragment)":10 | |
24046 * if __pyx_state is not None: | |
24047 * __pyx_unpickle_asGFF3__set_state(<asGFF3> __pyx_result, __pyx_state) | |
24048 * return __pyx_result # <<<<<<<<<<<<<< | |
24049 * cdef __pyx_unpickle_asGFF3__set_state(asGFF3 __pyx_result, tuple __pyx_state): | |
24050 * __pyx_result.encoding = __pyx_state[0] | |
24051 */ | |
24052 __Pyx_XDECREF(__pyx_r); | |
24053 __Pyx_INCREF(__pyx_v___pyx_result); | |
24054 __pyx_r = __pyx_v___pyx_result; | |
24055 goto __pyx_L0; | |
24056 | |
24057 /* "(tree fragment)":1 | |
24058 * def __pyx_unpickle_asGFF3(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
24059 * cdef object __pyx_PickleError | |
24060 * cdef object __pyx_result | |
24061 */ | |
24062 | |
24063 /* function exit code */ | |
24064 __pyx_L1_error:; | |
24065 __Pyx_XDECREF(__pyx_t_1); | |
24066 __Pyx_XDECREF(__pyx_t_3); | |
24067 __Pyx_XDECREF(__pyx_t_4); | |
24068 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_asGFF3", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
24069 __pyx_r = NULL; | |
24070 __pyx_L0:; | |
24071 __Pyx_XDECREF(__pyx_v___pyx_PickleError); | |
24072 __Pyx_XDECREF(__pyx_v___pyx_result); | |
24073 __Pyx_XGIVEREF(__pyx_r); | |
24074 __Pyx_TraceReturn(__pyx_r, 0); | |
24075 __Pyx_RefNannyFinishContext(); | |
24076 return __pyx_r; | |
24077 } | |
24078 | |
24079 /* "(tree fragment)":11 | |
24080 * __pyx_unpickle_asGFF3__set_state(<asGFF3> __pyx_result, __pyx_state) | |
24081 * return __pyx_result | |
24082 * cdef __pyx_unpickle_asGFF3__set_state(asGFF3 __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
24083 * __pyx_result.encoding = __pyx_state[0] | |
24084 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
24085 */ | |
24086 | |
24087 static PyObject *__pyx_f_5pysam_9libctabix___pyx_unpickle_asGFF3__set_state(struct __pyx_obj_5pysam_9libctabix_asGFF3 *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { | |
24088 PyObject *__pyx_r = NULL; | |
24089 __Pyx_TraceDeclarations | |
24090 __Pyx_RefNannyDeclarations | |
24091 PyObject *__pyx_t_1 = NULL; | |
24092 int __pyx_t_2; | |
24093 Py_ssize_t __pyx_t_3; | |
24094 int __pyx_t_4; | |
24095 PyObject *__pyx_t_5 = NULL; | |
24096 PyObject *__pyx_t_6 = NULL; | |
24097 PyObject *__pyx_t_7 = NULL; | |
24098 unsigned int __pyx_t_8; | |
24099 int __pyx_lineno = 0; | |
24100 const char *__pyx_filename = NULL; | |
24101 int __pyx_clineno = 0; | |
24102 __Pyx_RefNannySetupContext("__pyx_unpickle_asGFF3__set_state", 1); | |
24103 __Pyx_TraceCall("__pyx_unpickle_asGFF3__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error)); | |
24104 | |
24105 /* "(tree fragment)":12 | |
24106 * return __pyx_result | |
24107 * cdef __pyx_unpickle_asGFF3__set_state(asGFF3 __pyx_result, tuple __pyx_state): | |
24108 * __pyx_result.encoding = __pyx_state[0] # <<<<<<<<<<<<<< | |
24109 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
24110 * __pyx_result.__dict__.update(__pyx_state[1]) | |
24111 */ | |
24112 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
24113 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
24114 __PYX_ERR(1, 12, __pyx_L1_error) | |
24115 } | |
24116 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) | |
24117 __Pyx_GOTREF(__pyx_t_1); | |
24118 __Pyx_GIVEREF(__pyx_t_1); | |
24119 __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.encoding); | |
24120 __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.encoding); | |
24121 __pyx_v___pyx_result->__pyx_base.encoding = __pyx_t_1; | |
24122 __pyx_t_1 = 0; | |
24123 | |
24124 /* "(tree fragment)":13 | |
24125 * cdef __pyx_unpickle_asGFF3__set_state(asGFF3 __pyx_result, tuple __pyx_state): | |
24126 * __pyx_result.encoding = __pyx_state[0] | |
24127 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< | |
24128 * __pyx_result.__dict__.update(__pyx_state[1]) | |
24129 */ | |
24130 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
24131 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); | |
24132 __PYX_ERR(1, 13, __pyx_L1_error) | |
24133 } | |
24134 __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) | |
24135 __pyx_t_4 = (__pyx_t_3 > 1); | |
24136 if (__pyx_t_4) { | |
24137 } else { | |
24138 __pyx_t_2 = __pyx_t_4; | |
24139 goto __pyx_L4_bool_binop_done; | |
24140 } | |
24141 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) | |
24142 __pyx_t_2 = __pyx_t_4; | |
24143 __pyx_L4_bool_binop_done:; | |
24144 if (__pyx_t_2) { | |
24145 | |
24146 /* "(tree fragment)":14 | |
24147 * __pyx_result.encoding = __pyx_state[0] | |
24148 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
24149 * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< | |
24150 */ | |
24151 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) | |
24152 __Pyx_GOTREF(__pyx_t_5); | |
24153 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) | |
24154 __Pyx_GOTREF(__pyx_t_6); | |
24155 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
24156 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
24157 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
24158 __PYX_ERR(1, 14, __pyx_L1_error) | |
24159 } | |
24160 __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) | |
24161 __Pyx_GOTREF(__pyx_t_5); | |
24162 __pyx_t_7 = NULL; | |
24163 __pyx_t_8 = 0; | |
24164 #if CYTHON_UNPACK_METHODS | |
24165 if (likely(PyMethod_Check(__pyx_t_6))) { | |
24166 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); | |
24167 if (likely(__pyx_t_7)) { | |
24168 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
24169 __Pyx_INCREF(__pyx_t_7); | |
24170 __Pyx_INCREF(function); | |
24171 __Pyx_DECREF_SET(__pyx_t_6, function); | |
24172 __pyx_t_8 = 1; | |
24173 } | |
24174 } | |
24175 #endif | |
24176 { | |
24177 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; | |
24178 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
24179 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
24180 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
24181 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) | |
24182 __Pyx_GOTREF(__pyx_t_1); | |
24183 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
24184 } | |
24185 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24186 | |
24187 /* "(tree fragment)":13 | |
24188 * cdef __pyx_unpickle_asGFF3__set_state(asGFF3 __pyx_result, tuple __pyx_state): | |
24189 * __pyx_result.encoding = __pyx_state[0] | |
24190 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< | |
24191 * __pyx_result.__dict__.update(__pyx_state[1]) | |
24192 */ | |
24193 } | |
24194 | |
24195 /* "(tree fragment)":11 | |
24196 * __pyx_unpickle_asGFF3__set_state(<asGFF3> __pyx_result, __pyx_state) | |
24197 * return __pyx_result | |
24198 * cdef __pyx_unpickle_asGFF3__set_state(asGFF3 __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
24199 * __pyx_result.encoding = __pyx_state[0] | |
24200 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
24201 */ | |
24202 | |
24203 /* function exit code */ | |
24204 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
24205 goto __pyx_L0; | |
24206 __pyx_L1_error:; | |
24207 __Pyx_XDECREF(__pyx_t_1); | |
24208 __Pyx_XDECREF(__pyx_t_5); | |
24209 __Pyx_XDECREF(__pyx_t_6); | |
24210 __Pyx_XDECREF(__pyx_t_7); | |
24211 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_asGFF3__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
24212 __pyx_r = 0; | |
24213 __pyx_L0:; | |
24214 __Pyx_XGIVEREF(__pyx_r); | |
24215 __Pyx_TraceReturn(__pyx_r, 0); | |
24216 __Pyx_RefNannyFinishContext(); | |
24217 return __pyx_r; | |
24218 } | |
24219 | |
24220 /* "(tree fragment)":1 | |
24221 * def __pyx_unpickle_asGTF(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
24222 * cdef object __pyx_PickleError | |
24223 * cdef object __pyx_result | |
24224 */ | |
24225 | |
24226 /* Python wrapper */ | |
24227 static PyObject *__pyx_pw_5pysam_9libctabix_13__pyx_unpickle_asGTF(PyObject *__pyx_self, | |
24228 #if CYTHON_METH_FASTCALL | |
24229 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
24230 #else | |
24231 PyObject *__pyx_args, PyObject *__pyx_kwds | |
24232 #endif | |
24233 ); /*proto*/ | |
24234 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_12__pyx_unpickle_asGTF, "__pyx_unpickle_asGTF(__pyx_type, long __pyx_checksum, __pyx_state)"); | |
24235 static PyMethodDef __pyx_mdef_5pysam_9libctabix_13__pyx_unpickle_asGTF = {"__pyx_unpickle_asGTF", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_13__pyx_unpickle_asGTF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_12__pyx_unpickle_asGTF}; | |
24236 static PyObject *__pyx_pw_5pysam_9libctabix_13__pyx_unpickle_asGTF(PyObject *__pyx_self, | |
24237 #if CYTHON_METH_FASTCALL | |
24238 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
24239 #else | |
24240 PyObject *__pyx_args, PyObject *__pyx_kwds | |
24241 #endif | |
24242 ) { | |
24243 PyObject *__pyx_v___pyx_type = 0; | |
24244 long __pyx_v___pyx_checksum; | |
24245 PyObject *__pyx_v___pyx_state = 0; | |
24246 #if !CYTHON_METH_FASTCALL | |
24247 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
24248 #endif | |
24249 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
24250 PyObject* values[3] = {0,0,0}; | |
24251 int __pyx_lineno = 0; | |
24252 const char *__pyx_filename = NULL; | |
24253 int __pyx_clineno = 0; | |
24254 PyObject *__pyx_r = 0; | |
24255 __Pyx_RefNannyDeclarations | |
24256 __Pyx_RefNannySetupContext("__pyx_unpickle_asGTF (wrapper)", 0); | |
24257 #if !CYTHON_METH_FASTCALL | |
24258 #if CYTHON_ASSUME_SAFE_MACROS | |
24259 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
24260 #else | |
24261 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
24262 #endif | |
24263 #endif | |
24264 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
24265 { | |
24266 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; | |
24267 if (__pyx_kwds) { | |
24268 Py_ssize_t kw_args; | |
24269 switch (__pyx_nargs) { | |
24270 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
24271 CYTHON_FALLTHROUGH; | |
24272 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
24273 CYTHON_FALLTHROUGH; | |
24274 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
24275 CYTHON_FALLTHROUGH; | |
24276 case 0: break; | |
24277 default: goto __pyx_L5_argtuple_error; | |
24278 } | |
24279 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
24280 switch (__pyx_nargs) { | |
24281 case 0: | |
24282 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { | |
24283 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
24284 kw_args--; | |
24285 } | |
24286 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
24287 else goto __pyx_L5_argtuple_error; | |
24288 CYTHON_FALLTHROUGH; | |
24289 case 1: | |
24290 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { | |
24291 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
24292 kw_args--; | |
24293 } | |
24294 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
24295 else { | |
24296 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asGTF", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) | |
24297 } | |
24298 CYTHON_FALLTHROUGH; | |
24299 case 2: | |
24300 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
24301 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
24302 kw_args--; | |
24303 } | |
24304 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
24305 else { | |
24306 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asGTF", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) | |
24307 } | |
24308 } | |
24309 if (unlikely(kw_args > 0)) { | |
24310 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
24311 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_asGTF") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) | |
24312 } | |
24313 } else if (unlikely(__pyx_nargs != 3)) { | |
24314 goto __pyx_L5_argtuple_error; | |
24315 } else { | |
24316 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
24317 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
24318 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
24319 } | |
24320 __pyx_v___pyx_type = values[0]; | |
24321 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
24322 __pyx_v___pyx_state = values[2]; | |
24323 } | |
24324 goto __pyx_L6_skip; | |
24325 __pyx_L5_argtuple_error:; | |
24326 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asGTF", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) | |
24327 __pyx_L6_skip:; | |
24328 goto __pyx_L4_argument_unpacking_done; | |
24329 __pyx_L3_error:; | |
24330 { | |
24331 Py_ssize_t __pyx_temp; | |
24332 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
24333 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
24334 } | |
24335 } | |
24336 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_asGTF", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
24337 __Pyx_RefNannyFinishContext(); | |
24338 return NULL; | |
24339 __pyx_L4_argument_unpacking_done:; | |
24340 __pyx_r = __pyx_pf_5pysam_9libctabix_12__pyx_unpickle_asGTF(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); | |
24341 | |
24342 /* function exit code */ | |
24343 { | |
24344 Py_ssize_t __pyx_temp; | |
24345 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
24346 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
24347 } | |
24348 } | |
24349 __Pyx_RefNannyFinishContext(); | |
24350 return __pyx_r; | |
24351 } | |
24352 | |
24353 static PyObject *__pyx_pf_5pysam_9libctabix_12__pyx_unpickle_asGTF(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { | |
24354 PyObject *__pyx_v___pyx_PickleError = 0; | |
24355 PyObject *__pyx_v___pyx_result = 0; | |
24356 PyObject *__pyx_r = NULL; | |
24357 __Pyx_TraceDeclarations | |
24358 __Pyx_RefNannyDeclarations | |
24359 PyObject *__pyx_t_1 = NULL; | |
24360 int __pyx_t_2; | |
24361 PyObject *__pyx_t_3 = NULL; | |
24362 PyObject *__pyx_t_4 = NULL; | |
24363 unsigned int __pyx_t_5; | |
24364 int __pyx_lineno = 0; | |
24365 const char *__pyx_filename = NULL; | |
24366 int __pyx_clineno = 0; | |
24367 __Pyx_TraceFrameInit(__pyx_codeobj__59) | |
24368 __Pyx_RefNannySetupContext("__pyx_unpickle_asGTF", 1); | |
24369 __Pyx_TraceCall("__pyx_unpickle_asGTF", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
24370 | |
24371 /* "(tree fragment)":4 | |
24372 * cdef object __pyx_PickleError | |
24373 * cdef object __pyx_result | |
24374 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): # <<<<<<<<<<<<<< | |
24375 * from pickle import PickleError as __pyx_PickleError | |
24376 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
24377 */ | |
24378 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) | |
24379 __Pyx_GOTREF(__pyx_t_1); | |
24380 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__55, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error) | |
24381 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24382 if (__pyx_t_2) { | |
24383 | |
24384 /* "(tree fragment)":5 | |
24385 * cdef object __pyx_result | |
24386 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): | |
24387 * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< | |
24388 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
24389 * __pyx_result = asGTF.__new__(__pyx_type) | |
24390 */ | |
24391 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
24392 __Pyx_GOTREF(__pyx_t_1); | |
24393 __Pyx_INCREF(__pyx_n_s_PickleError); | |
24394 __Pyx_GIVEREF(__pyx_n_s_PickleError); | |
24395 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error); | |
24396 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) | |
24397 __Pyx_GOTREF(__pyx_t_3); | |
24398 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24399 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
24400 __Pyx_GOTREF(__pyx_t_1); | |
24401 __Pyx_INCREF(__pyx_t_1); | |
24402 __pyx_v___pyx_PickleError = __pyx_t_1; | |
24403 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24404 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
24405 | |
24406 /* "(tree fragment)":6 | |
24407 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): | |
24408 * from pickle import PickleError as __pyx_PickleError | |
24409 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum # <<<<<<<<<<<<<< | |
24410 * __pyx_result = asGTF.__new__(__pyx_type) | |
24411 * if __pyx_state is not None: | |
24412 */ | |
24413 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) | |
24414 __Pyx_GOTREF(__pyx_t_3); | |
24415 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) | |
24416 __Pyx_GOTREF(__pyx_t_1); | |
24417 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
24418 __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); | |
24419 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24420 __PYX_ERR(1, 6, __pyx_L1_error) | |
24421 | |
24422 /* "(tree fragment)":4 | |
24423 * cdef object __pyx_PickleError | |
24424 * cdef object __pyx_result | |
24425 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): # <<<<<<<<<<<<<< | |
24426 * from pickle import PickleError as __pyx_PickleError | |
24427 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
24428 */ | |
24429 } | |
24430 | |
24431 /* "(tree fragment)":7 | |
24432 * from pickle import PickleError as __pyx_PickleError | |
24433 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
24434 * __pyx_result = asGTF.__new__(__pyx_type) # <<<<<<<<<<<<<< | |
24435 * if __pyx_state is not None: | |
24436 * __pyx_unpickle_asGTF__set_state(<asGTF> __pyx_result, __pyx_state) | |
24437 */ | |
24438 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5pysam_9libctabix_asGTF), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) | |
24439 __Pyx_GOTREF(__pyx_t_3); | |
24440 __pyx_t_4 = NULL; | |
24441 __pyx_t_5 = 0; | |
24442 #if CYTHON_UNPACK_METHODS | |
24443 if (likely(PyMethod_Check(__pyx_t_3))) { | |
24444 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
24445 if (likely(__pyx_t_4)) { | |
24446 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
24447 __Pyx_INCREF(__pyx_t_4); | |
24448 __Pyx_INCREF(function); | |
24449 __Pyx_DECREF_SET(__pyx_t_3, function); | |
24450 __pyx_t_5 = 1; | |
24451 } | |
24452 } | |
24453 #endif | |
24454 { | |
24455 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; | |
24456 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
24457 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
24458 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) | |
24459 __Pyx_GOTREF(__pyx_t_1); | |
24460 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
24461 } | |
24462 __pyx_v___pyx_result = __pyx_t_1; | |
24463 __pyx_t_1 = 0; | |
24464 | |
24465 /* "(tree fragment)":8 | |
24466 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
24467 * __pyx_result = asGTF.__new__(__pyx_type) | |
24468 * if __pyx_state is not None: # <<<<<<<<<<<<<< | |
24469 * __pyx_unpickle_asGTF__set_state(<asGTF> __pyx_result, __pyx_state) | |
24470 * return __pyx_result | |
24471 */ | |
24472 __pyx_t_2 = (__pyx_v___pyx_state != Py_None); | |
24473 if (__pyx_t_2) { | |
24474 | |
24475 /* "(tree fragment)":9 | |
24476 * __pyx_result = asGTF.__new__(__pyx_type) | |
24477 * if __pyx_state is not None: | |
24478 * __pyx_unpickle_asGTF__set_state(<asGTF> __pyx_result, __pyx_state) # <<<<<<<<<<<<<< | |
24479 * return __pyx_result | |
24480 * cdef __pyx_unpickle_asGTF__set_state(asGTF __pyx_result, tuple __pyx_state): | |
24481 */ | |
24482 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error) | |
24483 __pyx_t_1 = __pyx_f_5pysam_9libctabix___pyx_unpickle_asGTF__set_state(((struct __pyx_obj_5pysam_9libctabix_asGTF *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) | |
24484 __Pyx_GOTREF(__pyx_t_1); | |
24485 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24486 | |
24487 /* "(tree fragment)":8 | |
24488 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
24489 * __pyx_result = asGTF.__new__(__pyx_type) | |
24490 * if __pyx_state is not None: # <<<<<<<<<<<<<< | |
24491 * __pyx_unpickle_asGTF__set_state(<asGTF> __pyx_result, __pyx_state) | |
24492 * return __pyx_result | |
24493 */ | |
24494 } | |
24495 | |
24496 /* "(tree fragment)":10 | |
24497 * if __pyx_state is not None: | |
24498 * __pyx_unpickle_asGTF__set_state(<asGTF> __pyx_result, __pyx_state) | |
24499 * return __pyx_result # <<<<<<<<<<<<<< | |
24500 * cdef __pyx_unpickle_asGTF__set_state(asGTF __pyx_result, tuple __pyx_state): | |
24501 * __pyx_result.encoding = __pyx_state[0] | |
24502 */ | |
24503 __Pyx_XDECREF(__pyx_r); | |
24504 __Pyx_INCREF(__pyx_v___pyx_result); | |
24505 __pyx_r = __pyx_v___pyx_result; | |
24506 goto __pyx_L0; | |
24507 | |
24508 /* "(tree fragment)":1 | |
24509 * def __pyx_unpickle_asGTF(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
24510 * cdef object __pyx_PickleError | |
24511 * cdef object __pyx_result | |
24512 */ | |
24513 | |
24514 /* function exit code */ | |
24515 __pyx_L1_error:; | |
24516 __Pyx_XDECREF(__pyx_t_1); | |
24517 __Pyx_XDECREF(__pyx_t_3); | |
24518 __Pyx_XDECREF(__pyx_t_4); | |
24519 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_asGTF", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
24520 __pyx_r = NULL; | |
24521 __pyx_L0:; | |
24522 __Pyx_XDECREF(__pyx_v___pyx_PickleError); | |
24523 __Pyx_XDECREF(__pyx_v___pyx_result); | |
24524 __Pyx_XGIVEREF(__pyx_r); | |
24525 __Pyx_TraceReturn(__pyx_r, 0); | |
24526 __Pyx_RefNannyFinishContext(); | |
24527 return __pyx_r; | |
24528 } | |
24529 | |
24530 /* "(tree fragment)":11 | |
24531 * __pyx_unpickle_asGTF__set_state(<asGTF> __pyx_result, __pyx_state) | |
24532 * return __pyx_result | |
24533 * cdef __pyx_unpickle_asGTF__set_state(asGTF __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
24534 * __pyx_result.encoding = __pyx_state[0] | |
24535 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
24536 */ | |
24537 | |
24538 static PyObject *__pyx_f_5pysam_9libctabix___pyx_unpickle_asGTF__set_state(struct __pyx_obj_5pysam_9libctabix_asGTF *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { | |
24539 PyObject *__pyx_r = NULL; | |
24540 __Pyx_TraceDeclarations | |
24541 __Pyx_RefNannyDeclarations | |
24542 PyObject *__pyx_t_1 = NULL; | |
24543 int __pyx_t_2; | |
24544 Py_ssize_t __pyx_t_3; | |
24545 int __pyx_t_4; | |
24546 PyObject *__pyx_t_5 = NULL; | |
24547 PyObject *__pyx_t_6 = NULL; | |
24548 PyObject *__pyx_t_7 = NULL; | |
24549 unsigned int __pyx_t_8; | |
24550 int __pyx_lineno = 0; | |
24551 const char *__pyx_filename = NULL; | |
24552 int __pyx_clineno = 0; | |
24553 __Pyx_RefNannySetupContext("__pyx_unpickle_asGTF__set_state", 1); | |
24554 __Pyx_TraceCall("__pyx_unpickle_asGTF__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error)); | |
24555 | |
24556 /* "(tree fragment)":12 | |
24557 * return __pyx_result | |
24558 * cdef __pyx_unpickle_asGTF__set_state(asGTF __pyx_result, tuple __pyx_state): | |
24559 * __pyx_result.encoding = __pyx_state[0] # <<<<<<<<<<<<<< | |
24560 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
24561 * __pyx_result.__dict__.update(__pyx_state[1]) | |
24562 */ | |
24563 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
24564 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
24565 __PYX_ERR(1, 12, __pyx_L1_error) | |
24566 } | |
24567 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) | |
24568 __Pyx_GOTREF(__pyx_t_1); | |
24569 __Pyx_GIVEREF(__pyx_t_1); | |
24570 __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.encoding); | |
24571 __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.encoding); | |
24572 __pyx_v___pyx_result->__pyx_base.encoding = __pyx_t_1; | |
24573 __pyx_t_1 = 0; | |
24574 | |
24575 /* "(tree fragment)":13 | |
24576 * cdef __pyx_unpickle_asGTF__set_state(asGTF __pyx_result, tuple __pyx_state): | |
24577 * __pyx_result.encoding = __pyx_state[0] | |
24578 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< | |
24579 * __pyx_result.__dict__.update(__pyx_state[1]) | |
24580 */ | |
24581 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
24582 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); | |
24583 __PYX_ERR(1, 13, __pyx_L1_error) | |
24584 } | |
24585 __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) | |
24586 __pyx_t_4 = (__pyx_t_3 > 1); | |
24587 if (__pyx_t_4) { | |
24588 } else { | |
24589 __pyx_t_2 = __pyx_t_4; | |
24590 goto __pyx_L4_bool_binop_done; | |
24591 } | |
24592 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) | |
24593 __pyx_t_2 = __pyx_t_4; | |
24594 __pyx_L4_bool_binop_done:; | |
24595 if (__pyx_t_2) { | |
24596 | |
24597 /* "(tree fragment)":14 | |
24598 * __pyx_result.encoding = __pyx_state[0] | |
24599 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
24600 * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< | |
24601 */ | |
24602 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) | |
24603 __Pyx_GOTREF(__pyx_t_5); | |
24604 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) | |
24605 __Pyx_GOTREF(__pyx_t_6); | |
24606 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
24607 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
24608 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
24609 __PYX_ERR(1, 14, __pyx_L1_error) | |
24610 } | |
24611 __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) | |
24612 __Pyx_GOTREF(__pyx_t_5); | |
24613 __pyx_t_7 = NULL; | |
24614 __pyx_t_8 = 0; | |
24615 #if CYTHON_UNPACK_METHODS | |
24616 if (likely(PyMethod_Check(__pyx_t_6))) { | |
24617 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); | |
24618 if (likely(__pyx_t_7)) { | |
24619 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
24620 __Pyx_INCREF(__pyx_t_7); | |
24621 __Pyx_INCREF(function); | |
24622 __Pyx_DECREF_SET(__pyx_t_6, function); | |
24623 __pyx_t_8 = 1; | |
24624 } | |
24625 } | |
24626 #endif | |
24627 { | |
24628 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; | |
24629 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
24630 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
24631 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
24632 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) | |
24633 __Pyx_GOTREF(__pyx_t_1); | |
24634 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
24635 } | |
24636 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24637 | |
24638 /* "(tree fragment)":13 | |
24639 * cdef __pyx_unpickle_asGTF__set_state(asGTF __pyx_result, tuple __pyx_state): | |
24640 * __pyx_result.encoding = __pyx_state[0] | |
24641 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< | |
24642 * __pyx_result.__dict__.update(__pyx_state[1]) | |
24643 */ | |
24644 } | |
24645 | |
24646 /* "(tree fragment)":11 | |
24647 * __pyx_unpickle_asGTF__set_state(<asGTF> __pyx_result, __pyx_state) | |
24648 * return __pyx_result | |
24649 * cdef __pyx_unpickle_asGTF__set_state(asGTF __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
24650 * __pyx_result.encoding = __pyx_state[0] | |
24651 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
24652 */ | |
24653 | |
24654 /* function exit code */ | |
24655 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
24656 goto __pyx_L0; | |
24657 __pyx_L1_error:; | |
24658 __Pyx_XDECREF(__pyx_t_1); | |
24659 __Pyx_XDECREF(__pyx_t_5); | |
24660 __Pyx_XDECREF(__pyx_t_6); | |
24661 __Pyx_XDECREF(__pyx_t_7); | |
24662 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_asGTF__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
24663 __pyx_r = 0; | |
24664 __pyx_L0:; | |
24665 __Pyx_XGIVEREF(__pyx_r); | |
24666 __Pyx_TraceReturn(__pyx_r, 0); | |
24667 __Pyx_RefNannyFinishContext(); | |
24668 return __pyx_r; | |
24669 } | |
24670 | |
24671 /* "(tree fragment)":1 | |
24672 * def __pyx_unpickle_asBed(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
24673 * cdef object __pyx_PickleError | |
24674 * cdef object __pyx_result | |
24675 */ | |
24676 | |
24677 /* Python wrapper */ | |
24678 static PyObject *__pyx_pw_5pysam_9libctabix_15__pyx_unpickle_asBed(PyObject *__pyx_self, | |
24679 #if CYTHON_METH_FASTCALL | |
24680 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
24681 #else | |
24682 PyObject *__pyx_args, PyObject *__pyx_kwds | |
24683 #endif | |
24684 ); /*proto*/ | |
24685 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_14__pyx_unpickle_asBed, "__pyx_unpickle_asBed(__pyx_type, long __pyx_checksum, __pyx_state)"); | |
24686 static PyMethodDef __pyx_mdef_5pysam_9libctabix_15__pyx_unpickle_asBed = {"__pyx_unpickle_asBed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_15__pyx_unpickle_asBed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_14__pyx_unpickle_asBed}; | |
24687 static PyObject *__pyx_pw_5pysam_9libctabix_15__pyx_unpickle_asBed(PyObject *__pyx_self, | |
24688 #if CYTHON_METH_FASTCALL | |
24689 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
24690 #else | |
24691 PyObject *__pyx_args, PyObject *__pyx_kwds | |
24692 #endif | |
24693 ) { | |
24694 PyObject *__pyx_v___pyx_type = 0; | |
24695 long __pyx_v___pyx_checksum; | |
24696 PyObject *__pyx_v___pyx_state = 0; | |
24697 #if !CYTHON_METH_FASTCALL | |
24698 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
24699 #endif | |
24700 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
24701 PyObject* values[3] = {0,0,0}; | |
24702 int __pyx_lineno = 0; | |
24703 const char *__pyx_filename = NULL; | |
24704 int __pyx_clineno = 0; | |
24705 PyObject *__pyx_r = 0; | |
24706 __Pyx_RefNannyDeclarations | |
24707 __Pyx_RefNannySetupContext("__pyx_unpickle_asBed (wrapper)", 0); | |
24708 #if !CYTHON_METH_FASTCALL | |
24709 #if CYTHON_ASSUME_SAFE_MACROS | |
24710 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
24711 #else | |
24712 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
24713 #endif | |
24714 #endif | |
24715 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
24716 { | |
24717 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; | |
24718 if (__pyx_kwds) { | |
24719 Py_ssize_t kw_args; | |
24720 switch (__pyx_nargs) { | |
24721 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
24722 CYTHON_FALLTHROUGH; | |
24723 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
24724 CYTHON_FALLTHROUGH; | |
24725 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
24726 CYTHON_FALLTHROUGH; | |
24727 case 0: break; | |
24728 default: goto __pyx_L5_argtuple_error; | |
24729 } | |
24730 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
24731 switch (__pyx_nargs) { | |
24732 case 0: | |
24733 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { | |
24734 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
24735 kw_args--; | |
24736 } | |
24737 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
24738 else goto __pyx_L5_argtuple_error; | |
24739 CYTHON_FALLTHROUGH; | |
24740 case 1: | |
24741 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { | |
24742 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
24743 kw_args--; | |
24744 } | |
24745 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
24746 else { | |
24747 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asBed", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) | |
24748 } | |
24749 CYTHON_FALLTHROUGH; | |
24750 case 2: | |
24751 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
24752 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
24753 kw_args--; | |
24754 } | |
24755 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
24756 else { | |
24757 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asBed", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) | |
24758 } | |
24759 } | |
24760 if (unlikely(kw_args > 0)) { | |
24761 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
24762 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_asBed") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) | |
24763 } | |
24764 } else if (unlikely(__pyx_nargs != 3)) { | |
24765 goto __pyx_L5_argtuple_error; | |
24766 } else { | |
24767 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
24768 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
24769 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
24770 } | |
24771 __pyx_v___pyx_type = values[0]; | |
24772 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
24773 __pyx_v___pyx_state = values[2]; | |
24774 } | |
24775 goto __pyx_L6_skip; | |
24776 __pyx_L5_argtuple_error:; | |
24777 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asBed", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) | |
24778 __pyx_L6_skip:; | |
24779 goto __pyx_L4_argument_unpacking_done; | |
24780 __pyx_L3_error:; | |
24781 { | |
24782 Py_ssize_t __pyx_temp; | |
24783 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
24784 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
24785 } | |
24786 } | |
24787 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_asBed", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
24788 __Pyx_RefNannyFinishContext(); | |
24789 return NULL; | |
24790 __pyx_L4_argument_unpacking_done:; | |
24791 __pyx_r = __pyx_pf_5pysam_9libctabix_14__pyx_unpickle_asBed(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); | |
24792 | |
24793 /* function exit code */ | |
24794 { | |
24795 Py_ssize_t __pyx_temp; | |
24796 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
24797 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
24798 } | |
24799 } | |
24800 __Pyx_RefNannyFinishContext(); | |
24801 return __pyx_r; | |
24802 } | |
24803 | |
24804 static PyObject *__pyx_pf_5pysam_9libctabix_14__pyx_unpickle_asBed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { | |
24805 PyObject *__pyx_v___pyx_PickleError = 0; | |
24806 PyObject *__pyx_v___pyx_result = 0; | |
24807 PyObject *__pyx_r = NULL; | |
24808 __Pyx_TraceDeclarations | |
24809 __Pyx_RefNannyDeclarations | |
24810 PyObject *__pyx_t_1 = NULL; | |
24811 int __pyx_t_2; | |
24812 PyObject *__pyx_t_3 = NULL; | |
24813 PyObject *__pyx_t_4 = NULL; | |
24814 unsigned int __pyx_t_5; | |
24815 int __pyx_lineno = 0; | |
24816 const char *__pyx_filename = NULL; | |
24817 int __pyx_clineno = 0; | |
24818 __Pyx_TraceFrameInit(__pyx_codeobj__60) | |
24819 __Pyx_RefNannySetupContext("__pyx_unpickle_asBed", 1); | |
24820 __Pyx_TraceCall("__pyx_unpickle_asBed", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
24821 | |
24822 /* "(tree fragment)":4 | |
24823 * cdef object __pyx_PickleError | |
24824 * cdef object __pyx_result | |
24825 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): # <<<<<<<<<<<<<< | |
24826 * from pickle import PickleError as __pyx_PickleError | |
24827 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
24828 */ | |
24829 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) | |
24830 __Pyx_GOTREF(__pyx_t_1); | |
24831 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__55, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error) | |
24832 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24833 if (__pyx_t_2) { | |
24834 | |
24835 /* "(tree fragment)":5 | |
24836 * cdef object __pyx_result | |
24837 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): | |
24838 * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< | |
24839 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
24840 * __pyx_result = asBed.__new__(__pyx_type) | |
24841 */ | |
24842 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
24843 __Pyx_GOTREF(__pyx_t_1); | |
24844 __Pyx_INCREF(__pyx_n_s_PickleError); | |
24845 __Pyx_GIVEREF(__pyx_n_s_PickleError); | |
24846 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error); | |
24847 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) | |
24848 __Pyx_GOTREF(__pyx_t_3); | |
24849 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24850 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
24851 __Pyx_GOTREF(__pyx_t_1); | |
24852 __Pyx_INCREF(__pyx_t_1); | |
24853 __pyx_v___pyx_PickleError = __pyx_t_1; | |
24854 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24855 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
24856 | |
24857 /* "(tree fragment)":6 | |
24858 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): | |
24859 * from pickle import PickleError as __pyx_PickleError | |
24860 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum # <<<<<<<<<<<<<< | |
24861 * __pyx_result = asBed.__new__(__pyx_type) | |
24862 * if __pyx_state is not None: | |
24863 */ | |
24864 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) | |
24865 __Pyx_GOTREF(__pyx_t_3); | |
24866 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) | |
24867 __Pyx_GOTREF(__pyx_t_1); | |
24868 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
24869 __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); | |
24870 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24871 __PYX_ERR(1, 6, __pyx_L1_error) | |
24872 | |
24873 /* "(tree fragment)":4 | |
24874 * cdef object __pyx_PickleError | |
24875 * cdef object __pyx_result | |
24876 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): # <<<<<<<<<<<<<< | |
24877 * from pickle import PickleError as __pyx_PickleError | |
24878 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
24879 */ | |
24880 } | |
24881 | |
24882 /* "(tree fragment)":7 | |
24883 * from pickle import PickleError as __pyx_PickleError | |
24884 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
24885 * __pyx_result = asBed.__new__(__pyx_type) # <<<<<<<<<<<<<< | |
24886 * if __pyx_state is not None: | |
24887 * __pyx_unpickle_asBed__set_state(<asBed> __pyx_result, __pyx_state) | |
24888 */ | |
24889 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5pysam_9libctabix_asBed), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) | |
24890 __Pyx_GOTREF(__pyx_t_3); | |
24891 __pyx_t_4 = NULL; | |
24892 __pyx_t_5 = 0; | |
24893 #if CYTHON_UNPACK_METHODS | |
24894 if (likely(PyMethod_Check(__pyx_t_3))) { | |
24895 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
24896 if (likely(__pyx_t_4)) { | |
24897 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
24898 __Pyx_INCREF(__pyx_t_4); | |
24899 __Pyx_INCREF(function); | |
24900 __Pyx_DECREF_SET(__pyx_t_3, function); | |
24901 __pyx_t_5 = 1; | |
24902 } | |
24903 } | |
24904 #endif | |
24905 { | |
24906 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; | |
24907 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
24908 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
24909 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) | |
24910 __Pyx_GOTREF(__pyx_t_1); | |
24911 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
24912 } | |
24913 __pyx_v___pyx_result = __pyx_t_1; | |
24914 __pyx_t_1 = 0; | |
24915 | |
24916 /* "(tree fragment)":8 | |
24917 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
24918 * __pyx_result = asBed.__new__(__pyx_type) | |
24919 * if __pyx_state is not None: # <<<<<<<<<<<<<< | |
24920 * __pyx_unpickle_asBed__set_state(<asBed> __pyx_result, __pyx_state) | |
24921 * return __pyx_result | |
24922 */ | |
24923 __pyx_t_2 = (__pyx_v___pyx_state != Py_None); | |
24924 if (__pyx_t_2) { | |
24925 | |
24926 /* "(tree fragment)":9 | |
24927 * __pyx_result = asBed.__new__(__pyx_type) | |
24928 * if __pyx_state is not None: | |
24929 * __pyx_unpickle_asBed__set_state(<asBed> __pyx_result, __pyx_state) # <<<<<<<<<<<<<< | |
24930 * return __pyx_result | |
24931 * cdef __pyx_unpickle_asBed__set_state(asBed __pyx_result, tuple __pyx_state): | |
24932 */ | |
24933 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error) | |
24934 __pyx_t_1 = __pyx_f_5pysam_9libctabix___pyx_unpickle_asBed__set_state(((struct __pyx_obj_5pysam_9libctabix_asBed *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) | |
24935 __Pyx_GOTREF(__pyx_t_1); | |
24936 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
24937 | |
24938 /* "(tree fragment)":8 | |
24939 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
24940 * __pyx_result = asBed.__new__(__pyx_type) | |
24941 * if __pyx_state is not None: # <<<<<<<<<<<<<< | |
24942 * __pyx_unpickle_asBed__set_state(<asBed> __pyx_result, __pyx_state) | |
24943 * return __pyx_result | |
24944 */ | |
24945 } | |
24946 | |
24947 /* "(tree fragment)":10 | |
24948 * if __pyx_state is not None: | |
24949 * __pyx_unpickle_asBed__set_state(<asBed> __pyx_result, __pyx_state) | |
24950 * return __pyx_result # <<<<<<<<<<<<<< | |
24951 * cdef __pyx_unpickle_asBed__set_state(asBed __pyx_result, tuple __pyx_state): | |
24952 * __pyx_result.encoding = __pyx_state[0] | |
24953 */ | |
24954 __Pyx_XDECREF(__pyx_r); | |
24955 __Pyx_INCREF(__pyx_v___pyx_result); | |
24956 __pyx_r = __pyx_v___pyx_result; | |
24957 goto __pyx_L0; | |
24958 | |
24959 /* "(tree fragment)":1 | |
24960 * def __pyx_unpickle_asBed(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
24961 * cdef object __pyx_PickleError | |
24962 * cdef object __pyx_result | |
24963 */ | |
24964 | |
24965 /* function exit code */ | |
24966 __pyx_L1_error:; | |
24967 __Pyx_XDECREF(__pyx_t_1); | |
24968 __Pyx_XDECREF(__pyx_t_3); | |
24969 __Pyx_XDECREF(__pyx_t_4); | |
24970 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_asBed", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
24971 __pyx_r = NULL; | |
24972 __pyx_L0:; | |
24973 __Pyx_XDECREF(__pyx_v___pyx_PickleError); | |
24974 __Pyx_XDECREF(__pyx_v___pyx_result); | |
24975 __Pyx_XGIVEREF(__pyx_r); | |
24976 __Pyx_TraceReturn(__pyx_r, 0); | |
24977 __Pyx_RefNannyFinishContext(); | |
24978 return __pyx_r; | |
24979 } | |
24980 | |
24981 /* "(tree fragment)":11 | |
24982 * __pyx_unpickle_asBed__set_state(<asBed> __pyx_result, __pyx_state) | |
24983 * return __pyx_result | |
24984 * cdef __pyx_unpickle_asBed__set_state(asBed __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
24985 * __pyx_result.encoding = __pyx_state[0] | |
24986 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
24987 */ | |
24988 | |
24989 static PyObject *__pyx_f_5pysam_9libctabix___pyx_unpickle_asBed__set_state(struct __pyx_obj_5pysam_9libctabix_asBed *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { | |
24990 PyObject *__pyx_r = NULL; | |
24991 __Pyx_TraceDeclarations | |
24992 __Pyx_RefNannyDeclarations | |
24993 PyObject *__pyx_t_1 = NULL; | |
24994 int __pyx_t_2; | |
24995 Py_ssize_t __pyx_t_3; | |
24996 int __pyx_t_4; | |
24997 PyObject *__pyx_t_5 = NULL; | |
24998 PyObject *__pyx_t_6 = NULL; | |
24999 PyObject *__pyx_t_7 = NULL; | |
25000 unsigned int __pyx_t_8; | |
25001 int __pyx_lineno = 0; | |
25002 const char *__pyx_filename = NULL; | |
25003 int __pyx_clineno = 0; | |
25004 __Pyx_RefNannySetupContext("__pyx_unpickle_asBed__set_state", 1); | |
25005 __Pyx_TraceCall("__pyx_unpickle_asBed__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error)); | |
25006 | |
25007 /* "(tree fragment)":12 | |
25008 * return __pyx_result | |
25009 * cdef __pyx_unpickle_asBed__set_state(asBed __pyx_result, tuple __pyx_state): | |
25010 * __pyx_result.encoding = __pyx_state[0] # <<<<<<<<<<<<<< | |
25011 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
25012 * __pyx_result.__dict__.update(__pyx_state[1]) | |
25013 */ | |
25014 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
25015 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
25016 __PYX_ERR(1, 12, __pyx_L1_error) | |
25017 } | |
25018 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) | |
25019 __Pyx_GOTREF(__pyx_t_1); | |
25020 __Pyx_GIVEREF(__pyx_t_1); | |
25021 __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.encoding); | |
25022 __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.encoding); | |
25023 __pyx_v___pyx_result->__pyx_base.encoding = __pyx_t_1; | |
25024 __pyx_t_1 = 0; | |
25025 | |
25026 /* "(tree fragment)":13 | |
25027 * cdef __pyx_unpickle_asBed__set_state(asBed __pyx_result, tuple __pyx_state): | |
25028 * __pyx_result.encoding = __pyx_state[0] | |
25029 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< | |
25030 * __pyx_result.__dict__.update(__pyx_state[1]) | |
25031 */ | |
25032 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
25033 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); | |
25034 __PYX_ERR(1, 13, __pyx_L1_error) | |
25035 } | |
25036 __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) | |
25037 __pyx_t_4 = (__pyx_t_3 > 1); | |
25038 if (__pyx_t_4) { | |
25039 } else { | |
25040 __pyx_t_2 = __pyx_t_4; | |
25041 goto __pyx_L4_bool_binop_done; | |
25042 } | |
25043 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) | |
25044 __pyx_t_2 = __pyx_t_4; | |
25045 __pyx_L4_bool_binop_done:; | |
25046 if (__pyx_t_2) { | |
25047 | |
25048 /* "(tree fragment)":14 | |
25049 * __pyx_result.encoding = __pyx_state[0] | |
25050 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
25051 * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< | |
25052 */ | |
25053 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) | |
25054 __Pyx_GOTREF(__pyx_t_5); | |
25055 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) | |
25056 __Pyx_GOTREF(__pyx_t_6); | |
25057 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
25058 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
25059 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
25060 __PYX_ERR(1, 14, __pyx_L1_error) | |
25061 } | |
25062 __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) | |
25063 __Pyx_GOTREF(__pyx_t_5); | |
25064 __pyx_t_7 = NULL; | |
25065 __pyx_t_8 = 0; | |
25066 #if CYTHON_UNPACK_METHODS | |
25067 if (likely(PyMethod_Check(__pyx_t_6))) { | |
25068 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); | |
25069 if (likely(__pyx_t_7)) { | |
25070 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
25071 __Pyx_INCREF(__pyx_t_7); | |
25072 __Pyx_INCREF(function); | |
25073 __Pyx_DECREF_SET(__pyx_t_6, function); | |
25074 __pyx_t_8 = 1; | |
25075 } | |
25076 } | |
25077 #endif | |
25078 { | |
25079 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; | |
25080 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
25081 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
25082 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
25083 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) | |
25084 __Pyx_GOTREF(__pyx_t_1); | |
25085 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
25086 } | |
25087 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25088 | |
25089 /* "(tree fragment)":13 | |
25090 * cdef __pyx_unpickle_asBed__set_state(asBed __pyx_result, tuple __pyx_state): | |
25091 * __pyx_result.encoding = __pyx_state[0] | |
25092 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< | |
25093 * __pyx_result.__dict__.update(__pyx_state[1]) | |
25094 */ | |
25095 } | |
25096 | |
25097 /* "(tree fragment)":11 | |
25098 * __pyx_unpickle_asBed__set_state(<asBed> __pyx_result, __pyx_state) | |
25099 * return __pyx_result | |
25100 * cdef __pyx_unpickle_asBed__set_state(asBed __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
25101 * __pyx_result.encoding = __pyx_state[0] | |
25102 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
25103 */ | |
25104 | |
25105 /* function exit code */ | |
25106 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
25107 goto __pyx_L0; | |
25108 __pyx_L1_error:; | |
25109 __Pyx_XDECREF(__pyx_t_1); | |
25110 __Pyx_XDECREF(__pyx_t_5); | |
25111 __Pyx_XDECREF(__pyx_t_6); | |
25112 __Pyx_XDECREF(__pyx_t_7); | |
25113 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_asBed__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
25114 __pyx_r = 0; | |
25115 __pyx_L0:; | |
25116 __Pyx_XGIVEREF(__pyx_r); | |
25117 __Pyx_TraceReturn(__pyx_r, 0); | |
25118 __Pyx_RefNannyFinishContext(); | |
25119 return __pyx_r; | |
25120 } | |
25121 | |
25122 /* "(tree fragment)":1 | |
25123 * def __pyx_unpickle_asVCF(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
25124 * cdef object __pyx_PickleError | |
25125 * cdef object __pyx_result | |
25126 */ | |
25127 | |
25128 /* Python wrapper */ | |
25129 static PyObject *__pyx_pw_5pysam_9libctabix_17__pyx_unpickle_asVCF(PyObject *__pyx_self, | |
25130 #if CYTHON_METH_FASTCALL | |
25131 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
25132 #else | |
25133 PyObject *__pyx_args, PyObject *__pyx_kwds | |
25134 #endif | |
25135 ); /*proto*/ | |
25136 PyDoc_STRVAR(__pyx_doc_5pysam_9libctabix_16__pyx_unpickle_asVCF, "__pyx_unpickle_asVCF(__pyx_type, long __pyx_checksum, __pyx_state)"); | |
25137 static PyMethodDef __pyx_mdef_5pysam_9libctabix_17__pyx_unpickle_asVCF = {"__pyx_unpickle_asVCF", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_17__pyx_unpickle_asVCF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_16__pyx_unpickle_asVCF}; | |
25138 static PyObject *__pyx_pw_5pysam_9libctabix_17__pyx_unpickle_asVCF(PyObject *__pyx_self, | |
25139 #if CYTHON_METH_FASTCALL | |
25140 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
25141 #else | |
25142 PyObject *__pyx_args, PyObject *__pyx_kwds | |
25143 #endif | |
25144 ) { | |
25145 PyObject *__pyx_v___pyx_type = 0; | |
25146 long __pyx_v___pyx_checksum; | |
25147 PyObject *__pyx_v___pyx_state = 0; | |
25148 #if !CYTHON_METH_FASTCALL | |
25149 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
25150 #endif | |
25151 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
25152 PyObject* values[3] = {0,0,0}; | |
25153 int __pyx_lineno = 0; | |
25154 const char *__pyx_filename = NULL; | |
25155 int __pyx_clineno = 0; | |
25156 PyObject *__pyx_r = 0; | |
25157 __Pyx_RefNannyDeclarations | |
25158 __Pyx_RefNannySetupContext("__pyx_unpickle_asVCF (wrapper)", 0); | |
25159 #if !CYTHON_METH_FASTCALL | |
25160 #if CYTHON_ASSUME_SAFE_MACROS | |
25161 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
25162 #else | |
25163 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
25164 #endif | |
25165 #endif | |
25166 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
25167 { | |
25168 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; | |
25169 if (__pyx_kwds) { | |
25170 Py_ssize_t kw_args; | |
25171 switch (__pyx_nargs) { | |
25172 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
25173 CYTHON_FALLTHROUGH; | |
25174 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
25175 CYTHON_FALLTHROUGH; | |
25176 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
25177 CYTHON_FALLTHROUGH; | |
25178 case 0: break; | |
25179 default: goto __pyx_L5_argtuple_error; | |
25180 } | |
25181 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
25182 switch (__pyx_nargs) { | |
25183 case 0: | |
25184 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { | |
25185 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
25186 kw_args--; | |
25187 } | |
25188 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
25189 else goto __pyx_L5_argtuple_error; | |
25190 CYTHON_FALLTHROUGH; | |
25191 case 1: | |
25192 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { | |
25193 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
25194 kw_args--; | |
25195 } | |
25196 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
25197 else { | |
25198 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asVCF", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) | |
25199 } | |
25200 CYTHON_FALLTHROUGH; | |
25201 case 2: | |
25202 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
25203 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
25204 kw_args--; | |
25205 } | |
25206 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
25207 else { | |
25208 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asVCF", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) | |
25209 } | |
25210 } | |
25211 if (unlikely(kw_args > 0)) { | |
25212 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
25213 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_asVCF") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) | |
25214 } | |
25215 } else if (unlikely(__pyx_nargs != 3)) { | |
25216 goto __pyx_L5_argtuple_error; | |
25217 } else { | |
25218 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
25219 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
25220 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
25221 } | |
25222 __pyx_v___pyx_type = values[0]; | |
25223 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
25224 __pyx_v___pyx_state = values[2]; | |
25225 } | |
25226 goto __pyx_L6_skip; | |
25227 __pyx_L5_argtuple_error:; | |
25228 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_asVCF", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) | |
25229 __pyx_L6_skip:; | |
25230 goto __pyx_L4_argument_unpacking_done; | |
25231 __pyx_L3_error:; | |
25232 { | |
25233 Py_ssize_t __pyx_temp; | |
25234 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
25235 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
25236 } | |
25237 } | |
25238 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_asVCF", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
25239 __Pyx_RefNannyFinishContext(); | |
25240 return NULL; | |
25241 __pyx_L4_argument_unpacking_done:; | |
25242 __pyx_r = __pyx_pf_5pysam_9libctabix_16__pyx_unpickle_asVCF(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); | |
25243 | |
25244 /* function exit code */ | |
25245 { | |
25246 Py_ssize_t __pyx_temp; | |
25247 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
25248 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
25249 } | |
25250 } | |
25251 __Pyx_RefNannyFinishContext(); | |
25252 return __pyx_r; | |
25253 } | |
25254 | |
25255 static PyObject *__pyx_pf_5pysam_9libctabix_16__pyx_unpickle_asVCF(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { | |
25256 PyObject *__pyx_v___pyx_PickleError = 0; | |
25257 PyObject *__pyx_v___pyx_result = 0; | |
25258 PyObject *__pyx_r = NULL; | |
25259 __Pyx_TraceDeclarations | |
25260 __Pyx_RefNannyDeclarations | |
25261 PyObject *__pyx_t_1 = NULL; | |
25262 int __pyx_t_2; | |
25263 PyObject *__pyx_t_3 = NULL; | |
25264 PyObject *__pyx_t_4 = NULL; | |
25265 unsigned int __pyx_t_5; | |
25266 int __pyx_lineno = 0; | |
25267 const char *__pyx_filename = NULL; | |
25268 int __pyx_clineno = 0; | |
25269 __Pyx_TraceFrameInit(__pyx_codeobj__61) | |
25270 __Pyx_RefNannySetupContext("__pyx_unpickle_asVCF", 1); | |
25271 __Pyx_TraceCall("__pyx_unpickle_asVCF", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
25272 | |
25273 /* "(tree fragment)":4 | |
25274 * cdef object __pyx_PickleError | |
25275 * cdef object __pyx_result | |
25276 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): # <<<<<<<<<<<<<< | |
25277 * from pickle import PickleError as __pyx_PickleError | |
25278 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
25279 */ | |
25280 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) | |
25281 __Pyx_GOTREF(__pyx_t_1); | |
25282 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__55, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error) | |
25283 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25284 if (__pyx_t_2) { | |
25285 | |
25286 /* "(tree fragment)":5 | |
25287 * cdef object __pyx_result | |
25288 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): | |
25289 * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< | |
25290 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
25291 * __pyx_result = asVCF.__new__(__pyx_type) | |
25292 */ | |
25293 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
25294 __Pyx_GOTREF(__pyx_t_1); | |
25295 __Pyx_INCREF(__pyx_n_s_PickleError); | |
25296 __Pyx_GIVEREF(__pyx_n_s_PickleError); | |
25297 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error); | |
25298 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) | |
25299 __Pyx_GOTREF(__pyx_t_3); | |
25300 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25301 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
25302 __Pyx_GOTREF(__pyx_t_1); | |
25303 __Pyx_INCREF(__pyx_t_1); | |
25304 __pyx_v___pyx_PickleError = __pyx_t_1; | |
25305 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25306 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
25307 | |
25308 /* "(tree fragment)":6 | |
25309 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): | |
25310 * from pickle import PickleError as __pyx_PickleError | |
25311 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum # <<<<<<<<<<<<<< | |
25312 * __pyx_result = asVCF.__new__(__pyx_type) | |
25313 * if __pyx_state is not None: | |
25314 */ | |
25315 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) | |
25316 __Pyx_GOTREF(__pyx_t_3); | |
25317 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) | |
25318 __Pyx_GOTREF(__pyx_t_1); | |
25319 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
25320 __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); | |
25321 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25322 __PYX_ERR(1, 6, __pyx_L1_error) | |
25323 | |
25324 /* "(tree fragment)":4 | |
25325 * cdef object __pyx_PickleError | |
25326 * cdef object __pyx_result | |
25327 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): # <<<<<<<<<<<<<< | |
25328 * from pickle import PickleError as __pyx_PickleError | |
25329 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
25330 */ | |
25331 } | |
25332 | |
25333 /* "(tree fragment)":7 | |
25334 * from pickle import PickleError as __pyx_PickleError | |
25335 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
25336 * __pyx_result = asVCF.__new__(__pyx_type) # <<<<<<<<<<<<<< | |
25337 * if __pyx_state is not None: | |
25338 * __pyx_unpickle_asVCF__set_state(<asVCF> __pyx_result, __pyx_state) | |
25339 */ | |
25340 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5pysam_9libctabix_asVCF), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) | |
25341 __Pyx_GOTREF(__pyx_t_3); | |
25342 __pyx_t_4 = NULL; | |
25343 __pyx_t_5 = 0; | |
25344 #if CYTHON_UNPACK_METHODS | |
25345 if (likely(PyMethod_Check(__pyx_t_3))) { | |
25346 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
25347 if (likely(__pyx_t_4)) { | |
25348 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
25349 __Pyx_INCREF(__pyx_t_4); | |
25350 __Pyx_INCREF(function); | |
25351 __Pyx_DECREF_SET(__pyx_t_3, function); | |
25352 __pyx_t_5 = 1; | |
25353 } | |
25354 } | |
25355 #endif | |
25356 { | |
25357 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; | |
25358 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
25359 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
25360 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) | |
25361 __Pyx_GOTREF(__pyx_t_1); | |
25362 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
25363 } | |
25364 __pyx_v___pyx_result = __pyx_t_1; | |
25365 __pyx_t_1 = 0; | |
25366 | |
25367 /* "(tree fragment)":8 | |
25368 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
25369 * __pyx_result = asVCF.__new__(__pyx_type) | |
25370 * if __pyx_state is not None: # <<<<<<<<<<<<<< | |
25371 * __pyx_unpickle_asVCF__set_state(<asVCF> __pyx_result, __pyx_state) | |
25372 * return __pyx_result | |
25373 */ | |
25374 __pyx_t_2 = (__pyx_v___pyx_state != Py_None); | |
25375 if (__pyx_t_2) { | |
25376 | |
25377 /* "(tree fragment)":9 | |
25378 * __pyx_result = asVCF.__new__(__pyx_type) | |
25379 * if __pyx_state is not None: | |
25380 * __pyx_unpickle_asVCF__set_state(<asVCF> __pyx_result, __pyx_state) # <<<<<<<<<<<<<< | |
25381 * return __pyx_result | |
25382 * cdef __pyx_unpickle_asVCF__set_state(asVCF __pyx_result, tuple __pyx_state): | |
25383 */ | |
25384 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error) | |
25385 __pyx_t_1 = __pyx_f_5pysam_9libctabix___pyx_unpickle_asVCF__set_state(((struct __pyx_obj_5pysam_9libctabix_asVCF *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) | |
25386 __Pyx_GOTREF(__pyx_t_1); | |
25387 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25388 | |
25389 /* "(tree fragment)":8 | |
25390 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
25391 * __pyx_result = asVCF.__new__(__pyx_type) | |
25392 * if __pyx_state is not None: # <<<<<<<<<<<<<< | |
25393 * __pyx_unpickle_asVCF__set_state(<asVCF> __pyx_result, __pyx_state) | |
25394 * return __pyx_result | |
25395 */ | |
25396 } | |
25397 | |
25398 /* "(tree fragment)":10 | |
25399 * if __pyx_state is not None: | |
25400 * __pyx_unpickle_asVCF__set_state(<asVCF> __pyx_result, __pyx_state) | |
25401 * return __pyx_result # <<<<<<<<<<<<<< | |
25402 * cdef __pyx_unpickle_asVCF__set_state(asVCF __pyx_result, tuple __pyx_state): | |
25403 * __pyx_result.encoding = __pyx_state[0] | |
25404 */ | |
25405 __Pyx_XDECREF(__pyx_r); | |
25406 __Pyx_INCREF(__pyx_v___pyx_result); | |
25407 __pyx_r = __pyx_v___pyx_result; | |
25408 goto __pyx_L0; | |
25409 | |
25410 /* "(tree fragment)":1 | |
25411 * def __pyx_unpickle_asVCF(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
25412 * cdef object __pyx_PickleError | |
25413 * cdef object __pyx_result | |
25414 */ | |
25415 | |
25416 /* function exit code */ | |
25417 __pyx_L1_error:; | |
25418 __Pyx_XDECREF(__pyx_t_1); | |
25419 __Pyx_XDECREF(__pyx_t_3); | |
25420 __Pyx_XDECREF(__pyx_t_4); | |
25421 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_asVCF", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
25422 __pyx_r = NULL; | |
25423 __pyx_L0:; | |
25424 __Pyx_XDECREF(__pyx_v___pyx_PickleError); | |
25425 __Pyx_XDECREF(__pyx_v___pyx_result); | |
25426 __Pyx_XGIVEREF(__pyx_r); | |
25427 __Pyx_TraceReturn(__pyx_r, 0); | |
25428 __Pyx_RefNannyFinishContext(); | |
25429 return __pyx_r; | |
25430 } | |
25431 | |
25432 /* "(tree fragment)":11 | |
25433 * __pyx_unpickle_asVCF__set_state(<asVCF> __pyx_result, __pyx_state) | |
25434 * return __pyx_result | |
25435 * cdef __pyx_unpickle_asVCF__set_state(asVCF __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
25436 * __pyx_result.encoding = __pyx_state[0] | |
25437 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
25438 */ | |
25439 | |
25440 static PyObject *__pyx_f_5pysam_9libctabix___pyx_unpickle_asVCF__set_state(struct __pyx_obj_5pysam_9libctabix_asVCF *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { | |
25441 PyObject *__pyx_r = NULL; | |
25442 __Pyx_TraceDeclarations | |
25443 __Pyx_RefNannyDeclarations | |
25444 PyObject *__pyx_t_1 = NULL; | |
25445 int __pyx_t_2; | |
25446 Py_ssize_t __pyx_t_3; | |
25447 int __pyx_t_4; | |
25448 PyObject *__pyx_t_5 = NULL; | |
25449 PyObject *__pyx_t_6 = NULL; | |
25450 PyObject *__pyx_t_7 = NULL; | |
25451 unsigned int __pyx_t_8; | |
25452 int __pyx_lineno = 0; | |
25453 const char *__pyx_filename = NULL; | |
25454 int __pyx_clineno = 0; | |
25455 __Pyx_RefNannySetupContext("__pyx_unpickle_asVCF__set_state", 1); | |
25456 __Pyx_TraceCall("__pyx_unpickle_asVCF__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error)); | |
25457 | |
25458 /* "(tree fragment)":12 | |
25459 * return __pyx_result | |
25460 * cdef __pyx_unpickle_asVCF__set_state(asVCF __pyx_result, tuple __pyx_state): | |
25461 * __pyx_result.encoding = __pyx_state[0] # <<<<<<<<<<<<<< | |
25462 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
25463 * __pyx_result.__dict__.update(__pyx_state[1]) | |
25464 */ | |
25465 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
25466 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
25467 __PYX_ERR(1, 12, __pyx_L1_error) | |
25468 } | |
25469 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) | |
25470 __Pyx_GOTREF(__pyx_t_1); | |
25471 __Pyx_GIVEREF(__pyx_t_1); | |
25472 __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.encoding); | |
25473 __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.encoding); | |
25474 __pyx_v___pyx_result->__pyx_base.encoding = __pyx_t_1; | |
25475 __pyx_t_1 = 0; | |
25476 | |
25477 /* "(tree fragment)":13 | |
25478 * cdef __pyx_unpickle_asVCF__set_state(asVCF __pyx_result, tuple __pyx_state): | |
25479 * __pyx_result.encoding = __pyx_state[0] | |
25480 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< | |
25481 * __pyx_result.__dict__.update(__pyx_state[1]) | |
25482 */ | |
25483 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
25484 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); | |
25485 __PYX_ERR(1, 13, __pyx_L1_error) | |
25486 } | |
25487 __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) | |
25488 __pyx_t_4 = (__pyx_t_3 > 1); | |
25489 if (__pyx_t_4) { | |
25490 } else { | |
25491 __pyx_t_2 = __pyx_t_4; | |
25492 goto __pyx_L4_bool_binop_done; | |
25493 } | |
25494 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) | |
25495 __pyx_t_2 = __pyx_t_4; | |
25496 __pyx_L4_bool_binop_done:; | |
25497 if (__pyx_t_2) { | |
25498 | |
25499 /* "(tree fragment)":14 | |
25500 * __pyx_result.encoding = __pyx_state[0] | |
25501 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
25502 * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< | |
25503 */ | |
25504 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) | |
25505 __Pyx_GOTREF(__pyx_t_5); | |
25506 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) | |
25507 __Pyx_GOTREF(__pyx_t_6); | |
25508 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
25509 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
25510 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
25511 __PYX_ERR(1, 14, __pyx_L1_error) | |
25512 } | |
25513 __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) | |
25514 __Pyx_GOTREF(__pyx_t_5); | |
25515 __pyx_t_7 = NULL; | |
25516 __pyx_t_8 = 0; | |
25517 #if CYTHON_UNPACK_METHODS | |
25518 if (likely(PyMethod_Check(__pyx_t_6))) { | |
25519 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); | |
25520 if (likely(__pyx_t_7)) { | |
25521 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
25522 __Pyx_INCREF(__pyx_t_7); | |
25523 __Pyx_INCREF(function); | |
25524 __Pyx_DECREF_SET(__pyx_t_6, function); | |
25525 __pyx_t_8 = 1; | |
25526 } | |
25527 } | |
25528 #endif | |
25529 { | |
25530 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; | |
25531 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
25532 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
25533 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
25534 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) | |
25535 __Pyx_GOTREF(__pyx_t_1); | |
25536 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
25537 } | |
25538 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
25539 | |
25540 /* "(tree fragment)":13 | |
25541 * cdef __pyx_unpickle_asVCF__set_state(asVCF __pyx_result, tuple __pyx_state): | |
25542 * __pyx_result.encoding = __pyx_state[0] | |
25543 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< | |
25544 * __pyx_result.__dict__.update(__pyx_state[1]) | |
25545 */ | |
25546 } | |
25547 | |
25548 /* "(tree fragment)":11 | |
25549 * __pyx_unpickle_asVCF__set_state(<asVCF> __pyx_result, __pyx_state) | |
25550 * return __pyx_result | |
25551 * cdef __pyx_unpickle_asVCF__set_state(asVCF __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
25552 * __pyx_result.encoding = __pyx_state[0] | |
25553 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
25554 */ | |
25555 | |
25556 /* function exit code */ | |
25557 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
25558 goto __pyx_L0; | |
25559 __pyx_L1_error:; | |
25560 __Pyx_XDECREF(__pyx_t_1); | |
25561 __Pyx_XDECREF(__pyx_t_5); | |
25562 __Pyx_XDECREF(__pyx_t_6); | |
25563 __Pyx_XDECREF(__pyx_t_7); | |
25564 __Pyx_AddTraceback("pysam.libctabix.__pyx_unpickle_asVCF__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
25565 __pyx_r = 0; | |
25566 __pyx_L0:; | |
25567 __Pyx_XGIVEREF(__pyx_r); | |
25568 __Pyx_TraceReturn(__pyx_r, 0); | |
25569 __Pyx_RefNannyFinishContext(); | |
25570 return __pyx_r; | |
25571 } | |
25572 static struct __pyx_vtabstruct_5pysam_9libctabix_tabix_file_iterator __pyx_vtable_5pysam_9libctabix_tabix_file_iterator; | |
25573 | |
25574 static PyObject *__pyx_tp_new_5pysam_9libctabix_tabix_file_iterator(PyTypeObject *t, PyObject *a, PyObject *k) { | |
25575 struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *p; | |
25576 PyObject *o; | |
25577 #if CYTHON_COMPILING_IN_LIMITED_API | |
25578 allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); | |
25579 o = alloc_func(t, 0); | |
25580 #else | |
25581 if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { | |
25582 o = (*t->tp_alloc)(t, 0); | |
25583 } else { | |
25584 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); | |
25585 } | |
25586 if (unlikely(!o)) return 0; | |
25587 #endif | |
25588 p = ((struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *)o); | |
25589 p->__pyx_vtab = __pyx_vtabptr_5pysam_9libctabix_tabix_file_iterator; | |
25590 p->parser = ((struct __pyx_obj_5pysam_9libctabix_Parser *)Py_None); Py_INCREF(Py_None); | |
25591 p->infile = Py_None; Py_INCREF(Py_None); | |
25592 if (unlikely(__pyx_pw_5pysam_9libctabix_19tabix_file_iterator_1__cinit__(o, a, k) < 0)) goto bad; | |
25593 return o; | |
25594 bad: | |
25595 Py_DECREF(o); o = 0; | |
25596 return NULL; | |
25597 } | |
25598 | |
25599 static void __pyx_tp_dealloc_5pysam_9libctabix_tabix_file_iterator(PyObject *o) { | |
25600 struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *p = (struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *)o; | |
25601 #if CYTHON_USE_TP_FINALIZE | |
25602 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { | |
25603 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5pysam_9libctabix_tabix_file_iterator) { | |
25604 if (PyObject_CallFinalizerFromDealloc(o)) return; | |
25605 } | |
25606 } | |
25607 #endif | |
25608 PyObject_GC_UnTrack(o); | |
25609 { | |
25610 PyObject *etype, *eval, *etb; | |
25611 PyErr_Fetch(&etype, &eval, &etb); | |
25612 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); | |
25613 __pyx_pw_5pysam_9libctabix_19tabix_file_iterator_5__dealloc__(o); | |
25614 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); | |
25615 PyErr_Restore(etype, eval, etb); | |
25616 } | |
25617 Py_CLEAR(p->parser); | |
25618 Py_CLEAR(p->infile); | |
25619 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY | |
25620 (*Py_TYPE(o)->tp_free)(o); | |
25621 #else | |
25622 { | |
25623 freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); | |
25624 if (tp_free) tp_free(o); | |
25625 } | |
25626 #endif | |
25627 } | |
25628 | |
25629 static int __pyx_tp_traverse_5pysam_9libctabix_tabix_file_iterator(PyObject *o, visitproc v, void *a) { | |
25630 int e; | |
25631 struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *p = (struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *)o; | |
25632 if (p->parser) { | |
25633 e = (*v)(((PyObject *)p->parser), a); if (e) return e; | |
25634 } | |
25635 if (p->infile) { | |
25636 e = (*v)(p->infile, a); if (e) return e; | |
25637 } | |
25638 return 0; | |
25639 } | |
25640 | |
25641 static int __pyx_tp_clear_5pysam_9libctabix_tabix_file_iterator(PyObject *o) { | |
25642 PyObject* tmp; | |
25643 struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *p = (struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *)o; | |
25644 tmp = ((PyObject*)p->parser); | |
25645 p->parser = ((struct __pyx_obj_5pysam_9libctabix_Parser *)Py_None); Py_INCREF(Py_None); | |
25646 Py_XDECREF(tmp); | |
25647 tmp = ((PyObject*)p->infile); | |
25648 p->infile = Py_None; Py_INCREF(Py_None); | |
25649 Py_XDECREF(tmp); | |
25650 return 0; | |
25651 } | |
25652 | |
25653 static PyObject *__pyx_specialmethod___pyx_pw_5pysam_9libctabix_19tabix_file_iterator_7__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) { | |
25654 PyObject *res = __pyx_pw_5pysam_9libctabix_19tabix_file_iterator_7__next__(self); | |
25655 if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); } | |
25656 return res; | |
25657 } | |
25658 | |
25659 static PyMethodDef __pyx_methods_5pysam_9libctabix_tabix_file_iterator[] = { | |
25660 {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_5pysam_9libctabix_19tabix_file_iterator_7__next__, METH_NOARGS|METH_COEXIST, 0}, | |
25661 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_19tabix_file_iterator_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_19tabix_file_iterator_8__reduce_cython__}, | |
25662 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_19tabix_file_iterator_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_19tabix_file_iterator_10__setstate_cython__}, | |
25663 {0, 0, 0, 0} | |
25664 }; | |
25665 #if CYTHON_USE_TYPE_SPECS | |
25666 static PyType_Slot __pyx_type_5pysam_9libctabix_tabix_file_iterator_slots[] = { | |
25667 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5pysam_9libctabix_tabix_file_iterator}, | |
25668 {Py_tp_doc, (void *)PyDoc_STR("iterate over a compressed or uncompressed ``infile``.\n ")}, | |
25669 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libctabix_tabix_file_iterator}, | |
25670 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libctabix_tabix_file_iterator}, | |
25671 {Py_tp_iter, (void *)__pyx_pw_5pysam_9libctabix_19tabix_file_iterator_3__iter__}, | |
25672 {Py_tp_iternext, (void *)__pyx_pw_5pysam_9libctabix_19tabix_file_iterator_7__next__}, | |
25673 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libctabix_tabix_file_iterator}, | |
25674 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libctabix_tabix_file_iterator}, | |
25675 {0, 0}, | |
25676 }; | |
25677 static PyType_Spec __pyx_type_5pysam_9libctabix_tabix_file_iterator_spec = { | |
25678 "pysam.libctabix.tabix_file_iterator", | |
25679 sizeof(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator), | |
25680 0, | |
25681 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, | |
25682 __pyx_type_5pysam_9libctabix_tabix_file_iterator_slots, | |
25683 }; | |
25684 #else | |
25685 | |
25686 static PyTypeObject __pyx_type_5pysam_9libctabix_tabix_file_iterator = { | |
25687 PyVarObject_HEAD_INIT(0, 0) | |
25688 "pysam.libctabix.""tabix_file_iterator", /*tp_name*/ | |
25689 sizeof(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator), /*tp_basicsize*/ | |
25690 0, /*tp_itemsize*/ | |
25691 __pyx_tp_dealloc_5pysam_9libctabix_tabix_file_iterator, /*tp_dealloc*/ | |
25692 #if PY_VERSION_HEX < 0x030800b4 | |
25693 0, /*tp_print*/ | |
25694 #endif | |
25695 #if PY_VERSION_HEX >= 0x030800b4 | |
25696 0, /*tp_vectorcall_offset*/ | |
25697 #endif | |
25698 0, /*tp_getattr*/ | |
25699 0, /*tp_setattr*/ | |
25700 #if PY_MAJOR_VERSION < 3 | |
25701 0, /*tp_compare*/ | |
25702 #endif | |
25703 #if PY_MAJOR_VERSION >= 3 | |
25704 0, /*tp_as_async*/ | |
25705 #endif | |
25706 0, /*tp_repr*/ | |
25707 0, /*tp_as_number*/ | |
25708 0, /*tp_as_sequence*/ | |
25709 0, /*tp_as_mapping*/ | |
25710 0, /*tp_hash*/ | |
25711 0, /*tp_call*/ | |
25712 0, /*tp_str*/ | |
25713 0, /*tp_getattro*/ | |
25714 0, /*tp_setattro*/ | |
25715 0, /*tp_as_buffer*/ | |
25716 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | |
25717 PyDoc_STR("iterate over a compressed or uncompressed ``infile``.\n "), /*tp_doc*/ | |
25718 __pyx_tp_traverse_5pysam_9libctabix_tabix_file_iterator, /*tp_traverse*/ | |
25719 __pyx_tp_clear_5pysam_9libctabix_tabix_file_iterator, /*tp_clear*/ | |
25720 0, /*tp_richcompare*/ | |
25721 0, /*tp_weaklistoffset*/ | |
25722 __pyx_pw_5pysam_9libctabix_19tabix_file_iterator_3__iter__, /*tp_iter*/ | |
25723 __pyx_pw_5pysam_9libctabix_19tabix_file_iterator_7__next__, /*tp_iternext*/ | |
25724 __pyx_methods_5pysam_9libctabix_tabix_file_iterator, /*tp_methods*/ | |
25725 0, /*tp_members*/ | |
25726 0, /*tp_getset*/ | |
25727 0, /*tp_base*/ | |
25728 0, /*tp_dict*/ | |
25729 0, /*tp_descr_get*/ | |
25730 0, /*tp_descr_set*/ | |
25731 #if !CYTHON_USE_TYPE_SPECS | |
25732 0, /*tp_dictoffset*/ | |
25733 #endif | |
25734 0, /*tp_init*/ | |
25735 0, /*tp_alloc*/ | |
25736 __pyx_tp_new_5pysam_9libctabix_tabix_file_iterator, /*tp_new*/ | |
25737 0, /*tp_free*/ | |
25738 0, /*tp_is_gc*/ | |
25739 0, /*tp_bases*/ | |
25740 0, /*tp_mro*/ | |
25741 0, /*tp_cache*/ | |
25742 0, /*tp_subclasses*/ | |
25743 0, /*tp_weaklist*/ | |
25744 0, /*tp_del*/ | |
25745 0, /*tp_version_tag*/ | |
25746 #if PY_VERSION_HEX >= 0x030400a1 | |
25747 #if CYTHON_USE_TP_FINALIZE | |
25748 0, /*tp_finalize*/ | |
25749 #else | |
25750 NULL, /*tp_finalize*/ | |
25751 #endif | |
25752 #endif | |
25753 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
25754 0, /*tp_vectorcall*/ | |
25755 #endif | |
25756 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
25757 0, /*tp_print*/ | |
25758 #endif | |
25759 #if PY_VERSION_HEX >= 0x030C0000 | |
25760 0, /*tp_watched*/ | |
25761 #endif | |
25762 #if PY_VERSION_HEX >= 0x030d00A4 | |
25763 0, /*tp_versions_used*/ | |
25764 #endif | |
25765 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
25766 0, /*tp_pypy_flags*/ | |
25767 #endif | |
25768 }; | |
25769 #endif | |
25770 static struct __pyx_vtabstruct_5pysam_9libctabix_TabixFile __pyx_vtable_5pysam_9libctabix_TabixFile; | |
25771 | |
25772 static PyObject *__pyx_tp_new_5pysam_9libctabix_TabixFile(PyTypeObject *t, PyObject *a, PyObject *k) { | |
25773 struct __pyx_obj_5pysam_9libctabix_TabixFile *p; | |
25774 PyObject *o = __Pyx_PyType_GetSlot(__pyx_ptype_5pysam_10libchtslib_HTSFile, tp_new, newfunc)(t, a, k); | |
25775 if (unlikely(!o)) return 0; | |
25776 p = ((struct __pyx_obj_5pysam_9libctabix_TabixFile *)o); | |
25777 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile*)__pyx_vtabptr_5pysam_9libctabix_TabixFile; | |
25778 p->filename_index = Py_None; Py_INCREF(Py_None); | |
25779 p->parser = ((struct __pyx_obj_5pysam_9libctabix_Parser *)Py_None); Py_INCREF(Py_None); | |
25780 p->encoding = Py_None; Py_INCREF(Py_None); | |
25781 if (unlikely(__pyx_pw_5pysam_9libctabix_9TabixFile_1__cinit__(o, a, k) < 0)) goto bad; | |
25782 return o; | |
25783 bad: | |
25784 Py_DECREF(o); o = 0; | |
25785 return NULL; | |
25786 } | |
25787 | |
25788 static void __pyx_tp_dealloc_5pysam_9libctabix_TabixFile(PyObject *o) { | |
25789 struct __pyx_obj_5pysam_9libctabix_TabixFile *p = (struct __pyx_obj_5pysam_9libctabix_TabixFile *)o; | |
25790 #if CYTHON_USE_TP_FINALIZE | |
25791 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { | |
25792 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5pysam_9libctabix_TabixFile) { | |
25793 if (PyObject_CallFinalizerFromDealloc(o)) return; | |
25794 } | |
25795 } | |
25796 #endif | |
25797 PyObject_GC_UnTrack(o); | |
25798 { | |
25799 PyObject *etype, *eval, *etb; | |
25800 PyErr_Fetch(&etype, &eval, &etb); | |
25801 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); | |
25802 __pyx_pw_5pysam_9libctabix_9TabixFile_11__dealloc__(o); | |
25803 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); | |
25804 PyErr_Restore(etype, eval, etb); | |
25805 } | |
25806 Py_CLEAR(p->filename_index); | |
25807 Py_CLEAR(p->parser); | |
25808 Py_CLEAR(p->encoding); | |
25809 #if PY_MAJOR_VERSION < 3 | |
25810 if (!(__pyx_ptype_5pysam_10libchtslib_HTSFile) || PyType_IS_GC(__pyx_ptype_5pysam_10libchtslib_HTSFile)) PyObject_GC_Track(o); | |
25811 #else | |
25812 if (PyType_IS_GC(__pyx_ptype_5pysam_10libchtslib_HTSFile)) PyObject_GC_Track(o); | |
25813 #endif | |
25814 if (likely(__pyx_ptype_5pysam_10libchtslib_HTSFile)) __Pyx_PyType_GetSlot(__pyx_ptype_5pysam_10libchtslib_HTSFile, tp_dealloc, destructor)(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5pysam_9libctabix_TabixFile); | |
25815 } | |
25816 | |
25817 static int __pyx_tp_traverse_5pysam_9libctabix_TabixFile(PyObject *o, visitproc v, void *a) { | |
25818 int e; | |
25819 struct __pyx_obj_5pysam_9libctabix_TabixFile *p = (struct __pyx_obj_5pysam_9libctabix_TabixFile *)o; | |
25820 e = ((likely(__pyx_ptype_5pysam_10libchtslib_HTSFile)) ? ((__pyx_ptype_5pysam_10libchtslib_HTSFile->tp_traverse) ? __pyx_ptype_5pysam_10libchtslib_HTSFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5pysam_9libctabix_TabixFile)); if (e) return e; | |
25821 if (p->filename_index) { | |
25822 e = (*v)(p->filename_index, a); if (e) return e; | |
25823 } | |
25824 if (p->parser) { | |
25825 e = (*v)(((PyObject *)p->parser), a); if (e) return e; | |
25826 } | |
25827 if (p->encoding) { | |
25828 e = (*v)(p->encoding, a); if (e) return e; | |
25829 } | |
25830 return 0; | |
25831 } | |
25832 | |
25833 static int __pyx_tp_clear_5pysam_9libctabix_TabixFile(PyObject *o) { | |
25834 PyObject* tmp; | |
25835 struct __pyx_obj_5pysam_9libctabix_TabixFile *p = (struct __pyx_obj_5pysam_9libctabix_TabixFile *)o; | |
25836 if (likely(__pyx_ptype_5pysam_10libchtslib_HTSFile)) { if (__pyx_ptype_5pysam_10libchtslib_HTSFile->tp_clear) __pyx_ptype_5pysam_10libchtslib_HTSFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5pysam_9libctabix_TabixFile); | |
25837 tmp = ((PyObject*)p->filename_index); | |
25838 p->filename_index = Py_None; Py_INCREF(Py_None); | |
25839 Py_XDECREF(tmp); | |
25840 tmp = ((PyObject*)p->parser); | |
25841 p->parser = ((struct __pyx_obj_5pysam_9libctabix_Parser *)Py_None); Py_INCREF(Py_None); | |
25842 Py_XDECREF(tmp); | |
25843 tmp = ((PyObject*)p->encoding); | |
25844 p->encoding = Py_None; Py_INCREF(Py_None); | |
25845 Py_XDECREF(tmp); | |
25846 return 0; | |
25847 } | |
25848 | |
25849 static PyObject *__pyx_getprop_5pysam_9libctabix_9TabixFile_header(PyObject *o, CYTHON_UNUSED void *x) { | |
25850 return __pyx_pw_5pysam_9libctabix_9TabixFile_6header_1__get__(o); | |
25851 } | |
25852 | |
25853 static PyObject *__pyx_getprop_5pysam_9libctabix_9TabixFile_contigs(PyObject *o, CYTHON_UNUSED void *x) { | |
25854 return __pyx_pw_5pysam_9libctabix_9TabixFile_7contigs_1__get__(o); | |
25855 } | |
25856 | |
25857 static PyObject *__pyx_getprop_5pysam_9libctabix_9TabixFile_filename_index(PyObject *o, CYTHON_UNUSED void *x) { | |
25858 return __pyx_pw_5pysam_9libctabix_9TabixFile_14filename_index_1__get__(o); | |
25859 } | |
25860 | |
25861 static PyMethodDef __pyx_methods_5pysam_9libctabix_TabixFile[] = { | |
25862 {"_open", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9TabixFile_3_open, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_9TabixFile_2_open}, | |
25863 {"_dup", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9TabixFile_5_dup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_9TabixFile_4_dup}, | |
25864 {"fetch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9TabixFile_7fetch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_9TabixFile_6fetch}, | |
25865 {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9TabixFile_9close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_9TabixFile_8close}, | |
25866 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9TabixFile_13__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_9TabixFile_12__reduce_cython__}, | |
25867 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9TabixFile_15__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_9TabixFile_14__setstate_cython__}, | |
25868 {0, 0, 0, 0} | |
25869 }; | |
25870 | |
25871 static struct PyGetSetDef __pyx_getsets_5pysam_9libctabix_TabixFile[] = { | |
25872 {(char *)"header", __pyx_getprop_5pysam_9libctabix_9TabixFile_header, 0, (char *)PyDoc_STR("the file header.\n\n The file header consists of the lines at the beginning of a\n file that are prefixed by the comment character ``#``.\n \n .. note::\n The header is returned as an iterator presenting lines\n without the newline character.\n "), 0}, | |
25873 {(char *)"contigs", __pyx_getprop_5pysam_9libctabix_9TabixFile_contigs, 0, (char *)PyDoc_STR("list of chromosome names"), 0}, | |
25874 {(char *)"filename_index", __pyx_getprop_5pysam_9libctabix_9TabixFile_filename_index, 0, (char *)0, 0}, | |
25875 {0, 0, 0, 0, 0} | |
25876 }; | |
25877 #if CYTHON_USE_TYPE_SPECS | |
25878 static PyType_Slot __pyx_type_5pysam_9libctabix_TabixFile_slots[] = { | |
25879 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5pysam_9libctabix_TabixFile}, | |
25880 {Py_tp_doc, (void *)PyDoc_STR("Random access to bgzf formatted files that\n have been indexed by :term:`tabix`.\n\n The file is automatically opened. The index file of file\n ``<filename>`` is expected to be called ``<filename>.tbi``\n by default (see parameter `index`).\n \n Parameters\n ----------\n \n filename : string\n Filename of bgzf file to be opened.\n\n index : string\n The filename of the index. If not set, the default is to\n assume that the index is called ``filename.tbi``\n\n mode : char\n The file opening mode. Currently, only ``r`` is permitted.\n \n parser : :class:`pysam.Parser`\n \n sets the default parser for this tabix file. If `parser`\n is None, the results are returned as an unparsed string.\n Otherwise, `parser` is assumed to be a functor that will return\n parsed data (see for example :class:`~pysam.asTuple` and\n :class:`~pysam.asGTF`).\n\n encoding : string\n\n The encoding passed to the parser\n\n threads: integer\n Number of threads to use for decompressing Tabix files.\n (Default=1)\n\n\n Raises\n ------\n \n ValueError\n if index file is missing.\n\n IOError\n if file could not be opened\n ")}, | |
25881 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libctabix_TabixFile}, | |
25882 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libctabix_TabixFile}, | |
25883 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libctabix_TabixFile}, | |
25884 {Py_tp_getset, (void *)__pyx_getsets_5pysam_9libctabix_TabixFile}, | |
25885 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libctabix_TabixFile}, | |
25886 {0, 0}, | |
25887 }; | |
25888 static PyType_Spec __pyx_type_5pysam_9libctabix_TabixFile_spec = { | |
25889 "pysam.libctabix.TabixFile", | |
25890 sizeof(struct __pyx_obj_5pysam_9libctabix_TabixFile), | |
25891 0, | |
25892 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, | |
25893 __pyx_type_5pysam_9libctabix_TabixFile_slots, | |
25894 }; | |
25895 #else | |
25896 | |
25897 static PyTypeObject __pyx_type_5pysam_9libctabix_TabixFile = { | |
25898 PyVarObject_HEAD_INIT(0, 0) | |
25899 "pysam.libctabix.""TabixFile", /*tp_name*/ | |
25900 sizeof(struct __pyx_obj_5pysam_9libctabix_TabixFile), /*tp_basicsize*/ | |
25901 0, /*tp_itemsize*/ | |
25902 __pyx_tp_dealloc_5pysam_9libctabix_TabixFile, /*tp_dealloc*/ | |
25903 #if PY_VERSION_HEX < 0x030800b4 | |
25904 0, /*tp_print*/ | |
25905 #endif | |
25906 #if PY_VERSION_HEX >= 0x030800b4 | |
25907 0, /*tp_vectorcall_offset*/ | |
25908 #endif | |
25909 0, /*tp_getattr*/ | |
25910 0, /*tp_setattr*/ | |
25911 #if PY_MAJOR_VERSION < 3 | |
25912 0, /*tp_compare*/ | |
25913 #endif | |
25914 #if PY_MAJOR_VERSION >= 3 | |
25915 0, /*tp_as_async*/ | |
25916 #endif | |
25917 0, /*tp_repr*/ | |
25918 0, /*tp_as_number*/ | |
25919 0, /*tp_as_sequence*/ | |
25920 0, /*tp_as_mapping*/ | |
25921 0, /*tp_hash*/ | |
25922 0, /*tp_call*/ | |
25923 0, /*tp_str*/ | |
25924 0, /*tp_getattro*/ | |
25925 0, /*tp_setattro*/ | |
25926 0, /*tp_as_buffer*/ | |
25927 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*/ | |
25928 PyDoc_STR("Random access to bgzf formatted files that\n have been indexed by :term:`tabix`.\n\n The file is automatically opened. The index file of file\n ``<filename>`` is expected to be called ``<filename>.tbi``\n by default (see parameter `index`).\n \n Parameters\n ----------\n \n filename : string\n Filename of bgzf file to be opened.\n\n index : string\n The filename of the index. If not set, the default is to\n assume that the index is called ``filename.tbi``\n\n mode : char\n The file opening mode. Currently, only ``r`` is permitted.\n \n parser : :class:`pysam.Parser`\n \n sets the default parser for this tabix file. If `parser`\n is None, the results are returned as an unparsed string.\n Otherwise, `parser` is assumed to be a functor that will return\n parsed data (see for example :class:`~pysam.asTuple` and\n :class:`~pysam.asGTF`).\n\n encoding : string\n\n The encoding passed to the parser\n\n threads: integer\n Number of threads to use for decompressing Tabix files.\n (Default=1)\n\n\n Raises\n ------\n \n ValueError\n if index file is missing.\n\n IOError\n if file could not be opened\n "), /*tp_doc*/ | |
25929 __pyx_tp_traverse_5pysam_9libctabix_TabixFile, /*tp_traverse*/ | |
25930 __pyx_tp_clear_5pysam_9libctabix_TabixFile, /*tp_clear*/ | |
25931 0, /*tp_richcompare*/ | |
25932 0, /*tp_weaklistoffset*/ | |
25933 0, /*tp_iter*/ | |
25934 0, /*tp_iternext*/ | |
25935 __pyx_methods_5pysam_9libctabix_TabixFile, /*tp_methods*/ | |
25936 0, /*tp_members*/ | |
25937 __pyx_getsets_5pysam_9libctabix_TabixFile, /*tp_getset*/ | |
25938 0, /*tp_base*/ | |
25939 0, /*tp_dict*/ | |
25940 0, /*tp_descr_get*/ | |
25941 0, /*tp_descr_set*/ | |
25942 #if !CYTHON_USE_TYPE_SPECS | |
25943 0, /*tp_dictoffset*/ | |
25944 #endif | |
25945 0, /*tp_init*/ | |
25946 0, /*tp_alloc*/ | |
25947 __pyx_tp_new_5pysam_9libctabix_TabixFile, /*tp_new*/ | |
25948 0, /*tp_free*/ | |
25949 0, /*tp_is_gc*/ | |
25950 0, /*tp_bases*/ | |
25951 0, /*tp_mro*/ | |
25952 0, /*tp_cache*/ | |
25953 0, /*tp_subclasses*/ | |
25954 0, /*tp_weaklist*/ | |
25955 0, /*tp_del*/ | |
25956 0, /*tp_version_tag*/ | |
25957 #if PY_VERSION_HEX >= 0x030400a1 | |
25958 #if CYTHON_USE_TP_FINALIZE | |
25959 0, /*tp_finalize*/ | |
25960 #else | |
25961 NULL, /*tp_finalize*/ | |
25962 #endif | |
25963 #endif | |
25964 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
25965 0, /*tp_vectorcall*/ | |
25966 #endif | |
25967 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
25968 0, /*tp_print*/ | |
25969 #endif | |
25970 #if PY_VERSION_HEX >= 0x030C0000 | |
25971 0, /*tp_watched*/ | |
25972 #endif | |
25973 #if PY_VERSION_HEX >= 0x030d00A4 | |
25974 0, /*tp_versions_used*/ | |
25975 #endif | |
25976 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
25977 0, /*tp_pypy_flags*/ | |
25978 #endif | |
25979 }; | |
25980 #endif | |
25981 static struct __pyx_vtabstruct_5pysam_9libctabix_Parser __pyx_vtable_5pysam_9libctabix_Parser; | |
25982 | |
25983 static PyObject *__pyx_tp_new_5pysam_9libctabix_Parser(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { | |
25984 struct __pyx_obj_5pysam_9libctabix_Parser *p; | |
25985 PyObject *o; | |
25986 #if CYTHON_COMPILING_IN_LIMITED_API | |
25987 allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); | |
25988 o = alloc_func(t, 0); | |
25989 #else | |
25990 if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { | |
25991 o = (*t->tp_alloc)(t, 0); | |
25992 } else { | |
25993 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); | |
25994 } | |
25995 if (unlikely(!o)) return 0; | |
25996 #endif | |
25997 p = ((struct __pyx_obj_5pysam_9libctabix_Parser *)o); | |
25998 p->__pyx_vtab = __pyx_vtabptr_5pysam_9libctabix_Parser; | |
25999 p->encoding = Py_None; Py_INCREF(Py_None); | |
26000 return o; | |
26001 } | |
26002 | |
26003 static void __pyx_tp_dealloc_5pysam_9libctabix_Parser(PyObject *o) { | |
26004 struct __pyx_obj_5pysam_9libctabix_Parser *p = (struct __pyx_obj_5pysam_9libctabix_Parser *)o; | |
26005 #if CYTHON_USE_TP_FINALIZE | |
26006 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { | |
26007 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5pysam_9libctabix_Parser) { | |
26008 if (PyObject_CallFinalizerFromDealloc(o)) return; | |
26009 } | |
26010 } | |
26011 #endif | |
26012 PyObject_GC_UnTrack(o); | |
26013 Py_CLEAR(p->encoding); | |
26014 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY | |
26015 (*Py_TYPE(o)->tp_free)(o); | |
26016 #else | |
26017 { | |
26018 freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); | |
26019 if (tp_free) tp_free(o); | |
26020 } | |
26021 #endif | |
26022 } | |
26023 | |
26024 static int __pyx_tp_traverse_5pysam_9libctabix_Parser(PyObject *o, visitproc v, void *a) { | |
26025 int e; | |
26026 struct __pyx_obj_5pysam_9libctabix_Parser *p = (struct __pyx_obj_5pysam_9libctabix_Parser *)o; | |
26027 if (p->encoding) { | |
26028 e = (*v)(p->encoding, a); if (e) return e; | |
26029 } | |
26030 return 0; | |
26031 } | |
26032 | |
26033 static int __pyx_tp_clear_5pysam_9libctabix_Parser(PyObject *o) { | |
26034 PyObject* tmp; | |
26035 struct __pyx_obj_5pysam_9libctabix_Parser *p = (struct __pyx_obj_5pysam_9libctabix_Parser *)o; | |
26036 tmp = ((PyObject*)p->encoding); | |
26037 p->encoding = Py_None; Py_INCREF(Py_None); | |
26038 Py_XDECREF(tmp); | |
26039 return 0; | |
26040 } | |
26041 | |
26042 static PyMethodDef __pyx_methods_5pysam_9libctabix_Parser[] = { | |
26043 {"set_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_6Parser_3set_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_6Parser_2set_encoding}, | |
26044 {"get_encoding", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_6Parser_5get_encoding, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_6Parser_4get_encoding}, | |
26045 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_6Parser_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_6Parser_8__reduce_cython__}, | |
26046 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_6Parser_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_6Parser_10__setstate_cython__}, | |
26047 {0, 0, 0, 0} | |
26048 }; | |
26049 #if CYTHON_USE_TYPE_SPECS | |
26050 static PyType_Slot __pyx_type_5pysam_9libctabix_Parser_slots[] = { | |
26051 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5pysam_9libctabix_Parser}, | |
26052 {Py_tp_call, (void *)__pyx_pw_5pysam_9libctabix_6Parser_7__call__}, | |
26053 {Py_tp_doc, (void *)PyDoc_STR("Parser(encoding=u'ascii')")}, | |
26054 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libctabix_Parser}, | |
26055 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libctabix_Parser}, | |
26056 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libctabix_Parser}, | |
26057 {Py_tp_init, (void *)__pyx_pw_5pysam_9libctabix_6Parser_1__init__}, | |
26058 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libctabix_Parser}, | |
26059 {0, 0}, | |
26060 }; | |
26061 static PyType_Spec __pyx_type_5pysam_9libctabix_Parser_spec = { | |
26062 "pysam.libctabix.Parser", | |
26063 sizeof(struct __pyx_obj_5pysam_9libctabix_Parser), | |
26064 0, | |
26065 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, | |
26066 __pyx_type_5pysam_9libctabix_Parser_slots, | |
26067 }; | |
26068 #else | |
26069 | |
26070 static PyTypeObject __pyx_type_5pysam_9libctabix_Parser = { | |
26071 PyVarObject_HEAD_INIT(0, 0) | |
26072 "pysam.libctabix.""Parser", /*tp_name*/ | |
26073 sizeof(struct __pyx_obj_5pysam_9libctabix_Parser), /*tp_basicsize*/ | |
26074 0, /*tp_itemsize*/ | |
26075 __pyx_tp_dealloc_5pysam_9libctabix_Parser, /*tp_dealloc*/ | |
26076 #if PY_VERSION_HEX < 0x030800b4 | |
26077 0, /*tp_print*/ | |
26078 #endif | |
26079 #if PY_VERSION_HEX >= 0x030800b4 | |
26080 0, /*tp_vectorcall_offset*/ | |
26081 #endif | |
26082 0, /*tp_getattr*/ | |
26083 0, /*tp_setattr*/ | |
26084 #if PY_MAJOR_VERSION < 3 | |
26085 0, /*tp_compare*/ | |
26086 #endif | |
26087 #if PY_MAJOR_VERSION >= 3 | |
26088 0, /*tp_as_async*/ | |
26089 #endif | |
26090 0, /*tp_repr*/ | |
26091 0, /*tp_as_number*/ | |
26092 0, /*tp_as_sequence*/ | |
26093 0, /*tp_as_mapping*/ | |
26094 0, /*tp_hash*/ | |
26095 __pyx_pw_5pysam_9libctabix_6Parser_7__call__, /*tp_call*/ | |
26096 0, /*tp_str*/ | |
26097 0, /*tp_getattro*/ | |
26098 0, /*tp_setattro*/ | |
26099 0, /*tp_as_buffer*/ | |
26100 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | |
26101 PyDoc_STR("Parser(encoding=u'ascii')"), /*tp_doc*/ | |
26102 __pyx_tp_traverse_5pysam_9libctabix_Parser, /*tp_traverse*/ | |
26103 __pyx_tp_clear_5pysam_9libctabix_Parser, /*tp_clear*/ | |
26104 0, /*tp_richcompare*/ | |
26105 0, /*tp_weaklistoffset*/ | |
26106 0, /*tp_iter*/ | |
26107 0, /*tp_iternext*/ | |
26108 __pyx_methods_5pysam_9libctabix_Parser, /*tp_methods*/ | |
26109 0, /*tp_members*/ | |
26110 0, /*tp_getset*/ | |
26111 0, /*tp_base*/ | |
26112 0, /*tp_dict*/ | |
26113 0, /*tp_descr_get*/ | |
26114 0, /*tp_descr_set*/ | |
26115 #if !CYTHON_USE_TYPE_SPECS | |
26116 0, /*tp_dictoffset*/ | |
26117 #endif | |
26118 __pyx_pw_5pysam_9libctabix_6Parser_1__init__, /*tp_init*/ | |
26119 0, /*tp_alloc*/ | |
26120 __pyx_tp_new_5pysam_9libctabix_Parser, /*tp_new*/ | |
26121 0, /*tp_free*/ | |
26122 0, /*tp_is_gc*/ | |
26123 0, /*tp_bases*/ | |
26124 0, /*tp_mro*/ | |
26125 0, /*tp_cache*/ | |
26126 0, /*tp_subclasses*/ | |
26127 0, /*tp_weaklist*/ | |
26128 0, /*tp_del*/ | |
26129 0, /*tp_version_tag*/ | |
26130 #if PY_VERSION_HEX >= 0x030400a1 | |
26131 #if CYTHON_USE_TP_FINALIZE | |
26132 0, /*tp_finalize*/ | |
26133 #else | |
26134 NULL, /*tp_finalize*/ | |
26135 #endif | |
26136 #endif | |
26137 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
26138 0, /*tp_vectorcall*/ | |
26139 #endif | |
26140 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
26141 0, /*tp_print*/ | |
26142 #endif | |
26143 #if PY_VERSION_HEX >= 0x030C0000 | |
26144 0, /*tp_watched*/ | |
26145 #endif | |
26146 #if PY_VERSION_HEX >= 0x030d00A4 | |
26147 0, /*tp_versions_used*/ | |
26148 #endif | |
26149 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
26150 0, /*tp_pypy_flags*/ | |
26151 #endif | |
26152 }; | |
26153 #endif | |
26154 static struct __pyx_vtabstruct_5pysam_9libctabix_asTuple __pyx_vtable_5pysam_9libctabix_asTuple; | |
26155 | |
26156 static PyObject *__pyx_tp_new_5pysam_9libctabix_asTuple(PyTypeObject *t, PyObject *a, PyObject *k) { | |
26157 struct __pyx_obj_5pysam_9libctabix_asTuple *p; | |
26158 PyObject *o = __pyx_tp_new_5pysam_9libctabix_Parser(t, a, k); | |
26159 if (unlikely(!o)) return 0; | |
26160 p = ((struct __pyx_obj_5pysam_9libctabix_asTuple *)o); | |
26161 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_9libctabix_Parser*)__pyx_vtabptr_5pysam_9libctabix_asTuple; | |
26162 return o; | |
26163 } | |
26164 | |
26165 static PyMethodDef __pyx_methods_5pysam_9libctabix_asTuple[] = { | |
26166 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_7asTuple_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_7asTuple___reduce_cython__}, | |
26167 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_7asTuple_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_7asTuple_2__setstate_cython__}, | |
26168 {0, 0, 0, 0} | |
26169 }; | |
26170 #if CYTHON_USE_TYPE_SPECS | |
26171 static PyType_Slot __pyx_type_5pysam_9libctabix_asTuple_slots[] = { | |
26172 {Py_tp_doc, (void *)PyDoc_STR("converts a :term:`tabix row` into a python tuple.\n\n A field in a row is accessed by numeric index.\n ")}, | |
26173 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libctabix_Parser}, | |
26174 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libctabix_Parser}, | |
26175 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libctabix_asTuple}, | |
26176 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libctabix_asTuple}, | |
26177 {0, 0}, | |
26178 }; | |
26179 static PyType_Spec __pyx_type_5pysam_9libctabix_asTuple_spec = { | |
26180 "pysam.libctabix.asTuple", | |
26181 sizeof(struct __pyx_obj_5pysam_9libctabix_asTuple), | |
26182 0, | |
26183 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, | |
26184 __pyx_type_5pysam_9libctabix_asTuple_slots, | |
26185 }; | |
26186 #else | |
26187 | |
26188 static PyTypeObject __pyx_type_5pysam_9libctabix_asTuple = { | |
26189 PyVarObject_HEAD_INIT(0, 0) | |
26190 "pysam.libctabix.""asTuple", /*tp_name*/ | |
26191 sizeof(struct __pyx_obj_5pysam_9libctabix_asTuple), /*tp_basicsize*/ | |
26192 0, /*tp_itemsize*/ | |
26193 __pyx_tp_dealloc_5pysam_9libctabix_Parser, /*tp_dealloc*/ | |
26194 #if PY_VERSION_HEX < 0x030800b4 | |
26195 0, /*tp_print*/ | |
26196 #endif | |
26197 #if PY_VERSION_HEX >= 0x030800b4 | |
26198 0, /*tp_vectorcall_offset*/ | |
26199 #endif | |
26200 0, /*tp_getattr*/ | |
26201 0, /*tp_setattr*/ | |
26202 #if PY_MAJOR_VERSION < 3 | |
26203 0, /*tp_compare*/ | |
26204 #endif | |
26205 #if PY_MAJOR_VERSION >= 3 | |
26206 0, /*tp_as_async*/ | |
26207 #endif | |
26208 0, /*tp_repr*/ | |
26209 0, /*tp_as_number*/ | |
26210 0, /*tp_as_sequence*/ | |
26211 0, /*tp_as_mapping*/ | |
26212 0, /*tp_hash*/ | |
26213 #if CYTHON_COMPILING_IN_PYPY || 0 | |
26214 __pyx_pw_5pysam_9libctabix_6Parser_7__call__, /*tp_call*/ | |
26215 #else | |
26216 0, /*tp_call*/ | |
26217 #endif | |
26218 0, /*tp_str*/ | |
26219 0, /*tp_getattro*/ | |
26220 0, /*tp_setattro*/ | |
26221 0, /*tp_as_buffer*/ | |
26222 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | |
26223 PyDoc_STR("converts a :term:`tabix row` into a python tuple.\n\n A field in a row is accessed by numeric index.\n "), /*tp_doc*/ | |
26224 __pyx_tp_traverse_5pysam_9libctabix_Parser, /*tp_traverse*/ | |
26225 __pyx_tp_clear_5pysam_9libctabix_Parser, /*tp_clear*/ | |
26226 0, /*tp_richcompare*/ | |
26227 0, /*tp_weaklistoffset*/ | |
26228 0, /*tp_iter*/ | |
26229 0, /*tp_iternext*/ | |
26230 __pyx_methods_5pysam_9libctabix_asTuple, /*tp_methods*/ | |
26231 0, /*tp_members*/ | |
26232 0, /*tp_getset*/ | |
26233 0, /*tp_base*/ | |
26234 0, /*tp_dict*/ | |
26235 0, /*tp_descr_get*/ | |
26236 0, /*tp_descr_set*/ | |
26237 #if !CYTHON_USE_TYPE_SPECS | |
26238 0, /*tp_dictoffset*/ | |
26239 #endif | |
26240 #if CYTHON_COMPILING_IN_PYPY || 0 | |
26241 __pyx_pw_5pysam_9libctabix_6Parser_1__init__, /*tp_init*/ | |
26242 #else | |
26243 0, /*tp_init*/ | |
26244 #endif | |
26245 0, /*tp_alloc*/ | |
26246 __pyx_tp_new_5pysam_9libctabix_asTuple, /*tp_new*/ | |
26247 0, /*tp_free*/ | |
26248 0, /*tp_is_gc*/ | |
26249 0, /*tp_bases*/ | |
26250 0, /*tp_mro*/ | |
26251 0, /*tp_cache*/ | |
26252 0, /*tp_subclasses*/ | |
26253 0, /*tp_weaklist*/ | |
26254 0, /*tp_del*/ | |
26255 0, /*tp_version_tag*/ | |
26256 #if PY_VERSION_HEX >= 0x030400a1 | |
26257 #if CYTHON_USE_TP_FINALIZE | |
26258 0, /*tp_finalize*/ | |
26259 #else | |
26260 NULL, /*tp_finalize*/ | |
26261 #endif | |
26262 #endif | |
26263 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
26264 0, /*tp_vectorcall*/ | |
26265 #endif | |
26266 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
26267 0, /*tp_print*/ | |
26268 #endif | |
26269 #if PY_VERSION_HEX >= 0x030C0000 | |
26270 0, /*tp_watched*/ | |
26271 #endif | |
26272 #if PY_VERSION_HEX >= 0x030d00A4 | |
26273 0, /*tp_versions_used*/ | |
26274 #endif | |
26275 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
26276 0, /*tp_pypy_flags*/ | |
26277 #endif | |
26278 }; | |
26279 #endif | |
26280 static struct __pyx_vtabstruct_5pysam_9libctabix_asGTF __pyx_vtable_5pysam_9libctabix_asGTF; | |
26281 | |
26282 static PyObject *__pyx_tp_new_5pysam_9libctabix_asGTF(PyTypeObject *t, PyObject *a, PyObject *k) { | |
26283 struct __pyx_obj_5pysam_9libctabix_asGTF *p; | |
26284 PyObject *o = __pyx_tp_new_5pysam_9libctabix_Parser(t, a, k); | |
26285 if (unlikely(!o)) return 0; | |
26286 p = ((struct __pyx_obj_5pysam_9libctabix_asGTF *)o); | |
26287 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_9libctabix_Parser*)__pyx_vtabptr_5pysam_9libctabix_asGTF; | |
26288 return o; | |
26289 } | |
26290 | |
26291 static PyMethodDef __pyx_methods_5pysam_9libctabix_asGTF[] = { | |
26292 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_5asGTF_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_5asGTF___reduce_cython__}, | |
26293 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_5asGTF_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_5asGTF_2__setstate_cython__}, | |
26294 {0, 0, 0, 0} | |
26295 }; | |
26296 #if CYTHON_USE_TYPE_SPECS | |
26297 static PyType_Slot __pyx_type_5pysam_9libctabix_asGTF_slots[] = { | |
26298 {Py_tp_doc, (void *)PyDoc_STR("converts a :term:`tabix row` into a GTF record with the following\n fields:\n \n +----------+----------+-------------------------------+\n |*Column* |*Name* |*Content* |\n +----------+----------+-------------------------------+\n |1 |contig |the chromosome name |\n +----------+----------+-------------------------------+\n |2 |feature |The feature type |\n +----------+----------+-------------------------------+\n |3 |source |The feature source |\n +----------+----------+-------------------------------+\n |4 |start |genomic start coordinate |\n | | |(0-based) |\n +----------+----------+-------------------------------+\n |5 |end |genomic end coordinate |\n | | |(0-based) |\n +----------+----------+-------------------------------+\n |6 |score |feature score |\n +----------+----------+-------------------------------+\n |7 |strand |strand |\n +----------+----------+-------------------------------+\n |8 |frame |frame |\n +----------+----------+-------------------------------+\n |9 |attributes|the attribute field |\n +----------+----------+-------------------------------+\n\n GTF formatted entries also define the following fields that\n are derived from the attributes field:\n\n +--------------------+------------------------------+\n |*Name* |*Content* |\n +--------------------+------------------------------+\n |gene_id |the gene identifier |\n +--------------------+------------------------------+\n |transcript_id |the transcript identifier |\n +--------------------+-------------------""-----------+\n\n ")}, | |
26299 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libctabix_Parser}, | |
26300 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libctabix_Parser}, | |
26301 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libctabix_asGTF}, | |
26302 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libctabix_asGTF}, | |
26303 {0, 0}, | |
26304 }; | |
26305 static PyType_Spec __pyx_type_5pysam_9libctabix_asGTF_spec = { | |
26306 "pysam.libctabix.asGTF", | |
26307 sizeof(struct __pyx_obj_5pysam_9libctabix_asGTF), | |
26308 0, | |
26309 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, | |
26310 __pyx_type_5pysam_9libctabix_asGTF_slots, | |
26311 }; | |
26312 #else | |
26313 | |
26314 static PyTypeObject __pyx_type_5pysam_9libctabix_asGTF = { | |
26315 PyVarObject_HEAD_INIT(0, 0) | |
26316 "pysam.libctabix.""asGTF", /*tp_name*/ | |
26317 sizeof(struct __pyx_obj_5pysam_9libctabix_asGTF), /*tp_basicsize*/ | |
26318 0, /*tp_itemsize*/ | |
26319 __pyx_tp_dealloc_5pysam_9libctabix_Parser, /*tp_dealloc*/ | |
26320 #if PY_VERSION_HEX < 0x030800b4 | |
26321 0, /*tp_print*/ | |
26322 #endif | |
26323 #if PY_VERSION_HEX >= 0x030800b4 | |
26324 0, /*tp_vectorcall_offset*/ | |
26325 #endif | |
26326 0, /*tp_getattr*/ | |
26327 0, /*tp_setattr*/ | |
26328 #if PY_MAJOR_VERSION < 3 | |
26329 0, /*tp_compare*/ | |
26330 #endif | |
26331 #if PY_MAJOR_VERSION >= 3 | |
26332 0, /*tp_as_async*/ | |
26333 #endif | |
26334 0, /*tp_repr*/ | |
26335 0, /*tp_as_number*/ | |
26336 0, /*tp_as_sequence*/ | |
26337 0, /*tp_as_mapping*/ | |
26338 0, /*tp_hash*/ | |
26339 #if CYTHON_COMPILING_IN_PYPY || 0 | |
26340 __pyx_pw_5pysam_9libctabix_6Parser_7__call__, /*tp_call*/ | |
26341 #else | |
26342 0, /*tp_call*/ | |
26343 #endif | |
26344 0, /*tp_str*/ | |
26345 0, /*tp_getattro*/ | |
26346 0, /*tp_setattro*/ | |
26347 0, /*tp_as_buffer*/ | |
26348 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | |
26349 PyDoc_STR("converts a :term:`tabix row` into a GTF record with the following\n fields:\n \n +----------+----------+-------------------------------+\n |*Column* |*Name* |*Content* |\n +----------+----------+-------------------------------+\n |1 |contig |the chromosome name |\n +----------+----------+-------------------------------+\n |2 |feature |The feature type |\n +----------+----------+-------------------------------+\n |3 |source |The feature source |\n +----------+----------+-------------------------------+\n |4 |start |genomic start coordinate |\n | | |(0-based) |\n +----------+----------+-------------------------------+\n |5 |end |genomic end coordinate |\n | | |(0-based) |\n +----------+----------+-------------------------------+\n |6 |score |feature score |\n +----------+----------+-------------------------------+\n |7 |strand |strand |\n +----------+----------+-------------------------------+\n |8 |frame |frame |\n +----------+----------+-------------------------------+\n |9 |attributes|the attribute field |\n +----------+----------+-------------------------------+\n\n GTF formatted entries also define the following fields that\n are derived from the attributes field:\n\n +--------------------+------------------------------+\n |*Name* |*Content* |\n +--------------------+------------------------------+\n |gene_id |the gene identifier |\n +--------------------+------------------------------+\n |transcript_id |the transcript identifier |\n +--------------------+-------------------""-----------+\n\n "), /*tp_doc*/ | |
26350 __pyx_tp_traverse_5pysam_9libctabix_Parser, /*tp_traverse*/ | |
26351 __pyx_tp_clear_5pysam_9libctabix_Parser, /*tp_clear*/ | |
26352 0, /*tp_richcompare*/ | |
26353 0, /*tp_weaklistoffset*/ | |
26354 0, /*tp_iter*/ | |
26355 0, /*tp_iternext*/ | |
26356 __pyx_methods_5pysam_9libctabix_asGTF, /*tp_methods*/ | |
26357 0, /*tp_members*/ | |
26358 0, /*tp_getset*/ | |
26359 0, /*tp_base*/ | |
26360 0, /*tp_dict*/ | |
26361 0, /*tp_descr_get*/ | |
26362 0, /*tp_descr_set*/ | |
26363 #if !CYTHON_USE_TYPE_SPECS | |
26364 0, /*tp_dictoffset*/ | |
26365 #endif | |
26366 #if CYTHON_COMPILING_IN_PYPY || 0 | |
26367 __pyx_pw_5pysam_9libctabix_6Parser_1__init__, /*tp_init*/ | |
26368 #else | |
26369 0, /*tp_init*/ | |
26370 #endif | |
26371 0, /*tp_alloc*/ | |
26372 __pyx_tp_new_5pysam_9libctabix_asGTF, /*tp_new*/ | |
26373 0, /*tp_free*/ | |
26374 0, /*tp_is_gc*/ | |
26375 0, /*tp_bases*/ | |
26376 0, /*tp_mro*/ | |
26377 0, /*tp_cache*/ | |
26378 0, /*tp_subclasses*/ | |
26379 0, /*tp_weaklist*/ | |
26380 0, /*tp_del*/ | |
26381 0, /*tp_version_tag*/ | |
26382 #if PY_VERSION_HEX >= 0x030400a1 | |
26383 #if CYTHON_USE_TP_FINALIZE | |
26384 0, /*tp_finalize*/ | |
26385 #else | |
26386 NULL, /*tp_finalize*/ | |
26387 #endif | |
26388 #endif | |
26389 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
26390 0, /*tp_vectorcall*/ | |
26391 #endif | |
26392 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
26393 0, /*tp_print*/ | |
26394 #endif | |
26395 #if PY_VERSION_HEX >= 0x030C0000 | |
26396 0, /*tp_watched*/ | |
26397 #endif | |
26398 #if PY_VERSION_HEX >= 0x030d00A4 | |
26399 0, /*tp_versions_used*/ | |
26400 #endif | |
26401 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
26402 0, /*tp_pypy_flags*/ | |
26403 #endif | |
26404 }; | |
26405 #endif | |
26406 static struct __pyx_vtabstruct_5pysam_9libctabix_asGFF3 __pyx_vtable_5pysam_9libctabix_asGFF3; | |
26407 | |
26408 static PyObject *__pyx_tp_new_5pysam_9libctabix_asGFF3(PyTypeObject *t, PyObject *a, PyObject *k) { | |
26409 struct __pyx_obj_5pysam_9libctabix_asGFF3 *p; | |
26410 PyObject *o = __pyx_tp_new_5pysam_9libctabix_Parser(t, a, k); | |
26411 if (unlikely(!o)) return 0; | |
26412 p = ((struct __pyx_obj_5pysam_9libctabix_asGFF3 *)o); | |
26413 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_9libctabix_Parser*)__pyx_vtabptr_5pysam_9libctabix_asGFF3; | |
26414 return o; | |
26415 } | |
26416 | |
26417 static PyMethodDef __pyx_methods_5pysam_9libctabix_asGFF3[] = { | |
26418 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_6asGFF3_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_6asGFF3___reduce_cython__}, | |
26419 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_6asGFF3_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_6asGFF3_2__setstate_cython__}, | |
26420 {0, 0, 0, 0} | |
26421 }; | |
26422 #if CYTHON_USE_TYPE_SPECS | |
26423 static PyType_Slot __pyx_type_5pysam_9libctabix_asGFF3_slots[] = { | |
26424 {Py_tp_doc, (void *)PyDoc_STR("converts a :term:`tabix row` into a GFF record with the following\n fields:\n \n +----------+----------+-------------------------------+\n |*Column* |*Name* |*Content* |\n +----------+----------+-------------------------------+\n |1 |contig |the chromosome name |\n +----------+----------+-------------------------------+\n |2 |feature |The feature type |\n +----------+----------+-------------------------------+\n |3 |source |The feature source |\n +----------+----------+-------------------------------+\n |4 |start |genomic start coordinate |\n | | |(0-based) |\n +----------+----------+-------------------------------+\n |5 |end |genomic end coordinate |\n | | |(0-based) |\n +----------+----------+-------------------------------+\n |6 |score |feature score |\n +----------+----------+-------------------------------+\n |7 |strand |strand |\n +----------+----------+-------------------------------+\n |8 |frame |frame |\n +----------+----------+-------------------------------+\n |9 |attributes|the attribute field |\n +----------+----------+-------------------------------+\n\n ")}, | |
26425 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libctabix_Parser}, | |
26426 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libctabix_Parser}, | |
26427 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libctabix_asGFF3}, | |
26428 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libctabix_asGFF3}, | |
26429 {0, 0}, | |
26430 }; | |
26431 static PyType_Spec __pyx_type_5pysam_9libctabix_asGFF3_spec = { | |
26432 "pysam.libctabix.asGFF3", | |
26433 sizeof(struct __pyx_obj_5pysam_9libctabix_asGFF3), | |
26434 0, | |
26435 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, | |
26436 __pyx_type_5pysam_9libctabix_asGFF3_slots, | |
26437 }; | |
26438 #else | |
26439 | |
26440 static PyTypeObject __pyx_type_5pysam_9libctabix_asGFF3 = { | |
26441 PyVarObject_HEAD_INIT(0, 0) | |
26442 "pysam.libctabix.""asGFF3", /*tp_name*/ | |
26443 sizeof(struct __pyx_obj_5pysam_9libctabix_asGFF3), /*tp_basicsize*/ | |
26444 0, /*tp_itemsize*/ | |
26445 __pyx_tp_dealloc_5pysam_9libctabix_Parser, /*tp_dealloc*/ | |
26446 #if PY_VERSION_HEX < 0x030800b4 | |
26447 0, /*tp_print*/ | |
26448 #endif | |
26449 #if PY_VERSION_HEX >= 0x030800b4 | |
26450 0, /*tp_vectorcall_offset*/ | |
26451 #endif | |
26452 0, /*tp_getattr*/ | |
26453 0, /*tp_setattr*/ | |
26454 #if PY_MAJOR_VERSION < 3 | |
26455 0, /*tp_compare*/ | |
26456 #endif | |
26457 #if PY_MAJOR_VERSION >= 3 | |
26458 0, /*tp_as_async*/ | |
26459 #endif | |
26460 0, /*tp_repr*/ | |
26461 0, /*tp_as_number*/ | |
26462 0, /*tp_as_sequence*/ | |
26463 0, /*tp_as_mapping*/ | |
26464 0, /*tp_hash*/ | |
26465 #if CYTHON_COMPILING_IN_PYPY || 0 | |
26466 __pyx_pw_5pysam_9libctabix_6Parser_7__call__, /*tp_call*/ | |
26467 #else | |
26468 0, /*tp_call*/ | |
26469 #endif | |
26470 0, /*tp_str*/ | |
26471 0, /*tp_getattro*/ | |
26472 0, /*tp_setattro*/ | |
26473 0, /*tp_as_buffer*/ | |
26474 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | |
26475 PyDoc_STR("converts a :term:`tabix row` into a GFF record with the following\n fields:\n \n +----------+----------+-------------------------------+\n |*Column* |*Name* |*Content* |\n +----------+----------+-------------------------------+\n |1 |contig |the chromosome name |\n +----------+----------+-------------------------------+\n |2 |feature |The feature type |\n +----------+----------+-------------------------------+\n |3 |source |The feature source |\n +----------+----------+-------------------------------+\n |4 |start |genomic start coordinate |\n | | |(0-based) |\n +----------+----------+-------------------------------+\n |5 |end |genomic end coordinate |\n | | |(0-based) |\n +----------+----------+-------------------------------+\n |6 |score |feature score |\n +----------+----------+-------------------------------+\n |7 |strand |strand |\n +----------+----------+-------------------------------+\n |8 |frame |frame |\n +----------+----------+-------------------------------+\n |9 |attributes|the attribute field |\n +----------+----------+-------------------------------+\n\n "), /*tp_doc*/ | |
26476 __pyx_tp_traverse_5pysam_9libctabix_Parser, /*tp_traverse*/ | |
26477 __pyx_tp_clear_5pysam_9libctabix_Parser, /*tp_clear*/ | |
26478 0, /*tp_richcompare*/ | |
26479 0, /*tp_weaklistoffset*/ | |
26480 0, /*tp_iter*/ | |
26481 0, /*tp_iternext*/ | |
26482 __pyx_methods_5pysam_9libctabix_asGFF3, /*tp_methods*/ | |
26483 0, /*tp_members*/ | |
26484 0, /*tp_getset*/ | |
26485 0, /*tp_base*/ | |
26486 0, /*tp_dict*/ | |
26487 0, /*tp_descr_get*/ | |
26488 0, /*tp_descr_set*/ | |
26489 #if !CYTHON_USE_TYPE_SPECS | |
26490 0, /*tp_dictoffset*/ | |
26491 #endif | |
26492 #if CYTHON_COMPILING_IN_PYPY || 0 | |
26493 __pyx_pw_5pysam_9libctabix_6Parser_1__init__, /*tp_init*/ | |
26494 #else | |
26495 0, /*tp_init*/ | |
26496 #endif | |
26497 0, /*tp_alloc*/ | |
26498 __pyx_tp_new_5pysam_9libctabix_asGFF3, /*tp_new*/ | |
26499 0, /*tp_free*/ | |
26500 0, /*tp_is_gc*/ | |
26501 0, /*tp_bases*/ | |
26502 0, /*tp_mro*/ | |
26503 0, /*tp_cache*/ | |
26504 0, /*tp_subclasses*/ | |
26505 0, /*tp_weaklist*/ | |
26506 0, /*tp_del*/ | |
26507 0, /*tp_version_tag*/ | |
26508 #if PY_VERSION_HEX >= 0x030400a1 | |
26509 #if CYTHON_USE_TP_FINALIZE | |
26510 0, /*tp_finalize*/ | |
26511 #else | |
26512 NULL, /*tp_finalize*/ | |
26513 #endif | |
26514 #endif | |
26515 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
26516 0, /*tp_vectorcall*/ | |
26517 #endif | |
26518 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
26519 0, /*tp_print*/ | |
26520 #endif | |
26521 #if PY_VERSION_HEX >= 0x030C0000 | |
26522 0, /*tp_watched*/ | |
26523 #endif | |
26524 #if PY_VERSION_HEX >= 0x030d00A4 | |
26525 0, /*tp_versions_used*/ | |
26526 #endif | |
26527 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
26528 0, /*tp_pypy_flags*/ | |
26529 #endif | |
26530 }; | |
26531 #endif | |
26532 static struct __pyx_vtabstruct_5pysam_9libctabix_asBed __pyx_vtable_5pysam_9libctabix_asBed; | |
26533 | |
26534 static PyObject *__pyx_tp_new_5pysam_9libctabix_asBed(PyTypeObject *t, PyObject *a, PyObject *k) { | |
26535 struct __pyx_obj_5pysam_9libctabix_asBed *p; | |
26536 PyObject *o = __pyx_tp_new_5pysam_9libctabix_Parser(t, a, k); | |
26537 if (unlikely(!o)) return 0; | |
26538 p = ((struct __pyx_obj_5pysam_9libctabix_asBed *)o); | |
26539 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_9libctabix_Parser*)__pyx_vtabptr_5pysam_9libctabix_asBed; | |
26540 return o; | |
26541 } | |
26542 | |
26543 static PyMethodDef __pyx_methods_5pysam_9libctabix_asBed[] = { | |
26544 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_5asBed_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_5asBed___reduce_cython__}, | |
26545 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_5asBed_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_5asBed_2__setstate_cython__}, | |
26546 {0, 0, 0, 0} | |
26547 }; | |
26548 #if CYTHON_USE_TYPE_SPECS | |
26549 static PyType_Slot __pyx_type_5pysam_9libctabix_asBed_slots[] = { | |
26550 {Py_tp_doc, (void *)PyDoc_STR("converts a :term:`tabix row` into a bed record\n with the following fields:\n\n +-----------+-----------+------------------------------------------+\n |*Column* |*Field* |*Contents* |\n | | | |\n +-----------+-----------+------------------------------------------+\n |1 |contig |contig |\n | | | |\n +-----------+-----------+------------------------------------------+\n |2 |start |genomic start coordinate (zero-based) |\n +-----------+-----------+------------------------------------------+\n |3 |end |genomic end coordinate plus one |\n | | |(zero-based) |\n +-----------+-----------+------------------------------------------+\n |4 |name |name of feature. |\n +-----------+-----------+------------------------------------------+\n |5 |score |score of feature |\n +-----------+-----------+------------------------------------------+\n |6 |strand |strand of feature |\n +-----------+-----------+------------------------------------------+\n |7 |thickStart |thickStart |\n +-----------+-----------+------------------------------------------+\n |8 |thickEnd |thickEnd |\n +-----------+-----------+------------------------------------------+\n |9 |itemRGB |itemRGB |\n +-----------+-----------+------------------------------------------+\n |10 |blockCount |number of bocks |\n +-----------+-----------+---------------------------------------""---+\n |11 |blockSizes |',' separated string of block sizes |\n +-----------+-----------+------------------------------------------+\n |12 |blockStarts|',' separated string of block genomic |\n | | |start positions |\n +-----------+-----------+------------------------------------------+\n\n Only the first three fields are required. Additional\n fields are optional, but if one is defined, all the preceding\n need to be defined as well.\n\n ")}, | |
26551 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libctabix_Parser}, | |
26552 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libctabix_Parser}, | |
26553 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libctabix_asBed}, | |
26554 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libctabix_asBed}, | |
26555 {0, 0}, | |
26556 }; | |
26557 static PyType_Spec __pyx_type_5pysam_9libctabix_asBed_spec = { | |
26558 "pysam.libctabix.asBed", | |
26559 sizeof(struct __pyx_obj_5pysam_9libctabix_asBed), | |
26560 0, | |
26561 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, | |
26562 __pyx_type_5pysam_9libctabix_asBed_slots, | |
26563 }; | |
26564 #else | |
26565 | |
26566 static PyTypeObject __pyx_type_5pysam_9libctabix_asBed = { | |
26567 PyVarObject_HEAD_INIT(0, 0) | |
26568 "pysam.libctabix.""asBed", /*tp_name*/ | |
26569 sizeof(struct __pyx_obj_5pysam_9libctabix_asBed), /*tp_basicsize*/ | |
26570 0, /*tp_itemsize*/ | |
26571 __pyx_tp_dealloc_5pysam_9libctabix_Parser, /*tp_dealloc*/ | |
26572 #if PY_VERSION_HEX < 0x030800b4 | |
26573 0, /*tp_print*/ | |
26574 #endif | |
26575 #if PY_VERSION_HEX >= 0x030800b4 | |
26576 0, /*tp_vectorcall_offset*/ | |
26577 #endif | |
26578 0, /*tp_getattr*/ | |
26579 0, /*tp_setattr*/ | |
26580 #if PY_MAJOR_VERSION < 3 | |
26581 0, /*tp_compare*/ | |
26582 #endif | |
26583 #if PY_MAJOR_VERSION >= 3 | |
26584 0, /*tp_as_async*/ | |
26585 #endif | |
26586 0, /*tp_repr*/ | |
26587 0, /*tp_as_number*/ | |
26588 0, /*tp_as_sequence*/ | |
26589 0, /*tp_as_mapping*/ | |
26590 0, /*tp_hash*/ | |
26591 #if CYTHON_COMPILING_IN_PYPY || 0 | |
26592 __pyx_pw_5pysam_9libctabix_6Parser_7__call__, /*tp_call*/ | |
26593 #else | |
26594 0, /*tp_call*/ | |
26595 #endif | |
26596 0, /*tp_str*/ | |
26597 0, /*tp_getattro*/ | |
26598 0, /*tp_setattro*/ | |
26599 0, /*tp_as_buffer*/ | |
26600 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | |
26601 PyDoc_STR("converts a :term:`tabix row` into a bed record\n with the following fields:\n\n +-----------+-----------+------------------------------------------+\n |*Column* |*Field* |*Contents* |\n | | | |\n +-----------+-----------+------------------------------------------+\n |1 |contig |contig |\n | | | |\n +-----------+-----------+------------------------------------------+\n |2 |start |genomic start coordinate (zero-based) |\n +-----------+-----------+------------------------------------------+\n |3 |end |genomic end coordinate plus one |\n | | |(zero-based) |\n +-----------+-----------+------------------------------------------+\n |4 |name |name of feature. |\n +-----------+-----------+------------------------------------------+\n |5 |score |score of feature |\n +-----------+-----------+------------------------------------------+\n |6 |strand |strand of feature |\n +-----------+-----------+------------------------------------------+\n |7 |thickStart |thickStart |\n +-----------+-----------+------------------------------------------+\n |8 |thickEnd |thickEnd |\n +-----------+-----------+------------------------------------------+\n |9 |itemRGB |itemRGB |\n +-----------+-----------+------------------------------------------+\n |10 |blockCount |number of bocks |\n +-----------+-----------+---------------------------------------""---+\n |11 |blockSizes |',' separated string of block sizes |\n +-----------+-----------+------------------------------------------+\n |12 |blockStarts|',' separated string of block genomic |\n | | |start positions |\n +-----------+-----------+------------------------------------------+\n\n Only the first three fields are required. Additional\n fields are optional, but if one is defined, all the preceding\n need to be defined as well.\n\n "), /*tp_doc*/ | |
26602 __pyx_tp_traverse_5pysam_9libctabix_Parser, /*tp_traverse*/ | |
26603 __pyx_tp_clear_5pysam_9libctabix_Parser, /*tp_clear*/ | |
26604 0, /*tp_richcompare*/ | |
26605 0, /*tp_weaklistoffset*/ | |
26606 0, /*tp_iter*/ | |
26607 0, /*tp_iternext*/ | |
26608 __pyx_methods_5pysam_9libctabix_asBed, /*tp_methods*/ | |
26609 0, /*tp_members*/ | |
26610 0, /*tp_getset*/ | |
26611 0, /*tp_base*/ | |
26612 0, /*tp_dict*/ | |
26613 0, /*tp_descr_get*/ | |
26614 0, /*tp_descr_set*/ | |
26615 #if !CYTHON_USE_TYPE_SPECS | |
26616 0, /*tp_dictoffset*/ | |
26617 #endif | |
26618 #if CYTHON_COMPILING_IN_PYPY || 0 | |
26619 __pyx_pw_5pysam_9libctabix_6Parser_1__init__, /*tp_init*/ | |
26620 #else | |
26621 0, /*tp_init*/ | |
26622 #endif | |
26623 0, /*tp_alloc*/ | |
26624 __pyx_tp_new_5pysam_9libctabix_asBed, /*tp_new*/ | |
26625 0, /*tp_free*/ | |
26626 0, /*tp_is_gc*/ | |
26627 0, /*tp_bases*/ | |
26628 0, /*tp_mro*/ | |
26629 0, /*tp_cache*/ | |
26630 0, /*tp_subclasses*/ | |
26631 0, /*tp_weaklist*/ | |
26632 0, /*tp_del*/ | |
26633 0, /*tp_version_tag*/ | |
26634 #if PY_VERSION_HEX >= 0x030400a1 | |
26635 #if CYTHON_USE_TP_FINALIZE | |
26636 0, /*tp_finalize*/ | |
26637 #else | |
26638 NULL, /*tp_finalize*/ | |
26639 #endif | |
26640 #endif | |
26641 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
26642 0, /*tp_vectorcall*/ | |
26643 #endif | |
26644 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
26645 0, /*tp_print*/ | |
26646 #endif | |
26647 #if PY_VERSION_HEX >= 0x030C0000 | |
26648 0, /*tp_watched*/ | |
26649 #endif | |
26650 #if PY_VERSION_HEX >= 0x030d00A4 | |
26651 0, /*tp_versions_used*/ | |
26652 #endif | |
26653 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
26654 0, /*tp_pypy_flags*/ | |
26655 #endif | |
26656 }; | |
26657 #endif | |
26658 static struct __pyx_vtabstruct_5pysam_9libctabix_asVCF __pyx_vtable_5pysam_9libctabix_asVCF; | |
26659 | |
26660 static PyObject *__pyx_tp_new_5pysam_9libctabix_asVCF(PyTypeObject *t, PyObject *a, PyObject *k) { | |
26661 struct __pyx_obj_5pysam_9libctabix_asVCF *p; | |
26662 PyObject *o = __pyx_tp_new_5pysam_9libctabix_Parser(t, a, k); | |
26663 if (unlikely(!o)) return 0; | |
26664 p = ((struct __pyx_obj_5pysam_9libctabix_asVCF *)o); | |
26665 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_9libctabix_Parser*)__pyx_vtabptr_5pysam_9libctabix_asVCF; | |
26666 return o; | |
26667 } | |
26668 | |
26669 static PyMethodDef __pyx_methods_5pysam_9libctabix_asVCF[] = { | |
26670 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_5asVCF_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_5asVCF___reduce_cython__}, | |
26671 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_5asVCF_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_5asVCF_2__setstate_cython__}, | |
26672 {0, 0, 0, 0} | |
26673 }; | |
26674 #if CYTHON_USE_TYPE_SPECS | |
26675 static PyType_Slot __pyx_type_5pysam_9libctabix_asVCF_slots[] = { | |
26676 {Py_tp_doc, (void *)PyDoc_STR("converts a :term:`tabix row` into a VCF record with\n the following fields:\n \n +----------+---------+------------------------------------+\n |*Column* |*Field* |*Contents* |\n | | | |\n +----------+---------+------------------------------------+\n |1 |contig |chromosome |\n +----------+---------+------------------------------------+\n |2 |pos |chromosomal position, zero-based |\n +----------+---------+------------------------------------+\n |3 |id |id |\n +----------+---------+------------------------------------+\n |4 |ref |reference allele |\n +----------+---------+------------------------------------+\n |5 |alt |alternate alleles |\n +----------+---------+------------------------------------+\n |6 |qual |quality |\n +----------+---------+------------------------------------+\n |7 |filter |filter |\n +----------+---------+------------------------------------+\n |8 |info |info |\n +----------+---------+------------------------------------+\n |9 |format |format specifier. |\n +----------+---------+------------------------------------+\n\n Access to genotypes is via index::\n\n contig = vcf.contig\n first_sample_genotype = vcf[0]\n second_sample_genotype = vcf[1]\n\n ")}, | |
26677 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libctabix_Parser}, | |
26678 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libctabix_Parser}, | |
26679 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libctabix_asVCF}, | |
26680 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libctabix_asVCF}, | |
26681 {0, 0}, | |
26682 }; | |
26683 static PyType_Spec __pyx_type_5pysam_9libctabix_asVCF_spec = { | |
26684 "pysam.libctabix.asVCF", | |
26685 sizeof(struct __pyx_obj_5pysam_9libctabix_asVCF), | |
26686 0, | |
26687 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, | |
26688 __pyx_type_5pysam_9libctabix_asVCF_slots, | |
26689 }; | |
26690 #else | |
26691 | |
26692 static PyTypeObject __pyx_type_5pysam_9libctabix_asVCF = { | |
26693 PyVarObject_HEAD_INIT(0, 0) | |
26694 "pysam.libctabix.""asVCF", /*tp_name*/ | |
26695 sizeof(struct __pyx_obj_5pysam_9libctabix_asVCF), /*tp_basicsize*/ | |
26696 0, /*tp_itemsize*/ | |
26697 __pyx_tp_dealloc_5pysam_9libctabix_Parser, /*tp_dealloc*/ | |
26698 #if PY_VERSION_HEX < 0x030800b4 | |
26699 0, /*tp_print*/ | |
26700 #endif | |
26701 #if PY_VERSION_HEX >= 0x030800b4 | |
26702 0, /*tp_vectorcall_offset*/ | |
26703 #endif | |
26704 0, /*tp_getattr*/ | |
26705 0, /*tp_setattr*/ | |
26706 #if PY_MAJOR_VERSION < 3 | |
26707 0, /*tp_compare*/ | |
26708 #endif | |
26709 #if PY_MAJOR_VERSION >= 3 | |
26710 0, /*tp_as_async*/ | |
26711 #endif | |
26712 0, /*tp_repr*/ | |
26713 0, /*tp_as_number*/ | |
26714 0, /*tp_as_sequence*/ | |
26715 0, /*tp_as_mapping*/ | |
26716 0, /*tp_hash*/ | |
26717 #if CYTHON_COMPILING_IN_PYPY || 0 | |
26718 __pyx_pw_5pysam_9libctabix_6Parser_7__call__, /*tp_call*/ | |
26719 #else | |
26720 0, /*tp_call*/ | |
26721 #endif | |
26722 0, /*tp_str*/ | |
26723 0, /*tp_getattro*/ | |
26724 0, /*tp_setattro*/ | |
26725 0, /*tp_as_buffer*/ | |
26726 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | |
26727 PyDoc_STR("converts a :term:`tabix row` into a VCF record with\n the following fields:\n \n +----------+---------+------------------------------------+\n |*Column* |*Field* |*Contents* |\n | | | |\n +----------+---------+------------------------------------+\n |1 |contig |chromosome |\n +----------+---------+------------------------------------+\n |2 |pos |chromosomal position, zero-based |\n +----------+---------+------------------------------------+\n |3 |id |id |\n +----------+---------+------------------------------------+\n |4 |ref |reference allele |\n +----------+---------+------------------------------------+\n |5 |alt |alternate alleles |\n +----------+---------+------------------------------------+\n |6 |qual |quality |\n +----------+---------+------------------------------------+\n |7 |filter |filter |\n +----------+---------+------------------------------------+\n |8 |info |info |\n +----------+---------+------------------------------------+\n |9 |format |format specifier. |\n +----------+---------+------------------------------------+\n\n Access to genotypes is via index::\n\n contig = vcf.contig\n first_sample_genotype = vcf[0]\n second_sample_genotype = vcf[1]\n\n "), /*tp_doc*/ | |
26728 __pyx_tp_traverse_5pysam_9libctabix_Parser, /*tp_traverse*/ | |
26729 __pyx_tp_clear_5pysam_9libctabix_Parser, /*tp_clear*/ | |
26730 0, /*tp_richcompare*/ | |
26731 0, /*tp_weaklistoffset*/ | |
26732 0, /*tp_iter*/ | |
26733 0, /*tp_iternext*/ | |
26734 __pyx_methods_5pysam_9libctabix_asVCF, /*tp_methods*/ | |
26735 0, /*tp_members*/ | |
26736 0, /*tp_getset*/ | |
26737 0, /*tp_base*/ | |
26738 0, /*tp_dict*/ | |
26739 0, /*tp_descr_get*/ | |
26740 0, /*tp_descr_set*/ | |
26741 #if !CYTHON_USE_TYPE_SPECS | |
26742 0, /*tp_dictoffset*/ | |
26743 #endif | |
26744 #if CYTHON_COMPILING_IN_PYPY || 0 | |
26745 __pyx_pw_5pysam_9libctabix_6Parser_1__init__, /*tp_init*/ | |
26746 #else | |
26747 0, /*tp_init*/ | |
26748 #endif | |
26749 0, /*tp_alloc*/ | |
26750 __pyx_tp_new_5pysam_9libctabix_asVCF, /*tp_new*/ | |
26751 0, /*tp_free*/ | |
26752 0, /*tp_is_gc*/ | |
26753 0, /*tp_bases*/ | |
26754 0, /*tp_mro*/ | |
26755 0, /*tp_cache*/ | |
26756 0, /*tp_subclasses*/ | |
26757 0, /*tp_weaklist*/ | |
26758 0, /*tp_del*/ | |
26759 0, /*tp_version_tag*/ | |
26760 #if PY_VERSION_HEX >= 0x030400a1 | |
26761 #if CYTHON_USE_TP_FINALIZE | |
26762 0, /*tp_finalize*/ | |
26763 #else | |
26764 NULL, /*tp_finalize*/ | |
26765 #endif | |
26766 #endif | |
26767 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
26768 0, /*tp_vectorcall*/ | |
26769 #endif | |
26770 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
26771 0, /*tp_print*/ | |
26772 #endif | |
26773 #if PY_VERSION_HEX >= 0x030C0000 | |
26774 0, /*tp_watched*/ | |
26775 #endif | |
26776 #if PY_VERSION_HEX >= 0x030d00A4 | |
26777 0, /*tp_versions_used*/ | |
26778 #endif | |
26779 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
26780 0, /*tp_pypy_flags*/ | |
26781 #endif | |
26782 }; | |
26783 #endif | |
26784 static struct __pyx_vtabstruct_5pysam_9libctabix_TabixIterator __pyx_vtable_5pysam_9libctabix_TabixIterator; | |
26785 | |
26786 static PyObject *__pyx_tp_new_5pysam_9libctabix_TabixIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { | |
26787 struct __pyx_obj_5pysam_9libctabix_TabixIterator *p; | |
26788 PyObject *o; | |
26789 #if CYTHON_COMPILING_IN_LIMITED_API | |
26790 allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); | |
26791 o = alloc_func(t, 0); | |
26792 #else | |
26793 if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { | |
26794 o = (*t->tp_alloc)(t, 0); | |
26795 } else { | |
26796 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); | |
26797 } | |
26798 if (unlikely(!o)) return 0; | |
26799 #endif | |
26800 p = ((struct __pyx_obj_5pysam_9libctabix_TabixIterator *)o); | |
26801 p->__pyx_vtab = __pyx_vtabptr_5pysam_9libctabix_TabixIterator; | |
26802 p->tabixfile = ((struct __pyx_obj_5pysam_9libctabix_TabixFile *)Py_None); Py_INCREF(Py_None); | |
26803 p->encoding = Py_None; Py_INCREF(Py_None); | |
26804 return o; | |
26805 } | |
26806 | |
26807 static void __pyx_tp_dealloc_5pysam_9libctabix_TabixIterator(PyObject *o) { | |
26808 struct __pyx_obj_5pysam_9libctabix_TabixIterator *p = (struct __pyx_obj_5pysam_9libctabix_TabixIterator *)o; | |
26809 #if CYTHON_USE_TP_FINALIZE | |
26810 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { | |
26811 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5pysam_9libctabix_TabixIterator) { | |
26812 if (PyObject_CallFinalizerFromDealloc(o)) return; | |
26813 } | |
26814 } | |
26815 #endif | |
26816 PyObject_GC_UnTrack(o); | |
26817 { | |
26818 PyObject *etype, *eval, *etb; | |
26819 PyErr_Fetch(&etype, &eval, &etb); | |
26820 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); | |
26821 __pyx_pw_5pysam_9libctabix_13TabixIterator_7__dealloc__(o); | |
26822 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); | |
26823 PyErr_Restore(etype, eval, etb); | |
26824 } | |
26825 Py_CLEAR(p->tabixfile); | |
26826 Py_CLEAR(p->encoding); | |
26827 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY | |
26828 (*Py_TYPE(o)->tp_free)(o); | |
26829 #else | |
26830 { | |
26831 freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); | |
26832 if (tp_free) tp_free(o); | |
26833 } | |
26834 #endif | |
26835 } | |
26836 | |
26837 static int __pyx_tp_traverse_5pysam_9libctabix_TabixIterator(PyObject *o, visitproc v, void *a) { | |
26838 int e; | |
26839 struct __pyx_obj_5pysam_9libctabix_TabixIterator *p = (struct __pyx_obj_5pysam_9libctabix_TabixIterator *)o; | |
26840 if (p->tabixfile) { | |
26841 e = (*v)(((PyObject *)p->tabixfile), a); if (e) return e; | |
26842 } | |
26843 if (p->encoding) { | |
26844 e = (*v)(p->encoding, a); if (e) return e; | |
26845 } | |
26846 return 0; | |
26847 } | |
26848 | |
26849 static int __pyx_tp_clear_5pysam_9libctabix_TabixIterator(PyObject *o) { | |
26850 PyObject* tmp; | |
26851 struct __pyx_obj_5pysam_9libctabix_TabixIterator *p = (struct __pyx_obj_5pysam_9libctabix_TabixIterator *)o; | |
26852 tmp = ((PyObject*)p->tabixfile); | |
26853 p->tabixfile = ((struct __pyx_obj_5pysam_9libctabix_TabixFile *)Py_None); Py_INCREF(Py_None); | |
26854 Py_XDECREF(tmp); | |
26855 tmp = ((PyObject*)p->encoding); | |
26856 p->encoding = Py_None; Py_INCREF(Py_None); | |
26857 Py_XDECREF(tmp); | |
26858 return 0; | |
26859 } | |
26860 | |
26861 static PyObject *__pyx_specialmethod___pyx_pw_5pysam_9libctabix_13TabixIterator_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) { | |
26862 PyObject *res = __pyx_pw_5pysam_9libctabix_13TabixIterator_5__next__(self); | |
26863 if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); } | |
26864 return res; | |
26865 } | |
26866 | |
26867 static PyMethodDef __pyx_methods_5pysam_9libctabix_TabixIterator[] = { | |
26868 {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_5pysam_9libctabix_13TabixIterator_5__next__, METH_NOARGS|METH_COEXIST, __pyx_doc_5pysam_9libctabix_13TabixIterator_4__next__}, | |
26869 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_13TabixIterator_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_13TabixIterator_8__reduce_cython__}, | |
26870 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_13TabixIterator_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_13TabixIterator_10__setstate_cython__}, | |
26871 {0, 0, 0, 0} | |
26872 }; | |
26873 #if CYTHON_USE_TYPE_SPECS | |
26874 static PyType_Slot __pyx_type_5pysam_9libctabix_TabixIterator_slots[] = { | |
26875 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5pysam_9libctabix_TabixIterator}, | |
26876 {Py_tp_doc, (void *)PyDoc_STR("TabixIterator(encoding=u'ascii')\niterates over rows in *tabixfile* in region\n given by *tid*, *start* and *end*.\n ")}, | |
26877 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libctabix_TabixIterator}, | |
26878 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libctabix_TabixIterator}, | |
26879 {Py_tp_iter, (void *)__pyx_pw_5pysam_9libctabix_13TabixIterator_3__iter__}, | |
26880 {Py_tp_iternext, (void *)__pyx_pw_5pysam_9libctabix_13TabixIterator_5__next__}, | |
26881 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libctabix_TabixIterator}, | |
26882 {Py_tp_init, (void *)__pyx_pw_5pysam_9libctabix_13TabixIterator_1__init__}, | |
26883 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libctabix_TabixIterator}, | |
26884 {0, 0}, | |
26885 }; | |
26886 static PyType_Spec __pyx_type_5pysam_9libctabix_TabixIterator_spec = { | |
26887 "pysam.libctabix.TabixIterator", | |
26888 sizeof(struct __pyx_obj_5pysam_9libctabix_TabixIterator), | |
26889 0, | |
26890 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, | |
26891 __pyx_type_5pysam_9libctabix_TabixIterator_slots, | |
26892 }; | |
26893 #else | |
26894 | |
26895 static PyTypeObject __pyx_type_5pysam_9libctabix_TabixIterator = { | |
26896 PyVarObject_HEAD_INIT(0, 0) | |
26897 "pysam.libctabix.""TabixIterator", /*tp_name*/ | |
26898 sizeof(struct __pyx_obj_5pysam_9libctabix_TabixIterator), /*tp_basicsize*/ | |
26899 0, /*tp_itemsize*/ | |
26900 __pyx_tp_dealloc_5pysam_9libctabix_TabixIterator, /*tp_dealloc*/ | |
26901 #if PY_VERSION_HEX < 0x030800b4 | |
26902 0, /*tp_print*/ | |
26903 #endif | |
26904 #if PY_VERSION_HEX >= 0x030800b4 | |
26905 0, /*tp_vectorcall_offset*/ | |
26906 #endif | |
26907 0, /*tp_getattr*/ | |
26908 0, /*tp_setattr*/ | |
26909 #if PY_MAJOR_VERSION < 3 | |
26910 0, /*tp_compare*/ | |
26911 #endif | |
26912 #if PY_MAJOR_VERSION >= 3 | |
26913 0, /*tp_as_async*/ | |
26914 #endif | |
26915 0, /*tp_repr*/ | |
26916 0, /*tp_as_number*/ | |
26917 0, /*tp_as_sequence*/ | |
26918 0, /*tp_as_mapping*/ | |
26919 0, /*tp_hash*/ | |
26920 0, /*tp_call*/ | |
26921 0, /*tp_str*/ | |
26922 0, /*tp_getattro*/ | |
26923 0, /*tp_setattro*/ | |
26924 0, /*tp_as_buffer*/ | |
26925 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | |
26926 PyDoc_STR("TabixIterator(encoding=u'ascii')\niterates over rows in *tabixfile* in region\n given by *tid*, *start* and *end*.\n "), /*tp_doc*/ | |
26927 __pyx_tp_traverse_5pysam_9libctabix_TabixIterator, /*tp_traverse*/ | |
26928 __pyx_tp_clear_5pysam_9libctabix_TabixIterator, /*tp_clear*/ | |
26929 0, /*tp_richcompare*/ | |
26930 0, /*tp_weaklistoffset*/ | |
26931 __pyx_pw_5pysam_9libctabix_13TabixIterator_3__iter__, /*tp_iter*/ | |
26932 __pyx_pw_5pysam_9libctabix_13TabixIterator_5__next__, /*tp_iternext*/ | |
26933 __pyx_methods_5pysam_9libctabix_TabixIterator, /*tp_methods*/ | |
26934 0, /*tp_members*/ | |
26935 0, /*tp_getset*/ | |
26936 0, /*tp_base*/ | |
26937 0, /*tp_dict*/ | |
26938 0, /*tp_descr_get*/ | |
26939 0, /*tp_descr_set*/ | |
26940 #if !CYTHON_USE_TYPE_SPECS | |
26941 0, /*tp_dictoffset*/ | |
26942 #endif | |
26943 __pyx_pw_5pysam_9libctabix_13TabixIterator_1__init__, /*tp_init*/ | |
26944 0, /*tp_alloc*/ | |
26945 __pyx_tp_new_5pysam_9libctabix_TabixIterator, /*tp_new*/ | |
26946 0, /*tp_free*/ | |
26947 0, /*tp_is_gc*/ | |
26948 0, /*tp_bases*/ | |
26949 0, /*tp_mro*/ | |
26950 0, /*tp_cache*/ | |
26951 0, /*tp_subclasses*/ | |
26952 0, /*tp_weaklist*/ | |
26953 0, /*tp_del*/ | |
26954 0, /*tp_version_tag*/ | |
26955 #if PY_VERSION_HEX >= 0x030400a1 | |
26956 #if CYTHON_USE_TP_FINALIZE | |
26957 0, /*tp_finalize*/ | |
26958 #else | |
26959 NULL, /*tp_finalize*/ | |
26960 #endif | |
26961 #endif | |
26962 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
26963 0, /*tp_vectorcall*/ | |
26964 #endif | |
26965 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
26966 0, /*tp_print*/ | |
26967 #endif | |
26968 #if PY_VERSION_HEX >= 0x030C0000 | |
26969 0, /*tp_watched*/ | |
26970 #endif | |
26971 #if PY_VERSION_HEX >= 0x030d00A4 | |
26972 0, /*tp_versions_used*/ | |
26973 #endif | |
26974 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
26975 0, /*tp_pypy_flags*/ | |
26976 #endif | |
26977 }; | |
26978 #endif | |
26979 static struct __pyx_vtabstruct_5pysam_9libctabix_TabixIteratorParsed __pyx_vtable_5pysam_9libctabix_TabixIteratorParsed; | |
26980 | |
26981 static PyObject *__pyx_tp_new_5pysam_9libctabix_TabixIteratorParsed(PyTypeObject *t, PyObject *a, PyObject *k) { | |
26982 struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *p; | |
26983 PyObject *o = __pyx_tp_new_5pysam_9libctabix_TabixIterator(t, a, k); | |
26984 if (unlikely(!o)) return 0; | |
26985 p = ((struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *)o); | |
26986 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_9libctabix_TabixIterator*)__pyx_vtabptr_5pysam_9libctabix_TabixIteratorParsed; | |
26987 p->parser = ((struct __pyx_obj_5pysam_9libctabix_Parser *)Py_None); Py_INCREF(Py_None); | |
26988 return o; | |
26989 } | |
26990 | |
26991 static void __pyx_tp_dealloc_5pysam_9libctabix_TabixIteratorParsed(PyObject *o) { | |
26992 struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *p = (struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *)o; | |
26993 #if CYTHON_USE_TP_FINALIZE | |
26994 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { | |
26995 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5pysam_9libctabix_TabixIteratorParsed) { | |
26996 if (PyObject_CallFinalizerFromDealloc(o)) return; | |
26997 } | |
26998 } | |
26999 #endif | |
27000 PyObject_GC_UnTrack(o); | |
27001 Py_CLEAR(p->parser); | |
27002 PyObject_GC_Track(o); | |
27003 __pyx_tp_dealloc_5pysam_9libctabix_TabixIterator(o); | |
27004 } | |
27005 | |
27006 static int __pyx_tp_traverse_5pysam_9libctabix_TabixIteratorParsed(PyObject *o, visitproc v, void *a) { | |
27007 int e; | |
27008 struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *p = (struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *)o; | |
27009 e = __pyx_tp_traverse_5pysam_9libctabix_TabixIterator(o, v, a); if (e) return e; | |
27010 if (p->parser) { | |
27011 e = (*v)(((PyObject *)p->parser), a); if (e) return e; | |
27012 } | |
27013 return 0; | |
27014 } | |
27015 | |
27016 static int __pyx_tp_clear_5pysam_9libctabix_TabixIteratorParsed(PyObject *o) { | |
27017 PyObject* tmp; | |
27018 struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *p = (struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed *)o; | |
27019 __pyx_tp_clear_5pysam_9libctabix_TabixIterator(o); | |
27020 tmp = ((PyObject*)p->parser); | |
27021 p->parser = ((struct __pyx_obj_5pysam_9libctabix_Parser *)Py_None); Py_INCREF(Py_None); | |
27022 Py_XDECREF(tmp); | |
27023 return 0; | |
27024 } | |
27025 | |
27026 static PyObject *__pyx_specialmethod___pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_3__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) { | |
27027 PyObject *res = __pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_3__next__(self); | |
27028 if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); } | |
27029 return res; | |
27030 } | |
27031 | |
27032 static PyMethodDef __pyx_methods_5pysam_9libctabix_TabixIteratorParsed[] = { | |
27033 {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_3__next__, METH_NOARGS|METH_COEXIST, __pyx_doc_5pysam_9libctabix_19TabixIteratorParsed_2__next__}, | |
27034 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_19TabixIteratorParsed_4__reduce_cython__}, | |
27035 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_19TabixIteratorParsed_6__setstate_cython__}, | |
27036 {0, 0, 0, 0} | |
27037 }; | |
27038 #if CYTHON_USE_TYPE_SPECS | |
27039 static PyType_Slot __pyx_type_5pysam_9libctabix_TabixIteratorParsed_slots[] = { | |
27040 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5pysam_9libctabix_TabixIteratorParsed}, | |
27041 {Py_tp_doc, (void *)PyDoc_STR("TabixIteratorParsed(Parser parser)\niterates over mapped reads in a region.\n\n The *parser* determines the encoding.\n\n Returns parsed data.\n ")}, | |
27042 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libctabix_TabixIteratorParsed}, | |
27043 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libctabix_TabixIteratorParsed}, | |
27044 {Py_tp_iternext, (void *)__pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_3__next__}, | |
27045 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libctabix_TabixIteratorParsed}, | |
27046 {Py_tp_init, (void *)__pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_1__init__}, | |
27047 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libctabix_TabixIteratorParsed}, | |
27048 {0, 0}, | |
27049 }; | |
27050 static PyType_Spec __pyx_type_5pysam_9libctabix_TabixIteratorParsed_spec = { | |
27051 "pysam.libctabix.TabixIteratorParsed", | |
27052 sizeof(struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed), | |
27053 0, | |
27054 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, | |
27055 __pyx_type_5pysam_9libctabix_TabixIteratorParsed_slots, | |
27056 }; | |
27057 #else | |
27058 | |
27059 static PyTypeObject __pyx_type_5pysam_9libctabix_TabixIteratorParsed = { | |
27060 PyVarObject_HEAD_INIT(0, 0) | |
27061 "pysam.libctabix.""TabixIteratorParsed", /*tp_name*/ | |
27062 sizeof(struct __pyx_obj_5pysam_9libctabix_TabixIteratorParsed), /*tp_basicsize*/ | |
27063 0, /*tp_itemsize*/ | |
27064 __pyx_tp_dealloc_5pysam_9libctabix_TabixIteratorParsed, /*tp_dealloc*/ | |
27065 #if PY_VERSION_HEX < 0x030800b4 | |
27066 0, /*tp_print*/ | |
27067 #endif | |
27068 #if PY_VERSION_HEX >= 0x030800b4 | |
27069 0, /*tp_vectorcall_offset*/ | |
27070 #endif | |
27071 0, /*tp_getattr*/ | |
27072 0, /*tp_setattr*/ | |
27073 #if PY_MAJOR_VERSION < 3 | |
27074 0, /*tp_compare*/ | |
27075 #endif | |
27076 #if PY_MAJOR_VERSION >= 3 | |
27077 0, /*tp_as_async*/ | |
27078 #endif | |
27079 0, /*tp_repr*/ | |
27080 0, /*tp_as_number*/ | |
27081 0, /*tp_as_sequence*/ | |
27082 0, /*tp_as_mapping*/ | |
27083 0, /*tp_hash*/ | |
27084 0, /*tp_call*/ | |
27085 0, /*tp_str*/ | |
27086 0, /*tp_getattro*/ | |
27087 0, /*tp_setattro*/ | |
27088 0, /*tp_as_buffer*/ | |
27089 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | |
27090 PyDoc_STR("TabixIteratorParsed(Parser parser)\niterates over mapped reads in a region.\n\n The *parser* determines the encoding.\n\n Returns parsed data.\n "), /*tp_doc*/ | |
27091 __pyx_tp_traverse_5pysam_9libctabix_TabixIteratorParsed, /*tp_traverse*/ | |
27092 __pyx_tp_clear_5pysam_9libctabix_TabixIteratorParsed, /*tp_clear*/ | |
27093 0, /*tp_richcompare*/ | |
27094 0, /*tp_weaklistoffset*/ | |
27095 #if CYTHON_COMPILING_IN_PYPY || 0 | |
27096 __pyx_pw_5pysam_9libctabix_13TabixIterator_3__iter__, /*tp_iter*/ | |
27097 #else | |
27098 0, /*tp_iter*/ | |
27099 #endif | |
27100 __pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_3__next__, /*tp_iternext*/ | |
27101 __pyx_methods_5pysam_9libctabix_TabixIteratorParsed, /*tp_methods*/ | |
27102 0, /*tp_members*/ | |
27103 0, /*tp_getset*/ | |
27104 0, /*tp_base*/ | |
27105 0, /*tp_dict*/ | |
27106 0, /*tp_descr_get*/ | |
27107 0, /*tp_descr_set*/ | |
27108 #if !CYTHON_USE_TYPE_SPECS | |
27109 0, /*tp_dictoffset*/ | |
27110 #endif | |
27111 __pyx_pw_5pysam_9libctabix_19TabixIteratorParsed_1__init__, /*tp_init*/ | |
27112 0, /*tp_alloc*/ | |
27113 __pyx_tp_new_5pysam_9libctabix_TabixIteratorParsed, /*tp_new*/ | |
27114 0, /*tp_free*/ | |
27115 0, /*tp_is_gc*/ | |
27116 0, /*tp_bases*/ | |
27117 0, /*tp_mro*/ | |
27118 0, /*tp_cache*/ | |
27119 0, /*tp_subclasses*/ | |
27120 0, /*tp_weaklist*/ | |
27121 0, /*tp_del*/ | |
27122 0, /*tp_version_tag*/ | |
27123 #if PY_VERSION_HEX >= 0x030400a1 | |
27124 #if CYTHON_USE_TP_FINALIZE | |
27125 0, /*tp_finalize*/ | |
27126 #else | |
27127 NULL, /*tp_finalize*/ | |
27128 #endif | |
27129 #endif | |
27130 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
27131 0, /*tp_vectorcall*/ | |
27132 #endif | |
27133 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
27134 0, /*tp_print*/ | |
27135 #endif | |
27136 #if PY_VERSION_HEX >= 0x030C0000 | |
27137 0, /*tp_watched*/ | |
27138 #endif | |
27139 #if PY_VERSION_HEX >= 0x030d00A4 | |
27140 0, /*tp_versions_used*/ | |
27141 #endif | |
27142 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
27143 0, /*tp_pypy_flags*/ | |
27144 #endif | |
27145 }; | |
27146 #endif | |
27147 static struct __pyx_vtabstruct_5pysam_9libctabix_GZIterator __pyx_vtable_5pysam_9libctabix_GZIterator; | |
27148 | |
27149 static PyObject *__pyx_tp_new_5pysam_9libctabix_GZIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { | |
27150 struct __pyx_obj_5pysam_9libctabix_GZIterator *p; | |
27151 PyObject *o; | |
27152 #if CYTHON_COMPILING_IN_LIMITED_API | |
27153 allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); | |
27154 o = alloc_func(t, 0); | |
27155 #else | |
27156 if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { | |
27157 o = (*t->tp_alloc)(t, 0); | |
27158 } else { | |
27159 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); | |
27160 } | |
27161 if (unlikely(!o)) return 0; | |
27162 #endif | |
27163 p = ((struct __pyx_obj_5pysam_9libctabix_GZIterator *)o); | |
27164 p->__pyx_vtab = __pyx_vtabptr_5pysam_9libctabix_GZIterator; | |
27165 p->_filename = Py_None; Py_INCREF(Py_None); | |
27166 p->encoding = Py_None; Py_INCREF(Py_None); | |
27167 return o; | |
27168 } | |
27169 | |
27170 static void __pyx_tp_dealloc_5pysam_9libctabix_GZIterator(PyObject *o) { | |
27171 struct __pyx_obj_5pysam_9libctabix_GZIterator *p = (struct __pyx_obj_5pysam_9libctabix_GZIterator *)o; | |
27172 #if CYTHON_USE_TP_FINALIZE | |
27173 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { | |
27174 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5pysam_9libctabix_GZIterator) { | |
27175 if (PyObject_CallFinalizerFromDealloc(o)) return; | |
27176 } | |
27177 } | |
27178 #endif | |
27179 PyObject_GC_UnTrack(o); | |
27180 { | |
27181 PyObject *etype, *eval, *etb; | |
27182 PyErr_Fetch(&etype, &eval, &etb); | |
27183 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); | |
27184 __pyx_pw_5pysam_9libctabix_10GZIterator_3__dealloc__(o); | |
27185 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); | |
27186 PyErr_Restore(etype, eval, etb); | |
27187 } | |
27188 Py_CLEAR(p->_filename); | |
27189 Py_CLEAR(p->encoding); | |
27190 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY | |
27191 (*Py_TYPE(o)->tp_free)(o); | |
27192 #else | |
27193 { | |
27194 freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); | |
27195 if (tp_free) tp_free(o); | |
27196 } | |
27197 #endif | |
27198 } | |
27199 | |
27200 static int __pyx_tp_traverse_5pysam_9libctabix_GZIterator(PyObject *o, visitproc v, void *a) { | |
27201 int e; | |
27202 struct __pyx_obj_5pysam_9libctabix_GZIterator *p = (struct __pyx_obj_5pysam_9libctabix_GZIterator *)o; | |
27203 if (p->_filename) { | |
27204 e = (*v)(p->_filename, a); if (e) return e; | |
27205 } | |
27206 if (p->encoding) { | |
27207 e = (*v)(p->encoding, a); if (e) return e; | |
27208 } | |
27209 return 0; | |
27210 } | |
27211 | |
27212 static int __pyx_tp_clear_5pysam_9libctabix_GZIterator(PyObject *o) { | |
27213 PyObject* tmp; | |
27214 struct __pyx_obj_5pysam_9libctabix_GZIterator *p = (struct __pyx_obj_5pysam_9libctabix_GZIterator *)o; | |
27215 tmp = ((PyObject*)p->_filename); | |
27216 p->_filename = Py_None; Py_INCREF(Py_None); | |
27217 Py_XDECREF(tmp); | |
27218 tmp = ((PyObject*)p->encoding); | |
27219 p->encoding = Py_None; Py_INCREF(Py_None); | |
27220 Py_XDECREF(tmp); | |
27221 return 0; | |
27222 } | |
27223 | |
27224 static PyObject *__pyx_specialmethod___pyx_pw_5pysam_9libctabix_10GZIterator_7__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) { | |
27225 PyObject *res = __pyx_pw_5pysam_9libctabix_10GZIterator_7__next__(self); | |
27226 if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); } | |
27227 return res; | |
27228 } | |
27229 | |
27230 static PyMethodDef __pyx_methods_5pysam_9libctabix_GZIterator[] = { | |
27231 {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_5pysam_9libctabix_10GZIterator_7__next__, METH_NOARGS|METH_COEXIST, __pyx_doc_5pysam_9libctabix_10GZIterator_6__next__}, | |
27232 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_10GZIterator_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_10GZIterator_8__reduce_cython__}, | |
27233 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_10GZIterator_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_10GZIterator_10__setstate_cython__}, | |
27234 {0, 0, 0, 0} | |
27235 }; | |
27236 #if CYTHON_USE_TYPE_SPECS | |
27237 static PyType_Slot __pyx_type_5pysam_9libctabix_GZIterator_slots[] = { | |
27238 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5pysam_9libctabix_GZIterator}, | |
27239 {Py_tp_doc, (void *)PyDoc_STR("GZIterator(filename, int buffer_size=65536, encoding=u'ascii')")}, | |
27240 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libctabix_GZIterator}, | |
27241 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libctabix_GZIterator}, | |
27242 {Py_tp_iter, (void *)__pyx_pw_5pysam_9libctabix_10GZIterator_5__iter__}, | |
27243 {Py_tp_iternext, (void *)__pyx_pw_5pysam_9libctabix_10GZIterator_7__next__}, | |
27244 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libctabix_GZIterator}, | |
27245 {Py_tp_init, (void *)__pyx_pw_5pysam_9libctabix_10GZIterator_1__init__}, | |
27246 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libctabix_GZIterator}, | |
27247 {0, 0}, | |
27248 }; | |
27249 static PyType_Spec __pyx_type_5pysam_9libctabix_GZIterator_spec = { | |
27250 "pysam.libctabix.GZIterator", | |
27251 sizeof(struct __pyx_obj_5pysam_9libctabix_GZIterator), | |
27252 0, | |
27253 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, | |
27254 __pyx_type_5pysam_9libctabix_GZIterator_slots, | |
27255 }; | |
27256 #else | |
27257 | |
27258 static PyTypeObject __pyx_type_5pysam_9libctabix_GZIterator = { | |
27259 PyVarObject_HEAD_INIT(0, 0) | |
27260 "pysam.libctabix.""GZIterator", /*tp_name*/ | |
27261 sizeof(struct __pyx_obj_5pysam_9libctabix_GZIterator), /*tp_basicsize*/ | |
27262 0, /*tp_itemsize*/ | |
27263 __pyx_tp_dealloc_5pysam_9libctabix_GZIterator, /*tp_dealloc*/ | |
27264 #if PY_VERSION_HEX < 0x030800b4 | |
27265 0, /*tp_print*/ | |
27266 #endif | |
27267 #if PY_VERSION_HEX >= 0x030800b4 | |
27268 0, /*tp_vectorcall_offset*/ | |
27269 #endif | |
27270 0, /*tp_getattr*/ | |
27271 0, /*tp_setattr*/ | |
27272 #if PY_MAJOR_VERSION < 3 | |
27273 0, /*tp_compare*/ | |
27274 #endif | |
27275 #if PY_MAJOR_VERSION >= 3 | |
27276 0, /*tp_as_async*/ | |
27277 #endif | |
27278 0, /*tp_repr*/ | |
27279 0, /*tp_as_number*/ | |
27280 0, /*tp_as_sequence*/ | |
27281 0, /*tp_as_mapping*/ | |
27282 0, /*tp_hash*/ | |
27283 0, /*tp_call*/ | |
27284 0, /*tp_str*/ | |
27285 0, /*tp_getattro*/ | |
27286 0, /*tp_setattro*/ | |
27287 0, /*tp_as_buffer*/ | |
27288 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | |
27289 PyDoc_STR("GZIterator(filename, int buffer_size=65536, encoding=u'ascii')"), /*tp_doc*/ | |
27290 __pyx_tp_traverse_5pysam_9libctabix_GZIterator, /*tp_traverse*/ | |
27291 __pyx_tp_clear_5pysam_9libctabix_GZIterator, /*tp_clear*/ | |
27292 0, /*tp_richcompare*/ | |
27293 0, /*tp_weaklistoffset*/ | |
27294 __pyx_pw_5pysam_9libctabix_10GZIterator_5__iter__, /*tp_iter*/ | |
27295 __pyx_pw_5pysam_9libctabix_10GZIterator_7__next__, /*tp_iternext*/ | |
27296 __pyx_methods_5pysam_9libctabix_GZIterator, /*tp_methods*/ | |
27297 0, /*tp_members*/ | |
27298 0, /*tp_getset*/ | |
27299 0, /*tp_base*/ | |
27300 0, /*tp_dict*/ | |
27301 0, /*tp_descr_get*/ | |
27302 0, /*tp_descr_set*/ | |
27303 #if !CYTHON_USE_TYPE_SPECS | |
27304 0, /*tp_dictoffset*/ | |
27305 #endif | |
27306 __pyx_pw_5pysam_9libctabix_10GZIterator_1__init__, /*tp_init*/ | |
27307 0, /*tp_alloc*/ | |
27308 __pyx_tp_new_5pysam_9libctabix_GZIterator, /*tp_new*/ | |
27309 0, /*tp_free*/ | |
27310 0, /*tp_is_gc*/ | |
27311 0, /*tp_bases*/ | |
27312 0, /*tp_mro*/ | |
27313 0, /*tp_cache*/ | |
27314 0, /*tp_subclasses*/ | |
27315 0, /*tp_weaklist*/ | |
27316 0, /*tp_del*/ | |
27317 0, /*tp_version_tag*/ | |
27318 #if PY_VERSION_HEX >= 0x030400a1 | |
27319 #if CYTHON_USE_TP_FINALIZE | |
27320 0, /*tp_finalize*/ | |
27321 #else | |
27322 NULL, /*tp_finalize*/ | |
27323 #endif | |
27324 #endif | |
27325 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
27326 0, /*tp_vectorcall*/ | |
27327 #endif | |
27328 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
27329 0, /*tp_print*/ | |
27330 #endif | |
27331 #if PY_VERSION_HEX >= 0x030C0000 | |
27332 0, /*tp_watched*/ | |
27333 #endif | |
27334 #if PY_VERSION_HEX >= 0x030d00A4 | |
27335 0, /*tp_versions_used*/ | |
27336 #endif | |
27337 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
27338 0, /*tp_pypy_flags*/ | |
27339 #endif | |
27340 }; | |
27341 #endif | |
27342 static struct __pyx_vtabstruct_5pysam_9libctabix_GZIteratorHead __pyx_vtable_5pysam_9libctabix_GZIteratorHead; | |
27343 | |
27344 static PyObject *__pyx_tp_new_5pysam_9libctabix_GZIteratorHead(PyTypeObject *t, PyObject *a, PyObject *k) { | |
27345 struct __pyx_obj_5pysam_9libctabix_GZIteratorHead *p; | |
27346 PyObject *o = __pyx_tp_new_5pysam_9libctabix_GZIterator(t, a, k); | |
27347 if (unlikely(!o)) return 0; | |
27348 p = ((struct __pyx_obj_5pysam_9libctabix_GZIteratorHead *)o); | |
27349 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_9libctabix_GZIterator*)__pyx_vtabptr_5pysam_9libctabix_GZIteratorHead; | |
27350 return o; | |
27351 } | |
27352 | |
27353 static PyObject *__pyx_specialmethod___pyx_pw_5pysam_9libctabix_14GZIteratorHead_1__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) { | |
27354 PyObject *res = __pyx_pw_5pysam_9libctabix_14GZIteratorHead_1__next__(self); | |
27355 if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); } | |
27356 return res; | |
27357 } | |
27358 | |
27359 static PyMethodDef __pyx_methods_5pysam_9libctabix_GZIteratorHead[] = { | |
27360 {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_5pysam_9libctabix_14GZIteratorHead_1__next__, METH_NOARGS|METH_COEXIST, __pyx_doc_5pysam_9libctabix_14GZIteratorHead___next__}, | |
27361 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_14GZIteratorHead_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_14GZIteratorHead_2__reduce_cython__}, | |
27362 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_14GZIteratorHead_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_14GZIteratorHead_4__setstate_cython__}, | |
27363 {0, 0, 0, 0} | |
27364 }; | |
27365 #if CYTHON_USE_TYPE_SPECS | |
27366 static PyType_Slot __pyx_type_5pysam_9libctabix_GZIteratorHead_slots[] = { | |
27367 {Py_tp_doc, (void *)PyDoc_STR("iterate line-by-line through gzip (or bgzip)\n compressed file returning comments at top of file.\n ")}, | |
27368 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libctabix_GZIterator}, | |
27369 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libctabix_GZIterator}, | |
27370 {Py_tp_iternext, (void *)__pyx_pw_5pysam_9libctabix_14GZIteratorHead_1__next__}, | |
27371 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libctabix_GZIteratorHead}, | |
27372 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libctabix_GZIteratorHead}, | |
27373 {0, 0}, | |
27374 }; | |
27375 static PyType_Spec __pyx_type_5pysam_9libctabix_GZIteratorHead_spec = { | |
27376 "pysam.libctabix.GZIteratorHead", | |
27377 sizeof(struct __pyx_obj_5pysam_9libctabix_GZIteratorHead), | |
27378 0, | |
27379 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, | |
27380 __pyx_type_5pysam_9libctabix_GZIteratorHead_slots, | |
27381 }; | |
27382 #else | |
27383 | |
27384 static PyTypeObject __pyx_type_5pysam_9libctabix_GZIteratorHead = { | |
27385 PyVarObject_HEAD_INIT(0, 0) | |
27386 "pysam.libctabix.""GZIteratorHead", /*tp_name*/ | |
27387 sizeof(struct __pyx_obj_5pysam_9libctabix_GZIteratorHead), /*tp_basicsize*/ | |
27388 0, /*tp_itemsize*/ | |
27389 __pyx_tp_dealloc_5pysam_9libctabix_GZIterator, /*tp_dealloc*/ | |
27390 #if PY_VERSION_HEX < 0x030800b4 | |
27391 0, /*tp_print*/ | |
27392 #endif | |
27393 #if PY_VERSION_HEX >= 0x030800b4 | |
27394 0, /*tp_vectorcall_offset*/ | |
27395 #endif | |
27396 0, /*tp_getattr*/ | |
27397 0, /*tp_setattr*/ | |
27398 #if PY_MAJOR_VERSION < 3 | |
27399 0, /*tp_compare*/ | |
27400 #endif | |
27401 #if PY_MAJOR_VERSION >= 3 | |
27402 0, /*tp_as_async*/ | |
27403 #endif | |
27404 0, /*tp_repr*/ | |
27405 0, /*tp_as_number*/ | |
27406 0, /*tp_as_sequence*/ | |
27407 0, /*tp_as_mapping*/ | |
27408 0, /*tp_hash*/ | |
27409 0, /*tp_call*/ | |
27410 0, /*tp_str*/ | |
27411 0, /*tp_getattro*/ | |
27412 0, /*tp_setattro*/ | |
27413 0, /*tp_as_buffer*/ | |
27414 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | |
27415 PyDoc_STR("iterate line-by-line through gzip (or bgzip)\n compressed file returning comments at top of file.\n "), /*tp_doc*/ | |
27416 __pyx_tp_traverse_5pysam_9libctabix_GZIterator, /*tp_traverse*/ | |
27417 __pyx_tp_clear_5pysam_9libctabix_GZIterator, /*tp_clear*/ | |
27418 0, /*tp_richcompare*/ | |
27419 0, /*tp_weaklistoffset*/ | |
27420 #if CYTHON_COMPILING_IN_PYPY || 0 | |
27421 __pyx_pw_5pysam_9libctabix_10GZIterator_5__iter__, /*tp_iter*/ | |
27422 #else | |
27423 0, /*tp_iter*/ | |
27424 #endif | |
27425 __pyx_pw_5pysam_9libctabix_14GZIteratorHead_1__next__, /*tp_iternext*/ | |
27426 __pyx_methods_5pysam_9libctabix_GZIteratorHead, /*tp_methods*/ | |
27427 0, /*tp_members*/ | |
27428 0, /*tp_getset*/ | |
27429 0, /*tp_base*/ | |
27430 0, /*tp_dict*/ | |
27431 0, /*tp_descr_get*/ | |
27432 0, /*tp_descr_set*/ | |
27433 #if !CYTHON_USE_TYPE_SPECS | |
27434 0, /*tp_dictoffset*/ | |
27435 #endif | |
27436 #if CYTHON_COMPILING_IN_PYPY || 0 | |
27437 __pyx_pw_5pysam_9libctabix_10GZIterator_1__init__, /*tp_init*/ | |
27438 #else | |
27439 0, /*tp_init*/ | |
27440 #endif | |
27441 0, /*tp_alloc*/ | |
27442 __pyx_tp_new_5pysam_9libctabix_GZIteratorHead, /*tp_new*/ | |
27443 0, /*tp_free*/ | |
27444 0, /*tp_is_gc*/ | |
27445 0, /*tp_bases*/ | |
27446 0, /*tp_mro*/ | |
27447 0, /*tp_cache*/ | |
27448 0, /*tp_subclasses*/ | |
27449 0, /*tp_weaklist*/ | |
27450 0, /*tp_del*/ | |
27451 0, /*tp_version_tag*/ | |
27452 #if PY_VERSION_HEX >= 0x030400a1 | |
27453 #if CYTHON_USE_TP_FINALIZE | |
27454 0, /*tp_finalize*/ | |
27455 #else | |
27456 NULL, /*tp_finalize*/ | |
27457 #endif | |
27458 #endif | |
27459 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
27460 0, /*tp_vectorcall*/ | |
27461 #endif | |
27462 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
27463 0, /*tp_print*/ | |
27464 #endif | |
27465 #if PY_VERSION_HEX >= 0x030C0000 | |
27466 0, /*tp_watched*/ | |
27467 #endif | |
27468 #if PY_VERSION_HEX >= 0x030d00A4 | |
27469 0, /*tp_versions_used*/ | |
27470 #endif | |
27471 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
27472 0, /*tp_pypy_flags*/ | |
27473 #endif | |
27474 }; | |
27475 #endif | |
27476 static struct __pyx_vtabstruct_5pysam_9libctabix_GZIteratorParsed __pyx_vtable_5pysam_9libctabix_GZIteratorParsed; | |
27477 | |
27478 static PyObject *__pyx_tp_new_5pysam_9libctabix_GZIteratorParsed(PyTypeObject *t, PyObject *a, PyObject *k) { | |
27479 struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *p; | |
27480 PyObject *o = __pyx_tp_new_5pysam_9libctabix_GZIterator(t, a, k); | |
27481 if (unlikely(!o)) return 0; | |
27482 p = ((struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *)o); | |
27483 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_9libctabix_GZIterator*)__pyx_vtabptr_5pysam_9libctabix_GZIteratorParsed; | |
27484 p->parser = ((struct __pyx_obj_5pysam_9libctabix_Parser *)Py_None); Py_INCREF(Py_None); | |
27485 return o; | |
27486 } | |
27487 | |
27488 static void __pyx_tp_dealloc_5pysam_9libctabix_GZIteratorParsed(PyObject *o) { | |
27489 struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *p = (struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *)o; | |
27490 #if CYTHON_USE_TP_FINALIZE | |
27491 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { | |
27492 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5pysam_9libctabix_GZIteratorParsed) { | |
27493 if (PyObject_CallFinalizerFromDealloc(o)) return; | |
27494 } | |
27495 } | |
27496 #endif | |
27497 PyObject_GC_UnTrack(o); | |
27498 Py_CLEAR(p->parser); | |
27499 PyObject_GC_Track(o); | |
27500 __pyx_tp_dealloc_5pysam_9libctabix_GZIterator(o); | |
27501 } | |
27502 | |
27503 static int __pyx_tp_traverse_5pysam_9libctabix_GZIteratorParsed(PyObject *o, visitproc v, void *a) { | |
27504 int e; | |
27505 struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *p = (struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *)o; | |
27506 e = __pyx_tp_traverse_5pysam_9libctabix_GZIterator(o, v, a); if (e) return e; | |
27507 if (p->parser) { | |
27508 e = (*v)(((PyObject *)p->parser), a); if (e) return e; | |
27509 } | |
27510 return 0; | |
27511 } | |
27512 | |
27513 static int __pyx_tp_clear_5pysam_9libctabix_GZIteratorParsed(PyObject *o) { | |
27514 PyObject* tmp; | |
27515 struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *p = (struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed *)o; | |
27516 __pyx_tp_clear_5pysam_9libctabix_GZIterator(o); | |
27517 tmp = ((PyObject*)p->parser); | |
27518 p->parser = ((struct __pyx_obj_5pysam_9libctabix_Parser *)Py_None); Py_INCREF(Py_None); | |
27519 Py_XDECREF(tmp); | |
27520 return 0; | |
27521 } | |
27522 | |
27523 static PyObject *__pyx_specialmethod___pyx_pw_5pysam_9libctabix_16GZIteratorParsed_3__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) { | |
27524 PyObject *res = __pyx_pw_5pysam_9libctabix_16GZIteratorParsed_3__next__(self); | |
27525 if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); } | |
27526 return res; | |
27527 } | |
27528 | |
27529 static PyMethodDef __pyx_methods_5pysam_9libctabix_GZIteratorParsed[] = { | |
27530 {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_5pysam_9libctabix_16GZIteratorParsed_3__next__, METH_NOARGS|METH_COEXIST, __pyx_doc_5pysam_9libctabix_16GZIteratorParsed_2__next__}, | |
27531 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_16GZIteratorParsed_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_16GZIteratorParsed_4__reduce_cython__}, | |
27532 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_16GZIteratorParsed_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_16GZIteratorParsed_6__setstate_cython__}, | |
27533 {0, 0, 0, 0} | |
27534 }; | |
27535 #if CYTHON_USE_TYPE_SPECS | |
27536 static PyType_Slot __pyx_type_5pysam_9libctabix_GZIteratorParsed_slots[] = { | |
27537 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5pysam_9libctabix_GZIteratorParsed}, | |
27538 {Py_tp_doc, (void *)PyDoc_STR("GZIteratorParsed(parser)\niterate line-by-line through gzip (or bgzip)\n compressed file returning comments at top of file.\n ")}, | |
27539 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libctabix_GZIteratorParsed}, | |
27540 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libctabix_GZIteratorParsed}, | |
27541 {Py_tp_iternext, (void *)__pyx_pw_5pysam_9libctabix_16GZIteratorParsed_3__next__}, | |
27542 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libctabix_GZIteratorParsed}, | |
27543 {Py_tp_init, (void *)__pyx_pw_5pysam_9libctabix_16GZIteratorParsed_1__init__}, | |
27544 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libctabix_GZIteratorParsed}, | |
27545 {0, 0}, | |
27546 }; | |
27547 static PyType_Spec __pyx_type_5pysam_9libctabix_GZIteratorParsed_spec = { | |
27548 "pysam.libctabix.GZIteratorParsed", | |
27549 sizeof(struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed), | |
27550 0, | |
27551 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, | |
27552 __pyx_type_5pysam_9libctabix_GZIteratorParsed_slots, | |
27553 }; | |
27554 #else | |
27555 | |
27556 static PyTypeObject __pyx_type_5pysam_9libctabix_GZIteratorParsed = { | |
27557 PyVarObject_HEAD_INIT(0, 0) | |
27558 "pysam.libctabix.""GZIteratorParsed", /*tp_name*/ | |
27559 sizeof(struct __pyx_obj_5pysam_9libctabix_GZIteratorParsed), /*tp_basicsize*/ | |
27560 0, /*tp_itemsize*/ | |
27561 __pyx_tp_dealloc_5pysam_9libctabix_GZIteratorParsed, /*tp_dealloc*/ | |
27562 #if PY_VERSION_HEX < 0x030800b4 | |
27563 0, /*tp_print*/ | |
27564 #endif | |
27565 #if PY_VERSION_HEX >= 0x030800b4 | |
27566 0, /*tp_vectorcall_offset*/ | |
27567 #endif | |
27568 0, /*tp_getattr*/ | |
27569 0, /*tp_setattr*/ | |
27570 #if PY_MAJOR_VERSION < 3 | |
27571 0, /*tp_compare*/ | |
27572 #endif | |
27573 #if PY_MAJOR_VERSION >= 3 | |
27574 0, /*tp_as_async*/ | |
27575 #endif | |
27576 0, /*tp_repr*/ | |
27577 0, /*tp_as_number*/ | |
27578 0, /*tp_as_sequence*/ | |
27579 0, /*tp_as_mapping*/ | |
27580 0, /*tp_hash*/ | |
27581 0, /*tp_call*/ | |
27582 0, /*tp_str*/ | |
27583 0, /*tp_getattro*/ | |
27584 0, /*tp_setattro*/ | |
27585 0, /*tp_as_buffer*/ | |
27586 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | |
27587 PyDoc_STR("GZIteratorParsed(parser)\niterate line-by-line through gzip (or bgzip)\n compressed file returning comments at top of file.\n "), /*tp_doc*/ | |
27588 __pyx_tp_traverse_5pysam_9libctabix_GZIteratorParsed, /*tp_traverse*/ | |
27589 __pyx_tp_clear_5pysam_9libctabix_GZIteratorParsed, /*tp_clear*/ | |
27590 0, /*tp_richcompare*/ | |
27591 0, /*tp_weaklistoffset*/ | |
27592 #if CYTHON_COMPILING_IN_PYPY || 0 | |
27593 __pyx_pw_5pysam_9libctabix_10GZIterator_5__iter__, /*tp_iter*/ | |
27594 #else | |
27595 0, /*tp_iter*/ | |
27596 #endif | |
27597 __pyx_pw_5pysam_9libctabix_16GZIteratorParsed_3__next__, /*tp_iternext*/ | |
27598 __pyx_methods_5pysam_9libctabix_GZIteratorParsed, /*tp_methods*/ | |
27599 0, /*tp_members*/ | |
27600 0, /*tp_getset*/ | |
27601 0, /*tp_base*/ | |
27602 0, /*tp_dict*/ | |
27603 0, /*tp_descr_get*/ | |
27604 0, /*tp_descr_set*/ | |
27605 #if !CYTHON_USE_TYPE_SPECS | |
27606 0, /*tp_dictoffset*/ | |
27607 #endif | |
27608 __pyx_pw_5pysam_9libctabix_16GZIteratorParsed_1__init__, /*tp_init*/ | |
27609 0, /*tp_alloc*/ | |
27610 __pyx_tp_new_5pysam_9libctabix_GZIteratorParsed, /*tp_new*/ | |
27611 0, /*tp_free*/ | |
27612 0, /*tp_is_gc*/ | |
27613 0, /*tp_bases*/ | |
27614 0, /*tp_mro*/ | |
27615 0, /*tp_cache*/ | |
27616 0, /*tp_subclasses*/ | |
27617 0, /*tp_weaklist*/ | |
27618 0, /*tp_del*/ | |
27619 0, /*tp_version_tag*/ | |
27620 #if PY_VERSION_HEX >= 0x030400a1 | |
27621 #if CYTHON_USE_TP_FINALIZE | |
27622 0, /*tp_finalize*/ | |
27623 #else | |
27624 NULL, /*tp_finalize*/ | |
27625 #endif | |
27626 #endif | |
27627 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
27628 0, /*tp_vectorcall*/ | |
27629 #endif | |
27630 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
27631 0, /*tp_print*/ | |
27632 #endif | |
27633 #if PY_VERSION_HEX >= 0x030C0000 | |
27634 0, /*tp_watched*/ | |
27635 #endif | |
27636 #if PY_VERSION_HEX >= 0x030d00A4 | |
27637 0, /*tp_versions_used*/ | |
27638 #endif | |
27639 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
27640 0, /*tp_pypy_flags*/ | |
27641 #endif | |
27642 }; | |
27643 #endif | |
27644 static struct __pyx_vtabstruct_5pysam_9libctabix_Tabixfile __pyx_vtable_5pysam_9libctabix_Tabixfile; | |
27645 | |
27646 static PyObject *__pyx_tp_new_5pysam_9libctabix_Tabixfile(PyTypeObject *t, PyObject *a, PyObject *k) { | |
27647 struct __pyx_obj_5pysam_9libctabix_Tabixfile *p; | |
27648 PyObject *o = __pyx_tp_new_5pysam_9libctabix_TabixFile(t, a, k); | |
27649 if (unlikely(!o)) return 0; | |
27650 p = ((struct __pyx_obj_5pysam_9libctabix_Tabixfile *)o); | |
27651 p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile*)__pyx_vtabptr_5pysam_9libctabix_Tabixfile; | |
27652 return o; | |
27653 } | |
27654 | |
27655 static PyMethodDef __pyx_methods_5pysam_9libctabix_Tabixfile[] = { | |
27656 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9Tabixfile_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_9Tabixfile___reduce_cython__}, | |
27657 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libctabix_9Tabixfile_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libctabix_9Tabixfile_2__setstate_cython__}, | |
27658 {0, 0, 0, 0} | |
27659 }; | |
27660 #if CYTHON_USE_TYPE_SPECS | |
27661 static PyType_Slot __pyx_type_5pysam_9libctabix_Tabixfile_slots[] = { | |
27662 {Py_tp_doc, (void *)PyDoc_STR("Tabixfile is deprecated: use TabixFile instead")}, | |
27663 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libctabix_TabixFile}, | |
27664 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libctabix_TabixFile}, | |
27665 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libctabix_Tabixfile}, | |
27666 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libctabix_Tabixfile}, | |
27667 {0, 0}, | |
27668 }; | |
27669 static PyType_Spec __pyx_type_5pysam_9libctabix_Tabixfile_spec = { | |
27670 "pysam.libctabix.Tabixfile", | |
27671 sizeof(struct __pyx_obj_5pysam_9libctabix_Tabixfile), | |
27672 0, | |
27673 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, | |
27674 __pyx_type_5pysam_9libctabix_Tabixfile_slots, | |
27675 }; | |
27676 #else | |
27677 | |
27678 static PyTypeObject __pyx_type_5pysam_9libctabix_Tabixfile = { | |
27679 PyVarObject_HEAD_INIT(0, 0) | |
27680 "pysam.libctabix.""Tabixfile", /*tp_name*/ | |
27681 sizeof(struct __pyx_obj_5pysam_9libctabix_Tabixfile), /*tp_basicsize*/ | |
27682 0, /*tp_itemsize*/ | |
27683 __pyx_tp_dealloc_5pysam_9libctabix_TabixFile, /*tp_dealloc*/ | |
27684 #if PY_VERSION_HEX < 0x030800b4 | |
27685 0, /*tp_print*/ | |
27686 #endif | |
27687 #if PY_VERSION_HEX >= 0x030800b4 | |
27688 0, /*tp_vectorcall_offset*/ | |
27689 #endif | |
27690 0, /*tp_getattr*/ | |
27691 0, /*tp_setattr*/ | |
27692 #if PY_MAJOR_VERSION < 3 | |
27693 0, /*tp_compare*/ | |
27694 #endif | |
27695 #if PY_MAJOR_VERSION >= 3 | |
27696 0, /*tp_as_async*/ | |
27697 #endif | |
27698 0, /*tp_repr*/ | |
27699 0, /*tp_as_number*/ | |
27700 0, /*tp_as_sequence*/ | |
27701 0, /*tp_as_mapping*/ | |
27702 0, /*tp_hash*/ | |
27703 0, /*tp_call*/ | |
27704 0, /*tp_str*/ | |
27705 0, /*tp_getattro*/ | |
27706 0, /*tp_setattro*/ | |
27707 0, /*tp_as_buffer*/ | |
27708 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*/ | |
27709 PyDoc_STR("Tabixfile is deprecated: use TabixFile instead"), /*tp_doc*/ | |
27710 __pyx_tp_traverse_5pysam_9libctabix_TabixFile, /*tp_traverse*/ | |
27711 __pyx_tp_clear_5pysam_9libctabix_TabixFile, /*tp_clear*/ | |
27712 0, /*tp_richcompare*/ | |
27713 0, /*tp_weaklistoffset*/ | |
27714 0, /*tp_iter*/ | |
27715 0, /*tp_iternext*/ | |
27716 __pyx_methods_5pysam_9libctabix_Tabixfile, /*tp_methods*/ | |
27717 0, /*tp_members*/ | |
27718 0, /*tp_getset*/ | |
27719 0, /*tp_base*/ | |
27720 0, /*tp_dict*/ | |
27721 0, /*tp_descr_get*/ | |
27722 0, /*tp_descr_set*/ | |
27723 #if !CYTHON_USE_TYPE_SPECS | |
27724 0, /*tp_dictoffset*/ | |
27725 #endif | |
27726 0, /*tp_init*/ | |
27727 0, /*tp_alloc*/ | |
27728 __pyx_tp_new_5pysam_9libctabix_Tabixfile, /*tp_new*/ | |
27729 0, /*tp_free*/ | |
27730 0, /*tp_is_gc*/ | |
27731 0, /*tp_bases*/ | |
27732 0, /*tp_mro*/ | |
27733 0, /*tp_cache*/ | |
27734 0, /*tp_subclasses*/ | |
27735 0, /*tp_weaklist*/ | |
27736 0, /*tp_del*/ | |
27737 0, /*tp_version_tag*/ | |
27738 #if PY_VERSION_HEX >= 0x030400a1 | |
27739 #if CYTHON_USE_TP_FINALIZE | |
27740 0, /*tp_finalize*/ | |
27741 #else | |
27742 NULL, /*tp_finalize*/ | |
27743 #endif | |
27744 #endif | |
27745 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
27746 0, /*tp_vectorcall*/ | |
27747 #endif | |
27748 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
27749 0, /*tp_print*/ | |
27750 #endif | |
27751 #if PY_VERSION_HEX >= 0x030C0000 | |
27752 0, /*tp_watched*/ | |
27753 #endif | |
27754 #if PY_VERSION_HEX >= 0x030d00A4 | |
27755 0, /*tp_versions_used*/ | |
27756 #endif | |
27757 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
27758 0, /*tp_pypy_flags*/ | |
27759 #endif | |
27760 }; | |
27761 #endif | |
27762 | |
27763 static PyMethodDef __pyx_methods[] = { | |
27764 {0, 0, 0, 0} | |
27765 }; | |
27766 #ifndef CYTHON_SMALL_CODE | |
27767 #if defined(__clang__) | |
27768 #define CYTHON_SMALL_CODE | |
27769 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) | |
27770 #define CYTHON_SMALL_CODE __attribute__((cold)) | |
27771 #else | |
27772 #define CYTHON_SMALL_CODE | |
27773 #endif | |
27774 #endif | |
27775 /* #### Code section: pystring_table ### */ | |
27776 | |
27777 static int __Pyx_CreateStringTabAndInitStrings(void) { | |
27778 __Pyx_StringTabEntry __pyx_string_tab[] = { | |
27779 {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, | |
27780 {&__pyx_kp_u_Could_not_open_file, __pyx_k_Could_not_open_file, sizeof(__pyx_k_Could_not_open_file), 0, 1, 0, 0}, | |
27781 {&__pyx_n_s_EmptyIterator, __pyx_k_EmptyIterator, sizeof(__pyx_k_EmptyIterator), 0, 0, 1, 1}, | |
27782 {&__pyx_n_s_EmptyIterator___iter, __pyx_k_EmptyIterator___iter, sizeof(__pyx_k_EmptyIterator___iter), 0, 0, 1, 1}, | |
27783 {&__pyx_n_s_EmptyIterator___next, __pyx_k_EmptyIterator___next, sizeof(__pyx_k_EmptyIterator___next), 0, 0, 1, 1}, | |
27784 {&__pyx_kp_u_Filename_s_already_exists_use_fo, __pyx_k_Filename_s_already_exists_use_fo, sizeof(__pyx_k_Filename_s_already_exists_use_fo), 0, 1, 0, 0}, | |
27785 {&__pyx_n_s_GZIterator, __pyx_k_GZIterator, sizeof(__pyx_k_GZIterator), 0, 0, 1, 1}, | |
27786 {&__pyx_n_u_GZIterator, __pyx_k_GZIterator, sizeof(__pyx_k_GZIterator), 0, 1, 0, 1}, | |
27787 {&__pyx_n_s_GZIteratorHead, __pyx_k_GZIteratorHead, sizeof(__pyx_k_GZIteratorHead), 0, 0, 1, 1}, | |
27788 {&__pyx_n_u_GZIteratorHead, __pyx_k_GZIteratorHead, sizeof(__pyx_k_GZIteratorHead), 0, 1, 0, 1}, | |
27789 {&__pyx_n_s_GZIteratorHead___reduce_cython, __pyx_k_GZIteratorHead___reduce_cython, sizeof(__pyx_k_GZIteratorHead___reduce_cython), 0, 0, 1, 1}, | |
27790 {&__pyx_n_s_GZIteratorHead___setstate_cython, __pyx_k_GZIteratorHead___setstate_cython, sizeof(__pyx_k_GZIteratorHead___setstate_cython), 0, 0, 1, 1}, | |
27791 {&__pyx_n_s_GZIteratorParsed, __pyx_k_GZIteratorParsed, sizeof(__pyx_k_GZIteratorParsed), 0, 0, 1, 1}, | |
27792 {&__pyx_n_s_GZIteratorParsed___reduce_cython, __pyx_k_GZIteratorParsed___reduce_cython, sizeof(__pyx_k_GZIteratorParsed___reduce_cython), 0, 0, 1, 1}, | |
27793 {&__pyx_n_s_GZIteratorParsed___setstate_cyth, __pyx_k_GZIteratorParsed___setstate_cyth, sizeof(__pyx_k_GZIteratorParsed___setstate_cyth), 0, 0, 1, 1}, | |
27794 {&__pyx_n_s_GZIterator___reduce_cython, __pyx_k_GZIterator___reduce_cython, sizeof(__pyx_k_GZIterator___reduce_cython), 0, 0, 1, 1}, | |
27795 {&__pyx_n_s_GZIterator___setstate_cython, __pyx_k_GZIterator___setstate_cython, sizeof(__pyx_k_GZIterator___setstate_cython), 0, 0, 1, 1}, | |
27796 {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, | |
27797 {&__pyx_kp_u_I_O_operation_on_closed_file, __pyx_k_I_O_operation_on_closed_file, sizeof(__pyx_k_I_O_operation_on_closed_file), 0, 1, 0, 0}, | |
27798 {&__pyx_kp_u_I_O_operation_on_closed_file_2, __pyx_k_I_O_operation_on_closed_file_2, sizeof(__pyx_k_I_O_operation_on_closed_file_2), 0, 1, 0, 0}, | |
27799 {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, | |
27800 {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, | |
27801 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, | |
27802 {&__pyx_kp_u_No_such_file_or_directory_s, __pyx_k_No_such_file_or_directory_s, sizeof(__pyx_k_No_such_file_or_directory_s), 0, 1, 0, 0}, | |
27803 {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, | |
27804 {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1}, | |
27805 {&__pyx_n_s_O_RDONLY, __pyx_k_O_RDONLY, sizeof(__pyx_k_O_RDONLY), 0, 0, 1, 1}, | |
27806 {&__pyx_n_s_Parser, __pyx_k_Parser, sizeof(__pyx_k_Parser), 0, 0, 1, 1}, | |
27807 {&__pyx_n_s_Parser___reduce_cython, __pyx_k_Parser___reduce_cython, sizeof(__pyx_k_Parser___reduce_cython), 0, 0, 1, 1}, | |
27808 {&__pyx_n_s_Parser___setstate_cython, __pyx_k_Parser___setstate_cython, sizeof(__pyx_k_Parser___setstate_cython), 0, 0, 1, 1}, | |
27809 {&__pyx_n_s_Parser_get_encoding, __pyx_k_Parser_get_encoding, sizeof(__pyx_k_Parser_get_encoding), 0, 0, 1, 1}, | |
27810 {&__pyx_n_s_Parser_set_encoding, __pyx_k_Parser_set_encoding, sizeof(__pyx_k_Parser_set_encoding), 0, 0, 1, 1}, | |
27811 {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, | |
27812 {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, | |
27813 {&__pyx_n_s_TabixFile, __pyx_k_TabixFile, sizeof(__pyx_k_TabixFile), 0, 0, 1, 1}, | |
27814 {&__pyx_n_u_TabixFile, __pyx_k_TabixFile, sizeof(__pyx_k_TabixFile), 0, 1, 0, 1}, | |
27815 {&__pyx_n_s_TabixFile___reduce_cython, __pyx_k_TabixFile___reduce_cython, sizeof(__pyx_k_TabixFile___reduce_cython), 0, 0, 1, 1}, | |
27816 {&__pyx_n_s_TabixFile___setstate_cython, __pyx_k_TabixFile___setstate_cython, sizeof(__pyx_k_TabixFile___setstate_cython), 0, 0, 1, 1}, | |
27817 {&__pyx_n_s_TabixFile__dup, __pyx_k_TabixFile__dup, sizeof(__pyx_k_TabixFile__dup), 0, 0, 1, 1}, | |
27818 {&__pyx_n_s_TabixFile__open, __pyx_k_TabixFile__open, sizeof(__pyx_k_TabixFile__open), 0, 0, 1, 1}, | |
27819 {&__pyx_n_s_TabixFile_close, __pyx_k_TabixFile_close, sizeof(__pyx_k_TabixFile_close), 0, 0, 1, 1}, | |
27820 {&__pyx_n_s_TabixFile_fetch, __pyx_k_TabixFile_fetch, sizeof(__pyx_k_TabixFile_fetch), 0, 0, 1, 1}, | |
27821 {&__pyx_n_s_TabixIterator, __pyx_k_TabixIterator, sizeof(__pyx_k_TabixIterator), 0, 0, 1, 1}, | |
27822 {&__pyx_n_s_TabixIteratorParsed, __pyx_k_TabixIteratorParsed, sizeof(__pyx_k_TabixIteratorParsed), 0, 0, 1, 1}, | |
27823 {&__pyx_n_s_TabixIteratorParsed___reduce_cyt, __pyx_k_TabixIteratorParsed___reduce_cyt, sizeof(__pyx_k_TabixIteratorParsed___reduce_cyt), 0, 0, 1, 1}, | |
27824 {&__pyx_n_s_TabixIteratorParsed___setstate_c, __pyx_k_TabixIteratorParsed___setstate_c, sizeof(__pyx_k_TabixIteratorParsed___setstate_c), 0, 0, 1, 1}, | |
27825 {&__pyx_n_s_TabixIterator___reduce_cython, __pyx_k_TabixIterator___reduce_cython, sizeof(__pyx_k_TabixIterator___reduce_cython), 0, 0, 1, 1}, | |
27826 {&__pyx_n_s_TabixIterator___setstate_cython, __pyx_k_TabixIterator___setstate_cython, sizeof(__pyx_k_TabixIterator___setstate_cython), 0, 0, 1, 1}, | |
27827 {&__pyx_n_s_Tabixfile, __pyx_k_Tabixfile, sizeof(__pyx_k_Tabixfile), 0, 0, 1, 1}, | |
27828 {&__pyx_n_u_Tabixfile, __pyx_k_Tabixfile, sizeof(__pyx_k_Tabixfile), 0, 1, 0, 1}, | |
27829 {&__pyx_n_s_Tabixfile___reduce_cython, __pyx_k_Tabixfile___reduce_cython, sizeof(__pyx_k_Tabixfile___reduce_cython), 0, 0, 1, 1}, | |
27830 {&__pyx_n_s_Tabixfile___setstate_cython, __pyx_k_Tabixfile___setstate_cython, sizeof(__pyx_k_Tabixfile___setstate_cython), 0, 0, 1, 1}, | |
27831 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, | |
27832 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, | |
27833 {&__pyx_n_s_WINDOW_SIZE, __pyx_k_WINDOW_SIZE, sizeof(__pyx_k_WINDOW_SIZE), 0, 0, 1, 1}, | |
27834 {&__pyx_kp_b__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 0, 0}, | |
27835 {&__pyx_kp_u__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 1, 0, 0}, | |
27836 {&__pyx_kp_u__42, __pyx_k__42, sizeof(__pyx_k__42), 0, 1, 0, 0}, | |
27837 {&__pyx_kp_u__43, __pyx_k__43, sizeof(__pyx_k__43), 0, 1, 0, 0}, | |
27838 {&__pyx_kp_u__44, __pyx_k__44, sizeof(__pyx_k__44), 0, 1, 0, 0}, | |
27839 {&__pyx_kp_u__56, __pyx_k__56, sizeof(__pyx_k__56), 0, 1, 0, 0}, | |
27840 {&__pyx_n_s__62, __pyx_k__62, sizeof(__pyx_k__62), 0, 0, 1, 1}, | |
27841 {&__pyx_n_s__78, __pyx_k__78, sizeof(__pyx_k__78), 0, 0, 1, 1}, | |
27842 {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, | |
27843 {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, | |
27844 {&__pyx_n_s_asBed, __pyx_k_asBed, sizeof(__pyx_k_asBed), 0, 0, 1, 1}, | |
27845 {&__pyx_n_u_asBed, __pyx_k_asBed, sizeof(__pyx_k_asBed), 0, 1, 0, 1}, | |
27846 {&__pyx_n_s_asBed___reduce_cython, __pyx_k_asBed___reduce_cython, sizeof(__pyx_k_asBed___reduce_cython), 0, 0, 1, 1}, | |
27847 {&__pyx_n_s_asBed___setstate_cython, __pyx_k_asBed___setstate_cython, sizeof(__pyx_k_asBed___setstate_cython), 0, 0, 1, 1}, | |
27848 {&__pyx_n_s_asGFF3, __pyx_k_asGFF3, sizeof(__pyx_k_asGFF3), 0, 0, 1, 1}, | |
27849 {&__pyx_n_u_asGFF3, __pyx_k_asGFF3, sizeof(__pyx_k_asGFF3), 0, 1, 0, 1}, | |
27850 {&__pyx_n_s_asGFF3___reduce_cython, __pyx_k_asGFF3___reduce_cython, sizeof(__pyx_k_asGFF3___reduce_cython), 0, 0, 1, 1}, | |
27851 {&__pyx_n_s_asGFF3___setstate_cython, __pyx_k_asGFF3___setstate_cython, sizeof(__pyx_k_asGFF3___setstate_cython), 0, 0, 1, 1}, | |
27852 {&__pyx_n_s_asGTF, __pyx_k_asGTF, sizeof(__pyx_k_asGTF), 0, 0, 1, 1}, | |
27853 {&__pyx_n_u_asGTF, __pyx_k_asGTF, sizeof(__pyx_k_asGTF), 0, 1, 0, 1}, | |
27854 {&__pyx_n_s_asGTF___reduce_cython, __pyx_k_asGTF___reduce_cython, sizeof(__pyx_k_asGTF___reduce_cython), 0, 0, 1, 1}, | |
27855 {&__pyx_n_s_asGTF___setstate_cython, __pyx_k_asGTF___setstate_cython, sizeof(__pyx_k_asGTF___setstate_cython), 0, 0, 1, 1}, | |
27856 {&__pyx_n_s_asTuple, __pyx_k_asTuple, sizeof(__pyx_k_asTuple), 0, 0, 1, 1}, | |
27857 {&__pyx_n_u_asTuple, __pyx_k_asTuple, sizeof(__pyx_k_asTuple), 0, 1, 0, 1}, | |
27858 {&__pyx_n_s_asTuple___reduce_cython, __pyx_k_asTuple___reduce_cython, sizeof(__pyx_k_asTuple___reduce_cython), 0, 0, 1, 1}, | |
27859 {&__pyx_n_s_asTuple___setstate_cython, __pyx_k_asTuple___setstate_cython, sizeof(__pyx_k_asTuple___setstate_cython), 0, 0, 1, 1}, | |
27860 {&__pyx_n_s_asVCF, __pyx_k_asVCF, sizeof(__pyx_k_asVCF), 0, 0, 1, 1}, | |
27861 {&__pyx_n_u_asVCF, __pyx_k_asVCF, sizeof(__pyx_k_asVCF), 0, 1, 0, 1}, | |
27862 {&__pyx_n_s_asVCF___reduce_cython, __pyx_k_asVCF___reduce_cython, sizeof(__pyx_k_asVCF___reduce_cython), 0, 0, 1, 1}, | |
27863 {&__pyx_n_s_asVCF___setstate_cython, __pyx_k_asVCF___setstate_cython, sizeof(__pyx_k_asVCF___setstate_cython), 0, 0, 1, 1}, | |
27864 {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1}, | |
27865 {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, | |
27866 {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, | |
27867 {&__pyx_n_u_bcf, __pyx_k_bcf, sizeof(__pyx_k_bcf), 0, 1, 0, 1}, | |
27868 {&__pyx_n_u_bed, __pyx_k_bed, sizeof(__pyx_k_bed), 0, 1, 0, 1}, | |
27869 {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, | |
27870 {&__pyx_n_s_buffer_size, __pyx_k_buffer_size, sizeof(__pyx_k_buffer_size), 0, 0, 1, 1}, | |
27871 {&__pyx_kp_u_building_of_index_for_failed, __pyx_k_building_of_index_for_failed, sizeof(__pyx_k_building_of_index_for_failed), 0, 1, 0, 0}, | |
27872 {&__pyx_n_s_bytes_cpy, __pyx_k_bytes_cpy, sizeof(__pyx_k_bytes_cpy), 0, 0, 1, 1}, | |
27873 {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, | |
27874 {&__pyx_n_s_cfilename, __pyx_k_cfilename, sizeof(__pyx_k_cfilename), 0, 0, 1, 1}, | |
27875 {&__pyx_n_s_cfilename_index, __pyx_k_cfilename_index, sizeof(__pyx_k_cfilename_index), 0, 0, 1, 1}, | |
27876 {&__pyx_n_s_cfn, __pyx_k_cfn, sizeof(__pyx_k_cfn), 0, 0, 1, 1}, | |
27877 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, | |
27878 {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, | |
27879 {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1}, | |
27880 {&__pyx_n_s_conf, __pyx_k_conf, sizeof(__pyx_k_conf), 0, 0, 1, 1}, | |
27881 {&__pyx_n_s_conf_data, __pyx_k_conf_data, sizeof(__pyx_k_conf_data), 0, 0, 1, 1}, | |
27882 {&__pyx_n_s_contigs, __pyx_k_contigs, sizeof(__pyx_k_contigs), 0, 0, 1, 1}, | |
27883 {&__pyx_kp_u_could_not_create_iterator_for_re, __pyx_k_could_not_create_iterator_for_re, sizeof(__pyx_k_could_not_create_iterator_for_re), 0, 1, 0, 0}, | |
27884 {&__pyx_kp_u_could_not_create_iterator_possib, __pyx_k_could_not_create_iterator_possib, sizeof(__pyx_k_could_not_create_iterator_possib), 0, 1, 0, 0}, | |
27885 {&__pyx_kp_u_could_not_load_tbi_csi_index_of, __pyx_k_could_not_load_tbi_csi_index_of, sizeof(__pyx_k_could_not_load_tbi_csi_index_of), 0, 1, 0, 0}, | |
27886 {&__pyx_kp_u_could_not_open_file_s, __pyx_k_could_not_open_file_s, sizeof(__pyx_k_could_not_open_file_s), 0, 1, 0, 0}, | |
27887 {&__pyx_kp_u_could_not_open_for_reading_heade, __pyx_k_could_not_open_for_reading_heade, sizeof(__pyx_k_could_not_open_for_reading_heade), 0, 1, 0, 0}, | |
27888 {&__pyx_kp_u_could_not_open_index_for_s, __pyx_k_could_not_open_index_for_s, sizeof(__pyx_k_could_not_open_index_for_s), 0, 1, 0, 0}, | |
27889 {&__pyx_kp_u_could_not_open_s_for_reading, __pyx_k_could_not_open_s_for_reading, sizeof(__pyx_k_could_not_open_s_for_reading), 0, 1, 0, 0}, | |
27890 {&__pyx_kp_u_could_not_open_s_for_writing, __pyx_k_could_not_open_s_for_writing, sizeof(__pyx_k_could_not_open_s_for_writing), 0, 1, 0, 0}, | |
27891 {&__pyx_n_s_cpy, __pyx_k_cpy, sizeof(__pyx_k_cpy), 0, 0, 1, 1}, | |
27892 {&__pyx_n_s_csi, __pyx_k_csi, sizeof(__pyx_k_csi), 0, 0, 1, 1}, | |
27893 {&__pyx_kp_u_csi_2, __pyx_k_csi_2, sizeof(__pyx_k_csi_2), 0, 1, 0, 0}, | |
27894 {&__pyx_n_s_cstr, __pyx_k_cstr, sizeof(__pyx_k_cstr), 0, 0, 1, 1}, | |
27895 {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, | |
27896 {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, | |
27897 {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, | |
27898 {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, | |
27899 {&__pyx_n_s_dup, __pyx_k_dup, sizeof(__pyx_k_dup), 0, 0, 1, 1}, | |
27900 {&__pyx_kp_s_empty_iterator, __pyx_k_empty_iterator, sizeof(__pyx_k_empty_iterator), 0, 0, 1, 0}, | |
27901 {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, | |
27902 {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, | |
27903 {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, | |
27904 {&__pyx_n_s_end_col, __pyx_k_end_col, sizeof(__pyx_k_end_col), 0, 0, 1, 1}, | |
27905 {&__pyx_kp_u_end_out_of_range_i, __pyx_k_end_out_of_range_i, sizeof(__pyx_k_end_out_of_range_i), 0, 1, 0, 0}, | |
27906 {&__pyx_kp_u_error_i_when_closing_file_s, __pyx_k_error_i_when_closing_file_s, sizeof(__pyx_k_error_i_when_closing_file_s), 0, 1, 0, 0}, | |
27907 {&__pyx_kp_u_error_i_when_writing_to_file_s, __pyx_k_error_i_when_writing_to_file_s, sizeof(__pyx_k_error_i_when_writing_to_file_s), 0, 1, 0, 0}, | |
27908 {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1}, | |
27909 {&__pyx_n_s_fd_src, __pyx_k_fd_src, sizeof(__pyx_k_fd_src), 0, 0, 1, 1}, | |
27910 {&__pyx_n_s_fetch, __pyx_k_fetch, sizeof(__pyx_k_fetch), 0, 0, 1, 1}, | |
27911 {&__pyx_kp_u_file_s_not_found, __pyx_k_file_s_not_found, sizeof(__pyx_k_file_s_not_found), 0, 1, 0, 0}, | |
27912 {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, | |
27913 {&__pyx_n_s_filename_in, __pyx_k_filename_in, sizeof(__pyx_k_filename_in), 0, 0, 1, 1}, | |
27914 {&__pyx_n_s_filename_index, __pyx_k_filename_index, sizeof(__pyx_k_filename_index), 0, 0, 1, 1}, | |
27915 {&__pyx_n_s_filename_out, __pyx_k_filename_out, sizeof(__pyx_k_filename_out), 0, 0, 1, 1}, | |
27916 {&__pyx_kp_u_filename_s_already_exists_use_fo, __pyx_k_filename_s_already_exists_use_fo, sizeof(__pyx_k_filename_s_already_exists_use_fo), 0, 1, 0, 0}, | |
27917 {&__pyx_n_s_fileobj, __pyx_k_fileobj, sizeof(__pyx_k_fileobj), 0, 0, 1, 1}, | |
27918 {&__pyx_n_s_fmt, __pyx_k_fmt, sizeof(__pyx_k_fmt), 0, 0, 1, 1}, | |
27919 {&__pyx_n_s_fn, __pyx_k_fn, sizeof(__pyx_k_fn), 0, 0, 1, 1}, | |
27920 {&__pyx_n_s_fn_index, __pyx_k_fn_index, sizeof(__pyx_k_fn_index), 0, 0, 1, 1}, | |
27921 {&__pyx_n_s_fnidx, __pyx_k_fnidx, sizeof(__pyx_k_fnidx), 0, 0, 1, 1}, | |
27922 {&__pyx_n_s_force, __pyx_k_force, sizeof(__pyx_k_force), 0, 0, 1, 1}, | |
27923 {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, | |
27924 {&__pyx_n_s_fp, __pyx_k_fp, sizeof(__pyx_k_fp), 0, 0, 1, 1}, | |
27925 {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, | |
27926 {&__pyx_n_s_get_encoding, __pyx_k_get_encoding, sizeof(__pyx_k_get_encoding), 0, 0, 1, 1}, | |
27927 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, | |
27928 {&__pyx_n_u_gff, __pyx_k_gff, sizeof(__pyx_k_gff), 0, 1, 0, 1}, | |
27929 {&__pyx_kp_u_gz, __pyx_k_gz, sizeof(__pyx_k_gz), 0, 1, 0, 0}, | |
27930 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, | |
27931 {&__pyx_kp_u_incomplete_line_at_s, __pyx_k_incomplete_line_at_s, sizeof(__pyx_k_incomplete_line_at_s), 0, 1, 0, 0}, | |
27932 {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, | |
27933 {&__pyx_kp_u_index_s_not_found, __pyx_k_index_s_not_found, sizeof(__pyx_k_index_s_not_found), 0, 1, 0, 0}, | |
27934 {&__pyx_n_s_infile, __pyx_k_infile, sizeof(__pyx_k_infile), 0, 0, 1, 1}, | |
27935 {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, | |
27936 {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, | |
27937 {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, | |
27938 {&__pyx_kp_u_invalid_file_opening_mode_s, __pyx_k_invalid_file_opening_mode_s, sizeof(__pyx_k_invalid_file_opening_mode_s), 0, 1, 0, 0}, | |
27939 {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, | |
27940 {&__pyx_n_s_is_empty, __pyx_k_is_empty, sizeof(__pyx_k_is_empty), 0, 0, 1, 1}, | |
27941 {&__pyx_n_s_is_open, __pyx_k_is_open, sizeof(__pyx_k_is_open), 0, 0, 1, 1}, | |
27942 {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, | |
27943 {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1}, | |
27944 {&__pyx_kp_s_iterate_over_infile_Permits_the, __pyx_k_iterate_over_infile_Permits_the, sizeof(__pyx_k_iterate_over_infile_Permits_the), 0, 0, 1, 0}, | |
27945 {&__pyx_kp_u_iteration_on_closed_file, __pyx_k_iteration_on_closed_file, sizeof(__pyx_k_iteration_on_closed_file), 0, 1, 0, 0}, | |
27946 {&__pyx_n_s_itr, __pyx_k_itr, sizeof(__pyx_k_itr), 0, 0, 1, 1}, | |
27947 {&__pyx_n_s_keep_original, __pyx_k_keep_original, sizeof(__pyx_k_keep_original), 0, 0, 1, 1}, | |
27948 {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, | |
27949 {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, | |
27950 {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1}, | |
27951 {&__pyx_n_s_line_skip, __pyx_k_line_skip, sizeof(__pyx_k_line_skip), 0, 0, 1, 1}, | |
27952 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, | |
27953 {&__pyx_n_s_meta_char, __pyx_k_meta_char, sizeof(__pyx_k_meta_char), 0, 0, 1, 1}, | |
27954 {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, | |
27955 {&__pyx_n_s_min_shift, __pyx_k_min_shift, sizeof(__pyx_k_min_shift), 0, 0, 1, 1}, | |
27956 {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, | |
27957 {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, | |
27958 {&__pyx_n_s_multiple_iterators, __pyx_k_multiple_iterators, sizeof(__pyx_k_multiple_iterators), 0, 0, 1, 1}, | |
27959 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, | |
27960 {&__pyx_n_s_nbytes, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 0, 0, 1, 1}, | |
27961 {&__pyx_kp_u_neither_preset_nor_seq_col_start, __pyx_k_neither_preset_nor_seq_col_start, sizeof(__pyx_k_neither_preset_nor_seq_col_start), 0, 1, 0, 0}, | |
27962 {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, | |
27963 {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1}, | |
27964 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, | |
27965 {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, | |
27966 {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, | |
27967 {&__pyx_kp_u_parse_method_of_s_not_implemente, __pyx_k_parse_method_of_s_not_implemente, sizeof(__pyx_k_parse_method_of_s_not_implemente), 0, 1, 0, 0}, | |
27968 {&__pyx_n_s_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 0, 0, 1, 1}, | |
27969 {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, | |
27970 {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, | |
27971 {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, | |
27972 {&__pyx_n_s_preset, __pyx_k_preset, sizeof(__pyx_k_preset), 0, 0, 1, 1}, | |
27973 {&__pyx_n_s_preset2conf, __pyx_k_preset2conf, sizeof(__pyx_k_preset2conf), 0, 0, 1, 1}, | |
27974 {&__pyx_n_u_psltbl, __pyx_k_psltbl, sizeof(__pyx_k_psltbl), 0, 1, 0, 1}, | |
27975 {&__pyx_n_s_pysam_libctabix, __pyx_k_pysam_libctabix, sizeof(__pyx_k_pysam_libctabix), 0, 0, 1, 1}, | |
27976 {&__pyx_kp_s_pysam_libctabix_pyx, __pyx_k_pysam_libctabix_pyx, sizeof(__pyx_k_pysam_libctabix_pyx), 0, 0, 1, 0}, | |
27977 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, | |
27978 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, | |
27979 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, | |
27980 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, | |
27981 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, | |
27982 {&__pyx_n_s_pyx_unpickle_Parser, __pyx_k_pyx_unpickle_Parser, sizeof(__pyx_k_pyx_unpickle_Parser), 0, 0, 1, 1}, | |
27983 {&__pyx_n_s_pyx_unpickle_asBed, __pyx_k_pyx_unpickle_asBed, sizeof(__pyx_k_pyx_unpickle_asBed), 0, 0, 1, 1}, | |
27984 {&__pyx_n_s_pyx_unpickle_asGFF3, __pyx_k_pyx_unpickle_asGFF3, sizeof(__pyx_k_pyx_unpickle_asGFF3), 0, 0, 1, 1}, | |
27985 {&__pyx_n_s_pyx_unpickle_asGTF, __pyx_k_pyx_unpickle_asGTF, sizeof(__pyx_k_pyx_unpickle_asGTF), 0, 0, 1, 1}, | |
27986 {&__pyx_n_s_pyx_unpickle_asTuple, __pyx_k_pyx_unpickle_asTuple, sizeof(__pyx_k_pyx_unpickle_asTuple), 0, 0, 1, 1}, | |
27987 {&__pyx_n_s_pyx_unpickle_asVCF, __pyx_k_pyx_unpickle_asVCF, sizeof(__pyx_k_pyx_unpickle_asVCF), 0, 0, 1, 1}, | |
27988 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, | |
27989 {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, | |
27990 {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, | |
27991 {&__pyx_n_u_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 1, 0, 1}, | |
27992 {&__pyx_n_s_readline, __pyx_k_readline, sizeof(__pyx_k_readline), 0, 0, 1, 1}, | |
27993 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, | |
27994 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, | |
27995 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, | |
27996 {&__pyx_n_s_reference, __pyx_k_reference, sizeof(__pyx_k_reference), 0, 0, 1, 1}, | |
27997 {&__pyx_n_s_region, __pyx_k_region, sizeof(__pyx_k_region), 0, 0, 1, 1}, | |
27998 {&__pyx_n_s_retval, __pyx_k_retval, sizeof(__pyx_k_retval), 0, 0, 1, 1}, | |
27999 {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0}, | |
28000 {&__pyx_n_s_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 0, 1, 1}, | |
28001 {&__pyx_kp_u_s_i, __pyx_k_s_i, sizeof(__pyx_k_s_i), 0, 1, 0, 0}, | |
28002 {&__pyx_kp_u_s_i_i, __pyx_k_s_i_i, sizeof(__pyx_k_s_i_i), 0, 1, 0, 0}, | |
28003 {&__pyx_n_u_sam, __pyx_k_sam, sizeof(__pyx_k_sam), 0, 1, 0, 1}, | |
28004 {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, | |
28005 {&__pyx_kp_s_self_gzipfile_self_kstream_canno, __pyx_k_self_gzipfile_self_kstream_canno, sizeof(__pyx_k_self_gzipfile_self_kstream_canno), 0, 0, 1, 0}, | |
28006 {&__pyx_kp_s_self_iterator_cannot_be_converte, __pyx_k_self_iterator_cannot_be_converte, sizeof(__pyx_k_self_iterator_cannot_be_converte), 0, 0, 1, 0}, | |
28007 {&__pyx_n_s_seq_col, __pyx_k_seq_col, sizeof(__pyx_k_seq_col), 0, 0, 1, 1}, | |
28008 {&__pyx_n_s_set_encoding, __pyx_k_set_encoding, sizeof(__pyx_k_set_encoding), 0, 0, 1, 1}, | |
28009 {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, | |
28010 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, | |
28011 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, | |
28012 {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, | |
28013 {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, | |
28014 {&__pyx_n_s_start_col, __pyx_k_start_col, sizeof(__pyx_k_start_col), 0, 0, 1, 1}, | |
28015 {&__pyx_kp_u_start_i_end_i, __pyx_k_start_i_end_i, sizeof(__pyx_k_start_i_end_i), 0, 1, 0, 0}, | |
28016 {&__pyx_kp_u_start_out_of_range_i, __pyx_k_start_out_of_range_i, sizeof(__pyx_k_start_out_of_range_i), 0, 1, 0, 0}, | |
28017 {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, | |
28018 {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, | |
28019 {&__pyx_n_s_suffix, __pyx_k_suffix, sizeof(__pyx_k_suffix), 0, 0, 1, 1}, | |
28020 {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, | |
28021 {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, | |
28022 {&__pyx_n_s_tabix_compress, __pyx_k_tabix_compress, sizeof(__pyx_k_tabix_compress), 0, 0, 1, 1}, | |
28023 {&__pyx_n_u_tabix_compress, __pyx_k_tabix_compress, sizeof(__pyx_k_tabix_compress), 0, 1, 0, 1}, | |
28024 {&__pyx_n_s_tabix_file_iterator, __pyx_k_tabix_file_iterator, sizeof(__pyx_k_tabix_file_iterator), 0, 0, 1, 1}, | |
28025 {&__pyx_n_u_tabix_file_iterator, __pyx_k_tabix_file_iterator, sizeof(__pyx_k_tabix_file_iterator), 0, 1, 0, 1}, | |
28026 {&__pyx_n_s_tabix_file_iterator___reduce_cyt, __pyx_k_tabix_file_iterator___reduce_cyt, sizeof(__pyx_k_tabix_file_iterator___reduce_cyt), 0, 0, 1, 1}, | |
28027 {&__pyx_n_s_tabix_file_iterator___setstate_c, __pyx_k_tabix_file_iterator___setstate_c, sizeof(__pyx_k_tabix_file_iterator___setstate_c), 0, 0, 1, 1}, | |
28028 {&__pyx_n_s_tabix_generic_iterator, __pyx_k_tabix_generic_iterator, sizeof(__pyx_k_tabix_generic_iterator), 0, 0, 1, 1}, | |
28029 {&__pyx_n_u_tabix_generic_iterator, __pyx_k_tabix_generic_iterator, sizeof(__pyx_k_tabix_generic_iterator), 0, 1, 0, 1}, | |
28030 {&__pyx_n_s_tabix_generic_iterator___init, __pyx_k_tabix_generic_iterator___init, sizeof(__pyx_k_tabix_generic_iterator___init), 0, 0, 1, 1}, | |
28031 {&__pyx_n_s_tabix_generic_iterator___iter, __pyx_k_tabix_generic_iterator___iter, sizeof(__pyx_k_tabix_generic_iterator___iter), 0, 0, 1, 1}, | |
28032 {&__pyx_n_s_tabix_generic_iterator___next, __pyx_k_tabix_generic_iterator___next, sizeof(__pyx_k_tabix_generic_iterator___next), 0, 0, 1, 1}, | |
28033 {&__pyx_n_s_tabix_index, __pyx_k_tabix_index, sizeof(__pyx_k_tabix_index), 0, 0, 1, 1}, | |
28034 {&__pyx_n_u_tabix_index, __pyx_k_tabix_index, sizeof(__pyx_k_tabix_index), 0, 1, 0, 1}, | |
28035 {&__pyx_n_s_tabix_iterator, __pyx_k_tabix_iterator, sizeof(__pyx_k_tabix_iterator), 0, 0, 1, 1}, | |
28036 {&__pyx_n_u_tabix_iterator, __pyx_k_tabix_iterator, sizeof(__pyx_k_tabix_iterator), 0, 1, 0, 1}, | |
28037 {&__pyx_kp_u_tbi, __pyx_k_tbi, sizeof(__pyx_k_tbi), 0, 1, 0, 0}, | |
28038 {&__pyx_n_s_tell, __pyx_k_tell, sizeof(__pyx_k_tell), 0, 0, 1, 1}, | |
28039 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, | |
28040 {&__pyx_n_s_threads, __pyx_k_threads, sizeof(__pyx_k_threads), 0, 0, 1, 1}, | |
28041 {&__pyx_kp_u_unknown_preset, __pyx_k_unknown_preset, sizeof(__pyx_k_unknown_preset), 0, 1, 0, 0}, | |
28042 {&__pyx_n_s_unlink, __pyx_k_unlink, sizeof(__pyx_k_unlink), 0, 0, 1, 1}, | |
28043 {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, | |
28044 {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1}, | |
28045 {&__pyx_kp_u_valid_presets_are, __pyx_k_valid_presets_are, sizeof(__pyx_k_valid_presets_are), 0, 1, 0, 0}, | |
28046 {&__pyx_n_u_vcf, __pyx_k_vcf, sizeof(__pyx_k_vcf), 0, 1, 0, 1}, | |
28047 {&__pyx_kp_u_writing_failed, __pyx_k_writing_failed, sizeof(__pyx_k_writing_failed), 0, 1, 0, 0}, | |
28048 {&__pyx_n_s_zerobased, __pyx_k_zerobased, sizeof(__pyx_k_zerobased), 0, 0, 1, 1}, | |
28049 {0, 0, 0, 0, 0, 0, 0} | |
28050 }; | |
28051 return __Pyx_InitStrings(__pyx_string_tab); | |
28052 } | |
28053 /* #### Code section: cached_builtins ### */ | |
28054 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { | |
28055 __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 94, __pyx_L1_error) | |
28056 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 361, __pyx_L1_error) | |
28057 __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 378, __pyx_L1_error) | |
28058 __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 560, __pyx_L1_error) | |
28059 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) | |
28060 __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 671, __pyx_L1_error) | |
28061 __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 701, __pyx_L1_error) | |
28062 __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 969, __pyx_L1_error) | |
28063 __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 1216, __pyx_L1_error) | |
28064 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 120, __pyx_L1_error) | |
28065 return 0; | |
28066 __pyx_L1_error:; | |
28067 return -1; | |
28068 } | |
28069 /* #### Code section: cached_constants ### */ | |
28070 | |
28071 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { | |
28072 __Pyx_RefNannyDeclarations | |
28073 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); | |
28074 | |
28075 /* "pysam/libctabix.pyx":444 | |
28076 * ''' | |
28077 * if not self.is_open(): | |
28078 * raise ValueError("I/O operation on closed file") # <<<<<<<<<<<<<< | |
28079 * | |
28080 * # convert coordinates to region string, which is one-based | |
28081 */ | |
28082 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 444, __pyx_L1_error) | |
28083 __Pyx_GOTREF(__pyx_tuple__19); | |
28084 __Pyx_GIVEREF(__pyx_tuple__19); | |
28085 | |
28086 /* "pysam/libctabix.pyx":499 | |
28087 * # when accessing a tabix file created prior tabix 1.0 | |
28088 * # the full-file iterator is empty. | |
28089 * raise ValueError( # <<<<<<<<<<<<<< | |
28090 * "could not create iterator, possible " | |
28091 * "tabix version mismatch") | |
28092 */ | |
28093 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_could_not_create_iterator_possib); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 499, __pyx_L1_error) | |
28094 __Pyx_GOTREF(__pyx_tuple__20); | |
28095 __Pyx_GIVEREF(__pyx_tuple__20); | |
28096 | |
28097 /* "pysam/libctabix.pyx":669 | |
28098 * cdef int retval = self.__cnext__() | |
28099 * if retval == -5: | |
28100 * raise IOError("iteration on closed file") # <<<<<<<<<<<<<< | |
28101 * elif retval < 0: | |
28102 * raise StopIteration | |
28103 */ | |
28104 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_iteration_on_closed_file); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 669, __pyx_L1_error) | |
28105 __Pyx_GOTREF(__pyx_tuple__24); | |
28106 __Pyx_GIVEREF(__pyx_tuple__24); | |
28107 | |
28108 /* "pysam/libctabix.pyx":859 | |
28109 * if r < 0: | |
28110 * free(buffer) | |
28111 * raise IOError("writing failed") # <<<<<<<<<<<<<< | |
28112 * | |
28113 * free(buffer) | |
28114 */ | |
28115 __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_u_writing_failed); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 859, __pyx_L1_error) | |
28116 __Pyx_GOTREF(__pyx_tuple__38); | |
28117 __Pyx_GIVEREF(__pyx_tuple__38); | |
28118 | |
28119 /* "pysam/libctabix.pyx":930 | |
28120 * if preset is None and \ | |
28121 * (seq_col is None or start_col is None or end_col is None): | |
28122 * raise ValueError( # <<<<<<<<<<<<<< | |
28123 * "neither preset nor seq_col,start_col and end_col given") | |
28124 * | |
28125 */ | |
28126 __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_u_neither_preset_nor_seq_col_start); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 930, __pyx_L1_error) | |
28127 __Pyx_GOTREF(__pyx_tuple__41); | |
28128 __Pyx_GIVEREF(__pyx_tuple__41); | |
28129 | |
28130 /* "pysam/libctabix.pyx":1108 | |
28131 * | |
28132 * if infile.closed: | |
28133 * raise ValueError("I/O operation on closed file.") # <<<<<<<<<<<<<< | |
28134 * | |
28135 * self.infile = infile | |
28136 */ | |
28137 __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_u_I_O_operation_on_closed_file_2); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1108, __pyx_L1_error) | |
28138 __Pyx_GOTREF(__pyx_tuple__45); | |
28139 __Pyx_GIVEREF(__pyx_tuple__45); | |
28140 | |
28141 /* "(tree fragment)":4 | |
28142 * cdef object __pyx_PickleError | |
28143 * cdef object __pyx_result | |
28144 * if __pyx_checksum not in (0xe8424ea, 0x14a9dc0, 0x84bea1f): # <<<<<<<<<<<<<< | |
28145 * from pickle import PickleError as __pyx_PickleError | |
28146 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe8424ea, 0x14a9dc0, 0x84bea1f) = (encoding))" % __pyx_checksum | |
28147 */ | |
28148 __pyx_tuple__55 = PyTuple_Pack(3, __pyx_int_243541226, __pyx_int_21667264, __pyx_int_139192863); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 4, __pyx_L1_error) | |
28149 __Pyx_GOTREF(__pyx_tuple__55); | |
28150 __Pyx_GIVEREF(__pyx_tuple__55); | |
28151 | |
28152 /* "pysam/libctabix.pyx":87 | |
28153 * self.encoding = encoding | |
28154 * | |
28155 * def set_encoding(self, encoding): # <<<<<<<<<<<<<< | |
28156 * self.encoding = encoding | |
28157 * | |
28158 */ | |
28159 __pyx_tuple__63 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 87, __pyx_L1_error) | |
28160 __Pyx_GOTREF(__pyx_tuple__63); | |
28161 __Pyx_GIVEREF(__pyx_tuple__63); | |
28162 __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libctabix_pyx, __pyx_n_s_set_encoding, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 87, __pyx_L1_error) | |
28163 | |
28164 /* "pysam/libctabix.pyx":90 | |
28165 * self.encoding = encoding | |
28166 * | |
28167 * def get_encoding(self): # <<<<<<<<<<<<<< | |
28168 * return self.encoding | |
28169 * | |
28170 */ | |
28171 __pyx_tuple__64 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 90, __pyx_L1_error) | |
28172 __Pyx_GOTREF(__pyx_tuple__64); | |
28173 __Pyx_GIVEREF(__pyx_tuple__64); | |
28174 __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libctabix_pyx, __pyx_n_s_get_encoding, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 90, __pyx_L1_error) | |
28175 | |
28176 /* "(tree fragment)":1 | |
28177 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
28178 * cdef tuple state | |
28179 * cdef object _dict | |
28180 */ | |
28181 __pyx_tuple__65 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28182 __Pyx_GOTREF(__pyx_tuple__65); | |
28183 __Pyx_GIVEREF(__pyx_tuple__65); | |
28184 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __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(1, 1, __pyx_L1_error) | |
28185 | |
28186 /* "(tree fragment)":16 | |
28187 * else: | |
28188 * return __pyx_unpickle_Parser, (type(self), 0xe8424ea, state) | |
28189 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
28190 * __pyx_unpickle_Parser__set_state(self, __pyx_state) | |
28191 */ | |
28192 __pyx_tuple__66 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(1, 16, __pyx_L1_error) | |
28193 __Pyx_GOTREF(__pyx_tuple__66); | |
28194 __Pyx_GIVEREF(__pyx_tuple__66); | |
28195 __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__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(1, 16, __pyx_L1_error) | |
28196 | |
28197 /* "(tree fragment)":1 | |
28198 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
28199 * cdef tuple state | |
28200 * cdef object _dict | |
28201 */ | |
28202 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28203 | |
28204 /* "(tree fragment)":16 | |
28205 * else: | |
28206 * return __pyx_unpickle_asTuple, (type(self), 0xe8424ea, state) | |
28207 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
28208 * __pyx_unpickle_asTuple__set_state(self, __pyx_state) | |
28209 */ | |
28210 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(1, 16, __pyx_L1_error) | |
28211 | |
28212 /* "(tree fragment)":1 | |
28213 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
28214 * cdef tuple state | |
28215 * cdef object _dict | |
28216 */ | |
28217 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28218 | |
28219 /* "(tree fragment)":16 | |
28220 * else: | |
28221 * return __pyx_unpickle_asGFF3, (type(self), 0xe8424ea, state) | |
28222 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
28223 * __pyx_unpickle_asGFF3__set_state(self, __pyx_state) | |
28224 */ | |
28225 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 16, __pyx_L1_error) | |
28226 | |
28227 /* "(tree fragment)":1 | |
28228 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
28229 * cdef tuple state | |
28230 * cdef object _dict | |
28231 */ | |
28232 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28233 | |
28234 /* "(tree fragment)":16 | |
28235 * else: | |
28236 * return __pyx_unpickle_asGTF, (type(self), 0xe8424ea, state) | |
28237 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
28238 * __pyx_unpickle_asGTF__set_state(self, __pyx_state) | |
28239 */ | |
28240 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 16, __pyx_L1_error) | |
28241 | |
28242 /* "(tree fragment)":1 | |
28243 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
28244 * cdef tuple state | |
28245 * cdef object _dict | |
28246 */ | |
28247 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28248 | |
28249 /* "(tree fragment)":16 | |
28250 * else: | |
28251 * return __pyx_unpickle_asBed, (type(self), 0xe8424ea, state) | |
28252 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
28253 * __pyx_unpickle_asBed__set_state(self, __pyx_state) | |
28254 */ | |
28255 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 16, __pyx_L1_error) | |
28256 | |
28257 /* "(tree fragment)":1 | |
28258 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
28259 * cdef tuple state | |
28260 * cdef object _dict | |
28261 */ | |
28262 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28263 | |
28264 /* "(tree fragment)":16 | |
28265 * else: | |
28266 * return __pyx_unpickle_asVCF, (type(self), 0xe8424ea, state) | |
28267 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
28268 * __pyx_unpickle_asVCF__set_state(self, __pyx_state) | |
28269 */ | |
28270 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 16, __pyx_L1_error) | |
28271 | |
28272 /* "pysam/libctabix.pyx":352 | |
28273 * self.encoding = encoding | |
28274 * | |
28275 * def _open( self, # <<<<<<<<<<<<<< | |
28276 * filename, | |
28277 * mode='r', | |
28278 */ | |
28279 __pyx_tuple__67 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_mode, __pyx_n_s_index, __pyx_n_s_threads, __pyx_n_s_filename_index, __pyx_n_s_cfilename, __pyx_n_s_cfilename_index); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 352, __pyx_L1_error) | |
28280 __Pyx_GOTREF(__pyx_tuple__67); | |
28281 __Pyx_GIVEREF(__pyx_tuple__67); | |
28282 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libctabix_pyx, __pyx_n_s_open, 352, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 352, __pyx_L1_error) | |
28283 __pyx_tuple__68 = PyTuple_Pack(3, __pyx_n_u_r, Py_None, __pyx_int_1); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 352, __pyx_L1_error) | |
28284 __Pyx_GOTREF(__pyx_tuple__68); | |
28285 __Pyx_GIVEREF(__pyx_tuple__68); | |
28286 | |
28287 /* "pysam/libctabix.pyx":404 | |
28288 * self.start_offset = self.tell() | |
28289 * | |
28290 * def _dup(self): # <<<<<<<<<<<<<< | |
28291 * '''return a copy of this tabix file. | |
28292 * | |
28293 */ | |
28294 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libctabix_pyx, __pyx_n_s_dup, 404, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 404, __pyx_L1_error) | |
28295 | |
28296 /* "pysam/libctabix.pyx":416 | |
28297 * encoding=self.encoding) | |
28298 * | |
28299 * def fetch(self, # <<<<<<<<<<<<<< | |
28300 * reference=None, | |
28301 * start=None, | |
28302 */ | |
28303 __pyx_tuple__69 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_reference, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_region, __pyx_n_s_parser, __pyx_n_s_multiple_iterators, __pyx_n_s_itr, __pyx_n_s_cstr, __pyx_n_s_fileobj, __pyx_n_s_s_2, __pyx_n_s_a); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 416, __pyx_L1_error) | |
28304 __Pyx_GOTREF(__pyx_tuple__69); | |
28305 __Pyx_GIVEREF(__pyx_tuple__69); | |
28306 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libctabix_pyx, __pyx_n_s_fetch, 416, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 416, __pyx_L1_error) | |
28307 __pyx_tuple__70 = PyTuple_Pack(6, Py_None, Py_None, Py_None, Py_None, Py_None, Py_False); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 416, __pyx_L1_error) | |
28308 __Pyx_GOTREF(__pyx_tuple__70); | |
28309 __Pyx_GIVEREF(__pyx_tuple__70); | |
28310 | |
28311 /* "pysam/libctabix.pyx":598 | |
28312 * return result | |
28313 * | |
28314 * def close(self): # <<<<<<<<<<<<<< | |
28315 * ''' | |
28316 * closes the :class:`pysam.TabixFile`.''' | |
28317 */ | |
28318 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libctabix_pyx, __pyx_n_s_close, 598, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 598, __pyx_L1_error) | |
28319 | |
28320 /* "(tree fragment)":1 | |
28321 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
28322 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
28323 * def __setstate_cython__(self, __pyx_state): | |
28324 */ | |
28325 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28326 | |
28327 /* "(tree fragment)":3 | |
28328 * def __reduce_cython__(self): | |
28329 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
28330 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
28331 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
28332 */ | |
28333 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(1, 3, __pyx_L1_error) | |
28334 | |
28335 /* "(tree fragment)":1 | |
28336 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
28337 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
28338 * def __setstate_cython__(self, __pyx_state): | |
28339 */ | |
28340 __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28341 | |
28342 /* "(tree fragment)":3 | |
28343 * def __reduce_cython__(self): | |
28344 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
28345 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
28346 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
28347 */ | |
28348 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(1, 3, __pyx_L1_error) | |
28349 | |
28350 /* "pysam/libctabix.pyx":685 | |
28351 * '''empty iterator''' | |
28352 * | |
28353 * def __iter__(self): # <<<<<<<<<<<<<< | |
28354 * return self | |
28355 * | |
28356 */ | |
28357 __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libctabix_pyx, __pyx_n_s_iter, 685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 685, __pyx_L1_error) | |
28358 | |
28359 /* "pysam/libctabix.pyx":688 | |
28360 * return self | |
28361 * | |
28362 * def __next__(self): # <<<<<<<<<<<<<< | |
28363 * raise StopIteration() | |
28364 * | |
28365 */ | |
28366 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libctabix_pyx, __pyx_n_s_next, 688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 688, __pyx_L1_error) | |
28367 | |
28368 /* "(tree fragment)":1 | |
28369 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
28370 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
28371 * def __setstate_cython__(self, __pyx_state): | |
28372 */ | |
28373 __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28374 | |
28375 /* "(tree fragment)":3 | |
28376 * def __reduce_cython__(self): | |
28377 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
28378 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
28379 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
28380 */ | |
28381 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(1, 3, __pyx_L1_error) | |
28382 | |
28383 /* "(tree fragment)":1 | |
28384 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
28385 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
28386 * def __setstate_cython__(self, __pyx_state): | |
28387 */ | |
28388 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28389 | |
28390 /* "(tree fragment)":3 | |
28391 * def __reduce_cython__(self): | |
28392 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
28393 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
28394 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
28395 */ | |
28396 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(1, 3, __pyx_L1_error) | |
28397 | |
28398 /* "(tree fragment)":1 | |
28399 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
28400 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
28401 * def __setstate_cython__(self, __pyx_state): | |
28402 */ | |
28403 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28404 | |
28405 /* "(tree fragment)":3 | |
28406 * def __reduce_cython__(self): | |
28407 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
28408 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
28409 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
28410 */ | |
28411 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 3, __pyx_L1_error) | |
28412 | |
28413 /* "(tree fragment)":1 | |
28414 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
28415 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
28416 * def __setstate_cython__(self, __pyx_state): | |
28417 */ | |
28418 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28419 | |
28420 /* "(tree fragment)":3 | |
28421 * def __reduce_cython__(self): | |
28422 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
28423 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
28424 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
28425 */ | |
28426 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(1, 3, __pyx_L1_error) | |
28427 | |
28428 /* "pysam/libctabix.pyx":811 | |
28429 * | |
28430 * | |
28431 * def tabix_compress(filename_in, # <<<<<<<<<<<<<< | |
28432 * filename_out, | |
28433 * force=False): | |
28434 */ | |
28435 __pyx_tuple__71 = PyTuple_Pack(13, __pyx_n_s_filename_in, __pyx_n_s_filename_out, __pyx_n_s_force, __pyx_n_s_WINDOW_SIZE, __pyx_n_s_c, __pyx_n_s_r, __pyx_n_s_buffer, __pyx_n_s_fp, __pyx_n_s_fd_src, __pyx_n_s_is_empty, __pyx_n_s_O_RDONLY, __pyx_n_s_fn, __pyx_n_s_cfn); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 811, __pyx_L1_error) | |
28436 __Pyx_GOTREF(__pyx_tuple__71); | |
28437 __Pyx_GIVEREF(__pyx_tuple__71); | |
28438 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libctabix_pyx, __pyx_n_s_tabix_compress, 811, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 811, __pyx_L1_error) | |
28439 __pyx_tuple__72 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 811, __pyx_L1_error) | |
28440 __Pyx_GOTREF(__pyx_tuple__72); | |
28441 __Pyx_GIVEREF(__pyx_tuple__72); | |
28442 | |
28443 /* "pysam/libctabix.pyx":873 | |
28444 * | |
28445 * | |
28446 * def tabix_index(filename, # <<<<<<<<<<<<<< | |
28447 * force=False, | |
28448 * seq_col=None, | |
28449 */ | |
28450 __pyx_tuple__73 = PyTuple_Pack(24, __pyx_n_s_filename, __pyx_n_s_force, __pyx_n_s_seq_col, __pyx_n_s_start_col, __pyx_n_s_end_col, __pyx_n_s_preset, __pyx_n_s_meta_char, __pyx_n_s_line_skip, __pyx_n_s_zerobased, __pyx_n_s_min_shift, __pyx_n_s_index, __pyx_n_s_keep_original, __pyx_n_s_csi, __pyx_n_s_fn, __pyx_n_s_cfn, __pyx_n_s_fp, __pyx_n_s_fmt, __pyx_n_s_preset2conf, __pyx_n_s_conf_data, __pyx_n_s_conf, __pyx_n_s_suffix, __pyx_n_s_fn_index, __pyx_n_s_fnidx, __pyx_n_s_retval); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 873, __pyx_L1_error) | |
28451 __Pyx_GOTREF(__pyx_tuple__73); | |
28452 __Pyx_GIVEREF(__pyx_tuple__73); | |
28453 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(13, 0, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libctabix_pyx, __pyx_n_s_tabix_index, 873, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 873, __pyx_L1_error) | |
28454 | |
28455 /* "(tree fragment)":1 | |
28456 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
28457 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
28458 * def __setstate_cython__(self, __pyx_state): | |
28459 */ | |
28460 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28461 | |
28462 /* "(tree fragment)":3 | |
28463 * def __reduce_cython__(self): | |
28464 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
28465 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
28466 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
28467 */ | |
28468 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(1, 3, __pyx_L1_error) | |
28469 | |
28470 /* "pysam/libctabix.pyx":1183 | |
28471 * Permits the use of file-like objects for example from the gzip module. | |
28472 * ''' | |
28473 * def __init__(self, infile, parser): # <<<<<<<<<<<<<< | |
28474 * | |
28475 * self.infile = infile | |
28476 */ | |
28477 __pyx_tuple__74 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_infile, __pyx_n_s_parser); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 1183, __pyx_L1_error) | |
28478 __Pyx_GOTREF(__pyx_tuple__74); | |
28479 __Pyx_GIVEREF(__pyx_tuple__74); | |
28480 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libctabix_pyx, __pyx_n_s_init, 1183, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 1183, __pyx_L1_error) | |
28481 | |
28482 /* "pysam/libctabix.pyx":1190 | |
28483 * self.parser = parser | |
28484 * | |
28485 * def __iter__(self): # <<<<<<<<<<<<<< | |
28486 * return self | |
28487 * | |
28488 */ | |
28489 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libctabix_pyx, __pyx_n_s_iter, 1190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 1190, __pyx_L1_error) | |
28490 | |
28491 /* "pysam/libctabix.pyx":1194 | |
28492 * | |
28493 * # cython version - required for python 3 | |
28494 * def __next__(self): # <<<<<<<<<<<<<< | |
28495 * | |
28496 * cdef char * b | |
28497 */ | |
28498 __pyx_tuple__75 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_b, __pyx_n_s_cpy, __pyx_n_s_nbytes, __pyx_n_s_encoding, __pyx_n_s_line, __pyx_n_s_s_2, __pyx_n_s_bytes_cpy); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 1194, __pyx_L1_error) | |
28499 __Pyx_GOTREF(__pyx_tuple__75); | |
28500 __Pyx_GIVEREF(__pyx_tuple__75); | |
28501 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libctabix_pyx, __pyx_n_s_next, 1194, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 1194, __pyx_L1_error) | |
28502 | |
28503 /* "pysam/libctabix.pyx":1238 | |
28504 * | |
28505 * | |
28506 * def tabix_iterator(infile, parser): # <<<<<<<<<<<<<< | |
28507 * """return an iterator over all entries in a file. | |
28508 * | |
28509 */ | |
28510 __pyx_tuple__76 = PyTuple_Pack(2, __pyx_n_s_infile, __pyx_n_s_parser); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 1238, __pyx_L1_error) | |
28511 __Pyx_GOTREF(__pyx_tuple__76); | |
28512 __Pyx_GIVEREF(__pyx_tuple__76); | |
28513 __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libctabix_pyx, __pyx_n_s_tabix_iterator, 1238, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 1238, __pyx_L1_error) | |
28514 | |
28515 /* "(tree fragment)":1 | |
28516 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
28517 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
28518 * def __setstate_cython__(self, __pyx_state): | |
28519 */ | |
28520 __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28521 | |
28522 /* "(tree fragment)":3 | |
28523 * def __reduce_cython__(self): | |
28524 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
28525 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
28526 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
28527 */ | |
28528 __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(1, 3, __pyx_L1_error) | |
28529 | |
28530 /* "(tree fragment)":1 | |
28531 * def __pyx_unpickle_Parser(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
28532 * cdef object __pyx_PickleError | |
28533 * cdef object __pyx_result | |
28534 */ | |
28535 __pyx_tuple__77 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28536 __Pyx_GOTREF(__pyx_tuple__77); | |
28537 __Pyx_GIVEREF(__pyx_tuple__77); | |
28538 __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Parser, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28539 __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_asTuple, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28540 __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_asGFF3, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28541 __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_asGTF, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28542 __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_asBed, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28543 __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_asVCF, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(1, 1, __pyx_L1_error) | |
28544 __Pyx_RefNannyFinishContext(); | |
28545 return 0; | |
28546 __pyx_L1_error:; | |
28547 __Pyx_RefNannyFinishContext(); | |
28548 return -1; | |
28549 } | |
28550 /* #### Code section: init_constants ### */ | |
28551 | |
28552 static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { | |
28553 __pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type; | |
28554 __pyx_umethod_PyDict_Type_keys.method_name = &__pyx_n_s_keys; | |
28555 if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); | |
28556 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) | |
28557 __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) | |
28558 __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) | |
28559 __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) | |
28560 __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) | |
28561 __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) | |
28562 __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(0, 1, __pyx_L1_error) | |
28563 __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) __PYX_ERR(0, 1, __pyx_L1_error) | |
28564 __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) __PYX_ERR(0, 1, __pyx_L1_error) | |
28565 __pyx_int_35 = PyInt_FromLong(35); if (unlikely(!__pyx_int_35)) __PYX_ERR(0, 1, __pyx_L1_error) | |
28566 __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) __PYX_ERR(0, 1, __pyx_L1_error) | |
28567 __pyx_int_21667264 = PyInt_FromLong(21667264L); if (unlikely(!__pyx_int_21667264)) __PYX_ERR(0, 1, __pyx_L1_error) | |
28568 __pyx_int_139192863 = PyInt_FromLong(139192863L); if (unlikely(!__pyx_int_139192863)) __PYX_ERR(0, 1, __pyx_L1_error) | |
28569 __pyx_int_243541226 = PyInt_FromLong(243541226L); if (unlikely(!__pyx_int_243541226)) __PYX_ERR(0, 1, __pyx_L1_error) | |
28570 __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) | |
28571 return 0; | |
28572 __pyx_L1_error:; | |
28573 return -1; | |
28574 } | |
28575 /* #### Code section: init_globals ### */ | |
28576 | |
28577 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { | |
28578 /* AssertionsEnabled.init */ | |
28579 if (likely(__Pyx_init_assertions_enabled() == 0)); else | |
28580 | |
28581 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) | |
28582 | |
28583 return 0; | |
28584 __pyx_L1_error:; | |
28585 return -1; | |
28586 } | |
28587 /* #### Code section: init_module ### */ | |
28588 | |
28589 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ | |
28590 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ | |
28591 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ | |
28592 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ | |
28593 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ | |
28594 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ | |
28595 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ | |
28596 | |
28597 static int __Pyx_modinit_global_init_code(void) { | |
28598 __Pyx_RefNannyDeclarations | |
28599 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); | |
28600 /*--- Global init code ---*/ | |
28601 __Pyx_RefNannyFinishContext(); | |
28602 return 0; | |
28603 } | |
28604 | |
28605 static int __Pyx_modinit_variable_export_code(void) { | |
28606 __Pyx_RefNannyDeclarations | |
28607 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); | |
28608 /*--- Variable export code ---*/ | |
28609 __Pyx_RefNannyFinishContext(); | |
28610 return 0; | |
28611 } | |
28612 | |
28613 static int __Pyx_modinit_function_export_code(void) { | |
28614 __Pyx_RefNannyDeclarations | |
28615 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); | |
28616 /*--- Function export code ---*/ | |
28617 __Pyx_RefNannyFinishContext(); | |
28618 return 0; | |
28619 } | |
28620 | |
28621 static int __Pyx_modinit_type_init_code(void) { | |
28622 __Pyx_RefNannyDeclarations | |
28623 PyObject *__pyx_t_1 = NULL; | |
28624 PyObject *__pyx_t_2 = NULL; | |
28625 int __pyx_lineno = 0; | |
28626 const char *__pyx_filename = NULL; | |
28627 int __pyx_clineno = 0; | |
28628 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); | |
28629 /*--- Type init code ---*/ | |
28630 __pyx_vtabptr_5pysam_9libctabix_tabix_file_iterator = &__pyx_vtable_5pysam_9libctabix_tabix_file_iterator; | |
28631 __pyx_vtable_5pysam_9libctabix_tabix_file_iterator.__pyx___cnext__ = (PyObject *(*)(struct __pyx_obj_5pysam_9libctabix_tabix_file_iterator *))__pyx_f_5pysam_9libctabix_19tabix_file_iterator___cnext__; | |
28632 #if CYTHON_USE_TYPE_SPECS | |
28633 __pyx_ptype_5pysam_9libctabix_tabix_file_iterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libctabix_tabix_file_iterator_spec, NULL); if (unlikely(!__pyx_ptype_5pysam_9libctabix_tabix_file_iterator)) __PYX_ERR(0, 1098, __pyx_L1_error) | |
28634 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libctabix_tabix_file_iterator_spec, __pyx_ptype_5pysam_9libctabix_tabix_file_iterator) < 0) __PYX_ERR(0, 1098, __pyx_L1_error) | |
28635 #else | |
28636 __pyx_ptype_5pysam_9libctabix_tabix_file_iterator = &__pyx_type_5pysam_9libctabix_tabix_file_iterator; | |
28637 #endif | |
28638 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28639 #endif | |
28640 #if !CYTHON_USE_TYPE_SPECS | |
28641 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libctabix_tabix_file_iterator) < 0) __PYX_ERR(0, 1098, __pyx_L1_error) | |
28642 #endif | |
28643 #if PY_MAJOR_VERSION < 3 | |
28644 __pyx_ptype_5pysam_9libctabix_tabix_file_iterator->tp_print = 0; | |
28645 #endif | |
28646 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28647 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libctabix_tabix_file_iterator->tp_dictoffset && __pyx_ptype_5pysam_9libctabix_tabix_file_iterator->tp_getattro == PyObject_GenericGetAttr)) { | |
28648 __pyx_ptype_5pysam_9libctabix_tabix_file_iterator->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
28649 } | |
28650 #endif | |
28651 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libctabix_tabix_file_iterator, __pyx_vtabptr_5pysam_9libctabix_tabix_file_iterator) < 0) __PYX_ERR(0, 1098, __pyx_L1_error) | |
28652 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28653 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libctabix_tabix_file_iterator) < 0) __PYX_ERR(0, 1098, __pyx_L1_error) | |
28654 #endif | |
28655 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_tabix_file_iterator, (PyObject *) __pyx_ptype_5pysam_9libctabix_tabix_file_iterator) < 0) __PYX_ERR(0, 1098, __pyx_L1_error) | |
28656 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28657 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libctabix_tabix_file_iterator) < 0) __PYX_ERR(0, 1098, __pyx_L1_error) | |
28658 #endif | |
28659 __pyx_t_1 = PyImport_ImportModule("pysam.libchtslib"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) | |
28660 __Pyx_GOTREF(__pyx_t_1); | |
28661 __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(0, 1, __pyx_L1_error) | |
28662 __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(0, 1, __pyx_L1_error) | |
28663 __pyx_vtabptr_5pysam_9libctabix_TabixFile = &__pyx_vtable_5pysam_9libctabix_TabixFile; | |
28664 __pyx_vtable_5pysam_9libctabix_TabixFile.__pyx_base = *__pyx_vtabptr_5pysam_10libchtslib_HTSFile; | |
28665 #if CYTHON_USE_TYPE_SPECS | |
28666 __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_10libchtslib_HTSFile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error) | |
28667 __Pyx_GOTREF(__pyx_t_2); | |
28668 __pyx_ptype_5pysam_9libctabix_TabixFile = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libctabix_TabixFile_spec, __pyx_t_2); | |
28669 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
28670 if (unlikely(!__pyx_ptype_5pysam_9libctabix_TabixFile)) __PYX_ERR(0, 287, __pyx_L1_error) | |
28671 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libctabix_TabixFile_spec, __pyx_ptype_5pysam_9libctabix_TabixFile) < 0) __PYX_ERR(0, 287, __pyx_L1_error) | |
28672 #else | |
28673 __pyx_ptype_5pysam_9libctabix_TabixFile = &__pyx_type_5pysam_9libctabix_TabixFile; | |
28674 #endif | |
28675 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28676 __pyx_ptype_5pysam_9libctabix_TabixFile->tp_base = __pyx_ptype_5pysam_10libchtslib_HTSFile; | |
28677 #endif | |
28678 #if !CYTHON_USE_TYPE_SPECS | |
28679 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libctabix_TabixFile) < 0) __PYX_ERR(0, 287, __pyx_L1_error) | |
28680 #endif | |
28681 #if PY_MAJOR_VERSION < 3 | |
28682 __pyx_ptype_5pysam_9libctabix_TabixFile->tp_print = 0; | |
28683 #endif | |
28684 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28685 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libctabix_TabixFile->tp_dictoffset && __pyx_ptype_5pysam_9libctabix_TabixFile->tp_getattro == PyObject_GenericGetAttr)) { | |
28686 __pyx_ptype_5pysam_9libctabix_TabixFile->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
28687 } | |
28688 #endif | |
28689 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libctabix_TabixFile, __pyx_vtabptr_5pysam_9libctabix_TabixFile) < 0) __PYX_ERR(0, 287, __pyx_L1_error) | |
28690 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28691 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libctabix_TabixFile) < 0) __PYX_ERR(0, 287, __pyx_L1_error) | |
28692 #endif | |
28693 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TabixFile, (PyObject *) __pyx_ptype_5pysam_9libctabix_TabixFile) < 0) __PYX_ERR(0, 287, __pyx_L1_error) | |
28694 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28695 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libctabix_TabixFile) < 0) __PYX_ERR(0, 287, __pyx_L1_error) | |
28696 #endif | |
28697 __pyx_vtabptr_5pysam_9libctabix_Parser = &__pyx_vtable_5pysam_9libctabix_Parser; | |
28698 __pyx_vtable_5pysam_9libctabix_Parser.parse = (PyObject *(*)(struct __pyx_obj_5pysam_9libctabix_Parser *, char *, int))__pyx_f_5pysam_9libctabix_6Parser_parse; | |
28699 #if CYTHON_USE_TYPE_SPECS | |
28700 __pyx_ptype_5pysam_9libctabix_Parser = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libctabix_Parser_spec, NULL); if (unlikely(!__pyx_ptype_5pysam_9libctabix_Parser)) __PYX_ERR(0, 82, __pyx_L1_error) | |
28701 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libctabix_Parser_spec, __pyx_ptype_5pysam_9libctabix_Parser) < 0) __PYX_ERR(0, 82, __pyx_L1_error) | |
28702 #else | |
28703 __pyx_ptype_5pysam_9libctabix_Parser = &__pyx_type_5pysam_9libctabix_Parser; | |
28704 #endif | |
28705 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28706 #endif | |
28707 #if !CYTHON_USE_TYPE_SPECS | |
28708 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libctabix_Parser) < 0) __PYX_ERR(0, 82, __pyx_L1_error) | |
28709 #endif | |
28710 #if PY_MAJOR_VERSION < 3 | |
28711 __pyx_ptype_5pysam_9libctabix_Parser->tp_print = 0; | |
28712 #endif | |
28713 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28714 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libctabix_Parser->tp_dictoffset && __pyx_ptype_5pysam_9libctabix_Parser->tp_getattro == PyObject_GenericGetAttr)) { | |
28715 __pyx_ptype_5pysam_9libctabix_Parser->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
28716 } | |
28717 #endif | |
28718 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libctabix_Parser, __pyx_vtabptr_5pysam_9libctabix_Parser) < 0) __PYX_ERR(0, 82, __pyx_L1_error) | |
28719 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28720 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libctabix_Parser) < 0) __PYX_ERR(0, 82, __pyx_L1_error) | |
28721 #endif | |
28722 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Parser, (PyObject *) __pyx_ptype_5pysam_9libctabix_Parser) < 0) __PYX_ERR(0, 82, __pyx_L1_error) | |
28723 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28724 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libctabix_Parser) < 0) __PYX_ERR(0, 82, __pyx_L1_error) | |
28725 #endif | |
28726 __pyx_vtabptr_5pysam_9libctabix_asTuple = &__pyx_vtable_5pysam_9libctabix_asTuple; | |
28727 __pyx_vtable_5pysam_9libctabix_asTuple.__pyx_base = *__pyx_vtabptr_5pysam_9libctabix_Parser; | |
28728 __pyx_vtable_5pysam_9libctabix_asTuple.__pyx_base.parse = (PyObject *(*)(struct __pyx_obj_5pysam_9libctabix_Parser *, char *, int))__pyx_f_5pysam_9libctabix_7asTuple_parse; | |
28729 #if CYTHON_USE_TYPE_SPECS | |
28730 __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_9libctabix_Parser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) | |
28731 __Pyx_GOTREF(__pyx_t_2); | |
28732 __pyx_ptype_5pysam_9libctabix_asTuple = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libctabix_asTuple_spec, __pyx_t_2); | |
28733 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
28734 if (unlikely(!__pyx_ptype_5pysam_9libctabix_asTuple)) __PYX_ERR(0, 101, __pyx_L1_error) | |
28735 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libctabix_asTuple_spec, __pyx_ptype_5pysam_9libctabix_asTuple) < 0) __PYX_ERR(0, 101, __pyx_L1_error) | |
28736 #else | |
28737 __pyx_ptype_5pysam_9libctabix_asTuple = &__pyx_type_5pysam_9libctabix_asTuple; | |
28738 #endif | |
28739 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28740 __pyx_ptype_5pysam_9libctabix_asTuple->tp_base = __pyx_ptype_5pysam_9libctabix_Parser; | |
28741 #endif | |
28742 #if !CYTHON_USE_TYPE_SPECS | |
28743 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libctabix_asTuple) < 0) __PYX_ERR(0, 101, __pyx_L1_error) | |
28744 #endif | |
28745 #if PY_MAJOR_VERSION < 3 | |
28746 __pyx_ptype_5pysam_9libctabix_asTuple->tp_print = 0; | |
28747 #endif | |
28748 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28749 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libctabix_asTuple->tp_dictoffset && __pyx_ptype_5pysam_9libctabix_asTuple->tp_getattro == PyObject_GenericGetAttr)) { | |
28750 __pyx_ptype_5pysam_9libctabix_asTuple->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
28751 } | |
28752 #endif | |
28753 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libctabix_asTuple, __pyx_vtabptr_5pysam_9libctabix_asTuple) < 0) __PYX_ERR(0, 101, __pyx_L1_error) | |
28754 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28755 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libctabix_asTuple) < 0) __PYX_ERR(0, 101, __pyx_L1_error) | |
28756 #endif | |
28757 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_asTuple, (PyObject *) __pyx_ptype_5pysam_9libctabix_asTuple) < 0) __PYX_ERR(0, 101, __pyx_L1_error) | |
28758 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28759 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libctabix_asTuple) < 0) __PYX_ERR(0, 101, __pyx_L1_error) | |
28760 #endif | |
28761 __pyx_vtabptr_5pysam_9libctabix_asGTF = &__pyx_vtable_5pysam_9libctabix_asGTF; | |
28762 __pyx_vtable_5pysam_9libctabix_asGTF.__pyx_base = *__pyx_vtabptr_5pysam_9libctabix_Parser; | |
28763 __pyx_vtable_5pysam_9libctabix_asGTF.__pyx_base.parse = (PyObject *(*)(struct __pyx_obj_5pysam_9libctabix_Parser *, char *, int))__pyx_f_5pysam_9libctabix_5asGTF_parse; | |
28764 #if CYTHON_USE_TYPE_SPECS | |
28765 __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_9libctabix_Parser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) | |
28766 __Pyx_GOTREF(__pyx_t_2); | |
28767 __pyx_ptype_5pysam_9libctabix_asGTF = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libctabix_asGTF_spec, __pyx_t_2); | |
28768 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
28769 if (unlikely(!__pyx_ptype_5pysam_9libctabix_asGTF)) __PYX_ERR(0, 151, __pyx_L1_error) | |
28770 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libctabix_asGTF_spec, __pyx_ptype_5pysam_9libctabix_asGTF) < 0) __PYX_ERR(0, 151, __pyx_L1_error) | |
28771 #else | |
28772 __pyx_ptype_5pysam_9libctabix_asGTF = &__pyx_type_5pysam_9libctabix_asGTF; | |
28773 #endif | |
28774 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28775 __pyx_ptype_5pysam_9libctabix_asGTF->tp_base = __pyx_ptype_5pysam_9libctabix_Parser; | |
28776 #endif | |
28777 #if !CYTHON_USE_TYPE_SPECS | |
28778 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libctabix_asGTF) < 0) __PYX_ERR(0, 151, __pyx_L1_error) | |
28779 #endif | |
28780 #if PY_MAJOR_VERSION < 3 | |
28781 __pyx_ptype_5pysam_9libctabix_asGTF->tp_print = 0; | |
28782 #endif | |
28783 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28784 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libctabix_asGTF->tp_dictoffset && __pyx_ptype_5pysam_9libctabix_asGTF->tp_getattro == PyObject_GenericGetAttr)) { | |
28785 __pyx_ptype_5pysam_9libctabix_asGTF->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
28786 } | |
28787 #endif | |
28788 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libctabix_asGTF, __pyx_vtabptr_5pysam_9libctabix_asGTF) < 0) __PYX_ERR(0, 151, __pyx_L1_error) | |
28789 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28790 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libctabix_asGTF) < 0) __PYX_ERR(0, 151, __pyx_L1_error) | |
28791 #endif | |
28792 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_asGTF, (PyObject *) __pyx_ptype_5pysam_9libctabix_asGTF) < 0) __PYX_ERR(0, 151, __pyx_L1_error) | |
28793 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28794 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libctabix_asGTF) < 0) __PYX_ERR(0, 151, __pyx_L1_error) | |
28795 #endif | |
28796 __pyx_vtabptr_5pysam_9libctabix_asGFF3 = &__pyx_vtable_5pysam_9libctabix_asGFF3; | |
28797 __pyx_vtable_5pysam_9libctabix_asGFF3.__pyx_base = *__pyx_vtabptr_5pysam_9libctabix_Parser; | |
28798 __pyx_vtable_5pysam_9libctabix_asGFF3.__pyx_base.parse = (PyObject *(*)(struct __pyx_obj_5pysam_9libctabix_Parser *, char *, int))__pyx_f_5pysam_9libctabix_6asGFF3_parse; | |
28799 #if CYTHON_USE_TYPE_SPECS | |
28800 __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_9libctabix_Parser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) | |
28801 __Pyx_GOTREF(__pyx_t_2); | |
28802 __pyx_ptype_5pysam_9libctabix_asGFF3 = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libctabix_asGFF3_spec, __pyx_t_2); | |
28803 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
28804 if (unlikely(!__pyx_ptype_5pysam_9libctabix_asGFF3)) __PYX_ERR(0, 115, __pyx_L1_error) | |
28805 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libctabix_asGFF3_spec, __pyx_ptype_5pysam_9libctabix_asGFF3) < 0) __PYX_ERR(0, 115, __pyx_L1_error) | |
28806 #else | |
28807 __pyx_ptype_5pysam_9libctabix_asGFF3 = &__pyx_type_5pysam_9libctabix_asGFF3; | |
28808 #endif | |
28809 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28810 __pyx_ptype_5pysam_9libctabix_asGFF3->tp_base = __pyx_ptype_5pysam_9libctabix_Parser; | |
28811 #endif | |
28812 #if !CYTHON_USE_TYPE_SPECS | |
28813 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libctabix_asGFF3) < 0) __PYX_ERR(0, 115, __pyx_L1_error) | |
28814 #endif | |
28815 #if PY_MAJOR_VERSION < 3 | |
28816 __pyx_ptype_5pysam_9libctabix_asGFF3->tp_print = 0; | |
28817 #endif | |
28818 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28819 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libctabix_asGFF3->tp_dictoffset && __pyx_ptype_5pysam_9libctabix_asGFF3->tp_getattro == PyObject_GenericGetAttr)) { | |
28820 __pyx_ptype_5pysam_9libctabix_asGFF3->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
28821 } | |
28822 #endif | |
28823 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libctabix_asGFF3, __pyx_vtabptr_5pysam_9libctabix_asGFF3) < 0) __PYX_ERR(0, 115, __pyx_L1_error) | |
28824 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28825 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libctabix_asGFF3) < 0) __PYX_ERR(0, 115, __pyx_L1_error) | |
28826 #endif | |
28827 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_asGFF3, (PyObject *) __pyx_ptype_5pysam_9libctabix_asGFF3) < 0) __PYX_ERR(0, 115, __pyx_L1_error) | |
28828 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28829 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libctabix_asGFF3) < 0) __PYX_ERR(0, 115, __pyx_L1_error) | |
28830 #endif | |
28831 __pyx_vtabptr_5pysam_9libctabix_asBed = &__pyx_vtable_5pysam_9libctabix_asBed; | |
28832 __pyx_vtable_5pysam_9libctabix_asBed.__pyx_base = *__pyx_vtabptr_5pysam_9libctabix_Parser; | |
28833 __pyx_vtable_5pysam_9libctabix_asBed.__pyx_base.parse = (PyObject *(*)(struct __pyx_obj_5pysam_9libctabix_Parser *, char *, int))__pyx_f_5pysam_9libctabix_5asBed_parse; | |
28834 #if CYTHON_USE_TYPE_SPECS | |
28835 __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_9libctabix_Parser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) | |
28836 __Pyx_GOTREF(__pyx_t_2); | |
28837 __pyx_ptype_5pysam_9libctabix_asBed = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libctabix_asBed_spec, __pyx_t_2); | |
28838 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
28839 if (unlikely(!__pyx_ptype_5pysam_9libctabix_asBed)) __PYX_ERR(0, 198, __pyx_L1_error) | |
28840 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libctabix_asBed_spec, __pyx_ptype_5pysam_9libctabix_asBed) < 0) __PYX_ERR(0, 198, __pyx_L1_error) | |
28841 #else | |
28842 __pyx_ptype_5pysam_9libctabix_asBed = &__pyx_type_5pysam_9libctabix_asBed; | |
28843 #endif | |
28844 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28845 __pyx_ptype_5pysam_9libctabix_asBed->tp_base = __pyx_ptype_5pysam_9libctabix_Parser; | |
28846 #endif | |
28847 #if !CYTHON_USE_TYPE_SPECS | |
28848 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libctabix_asBed) < 0) __PYX_ERR(0, 198, __pyx_L1_error) | |
28849 #endif | |
28850 #if PY_MAJOR_VERSION < 3 | |
28851 __pyx_ptype_5pysam_9libctabix_asBed->tp_print = 0; | |
28852 #endif | |
28853 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28854 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libctabix_asBed->tp_dictoffset && __pyx_ptype_5pysam_9libctabix_asBed->tp_getattro == PyObject_GenericGetAttr)) { | |
28855 __pyx_ptype_5pysam_9libctabix_asBed->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
28856 } | |
28857 #endif | |
28858 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libctabix_asBed, __pyx_vtabptr_5pysam_9libctabix_asBed) < 0) __PYX_ERR(0, 198, __pyx_L1_error) | |
28859 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28860 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libctabix_asBed) < 0) __PYX_ERR(0, 198, __pyx_L1_error) | |
28861 #endif | |
28862 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_asBed, (PyObject *) __pyx_ptype_5pysam_9libctabix_asBed) < 0) __PYX_ERR(0, 198, __pyx_L1_error) | |
28863 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28864 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libctabix_asBed) < 0) __PYX_ERR(0, 198, __pyx_L1_error) | |
28865 #endif | |
28866 __pyx_vtabptr_5pysam_9libctabix_asVCF = &__pyx_vtable_5pysam_9libctabix_asVCF; | |
28867 __pyx_vtable_5pysam_9libctabix_asVCF.__pyx_base = *__pyx_vtabptr_5pysam_9libctabix_Parser; | |
28868 __pyx_vtable_5pysam_9libctabix_asVCF.__pyx_base.parse = (PyObject *(*)(struct __pyx_obj_5pysam_9libctabix_Parser *, char *, int))__pyx_f_5pysam_9libctabix_5asVCF_parse; | |
28869 #if CYTHON_USE_TYPE_SPECS | |
28870 __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_9libctabix_Parser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) | |
28871 __Pyx_GOTREF(__pyx_t_2); | |
28872 __pyx_ptype_5pysam_9libctabix_asVCF = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libctabix_asVCF_spec, __pyx_t_2); | |
28873 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
28874 if (unlikely(!__pyx_ptype_5pysam_9libctabix_asVCF)) __PYX_ERR(0, 246, __pyx_L1_error) | |
28875 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libctabix_asVCF_spec, __pyx_ptype_5pysam_9libctabix_asVCF) < 0) __PYX_ERR(0, 246, __pyx_L1_error) | |
28876 #else | |
28877 __pyx_ptype_5pysam_9libctabix_asVCF = &__pyx_type_5pysam_9libctabix_asVCF; | |
28878 #endif | |
28879 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28880 __pyx_ptype_5pysam_9libctabix_asVCF->tp_base = __pyx_ptype_5pysam_9libctabix_Parser; | |
28881 #endif | |
28882 #if !CYTHON_USE_TYPE_SPECS | |
28883 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libctabix_asVCF) < 0) __PYX_ERR(0, 246, __pyx_L1_error) | |
28884 #endif | |
28885 #if PY_MAJOR_VERSION < 3 | |
28886 __pyx_ptype_5pysam_9libctabix_asVCF->tp_print = 0; | |
28887 #endif | |
28888 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28889 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libctabix_asVCF->tp_dictoffset && __pyx_ptype_5pysam_9libctabix_asVCF->tp_getattro == PyObject_GenericGetAttr)) { | |
28890 __pyx_ptype_5pysam_9libctabix_asVCF->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
28891 } | |
28892 #endif | |
28893 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libctabix_asVCF, __pyx_vtabptr_5pysam_9libctabix_asVCF) < 0) __PYX_ERR(0, 246, __pyx_L1_error) | |
28894 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28895 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libctabix_asVCF) < 0) __PYX_ERR(0, 246, __pyx_L1_error) | |
28896 #endif | |
28897 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_asVCF, (PyObject *) __pyx_ptype_5pysam_9libctabix_asVCF) < 0) __PYX_ERR(0, 246, __pyx_L1_error) | |
28898 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28899 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libctabix_asVCF) < 0) __PYX_ERR(0, 246, __pyx_L1_error) | |
28900 #endif | |
28901 __pyx_vtabptr_5pysam_9libctabix_TabixIterator = &__pyx_vtable_5pysam_9libctabix_TabixIterator; | |
28902 __pyx_vtable_5pysam_9libctabix_TabixIterator.__pyx___cnext__ = (int (*)(struct __pyx_obj_5pysam_9libctabix_TabixIterator *))__pyx_f_5pysam_9libctabix_13TabixIterator___cnext__; | |
28903 #if CYTHON_USE_TYPE_SPECS | |
28904 __pyx_ptype_5pysam_9libctabix_TabixIterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libctabix_TabixIterator_spec, NULL); if (unlikely(!__pyx_ptype_5pysam_9libctabix_TabixIterator)) __PYX_ERR(0, 619, __pyx_L1_error) | |
28905 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libctabix_TabixIterator_spec, __pyx_ptype_5pysam_9libctabix_TabixIterator) < 0) __PYX_ERR(0, 619, __pyx_L1_error) | |
28906 #else | |
28907 __pyx_ptype_5pysam_9libctabix_TabixIterator = &__pyx_type_5pysam_9libctabix_TabixIterator; | |
28908 #endif | |
28909 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28910 #endif | |
28911 #if !CYTHON_USE_TYPE_SPECS | |
28912 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libctabix_TabixIterator) < 0) __PYX_ERR(0, 619, __pyx_L1_error) | |
28913 #endif | |
28914 #if PY_MAJOR_VERSION < 3 | |
28915 __pyx_ptype_5pysam_9libctabix_TabixIterator->tp_print = 0; | |
28916 #endif | |
28917 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28918 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libctabix_TabixIterator->tp_dictoffset && __pyx_ptype_5pysam_9libctabix_TabixIterator->tp_getattro == PyObject_GenericGetAttr)) { | |
28919 __pyx_ptype_5pysam_9libctabix_TabixIterator->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
28920 } | |
28921 #endif | |
28922 #if CYTHON_UPDATE_DESCRIPTOR_DOC | |
28923 { | |
28924 PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_5pysam_9libctabix_TabixIterator, "__next__"); if (unlikely(!wrapper)) __PYX_ERR(0, 619, __pyx_L1_error) | |
28925 if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { | |
28926 __pyx_wrapperbase_5pysam_9libctabix_13TabixIterator_4__next__ = *((PyWrapperDescrObject *)wrapper)->d_base; | |
28927 __pyx_wrapperbase_5pysam_9libctabix_13TabixIterator_4__next__.doc = __pyx_doc_5pysam_9libctabix_13TabixIterator_4__next__; | |
28928 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_9libctabix_13TabixIterator_4__next__; | |
28929 } | |
28930 } | |
28931 #endif | |
28932 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libctabix_TabixIterator, __pyx_vtabptr_5pysam_9libctabix_TabixIterator) < 0) __PYX_ERR(0, 619, __pyx_L1_error) | |
28933 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28934 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libctabix_TabixIterator) < 0) __PYX_ERR(0, 619, __pyx_L1_error) | |
28935 #endif | |
28936 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TabixIterator, (PyObject *) __pyx_ptype_5pysam_9libctabix_TabixIterator) < 0) __PYX_ERR(0, 619, __pyx_L1_error) | |
28937 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28938 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libctabix_TabixIterator) < 0) __PYX_ERR(0, 619, __pyx_L1_error) | |
28939 #endif | |
28940 __pyx_vtabptr_5pysam_9libctabix_TabixIteratorParsed = &__pyx_vtable_5pysam_9libctabix_TabixIteratorParsed; | |
28941 __pyx_vtable_5pysam_9libctabix_TabixIteratorParsed.__pyx_base = *__pyx_vtabptr_5pysam_9libctabix_TabixIterator; | |
28942 #if CYTHON_USE_TYPE_SPECS | |
28943 __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_9libctabix_TabixIterator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error) | |
28944 __Pyx_GOTREF(__pyx_t_2); | |
28945 __pyx_ptype_5pysam_9libctabix_TabixIteratorParsed = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libctabix_TabixIteratorParsed_spec, __pyx_t_2); | |
28946 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
28947 if (unlikely(!__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed)) __PYX_ERR(0, 692, __pyx_L1_error) | |
28948 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libctabix_TabixIteratorParsed_spec, __pyx_ptype_5pysam_9libctabix_TabixIteratorParsed) < 0) __PYX_ERR(0, 692, __pyx_L1_error) | |
28949 #else | |
28950 __pyx_ptype_5pysam_9libctabix_TabixIteratorParsed = &__pyx_type_5pysam_9libctabix_TabixIteratorParsed; | |
28951 #endif | |
28952 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28953 __pyx_ptype_5pysam_9libctabix_TabixIteratorParsed->tp_base = __pyx_ptype_5pysam_9libctabix_TabixIterator; | |
28954 #endif | |
28955 #if !CYTHON_USE_TYPE_SPECS | |
28956 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed) < 0) __PYX_ERR(0, 692, __pyx_L1_error) | |
28957 #endif | |
28958 #if PY_MAJOR_VERSION < 3 | |
28959 __pyx_ptype_5pysam_9libctabix_TabixIteratorParsed->tp_print = 0; | |
28960 #endif | |
28961 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28962 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed->tp_dictoffset && __pyx_ptype_5pysam_9libctabix_TabixIteratorParsed->tp_getattro == PyObject_GenericGetAttr)) { | |
28963 __pyx_ptype_5pysam_9libctabix_TabixIteratorParsed->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
28964 } | |
28965 #endif | |
28966 #if CYTHON_UPDATE_DESCRIPTOR_DOC | |
28967 { | |
28968 PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed, "__next__"); if (unlikely(!wrapper)) __PYX_ERR(0, 692, __pyx_L1_error) | |
28969 if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { | |
28970 __pyx_wrapperbase_5pysam_9libctabix_19TabixIteratorParsed_2__next__ = *((PyWrapperDescrObject *)wrapper)->d_base; | |
28971 __pyx_wrapperbase_5pysam_9libctabix_19TabixIteratorParsed_2__next__.doc = __pyx_doc_5pysam_9libctabix_19TabixIteratorParsed_2__next__; | |
28972 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_9libctabix_19TabixIteratorParsed_2__next__; | |
28973 } | |
28974 } | |
28975 #endif | |
28976 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed, __pyx_vtabptr_5pysam_9libctabix_TabixIteratorParsed) < 0) __PYX_ERR(0, 692, __pyx_L1_error) | |
28977 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28978 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libctabix_TabixIteratorParsed) < 0) __PYX_ERR(0, 692, __pyx_L1_error) | |
28979 #endif | |
28980 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TabixIteratorParsed, (PyObject *) __pyx_ptype_5pysam_9libctabix_TabixIteratorParsed) < 0) __PYX_ERR(0, 692, __pyx_L1_error) | |
28981 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28982 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libctabix_TabixIteratorParsed) < 0) __PYX_ERR(0, 692, __pyx_L1_error) | |
28983 #endif | |
28984 __pyx_vtabptr_5pysam_9libctabix_GZIterator = &__pyx_vtable_5pysam_9libctabix_GZIterator; | |
28985 __pyx_vtable_5pysam_9libctabix_GZIterator.__pyx___cnext__ = (int (*)(struct __pyx_obj_5pysam_9libctabix_GZIterator *))__pyx_f_5pysam_9libctabix_10GZIterator___cnext__; | |
28986 #if CYTHON_USE_TYPE_SPECS | |
28987 __pyx_ptype_5pysam_9libctabix_GZIterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libctabix_GZIterator_spec, NULL); if (unlikely(!__pyx_ptype_5pysam_9libctabix_GZIterator)) __PYX_ERR(0, 720, __pyx_L1_error) | |
28988 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libctabix_GZIterator_spec, __pyx_ptype_5pysam_9libctabix_GZIterator) < 0) __PYX_ERR(0, 720, __pyx_L1_error) | |
28989 #else | |
28990 __pyx_ptype_5pysam_9libctabix_GZIterator = &__pyx_type_5pysam_9libctabix_GZIterator; | |
28991 #endif | |
28992 #if !CYTHON_COMPILING_IN_LIMITED_API | |
28993 #endif | |
28994 #if !CYTHON_USE_TYPE_SPECS | |
28995 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libctabix_GZIterator) < 0) __PYX_ERR(0, 720, __pyx_L1_error) | |
28996 #endif | |
28997 #if PY_MAJOR_VERSION < 3 | |
28998 __pyx_ptype_5pysam_9libctabix_GZIterator->tp_print = 0; | |
28999 #endif | |
29000 #if !CYTHON_COMPILING_IN_LIMITED_API | |
29001 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libctabix_GZIterator->tp_dictoffset && __pyx_ptype_5pysam_9libctabix_GZIterator->tp_getattro == PyObject_GenericGetAttr)) { | |
29002 __pyx_ptype_5pysam_9libctabix_GZIterator->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
29003 } | |
29004 #endif | |
29005 #if CYTHON_UPDATE_DESCRIPTOR_DOC | |
29006 { | |
29007 PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_5pysam_9libctabix_GZIterator, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 720, __pyx_L1_error) | |
29008 if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { | |
29009 __pyx_wrapperbase_5pysam_9libctabix_10GZIterator___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; | |
29010 __pyx_wrapperbase_5pysam_9libctabix_10GZIterator___init__.doc = __pyx_doc_5pysam_9libctabix_10GZIterator___init__; | |
29011 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_9libctabix_10GZIterator___init__; | |
29012 } | |
29013 } | |
29014 #endif | |
29015 #if CYTHON_UPDATE_DESCRIPTOR_DOC | |
29016 { | |
29017 PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_5pysam_9libctabix_GZIterator, "__next__"); if (unlikely(!wrapper)) __PYX_ERR(0, 720, __pyx_L1_error) | |
29018 if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { | |
29019 __pyx_wrapperbase_5pysam_9libctabix_10GZIterator_6__next__ = *((PyWrapperDescrObject *)wrapper)->d_base; | |
29020 __pyx_wrapperbase_5pysam_9libctabix_10GZIterator_6__next__.doc = __pyx_doc_5pysam_9libctabix_10GZIterator_6__next__; | |
29021 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_9libctabix_10GZIterator_6__next__; | |
29022 } | |
29023 } | |
29024 #endif | |
29025 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libctabix_GZIterator, __pyx_vtabptr_5pysam_9libctabix_GZIterator) < 0) __PYX_ERR(0, 720, __pyx_L1_error) | |
29026 #if !CYTHON_COMPILING_IN_LIMITED_API | |
29027 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libctabix_GZIterator) < 0) __PYX_ERR(0, 720, __pyx_L1_error) | |
29028 #endif | |
29029 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GZIterator, (PyObject *) __pyx_ptype_5pysam_9libctabix_GZIterator) < 0) __PYX_ERR(0, 720, __pyx_L1_error) | |
29030 #if !CYTHON_COMPILING_IN_LIMITED_API | |
29031 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libctabix_GZIterator) < 0) __PYX_ERR(0, 720, __pyx_L1_error) | |
29032 #endif | |
29033 __pyx_vtabptr_5pysam_9libctabix_GZIteratorHead = &__pyx_vtable_5pysam_9libctabix_GZIteratorHead; | |
29034 __pyx_vtable_5pysam_9libctabix_GZIteratorHead.__pyx_base = *__pyx_vtabptr_5pysam_9libctabix_GZIterator; | |
29035 #if CYTHON_USE_TYPE_SPECS | |
29036 __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_9libctabix_GZIterator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error) | |
29037 __Pyx_GOTREF(__pyx_t_2); | |
29038 __pyx_ptype_5pysam_9libctabix_GZIteratorHead = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libctabix_GZIteratorHead_spec, __pyx_t_2); | |
29039 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29040 if (unlikely(!__pyx_ptype_5pysam_9libctabix_GZIteratorHead)) __PYX_ERR(0, 775, __pyx_L1_error) | |
29041 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libctabix_GZIteratorHead_spec, __pyx_ptype_5pysam_9libctabix_GZIteratorHead) < 0) __PYX_ERR(0, 775, __pyx_L1_error) | |
29042 #else | |
29043 __pyx_ptype_5pysam_9libctabix_GZIteratorHead = &__pyx_type_5pysam_9libctabix_GZIteratorHead; | |
29044 #endif | |
29045 #if !CYTHON_COMPILING_IN_LIMITED_API | |
29046 __pyx_ptype_5pysam_9libctabix_GZIteratorHead->tp_base = __pyx_ptype_5pysam_9libctabix_GZIterator; | |
29047 #endif | |
29048 #if !CYTHON_USE_TYPE_SPECS | |
29049 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libctabix_GZIteratorHead) < 0) __PYX_ERR(0, 775, __pyx_L1_error) | |
29050 #endif | |
29051 #if PY_MAJOR_VERSION < 3 | |
29052 __pyx_ptype_5pysam_9libctabix_GZIteratorHead->tp_print = 0; | |
29053 #endif | |
29054 #if !CYTHON_COMPILING_IN_LIMITED_API | |
29055 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libctabix_GZIteratorHead->tp_dictoffset && __pyx_ptype_5pysam_9libctabix_GZIteratorHead->tp_getattro == PyObject_GenericGetAttr)) { | |
29056 __pyx_ptype_5pysam_9libctabix_GZIteratorHead->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
29057 } | |
29058 #endif | |
29059 #if CYTHON_UPDATE_DESCRIPTOR_DOC | |
29060 { | |
29061 PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_5pysam_9libctabix_GZIteratorHead, "__next__"); if (unlikely(!wrapper)) __PYX_ERR(0, 775, __pyx_L1_error) | |
29062 if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { | |
29063 __pyx_wrapperbase_5pysam_9libctabix_14GZIteratorHead___next__ = *((PyWrapperDescrObject *)wrapper)->d_base; | |
29064 __pyx_wrapperbase_5pysam_9libctabix_14GZIteratorHead___next__.doc = __pyx_doc_5pysam_9libctabix_14GZIteratorHead___next__; | |
29065 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_9libctabix_14GZIteratorHead___next__; | |
29066 } | |
29067 } | |
29068 #endif | |
29069 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libctabix_GZIteratorHead, __pyx_vtabptr_5pysam_9libctabix_GZIteratorHead) < 0) __PYX_ERR(0, 775, __pyx_L1_error) | |
29070 #if !CYTHON_COMPILING_IN_LIMITED_API | |
29071 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libctabix_GZIteratorHead) < 0) __PYX_ERR(0, 775, __pyx_L1_error) | |
29072 #endif | |
29073 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GZIteratorHead, (PyObject *) __pyx_ptype_5pysam_9libctabix_GZIteratorHead) < 0) __PYX_ERR(0, 775, __pyx_L1_error) | |
29074 #if !CYTHON_COMPILING_IN_LIMITED_API | |
29075 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libctabix_GZIteratorHead) < 0) __PYX_ERR(0, 775, __pyx_L1_error) | |
29076 #endif | |
29077 __pyx_vtabptr_5pysam_9libctabix_GZIteratorParsed = &__pyx_vtable_5pysam_9libctabix_GZIteratorParsed; | |
29078 __pyx_vtable_5pysam_9libctabix_GZIteratorParsed.__pyx_base = *__pyx_vtabptr_5pysam_9libctabix_GZIterator; | |
29079 #if CYTHON_USE_TYPE_SPECS | |
29080 __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_9libctabix_GZIterator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 792, __pyx_L1_error) | |
29081 __Pyx_GOTREF(__pyx_t_2); | |
29082 __pyx_ptype_5pysam_9libctabix_GZIteratorParsed = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libctabix_GZIteratorParsed_spec, __pyx_t_2); | |
29083 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29084 if (unlikely(!__pyx_ptype_5pysam_9libctabix_GZIteratorParsed)) __PYX_ERR(0, 792, __pyx_L1_error) | |
29085 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libctabix_GZIteratorParsed_spec, __pyx_ptype_5pysam_9libctabix_GZIteratorParsed) < 0) __PYX_ERR(0, 792, __pyx_L1_error) | |
29086 #else | |
29087 __pyx_ptype_5pysam_9libctabix_GZIteratorParsed = &__pyx_type_5pysam_9libctabix_GZIteratorParsed; | |
29088 #endif | |
29089 #if !CYTHON_COMPILING_IN_LIMITED_API | |
29090 __pyx_ptype_5pysam_9libctabix_GZIteratorParsed->tp_base = __pyx_ptype_5pysam_9libctabix_GZIterator; | |
29091 #endif | |
29092 #if !CYTHON_USE_TYPE_SPECS | |
29093 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libctabix_GZIteratorParsed) < 0) __PYX_ERR(0, 792, __pyx_L1_error) | |
29094 #endif | |
29095 #if PY_MAJOR_VERSION < 3 | |
29096 __pyx_ptype_5pysam_9libctabix_GZIteratorParsed->tp_print = 0; | |
29097 #endif | |
29098 #if !CYTHON_COMPILING_IN_LIMITED_API | |
29099 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libctabix_GZIteratorParsed->tp_dictoffset && __pyx_ptype_5pysam_9libctabix_GZIteratorParsed->tp_getattro == PyObject_GenericGetAttr)) { | |
29100 __pyx_ptype_5pysam_9libctabix_GZIteratorParsed->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
29101 } | |
29102 #endif | |
29103 #if CYTHON_UPDATE_DESCRIPTOR_DOC | |
29104 { | |
29105 PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_5pysam_9libctabix_GZIteratorParsed, "__next__"); if (unlikely(!wrapper)) __PYX_ERR(0, 792, __pyx_L1_error) | |
29106 if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { | |
29107 __pyx_wrapperbase_5pysam_9libctabix_16GZIteratorParsed_2__next__ = *((PyWrapperDescrObject *)wrapper)->d_base; | |
29108 __pyx_wrapperbase_5pysam_9libctabix_16GZIteratorParsed_2__next__.doc = __pyx_doc_5pysam_9libctabix_16GZIteratorParsed_2__next__; | |
29109 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_9libctabix_16GZIteratorParsed_2__next__; | |
29110 } | |
29111 } | |
29112 #endif | |
29113 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libctabix_GZIteratorParsed, __pyx_vtabptr_5pysam_9libctabix_GZIteratorParsed) < 0) __PYX_ERR(0, 792, __pyx_L1_error) | |
29114 #if !CYTHON_COMPILING_IN_LIMITED_API | |
29115 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libctabix_GZIteratorParsed) < 0) __PYX_ERR(0, 792, __pyx_L1_error) | |
29116 #endif | |
29117 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GZIteratorParsed, (PyObject *) __pyx_ptype_5pysam_9libctabix_GZIteratorParsed) < 0) __PYX_ERR(0, 792, __pyx_L1_error) | |
29118 #if !CYTHON_COMPILING_IN_LIMITED_API | |
29119 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libctabix_GZIteratorParsed) < 0) __PYX_ERR(0, 792, __pyx_L1_error) | |
29120 #endif | |
29121 __pyx_vtabptr_5pysam_9libctabix_Tabixfile = &__pyx_vtable_5pysam_9libctabix_Tabixfile; | |
29122 __pyx_vtable_5pysam_9libctabix_Tabixfile.__pyx_base = *__pyx_vtabptr_5pysam_9libctabix_TabixFile; | |
29123 #if CYTHON_USE_TYPE_SPECS | |
29124 __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_9libctabix_TabixFile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1251, __pyx_L1_error) | |
29125 __Pyx_GOTREF(__pyx_t_2); | |
29126 __pyx_ptype_5pysam_9libctabix_Tabixfile = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libctabix_Tabixfile_spec, __pyx_t_2); | |
29127 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29128 if (unlikely(!__pyx_ptype_5pysam_9libctabix_Tabixfile)) __PYX_ERR(0, 1251, __pyx_L1_error) | |
29129 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libctabix_Tabixfile_spec, __pyx_ptype_5pysam_9libctabix_Tabixfile) < 0) __PYX_ERR(0, 1251, __pyx_L1_error) | |
29130 #else | |
29131 __pyx_ptype_5pysam_9libctabix_Tabixfile = &__pyx_type_5pysam_9libctabix_Tabixfile; | |
29132 #endif | |
29133 #if !CYTHON_COMPILING_IN_LIMITED_API | |
29134 __pyx_ptype_5pysam_9libctabix_Tabixfile->tp_base = __pyx_ptype_5pysam_9libctabix_TabixFile; | |
29135 #endif | |
29136 #if !CYTHON_USE_TYPE_SPECS | |
29137 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libctabix_Tabixfile) < 0) __PYX_ERR(0, 1251, __pyx_L1_error) | |
29138 #endif | |
29139 #if PY_MAJOR_VERSION < 3 | |
29140 __pyx_ptype_5pysam_9libctabix_Tabixfile->tp_print = 0; | |
29141 #endif | |
29142 #if !CYTHON_COMPILING_IN_LIMITED_API | |
29143 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libctabix_Tabixfile->tp_dictoffset && __pyx_ptype_5pysam_9libctabix_Tabixfile->tp_getattro == PyObject_GenericGetAttr)) { | |
29144 __pyx_ptype_5pysam_9libctabix_Tabixfile->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
29145 } | |
29146 #endif | |
29147 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libctabix_Tabixfile, __pyx_vtabptr_5pysam_9libctabix_Tabixfile) < 0) __PYX_ERR(0, 1251, __pyx_L1_error) | |
29148 #if !CYTHON_COMPILING_IN_LIMITED_API | |
29149 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libctabix_Tabixfile) < 0) __PYX_ERR(0, 1251, __pyx_L1_error) | |
29150 #endif | |
29151 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Tabixfile, (PyObject *) __pyx_ptype_5pysam_9libctabix_Tabixfile) < 0) __PYX_ERR(0, 1251, __pyx_L1_error) | |
29152 #if !CYTHON_COMPILING_IN_LIMITED_API | |
29153 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libctabix_Tabixfile) < 0) __PYX_ERR(0, 1251, __pyx_L1_error) | |
29154 #endif | |
29155 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
29156 __Pyx_RefNannyFinishContext(); | |
29157 return 0; | |
29158 __pyx_L1_error:; | |
29159 __Pyx_XDECREF(__pyx_t_1); | |
29160 __Pyx_XDECREF(__pyx_t_2); | |
29161 __Pyx_RefNannyFinishContext(); | |
29162 return -1; | |
29163 } | |
29164 | |
29165 static int __Pyx_modinit_type_import_code(void) { | |
29166 __Pyx_RefNannyDeclarations | |
29167 PyObject *__pyx_t_1 = NULL; | |
29168 int __pyx_lineno = 0; | |
29169 const char *__pyx_filename = NULL; | |
29170 int __pyx_clineno = 0; | |
29171 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); | |
29172 /*--- Type import code ---*/ | |
29173 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 9, __pyx_L1_error) | |
29174 __Pyx_GOTREF(__pyx_t_1); | |
29175 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", | |
29176 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 | |
29177 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject), | |
29178 #elif CYTHON_COMPILING_IN_LIMITED_API | |
29179 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject), | |
29180 #else | |
29181 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject), | |
29182 #endif | |
29183 __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(5, 9, __pyx_L1_error) | |
29184 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
29185 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 8, __pyx_L1_error) | |
29186 __Pyx_GOTREF(__pyx_t_1); | |
29187 __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(6, 8, __pyx_L1_error) | |
29188 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
29189 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 15, __pyx_L1_error) | |
29190 __Pyx_GOTREF(__pyx_t_1); | |
29191 __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(7, 15, __pyx_L1_error) | |
29192 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
29193 __pyx_t_1 = PyImport_ImportModule("pysam.libctabixproxies"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 5, __pyx_L1_error) | |
29194 __Pyx_GOTREF(__pyx_t_1); | |
29195 __pyx_ptype_5pysam_16libctabixproxies_TupleProxy = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabixproxies", "TupleProxy", sizeof(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxy),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_16libctabixproxies_TupleProxy) __PYX_ERR(8, 5, __pyx_L1_error) | |
29196 __pyx_vtabptr_5pysam_16libctabixproxies_TupleProxy = (struct __pyx_vtabstruct_5pysam_16libctabixproxies_TupleProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_16libctabixproxies_TupleProxy); if (unlikely(!__pyx_vtabptr_5pysam_16libctabixproxies_TupleProxy)) __PYX_ERR(8, 5, __pyx_L1_error) | |
29197 __pyx_ptype_5pysam_16libctabixproxies_TupleProxyIterator = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabixproxies", "TupleProxyIterator", sizeof(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxyIterator), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_16libctabixproxies_TupleProxyIterator),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_16libctabixproxies_TupleProxyIterator) __PYX_ERR(8, 27, __pyx_L1_error) | |
29198 __pyx_ptype_5pysam_16libctabixproxies_NamedTupleProxy = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabixproxies", "NamedTupleProxy", sizeof(struct __pyx_obj_5pysam_16libctabixproxies_NamedTupleProxy), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_16libctabixproxies_NamedTupleProxy),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_16libctabixproxies_NamedTupleProxy) __PYX_ERR(8, 32, __pyx_L1_error) | |
29199 __pyx_vtabptr_5pysam_16libctabixproxies_NamedTupleProxy = (struct __pyx_vtabstruct_5pysam_16libctabixproxies_NamedTupleProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_16libctabixproxies_NamedTupleProxy); if (unlikely(!__pyx_vtabptr_5pysam_16libctabixproxies_NamedTupleProxy)) __PYX_ERR(8, 32, __pyx_L1_error) | |
29200 __pyx_ptype_5pysam_16libctabixproxies_GTFProxy = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabixproxies", "GTFProxy", sizeof(struct __pyx_obj_5pysam_16libctabixproxies_GTFProxy), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_16libctabixproxies_GTFProxy),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_16libctabixproxies_GTFProxy) __PYX_ERR(8, 36, __pyx_L1_error) | |
29201 __pyx_vtabptr_5pysam_16libctabixproxies_GTFProxy = (struct __pyx_vtabstruct_5pysam_16libctabixproxies_GTFProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_16libctabixproxies_GTFProxy); if (unlikely(!__pyx_vtabptr_5pysam_16libctabixproxies_GTFProxy)) __PYX_ERR(8, 36, __pyx_L1_error) | |
29202 __pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabixproxies", "GFF3Proxy", sizeof(struct __pyx_obj_5pysam_16libctabixproxies_GFF3Proxy), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_16libctabixproxies_GFF3Proxy),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy) __PYX_ERR(8, 42, __pyx_L1_error) | |
29203 __pyx_vtabptr_5pysam_16libctabixproxies_GFF3Proxy = (struct __pyx_vtabstruct_5pysam_16libctabixproxies_GFF3Proxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_16libctabixproxies_GFF3Proxy); if (unlikely(!__pyx_vtabptr_5pysam_16libctabixproxies_GFF3Proxy)) __PYX_ERR(8, 42, __pyx_L1_error) | |
29204 __pyx_ptype_5pysam_16libctabixproxies_BedProxy = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabixproxies", "BedProxy", sizeof(struct __pyx_obj_5pysam_16libctabixproxies_BedProxy), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_16libctabixproxies_BedProxy),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_16libctabixproxies_BedProxy) __PYX_ERR(8, 46, __pyx_L1_error) | |
29205 __pyx_vtabptr_5pysam_16libctabixproxies_BedProxy = (struct __pyx_vtabstruct_5pysam_16libctabixproxies_BedProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_16libctabixproxies_BedProxy); if (unlikely(!__pyx_vtabptr_5pysam_16libctabixproxies_BedProxy)) __PYX_ERR(8, 46, __pyx_L1_error) | |
29206 __pyx_ptype_5pysam_16libctabixproxies_VCFProxy = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libctabixproxies", "VCFProxy", sizeof(struct __pyx_obj_5pysam_16libctabixproxies_VCFProxy), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_16libctabixproxies_VCFProxy),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_16libctabixproxies_VCFProxy) __PYX_ERR(8, 58, __pyx_L1_error) | |
29207 __pyx_vtabptr_5pysam_16libctabixproxies_VCFProxy = (struct __pyx_vtabstruct_5pysam_16libctabixproxies_VCFProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_16libctabixproxies_VCFProxy); if (unlikely(!__pyx_vtabptr_5pysam_16libctabixproxies_VCFProxy)) __PYX_ERR(8, 58, __pyx_L1_error) | |
29208 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
29209 __pyx_t_1 = PyImport_ImportModule("array"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 69, __pyx_L1_error) | |
29210 __Pyx_GOTREF(__pyx_t_1); | |
29211 __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(3, 69, __pyx_L1_error) | |
29212 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
29213 __Pyx_RefNannyFinishContext(); | |
29214 return 0; | |
29215 __pyx_L1_error:; | |
29216 __Pyx_XDECREF(__pyx_t_1); | |
29217 __Pyx_RefNannyFinishContext(); | |
29218 return -1; | |
29219 } | |
29220 | |
29221 static int __Pyx_modinit_variable_import_code(void) { | |
29222 __Pyx_RefNannyDeclarations | |
29223 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); | |
29224 /*--- Variable import code ---*/ | |
29225 __Pyx_RefNannyFinishContext(); | |
29226 return 0; | |
29227 } | |
29228 | |
29229 static int __Pyx_modinit_function_import_code(void) { | |
29230 __Pyx_RefNannyDeclarations | |
29231 PyObject *__pyx_t_1 = NULL; | |
29232 int __pyx_lineno = 0; | |
29233 const char *__pyx_filename = NULL; | |
29234 int __pyx_clineno = 0; | |
29235 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); | |
29236 /*--- Function import code ---*/ | |
29237 __pyx_t_1 = PyImport_ImportModule("pysam.libcutils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) | |
29238 __Pyx_GOTREF(__pyx_t_1); | |
29239 if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "charptr_to_str", (void (**)(void))&__pyx_f_5pysam_9libcutils_charptr_to_str, "PyObject *(char const *, struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29240 if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "force_str", (void (**)(void))&__pyx_f_5pysam_9libcutils_force_str, "PyObject *(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_force_str *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29241 if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "force_bytes", (void (**)(void))&__pyx_f_5pysam_9libcutils_force_bytes, "PyObject *(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_force_bytes *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29242 if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "encode_filename", (void (**)(void))&__pyx_f_5pysam_9libcutils_encode_filename, "PyObject *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29243 if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "from_string_and_size", (void (**)(void))&__pyx_f_5pysam_9libcutils_from_string_and_size, "PyObject *(char const *, size_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29244 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
29245 __Pyx_RefNannyFinishContext(); | |
29246 return 0; | |
29247 __pyx_L1_error:; | |
29248 __Pyx_XDECREF(__pyx_t_1); | |
29249 __Pyx_RefNannyFinishContext(); | |
29250 return -1; | |
29251 } | |
29252 | |
29253 | |
29254 #if PY_MAJOR_VERSION >= 3 | |
29255 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
29256 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ | |
29257 static int __pyx_pymod_exec_libctabix(PyObject* module); /*proto*/ | |
29258 static PyModuleDef_Slot __pyx_moduledef_slots[] = { | |
29259 {Py_mod_create, (void*)__pyx_pymod_create}, | |
29260 {Py_mod_exec, (void*)__pyx_pymod_exec_libctabix}, | |
29261 {0, NULL} | |
29262 }; | |
29263 #endif | |
29264 | |
29265 #ifdef __cplusplus | |
29266 namespace { | |
29267 struct PyModuleDef __pyx_moduledef = | |
29268 #else | |
29269 static struct PyModuleDef __pyx_moduledef = | |
29270 #endif | |
29271 { | |
29272 PyModuleDef_HEAD_INIT, | |
29273 "libctabix", | |
29274 0, /* m_doc */ | |
29275 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
29276 0, /* m_size */ | |
29277 #elif CYTHON_USE_MODULE_STATE | |
29278 sizeof(__pyx_mstate), /* m_size */ | |
29279 #else | |
29280 -1, /* m_size */ | |
29281 #endif | |
29282 __pyx_methods /* m_methods */, | |
29283 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
29284 __pyx_moduledef_slots, /* m_slots */ | |
29285 #else | |
29286 NULL, /* m_reload */ | |
29287 #endif | |
29288 #if CYTHON_USE_MODULE_STATE | |
29289 __pyx_m_traverse, /* m_traverse */ | |
29290 __pyx_m_clear, /* m_clear */ | |
29291 NULL /* m_free */ | |
29292 #else | |
29293 NULL, /* m_traverse */ | |
29294 NULL, /* m_clear */ | |
29295 NULL /* m_free */ | |
29296 #endif | |
29297 }; | |
29298 #ifdef __cplusplus | |
29299 } /* anonymous namespace */ | |
29300 #endif | |
29301 #endif | |
29302 | |
29303 #ifndef CYTHON_NO_PYINIT_EXPORT | |
29304 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC | |
29305 #elif PY_MAJOR_VERSION < 3 | |
29306 #ifdef __cplusplus | |
29307 #define __Pyx_PyMODINIT_FUNC extern "C" void | |
29308 #else | |
29309 #define __Pyx_PyMODINIT_FUNC void | |
29310 #endif | |
29311 #else | |
29312 #ifdef __cplusplus | |
29313 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * | |
29314 #else | |
29315 #define __Pyx_PyMODINIT_FUNC PyObject * | |
29316 #endif | |
29317 #endif | |
29318 | |
29319 | |
29320 #if PY_MAJOR_VERSION < 3 | |
29321 __Pyx_PyMODINIT_FUNC initlibctabix(void) CYTHON_SMALL_CODE; /*proto*/ | |
29322 __Pyx_PyMODINIT_FUNC initlibctabix(void) | |
29323 #else | |
29324 __Pyx_PyMODINIT_FUNC PyInit_libctabix(void) CYTHON_SMALL_CODE; /*proto*/ | |
29325 __Pyx_PyMODINIT_FUNC PyInit_libctabix(void) | |
29326 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
29327 { | |
29328 return PyModuleDef_Init(&__pyx_moduledef); | |
29329 } | |
29330 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { | |
29331 #if PY_VERSION_HEX >= 0x030700A1 | |
29332 static PY_INT64_T main_interpreter_id = -1; | |
29333 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); | |
29334 if (main_interpreter_id == -1) { | |
29335 main_interpreter_id = current_id; | |
29336 return (unlikely(current_id == -1)) ? -1 : 0; | |
29337 } else if (unlikely(main_interpreter_id != current_id)) | |
29338 #else | |
29339 static PyInterpreterState *main_interpreter = NULL; | |
29340 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; | |
29341 if (!main_interpreter) { | |
29342 main_interpreter = current_interpreter; | |
29343 } else if (unlikely(main_interpreter != current_interpreter)) | |
29344 #endif | |
29345 { | |
29346 PyErr_SetString( | |
29347 PyExc_ImportError, | |
29348 "Interpreter change detected - this module can only be loaded into one interpreter per process."); | |
29349 return -1; | |
29350 } | |
29351 return 0; | |
29352 } | |
29353 #if CYTHON_COMPILING_IN_LIMITED_API | |
29354 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) | |
29355 #else | |
29356 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) | |
29357 #endif | |
29358 { | |
29359 PyObject *value = PyObject_GetAttrString(spec, from_name); | |
29360 int result = 0; | |
29361 if (likely(value)) { | |
29362 if (allow_none || value != Py_None) { | |
29363 #if CYTHON_COMPILING_IN_LIMITED_API | |
29364 result = PyModule_AddObject(module, to_name, value); | |
29365 #else | |
29366 result = PyDict_SetItemString(moddict, to_name, value); | |
29367 #endif | |
29368 } | |
29369 Py_DECREF(value); | |
29370 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { | |
29371 PyErr_Clear(); | |
29372 } else { | |
29373 result = -1; | |
29374 } | |
29375 return result; | |
29376 } | |
29377 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { | |
29378 PyObject *module = NULL, *moddict, *modname; | |
29379 CYTHON_UNUSED_VAR(def); | |
29380 if (__Pyx_check_single_interpreter()) | |
29381 return NULL; | |
29382 if (__pyx_m) | |
29383 return __Pyx_NewRef(__pyx_m); | |
29384 modname = PyObject_GetAttrString(spec, "name"); | |
29385 if (unlikely(!modname)) goto bad; | |
29386 module = PyModule_NewObject(modname); | |
29387 Py_DECREF(modname); | |
29388 if (unlikely(!module)) goto bad; | |
29389 #if CYTHON_COMPILING_IN_LIMITED_API | |
29390 moddict = module; | |
29391 #else | |
29392 moddict = PyModule_GetDict(module); | |
29393 if (unlikely(!moddict)) goto bad; | |
29394 #endif | |
29395 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; | |
29396 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; | |
29397 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; | |
29398 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; | |
29399 return module; | |
29400 bad: | |
29401 Py_XDECREF(module); | |
29402 return NULL; | |
29403 } | |
29404 | |
29405 | |
29406 static CYTHON_SMALL_CODE int __pyx_pymod_exec_libctabix(PyObject *__pyx_pyinit_module) | |
29407 #endif | |
29408 #endif | |
29409 { | |
29410 int stringtab_initialized = 0; | |
29411 #if CYTHON_USE_MODULE_STATE | |
29412 int pystate_addmodule_run = 0; | |
29413 #endif | |
29414 __Pyx_TraceDeclarations | |
29415 PyObject *__pyx_t_1 = NULL; | |
29416 PyObject *__pyx_t_2 = NULL; | |
29417 PyObject *__pyx_t_3 = NULL; | |
29418 PyObject *__pyx_t_4 = NULL; | |
29419 int __pyx_lineno = 0; | |
29420 const char *__pyx_filename = NULL; | |
29421 int __pyx_clineno = 0; | |
29422 __Pyx_RefNannyDeclarations | |
29423 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
29424 if (__pyx_m) { | |
29425 if (__pyx_m == __pyx_pyinit_module) return 0; | |
29426 PyErr_SetString(PyExc_RuntimeError, "Module 'libctabix' has already been imported. Re-initialisation is not supported."); | |
29427 return -1; | |
29428 } | |
29429 #elif PY_MAJOR_VERSION >= 3 | |
29430 if (__pyx_m) return __Pyx_NewRef(__pyx_m); | |
29431 #endif | |
29432 /*--- Module creation code ---*/ | |
29433 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
29434 __pyx_m = __pyx_pyinit_module; | |
29435 Py_INCREF(__pyx_m); | |
29436 #else | |
29437 #if PY_MAJOR_VERSION < 3 | |
29438 __pyx_m = Py_InitModule4("libctabix", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); | |
29439 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) | |
29440 #elif CYTHON_USE_MODULE_STATE | |
29441 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) | |
29442 { | |
29443 int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); | |
29444 __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "libctabix" pseudovariable */ | |
29445 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
29446 pystate_addmodule_run = 1; | |
29447 } | |
29448 #else | |
29449 __pyx_m = PyModule_Create(&__pyx_moduledef); | |
29450 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) | |
29451 #endif | |
29452 #endif | |
29453 CYTHON_UNUSED_VAR(__pyx_t_1); | |
29454 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) | |
29455 Py_INCREF(__pyx_d); | |
29456 __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) | |
29457 __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) | |
29458 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29459 #if CYTHON_REFNANNY | |
29460 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); | |
29461 if (!__Pyx_RefNanny) { | |
29462 PyErr_Clear(); | |
29463 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); | |
29464 if (!__Pyx_RefNanny) | |
29465 Py_FatalError("failed to import 'refnanny' module"); | |
29466 } | |
29467 #endif | |
29468 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_libctabix(void)", 0); | |
29469 if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29470 #ifdef __Pxy_PyFrame_Initialize_Offsets | |
29471 __Pxy_PyFrame_Initialize_Offsets(); | |
29472 #endif | |
29473 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) | |
29474 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) | |
29475 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) | |
29476 #ifdef __Pyx_CyFunction_USED | |
29477 if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29478 #endif | |
29479 #ifdef __Pyx_FusedFunction_USED | |
29480 if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29481 #endif | |
29482 #ifdef __Pyx_Coroutine_USED | |
29483 if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29484 #endif | |
29485 #ifdef __Pyx_Generator_USED | |
29486 if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29487 #endif | |
29488 #ifdef __Pyx_AsyncGen_USED | |
29489 if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29490 #endif | |
29491 #ifdef __Pyx_StopAsyncIteration_USED | |
29492 if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29493 #endif | |
29494 /*--- Library function declarations ---*/ | |
29495 /*--- Threads initialization code ---*/ | |
29496 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS | |
29497 PyEval_InitThreads(); | |
29498 #endif | |
29499 /*--- Initialize various global constants etc. ---*/ | |
29500 if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29501 stringtab_initialized = 1; | |
29502 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29503 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) | |
29504 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29505 #endif | |
29506 if (__pyx_module_is_main_pysam__libctabix) { | |
29507 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29508 } | |
29509 #if PY_MAJOR_VERSION >= 3 | |
29510 { | |
29511 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) | |
29512 if (!PyDict_GetItemString(modules, "pysam.libctabix")) { | |
29513 if (unlikely((PyDict_SetItemString(modules, "pysam.libctabix", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
29514 } | |
29515 } | |
29516 #endif | |
29517 /*--- Builtin init code ---*/ | |
29518 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29519 /*--- Constants init code ---*/ | |
29520 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29521 /*--- Global type/function init code ---*/ | |
29522 (void)__Pyx_modinit_global_init_code(); | |
29523 (void)__Pyx_modinit_variable_export_code(); | |
29524 (void)__Pyx_modinit_function_export_code(); | |
29525 if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
29526 if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
29527 (void)__Pyx_modinit_variable_import_code(); | |
29528 if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
29529 /*--- Execution code ---*/ | |
29530 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) | |
29531 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
29532 #endif | |
29533 __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_libctabix(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); | |
29534 | |
29535 /* "pysam/libctabix.pyx":57 | |
29536 * # | |
29537 * ############################################################################### | |
29538 * import os # <<<<<<<<<<<<<< | |
29539 * import sys | |
29540 * | |
29541 */ | |
29542 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) | |
29543 __Pyx_GOTREF(__pyx_t_2); | |
29544 if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) | |
29545 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29546 | |
29547 /* "pysam/libctabix.pyx":58 | |
29548 * ############################################################################### | |
29549 * import os | |
29550 * import sys # <<<<<<<<<<<<<< | |
29551 * | |
29552 * from libc.stdio cimport printf, fprintf, stderr | |
29553 */ | |
29554 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) | |
29555 __Pyx_GOTREF(__pyx_t_2); | |
29556 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 58, __pyx_L1_error) | |
29557 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29558 | |
29559 /* "pysam/libctabix.pyx":87 | |
29560 * self.encoding = encoding | |
29561 * | |
29562 * def set_encoding(self, encoding): # <<<<<<<<<<<<<< | |
29563 * self.encoding = encoding | |
29564 * | |
29565 */ | |
29566 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_6Parser_3set_encoding, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser_set_encoding, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) | |
29567 __Pyx_GOTREF(__pyx_t_2); | |
29568 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_Parser, __pyx_n_s_set_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 87, __pyx_L1_error) | |
29569 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29570 PyType_Modified(__pyx_ptype_5pysam_9libctabix_Parser); | |
29571 | |
29572 /* "pysam/libctabix.pyx":90 | |
29573 * self.encoding = encoding | |
29574 * | |
29575 * def get_encoding(self): # <<<<<<<<<<<<<< | |
29576 * return self.encoding | |
29577 * | |
29578 */ | |
29579 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_6Parser_5get_encoding, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser_get_encoding, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) | |
29580 __Pyx_GOTREF(__pyx_t_2); | |
29581 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_Parser, __pyx_n_s_get_encoding, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error) | |
29582 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29583 PyType_Modified(__pyx_ptype_5pysam_9libctabix_Parser); | |
29584 | |
29585 /* "(tree fragment)":1 | |
29586 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
29587 * cdef tuple state | |
29588 * cdef object _dict | |
29589 */ | |
29590 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_6Parser_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser___reduce_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
29591 __Pyx_GOTREF(__pyx_t_2); | |
29592 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_Parser, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
29593 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29594 PyType_Modified(__pyx_ptype_5pysam_9libctabix_Parser); | |
29595 | |
29596 /* "(tree fragment)":16 | |
29597 * else: | |
29598 * return __pyx_unpickle_Parser, (type(self), 0xe8424ea, state) | |
29599 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
29600 * __pyx_unpickle_Parser__set_state(self, __pyx_state) | |
29601 */ | |
29602 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_6Parser_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser___setstate_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) | |
29603 __Pyx_GOTREF(__pyx_t_2); | |
29604 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_Parser, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 16, __pyx_L1_error) | |
29605 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29606 PyType_Modified(__pyx_ptype_5pysam_9libctabix_Parser); | |
29607 | |
29608 /* "(tree fragment)":1 | |
29609 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
29610 * cdef tuple state | |
29611 * cdef object _dict | |
29612 */ | |
29613 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_7asTuple_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_asTuple___reduce_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
29614 __Pyx_GOTREF(__pyx_t_2); | |
29615 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_asTuple, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
29616 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29617 PyType_Modified(__pyx_ptype_5pysam_9libctabix_asTuple); | |
29618 | |
29619 /* "(tree fragment)":16 | |
29620 * else: | |
29621 * return __pyx_unpickle_asTuple, (type(self), 0xe8424ea, state) | |
29622 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
29623 * __pyx_unpickle_asTuple__set_state(self, __pyx_state) | |
29624 */ | |
29625 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_7asTuple_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_asTuple___setstate_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) | |
29626 __Pyx_GOTREF(__pyx_t_2); | |
29627 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_asTuple, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 16, __pyx_L1_error) | |
29628 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29629 PyType_Modified(__pyx_ptype_5pysam_9libctabix_asTuple); | |
29630 | |
29631 /* "(tree fragment)":1 | |
29632 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
29633 * cdef tuple state | |
29634 * cdef object _dict | |
29635 */ | |
29636 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_6asGFF3_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_asGFF3___reduce_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
29637 __Pyx_GOTREF(__pyx_t_2); | |
29638 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_asGFF3, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
29639 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29640 PyType_Modified(__pyx_ptype_5pysam_9libctabix_asGFF3); | |
29641 | |
29642 /* "(tree fragment)":16 | |
29643 * else: | |
29644 * return __pyx_unpickle_asGFF3, (type(self), 0xe8424ea, state) | |
29645 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
29646 * __pyx_unpickle_asGFF3__set_state(self, __pyx_state) | |
29647 */ | |
29648 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_6asGFF3_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_asGFF3___setstate_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) | |
29649 __Pyx_GOTREF(__pyx_t_2); | |
29650 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_asGFF3, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 16, __pyx_L1_error) | |
29651 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29652 PyType_Modified(__pyx_ptype_5pysam_9libctabix_asGFF3); | |
29653 | |
29654 /* "(tree fragment)":1 | |
29655 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
29656 * cdef tuple state | |
29657 * cdef object _dict | |
29658 */ | |
29659 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_5asGTF_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_asGTF___reduce_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
29660 __Pyx_GOTREF(__pyx_t_2); | |
29661 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_asGTF, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
29662 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29663 PyType_Modified(__pyx_ptype_5pysam_9libctabix_asGTF); | |
29664 | |
29665 /* "(tree fragment)":16 | |
29666 * else: | |
29667 * return __pyx_unpickle_asGTF, (type(self), 0xe8424ea, state) | |
29668 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
29669 * __pyx_unpickle_asGTF__set_state(self, __pyx_state) | |
29670 */ | |
29671 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_5asGTF_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_asGTF___setstate_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) | |
29672 __Pyx_GOTREF(__pyx_t_2); | |
29673 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_asGTF, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 16, __pyx_L1_error) | |
29674 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29675 PyType_Modified(__pyx_ptype_5pysam_9libctabix_asGTF); | |
29676 | |
29677 /* "(tree fragment)":1 | |
29678 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
29679 * cdef tuple state | |
29680 * cdef object _dict | |
29681 */ | |
29682 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_5asBed_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_asBed___reduce_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
29683 __Pyx_GOTREF(__pyx_t_2); | |
29684 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_asBed, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
29685 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29686 PyType_Modified(__pyx_ptype_5pysam_9libctabix_asBed); | |
29687 | |
29688 /* "(tree fragment)":16 | |
29689 * else: | |
29690 * return __pyx_unpickle_asBed, (type(self), 0xe8424ea, state) | |
29691 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
29692 * __pyx_unpickle_asBed__set_state(self, __pyx_state) | |
29693 */ | |
29694 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_5asBed_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_asBed___setstate_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) | |
29695 __Pyx_GOTREF(__pyx_t_2); | |
29696 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_asBed, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 16, __pyx_L1_error) | |
29697 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29698 PyType_Modified(__pyx_ptype_5pysam_9libctabix_asBed); | |
29699 | |
29700 /* "(tree fragment)":1 | |
29701 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
29702 * cdef tuple state | |
29703 * cdef object _dict | |
29704 */ | |
29705 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_5asVCF_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_asVCF___reduce_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
29706 __Pyx_GOTREF(__pyx_t_2); | |
29707 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_asVCF, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
29708 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29709 PyType_Modified(__pyx_ptype_5pysam_9libctabix_asVCF); | |
29710 | |
29711 /* "(tree fragment)":16 | |
29712 * else: | |
29713 * return __pyx_unpickle_asVCF, (type(self), 0xe8424ea, state) | |
29714 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
29715 * __pyx_unpickle_asVCF__set_state(self, __pyx_state) | |
29716 */ | |
29717 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_5asVCF_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_asVCF___setstate_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) | |
29718 __Pyx_GOTREF(__pyx_t_2); | |
29719 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_asVCF, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 16, __pyx_L1_error) | |
29720 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29721 PyType_Modified(__pyx_ptype_5pysam_9libctabix_asVCF); | |
29722 | |
29723 /* "pysam/libctabix.pyx":352 | |
29724 * self.encoding = encoding | |
29725 * | |
29726 * def _open( self, # <<<<<<<<<<<<<< | |
29727 * filename, | |
29728 * mode='r', | |
29729 */ | |
29730 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_9TabixFile_3_open, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TabixFile__open, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error) | |
29731 __Pyx_GOTREF(__pyx_t_2); | |
29732 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__68); | |
29733 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_TabixFile, __pyx_n_s_open, __pyx_t_2) < 0) __PYX_ERR(0, 352, __pyx_L1_error) | |
29734 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29735 PyType_Modified(__pyx_ptype_5pysam_9libctabix_TabixFile); | |
29736 | |
29737 /* "pysam/libctabix.pyx":404 | |
29738 * self.start_offset = self.tell() | |
29739 * | |
29740 * def _dup(self): # <<<<<<<<<<<<<< | |
29741 * '''return a copy of this tabix file. | |
29742 * | |
29743 */ | |
29744 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_9TabixFile_5_dup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TabixFile__dup, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) | |
29745 __Pyx_GOTREF(__pyx_t_2); | |
29746 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_TabixFile, __pyx_n_s_dup, __pyx_t_2) < 0) __PYX_ERR(0, 404, __pyx_L1_error) | |
29747 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29748 PyType_Modified(__pyx_ptype_5pysam_9libctabix_TabixFile); | |
29749 | |
29750 /* "pysam/libctabix.pyx":416 | |
29751 * encoding=self.encoding) | |
29752 * | |
29753 * def fetch(self, # <<<<<<<<<<<<<< | |
29754 * reference=None, | |
29755 * start=None, | |
29756 */ | |
29757 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_9TabixFile_7fetch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TabixFile_fetch, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) | |
29758 __Pyx_GOTREF(__pyx_t_2); | |
29759 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__70); | |
29760 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_TabixFile, __pyx_n_s_fetch, __pyx_t_2) < 0) __PYX_ERR(0, 416, __pyx_L1_error) | |
29761 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29762 PyType_Modified(__pyx_ptype_5pysam_9libctabix_TabixFile); | |
29763 | |
29764 /* "pysam/libctabix.pyx":598 | |
29765 * return result | |
29766 * | |
29767 * def close(self): # <<<<<<<<<<<<<< | |
29768 * ''' | |
29769 * closes the :class:`pysam.TabixFile`.''' | |
29770 */ | |
29771 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_9TabixFile_9close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TabixFile_close, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error) | |
29772 __Pyx_GOTREF(__pyx_t_2); | |
29773 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libctabix_TabixFile, __pyx_n_s_close, __pyx_t_2) < 0) __PYX_ERR(0, 598, __pyx_L1_error) | |
29774 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29775 PyType_Modified(__pyx_ptype_5pysam_9libctabix_TabixFile); | |
29776 | |
29777 /* "(tree fragment)":1 | |
29778 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
29779 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
29780 * def __setstate_cython__(self, __pyx_state): | |
29781 */ | |
29782 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_9TabixFile_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TabixFile___reduce_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
29783 __Pyx_GOTREF(__pyx_t_2); | |
29784 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
29785 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29786 | |
29787 /* "(tree fragment)":3 | |
29788 * def __reduce_cython__(self): | |
29789 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
29790 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
29791 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
29792 */ | |
29793 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_9TabixFile_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TabixFile___setstate_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) | |
29794 __Pyx_GOTREF(__pyx_t_2); | |
29795 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) | |
29796 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29797 | |
29798 /* "(tree fragment)":1 | |
29799 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
29800 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
29801 * def __setstate_cython__(self, __pyx_state): | |
29802 */ | |
29803 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_13TabixIterator_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TabixIterator___reduce_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
29804 __Pyx_GOTREF(__pyx_t_2); | |
29805 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
29806 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29807 | |
29808 /* "(tree fragment)":3 | |
29809 * def __reduce_cython__(self): | |
29810 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
29811 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
29812 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
29813 */ | |
29814 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_13TabixIterator_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TabixIterator___setstate_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) | |
29815 __Pyx_GOTREF(__pyx_t_2); | |
29816 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) | |
29817 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29818 | |
29819 /* "pysam/libctabix.pyx":682 | |
29820 * | |
29821 * | |
29822 * class EmptyIterator: # <<<<<<<<<<<<<< | |
29823 * '''empty iterator''' | |
29824 * | |
29825 */ | |
29826 __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_EmptyIterator, __pyx_n_s_EmptyIterator, (PyObject *) NULL, __pyx_n_s_pysam_libctabix, __pyx_kp_s_empty_iterator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error) | |
29827 __Pyx_GOTREF(__pyx_t_2); | |
29828 | |
29829 /* "pysam/libctabix.pyx":685 | |
29830 * '''empty iterator''' | |
29831 * | |
29832 * def __iter__(self): # <<<<<<<<<<<<<< | |
29833 * return self | |
29834 * | |
29835 */ | |
29836 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_13EmptyIterator_1__iter__, 0, __pyx_n_s_EmptyIterator___iter, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error) | |
29837 __Pyx_GOTREF(__pyx_t_3); | |
29838 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_iter, __pyx_t_3) < 0) __PYX_ERR(0, 685, __pyx_L1_error) | |
29839 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
29840 | |
29841 /* "pysam/libctabix.pyx":688 | |
29842 * return self | |
29843 * | |
29844 * def __next__(self): # <<<<<<<<<<<<<< | |
29845 * raise StopIteration() | |
29846 * | |
29847 */ | |
29848 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_13EmptyIterator_3__next__, 0, __pyx_n_s_EmptyIterator___next, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error) | |
29849 __Pyx_GOTREF(__pyx_t_3); | |
29850 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_next, __pyx_t_3) < 0) __PYX_ERR(0, 688, __pyx_L1_error) | |
29851 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
29852 | |
29853 /* "pysam/libctabix.pyx":682 | |
29854 * | |
29855 * | |
29856 * class EmptyIterator: # <<<<<<<<<<<<<< | |
29857 * '''empty iterator''' | |
29858 * | |
29859 */ | |
29860 __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_EmptyIterator, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error) | |
29861 __Pyx_GOTREF(__pyx_t_3); | |
29862 if (PyDict_SetItem(__pyx_d, __pyx_n_s_EmptyIterator, __pyx_t_3) < 0) __PYX_ERR(0, 682, __pyx_L1_error) | |
29863 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
29864 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29865 | |
29866 /* "(tree fragment)":1 | |
29867 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
29868 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
29869 * def __setstate_cython__(self, __pyx_state): | |
29870 */ | |
29871 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_19TabixIteratorParsed_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TabixIteratorParsed___reduce_cyt, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
29872 __Pyx_GOTREF(__pyx_t_2); | |
29873 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
29874 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29875 | |
29876 /* "(tree fragment)":3 | |
29877 * def __reduce_cython__(self): | |
29878 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
29879 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
29880 * raise TypeError, "self.iterator cannot be converted to a Python object for pickling" | |
29881 */ | |
29882 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_19TabixIteratorParsed_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TabixIteratorParsed___setstate_c, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) | |
29883 __Pyx_GOTREF(__pyx_t_2); | |
29884 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) | |
29885 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29886 | |
29887 /* "(tree fragment)":1 | |
29888 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
29889 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
29890 * def __setstate_cython__(self, __pyx_state): | |
29891 */ | |
29892 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_10GZIterator_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GZIterator___reduce_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
29893 __Pyx_GOTREF(__pyx_t_2); | |
29894 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
29895 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29896 | |
29897 /* "(tree fragment)":3 | |
29898 * def __reduce_cython__(self): | |
29899 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
29900 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
29901 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
29902 */ | |
29903 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_10GZIterator_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GZIterator___setstate_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) | |
29904 __Pyx_GOTREF(__pyx_t_2); | |
29905 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) | |
29906 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29907 | |
29908 /* "(tree fragment)":1 | |
29909 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
29910 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
29911 * def __setstate_cython__(self, __pyx_state): | |
29912 */ | |
29913 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_14GZIteratorHead_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GZIteratorHead___reduce_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
29914 __Pyx_GOTREF(__pyx_t_2); | |
29915 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
29916 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29917 | |
29918 /* "(tree fragment)":3 | |
29919 * def __reduce_cython__(self): | |
29920 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
29921 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
29922 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
29923 */ | |
29924 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_14GZIteratorHead_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GZIteratorHead___setstate_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) | |
29925 __Pyx_GOTREF(__pyx_t_2); | |
29926 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) | |
29927 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29928 | |
29929 /* "(tree fragment)":1 | |
29930 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
29931 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
29932 * def __setstate_cython__(self, __pyx_state): | |
29933 */ | |
29934 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_16GZIteratorParsed_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GZIteratorParsed___reduce_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
29935 __Pyx_GOTREF(__pyx_t_2); | |
29936 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
29937 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29938 | |
29939 /* "(tree fragment)":3 | |
29940 * def __reduce_cython__(self): | |
29941 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
29942 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
29943 * raise TypeError, "self.gzipfile,self.kstream cannot be converted to a Python object for pickling" | |
29944 */ | |
29945 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_16GZIteratorParsed_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GZIteratorParsed___setstate_cyth, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) | |
29946 __Pyx_GOTREF(__pyx_t_2); | |
29947 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) | |
29948 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29949 | |
29950 /* "pysam/libctabix.pyx":811 | |
29951 * | |
29952 * | |
29953 * def tabix_compress(filename_in, # <<<<<<<<<<<<<< | |
29954 * filename_out, | |
29955 * force=False): | |
29956 */ | |
29957 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_1tabix_compress, 0, __pyx_n_s_tabix_compress, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error) | |
29958 __Pyx_GOTREF(__pyx_t_2); | |
29959 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__72); | |
29960 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tabix_compress, __pyx_t_2) < 0) __PYX_ERR(0, 811, __pyx_L1_error) | |
29961 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
29962 | |
29963 /* "pysam/libctabix.pyx":880 | |
29964 * preset=None, | |
29965 * meta_char="#", | |
29966 * int line_skip=0, # <<<<<<<<<<<<<< | |
29967 * zerobased=False, | |
29968 * int min_shift=-1, | |
29969 */ | |
29970 __pyx_t_2 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) | |
29971 __Pyx_GOTREF(__pyx_t_2); | |
29972 | |
29973 /* "pysam/libctabix.pyx":882 | |
29974 * int line_skip=0, | |
29975 * zerobased=False, | |
29976 * int min_shift=-1, # <<<<<<<<<<<<<< | |
29977 * index=None, | |
29978 * keep_original=False, | |
29979 */ | |
29980 __pyx_t_3 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error) | |
29981 __Pyx_GOTREF(__pyx_t_3); | |
29982 | |
29983 /* "pysam/libctabix.pyx":873 | |
29984 * | |
29985 * | |
29986 * def tabix_index(filename, # <<<<<<<<<<<<<< | |
29987 * force=False, | |
29988 * seq_col=None, | |
29989 */ | |
29990 __pyx_t_4 = PyTuple_New(12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) | |
29991 __Pyx_GOTREF(__pyx_t_4); | |
29992 __Pyx_INCREF(((PyObject *)Py_False)); | |
29993 __Pyx_GIVEREF(((PyObject *)Py_False)); | |
29994 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_False))) __PYX_ERR(0, 873, __pyx_L1_error); | |
29995 __Pyx_INCREF(Py_None); | |
29996 __Pyx_GIVEREF(Py_None); | |
29997 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, Py_None)) __PYX_ERR(0, 873, __pyx_L1_error); | |
29998 __Pyx_INCREF(Py_None); | |
29999 __Pyx_GIVEREF(Py_None); | |
30000 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None)) __PYX_ERR(0, 873, __pyx_L1_error); | |
30001 __Pyx_INCREF(Py_None); | |
30002 __Pyx_GIVEREF(Py_None); | |
30003 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, Py_None)) __PYX_ERR(0, 873, __pyx_L1_error); | |
30004 __Pyx_INCREF(Py_None); | |
30005 __Pyx_GIVEREF(Py_None); | |
30006 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, Py_None)) __PYX_ERR(0, 873, __pyx_L1_error); | |
30007 __Pyx_INCREF(((PyObject*)__pyx_kp_u__39)); | |
30008 __Pyx_GIVEREF(((PyObject*)__pyx_kp_u__39)); | |
30009 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 5, ((PyObject*)__pyx_kp_u__39))) __PYX_ERR(0, 873, __pyx_L1_error); | |
30010 __Pyx_GIVEREF(__pyx_t_2); | |
30011 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_2)) __PYX_ERR(0, 873, __pyx_L1_error); | |
30012 __Pyx_INCREF(((PyObject *)Py_False)); | |
30013 __Pyx_GIVEREF(((PyObject *)Py_False)); | |
30014 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 7, ((PyObject *)Py_False))) __PYX_ERR(0, 873, __pyx_L1_error); | |
30015 __Pyx_GIVEREF(__pyx_t_3); | |
30016 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_t_3)) __PYX_ERR(0, 873, __pyx_L1_error); | |
30017 __Pyx_INCREF(Py_None); | |
30018 __Pyx_GIVEREF(Py_None); | |
30019 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 9, Py_None)) __PYX_ERR(0, 873, __pyx_L1_error); | |
30020 __Pyx_INCREF(((PyObject *)Py_False)); | |
30021 __Pyx_GIVEREF(((PyObject *)Py_False)); | |
30022 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 10, ((PyObject *)Py_False))) __PYX_ERR(0, 873, __pyx_L1_error); | |
30023 __Pyx_INCREF(((PyObject *)Py_False)); | |
30024 __Pyx_GIVEREF(((PyObject *)Py_False)); | |
30025 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 11, ((PyObject *)Py_False))) __PYX_ERR(0, 873, __pyx_L1_error); | |
30026 __pyx_t_2 = 0; | |
30027 __pyx_t_3 = 0; | |
30028 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_3tabix_index, 0, __pyx_n_s_tabix_index, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 873, __pyx_L1_error) | |
30029 __Pyx_GOTREF(__pyx_t_3); | |
30030 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_4); | |
30031 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
30032 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tabix_index, __pyx_t_3) < 0) __PYX_ERR(0, 873, __pyx_L1_error) | |
30033 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30034 | |
30035 /* "(tree fragment)":1 | |
30036 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
30037 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
30038 * def __setstate_cython__(self, __pyx_state): | |
30039 */ | |
30040 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_19tabix_file_iterator_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_tabix_file_iterator___reduce_cyt, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) | |
30041 __Pyx_GOTREF(__pyx_t_3); | |
30042 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
30043 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30044 | |
30045 /* "(tree fragment)":3 | |
30046 * def __reduce_cython__(self): | |
30047 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
30048 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
30049 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
30050 */ | |
30051 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_19tabix_file_iterator_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_tabix_file_iterator___setstate_c, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) | |
30052 __Pyx_GOTREF(__pyx_t_3); | |
30053 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) | |
30054 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30055 | |
30056 /* "pysam/libctabix.pyx":1178 | |
30057 * | |
30058 * | |
30059 * class tabix_generic_iterator: # <<<<<<<<<<<<<< | |
30060 * '''iterate over ``infile``. | |
30061 * | |
30062 */ | |
30063 __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_tabix_generic_iterator, __pyx_n_s_tabix_generic_iterator, (PyObject *) NULL, __pyx_n_s_pysam_libctabix, __pyx_kp_s_iterate_over_infile_Permits_the); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1178, __pyx_L1_error) | |
30064 __Pyx_GOTREF(__pyx_t_3); | |
30065 | |
30066 /* "pysam/libctabix.pyx":1183 | |
30067 * Permits the use of file-like objects for example from the gzip module. | |
30068 * ''' | |
30069 * def __init__(self, infile, parser): # <<<<<<<<<<<<<< | |
30070 * | |
30071 * self.infile = infile | |
30072 */ | |
30073 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_22tabix_generic_iterator_1__init__, 0, __pyx_n_s_tabix_generic_iterator___init, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1183, __pyx_L1_error) | |
30074 __Pyx_GOTREF(__pyx_t_4); | |
30075 if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 1183, __pyx_L1_error) | |
30076 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
30077 | |
30078 /* "pysam/libctabix.pyx":1190 | |
30079 * self.parser = parser | |
30080 * | |
30081 * def __iter__(self): # <<<<<<<<<<<<<< | |
30082 * return self | |
30083 * | |
30084 */ | |
30085 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_22tabix_generic_iterator_3__iter__, 0, __pyx_n_s_tabix_generic_iterator___iter, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1190, __pyx_L1_error) | |
30086 __Pyx_GOTREF(__pyx_t_4); | |
30087 if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_iter, __pyx_t_4) < 0) __PYX_ERR(0, 1190, __pyx_L1_error) | |
30088 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
30089 | |
30090 /* "pysam/libctabix.pyx":1194 | |
30091 * | |
30092 * # cython version - required for python 3 | |
30093 * def __next__(self): # <<<<<<<<<<<<<< | |
30094 * | |
30095 * cdef char * b | |
30096 */ | |
30097 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_22tabix_generic_iterator_5__next__, 0, __pyx_n_s_tabix_generic_iterator___next, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1194, __pyx_L1_error) | |
30098 __Pyx_GOTREF(__pyx_t_4); | |
30099 if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_next, __pyx_t_4) < 0) __PYX_ERR(0, 1194, __pyx_L1_error) | |
30100 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
30101 | |
30102 /* "pysam/libctabix.pyx":1178 | |
30103 * | |
30104 * | |
30105 * class tabix_generic_iterator: # <<<<<<<<<<<<<< | |
30106 * '''iterate over ``infile``. | |
30107 * | |
30108 */ | |
30109 __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_tabix_generic_iterator, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1178, __pyx_L1_error) | |
30110 __Pyx_GOTREF(__pyx_t_4); | |
30111 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tabix_generic_iterator, __pyx_t_4) < 0) __PYX_ERR(0, 1178, __pyx_L1_error) | |
30112 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
30113 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30114 | |
30115 /* "pysam/libctabix.pyx":1238 | |
30116 * | |
30117 * | |
30118 * def tabix_iterator(infile, parser): # <<<<<<<<<<<<<< | |
30119 * """return an iterator over all entries in a file. | |
30120 * | |
30121 */ | |
30122 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_5tabix_iterator, 0, __pyx_n_s_tabix_iterator, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1238, __pyx_L1_error) | |
30123 __Pyx_GOTREF(__pyx_t_3); | |
30124 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tabix_iterator, __pyx_t_3) < 0) __PYX_ERR(0, 1238, __pyx_L1_error) | |
30125 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30126 | |
30127 /* "(tree fragment)":1 | |
30128 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
30129 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
30130 * def __setstate_cython__(self, __pyx_state): | |
30131 */ | |
30132 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_9Tabixfile_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tabixfile___reduce_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) | |
30133 __Pyx_GOTREF(__pyx_t_3); | |
30134 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
30135 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30136 | |
30137 /* "(tree fragment)":3 | |
30138 * def __reduce_cython__(self): | |
30139 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
30140 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
30141 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
30142 */ | |
30143 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_9Tabixfile_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Tabixfile___setstate_cython, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) | |
30144 __Pyx_GOTREF(__pyx_t_3); | |
30145 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) | |
30146 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30147 | |
30148 /* "pysam/libctabix.pyx":1256 | |
30149 * | |
30150 * | |
30151 * __all__ = [ # <<<<<<<<<<<<<< | |
30152 * "tabix_index", | |
30153 * "tabix_compress", | |
30154 */ | |
30155 __pyx_t_3 = PyList_New(14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1256, __pyx_L1_error) | |
30156 __Pyx_GOTREF(__pyx_t_3); | |
30157 __Pyx_INCREF(__pyx_n_u_tabix_index); | |
30158 __Pyx_GIVEREF(__pyx_n_u_tabix_index); | |
30159 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_tabix_index)) __PYX_ERR(0, 1256, __pyx_L1_error); | |
30160 __Pyx_INCREF(__pyx_n_u_tabix_compress); | |
30161 __Pyx_GIVEREF(__pyx_n_u_tabix_compress); | |
30162 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_u_tabix_compress)) __PYX_ERR(0, 1256, __pyx_L1_error); | |
30163 __Pyx_INCREF(__pyx_n_u_TabixFile); | |
30164 __Pyx_GIVEREF(__pyx_n_u_TabixFile); | |
30165 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_u_TabixFile)) __PYX_ERR(0, 1256, __pyx_L1_error); | |
30166 __Pyx_INCREF(__pyx_n_u_Tabixfile); | |
30167 __Pyx_GIVEREF(__pyx_n_u_Tabixfile); | |
30168 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_u_Tabixfile)) __PYX_ERR(0, 1256, __pyx_L1_error); | |
30169 __Pyx_INCREF(__pyx_n_u_asTuple); | |
30170 __Pyx_GIVEREF(__pyx_n_u_asTuple); | |
30171 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_u_asTuple)) __PYX_ERR(0, 1256, __pyx_L1_error); | |
30172 __Pyx_INCREF(__pyx_n_u_asGTF); | |
30173 __Pyx_GIVEREF(__pyx_n_u_asGTF); | |
30174 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 5, __pyx_n_u_asGTF)) __PYX_ERR(0, 1256, __pyx_L1_error); | |
30175 __Pyx_INCREF(__pyx_n_u_asGFF3); | |
30176 __Pyx_GIVEREF(__pyx_n_u_asGFF3); | |
30177 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 6, __pyx_n_u_asGFF3)) __PYX_ERR(0, 1256, __pyx_L1_error); | |
30178 __Pyx_INCREF(__pyx_n_u_asVCF); | |
30179 __Pyx_GIVEREF(__pyx_n_u_asVCF); | |
30180 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 7, __pyx_n_u_asVCF)) __PYX_ERR(0, 1256, __pyx_L1_error); | |
30181 __Pyx_INCREF(__pyx_n_u_asBed); | |
30182 __Pyx_GIVEREF(__pyx_n_u_asBed); | |
30183 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 8, __pyx_n_u_asBed)) __PYX_ERR(0, 1256, __pyx_L1_error); | |
30184 __Pyx_INCREF(__pyx_n_u_GZIterator); | |
30185 __Pyx_GIVEREF(__pyx_n_u_GZIterator); | |
30186 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 9, __pyx_n_u_GZIterator)) __PYX_ERR(0, 1256, __pyx_L1_error); | |
30187 __Pyx_INCREF(__pyx_n_u_GZIteratorHead); | |
30188 __Pyx_GIVEREF(__pyx_n_u_GZIteratorHead); | |
30189 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 10, __pyx_n_u_GZIteratorHead)) __PYX_ERR(0, 1256, __pyx_L1_error); | |
30190 __Pyx_INCREF(__pyx_n_u_tabix_iterator); | |
30191 __Pyx_GIVEREF(__pyx_n_u_tabix_iterator); | |
30192 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 11, __pyx_n_u_tabix_iterator)) __PYX_ERR(0, 1256, __pyx_L1_error); | |
30193 __Pyx_INCREF(__pyx_n_u_tabix_generic_iterator); | |
30194 __Pyx_GIVEREF(__pyx_n_u_tabix_generic_iterator); | |
30195 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 12, __pyx_n_u_tabix_generic_iterator)) __PYX_ERR(0, 1256, __pyx_L1_error); | |
30196 __Pyx_INCREF(__pyx_n_u_tabix_file_iterator); | |
30197 __Pyx_GIVEREF(__pyx_n_u_tabix_file_iterator); | |
30198 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 13, __pyx_n_u_tabix_file_iterator)) __PYX_ERR(0, 1256, __pyx_L1_error); | |
30199 if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_3) < 0) __PYX_ERR(0, 1256, __pyx_L1_error) | |
30200 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30201 | |
30202 /* "(tree fragment)":1 | |
30203 * def __pyx_unpickle_Parser(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
30204 * cdef object __pyx_PickleError | |
30205 * cdef object __pyx_result | |
30206 */ | |
30207 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_7__pyx_unpickle_Parser, 0, __pyx_n_s_pyx_unpickle_Parser, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) | |
30208 __Pyx_GOTREF(__pyx_t_3); | |
30209 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Parser, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
30210 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30211 | |
30212 /* "(tree fragment)":11 | |
30213 * __pyx_unpickle_Parser__set_state(<Parser> __pyx_result, __pyx_state) | |
30214 * return __pyx_result | |
30215 * cdef __pyx_unpickle_Parser__set_state(Parser __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
30216 * __pyx_result.encoding = __pyx_state[0] | |
30217 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
30218 */ | |
30219 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_9__pyx_unpickle_asTuple, 0, __pyx_n_s_pyx_unpickle_asTuple, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) | |
30220 __Pyx_GOTREF(__pyx_t_3); | |
30221 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_asTuple, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
30222 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30223 | |
30224 /* "(tree fragment)":1 | |
30225 * def __pyx_unpickle_asGFF3(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
30226 * cdef object __pyx_PickleError | |
30227 * cdef object __pyx_result | |
30228 */ | |
30229 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_11__pyx_unpickle_asGFF3, 0, __pyx_n_s_pyx_unpickle_asGFF3, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) | |
30230 __Pyx_GOTREF(__pyx_t_3); | |
30231 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_asGFF3, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
30232 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30233 | |
30234 /* "(tree fragment)":11 | |
30235 * __pyx_unpickle_asGFF3__set_state(<asGFF3> __pyx_result, __pyx_state) | |
30236 * return __pyx_result | |
30237 * cdef __pyx_unpickle_asGFF3__set_state(asGFF3 __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
30238 * __pyx_result.encoding = __pyx_state[0] | |
30239 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
30240 */ | |
30241 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_13__pyx_unpickle_asGTF, 0, __pyx_n_s_pyx_unpickle_asGTF, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) | |
30242 __Pyx_GOTREF(__pyx_t_3); | |
30243 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_asGTF, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
30244 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30245 | |
30246 /* "(tree fragment)":1 | |
30247 * def __pyx_unpickle_asBed(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
30248 * cdef object __pyx_PickleError | |
30249 * cdef object __pyx_result | |
30250 */ | |
30251 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_15__pyx_unpickle_asBed, 0, __pyx_n_s_pyx_unpickle_asBed, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) | |
30252 __Pyx_GOTREF(__pyx_t_3); | |
30253 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_asBed, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
30254 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30255 | |
30256 /* "(tree fragment)":11 | |
30257 * __pyx_unpickle_asBed__set_state(<asBed> __pyx_result, __pyx_state) | |
30258 * return __pyx_result | |
30259 * cdef __pyx_unpickle_asBed__set_state(asBed __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
30260 * __pyx_result.encoding = __pyx_state[0] | |
30261 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): | |
30262 */ | |
30263 __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libctabix_17__pyx_unpickle_asVCF, 0, __pyx_n_s_pyx_unpickle_asVCF, NULL, __pyx_n_s_pysam_libctabix, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) | |
30264 __Pyx_GOTREF(__pyx_t_3); | |
30265 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_asVCF, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
30266 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30267 | |
30268 /* "pysam/libctabix.pyx":1 | |
30269 * # cython: language_level=3 # <<<<<<<<<<<<<< | |
30270 * # cython: embedsignature=True | |
30271 * # cython: profile=True | |
30272 */ | |
30273 __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) | |
30274 __Pyx_GOTREF(__pyx_t_3); | |
30275 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
30276 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
30277 __Pyx_TraceReturn(Py_None, 0); | |
30278 | |
30279 /*--- Wrapped vars code ---*/ | |
30280 | |
30281 goto __pyx_L0; | |
30282 __pyx_L1_error:; | |
30283 __Pyx_XDECREF(__pyx_t_2); | |
30284 __Pyx_XDECREF(__pyx_t_3); | |
30285 __Pyx_XDECREF(__pyx_t_4); | |
30286 if (__pyx_m) { | |
30287 if (__pyx_d && stringtab_initialized) { | |
30288 __Pyx_AddTraceback("init pysam.libctabix", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
30289 } | |
30290 #if !CYTHON_USE_MODULE_STATE | |
30291 Py_CLEAR(__pyx_m); | |
30292 #else | |
30293 Py_DECREF(__pyx_m); | |
30294 if (pystate_addmodule_run) { | |
30295 PyObject *tp, *value, *tb; | |
30296 PyErr_Fetch(&tp, &value, &tb); | |
30297 PyState_RemoveModule(&__pyx_moduledef); | |
30298 PyErr_Restore(tp, value, tb); | |
30299 } | |
30300 #endif | |
30301 } else if (!PyErr_Occurred()) { | |
30302 PyErr_SetString(PyExc_ImportError, "init pysam.libctabix"); | |
30303 } | |
30304 __pyx_L0:; | |
30305 __Pyx_RefNannyFinishContext(); | |
30306 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
30307 return (__pyx_m != NULL) ? 0 : -1; | |
30308 #elif PY_MAJOR_VERSION >= 3 | |
30309 return __pyx_m; | |
30310 #else | |
30311 return; | |
30312 #endif | |
30313 } | |
30314 /* #### Code section: cleanup_globals ### */ | |
30315 /* #### Code section: cleanup_module ### */ | |
30316 /* #### Code section: main_method ### */ | |
30317 /* #### Code section: utility_code_pragmas ### */ | |
30318 #ifdef _MSC_VER | |
30319 #pragma warning( push ) | |
30320 /* Warning 4127: conditional expression is constant | |
30321 * Cython uses constant conditional expressions to allow in inline functions to be optimized at | |
30322 * compile-time, so this warning is not useful | |
30323 */ | |
30324 #pragma warning( disable : 4127 ) | |
30325 #endif | |
30326 | |
30327 | |
30328 | |
30329 /* #### Code section: utility_code_def ### */ | |
30330 | |
30331 /* --- Runtime support code --- */ | |
30332 /* Refnanny */ | |
30333 #if CYTHON_REFNANNY | |
30334 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { | |
30335 PyObject *m = NULL, *p = NULL; | |
30336 void *r = NULL; | |
30337 m = PyImport_ImportModule(modname); | |
30338 if (!m) goto end; | |
30339 p = PyObject_GetAttrString(m, "RefNannyAPI"); | |
30340 if (!p) goto end; | |
30341 r = PyLong_AsVoidPtr(p); | |
30342 end: | |
30343 Py_XDECREF(p); | |
30344 Py_XDECREF(m); | |
30345 return (__Pyx_RefNannyAPIStruct *)r; | |
30346 } | |
30347 #endif | |
30348 | |
30349 /* PyErrExceptionMatches */ | |
30350 #if CYTHON_FAST_THREAD_STATE | |
30351 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { | |
30352 Py_ssize_t i, n; | |
30353 n = PyTuple_GET_SIZE(tuple); | |
30354 #if PY_MAJOR_VERSION >= 3 | |
30355 for (i=0; i<n; i++) { | |
30356 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1; | |
30357 } | |
30358 #endif | |
30359 for (i=0; i<n; i++) { | |
30360 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1; | |
30361 } | |
30362 return 0; | |
30363 } | |
30364 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { | |
30365 int result; | |
30366 PyObject *exc_type; | |
30367 #if PY_VERSION_HEX >= 0x030C00A6 | |
30368 PyObject *current_exception = tstate->current_exception; | |
30369 if (unlikely(!current_exception)) return 0; | |
30370 exc_type = (PyObject*) Py_TYPE(current_exception); | |
30371 if (exc_type == err) return 1; | |
30372 #else | |
30373 exc_type = tstate->curexc_type; | |
30374 if (exc_type == err) return 1; | |
30375 if (unlikely(!exc_type)) return 0; | |
30376 #endif | |
30377 #if CYTHON_AVOID_BORROWED_REFS | |
30378 Py_INCREF(exc_type); | |
30379 #endif | |
30380 if (unlikely(PyTuple_Check(err))) { | |
30381 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); | |
30382 } else { | |
30383 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); | |
30384 } | |
30385 #if CYTHON_AVOID_BORROWED_REFS | |
30386 Py_DECREF(exc_type); | |
30387 #endif | |
30388 return result; | |
30389 } | |
30390 #endif | |
30391 | |
30392 /* PyErrFetchRestore */ | |
30393 #if CYTHON_FAST_THREAD_STATE | |
30394 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { | |
30395 #if PY_VERSION_HEX >= 0x030C00A6 | |
30396 PyObject *tmp_value; | |
30397 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); | |
30398 if (value) { | |
30399 #if CYTHON_COMPILING_IN_CPYTHON | |
30400 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) | |
30401 #endif | |
30402 PyException_SetTraceback(value, tb); | |
30403 } | |
30404 tmp_value = tstate->current_exception; | |
30405 tstate->current_exception = value; | |
30406 Py_XDECREF(tmp_value); | |
30407 Py_XDECREF(type); | |
30408 Py_XDECREF(tb); | |
30409 #else | |
30410 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
30411 tmp_type = tstate->curexc_type; | |
30412 tmp_value = tstate->curexc_value; | |
30413 tmp_tb = tstate->curexc_traceback; | |
30414 tstate->curexc_type = type; | |
30415 tstate->curexc_value = value; | |
30416 tstate->curexc_traceback = tb; | |
30417 Py_XDECREF(tmp_type); | |
30418 Py_XDECREF(tmp_value); | |
30419 Py_XDECREF(tmp_tb); | |
30420 #endif | |
30421 } | |
30422 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { | |
30423 #if PY_VERSION_HEX >= 0x030C00A6 | |
30424 PyObject* exc_value; | |
30425 exc_value = tstate->current_exception; | |
30426 tstate->current_exception = 0; | |
30427 *value = exc_value; | |
30428 *type = NULL; | |
30429 *tb = NULL; | |
30430 if (exc_value) { | |
30431 *type = (PyObject*) Py_TYPE(exc_value); | |
30432 Py_INCREF(*type); | |
30433 #if CYTHON_COMPILING_IN_CPYTHON | |
30434 *tb = ((PyBaseExceptionObject*) exc_value)->traceback; | |
30435 Py_XINCREF(*tb); | |
30436 #else | |
30437 *tb = PyException_GetTraceback(exc_value); | |
30438 #endif | |
30439 } | |
30440 #else | |
30441 *type = tstate->curexc_type; | |
30442 *value = tstate->curexc_value; | |
30443 *tb = tstate->curexc_traceback; | |
30444 tstate->curexc_type = 0; | |
30445 tstate->curexc_value = 0; | |
30446 tstate->curexc_traceback = 0; | |
30447 #endif | |
30448 } | |
30449 #endif | |
30450 | |
30451 /* PyObjectGetAttrStr */ | |
30452 #if CYTHON_USE_TYPE_SLOTS | |
30453 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { | |
30454 PyTypeObject* tp = Py_TYPE(obj); | |
30455 if (likely(tp->tp_getattro)) | |
30456 return tp->tp_getattro(obj, attr_name); | |
30457 #if PY_MAJOR_VERSION < 3 | |
30458 if (likely(tp->tp_getattr)) | |
30459 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); | |
30460 #endif | |
30461 return PyObject_GetAttr(obj, attr_name); | |
30462 } | |
30463 #endif | |
30464 | |
30465 /* PyObjectGetAttrStrNoError */ | |
30466 #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 | |
30467 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { | |
30468 __Pyx_PyThreadState_declare | |
30469 __Pyx_PyThreadState_assign | |
30470 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) | |
30471 __Pyx_PyErr_Clear(); | |
30472 } | |
30473 #endif | |
30474 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { | |
30475 PyObject *result; | |
30476 #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 | |
30477 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); | |
30478 return result; | |
30479 #else | |
30480 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 | |
30481 PyTypeObject* tp = Py_TYPE(obj); | |
30482 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { | |
30483 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); | |
30484 } | |
30485 #endif | |
30486 result = __Pyx_PyObject_GetAttrStr(obj, attr_name); | |
30487 if (unlikely(!result)) { | |
30488 __Pyx_PyObject_GetAttrStr_ClearAttributeError(); | |
30489 } | |
30490 return result; | |
30491 #endif | |
30492 } | |
30493 | |
30494 /* GetBuiltinName */ | |
30495 static PyObject *__Pyx_GetBuiltinName(PyObject *name) { | |
30496 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); | |
30497 if (unlikely(!result) && !PyErr_Occurred()) { | |
30498 PyErr_Format(PyExc_NameError, | |
30499 #if PY_MAJOR_VERSION >= 3 | |
30500 "name '%U' is not defined", name); | |
30501 #else | |
30502 "name '%.200s' is not defined", PyString_AS_STRING(name)); | |
30503 #endif | |
30504 } | |
30505 return result; | |
30506 } | |
30507 | |
30508 /* TupleAndListFromArray */ | |
30509 #if CYTHON_COMPILING_IN_CPYTHON | |
30510 static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { | |
30511 PyObject *v; | |
30512 Py_ssize_t i; | |
30513 for (i = 0; i < length; i++) { | |
30514 v = dest[i] = src[i]; | |
30515 Py_INCREF(v); | |
30516 } | |
30517 } | |
30518 static CYTHON_INLINE PyObject * | |
30519 __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) | |
30520 { | |
30521 PyObject *res; | |
30522 if (n <= 0) { | |
30523 Py_INCREF(__pyx_empty_tuple); | |
30524 return __pyx_empty_tuple; | |
30525 } | |
30526 res = PyTuple_New(n); | |
30527 if (unlikely(res == NULL)) return NULL; | |
30528 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); | |
30529 return res; | |
30530 } | |
30531 static CYTHON_INLINE PyObject * | |
30532 __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) | |
30533 { | |
30534 PyObject *res; | |
30535 if (n <= 0) { | |
30536 return PyList_New(0); | |
30537 } | |
30538 res = PyList_New(n); | |
30539 if (unlikely(res == NULL)) return NULL; | |
30540 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); | |
30541 return res; | |
30542 } | |
30543 #endif | |
30544 | |
30545 /* BytesEquals */ | |
30546 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { | |
30547 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API | |
30548 return PyObject_RichCompareBool(s1, s2, equals); | |
30549 #else | |
30550 if (s1 == s2) { | |
30551 return (equals == Py_EQ); | |
30552 } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { | |
30553 const char *ps1, *ps2; | |
30554 Py_ssize_t length = PyBytes_GET_SIZE(s1); | |
30555 if (length != PyBytes_GET_SIZE(s2)) | |
30556 return (equals == Py_NE); | |
30557 ps1 = PyBytes_AS_STRING(s1); | |
30558 ps2 = PyBytes_AS_STRING(s2); | |
30559 if (ps1[0] != ps2[0]) { | |
30560 return (equals == Py_NE); | |
30561 } else if (length == 1) { | |
30562 return (equals == Py_EQ); | |
30563 } else { | |
30564 int result; | |
30565 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) | |
30566 Py_hash_t hash1, hash2; | |
30567 hash1 = ((PyBytesObject*)s1)->ob_shash; | |
30568 hash2 = ((PyBytesObject*)s2)->ob_shash; | |
30569 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { | |
30570 return (equals == Py_NE); | |
30571 } | |
30572 #endif | |
30573 result = memcmp(ps1, ps2, (size_t)length); | |
30574 return (equals == Py_EQ) ? (result == 0) : (result != 0); | |
30575 } | |
30576 } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { | |
30577 return (equals == Py_NE); | |
30578 } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { | |
30579 return (equals == Py_NE); | |
30580 } else { | |
30581 int result; | |
30582 PyObject* py_result = PyObject_RichCompare(s1, s2, equals); | |
30583 if (!py_result) | |
30584 return -1; | |
30585 result = __Pyx_PyObject_IsTrue(py_result); | |
30586 Py_DECREF(py_result); | |
30587 return result; | |
30588 } | |
30589 #endif | |
30590 } | |
30591 | |
30592 /* UnicodeEquals */ | |
30593 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { | |
30594 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API | |
30595 return PyObject_RichCompareBool(s1, s2, equals); | |
30596 #else | |
30597 #if PY_MAJOR_VERSION < 3 | |
30598 PyObject* owned_ref = NULL; | |
30599 #endif | |
30600 int s1_is_unicode, s2_is_unicode; | |
30601 if (s1 == s2) { | |
30602 goto return_eq; | |
30603 } | |
30604 s1_is_unicode = PyUnicode_CheckExact(s1); | |
30605 s2_is_unicode = PyUnicode_CheckExact(s2); | |
30606 #if PY_MAJOR_VERSION < 3 | |
30607 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { | |
30608 owned_ref = PyUnicode_FromObject(s2); | |
30609 if (unlikely(!owned_ref)) | |
30610 return -1; | |
30611 s2 = owned_ref; | |
30612 s2_is_unicode = 1; | |
30613 } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { | |
30614 owned_ref = PyUnicode_FromObject(s1); | |
30615 if (unlikely(!owned_ref)) | |
30616 return -1; | |
30617 s1 = owned_ref; | |
30618 s1_is_unicode = 1; | |
30619 } else if (((!s2_is_unicode) & (!s1_is_unicode))) { | |
30620 return __Pyx_PyBytes_Equals(s1, s2, equals); | |
30621 } | |
30622 #endif | |
30623 if (s1_is_unicode & s2_is_unicode) { | |
30624 Py_ssize_t length; | |
30625 int kind; | |
30626 void *data1, *data2; | |
30627 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) | |
30628 return -1; | |
30629 length = __Pyx_PyUnicode_GET_LENGTH(s1); | |
30630 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { | |
30631 goto return_ne; | |
30632 } | |
30633 #if CYTHON_USE_UNICODE_INTERNALS | |
30634 { | |
30635 Py_hash_t hash1, hash2; | |
30636 #if CYTHON_PEP393_ENABLED | |
30637 hash1 = ((PyASCIIObject*)s1)->hash; | |
30638 hash2 = ((PyASCIIObject*)s2)->hash; | |
30639 #else | |
30640 hash1 = ((PyUnicodeObject*)s1)->hash; | |
30641 hash2 = ((PyUnicodeObject*)s2)->hash; | |
30642 #endif | |
30643 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { | |
30644 goto return_ne; | |
30645 } | |
30646 } | |
30647 #endif | |
30648 kind = __Pyx_PyUnicode_KIND(s1); | |
30649 if (kind != __Pyx_PyUnicode_KIND(s2)) { | |
30650 goto return_ne; | |
30651 } | |
30652 data1 = __Pyx_PyUnicode_DATA(s1); | |
30653 data2 = __Pyx_PyUnicode_DATA(s2); | |
30654 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { | |
30655 goto return_ne; | |
30656 } else if (length == 1) { | |
30657 goto return_eq; | |
30658 } else { | |
30659 int result = memcmp(data1, data2, (size_t)(length * kind)); | |
30660 #if PY_MAJOR_VERSION < 3 | |
30661 Py_XDECREF(owned_ref); | |
30662 #endif | |
30663 return (equals == Py_EQ) ? (result == 0) : (result != 0); | |
30664 } | |
30665 } else if ((s1 == Py_None) & s2_is_unicode) { | |
30666 goto return_ne; | |
30667 } else if ((s2 == Py_None) & s1_is_unicode) { | |
30668 goto return_ne; | |
30669 } else { | |
30670 int result; | |
30671 PyObject* py_result = PyObject_RichCompare(s1, s2, equals); | |
30672 #if PY_MAJOR_VERSION < 3 | |
30673 Py_XDECREF(owned_ref); | |
30674 #endif | |
30675 if (!py_result) | |
30676 return -1; | |
30677 result = __Pyx_PyObject_IsTrue(py_result); | |
30678 Py_DECREF(py_result); | |
30679 return result; | |
30680 } | |
30681 return_eq: | |
30682 #if PY_MAJOR_VERSION < 3 | |
30683 Py_XDECREF(owned_ref); | |
30684 #endif | |
30685 return (equals == Py_EQ); | |
30686 return_ne: | |
30687 #if PY_MAJOR_VERSION < 3 | |
30688 Py_XDECREF(owned_ref); | |
30689 #endif | |
30690 return (equals == Py_NE); | |
30691 #endif | |
30692 } | |
30693 | |
30694 /* fastcall */ | |
30695 #if CYTHON_METH_FASTCALL | |
30696 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) | |
30697 { | |
30698 Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); | |
30699 for (i = 0; i < n; i++) | |
30700 { | |
30701 if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; | |
30702 } | |
30703 for (i = 0; i < n; i++) | |
30704 { | |
30705 int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); | |
30706 if (unlikely(eq != 0)) { | |
30707 if (unlikely(eq < 0)) return NULL; | |
30708 return kwvalues[i]; | |
30709 } | |
30710 } | |
30711 return NULL; | |
30712 } | |
30713 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 | |
30714 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { | |
30715 Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); | |
30716 PyObject *dict; | |
30717 dict = PyDict_New(); | |
30718 if (unlikely(!dict)) | |
30719 return NULL; | |
30720 for (i=0; i<nkwargs; i++) { | |
30721 PyObject *key = PyTuple_GET_ITEM(kwnames, i); | |
30722 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0)) | |
30723 goto bad; | |
30724 } | |
30725 return dict; | |
30726 bad: | |
30727 Py_DECREF(dict); | |
30728 return NULL; | |
30729 } | |
30730 #endif | |
30731 #endif | |
30732 | |
30733 /* RaiseDoubleKeywords */ | |
30734 static void __Pyx_RaiseDoubleKeywordsError( | |
30735 const char* func_name, | |
30736 PyObject* kw_name) | |
30737 { | |
30738 PyErr_Format(PyExc_TypeError, | |
30739 #if PY_MAJOR_VERSION >= 3 | |
30740 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); | |
30741 #else | |
30742 "%s() got multiple values for keyword argument '%s'", func_name, | |
30743 PyString_AsString(kw_name)); | |
30744 #endif | |
30745 } | |
30746 | |
30747 /* ParseKeywords */ | |
30748 static int __Pyx_ParseOptionalKeywords( | |
30749 PyObject *kwds, | |
30750 PyObject *const *kwvalues, | |
30751 PyObject **argnames[], | |
30752 PyObject *kwds2, | |
30753 PyObject *values[], | |
30754 Py_ssize_t num_pos_args, | |
30755 const char* function_name) | |
30756 { | |
30757 PyObject *key = 0, *value = 0; | |
30758 Py_ssize_t pos = 0; | |
30759 PyObject*** name; | |
30760 PyObject*** first_kw_arg = argnames + num_pos_args; | |
30761 int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); | |
30762 while (1) { | |
30763 Py_XDECREF(key); key = NULL; | |
30764 Py_XDECREF(value); value = NULL; | |
30765 if (kwds_is_tuple) { | |
30766 Py_ssize_t size; | |
30767 #if CYTHON_ASSUME_SAFE_MACROS | |
30768 size = PyTuple_GET_SIZE(kwds); | |
30769 #else | |
30770 size = PyTuple_Size(kwds); | |
30771 if (size < 0) goto bad; | |
30772 #endif | |
30773 if (pos >= size) break; | |
30774 #if CYTHON_AVOID_BORROWED_REFS | |
30775 key = __Pyx_PySequence_ITEM(kwds, pos); | |
30776 if (!key) goto bad; | |
30777 #elif CYTHON_ASSUME_SAFE_MACROS | |
30778 key = PyTuple_GET_ITEM(kwds, pos); | |
30779 #else | |
30780 key = PyTuple_GetItem(kwds, pos); | |
30781 if (!key) goto bad; | |
30782 #endif | |
30783 value = kwvalues[pos]; | |
30784 pos++; | |
30785 } | |
30786 else | |
30787 { | |
30788 if (!PyDict_Next(kwds, &pos, &key, &value)) break; | |
30789 #if CYTHON_AVOID_BORROWED_REFS | |
30790 Py_INCREF(key); | |
30791 #endif | |
30792 } | |
30793 name = first_kw_arg; | |
30794 while (*name && (**name != key)) name++; | |
30795 if (*name) { | |
30796 values[name-argnames] = value; | |
30797 #if CYTHON_AVOID_BORROWED_REFS | |
30798 Py_INCREF(value); | |
30799 Py_DECREF(key); | |
30800 #endif | |
30801 key = NULL; | |
30802 value = NULL; | |
30803 continue; | |
30804 } | |
30805 #if !CYTHON_AVOID_BORROWED_REFS | |
30806 Py_INCREF(key); | |
30807 #endif | |
30808 Py_INCREF(value); | |
30809 name = first_kw_arg; | |
30810 #if PY_MAJOR_VERSION < 3 | |
30811 if (likely(PyString_Check(key))) { | |
30812 while (*name) { | |
30813 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) | |
30814 && _PyString_Eq(**name, key)) { | |
30815 values[name-argnames] = value; | |
30816 #if CYTHON_AVOID_BORROWED_REFS | |
30817 value = NULL; | |
30818 #endif | |
30819 break; | |
30820 } | |
30821 name++; | |
30822 } | |
30823 if (*name) continue; | |
30824 else { | |
30825 PyObject*** argname = argnames; | |
30826 while (argname != first_kw_arg) { | |
30827 if ((**argname == key) || ( | |
30828 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) | |
30829 && _PyString_Eq(**argname, key))) { | |
30830 goto arg_passed_twice; | |
30831 } | |
30832 argname++; | |
30833 } | |
30834 } | |
30835 } else | |
30836 #endif | |
30837 if (likely(PyUnicode_Check(key))) { | |
30838 while (*name) { | |
30839 int cmp = ( | |
30840 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 | |
30841 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : | |
30842 #endif | |
30843 PyUnicode_Compare(**name, key) | |
30844 ); | |
30845 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; | |
30846 if (cmp == 0) { | |
30847 values[name-argnames] = value; | |
30848 #if CYTHON_AVOID_BORROWED_REFS | |
30849 value = NULL; | |
30850 #endif | |
30851 break; | |
30852 } | |
30853 name++; | |
30854 } | |
30855 if (*name) continue; | |
30856 else { | |
30857 PyObject*** argname = argnames; | |
30858 while (argname != first_kw_arg) { | |
30859 int cmp = (**argname == key) ? 0 : | |
30860 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 | |
30861 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : | |
30862 #endif | |
30863 PyUnicode_Compare(**argname, key); | |
30864 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; | |
30865 if (cmp == 0) goto arg_passed_twice; | |
30866 argname++; | |
30867 } | |
30868 } | |
30869 } else | |
30870 goto invalid_keyword_type; | |
30871 if (kwds2) { | |
30872 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; | |
30873 } else { | |
30874 goto invalid_keyword; | |
30875 } | |
30876 } | |
30877 Py_XDECREF(key); | |
30878 Py_XDECREF(value); | |
30879 return 0; | |
30880 arg_passed_twice: | |
30881 __Pyx_RaiseDoubleKeywordsError(function_name, key); | |
30882 goto bad; | |
30883 invalid_keyword_type: | |
30884 PyErr_Format(PyExc_TypeError, | |
30885 "%.200s() keywords must be strings", function_name); | |
30886 goto bad; | |
30887 invalid_keyword: | |
30888 #if PY_MAJOR_VERSION < 3 | |
30889 PyErr_Format(PyExc_TypeError, | |
30890 "%.200s() got an unexpected keyword argument '%.200s'", | |
30891 function_name, PyString_AsString(key)); | |
30892 #else | |
30893 PyErr_Format(PyExc_TypeError, | |
30894 "%s() got an unexpected keyword argument '%U'", | |
30895 function_name, key); | |
30896 #endif | |
30897 bad: | |
30898 Py_XDECREF(key); | |
30899 Py_XDECREF(value); | |
30900 return -1; | |
30901 } | |
30902 | |
30903 /* RaiseArgTupleInvalid */ | |
30904 static void __Pyx_RaiseArgtupleInvalid( | |
30905 const char* func_name, | |
30906 int exact, | |
30907 Py_ssize_t num_min, | |
30908 Py_ssize_t num_max, | |
30909 Py_ssize_t num_found) | |
30910 { | |
30911 Py_ssize_t num_expected; | |
30912 const char *more_or_less; | |
30913 if (num_found < num_min) { | |
30914 num_expected = num_min; | |
30915 more_or_less = "at least"; | |
30916 } else { | |
30917 num_expected = num_max; | |
30918 more_or_less = "at most"; | |
30919 } | |
30920 if (exact) { | |
30921 more_or_less = "exactly"; | |
30922 } | |
30923 PyErr_Format(PyExc_TypeError, | |
30924 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
30925 func_name, more_or_less, num_expected, | |
30926 (num_expected == 1) ? "" : "s", num_found); | |
30927 } | |
30928 | |
30929 /* Profile */ | |
30930 #if CYTHON_PROFILE | |
30931 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, | |
30932 PyFrameObject** frame, | |
30933 PyThreadState* tstate, | |
30934 const char *funcname, | |
30935 const char *srcfile, | |
30936 int firstlineno) { | |
30937 PyObject *type, *value, *traceback; | |
30938 int retval; | |
30939 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { | |
30940 if (*code == NULL) { | |
30941 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); | |
30942 if (*code == NULL) return 0; | |
30943 } | |
30944 *frame = PyFrame_New( | |
30945 tstate, /*PyThreadState *tstate*/ | |
30946 *code, /*PyCodeObject *code*/ | |
30947 __pyx_d, /*PyObject *globals*/ | |
30948 0 /*PyObject *locals*/ | |
30949 ); | |
30950 if (*frame == NULL) return 0; | |
30951 if (CYTHON_TRACE && (*frame)->f_trace == NULL) { | |
30952 Py_INCREF(Py_None); | |
30953 (*frame)->f_trace = Py_None; | |
30954 } | |
30955 #if PY_VERSION_HEX < 0x030400B1 | |
30956 } else { | |
30957 (*frame)->f_tstate = tstate; | |
30958 #endif | |
30959 } | |
30960 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); | |
30961 retval = 1; | |
30962 __Pyx_EnterTracing(tstate); | |
30963 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); | |
30964 #if CYTHON_TRACE | |
30965 if (tstate->c_tracefunc) | |
30966 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; | |
30967 if (retval && tstate->c_profilefunc) | |
30968 #endif | |
30969 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; | |
30970 __Pyx_LeaveTracing(tstate); | |
30971 if (retval) { | |
30972 __Pyx_ErrRestoreInState(tstate, type, value, traceback); | |
30973 return __Pyx_IsTracing(tstate, 0, 0) && retval; | |
30974 } else { | |
30975 Py_XDECREF(type); | |
30976 Py_XDECREF(value); | |
30977 Py_XDECREF(traceback); | |
30978 return -1; | |
30979 } | |
30980 } | |
30981 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { | |
30982 PyCodeObject *py_code = 0; | |
30983 #if PY_MAJOR_VERSION >= 3 | |
30984 py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); | |
30985 if (likely(py_code)) { | |
30986 py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; | |
30987 } | |
30988 #else | |
30989 PyObject *py_srcfile = 0; | |
30990 PyObject *py_funcname = 0; | |
30991 py_funcname = PyString_FromString(funcname); | |
30992 if (unlikely(!py_funcname)) goto bad; | |
30993 py_srcfile = PyString_FromString(srcfile); | |
30994 if (unlikely(!py_srcfile)) goto bad; | |
30995 py_code = PyCode_New( | |
30996 0, | |
30997 0, | |
30998 0, | |
30999 CO_OPTIMIZED | CO_NEWLOCALS, | |
31000 __pyx_empty_bytes, /*PyObject *code,*/ | |
31001 __pyx_empty_tuple, /*PyObject *consts,*/ | |
31002 __pyx_empty_tuple, /*PyObject *names,*/ | |
31003 __pyx_empty_tuple, /*PyObject *varnames,*/ | |
31004 __pyx_empty_tuple, /*PyObject *freevars,*/ | |
31005 __pyx_empty_tuple, /*PyObject *cellvars,*/ | |
31006 py_srcfile, /*PyObject *filename,*/ | |
31007 py_funcname, /*PyObject *name,*/ | |
31008 firstlineno, | |
31009 __pyx_empty_bytes /*PyObject *lnotab*/ | |
31010 ); | |
31011 bad: | |
31012 Py_XDECREF(py_srcfile); | |
31013 Py_XDECREF(py_funcname); | |
31014 #endif | |
31015 return py_code; | |
31016 } | |
31017 #endif | |
31018 | |
31019 /* KeywordStringCheck */ | |
31020 static int __Pyx_CheckKeywordStrings( | |
31021 PyObject *kw, | |
31022 const char* function_name, | |
31023 int kw_allowed) | |
31024 { | |
31025 PyObject* key = 0; | |
31026 Py_ssize_t pos = 0; | |
31027 #if CYTHON_COMPILING_IN_PYPY | |
31028 if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) | |
31029 goto invalid_keyword; | |
31030 return 1; | |
31031 #else | |
31032 if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { | |
31033 Py_ssize_t kwsize; | |
31034 #if CYTHON_ASSUME_SAFE_MACROS | |
31035 kwsize = PyTuple_GET_SIZE(kw); | |
31036 #else | |
31037 kwsize = PyTuple_Size(kw); | |
31038 if (kwsize < 0) return 0; | |
31039 #endif | |
31040 if (unlikely(kwsize == 0)) | |
31041 return 1; | |
31042 if (!kw_allowed) { | |
31043 #if CYTHON_ASSUME_SAFE_MACROS | |
31044 key = PyTuple_GET_ITEM(kw, 0); | |
31045 #else | |
31046 key = PyTuple_GetItem(kw, pos); | |
31047 if (!key) return 0; | |
31048 #endif | |
31049 goto invalid_keyword; | |
31050 } | |
31051 #if PY_VERSION_HEX < 0x03090000 | |
31052 for (pos = 0; pos < kwsize; pos++) { | |
31053 #if CYTHON_ASSUME_SAFE_MACROS | |
31054 key = PyTuple_GET_ITEM(kw, pos); | |
31055 #else | |
31056 key = PyTuple_GetItem(kw, pos); | |
31057 if (!key) return 0; | |
31058 #endif | |
31059 if (unlikely(!PyUnicode_Check(key))) | |
31060 goto invalid_keyword_type; | |
31061 } | |
31062 #endif | |
31063 return 1; | |
31064 } | |
31065 while (PyDict_Next(kw, &pos, &key, 0)) { | |
31066 #if PY_MAJOR_VERSION < 3 | |
31067 if (unlikely(!PyString_Check(key))) | |
31068 #endif | |
31069 if (unlikely(!PyUnicode_Check(key))) | |
31070 goto invalid_keyword_type; | |
31071 } | |
31072 if (!kw_allowed && unlikely(key)) | |
31073 goto invalid_keyword; | |
31074 return 1; | |
31075 invalid_keyword_type: | |
31076 PyErr_Format(PyExc_TypeError, | |
31077 "%.200s() keywords must be strings", function_name); | |
31078 return 0; | |
31079 #endif | |
31080 invalid_keyword: | |
31081 #if PY_MAJOR_VERSION < 3 | |
31082 PyErr_Format(PyExc_TypeError, | |
31083 "%.200s() got an unexpected keyword argument '%.200s'", | |
31084 function_name, PyString_AsString(key)); | |
31085 #else | |
31086 PyErr_Format(PyExc_TypeError, | |
31087 "%s() got an unexpected keyword argument '%U'", | |
31088 function_name, key); | |
31089 #endif | |
31090 return 0; | |
31091 } | |
31092 | |
31093 /* PyFunctionFastCall */ | |
31094 #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL | |
31095 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, | |
31096 PyObject *globals) { | |
31097 PyFrameObject *f; | |
31098 PyThreadState *tstate = __Pyx_PyThreadState_Current; | |
31099 PyObject **fastlocals; | |
31100 Py_ssize_t i; | |
31101 PyObject *result; | |
31102 assert(globals != NULL); | |
31103 /* XXX Perhaps we should create a specialized | |
31104 PyFrame_New() that doesn't take locals, but does | |
31105 take builtins without sanity checking them. | |
31106 */ | |
31107 assert(tstate != NULL); | |
31108 f = PyFrame_New(tstate, co, globals, NULL); | |
31109 if (f == NULL) { | |
31110 return NULL; | |
31111 } | |
31112 fastlocals = __Pyx_PyFrame_GetLocalsplus(f); | |
31113 for (i = 0; i < na; i++) { | |
31114 Py_INCREF(*args); | |
31115 fastlocals[i] = *args++; | |
31116 } | |
31117 result = PyEval_EvalFrameEx(f,0); | |
31118 ++tstate->recursion_depth; | |
31119 Py_DECREF(f); | |
31120 --tstate->recursion_depth; | |
31121 return result; | |
31122 } | |
31123 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { | |
31124 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); | |
31125 PyObject *globals = PyFunction_GET_GLOBALS(func); | |
31126 PyObject *argdefs = PyFunction_GET_DEFAULTS(func); | |
31127 PyObject *closure; | |
31128 #if PY_MAJOR_VERSION >= 3 | |
31129 PyObject *kwdefs; | |
31130 #endif | |
31131 PyObject *kwtuple, **k; | |
31132 PyObject **d; | |
31133 Py_ssize_t nd; | |
31134 Py_ssize_t nk; | |
31135 PyObject *result; | |
31136 assert(kwargs == NULL || PyDict_Check(kwargs)); | |
31137 nk = kwargs ? PyDict_Size(kwargs) : 0; | |
31138 #if PY_MAJOR_VERSION < 3 | |
31139 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { | |
31140 return NULL; | |
31141 } | |
31142 #else | |
31143 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { | |
31144 return NULL; | |
31145 } | |
31146 #endif | |
31147 if ( | |
31148 #if PY_MAJOR_VERSION >= 3 | |
31149 co->co_kwonlyargcount == 0 && | |
31150 #endif | |
31151 likely(kwargs == NULL || nk == 0) && | |
31152 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { | |
31153 if (argdefs == NULL && co->co_argcount == nargs) { | |
31154 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); | |
31155 goto done; | |
31156 } | |
31157 else if (nargs == 0 && argdefs != NULL | |
31158 && co->co_argcount == Py_SIZE(argdefs)) { | |
31159 /* function called with no arguments, but all parameters have | |
31160 a default value: use default values as arguments .*/ | |
31161 args = &PyTuple_GET_ITEM(argdefs, 0); | |
31162 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); | |
31163 goto done; | |
31164 } | |
31165 } | |
31166 if (kwargs != NULL) { | |
31167 Py_ssize_t pos, i; | |
31168 kwtuple = PyTuple_New(2 * nk); | |
31169 if (kwtuple == NULL) { | |
31170 result = NULL; | |
31171 goto done; | |
31172 } | |
31173 k = &PyTuple_GET_ITEM(kwtuple, 0); | |
31174 pos = i = 0; | |
31175 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { | |
31176 Py_INCREF(k[i]); | |
31177 Py_INCREF(k[i+1]); | |
31178 i += 2; | |
31179 } | |
31180 nk = i / 2; | |
31181 } | |
31182 else { | |
31183 kwtuple = NULL; | |
31184 k = NULL; | |
31185 } | |
31186 closure = PyFunction_GET_CLOSURE(func); | |
31187 #if PY_MAJOR_VERSION >= 3 | |
31188 kwdefs = PyFunction_GET_KW_DEFAULTS(func); | |
31189 #endif | |
31190 if (argdefs != NULL) { | |
31191 d = &PyTuple_GET_ITEM(argdefs, 0); | |
31192 nd = Py_SIZE(argdefs); | |
31193 } | |
31194 else { | |
31195 d = NULL; | |
31196 nd = 0; | |
31197 } | |
31198 #if PY_MAJOR_VERSION >= 3 | |
31199 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, | |
31200 args, (int)nargs, | |
31201 k, (int)nk, | |
31202 d, (int)nd, kwdefs, closure); | |
31203 #else | |
31204 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, | |
31205 args, (int)nargs, | |
31206 k, (int)nk, | |
31207 d, (int)nd, closure); | |
31208 #endif | |
31209 Py_XDECREF(kwtuple); | |
31210 done: | |
31211 Py_LeaveRecursiveCall(); | |
31212 return result; | |
31213 } | |
31214 #endif | |
31215 | |
31216 /* PyObjectCall */ | |
31217 #if CYTHON_COMPILING_IN_CPYTHON | |
31218 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { | |
31219 PyObject *result; | |
31220 ternaryfunc call = Py_TYPE(func)->tp_call; | |
31221 if (unlikely(!call)) | |
31222 return PyObject_Call(func, arg, kw); | |
31223 #if PY_MAJOR_VERSION < 3 | |
31224 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) | |
31225 return NULL; | |
31226 #else | |
31227 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) | |
31228 return NULL; | |
31229 #endif | |
31230 result = (*call)(func, arg, kw); | |
31231 Py_LeaveRecursiveCall(); | |
31232 if (unlikely(!result) && unlikely(!PyErr_Occurred())) { | |
31233 PyErr_SetString( | |
31234 PyExc_SystemError, | |
31235 "NULL result without error in PyObject_Call"); | |
31236 } | |
31237 return result; | |
31238 } | |
31239 #endif | |
31240 | |
31241 /* PyObjectCallMethO */ | |
31242 #if CYTHON_COMPILING_IN_CPYTHON | |
31243 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { | |
31244 PyObject *self, *result; | |
31245 PyCFunction cfunc; | |
31246 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); | |
31247 self = __Pyx_CyOrPyCFunction_GET_SELF(func); | |
31248 #if PY_MAJOR_VERSION < 3 | |
31249 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) | |
31250 return NULL; | |
31251 #else | |
31252 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) | |
31253 return NULL; | |
31254 #endif | |
31255 result = cfunc(self, arg); | |
31256 Py_LeaveRecursiveCall(); | |
31257 if (unlikely(!result) && unlikely(!PyErr_Occurred())) { | |
31258 PyErr_SetString( | |
31259 PyExc_SystemError, | |
31260 "NULL result without error in PyObject_Call"); | |
31261 } | |
31262 return result; | |
31263 } | |
31264 #endif | |
31265 | |
31266 /* PyObjectFastCall */ | |
31267 #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API | |
31268 static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { | |
31269 PyObject *argstuple; | |
31270 PyObject *result = 0; | |
31271 size_t i; | |
31272 argstuple = PyTuple_New((Py_ssize_t)nargs); | |
31273 if (unlikely(!argstuple)) return NULL; | |
31274 for (i = 0; i < nargs; i++) { | |
31275 Py_INCREF(args[i]); | |
31276 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; | |
31277 } | |
31278 result = __Pyx_PyObject_Call(func, argstuple, kwargs); | |
31279 bad: | |
31280 Py_DECREF(argstuple); | |
31281 return result; | |
31282 } | |
31283 #endif | |
31284 static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { | |
31285 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); | |
31286 #if CYTHON_COMPILING_IN_CPYTHON | |
31287 if (nargs == 0 && kwargs == NULL) { | |
31288 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) | |
31289 return __Pyx_PyObject_CallMethO(func, NULL); | |
31290 } | |
31291 else if (nargs == 1 && kwargs == NULL) { | |
31292 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) | |
31293 return __Pyx_PyObject_CallMethO(func, args[0]); | |
31294 } | |
31295 #endif | |
31296 #if PY_VERSION_HEX < 0x030800B1 | |
31297 #if CYTHON_FAST_PYCCALL | |
31298 if (PyCFunction_Check(func)) { | |
31299 if (kwargs) { | |
31300 return _PyCFunction_FastCallDict(func, args, nargs, kwargs); | |
31301 } else { | |
31302 return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); | |
31303 } | |
31304 } | |
31305 #if PY_VERSION_HEX >= 0x030700A1 | |
31306 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { | |
31307 return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); | |
31308 } | |
31309 #endif | |
31310 #endif | |
31311 #if CYTHON_FAST_PYCALL | |
31312 if (PyFunction_Check(func)) { | |
31313 return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); | |
31314 } | |
31315 #endif | |
31316 #endif | |
31317 if (kwargs == NULL) { | |
31318 #if CYTHON_VECTORCALL | |
31319 #if PY_VERSION_HEX < 0x03090000 | |
31320 vectorcallfunc f = _PyVectorcall_Function(func); | |
31321 #else | |
31322 vectorcallfunc f = PyVectorcall_Function(func); | |
31323 #endif | |
31324 if (f) { | |
31325 return f(func, args, (size_t)nargs, NULL); | |
31326 } | |
31327 #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL | |
31328 if (__Pyx_CyFunction_CheckExact(func)) { | |
31329 __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); | |
31330 if (f) return f(func, args, (size_t)nargs, NULL); | |
31331 } | |
31332 #endif | |
31333 } | |
31334 if (nargs == 0) { | |
31335 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); | |
31336 } | |
31337 #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API | |
31338 return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); | |
31339 #else | |
31340 return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); | |
31341 #endif | |
31342 } | |
31343 | |
31344 /* PyObjectCallOneArg */ | |
31345 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { | |
31346 PyObject *args[2] = {NULL, arg}; | |
31347 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); | |
31348 } | |
31349 | |
31350 /* RaiseException */ | |
31351 #if PY_MAJOR_VERSION < 3 | |
31352 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { | |
31353 __Pyx_PyThreadState_declare | |
31354 CYTHON_UNUSED_VAR(cause); | |
31355 Py_XINCREF(type); | |
31356 if (!value || value == Py_None) | |
31357 value = NULL; | |
31358 else | |
31359 Py_INCREF(value); | |
31360 if (!tb || tb == Py_None) | |
31361 tb = NULL; | |
31362 else { | |
31363 Py_INCREF(tb); | |
31364 if (!PyTraceBack_Check(tb)) { | |
31365 PyErr_SetString(PyExc_TypeError, | |
31366 "raise: arg 3 must be a traceback or None"); | |
31367 goto raise_error; | |
31368 } | |
31369 } | |
31370 if (PyType_Check(type)) { | |
31371 #if CYTHON_COMPILING_IN_PYPY | |
31372 if (!value) { | |
31373 Py_INCREF(Py_None); | |
31374 value = Py_None; | |
31375 } | |
31376 #endif | |
31377 PyErr_NormalizeException(&type, &value, &tb); | |
31378 } else { | |
31379 if (value) { | |
31380 PyErr_SetString(PyExc_TypeError, | |
31381 "instance exception may not have a separate value"); | |
31382 goto raise_error; | |
31383 } | |
31384 value = type; | |
31385 type = (PyObject*) Py_TYPE(type); | |
31386 Py_INCREF(type); | |
31387 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { | |
31388 PyErr_SetString(PyExc_TypeError, | |
31389 "raise: exception class must be a subclass of BaseException"); | |
31390 goto raise_error; | |
31391 } | |
31392 } | |
31393 __Pyx_PyThreadState_assign | |
31394 __Pyx_ErrRestore(type, value, tb); | |
31395 return; | |
31396 raise_error: | |
31397 Py_XDECREF(value); | |
31398 Py_XDECREF(type); | |
31399 Py_XDECREF(tb); | |
31400 return; | |
31401 } | |
31402 #else | |
31403 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { | |
31404 PyObject* owned_instance = NULL; | |
31405 if (tb == Py_None) { | |
31406 tb = 0; | |
31407 } else if (tb && !PyTraceBack_Check(tb)) { | |
31408 PyErr_SetString(PyExc_TypeError, | |
31409 "raise: arg 3 must be a traceback or None"); | |
31410 goto bad; | |
31411 } | |
31412 if (value == Py_None) | |
31413 value = 0; | |
31414 if (PyExceptionInstance_Check(type)) { | |
31415 if (value) { | |
31416 PyErr_SetString(PyExc_TypeError, | |
31417 "instance exception may not have a separate value"); | |
31418 goto bad; | |
31419 } | |
31420 value = type; | |
31421 type = (PyObject*) Py_TYPE(value); | |
31422 } else if (PyExceptionClass_Check(type)) { | |
31423 PyObject *instance_class = NULL; | |
31424 if (value && PyExceptionInstance_Check(value)) { | |
31425 instance_class = (PyObject*) Py_TYPE(value); | |
31426 if (instance_class != type) { | |
31427 int is_subclass = PyObject_IsSubclass(instance_class, type); | |
31428 if (!is_subclass) { | |
31429 instance_class = NULL; | |
31430 } else if (unlikely(is_subclass == -1)) { | |
31431 goto bad; | |
31432 } else { | |
31433 type = instance_class; | |
31434 } | |
31435 } | |
31436 } | |
31437 if (!instance_class) { | |
31438 PyObject *args; | |
31439 if (!value) | |
31440 args = PyTuple_New(0); | |
31441 else if (PyTuple_Check(value)) { | |
31442 Py_INCREF(value); | |
31443 args = value; | |
31444 } else | |
31445 args = PyTuple_Pack(1, value); | |
31446 if (!args) | |
31447 goto bad; | |
31448 owned_instance = PyObject_Call(type, args, NULL); | |
31449 Py_DECREF(args); | |
31450 if (!owned_instance) | |
31451 goto bad; | |
31452 value = owned_instance; | |
31453 if (!PyExceptionInstance_Check(value)) { | |
31454 PyErr_Format(PyExc_TypeError, | |
31455 "calling %R should have returned an instance of " | |
31456 "BaseException, not %R", | |
31457 type, Py_TYPE(value)); | |
31458 goto bad; | |
31459 } | |
31460 } | |
31461 } else { | |
31462 PyErr_SetString(PyExc_TypeError, | |
31463 "raise: exception class must be a subclass of BaseException"); | |
31464 goto bad; | |
31465 } | |
31466 if (cause) { | |
31467 PyObject *fixed_cause; | |
31468 if (cause == Py_None) { | |
31469 fixed_cause = NULL; | |
31470 } else if (PyExceptionClass_Check(cause)) { | |
31471 fixed_cause = PyObject_CallObject(cause, NULL); | |
31472 if (fixed_cause == NULL) | |
31473 goto bad; | |
31474 } else if (PyExceptionInstance_Check(cause)) { | |
31475 fixed_cause = cause; | |
31476 Py_INCREF(fixed_cause); | |
31477 } else { | |
31478 PyErr_SetString(PyExc_TypeError, | |
31479 "exception causes must derive from " | |
31480 "BaseException"); | |
31481 goto bad; | |
31482 } | |
31483 PyException_SetCause(value, fixed_cause); | |
31484 } | |
31485 PyErr_SetObject(type, value); | |
31486 if (tb) { | |
31487 #if PY_VERSION_HEX >= 0x030C00A6 | |
31488 PyException_SetTraceback(value, tb); | |
31489 #elif CYTHON_FAST_THREAD_STATE | |
31490 PyThreadState *tstate = __Pyx_PyThreadState_Current; | |
31491 PyObject* tmp_tb = tstate->curexc_traceback; | |
31492 if (tb != tmp_tb) { | |
31493 Py_INCREF(tb); | |
31494 tstate->curexc_traceback = tb; | |
31495 Py_XDECREF(tmp_tb); | |
31496 } | |
31497 #else | |
31498 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
31499 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); | |
31500 Py_INCREF(tb); | |
31501 PyErr_Restore(tmp_type, tmp_value, tb); | |
31502 Py_XDECREF(tmp_tb); | |
31503 #endif | |
31504 } | |
31505 bad: | |
31506 Py_XDECREF(owned_instance); | |
31507 return; | |
31508 } | |
31509 #endif | |
31510 | |
31511 /* GetAttr3 */ | |
31512 #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 | |
31513 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { | |
31514 __Pyx_PyThreadState_declare | |
31515 __Pyx_PyThreadState_assign | |
31516 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) | |
31517 return NULL; | |
31518 __Pyx_PyErr_Clear(); | |
31519 Py_INCREF(d); | |
31520 return d; | |
31521 } | |
31522 #endif | |
31523 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { | |
31524 PyObject *r; | |
31525 #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 | |
31526 int res = PyObject_GetOptionalAttr(o, n, &r); | |
31527 return (res != 0) ? r : __Pyx_NewRef(d); | |
31528 #else | |
31529 #if CYTHON_USE_TYPE_SLOTS | |
31530 if (likely(PyString_Check(n))) { | |
31531 r = __Pyx_PyObject_GetAttrStrNoError(o, n); | |
31532 if (unlikely(!r) && likely(!PyErr_Occurred())) { | |
31533 r = __Pyx_NewRef(d); | |
31534 } | |
31535 return r; | |
31536 } | |
31537 #endif | |
31538 r = PyObject_GetAttr(o, n); | |
31539 return (likely(r)) ? r : __Pyx_GetAttr3Default(d); | |
31540 #endif | |
31541 } | |
31542 | |
31543 /* PyDictVersioning */ | |
31544 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS | |
31545 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { | |
31546 PyObject *dict = Py_TYPE(obj)->tp_dict; | |
31547 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; | |
31548 } | |
31549 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { | |
31550 PyObject **dictptr = NULL; | |
31551 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; | |
31552 if (offset) { | |
31553 #if CYTHON_COMPILING_IN_CPYTHON | |
31554 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); | |
31555 #else | |
31556 dictptr = _PyObject_GetDictPtr(obj); | |
31557 #endif | |
31558 } | |
31559 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; | |
31560 } | |
31561 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { | |
31562 PyObject *dict = Py_TYPE(obj)->tp_dict; | |
31563 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) | |
31564 return 0; | |
31565 return obj_dict_version == __Pyx_get_object_dict_version(obj); | |
31566 } | |
31567 #endif | |
31568 | |
31569 /* GetModuleGlobalName */ | |
31570 #if CYTHON_USE_DICT_VERSIONS | |
31571 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) | |
31572 #else | |
31573 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) | |
31574 #endif | |
31575 { | |
31576 PyObject *result; | |
31577 #if !CYTHON_AVOID_BORROWED_REFS | |
31578 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 | |
31579 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); | |
31580 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) | |
31581 if (likely(result)) { | |
31582 return __Pyx_NewRef(result); | |
31583 } else if (unlikely(PyErr_Occurred())) { | |
31584 return NULL; | |
31585 } | |
31586 #elif CYTHON_COMPILING_IN_LIMITED_API | |
31587 if (unlikely(!__pyx_m)) { | |
31588 return NULL; | |
31589 } | |
31590 result = PyObject_GetAttr(__pyx_m, name); | |
31591 if (likely(result)) { | |
31592 return result; | |
31593 } | |
31594 #else | |
31595 result = PyDict_GetItem(__pyx_d, name); | |
31596 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) | |
31597 if (likely(result)) { | |
31598 return __Pyx_NewRef(result); | |
31599 } | |
31600 #endif | |
31601 #else | |
31602 result = PyObject_GetItem(__pyx_d, name); | |
31603 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) | |
31604 if (likely(result)) { | |
31605 return __Pyx_NewRef(result); | |
31606 } | |
31607 PyErr_Clear(); | |
31608 #endif | |
31609 return __Pyx_GetBuiltinName(name); | |
31610 } | |
31611 | |
31612 /* RaiseUnexpectedTypeError */ | |
31613 static int | |
31614 __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) | |
31615 { | |
31616 __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); | |
31617 PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, | |
31618 expected, obj_type_name); | |
31619 __Pyx_DECREF_TypeName(obj_type_name); | |
31620 return 0; | |
31621 } | |
31622 | |
31623 /* ExtTypeTest */ | |
31624 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { | |
31625 __Pyx_TypeName obj_type_name; | |
31626 __Pyx_TypeName type_name; | |
31627 if (unlikely(!type)) { | |
31628 PyErr_SetString(PyExc_SystemError, "Missing type object"); | |
31629 return 0; | |
31630 } | |
31631 if (likely(__Pyx_TypeCheck(obj, type))) | |
31632 return 1; | |
31633 obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); | |
31634 type_name = __Pyx_PyType_GetName(type); | |
31635 PyErr_Format(PyExc_TypeError, | |
31636 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, | |
31637 obj_type_name, type_name); | |
31638 __Pyx_DECREF_TypeName(obj_type_name); | |
31639 __Pyx_DECREF_TypeName(type_name); | |
31640 return 0; | |
31641 } | |
31642 | |
31643 /* PyIntBinop */ | |
31644 #if !CYTHON_COMPILING_IN_PYPY | |
31645 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { | |
31646 CYTHON_MAYBE_UNUSED_VAR(intval); | |
31647 CYTHON_MAYBE_UNUSED_VAR(inplace); | |
31648 CYTHON_UNUSED_VAR(zerodivision_check); | |
31649 #if PY_MAJOR_VERSION < 3 | |
31650 if (likely(PyInt_CheckExact(op1))) { | |
31651 const long b = intval; | |
31652 long x; | |
31653 long a = PyInt_AS_LONG(op1); | |
31654 | |
31655 x = (long)((unsigned long)a + (unsigned long)b); | |
31656 if (likely((x^a) >= 0 || (x^b) >= 0)) | |
31657 return PyInt_FromLong(x); | |
31658 return PyLong_Type.tp_as_number->nb_add(op1, op2); | |
31659 } | |
31660 #endif | |
31661 #if CYTHON_USE_PYLONG_INTERNALS | |
31662 if (likely(PyLong_CheckExact(op1))) { | |
31663 const long b = intval; | |
31664 long a, x; | |
31665 #ifdef HAVE_LONG_LONG | |
31666 const PY_LONG_LONG llb = intval; | |
31667 PY_LONG_LONG lla, llx; | |
31668 #endif | |
31669 if (unlikely(__Pyx_PyLong_IsZero(op1))) { | |
31670 return __Pyx_NewRef(op2); | |
31671 } | |
31672 if (likely(__Pyx_PyLong_IsCompact(op1))) { | |
31673 a = __Pyx_PyLong_CompactValue(op1); | |
31674 } else { | |
31675 const digit* digits = __Pyx_PyLong_Digits(op1); | |
31676 const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); | |
31677 switch (size) { | |
31678 case -2: | |
31679 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { | |
31680 a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
31681 break; | |
31682 #ifdef HAVE_LONG_LONG | |
31683 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { | |
31684 lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
31685 goto long_long; | |
31686 #endif | |
31687 } | |
31688 CYTHON_FALLTHROUGH; | |
31689 case 2: | |
31690 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { | |
31691 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
31692 break; | |
31693 #ifdef HAVE_LONG_LONG | |
31694 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { | |
31695 lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
31696 goto long_long; | |
31697 #endif | |
31698 } | |
31699 CYTHON_FALLTHROUGH; | |
31700 case -3: | |
31701 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { | |
31702 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
31703 break; | |
31704 #ifdef HAVE_LONG_LONG | |
31705 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { | |
31706 lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
31707 goto long_long; | |
31708 #endif | |
31709 } | |
31710 CYTHON_FALLTHROUGH; | |
31711 case 3: | |
31712 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { | |
31713 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
31714 break; | |
31715 #ifdef HAVE_LONG_LONG | |
31716 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { | |
31717 lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
31718 goto long_long; | |
31719 #endif | |
31720 } | |
31721 CYTHON_FALLTHROUGH; | |
31722 case -4: | |
31723 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { | |
31724 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
31725 break; | |
31726 #ifdef HAVE_LONG_LONG | |
31727 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { | |
31728 lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
31729 goto long_long; | |
31730 #endif | |
31731 } | |
31732 CYTHON_FALLTHROUGH; | |
31733 case 4: | |
31734 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { | |
31735 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); | |
31736 break; | |
31737 #ifdef HAVE_LONG_LONG | |
31738 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { | |
31739 lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); | |
31740 goto long_long; | |
31741 #endif | |
31742 } | |
31743 CYTHON_FALLTHROUGH; | |
31744 default: return PyLong_Type.tp_as_number->nb_add(op1, op2); | |
31745 } | |
31746 } | |
31747 x = a + b; | |
31748 return PyLong_FromLong(x); | |
31749 #ifdef HAVE_LONG_LONG | |
31750 long_long: | |
31751 llx = lla + llb; | |
31752 return PyLong_FromLongLong(llx); | |
31753 #endif | |
31754 | |
31755 | |
31756 } | |
31757 #endif | |
31758 if (PyFloat_CheckExact(op1)) { | |
31759 const long b = intval; | |
31760 #if CYTHON_COMPILING_IN_LIMITED_API | |
31761 double a = __pyx_PyFloat_AsDouble(op1); | |
31762 #else | |
31763 double a = PyFloat_AS_DOUBLE(op1); | |
31764 #endif | |
31765 double result; | |
31766 | |
31767 PyFPE_START_PROTECT("add", return NULL) | |
31768 result = ((double)a) + (double)b; | |
31769 PyFPE_END_PROTECT(result) | |
31770 return PyFloat_FromDouble(result); | |
31771 } | |
31772 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); | |
31773 } | |
31774 #endif | |
31775 | |
31776 /* WriteUnraisableException */ | |
31777 static void __Pyx_WriteUnraisable(const char *name, int clineno, | |
31778 int lineno, const char *filename, | |
31779 int full_traceback, int nogil) { | |
31780 PyObject *old_exc, *old_val, *old_tb; | |
31781 PyObject *ctx; | |
31782 __Pyx_PyThreadState_declare | |
31783 #ifdef WITH_THREAD | |
31784 PyGILState_STATE state; | |
31785 if (nogil) | |
31786 state = PyGILState_Ensure(); | |
31787 else state = (PyGILState_STATE)0; | |
31788 #endif | |
31789 CYTHON_UNUSED_VAR(clineno); | |
31790 CYTHON_UNUSED_VAR(lineno); | |
31791 CYTHON_UNUSED_VAR(filename); | |
31792 CYTHON_MAYBE_UNUSED_VAR(nogil); | |
31793 __Pyx_PyThreadState_assign | |
31794 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); | |
31795 if (full_traceback) { | |
31796 Py_XINCREF(old_exc); | |
31797 Py_XINCREF(old_val); | |
31798 Py_XINCREF(old_tb); | |
31799 __Pyx_ErrRestore(old_exc, old_val, old_tb); | |
31800 PyErr_PrintEx(0); | |
31801 } | |
31802 #if PY_MAJOR_VERSION < 3 | |
31803 ctx = PyString_FromString(name); | |
31804 #else | |
31805 ctx = PyUnicode_FromString(name); | |
31806 #endif | |
31807 __Pyx_ErrRestore(old_exc, old_val, old_tb); | |
31808 if (!ctx) { | |
31809 PyErr_WriteUnraisable(Py_None); | |
31810 } else { | |
31811 PyErr_WriteUnraisable(ctx); | |
31812 Py_DECREF(ctx); | |
31813 } | |
31814 #ifdef WITH_THREAD | |
31815 if (nogil) | |
31816 PyGILState_Release(state); | |
31817 #endif | |
31818 } | |
31819 | |
31820 /* PyObjectCallNoArg */ | |
31821 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { | |
31822 PyObject *arg[2] = {NULL, NULL}; | |
31823 return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); | |
31824 } | |
31825 | |
31826 /* ArgTypeTest */ | |
31827 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) | |
31828 { | |
31829 __Pyx_TypeName type_name; | |
31830 __Pyx_TypeName obj_type_name; | |
31831 if (unlikely(!type)) { | |
31832 PyErr_SetString(PyExc_SystemError, "Missing type object"); | |
31833 return 0; | |
31834 } | |
31835 else if (exact) { | |
31836 #if PY_MAJOR_VERSION == 2 | |
31837 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; | |
31838 #endif | |
31839 } | |
31840 else { | |
31841 if (likely(__Pyx_TypeCheck(obj, type))) return 1; | |
31842 } | |
31843 type_name = __Pyx_PyType_GetName(type); | |
31844 obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); | |
31845 PyErr_Format(PyExc_TypeError, | |
31846 "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME | |
31847 ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); | |
31848 __Pyx_DECREF_TypeName(type_name); | |
31849 __Pyx_DECREF_TypeName(obj_type_name); | |
31850 return 0; | |
31851 } | |
31852 | |
31853 /* PyObjectFormatAndDecref */ | |
31854 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { | |
31855 if (unlikely(!s)) return NULL; | |
31856 if (likely(PyUnicode_CheckExact(s))) return s; | |
31857 #if PY_MAJOR_VERSION < 3 | |
31858 if (likely(PyString_CheckExact(s))) { | |
31859 PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); | |
31860 Py_DECREF(s); | |
31861 return result; | |
31862 } | |
31863 #endif | |
31864 return __Pyx_PyObject_FormatAndDecref(s, f); | |
31865 } | |
31866 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { | |
31867 PyObject *result; | |
31868 if (unlikely(!s)) return NULL; | |
31869 result = PyObject_Format(s, f); | |
31870 Py_DECREF(s); | |
31871 return result; | |
31872 } | |
31873 | |
31874 /* JoinPyUnicode */ | |
31875 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, | |
31876 Py_UCS4 max_char) { | |
31877 #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
31878 PyObject *result_uval; | |
31879 int result_ukind, kind_shift; | |
31880 Py_ssize_t i, char_pos; | |
31881 void *result_udata; | |
31882 CYTHON_MAYBE_UNUSED_VAR(max_char); | |
31883 #if CYTHON_PEP393_ENABLED | |
31884 result_uval = PyUnicode_New(result_ulength, max_char); | |
31885 if (unlikely(!result_uval)) return NULL; | |
31886 result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; | |
31887 kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; | |
31888 result_udata = PyUnicode_DATA(result_uval); | |
31889 #else | |
31890 result_uval = PyUnicode_FromUnicode(NULL, result_ulength); | |
31891 if (unlikely(!result_uval)) return NULL; | |
31892 result_ukind = sizeof(Py_UNICODE); | |
31893 kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; | |
31894 result_udata = PyUnicode_AS_UNICODE(result_uval); | |
31895 #endif | |
31896 assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); | |
31897 char_pos = 0; | |
31898 for (i=0; i < value_count; i++) { | |
31899 int ukind; | |
31900 Py_ssize_t ulength; | |
31901 void *udata; | |
31902 PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); | |
31903 if (unlikely(__Pyx_PyUnicode_READY(uval))) | |
31904 goto bad; | |
31905 ulength = __Pyx_PyUnicode_GET_LENGTH(uval); | |
31906 if (unlikely(!ulength)) | |
31907 continue; | |
31908 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) | |
31909 goto overflow; | |
31910 ukind = __Pyx_PyUnicode_KIND(uval); | |
31911 udata = __Pyx_PyUnicode_DATA(uval); | |
31912 if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { | |
31913 memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); | |
31914 } else { | |
31915 #if PY_VERSION_HEX >= 0x030d0000 | |
31916 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; | |
31917 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) | |
31918 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); | |
31919 #else | |
31920 Py_ssize_t j; | |
31921 for (j=0; j < ulength; j++) { | |
31922 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); | |
31923 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); | |
31924 } | |
31925 #endif | |
31926 } | |
31927 char_pos += ulength; | |
31928 } | |
31929 return result_uval; | |
31930 overflow: | |
31931 PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); | |
31932 bad: | |
31933 Py_DECREF(result_uval); | |
31934 return NULL; | |
31935 #else | |
31936 CYTHON_UNUSED_VAR(max_char); | |
31937 CYTHON_UNUSED_VAR(result_ulength); | |
31938 CYTHON_UNUSED_VAR(value_count); | |
31939 return PyUnicode_Join(__pyx_empty_unicode, value_tuple); | |
31940 #endif | |
31941 } | |
31942 | |
31943 /* DictGetItem */ | |
31944 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY | |
31945 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { | |
31946 PyObject *value; | |
31947 value = PyDict_GetItemWithError(d, key); | |
31948 if (unlikely(!value)) { | |
31949 if (!PyErr_Occurred()) { | |
31950 if (unlikely(PyTuple_Check(key))) { | |
31951 PyObject* args = PyTuple_Pack(1, key); | |
31952 if (likely(args)) { | |
31953 PyErr_SetObject(PyExc_KeyError, args); | |
31954 Py_DECREF(args); | |
31955 } | |
31956 } else { | |
31957 PyErr_SetObject(PyExc_KeyError, key); | |
31958 } | |
31959 } | |
31960 return NULL; | |
31961 } | |
31962 Py_INCREF(value); | |
31963 return value; | |
31964 } | |
31965 #endif | |
31966 | |
31967 /* GetTopmostException */ | |
31968 #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE | |
31969 static _PyErr_StackItem * | |
31970 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) | |
31971 { | |
31972 _PyErr_StackItem *exc_info = tstate->exc_info; | |
31973 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && | |
31974 exc_info->previous_item != NULL) | |
31975 { | |
31976 exc_info = exc_info->previous_item; | |
31977 } | |
31978 return exc_info; | |
31979 } | |
31980 #endif | |
31981 | |
31982 /* SaveResetException */ | |
31983 #if CYTHON_FAST_THREAD_STATE | |
31984 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { | |
31985 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 | |
31986 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); | |
31987 PyObject *exc_value = exc_info->exc_value; | |
31988 if (exc_value == NULL || exc_value == Py_None) { | |
31989 *value = NULL; | |
31990 *type = NULL; | |
31991 *tb = NULL; | |
31992 } else { | |
31993 *value = exc_value; | |
31994 Py_INCREF(*value); | |
31995 *type = (PyObject*) Py_TYPE(exc_value); | |
31996 Py_INCREF(*type); | |
31997 *tb = PyException_GetTraceback(exc_value); | |
31998 } | |
31999 #elif CYTHON_USE_EXC_INFO_STACK | |
32000 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); | |
32001 *type = exc_info->exc_type; | |
32002 *value = exc_info->exc_value; | |
32003 *tb = exc_info->exc_traceback; | |
32004 Py_XINCREF(*type); | |
32005 Py_XINCREF(*value); | |
32006 Py_XINCREF(*tb); | |
32007 #else | |
32008 *type = tstate->exc_type; | |
32009 *value = tstate->exc_value; | |
32010 *tb = tstate->exc_traceback; | |
32011 Py_XINCREF(*type); | |
32012 Py_XINCREF(*value); | |
32013 Py_XINCREF(*tb); | |
32014 #endif | |
32015 } | |
32016 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { | |
32017 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 | |
32018 _PyErr_StackItem *exc_info = tstate->exc_info; | |
32019 PyObject *tmp_value = exc_info->exc_value; | |
32020 exc_info->exc_value = value; | |
32021 Py_XDECREF(tmp_value); | |
32022 Py_XDECREF(type); | |
32023 Py_XDECREF(tb); | |
32024 #else | |
32025 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
32026 #if CYTHON_USE_EXC_INFO_STACK | |
32027 _PyErr_StackItem *exc_info = tstate->exc_info; | |
32028 tmp_type = exc_info->exc_type; | |
32029 tmp_value = exc_info->exc_value; | |
32030 tmp_tb = exc_info->exc_traceback; | |
32031 exc_info->exc_type = type; | |
32032 exc_info->exc_value = value; | |
32033 exc_info->exc_traceback = tb; | |
32034 #else | |
32035 tmp_type = tstate->exc_type; | |
32036 tmp_value = tstate->exc_value; | |
32037 tmp_tb = tstate->exc_traceback; | |
32038 tstate->exc_type = type; | |
32039 tstate->exc_value = value; | |
32040 tstate->exc_traceback = tb; | |
32041 #endif | |
32042 Py_XDECREF(tmp_type); | |
32043 Py_XDECREF(tmp_value); | |
32044 Py_XDECREF(tmp_tb); | |
32045 #endif | |
32046 } | |
32047 #endif | |
32048 | |
32049 /* GetException */ | |
32050 #if CYTHON_FAST_THREAD_STATE | |
32051 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) | |
32052 #else | |
32053 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) | |
32054 #endif | |
32055 { | |
32056 PyObject *local_type = NULL, *local_value, *local_tb = NULL; | |
32057 #if CYTHON_FAST_THREAD_STATE | |
32058 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
32059 #if PY_VERSION_HEX >= 0x030C00A6 | |
32060 local_value = tstate->current_exception; | |
32061 tstate->current_exception = 0; | |
32062 if (likely(local_value)) { | |
32063 local_type = (PyObject*) Py_TYPE(local_value); | |
32064 Py_INCREF(local_type); | |
32065 local_tb = PyException_GetTraceback(local_value); | |
32066 } | |
32067 #else | |
32068 local_type = tstate->curexc_type; | |
32069 local_value = tstate->curexc_value; | |
32070 local_tb = tstate->curexc_traceback; | |
32071 tstate->curexc_type = 0; | |
32072 tstate->curexc_value = 0; | |
32073 tstate->curexc_traceback = 0; | |
32074 #endif | |
32075 #else | |
32076 PyErr_Fetch(&local_type, &local_value, &local_tb); | |
32077 #endif | |
32078 PyErr_NormalizeException(&local_type, &local_value, &local_tb); | |
32079 #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 | |
32080 if (unlikely(tstate->current_exception)) | |
32081 #elif CYTHON_FAST_THREAD_STATE | |
32082 if (unlikely(tstate->curexc_type)) | |
32083 #else | |
32084 if (unlikely(PyErr_Occurred())) | |
32085 #endif | |
32086 goto bad; | |
32087 #if PY_MAJOR_VERSION >= 3 | |
32088 if (local_tb) { | |
32089 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) | |
32090 goto bad; | |
32091 } | |
32092 #endif | |
32093 Py_XINCREF(local_tb); | |
32094 Py_XINCREF(local_type); | |
32095 Py_XINCREF(local_value); | |
32096 *type = local_type; | |
32097 *value = local_value; | |
32098 *tb = local_tb; | |
32099 #if CYTHON_FAST_THREAD_STATE | |
32100 #if CYTHON_USE_EXC_INFO_STACK | |
32101 { | |
32102 _PyErr_StackItem *exc_info = tstate->exc_info; | |
32103 #if PY_VERSION_HEX >= 0x030B00a4 | |
32104 tmp_value = exc_info->exc_value; | |
32105 exc_info->exc_value = local_value; | |
32106 tmp_type = NULL; | |
32107 tmp_tb = NULL; | |
32108 Py_XDECREF(local_type); | |
32109 Py_XDECREF(local_tb); | |
32110 #else | |
32111 tmp_type = exc_info->exc_type; | |
32112 tmp_value = exc_info->exc_value; | |
32113 tmp_tb = exc_info->exc_traceback; | |
32114 exc_info->exc_type = local_type; | |
32115 exc_info->exc_value = local_value; | |
32116 exc_info->exc_traceback = local_tb; | |
32117 #endif | |
32118 } | |
32119 #else | |
32120 tmp_type = tstate->exc_type; | |
32121 tmp_value = tstate->exc_value; | |
32122 tmp_tb = tstate->exc_traceback; | |
32123 tstate->exc_type = local_type; | |
32124 tstate->exc_value = local_value; | |
32125 tstate->exc_traceback = local_tb; | |
32126 #endif | |
32127 Py_XDECREF(tmp_type); | |
32128 Py_XDECREF(tmp_value); | |
32129 Py_XDECREF(tmp_tb); | |
32130 #else | |
32131 PyErr_SetExcInfo(local_type, local_value, local_tb); | |
32132 #endif | |
32133 return 0; | |
32134 bad: | |
32135 *type = 0; | |
32136 *value = 0; | |
32137 *tb = 0; | |
32138 Py_XDECREF(local_type); | |
32139 Py_XDECREF(local_value); | |
32140 Py_XDECREF(local_tb); | |
32141 return -1; | |
32142 } | |
32143 | |
32144 /* UnpackUnboundCMethod */ | |
32145 static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { | |
32146 PyObject *result; | |
32147 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); | |
32148 if (unlikely(!selfless_args)) return NULL; | |
32149 result = PyObject_Call(method, selfless_args, kwargs); | |
32150 Py_DECREF(selfless_args); | |
32151 return result; | |
32152 } | |
32153 static PyMethodDef __Pyx_UnboundCMethod_Def = { | |
32154 "CythonUnboundCMethod", | |
32155 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), | |
32156 METH_VARARGS | METH_KEYWORDS, | |
32157 NULL | |
32158 }; | |
32159 static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { | |
32160 PyObject *method; | |
32161 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); | |
32162 if (unlikely(!method)) | |
32163 return -1; | |
32164 target->method = method; | |
32165 #if CYTHON_COMPILING_IN_CPYTHON | |
32166 #if PY_MAJOR_VERSION >= 3 | |
32167 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) | |
32168 #else | |
32169 if (likely(!__Pyx_CyOrPyCFunction_Check(method))) | |
32170 #endif | |
32171 { | |
32172 PyMethodDescrObject *descr = (PyMethodDescrObject*) method; | |
32173 target->func = descr->d_method->ml_meth; | |
32174 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); | |
32175 } else | |
32176 #endif | |
32177 #if CYTHON_COMPILING_IN_PYPY | |
32178 #else | |
32179 if (PyCFunction_Check(method)) | |
32180 #endif | |
32181 { | |
32182 PyObject *self; | |
32183 int self_found; | |
32184 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY | |
32185 self = PyObject_GetAttrString(method, "__self__"); | |
32186 if (!self) { | |
32187 PyErr_Clear(); | |
32188 } | |
32189 #else | |
32190 self = PyCFunction_GET_SELF(method); | |
32191 #endif | |
32192 self_found = (self && self != Py_None); | |
32193 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY | |
32194 Py_XDECREF(self); | |
32195 #endif | |
32196 if (self_found) { | |
32197 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); | |
32198 if (unlikely(!unbound_method)) return -1; | |
32199 Py_DECREF(method); | |
32200 target->method = unbound_method; | |
32201 } | |
32202 } | |
32203 return 0; | |
32204 } | |
32205 | |
32206 /* CallUnboundCMethod0 */ | |
32207 static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { | |
32208 PyObject *args, *result = NULL; | |
32209 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; | |
32210 #if CYTHON_ASSUME_SAFE_MACROS | |
32211 args = PyTuple_New(1); | |
32212 if (unlikely(!args)) goto bad; | |
32213 Py_INCREF(self); | |
32214 PyTuple_SET_ITEM(args, 0, self); | |
32215 #else | |
32216 args = PyTuple_Pack(1, self); | |
32217 if (unlikely(!args)) goto bad; | |
32218 #endif | |
32219 result = __Pyx_PyObject_Call(cfunc->method, args, NULL); | |
32220 Py_DECREF(args); | |
32221 bad: | |
32222 return result; | |
32223 } | |
32224 | |
32225 /* py_dict_keys */ | |
32226 static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { | |
32227 if (PY_MAJOR_VERSION >= 3) | |
32228 return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_keys, d); | |
32229 else | |
32230 return PyDict_Keys(d); | |
32231 } | |
32232 | |
32233 /* UnicodeAsUCS4 */ | |
32234 static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) { | |
32235 Py_ssize_t length; | |
32236 #if CYTHON_PEP393_ENABLED | |
32237 length = PyUnicode_GET_LENGTH(x); | |
32238 if (likely(length == 1)) { | |
32239 return PyUnicode_READ_CHAR(x, 0); | |
32240 } | |
32241 #else | |
32242 length = PyUnicode_GET_SIZE(x); | |
32243 if (likely(length == 1)) { | |
32244 return PyUnicode_AS_UNICODE(x)[0]; | |
32245 } | |
32246 #if Py_UNICODE_SIZE == 2 | |
32247 else if (PyUnicode_GET_SIZE(x) == 2) { | |
32248 Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0]; | |
32249 if (high_val >= 0xD800 && high_val <= 0xDBFF) { | |
32250 Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1]; | |
32251 if (low_val >= 0xDC00 && low_val <= 0xDFFF) { | |
32252 return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1))); | |
32253 } | |
32254 } | |
32255 } | |
32256 #endif | |
32257 #endif | |
32258 PyErr_Format(PyExc_ValueError, | |
32259 "only single character unicode strings can be converted to Py_UCS4, " | |
32260 "got length %" CYTHON_FORMAT_SSIZE_T "d", length); | |
32261 return (Py_UCS4)-1; | |
32262 } | |
32263 | |
32264 /* object_ord */ | |
32265 static long __Pyx__PyObject_Ord(PyObject* c) { | |
32266 Py_ssize_t size; | |
32267 if (PyBytes_Check(c)) { | |
32268 size = PyBytes_GET_SIZE(c); | |
32269 if (likely(size == 1)) { | |
32270 return (unsigned char) PyBytes_AS_STRING(c)[0]; | |
32271 } | |
32272 #if PY_MAJOR_VERSION < 3 | |
32273 } else if (PyUnicode_Check(c)) { | |
32274 return (long)__Pyx_PyUnicode_AsPy_UCS4(c); | |
32275 #endif | |
32276 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) | |
32277 } else if (PyByteArray_Check(c)) { | |
32278 size = PyByteArray_GET_SIZE(c); | |
32279 if (likely(size == 1)) { | |
32280 return (unsigned char) PyByteArray_AS_STRING(c)[0]; | |
32281 } | |
32282 #endif | |
32283 } else { | |
32284 __Pyx_TypeName c_type_name = __Pyx_PyType_GetName(Py_TYPE(c)); | |
32285 PyErr_Format(PyExc_TypeError, | |
32286 "ord() expected string of length 1, but " __Pyx_FMT_TYPENAME " found", | |
32287 c_type_name); | |
32288 __Pyx_DECREF_TypeName(c_type_name); | |
32289 return (long)(Py_UCS4)-1; | |
32290 } | |
32291 PyErr_Format(PyExc_TypeError, | |
32292 "ord() expected a character, but string of length %zd found", size); | |
32293 return (long)(Py_UCS4)-1; | |
32294 } | |
32295 | |
32296 /* RaiseTooManyValuesToUnpack */ | |
32297 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { | |
32298 PyErr_Format(PyExc_ValueError, | |
32299 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); | |
32300 } | |
32301 | |
32302 /* RaiseNeedMoreValuesToUnpack */ | |
32303 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { | |
32304 PyErr_Format(PyExc_ValueError, | |
32305 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", | |
32306 index, (index == 1) ? "" : "s"); | |
32307 } | |
32308 | |
32309 /* IterFinish */ | |
32310 static CYTHON_INLINE int __Pyx_IterFinish(void) { | |
32311 PyObject* exc_type; | |
32312 __Pyx_PyThreadState_declare | |
32313 __Pyx_PyThreadState_assign | |
32314 exc_type = __Pyx_PyErr_CurrentExceptionType(); | |
32315 if (unlikely(exc_type)) { | |
32316 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) | |
32317 return -1; | |
32318 __Pyx_PyErr_Clear(); | |
32319 return 0; | |
32320 } | |
32321 return 0; | |
32322 } | |
32323 | |
32324 /* UnpackItemEndCheck */ | |
32325 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { | |
32326 if (unlikely(retval)) { | |
32327 Py_DECREF(retval); | |
32328 __Pyx_RaiseTooManyValuesError(expected); | |
32329 return -1; | |
32330 } | |
32331 return __Pyx_IterFinish(); | |
32332 } | |
32333 | |
32334 /* PyObjectSetAttrStr */ | |
32335 #if CYTHON_USE_TYPE_SLOTS | |
32336 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { | |
32337 PyTypeObject* tp = Py_TYPE(obj); | |
32338 if (likely(tp->tp_setattro)) | |
32339 return tp->tp_setattro(obj, attr_name, value); | |
32340 #if PY_MAJOR_VERSION < 3 | |
32341 if (likely(tp->tp_setattr)) | |
32342 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); | |
32343 #endif | |
32344 return PyObject_SetAttr(obj, attr_name, value); | |
32345 } | |
32346 #endif | |
32347 | |
32348 /* Import */ | |
32349 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { | |
32350 PyObject *module = 0; | |
32351 PyObject *empty_dict = 0; | |
32352 PyObject *empty_list = 0; | |
32353 #if PY_MAJOR_VERSION < 3 | |
32354 PyObject *py_import; | |
32355 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); | |
32356 if (unlikely(!py_import)) | |
32357 goto bad; | |
32358 if (!from_list) { | |
32359 empty_list = PyList_New(0); | |
32360 if (unlikely(!empty_list)) | |
32361 goto bad; | |
32362 from_list = empty_list; | |
32363 } | |
32364 #endif | |
32365 empty_dict = PyDict_New(); | |
32366 if (unlikely(!empty_dict)) | |
32367 goto bad; | |
32368 { | |
32369 #if PY_MAJOR_VERSION >= 3 | |
32370 if (level == -1) { | |
32371 if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { | |
32372 module = PyImport_ImportModuleLevelObject( | |
32373 name, __pyx_d, empty_dict, from_list, 1); | |
32374 if (unlikely(!module)) { | |
32375 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) | |
32376 goto bad; | |
32377 PyErr_Clear(); | |
32378 } | |
32379 } | |
32380 level = 0; | |
32381 } | |
32382 #endif | |
32383 if (!module) { | |
32384 #if PY_MAJOR_VERSION < 3 | |
32385 PyObject *py_level = PyInt_FromLong(level); | |
32386 if (unlikely(!py_level)) | |
32387 goto bad; | |
32388 module = PyObject_CallFunctionObjArgs(py_import, | |
32389 name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); | |
32390 Py_DECREF(py_level); | |
32391 #else | |
32392 module = PyImport_ImportModuleLevelObject( | |
32393 name, __pyx_d, empty_dict, from_list, level); | |
32394 #endif | |
32395 } | |
32396 } | |
32397 bad: | |
32398 Py_XDECREF(empty_dict); | |
32399 Py_XDECREF(empty_list); | |
32400 #if PY_MAJOR_VERSION < 3 | |
32401 Py_XDECREF(py_import); | |
32402 #endif | |
32403 return module; | |
32404 } | |
32405 | |
32406 /* ImportFrom */ | |
32407 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { | |
32408 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); | |
32409 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { | |
32410 const char* module_name_str = 0; | |
32411 PyObject* module_name = 0; | |
32412 PyObject* module_dot = 0; | |
32413 PyObject* full_name = 0; | |
32414 PyErr_Clear(); | |
32415 module_name_str = PyModule_GetName(module); | |
32416 if (unlikely(!module_name_str)) { goto modbad; } | |
32417 module_name = PyUnicode_FromString(module_name_str); | |
32418 if (unlikely(!module_name)) { goto modbad; } | |
32419 module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__56); | |
32420 if (unlikely(!module_dot)) { goto modbad; } | |
32421 full_name = PyUnicode_Concat(module_dot, name); | |
32422 if (unlikely(!full_name)) { goto modbad; } | |
32423 #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) | |
32424 { | |
32425 PyObject *modules = PyImport_GetModuleDict(); | |
32426 if (unlikely(!modules)) | |
32427 goto modbad; | |
32428 value = PyObject_GetItem(modules, full_name); | |
32429 } | |
32430 #else | |
32431 value = PyImport_GetModule(full_name); | |
32432 #endif | |
32433 modbad: | |
32434 Py_XDECREF(full_name); | |
32435 Py_XDECREF(module_dot); | |
32436 Py_XDECREF(module_name); | |
32437 } | |
32438 if (unlikely(!value)) { | |
32439 PyErr_Format(PyExc_ImportError, | |
32440 #if PY_MAJOR_VERSION < 3 | |
32441 "cannot import name %.230s", PyString_AS_STRING(name)); | |
32442 #else | |
32443 "cannot import name %S", name); | |
32444 #endif | |
32445 } | |
32446 return value; | |
32447 } | |
32448 | |
32449 /* GetItemInt */ | |
32450 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { | |
32451 PyObject *r; | |
32452 if (unlikely(!j)) return NULL; | |
32453 r = PyObject_GetItem(o, j); | |
32454 Py_DECREF(j); | |
32455 return r; | |
32456 } | |
32457 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, | |
32458 CYTHON_NCP_UNUSED int wraparound, | |
32459 CYTHON_NCP_UNUSED int boundscheck) { | |
32460 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
32461 Py_ssize_t wrapped_i = i; | |
32462 if (wraparound & unlikely(i < 0)) { | |
32463 wrapped_i += PyList_GET_SIZE(o); | |
32464 } | |
32465 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { | |
32466 PyObject *r = PyList_GET_ITEM(o, wrapped_i); | |
32467 Py_INCREF(r); | |
32468 return r; | |
32469 } | |
32470 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); | |
32471 #else | |
32472 return PySequence_GetItem(o, i); | |
32473 #endif | |
32474 } | |
32475 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, | |
32476 CYTHON_NCP_UNUSED int wraparound, | |
32477 CYTHON_NCP_UNUSED int boundscheck) { | |
32478 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
32479 Py_ssize_t wrapped_i = i; | |
32480 if (wraparound & unlikely(i < 0)) { | |
32481 wrapped_i += PyTuple_GET_SIZE(o); | |
32482 } | |
32483 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { | |
32484 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); | |
32485 Py_INCREF(r); | |
32486 return r; | |
32487 } | |
32488 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); | |
32489 #else | |
32490 return PySequence_GetItem(o, i); | |
32491 #endif | |
32492 } | |
32493 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, | |
32494 CYTHON_NCP_UNUSED int wraparound, | |
32495 CYTHON_NCP_UNUSED int boundscheck) { | |
32496 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS | |
32497 if (is_list || PyList_CheckExact(o)) { | |
32498 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); | |
32499 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { | |
32500 PyObject *r = PyList_GET_ITEM(o, n); | |
32501 Py_INCREF(r); | |
32502 return r; | |
32503 } | |
32504 } | |
32505 else if (PyTuple_CheckExact(o)) { | |
32506 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); | |
32507 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { | |
32508 PyObject *r = PyTuple_GET_ITEM(o, n); | |
32509 Py_INCREF(r); | |
32510 return r; | |
32511 } | |
32512 } else { | |
32513 PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; | |
32514 PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; | |
32515 if (mm && mm->mp_subscript) { | |
32516 PyObject *r, *key = PyInt_FromSsize_t(i); | |
32517 if (unlikely(!key)) return NULL; | |
32518 r = mm->mp_subscript(o, key); | |
32519 Py_DECREF(key); | |
32520 return r; | |
32521 } | |
32522 if (likely(sm && sm->sq_item)) { | |
32523 if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { | |
32524 Py_ssize_t l = sm->sq_length(o); | |
32525 if (likely(l >= 0)) { | |
32526 i += l; | |
32527 } else { | |
32528 if (!PyErr_ExceptionMatches(PyExc_OverflowError)) | |
32529 return NULL; | |
32530 PyErr_Clear(); | |
32531 } | |
32532 } | |
32533 return sm->sq_item(o, i); | |
32534 } | |
32535 } | |
32536 #else | |
32537 if (is_list || !PyMapping_Check(o)) { | |
32538 return PySequence_GetItem(o, i); | |
32539 } | |
32540 #endif | |
32541 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); | |
32542 } | |
32543 | |
32544 /* GetAttr */ | |
32545 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { | |
32546 #if CYTHON_USE_TYPE_SLOTS | |
32547 #if PY_MAJOR_VERSION >= 3 | |
32548 if (likely(PyUnicode_Check(n))) | |
32549 #else | |
32550 if (likely(PyString_Check(n))) | |
32551 #endif | |
32552 return __Pyx_PyObject_GetAttrStr(o, n); | |
32553 #endif | |
32554 return PyObject_GetAttr(o, n); | |
32555 } | |
32556 | |
32557 /* HasAttr */ | |
32558 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { | |
32559 PyObject *r; | |
32560 if (unlikely(!__Pyx_PyBaseString_Check(n))) { | |
32561 PyErr_SetString(PyExc_TypeError, | |
32562 "hasattr(): attribute name must be string"); | |
32563 return -1; | |
32564 } | |
32565 r = __Pyx_GetAttr(o, n); | |
32566 if (!r) { | |
32567 PyErr_Clear(); | |
32568 return 0; | |
32569 } else { | |
32570 Py_DECREF(r); | |
32571 return 1; | |
32572 } | |
32573 } | |
32574 | |
32575 /* CallNextTpDealloc */ | |
32576 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { | |
32577 PyTypeObject* type = Py_TYPE(obj); | |
32578 destructor tp_dealloc = NULL; | |
32579 while (type && __Pyx_PyType_GetSlot(type, tp_dealloc, destructor) != current_tp_dealloc) | |
32580 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); | |
32581 while (type && (tp_dealloc = __Pyx_PyType_GetSlot(type, tp_dealloc, destructor)) == current_tp_dealloc) | |
32582 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); | |
32583 if (type) | |
32584 tp_dealloc(obj); | |
32585 } | |
32586 | |
32587 /* CallNextTpTraverse */ | |
32588 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { | |
32589 PyTypeObject* type = Py_TYPE(obj); | |
32590 traverseproc tp_traverse = NULL; | |
32591 while (type && __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc) != current_tp_traverse) | |
32592 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); | |
32593 while (type && (tp_traverse = __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc)) == current_tp_traverse) | |
32594 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); | |
32595 if (type && tp_traverse) | |
32596 return tp_traverse(obj, v, a); | |
32597 return 0; | |
32598 } | |
32599 | |
32600 /* CallNextTpClear */ | |
32601 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { | |
32602 PyTypeObject* type = Py_TYPE(obj); | |
32603 inquiry tp_clear = NULL; | |
32604 while (type && __Pyx_PyType_GetSlot(type, tp_clear, inquiry) != current_tp_clear) | |
32605 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); | |
32606 while (type && (tp_clear = __Pyx_PyType_GetSlot(type, tp_clear, inquiry)) == current_tp_clear) | |
32607 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*); | |
32608 if (type && tp_clear) | |
32609 tp_clear(obj); | |
32610 } | |
32611 | |
32612 /* FixUpExtensionType */ | |
32613 #if CYTHON_USE_TYPE_SPECS | |
32614 static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { | |
32615 #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API | |
32616 CYTHON_UNUSED_VAR(spec); | |
32617 CYTHON_UNUSED_VAR(type); | |
32618 #else | |
32619 const PyType_Slot *slot = spec->slots; | |
32620 while (slot && slot->slot && slot->slot != Py_tp_members) | |
32621 slot++; | |
32622 if (slot && slot->slot == Py_tp_members) { | |
32623 int changed = 0; | |
32624 #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) | |
32625 const | |
32626 #endif | |
32627 PyMemberDef *memb = (PyMemberDef*) slot->pfunc; | |
32628 while (memb && memb->name) { | |
32629 if (memb->name[0] == '_' && memb->name[1] == '_') { | |
32630 #if PY_VERSION_HEX < 0x030900b1 | |
32631 if (strcmp(memb->name, "__weaklistoffset__") == 0) { | |
32632 assert(memb->type == T_PYSSIZET); | |
32633 assert(memb->flags == READONLY); | |
32634 type->tp_weaklistoffset = memb->offset; | |
32635 changed = 1; | |
32636 } | |
32637 else if (strcmp(memb->name, "__dictoffset__") == 0) { | |
32638 assert(memb->type == T_PYSSIZET); | |
32639 assert(memb->flags == READONLY); | |
32640 type->tp_dictoffset = memb->offset; | |
32641 changed = 1; | |
32642 } | |
32643 #if CYTHON_METH_FASTCALL | |
32644 else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { | |
32645 assert(memb->type == T_PYSSIZET); | |
32646 assert(memb->flags == READONLY); | |
32647 #if PY_VERSION_HEX >= 0x030800b4 | |
32648 type->tp_vectorcall_offset = memb->offset; | |
32649 #else | |
32650 type->tp_print = (printfunc) memb->offset; | |
32651 #endif | |
32652 changed = 1; | |
32653 } | |
32654 #endif | |
32655 #else | |
32656 if ((0)); | |
32657 #endif | |
32658 #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON | |
32659 else if (strcmp(memb->name, "__module__") == 0) { | |
32660 PyObject *descr; | |
32661 assert(memb->type == T_OBJECT); | |
32662 assert(memb->flags == 0 || memb->flags == READONLY); | |
32663 descr = PyDescr_NewMember(type, memb); | |
32664 if (unlikely(!descr)) | |
32665 return -1; | |
32666 if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { | |
32667 Py_DECREF(descr); | |
32668 return -1; | |
32669 } | |
32670 Py_DECREF(descr); | |
32671 changed = 1; | |
32672 } | |
32673 #endif | |
32674 } | |
32675 memb++; | |
32676 } | |
32677 if (changed) | |
32678 PyType_Modified(type); | |
32679 } | |
32680 #endif | |
32681 return 0; | |
32682 } | |
32683 #endif | |
32684 | |
32685 /* PyObjectGetMethod */ | |
32686 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { | |
32687 PyObject *attr; | |
32688 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP | |
32689 __Pyx_TypeName type_name; | |
32690 PyTypeObject *tp = Py_TYPE(obj); | |
32691 PyObject *descr; | |
32692 descrgetfunc f = NULL; | |
32693 PyObject **dictptr, *dict; | |
32694 int meth_found = 0; | |
32695 assert (*method == NULL); | |
32696 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { | |
32697 attr = __Pyx_PyObject_GetAttrStr(obj, name); | |
32698 goto try_unpack; | |
32699 } | |
32700 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { | |
32701 return 0; | |
32702 } | |
32703 descr = _PyType_Lookup(tp, name); | |
32704 if (likely(descr != NULL)) { | |
32705 Py_INCREF(descr); | |
32706 #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR | |
32707 if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) | |
32708 #elif PY_MAJOR_VERSION >= 3 | |
32709 #ifdef __Pyx_CyFunction_USED | |
32710 if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) | |
32711 #else | |
32712 if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) | |
32713 #endif | |
32714 #else | |
32715 #ifdef __Pyx_CyFunction_USED | |
32716 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) | |
32717 #else | |
32718 if (likely(PyFunction_Check(descr))) | |
32719 #endif | |
32720 #endif | |
32721 { | |
32722 meth_found = 1; | |
32723 } else { | |
32724 f = Py_TYPE(descr)->tp_descr_get; | |
32725 if (f != NULL && PyDescr_IsData(descr)) { | |
32726 attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); | |
32727 Py_DECREF(descr); | |
32728 goto try_unpack; | |
32729 } | |
32730 } | |
32731 } | |
32732 dictptr = _PyObject_GetDictPtr(obj); | |
32733 if (dictptr != NULL && (dict = *dictptr) != NULL) { | |
32734 Py_INCREF(dict); | |
32735 attr = __Pyx_PyDict_GetItemStr(dict, name); | |
32736 if (attr != NULL) { | |
32737 Py_INCREF(attr); | |
32738 Py_DECREF(dict); | |
32739 Py_XDECREF(descr); | |
32740 goto try_unpack; | |
32741 } | |
32742 Py_DECREF(dict); | |
32743 } | |
32744 if (meth_found) { | |
32745 *method = descr; | |
32746 return 1; | |
32747 } | |
32748 if (f != NULL) { | |
32749 attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); | |
32750 Py_DECREF(descr); | |
32751 goto try_unpack; | |
32752 } | |
32753 if (likely(descr != NULL)) { | |
32754 *method = descr; | |
32755 return 0; | |
32756 } | |
32757 type_name = __Pyx_PyType_GetName(tp); | |
32758 PyErr_Format(PyExc_AttributeError, | |
32759 #if PY_MAJOR_VERSION >= 3 | |
32760 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", | |
32761 type_name, name); | |
32762 #else | |
32763 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", | |
32764 type_name, PyString_AS_STRING(name)); | |
32765 #endif | |
32766 __Pyx_DECREF_TypeName(type_name); | |
32767 return 0; | |
32768 #else | |
32769 attr = __Pyx_PyObject_GetAttrStr(obj, name); | |
32770 goto try_unpack; | |
32771 #endif | |
32772 try_unpack: | |
32773 #if CYTHON_UNPACK_METHODS | |
32774 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { | |
32775 PyObject *function = PyMethod_GET_FUNCTION(attr); | |
32776 Py_INCREF(function); | |
32777 Py_DECREF(attr); | |
32778 *method = function; | |
32779 return 1; | |
32780 } | |
32781 #endif | |
32782 *method = attr; | |
32783 return 0; | |
32784 } | |
32785 | |
32786 /* PyObjectCallMethod0 */ | |
32787 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { | |
32788 PyObject *method = NULL, *result = NULL; | |
32789 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); | |
32790 if (likely(is_method)) { | |
32791 result = __Pyx_PyObject_CallOneArg(method, obj); | |
32792 Py_DECREF(method); | |
32793 return result; | |
32794 } | |
32795 if (unlikely(!method)) goto bad; | |
32796 result = __Pyx_PyObject_CallNoArg(method); | |
32797 Py_DECREF(method); | |
32798 bad: | |
32799 return result; | |
32800 } | |
32801 | |
32802 /* ValidateBasesTuple */ | |
32803 #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS | |
32804 static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { | |
32805 Py_ssize_t i, n; | |
32806 #if CYTHON_ASSUME_SAFE_MACROS | |
32807 n = PyTuple_GET_SIZE(bases); | |
32808 #else | |
32809 n = PyTuple_Size(bases); | |
32810 if (n < 0) return -1; | |
32811 #endif | |
32812 for (i = 1; i < n; i++) | |
32813 { | |
32814 #if CYTHON_AVOID_BORROWED_REFS | |
32815 PyObject *b0 = PySequence_GetItem(bases, i); | |
32816 if (!b0) return -1; | |
32817 #elif CYTHON_ASSUME_SAFE_MACROS | |
32818 PyObject *b0 = PyTuple_GET_ITEM(bases, i); | |
32819 #else | |
32820 PyObject *b0 = PyTuple_GetItem(bases, i); | |
32821 if (!b0) return -1; | |
32822 #endif | |
32823 PyTypeObject *b; | |
32824 #if PY_MAJOR_VERSION < 3 | |
32825 if (PyClass_Check(b0)) | |
32826 { | |
32827 PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", | |
32828 PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); | |
32829 #if CYTHON_AVOID_BORROWED_REFS | |
32830 Py_DECREF(b0); | |
32831 #endif | |
32832 return -1; | |
32833 } | |
32834 #endif | |
32835 b = (PyTypeObject*) b0; | |
32836 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) | |
32837 { | |
32838 __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); | |
32839 PyErr_Format(PyExc_TypeError, | |
32840 "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); | |
32841 __Pyx_DECREF_TypeName(b_name); | |
32842 #if CYTHON_AVOID_BORROWED_REFS | |
32843 Py_DECREF(b0); | |
32844 #endif | |
32845 return -1; | |
32846 } | |
32847 if (dictoffset == 0) | |
32848 { | |
32849 Py_ssize_t b_dictoffset = 0; | |
32850 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY | |
32851 b_dictoffset = b->tp_dictoffset; | |
32852 #else | |
32853 PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); | |
32854 if (!py_b_dictoffset) goto dictoffset_return; | |
32855 b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); | |
32856 Py_DECREF(py_b_dictoffset); | |
32857 if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; | |
32858 #endif | |
32859 if (b_dictoffset) { | |
32860 { | |
32861 __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); | |
32862 PyErr_Format(PyExc_TypeError, | |
32863 "extension type '%.200s' has no __dict__ slot, " | |
32864 "but base type '" __Pyx_FMT_TYPENAME "' has: " | |
32865 "either add 'cdef dict __dict__' to the extension type " | |
32866 "or add '__slots__ = [...]' to the base type", | |
32867 type_name, b_name); | |
32868 __Pyx_DECREF_TypeName(b_name); | |
32869 } | |
32870 #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) | |
32871 dictoffset_return: | |
32872 #endif | |
32873 #if CYTHON_AVOID_BORROWED_REFS | |
32874 Py_DECREF(b0); | |
32875 #endif | |
32876 return -1; | |
32877 } | |
32878 } | |
32879 #if CYTHON_AVOID_BORROWED_REFS | |
32880 Py_DECREF(b0); | |
32881 #endif | |
32882 } | |
32883 return 0; | |
32884 } | |
32885 #endif | |
32886 | |
32887 /* PyType_Ready */ | |
32888 static int __Pyx_PyType_Ready(PyTypeObject *t) { | |
32889 #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) | |
32890 (void)__Pyx_PyObject_CallMethod0; | |
32891 #if CYTHON_USE_TYPE_SPECS | |
32892 (void)__Pyx_validate_bases_tuple; | |
32893 #endif | |
32894 return PyType_Ready(t); | |
32895 #else | |
32896 int r; | |
32897 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); | |
32898 if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) | |
32899 return -1; | |
32900 #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) | |
32901 { | |
32902 int gc_was_enabled; | |
32903 #if PY_VERSION_HEX >= 0x030A00b1 | |
32904 gc_was_enabled = PyGC_Disable(); | |
32905 (void)__Pyx_PyObject_CallMethod0; | |
32906 #else | |
32907 PyObject *ret, *py_status; | |
32908 PyObject *gc = NULL; | |
32909 #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) | |
32910 gc = PyImport_GetModule(__pyx_kp_u_gc); | |
32911 #endif | |
32912 if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); | |
32913 if (unlikely(!gc)) return -1; | |
32914 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); | |
32915 if (unlikely(!py_status)) { | |
32916 Py_DECREF(gc); | |
32917 return -1; | |
32918 } | |
32919 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); | |
32920 Py_DECREF(py_status); | |
32921 if (gc_was_enabled > 0) { | |
32922 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); | |
32923 if (unlikely(!ret)) { | |
32924 Py_DECREF(gc); | |
32925 return -1; | |
32926 } | |
32927 Py_DECREF(ret); | |
32928 } else if (unlikely(gc_was_enabled == -1)) { | |
32929 Py_DECREF(gc); | |
32930 return -1; | |
32931 } | |
32932 #endif | |
32933 t->tp_flags |= Py_TPFLAGS_HEAPTYPE; | |
32934 #if PY_VERSION_HEX >= 0x030A0000 | |
32935 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; | |
32936 #endif | |
32937 #else | |
32938 (void)__Pyx_PyObject_CallMethod0; | |
32939 #endif | |
32940 r = PyType_Ready(t); | |
32941 #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) | |
32942 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; | |
32943 #if PY_VERSION_HEX >= 0x030A00b1 | |
32944 if (gc_was_enabled) | |
32945 PyGC_Enable(); | |
32946 #else | |
32947 if (gc_was_enabled) { | |
32948 PyObject *tp, *v, *tb; | |
32949 PyErr_Fetch(&tp, &v, &tb); | |
32950 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); | |
32951 if (likely(ret || r == -1)) { | |
32952 Py_XDECREF(ret); | |
32953 PyErr_Restore(tp, v, tb); | |
32954 } else { | |
32955 Py_XDECREF(tp); | |
32956 Py_XDECREF(v); | |
32957 Py_XDECREF(tb); | |
32958 r = -1; | |
32959 } | |
32960 } | |
32961 Py_DECREF(gc); | |
32962 #endif | |
32963 } | |
32964 #endif | |
32965 return r; | |
32966 #endif | |
32967 } | |
32968 | |
32969 /* PyObject_GenericGetAttrNoDict */ | |
32970 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 | |
32971 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { | |
32972 __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); | |
32973 PyErr_Format(PyExc_AttributeError, | |
32974 #if PY_MAJOR_VERSION >= 3 | |
32975 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", | |
32976 type_name, attr_name); | |
32977 #else | |
32978 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", | |
32979 type_name, PyString_AS_STRING(attr_name)); | |
32980 #endif | |
32981 __Pyx_DECREF_TypeName(type_name); | |
32982 return NULL; | |
32983 } | |
32984 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { | |
32985 PyObject *descr; | |
32986 PyTypeObject *tp = Py_TYPE(obj); | |
32987 if (unlikely(!PyString_Check(attr_name))) { | |
32988 return PyObject_GenericGetAttr(obj, attr_name); | |
32989 } | |
32990 assert(!tp->tp_dictoffset); | |
32991 descr = _PyType_Lookup(tp, attr_name); | |
32992 if (unlikely(!descr)) { | |
32993 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); | |
32994 } | |
32995 Py_INCREF(descr); | |
32996 #if PY_MAJOR_VERSION < 3 | |
32997 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) | |
32998 #endif | |
32999 { | |
33000 descrgetfunc f = Py_TYPE(descr)->tp_descr_get; | |
33001 if (unlikely(f)) { | |
33002 PyObject *res = f(descr, obj, (PyObject *)tp); | |
33003 Py_DECREF(descr); | |
33004 return res; | |
33005 } | |
33006 } | |
33007 return descr; | |
33008 } | |
33009 #endif | |
33010 | |
33011 /* PyObject_GenericGetAttr */ | |
33012 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 | |
33013 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { | |
33014 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { | |
33015 return PyObject_GenericGetAttr(obj, attr_name); | |
33016 } | |
33017 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); | |
33018 } | |
33019 #endif | |
33020 | |
33021 /* SetVTable */ | |
33022 static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) { | |
33023 PyObject *ob = PyCapsule_New(vtable, 0, 0); | |
33024 if (unlikely(!ob)) | |
33025 goto bad; | |
33026 #if CYTHON_COMPILING_IN_LIMITED_API | |
33027 if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0)) | |
33028 #else | |
33029 if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0)) | |
33030 #endif | |
33031 goto bad; | |
33032 Py_DECREF(ob); | |
33033 return 0; | |
33034 bad: | |
33035 Py_XDECREF(ob); | |
33036 return -1; | |
33037 } | |
33038 | |
33039 /* GetVTable */ | |
33040 static void* __Pyx_GetVtable(PyTypeObject *type) { | |
33041 void* ptr; | |
33042 #if CYTHON_COMPILING_IN_LIMITED_API | |
33043 PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); | |
33044 #else | |
33045 PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); | |
33046 #endif | |
33047 if (!ob) | |
33048 goto bad; | |
33049 ptr = PyCapsule_GetPointer(ob, 0); | |
33050 if (!ptr && !PyErr_Occurred()) | |
33051 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); | |
33052 Py_DECREF(ob); | |
33053 return ptr; | |
33054 bad: | |
33055 Py_XDECREF(ob); | |
33056 return NULL; | |
33057 } | |
33058 | |
33059 /* MergeVTables */ | |
33060 #if !CYTHON_COMPILING_IN_LIMITED_API | |
33061 static int __Pyx_MergeVtables(PyTypeObject *type) { | |
33062 int i; | |
33063 void** base_vtables; | |
33064 __Pyx_TypeName tp_base_name; | |
33065 __Pyx_TypeName base_name; | |
33066 void* unknown = (void*)-1; | |
33067 PyObject* bases = type->tp_bases; | |
33068 int base_depth = 0; | |
33069 { | |
33070 PyTypeObject* base = type->tp_base; | |
33071 while (base) { | |
33072 base_depth += 1; | |
33073 base = base->tp_base; | |
33074 } | |
33075 } | |
33076 base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1)); | |
33077 base_vtables[0] = unknown; | |
33078 for (i = 1; i < PyTuple_GET_SIZE(bases); i++) { | |
33079 void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i))); | |
33080 if (base_vtable != NULL) { | |
33081 int j; | |
33082 PyTypeObject* base = type->tp_base; | |
33083 for (j = 0; j < base_depth; j++) { | |
33084 if (base_vtables[j] == unknown) { | |
33085 base_vtables[j] = __Pyx_GetVtable(base); | |
33086 base_vtables[j + 1] = unknown; | |
33087 } | |
33088 if (base_vtables[j] == base_vtable) { | |
33089 break; | |
33090 } else if (base_vtables[j] == NULL) { | |
33091 goto bad; | |
33092 } | |
33093 base = base->tp_base; | |
33094 } | |
33095 } | |
33096 } | |
33097 PyErr_Clear(); | |
33098 free(base_vtables); | |
33099 return 0; | |
33100 bad: | |
33101 tp_base_name = __Pyx_PyType_GetName(type->tp_base); | |
33102 base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i)); | |
33103 PyErr_Format(PyExc_TypeError, | |
33104 "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); | |
33105 __Pyx_DECREF_TypeName(tp_base_name); | |
33106 __Pyx_DECREF_TypeName(base_name); | |
33107 free(base_vtables); | |
33108 return -1; | |
33109 } | |
33110 #endif | |
33111 | |
33112 /* SetupReduce */ | |
33113 #if !CYTHON_COMPILING_IN_LIMITED_API | |
33114 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { | |
33115 int ret; | |
33116 PyObject *name_attr; | |
33117 name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); | |
33118 if (likely(name_attr)) { | |
33119 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); | |
33120 } else { | |
33121 ret = -1; | |
33122 } | |
33123 if (unlikely(ret < 0)) { | |
33124 PyErr_Clear(); | |
33125 ret = 0; | |
33126 } | |
33127 Py_XDECREF(name_attr); | |
33128 return ret; | |
33129 } | |
33130 static int __Pyx_setup_reduce(PyObject* type_obj) { | |
33131 int ret = 0; | |
33132 PyObject *object_reduce = NULL; | |
33133 PyObject *object_getstate = NULL; | |
33134 PyObject *object_reduce_ex = NULL; | |
33135 PyObject *reduce = NULL; | |
33136 PyObject *reduce_ex = NULL; | |
33137 PyObject *reduce_cython = NULL; | |
33138 PyObject *setstate = NULL; | |
33139 PyObject *setstate_cython = NULL; | |
33140 PyObject *getstate = NULL; | |
33141 #if CYTHON_USE_PYTYPE_LOOKUP | |
33142 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); | |
33143 #else | |
33144 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); | |
33145 if (!getstate && PyErr_Occurred()) { | |
33146 goto __PYX_BAD; | |
33147 } | |
33148 #endif | |
33149 if (getstate) { | |
33150 #if CYTHON_USE_PYTYPE_LOOKUP | |
33151 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); | |
33152 #else | |
33153 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); | |
33154 if (!object_getstate && PyErr_Occurred()) { | |
33155 goto __PYX_BAD; | |
33156 } | |
33157 #endif | |
33158 if (object_getstate != getstate) { | |
33159 goto __PYX_GOOD; | |
33160 } | |
33161 } | |
33162 #if CYTHON_USE_PYTYPE_LOOKUP | |
33163 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; | |
33164 #else | |
33165 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; | |
33166 #endif | |
33167 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; | |
33168 if (reduce_ex == object_reduce_ex) { | |
33169 #if CYTHON_USE_PYTYPE_LOOKUP | |
33170 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; | |
33171 #else | |
33172 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; | |
33173 #endif | |
33174 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; | |
33175 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { | |
33176 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); | |
33177 if (likely(reduce_cython)) { | |
33178 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; | |
33179 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; | |
33180 } else if (reduce == object_reduce || PyErr_Occurred()) { | |
33181 goto __PYX_BAD; | |
33182 } | |
33183 setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); | |
33184 if (!setstate) PyErr_Clear(); | |
33185 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { | |
33186 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); | |
33187 if (likely(setstate_cython)) { | |
33188 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; | |
33189 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; | |
33190 } else if (!setstate || PyErr_Occurred()) { | |
33191 goto __PYX_BAD; | |
33192 } | |
33193 } | |
33194 PyType_Modified((PyTypeObject*)type_obj); | |
33195 } | |
33196 } | |
33197 goto __PYX_GOOD; | |
33198 __PYX_BAD: | |
33199 if (!PyErr_Occurred()) { | |
33200 __Pyx_TypeName type_obj_name = | |
33201 __Pyx_PyType_GetName((PyTypeObject*)type_obj); | |
33202 PyErr_Format(PyExc_RuntimeError, | |
33203 "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); | |
33204 __Pyx_DECREF_TypeName(type_obj_name); | |
33205 } | |
33206 ret = -1; | |
33207 __PYX_GOOD: | |
33208 #if !CYTHON_USE_PYTYPE_LOOKUP | |
33209 Py_XDECREF(object_reduce); | |
33210 Py_XDECREF(object_reduce_ex); | |
33211 Py_XDECREF(object_getstate); | |
33212 Py_XDECREF(getstate); | |
33213 #endif | |
33214 Py_XDECREF(reduce); | |
33215 Py_XDECREF(reduce_ex); | |
33216 Py_XDECREF(reduce_cython); | |
33217 Py_XDECREF(setstate); | |
33218 Py_XDECREF(setstate_cython); | |
33219 return ret; | |
33220 } | |
33221 #endif | |
33222 | |
33223 /* TypeImport */ | |
33224 #ifndef __PYX_HAVE_RT_ImportType_3_0_11 | |
33225 #define __PYX_HAVE_RT_ImportType_3_0_11 | |
33226 static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name, | |
33227 size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size) | |
33228 { | |
33229 PyObject *result = 0; | |
33230 char warning[200]; | |
33231 Py_ssize_t basicsize; | |
33232 Py_ssize_t itemsize; | |
33233 #if CYTHON_COMPILING_IN_LIMITED_API | |
33234 PyObject *py_basicsize; | |
33235 PyObject *py_itemsize; | |
33236 #endif | |
33237 result = PyObject_GetAttrString(module, class_name); | |
33238 if (!result) | |
33239 goto bad; | |
33240 if (!PyType_Check(result)) { | |
33241 PyErr_Format(PyExc_TypeError, | |
33242 "%.200s.%.200s is not a type object", | |
33243 module_name, class_name); | |
33244 goto bad; | |
33245 } | |
33246 #if !CYTHON_COMPILING_IN_LIMITED_API | |
33247 basicsize = ((PyTypeObject *)result)->tp_basicsize; | |
33248 itemsize = ((PyTypeObject *)result)->tp_itemsize; | |
33249 #else | |
33250 py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); | |
33251 if (!py_basicsize) | |
33252 goto bad; | |
33253 basicsize = PyLong_AsSsize_t(py_basicsize); | |
33254 Py_DECREF(py_basicsize); | |
33255 py_basicsize = 0; | |
33256 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) | |
33257 goto bad; | |
33258 py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); | |
33259 if (!py_itemsize) | |
33260 goto bad; | |
33261 itemsize = PyLong_AsSsize_t(py_itemsize); | |
33262 Py_DECREF(py_itemsize); | |
33263 py_itemsize = 0; | |
33264 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) | |
33265 goto bad; | |
33266 #endif | |
33267 if (itemsize) { | |
33268 if (size % alignment) { | |
33269 alignment = size % alignment; | |
33270 } | |
33271 if (itemsize < (Py_ssize_t)alignment) | |
33272 itemsize = (Py_ssize_t)alignment; | |
33273 } | |
33274 if ((size_t)(basicsize + itemsize) < size) { | |
33275 PyErr_Format(PyExc_ValueError, | |
33276 "%.200s.%.200s size changed, may indicate binary incompatibility. " | |
33277 "Expected %zd from C header, got %zd from PyObject", | |
33278 module_name, class_name, size, basicsize+itemsize); | |
33279 goto bad; | |
33280 } | |
33281 if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 && | |
33282 ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { | |
33283 PyErr_Format(PyExc_ValueError, | |
33284 "%.200s.%.200s size changed, may indicate binary incompatibility. " | |
33285 "Expected %zd from C header, got %zd-%zd from PyObject", | |
33286 module_name, class_name, size, basicsize, basicsize+itemsize); | |
33287 goto bad; | |
33288 } | |
33289 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) { | |
33290 PyOS_snprintf(warning, sizeof(warning), | |
33291 "%s.%s size changed, may indicate binary incompatibility. " | |
33292 "Expected %zd from C header, got %zd from PyObject", | |
33293 module_name, class_name, size, basicsize); | |
33294 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; | |
33295 } | |
33296 return (PyTypeObject *)result; | |
33297 bad: | |
33298 Py_XDECREF(result); | |
33299 return NULL; | |
33300 } | |
33301 #endif | |
33302 | |
33303 /* ImportDottedModule */ | |
33304 #if PY_MAJOR_VERSION >= 3 | |
33305 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { | |
33306 PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; | |
33307 if (unlikely(PyErr_Occurred())) { | |
33308 PyErr_Clear(); | |
33309 } | |
33310 if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { | |
33311 partial_name = name; | |
33312 } else { | |
33313 slice = PySequence_GetSlice(parts_tuple, 0, count); | |
33314 if (unlikely(!slice)) | |
33315 goto bad; | |
33316 sep = PyUnicode_FromStringAndSize(".", 1); | |
33317 if (unlikely(!sep)) | |
33318 goto bad; | |
33319 partial_name = PyUnicode_Join(sep, slice); | |
33320 } | |
33321 PyErr_Format( | |
33322 #if PY_MAJOR_VERSION < 3 | |
33323 PyExc_ImportError, | |
33324 "No module named '%s'", PyString_AS_STRING(partial_name)); | |
33325 #else | |
33326 #if PY_VERSION_HEX >= 0x030600B1 | |
33327 PyExc_ModuleNotFoundError, | |
33328 #else | |
33329 PyExc_ImportError, | |
33330 #endif | |
33331 "No module named '%U'", partial_name); | |
33332 #endif | |
33333 bad: | |
33334 Py_XDECREF(sep); | |
33335 Py_XDECREF(slice); | |
33336 Py_XDECREF(partial_name); | |
33337 return NULL; | |
33338 } | |
33339 #endif | |
33340 #if PY_MAJOR_VERSION >= 3 | |
33341 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { | |
33342 PyObject *imported_module; | |
33343 #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) | |
33344 PyObject *modules = PyImport_GetModuleDict(); | |
33345 if (unlikely(!modules)) | |
33346 return NULL; | |
33347 imported_module = __Pyx_PyDict_GetItemStr(modules, name); | |
33348 Py_XINCREF(imported_module); | |
33349 #else | |
33350 imported_module = PyImport_GetModule(name); | |
33351 #endif | |
33352 return imported_module; | |
33353 } | |
33354 #endif | |
33355 #if PY_MAJOR_VERSION >= 3 | |
33356 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { | |
33357 Py_ssize_t i, nparts; | |
33358 nparts = PyTuple_GET_SIZE(parts_tuple); | |
33359 for (i=1; i < nparts && module; i++) { | |
33360 PyObject *part, *submodule; | |
33361 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
33362 part = PyTuple_GET_ITEM(parts_tuple, i); | |
33363 #else | |
33364 part = PySequence_ITEM(parts_tuple, i); | |
33365 #endif | |
33366 submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); | |
33367 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) | |
33368 Py_DECREF(part); | |
33369 #endif | |
33370 Py_DECREF(module); | |
33371 module = submodule; | |
33372 } | |
33373 if (unlikely(!module)) { | |
33374 return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); | |
33375 } | |
33376 return module; | |
33377 } | |
33378 #endif | |
33379 static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { | |
33380 #if PY_MAJOR_VERSION < 3 | |
33381 PyObject *module, *from_list, *star = __pyx_n_s__62; | |
33382 CYTHON_UNUSED_VAR(parts_tuple); | |
33383 from_list = PyList_New(1); | |
33384 if (unlikely(!from_list)) | |
33385 return NULL; | |
33386 Py_INCREF(star); | |
33387 PyList_SET_ITEM(from_list, 0, star); | |
33388 module = __Pyx_Import(name, from_list, 0); | |
33389 Py_DECREF(from_list); | |
33390 return module; | |
33391 #else | |
33392 PyObject *imported_module; | |
33393 PyObject *module = __Pyx_Import(name, NULL, 0); | |
33394 if (!parts_tuple || unlikely(!module)) | |
33395 return module; | |
33396 imported_module = __Pyx__ImportDottedModule_Lookup(name); | |
33397 if (likely(imported_module)) { | |
33398 Py_DECREF(module); | |
33399 return imported_module; | |
33400 } | |
33401 PyErr_Clear(); | |
33402 return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); | |
33403 #endif | |
33404 } | |
33405 static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { | |
33406 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 | |
33407 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); | |
33408 if (likely(module)) { | |
33409 PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); | |
33410 if (likely(spec)) { | |
33411 PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); | |
33412 if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { | |
33413 Py_DECREF(spec); | |
33414 spec = NULL; | |
33415 } | |
33416 Py_XDECREF(unsafe); | |
33417 } | |
33418 if (likely(!spec)) { | |
33419 PyErr_Clear(); | |
33420 return module; | |
33421 } | |
33422 Py_DECREF(spec); | |
33423 Py_DECREF(module); | |
33424 } else if (PyErr_Occurred()) { | |
33425 PyErr_Clear(); | |
33426 } | |
33427 #endif | |
33428 return __Pyx__ImportDottedModule(name, parts_tuple); | |
33429 } | |
33430 | |
33431 /* FetchSharedCythonModule */ | |
33432 static PyObject *__Pyx_FetchSharedCythonABIModule(void) { | |
33433 return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); | |
33434 } | |
33435 | |
33436 /* FetchCommonType */ | |
33437 static int __Pyx_VerifyCachedType(PyObject *cached_type, | |
33438 const char *name, | |
33439 Py_ssize_t basicsize, | |
33440 Py_ssize_t expected_basicsize) { | |
33441 if (!PyType_Check(cached_type)) { | |
33442 PyErr_Format(PyExc_TypeError, | |
33443 "Shared Cython type %.200s is not a type object", name); | |
33444 return -1; | |
33445 } | |
33446 if (basicsize != expected_basicsize) { | |
33447 PyErr_Format(PyExc_TypeError, | |
33448 "Shared Cython type %.200s has the wrong size, try recompiling", | |
33449 name); | |
33450 return -1; | |
33451 } | |
33452 return 0; | |
33453 } | |
33454 #if !CYTHON_USE_TYPE_SPECS | |
33455 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { | |
33456 PyObject* abi_module; | |
33457 const char* object_name; | |
33458 PyTypeObject *cached_type = NULL; | |
33459 abi_module = __Pyx_FetchSharedCythonABIModule(); | |
33460 if (!abi_module) return NULL; | |
33461 object_name = strrchr(type->tp_name, '.'); | |
33462 object_name = object_name ? object_name+1 : type->tp_name; | |
33463 cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); | |
33464 if (cached_type) { | |
33465 if (__Pyx_VerifyCachedType( | |
33466 (PyObject *)cached_type, | |
33467 object_name, | |
33468 cached_type->tp_basicsize, | |
33469 type->tp_basicsize) < 0) { | |
33470 goto bad; | |
33471 } | |
33472 goto done; | |
33473 } | |
33474 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; | |
33475 PyErr_Clear(); | |
33476 if (PyType_Ready(type) < 0) goto bad; | |
33477 if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) | |
33478 goto bad; | |
33479 Py_INCREF(type); | |
33480 cached_type = type; | |
33481 done: | |
33482 Py_DECREF(abi_module); | |
33483 return cached_type; | |
33484 bad: | |
33485 Py_XDECREF(cached_type); | |
33486 cached_type = NULL; | |
33487 goto done; | |
33488 } | |
33489 #else | |
33490 static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { | |
33491 PyObject *abi_module, *cached_type = NULL; | |
33492 const char* object_name = strrchr(spec->name, '.'); | |
33493 object_name = object_name ? object_name+1 : spec->name; | |
33494 abi_module = __Pyx_FetchSharedCythonABIModule(); | |
33495 if (!abi_module) return NULL; | |
33496 cached_type = PyObject_GetAttrString(abi_module, object_name); | |
33497 if (cached_type) { | |
33498 Py_ssize_t basicsize; | |
33499 #if CYTHON_COMPILING_IN_LIMITED_API | |
33500 PyObject *py_basicsize; | |
33501 py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); | |
33502 if (unlikely(!py_basicsize)) goto bad; | |
33503 basicsize = PyLong_AsSsize_t(py_basicsize); | |
33504 Py_DECREF(py_basicsize); | |
33505 py_basicsize = 0; | |
33506 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; | |
33507 #else | |
33508 basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; | |
33509 #endif | |
33510 if (__Pyx_VerifyCachedType( | |
33511 cached_type, | |
33512 object_name, | |
33513 basicsize, | |
33514 spec->basicsize) < 0) { | |
33515 goto bad; | |
33516 } | |
33517 goto done; | |
33518 } | |
33519 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; | |
33520 PyErr_Clear(); | |
33521 CYTHON_UNUSED_VAR(module); | |
33522 cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); | |
33523 if (unlikely(!cached_type)) goto bad; | |
33524 if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; | |
33525 if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; | |
33526 done: | |
33527 Py_DECREF(abi_module); | |
33528 assert(cached_type == NULL || PyType_Check(cached_type)); | |
33529 return (PyTypeObject *) cached_type; | |
33530 bad: | |
33531 Py_XDECREF(cached_type); | |
33532 cached_type = NULL; | |
33533 goto done; | |
33534 } | |
33535 #endif | |
33536 | |
33537 /* PyVectorcallFastCallDict */ | |
33538 #if CYTHON_METH_FASTCALL | |
33539 static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) | |
33540 { | |
33541 PyObject *res = NULL; | |
33542 PyObject *kwnames; | |
33543 PyObject **newargs; | |
33544 PyObject **kwvalues; | |
33545 Py_ssize_t i, pos; | |
33546 size_t j; | |
33547 PyObject *key, *value; | |
33548 unsigned long keys_are_strings; | |
33549 Py_ssize_t nkw = PyDict_GET_SIZE(kw); | |
33550 newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); | |
33551 if (unlikely(newargs == NULL)) { | |
33552 PyErr_NoMemory(); | |
33553 return NULL; | |
33554 } | |
33555 for (j = 0; j < nargs; j++) newargs[j] = args[j]; | |
33556 kwnames = PyTuple_New(nkw); | |
33557 if (unlikely(kwnames == NULL)) { | |
33558 PyMem_Free(newargs); | |
33559 return NULL; | |
33560 } | |
33561 kwvalues = newargs + nargs; | |
33562 pos = i = 0; | |
33563 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; | |
33564 while (PyDict_Next(kw, &pos, &key, &value)) { | |
33565 keys_are_strings &= Py_TYPE(key)->tp_flags; | |
33566 Py_INCREF(key); | |
33567 Py_INCREF(value); | |
33568 PyTuple_SET_ITEM(kwnames, i, key); | |
33569 kwvalues[i] = value; | |
33570 i++; | |
33571 } | |
33572 if (unlikely(!keys_are_strings)) { | |
33573 PyErr_SetString(PyExc_TypeError, "keywords must be strings"); | |
33574 goto cleanup; | |
33575 } | |
33576 res = vc(func, newargs, nargs, kwnames); | |
33577 cleanup: | |
33578 Py_DECREF(kwnames); | |
33579 for (i = 0; i < nkw; i++) | |
33580 Py_DECREF(kwvalues[i]); | |
33581 PyMem_Free(newargs); | |
33582 return res; | |
33583 } | |
33584 static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) | |
33585 { | |
33586 if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { | |
33587 return vc(func, args, nargs, NULL); | |
33588 } | |
33589 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); | |
33590 } | |
33591 #endif | |
33592 | |
33593 /* CythonFunctionShared */ | |
33594 #if CYTHON_COMPILING_IN_LIMITED_API | |
33595 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { | |
33596 if (__Pyx_CyFunction_Check(func)) { | |
33597 return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; | |
33598 } else if (PyCFunction_Check(func)) { | |
33599 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; | |
33600 } | |
33601 return 0; | |
33602 } | |
33603 #else | |
33604 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { | |
33605 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; | |
33606 } | |
33607 #endif | |
33608 static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { | |
33609 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API | |
33610 __Pyx_Py_XDECREF_SET( | |
33611 __Pyx_CyFunction_GetClassObj(f), | |
33612 ((classobj) ? __Pyx_NewRef(classobj) : NULL)); | |
33613 #else | |
33614 __Pyx_Py_XDECREF_SET( | |
33615 ((PyCMethodObject *) (f))->mm_class, | |
33616 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); | |
33617 #endif | |
33618 } | |
33619 static PyObject * | |
33620 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) | |
33621 { | |
33622 CYTHON_UNUSED_VAR(closure); | |
33623 if (unlikely(op->func_doc == NULL)) { | |
33624 #if CYTHON_COMPILING_IN_LIMITED_API | |
33625 op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); | |
33626 if (unlikely(!op->func_doc)) return NULL; | |
33627 #else | |
33628 if (((PyCFunctionObject*)op)->m_ml->ml_doc) { | |
33629 #if PY_MAJOR_VERSION >= 3 | |
33630 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); | |
33631 #else | |
33632 op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); | |
33633 #endif | |
33634 if (unlikely(op->func_doc == NULL)) | |
33635 return NULL; | |
33636 } else { | |
33637 Py_INCREF(Py_None); | |
33638 return Py_None; | |
33639 } | |
33640 #endif | |
33641 } | |
33642 Py_INCREF(op->func_doc); | |
33643 return op->func_doc; | |
33644 } | |
33645 static int | |
33646 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) | |
33647 { | |
33648 CYTHON_UNUSED_VAR(context); | |
33649 if (value == NULL) { | |
33650 value = Py_None; | |
33651 } | |
33652 Py_INCREF(value); | |
33653 __Pyx_Py_XDECREF_SET(op->func_doc, value); | |
33654 return 0; | |
33655 } | |
33656 static PyObject * | |
33657 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) | |
33658 { | |
33659 CYTHON_UNUSED_VAR(context); | |
33660 if (unlikely(op->func_name == NULL)) { | |
33661 #if CYTHON_COMPILING_IN_LIMITED_API | |
33662 op->func_name = PyObject_GetAttrString(op->func, "__name__"); | |
33663 #elif PY_MAJOR_VERSION >= 3 | |
33664 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); | |
33665 #else | |
33666 op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); | |
33667 #endif | |
33668 if (unlikely(op->func_name == NULL)) | |
33669 return NULL; | |
33670 } | |
33671 Py_INCREF(op->func_name); | |
33672 return op->func_name; | |
33673 } | |
33674 static int | |
33675 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) | |
33676 { | |
33677 CYTHON_UNUSED_VAR(context); | |
33678 #if PY_MAJOR_VERSION >= 3 | |
33679 if (unlikely(value == NULL || !PyUnicode_Check(value))) | |
33680 #else | |
33681 if (unlikely(value == NULL || !PyString_Check(value))) | |
33682 #endif | |
33683 { | |
33684 PyErr_SetString(PyExc_TypeError, | |
33685 "__name__ must be set to a string object"); | |
33686 return -1; | |
33687 } | |
33688 Py_INCREF(value); | |
33689 __Pyx_Py_XDECREF_SET(op->func_name, value); | |
33690 return 0; | |
33691 } | |
33692 static PyObject * | |
33693 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) | |
33694 { | |
33695 CYTHON_UNUSED_VAR(context); | |
33696 Py_INCREF(op->func_qualname); | |
33697 return op->func_qualname; | |
33698 } | |
33699 static int | |
33700 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) | |
33701 { | |
33702 CYTHON_UNUSED_VAR(context); | |
33703 #if PY_MAJOR_VERSION >= 3 | |
33704 if (unlikely(value == NULL || !PyUnicode_Check(value))) | |
33705 #else | |
33706 if (unlikely(value == NULL || !PyString_Check(value))) | |
33707 #endif | |
33708 { | |
33709 PyErr_SetString(PyExc_TypeError, | |
33710 "__qualname__ must be set to a string object"); | |
33711 return -1; | |
33712 } | |
33713 Py_INCREF(value); | |
33714 __Pyx_Py_XDECREF_SET(op->func_qualname, value); | |
33715 return 0; | |
33716 } | |
33717 static PyObject * | |
33718 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) | |
33719 { | |
33720 CYTHON_UNUSED_VAR(context); | |
33721 if (unlikely(op->func_dict == NULL)) { | |
33722 op->func_dict = PyDict_New(); | |
33723 if (unlikely(op->func_dict == NULL)) | |
33724 return NULL; | |
33725 } | |
33726 Py_INCREF(op->func_dict); | |
33727 return op->func_dict; | |
33728 } | |
33729 static int | |
33730 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) | |
33731 { | |
33732 CYTHON_UNUSED_VAR(context); | |
33733 if (unlikely(value == NULL)) { | |
33734 PyErr_SetString(PyExc_TypeError, | |
33735 "function's dictionary may not be deleted"); | |
33736 return -1; | |
33737 } | |
33738 if (unlikely(!PyDict_Check(value))) { | |
33739 PyErr_SetString(PyExc_TypeError, | |
33740 "setting function's dictionary to a non-dict"); | |
33741 return -1; | |
33742 } | |
33743 Py_INCREF(value); | |
33744 __Pyx_Py_XDECREF_SET(op->func_dict, value); | |
33745 return 0; | |
33746 } | |
33747 static PyObject * | |
33748 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) | |
33749 { | |
33750 CYTHON_UNUSED_VAR(context); | |
33751 Py_INCREF(op->func_globals); | |
33752 return op->func_globals; | |
33753 } | |
33754 static PyObject * | |
33755 __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) | |
33756 { | |
33757 CYTHON_UNUSED_VAR(op); | |
33758 CYTHON_UNUSED_VAR(context); | |
33759 Py_INCREF(Py_None); | |
33760 return Py_None; | |
33761 } | |
33762 static PyObject * | |
33763 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) | |
33764 { | |
33765 PyObject* result = (op->func_code) ? op->func_code : Py_None; | |
33766 CYTHON_UNUSED_VAR(context); | |
33767 Py_INCREF(result); | |
33768 return result; | |
33769 } | |
33770 static int | |
33771 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { | |
33772 int result = 0; | |
33773 PyObject *res = op->defaults_getter((PyObject *) op); | |
33774 if (unlikely(!res)) | |
33775 return -1; | |
33776 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
33777 op->defaults_tuple = PyTuple_GET_ITEM(res, 0); | |
33778 Py_INCREF(op->defaults_tuple); | |
33779 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); | |
33780 Py_INCREF(op->defaults_kwdict); | |
33781 #else | |
33782 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); | |
33783 if (unlikely(!op->defaults_tuple)) result = -1; | |
33784 else { | |
33785 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); | |
33786 if (unlikely(!op->defaults_kwdict)) result = -1; | |
33787 } | |
33788 #endif | |
33789 Py_DECREF(res); | |
33790 return result; | |
33791 } | |
33792 static int | |
33793 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { | |
33794 CYTHON_UNUSED_VAR(context); | |
33795 if (!value) { | |
33796 value = Py_None; | |
33797 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { | |
33798 PyErr_SetString(PyExc_TypeError, | |
33799 "__defaults__ must be set to a tuple object"); | |
33800 return -1; | |
33801 } | |
33802 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " | |
33803 "currently affect the values used in function calls", 1); | |
33804 Py_INCREF(value); | |
33805 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); | |
33806 return 0; | |
33807 } | |
33808 static PyObject * | |
33809 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { | |
33810 PyObject* result = op->defaults_tuple; | |
33811 CYTHON_UNUSED_VAR(context); | |
33812 if (unlikely(!result)) { | |
33813 if (op->defaults_getter) { | |
33814 if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; | |
33815 result = op->defaults_tuple; | |
33816 } else { | |
33817 result = Py_None; | |
33818 } | |
33819 } | |
33820 Py_INCREF(result); | |
33821 return result; | |
33822 } | |
33823 static int | |
33824 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { | |
33825 CYTHON_UNUSED_VAR(context); | |
33826 if (!value) { | |
33827 value = Py_None; | |
33828 } else if (unlikely(value != Py_None && !PyDict_Check(value))) { | |
33829 PyErr_SetString(PyExc_TypeError, | |
33830 "__kwdefaults__ must be set to a dict object"); | |
33831 return -1; | |
33832 } | |
33833 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " | |
33834 "currently affect the values used in function calls", 1); | |
33835 Py_INCREF(value); | |
33836 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); | |
33837 return 0; | |
33838 } | |
33839 static PyObject * | |
33840 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { | |
33841 PyObject* result = op->defaults_kwdict; | |
33842 CYTHON_UNUSED_VAR(context); | |
33843 if (unlikely(!result)) { | |
33844 if (op->defaults_getter) { | |
33845 if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; | |
33846 result = op->defaults_kwdict; | |
33847 } else { | |
33848 result = Py_None; | |
33849 } | |
33850 } | |
33851 Py_INCREF(result); | |
33852 return result; | |
33853 } | |
33854 static int | |
33855 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { | |
33856 CYTHON_UNUSED_VAR(context); | |
33857 if (!value || value == Py_None) { | |
33858 value = NULL; | |
33859 } else if (unlikely(!PyDict_Check(value))) { | |
33860 PyErr_SetString(PyExc_TypeError, | |
33861 "__annotations__ must be set to a dict object"); | |
33862 return -1; | |
33863 } | |
33864 Py_XINCREF(value); | |
33865 __Pyx_Py_XDECREF_SET(op->func_annotations, value); | |
33866 return 0; | |
33867 } | |
33868 static PyObject * | |
33869 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { | |
33870 PyObject* result = op->func_annotations; | |
33871 CYTHON_UNUSED_VAR(context); | |
33872 if (unlikely(!result)) { | |
33873 result = PyDict_New(); | |
33874 if (unlikely(!result)) return NULL; | |
33875 op->func_annotations = result; | |
33876 } | |
33877 Py_INCREF(result); | |
33878 return result; | |
33879 } | |
33880 static PyObject * | |
33881 __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { | |
33882 int is_coroutine; | |
33883 CYTHON_UNUSED_VAR(context); | |
33884 if (op->func_is_coroutine) { | |
33885 return __Pyx_NewRef(op->func_is_coroutine); | |
33886 } | |
33887 is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; | |
33888 #if PY_VERSION_HEX >= 0x03050000 | |
33889 if (is_coroutine) { | |
33890 PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; | |
33891 fromlist = PyList_New(1); | |
33892 if (unlikely(!fromlist)) return NULL; | |
33893 Py_INCREF(marker); | |
33894 #if CYTHON_ASSUME_SAFE_MACROS | |
33895 PyList_SET_ITEM(fromlist, 0, marker); | |
33896 #else | |
33897 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { | |
33898 Py_DECREF(marker); | |
33899 Py_DECREF(fromlist); | |
33900 return NULL; | |
33901 } | |
33902 #endif | |
33903 module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); | |
33904 Py_DECREF(fromlist); | |
33905 if (unlikely(!module)) goto ignore; | |
33906 op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); | |
33907 Py_DECREF(module); | |
33908 if (likely(op->func_is_coroutine)) { | |
33909 return __Pyx_NewRef(op->func_is_coroutine); | |
33910 } | |
33911 ignore: | |
33912 PyErr_Clear(); | |
33913 } | |
33914 #endif | |
33915 op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); | |
33916 return __Pyx_NewRef(op->func_is_coroutine); | |
33917 } | |
33918 #if CYTHON_COMPILING_IN_LIMITED_API | |
33919 static PyObject * | |
33920 __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { | |
33921 CYTHON_UNUSED_VAR(context); | |
33922 return PyObject_GetAttrString(op->func, "__module__"); | |
33923 } | |
33924 static int | |
33925 __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { | |
33926 CYTHON_UNUSED_VAR(context); | |
33927 return PyObject_SetAttrString(op->func, "__module__", value); | |
33928 } | |
33929 #endif | |
33930 static PyGetSetDef __pyx_CyFunction_getsets[] = { | |
33931 {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, | |
33932 {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, | |
33933 {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, | |
33934 {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, | |
33935 {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, | |
33936 {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, | |
33937 {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, | |
33938 {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, | |
33939 {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, | |
33940 {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, | |
33941 {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, | |
33942 {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, | |
33943 {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, | |
33944 {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, | |
33945 {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, | |
33946 {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, | |
33947 {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, | |
33948 {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, | |
33949 #if CYTHON_COMPILING_IN_LIMITED_API | |
33950 {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, | |
33951 #endif | |
33952 {0, 0, 0, 0, 0} | |
33953 }; | |
33954 static PyMemberDef __pyx_CyFunction_members[] = { | |
33955 #if !CYTHON_COMPILING_IN_LIMITED_API | |
33956 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, | |
33957 #endif | |
33958 #if CYTHON_USE_TYPE_SPECS | |
33959 {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, | |
33960 #if CYTHON_METH_FASTCALL | |
33961 #if CYTHON_BACKPORT_VECTORCALL | |
33962 {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, | |
33963 #else | |
33964 #if !CYTHON_COMPILING_IN_LIMITED_API | |
33965 {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, | |
33966 #endif | |
33967 #endif | |
33968 #endif | |
33969 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API | |
33970 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, | |
33971 #else | |
33972 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, | |
33973 #endif | |
33974 #endif | |
33975 {0, 0, 0, 0, 0} | |
33976 }; | |
33977 static PyObject * | |
33978 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) | |
33979 { | |
33980 CYTHON_UNUSED_VAR(args); | |
33981 #if PY_MAJOR_VERSION >= 3 | |
33982 Py_INCREF(m->func_qualname); | |
33983 return m->func_qualname; | |
33984 #else | |
33985 return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); | |
33986 #endif | |
33987 } | |
33988 static PyMethodDef __pyx_CyFunction_methods[] = { | |
33989 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, | |
33990 {0, 0, 0, 0} | |
33991 }; | |
33992 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API | |
33993 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) | |
33994 #else | |
33995 #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) | |
33996 #endif | |
33997 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, | |
33998 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { | |
33999 #if !CYTHON_COMPILING_IN_LIMITED_API | |
34000 PyCFunctionObject *cf = (PyCFunctionObject*) op; | |
34001 #endif | |
34002 if (unlikely(op == NULL)) | |
34003 return NULL; | |
34004 #if CYTHON_COMPILING_IN_LIMITED_API | |
34005 op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); | |
34006 if (unlikely(!op->func)) return NULL; | |
34007 #endif | |
34008 op->flags = flags; | |
34009 __Pyx_CyFunction_weakreflist(op) = NULL; | |
34010 #if !CYTHON_COMPILING_IN_LIMITED_API | |
34011 cf->m_ml = ml; | |
34012 cf->m_self = (PyObject *) op; | |
34013 #endif | |
34014 Py_XINCREF(closure); | |
34015 op->func_closure = closure; | |
34016 #if !CYTHON_COMPILING_IN_LIMITED_API | |
34017 Py_XINCREF(module); | |
34018 cf->m_module = module; | |
34019 #endif | |
34020 op->func_dict = NULL; | |
34021 op->func_name = NULL; | |
34022 Py_INCREF(qualname); | |
34023 op->func_qualname = qualname; | |
34024 op->func_doc = NULL; | |
34025 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API | |
34026 op->func_classobj = NULL; | |
34027 #else | |
34028 ((PyCMethodObject*)op)->mm_class = NULL; | |
34029 #endif | |
34030 op->func_globals = globals; | |
34031 Py_INCREF(op->func_globals); | |
34032 Py_XINCREF(code); | |
34033 op->func_code = code; | |
34034 op->defaults_pyobjects = 0; | |
34035 op->defaults_size = 0; | |
34036 op->defaults = NULL; | |
34037 op->defaults_tuple = NULL; | |
34038 op->defaults_kwdict = NULL; | |
34039 op->defaults_getter = NULL; | |
34040 op->func_annotations = NULL; | |
34041 op->func_is_coroutine = NULL; | |
34042 #if CYTHON_METH_FASTCALL | |
34043 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { | |
34044 case METH_NOARGS: | |
34045 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; | |
34046 break; | |
34047 case METH_O: | |
34048 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; | |
34049 break; | |
34050 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: | |
34051 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; | |
34052 break; | |
34053 case METH_FASTCALL | METH_KEYWORDS: | |
34054 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; | |
34055 break; | |
34056 case METH_VARARGS | METH_KEYWORDS: | |
34057 __Pyx_CyFunction_func_vectorcall(op) = NULL; | |
34058 break; | |
34059 default: | |
34060 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); | |
34061 Py_DECREF(op); | |
34062 return NULL; | |
34063 } | |
34064 #endif | |
34065 return (PyObject *) op; | |
34066 } | |
34067 static int | |
34068 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) | |
34069 { | |
34070 Py_CLEAR(m->func_closure); | |
34071 #if CYTHON_COMPILING_IN_LIMITED_API | |
34072 Py_CLEAR(m->func); | |
34073 #else | |
34074 Py_CLEAR(((PyCFunctionObject*)m)->m_module); | |
34075 #endif | |
34076 Py_CLEAR(m->func_dict); | |
34077 Py_CLEAR(m->func_name); | |
34078 Py_CLEAR(m->func_qualname); | |
34079 Py_CLEAR(m->func_doc); | |
34080 Py_CLEAR(m->func_globals); | |
34081 Py_CLEAR(m->func_code); | |
34082 #if !CYTHON_COMPILING_IN_LIMITED_API | |
34083 #if PY_VERSION_HEX < 0x030900B1 | |
34084 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); | |
34085 #else | |
34086 { | |
34087 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; | |
34088 ((PyCMethodObject *) (m))->mm_class = NULL; | |
34089 Py_XDECREF(cls); | |
34090 } | |
34091 #endif | |
34092 #endif | |
34093 Py_CLEAR(m->defaults_tuple); | |
34094 Py_CLEAR(m->defaults_kwdict); | |
34095 Py_CLEAR(m->func_annotations); | |
34096 Py_CLEAR(m->func_is_coroutine); | |
34097 if (m->defaults) { | |
34098 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); | |
34099 int i; | |
34100 for (i = 0; i < m->defaults_pyobjects; i++) | |
34101 Py_XDECREF(pydefaults[i]); | |
34102 PyObject_Free(m->defaults); | |
34103 m->defaults = NULL; | |
34104 } | |
34105 return 0; | |
34106 } | |
34107 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) | |
34108 { | |
34109 if (__Pyx_CyFunction_weakreflist(m) != NULL) | |
34110 PyObject_ClearWeakRefs((PyObject *) m); | |
34111 __Pyx_CyFunction_clear(m); | |
34112 __Pyx_PyHeapTypeObject_GC_Del(m); | |
34113 } | |
34114 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) | |
34115 { | |
34116 PyObject_GC_UnTrack(m); | |
34117 __Pyx__CyFunction_dealloc(m); | |
34118 } | |
34119 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) | |
34120 { | |
34121 Py_VISIT(m->func_closure); | |
34122 #if CYTHON_COMPILING_IN_LIMITED_API | |
34123 Py_VISIT(m->func); | |
34124 #else | |
34125 Py_VISIT(((PyCFunctionObject*)m)->m_module); | |
34126 #endif | |
34127 Py_VISIT(m->func_dict); | |
34128 Py_VISIT(m->func_name); | |
34129 Py_VISIT(m->func_qualname); | |
34130 Py_VISIT(m->func_doc); | |
34131 Py_VISIT(m->func_globals); | |
34132 Py_VISIT(m->func_code); | |
34133 #if !CYTHON_COMPILING_IN_LIMITED_API | |
34134 Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); | |
34135 #endif | |
34136 Py_VISIT(m->defaults_tuple); | |
34137 Py_VISIT(m->defaults_kwdict); | |
34138 Py_VISIT(m->func_is_coroutine); | |
34139 if (m->defaults) { | |
34140 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); | |
34141 int i; | |
34142 for (i = 0; i < m->defaults_pyobjects; i++) | |
34143 Py_VISIT(pydefaults[i]); | |
34144 } | |
34145 return 0; | |
34146 } | |
34147 static PyObject* | |
34148 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) | |
34149 { | |
34150 #if PY_MAJOR_VERSION >= 3 | |
34151 return PyUnicode_FromFormat("<cyfunction %U at %p>", | |
34152 op->func_qualname, (void *)op); | |
34153 #else | |
34154 return PyString_FromFormat("<cyfunction %s at %p>", | |
34155 PyString_AsString(op->func_qualname), (void *)op); | |
34156 #endif | |
34157 } | |
34158 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { | |
34159 #if CYTHON_COMPILING_IN_LIMITED_API | |
34160 PyObject *f = ((__pyx_CyFunctionObject*)func)->func; | |
34161 PyObject *py_name = NULL; | |
34162 PyCFunction meth; | |
34163 int flags; | |
34164 meth = PyCFunction_GetFunction(f); | |
34165 if (unlikely(!meth)) return NULL; | |
34166 flags = PyCFunction_GetFlags(f); | |
34167 if (unlikely(flags < 0)) return NULL; | |
34168 #else | |
34169 PyCFunctionObject* f = (PyCFunctionObject*)func; | |
34170 PyCFunction meth = f->m_ml->ml_meth; | |
34171 int flags = f->m_ml->ml_flags; | |
34172 #endif | |
34173 Py_ssize_t size; | |
34174 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { | |
34175 case METH_VARARGS: | |
34176 if (likely(kw == NULL || PyDict_Size(kw) == 0)) | |
34177 return (*meth)(self, arg); | |
34178 break; | |
34179 case METH_VARARGS | METH_KEYWORDS: | |
34180 return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); | |
34181 case METH_NOARGS: | |
34182 if (likely(kw == NULL || PyDict_Size(kw) == 0)) { | |
34183 #if CYTHON_ASSUME_SAFE_MACROS | |
34184 size = PyTuple_GET_SIZE(arg); | |
34185 #else | |
34186 size = PyTuple_Size(arg); | |
34187 if (unlikely(size < 0)) return NULL; | |
34188 #endif | |
34189 if (likely(size == 0)) | |
34190 return (*meth)(self, NULL); | |
34191 #if CYTHON_COMPILING_IN_LIMITED_API | |
34192 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); | |
34193 if (!py_name) return NULL; | |
34194 PyErr_Format(PyExc_TypeError, | |
34195 "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
34196 py_name, size); | |
34197 Py_DECREF(py_name); | |
34198 #else | |
34199 PyErr_Format(PyExc_TypeError, | |
34200 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
34201 f->m_ml->ml_name, size); | |
34202 #endif | |
34203 return NULL; | |
34204 } | |
34205 break; | |
34206 case METH_O: | |
34207 if (likely(kw == NULL || PyDict_Size(kw) == 0)) { | |
34208 #if CYTHON_ASSUME_SAFE_MACROS | |
34209 size = PyTuple_GET_SIZE(arg); | |
34210 #else | |
34211 size = PyTuple_Size(arg); | |
34212 if (unlikely(size < 0)) return NULL; | |
34213 #endif | |
34214 if (likely(size == 1)) { | |
34215 PyObject *result, *arg0; | |
34216 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
34217 arg0 = PyTuple_GET_ITEM(arg, 0); | |
34218 #else | |
34219 arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; | |
34220 #endif | |
34221 result = (*meth)(self, arg0); | |
34222 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) | |
34223 Py_DECREF(arg0); | |
34224 #endif | |
34225 return result; | |
34226 } | |
34227 #if CYTHON_COMPILING_IN_LIMITED_API | |
34228 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); | |
34229 if (!py_name) return NULL; | |
34230 PyErr_Format(PyExc_TypeError, | |
34231 "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
34232 py_name, size); | |
34233 Py_DECREF(py_name); | |
34234 #else | |
34235 PyErr_Format(PyExc_TypeError, | |
34236 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
34237 f->m_ml->ml_name, size); | |
34238 #endif | |
34239 return NULL; | |
34240 } | |
34241 break; | |
34242 default: | |
34243 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); | |
34244 return NULL; | |
34245 } | |
34246 #if CYTHON_COMPILING_IN_LIMITED_API | |
34247 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); | |
34248 if (!py_name) return NULL; | |
34249 PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", | |
34250 py_name); | |
34251 Py_DECREF(py_name); | |
34252 #else | |
34253 PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", | |
34254 f->m_ml->ml_name); | |
34255 #endif | |
34256 return NULL; | |
34257 } | |
34258 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { | |
34259 PyObject *self, *result; | |
34260 #if CYTHON_COMPILING_IN_LIMITED_API | |
34261 self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); | |
34262 if (unlikely(!self) && PyErr_Occurred()) return NULL; | |
34263 #else | |
34264 self = ((PyCFunctionObject*)func)->m_self; | |
34265 #endif | |
34266 result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); | |
34267 return result; | |
34268 } | |
34269 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { | |
34270 PyObject *result; | |
34271 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; | |
34272 #if CYTHON_METH_FASTCALL | |
34273 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); | |
34274 if (vc) { | |
34275 #if CYTHON_ASSUME_SAFE_MACROS | |
34276 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); | |
34277 #else | |
34278 (void) &__Pyx_PyVectorcall_FastCallDict; | |
34279 return PyVectorcall_Call(func, args, kw); | |
34280 #endif | |
34281 } | |
34282 #endif | |
34283 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { | |
34284 Py_ssize_t argc; | |
34285 PyObject *new_args; | |
34286 PyObject *self; | |
34287 #if CYTHON_ASSUME_SAFE_MACROS | |
34288 argc = PyTuple_GET_SIZE(args); | |
34289 #else | |
34290 argc = PyTuple_Size(args); | |
34291 if (unlikely(!argc) < 0) return NULL; | |
34292 #endif | |
34293 new_args = PyTuple_GetSlice(args, 1, argc); | |
34294 if (unlikely(!new_args)) | |
34295 return NULL; | |
34296 self = PyTuple_GetItem(args, 0); | |
34297 if (unlikely(!self)) { | |
34298 Py_DECREF(new_args); | |
34299 #if PY_MAJOR_VERSION > 2 | |
34300 PyErr_Format(PyExc_TypeError, | |
34301 "unbound method %.200S() needs an argument", | |
34302 cyfunc->func_qualname); | |
34303 #else | |
34304 PyErr_SetString(PyExc_TypeError, | |
34305 "unbound method needs an argument"); | |
34306 #endif | |
34307 return NULL; | |
34308 } | |
34309 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); | |
34310 Py_DECREF(new_args); | |
34311 } else { | |
34312 result = __Pyx_CyFunction_Call(func, args, kw); | |
34313 } | |
34314 return result; | |
34315 } | |
34316 #if CYTHON_METH_FASTCALL | |
34317 static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) | |
34318 { | |
34319 int ret = 0; | |
34320 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { | |
34321 if (unlikely(nargs < 1)) { | |
34322 PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", | |
34323 ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); | |
34324 return -1; | |
34325 } | |
34326 ret = 1; | |
34327 } | |
34328 if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { | |
34329 PyErr_Format(PyExc_TypeError, | |
34330 "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); | |
34331 return -1; | |
34332 } | |
34333 return ret; | |
34334 } | |
34335 static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) | |
34336 { | |
34337 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; | |
34338 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; | |
34339 #if CYTHON_BACKPORT_VECTORCALL | |
34340 Py_ssize_t nargs = (Py_ssize_t)nargsf; | |
34341 #else | |
34342 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); | |
34343 #endif | |
34344 PyObject *self; | |
34345 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { | |
34346 case 1: | |
34347 self = args[0]; | |
34348 args += 1; | |
34349 nargs -= 1; | |
34350 break; | |
34351 case 0: | |
34352 self = ((PyCFunctionObject*)cyfunc)->m_self; | |
34353 break; | |
34354 default: | |
34355 return NULL; | |
34356 } | |
34357 if (unlikely(nargs != 0)) { | |
34358 PyErr_Format(PyExc_TypeError, | |
34359 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
34360 def->ml_name, nargs); | |
34361 return NULL; | |
34362 } | |
34363 return def->ml_meth(self, NULL); | |
34364 } | |
34365 static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) | |
34366 { | |
34367 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; | |
34368 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; | |
34369 #if CYTHON_BACKPORT_VECTORCALL | |
34370 Py_ssize_t nargs = (Py_ssize_t)nargsf; | |
34371 #else | |
34372 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); | |
34373 #endif | |
34374 PyObject *self; | |
34375 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { | |
34376 case 1: | |
34377 self = args[0]; | |
34378 args += 1; | |
34379 nargs -= 1; | |
34380 break; | |
34381 case 0: | |
34382 self = ((PyCFunctionObject*)cyfunc)->m_self; | |
34383 break; | |
34384 default: | |
34385 return NULL; | |
34386 } | |
34387 if (unlikely(nargs != 1)) { | |
34388 PyErr_Format(PyExc_TypeError, | |
34389 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
34390 def->ml_name, nargs); | |
34391 return NULL; | |
34392 } | |
34393 return def->ml_meth(self, args[0]); | |
34394 } | |
34395 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) | |
34396 { | |
34397 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; | |
34398 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; | |
34399 #if CYTHON_BACKPORT_VECTORCALL | |
34400 Py_ssize_t nargs = (Py_ssize_t)nargsf; | |
34401 #else | |
34402 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); | |
34403 #endif | |
34404 PyObject *self; | |
34405 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { | |
34406 case 1: | |
34407 self = args[0]; | |
34408 args += 1; | |
34409 nargs -= 1; | |
34410 break; | |
34411 case 0: | |
34412 self = ((PyCFunctionObject*)cyfunc)->m_self; | |
34413 break; | |
34414 default: | |
34415 return NULL; | |
34416 } | |
34417 return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); | |
34418 } | |
34419 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) | |
34420 { | |
34421 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; | |
34422 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; | |
34423 PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); | |
34424 #if CYTHON_BACKPORT_VECTORCALL | |
34425 Py_ssize_t nargs = (Py_ssize_t)nargsf; | |
34426 #else | |
34427 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); | |
34428 #endif | |
34429 PyObject *self; | |
34430 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { | |
34431 case 1: | |
34432 self = args[0]; | |
34433 args += 1; | |
34434 nargs -= 1; | |
34435 break; | |
34436 case 0: | |
34437 self = ((PyCFunctionObject*)cyfunc)->m_self; | |
34438 break; | |
34439 default: | |
34440 return NULL; | |
34441 } | |
34442 return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); | |
34443 } | |
34444 #endif | |
34445 #if CYTHON_USE_TYPE_SPECS | |
34446 static PyType_Slot __pyx_CyFunctionType_slots[] = { | |
34447 {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, | |
34448 {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, | |
34449 {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, | |
34450 {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, | |
34451 {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, | |
34452 {Py_tp_methods, (void *)__pyx_CyFunction_methods}, | |
34453 {Py_tp_members, (void *)__pyx_CyFunction_members}, | |
34454 {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, | |
34455 {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, | |
34456 {0, 0}, | |
34457 }; | |
34458 static PyType_Spec __pyx_CyFunctionType_spec = { | |
34459 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", | |
34460 sizeof(__pyx_CyFunctionObject), | |
34461 0, | |
34462 #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR | |
34463 Py_TPFLAGS_METHOD_DESCRIPTOR | | |
34464 #endif | |
34465 #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) | |
34466 _Py_TPFLAGS_HAVE_VECTORCALL | | |
34467 #endif | |
34468 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, | |
34469 __pyx_CyFunctionType_slots | |
34470 }; | |
34471 #else | |
34472 static PyTypeObject __pyx_CyFunctionType_type = { | |
34473 PyVarObject_HEAD_INIT(0, 0) | |
34474 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", | |
34475 sizeof(__pyx_CyFunctionObject), | |
34476 0, | |
34477 (destructor) __Pyx_CyFunction_dealloc, | |
34478 #if !CYTHON_METH_FASTCALL | |
34479 0, | |
34480 #elif CYTHON_BACKPORT_VECTORCALL | |
34481 (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), | |
34482 #else | |
34483 offsetof(PyCFunctionObject, vectorcall), | |
34484 #endif | |
34485 0, | |
34486 0, | |
34487 #if PY_MAJOR_VERSION < 3 | |
34488 0, | |
34489 #else | |
34490 0, | |
34491 #endif | |
34492 (reprfunc) __Pyx_CyFunction_repr, | |
34493 0, | |
34494 0, | |
34495 0, | |
34496 0, | |
34497 __Pyx_CyFunction_CallAsMethod, | |
34498 0, | |
34499 0, | |
34500 0, | |
34501 0, | |
34502 #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR | |
34503 Py_TPFLAGS_METHOD_DESCRIPTOR | | |
34504 #endif | |
34505 #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL | |
34506 _Py_TPFLAGS_HAVE_VECTORCALL | | |
34507 #endif | |
34508 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, | |
34509 0, | |
34510 (traverseproc) __Pyx_CyFunction_traverse, | |
34511 (inquiry) __Pyx_CyFunction_clear, | |
34512 0, | |
34513 #if PY_VERSION_HEX < 0x030500A0 | |
34514 offsetof(__pyx_CyFunctionObject, func_weakreflist), | |
34515 #else | |
34516 offsetof(PyCFunctionObject, m_weakreflist), | |
34517 #endif | |
34518 0, | |
34519 0, | |
34520 __pyx_CyFunction_methods, | |
34521 __pyx_CyFunction_members, | |
34522 __pyx_CyFunction_getsets, | |
34523 0, | |
34524 0, | |
34525 __Pyx_PyMethod_New, | |
34526 0, | |
34527 offsetof(__pyx_CyFunctionObject, func_dict), | |
34528 0, | |
34529 0, | |
34530 0, | |
34531 0, | |
34532 0, | |
34533 0, | |
34534 0, | |
34535 0, | |
34536 0, | |
34537 0, | |
34538 0, | |
34539 0, | |
34540 #if PY_VERSION_HEX >= 0x030400a1 | |
34541 0, | |
34542 #endif | |
34543 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
34544 0, | |
34545 #endif | |
34546 #if __PYX_NEED_TP_PRINT_SLOT | |
34547 0, | |
34548 #endif | |
34549 #if PY_VERSION_HEX >= 0x030C0000 | |
34550 0, | |
34551 #endif | |
34552 #if PY_VERSION_HEX >= 0x030d00A4 | |
34553 0, | |
34554 #endif | |
34555 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
34556 0, | |
34557 #endif | |
34558 }; | |
34559 #endif | |
34560 static int __pyx_CyFunction_init(PyObject *module) { | |
34561 #if CYTHON_USE_TYPE_SPECS | |
34562 __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); | |
34563 #else | |
34564 CYTHON_UNUSED_VAR(module); | |
34565 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); | |
34566 #endif | |
34567 if (unlikely(__pyx_CyFunctionType == NULL)) { | |
34568 return -1; | |
34569 } | |
34570 return 0; | |
34571 } | |
34572 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { | |
34573 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
34574 m->defaults = PyObject_Malloc(size); | |
34575 if (unlikely(!m->defaults)) | |
34576 return PyErr_NoMemory(); | |
34577 memset(m->defaults, 0, size); | |
34578 m->defaults_pyobjects = pyobjects; | |
34579 m->defaults_size = size; | |
34580 return m->defaults; | |
34581 } | |
34582 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { | |
34583 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
34584 m->defaults_tuple = tuple; | |
34585 Py_INCREF(tuple); | |
34586 } | |
34587 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { | |
34588 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
34589 m->defaults_kwdict = dict; | |
34590 Py_INCREF(dict); | |
34591 } | |
34592 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { | |
34593 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
34594 m->func_annotations = dict; | |
34595 Py_INCREF(dict); | |
34596 } | |
34597 | |
34598 /* CythonFunction */ | |
34599 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, | |
34600 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { | |
34601 PyObject *op = __Pyx_CyFunction_Init( | |
34602 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), | |
34603 ml, flags, qualname, closure, module, globals, code | |
34604 ); | |
34605 if (likely(op)) { | |
34606 PyObject_GC_Track(op); | |
34607 } | |
34608 return op; | |
34609 } | |
34610 | |
34611 /* CalculateMetaclass */ | |
34612 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { | |
34613 Py_ssize_t i, nbases; | |
34614 #if CYTHON_ASSUME_SAFE_MACROS | |
34615 nbases = PyTuple_GET_SIZE(bases); | |
34616 #else | |
34617 nbases = PyTuple_Size(bases); | |
34618 if (nbases < 0) return NULL; | |
34619 #endif | |
34620 for (i=0; i < nbases; i++) { | |
34621 PyTypeObject *tmptype; | |
34622 #if CYTHON_ASSUME_SAFE_MACROS | |
34623 PyObject *tmp = PyTuple_GET_ITEM(bases, i); | |
34624 #else | |
34625 PyObject *tmp = PyTuple_GetItem(bases, i); | |
34626 if (!tmp) return NULL; | |
34627 #endif | |
34628 tmptype = Py_TYPE(tmp); | |
34629 #if PY_MAJOR_VERSION < 3 | |
34630 if (tmptype == &PyClass_Type) | |
34631 continue; | |
34632 #endif | |
34633 if (!metaclass) { | |
34634 metaclass = tmptype; | |
34635 continue; | |
34636 } | |
34637 if (PyType_IsSubtype(metaclass, tmptype)) | |
34638 continue; | |
34639 if (PyType_IsSubtype(tmptype, metaclass)) { | |
34640 metaclass = tmptype; | |
34641 continue; | |
34642 } | |
34643 PyErr_SetString(PyExc_TypeError, | |
34644 "metaclass conflict: " | |
34645 "the metaclass of a derived class " | |
34646 "must be a (non-strict) subclass " | |
34647 "of the metaclasses of all its bases"); | |
34648 return NULL; | |
34649 } | |
34650 if (!metaclass) { | |
34651 #if PY_MAJOR_VERSION < 3 | |
34652 metaclass = &PyClass_Type; | |
34653 #else | |
34654 metaclass = &PyType_Type; | |
34655 #endif | |
34656 } | |
34657 Py_INCREF((PyObject*) metaclass); | |
34658 return (PyObject*) metaclass; | |
34659 } | |
34660 | |
34661 /* PyObjectCall2Args */ | |
34662 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { | |
34663 PyObject *args[3] = {NULL, arg1, arg2}; | |
34664 return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); | |
34665 } | |
34666 | |
34667 /* PyObjectLookupSpecial */ | |
34668 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS | |
34669 static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { | |
34670 PyObject *res; | |
34671 PyTypeObject *tp = Py_TYPE(obj); | |
34672 #if PY_MAJOR_VERSION < 3 | |
34673 if (unlikely(PyInstance_Check(obj))) | |
34674 return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); | |
34675 #endif | |
34676 res = _PyType_Lookup(tp, attr_name); | |
34677 if (likely(res)) { | |
34678 descrgetfunc f = Py_TYPE(res)->tp_descr_get; | |
34679 if (!f) { | |
34680 Py_INCREF(res); | |
34681 } else { | |
34682 res = f(res, obj, (PyObject *)tp); | |
34683 } | |
34684 } else if (with_error) { | |
34685 PyErr_SetObject(PyExc_AttributeError, attr_name); | |
34686 } | |
34687 return res; | |
34688 } | |
34689 #endif | |
34690 | |
34691 /* Py3ClassCreate */ | |
34692 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, | |
34693 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { | |
34694 PyObject *ns; | |
34695 if (metaclass) { | |
34696 PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); | |
34697 if (prep) { | |
34698 PyObject *pargs[3] = {NULL, name, bases}; | |
34699 ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); | |
34700 Py_DECREF(prep); | |
34701 } else { | |
34702 if (unlikely(PyErr_Occurred())) | |
34703 return NULL; | |
34704 ns = PyDict_New(); | |
34705 } | |
34706 } else { | |
34707 ns = PyDict_New(); | |
34708 } | |
34709 if (unlikely(!ns)) | |
34710 return NULL; | |
34711 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; | |
34712 #if PY_VERSION_HEX >= 0x03030000 | |
34713 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; | |
34714 #else | |
34715 CYTHON_MAYBE_UNUSED_VAR(qualname); | |
34716 #endif | |
34717 if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; | |
34718 return ns; | |
34719 bad: | |
34720 Py_DECREF(ns); | |
34721 return NULL; | |
34722 } | |
34723 #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS | |
34724 static int __Pyx_SetNamesPEP487(PyObject *type_obj) { | |
34725 PyTypeObject *type = (PyTypeObject*) type_obj; | |
34726 PyObject *names_to_set, *key, *value, *set_name, *tmp; | |
34727 Py_ssize_t i = 0; | |
34728 #if CYTHON_USE_TYPE_SLOTS | |
34729 names_to_set = PyDict_Copy(type->tp_dict); | |
34730 #else | |
34731 { | |
34732 PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); | |
34733 names_to_set = NULL; | |
34734 if (likely(d)) { | |
34735 PyObject *names_to_set = PyDict_New(); | |
34736 int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; | |
34737 Py_DECREF(d); | |
34738 if (unlikely(ret < 0)) | |
34739 Py_CLEAR(names_to_set); | |
34740 } | |
34741 } | |
34742 #endif | |
34743 if (unlikely(names_to_set == NULL)) | |
34744 goto bad; | |
34745 while (PyDict_Next(names_to_set, &i, &key, &value)) { | |
34746 set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); | |
34747 if (unlikely(set_name != NULL)) { | |
34748 tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); | |
34749 Py_DECREF(set_name); | |
34750 if (unlikely(tmp == NULL)) { | |
34751 __Pyx_TypeName value_type_name = | |
34752 __Pyx_PyType_GetName(Py_TYPE(value)); | |
34753 __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); | |
34754 PyErr_Format(PyExc_RuntimeError, | |
34755 #if PY_MAJOR_VERSION >= 3 | |
34756 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", | |
34757 value_type_name, key, type_name); | |
34758 #else | |
34759 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", | |
34760 value_type_name, | |
34761 PyString_Check(key) ? PyString_AS_STRING(key) : "?", | |
34762 type_name); | |
34763 #endif | |
34764 goto bad; | |
34765 } else { | |
34766 Py_DECREF(tmp); | |
34767 } | |
34768 } | |
34769 else if (unlikely(PyErr_Occurred())) { | |
34770 goto bad; | |
34771 } | |
34772 } | |
34773 Py_DECREF(names_to_set); | |
34774 return 0; | |
34775 bad: | |
34776 Py_XDECREF(names_to_set); | |
34777 return -1; | |
34778 } | |
34779 static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { | |
34780 #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
34781 PyTypeObject *type = (PyTypeObject*) type_obj; | |
34782 PyObject *mro = type->tp_mro; | |
34783 Py_ssize_t i, nbases; | |
34784 if (unlikely(!mro)) goto done; | |
34785 (void) &__Pyx_GetBuiltinName; | |
34786 Py_INCREF(mro); | |
34787 nbases = PyTuple_GET_SIZE(mro); | |
34788 assert(PyTuple_GET_ITEM(mro, 0) == type_obj); | |
34789 for (i = 1; i < nbases-1; i++) { | |
34790 PyObject *base, *dict, *meth; | |
34791 base = PyTuple_GET_ITEM(mro, i); | |
34792 dict = ((PyTypeObject *)base)->tp_dict; | |
34793 meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); | |
34794 if (unlikely(meth)) { | |
34795 descrgetfunc f = Py_TYPE(meth)->tp_descr_get; | |
34796 PyObject *res; | |
34797 Py_INCREF(meth); | |
34798 if (likely(f)) { | |
34799 res = f(meth, NULL, type_obj); | |
34800 Py_DECREF(meth); | |
34801 if (unlikely(!res)) goto bad; | |
34802 meth = res; | |
34803 } | |
34804 res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); | |
34805 Py_DECREF(meth); | |
34806 if (unlikely(!res)) goto bad; | |
34807 Py_DECREF(res); | |
34808 goto done; | |
34809 } else if (unlikely(PyErr_Occurred())) { | |
34810 goto bad; | |
34811 } | |
34812 } | |
34813 done: | |
34814 Py_XDECREF(mro); | |
34815 return type_obj; | |
34816 bad: | |
34817 Py_XDECREF(mro); | |
34818 Py_DECREF(type_obj); | |
34819 return NULL; | |
34820 #else | |
34821 PyObject *super_type, *super, *func, *res; | |
34822 #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) | |
34823 super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); | |
34824 #else | |
34825 super_type = (PyObject*) &PySuper_Type; | |
34826 (void) &__Pyx_GetBuiltinName; | |
34827 #endif | |
34828 super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; | |
34829 #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) | |
34830 Py_XDECREF(super_type); | |
34831 #endif | |
34832 if (unlikely(!super)) { | |
34833 Py_CLEAR(type_obj); | |
34834 goto done; | |
34835 } | |
34836 func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); | |
34837 Py_DECREF(super); | |
34838 if (likely(!func)) { | |
34839 if (unlikely(PyErr_Occurred())) | |
34840 Py_CLEAR(type_obj); | |
34841 goto done; | |
34842 } | |
34843 res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); | |
34844 Py_DECREF(func); | |
34845 if (unlikely(!res)) | |
34846 Py_CLEAR(type_obj); | |
34847 Py_XDECREF(res); | |
34848 done: | |
34849 return type_obj; | |
34850 #endif | |
34851 } | |
34852 #endif | |
34853 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, | |
34854 PyObject *dict, PyObject *mkw, | |
34855 int calculate_metaclass, int allow_py2_metaclass) { | |
34856 PyObject *result; | |
34857 PyObject *owned_metaclass = NULL; | |
34858 PyObject *margs[4] = {NULL, name, bases, dict}; | |
34859 if (allow_py2_metaclass) { | |
34860 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); | |
34861 if (owned_metaclass) { | |
34862 metaclass = owned_metaclass; | |
34863 } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { | |
34864 PyErr_Clear(); | |
34865 } else { | |
34866 return NULL; | |
34867 } | |
34868 } | |
34869 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { | |
34870 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); | |
34871 Py_XDECREF(owned_metaclass); | |
34872 if (unlikely(!metaclass)) | |
34873 return NULL; | |
34874 owned_metaclass = metaclass; | |
34875 } | |
34876 result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, | |
34877 #if PY_VERSION_HEX < 0x030600A4 | |
34878 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw | |
34879 #else | |
34880 mkw | |
34881 #endif | |
34882 ); | |
34883 Py_XDECREF(owned_metaclass); | |
34884 #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS | |
34885 if (likely(result) && likely(PyType_Check(result))) { | |
34886 if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { | |
34887 Py_CLEAR(result); | |
34888 } else { | |
34889 result = __Pyx_InitSubclassPEP487(result, mkw); | |
34890 } | |
34891 } | |
34892 #else | |
34893 (void) &__Pyx_GetBuiltinName; | |
34894 #endif | |
34895 return result; | |
34896 } | |
34897 | |
34898 /* CLineInTraceback */ | |
34899 #ifndef CYTHON_CLINE_IN_TRACEBACK | |
34900 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { | |
34901 PyObject *use_cline; | |
34902 PyObject *ptype, *pvalue, *ptraceback; | |
34903 #if CYTHON_COMPILING_IN_CPYTHON | |
34904 PyObject **cython_runtime_dict; | |
34905 #endif | |
34906 CYTHON_MAYBE_UNUSED_VAR(tstate); | |
34907 if (unlikely(!__pyx_cython_runtime)) { | |
34908 return c_line; | |
34909 } | |
34910 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); | |
34911 #if CYTHON_COMPILING_IN_CPYTHON | |
34912 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); | |
34913 if (likely(cython_runtime_dict)) { | |
34914 __PYX_PY_DICT_LOOKUP_IF_MODIFIED( | |
34915 use_cline, *cython_runtime_dict, | |
34916 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) | |
34917 } else | |
34918 #endif | |
34919 { | |
34920 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); | |
34921 if (use_cline_obj) { | |
34922 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; | |
34923 Py_DECREF(use_cline_obj); | |
34924 } else { | |
34925 PyErr_Clear(); | |
34926 use_cline = NULL; | |
34927 } | |
34928 } | |
34929 if (!use_cline) { | |
34930 c_line = 0; | |
34931 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); | |
34932 } | |
34933 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { | |
34934 c_line = 0; | |
34935 } | |
34936 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); | |
34937 return c_line; | |
34938 } | |
34939 #endif | |
34940 | |
34941 /* CodeObjectCache */ | |
34942 #if !CYTHON_COMPILING_IN_LIMITED_API | |
34943 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { | |
34944 int start = 0, mid = 0, end = count - 1; | |
34945 if (end >= 0 && code_line > entries[end].code_line) { | |
34946 return count; | |
34947 } | |
34948 while (start < end) { | |
34949 mid = start + (end - start) / 2; | |
34950 if (code_line < entries[mid].code_line) { | |
34951 end = mid; | |
34952 } else if (code_line > entries[mid].code_line) { | |
34953 start = mid + 1; | |
34954 } else { | |
34955 return mid; | |
34956 } | |
34957 } | |
34958 if (code_line <= entries[mid].code_line) { | |
34959 return mid; | |
34960 } else { | |
34961 return mid + 1; | |
34962 } | |
34963 } | |
34964 static PyCodeObject *__pyx_find_code_object(int code_line) { | |
34965 PyCodeObject* code_object; | |
34966 int pos; | |
34967 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { | |
34968 return NULL; | |
34969 } | |
34970 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); | |
34971 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { | |
34972 return NULL; | |
34973 } | |
34974 code_object = __pyx_code_cache.entries[pos].code_object; | |
34975 Py_INCREF(code_object); | |
34976 return code_object; | |
34977 } | |
34978 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { | |
34979 int pos, i; | |
34980 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; | |
34981 if (unlikely(!code_line)) { | |
34982 return; | |
34983 } | |
34984 if (unlikely(!entries)) { | |
34985 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); | |
34986 if (likely(entries)) { | |
34987 __pyx_code_cache.entries = entries; | |
34988 __pyx_code_cache.max_count = 64; | |
34989 __pyx_code_cache.count = 1; | |
34990 entries[0].code_line = code_line; | |
34991 entries[0].code_object = code_object; | |
34992 Py_INCREF(code_object); | |
34993 } | |
34994 return; | |
34995 } | |
34996 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); | |
34997 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { | |
34998 PyCodeObject* tmp = entries[pos].code_object; | |
34999 entries[pos].code_object = code_object; | |
35000 Py_DECREF(tmp); | |
35001 return; | |
35002 } | |
35003 if (__pyx_code_cache.count == __pyx_code_cache.max_count) { | |
35004 int new_max = __pyx_code_cache.max_count + 64; | |
35005 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( | |
35006 __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); | |
35007 if (unlikely(!entries)) { | |
35008 return; | |
35009 } | |
35010 __pyx_code_cache.entries = entries; | |
35011 __pyx_code_cache.max_count = new_max; | |
35012 } | |
35013 for (i=__pyx_code_cache.count; i>pos; i--) { | |
35014 entries[i] = entries[i-1]; | |
35015 } | |
35016 entries[pos].code_line = code_line; | |
35017 entries[pos].code_object = code_object; | |
35018 __pyx_code_cache.count++; | |
35019 Py_INCREF(code_object); | |
35020 } | |
35021 #endif | |
35022 | |
35023 /* AddTraceback */ | |
35024 #include "compile.h" | |
35025 #include "frameobject.h" | |
35026 #include "traceback.h" | |
35027 #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API | |
35028 #ifndef Py_BUILD_CORE | |
35029 #define Py_BUILD_CORE 1 | |
35030 #endif | |
35031 #include "internal/pycore_frame.h" | |
35032 #endif | |
35033 #if CYTHON_COMPILING_IN_LIMITED_API | |
35034 static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, | |
35035 PyObject *firstlineno, PyObject *name) { | |
35036 PyObject *replace = NULL; | |
35037 if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; | |
35038 if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; | |
35039 replace = PyObject_GetAttrString(code, "replace"); | |
35040 if (likely(replace)) { | |
35041 PyObject *result; | |
35042 result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); | |
35043 Py_DECREF(replace); | |
35044 return result; | |
35045 } | |
35046 PyErr_Clear(); | |
35047 #if __PYX_LIMITED_VERSION_HEX < 0x030780000 | |
35048 { | |
35049 PyObject *compiled = NULL, *result = NULL; | |
35050 if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; | |
35051 if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; | |
35052 compiled = Py_CompileString( | |
35053 "out = type(code)(\n" | |
35054 " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" | |
35055 " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" | |
35056 " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" | |
35057 " code.co_lnotab)\n", "<dummy>", Py_file_input); | |
35058 if (!compiled) return NULL; | |
35059 result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); | |
35060 Py_DECREF(compiled); | |
35061 if (!result) PyErr_Print(); | |
35062 Py_DECREF(result); | |
35063 result = PyDict_GetItemString(scratch_dict, "out"); | |
35064 if (result) Py_INCREF(result); | |
35065 return result; | |
35066 } | |
35067 #else | |
35068 return NULL; | |
35069 #endif | |
35070 } | |
35071 static void __Pyx_AddTraceback(const char *funcname, int c_line, | |
35072 int py_line, const char *filename) { | |
35073 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; | |
35074 PyObject *replace = NULL, *getframe = NULL, *frame = NULL; | |
35075 PyObject *exc_type, *exc_value, *exc_traceback; | |
35076 int success = 0; | |
35077 if (c_line) { | |
35078 (void) __pyx_cfilenm; | |
35079 (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); | |
35080 } | |
35081 PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); | |
35082 code_object = Py_CompileString("_getframe()", filename, Py_eval_input); | |
35083 if (unlikely(!code_object)) goto bad; | |
35084 py_py_line = PyLong_FromLong(py_line); | |
35085 if (unlikely(!py_py_line)) goto bad; | |
35086 py_funcname = PyUnicode_FromString(funcname); | |
35087 if (unlikely(!py_funcname)) goto bad; | |
35088 dict = PyDict_New(); | |
35089 if (unlikely(!dict)) goto bad; | |
35090 { | |
35091 PyObject *old_code_object = code_object; | |
35092 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); | |
35093 Py_DECREF(old_code_object); | |
35094 } | |
35095 if (unlikely(!code_object)) goto bad; | |
35096 getframe = PySys_GetObject("_getframe"); | |
35097 if (unlikely(!getframe)) goto bad; | |
35098 if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; | |
35099 frame = PyEval_EvalCode(code_object, dict, dict); | |
35100 if (unlikely(!frame) || frame == Py_None) goto bad; | |
35101 success = 1; | |
35102 bad: | |
35103 PyErr_Restore(exc_type, exc_value, exc_traceback); | |
35104 Py_XDECREF(code_object); | |
35105 Py_XDECREF(py_py_line); | |
35106 Py_XDECREF(py_funcname); | |
35107 Py_XDECREF(dict); | |
35108 Py_XDECREF(replace); | |
35109 if (success) { | |
35110 PyTraceBack_Here( | |
35111 (struct _frame*)frame); | |
35112 } | |
35113 Py_XDECREF(frame); | |
35114 } | |
35115 #else | |
35116 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( | |
35117 const char *funcname, int c_line, | |
35118 int py_line, const char *filename) { | |
35119 PyCodeObject *py_code = NULL; | |
35120 PyObject *py_funcname = NULL; | |
35121 #if PY_MAJOR_VERSION < 3 | |
35122 PyObject *py_srcfile = NULL; | |
35123 py_srcfile = PyString_FromString(filename); | |
35124 if (!py_srcfile) goto bad; | |
35125 #endif | |
35126 if (c_line) { | |
35127 #if PY_MAJOR_VERSION < 3 | |
35128 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); | |
35129 if (!py_funcname) goto bad; | |
35130 #else | |
35131 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); | |
35132 if (!py_funcname) goto bad; | |
35133 funcname = PyUnicode_AsUTF8(py_funcname); | |
35134 if (!funcname) goto bad; | |
35135 #endif | |
35136 } | |
35137 else { | |
35138 #if PY_MAJOR_VERSION < 3 | |
35139 py_funcname = PyString_FromString(funcname); | |
35140 if (!py_funcname) goto bad; | |
35141 #endif | |
35142 } | |
35143 #if PY_MAJOR_VERSION < 3 | |
35144 py_code = __Pyx_PyCode_New( | |
35145 0, | |
35146 0, | |
35147 0, | |
35148 0, | |
35149 0, | |
35150 0, | |
35151 __pyx_empty_bytes, /*PyObject *code,*/ | |
35152 __pyx_empty_tuple, /*PyObject *consts,*/ | |
35153 __pyx_empty_tuple, /*PyObject *names,*/ | |
35154 __pyx_empty_tuple, /*PyObject *varnames,*/ | |
35155 __pyx_empty_tuple, /*PyObject *freevars,*/ | |
35156 __pyx_empty_tuple, /*PyObject *cellvars,*/ | |
35157 py_srcfile, /*PyObject *filename,*/ | |
35158 py_funcname, /*PyObject *name,*/ | |
35159 py_line, | |
35160 __pyx_empty_bytes /*PyObject *lnotab*/ | |
35161 ); | |
35162 Py_DECREF(py_srcfile); | |
35163 #else | |
35164 py_code = PyCode_NewEmpty(filename, funcname, py_line); | |
35165 #endif | |
35166 Py_XDECREF(py_funcname); | |
35167 return py_code; | |
35168 bad: | |
35169 Py_XDECREF(py_funcname); | |
35170 #if PY_MAJOR_VERSION < 3 | |
35171 Py_XDECREF(py_srcfile); | |
35172 #endif | |
35173 return NULL; | |
35174 } | |
35175 static void __Pyx_AddTraceback(const char *funcname, int c_line, | |
35176 int py_line, const char *filename) { | |
35177 PyCodeObject *py_code = 0; | |
35178 PyFrameObject *py_frame = 0; | |
35179 PyThreadState *tstate = __Pyx_PyThreadState_Current; | |
35180 PyObject *ptype, *pvalue, *ptraceback; | |
35181 if (c_line) { | |
35182 c_line = __Pyx_CLineForTraceback(tstate, c_line); | |
35183 } | |
35184 py_code = __pyx_find_code_object(c_line ? -c_line : py_line); | |
35185 if (!py_code) { | |
35186 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); | |
35187 py_code = __Pyx_CreateCodeObjectForTraceback( | |
35188 funcname, c_line, py_line, filename); | |
35189 if (!py_code) { | |
35190 /* If the code object creation fails, then we should clear the | |
35191 fetched exception references and propagate the new exception */ | |
35192 Py_XDECREF(ptype); | |
35193 Py_XDECREF(pvalue); | |
35194 Py_XDECREF(ptraceback); | |
35195 goto bad; | |
35196 } | |
35197 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); | |
35198 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); | |
35199 } | |
35200 py_frame = PyFrame_New( | |
35201 tstate, /*PyThreadState *tstate,*/ | |
35202 py_code, /*PyCodeObject *code,*/ | |
35203 __pyx_d, /*PyObject *globals,*/ | |
35204 0 /*PyObject *locals*/ | |
35205 ); | |
35206 if (!py_frame) goto bad; | |
35207 __Pyx_PyFrame_SetLineNumber(py_frame, py_line); | |
35208 PyTraceBack_Here(py_frame); | |
35209 bad: | |
35210 Py_XDECREF(py_code); | |
35211 Py_XDECREF(py_frame); | |
35212 } | |
35213 #endif | |
35214 | |
35215 /* CIntFromPyVerify */ | |
35216 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ | |
35217 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) | |
35218 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ | |
35219 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) | |
35220 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ | |
35221 {\ | |
35222 func_type value = func_value;\ | |
35223 if (sizeof(target_type) < sizeof(func_type)) {\ | |
35224 if (unlikely(value != (func_type) (target_type) value)) {\ | |
35225 func_type zero = 0;\ | |
35226 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ | |
35227 return (target_type) -1;\ | |
35228 if (is_unsigned && unlikely(value < zero))\ | |
35229 goto raise_neg_overflow;\ | |
35230 else\ | |
35231 goto raise_overflow;\ | |
35232 }\ | |
35233 }\ | |
35234 return (target_type) value;\ | |
35235 } | |
35236 | |
35237 /* CIntFromPy */ | |
35238 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { | |
35239 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
35240 #pragma GCC diagnostic push | |
35241 #pragma GCC diagnostic ignored "-Wconversion" | |
35242 #endif | |
35243 const int neg_one = (int) -1, const_zero = (int) 0; | |
35244 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
35245 #pragma GCC diagnostic pop | |
35246 #endif | |
35247 const int is_unsigned = neg_one > const_zero; | |
35248 #if PY_MAJOR_VERSION < 3 | |
35249 if (likely(PyInt_Check(x))) { | |
35250 if ((sizeof(int) < sizeof(long))) { | |
35251 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) | |
35252 } else { | |
35253 long val = PyInt_AS_LONG(x); | |
35254 if (is_unsigned && unlikely(val < 0)) { | |
35255 goto raise_neg_overflow; | |
35256 } | |
35257 return (int) val; | |
35258 } | |
35259 } | |
35260 #endif | |
35261 if (unlikely(!PyLong_Check(x))) { | |
35262 int val; | |
35263 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); | |
35264 if (!tmp) return (int) -1; | |
35265 val = __Pyx_PyInt_As_int(tmp); | |
35266 Py_DECREF(tmp); | |
35267 return val; | |
35268 } | |
35269 if (is_unsigned) { | |
35270 #if CYTHON_USE_PYLONG_INTERNALS | |
35271 if (unlikely(__Pyx_PyLong_IsNeg(x))) { | |
35272 goto raise_neg_overflow; | |
35273 } else if (__Pyx_PyLong_IsCompact(x)) { | |
35274 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) | |
35275 } else { | |
35276 const digit* digits = __Pyx_PyLong_Digits(x); | |
35277 assert(__Pyx_PyLong_DigitCount(x) > 1); | |
35278 switch (__Pyx_PyLong_DigitCount(x)) { | |
35279 case 2: | |
35280 if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { | |
35281 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
35282 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35283 } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { | |
35284 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); | |
35285 } | |
35286 } | |
35287 break; | |
35288 case 3: | |
35289 if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { | |
35290 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
35291 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35292 } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { | |
35293 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); | |
35294 } | |
35295 } | |
35296 break; | |
35297 case 4: | |
35298 if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { | |
35299 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
35300 __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]))) | |
35301 } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { | |
35302 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); | |
35303 } | |
35304 } | |
35305 break; | |
35306 } | |
35307 } | |
35308 #endif | |
35309 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 | |
35310 if (unlikely(Py_SIZE(x) < 0)) { | |
35311 goto raise_neg_overflow; | |
35312 } | |
35313 #else | |
35314 { | |
35315 int result = PyObject_RichCompareBool(x, Py_False, Py_LT); | |
35316 if (unlikely(result < 0)) | |
35317 return (int) -1; | |
35318 if (unlikely(result == 1)) | |
35319 goto raise_neg_overflow; | |
35320 } | |
35321 #endif | |
35322 if ((sizeof(int) <= sizeof(unsigned long))) { | |
35323 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) | |
35324 #ifdef HAVE_LONG_LONG | |
35325 } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { | |
35326 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) | |
35327 #endif | |
35328 } | |
35329 } else { | |
35330 #if CYTHON_USE_PYLONG_INTERNALS | |
35331 if (__Pyx_PyLong_IsCompact(x)) { | |
35332 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) | |
35333 } else { | |
35334 const digit* digits = __Pyx_PyLong_Digits(x); | |
35335 assert(__Pyx_PyLong_DigitCount(x) > 1); | |
35336 switch (__Pyx_PyLong_SignedDigitCount(x)) { | |
35337 case -2: | |
35338 if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { | |
35339 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
35340 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35341 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { | |
35342 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
35343 } | |
35344 } | |
35345 break; | |
35346 case 2: | |
35347 if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { | |
35348 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
35349 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35350 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { | |
35351 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
35352 } | |
35353 } | |
35354 break; | |
35355 case -3: | |
35356 if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { | |
35357 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
35358 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35359 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { | |
35360 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
35361 } | |
35362 } | |
35363 break; | |
35364 case 3: | |
35365 if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { | |
35366 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
35367 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35368 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { | |
35369 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
35370 } | |
35371 } | |
35372 break; | |
35373 case -4: | |
35374 if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { | |
35375 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
35376 __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]))) | |
35377 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { | |
35378 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
35379 } | |
35380 } | |
35381 break; | |
35382 case 4: | |
35383 if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { | |
35384 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
35385 __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]))) | |
35386 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { | |
35387 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
35388 } | |
35389 } | |
35390 break; | |
35391 } | |
35392 } | |
35393 #endif | |
35394 if ((sizeof(int) <= sizeof(long))) { | |
35395 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) | |
35396 #ifdef HAVE_LONG_LONG | |
35397 } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { | |
35398 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) | |
35399 #endif | |
35400 } | |
35401 } | |
35402 { | |
35403 int val; | |
35404 int ret = -1; | |
35405 #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API | |
35406 Py_ssize_t bytes_copied = PyLong_AsNativeBytes( | |
35407 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); | |
35408 if (unlikely(bytes_copied == -1)) { | |
35409 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { | |
35410 goto raise_overflow; | |
35411 } else { | |
35412 ret = 0; | |
35413 } | |
35414 #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) | |
35415 int one = 1; int is_little = (int)*(unsigned char *)&one; | |
35416 unsigned char *bytes = (unsigned char *)&val; | |
35417 ret = _PyLong_AsByteArray((PyLongObject *)x, | |
35418 bytes, sizeof(val), | |
35419 is_little, !is_unsigned); | |
35420 #else | |
35421 PyObject *v; | |
35422 PyObject *stepval = NULL, *mask = NULL, *shift = NULL; | |
35423 int bits, remaining_bits, is_negative = 0; | |
35424 int chunk_size = (sizeof(long) < 8) ? 30 : 62; | |
35425 if (likely(PyLong_CheckExact(x))) { | |
35426 v = __Pyx_NewRef(x); | |
35427 } else { | |
35428 v = PyNumber_Long(x); | |
35429 if (unlikely(!v)) return (int) -1; | |
35430 assert(PyLong_CheckExact(v)); | |
35431 } | |
35432 { | |
35433 int result = PyObject_RichCompareBool(v, Py_False, Py_LT); | |
35434 if (unlikely(result < 0)) { | |
35435 Py_DECREF(v); | |
35436 return (int) -1; | |
35437 } | |
35438 is_negative = result == 1; | |
35439 } | |
35440 if (is_unsigned && unlikely(is_negative)) { | |
35441 Py_DECREF(v); | |
35442 goto raise_neg_overflow; | |
35443 } else if (is_negative) { | |
35444 stepval = PyNumber_Invert(v); | |
35445 Py_DECREF(v); | |
35446 if (unlikely(!stepval)) | |
35447 return (int) -1; | |
35448 } else { | |
35449 stepval = v; | |
35450 } | |
35451 v = NULL; | |
35452 val = (int) 0; | |
35453 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; | |
35454 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; | |
35455 for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { | |
35456 PyObject *tmp, *digit; | |
35457 long idigit; | |
35458 digit = PyNumber_And(stepval, mask); | |
35459 if (unlikely(!digit)) goto done; | |
35460 idigit = PyLong_AsLong(digit); | |
35461 Py_DECREF(digit); | |
35462 if (unlikely(idigit < 0)) goto done; | |
35463 val |= ((int) idigit) << bits; | |
35464 tmp = PyNumber_Rshift(stepval, shift); | |
35465 if (unlikely(!tmp)) goto done; | |
35466 Py_DECREF(stepval); stepval = tmp; | |
35467 } | |
35468 Py_DECREF(shift); shift = NULL; | |
35469 Py_DECREF(mask); mask = NULL; | |
35470 { | |
35471 long idigit = PyLong_AsLong(stepval); | |
35472 if (unlikely(idigit < 0)) goto done; | |
35473 remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); | |
35474 if (unlikely(idigit >= (1L << remaining_bits))) | |
35475 goto raise_overflow; | |
35476 val |= ((int) idigit) << bits; | |
35477 } | |
35478 if (!is_unsigned) { | |
35479 if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) | |
35480 goto raise_overflow; | |
35481 if (is_negative) | |
35482 val = ~val; | |
35483 } | |
35484 ret = 0; | |
35485 done: | |
35486 Py_XDECREF(shift); | |
35487 Py_XDECREF(mask); | |
35488 Py_XDECREF(stepval); | |
35489 #endif | |
35490 if (unlikely(ret)) | |
35491 return (int) -1; | |
35492 return val; | |
35493 } | |
35494 raise_overflow: | |
35495 PyErr_SetString(PyExc_OverflowError, | |
35496 "value too large to convert to int"); | |
35497 return (int) -1; | |
35498 raise_neg_overflow: | |
35499 PyErr_SetString(PyExc_OverflowError, | |
35500 "can't convert negative value to int"); | |
35501 return (int) -1; | |
35502 } | |
35503 | |
35504 /* CIntToPy */ | |
35505 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { | |
35506 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
35507 #pragma GCC diagnostic push | |
35508 #pragma GCC diagnostic ignored "-Wconversion" | |
35509 #endif | |
35510 const int neg_one = (int) -1, const_zero = (int) 0; | |
35511 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
35512 #pragma GCC diagnostic pop | |
35513 #endif | |
35514 const int is_unsigned = neg_one > const_zero; | |
35515 if (is_unsigned) { | |
35516 if (sizeof(int) < sizeof(long)) { | |
35517 return PyInt_FromLong((long) value); | |
35518 } else if (sizeof(int) <= sizeof(unsigned long)) { | |
35519 return PyLong_FromUnsignedLong((unsigned long) value); | |
35520 #ifdef HAVE_LONG_LONG | |
35521 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { | |
35522 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); | |
35523 #endif | |
35524 } | |
35525 } else { | |
35526 if (sizeof(int) <= sizeof(long)) { | |
35527 return PyInt_FromLong((long) value); | |
35528 #ifdef HAVE_LONG_LONG | |
35529 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { | |
35530 return PyLong_FromLongLong((PY_LONG_LONG) value); | |
35531 #endif | |
35532 } | |
35533 } | |
35534 { | |
35535 unsigned char *bytes = (unsigned char *)&value; | |
35536 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 | |
35537 if (is_unsigned) { | |
35538 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); | |
35539 } else { | |
35540 return PyLong_FromNativeBytes(bytes, sizeof(value), -1); | |
35541 } | |
35542 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 | |
35543 int one = 1; int little = (int)*(unsigned char *)&one; | |
35544 return _PyLong_FromByteArray(bytes, sizeof(int), | |
35545 little, !is_unsigned); | |
35546 #else | |
35547 int one = 1; int little = (int)*(unsigned char *)&one; | |
35548 PyObject *from_bytes, *result = NULL; | |
35549 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; | |
35550 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); | |
35551 if (!from_bytes) return NULL; | |
35552 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); | |
35553 if (!py_bytes) goto limited_bad; | |
35554 order_str = PyUnicode_FromString(little ? "little" : "big"); | |
35555 if (!order_str) goto limited_bad; | |
35556 arg_tuple = PyTuple_Pack(2, py_bytes, order_str); | |
35557 if (!arg_tuple) goto limited_bad; | |
35558 if (!is_unsigned) { | |
35559 kwds = PyDict_New(); | |
35560 if (!kwds) goto limited_bad; | |
35561 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; | |
35562 } | |
35563 result = PyObject_Call(from_bytes, arg_tuple, kwds); | |
35564 limited_bad: | |
35565 Py_XDECREF(kwds); | |
35566 Py_XDECREF(arg_tuple); | |
35567 Py_XDECREF(order_str); | |
35568 Py_XDECREF(py_bytes); | |
35569 Py_XDECREF(from_bytes); | |
35570 return result; | |
35571 #endif | |
35572 } | |
35573 } | |
35574 | |
35575 /* CIntFromPy */ | |
35576 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { | |
35577 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
35578 #pragma GCC diagnostic push | |
35579 #pragma GCC diagnostic ignored "-Wconversion" | |
35580 #endif | |
35581 const long neg_one = (long) -1, const_zero = (long) 0; | |
35582 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
35583 #pragma GCC diagnostic pop | |
35584 #endif | |
35585 const int is_unsigned = neg_one > const_zero; | |
35586 #if PY_MAJOR_VERSION < 3 | |
35587 if (likely(PyInt_Check(x))) { | |
35588 if ((sizeof(long) < sizeof(long))) { | |
35589 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) | |
35590 } else { | |
35591 long val = PyInt_AS_LONG(x); | |
35592 if (is_unsigned && unlikely(val < 0)) { | |
35593 goto raise_neg_overflow; | |
35594 } | |
35595 return (long) val; | |
35596 } | |
35597 } | |
35598 #endif | |
35599 if (unlikely(!PyLong_Check(x))) { | |
35600 long val; | |
35601 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); | |
35602 if (!tmp) return (long) -1; | |
35603 val = __Pyx_PyInt_As_long(tmp); | |
35604 Py_DECREF(tmp); | |
35605 return val; | |
35606 } | |
35607 if (is_unsigned) { | |
35608 #if CYTHON_USE_PYLONG_INTERNALS | |
35609 if (unlikely(__Pyx_PyLong_IsNeg(x))) { | |
35610 goto raise_neg_overflow; | |
35611 } else if (__Pyx_PyLong_IsCompact(x)) { | |
35612 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) | |
35613 } else { | |
35614 const digit* digits = __Pyx_PyLong_Digits(x); | |
35615 assert(__Pyx_PyLong_DigitCount(x) > 1); | |
35616 switch (__Pyx_PyLong_DigitCount(x)) { | |
35617 case 2: | |
35618 if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { | |
35619 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
35620 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35621 } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { | |
35622 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); | |
35623 } | |
35624 } | |
35625 break; | |
35626 case 3: | |
35627 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { | |
35628 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
35629 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35630 } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { | |
35631 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); | |
35632 } | |
35633 } | |
35634 break; | |
35635 case 4: | |
35636 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { | |
35637 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
35638 __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]))) | |
35639 } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { | |
35640 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); | |
35641 } | |
35642 } | |
35643 break; | |
35644 } | |
35645 } | |
35646 #endif | |
35647 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 | |
35648 if (unlikely(Py_SIZE(x) < 0)) { | |
35649 goto raise_neg_overflow; | |
35650 } | |
35651 #else | |
35652 { | |
35653 int result = PyObject_RichCompareBool(x, Py_False, Py_LT); | |
35654 if (unlikely(result < 0)) | |
35655 return (long) -1; | |
35656 if (unlikely(result == 1)) | |
35657 goto raise_neg_overflow; | |
35658 } | |
35659 #endif | |
35660 if ((sizeof(long) <= sizeof(unsigned long))) { | |
35661 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) | |
35662 #ifdef HAVE_LONG_LONG | |
35663 } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { | |
35664 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) | |
35665 #endif | |
35666 } | |
35667 } else { | |
35668 #if CYTHON_USE_PYLONG_INTERNALS | |
35669 if (__Pyx_PyLong_IsCompact(x)) { | |
35670 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) | |
35671 } else { | |
35672 const digit* digits = __Pyx_PyLong_Digits(x); | |
35673 assert(__Pyx_PyLong_DigitCount(x) > 1); | |
35674 switch (__Pyx_PyLong_SignedDigitCount(x)) { | |
35675 case -2: | |
35676 if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { | |
35677 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
35678 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35679 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { | |
35680 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
35681 } | |
35682 } | |
35683 break; | |
35684 case 2: | |
35685 if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { | |
35686 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
35687 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35688 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { | |
35689 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
35690 } | |
35691 } | |
35692 break; | |
35693 case -3: | |
35694 if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { | |
35695 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
35696 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35697 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { | |
35698 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
35699 } | |
35700 } | |
35701 break; | |
35702 case 3: | |
35703 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { | |
35704 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
35705 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35706 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { | |
35707 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
35708 } | |
35709 } | |
35710 break; | |
35711 case -4: | |
35712 if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { | |
35713 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
35714 __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]))) | |
35715 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { | |
35716 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
35717 } | |
35718 } | |
35719 break; | |
35720 case 4: | |
35721 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { | |
35722 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
35723 __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]))) | |
35724 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { | |
35725 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
35726 } | |
35727 } | |
35728 break; | |
35729 } | |
35730 } | |
35731 #endif | |
35732 if ((sizeof(long) <= sizeof(long))) { | |
35733 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) | |
35734 #ifdef HAVE_LONG_LONG | |
35735 } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { | |
35736 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) | |
35737 #endif | |
35738 } | |
35739 } | |
35740 { | |
35741 long val; | |
35742 int ret = -1; | |
35743 #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API | |
35744 Py_ssize_t bytes_copied = PyLong_AsNativeBytes( | |
35745 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); | |
35746 if (unlikely(bytes_copied == -1)) { | |
35747 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { | |
35748 goto raise_overflow; | |
35749 } else { | |
35750 ret = 0; | |
35751 } | |
35752 #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) | |
35753 int one = 1; int is_little = (int)*(unsigned char *)&one; | |
35754 unsigned char *bytes = (unsigned char *)&val; | |
35755 ret = _PyLong_AsByteArray((PyLongObject *)x, | |
35756 bytes, sizeof(val), | |
35757 is_little, !is_unsigned); | |
35758 #else | |
35759 PyObject *v; | |
35760 PyObject *stepval = NULL, *mask = NULL, *shift = NULL; | |
35761 int bits, remaining_bits, is_negative = 0; | |
35762 int chunk_size = (sizeof(long) < 8) ? 30 : 62; | |
35763 if (likely(PyLong_CheckExact(x))) { | |
35764 v = __Pyx_NewRef(x); | |
35765 } else { | |
35766 v = PyNumber_Long(x); | |
35767 if (unlikely(!v)) return (long) -1; | |
35768 assert(PyLong_CheckExact(v)); | |
35769 } | |
35770 { | |
35771 int result = PyObject_RichCompareBool(v, Py_False, Py_LT); | |
35772 if (unlikely(result < 0)) { | |
35773 Py_DECREF(v); | |
35774 return (long) -1; | |
35775 } | |
35776 is_negative = result == 1; | |
35777 } | |
35778 if (is_unsigned && unlikely(is_negative)) { | |
35779 Py_DECREF(v); | |
35780 goto raise_neg_overflow; | |
35781 } else if (is_negative) { | |
35782 stepval = PyNumber_Invert(v); | |
35783 Py_DECREF(v); | |
35784 if (unlikely(!stepval)) | |
35785 return (long) -1; | |
35786 } else { | |
35787 stepval = v; | |
35788 } | |
35789 v = NULL; | |
35790 val = (long) 0; | |
35791 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; | |
35792 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; | |
35793 for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { | |
35794 PyObject *tmp, *digit; | |
35795 long idigit; | |
35796 digit = PyNumber_And(stepval, mask); | |
35797 if (unlikely(!digit)) goto done; | |
35798 idigit = PyLong_AsLong(digit); | |
35799 Py_DECREF(digit); | |
35800 if (unlikely(idigit < 0)) goto done; | |
35801 val |= ((long) idigit) << bits; | |
35802 tmp = PyNumber_Rshift(stepval, shift); | |
35803 if (unlikely(!tmp)) goto done; | |
35804 Py_DECREF(stepval); stepval = tmp; | |
35805 } | |
35806 Py_DECREF(shift); shift = NULL; | |
35807 Py_DECREF(mask); mask = NULL; | |
35808 { | |
35809 long idigit = PyLong_AsLong(stepval); | |
35810 if (unlikely(idigit < 0)) goto done; | |
35811 remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); | |
35812 if (unlikely(idigit >= (1L << remaining_bits))) | |
35813 goto raise_overflow; | |
35814 val |= ((long) idigit) << bits; | |
35815 } | |
35816 if (!is_unsigned) { | |
35817 if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) | |
35818 goto raise_overflow; | |
35819 if (is_negative) | |
35820 val = ~val; | |
35821 } | |
35822 ret = 0; | |
35823 done: | |
35824 Py_XDECREF(shift); | |
35825 Py_XDECREF(mask); | |
35826 Py_XDECREF(stepval); | |
35827 #endif | |
35828 if (unlikely(ret)) | |
35829 return (long) -1; | |
35830 return val; | |
35831 } | |
35832 raise_overflow: | |
35833 PyErr_SetString(PyExc_OverflowError, | |
35834 "value too large to convert to long"); | |
35835 return (long) -1; | |
35836 raise_neg_overflow: | |
35837 PyErr_SetString(PyExc_OverflowError, | |
35838 "can't convert negative value to long"); | |
35839 return (long) -1; | |
35840 } | |
35841 | |
35842 /* CIntFromPy */ | |
35843 static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) { | |
35844 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
35845 #pragma GCC diagnostic push | |
35846 #pragma GCC diagnostic ignored "-Wconversion" | |
35847 #endif | |
35848 const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; | |
35849 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
35850 #pragma GCC diagnostic pop | |
35851 #endif | |
35852 const int is_unsigned = neg_one > const_zero; | |
35853 #if PY_MAJOR_VERSION < 3 | |
35854 if (likely(PyInt_Check(x))) { | |
35855 if ((sizeof(int64_t) < sizeof(long))) { | |
35856 __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x)) | |
35857 } else { | |
35858 long val = PyInt_AS_LONG(x); | |
35859 if (is_unsigned && unlikely(val < 0)) { | |
35860 goto raise_neg_overflow; | |
35861 } | |
35862 return (int64_t) val; | |
35863 } | |
35864 } | |
35865 #endif | |
35866 if (unlikely(!PyLong_Check(x))) { | |
35867 int64_t val; | |
35868 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); | |
35869 if (!tmp) return (int64_t) -1; | |
35870 val = __Pyx_PyInt_As_int64_t(tmp); | |
35871 Py_DECREF(tmp); | |
35872 return val; | |
35873 } | |
35874 if (is_unsigned) { | |
35875 #if CYTHON_USE_PYLONG_INTERNALS | |
35876 if (unlikely(__Pyx_PyLong_IsNeg(x))) { | |
35877 goto raise_neg_overflow; | |
35878 } else if (__Pyx_PyLong_IsCompact(x)) { | |
35879 __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) | |
35880 } else { | |
35881 const digit* digits = __Pyx_PyLong_Digits(x); | |
35882 assert(__Pyx_PyLong_DigitCount(x) > 1); | |
35883 switch (__Pyx_PyLong_DigitCount(x)) { | |
35884 case 2: | |
35885 if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) { | |
35886 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
35887 __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35888 } else if ((8 * sizeof(int64_t) >= 2 * PyLong_SHIFT)) { | |
35889 return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); | |
35890 } | |
35891 } | |
35892 break; | |
35893 case 3: | |
35894 if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) { | |
35895 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
35896 __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35897 } else if ((8 * sizeof(int64_t) >= 3 * PyLong_SHIFT)) { | |
35898 return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); | |
35899 } | |
35900 } | |
35901 break; | |
35902 case 4: | |
35903 if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) { | |
35904 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
35905 __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35906 } else if ((8 * sizeof(int64_t) >= 4 * PyLong_SHIFT)) { | |
35907 return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); | |
35908 } | |
35909 } | |
35910 break; | |
35911 } | |
35912 } | |
35913 #endif | |
35914 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 | |
35915 if (unlikely(Py_SIZE(x) < 0)) { | |
35916 goto raise_neg_overflow; | |
35917 } | |
35918 #else | |
35919 { | |
35920 int result = PyObject_RichCompareBool(x, Py_False, Py_LT); | |
35921 if (unlikely(result < 0)) | |
35922 return (int64_t) -1; | |
35923 if (unlikely(result == 1)) | |
35924 goto raise_neg_overflow; | |
35925 } | |
35926 #endif | |
35927 if ((sizeof(int64_t) <= sizeof(unsigned long))) { | |
35928 __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x)) | |
35929 #ifdef HAVE_LONG_LONG | |
35930 } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) { | |
35931 __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) | |
35932 #endif | |
35933 } | |
35934 } else { | |
35935 #if CYTHON_USE_PYLONG_INTERNALS | |
35936 if (__Pyx_PyLong_IsCompact(x)) { | |
35937 __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) | |
35938 } else { | |
35939 const digit* digits = __Pyx_PyLong_Digits(x); | |
35940 assert(__Pyx_PyLong_DigitCount(x) > 1); | |
35941 switch (__Pyx_PyLong_SignedDigitCount(x)) { | |
35942 case -2: | |
35943 if ((8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT)) { | |
35944 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
35945 __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35946 } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { | |
35947 return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); | |
35948 } | |
35949 } | |
35950 break; | |
35951 case 2: | |
35952 if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) { | |
35953 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
35954 __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35955 } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { | |
35956 return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); | |
35957 } | |
35958 } | |
35959 break; | |
35960 case -3: | |
35961 if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) { | |
35962 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
35963 __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35964 } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { | |
35965 return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); | |
35966 } | |
35967 } | |
35968 break; | |
35969 case 3: | |
35970 if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) { | |
35971 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
35972 __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35973 } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { | |
35974 return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); | |
35975 } | |
35976 } | |
35977 break; | |
35978 case -4: | |
35979 if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) { | |
35980 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
35981 __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35982 } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) { | |
35983 return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); | |
35984 } | |
35985 } | |
35986 break; | |
35987 case 4: | |
35988 if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) { | |
35989 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
35990 __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
35991 } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) { | |
35992 return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); | |
35993 } | |
35994 } | |
35995 break; | |
35996 } | |
35997 } | |
35998 #endif | |
35999 if ((sizeof(int64_t) <= sizeof(long))) { | |
36000 __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x)) | |
36001 #ifdef HAVE_LONG_LONG | |
36002 } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) { | |
36003 __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) | |
36004 #endif | |
36005 } | |
36006 } | |
36007 { | |
36008 int64_t val; | |
36009 int ret = -1; | |
36010 #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API | |
36011 Py_ssize_t bytes_copied = PyLong_AsNativeBytes( | |
36012 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); | |
36013 if (unlikely(bytes_copied == -1)) { | |
36014 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { | |
36015 goto raise_overflow; | |
36016 } else { | |
36017 ret = 0; | |
36018 } | |
36019 #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) | |
36020 int one = 1; int is_little = (int)*(unsigned char *)&one; | |
36021 unsigned char *bytes = (unsigned char *)&val; | |
36022 ret = _PyLong_AsByteArray((PyLongObject *)x, | |
36023 bytes, sizeof(val), | |
36024 is_little, !is_unsigned); | |
36025 #else | |
36026 PyObject *v; | |
36027 PyObject *stepval = NULL, *mask = NULL, *shift = NULL; | |
36028 int bits, remaining_bits, is_negative = 0; | |
36029 int chunk_size = (sizeof(long) < 8) ? 30 : 62; | |
36030 if (likely(PyLong_CheckExact(x))) { | |
36031 v = __Pyx_NewRef(x); | |
36032 } else { | |
36033 v = PyNumber_Long(x); | |
36034 if (unlikely(!v)) return (int64_t) -1; | |
36035 assert(PyLong_CheckExact(v)); | |
36036 } | |
36037 { | |
36038 int result = PyObject_RichCompareBool(v, Py_False, Py_LT); | |
36039 if (unlikely(result < 0)) { | |
36040 Py_DECREF(v); | |
36041 return (int64_t) -1; | |
36042 } | |
36043 is_negative = result == 1; | |
36044 } | |
36045 if (is_unsigned && unlikely(is_negative)) { | |
36046 Py_DECREF(v); | |
36047 goto raise_neg_overflow; | |
36048 } else if (is_negative) { | |
36049 stepval = PyNumber_Invert(v); | |
36050 Py_DECREF(v); | |
36051 if (unlikely(!stepval)) | |
36052 return (int64_t) -1; | |
36053 } else { | |
36054 stepval = v; | |
36055 } | |
36056 v = NULL; | |
36057 val = (int64_t) 0; | |
36058 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; | |
36059 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; | |
36060 for (bits = 0; bits < (int) sizeof(int64_t) * 8 - chunk_size; bits += chunk_size) { | |
36061 PyObject *tmp, *digit; | |
36062 long idigit; | |
36063 digit = PyNumber_And(stepval, mask); | |
36064 if (unlikely(!digit)) goto done; | |
36065 idigit = PyLong_AsLong(digit); | |
36066 Py_DECREF(digit); | |
36067 if (unlikely(idigit < 0)) goto done; | |
36068 val |= ((int64_t) idigit) << bits; | |
36069 tmp = PyNumber_Rshift(stepval, shift); | |
36070 if (unlikely(!tmp)) goto done; | |
36071 Py_DECREF(stepval); stepval = tmp; | |
36072 } | |
36073 Py_DECREF(shift); shift = NULL; | |
36074 Py_DECREF(mask); mask = NULL; | |
36075 { | |
36076 long idigit = PyLong_AsLong(stepval); | |
36077 if (unlikely(idigit < 0)) goto done; | |
36078 remaining_bits = ((int) sizeof(int64_t) * 8) - bits - (is_unsigned ? 0 : 1); | |
36079 if (unlikely(idigit >= (1L << remaining_bits))) | |
36080 goto raise_overflow; | |
36081 val |= ((int64_t) idigit) << bits; | |
36082 } | |
36083 if (!is_unsigned) { | |
36084 if (unlikely(val & (((int64_t) 1) << (sizeof(int64_t) * 8 - 1)))) | |
36085 goto raise_overflow; | |
36086 if (is_negative) | |
36087 val = ~val; | |
36088 } | |
36089 ret = 0; | |
36090 done: | |
36091 Py_XDECREF(shift); | |
36092 Py_XDECREF(mask); | |
36093 Py_XDECREF(stepval); | |
36094 #endif | |
36095 if (unlikely(ret)) | |
36096 return (int64_t) -1; | |
36097 return val; | |
36098 } | |
36099 raise_overflow: | |
36100 PyErr_SetString(PyExc_OverflowError, | |
36101 "value too large to convert to int64_t"); | |
36102 return (int64_t) -1; | |
36103 raise_neg_overflow: | |
36104 PyErr_SetString(PyExc_OverflowError, | |
36105 "can't convert negative value to int64_t"); | |
36106 return (int64_t) -1; | |
36107 } | |
36108 | |
36109 /* CIntToPy */ | |
36110 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { | |
36111 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
36112 #pragma GCC diagnostic push | |
36113 #pragma GCC diagnostic ignored "-Wconversion" | |
36114 #endif | |
36115 const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; | |
36116 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
36117 #pragma GCC diagnostic pop | |
36118 #endif | |
36119 const int is_unsigned = neg_one > const_zero; | |
36120 if (is_unsigned) { | |
36121 if (sizeof(int32_t) < sizeof(long)) { | |
36122 return PyInt_FromLong((long) value); | |
36123 } else if (sizeof(int32_t) <= sizeof(unsigned long)) { | |
36124 return PyLong_FromUnsignedLong((unsigned long) value); | |
36125 #ifdef HAVE_LONG_LONG | |
36126 } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { | |
36127 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); | |
36128 #endif | |
36129 } | |
36130 } else { | |
36131 if (sizeof(int32_t) <= sizeof(long)) { | |
36132 return PyInt_FromLong((long) value); | |
36133 #ifdef HAVE_LONG_LONG | |
36134 } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { | |
36135 return PyLong_FromLongLong((PY_LONG_LONG) value); | |
36136 #endif | |
36137 } | |
36138 } | |
36139 { | |
36140 unsigned char *bytes = (unsigned char *)&value; | |
36141 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 | |
36142 if (is_unsigned) { | |
36143 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); | |
36144 } else { | |
36145 return PyLong_FromNativeBytes(bytes, sizeof(value), -1); | |
36146 } | |
36147 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 | |
36148 int one = 1; int little = (int)*(unsigned char *)&one; | |
36149 return _PyLong_FromByteArray(bytes, sizeof(int32_t), | |
36150 little, !is_unsigned); | |
36151 #else | |
36152 int one = 1; int little = (int)*(unsigned char *)&one; | |
36153 PyObject *from_bytes, *result = NULL; | |
36154 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; | |
36155 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); | |
36156 if (!from_bytes) return NULL; | |
36157 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int32_t)); | |
36158 if (!py_bytes) goto limited_bad; | |
36159 order_str = PyUnicode_FromString(little ? "little" : "big"); | |
36160 if (!order_str) goto limited_bad; | |
36161 arg_tuple = PyTuple_Pack(2, py_bytes, order_str); | |
36162 if (!arg_tuple) goto limited_bad; | |
36163 if (!is_unsigned) { | |
36164 kwds = PyDict_New(); | |
36165 if (!kwds) goto limited_bad; | |
36166 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; | |
36167 } | |
36168 result = PyObject_Call(from_bytes, arg_tuple, kwds); | |
36169 limited_bad: | |
36170 Py_XDECREF(kwds); | |
36171 Py_XDECREF(arg_tuple); | |
36172 Py_XDECREF(order_str); | |
36173 Py_XDECREF(py_bytes); | |
36174 Py_XDECREF(from_bytes); | |
36175 return result; | |
36176 #endif | |
36177 } | |
36178 } | |
36179 | |
36180 /* CIntToPy */ | |
36181 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { | |
36182 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
36183 #pragma GCC diagnostic push | |
36184 #pragma GCC diagnostic ignored "-Wconversion" | |
36185 #endif | |
36186 const long neg_one = (long) -1, const_zero = (long) 0; | |
36187 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
36188 #pragma GCC diagnostic pop | |
36189 #endif | |
36190 const int is_unsigned = neg_one > const_zero; | |
36191 if (is_unsigned) { | |
36192 if (sizeof(long) < sizeof(long)) { | |
36193 return PyInt_FromLong((long) value); | |
36194 } else if (sizeof(long) <= sizeof(unsigned long)) { | |
36195 return PyLong_FromUnsignedLong((unsigned long) value); | |
36196 #ifdef HAVE_LONG_LONG | |
36197 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { | |
36198 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); | |
36199 #endif | |
36200 } | |
36201 } else { | |
36202 if (sizeof(long) <= sizeof(long)) { | |
36203 return PyInt_FromLong((long) value); | |
36204 #ifdef HAVE_LONG_LONG | |
36205 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { | |
36206 return PyLong_FromLongLong((PY_LONG_LONG) value); | |
36207 #endif | |
36208 } | |
36209 } | |
36210 { | |
36211 unsigned char *bytes = (unsigned char *)&value; | |
36212 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 | |
36213 if (is_unsigned) { | |
36214 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); | |
36215 } else { | |
36216 return PyLong_FromNativeBytes(bytes, sizeof(value), -1); | |
36217 } | |
36218 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 | |
36219 int one = 1; int little = (int)*(unsigned char *)&one; | |
36220 return _PyLong_FromByteArray(bytes, sizeof(long), | |
36221 little, !is_unsigned); | |
36222 #else | |
36223 int one = 1; int little = (int)*(unsigned char *)&one; | |
36224 PyObject *from_bytes, *result = NULL; | |
36225 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; | |
36226 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); | |
36227 if (!from_bytes) return NULL; | |
36228 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); | |
36229 if (!py_bytes) goto limited_bad; | |
36230 order_str = PyUnicode_FromString(little ? "little" : "big"); | |
36231 if (!order_str) goto limited_bad; | |
36232 arg_tuple = PyTuple_Pack(2, py_bytes, order_str); | |
36233 if (!arg_tuple) goto limited_bad; | |
36234 if (!is_unsigned) { | |
36235 kwds = PyDict_New(); | |
36236 if (!kwds) goto limited_bad; | |
36237 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; | |
36238 } | |
36239 result = PyObject_Call(from_bytes, arg_tuple, kwds); | |
36240 limited_bad: | |
36241 Py_XDECREF(kwds); | |
36242 Py_XDECREF(arg_tuple); | |
36243 Py_XDECREF(order_str); | |
36244 Py_XDECREF(py_bytes); | |
36245 Py_XDECREF(from_bytes); | |
36246 return result; | |
36247 #endif | |
36248 } | |
36249 } | |
36250 | |
36251 /* CIntFromPy */ | |
36252 static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) { | |
36253 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
36254 #pragma GCC diagnostic push | |
36255 #pragma GCC diagnostic ignored "-Wconversion" | |
36256 #endif | |
36257 const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; | |
36258 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
36259 #pragma GCC diagnostic pop | |
36260 #endif | |
36261 const int is_unsigned = neg_one > const_zero; | |
36262 #if PY_MAJOR_VERSION < 3 | |
36263 if (likely(PyInt_Check(x))) { | |
36264 if ((sizeof(int32_t) < sizeof(long))) { | |
36265 __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG(x)) | |
36266 } else { | |
36267 long val = PyInt_AS_LONG(x); | |
36268 if (is_unsigned && unlikely(val < 0)) { | |
36269 goto raise_neg_overflow; | |
36270 } | |
36271 return (int32_t) val; | |
36272 } | |
36273 } | |
36274 #endif | |
36275 if (unlikely(!PyLong_Check(x))) { | |
36276 int32_t val; | |
36277 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); | |
36278 if (!tmp) return (int32_t) -1; | |
36279 val = __Pyx_PyInt_As_int32_t(tmp); | |
36280 Py_DECREF(tmp); | |
36281 return val; | |
36282 } | |
36283 if (is_unsigned) { | |
36284 #if CYTHON_USE_PYLONG_INTERNALS | |
36285 if (unlikely(__Pyx_PyLong_IsNeg(x))) { | |
36286 goto raise_neg_overflow; | |
36287 } else if (__Pyx_PyLong_IsCompact(x)) { | |
36288 __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) | |
36289 } else { | |
36290 const digit* digits = __Pyx_PyLong_Digits(x); | |
36291 assert(__Pyx_PyLong_DigitCount(x) > 1); | |
36292 switch (__Pyx_PyLong_DigitCount(x)) { | |
36293 case 2: | |
36294 if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) { | |
36295 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
36296 __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
36297 } else if ((8 * sizeof(int32_t) >= 2 * PyLong_SHIFT)) { | |
36298 return (int32_t) (((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); | |
36299 } | |
36300 } | |
36301 break; | |
36302 case 3: | |
36303 if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) { | |
36304 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
36305 __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
36306 } else if ((8 * sizeof(int32_t) >= 3 * PyLong_SHIFT)) { | |
36307 return (int32_t) (((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); | |
36308 } | |
36309 } | |
36310 break; | |
36311 case 4: | |
36312 if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) { | |
36313 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
36314 __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
36315 } else if ((8 * sizeof(int32_t) >= 4 * PyLong_SHIFT)) { | |
36316 return (int32_t) (((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])); | |
36317 } | |
36318 } | |
36319 break; | |
36320 } | |
36321 } | |
36322 #endif | |
36323 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 | |
36324 if (unlikely(Py_SIZE(x) < 0)) { | |
36325 goto raise_neg_overflow; | |
36326 } | |
36327 #else | |
36328 { | |
36329 int result = PyObject_RichCompareBool(x, Py_False, Py_LT); | |
36330 if (unlikely(result < 0)) | |
36331 return (int32_t) -1; | |
36332 if (unlikely(result == 1)) | |
36333 goto raise_neg_overflow; | |
36334 } | |
36335 #endif | |
36336 if ((sizeof(int32_t) <= sizeof(unsigned long))) { | |
36337 __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x)) | |
36338 #ifdef HAVE_LONG_LONG | |
36339 } else if ((sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG))) { | |
36340 __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) | |
36341 #endif | |
36342 } | |
36343 } else { | |
36344 #if CYTHON_USE_PYLONG_INTERNALS | |
36345 if (__Pyx_PyLong_IsCompact(x)) { | |
36346 __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) | |
36347 } else { | |
36348 const digit* digits = __Pyx_PyLong_Digits(x); | |
36349 assert(__Pyx_PyLong_DigitCount(x) > 1); | |
36350 switch (__Pyx_PyLong_SignedDigitCount(x)) { | |
36351 case -2: | |
36352 if ((8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT)) { | |
36353 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
36354 __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
36355 } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { | |
36356 return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); | |
36357 } | |
36358 } | |
36359 break; | |
36360 case 2: | |
36361 if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) { | |
36362 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
36363 __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
36364 } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { | |
36365 return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); | |
36366 } | |
36367 } | |
36368 break; | |
36369 case -3: | |
36370 if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) { | |
36371 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
36372 __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
36373 } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { | |
36374 return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); | |
36375 } | |
36376 } | |
36377 break; | |
36378 case 3: | |
36379 if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) { | |
36380 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
36381 __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
36382 } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { | |
36383 return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); | |
36384 } | |
36385 } | |
36386 break; | |
36387 case -4: | |
36388 if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) { | |
36389 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
36390 __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
36391 } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) { | |
36392 return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); | |
36393 } | |
36394 } | |
36395 break; | |
36396 case 4: | |
36397 if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) { | |
36398 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
36399 __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
36400 } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) { | |
36401 return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]))); | |
36402 } | |
36403 } | |
36404 break; | |
36405 } | |
36406 } | |
36407 #endif | |
36408 if ((sizeof(int32_t) <= sizeof(long))) { | |
36409 __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x)) | |
36410 #ifdef HAVE_LONG_LONG | |
36411 } else if ((sizeof(int32_t) <= sizeof(PY_LONG_LONG))) { | |
36412 __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) | |
36413 #endif | |
36414 } | |
36415 } | |
36416 { | |
36417 int32_t val; | |
36418 int ret = -1; | |
36419 #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API | |
36420 Py_ssize_t bytes_copied = PyLong_AsNativeBytes( | |
36421 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); | |
36422 if (unlikely(bytes_copied == -1)) { | |
36423 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { | |
36424 goto raise_overflow; | |
36425 } else { | |
36426 ret = 0; | |
36427 } | |
36428 #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) | |
36429 int one = 1; int is_little = (int)*(unsigned char *)&one; | |
36430 unsigned char *bytes = (unsigned char *)&val; | |
36431 ret = _PyLong_AsByteArray((PyLongObject *)x, | |
36432 bytes, sizeof(val), | |
36433 is_little, !is_unsigned); | |
36434 #else | |
36435 PyObject *v; | |
36436 PyObject *stepval = NULL, *mask = NULL, *shift = NULL; | |
36437 int bits, remaining_bits, is_negative = 0; | |
36438 int chunk_size = (sizeof(long) < 8) ? 30 : 62; | |
36439 if (likely(PyLong_CheckExact(x))) { | |
36440 v = __Pyx_NewRef(x); | |
36441 } else { | |
36442 v = PyNumber_Long(x); | |
36443 if (unlikely(!v)) return (int32_t) -1; | |
36444 assert(PyLong_CheckExact(v)); | |
36445 } | |
36446 { | |
36447 int result = PyObject_RichCompareBool(v, Py_False, Py_LT); | |
36448 if (unlikely(result < 0)) { | |
36449 Py_DECREF(v); | |
36450 return (int32_t) -1; | |
36451 } | |
36452 is_negative = result == 1; | |
36453 } | |
36454 if (is_unsigned && unlikely(is_negative)) { | |
36455 Py_DECREF(v); | |
36456 goto raise_neg_overflow; | |
36457 } else if (is_negative) { | |
36458 stepval = PyNumber_Invert(v); | |
36459 Py_DECREF(v); | |
36460 if (unlikely(!stepval)) | |
36461 return (int32_t) -1; | |
36462 } else { | |
36463 stepval = v; | |
36464 } | |
36465 v = NULL; | |
36466 val = (int32_t) 0; | |
36467 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; | |
36468 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; | |
36469 for (bits = 0; bits < (int) sizeof(int32_t) * 8 - chunk_size; bits += chunk_size) { | |
36470 PyObject *tmp, *digit; | |
36471 long idigit; | |
36472 digit = PyNumber_And(stepval, mask); | |
36473 if (unlikely(!digit)) goto done; | |
36474 idigit = PyLong_AsLong(digit); | |
36475 Py_DECREF(digit); | |
36476 if (unlikely(idigit < 0)) goto done; | |
36477 val |= ((int32_t) idigit) << bits; | |
36478 tmp = PyNumber_Rshift(stepval, shift); | |
36479 if (unlikely(!tmp)) goto done; | |
36480 Py_DECREF(stepval); stepval = tmp; | |
36481 } | |
36482 Py_DECREF(shift); shift = NULL; | |
36483 Py_DECREF(mask); mask = NULL; | |
36484 { | |
36485 long idigit = PyLong_AsLong(stepval); | |
36486 if (unlikely(idigit < 0)) goto done; | |
36487 remaining_bits = ((int) sizeof(int32_t) * 8) - bits - (is_unsigned ? 0 : 1); | |
36488 if (unlikely(idigit >= (1L << remaining_bits))) | |
36489 goto raise_overflow; | |
36490 val |= ((int32_t) idigit) << bits; | |
36491 } | |
36492 if (!is_unsigned) { | |
36493 if (unlikely(val & (((int32_t) 1) << (sizeof(int32_t) * 8 - 1)))) | |
36494 goto raise_overflow; | |
36495 if (is_negative) | |
36496 val = ~val; | |
36497 } | |
36498 ret = 0; | |
36499 done: | |
36500 Py_XDECREF(shift); | |
36501 Py_XDECREF(mask); | |
36502 Py_XDECREF(stepval); | |
36503 #endif | |
36504 if (unlikely(ret)) | |
36505 return (int32_t) -1; | |
36506 return val; | |
36507 } | |
36508 raise_overflow: | |
36509 PyErr_SetString(PyExc_OverflowError, | |
36510 "value too large to convert to int32_t"); | |
36511 return (int32_t) -1; | |
36512 raise_neg_overflow: | |
36513 PyErr_SetString(PyExc_OverflowError, | |
36514 "can't convert negative value to int32_t"); | |
36515 return (int32_t) -1; | |
36516 } | |
36517 | |
36518 /* FormatTypeName */ | |
36519 #if CYTHON_COMPILING_IN_LIMITED_API | |
36520 static __Pyx_TypeName | |
36521 __Pyx_PyType_GetName(PyTypeObject* tp) | |
36522 { | |
36523 PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, | |
36524 __pyx_n_s_name); | |
36525 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { | |
36526 PyErr_Clear(); | |
36527 Py_XDECREF(name); | |
36528 name = __Pyx_NewRef(__pyx_n_s__78); | |
36529 } | |
36530 return name; | |
36531 } | |
36532 #endif | |
36533 | |
36534 /* FastTypeChecks */ | |
36535 #if CYTHON_COMPILING_IN_CPYTHON | |
36536 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { | |
36537 while (a) { | |
36538 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); | |
36539 if (a == b) | |
36540 return 1; | |
36541 } | |
36542 return b == &PyBaseObject_Type; | |
36543 } | |
36544 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { | |
36545 PyObject *mro; | |
36546 if (a == b) return 1; | |
36547 mro = a->tp_mro; | |
36548 if (likely(mro)) { | |
36549 Py_ssize_t i, n; | |
36550 n = PyTuple_GET_SIZE(mro); | |
36551 for (i = 0; i < n; i++) { | |
36552 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) | |
36553 return 1; | |
36554 } | |
36555 return 0; | |
36556 } | |
36557 return __Pyx_InBases(a, b); | |
36558 } | |
36559 static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { | |
36560 PyObject *mro; | |
36561 if (cls == a || cls == b) return 1; | |
36562 mro = cls->tp_mro; | |
36563 if (likely(mro)) { | |
36564 Py_ssize_t i, n; | |
36565 n = PyTuple_GET_SIZE(mro); | |
36566 for (i = 0; i < n; i++) { | |
36567 PyObject *base = PyTuple_GET_ITEM(mro, i); | |
36568 if (base == (PyObject *)a || base == (PyObject *)b) | |
36569 return 1; | |
36570 } | |
36571 return 0; | |
36572 } | |
36573 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); | |
36574 } | |
36575 #if PY_MAJOR_VERSION == 2 | |
36576 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { | |
36577 PyObject *exception, *value, *tb; | |
36578 int res; | |
36579 __Pyx_PyThreadState_declare | |
36580 __Pyx_PyThreadState_assign | |
36581 __Pyx_ErrFetch(&exception, &value, &tb); | |
36582 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; | |
36583 if (unlikely(res == -1)) { | |
36584 PyErr_WriteUnraisable(err); | |
36585 res = 0; | |
36586 } | |
36587 if (!res) { | |
36588 res = PyObject_IsSubclass(err, exc_type2); | |
36589 if (unlikely(res == -1)) { | |
36590 PyErr_WriteUnraisable(err); | |
36591 res = 0; | |
36592 } | |
36593 } | |
36594 __Pyx_ErrRestore(exception, value, tb); | |
36595 return res; | |
36596 } | |
36597 #else | |
36598 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { | |
36599 if (exc_type1) { | |
36600 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); | |
36601 } else { | |
36602 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); | |
36603 } | |
36604 } | |
36605 #endif | |
36606 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { | |
36607 Py_ssize_t i, n; | |
36608 assert(PyExceptionClass_Check(exc_type)); | |
36609 n = PyTuple_GET_SIZE(tuple); | |
36610 #if PY_MAJOR_VERSION >= 3 | |
36611 for (i=0; i<n; i++) { | |
36612 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1; | |
36613 } | |
36614 #endif | |
36615 for (i=0; i<n; i++) { | |
36616 PyObject *t = PyTuple_GET_ITEM(tuple, i); | |
36617 #if PY_MAJOR_VERSION < 3 | |
36618 if (likely(exc_type == t)) return 1; | |
36619 #endif | |
36620 if (likely(PyExceptionClass_Check(t))) { | |
36621 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1; | |
36622 } else { | |
36623 } | |
36624 } | |
36625 return 0; | |
36626 } | |
36627 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) { | |
36628 if (likely(err == exc_type)) return 1; | |
36629 if (likely(PyExceptionClass_Check(err))) { | |
36630 if (likely(PyExceptionClass_Check(exc_type))) { | |
36631 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type); | |
36632 } else if (likely(PyTuple_Check(exc_type))) { | |
36633 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type); | |
36634 } else { | |
36635 } | |
36636 } | |
36637 return PyErr_GivenExceptionMatches(err, exc_type); | |
36638 } | |
36639 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) { | |
36640 assert(PyExceptionClass_Check(exc_type1)); | |
36641 assert(PyExceptionClass_Check(exc_type2)); | |
36642 if (likely(err == exc_type1 || err == exc_type2)) return 1; | |
36643 if (likely(PyExceptionClass_Check(err))) { | |
36644 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2); | |
36645 } | |
36646 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2)); | |
36647 } | |
36648 #endif | |
36649 | |
36650 /* CheckBinaryVersion */ | |
36651 static unsigned long __Pyx_get_runtime_version(void) { | |
36652 #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 | |
36653 return Py_Version & ~0xFFUL; | |
36654 #else | |
36655 const char* rt_version = Py_GetVersion(); | |
36656 unsigned long version = 0; | |
36657 unsigned long factor = 0x01000000UL; | |
36658 unsigned int digit = 0; | |
36659 int i = 0; | |
36660 while (factor) { | |
36661 while ('0' <= rt_version[i] && rt_version[i] <= '9') { | |
36662 digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); | |
36663 ++i; | |
36664 } | |
36665 version += factor * digit; | |
36666 if (rt_version[i] != '.') | |
36667 break; | |
36668 digit = 0; | |
36669 factor >>= 8; | |
36670 ++i; | |
36671 } | |
36672 return version; | |
36673 #endif | |
36674 } | |
36675 static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { | |
36676 const unsigned long MAJOR_MINOR = 0xFFFF0000UL; | |
36677 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) | |
36678 return 0; | |
36679 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) | |
36680 return 1; | |
36681 { | |
36682 char message[200]; | |
36683 PyOS_snprintf(message, sizeof(message), | |
36684 "compile time Python version %d.%d " | |
36685 "of module '%.100s' " | |
36686 "%s " | |
36687 "runtime version %d.%d", | |
36688 (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), | |
36689 __Pyx_MODULE_NAME, | |
36690 (allow_newer) ? "was newer than" : "does not match", | |
36691 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) | |
36692 ); | |
36693 return PyErr_WarnEx(NULL, message, 1); | |
36694 } | |
36695 } | |
36696 | |
36697 /* FunctionImport */ | |
36698 #ifndef __PYX_HAVE_RT_ImportFunction_3_0_11 | |
36699 #define __PYX_HAVE_RT_ImportFunction_3_0_11 | |
36700 static int __Pyx_ImportFunction_3_0_11(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { | |
36701 PyObject *d = 0; | |
36702 PyObject *cobj = 0; | |
36703 union { | |
36704 void (*fp)(void); | |
36705 void *p; | |
36706 } tmp; | |
36707 d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); | |
36708 if (!d) | |
36709 goto bad; | |
36710 cobj = PyDict_GetItemString(d, funcname); | |
36711 if (!cobj) { | |
36712 PyErr_Format(PyExc_ImportError, | |
36713 "%.200s does not export expected C function %.200s", | |
36714 PyModule_GetName(module), funcname); | |
36715 goto bad; | |
36716 } | |
36717 if (!PyCapsule_IsValid(cobj, sig)) { | |
36718 PyErr_Format(PyExc_TypeError, | |
36719 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", | |
36720 PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); | |
36721 goto bad; | |
36722 } | |
36723 tmp.p = PyCapsule_GetPointer(cobj, sig); | |
36724 *f = tmp.fp; | |
36725 if (!(*f)) | |
36726 goto bad; | |
36727 Py_DECREF(d); | |
36728 return 0; | |
36729 bad: | |
36730 Py_XDECREF(d); | |
36731 return -1; | |
36732 } | |
36733 #endif | |
36734 | |
36735 /* InitStrings */ | |
36736 #if PY_MAJOR_VERSION >= 3 | |
36737 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { | |
36738 if (t.is_unicode | t.is_str) { | |
36739 if (t.intern) { | |
36740 *str = PyUnicode_InternFromString(t.s); | |
36741 } else if (t.encoding) { | |
36742 *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); | |
36743 } else { | |
36744 *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); | |
36745 } | |
36746 } else { | |
36747 *str = PyBytes_FromStringAndSize(t.s, t.n - 1); | |
36748 } | |
36749 if (!*str) | |
36750 return -1; | |
36751 if (PyObject_Hash(*str) == -1) | |
36752 return -1; | |
36753 return 0; | |
36754 } | |
36755 #endif | |
36756 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { | |
36757 while (t->p) { | |
36758 #if PY_MAJOR_VERSION >= 3 | |
36759 __Pyx_InitString(*t, t->p); | |
36760 #else | |
36761 if (t->is_unicode) { | |
36762 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); | |
36763 } else if (t->intern) { | |
36764 *t->p = PyString_InternFromString(t->s); | |
36765 } else { | |
36766 *t->p = PyString_FromStringAndSize(t->s, t->n - 1); | |
36767 } | |
36768 if (!*t->p) | |
36769 return -1; | |
36770 if (PyObject_Hash(*t->p) == -1) | |
36771 return -1; | |
36772 #endif | |
36773 ++t; | |
36774 } | |
36775 return 0; | |
36776 } | |
36777 | |
36778 #include <string.h> | |
36779 static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { | |
36780 size_t len = strlen(s); | |
36781 if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { | |
36782 PyErr_SetString(PyExc_OverflowError, "byte string is too long"); | |
36783 return -1; | |
36784 } | |
36785 return (Py_ssize_t) len; | |
36786 } | |
36787 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { | |
36788 Py_ssize_t len = __Pyx_ssize_strlen(c_str); | |
36789 if (unlikely(len < 0)) return NULL; | |
36790 return __Pyx_PyUnicode_FromStringAndSize(c_str, len); | |
36791 } | |
36792 static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { | |
36793 Py_ssize_t len = __Pyx_ssize_strlen(c_str); | |
36794 if (unlikely(len < 0)) return NULL; | |
36795 return PyByteArray_FromStringAndSize(c_str, len); | |
36796 } | |
36797 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { | |
36798 Py_ssize_t ignore; | |
36799 return __Pyx_PyObject_AsStringAndSize(o, &ignore); | |
36800 } | |
36801 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT | |
36802 #if !CYTHON_PEP393_ENABLED | |
36803 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { | |
36804 char* defenc_c; | |
36805 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); | |
36806 if (!defenc) return NULL; | |
36807 defenc_c = PyBytes_AS_STRING(defenc); | |
36808 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
36809 { | |
36810 char* end = defenc_c + PyBytes_GET_SIZE(defenc); | |
36811 char* c; | |
36812 for (c = defenc_c; c < end; c++) { | |
36813 if ((unsigned char) (*c) >= 128) { | |
36814 PyUnicode_AsASCIIString(o); | |
36815 return NULL; | |
36816 } | |
36817 } | |
36818 } | |
36819 #endif | |
36820 *length = PyBytes_GET_SIZE(defenc); | |
36821 return defenc_c; | |
36822 } | |
36823 #else | |
36824 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { | |
36825 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; | |
36826 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
36827 if (likely(PyUnicode_IS_ASCII(o))) { | |
36828 *length = PyUnicode_GET_LENGTH(o); | |
36829 return PyUnicode_AsUTF8(o); | |
36830 } else { | |
36831 PyUnicode_AsASCIIString(o); | |
36832 return NULL; | |
36833 } | |
36834 #else | |
36835 return PyUnicode_AsUTF8AndSize(o, length); | |
36836 #endif | |
36837 } | |
36838 #endif | |
36839 #endif | |
36840 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { | |
36841 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT | |
36842 if ( | |
36843 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
36844 __Pyx_sys_getdefaultencoding_not_ascii && | |
36845 #endif | |
36846 PyUnicode_Check(o)) { | |
36847 return __Pyx_PyUnicode_AsStringAndSize(o, length); | |
36848 } else | |
36849 #endif | |
36850 #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) | |
36851 if (PyByteArray_Check(o)) { | |
36852 *length = PyByteArray_GET_SIZE(o); | |
36853 return PyByteArray_AS_STRING(o); | |
36854 } else | |
36855 #endif | |
36856 { | |
36857 char* result; | |
36858 int r = PyBytes_AsStringAndSize(o, &result, length); | |
36859 if (unlikely(r < 0)) { | |
36860 return NULL; | |
36861 } else { | |
36862 return result; | |
36863 } | |
36864 } | |
36865 } | |
36866 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { | |
36867 int is_true = x == Py_True; | |
36868 if (is_true | (x == Py_False) | (x == Py_None)) return is_true; | |
36869 else return PyObject_IsTrue(x); | |
36870 } | |
36871 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { | |
36872 int retval; | |
36873 if (unlikely(!x)) return -1; | |
36874 retval = __Pyx_PyObject_IsTrue(x); | |
36875 Py_DECREF(x); | |
36876 return retval; | |
36877 } | |
36878 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { | |
36879 __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); | |
36880 #if PY_MAJOR_VERSION >= 3 | |
36881 if (PyLong_Check(result)) { | |
36882 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, | |
36883 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " | |
36884 "The ability to return an instance of a strict subclass of int is deprecated, " | |
36885 "and may be removed in a future version of Python.", | |
36886 result_type_name)) { | |
36887 __Pyx_DECREF_TypeName(result_type_name); | |
36888 Py_DECREF(result); | |
36889 return NULL; | |
36890 } | |
36891 __Pyx_DECREF_TypeName(result_type_name); | |
36892 return result; | |
36893 } | |
36894 #endif | |
36895 PyErr_Format(PyExc_TypeError, | |
36896 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", | |
36897 type_name, type_name, result_type_name); | |
36898 __Pyx_DECREF_TypeName(result_type_name); | |
36899 Py_DECREF(result); | |
36900 return NULL; | |
36901 } | |
36902 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { | |
36903 #if CYTHON_USE_TYPE_SLOTS | |
36904 PyNumberMethods *m; | |
36905 #endif | |
36906 const char *name = NULL; | |
36907 PyObject *res = NULL; | |
36908 #if PY_MAJOR_VERSION < 3 | |
36909 if (likely(PyInt_Check(x) || PyLong_Check(x))) | |
36910 #else | |
36911 if (likely(PyLong_Check(x))) | |
36912 #endif | |
36913 return __Pyx_NewRef(x); | |
36914 #if CYTHON_USE_TYPE_SLOTS | |
36915 m = Py_TYPE(x)->tp_as_number; | |
36916 #if PY_MAJOR_VERSION < 3 | |
36917 if (m && m->nb_int) { | |
36918 name = "int"; | |
36919 res = m->nb_int(x); | |
36920 } | |
36921 else if (m && m->nb_long) { | |
36922 name = "long"; | |
36923 res = m->nb_long(x); | |
36924 } | |
36925 #else | |
36926 if (likely(m && m->nb_int)) { | |
36927 name = "int"; | |
36928 res = m->nb_int(x); | |
36929 } | |
36930 #endif | |
36931 #else | |
36932 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { | |
36933 res = PyNumber_Int(x); | |
36934 } | |
36935 #endif | |
36936 if (likely(res)) { | |
36937 #if PY_MAJOR_VERSION < 3 | |
36938 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { | |
36939 #else | |
36940 if (unlikely(!PyLong_CheckExact(res))) { | |
36941 #endif | |
36942 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); | |
36943 } | |
36944 } | |
36945 else if (!PyErr_Occurred()) { | |
36946 PyErr_SetString(PyExc_TypeError, | |
36947 "an integer is required"); | |
36948 } | |
36949 return res; | |
36950 } | |
36951 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { | |
36952 Py_ssize_t ival; | |
36953 PyObject *x; | |
36954 #if PY_MAJOR_VERSION < 3 | |
36955 if (likely(PyInt_CheckExact(b))) { | |
36956 if (sizeof(Py_ssize_t) >= sizeof(long)) | |
36957 return PyInt_AS_LONG(b); | |
36958 else | |
36959 return PyInt_AsSsize_t(b); | |
36960 } | |
36961 #endif | |
36962 if (likely(PyLong_CheckExact(b))) { | |
36963 #if CYTHON_USE_PYLONG_INTERNALS | |
36964 if (likely(__Pyx_PyLong_IsCompact(b))) { | |
36965 return __Pyx_PyLong_CompactValue(b); | |
36966 } else { | |
36967 const digit* digits = __Pyx_PyLong_Digits(b); | |
36968 const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); | |
36969 switch (size) { | |
36970 case 2: | |
36971 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { | |
36972 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
36973 } | |
36974 break; | |
36975 case -2: | |
36976 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { | |
36977 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
36978 } | |
36979 break; | |
36980 case 3: | |
36981 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { | |
36982 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
36983 } | |
36984 break; | |
36985 case -3: | |
36986 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { | |
36987 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
36988 } | |
36989 break; | |
36990 case 4: | |
36991 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { | |
36992 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])); | |
36993 } | |
36994 break; | |
36995 case -4: | |
36996 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { | |
36997 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])); | |
36998 } | |
36999 break; | |
37000 } | |
37001 } | |
37002 #endif | |
37003 return PyLong_AsSsize_t(b); | |
37004 } | |
37005 x = PyNumber_Index(b); | |
37006 if (!x) return -1; | |
37007 ival = PyInt_AsSsize_t(x); | |
37008 Py_DECREF(x); | |
37009 return ival; | |
37010 } | |
37011 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { | |
37012 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { | |
37013 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); | |
37014 #if PY_MAJOR_VERSION < 3 | |
37015 } else if (likely(PyInt_CheckExact(o))) { | |
37016 return PyInt_AS_LONG(o); | |
37017 #endif | |
37018 } else { | |
37019 Py_ssize_t ival; | |
37020 PyObject *x; | |
37021 x = PyNumber_Index(o); | |
37022 if (!x) return -1; | |
37023 ival = PyInt_AsLong(x); | |
37024 Py_DECREF(x); | |
37025 return ival; | |
37026 } | |
37027 } | |
37028 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { | |
37029 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); | |
37030 } | |
37031 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { | |
37032 return PyInt_FromSize_t(ival); | |
37033 } | |
37034 | |
37035 | |
37036 /* #### Code section: utility_code_pragmas_end ### */ | |
37037 #ifdef _MSC_VER | |
37038 #pragma warning( pop ) | |
37039 #endif | |
37040 | |
37041 | |
37042 | |
37043 /* #### Code section: end ### */ | |
37044 #endif /* Py_PYTHON_H */ |