Mercurial > repos > rliterman > csp2
comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/site-packages/pysam/libcfaidx.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 "build/lib.linux-x86_64-cpython-37/pysam" | |
68 ], | |
69 "name": "pysam.libcfaidx", | |
70 "sources": [ | |
71 "pysam/libcfaidx.pyx" | |
72 ] | |
73 }, | |
74 "module_name": "pysam.libcfaidx" | |
75 } | |
76 END: Cython Metadata */ | |
77 | |
78 #ifndef PY_SSIZE_T_CLEAN | |
79 #define PY_SSIZE_T_CLEAN | |
80 #endif /* PY_SSIZE_T_CLEAN */ | |
81 #if defined(CYTHON_LIMITED_API) && 0 | |
82 #ifndef Py_LIMITED_API | |
83 #if CYTHON_LIMITED_API+0 > 0x03030000 | |
84 #define Py_LIMITED_API CYTHON_LIMITED_API | |
85 #else | |
86 #define Py_LIMITED_API 0x03030000 | |
87 #endif | |
88 #endif | |
89 #endif | |
90 | |
91 #include "Python.h" | |
92 | |
93 #if PY_MAJOR_VERSION >= 3 | |
94 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj) | |
95 #else | |
96 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL) | |
97 #endif | |
98 | |
99 | |
100 #if PY_MAJOR_VERSION <= 2 | |
101 #define PyDict_GetItemWithError _PyDict_GetItemWithError | |
102 #endif | |
103 | |
104 | |
105 #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get) | |
106 #define PyContextVar_Get(var, d, v) ((d) ? ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) : ((v)[0] = NULL, 0) ) | |
107 #endif | |
108 | |
109 #ifndef Py_PYTHON_H | |
110 #error Python headers needed to compile C extensions, please install development version of Python. | |
111 #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) | |
112 #error Cython requires Python 2.7+ or Python 3.3+. | |
113 #else | |
114 #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API | |
115 #define __PYX_EXTRA_ABI_MODULE_NAME "limited" | |
116 #else | |
117 #define __PYX_EXTRA_ABI_MODULE_NAME "" | |
118 #endif | |
119 #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME | |
120 #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI | |
121 #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." | |
122 #define CYTHON_HEX_VERSION 0x03000BF0 | |
123 #define CYTHON_FUTURE_DIVISION 1 | |
124 #include <stddef.h> | |
125 #ifndef offsetof | |
126 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) | |
127 #endif | |
128 #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) | |
129 #ifndef __stdcall | |
130 #define __stdcall | |
131 #endif | |
132 #ifndef __cdecl | |
133 #define __cdecl | |
134 #endif | |
135 #ifndef __fastcall | |
136 #define __fastcall | |
137 #endif | |
138 #endif | |
139 #ifndef DL_IMPORT | |
140 #define DL_IMPORT(t) t | |
141 #endif | |
142 #ifndef DL_EXPORT | |
143 #define DL_EXPORT(t) t | |
144 #endif | |
145 #define __PYX_COMMA , | |
146 #ifndef HAVE_LONG_LONG | |
147 #define HAVE_LONG_LONG | |
148 #endif | |
149 #ifndef PY_LONG_LONG | |
150 #define PY_LONG_LONG LONG_LONG | |
151 #endif | |
152 #ifndef Py_HUGE_VAL | |
153 #define Py_HUGE_VAL HUGE_VAL | |
154 #endif | |
155 #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX | |
156 #if defined(GRAALVM_PYTHON) | |
157 /* For very preliminary testing purposes. Most variables are set the same as PyPy. | |
158 The existence of this section does not imply that anything works or is even tested */ | |
159 #define CYTHON_COMPILING_IN_PYPY 0 | |
160 #define CYTHON_COMPILING_IN_CPYTHON 0 | |
161 #define CYTHON_COMPILING_IN_LIMITED_API 0 | |
162 #define CYTHON_COMPILING_IN_GRAAL 1 | |
163 #define CYTHON_COMPILING_IN_NOGIL 0 | |
164 #undef CYTHON_USE_TYPE_SLOTS | |
165 #define CYTHON_USE_TYPE_SLOTS 0 | |
166 #undef CYTHON_USE_TYPE_SPECS | |
167 #define CYTHON_USE_TYPE_SPECS 0 | |
168 #undef CYTHON_USE_PYTYPE_LOOKUP | |
169 #define CYTHON_USE_PYTYPE_LOOKUP 0 | |
170 #if PY_VERSION_HEX < 0x03050000 | |
171 #undef CYTHON_USE_ASYNC_SLOTS | |
172 #define CYTHON_USE_ASYNC_SLOTS 0 | |
173 #elif !defined(CYTHON_USE_ASYNC_SLOTS) | |
174 #define CYTHON_USE_ASYNC_SLOTS 1 | |
175 #endif | |
176 #undef CYTHON_USE_PYLIST_INTERNALS | |
177 #define CYTHON_USE_PYLIST_INTERNALS 0 | |
178 #undef CYTHON_USE_UNICODE_INTERNALS | |
179 #define CYTHON_USE_UNICODE_INTERNALS 0 | |
180 #undef CYTHON_USE_UNICODE_WRITER | |
181 #define CYTHON_USE_UNICODE_WRITER 0 | |
182 #undef CYTHON_USE_PYLONG_INTERNALS | |
183 #define CYTHON_USE_PYLONG_INTERNALS 0 | |
184 #undef CYTHON_AVOID_BORROWED_REFS | |
185 #define CYTHON_AVOID_BORROWED_REFS 1 | |
186 #undef CYTHON_ASSUME_SAFE_MACROS | |
187 #define CYTHON_ASSUME_SAFE_MACROS 0 | |
188 #undef CYTHON_UNPACK_METHODS | |
189 #define CYTHON_UNPACK_METHODS 0 | |
190 #undef CYTHON_FAST_THREAD_STATE | |
191 #define CYTHON_FAST_THREAD_STATE 0 | |
192 #undef CYTHON_FAST_GIL | |
193 #define CYTHON_FAST_GIL 0 | |
194 #undef CYTHON_METH_FASTCALL | |
195 #define CYTHON_METH_FASTCALL 0 | |
196 #undef CYTHON_FAST_PYCALL | |
197 #define CYTHON_FAST_PYCALL 0 | |
198 #ifndef CYTHON_PEP487_INIT_SUBCLASS | |
199 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) | |
200 #endif | |
201 #undef CYTHON_PEP489_MULTI_PHASE_INIT | |
202 #define CYTHON_PEP489_MULTI_PHASE_INIT 1 | |
203 #undef CYTHON_USE_MODULE_STATE | |
204 #define CYTHON_USE_MODULE_STATE 0 | |
205 #undef CYTHON_USE_TP_FINALIZE | |
206 #define CYTHON_USE_TP_FINALIZE 0 | |
207 #undef CYTHON_USE_DICT_VERSIONS | |
208 #define CYTHON_USE_DICT_VERSIONS 0 | |
209 #undef CYTHON_USE_EXC_INFO_STACK | |
210 #define CYTHON_USE_EXC_INFO_STACK 0 | |
211 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC | |
212 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 | |
213 #endif | |
214 #undef CYTHON_USE_FREELISTS | |
215 #define CYTHON_USE_FREELISTS 0 | |
216 #elif defined(PYPY_VERSION) | |
217 #define CYTHON_COMPILING_IN_PYPY 1 | |
218 #define CYTHON_COMPILING_IN_CPYTHON 0 | |
219 #define CYTHON_COMPILING_IN_LIMITED_API 0 | |
220 #define CYTHON_COMPILING_IN_GRAAL 0 | |
221 #define CYTHON_COMPILING_IN_NOGIL 0 | |
222 #undef CYTHON_USE_TYPE_SLOTS | |
223 #define CYTHON_USE_TYPE_SLOTS 0 | |
224 #ifndef CYTHON_USE_TYPE_SPECS | |
225 #define CYTHON_USE_TYPE_SPECS 0 | |
226 #endif | |
227 #undef CYTHON_USE_PYTYPE_LOOKUP | |
228 #define CYTHON_USE_PYTYPE_LOOKUP 0 | |
229 #if PY_VERSION_HEX < 0x03050000 | |
230 #undef CYTHON_USE_ASYNC_SLOTS | |
231 #define CYTHON_USE_ASYNC_SLOTS 0 | |
232 #elif !defined(CYTHON_USE_ASYNC_SLOTS) | |
233 #define CYTHON_USE_ASYNC_SLOTS 1 | |
234 #endif | |
235 #undef CYTHON_USE_PYLIST_INTERNALS | |
236 #define CYTHON_USE_PYLIST_INTERNALS 0 | |
237 #undef CYTHON_USE_UNICODE_INTERNALS | |
238 #define CYTHON_USE_UNICODE_INTERNALS 0 | |
239 #undef CYTHON_USE_UNICODE_WRITER | |
240 #define CYTHON_USE_UNICODE_WRITER 0 | |
241 #undef CYTHON_USE_PYLONG_INTERNALS | |
242 #define CYTHON_USE_PYLONG_INTERNALS 0 | |
243 #undef CYTHON_AVOID_BORROWED_REFS | |
244 #define CYTHON_AVOID_BORROWED_REFS 1 | |
245 #undef CYTHON_ASSUME_SAFE_MACROS | |
246 #define CYTHON_ASSUME_SAFE_MACROS 0 | |
247 #undef CYTHON_UNPACK_METHODS | |
248 #define CYTHON_UNPACK_METHODS 0 | |
249 #undef CYTHON_FAST_THREAD_STATE | |
250 #define CYTHON_FAST_THREAD_STATE 0 | |
251 #undef CYTHON_FAST_GIL | |
252 #define CYTHON_FAST_GIL 0 | |
253 #undef CYTHON_METH_FASTCALL | |
254 #define CYTHON_METH_FASTCALL 0 | |
255 #undef CYTHON_FAST_PYCALL | |
256 #define CYTHON_FAST_PYCALL 0 | |
257 #ifndef CYTHON_PEP487_INIT_SUBCLASS | |
258 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) | |
259 #endif | |
260 #if PY_VERSION_HEX < 0x03090000 | |
261 #undef CYTHON_PEP489_MULTI_PHASE_INIT | |
262 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 | |
263 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) | |
264 #define CYTHON_PEP489_MULTI_PHASE_INIT 1 | |
265 #endif | |
266 #undef CYTHON_USE_MODULE_STATE | |
267 #define CYTHON_USE_MODULE_STATE 0 | |
268 #undef CYTHON_USE_TP_FINALIZE | |
269 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) | |
270 #undef CYTHON_USE_DICT_VERSIONS | |
271 #define CYTHON_USE_DICT_VERSIONS 0 | |
272 #undef CYTHON_USE_EXC_INFO_STACK | |
273 #define CYTHON_USE_EXC_INFO_STACK 0 | |
274 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC | |
275 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 | |
276 #endif | |
277 #undef CYTHON_USE_FREELISTS | |
278 #define CYTHON_USE_FREELISTS 0 | |
279 #elif defined(CYTHON_LIMITED_API) | |
280 #ifdef Py_LIMITED_API | |
281 #undef __PYX_LIMITED_VERSION_HEX | |
282 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API | |
283 #endif | |
284 #define CYTHON_COMPILING_IN_PYPY 0 | |
285 #define CYTHON_COMPILING_IN_CPYTHON 0 | |
286 #define CYTHON_COMPILING_IN_LIMITED_API 1 | |
287 #define CYTHON_COMPILING_IN_GRAAL 0 | |
288 #define CYTHON_COMPILING_IN_NOGIL 0 | |
289 #undef CYTHON_CLINE_IN_TRACEBACK | |
290 #define CYTHON_CLINE_IN_TRACEBACK 0 | |
291 #undef CYTHON_USE_TYPE_SLOTS | |
292 #define CYTHON_USE_TYPE_SLOTS 0 | |
293 #undef CYTHON_USE_TYPE_SPECS | |
294 #define CYTHON_USE_TYPE_SPECS 1 | |
295 #undef CYTHON_USE_PYTYPE_LOOKUP | |
296 #define CYTHON_USE_PYTYPE_LOOKUP 0 | |
297 #undef CYTHON_USE_ASYNC_SLOTS | |
298 #define CYTHON_USE_ASYNC_SLOTS 0 | |
299 #undef CYTHON_USE_PYLIST_INTERNALS | |
300 #define CYTHON_USE_PYLIST_INTERNALS 0 | |
301 #undef CYTHON_USE_UNICODE_INTERNALS | |
302 #define CYTHON_USE_UNICODE_INTERNALS 0 | |
303 #ifndef CYTHON_USE_UNICODE_WRITER | |
304 #define CYTHON_USE_UNICODE_WRITER 0 | |
305 #endif | |
306 #undef CYTHON_USE_PYLONG_INTERNALS | |
307 #define CYTHON_USE_PYLONG_INTERNALS 0 | |
308 #ifndef CYTHON_AVOID_BORROWED_REFS | |
309 #define CYTHON_AVOID_BORROWED_REFS 0 | |
310 #endif | |
311 #undef CYTHON_ASSUME_SAFE_MACROS | |
312 #define CYTHON_ASSUME_SAFE_MACROS 0 | |
313 #undef CYTHON_UNPACK_METHODS | |
314 #define CYTHON_UNPACK_METHODS 0 | |
315 #undef CYTHON_FAST_THREAD_STATE | |
316 #define CYTHON_FAST_THREAD_STATE 0 | |
317 #undef CYTHON_FAST_GIL | |
318 #define CYTHON_FAST_GIL 0 | |
319 #undef CYTHON_METH_FASTCALL | |
320 #define CYTHON_METH_FASTCALL 0 | |
321 #undef CYTHON_FAST_PYCALL | |
322 #define CYTHON_FAST_PYCALL 0 | |
323 #ifndef CYTHON_PEP487_INIT_SUBCLASS | |
324 #define CYTHON_PEP487_INIT_SUBCLASS 1 | |
325 #endif | |
326 #undef CYTHON_PEP489_MULTI_PHASE_INIT | |
327 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 | |
328 #undef CYTHON_USE_MODULE_STATE | |
329 #define CYTHON_USE_MODULE_STATE 1 | |
330 #ifndef CYTHON_USE_TP_FINALIZE | |
331 #define CYTHON_USE_TP_FINALIZE 0 | |
332 #endif | |
333 #undef CYTHON_USE_DICT_VERSIONS | |
334 #define CYTHON_USE_DICT_VERSIONS 0 | |
335 #undef CYTHON_USE_EXC_INFO_STACK | |
336 #define CYTHON_USE_EXC_INFO_STACK 0 | |
337 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC | |
338 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 | |
339 #endif | |
340 #undef CYTHON_USE_FREELISTS | |
341 #define CYTHON_USE_FREELISTS 0 | |
342 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) | |
343 #define CYTHON_COMPILING_IN_PYPY 0 | |
344 #define CYTHON_COMPILING_IN_CPYTHON 0 | |
345 #define CYTHON_COMPILING_IN_LIMITED_API 0 | |
346 #define CYTHON_COMPILING_IN_GRAAL 0 | |
347 #define CYTHON_COMPILING_IN_NOGIL 1 | |
348 #ifndef CYTHON_USE_TYPE_SLOTS | |
349 #define CYTHON_USE_TYPE_SLOTS 1 | |
350 #endif | |
351 #ifndef CYTHON_USE_TYPE_SPECS | |
352 #define CYTHON_USE_TYPE_SPECS 0 | |
353 #endif | |
354 #undef CYTHON_USE_PYTYPE_LOOKUP | |
355 #define CYTHON_USE_PYTYPE_LOOKUP 0 | |
356 #ifndef CYTHON_USE_ASYNC_SLOTS | |
357 #define CYTHON_USE_ASYNC_SLOTS 1 | |
358 #endif | |
359 #ifndef CYTHON_USE_PYLONG_INTERNALS | |
360 #define CYTHON_USE_PYLONG_INTERNALS 0 | |
361 #endif | |
362 #undef CYTHON_USE_PYLIST_INTERNALS | |
363 #define CYTHON_USE_PYLIST_INTERNALS 0 | |
364 #ifndef CYTHON_USE_UNICODE_INTERNALS | |
365 #define CYTHON_USE_UNICODE_INTERNALS 1 | |
366 #endif | |
367 #undef CYTHON_USE_UNICODE_WRITER | |
368 #define CYTHON_USE_UNICODE_WRITER 0 | |
369 #ifndef CYTHON_AVOID_BORROWED_REFS | |
370 #define CYTHON_AVOID_BORROWED_REFS 0 | |
371 #endif | |
372 #ifndef CYTHON_ASSUME_SAFE_MACROS | |
373 #define CYTHON_ASSUME_SAFE_MACROS 1 | |
374 #endif | |
375 #ifndef CYTHON_UNPACK_METHODS | |
376 #define CYTHON_UNPACK_METHODS 1 | |
377 #endif | |
378 #undef CYTHON_FAST_THREAD_STATE | |
379 #define CYTHON_FAST_THREAD_STATE 0 | |
380 #undef CYTHON_FAST_GIL | |
381 #define CYTHON_FAST_GIL 0 | |
382 #ifndef CYTHON_METH_FASTCALL | |
383 #define CYTHON_METH_FASTCALL 1 | |
384 #endif | |
385 #undef CYTHON_FAST_PYCALL | |
386 #define CYTHON_FAST_PYCALL 0 | |
387 #ifndef CYTHON_PEP487_INIT_SUBCLASS | |
388 #define CYTHON_PEP487_INIT_SUBCLASS 1 | |
389 #endif | |
390 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT | |
391 #define CYTHON_PEP489_MULTI_PHASE_INIT 1 | |
392 #endif | |
393 #ifndef CYTHON_USE_MODULE_STATE | |
394 #define CYTHON_USE_MODULE_STATE 0 | |
395 #endif | |
396 #ifndef CYTHON_USE_TP_FINALIZE | |
397 #define CYTHON_USE_TP_FINALIZE 1 | |
398 #endif | |
399 #undef CYTHON_USE_DICT_VERSIONS | |
400 #define CYTHON_USE_DICT_VERSIONS 0 | |
401 #undef CYTHON_USE_EXC_INFO_STACK | |
402 #define CYTHON_USE_EXC_INFO_STACK 0 | |
403 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC | |
404 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 | |
405 #endif | |
406 #ifndef CYTHON_USE_FREELISTS | |
407 #define CYTHON_USE_FREELISTS 0 | |
408 #endif | |
409 #else | |
410 #define CYTHON_COMPILING_IN_PYPY 0 | |
411 #define CYTHON_COMPILING_IN_CPYTHON 1 | |
412 #define CYTHON_COMPILING_IN_LIMITED_API 0 | |
413 #define CYTHON_COMPILING_IN_GRAAL 0 | |
414 #define CYTHON_COMPILING_IN_NOGIL 0 | |
415 #ifndef CYTHON_USE_TYPE_SLOTS | |
416 #define CYTHON_USE_TYPE_SLOTS 1 | |
417 #endif | |
418 #ifndef CYTHON_USE_TYPE_SPECS | |
419 #define CYTHON_USE_TYPE_SPECS 0 | |
420 #endif | |
421 #ifndef CYTHON_USE_PYTYPE_LOOKUP | |
422 #define CYTHON_USE_PYTYPE_LOOKUP 1 | |
423 #endif | |
424 #if PY_MAJOR_VERSION < 3 | |
425 #undef CYTHON_USE_ASYNC_SLOTS | |
426 #define CYTHON_USE_ASYNC_SLOTS 0 | |
427 #elif !defined(CYTHON_USE_ASYNC_SLOTS) | |
428 #define CYTHON_USE_ASYNC_SLOTS 1 | |
429 #endif | |
430 #ifndef CYTHON_USE_PYLONG_INTERNALS | |
431 #define CYTHON_USE_PYLONG_INTERNALS 1 | |
432 #endif | |
433 #ifndef CYTHON_USE_PYLIST_INTERNALS | |
434 #define CYTHON_USE_PYLIST_INTERNALS 1 | |
435 #endif | |
436 #ifndef CYTHON_USE_UNICODE_INTERNALS | |
437 #define CYTHON_USE_UNICODE_INTERNALS 1 | |
438 #endif | |
439 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 | |
440 #undef CYTHON_USE_UNICODE_WRITER | |
441 #define CYTHON_USE_UNICODE_WRITER 0 | |
442 #elif !defined(CYTHON_USE_UNICODE_WRITER) | |
443 #define CYTHON_USE_UNICODE_WRITER 1 | |
444 #endif | |
445 #ifndef CYTHON_AVOID_BORROWED_REFS | |
446 #define CYTHON_AVOID_BORROWED_REFS 0 | |
447 #endif | |
448 #ifndef CYTHON_ASSUME_SAFE_MACROS | |
449 #define CYTHON_ASSUME_SAFE_MACROS 1 | |
450 #endif | |
451 #ifndef CYTHON_UNPACK_METHODS | |
452 #define CYTHON_UNPACK_METHODS 1 | |
453 #endif | |
454 #ifndef CYTHON_FAST_THREAD_STATE | |
455 #define CYTHON_FAST_THREAD_STATE 1 | |
456 #endif | |
457 #ifndef CYTHON_FAST_GIL | |
458 #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) | |
459 #endif | |
460 #ifndef CYTHON_METH_FASTCALL | |
461 #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) | |
462 #endif | |
463 #ifndef CYTHON_FAST_PYCALL | |
464 #define CYTHON_FAST_PYCALL 1 | |
465 #endif | |
466 #ifndef CYTHON_PEP487_INIT_SUBCLASS | |
467 #define CYTHON_PEP487_INIT_SUBCLASS 1 | |
468 #endif | |
469 #if PY_VERSION_HEX < 0x03050000 | |
470 #undef CYTHON_PEP489_MULTI_PHASE_INIT | |
471 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 | |
472 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) | |
473 #define CYTHON_PEP489_MULTI_PHASE_INIT 1 | |
474 #endif | |
475 #ifndef CYTHON_USE_MODULE_STATE | |
476 #define CYTHON_USE_MODULE_STATE 0 | |
477 #endif | |
478 #if PY_VERSION_HEX < 0x030400a1 | |
479 #undef CYTHON_USE_TP_FINALIZE | |
480 #define CYTHON_USE_TP_FINALIZE 0 | |
481 #elif !defined(CYTHON_USE_TP_FINALIZE) | |
482 #define CYTHON_USE_TP_FINALIZE 1 | |
483 #endif | |
484 #if PY_VERSION_HEX < 0x030600B1 | |
485 #undef CYTHON_USE_DICT_VERSIONS | |
486 #define CYTHON_USE_DICT_VERSIONS 0 | |
487 #elif !defined(CYTHON_USE_DICT_VERSIONS) | |
488 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) | |
489 #endif | |
490 #if PY_VERSION_HEX < 0x030700A3 | |
491 #undef CYTHON_USE_EXC_INFO_STACK | |
492 #define CYTHON_USE_EXC_INFO_STACK 0 | |
493 #elif !defined(CYTHON_USE_EXC_INFO_STACK) | |
494 #define CYTHON_USE_EXC_INFO_STACK 1 | |
495 #endif | |
496 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC | |
497 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 | |
498 #endif | |
499 #ifndef CYTHON_USE_FREELISTS | |
500 #define CYTHON_USE_FREELISTS 1 | |
501 #endif | |
502 #endif | |
503 #if !defined(CYTHON_FAST_PYCCALL) | |
504 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) | |
505 #endif | |
506 #if !defined(CYTHON_VECTORCALL) | |
507 #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) | |
508 #endif | |
509 #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) | |
510 #if CYTHON_USE_PYLONG_INTERNALS | |
511 #if PY_MAJOR_VERSION < 3 | |
512 #include "longintrepr.h" | |
513 #endif | |
514 #undef SHIFT | |
515 #undef BASE | |
516 #undef MASK | |
517 #ifdef SIZEOF_VOID_P | |
518 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; | |
519 #endif | |
520 #endif | |
521 #ifndef __has_attribute | |
522 #define __has_attribute(x) 0 | |
523 #endif | |
524 #ifndef __has_cpp_attribute | |
525 #define __has_cpp_attribute(x) 0 | |
526 #endif | |
527 #ifndef CYTHON_RESTRICT | |
528 #if defined(__GNUC__) | |
529 #define CYTHON_RESTRICT __restrict__ | |
530 #elif defined(_MSC_VER) && _MSC_VER >= 1400 | |
531 #define CYTHON_RESTRICT __restrict | |
532 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | |
533 #define CYTHON_RESTRICT restrict | |
534 #else | |
535 #define CYTHON_RESTRICT | |
536 #endif | |
537 #endif | |
538 #ifndef CYTHON_UNUSED | |
539 #if defined(__cplusplus) | |
540 /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 | |
541 * but leads to warnings with -pedantic, since it is a C++17 feature */ | |
542 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) | |
543 #if __has_cpp_attribute(maybe_unused) | |
544 #define CYTHON_UNUSED [[maybe_unused]] | |
545 #endif | |
546 #endif | |
547 #endif | |
548 #endif | |
549 #ifndef CYTHON_UNUSED | |
550 # if defined(__GNUC__) | |
551 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) | |
552 # define CYTHON_UNUSED __attribute__ ((__unused__)) | |
553 # else | |
554 # define CYTHON_UNUSED | |
555 # endif | |
556 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) | |
557 # define CYTHON_UNUSED __attribute__ ((__unused__)) | |
558 # else | |
559 # define CYTHON_UNUSED | |
560 # endif | |
561 #endif | |
562 #ifndef CYTHON_UNUSED_VAR | |
563 # if defined(__cplusplus) | |
564 template<class T> void CYTHON_UNUSED_VAR( const T& ) { } | |
565 # else | |
566 # define CYTHON_UNUSED_VAR(x) (void)(x) | |
567 # endif | |
568 #endif | |
569 #ifndef CYTHON_MAYBE_UNUSED_VAR | |
570 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) | |
571 #endif | |
572 #ifndef CYTHON_NCP_UNUSED | |
573 # if CYTHON_COMPILING_IN_CPYTHON | |
574 # define CYTHON_NCP_UNUSED | |
575 # else | |
576 # define CYTHON_NCP_UNUSED CYTHON_UNUSED | |
577 # endif | |
578 #endif | |
579 #ifndef CYTHON_USE_CPP_STD_MOVE | |
580 #if defined(__cplusplus) && (\ | |
581 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) | |
582 #define CYTHON_USE_CPP_STD_MOVE 1 | |
583 #else | |
584 #define CYTHON_USE_CPP_STD_MOVE 0 | |
585 #endif | |
586 #endif | |
587 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) | |
588 #ifdef _MSC_VER | |
589 #ifndef _MSC_STDINT_H_ | |
590 #if _MSC_VER < 1300 | |
591 typedef unsigned char uint8_t; | |
592 typedef unsigned short uint16_t; | |
593 typedef unsigned int uint32_t; | |
594 #else | |
595 typedef unsigned __int8 uint8_t; | |
596 typedef unsigned __int16 uint16_t; | |
597 typedef unsigned __int32 uint32_t; | |
598 #endif | |
599 #endif | |
600 #if _MSC_VER < 1300 | |
601 #ifdef _WIN64 | |
602 typedef unsigned long long __pyx_uintptr_t; | |
603 #else | |
604 typedef unsigned int __pyx_uintptr_t; | |
605 #endif | |
606 #else | |
607 #ifdef _WIN64 | |
608 typedef unsigned __int64 __pyx_uintptr_t; | |
609 #else | |
610 typedef unsigned __int32 __pyx_uintptr_t; | |
611 #endif | |
612 #endif | |
613 #else | |
614 #include <stdint.h> | |
615 typedef uintptr_t __pyx_uintptr_t; | |
616 #endif | |
617 #ifndef CYTHON_FALLTHROUGH | |
618 #if defined(__cplusplus) | |
619 /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 | |
620 * but leads to warnings with -pedantic, since it is a C++17 feature */ | |
621 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) | |
622 #if __has_cpp_attribute(fallthrough) | |
623 #define CYTHON_FALLTHROUGH [[fallthrough]] | |
624 #endif | |
625 #endif | |
626 #ifndef CYTHON_FALLTHROUGH | |
627 #if __has_cpp_attribute(clang::fallthrough) | |
628 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] | |
629 #elif __has_cpp_attribute(gnu::fallthrough) | |
630 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] | |
631 #endif | |
632 #endif | |
633 #endif | |
634 #ifndef CYTHON_FALLTHROUGH | |
635 #if __has_attribute(fallthrough) | |
636 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) | |
637 #else | |
638 #define CYTHON_FALLTHROUGH | |
639 #endif | |
640 #endif | |
641 #if defined(__clang__) && defined(__apple_build_version__) | |
642 #if __apple_build_version__ < 7000000 | |
643 #undef CYTHON_FALLTHROUGH | |
644 #define CYTHON_FALLTHROUGH | |
645 #endif | |
646 #endif | |
647 #endif | |
648 #ifdef __cplusplus | |
649 template <typename T> | |
650 struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; | |
651 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value) | |
652 #else | |
653 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) | |
654 #endif | |
655 #if CYTHON_COMPILING_IN_PYPY == 1 | |
656 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) | |
657 #else | |
658 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) | |
659 #endif | |
660 #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) | |
661 | |
662 #ifndef CYTHON_INLINE | |
663 #if defined(__clang__) | |
664 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) | |
665 #elif defined(__GNUC__) | |
666 #define CYTHON_INLINE __inline__ | |
667 #elif defined(_MSC_VER) | |
668 #define CYTHON_INLINE __inline | |
669 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | |
670 #define CYTHON_INLINE inline | |
671 #else | |
672 #define CYTHON_INLINE | |
673 #endif | |
674 #endif | |
675 | |
676 #define __PYX_BUILD_PY_SSIZE_T "n" | |
677 #define CYTHON_FORMAT_SSIZE_T "z" | |
678 #if PY_MAJOR_VERSION < 3 | |
679 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" | |
680 #define __Pyx_DefaultClassType PyClass_Type | |
681 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ | |
682 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) | |
683 #else | |
684 #define __Pyx_BUILTIN_MODULE_NAME "builtins" | |
685 #define __Pyx_DefaultClassType PyType_Type | |
686 #if CYTHON_COMPILING_IN_LIMITED_API | |
687 static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, | |
688 PyObject *code, PyObject *c, PyObject* n, PyObject *v, | |
689 PyObject *fv, PyObject *cell, PyObject* fn, | |
690 PyObject *name, int fline, PyObject *lnos) { | |
691 PyObject *exception_table = NULL; | |
692 PyObject *types_module=NULL, *code_type=NULL, *result=NULL; | |
693 #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 | |
694 PyObject *version_info; | |
695 PyObject *py_minor_version = NULL; | |
696 #endif | |
697 long minor_version = 0; | |
698 PyObject *type, *value, *traceback; | |
699 PyErr_Fetch(&type, &value, &traceback); | |
700 #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 | |
701 minor_version = 11; | |
702 #else | |
703 if (!(version_info = PySys_GetObject("version_info"))) goto end; | |
704 if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; | |
705 minor_version = PyLong_AsLong(py_minor_version); | |
706 Py_DECREF(py_minor_version); | |
707 if (minor_version == -1 && PyErr_Occurred()) goto end; | |
708 #endif | |
709 if (!(types_module = PyImport_ImportModule("types"))) goto end; | |
710 if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; | |
711 if (minor_version <= 7) { | |
712 (void)p; | |
713 result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, | |
714 c, n, v, fn, name, fline, lnos, fv, cell); | |
715 } else if (minor_version <= 10) { | |
716 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, | |
717 c, n, v, fn, name, fline, lnos, fv, cell); | |
718 } else { | |
719 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; | |
720 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, | |
721 c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); | |
722 } | |
723 end: | |
724 Py_XDECREF(code_type); | |
725 Py_XDECREF(exception_table); | |
726 Py_XDECREF(types_module); | |
727 if (type) { | |
728 PyErr_Restore(type, value, traceback); | |
729 } | |
730 return result; | |
731 } | |
732 #ifndef CO_OPTIMIZED | |
733 #define CO_OPTIMIZED 0x0001 | |
734 #endif | |
735 #ifndef CO_NEWLOCALS | |
736 #define CO_NEWLOCALS 0x0002 | |
737 #endif | |
738 #ifndef CO_VARARGS | |
739 #define CO_VARARGS 0x0004 | |
740 #endif | |
741 #ifndef CO_VARKEYWORDS | |
742 #define CO_VARKEYWORDS 0x0008 | |
743 #endif | |
744 #ifndef CO_ASYNC_GENERATOR | |
745 #define CO_ASYNC_GENERATOR 0x0200 | |
746 #endif | |
747 #ifndef CO_GENERATOR | |
748 #define CO_GENERATOR 0x0020 | |
749 #endif | |
750 #ifndef CO_COROUTINE | |
751 #define CO_COROUTINE 0x0080 | |
752 #endif | |
753 #elif PY_VERSION_HEX >= 0x030B0000 | |
754 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, | |
755 PyObject *code, PyObject *c, PyObject* n, PyObject *v, | |
756 PyObject *fv, PyObject *cell, PyObject* fn, | |
757 PyObject *name, int fline, PyObject *lnos) { | |
758 PyCodeObject *result; | |
759 PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); | |
760 if (!empty_bytes) return NULL; | |
761 result = | |
762 #if PY_VERSION_HEX >= 0x030C0000 | |
763 PyUnstable_Code_NewWithPosOnlyArgs | |
764 #else | |
765 PyCode_NewWithPosOnlyArgs | |
766 #endif | |
767 (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); | |
768 Py_DECREF(empty_bytes); | |
769 return result; | |
770 } | |
771 #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY | |
772 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ | |
773 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) | |
774 #else | |
775 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ | |
776 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) | |
777 #endif | |
778 #endif | |
779 #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) | |
780 #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) | |
781 #else | |
782 #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) | |
783 #endif | |
784 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) | |
785 #define __Pyx_Py_Is(x, y) Py_Is(x, y) | |
786 #else | |
787 #define __Pyx_Py_Is(x, y) ((x) == (y)) | |
788 #endif | |
789 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) | |
790 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) | |
791 #else | |
792 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) | |
793 #endif | |
794 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) | |
795 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) | |
796 #else | |
797 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) | |
798 #endif | |
799 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) | |
800 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) | |
801 #else | |
802 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) | |
803 #endif | |
804 #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) | |
805 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY | |
806 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) | |
807 #else | |
808 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) | |
809 #endif | |
810 #ifndef CO_COROUTINE | |
811 #define CO_COROUTINE 0x80 | |
812 #endif | |
813 #ifndef CO_ASYNC_GENERATOR | |
814 #define CO_ASYNC_GENERATOR 0x200 | |
815 #endif | |
816 #ifndef Py_TPFLAGS_CHECKTYPES | |
817 #define Py_TPFLAGS_CHECKTYPES 0 | |
818 #endif | |
819 #ifndef Py_TPFLAGS_HAVE_INDEX | |
820 #define Py_TPFLAGS_HAVE_INDEX 0 | |
821 #endif | |
822 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER | |
823 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 | |
824 #endif | |
825 #ifndef Py_TPFLAGS_HAVE_FINALIZE | |
826 #define Py_TPFLAGS_HAVE_FINALIZE 0 | |
827 #endif | |
828 #ifndef Py_TPFLAGS_SEQUENCE | |
829 #define Py_TPFLAGS_SEQUENCE 0 | |
830 #endif | |
831 #ifndef Py_TPFLAGS_MAPPING | |
832 #define Py_TPFLAGS_MAPPING 0 | |
833 #endif | |
834 #ifndef METH_STACKLESS | |
835 #define METH_STACKLESS 0 | |
836 #endif | |
837 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) | |
838 #ifndef METH_FASTCALL | |
839 #define METH_FASTCALL 0x80 | |
840 #endif | |
841 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); | |
842 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, | |
843 Py_ssize_t nargs, PyObject *kwnames); | |
844 #else | |
845 #if PY_VERSION_HEX >= 0x030d00A4 | |
846 # define __Pyx_PyCFunctionFast PyCFunctionFast | |
847 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords | |
848 #else | |
849 # define __Pyx_PyCFunctionFast _PyCFunctionFast | |
850 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords | |
851 #endif | |
852 #endif | |
853 #if CYTHON_METH_FASTCALL | |
854 #define __Pyx_METH_FASTCALL METH_FASTCALL | |
855 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast | |
856 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords | |
857 #else | |
858 #define __Pyx_METH_FASTCALL METH_VARARGS | |
859 #define __Pyx_PyCFunction_FastCall PyCFunction | |
860 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords | |
861 #endif | |
862 #if CYTHON_VECTORCALL | |
863 #define __pyx_vectorcallfunc vectorcallfunc | |
864 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET | |
865 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) | |
866 #elif CYTHON_BACKPORT_VECTORCALL | |
867 typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, | |
868 size_t nargsf, PyObject *kwnames); | |
869 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) | |
870 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) | |
871 #else | |
872 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 | |
873 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) | |
874 #endif | |
875 #if PY_MAJOR_VERSION >= 0x030900B1 | |
876 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) | |
877 #else | |
878 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) | |
879 #endif | |
880 #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) | |
881 #if CYTHON_COMPILING_IN_CPYTHON | |
882 #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) | |
883 #elif !CYTHON_COMPILING_IN_LIMITED_API | |
884 #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) | |
885 #endif | |
886 #if CYTHON_COMPILING_IN_CPYTHON | |
887 #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) | |
888 static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { | |
889 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; | |
890 } | |
891 #endif | |
892 static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { | |
893 #if CYTHON_COMPILING_IN_LIMITED_API | |
894 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; | |
895 #else | |
896 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; | |
897 #endif | |
898 } | |
899 #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) | |
900 #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 | |
901 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) | |
902 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); | |
903 #else | |
904 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) | |
905 #define __Pyx_PyCMethod PyCMethod | |
906 #endif | |
907 #ifndef METH_METHOD | |
908 #define METH_METHOD 0x200 | |
909 #endif | |
910 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) | |
911 #define PyObject_Malloc(s) PyMem_Malloc(s) | |
912 #define PyObject_Free(p) PyMem_Free(p) | |
913 #define PyObject_Realloc(p) PyMem_Realloc(p) | |
914 #endif | |
915 #if CYTHON_COMPILING_IN_LIMITED_API | |
916 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) | |
917 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) | |
918 #else | |
919 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) | |
920 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) | |
921 #endif | |
922 #if CYTHON_COMPILING_IN_LIMITED_API | |
923 #define __Pyx_PyThreadState_Current PyThreadState_Get() | |
924 #elif !CYTHON_FAST_THREAD_STATE | |
925 #define __Pyx_PyThreadState_Current PyThreadState_GET() | |
926 #elif PY_VERSION_HEX >= 0x030d00A1 | |
927 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() | |
928 #elif PY_VERSION_HEX >= 0x03060000 | |
929 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() | |
930 #elif PY_VERSION_HEX >= 0x03000000 | |
931 #define __Pyx_PyThreadState_Current PyThreadState_GET() | |
932 #else | |
933 #define __Pyx_PyThreadState_Current _PyThreadState_Current | |
934 #endif | |
935 #if CYTHON_COMPILING_IN_LIMITED_API | |
936 static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) | |
937 { | |
938 void *result; | |
939 result = PyModule_GetState(op); | |
940 if (!result) | |
941 Py_FatalError("Couldn't find the module state"); | |
942 return result; | |
943 } | |
944 #endif | |
945 #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) | |
946 #if CYTHON_COMPILING_IN_LIMITED_API | |
947 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) | |
948 #else | |
949 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) | |
950 #endif | |
951 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) | |
952 #include "pythread.h" | |
953 #define Py_tss_NEEDS_INIT 0 | |
954 typedef int Py_tss_t; | |
955 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { | |
956 *key = PyThread_create_key(); | |
957 return 0; | |
958 } | |
959 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { | |
960 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); | |
961 *key = Py_tss_NEEDS_INIT; | |
962 return key; | |
963 } | |
964 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { | |
965 PyObject_Free(key); | |
966 } | |
967 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { | |
968 return *key != Py_tss_NEEDS_INIT; | |
969 } | |
970 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { | |
971 PyThread_delete_key(*key); | |
972 *key = Py_tss_NEEDS_INIT; | |
973 } | |
974 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { | |
975 return PyThread_set_key_value(*key, value); | |
976 } | |
977 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { | |
978 return PyThread_get_key_value(*key); | |
979 } | |
980 #endif | |
981 #if PY_MAJOR_VERSION < 3 | |
982 #if CYTHON_COMPILING_IN_PYPY | |
983 #if PYPY_VERSION_NUM < 0x07030600 | |
984 #if defined(__cplusplus) && __cplusplus >= 201402L | |
985 [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] | |
986 #elif defined(__GNUC__) || defined(__clang__) | |
987 __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) | |
988 #elif defined(_MSC_VER) | |
989 __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) | |
990 #endif | |
991 static CYTHON_INLINE int PyGILState_Check(void) { | |
992 return 0; | |
993 } | |
994 #else // PYPY_VERSION_NUM < 0x07030600 | |
995 #endif // PYPY_VERSION_NUM < 0x07030600 | |
996 #else | |
997 static CYTHON_INLINE int PyGILState_Check(void) { | |
998 PyThreadState * tstate = _PyThreadState_Current; | |
999 return tstate && (tstate == PyGILState_GetThisThreadState()); | |
1000 } | |
1001 #endif | |
1002 #endif | |
1003 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) | |
1004 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) | |
1005 #else | |
1006 #define __Pyx_PyDict_NewPresized(n) PyDict_New() | |
1007 #endif | |
1008 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION | |
1009 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) | |
1010 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) | |
1011 #else | |
1012 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) | |
1013 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) | |
1014 #endif | |
1015 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS | |
1016 #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) | |
1017 static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { | |
1018 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); | |
1019 if (res == NULL) PyErr_Clear(); | |
1020 return res; | |
1021 } | |
1022 #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) | |
1023 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError | |
1024 #define __Pyx_PyDict_GetItemStr PyDict_GetItem | |
1025 #else | |
1026 static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { | |
1027 #if CYTHON_COMPILING_IN_PYPY | |
1028 return PyDict_GetItem(dict, name); | |
1029 #else | |
1030 PyDictEntry *ep; | |
1031 PyDictObject *mp = (PyDictObject*) dict; | |
1032 long hash = ((PyStringObject *) name)->ob_shash; | |
1033 assert(hash != -1); | |
1034 ep = (mp->ma_lookup)(mp, name, hash); | |
1035 if (ep == NULL) { | |
1036 return NULL; | |
1037 } | |
1038 return ep->me_value; | |
1039 #endif | |
1040 } | |
1041 #define __Pyx_PyDict_GetItemStr PyDict_GetItem | |
1042 #endif | |
1043 #if CYTHON_USE_TYPE_SLOTS | |
1044 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) | |
1045 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) | |
1046 #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) | |
1047 #else | |
1048 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) | |
1049 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) | |
1050 #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next | |
1051 #endif | |
1052 #if CYTHON_COMPILING_IN_LIMITED_API | |
1053 #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) | |
1054 #else | |
1055 #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) | |
1056 #endif | |
1057 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 | |
1058 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ | |
1059 PyTypeObject *type = Py_TYPE((PyObject*)obj);\ | |
1060 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ | |
1061 PyObject_GC_Del(obj);\ | |
1062 Py_DECREF(type);\ | |
1063 } | |
1064 #else | |
1065 #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) | |
1066 #endif | |
1067 #if CYTHON_COMPILING_IN_LIMITED_API | |
1068 #define CYTHON_PEP393_ENABLED 1 | |
1069 #define __Pyx_PyUnicode_READY(op) (0) | |
1070 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) | |
1071 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) | |
1072 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) | |
1073 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) | |
1074 #define __Pyx_PyUnicode_DATA(u) ((void*)u) | |
1075 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) | |
1076 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) | |
1077 #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) | |
1078 #define CYTHON_PEP393_ENABLED 1 | |
1079 #if PY_VERSION_HEX >= 0x030C0000 | |
1080 #define __Pyx_PyUnicode_READY(op) (0) | |
1081 #else | |
1082 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ | |
1083 0 : _PyUnicode_Ready((PyObject *)(op))) | |
1084 #endif | |
1085 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) | |
1086 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) | |
1087 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) | |
1088 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) | |
1089 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) | |
1090 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) | |
1091 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) | |
1092 #if PY_VERSION_HEX >= 0x030C0000 | |
1093 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) | |
1094 #else | |
1095 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 | |
1096 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) | |
1097 #else | |
1098 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) | |
1099 #endif | |
1100 #endif | |
1101 #else | |
1102 #define CYTHON_PEP393_ENABLED 0 | |
1103 #define PyUnicode_1BYTE_KIND 1 | |
1104 #define PyUnicode_2BYTE_KIND 2 | |
1105 #define PyUnicode_4BYTE_KIND 4 | |
1106 #define __Pyx_PyUnicode_READY(op) (0) | |
1107 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) | |
1108 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) | |
1109 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) | |
1110 #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) | |
1111 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) | |
1112 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) | |
1113 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) | |
1114 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) | |
1115 #endif | |
1116 #if CYTHON_COMPILING_IN_PYPY | |
1117 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) | |
1118 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) | |
1119 #else | |
1120 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) | |
1121 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ | |
1122 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) | |
1123 #endif | |
1124 #if CYTHON_COMPILING_IN_PYPY | |
1125 #if !defined(PyUnicode_DecodeUnicodeEscape) | |
1126 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) | |
1127 #endif | |
1128 #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) | |
1129 #undef PyUnicode_Contains | |
1130 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) | |
1131 #endif | |
1132 #if !defined(PyByteArray_Check) | |
1133 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) | |
1134 #endif | |
1135 #if !defined(PyObject_Format) | |
1136 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) | |
1137 #endif | |
1138 #endif | |
1139 #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)) | |
1140 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) | |
1141 #if PY_MAJOR_VERSION >= 3 | |
1142 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) | |
1143 #else | |
1144 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) | |
1145 #endif | |
1146 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) | |
1147 #define PyObject_ASCII(o) PyObject_Repr(o) | |
1148 #endif | |
1149 #if PY_MAJOR_VERSION >= 3 | |
1150 #define PyBaseString_Type PyUnicode_Type | |
1151 #define PyStringObject PyUnicodeObject | |
1152 #define PyString_Type PyUnicode_Type | |
1153 #define PyString_Check PyUnicode_Check | |
1154 #define PyString_CheckExact PyUnicode_CheckExact | |
1155 #ifndef PyObject_Unicode | |
1156 #define PyObject_Unicode PyObject_Str | |
1157 #endif | |
1158 #endif | |
1159 #if PY_MAJOR_VERSION >= 3 | |
1160 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) | |
1161 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) | |
1162 #else | |
1163 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) | |
1164 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) | |
1165 #endif | |
1166 #if CYTHON_COMPILING_IN_CPYTHON | |
1167 #define __Pyx_PySequence_ListKeepNew(obj)\ | |
1168 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) | |
1169 #else | |
1170 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) | |
1171 #endif | |
1172 #ifndef PySet_CheckExact | |
1173 #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) | |
1174 #endif | |
1175 #if PY_VERSION_HEX >= 0x030900A4 | |
1176 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) | |
1177 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) | |
1178 #else | |
1179 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) | |
1180 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) | |
1181 #endif | |
1182 #if CYTHON_ASSUME_SAFE_MACROS | |
1183 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) | |
1184 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) | |
1185 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) | |
1186 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) | |
1187 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) | |
1188 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) | |
1189 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) | |
1190 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) | |
1191 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) | |
1192 #else | |
1193 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) | |
1194 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) | |
1195 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) | |
1196 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) | |
1197 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) | |
1198 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) | |
1199 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) | |
1200 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) | |
1201 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) | |
1202 #endif | |
1203 #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 | |
1204 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) | |
1205 #else | |
1206 static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { | |
1207 PyObject *module = PyImport_AddModule(name); | |
1208 Py_XINCREF(module); | |
1209 return module; | |
1210 } | |
1211 #endif | |
1212 #if PY_MAJOR_VERSION >= 3 | |
1213 #define PyIntObject PyLongObject | |
1214 #define PyInt_Type PyLong_Type | |
1215 #define PyInt_Check(op) PyLong_Check(op) | |
1216 #define PyInt_CheckExact(op) PyLong_CheckExact(op) | |
1217 #define __Pyx_Py3Int_Check(op) PyLong_Check(op) | |
1218 #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) | |
1219 #define PyInt_FromString PyLong_FromString | |
1220 #define PyInt_FromUnicode PyLong_FromUnicode | |
1221 #define PyInt_FromLong PyLong_FromLong | |
1222 #define PyInt_FromSize_t PyLong_FromSize_t | |
1223 #define PyInt_FromSsize_t PyLong_FromSsize_t | |
1224 #define PyInt_AsLong PyLong_AsLong | |
1225 #define PyInt_AS_LONG PyLong_AS_LONG | |
1226 #define PyInt_AsSsize_t PyLong_AsSsize_t | |
1227 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask | |
1228 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask | |
1229 #define PyNumber_Int PyNumber_Long | |
1230 #else | |
1231 #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) | |
1232 #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) | |
1233 #endif | |
1234 #if PY_MAJOR_VERSION >= 3 | |
1235 #define PyBoolObject PyLongObject | |
1236 #endif | |
1237 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY | |
1238 #ifndef PyUnicode_InternFromString | |
1239 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) | |
1240 #endif | |
1241 #endif | |
1242 #if PY_VERSION_HEX < 0x030200A4 | |
1243 typedef long Py_hash_t; | |
1244 #define __Pyx_PyInt_FromHash_t PyInt_FromLong | |
1245 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t | |
1246 #else | |
1247 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t | |
1248 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t | |
1249 #endif | |
1250 #if CYTHON_USE_ASYNC_SLOTS | |
1251 #if PY_VERSION_HEX >= 0x030500B1 | |
1252 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods | |
1253 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) | |
1254 #else | |
1255 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) | |
1256 #endif | |
1257 #else | |
1258 #define __Pyx_PyType_AsAsync(obj) NULL | |
1259 #endif | |
1260 #ifndef __Pyx_PyAsyncMethodsStruct | |
1261 typedef struct { | |
1262 unaryfunc am_await; | |
1263 unaryfunc am_aiter; | |
1264 unaryfunc am_anext; | |
1265 } __Pyx_PyAsyncMethodsStruct; | |
1266 #endif | |
1267 | |
1268 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) | |
1269 #if !defined(_USE_MATH_DEFINES) | |
1270 #define _USE_MATH_DEFINES | |
1271 #endif | |
1272 #endif | |
1273 #include <math.h> | |
1274 #ifdef NAN | |
1275 #define __PYX_NAN() ((float) NAN) | |
1276 #else | |
1277 static CYTHON_INLINE float __PYX_NAN() { | |
1278 float value; | |
1279 memset(&value, 0xFF, sizeof(value)); | |
1280 return value; | |
1281 } | |
1282 #endif | |
1283 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) | |
1284 #define __Pyx_truncl trunc | |
1285 #else | |
1286 #define __Pyx_truncl truncl | |
1287 #endif | |
1288 | |
1289 #define __PYX_MARK_ERR_POS(f_index, lineno) \ | |
1290 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } | |
1291 #define __PYX_ERR(f_index, lineno, Ln_error) \ | |
1292 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } | |
1293 | |
1294 #ifdef CYTHON_EXTERN_C | |
1295 #undef __PYX_EXTERN_C | |
1296 #define __PYX_EXTERN_C CYTHON_EXTERN_C | |
1297 #elif defined(__PYX_EXTERN_C) | |
1298 #ifdef _MSC_VER | |
1299 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") | |
1300 #else | |
1301 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. | |
1302 #endif | |
1303 #else | |
1304 #ifdef __cplusplus | |
1305 #define __PYX_EXTERN_C extern "C" | |
1306 #else | |
1307 #define __PYX_EXTERN_C extern | |
1308 #endif | |
1309 #endif | |
1310 | |
1311 #define __PYX_HAVE__pysam__libcfaidx | |
1312 #define __PYX_HAVE_API__pysam__libcfaidx | |
1313 /* Early includes */ | |
1314 #include <stdint.h> | |
1315 #include <string.h> | |
1316 #include <stdlib.h> | |
1317 #include <stdio.h> | |
1318 #include <stddef.h> | |
1319 #include "pythread.h" | |
1320 | |
1321 #if CYTHON_COMPILING_IN_PYPY | |
1322 #ifdef _MSC_VER | |
1323 #pragma message ("This module uses CPython specific internals of 'array.array', which are not available in PyPy.") | |
1324 #else | |
1325 #warning This module uses CPython specific internals of 'array.array', which are not available in PyPy. | |
1326 #endif | |
1327 #endif | |
1328 | |
1329 #include <sys/types.h> | |
1330 #include "stdarg.h" | |
1331 #include "htslib/kstring.h" | |
1332 #include "htslib_util.h" | |
1333 #include "htslib/hfile.h" | |
1334 #include "htslib/bgzf.h" | |
1335 #include "htslib/hts.h" | |
1336 #include "htslib/sam.h" | |
1337 #include "htslib/faidx.h" | |
1338 #include "htslib/tbx.h" | |
1339 #include "htslib/vcf.h" | |
1340 #include "htslib/vcfutils.h" | |
1341 #include "htslib/cram.h" | |
1342 #include "pysam_stream.h" | |
1343 #include <errno.h> | |
1344 #ifdef _OPENMP | |
1345 #include <omp.h> | |
1346 #endif /* _OPENMP */ | |
1347 | |
1348 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) | |
1349 #define CYTHON_WITHOUT_ASSERTIONS | |
1350 #endif | |
1351 | |
1352 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; | |
1353 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; | |
1354 | |
1355 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 | |
1356 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 | |
1357 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) | |
1358 #define __PYX_DEFAULT_STRING_ENCODING "" | |
1359 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString | |
1360 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize | |
1361 #define __Pyx_uchar_cast(c) ((unsigned char)c) | |
1362 #define __Pyx_long_cast(x) ((long)x) | |
1363 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ | |
1364 (sizeof(type) < sizeof(Py_ssize_t)) ||\ | |
1365 (sizeof(type) > sizeof(Py_ssize_t) &&\ | |
1366 likely(v < (type)PY_SSIZE_T_MAX ||\ | |
1367 v == (type)PY_SSIZE_T_MAX) &&\ | |
1368 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ | |
1369 v == (type)PY_SSIZE_T_MIN))) ||\ | |
1370 (sizeof(type) == sizeof(Py_ssize_t) &&\ | |
1371 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ | |
1372 v == (type)PY_SSIZE_T_MAX))) ) | |
1373 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { | |
1374 return (size_t) i < (size_t) limit; | |
1375 } | |
1376 #if defined (__cplusplus) && __cplusplus >= 201103L | |
1377 #include <cstdlib> | |
1378 #define __Pyx_sst_abs(value) std::abs(value) | |
1379 #elif SIZEOF_INT >= SIZEOF_SIZE_T | |
1380 #define __Pyx_sst_abs(value) abs(value) | |
1381 #elif SIZEOF_LONG >= SIZEOF_SIZE_T | |
1382 #define __Pyx_sst_abs(value) labs(value) | |
1383 #elif defined (_MSC_VER) | |
1384 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) | |
1385 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | |
1386 #define __Pyx_sst_abs(value) llabs(value) | |
1387 #elif defined (__GNUC__) | |
1388 #define __Pyx_sst_abs(value) __builtin_llabs(value) | |
1389 #else | |
1390 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) | |
1391 #endif | |
1392 static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); | |
1393 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); | |
1394 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); | |
1395 static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); | |
1396 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) | |
1397 #define __Pyx_PyBytes_FromString PyBytes_FromString | |
1398 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize | |
1399 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); | |
1400 #if PY_MAJOR_VERSION < 3 | |
1401 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString | |
1402 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize | |
1403 #else | |
1404 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString | |
1405 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize | |
1406 #endif | |
1407 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) | |
1408 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) | |
1409 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) | |
1410 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) | |
1411 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) | |
1412 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) | |
1413 #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) | |
1414 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) | |
1415 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) | |
1416 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) | |
1417 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) | |
1418 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) | |
1419 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) | |
1420 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) | |
1421 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) | |
1422 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) | |
1423 #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) | |
1424 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode | |
1425 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) | |
1426 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) | |
1427 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); | |
1428 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); | |
1429 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); | |
1430 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); | |
1431 #define __Pyx_PySequence_Tuple(obj)\ | |
1432 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) | |
1433 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); | |
1434 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); | |
1435 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); | |
1436 #if CYTHON_ASSUME_SAFE_MACROS | |
1437 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) | |
1438 #else | |
1439 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) | |
1440 #endif | |
1441 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) | |
1442 #if PY_MAJOR_VERSION >= 3 | |
1443 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) | |
1444 #else | |
1445 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) | |
1446 #endif | |
1447 #if CYTHON_USE_PYLONG_INTERNALS | |
1448 #if PY_VERSION_HEX >= 0x030C00A7 | |
1449 #ifndef _PyLong_SIGN_MASK | |
1450 #define _PyLong_SIGN_MASK 3 | |
1451 #endif | |
1452 #ifndef _PyLong_NON_SIZE_BITS | |
1453 #define _PyLong_NON_SIZE_BITS 3 | |
1454 #endif | |
1455 #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) | |
1456 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) | |
1457 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) | |
1458 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) | |
1459 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) | |
1460 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) | |
1461 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) | |
1462 #define __Pyx_PyLong_SignedDigitCount(x)\ | |
1463 ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) | |
1464 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) | |
1465 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) | |
1466 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) | |
1467 #else | |
1468 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) | |
1469 #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) | |
1470 #endif | |
1471 typedef Py_ssize_t __Pyx_compact_pylong; | |
1472 typedef size_t __Pyx_compact_upylong; | |
1473 #else | |
1474 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) | |
1475 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) | |
1476 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) | |
1477 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) | |
1478 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) | |
1479 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) | |
1480 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) | |
1481 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) | |
1482 #define __Pyx_PyLong_CompactValue(x)\ | |
1483 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) | |
1484 typedef sdigit __Pyx_compact_pylong; | |
1485 typedef digit __Pyx_compact_upylong; | |
1486 #endif | |
1487 #if PY_VERSION_HEX >= 0x030C00A5 | |
1488 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) | |
1489 #else | |
1490 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) | |
1491 #endif | |
1492 #endif | |
1493 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
1494 #include <string.h> | |
1495 static int __Pyx_sys_getdefaultencoding_not_ascii; | |
1496 static int __Pyx_init_sys_getdefaultencoding_params(void) { | |
1497 PyObject* sys; | |
1498 PyObject* default_encoding = NULL; | |
1499 PyObject* ascii_chars_u = NULL; | |
1500 PyObject* ascii_chars_b = NULL; | |
1501 const char* default_encoding_c; | |
1502 sys = PyImport_ImportModule("sys"); | |
1503 if (!sys) goto bad; | |
1504 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); | |
1505 Py_DECREF(sys); | |
1506 if (!default_encoding) goto bad; | |
1507 default_encoding_c = PyBytes_AsString(default_encoding); | |
1508 if (!default_encoding_c) goto bad; | |
1509 if (strcmp(default_encoding_c, "ascii") == 0) { | |
1510 __Pyx_sys_getdefaultencoding_not_ascii = 0; | |
1511 } else { | |
1512 char ascii_chars[128]; | |
1513 int c; | |
1514 for (c = 0; c < 128; c++) { | |
1515 ascii_chars[c] = (char) c; | |
1516 } | |
1517 __Pyx_sys_getdefaultencoding_not_ascii = 1; | |
1518 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); | |
1519 if (!ascii_chars_u) goto bad; | |
1520 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); | |
1521 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { | |
1522 PyErr_Format( | |
1523 PyExc_ValueError, | |
1524 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", | |
1525 default_encoding_c); | |
1526 goto bad; | |
1527 } | |
1528 Py_DECREF(ascii_chars_u); | |
1529 Py_DECREF(ascii_chars_b); | |
1530 } | |
1531 Py_DECREF(default_encoding); | |
1532 return 0; | |
1533 bad: | |
1534 Py_XDECREF(default_encoding); | |
1535 Py_XDECREF(ascii_chars_u); | |
1536 Py_XDECREF(ascii_chars_b); | |
1537 return -1; | |
1538 } | |
1539 #endif | |
1540 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 | |
1541 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) | |
1542 #else | |
1543 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) | |
1544 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT | |
1545 #include <string.h> | |
1546 static char* __PYX_DEFAULT_STRING_ENCODING; | |
1547 static int __Pyx_init_sys_getdefaultencoding_params(void) { | |
1548 PyObject* sys; | |
1549 PyObject* default_encoding = NULL; | |
1550 char* default_encoding_c; | |
1551 sys = PyImport_ImportModule("sys"); | |
1552 if (!sys) goto bad; | |
1553 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); | |
1554 Py_DECREF(sys); | |
1555 if (!default_encoding) goto bad; | |
1556 default_encoding_c = PyBytes_AsString(default_encoding); | |
1557 if (!default_encoding_c) goto bad; | |
1558 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); | |
1559 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; | |
1560 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); | |
1561 Py_DECREF(default_encoding); | |
1562 return 0; | |
1563 bad: | |
1564 Py_XDECREF(default_encoding); | |
1565 return -1; | |
1566 } | |
1567 #endif | |
1568 #endif | |
1569 | |
1570 | |
1571 /* Test for GCC > 2.95 */ | |
1572 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) | |
1573 #define likely(x) __builtin_expect(!!(x), 1) | |
1574 #define unlikely(x) __builtin_expect(!!(x), 0) | |
1575 #else /* !__GNUC__ or GCC < 2.95 */ | |
1576 #define likely(x) (x) | |
1577 #define unlikely(x) (x) | |
1578 #endif /* __GNUC__ */ | |
1579 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } | |
1580 | |
1581 #if !CYTHON_USE_MODULE_STATE | |
1582 static PyObject *__pyx_m = NULL; | |
1583 #endif | |
1584 static int __pyx_lineno; | |
1585 static int __pyx_clineno = 0; | |
1586 static const char * __pyx_cfilenm = __FILE__; | |
1587 static const char *__pyx_filename; | |
1588 | |
1589 /* #### Code section: filename_table ### */ | |
1590 | |
1591 static const char *__pyx_f[] = { | |
1592 "pysam/libcfaidx.pyx", | |
1593 "<stringsource>", | |
1594 "contextvars.pxd", | |
1595 "array.pxd", | |
1596 "pysam/libcfaidx.pxd", | |
1597 "type.pxd", | |
1598 "bool.pxd", | |
1599 "complex.pxd", | |
1600 "pysam/libchtslib.pxd", | |
1601 }; | |
1602 /* #### Code section: utility_code_proto_before_types ### */ | |
1603 /* ForceInitThreads.proto */ | |
1604 #ifndef __PYX_FORCE_INIT_THREADS | |
1605 #define __PYX_FORCE_INIT_THREADS 0 | |
1606 #endif | |
1607 | |
1608 /* NoFastGil.proto */ | |
1609 #define __Pyx_PyGILState_Ensure PyGILState_Ensure | |
1610 #define __Pyx_PyGILState_Release PyGILState_Release | |
1611 #define __Pyx_FastGIL_Remember() | |
1612 #define __Pyx_FastGIL_Forget() | |
1613 #define __Pyx_FastGilFuncInit() | |
1614 | |
1615 /* #### Code section: numeric_typedefs ### */ | |
1616 /* #### Code section: complex_type_declarations ### */ | |
1617 /* #### Code section: type_declarations ### */ | |
1618 | |
1619 /*--- Type declarations ---*/ | |
1620 #ifndef _ARRAYARRAY_H | |
1621 struct arrayobject; | |
1622 typedef struct arrayobject arrayobject; | |
1623 #endif | |
1624 struct __pyx_obj_5pysam_10libchtslib_HTSFile; | |
1625 struct __pyx_obj_5pysam_9libcfaidx_FastaFile; | |
1626 struct __pyx_obj_5pysam_9libcfaidx_FastqProxy; | |
1627 struct __pyx_obj_5pysam_9libcfaidx_FastxRecord; | |
1628 struct __pyx_obj_5pysam_9libcfaidx_FastxFile; | |
1629 struct __pyx_obj_5pysam_9libcfaidx_FastqFile; | |
1630 struct __pyx_obj_5pysam_9libcfaidx_Fastafile; | |
1631 struct __pyx_opt_args_7cpython_11contextvars_get_value; | |
1632 struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default; | |
1633 | |
1634 /* "cpython/contextvars.pxd":112 | |
1635 * | |
1636 * | |
1637 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< | |
1638 * """Return a new reference to the value of the context variable, | |
1639 * or the default value of the context variable, | |
1640 */ | |
1641 struct __pyx_opt_args_7cpython_11contextvars_get_value { | |
1642 int __pyx_n; | |
1643 PyObject *default_value; | |
1644 }; | |
1645 | |
1646 /* "cpython/contextvars.pxd":129 | |
1647 * | |
1648 * | |
1649 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< | |
1650 * """Return a new reference to the value of the context variable, | |
1651 * or the provided default value if no such value was found. | |
1652 */ | |
1653 struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default { | |
1654 int __pyx_n; | |
1655 PyObject *default_value; | |
1656 }; | |
1657 struct __pyx_opt_args_5pysam_9libcutils_parse_region; | |
1658 struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array; | |
1659 struct __pyx_opt_args_5pysam_9libcutils_array_to_qualitystring; | |
1660 struct __pyx_opt_args_5pysam_9libcutils_qualities_to_qualitystring; | |
1661 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str; | |
1662 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_bytes; | |
1663 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str_w_len; | |
1664 struct __pyx_opt_args_5pysam_9libcutils_force_str; | |
1665 struct __pyx_opt_args_5pysam_9libcutils_force_bytes; | |
1666 struct __pyx_opt_args_5pysam_9libcutils_decode_bytes; | |
1667 | |
1668 /* "pysam/libcutils.pxd":8 | |
1669 * from cpython cimport array as c_array | |
1670 * | |
1671 * cpdef parse_region(contig=*, start=*, stop=*, region=*, reference=*, end=*) # <<<<<<<<<<<<<< | |
1672 * | |
1673 * cdef int libc_whence_from_io(int whence) | |
1674 */ | |
1675 struct __pyx_opt_args_5pysam_9libcutils_parse_region { | |
1676 int __pyx_n; | |
1677 PyObject *contig; | |
1678 PyObject *start; | |
1679 PyObject *stop; | |
1680 PyObject *region; | |
1681 PyObject *reference; | |
1682 PyObject *end; | |
1683 }; | |
1684 | |
1685 /* "pysam/libcutils.pxd":15 | |
1686 * # Utility functions for quality string conversions | |
1687 * | |
1688 * cpdef c_array.array qualitystring_to_array(input_str, int offset=*) # <<<<<<<<<<<<<< | |
1689 * cpdef array_to_qualitystring(c_array.array arr, int offset=*) | |
1690 * cpdef qualities_to_qualitystring(qualities, int offset=*) | |
1691 */ | |
1692 struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array { | |
1693 int __pyx_n; | |
1694 int offset; | |
1695 }; | |
1696 | |
1697 /* "pysam/libcutils.pxd":16 | |
1698 * | |
1699 * cpdef c_array.array qualitystring_to_array(input_str, int offset=*) | |
1700 * cpdef array_to_qualitystring(c_array.array arr, int offset=*) # <<<<<<<<<<<<<< | |
1701 * cpdef qualities_to_qualitystring(qualities, int offset=*) | |
1702 * | |
1703 */ | |
1704 struct __pyx_opt_args_5pysam_9libcutils_array_to_qualitystring { | |
1705 int __pyx_n; | |
1706 int offset; | |
1707 }; | |
1708 | |
1709 /* "pysam/libcutils.pxd":17 | |
1710 * cpdef c_array.array qualitystring_to_array(input_str, int offset=*) | |
1711 * cpdef array_to_qualitystring(c_array.array arr, int offset=*) | |
1712 * cpdef qualities_to_qualitystring(qualities, int offset=*) # <<<<<<<<<<<<<< | |
1713 * | |
1714 * ######################################################################## | |
1715 */ | |
1716 struct __pyx_opt_args_5pysam_9libcutils_qualities_to_qualitystring { | |
1717 int __pyx_n; | |
1718 int offset; | |
1719 }; | |
1720 | |
1721 /* "pysam/libcutils.pxd":29 | |
1722 * ## Python 3 compatibility functions | |
1723 * ######################################################################## | |
1724 * cdef charptr_to_str(const char *s, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1725 * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) | |
1726 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) | |
1727 */ | |
1728 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str { | |
1729 int __pyx_n; | |
1730 PyObject *encoding; | |
1731 PyObject *errors; | |
1732 }; | |
1733 | |
1734 /* "pysam/libcutils.pxd":30 | |
1735 * ######################################################################## | |
1736 * cdef charptr_to_str(const char *s, encoding=*, errors=*) | |
1737 * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1738 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) | |
1739 * cdef force_str(object s, encoding=*, errors=*) | |
1740 */ | |
1741 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_bytes { | |
1742 int __pyx_n; | |
1743 PyObject *encoding; | |
1744 PyObject *errors; | |
1745 }; | |
1746 | |
1747 /* "pysam/libcutils.pxd":31 | |
1748 * cdef charptr_to_str(const char *s, encoding=*, errors=*) | |
1749 * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) | |
1750 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1751 * cdef force_str(object s, encoding=*, errors=*) | |
1752 * cdef bytes force_bytes(object s, encoding=*, errors=*) | |
1753 */ | |
1754 struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str_w_len { | |
1755 int __pyx_n; | |
1756 PyObject *encoding; | |
1757 PyObject *errors; | |
1758 }; | |
1759 | |
1760 /* "pysam/libcutils.pxd":32 | |
1761 * cdef bytes charptr_to_bytes(const char *s, encoding=*, errors=*) | |
1762 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) | |
1763 * cdef force_str(object s, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1764 * cdef bytes force_bytes(object s, encoding=*, errors=*) | |
1765 * cdef decode_bytes(bytes s, encoding=*, errors=*) | |
1766 */ | |
1767 struct __pyx_opt_args_5pysam_9libcutils_force_str { | |
1768 int __pyx_n; | |
1769 PyObject *encoding; | |
1770 PyObject *errors; | |
1771 }; | |
1772 | |
1773 /* "pysam/libcutils.pxd":33 | |
1774 * cdef charptr_to_str_w_len(const char* s, size_t n, encoding=*, errors=*) | |
1775 * cdef force_str(object s, encoding=*, errors=*) | |
1776 * cdef bytes force_bytes(object s, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1777 * cdef decode_bytes(bytes s, encoding=*, errors=*) | |
1778 * cdef bytes encode_filename(object filename) | |
1779 */ | |
1780 struct __pyx_opt_args_5pysam_9libcutils_force_bytes { | |
1781 int __pyx_n; | |
1782 PyObject *encoding; | |
1783 PyObject *errors; | |
1784 }; | |
1785 | |
1786 /* "pysam/libcutils.pxd":34 | |
1787 * cdef force_str(object s, encoding=*, errors=*) | |
1788 * cdef bytes force_bytes(object s, encoding=*, errors=*) | |
1789 * cdef decode_bytes(bytes s, encoding=*, errors=*) # <<<<<<<<<<<<<< | |
1790 * cdef bytes encode_filename(object filename) | |
1791 * cdef from_string_and_size(const char *s, size_t length) | |
1792 */ | |
1793 struct __pyx_opt_args_5pysam_9libcutils_decode_bytes { | |
1794 int __pyx_n; | |
1795 PyObject *encoding; | |
1796 PyObject *errors; | |
1797 }; | |
1798 struct __pyx_opt_args_5pysam_9libcfaidx_10FastqProxy_get_quality_array; | |
1799 struct __pyx_opt_args_5pysam_9libcfaidx_11FastxRecord_get_quality_array; | |
1800 | |
1801 /* "pysam/libcfaidx.pxd":50 | |
1802 * cdef cython.str to_string(self) | |
1803 * cdef cython.str tostring(self) | |
1804 * cpdef array.array get_quality_array(self, int offset=*) # <<<<<<<<<<<<<< | |
1805 * | |
1806 * | |
1807 */ | |
1808 struct __pyx_opt_args_5pysam_9libcfaidx_10FastqProxy_get_quality_array { | |
1809 int __pyx_n; | |
1810 int offset; | |
1811 }; | |
1812 | |
1813 /* "pysam/libcfaidx.pxd":60 | |
1814 * cdef cython.str to_string(self) | |
1815 * cdef cython.str tostring(self) | |
1816 * cpdef array.array get_quality_array(self, int offset=*) # <<<<<<<<<<<<<< | |
1817 * | |
1818 * cdef class FastxFile: | |
1819 */ | |
1820 struct __pyx_opt_args_5pysam_9libcfaidx_11FastxRecord_get_quality_array { | |
1821 int __pyx_n; | |
1822 int offset; | |
1823 }; | |
1824 | |
1825 /* "pysam/libchtslib.pxd":2706 | |
1826 * | |
1827 * | |
1828 * cdef class HTSFile(object): # <<<<<<<<<<<<<< | |
1829 * cdef htsFile *htsfile # pointer to htsFile structure | |
1830 * cdef int64_t start_offset # BGZF offset of first record | |
1831 */ | |
1832 struct __pyx_obj_5pysam_10libchtslib_HTSFile { | |
1833 PyObject_HEAD | |
1834 struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile *__pyx_vtab; | |
1835 htsFile *htsfile; | |
1836 int64_t start_offset; | |
1837 PyObject *filename; | |
1838 PyObject *mode; | |
1839 PyObject *threads; | |
1840 PyObject *index_filename; | |
1841 int is_stream; | |
1842 int is_remote; | |
1843 int duplicate_filehandle; | |
1844 }; | |
1845 | |
1846 | |
1847 /* "pysam/libcfaidx.pxd":38 | |
1848 * int * dret) | |
1849 * | |
1850 * cdef class FastaFile: # <<<<<<<<<<<<<< | |
1851 * cdef bint is_remote | |
1852 * cdef object _filename, _references, _lengths, reference2length | |
1853 */ | |
1854 struct __pyx_obj_5pysam_9libcfaidx_FastaFile { | |
1855 PyObject_HEAD | |
1856 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastaFile *__pyx_vtab; | |
1857 int is_remote; | |
1858 PyObject *_filename; | |
1859 PyObject *_references; | |
1860 PyObject *_lengths; | |
1861 PyObject *reference2length; | |
1862 faidx_t *fastafile; | |
1863 }; | |
1864 | |
1865 | |
1866 /* "pysam/libcfaidx.pxd":46 | |
1867 * | |
1868 * | |
1869 * cdef class FastqProxy: # <<<<<<<<<<<<<< | |
1870 * cdef kseq_t * _delegate | |
1871 * cdef cython.str to_string(self) | |
1872 */ | |
1873 struct __pyx_obj_5pysam_9libcfaidx_FastqProxy { | |
1874 PyObject_HEAD | |
1875 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqProxy *__pyx_vtab; | |
1876 kseq_t *_delegate; | |
1877 }; | |
1878 | |
1879 | |
1880 /* "pysam/libcfaidx.pxd":53 | |
1881 * | |
1882 * | |
1883 * cdef class FastxRecord: # <<<<<<<<<<<<<< | |
1884 * """ | |
1885 * Python container for pysam.libcfaidx.FastqProxy with persistence. | |
1886 */ | |
1887 struct __pyx_obj_5pysam_9libcfaidx_FastxRecord { | |
1888 PyObject_HEAD | |
1889 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxRecord *__pyx_vtab; | |
1890 PyObject *comment; | |
1891 PyObject *quality; | |
1892 PyObject *sequence; | |
1893 PyObject *name; | |
1894 }; | |
1895 | |
1896 | |
1897 /* "pysam/libcfaidx.pxd":62 | |
1898 * cpdef array.array get_quality_array(self, int offset=*) | |
1899 * | |
1900 * cdef class FastxFile: # <<<<<<<<<<<<<< | |
1901 * cdef object _filename | |
1902 * cdef BGZF * fastqfile | |
1903 */ | |
1904 struct __pyx_obj_5pysam_9libcfaidx_FastxFile { | |
1905 PyObject_HEAD | |
1906 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxFile *__pyx_vtab; | |
1907 PyObject *_filename; | |
1908 BGZF *fastqfile; | |
1909 kseq_t *entry; | |
1910 int persist; | |
1911 int is_remote; | |
1912 }; | |
1913 | |
1914 | |
1915 /* "pysam/libcfaidx.pxd":74 | |
1916 * | |
1917 * # Compatibility Layer for pysam 0.8.1 | |
1918 * cdef class FastqFile(FastxFile): # <<<<<<<<<<<<<< | |
1919 * pass | |
1920 * | |
1921 */ | |
1922 struct __pyx_obj_5pysam_9libcfaidx_FastqFile { | |
1923 struct __pyx_obj_5pysam_9libcfaidx_FastxFile __pyx_base; | |
1924 }; | |
1925 | |
1926 | |
1927 /* "pysam/libcfaidx.pxd":79 | |
1928 * | |
1929 * # Compatibility Layer for pysam < 0.8 | |
1930 * cdef class Fastafile(FastaFile): # <<<<<<<<<<<<<< | |
1931 * pass | |
1932 * | |
1933 */ | |
1934 struct __pyx_obj_5pysam_9libcfaidx_Fastafile { | |
1935 struct __pyx_obj_5pysam_9libcfaidx_FastaFile __pyx_base; | |
1936 }; | |
1937 | |
1938 | |
1939 | |
1940 /* "pysam/libchtslib.pxd":2706 | |
1941 * | |
1942 * | |
1943 * cdef class HTSFile(object): # <<<<<<<<<<<<<< | |
1944 * cdef htsFile *htsfile # pointer to htsFile structure | |
1945 * cdef int64_t start_offset # BGZF offset of first record | |
1946 */ | |
1947 | |
1948 struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile { | |
1949 htsFile *(*_open_htsfile)(struct __pyx_obj_5pysam_10libchtslib_HTSFile *); | |
1950 }; | |
1951 static struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile *__pyx_vtabptr_5pysam_10libchtslib_HTSFile; | |
1952 | |
1953 | |
1954 /* "pysam/libcfaidx.pyx":83 | |
1955 * ## add automatic indexing. | |
1956 * ## add function to get sequence names. | |
1957 * cdef class FastaFile: # <<<<<<<<<<<<<< | |
1958 * """Random access to fasta formatted files that | |
1959 * have been indexed by :term:`faidx`. | |
1960 */ | |
1961 | |
1962 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastaFile { | |
1963 char *(*_fetch)(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *, char *, int, int, int *); | |
1964 }; | |
1965 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastaFile *__pyx_vtabptr_5pysam_9libcfaidx_FastaFile; | |
1966 | |
1967 | |
1968 /* "pysam/libcfaidx.pyx":355 | |
1969 * | |
1970 * | |
1971 * cdef class FastqProxy: # <<<<<<<<<<<<<< | |
1972 * """A single entry in a fastq file.""" | |
1973 * def __init__(self): | |
1974 */ | |
1975 | |
1976 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqProxy { | |
1977 PyObject *(*to_string)(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *); | |
1978 PyObject *(*tostring)(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *); | |
1979 arrayobject *(*get_quality_array)(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcfaidx_10FastqProxy_get_quality_array *__pyx_optional_args); | |
1980 }; | |
1981 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqProxy *__pyx_vtabptr_5pysam_9libcfaidx_FastqProxy; | |
1982 | |
1983 | |
1984 /* "pysam/libcfaidx.pyx":411 | |
1985 * offset=offset) | |
1986 * | |
1987 * cdef class FastxRecord: # <<<<<<<<<<<<<< | |
1988 * """A fasta/fastq record. | |
1989 * | |
1990 */ | |
1991 | |
1992 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxRecord { | |
1993 PyObject *(*to_string)(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *); | |
1994 PyObject *(*tostring)(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *); | |
1995 arrayobject *(*get_quality_array)(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcfaidx_11FastxRecord_get_quality_array *__pyx_optional_args); | |
1996 }; | |
1997 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxRecord *__pyx_vtabptr_5pysam_9libcfaidx_FastxRecord; | |
1998 | |
1999 | |
2000 /* "pysam/libcfaidx.pyx":496 | |
2001 * | |
2002 * | |
2003 * cdef class FastxFile: # <<<<<<<<<<<<<< | |
2004 * r"""Stream access to :term:`fasta` or :term:`fastq` formatted files. | |
2005 * | |
2006 */ | |
2007 | |
2008 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxFile { | |
2009 kseq_t *(*getCurrent)(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *); | |
2010 int (*cnext)(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *); | |
2011 }; | |
2012 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxFile *__pyx_vtabptr_5pysam_9libcfaidx_FastxFile; | |
2013 | |
2014 | |
2015 /* "pysam/libcfaidx.pyx":658 | |
2016 * | |
2017 * # Compatibility Layer for pysam 0.8.1 | |
2018 * cdef class FastqFile(FastxFile): # <<<<<<<<<<<<<< | |
2019 * """FastqFile is deprecated: use FastxFile instead""" | |
2020 * pass | |
2021 */ | |
2022 | |
2023 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqFile { | |
2024 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxFile __pyx_base; | |
2025 }; | |
2026 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqFile *__pyx_vtabptr_5pysam_9libcfaidx_FastqFile; | |
2027 | |
2028 | |
2029 /* "pysam/libcfaidx.pyx":663 | |
2030 * | |
2031 * # Compatibility Layer for pysam < 0.8 | |
2032 * cdef class Fastafile(FastaFile): # <<<<<<<<<<<<<< | |
2033 * """Fastafile is deprecated: use FastaFile instead""" | |
2034 * pass | |
2035 */ | |
2036 | |
2037 struct __pyx_vtabstruct_5pysam_9libcfaidx_Fastafile { | |
2038 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastaFile __pyx_base; | |
2039 }; | |
2040 static struct __pyx_vtabstruct_5pysam_9libcfaidx_Fastafile *__pyx_vtabptr_5pysam_9libcfaidx_Fastafile; | |
2041 /* #### Code section: utility_code_proto ### */ | |
2042 | |
2043 /* --- Runtime support code (head) --- */ | |
2044 /* Refnanny.proto */ | |
2045 #ifndef CYTHON_REFNANNY | |
2046 #define CYTHON_REFNANNY 0 | |
2047 #endif | |
2048 #if CYTHON_REFNANNY | |
2049 typedef struct { | |
2050 void (*INCREF)(void*, PyObject*, Py_ssize_t); | |
2051 void (*DECREF)(void*, PyObject*, Py_ssize_t); | |
2052 void (*GOTREF)(void*, PyObject*, Py_ssize_t); | |
2053 void (*GIVEREF)(void*, PyObject*, Py_ssize_t); | |
2054 void* (*SetupContext)(const char*, Py_ssize_t, const char*); | |
2055 void (*FinishContext)(void**); | |
2056 } __Pyx_RefNannyAPIStruct; | |
2057 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; | |
2058 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); | |
2059 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; | |
2060 #ifdef WITH_THREAD | |
2061 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ | |
2062 if (acquire_gil) {\ | |
2063 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ | |
2064 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ | |
2065 PyGILState_Release(__pyx_gilstate_save);\ | |
2066 } else {\ | |
2067 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ | |
2068 } | |
2069 #define __Pyx_RefNannyFinishContextNogil() {\ | |
2070 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ | |
2071 __Pyx_RefNannyFinishContext();\ | |
2072 PyGILState_Release(__pyx_gilstate_save);\ | |
2073 } | |
2074 #else | |
2075 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ | |
2076 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) | |
2077 #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() | |
2078 #endif | |
2079 #define __Pyx_RefNannyFinishContextNogil() {\ | |
2080 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ | |
2081 __Pyx_RefNannyFinishContext();\ | |
2082 PyGILState_Release(__pyx_gilstate_save);\ | |
2083 } | |
2084 #define __Pyx_RefNannyFinishContext()\ | |
2085 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) | |
2086 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) | |
2087 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) | |
2088 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) | |
2089 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) | |
2090 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) | |
2091 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) | |
2092 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) | |
2093 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) | |
2094 #else | |
2095 #define __Pyx_RefNannyDeclarations | |
2096 #define __Pyx_RefNannySetupContext(name, acquire_gil) | |
2097 #define __Pyx_RefNannyFinishContextNogil() | |
2098 #define __Pyx_RefNannyFinishContext() | |
2099 #define __Pyx_INCREF(r) Py_INCREF(r) | |
2100 #define __Pyx_DECREF(r) Py_DECREF(r) | |
2101 #define __Pyx_GOTREF(r) | |
2102 #define __Pyx_GIVEREF(r) | |
2103 #define __Pyx_XINCREF(r) Py_XINCREF(r) | |
2104 #define __Pyx_XDECREF(r) Py_XDECREF(r) | |
2105 #define __Pyx_XGOTREF(r) | |
2106 #define __Pyx_XGIVEREF(r) | |
2107 #endif | |
2108 #define __Pyx_Py_XDECREF_SET(r, v) do {\ | |
2109 PyObject *tmp = (PyObject *) r;\ | |
2110 r = v; Py_XDECREF(tmp);\ | |
2111 } while (0) | |
2112 #define __Pyx_XDECREF_SET(r, v) do {\ | |
2113 PyObject *tmp = (PyObject *) r;\ | |
2114 r = v; __Pyx_XDECREF(tmp);\ | |
2115 } while (0) | |
2116 #define __Pyx_DECREF_SET(r, v) do {\ | |
2117 PyObject *tmp = (PyObject *) r;\ | |
2118 r = v; __Pyx_DECREF(tmp);\ | |
2119 } while (0) | |
2120 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) | |
2121 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) | |
2122 | |
2123 /* PyErrExceptionMatches.proto */ | |
2124 #if CYTHON_FAST_THREAD_STATE | |
2125 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) | |
2126 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); | |
2127 #else | |
2128 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) | |
2129 #endif | |
2130 | |
2131 /* PyThreadStateGet.proto */ | |
2132 #if CYTHON_FAST_THREAD_STATE | |
2133 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; | |
2134 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; | |
2135 #if PY_VERSION_HEX >= 0x030C00A6 | |
2136 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) | |
2137 #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) | |
2138 #else | |
2139 #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) | |
2140 #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) | |
2141 #endif | |
2142 #else | |
2143 #define __Pyx_PyThreadState_declare | |
2144 #define __Pyx_PyThreadState_assign | |
2145 #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) | |
2146 #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() | |
2147 #endif | |
2148 | |
2149 /* PyErrFetchRestore.proto */ | |
2150 #if CYTHON_FAST_THREAD_STATE | |
2151 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) | |
2152 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) | |
2153 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) | |
2154 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) | |
2155 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) | |
2156 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); | |
2157 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); | |
2158 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 | |
2159 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) | |
2160 #else | |
2161 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) | |
2162 #endif | |
2163 #else | |
2164 #define __Pyx_PyErr_Clear() PyErr_Clear() | |
2165 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) | |
2166 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) | |
2167 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) | |
2168 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) | |
2169 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) | |
2170 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) | |
2171 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) | |
2172 #endif | |
2173 | |
2174 /* PyObjectGetAttrStr.proto */ | |
2175 #if CYTHON_USE_TYPE_SLOTS | |
2176 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); | |
2177 #else | |
2178 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) | |
2179 #endif | |
2180 | |
2181 /* PyObjectGetAttrStrNoError.proto */ | |
2182 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); | |
2183 | |
2184 /* GetBuiltinName.proto */ | |
2185 static PyObject *__Pyx_GetBuiltinName(PyObject *name); | |
2186 | |
2187 /* TupleAndListFromArray.proto */ | |
2188 #if CYTHON_COMPILING_IN_CPYTHON | |
2189 static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); | |
2190 static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); | |
2191 #endif | |
2192 | |
2193 /* IncludeStringH.proto */ | |
2194 #include <string.h> | |
2195 | |
2196 /* BytesEquals.proto */ | |
2197 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); | |
2198 | |
2199 /* UnicodeEquals.proto */ | |
2200 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); | |
2201 | |
2202 /* fastcall.proto */ | |
2203 #if CYTHON_AVOID_BORROWED_REFS | |
2204 #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) | |
2205 #elif CYTHON_ASSUME_SAFE_MACROS | |
2206 #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) | |
2207 #else | |
2208 #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) | |
2209 #endif | |
2210 #if CYTHON_AVOID_BORROWED_REFS | |
2211 #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) | |
2212 #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) | |
2213 #else | |
2214 #define __Pyx_Arg_NewRef_VARARGS(arg) arg | |
2215 #define __Pyx_Arg_XDECREF_VARARGS(arg) | |
2216 #endif | |
2217 #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) | |
2218 #define __Pyx_KwValues_VARARGS(args, nargs) NULL | |
2219 #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) | |
2220 #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) | |
2221 #if CYTHON_METH_FASTCALL | |
2222 #define __Pyx_Arg_FASTCALL(args, i) args[i] | |
2223 #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) | |
2224 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) | |
2225 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); | |
2226 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 | |
2227 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); | |
2228 #else | |
2229 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) | |
2230 #endif | |
2231 #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs | |
2232 to have the same reference counting */ | |
2233 #define __Pyx_Arg_XDECREF_FASTCALL(arg) | |
2234 #else | |
2235 #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS | |
2236 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS | |
2237 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS | |
2238 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS | |
2239 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS | |
2240 #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) | |
2241 #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) | |
2242 #endif | |
2243 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
2244 #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) | |
2245 #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) | |
2246 #else | |
2247 #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) | |
2248 #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) | |
2249 #endif | |
2250 | |
2251 /* Profile.proto */ | |
2252 #ifndef CYTHON_PROFILE | |
2253 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY | |
2254 #define CYTHON_PROFILE 0 | |
2255 #else | |
2256 #define CYTHON_PROFILE 1 | |
2257 #endif | |
2258 #endif | |
2259 #ifndef CYTHON_TRACE_NOGIL | |
2260 #define CYTHON_TRACE_NOGIL 0 | |
2261 #else | |
2262 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE) | |
2263 #define CYTHON_TRACE 1 | |
2264 #endif | |
2265 #endif | |
2266 #ifndef CYTHON_TRACE | |
2267 #define CYTHON_TRACE 0 | |
2268 #endif | |
2269 #if CYTHON_TRACE | |
2270 #undef CYTHON_PROFILE_REUSE_FRAME | |
2271 #endif | |
2272 #ifndef CYTHON_PROFILE_REUSE_FRAME | |
2273 #define CYTHON_PROFILE_REUSE_FRAME 0 | |
2274 #endif | |
2275 #if CYTHON_PROFILE || CYTHON_TRACE | |
2276 #include "compile.h" | |
2277 #include "frameobject.h" | |
2278 #include "traceback.h" | |
2279 #if PY_VERSION_HEX >= 0x030b00a6 | |
2280 #ifndef Py_BUILD_CORE | |
2281 #define Py_BUILD_CORE 1 | |
2282 #endif | |
2283 #include "internal/pycore_frame.h" | |
2284 #endif | |
2285 #if CYTHON_PROFILE_REUSE_FRAME | |
2286 #define CYTHON_FRAME_MODIFIER static | |
2287 #define CYTHON_FRAME_DEL(frame) | |
2288 #else | |
2289 #define CYTHON_FRAME_MODIFIER | |
2290 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame) | |
2291 #endif | |
2292 #define __Pyx_TraceDeclarations\ | |
2293 static PyCodeObject *__pyx_frame_code = NULL;\ | |
2294 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\ | |
2295 int __Pyx_use_tracing = 0; | |
2296 #define __Pyx_TraceFrameInit(codeobj)\ | |
2297 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj; | |
2298 #if PY_VERSION_HEX >= 0x030b00a2 | |
2299 #if PY_VERSION_HEX >= 0x030C00b1 | |
2300 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ | |
2301 ((!(check_tracing) || !(tstate)->tracing) &&\ | |
2302 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) | |
2303 #else | |
2304 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ | |
2305 (unlikely((tstate)->cframe->use_tracing) &&\ | |
2306 (!(check_tracing) || !(tstate)->tracing) &&\ | |
2307 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) | |
2308 #endif | |
2309 #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate) | |
2310 #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate) | |
2311 #elif PY_VERSION_HEX >= 0x030a00b1 | |
2312 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ | |
2313 (unlikely((tstate)->cframe->use_tracing) &&\ | |
2314 (!(check_tracing) || !(tstate)->tracing) &&\ | |
2315 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) | |
2316 #define __Pyx_EnterTracing(tstate)\ | |
2317 do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0) | |
2318 #define __Pyx_LeaveTracing(tstate)\ | |
2319 do {\ | |
2320 tstate->tracing--;\ | |
2321 tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ | |
2322 || tstate->c_profilefunc != NULL);\ | |
2323 } while (0) | |
2324 #else | |
2325 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\ | |
2326 (unlikely((tstate)->use_tracing) &&\ | |
2327 (!(check_tracing) || !(tstate)->tracing) &&\ | |
2328 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc))) | |
2329 #define __Pyx_EnterTracing(tstate)\ | |
2330 do { tstate->tracing++; tstate->use_tracing = 0; } while (0) | |
2331 #define __Pyx_LeaveTracing(tstate)\ | |
2332 do {\ | |
2333 tstate->tracing--;\ | |
2334 tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\ | |
2335 || tstate->c_profilefunc != NULL);\ | |
2336 } while (0) | |
2337 #endif | |
2338 #ifdef WITH_THREAD | |
2339 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ | |
2340 if (nogil) {\ | |
2341 if (CYTHON_TRACE_NOGIL) {\ | |
2342 PyThreadState *tstate;\ | |
2343 PyGILState_STATE state = PyGILState_Ensure();\ | |
2344 tstate = __Pyx_PyThreadState_Current;\ | |
2345 if (__Pyx_IsTracing(tstate, 1, 1)) {\ | |
2346 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ | |
2347 }\ | |
2348 PyGILState_Release(state);\ | |
2349 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ | |
2350 }\ | |
2351 } else {\ | |
2352 PyThreadState* tstate = PyThreadState_GET();\ | |
2353 if (__Pyx_IsTracing(tstate, 1, 1)) {\ | |
2354 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ | |
2355 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ | |
2356 }\ | |
2357 } | |
2358 #else | |
2359 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\ | |
2360 { PyThreadState* tstate = PyThreadState_GET();\ | |
2361 if (__Pyx_IsTracing(tstate, 1, 1)) {\ | |
2362 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\ | |
2363 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\ | |
2364 }\ | |
2365 } | |
2366 #endif | |
2367 #define __Pyx_TraceException()\ | |
2368 if (likely(!__Pyx_use_tracing)); else {\ | |
2369 PyThreadState* tstate = __Pyx_PyThreadState_Current;\ | |
2370 if (__Pyx_IsTracing(tstate, 0, 1)) {\ | |
2371 __Pyx_EnterTracing(tstate);\ | |
2372 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\ | |
2373 if (exc_info) {\ | |
2374 if (CYTHON_TRACE && tstate->c_tracefunc)\ | |
2375 tstate->c_tracefunc(\ | |
2376 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ | |
2377 tstate->c_profilefunc(\ | |
2378 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\ | |
2379 Py_DECREF(exc_info);\ | |
2380 }\ | |
2381 __Pyx_LeaveTracing(tstate);\ | |
2382 }\ | |
2383 } | |
2384 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) { | |
2385 PyObject *type, *value, *traceback; | |
2386 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); | |
2387 __Pyx_EnterTracing(tstate); | |
2388 if (CYTHON_TRACE && tstate->c_tracefunc) | |
2389 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result); | |
2390 if (tstate->c_profilefunc) | |
2391 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result); | |
2392 CYTHON_FRAME_DEL(frame); | |
2393 __Pyx_LeaveTracing(tstate); | |
2394 __Pyx_ErrRestoreInState(tstate, type, value, traceback); | |
2395 } | |
2396 #ifdef WITH_THREAD | |
2397 #define __Pyx_TraceReturn(result, nogil)\ | |
2398 if (likely(!__Pyx_use_tracing)); else {\ | |
2399 if (nogil) {\ | |
2400 if (CYTHON_TRACE_NOGIL) {\ | |
2401 PyThreadState *tstate;\ | |
2402 PyGILState_STATE state = PyGILState_Ensure();\ | |
2403 tstate = __Pyx_PyThreadState_Current;\ | |
2404 if (__Pyx_IsTracing(tstate, 0, 0)) {\ | |
2405 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ | |
2406 }\ | |
2407 PyGILState_Release(state);\ | |
2408 }\ | |
2409 } else {\ | |
2410 PyThreadState* tstate = __Pyx_PyThreadState_Current;\ | |
2411 if (__Pyx_IsTracing(tstate, 0, 0)) {\ | |
2412 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ | |
2413 }\ | |
2414 }\ | |
2415 } | |
2416 #else | |
2417 #define __Pyx_TraceReturn(result, nogil)\ | |
2418 if (likely(!__Pyx_use_tracing)); else {\ | |
2419 PyThreadState* tstate = __Pyx_PyThreadState_Current;\ | |
2420 if (__Pyx_IsTracing(tstate, 0, 0)) {\ | |
2421 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\ | |
2422 }\ | |
2423 } | |
2424 #endif | |
2425 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); | |
2426 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno); | |
2427 #else | |
2428 #define __Pyx_TraceDeclarations | |
2429 #define __Pyx_TraceFrameInit(codeobj) | |
2430 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error; | |
2431 #define __Pyx_TraceException() | |
2432 #define __Pyx_TraceReturn(result, nogil) | |
2433 #endif | |
2434 #if CYTHON_TRACE | |
2435 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) { | |
2436 int ret; | |
2437 PyObject *type, *value, *traceback; | |
2438 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); | |
2439 __Pyx_PyFrame_SetLineNumber(frame, lineno); | |
2440 __Pyx_EnterTracing(tstate); | |
2441 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL); | |
2442 __Pyx_LeaveTracing(tstate); | |
2443 if (likely(!ret)) { | |
2444 __Pyx_ErrRestoreInState(tstate, type, value, traceback); | |
2445 } else { | |
2446 Py_XDECREF(type); | |
2447 Py_XDECREF(value); | |
2448 Py_XDECREF(traceback); | |
2449 } | |
2450 return ret; | |
2451 } | |
2452 #ifdef WITH_THREAD | |
2453 #define __Pyx_TraceLine(lineno, nogil, goto_error)\ | |
2454 if (likely(!__Pyx_use_tracing)); else {\ | |
2455 if (nogil) {\ | |
2456 if (CYTHON_TRACE_NOGIL) {\ | |
2457 int ret = 0;\ | |
2458 PyThreadState *tstate;\ | |
2459 PyGILState_STATE state = __Pyx_PyGILState_Ensure();\ | |
2460 tstate = __Pyx_PyThreadState_Current;\ | |
2461 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ | |
2462 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ | |
2463 }\ | |
2464 __Pyx_PyGILState_Release(state);\ | |
2465 if (unlikely(ret)) goto_error;\ | |
2466 }\ | |
2467 } else {\ | |
2468 PyThreadState* tstate = __Pyx_PyThreadState_Current;\ | |
2469 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ | |
2470 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ | |
2471 if (unlikely(ret)) goto_error;\ | |
2472 }\ | |
2473 }\ | |
2474 } | |
2475 #else | |
2476 #define __Pyx_TraceLine(lineno, nogil, goto_error)\ | |
2477 if (likely(!__Pyx_use_tracing)); else {\ | |
2478 PyThreadState* tstate = __Pyx_PyThreadState_Current;\ | |
2479 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\ | |
2480 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\ | |
2481 if (unlikely(ret)) goto_error;\ | |
2482 }\ | |
2483 } | |
2484 #endif | |
2485 #else | |
2486 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error; | |
2487 #endif | |
2488 | |
2489 /* KeywordStringCheck.proto */ | |
2490 static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); | |
2491 | |
2492 /* PyObjectCall.proto */ | |
2493 #if CYTHON_COMPILING_IN_CPYTHON | |
2494 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); | |
2495 #else | |
2496 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) | |
2497 #endif | |
2498 | |
2499 /* RaiseArgTupleInvalid.proto */ | |
2500 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, | |
2501 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); | |
2502 | |
2503 /* RaiseException.proto */ | |
2504 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); | |
2505 | |
2506 /* RaiseDoubleKeywords.proto */ | |
2507 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); | |
2508 | |
2509 /* ParseKeywords.proto */ | |
2510 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, | |
2511 PyObject **argnames[], | |
2512 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, | |
2513 const char* function_name); | |
2514 | |
2515 /* PyFunctionFastCall.proto */ | |
2516 #if CYTHON_FAST_PYCALL | |
2517 #if !CYTHON_VECTORCALL | |
2518 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ | |
2519 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) | |
2520 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); | |
2521 #endif | |
2522 #define __Pyx_BUILD_ASSERT_EXPR(cond)\ | |
2523 (sizeof(char [1 - 2*!(cond)]) - 1) | |
2524 #ifndef Py_MEMBER_SIZE | |
2525 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) | |
2526 #endif | |
2527 #if !CYTHON_VECTORCALL | |
2528 #if PY_VERSION_HEX >= 0x03080000 | |
2529 #include "frameobject.h" | |
2530 #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API | |
2531 #ifndef Py_BUILD_CORE | |
2532 #define Py_BUILD_CORE 1 | |
2533 #endif | |
2534 #include "internal/pycore_frame.h" | |
2535 #endif | |
2536 #define __Pxy_PyFrame_Initialize_Offsets() | |
2537 #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) | |
2538 #else | |
2539 static size_t __pyx_pyframe_localsplus_offset = 0; | |
2540 #include "frameobject.h" | |
2541 #define __Pxy_PyFrame_Initialize_Offsets()\ | |
2542 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ | |
2543 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) | |
2544 #define __Pyx_PyFrame_GetLocalsplus(frame)\ | |
2545 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) | |
2546 #endif | |
2547 #endif | |
2548 #endif | |
2549 | |
2550 /* PyObjectCallMethO.proto */ | |
2551 #if CYTHON_COMPILING_IN_CPYTHON | |
2552 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); | |
2553 #endif | |
2554 | |
2555 /* PyObjectFastCall.proto */ | |
2556 #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) | |
2557 static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); | |
2558 | |
2559 /* PyDictVersioning.proto */ | |
2560 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS | |
2561 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) | |
2562 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) | |
2563 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ | |
2564 (version_var) = __PYX_GET_DICT_VERSION(dict);\ | |
2565 (cache_var) = (value); | |
2566 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ | |
2567 static PY_UINT64_T __pyx_dict_version = 0;\ | |
2568 static PyObject *__pyx_dict_cached_value = NULL;\ | |
2569 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ | |
2570 (VAR) = __pyx_dict_cached_value;\ | |
2571 } else {\ | |
2572 (VAR) = __pyx_dict_cached_value = (LOOKUP);\ | |
2573 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ | |
2574 }\ | |
2575 } | |
2576 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); | |
2577 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); | |
2578 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); | |
2579 #else | |
2580 #define __PYX_GET_DICT_VERSION(dict) (0) | |
2581 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) | |
2582 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); | |
2583 #endif | |
2584 | |
2585 /* GetModuleGlobalName.proto */ | |
2586 #if CYTHON_USE_DICT_VERSIONS | |
2587 #define __Pyx_GetModuleGlobalName(var, name) do {\ | |
2588 static PY_UINT64_T __pyx_dict_version = 0;\ | |
2589 static PyObject *__pyx_dict_cached_value = NULL;\ | |
2590 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ | |
2591 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ | |
2592 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ | |
2593 } while(0) | |
2594 #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ | |
2595 PY_UINT64_T __pyx_dict_version;\ | |
2596 PyObject *__pyx_dict_cached_value;\ | |
2597 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ | |
2598 } while(0) | |
2599 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); | |
2600 #else | |
2601 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) | |
2602 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) | |
2603 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); | |
2604 #endif | |
2605 | |
2606 /* PyObjectCallOneArg.proto */ | |
2607 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); | |
2608 | |
2609 /* ListAppend.proto */ | |
2610 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS | |
2611 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { | |
2612 PyListObject* L = (PyListObject*) list; | |
2613 Py_ssize_t len = Py_SIZE(list); | |
2614 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { | |
2615 Py_INCREF(x); | |
2616 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 | |
2617 L->ob_item[len] = x; | |
2618 #else | |
2619 PyList_SET_ITEM(list, len, x); | |
2620 #endif | |
2621 __Pyx_SET_SIZE(list, len + 1); | |
2622 return 0; | |
2623 } | |
2624 return PyList_Append(list, x); | |
2625 } | |
2626 #else | |
2627 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) | |
2628 #endif | |
2629 | |
2630 /* PyObjectCall2Args.proto */ | |
2631 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); | |
2632 | |
2633 /* PyObjectGetMethod.proto */ | |
2634 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); | |
2635 | |
2636 /* PyObjectCallMethod1.proto */ | |
2637 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); | |
2638 | |
2639 /* append.proto */ | |
2640 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); | |
2641 | |
2642 /* WriteUnraisableException.proto */ | |
2643 static void __Pyx_WriteUnraisable(const char *name, int clineno, | |
2644 int lineno, const char *filename, | |
2645 int full_traceback, int nogil); | |
2646 | |
2647 /* RaiseTooManyValuesToUnpack.proto */ | |
2648 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); | |
2649 | |
2650 /* RaiseNeedMoreValuesToUnpack.proto */ | |
2651 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); | |
2652 | |
2653 /* IterFinish.proto */ | |
2654 static CYTHON_INLINE int __Pyx_IterFinish(void); | |
2655 | |
2656 /* UnpackItemEndCheck.proto */ | |
2657 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); | |
2658 | |
2659 /* GetException.proto */ | |
2660 #if CYTHON_FAST_THREAD_STATE | |
2661 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) | |
2662 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); | |
2663 #else | |
2664 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); | |
2665 #endif | |
2666 | |
2667 /* SwapException.proto */ | |
2668 #if CYTHON_FAST_THREAD_STATE | |
2669 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) | |
2670 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); | |
2671 #else | |
2672 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); | |
2673 #endif | |
2674 | |
2675 /* GetTopmostException.proto */ | |
2676 #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE | |
2677 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); | |
2678 #endif | |
2679 | |
2680 /* SaveResetException.proto */ | |
2681 #if CYTHON_FAST_THREAD_STATE | |
2682 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) | |
2683 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); | |
2684 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) | |
2685 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); | |
2686 #else | |
2687 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) | |
2688 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) | |
2689 #endif | |
2690 | |
2691 /* GetItemInt.proto */ | |
2692 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ | |
2693 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ | |
2694 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ | |
2695 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ | |
2696 __Pyx_GetItemInt_Generic(o, to_py_func(i)))) | |
2697 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ | |
2698 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ | |
2699 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ | |
2700 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) | |
2701 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, | |
2702 int wraparound, int boundscheck); | |
2703 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ | |
2704 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ | |
2705 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ | |
2706 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) | |
2707 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, | |
2708 int wraparound, int boundscheck); | |
2709 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); | |
2710 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, | |
2711 int is_list, int wraparound, int boundscheck); | |
2712 | |
2713 /* ObjectGetItem.proto */ | |
2714 #if CYTHON_USE_TYPE_SLOTS | |
2715 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); | |
2716 #else | |
2717 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) | |
2718 #endif | |
2719 | |
2720 /* PySequenceContains.proto */ | |
2721 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { | |
2722 int result = PySequence_Contains(seq, item); | |
2723 return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); | |
2724 } | |
2725 | |
2726 /* PyObjectFormatAndDecref.proto */ | |
2727 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f); | |
2728 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f); | |
2729 | |
2730 /* JoinPyUnicode.proto */ | |
2731 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, | |
2732 Py_UCS4 max_char); | |
2733 | |
2734 /* ExtTypeTest.proto */ | |
2735 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); | |
2736 | |
2737 /* ArgTypeTest.proto */ | |
2738 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ | |
2739 ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ | |
2740 __Pyx__ArgTypeTest(obj, type, name, exact)) | |
2741 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); | |
2742 | |
2743 /* RaiseUnexpectedTypeError.proto */ | |
2744 static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); | |
2745 | |
2746 /* PyUnicode_Unicode.proto */ | |
2747 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj); | |
2748 | |
2749 /* GetAttr3.proto */ | |
2750 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); | |
2751 | |
2752 /* Import.proto */ | |
2753 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); | |
2754 | |
2755 /* ImportFrom.proto */ | |
2756 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); | |
2757 | |
2758 /* GetAttr.proto */ | |
2759 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); | |
2760 | |
2761 /* HasAttr.proto */ | |
2762 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); | |
2763 | |
2764 /* IncludeStructmemberH.proto */ | |
2765 #include <structmember.h> | |
2766 | |
2767 /* FixUpExtensionType.proto */ | |
2768 #if CYTHON_USE_TYPE_SPECS | |
2769 static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); | |
2770 #endif | |
2771 | |
2772 /* PyObjectCallNoArg.proto */ | |
2773 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); | |
2774 | |
2775 /* PyObjectCallMethod0.proto */ | |
2776 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); | |
2777 | |
2778 /* ValidateBasesTuple.proto */ | |
2779 #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS | |
2780 static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); | |
2781 #endif | |
2782 | |
2783 /* PyType_Ready.proto */ | |
2784 CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); | |
2785 | |
2786 /* PyObject_GenericGetAttrNoDict.proto */ | |
2787 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 | |
2788 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); | |
2789 #else | |
2790 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr | |
2791 #endif | |
2792 | |
2793 /* PyObject_GenericGetAttr.proto */ | |
2794 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 | |
2795 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); | |
2796 #else | |
2797 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr | |
2798 #endif | |
2799 | |
2800 /* SetVTable.proto */ | |
2801 static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable); | |
2802 | |
2803 /* GetVTable.proto */ | |
2804 static void* __Pyx_GetVtable(PyTypeObject *type); | |
2805 | |
2806 /* MergeVTables.proto */ | |
2807 #if !CYTHON_COMPILING_IN_LIMITED_API | |
2808 static int __Pyx_MergeVtables(PyTypeObject *type); | |
2809 #endif | |
2810 | |
2811 /* SetupReduce.proto */ | |
2812 #if !CYTHON_COMPILING_IN_LIMITED_API | |
2813 static int __Pyx_setup_reduce(PyObject* type_obj); | |
2814 #endif | |
2815 | |
2816 /* TypeImport.proto */ | |
2817 #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11 | |
2818 #define __PYX_HAVE_RT_ImportType_proto_3_0_11 | |
2819 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L | |
2820 #include <stdalign.h> | |
2821 #endif | |
2822 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L | |
2823 #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s) | |
2824 #else | |
2825 #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*) | |
2826 #endif | |
2827 enum __Pyx_ImportType_CheckSize_3_0_11 { | |
2828 __Pyx_ImportType_CheckSize_Error_3_0_11 = 0, | |
2829 __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1, | |
2830 __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2 | |
2831 }; | |
2832 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); | |
2833 #endif | |
2834 | |
2835 /* ImportDottedModule.proto */ | |
2836 static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); | |
2837 #if PY_MAJOR_VERSION >= 3 | |
2838 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); | |
2839 #endif | |
2840 | |
2841 /* FetchSharedCythonModule.proto */ | |
2842 static PyObject *__Pyx_FetchSharedCythonABIModule(void); | |
2843 | |
2844 /* FetchCommonType.proto */ | |
2845 #if !CYTHON_USE_TYPE_SPECS | |
2846 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); | |
2847 #else | |
2848 static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); | |
2849 #endif | |
2850 | |
2851 /* PyMethodNew.proto */ | |
2852 #if CYTHON_COMPILING_IN_LIMITED_API | |
2853 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { | |
2854 PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; | |
2855 CYTHON_UNUSED_VAR(typ); | |
2856 if (!self) | |
2857 return __Pyx_NewRef(func); | |
2858 typesModule = PyImport_ImportModule("types"); | |
2859 if (!typesModule) return NULL; | |
2860 methodType = PyObject_GetAttrString(typesModule, "MethodType"); | |
2861 Py_DECREF(typesModule); | |
2862 if (!methodType) return NULL; | |
2863 result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); | |
2864 Py_DECREF(methodType); | |
2865 return result; | |
2866 } | |
2867 #elif PY_MAJOR_VERSION >= 3 | |
2868 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { | |
2869 CYTHON_UNUSED_VAR(typ); | |
2870 if (!self) | |
2871 return __Pyx_NewRef(func); | |
2872 return PyMethod_New(func, self); | |
2873 } | |
2874 #else | |
2875 #define __Pyx_PyMethod_New PyMethod_New | |
2876 #endif | |
2877 | |
2878 /* PyVectorcallFastCallDict.proto */ | |
2879 #if CYTHON_METH_FASTCALL | |
2880 static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); | |
2881 #endif | |
2882 | |
2883 /* CythonFunctionShared.proto */ | |
2884 #define __Pyx_CyFunction_USED | |
2885 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 | |
2886 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 | |
2887 #define __Pyx_CYFUNCTION_CCLASS 0x04 | |
2888 #define __Pyx_CYFUNCTION_COROUTINE 0x08 | |
2889 #define __Pyx_CyFunction_GetClosure(f)\ | |
2890 (((__pyx_CyFunctionObject *) (f))->func_closure) | |
2891 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API | |
2892 #define __Pyx_CyFunction_GetClassObj(f)\ | |
2893 (((__pyx_CyFunctionObject *) (f))->func_classobj) | |
2894 #else | |
2895 #define __Pyx_CyFunction_GetClassObj(f)\ | |
2896 ((PyObject*) ((PyCMethodObject *) (f))->mm_class) | |
2897 #endif | |
2898 #define __Pyx_CyFunction_SetClassObj(f, classobj)\ | |
2899 __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) | |
2900 #define __Pyx_CyFunction_Defaults(type, f)\ | |
2901 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) | |
2902 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ | |
2903 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) | |
2904 typedef struct { | |
2905 #if CYTHON_COMPILING_IN_LIMITED_API | |
2906 PyObject_HEAD | |
2907 PyObject *func; | |
2908 #elif PY_VERSION_HEX < 0x030900B1 | |
2909 PyCFunctionObject func; | |
2910 #else | |
2911 PyCMethodObject func; | |
2912 #endif | |
2913 #if CYTHON_BACKPORT_VECTORCALL | |
2914 __pyx_vectorcallfunc func_vectorcall; | |
2915 #endif | |
2916 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API | |
2917 PyObject *func_weakreflist; | |
2918 #endif | |
2919 PyObject *func_dict; | |
2920 PyObject *func_name; | |
2921 PyObject *func_qualname; | |
2922 PyObject *func_doc; | |
2923 PyObject *func_globals; | |
2924 PyObject *func_code; | |
2925 PyObject *func_closure; | |
2926 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API | |
2927 PyObject *func_classobj; | |
2928 #endif | |
2929 void *defaults; | |
2930 int defaults_pyobjects; | |
2931 size_t defaults_size; | |
2932 int flags; | |
2933 PyObject *defaults_tuple; | |
2934 PyObject *defaults_kwdict; | |
2935 PyObject *(*defaults_getter)(PyObject *); | |
2936 PyObject *func_annotations; | |
2937 PyObject *func_is_coroutine; | |
2938 } __pyx_CyFunctionObject; | |
2939 #undef __Pyx_CyOrPyCFunction_Check | |
2940 #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) | |
2941 #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) | |
2942 #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) | |
2943 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); | |
2944 #undef __Pyx_IsSameCFunction | |
2945 #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) | |
2946 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, | |
2947 int flags, PyObject* qualname, | |
2948 PyObject *closure, | |
2949 PyObject *module, PyObject *globals, | |
2950 PyObject* code); | |
2951 static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); | |
2952 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, | |
2953 size_t size, | |
2954 int pyobjects); | |
2955 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, | |
2956 PyObject *tuple); | |
2957 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, | |
2958 PyObject *dict); | |
2959 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, | |
2960 PyObject *dict); | |
2961 static int __pyx_CyFunction_init(PyObject *module); | |
2962 #if CYTHON_METH_FASTCALL | |
2963 static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); | |
2964 static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); | |
2965 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); | |
2966 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); | |
2967 #if CYTHON_BACKPORT_VECTORCALL | |
2968 #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) | |
2969 #else | |
2970 #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) | |
2971 #endif | |
2972 #endif | |
2973 | |
2974 /* CythonFunction.proto */ | |
2975 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, | |
2976 int flags, PyObject* qualname, | |
2977 PyObject *closure, | |
2978 PyObject *module, PyObject *globals, | |
2979 PyObject* code); | |
2980 | |
2981 /* CLineInTraceback.proto */ | |
2982 #ifdef CYTHON_CLINE_IN_TRACEBACK | |
2983 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) | |
2984 #else | |
2985 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); | |
2986 #endif | |
2987 | |
2988 /* CodeObjectCache.proto */ | |
2989 #if !CYTHON_COMPILING_IN_LIMITED_API | |
2990 typedef struct { | |
2991 PyCodeObject* code_object; | |
2992 int code_line; | |
2993 } __Pyx_CodeObjectCacheEntry; | |
2994 struct __Pyx_CodeObjectCache { | |
2995 int count; | |
2996 int max_count; | |
2997 __Pyx_CodeObjectCacheEntry* entries; | |
2998 }; | |
2999 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; | |
3000 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); | |
3001 static PyCodeObject *__pyx_find_code_object(int code_line); | |
3002 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); | |
3003 #endif | |
3004 | |
3005 /* AddTraceback.proto */ | |
3006 static void __Pyx_AddTraceback(const char *funcname, int c_line, | |
3007 int py_line, const char *filename); | |
3008 | |
3009 /* ArrayAPI.proto */ | |
3010 #ifndef _ARRAYARRAY_H | |
3011 #define _ARRAYARRAY_H | |
3012 typedef struct arraydescr { | |
3013 int typecode; | |
3014 int itemsize; | |
3015 PyObject * (*getitem)(struct arrayobject *, Py_ssize_t); | |
3016 int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *); | |
3017 #if PY_MAJOR_VERSION >= 3 | |
3018 char *formats; | |
3019 #endif | |
3020 } arraydescr; | |
3021 struct arrayobject { | |
3022 PyObject_HEAD | |
3023 Py_ssize_t ob_size; | |
3024 union { | |
3025 char *ob_item; | |
3026 float *as_floats; | |
3027 double *as_doubles; | |
3028 int *as_ints; | |
3029 unsigned int *as_uints; | |
3030 unsigned char *as_uchars; | |
3031 signed char *as_schars; | |
3032 char *as_chars; | |
3033 unsigned long *as_ulongs; | |
3034 long *as_longs; | |
3035 #if PY_MAJOR_VERSION >= 3 | |
3036 unsigned long long *as_ulonglongs; | |
3037 long long *as_longlongs; | |
3038 #endif | |
3039 short *as_shorts; | |
3040 unsigned short *as_ushorts; | |
3041 Py_UNICODE *as_pyunicodes; | |
3042 void *as_voidptr; | |
3043 } data; | |
3044 Py_ssize_t allocated; | |
3045 struct arraydescr *ob_descr; | |
3046 PyObject *weakreflist; | |
3047 #if PY_MAJOR_VERSION >= 3 | |
3048 int ob_exports; | |
3049 #endif | |
3050 }; | |
3051 #ifndef NO_NEWARRAY_INLINE | |
3052 static CYTHON_INLINE PyObject * newarrayobject(PyTypeObject *type, Py_ssize_t size, | |
3053 struct arraydescr *descr) { | |
3054 arrayobject *op; | |
3055 size_t nbytes; | |
3056 if (size < 0) { | |
3057 PyErr_BadInternalCall(); | |
3058 return NULL; | |
3059 } | |
3060 nbytes = size * descr->itemsize; | |
3061 if (nbytes / descr->itemsize != (size_t)size) { | |
3062 return PyErr_NoMemory(); | |
3063 } | |
3064 op = (arrayobject *) type->tp_alloc(type, 0); | |
3065 if (op == NULL) { | |
3066 return NULL; | |
3067 } | |
3068 op->ob_descr = descr; | |
3069 op->allocated = size; | |
3070 op->weakreflist = NULL; | |
3071 __Pyx_SET_SIZE(op, size); | |
3072 if (size <= 0) { | |
3073 op->data.ob_item = NULL; | |
3074 } | |
3075 else { | |
3076 op->data.ob_item = PyMem_NEW(char, nbytes); | |
3077 if (op->data.ob_item == NULL) { | |
3078 Py_DECREF(op); | |
3079 return PyErr_NoMemory(); | |
3080 } | |
3081 } | |
3082 return (PyObject *) op; | |
3083 } | |
3084 #else | |
3085 PyObject* newarrayobject(PyTypeObject *type, Py_ssize_t size, | |
3086 struct arraydescr *descr); | |
3087 #endif | |
3088 static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) { | |
3089 void *items = (void*) self->data.ob_item; | |
3090 PyMem_Resize(items, char, (size_t)(n * self->ob_descr->itemsize)); | |
3091 if (items == NULL) { | |
3092 PyErr_NoMemory(); | |
3093 return -1; | |
3094 } | |
3095 self->data.ob_item = (char*) items; | |
3096 __Pyx_SET_SIZE(self, n); | |
3097 self->allocated = n; | |
3098 return 0; | |
3099 } | |
3100 static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) { | |
3101 void *items = (void*) self->data.ob_item; | |
3102 Py_ssize_t newsize; | |
3103 if (n < self->allocated && n*4 > self->allocated) { | |
3104 __Pyx_SET_SIZE(self, n); | |
3105 return 0; | |
3106 } | |
3107 newsize = n + (n / 2) + 1; | |
3108 if (newsize <= n) { | |
3109 PyErr_NoMemory(); | |
3110 return -1; | |
3111 } | |
3112 PyMem_Resize(items, char, (size_t)(newsize * self->ob_descr->itemsize)); | |
3113 if (items == NULL) { | |
3114 PyErr_NoMemory(); | |
3115 return -1; | |
3116 } | |
3117 self->data.ob_item = (char*) items; | |
3118 __Pyx_SET_SIZE(self, n); | |
3119 self->allocated = newsize; | |
3120 return 0; | |
3121 } | |
3122 #endif | |
3123 | |
3124 /* GCCDiagnostics.proto */ | |
3125 #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |
3126 #define __Pyx_HAS_GCC_DIAGNOSTIC | |
3127 #endif | |
3128 | |
3129 /* CIntFromPy.proto */ | |
3130 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); | |
3131 | |
3132 /* CIntFromPy.proto */ | |
3133 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); | |
3134 | |
3135 /* CIntToPy.proto */ | |
3136 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); | |
3137 | |
3138 /* CIntToPy.proto */ | |
3139 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); | |
3140 | |
3141 /* FormatTypeName.proto */ | |
3142 #if CYTHON_COMPILING_IN_LIMITED_API | |
3143 typedef PyObject *__Pyx_TypeName; | |
3144 #define __Pyx_FMT_TYPENAME "%U" | |
3145 static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); | |
3146 #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) | |
3147 #else | |
3148 typedef const char *__Pyx_TypeName; | |
3149 #define __Pyx_FMT_TYPENAME "%.200s" | |
3150 #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) | |
3151 #define __Pyx_DECREF_TypeName(obj) | |
3152 #endif | |
3153 | |
3154 /* FastTypeChecks.proto */ | |
3155 #if CYTHON_COMPILING_IN_CPYTHON | |
3156 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) | |
3157 #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) | |
3158 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); | |
3159 static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); | |
3160 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); | |
3161 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); | |
3162 #else | |
3163 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) | |
3164 #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) | |
3165 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) | |
3166 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) | |
3167 #endif | |
3168 #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) | |
3169 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) | |
3170 | |
3171 /* CheckBinaryVersion.proto */ | |
3172 static unsigned long __Pyx_get_runtime_version(void); | |
3173 static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); | |
3174 | |
3175 /* FunctionImport.proto */ | |
3176 static int __Pyx_ImportFunction_3_0_11(PyObject *module, const char *funcname, void (**f)(void), const char *sig); | |
3177 | |
3178 /* InitStrings.proto */ | |
3179 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); | |
3180 | |
3181 /* #### Code section: module_declarations ### */ | |
3182 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/ | |
3183 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/ | |
3184 static char *__pyx_f_5pysam_9libcfaidx_9FastaFile__fetch(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, char *__pyx_v_reference, int __pyx_v_start, int __pyx_v_end, int *__pyx_v_length); /* proto*/ | |
3185 static PyObject *__pyx_f_5pysam_9libcfaidx_10FastqProxy_to_string(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self); /* proto*/ | |
3186 static PyObject *__pyx_f_5pysam_9libcfaidx_10FastqProxy_tostring(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self); /* proto*/ | |
3187 static arrayobject *__pyx_f_5pysam_9libcfaidx_10FastqProxy_get_quality_array(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcfaidx_10FastqProxy_get_quality_array *__pyx_optional_args); /* proto*/ | |
3188 static PyObject *__pyx_f_5pysam_9libcfaidx_11FastxRecord_to_string(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self); /* proto*/ | |
3189 static PyObject *__pyx_f_5pysam_9libcfaidx_11FastxRecord_tostring(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self); /* proto*/ | |
3190 static arrayobject *__pyx_f_5pysam_9libcfaidx_11FastxRecord_get_quality_array(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcfaidx_11FastxRecord_get_quality_array *__pyx_optional_args); /* proto*/ | |
3191 static kseq_t *__pyx_f_5pysam_9libcfaidx_9FastxFile_getCurrent(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self); /* proto*/ | |
3192 static int __pyx_f_5pysam_9libcfaidx_9FastxFile_cnext(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self); /* proto*/ | |
3193 | |
3194 /* Module declarations from "libc.stdint" */ | |
3195 | |
3196 /* Module declarations from "libc.string" */ | |
3197 | |
3198 /* Module declarations from "libc.stdlib" */ | |
3199 | |
3200 /* Module declarations from "libc.stdio" */ | |
3201 | |
3202 /* Module declarations from "cython" */ | |
3203 | |
3204 /* Module declarations from "cpython.version" */ | |
3205 | |
3206 /* Module declarations from "__builtin__" */ | |
3207 | |
3208 /* Module declarations from "cpython.type" */ | |
3209 | |
3210 /* Module declarations from "cpython.object" */ | |
3211 | |
3212 /* Module declarations from "cpython.ref" */ | |
3213 | |
3214 /* Module declarations from "cpython.exc" */ | |
3215 | |
3216 /* Module declarations from "cpython.module" */ | |
3217 | |
3218 /* Module declarations from "cpython.mem" */ | |
3219 | |
3220 /* Module declarations from "cpython.tuple" */ | |
3221 | |
3222 /* Module declarations from "cpython.list" */ | |
3223 | |
3224 /* Module declarations from "cpython.sequence" */ | |
3225 | |
3226 /* Module declarations from "cpython.mapping" */ | |
3227 | |
3228 /* Module declarations from "cpython.iterator" */ | |
3229 | |
3230 /* Module declarations from "cpython.number" */ | |
3231 | |
3232 /* Module declarations from "cpython.int" */ | |
3233 | |
3234 /* Module declarations from "__builtin__" */ | |
3235 | |
3236 /* Module declarations from "cpython.bool" */ | |
3237 | |
3238 /* Module declarations from "cpython.long" */ | |
3239 | |
3240 /* Module declarations from "cpython.float" */ | |
3241 | |
3242 /* Module declarations from "__builtin__" */ | |
3243 | |
3244 /* Module declarations from "cpython.complex" */ | |
3245 | |
3246 /* Module declarations from "cpython.string" */ | |
3247 | |
3248 /* Module declarations from "libc.stddef" */ | |
3249 | |
3250 /* Module declarations from "cpython.unicode" */ | |
3251 | |
3252 /* Module declarations from "cpython.pyport" */ | |
3253 | |
3254 /* Module declarations from "cpython.dict" */ | |
3255 | |
3256 /* Module declarations from "cpython.instance" */ | |
3257 | |
3258 /* Module declarations from "cpython.function" */ | |
3259 | |
3260 /* Module declarations from "cpython.method" */ | |
3261 | |
3262 /* Module declarations from "cpython.weakref" */ | |
3263 | |
3264 /* Module declarations from "cpython.getargs" */ | |
3265 | |
3266 /* Module declarations from "cpython.pythread" */ | |
3267 | |
3268 /* Module declarations from "cpython.pystate" */ | |
3269 | |
3270 /* Module declarations from "cpython.cobject" */ | |
3271 | |
3272 /* Module declarations from "cpython.oldbuffer" */ | |
3273 | |
3274 /* Module declarations from "cpython.set" */ | |
3275 | |
3276 /* Module declarations from "cpython.buffer" */ | |
3277 | |
3278 /* Module declarations from "cpython.bytes" */ | |
3279 | |
3280 /* Module declarations from "cpython.pycapsule" */ | |
3281 | |
3282 /* Module declarations from "cpython.contextvars" */ | |
3283 | |
3284 /* Module declarations from "cpython" */ | |
3285 | |
3286 /* Module declarations from "array" */ | |
3287 | |
3288 /* Module declarations from "cpython.array" */ | |
3289 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *, char *, Py_ssize_t); /*proto*/ | |
3290 | |
3291 /* Module declarations from "posix.types" */ | |
3292 | |
3293 /* Module declarations from "pysam.libchtslib" */ | |
3294 | |
3295 /* Module declarations from "libc.errno" */ | |
3296 | |
3297 /* Module declarations from "pysam.libcutils" */ | |
3298 static PyObject *(*__pyx_f_5pysam_9libcutils_parse_region)(int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcutils_parse_region *__pyx_optional_args); /*proto*/ | |
3299 static arrayobject *(*__pyx_f_5pysam_9libcutils_qualitystring_to_array)(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array *__pyx_optional_args); /*proto*/ | |
3300 static PyObject *(*__pyx_f_5pysam_9libcutils_charptr_to_str)(char const *, struct __pyx_opt_args_5pysam_9libcutils_charptr_to_str *__pyx_optional_args); /*proto*/ | |
3301 static PyObject *(*__pyx_f_5pysam_9libcutils_force_str)(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_force_str *__pyx_optional_args); /*proto*/ | |
3302 static PyObject *(*__pyx_f_5pysam_9libcutils_force_bytes)(PyObject *, struct __pyx_opt_args_5pysam_9libcutils_force_bytes *__pyx_optional_args); /*proto*/ | |
3303 static PyObject *(*__pyx_f_5pysam_9libcutils_encode_filename)(PyObject *); /*proto*/ | |
3304 static PyObject *(*__pyx_f_5pysam_9libcutils_from_string_and_size)(char const *, size_t); /*proto*/ | |
3305 | |
3306 /* Module declarations from "pysam.libcfaidx" */ | |
3307 static PyObject *__pyx_f_5pysam_9libcfaidx_makeFastqProxy(kseq_t *); /*proto*/ | |
3308 static PyObject *__pyx_f_5pysam_9libcfaidx___pyx_unpickle_FastxRecord__set_state(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *, PyObject *); /*proto*/ | |
3309 /* #### Code section: typeinfo ### */ | |
3310 /* #### Code section: before_global_var ### */ | |
3311 #define __Pyx_MODULE_NAME "pysam.libcfaidx" | |
3312 extern int __pyx_module_is_main_pysam__libcfaidx; | |
3313 int __pyx_module_is_main_pysam__libcfaidx = 0; | |
3314 | |
3315 /* Implementation of "pysam.libcfaidx" */ | |
3316 /* #### Code section: global_var ### */ | |
3317 static PyObject *__pyx_builtin_ValueError; | |
3318 static PyObject *__pyx_builtin_IOError; | |
3319 static PyObject *__pyx_builtin_zip; | |
3320 static PyObject *__pyx_builtin_KeyError; | |
3321 static PyObject *__pyx_builtin_TypeError; | |
3322 static PyObject *__pyx_builtin_StopIteration; | |
3323 static PyObject *__pyx_builtin_MemoryError; | |
3324 /* #### Code section: string_decls ### */ | |
3325 static const char __pyx_k_s[] = " %s"; | |
3326 static const char __pyx_k_x[] = "x"; | |
3327 static const char __pyx_k__4[] = "-"; | |
3328 static const char __pyx_k_gc[] = "gc"; | |
3329 static const char __pyx_k_os[] = "os"; | |
3330 static const char __pyx_k_re[] = "re"; | |
3331 static const char __pyx_k_ss[] = "ss"; | |
3332 static const char __pyx_k__11[] = ""; | |
3333 static const char __pyx_k__16[] = ">"; | |
3334 static const char __pyx_k__17[] = "\n"; | |
3335 static const char __pyx_k__18[] = "@"; | |
3336 static const char __pyx_k__19[] = "\n+\n"; | |
3337 static const char __pyx_k__47[] = "."; | |
3338 static const char __pyx_k__48[] = "*"; | |
3339 static const char __pyx_k__68[] = "?"; | |
3340 static const char __pyx_k_all[] = "__all__"; | |
3341 static const char __pyx_k_end[] = "end"; | |
3342 static const char __pyx_k_new[] = "__new__"; | |
3343 static const char __pyx_k_ref[] = "ref"; | |
3344 static const char __pyx_k_s_2[] = "s"; | |
3345 static const char __pyx_k_seq[] = "seq"; | |
3346 static const char __pyx_k_sys[] = "sys"; | |
3347 static const char __pyx_k_zip[] = "zip"; | |
3348 static const char __pyx_k_None[] = "None"; | |
3349 static const char __pyx_k_copy[] = "__copy__"; | |
3350 static const char __pyx_k_dict[] = "__dict__"; | |
3351 static const char __pyx_k_exit[] = "__exit__"; | |
3352 static const char __pyx_k_main[] = "__main__"; | |
3353 static const char __pyx_k_memo[] = "memo"; | |
3354 static const char __pyx_k_name[] = "name"; | |
3355 static const char __pyx_k_open[] = "_open"; | |
3356 static const char __pyx_k_path[] = "path"; | |
3357 static const char __pyx_k_rend[] = "rend"; | |
3358 static const char __pyx_k_self[] = "self"; | |
3359 static const char __pyx_k_spec[] = "__spec__"; | |
3360 static const char __pyx_k_test[] = "__test__"; | |
3361 static const char __pyx_k_close[] = "close"; | |
3362 static const char __pyx_k_enter[] = "__enter__"; | |
3363 static const char __pyx_k_fetch[] = "fetch"; | |
3364 static const char __pyx_k_proxy[] = "proxy"; | |
3365 static const char __pyx_k_start[] = "start"; | |
3366 static const char __pyx_k_state[] = "state"; | |
3367 static const char __pyx_k_append[] = "append"; | |
3368 static const char __pyx_k_contig[] = "contig"; | |
3369 static const char __pyx_k_dict_2[] = "_dict"; | |
3370 static const char __pyx_k_enable[] = "enable"; | |
3371 static const char __pyx_k_exists[] = "exists"; | |
3372 static const char __pyx_k_format[] = "format"; | |
3373 static const char __pyx_k_import[] = "__import__"; | |
3374 static const char __pyx_k_length[] = "length"; | |
3375 static const char __pyx_k_name_2[] = "__name__"; | |
3376 static const char __pyx_k_offset[] = "offset"; | |
3377 static const char __pyx_k_pickle[] = "pickle"; | |
3378 static const char __pyx_k_reduce[] = "__reduce__"; | |
3379 static const char __pyx_k_region[] = "region"; | |
3380 static const char __pyx_k_rstart[] = "rstart"; | |
3381 static const char __pyx_k_update[] = "update"; | |
3382 static const char __pyx_k_IOError[] = "IOError"; | |
3383 static const char __pyx_k_comment[] = "comment"; | |
3384 static const char __pyx_k_disable[] = "disable"; | |
3385 static const char __pyx_k_is_open[] = "is_open"; | |
3386 static const char __pyx_k_persist[] = "persist"; | |
3387 static const char __pyx_k_quality[] = "quality"; | |
3388 static const char __pyx_k_KeyError[] = "KeyError"; | |
3389 static const char __pyx_k_contig_b[] = "contig_b"; | |
3390 static const char __pyx_k_deepcopy[] = "__deepcopy__"; | |
3391 static const char __pyx_k_exc_type[] = "exc_type"; | |
3392 static const char __pyx_k_filename[] = "filename"; | |
3393 static const char __pyx_k_getstate[] = "__getstate__"; | |
3394 static const char __pyx_k_pyx_type[] = "__pyx_type"; | |
3395 static const char __pyx_k_sequence[] = "sequence"; | |
3396 static const char __pyx_k_set_name[] = "set_name"; | |
3397 static const char __pyx_k_setstate[] = "__setstate__"; | |
3398 static const char __pyx_k_FastaFile[] = "FastaFile"; | |
3399 static const char __pyx_k_Fastafile[] = "Fastafile"; | |
3400 static const char __pyx_k_FastqFile[] = "FastqFile"; | |
3401 static const char __pyx_k_FastxFile[] = "FastxFile"; | |
3402 static const char __pyx_k_TypeError[] = "TypeError"; | |
3403 static const char __pyx_k_cfilename[] = "cfilename"; | |
3404 static const char __pyx_k_exc_value[] = "exc_value"; | |
3405 static const char __pyx_k_isenabled[] = "isenabled"; | |
3406 static const char __pyx_k_pyx_state[] = "__pyx_state"; | |
3407 static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; | |
3408 static const char __pyx_k_reference[] = "reference"; | |
3409 static const char __pyx_k_traceback[] = "traceback"; | |
3410 static const char __pyx_k_FastqProxy[] = "FastqProxy"; | |
3411 static const char __pyx_k_ValueError[] = "ValueError"; | |
3412 static const char __pyx_k_cindexname[] = "cindexname"; | |
3413 static const char __pyx_k_pyx_result[] = "__pyx_result"; | |
3414 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; | |
3415 static const char __pyx_k_references[] = "references"; | |
3416 static const char __pyx_k_FastxRecord[] = "FastxRecord"; | |
3417 static const char __pyx_k_MemoryError[] = "MemoryError"; | |
3418 static const char __pyx_k_PickleError[] = "PickleError"; | |
3419 static const char __pyx_k_nreferences[] = "nreferences"; | |
3420 static const char __pyx_k_set_comment[] = "set_comment"; | |
3421 static const char __pyx_k_initializing[] = "_initializing"; | |
3422 static const char __pyx_k_is_coroutine[] = "_is_coroutine"; | |
3423 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; | |
3424 static const char __pyx_k_set_sequence[] = "set_sequence"; | |
3425 static const char __pyx_k_stringsource[] = "<stringsource>"; | |
3426 static const char __pyx_k_use_setstate[] = "use_setstate"; | |
3427 static const char __pyx_k_StopIteration[] = "StopIteration"; | |
3428 static const char __pyx_k_class_getitem[] = "__class_getitem__"; | |
3429 static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; | |
3430 static const char __pyx_k_filepath_index[] = "filepath_index"; | |
3431 static const char __pyx_k_FastaFile__open[] = "FastaFile._open"; | |
3432 static const char __pyx_k_FastaFile_close[] = "FastaFile.close"; | |
3433 static const char __pyx_k_FastaFile_fetch[] = "FastaFile.fetch"; | |
3434 static const char __pyx_k_FastxFile__open[] = "FastxFile._open"; | |
3435 static const char __pyx_k_FastxFile_close[] = "FastxFile.close"; | |
3436 static const char __pyx_k_bindex_filename[] = "bindex_filename"; | |
3437 static const char __pyx_k_pysam_libcfaidx[] = "pysam.libcfaidx"; | |
3438 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; | |
3439 static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; | |
3440 static const char __pyx_k_FastaFile___exit[] = "FastaFile.__exit__"; | |
3441 static const char __pyx_k_FastxFile___exit[] = "FastxFile.__exit__"; | |
3442 static const char __pyx_k_file_s_not_found[] = "file `%s` not found"; | |
3443 static const char __pyx_k_FastaFile___enter[] = "FastaFile.__enter__"; | |
3444 static const char __pyx_k_FastaFile_is_open[] = "FastaFile.is_open"; | |
3445 static const char __pyx_k_FastxFile___enter[] = "FastxFile.__enter__"; | |
3446 static const char __pyx_k_FastxFile_is_open[] = "FastxFile.is_open"; | |
3447 static const char __pyx_k_get_quality_array[] = "get_quality_array"; | |
3448 static const char __pyx_k_FastxRecord___copy[] = "FastxRecord.__copy__"; | |
3449 static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; | |
3450 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; | |
3451 static const char __pyx_k_pysam_libcfaidx_pyx[] = "pysam/libcfaidx.pyx"; | |
3452 static const char __pyx_k_FastxRecord_set_name[] = "FastxRecord.set_name"; | |
3453 static const char __pyx_k_get_reference_length[] = "get_reference_length"; | |
3454 static const char __pyx_k_cindexname_compressed[] = "cindexname_compressed"; | |
3455 static const char __pyx_k_FastxRecord___deepcopy[] = "FastxRecord.__deepcopy__"; | |
3456 static const char __pyx_k_sequence_s_not_present[] = "sequence '%s' not present"; | |
3457 static const char __pyx_k_FastxRecord_set_comment[] = "FastxRecord.set_comment"; | |
3458 static const char __pyx_k_filename_does_not_exist[] = "filename {} does not exist"; | |
3459 static const char __pyx_k_FastxRecord_set_sequence[] = "FastxRecord.set_sequence"; | |
3460 static const char __pyx_k_pyx_unpickle_FastxRecord[] = "__pyx_unpickle_FastxRecord"; | |
3461 static const char __pyx_k_FastaFile___reduce_cython[] = "FastaFile.__reduce_cython__"; | |
3462 static const char __pyx_k_Fastafile___reduce_cython[] = "Fastafile.__reduce_cython__"; | |
3463 static const char __pyx_k_FastqFile___reduce_cython[] = "FastqFile.__reduce_cython__"; | |
3464 static const char __pyx_k_FastxFile___reduce_cython[] = "FastxFile.__reduce_cython__"; | |
3465 static const char __pyx_k_error_when_opening_file_s[] = "error when opening file `%s`"; | |
3466 static const char __pyx_k_filepath_index_compressed[] = "filepath_index_compressed"; | |
3467 static const char __pyx_k_unknown_problem_parsing_0[] = "unknown problem parsing {0}"; | |
3468 static const char __pyx_k_FastqProxy___reduce_cython[] = "FastqProxy.__reduce_cython__"; | |
3469 static const char __pyx_k_bindex_filename_compressed[] = "bindex_filename_compressed"; | |
3470 static const char __pyx_k_calling_len_on_closed_file[] = "calling len() on closed file"; | |
3471 static const char __pyx_k_FastaFile___setstate_cython[] = "FastaFile.__setstate_cython__"; | |
3472 static const char __pyx_k_Fastafile___setstate_cython[] = "Fastafile.__setstate_cython__"; | |
3473 static const char __pyx_k_FastqFile___setstate_cython[] = "FastqFile.__setstate_cython__"; | |
3474 static const char __pyx_k_FastxFile___setstate_cython[] = "FastxFile.__setstate_cython__"; | |
3475 static const char __pyx_k_FastxRecord___reduce_cython[] = "FastxRecord.__reduce_cython__"; | |
3476 static const char __pyx_k_no_sequence_region_supplied[] = "no sequence/region supplied."; | |
3477 static const char __pyx_k_FastqProxy___setstate_cython[] = "FastqProxy.__setstate_cython__"; | |
3478 static const char __pyx_k_FastqProxy_get_quality_array[] = "FastqProxy.get_quality_array"; | |
3479 static const char __pyx_k_I_O_operation_on_closed_file[] = "I/O operation on closed file"; | |
3480 static const char __pyx_k_FastxRecord___setstate_cython[] = "FastxRecord.__setstate_cython__"; | |
3481 static const char __pyx_k_FastxRecord_get_quality_array[] = "FastxRecord.get_quality_array"; | |
3482 static const char __pyx_k_truncated_quality_string_in_0[] = "truncated quality string in {0}"; | |
3483 static const char __pyx_k_FastaFile_get_reference_length[] = "FastaFile.get_reference_length"; | |
3484 static const char __pyx_k_FastxRecord_must_have_a_name_and[] = "FastxRecord must have a name and not None"; | |
3485 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x1bdb611, 0xb688a86, 0x43fd151) = (comment, name, quality, sequence))"; | |
3486 static const char __pyx_k_can_not_write_record_without_a_s[] = "can not write record without a sequence"; | |
3487 static const char __pyx_k_can_not_write_record_without_nam[] = "can not write record without name"; | |
3488 static const char __pyx_k_do_not_instantiate_FastqProxy_di[] = "do not instantiate FastqProxy directly"; | |
3489 static const char __pyx_k_failure_when_retrieving_sequence[] = "failure when retrieving sequence on '%s'"; | |
3490 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; | |
3491 static const char __pyx_k_self__delegate_cannot_be_convert[] = "self._delegate cannot be converted to a Python object for pickling"; | |
3492 static const char __pyx_k_sequence_and_quality_length_do_n[] = "sequence and quality length do not match: {} vs {}"; | |
3493 /* #### Code section: decls ### */ | |
3494 static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */ | |
3495 static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ | |
3496 static int __pyx_pf_5pysam_9libcfaidx_9FastaFile___cinit__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ | |
3497 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_2is_open(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self); /* proto */ | |
3498 static Py_ssize_t __pyx_pf_5pysam_9libcfaidx_9FastaFile_4__len__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self); /* proto */ | |
3499 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_6_open(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_filepath_index, PyObject *__pyx_v_filepath_index_compressed); /* proto */ | |
3500 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_8close(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self); /* proto */ | |
3501 static void __pyx_pf_5pysam_9libcfaidx_9FastaFile_10__dealloc__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self); /* proto */ | |
3502 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_12__enter__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self); /* proto */ | |
3503 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_14__exit__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */ | |
3504 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_6closed___get__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self); /* proto */ | |
3505 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_8filename___get__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self); /* proto */ | |
3506 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_10references___get__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self); /* proto */ | |
3507 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_11nreferences___get__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self); /* proto */ | |
3508 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_7lengths___get__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self); /* proto */ | |
3509 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_16fetch(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region); /* proto */ | |
3510 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_18get_reference_length(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_reference); /* proto */ | |
3511 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_20__getitem__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_reference); /* proto */ | |
3512 static int __pyx_pf_5pysam_9libcfaidx_9FastaFile_22__contains__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_reference); /* proto */ | |
3513 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self); /* proto */ | |
3514 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
3515 static int __pyx_pf_5pysam_9libcfaidx_10FastqProxy___init__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self); /* proto */ | |
3516 static PyObject *__pyx_pf_5pysam_9libcfaidx_10FastqProxy_4name___get__(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self); /* proto */ | |
3517 static PyObject *__pyx_pf_5pysam_9libcfaidx_10FastqProxy_8sequence___get__(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self); /* proto */ | |
3518 static PyObject *__pyx_pf_5pysam_9libcfaidx_10FastqProxy_7comment___get__(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self); /* proto */ | |
3519 static PyObject *__pyx_pf_5pysam_9libcfaidx_10FastqProxy_7quality___get__(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self); /* proto */ | |
3520 static PyObject *__pyx_pf_5pysam_9libcfaidx_10FastqProxy_2__str__(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self); /* proto */ | |
3521 static PyObject *__pyx_pf_5pysam_9libcfaidx_10FastqProxy_4get_quality_array(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self, int __pyx_v_offset); /* proto */ | |
3522 static PyObject *__pyx_pf_5pysam_9libcfaidx_10FastqProxy_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self); /* proto */ | |
3523 static PyObject *__pyx_pf_5pysam_9libcfaidx_10FastqProxy_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
3524 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord___init__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_comment, PyObject *__pyx_v_sequence, PyObject *__pyx_v_quality, struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_proxy); /* proto */ | |
3525 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_2__copy__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self); /* proto */ | |
3526 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_4__deepcopy__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_memo); /* proto */ | |
3527 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_6set_name(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ | |
3528 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_8set_comment(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v_comment); /* proto */ | |
3529 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_10set_sequence(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v_sequence, PyObject *__pyx_v_quality); /* proto */ | |
3530 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_12__str__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self); /* proto */ | |
3531 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_14get_quality_array(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, int __pyx_v_offset); /* proto */ | |
3532 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_7comment___get__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self); /* proto */ | |
3533 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord_7comment_2__set__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ | |
3534 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord_7comment_4__del__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self); /* proto */ | |
3535 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_7quality___get__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self); /* proto */ | |
3536 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord_7quality_2__set__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ | |
3537 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord_7quality_4__del__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self); /* proto */ | |
3538 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_8sequence___get__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self); /* proto */ | |
3539 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord_8sequence_2__set__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ | |
3540 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord_8sequence_4__del__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self); /* proto */ | |
3541 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_4name___get__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self); /* proto */ | |
3542 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord_4name_2__set__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ | |
3543 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord_4name_4__del__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self); /* proto */ | |
3544 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_16__reduce_cython__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self); /* proto */ | |
3545 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_18__setstate_cython__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ | |
3546 static int __pyx_pf_5pysam_9libcfaidx_9FastxFile___cinit__(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ | |
3547 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_2is_open(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self); /* proto */ | |
3548 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_4_open(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_persist); /* proto */ | |
3549 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_6close(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self); /* proto */ | |
3550 static void __pyx_pf_5pysam_9libcfaidx_9FastxFile_8__dealloc__(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self); /* proto */ | |
3551 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_10__enter__(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self); /* proto */ | |
3552 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_12__exit__(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */ | |
3553 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_6closed___get__(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self); /* proto */ | |
3554 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_8filename___get__(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self); /* proto */ | |
3555 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_14__iter__(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self); /* proto */ | |
3556 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_16__next__(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self); /* proto */ | |
3557 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self); /* proto */ | |
3558 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
3559 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastqFile___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastqFile *__pyx_v_self); /* proto */ | |
3560 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastqFile_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastqFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
3561 static PyObject *__pyx_pf_5pysam_9libcfaidx_9Fastafile___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_Fastafile *__pyx_v_self); /* proto */ | |
3562 static PyObject *__pyx_pf_5pysam_9libcfaidx_9Fastafile_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_Fastafile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ | |
3563 static PyObject *__pyx_pf_5pysam_9libcfaidx___pyx_unpickle_FastxRecord(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ | |
3564 static PyObject *__pyx_tp_new_5pysam_9libcfaidx_FastaFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
3565 static PyObject *__pyx_tp_new_5pysam_9libcfaidx_FastqProxy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
3566 static PyObject *__pyx_tp_new_5pysam_9libcfaidx_FastxRecord(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
3567 static PyObject *__pyx_tp_new_5pysam_9libcfaidx_FastxFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
3568 static PyObject *__pyx_tp_new_5pysam_9libcfaidx_FastqFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
3569 static PyObject *__pyx_tp_new_5pysam_9libcfaidx_Fastafile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ | |
3570 /* #### Code section: late_includes ### */ | |
3571 /* #### Code section: module_state ### */ | |
3572 typedef struct { | |
3573 PyObject *__pyx_d; | |
3574 PyObject *__pyx_b; | |
3575 PyObject *__pyx_cython_runtime; | |
3576 PyObject *__pyx_empty_tuple; | |
3577 PyObject *__pyx_empty_bytes; | |
3578 PyObject *__pyx_empty_unicode; | |
3579 #ifdef __Pyx_CyFunction_USED | |
3580 PyTypeObject *__pyx_CyFunctionType; | |
3581 #endif | |
3582 #ifdef __Pyx_FusedFunction_USED | |
3583 PyTypeObject *__pyx_FusedFunctionType; | |
3584 #endif | |
3585 #ifdef __Pyx_Generator_USED | |
3586 PyTypeObject *__pyx_GeneratorType; | |
3587 #endif | |
3588 #ifdef __Pyx_IterableCoroutine_USED | |
3589 PyTypeObject *__pyx_IterableCoroutineType; | |
3590 #endif | |
3591 #ifdef __Pyx_Coroutine_USED | |
3592 PyTypeObject *__pyx_CoroutineAwaitType; | |
3593 #endif | |
3594 #ifdef __Pyx_Coroutine_USED | |
3595 PyTypeObject *__pyx_CoroutineType; | |
3596 #endif | |
3597 #if CYTHON_USE_MODULE_STATE | |
3598 #endif | |
3599 #if CYTHON_USE_MODULE_STATE | |
3600 #endif | |
3601 #if CYTHON_USE_MODULE_STATE | |
3602 #endif | |
3603 #if CYTHON_USE_MODULE_STATE | |
3604 #endif | |
3605 #if CYTHON_USE_MODULE_STATE | |
3606 #endif | |
3607 #if CYTHON_USE_MODULE_STATE | |
3608 #endif | |
3609 #if CYTHON_USE_MODULE_STATE | |
3610 #endif | |
3611 #if CYTHON_USE_MODULE_STATE | |
3612 #endif | |
3613 PyTypeObject *__pyx_ptype_7cpython_4type_type; | |
3614 #if CYTHON_USE_MODULE_STATE | |
3615 #endif | |
3616 #if CYTHON_USE_MODULE_STATE | |
3617 #endif | |
3618 #if CYTHON_USE_MODULE_STATE | |
3619 #endif | |
3620 #if CYTHON_USE_MODULE_STATE | |
3621 #endif | |
3622 #if CYTHON_USE_MODULE_STATE | |
3623 #endif | |
3624 #if CYTHON_USE_MODULE_STATE | |
3625 #endif | |
3626 #if CYTHON_USE_MODULE_STATE | |
3627 #endif | |
3628 #if CYTHON_USE_MODULE_STATE | |
3629 #endif | |
3630 #if CYTHON_USE_MODULE_STATE | |
3631 #endif | |
3632 #if CYTHON_USE_MODULE_STATE | |
3633 #endif | |
3634 #if CYTHON_USE_MODULE_STATE | |
3635 #endif | |
3636 #if CYTHON_USE_MODULE_STATE | |
3637 #endif | |
3638 #if CYTHON_USE_MODULE_STATE | |
3639 #endif | |
3640 #if CYTHON_USE_MODULE_STATE | |
3641 #endif | |
3642 PyTypeObject *__pyx_ptype_7cpython_4bool_bool; | |
3643 #if CYTHON_USE_MODULE_STATE | |
3644 #endif | |
3645 #if CYTHON_USE_MODULE_STATE | |
3646 #endif | |
3647 #if CYTHON_USE_MODULE_STATE | |
3648 #endif | |
3649 #if CYTHON_USE_MODULE_STATE | |
3650 #endif | |
3651 PyTypeObject *__pyx_ptype_7cpython_7complex_complex; | |
3652 #if CYTHON_USE_MODULE_STATE | |
3653 #endif | |
3654 #if CYTHON_USE_MODULE_STATE | |
3655 #endif | |
3656 #if CYTHON_USE_MODULE_STATE | |
3657 #endif | |
3658 #if CYTHON_USE_MODULE_STATE | |
3659 #endif | |
3660 #if CYTHON_USE_MODULE_STATE | |
3661 #endif | |
3662 #if CYTHON_USE_MODULE_STATE | |
3663 #endif | |
3664 #if CYTHON_USE_MODULE_STATE | |
3665 #endif | |
3666 #if CYTHON_USE_MODULE_STATE | |
3667 #endif | |
3668 #if CYTHON_USE_MODULE_STATE | |
3669 #endif | |
3670 #if CYTHON_USE_MODULE_STATE | |
3671 #endif | |
3672 #if CYTHON_USE_MODULE_STATE | |
3673 #endif | |
3674 #if CYTHON_USE_MODULE_STATE | |
3675 #endif | |
3676 #if CYTHON_USE_MODULE_STATE | |
3677 #endif | |
3678 #if CYTHON_USE_MODULE_STATE | |
3679 #endif | |
3680 #if CYTHON_USE_MODULE_STATE | |
3681 #endif | |
3682 #if CYTHON_USE_MODULE_STATE | |
3683 #endif | |
3684 #if CYTHON_USE_MODULE_STATE | |
3685 #endif | |
3686 #if CYTHON_USE_MODULE_STATE | |
3687 #endif | |
3688 #if CYTHON_USE_MODULE_STATE | |
3689 #endif | |
3690 #if CYTHON_USE_MODULE_STATE | |
3691 #endif | |
3692 #if CYTHON_USE_MODULE_STATE | |
3693 #endif | |
3694 #if CYTHON_USE_MODULE_STATE | |
3695 #endif | |
3696 PyTypeObject *__pyx_ptype_7cpython_5array_array; | |
3697 #if CYTHON_USE_MODULE_STATE | |
3698 #endif | |
3699 #if CYTHON_USE_MODULE_STATE | |
3700 #endif | |
3701 PyTypeObject *__pyx_ptype_5pysam_10libchtslib_HTSFile; | |
3702 #if CYTHON_USE_MODULE_STATE | |
3703 #endif | |
3704 #if CYTHON_USE_MODULE_STATE | |
3705 #endif | |
3706 #if CYTHON_USE_MODULE_STATE | |
3707 PyObject *__pyx_type_5pysam_9libcfaidx_FastaFile; | |
3708 PyObject *__pyx_type_5pysam_9libcfaidx_FastqProxy; | |
3709 PyObject *__pyx_type_5pysam_9libcfaidx_FastxRecord; | |
3710 PyObject *__pyx_type_5pysam_9libcfaidx_FastxFile; | |
3711 PyObject *__pyx_type_5pysam_9libcfaidx_FastqFile; | |
3712 PyObject *__pyx_type_5pysam_9libcfaidx_Fastafile; | |
3713 #endif | |
3714 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_FastaFile; | |
3715 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_FastqProxy; | |
3716 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_FastxRecord; | |
3717 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_FastxFile; | |
3718 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_FastqFile; | |
3719 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_Fastafile; | |
3720 PyObject *__pyx_n_s_FastaFile; | |
3721 PyObject *__pyx_n_u_FastaFile; | |
3722 PyObject *__pyx_n_s_FastaFile___enter; | |
3723 PyObject *__pyx_n_s_FastaFile___exit; | |
3724 PyObject *__pyx_n_s_FastaFile___reduce_cython; | |
3725 PyObject *__pyx_n_s_FastaFile___setstate_cython; | |
3726 PyObject *__pyx_n_s_FastaFile__open; | |
3727 PyObject *__pyx_n_s_FastaFile_close; | |
3728 PyObject *__pyx_n_s_FastaFile_fetch; | |
3729 PyObject *__pyx_n_s_FastaFile_get_reference_length; | |
3730 PyObject *__pyx_n_s_FastaFile_is_open; | |
3731 PyObject *__pyx_n_s_Fastafile; | |
3732 PyObject *__pyx_n_u_Fastafile; | |
3733 PyObject *__pyx_n_s_Fastafile___reduce_cython; | |
3734 PyObject *__pyx_n_s_Fastafile___setstate_cython; | |
3735 PyObject *__pyx_n_s_FastqFile; | |
3736 PyObject *__pyx_n_u_FastqFile; | |
3737 PyObject *__pyx_n_s_FastqFile___reduce_cython; | |
3738 PyObject *__pyx_n_s_FastqFile___setstate_cython; | |
3739 PyObject *__pyx_n_s_FastqProxy; | |
3740 PyObject *__pyx_n_u_FastqProxy; | |
3741 PyObject *__pyx_n_s_FastqProxy___reduce_cython; | |
3742 PyObject *__pyx_n_s_FastqProxy___setstate_cython; | |
3743 PyObject *__pyx_n_s_FastqProxy_get_quality_array; | |
3744 PyObject *__pyx_n_s_FastxFile; | |
3745 PyObject *__pyx_n_u_FastxFile; | |
3746 PyObject *__pyx_n_s_FastxFile___enter; | |
3747 PyObject *__pyx_n_s_FastxFile___exit; | |
3748 PyObject *__pyx_n_s_FastxFile___reduce_cython; | |
3749 PyObject *__pyx_n_s_FastxFile___setstate_cython; | |
3750 PyObject *__pyx_n_s_FastxFile__open; | |
3751 PyObject *__pyx_n_s_FastxFile_close; | |
3752 PyObject *__pyx_n_s_FastxFile_is_open; | |
3753 PyObject *__pyx_n_s_FastxRecord; | |
3754 PyObject *__pyx_n_u_FastxRecord; | |
3755 PyObject *__pyx_n_s_FastxRecord___copy; | |
3756 PyObject *__pyx_n_s_FastxRecord___deepcopy; | |
3757 PyObject *__pyx_n_s_FastxRecord___reduce_cython; | |
3758 PyObject *__pyx_n_s_FastxRecord___setstate_cython; | |
3759 PyObject *__pyx_n_s_FastxRecord_get_quality_array; | |
3760 PyObject *__pyx_kp_u_FastxRecord_must_have_a_name_and; | |
3761 PyObject *__pyx_n_s_FastxRecord_set_comment; | |
3762 PyObject *__pyx_n_s_FastxRecord_set_name; | |
3763 PyObject *__pyx_n_s_FastxRecord_set_sequence; | |
3764 PyObject *__pyx_n_s_IOError; | |
3765 PyObject *__pyx_kp_u_I_O_operation_on_closed_file; | |
3766 PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; | |
3767 PyObject *__pyx_n_s_KeyError; | |
3768 PyObject *__pyx_n_s_MemoryError; | |
3769 PyObject *__pyx_kp_u_None; | |
3770 PyObject *__pyx_n_s_PickleError; | |
3771 PyObject *__pyx_n_s_StopIteration; | |
3772 PyObject *__pyx_n_s_TypeError; | |
3773 PyObject *__pyx_n_s_ValueError; | |
3774 PyObject *__pyx_kp_u__11; | |
3775 PyObject *__pyx_kp_u__16; | |
3776 PyObject *__pyx_kp_u__17; | |
3777 PyObject *__pyx_kp_u__18; | |
3778 PyObject *__pyx_kp_u__19; | |
3779 PyObject *__pyx_kp_b__4; | |
3780 PyObject *__pyx_kp_u__47; | |
3781 PyObject *__pyx_n_s__48; | |
3782 PyObject *__pyx_n_s__68; | |
3783 PyObject *__pyx_n_s_all; | |
3784 PyObject *__pyx_n_s_append; | |
3785 PyObject *__pyx_n_s_asyncio_coroutines; | |
3786 PyObject *__pyx_n_s_bindex_filename; | |
3787 PyObject *__pyx_n_s_bindex_filename_compressed; | |
3788 PyObject *__pyx_kp_u_calling_len_on_closed_file; | |
3789 PyObject *__pyx_kp_u_can_not_write_record_without_a_s; | |
3790 PyObject *__pyx_kp_u_can_not_write_record_without_nam; | |
3791 PyObject *__pyx_n_s_cfilename; | |
3792 PyObject *__pyx_n_s_cindexname; | |
3793 PyObject *__pyx_n_s_cindexname_compressed; | |
3794 PyObject *__pyx_n_s_class_getitem; | |
3795 PyObject *__pyx_n_s_cline_in_traceback; | |
3796 PyObject *__pyx_n_s_close; | |
3797 PyObject *__pyx_n_s_comment; | |
3798 PyObject *__pyx_n_s_contig; | |
3799 PyObject *__pyx_n_s_contig_b; | |
3800 PyObject *__pyx_n_s_copy; | |
3801 PyObject *__pyx_n_s_deepcopy; | |
3802 PyObject *__pyx_n_s_dict; | |
3803 PyObject *__pyx_n_s_dict_2; | |
3804 PyObject *__pyx_kp_u_disable; | |
3805 PyObject *__pyx_kp_u_do_not_instantiate_FastqProxy_di; | |
3806 PyObject *__pyx_kp_u_enable; | |
3807 PyObject *__pyx_n_s_end; | |
3808 PyObject *__pyx_n_s_enter; | |
3809 PyObject *__pyx_kp_u_error_when_opening_file_s; | |
3810 PyObject *__pyx_n_s_exc_type; | |
3811 PyObject *__pyx_n_s_exc_value; | |
3812 PyObject *__pyx_n_s_exists; | |
3813 PyObject *__pyx_n_s_exit; | |
3814 PyObject *__pyx_kp_u_failure_when_retrieving_sequence; | |
3815 PyObject *__pyx_n_s_fetch; | |
3816 PyObject *__pyx_kp_u_file_s_not_found; | |
3817 PyObject *__pyx_n_s_filename; | |
3818 PyObject *__pyx_kp_u_filename_does_not_exist; | |
3819 PyObject *__pyx_n_s_filepath_index; | |
3820 PyObject *__pyx_n_s_filepath_index_compressed; | |
3821 PyObject *__pyx_n_s_format; | |
3822 PyObject *__pyx_kp_u_gc; | |
3823 PyObject *__pyx_n_s_get_quality_array; | |
3824 PyObject *__pyx_n_s_get_reference_length; | |
3825 PyObject *__pyx_n_s_getstate; | |
3826 PyObject *__pyx_n_s_import; | |
3827 PyObject *__pyx_n_s_initializing; | |
3828 PyObject *__pyx_n_s_is_coroutine; | |
3829 PyObject *__pyx_n_s_is_open; | |
3830 PyObject *__pyx_kp_u_isenabled; | |
3831 PyObject *__pyx_n_s_length; | |
3832 PyObject *__pyx_n_s_main; | |
3833 PyObject *__pyx_n_s_memo; | |
3834 PyObject *__pyx_n_s_name; | |
3835 PyObject *__pyx_n_s_name_2; | |
3836 PyObject *__pyx_n_s_new; | |
3837 PyObject *__pyx_kp_s_no_default___reduce___due_to_non; | |
3838 PyObject *__pyx_kp_u_no_sequence_region_supplied; | |
3839 PyObject *__pyx_n_s_nreferences; | |
3840 PyObject *__pyx_n_s_offset; | |
3841 PyObject *__pyx_n_s_open; | |
3842 PyObject *__pyx_n_s_os; | |
3843 PyObject *__pyx_n_s_path; | |
3844 PyObject *__pyx_n_s_persist; | |
3845 PyObject *__pyx_n_s_pickle; | |
3846 PyObject *__pyx_n_s_proxy; | |
3847 PyObject *__pyx_n_s_pysam_libcfaidx; | |
3848 PyObject *__pyx_kp_s_pysam_libcfaidx_pyx; | |
3849 PyObject *__pyx_n_s_pyx_PickleError; | |
3850 PyObject *__pyx_n_s_pyx_checksum; | |
3851 PyObject *__pyx_n_s_pyx_result; | |
3852 PyObject *__pyx_n_s_pyx_state; | |
3853 PyObject *__pyx_n_s_pyx_type; | |
3854 PyObject *__pyx_n_s_pyx_unpickle_FastxRecord; | |
3855 PyObject *__pyx_n_s_pyx_vtable; | |
3856 PyObject *__pyx_n_s_quality; | |
3857 PyObject *__pyx_n_s_re; | |
3858 PyObject *__pyx_n_s_reduce; | |
3859 PyObject *__pyx_n_s_reduce_cython; | |
3860 PyObject *__pyx_n_s_reduce_ex; | |
3861 PyObject *__pyx_n_s_ref; | |
3862 PyObject *__pyx_n_s_reference; | |
3863 PyObject *__pyx_n_s_references; | |
3864 PyObject *__pyx_n_s_region; | |
3865 PyObject *__pyx_n_s_rend; | |
3866 PyObject *__pyx_n_s_rstart; | |
3867 PyObject *__pyx_kp_u_s; | |
3868 PyObject *__pyx_n_s_s_2; | |
3869 PyObject *__pyx_n_s_self; | |
3870 PyObject *__pyx_kp_s_self__delegate_cannot_be_convert; | |
3871 PyObject *__pyx_n_s_seq; | |
3872 PyObject *__pyx_n_s_sequence; | |
3873 PyObject *__pyx_kp_u_sequence_and_quality_length_do_n; | |
3874 PyObject *__pyx_kp_u_sequence_s_not_present; | |
3875 PyObject *__pyx_n_s_set_comment; | |
3876 PyObject *__pyx_n_s_set_name; | |
3877 PyObject *__pyx_n_s_set_sequence; | |
3878 PyObject *__pyx_n_s_setstate; | |
3879 PyObject *__pyx_n_s_setstate_cython; | |
3880 PyObject *__pyx_n_s_spec; | |
3881 PyObject *__pyx_n_s_ss; | |
3882 PyObject *__pyx_n_s_start; | |
3883 PyObject *__pyx_n_s_state; | |
3884 PyObject *__pyx_kp_s_stringsource; | |
3885 PyObject *__pyx_n_s_sys; | |
3886 PyObject *__pyx_n_s_test; | |
3887 PyObject *__pyx_n_s_traceback; | |
3888 PyObject *__pyx_kp_u_truncated_quality_string_in_0; | |
3889 PyObject *__pyx_kp_u_unknown_problem_parsing_0; | |
3890 PyObject *__pyx_n_s_update; | |
3891 PyObject *__pyx_n_s_use_setstate; | |
3892 PyObject *__pyx_n_s_x; | |
3893 PyObject *__pyx_n_s_zip; | |
3894 PyObject *__pyx_int_33; | |
3895 PyObject *__pyx_int_29210129; | |
3896 PyObject *__pyx_int_71291217; | |
3897 PyObject *__pyx_int_191400582; | |
3898 PyObject *__pyx_codeobj_; | |
3899 PyObject *__pyx_tuple__2; | |
3900 PyObject *__pyx_tuple__9; | |
3901 PyObject *__pyx_tuple__10; | |
3902 PyObject *__pyx_tuple__15; | |
3903 PyObject *__pyx_tuple__25; | |
3904 PyObject *__pyx_tuple__26; | |
3905 PyObject *__pyx_tuple__28; | |
3906 PyObject *__pyx_tuple__46; | |
3907 PyObject *__pyx_tuple__49; | |
3908 PyObject *__pyx_tuple__50; | |
3909 PyObject *__pyx_tuple__51; | |
3910 PyObject *__pyx_tuple__52; | |
3911 PyObject *__pyx_tuple__53; | |
3912 PyObject *__pyx_tuple__54; | |
3913 PyObject *__pyx_tuple__55; | |
3914 PyObject *__pyx_tuple__56; | |
3915 PyObject *__pyx_tuple__57; | |
3916 PyObject *__pyx_tuple__58; | |
3917 PyObject *__pyx_tuple__59; | |
3918 PyObject *__pyx_tuple__60; | |
3919 PyObject *__pyx_tuple__61; | |
3920 PyObject *__pyx_tuple__62; | |
3921 PyObject *__pyx_tuple__63; | |
3922 PyObject *__pyx_tuple__64; | |
3923 PyObject *__pyx_tuple__65; | |
3924 PyObject *__pyx_tuple__66; | |
3925 PyObject *__pyx_tuple__67; | |
3926 PyObject *__pyx_codeobj__3; | |
3927 PyObject *__pyx_codeobj__5; | |
3928 PyObject *__pyx_codeobj__6; | |
3929 PyObject *__pyx_codeobj__7; | |
3930 PyObject *__pyx_codeobj__8; | |
3931 PyObject *__pyx_codeobj__12; | |
3932 PyObject *__pyx_codeobj__13; | |
3933 PyObject *__pyx_codeobj__14; | |
3934 PyObject *__pyx_codeobj__20; | |
3935 PyObject *__pyx_codeobj__21; | |
3936 PyObject *__pyx_codeobj__22; | |
3937 PyObject *__pyx_codeobj__23; | |
3938 PyObject *__pyx_codeobj__24; | |
3939 PyObject *__pyx_codeobj__27; | |
3940 PyObject *__pyx_codeobj__29; | |
3941 PyObject *__pyx_codeobj__30; | |
3942 PyObject *__pyx_codeobj__31; | |
3943 PyObject *__pyx_codeobj__32; | |
3944 PyObject *__pyx_codeobj__33; | |
3945 PyObject *__pyx_codeobj__34; | |
3946 PyObject *__pyx_codeobj__35; | |
3947 PyObject *__pyx_codeobj__36; | |
3948 PyObject *__pyx_codeobj__37; | |
3949 PyObject *__pyx_codeobj__38; | |
3950 PyObject *__pyx_codeobj__39; | |
3951 PyObject *__pyx_codeobj__40; | |
3952 PyObject *__pyx_codeobj__41; | |
3953 PyObject *__pyx_codeobj__42; | |
3954 PyObject *__pyx_codeobj__43; | |
3955 PyObject *__pyx_codeobj__44; | |
3956 PyObject *__pyx_codeobj__45; | |
3957 } __pyx_mstate; | |
3958 | |
3959 #if CYTHON_USE_MODULE_STATE | |
3960 #ifdef __cplusplus | |
3961 namespace { | |
3962 extern struct PyModuleDef __pyx_moduledef; | |
3963 } /* anonymous namespace */ | |
3964 #else | |
3965 static struct PyModuleDef __pyx_moduledef; | |
3966 #endif | |
3967 | |
3968 #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) | |
3969 | |
3970 #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) | |
3971 | |
3972 #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) | |
3973 #else | |
3974 static __pyx_mstate __pyx_mstate_global_static = | |
3975 #ifdef __cplusplus | |
3976 {}; | |
3977 #else | |
3978 {0}; | |
3979 #endif | |
3980 static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; | |
3981 #endif | |
3982 /* #### Code section: module_state_clear ### */ | |
3983 #if CYTHON_USE_MODULE_STATE | |
3984 static int __pyx_m_clear(PyObject *m) { | |
3985 __pyx_mstate *clear_module_state = __pyx_mstate(m); | |
3986 if (!clear_module_state) return 0; | |
3987 Py_CLEAR(clear_module_state->__pyx_d); | |
3988 Py_CLEAR(clear_module_state->__pyx_b); | |
3989 Py_CLEAR(clear_module_state->__pyx_cython_runtime); | |
3990 Py_CLEAR(clear_module_state->__pyx_empty_tuple); | |
3991 Py_CLEAR(clear_module_state->__pyx_empty_bytes); | |
3992 Py_CLEAR(clear_module_state->__pyx_empty_unicode); | |
3993 #ifdef __Pyx_CyFunction_USED | |
3994 Py_CLEAR(clear_module_state->__pyx_CyFunctionType); | |
3995 #endif | |
3996 #ifdef __Pyx_FusedFunction_USED | |
3997 Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); | |
3998 #endif | |
3999 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); | |
4000 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool); | |
4001 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex); | |
4002 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_5array_array); | |
4003 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_10libchtslib_HTSFile); | |
4004 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_FastaFile); | |
4005 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libcfaidx_FastaFile); | |
4006 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_FastqProxy); | |
4007 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libcfaidx_FastqProxy); | |
4008 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_FastxRecord); | |
4009 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libcfaidx_FastxRecord); | |
4010 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_FastxFile); | |
4011 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libcfaidx_FastxFile); | |
4012 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_FastqFile); | |
4013 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libcfaidx_FastqFile); | |
4014 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_Fastafile); | |
4015 Py_CLEAR(clear_module_state->__pyx_type_5pysam_9libcfaidx_Fastafile); | |
4016 Py_CLEAR(clear_module_state->__pyx_n_s_FastaFile); | |
4017 Py_CLEAR(clear_module_state->__pyx_n_u_FastaFile); | |
4018 Py_CLEAR(clear_module_state->__pyx_n_s_FastaFile___enter); | |
4019 Py_CLEAR(clear_module_state->__pyx_n_s_FastaFile___exit); | |
4020 Py_CLEAR(clear_module_state->__pyx_n_s_FastaFile___reduce_cython); | |
4021 Py_CLEAR(clear_module_state->__pyx_n_s_FastaFile___setstate_cython); | |
4022 Py_CLEAR(clear_module_state->__pyx_n_s_FastaFile__open); | |
4023 Py_CLEAR(clear_module_state->__pyx_n_s_FastaFile_close); | |
4024 Py_CLEAR(clear_module_state->__pyx_n_s_FastaFile_fetch); | |
4025 Py_CLEAR(clear_module_state->__pyx_n_s_FastaFile_get_reference_length); | |
4026 Py_CLEAR(clear_module_state->__pyx_n_s_FastaFile_is_open); | |
4027 Py_CLEAR(clear_module_state->__pyx_n_s_Fastafile); | |
4028 Py_CLEAR(clear_module_state->__pyx_n_u_Fastafile); | |
4029 Py_CLEAR(clear_module_state->__pyx_n_s_Fastafile___reduce_cython); | |
4030 Py_CLEAR(clear_module_state->__pyx_n_s_Fastafile___setstate_cython); | |
4031 Py_CLEAR(clear_module_state->__pyx_n_s_FastqFile); | |
4032 Py_CLEAR(clear_module_state->__pyx_n_u_FastqFile); | |
4033 Py_CLEAR(clear_module_state->__pyx_n_s_FastqFile___reduce_cython); | |
4034 Py_CLEAR(clear_module_state->__pyx_n_s_FastqFile___setstate_cython); | |
4035 Py_CLEAR(clear_module_state->__pyx_n_s_FastqProxy); | |
4036 Py_CLEAR(clear_module_state->__pyx_n_u_FastqProxy); | |
4037 Py_CLEAR(clear_module_state->__pyx_n_s_FastqProxy___reduce_cython); | |
4038 Py_CLEAR(clear_module_state->__pyx_n_s_FastqProxy___setstate_cython); | |
4039 Py_CLEAR(clear_module_state->__pyx_n_s_FastqProxy_get_quality_array); | |
4040 Py_CLEAR(clear_module_state->__pyx_n_s_FastxFile); | |
4041 Py_CLEAR(clear_module_state->__pyx_n_u_FastxFile); | |
4042 Py_CLEAR(clear_module_state->__pyx_n_s_FastxFile___enter); | |
4043 Py_CLEAR(clear_module_state->__pyx_n_s_FastxFile___exit); | |
4044 Py_CLEAR(clear_module_state->__pyx_n_s_FastxFile___reduce_cython); | |
4045 Py_CLEAR(clear_module_state->__pyx_n_s_FastxFile___setstate_cython); | |
4046 Py_CLEAR(clear_module_state->__pyx_n_s_FastxFile__open); | |
4047 Py_CLEAR(clear_module_state->__pyx_n_s_FastxFile_close); | |
4048 Py_CLEAR(clear_module_state->__pyx_n_s_FastxFile_is_open); | |
4049 Py_CLEAR(clear_module_state->__pyx_n_s_FastxRecord); | |
4050 Py_CLEAR(clear_module_state->__pyx_n_u_FastxRecord); | |
4051 Py_CLEAR(clear_module_state->__pyx_n_s_FastxRecord___copy); | |
4052 Py_CLEAR(clear_module_state->__pyx_n_s_FastxRecord___deepcopy); | |
4053 Py_CLEAR(clear_module_state->__pyx_n_s_FastxRecord___reduce_cython); | |
4054 Py_CLEAR(clear_module_state->__pyx_n_s_FastxRecord___setstate_cython); | |
4055 Py_CLEAR(clear_module_state->__pyx_n_s_FastxRecord_get_quality_array); | |
4056 Py_CLEAR(clear_module_state->__pyx_kp_u_FastxRecord_must_have_a_name_and); | |
4057 Py_CLEAR(clear_module_state->__pyx_n_s_FastxRecord_set_comment); | |
4058 Py_CLEAR(clear_module_state->__pyx_n_s_FastxRecord_set_name); | |
4059 Py_CLEAR(clear_module_state->__pyx_n_s_FastxRecord_set_sequence); | |
4060 Py_CLEAR(clear_module_state->__pyx_n_s_IOError); | |
4061 Py_CLEAR(clear_module_state->__pyx_kp_u_I_O_operation_on_closed_file); | |
4062 Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); | |
4063 Py_CLEAR(clear_module_state->__pyx_n_s_KeyError); | |
4064 Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError); | |
4065 Py_CLEAR(clear_module_state->__pyx_kp_u_None); | |
4066 Py_CLEAR(clear_module_state->__pyx_n_s_PickleError); | |
4067 Py_CLEAR(clear_module_state->__pyx_n_s_StopIteration); | |
4068 Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); | |
4069 Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); | |
4070 Py_CLEAR(clear_module_state->__pyx_kp_u__11); | |
4071 Py_CLEAR(clear_module_state->__pyx_kp_u__16); | |
4072 Py_CLEAR(clear_module_state->__pyx_kp_u__17); | |
4073 Py_CLEAR(clear_module_state->__pyx_kp_u__18); | |
4074 Py_CLEAR(clear_module_state->__pyx_kp_u__19); | |
4075 Py_CLEAR(clear_module_state->__pyx_kp_b__4); | |
4076 Py_CLEAR(clear_module_state->__pyx_kp_u__47); | |
4077 Py_CLEAR(clear_module_state->__pyx_n_s__48); | |
4078 Py_CLEAR(clear_module_state->__pyx_n_s__68); | |
4079 Py_CLEAR(clear_module_state->__pyx_n_s_all); | |
4080 Py_CLEAR(clear_module_state->__pyx_n_s_append); | |
4081 Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); | |
4082 Py_CLEAR(clear_module_state->__pyx_n_s_bindex_filename); | |
4083 Py_CLEAR(clear_module_state->__pyx_n_s_bindex_filename_compressed); | |
4084 Py_CLEAR(clear_module_state->__pyx_kp_u_calling_len_on_closed_file); | |
4085 Py_CLEAR(clear_module_state->__pyx_kp_u_can_not_write_record_without_a_s); | |
4086 Py_CLEAR(clear_module_state->__pyx_kp_u_can_not_write_record_without_nam); | |
4087 Py_CLEAR(clear_module_state->__pyx_n_s_cfilename); | |
4088 Py_CLEAR(clear_module_state->__pyx_n_s_cindexname); | |
4089 Py_CLEAR(clear_module_state->__pyx_n_s_cindexname_compressed); | |
4090 Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); | |
4091 Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); | |
4092 Py_CLEAR(clear_module_state->__pyx_n_s_close); | |
4093 Py_CLEAR(clear_module_state->__pyx_n_s_comment); | |
4094 Py_CLEAR(clear_module_state->__pyx_n_s_contig); | |
4095 Py_CLEAR(clear_module_state->__pyx_n_s_contig_b); | |
4096 Py_CLEAR(clear_module_state->__pyx_n_s_copy); | |
4097 Py_CLEAR(clear_module_state->__pyx_n_s_deepcopy); | |
4098 Py_CLEAR(clear_module_state->__pyx_n_s_dict); | |
4099 Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); | |
4100 Py_CLEAR(clear_module_state->__pyx_kp_u_disable); | |
4101 Py_CLEAR(clear_module_state->__pyx_kp_u_do_not_instantiate_FastqProxy_di); | |
4102 Py_CLEAR(clear_module_state->__pyx_kp_u_enable); | |
4103 Py_CLEAR(clear_module_state->__pyx_n_s_end); | |
4104 Py_CLEAR(clear_module_state->__pyx_n_s_enter); | |
4105 Py_CLEAR(clear_module_state->__pyx_kp_u_error_when_opening_file_s); | |
4106 Py_CLEAR(clear_module_state->__pyx_n_s_exc_type); | |
4107 Py_CLEAR(clear_module_state->__pyx_n_s_exc_value); | |
4108 Py_CLEAR(clear_module_state->__pyx_n_s_exists); | |
4109 Py_CLEAR(clear_module_state->__pyx_n_s_exit); | |
4110 Py_CLEAR(clear_module_state->__pyx_kp_u_failure_when_retrieving_sequence); | |
4111 Py_CLEAR(clear_module_state->__pyx_n_s_fetch); | |
4112 Py_CLEAR(clear_module_state->__pyx_kp_u_file_s_not_found); | |
4113 Py_CLEAR(clear_module_state->__pyx_n_s_filename); | |
4114 Py_CLEAR(clear_module_state->__pyx_kp_u_filename_does_not_exist); | |
4115 Py_CLEAR(clear_module_state->__pyx_n_s_filepath_index); | |
4116 Py_CLEAR(clear_module_state->__pyx_n_s_filepath_index_compressed); | |
4117 Py_CLEAR(clear_module_state->__pyx_n_s_format); | |
4118 Py_CLEAR(clear_module_state->__pyx_kp_u_gc); | |
4119 Py_CLEAR(clear_module_state->__pyx_n_s_get_quality_array); | |
4120 Py_CLEAR(clear_module_state->__pyx_n_s_get_reference_length); | |
4121 Py_CLEAR(clear_module_state->__pyx_n_s_getstate); | |
4122 Py_CLEAR(clear_module_state->__pyx_n_s_import); | |
4123 Py_CLEAR(clear_module_state->__pyx_n_s_initializing); | |
4124 Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); | |
4125 Py_CLEAR(clear_module_state->__pyx_n_s_is_open); | |
4126 Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); | |
4127 Py_CLEAR(clear_module_state->__pyx_n_s_length); | |
4128 Py_CLEAR(clear_module_state->__pyx_n_s_main); | |
4129 Py_CLEAR(clear_module_state->__pyx_n_s_memo); | |
4130 Py_CLEAR(clear_module_state->__pyx_n_s_name); | |
4131 Py_CLEAR(clear_module_state->__pyx_n_s_name_2); | |
4132 Py_CLEAR(clear_module_state->__pyx_n_s_new); | |
4133 Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); | |
4134 Py_CLEAR(clear_module_state->__pyx_kp_u_no_sequence_region_supplied); | |
4135 Py_CLEAR(clear_module_state->__pyx_n_s_nreferences); | |
4136 Py_CLEAR(clear_module_state->__pyx_n_s_offset); | |
4137 Py_CLEAR(clear_module_state->__pyx_n_s_open); | |
4138 Py_CLEAR(clear_module_state->__pyx_n_s_os); | |
4139 Py_CLEAR(clear_module_state->__pyx_n_s_path); | |
4140 Py_CLEAR(clear_module_state->__pyx_n_s_persist); | |
4141 Py_CLEAR(clear_module_state->__pyx_n_s_pickle); | |
4142 Py_CLEAR(clear_module_state->__pyx_n_s_proxy); | |
4143 Py_CLEAR(clear_module_state->__pyx_n_s_pysam_libcfaidx); | |
4144 Py_CLEAR(clear_module_state->__pyx_kp_s_pysam_libcfaidx_pyx); | |
4145 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError); | |
4146 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum); | |
4147 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result); | |
4148 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); | |
4149 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type); | |
4150 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_FastxRecord); | |
4151 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable); | |
4152 Py_CLEAR(clear_module_state->__pyx_n_s_quality); | |
4153 Py_CLEAR(clear_module_state->__pyx_n_s_re); | |
4154 Py_CLEAR(clear_module_state->__pyx_n_s_reduce); | |
4155 Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); | |
4156 Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); | |
4157 Py_CLEAR(clear_module_state->__pyx_n_s_ref); | |
4158 Py_CLEAR(clear_module_state->__pyx_n_s_reference); | |
4159 Py_CLEAR(clear_module_state->__pyx_n_s_references); | |
4160 Py_CLEAR(clear_module_state->__pyx_n_s_region); | |
4161 Py_CLEAR(clear_module_state->__pyx_n_s_rend); | |
4162 Py_CLEAR(clear_module_state->__pyx_n_s_rstart); | |
4163 Py_CLEAR(clear_module_state->__pyx_kp_u_s); | |
4164 Py_CLEAR(clear_module_state->__pyx_n_s_s_2); | |
4165 Py_CLEAR(clear_module_state->__pyx_n_s_self); | |
4166 Py_CLEAR(clear_module_state->__pyx_kp_s_self__delegate_cannot_be_convert); | |
4167 Py_CLEAR(clear_module_state->__pyx_n_s_seq); | |
4168 Py_CLEAR(clear_module_state->__pyx_n_s_sequence); | |
4169 Py_CLEAR(clear_module_state->__pyx_kp_u_sequence_and_quality_length_do_n); | |
4170 Py_CLEAR(clear_module_state->__pyx_kp_u_sequence_s_not_present); | |
4171 Py_CLEAR(clear_module_state->__pyx_n_s_set_comment); | |
4172 Py_CLEAR(clear_module_state->__pyx_n_s_set_name); | |
4173 Py_CLEAR(clear_module_state->__pyx_n_s_set_sequence); | |
4174 Py_CLEAR(clear_module_state->__pyx_n_s_setstate); | |
4175 Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); | |
4176 Py_CLEAR(clear_module_state->__pyx_n_s_spec); | |
4177 Py_CLEAR(clear_module_state->__pyx_n_s_ss); | |
4178 Py_CLEAR(clear_module_state->__pyx_n_s_start); | |
4179 Py_CLEAR(clear_module_state->__pyx_n_s_state); | |
4180 Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); | |
4181 Py_CLEAR(clear_module_state->__pyx_n_s_sys); | |
4182 Py_CLEAR(clear_module_state->__pyx_n_s_test); | |
4183 Py_CLEAR(clear_module_state->__pyx_n_s_traceback); | |
4184 Py_CLEAR(clear_module_state->__pyx_kp_u_truncated_quality_string_in_0); | |
4185 Py_CLEAR(clear_module_state->__pyx_kp_u_unknown_problem_parsing_0); | |
4186 Py_CLEAR(clear_module_state->__pyx_n_s_update); | |
4187 Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate); | |
4188 Py_CLEAR(clear_module_state->__pyx_n_s_x); | |
4189 Py_CLEAR(clear_module_state->__pyx_n_s_zip); | |
4190 Py_CLEAR(clear_module_state->__pyx_int_33); | |
4191 Py_CLEAR(clear_module_state->__pyx_int_29210129); | |
4192 Py_CLEAR(clear_module_state->__pyx_int_71291217); | |
4193 Py_CLEAR(clear_module_state->__pyx_int_191400582); | |
4194 Py_CLEAR(clear_module_state->__pyx_codeobj_); | |
4195 Py_CLEAR(clear_module_state->__pyx_tuple__2); | |
4196 Py_CLEAR(clear_module_state->__pyx_tuple__9); | |
4197 Py_CLEAR(clear_module_state->__pyx_tuple__10); | |
4198 Py_CLEAR(clear_module_state->__pyx_tuple__15); | |
4199 Py_CLEAR(clear_module_state->__pyx_tuple__25); | |
4200 Py_CLEAR(clear_module_state->__pyx_tuple__26); | |
4201 Py_CLEAR(clear_module_state->__pyx_tuple__28); | |
4202 Py_CLEAR(clear_module_state->__pyx_tuple__46); | |
4203 Py_CLEAR(clear_module_state->__pyx_tuple__49); | |
4204 Py_CLEAR(clear_module_state->__pyx_tuple__50); | |
4205 Py_CLEAR(clear_module_state->__pyx_tuple__51); | |
4206 Py_CLEAR(clear_module_state->__pyx_tuple__52); | |
4207 Py_CLEAR(clear_module_state->__pyx_tuple__53); | |
4208 Py_CLEAR(clear_module_state->__pyx_tuple__54); | |
4209 Py_CLEAR(clear_module_state->__pyx_tuple__55); | |
4210 Py_CLEAR(clear_module_state->__pyx_tuple__56); | |
4211 Py_CLEAR(clear_module_state->__pyx_tuple__57); | |
4212 Py_CLEAR(clear_module_state->__pyx_tuple__58); | |
4213 Py_CLEAR(clear_module_state->__pyx_tuple__59); | |
4214 Py_CLEAR(clear_module_state->__pyx_tuple__60); | |
4215 Py_CLEAR(clear_module_state->__pyx_tuple__61); | |
4216 Py_CLEAR(clear_module_state->__pyx_tuple__62); | |
4217 Py_CLEAR(clear_module_state->__pyx_tuple__63); | |
4218 Py_CLEAR(clear_module_state->__pyx_tuple__64); | |
4219 Py_CLEAR(clear_module_state->__pyx_tuple__65); | |
4220 Py_CLEAR(clear_module_state->__pyx_tuple__66); | |
4221 Py_CLEAR(clear_module_state->__pyx_tuple__67); | |
4222 Py_CLEAR(clear_module_state->__pyx_codeobj__3); | |
4223 Py_CLEAR(clear_module_state->__pyx_codeobj__5); | |
4224 Py_CLEAR(clear_module_state->__pyx_codeobj__6); | |
4225 Py_CLEAR(clear_module_state->__pyx_codeobj__7); | |
4226 Py_CLEAR(clear_module_state->__pyx_codeobj__8); | |
4227 Py_CLEAR(clear_module_state->__pyx_codeobj__12); | |
4228 Py_CLEAR(clear_module_state->__pyx_codeobj__13); | |
4229 Py_CLEAR(clear_module_state->__pyx_codeobj__14); | |
4230 Py_CLEAR(clear_module_state->__pyx_codeobj__20); | |
4231 Py_CLEAR(clear_module_state->__pyx_codeobj__21); | |
4232 Py_CLEAR(clear_module_state->__pyx_codeobj__22); | |
4233 Py_CLEAR(clear_module_state->__pyx_codeobj__23); | |
4234 Py_CLEAR(clear_module_state->__pyx_codeobj__24); | |
4235 Py_CLEAR(clear_module_state->__pyx_codeobj__27); | |
4236 Py_CLEAR(clear_module_state->__pyx_codeobj__29); | |
4237 Py_CLEAR(clear_module_state->__pyx_codeobj__30); | |
4238 Py_CLEAR(clear_module_state->__pyx_codeobj__31); | |
4239 Py_CLEAR(clear_module_state->__pyx_codeobj__32); | |
4240 Py_CLEAR(clear_module_state->__pyx_codeobj__33); | |
4241 Py_CLEAR(clear_module_state->__pyx_codeobj__34); | |
4242 Py_CLEAR(clear_module_state->__pyx_codeobj__35); | |
4243 Py_CLEAR(clear_module_state->__pyx_codeobj__36); | |
4244 Py_CLEAR(clear_module_state->__pyx_codeobj__37); | |
4245 Py_CLEAR(clear_module_state->__pyx_codeobj__38); | |
4246 Py_CLEAR(clear_module_state->__pyx_codeobj__39); | |
4247 Py_CLEAR(clear_module_state->__pyx_codeobj__40); | |
4248 Py_CLEAR(clear_module_state->__pyx_codeobj__41); | |
4249 Py_CLEAR(clear_module_state->__pyx_codeobj__42); | |
4250 Py_CLEAR(clear_module_state->__pyx_codeobj__43); | |
4251 Py_CLEAR(clear_module_state->__pyx_codeobj__44); | |
4252 Py_CLEAR(clear_module_state->__pyx_codeobj__45); | |
4253 return 0; | |
4254 } | |
4255 #endif | |
4256 /* #### Code section: module_state_traverse ### */ | |
4257 #if CYTHON_USE_MODULE_STATE | |
4258 static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { | |
4259 __pyx_mstate *traverse_module_state = __pyx_mstate(m); | |
4260 if (!traverse_module_state) return 0; | |
4261 Py_VISIT(traverse_module_state->__pyx_d); | |
4262 Py_VISIT(traverse_module_state->__pyx_b); | |
4263 Py_VISIT(traverse_module_state->__pyx_cython_runtime); | |
4264 Py_VISIT(traverse_module_state->__pyx_empty_tuple); | |
4265 Py_VISIT(traverse_module_state->__pyx_empty_bytes); | |
4266 Py_VISIT(traverse_module_state->__pyx_empty_unicode); | |
4267 #ifdef __Pyx_CyFunction_USED | |
4268 Py_VISIT(traverse_module_state->__pyx_CyFunctionType); | |
4269 #endif | |
4270 #ifdef __Pyx_FusedFunction_USED | |
4271 Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); | |
4272 #endif | |
4273 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); | |
4274 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool); | |
4275 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex); | |
4276 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_5array_array); | |
4277 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_10libchtslib_HTSFile); | |
4278 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_FastaFile); | |
4279 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libcfaidx_FastaFile); | |
4280 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_FastqProxy); | |
4281 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libcfaidx_FastqProxy); | |
4282 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_FastxRecord); | |
4283 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libcfaidx_FastxRecord); | |
4284 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_FastxFile); | |
4285 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libcfaidx_FastxFile); | |
4286 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_FastqFile); | |
4287 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libcfaidx_FastqFile); | |
4288 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_Fastafile); | |
4289 Py_VISIT(traverse_module_state->__pyx_type_5pysam_9libcfaidx_Fastafile); | |
4290 Py_VISIT(traverse_module_state->__pyx_n_s_FastaFile); | |
4291 Py_VISIT(traverse_module_state->__pyx_n_u_FastaFile); | |
4292 Py_VISIT(traverse_module_state->__pyx_n_s_FastaFile___enter); | |
4293 Py_VISIT(traverse_module_state->__pyx_n_s_FastaFile___exit); | |
4294 Py_VISIT(traverse_module_state->__pyx_n_s_FastaFile___reduce_cython); | |
4295 Py_VISIT(traverse_module_state->__pyx_n_s_FastaFile___setstate_cython); | |
4296 Py_VISIT(traverse_module_state->__pyx_n_s_FastaFile__open); | |
4297 Py_VISIT(traverse_module_state->__pyx_n_s_FastaFile_close); | |
4298 Py_VISIT(traverse_module_state->__pyx_n_s_FastaFile_fetch); | |
4299 Py_VISIT(traverse_module_state->__pyx_n_s_FastaFile_get_reference_length); | |
4300 Py_VISIT(traverse_module_state->__pyx_n_s_FastaFile_is_open); | |
4301 Py_VISIT(traverse_module_state->__pyx_n_s_Fastafile); | |
4302 Py_VISIT(traverse_module_state->__pyx_n_u_Fastafile); | |
4303 Py_VISIT(traverse_module_state->__pyx_n_s_Fastafile___reduce_cython); | |
4304 Py_VISIT(traverse_module_state->__pyx_n_s_Fastafile___setstate_cython); | |
4305 Py_VISIT(traverse_module_state->__pyx_n_s_FastqFile); | |
4306 Py_VISIT(traverse_module_state->__pyx_n_u_FastqFile); | |
4307 Py_VISIT(traverse_module_state->__pyx_n_s_FastqFile___reduce_cython); | |
4308 Py_VISIT(traverse_module_state->__pyx_n_s_FastqFile___setstate_cython); | |
4309 Py_VISIT(traverse_module_state->__pyx_n_s_FastqProxy); | |
4310 Py_VISIT(traverse_module_state->__pyx_n_u_FastqProxy); | |
4311 Py_VISIT(traverse_module_state->__pyx_n_s_FastqProxy___reduce_cython); | |
4312 Py_VISIT(traverse_module_state->__pyx_n_s_FastqProxy___setstate_cython); | |
4313 Py_VISIT(traverse_module_state->__pyx_n_s_FastqProxy_get_quality_array); | |
4314 Py_VISIT(traverse_module_state->__pyx_n_s_FastxFile); | |
4315 Py_VISIT(traverse_module_state->__pyx_n_u_FastxFile); | |
4316 Py_VISIT(traverse_module_state->__pyx_n_s_FastxFile___enter); | |
4317 Py_VISIT(traverse_module_state->__pyx_n_s_FastxFile___exit); | |
4318 Py_VISIT(traverse_module_state->__pyx_n_s_FastxFile___reduce_cython); | |
4319 Py_VISIT(traverse_module_state->__pyx_n_s_FastxFile___setstate_cython); | |
4320 Py_VISIT(traverse_module_state->__pyx_n_s_FastxFile__open); | |
4321 Py_VISIT(traverse_module_state->__pyx_n_s_FastxFile_close); | |
4322 Py_VISIT(traverse_module_state->__pyx_n_s_FastxFile_is_open); | |
4323 Py_VISIT(traverse_module_state->__pyx_n_s_FastxRecord); | |
4324 Py_VISIT(traverse_module_state->__pyx_n_u_FastxRecord); | |
4325 Py_VISIT(traverse_module_state->__pyx_n_s_FastxRecord___copy); | |
4326 Py_VISIT(traverse_module_state->__pyx_n_s_FastxRecord___deepcopy); | |
4327 Py_VISIT(traverse_module_state->__pyx_n_s_FastxRecord___reduce_cython); | |
4328 Py_VISIT(traverse_module_state->__pyx_n_s_FastxRecord___setstate_cython); | |
4329 Py_VISIT(traverse_module_state->__pyx_n_s_FastxRecord_get_quality_array); | |
4330 Py_VISIT(traverse_module_state->__pyx_kp_u_FastxRecord_must_have_a_name_and); | |
4331 Py_VISIT(traverse_module_state->__pyx_n_s_FastxRecord_set_comment); | |
4332 Py_VISIT(traverse_module_state->__pyx_n_s_FastxRecord_set_name); | |
4333 Py_VISIT(traverse_module_state->__pyx_n_s_FastxRecord_set_sequence); | |
4334 Py_VISIT(traverse_module_state->__pyx_n_s_IOError); | |
4335 Py_VISIT(traverse_module_state->__pyx_kp_u_I_O_operation_on_closed_file); | |
4336 Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); | |
4337 Py_VISIT(traverse_module_state->__pyx_n_s_KeyError); | |
4338 Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError); | |
4339 Py_VISIT(traverse_module_state->__pyx_kp_u_None); | |
4340 Py_VISIT(traverse_module_state->__pyx_n_s_PickleError); | |
4341 Py_VISIT(traverse_module_state->__pyx_n_s_StopIteration); | |
4342 Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); | |
4343 Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); | |
4344 Py_VISIT(traverse_module_state->__pyx_kp_u__11); | |
4345 Py_VISIT(traverse_module_state->__pyx_kp_u__16); | |
4346 Py_VISIT(traverse_module_state->__pyx_kp_u__17); | |
4347 Py_VISIT(traverse_module_state->__pyx_kp_u__18); | |
4348 Py_VISIT(traverse_module_state->__pyx_kp_u__19); | |
4349 Py_VISIT(traverse_module_state->__pyx_kp_b__4); | |
4350 Py_VISIT(traverse_module_state->__pyx_kp_u__47); | |
4351 Py_VISIT(traverse_module_state->__pyx_n_s__48); | |
4352 Py_VISIT(traverse_module_state->__pyx_n_s__68); | |
4353 Py_VISIT(traverse_module_state->__pyx_n_s_all); | |
4354 Py_VISIT(traverse_module_state->__pyx_n_s_append); | |
4355 Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); | |
4356 Py_VISIT(traverse_module_state->__pyx_n_s_bindex_filename); | |
4357 Py_VISIT(traverse_module_state->__pyx_n_s_bindex_filename_compressed); | |
4358 Py_VISIT(traverse_module_state->__pyx_kp_u_calling_len_on_closed_file); | |
4359 Py_VISIT(traverse_module_state->__pyx_kp_u_can_not_write_record_without_a_s); | |
4360 Py_VISIT(traverse_module_state->__pyx_kp_u_can_not_write_record_without_nam); | |
4361 Py_VISIT(traverse_module_state->__pyx_n_s_cfilename); | |
4362 Py_VISIT(traverse_module_state->__pyx_n_s_cindexname); | |
4363 Py_VISIT(traverse_module_state->__pyx_n_s_cindexname_compressed); | |
4364 Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); | |
4365 Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); | |
4366 Py_VISIT(traverse_module_state->__pyx_n_s_close); | |
4367 Py_VISIT(traverse_module_state->__pyx_n_s_comment); | |
4368 Py_VISIT(traverse_module_state->__pyx_n_s_contig); | |
4369 Py_VISIT(traverse_module_state->__pyx_n_s_contig_b); | |
4370 Py_VISIT(traverse_module_state->__pyx_n_s_copy); | |
4371 Py_VISIT(traverse_module_state->__pyx_n_s_deepcopy); | |
4372 Py_VISIT(traverse_module_state->__pyx_n_s_dict); | |
4373 Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); | |
4374 Py_VISIT(traverse_module_state->__pyx_kp_u_disable); | |
4375 Py_VISIT(traverse_module_state->__pyx_kp_u_do_not_instantiate_FastqProxy_di); | |
4376 Py_VISIT(traverse_module_state->__pyx_kp_u_enable); | |
4377 Py_VISIT(traverse_module_state->__pyx_n_s_end); | |
4378 Py_VISIT(traverse_module_state->__pyx_n_s_enter); | |
4379 Py_VISIT(traverse_module_state->__pyx_kp_u_error_when_opening_file_s); | |
4380 Py_VISIT(traverse_module_state->__pyx_n_s_exc_type); | |
4381 Py_VISIT(traverse_module_state->__pyx_n_s_exc_value); | |
4382 Py_VISIT(traverse_module_state->__pyx_n_s_exists); | |
4383 Py_VISIT(traverse_module_state->__pyx_n_s_exit); | |
4384 Py_VISIT(traverse_module_state->__pyx_kp_u_failure_when_retrieving_sequence); | |
4385 Py_VISIT(traverse_module_state->__pyx_n_s_fetch); | |
4386 Py_VISIT(traverse_module_state->__pyx_kp_u_file_s_not_found); | |
4387 Py_VISIT(traverse_module_state->__pyx_n_s_filename); | |
4388 Py_VISIT(traverse_module_state->__pyx_kp_u_filename_does_not_exist); | |
4389 Py_VISIT(traverse_module_state->__pyx_n_s_filepath_index); | |
4390 Py_VISIT(traverse_module_state->__pyx_n_s_filepath_index_compressed); | |
4391 Py_VISIT(traverse_module_state->__pyx_n_s_format); | |
4392 Py_VISIT(traverse_module_state->__pyx_kp_u_gc); | |
4393 Py_VISIT(traverse_module_state->__pyx_n_s_get_quality_array); | |
4394 Py_VISIT(traverse_module_state->__pyx_n_s_get_reference_length); | |
4395 Py_VISIT(traverse_module_state->__pyx_n_s_getstate); | |
4396 Py_VISIT(traverse_module_state->__pyx_n_s_import); | |
4397 Py_VISIT(traverse_module_state->__pyx_n_s_initializing); | |
4398 Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); | |
4399 Py_VISIT(traverse_module_state->__pyx_n_s_is_open); | |
4400 Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); | |
4401 Py_VISIT(traverse_module_state->__pyx_n_s_length); | |
4402 Py_VISIT(traverse_module_state->__pyx_n_s_main); | |
4403 Py_VISIT(traverse_module_state->__pyx_n_s_memo); | |
4404 Py_VISIT(traverse_module_state->__pyx_n_s_name); | |
4405 Py_VISIT(traverse_module_state->__pyx_n_s_name_2); | |
4406 Py_VISIT(traverse_module_state->__pyx_n_s_new); | |
4407 Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); | |
4408 Py_VISIT(traverse_module_state->__pyx_kp_u_no_sequence_region_supplied); | |
4409 Py_VISIT(traverse_module_state->__pyx_n_s_nreferences); | |
4410 Py_VISIT(traverse_module_state->__pyx_n_s_offset); | |
4411 Py_VISIT(traverse_module_state->__pyx_n_s_open); | |
4412 Py_VISIT(traverse_module_state->__pyx_n_s_os); | |
4413 Py_VISIT(traverse_module_state->__pyx_n_s_path); | |
4414 Py_VISIT(traverse_module_state->__pyx_n_s_persist); | |
4415 Py_VISIT(traverse_module_state->__pyx_n_s_pickle); | |
4416 Py_VISIT(traverse_module_state->__pyx_n_s_proxy); | |
4417 Py_VISIT(traverse_module_state->__pyx_n_s_pysam_libcfaidx); | |
4418 Py_VISIT(traverse_module_state->__pyx_kp_s_pysam_libcfaidx_pyx); | |
4419 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError); | |
4420 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum); | |
4421 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result); | |
4422 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); | |
4423 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type); | |
4424 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_FastxRecord); | |
4425 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable); | |
4426 Py_VISIT(traverse_module_state->__pyx_n_s_quality); | |
4427 Py_VISIT(traverse_module_state->__pyx_n_s_re); | |
4428 Py_VISIT(traverse_module_state->__pyx_n_s_reduce); | |
4429 Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); | |
4430 Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); | |
4431 Py_VISIT(traverse_module_state->__pyx_n_s_ref); | |
4432 Py_VISIT(traverse_module_state->__pyx_n_s_reference); | |
4433 Py_VISIT(traverse_module_state->__pyx_n_s_references); | |
4434 Py_VISIT(traverse_module_state->__pyx_n_s_region); | |
4435 Py_VISIT(traverse_module_state->__pyx_n_s_rend); | |
4436 Py_VISIT(traverse_module_state->__pyx_n_s_rstart); | |
4437 Py_VISIT(traverse_module_state->__pyx_kp_u_s); | |
4438 Py_VISIT(traverse_module_state->__pyx_n_s_s_2); | |
4439 Py_VISIT(traverse_module_state->__pyx_n_s_self); | |
4440 Py_VISIT(traverse_module_state->__pyx_kp_s_self__delegate_cannot_be_convert); | |
4441 Py_VISIT(traverse_module_state->__pyx_n_s_seq); | |
4442 Py_VISIT(traverse_module_state->__pyx_n_s_sequence); | |
4443 Py_VISIT(traverse_module_state->__pyx_kp_u_sequence_and_quality_length_do_n); | |
4444 Py_VISIT(traverse_module_state->__pyx_kp_u_sequence_s_not_present); | |
4445 Py_VISIT(traverse_module_state->__pyx_n_s_set_comment); | |
4446 Py_VISIT(traverse_module_state->__pyx_n_s_set_name); | |
4447 Py_VISIT(traverse_module_state->__pyx_n_s_set_sequence); | |
4448 Py_VISIT(traverse_module_state->__pyx_n_s_setstate); | |
4449 Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); | |
4450 Py_VISIT(traverse_module_state->__pyx_n_s_spec); | |
4451 Py_VISIT(traverse_module_state->__pyx_n_s_ss); | |
4452 Py_VISIT(traverse_module_state->__pyx_n_s_start); | |
4453 Py_VISIT(traverse_module_state->__pyx_n_s_state); | |
4454 Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); | |
4455 Py_VISIT(traverse_module_state->__pyx_n_s_sys); | |
4456 Py_VISIT(traverse_module_state->__pyx_n_s_test); | |
4457 Py_VISIT(traverse_module_state->__pyx_n_s_traceback); | |
4458 Py_VISIT(traverse_module_state->__pyx_kp_u_truncated_quality_string_in_0); | |
4459 Py_VISIT(traverse_module_state->__pyx_kp_u_unknown_problem_parsing_0); | |
4460 Py_VISIT(traverse_module_state->__pyx_n_s_update); | |
4461 Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate); | |
4462 Py_VISIT(traverse_module_state->__pyx_n_s_x); | |
4463 Py_VISIT(traverse_module_state->__pyx_n_s_zip); | |
4464 Py_VISIT(traverse_module_state->__pyx_int_33); | |
4465 Py_VISIT(traverse_module_state->__pyx_int_29210129); | |
4466 Py_VISIT(traverse_module_state->__pyx_int_71291217); | |
4467 Py_VISIT(traverse_module_state->__pyx_int_191400582); | |
4468 Py_VISIT(traverse_module_state->__pyx_codeobj_); | |
4469 Py_VISIT(traverse_module_state->__pyx_tuple__2); | |
4470 Py_VISIT(traverse_module_state->__pyx_tuple__9); | |
4471 Py_VISIT(traverse_module_state->__pyx_tuple__10); | |
4472 Py_VISIT(traverse_module_state->__pyx_tuple__15); | |
4473 Py_VISIT(traverse_module_state->__pyx_tuple__25); | |
4474 Py_VISIT(traverse_module_state->__pyx_tuple__26); | |
4475 Py_VISIT(traverse_module_state->__pyx_tuple__28); | |
4476 Py_VISIT(traverse_module_state->__pyx_tuple__46); | |
4477 Py_VISIT(traverse_module_state->__pyx_tuple__49); | |
4478 Py_VISIT(traverse_module_state->__pyx_tuple__50); | |
4479 Py_VISIT(traverse_module_state->__pyx_tuple__51); | |
4480 Py_VISIT(traverse_module_state->__pyx_tuple__52); | |
4481 Py_VISIT(traverse_module_state->__pyx_tuple__53); | |
4482 Py_VISIT(traverse_module_state->__pyx_tuple__54); | |
4483 Py_VISIT(traverse_module_state->__pyx_tuple__55); | |
4484 Py_VISIT(traverse_module_state->__pyx_tuple__56); | |
4485 Py_VISIT(traverse_module_state->__pyx_tuple__57); | |
4486 Py_VISIT(traverse_module_state->__pyx_tuple__58); | |
4487 Py_VISIT(traverse_module_state->__pyx_tuple__59); | |
4488 Py_VISIT(traverse_module_state->__pyx_tuple__60); | |
4489 Py_VISIT(traverse_module_state->__pyx_tuple__61); | |
4490 Py_VISIT(traverse_module_state->__pyx_tuple__62); | |
4491 Py_VISIT(traverse_module_state->__pyx_tuple__63); | |
4492 Py_VISIT(traverse_module_state->__pyx_tuple__64); | |
4493 Py_VISIT(traverse_module_state->__pyx_tuple__65); | |
4494 Py_VISIT(traverse_module_state->__pyx_tuple__66); | |
4495 Py_VISIT(traverse_module_state->__pyx_tuple__67); | |
4496 Py_VISIT(traverse_module_state->__pyx_codeobj__3); | |
4497 Py_VISIT(traverse_module_state->__pyx_codeobj__5); | |
4498 Py_VISIT(traverse_module_state->__pyx_codeobj__6); | |
4499 Py_VISIT(traverse_module_state->__pyx_codeobj__7); | |
4500 Py_VISIT(traverse_module_state->__pyx_codeobj__8); | |
4501 Py_VISIT(traverse_module_state->__pyx_codeobj__12); | |
4502 Py_VISIT(traverse_module_state->__pyx_codeobj__13); | |
4503 Py_VISIT(traverse_module_state->__pyx_codeobj__14); | |
4504 Py_VISIT(traverse_module_state->__pyx_codeobj__20); | |
4505 Py_VISIT(traverse_module_state->__pyx_codeobj__21); | |
4506 Py_VISIT(traverse_module_state->__pyx_codeobj__22); | |
4507 Py_VISIT(traverse_module_state->__pyx_codeobj__23); | |
4508 Py_VISIT(traverse_module_state->__pyx_codeobj__24); | |
4509 Py_VISIT(traverse_module_state->__pyx_codeobj__27); | |
4510 Py_VISIT(traverse_module_state->__pyx_codeobj__29); | |
4511 Py_VISIT(traverse_module_state->__pyx_codeobj__30); | |
4512 Py_VISIT(traverse_module_state->__pyx_codeobj__31); | |
4513 Py_VISIT(traverse_module_state->__pyx_codeobj__32); | |
4514 Py_VISIT(traverse_module_state->__pyx_codeobj__33); | |
4515 Py_VISIT(traverse_module_state->__pyx_codeobj__34); | |
4516 Py_VISIT(traverse_module_state->__pyx_codeobj__35); | |
4517 Py_VISIT(traverse_module_state->__pyx_codeobj__36); | |
4518 Py_VISIT(traverse_module_state->__pyx_codeobj__37); | |
4519 Py_VISIT(traverse_module_state->__pyx_codeobj__38); | |
4520 Py_VISIT(traverse_module_state->__pyx_codeobj__39); | |
4521 Py_VISIT(traverse_module_state->__pyx_codeobj__40); | |
4522 Py_VISIT(traverse_module_state->__pyx_codeobj__41); | |
4523 Py_VISIT(traverse_module_state->__pyx_codeobj__42); | |
4524 Py_VISIT(traverse_module_state->__pyx_codeobj__43); | |
4525 Py_VISIT(traverse_module_state->__pyx_codeobj__44); | |
4526 Py_VISIT(traverse_module_state->__pyx_codeobj__45); | |
4527 return 0; | |
4528 } | |
4529 #endif | |
4530 /* #### Code section: module_state_defines ### */ | |
4531 #define __pyx_d __pyx_mstate_global->__pyx_d | |
4532 #define __pyx_b __pyx_mstate_global->__pyx_b | |
4533 #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime | |
4534 #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple | |
4535 #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes | |
4536 #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode | |
4537 #ifdef __Pyx_CyFunction_USED | |
4538 #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType | |
4539 #endif | |
4540 #ifdef __Pyx_FusedFunction_USED | |
4541 #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType | |
4542 #endif | |
4543 #ifdef __Pyx_Generator_USED | |
4544 #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType | |
4545 #endif | |
4546 #ifdef __Pyx_IterableCoroutine_USED | |
4547 #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType | |
4548 #endif | |
4549 #ifdef __Pyx_Coroutine_USED | |
4550 #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType | |
4551 #endif | |
4552 #ifdef __Pyx_Coroutine_USED | |
4553 #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType | |
4554 #endif | |
4555 #if CYTHON_USE_MODULE_STATE | |
4556 #endif | |
4557 #if CYTHON_USE_MODULE_STATE | |
4558 #endif | |
4559 #if CYTHON_USE_MODULE_STATE | |
4560 #endif | |
4561 #if CYTHON_USE_MODULE_STATE | |
4562 #endif | |
4563 #if CYTHON_USE_MODULE_STATE | |
4564 #endif | |
4565 #if CYTHON_USE_MODULE_STATE | |
4566 #endif | |
4567 #if CYTHON_USE_MODULE_STATE | |
4568 #endif | |
4569 #if CYTHON_USE_MODULE_STATE | |
4570 #endif | |
4571 #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type | |
4572 #if CYTHON_USE_MODULE_STATE | |
4573 #endif | |
4574 #if CYTHON_USE_MODULE_STATE | |
4575 #endif | |
4576 #if CYTHON_USE_MODULE_STATE | |
4577 #endif | |
4578 #if CYTHON_USE_MODULE_STATE | |
4579 #endif | |
4580 #if CYTHON_USE_MODULE_STATE | |
4581 #endif | |
4582 #if CYTHON_USE_MODULE_STATE | |
4583 #endif | |
4584 #if CYTHON_USE_MODULE_STATE | |
4585 #endif | |
4586 #if CYTHON_USE_MODULE_STATE | |
4587 #endif | |
4588 #if CYTHON_USE_MODULE_STATE | |
4589 #endif | |
4590 #if CYTHON_USE_MODULE_STATE | |
4591 #endif | |
4592 #if CYTHON_USE_MODULE_STATE | |
4593 #endif | |
4594 #if CYTHON_USE_MODULE_STATE | |
4595 #endif | |
4596 #if CYTHON_USE_MODULE_STATE | |
4597 #endif | |
4598 #if CYTHON_USE_MODULE_STATE | |
4599 #endif | |
4600 #define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool | |
4601 #if CYTHON_USE_MODULE_STATE | |
4602 #endif | |
4603 #if CYTHON_USE_MODULE_STATE | |
4604 #endif | |
4605 #if CYTHON_USE_MODULE_STATE | |
4606 #endif | |
4607 #if CYTHON_USE_MODULE_STATE | |
4608 #endif | |
4609 #define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex | |
4610 #if CYTHON_USE_MODULE_STATE | |
4611 #endif | |
4612 #if CYTHON_USE_MODULE_STATE | |
4613 #endif | |
4614 #if CYTHON_USE_MODULE_STATE | |
4615 #endif | |
4616 #if CYTHON_USE_MODULE_STATE | |
4617 #endif | |
4618 #if CYTHON_USE_MODULE_STATE | |
4619 #endif | |
4620 #if CYTHON_USE_MODULE_STATE | |
4621 #endif | |
4622 #if CYTHON_USE_MODULE_STATE | |
4623 #endif | |
4624 #if CYTHON_USE_MODULE_STATE | |
4625 #endif | |
4626 #if CYTHON_USE_MODULE_STATE | |
4627 #endif | |
4628 #if CYTHON_USE_MODULE_STATE | |
4629 #endif | |
4630 #if CYTHON_USE_MODULE_STATE | |
4631 #endif | |
4632 #if CYTHON_USE_MODULE_STATE | |
4633 #endif | |
4634 #if CYTHON_USE_MODULE_STATE | |
4635 #endif | |
4636 #if CYTHON_USE_MODULE_STATE | |
4637 #endif | |
4638 #if CYTHON_USE_MODULE_STATE | |
4639 #endif | |
4640 #if CYTHON_USE_MODULE_STATE | |
4641 #endif | |
4642 #if CYTHON_USE_MODULE_STATE | |
4643 #endif | |
4644 #if CYTHON_USE_MODULE_STATE | |
4645 #endif | |
4646 #if CYTHON_USE_MODULE_STATE | |
4647 #endif | |
4648 #if CYTHON_USE_MODULE_STATE | |
4649 #endif | |
4650 #if CYTHON_USE_MODULE_STATE | |
4651 #endif | |
4652 #if CYTHON_USE_MODULE_STATE | |
4653 #endif | |
4654 #define __pyx_ptype_7cpython_5array_array __pyx_mstate_global->__pyx_ptype_7cpython_5array_array | |
4655 #if CYTHON_USE_MODULE_STATE | |
4656 #endif | |
4657 #if CYTHON_USE_MODULE_STATE | |
4658 #endif | |
4659 #define __pyx_ptype_5pysam_10libchtslib_HTSFile __pyx_mstate_global->__pyx_ptype_5pysam_10libchtslib_HTSFile | |
4660 #if CYTHON_USE_MODULE_STATE | |
4661 #endif | |
4662 #if CYTHON_USE_MODULE_STATE | |
4663 #endif | |
4664 #if CYTHON_USE_MODULE_STATE | |
4665 #define __pyx_type_5pysam_9libcfaidx_FastaFile __pyx_mstate_global->__pyx_type_5pysam_9libcfaidx_FastaFile | |
4666 #define __pyx_type_5pysam_9libcfaidx_FastqProxy __pyx_mstate_global->__pyx_type_5pysam_9libcfaidx_FastqProxy | |
4667 #define __pyx_type_5pysam_9libcfaidx_FastxRecord __pyx_mstate_global->__pyx_type_5pysam_9libcfaidx_FastxRecord | |
4668 #define __pyx_type_5pysam_9libcfaidx_FastxFile __pyx_mstate_global->__pyx_type_5pysam_9libcfaidx_FastxFile | |
4669 #define __pyx_type_5pysam_9libcfaidx_FastqFile __pyx_mstate_global->__pyx_type_5pysam_9libcfaidx_FastqFile | |
4670 #define __pyx_type_5pysam_9libcfaidx_Fastafile __pyx_mstate_global->__pyx_type_5pysam_9libcfaidx_Fastafile | |
4671 #endif | |
4672 #define __pyx_ptype_5pysam_9libcfaidx_FastaFile __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_FastaFile | |
4673 #define __pyx_ptype_5pysam_9libcfaidx_FastqProxy __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_FastqProxy | |
4674 #define __pyx_ptype_5pysam_9libcfaidx_FastxRecord __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_FastxRecord | |
4675 #define __pyx_ptype_5pysam_9libcfaidx_FastxFile __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_FastxFile | |
4676 #define __pyx_ptype_5pysam_9libcfaidx_FastqFile __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_FastqFile | |
4677 #define __pyx_ptype_5pysam_9libcfaidx_Fastafile __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_Fastafile | |
4678 #define __pyx_n_s_FastaFile __pyx_mstate_global->__pyx_n_s_FastaFile | |
4679 #define __pyx_n_u_FastaFile __pyx_mstate_global->__pyx_n_u_FastaFile | |
4680 #define __pyx_n_s_FastaFile___enter __pyx_mstate_global->__pyx_n_s_FastaFile___enter | |
4681 #define __pyx_n_s_FastaFile___exit __pyx_mstate_global->__pyx_n_s_FastaFile___exit | |
4682 #define __pyx_n_s_FastaFile___reduce_cython __pyx_mstate_global->__pyx_n_s_FastaFile___reduce_cython | |
4683 #define __pyx_n_s_FastaFile___setstate_cython __pyx_mstate_global->__pyx_n_s_FastaFile___setstate_cython | |
4684 #define __pyx_n_s_FastaFile__open __pyx_mstate_global->__pyx_n_s_FastaFile__open | |
4685 #define __pyx_n_s_FastaFile_close __pyx_mstate_global->__pyx_n_s_FastaFile_close | |
4686 #define __pyx_n_s_FastaFile_fetch __pyx_mstate_global->__pyx_n_s_FastaFile_fetch | |
4687 #define __pyx_n_s_FastaFile_get_reference_length __pyx_mstate_global->__pyx_n_s_FastaFile_get_reference_length | |
4688 #define __pyx_n_s_FastaFile_is_open __pyx_mstate_global->__pyx_n_s_FastaFile_is_open | |
4689 #define __pyx_n_s_Fastafile __pyx_mstate_global->__pyx_n_s_Fastafile | |
4690 #define __pyx_n_u_Fastafile __pyx_mstate_global->__pyx_n_u_Fastafile | |
4691 #define __pyx_n_s_Fastafile___reduce_cython __pyx_mstate_global->__pyx_n_s_Fastafile___reduce_cython | |
4692 #define __pyx_n_s_Fastafile___setstate_cython __pyx_mstate_global->__pyx_n_s_Fastafile___setstate_cython | |
4693 #define __pyx_n_s_FastqFile __pyx_mstate_global->__pyx_n_s_FastqFile | |
4694 #define __pyx_n_u_FastqFile __pyx_mstate_global->__pyx_n_u_FastqFile | |
4695 #define __pyx_n_s_FastqFile___reduce_cython __pyx_mstate_global->__pyx_n_s_FastqFile___reduce_cython | |
4696 #define __pyx_n_s_FastqFile___setstate_cython __pyx_mstate_global->__pyx_n_s_FastqFile___setstate_cython | |
4697 #define __pyx_n_s_FastqProxy __pyx_mstate_global->__pyx_n_s_FastqProxy | |
4698 #define __pyx_n_u_FastqProxy __pyx_mstate_global->__pyx_n_u_FastqProxy | |
4699 #define __pyx_n_s_FastqProxy___reduce_cython __pyx_mstate_global->__pyx_n_s_FastqProxy___reduce_cython | |
4700 #define __pyx_n_s_FastqProxy___setstate_cython __pyx_mstate_global->__pyx_n_s_FastqProxy___setstate_cython | |
4701 #define __pyx_n_s_FastqProxy_get_quality_array __pyx_mstate_global->__pyx_n_s_FastqProxy_get_quality_array | |
4702 #define __pyx_n_s_FastxFile __pyx_mstate_global->__pyx_n_s_FastxFile | |
4703 #define __pyx_n_u_FastxFile __pyx_mstate_global->__pyx_n_u_FastxFile | |
4704 #define __pyx_n_s_FastxFile___enter __pyx_mstate_global->__pyx_n_s_FastxFile___enter | |
4705 #define __pyx_n_s_FastxFile___exit __pyx_mstate_global->__pyx_n_s_FastxFile___exit | |
4706 #define __pyx_n_s_FastxFile___reduce_cython __pyx_mstate_global->__pyx_n_s_FastxFile___reduce_cython | |
4707 #define __pyx_n_s_FastxFile___setstate_cython __pyx_mstate_global->__pyx_n_s_FastxFile___setstate_cython | |
4708 #define __pyx_n_s_FastxFile__open __pyx_mstate_global->__pyx_n_s_FastxFile__open | |
4709 #define __pyx_n_s_FastxFile_close __pyx_mstate_global->__pyx_n_s_FastxFile_close | |
4710 #define __pyx_n_s_FastxFile_is_open __pyx_mstate_global->__pyx_n_s_FastxFile_is_open | |
4711 #define __pyx_n_s_FastxRecord __pyx_mstate_global->__pyx_n_s_FastxRecord | |
4712 #define __pyx_n_u_FastxRecord __pyx_mstate_global->__pyx_n_u_FastxRecord | |
4713 #define __pyx_n_s_FastxRecord___copy __pyx_mstate_global->__pyx_n_s_FastxRecord___copy | |
4714 #define __pyx_n_s_FastxRecord___deepcopy __pyx_mstate_global->__pyx_n_s_FastxRecord___deepcopy | |
4715 #define __pyx_n_s_FastxRecord___reduce_cython __pyx_mstate_global->__pyx_n_s_FastxRecord___reduce_cython | |
4716 #define __pyx_n_s_FastxRecord___setstate_cython __pyx_mstate_global->__pyx_n_s_FastxRecord___setstate_cython | |
4717 #define __pyx_n_s_FastxRecord_get_quality_array __pyx_mstate_global->__pyx_n_s_FastxRecord_get_quality_array | |
4718 #define __pyx_kp_u_FastxRecord_must_have_a_name_and __pyx_mstate_global->__pyx_kp_u_FastxRecord_must_have_a_name_and | |
4719 #define __pyx_n_s_FastxRecord_set_comment __pyx_mstate_global->__pyx_n_s_FastxRecord_set_comment | |
4720 #define __pyx_n_s_FastxRecord_set_name __pyx_mstate_global->__pyx_n_s_FastxRecord_set_name | |
4721 #define __pyx_n_s_FastxRecord_set_sequence __pyx_mstate_global->__pyx_n_s_FastxRecord_set_sequence | |
4722 #define __pyx_n_s_IOError __pyx_mstate_global->__pyx_n_s_IOError | |
4723 #define __pyx_kp_u_I_O_operation_on_closed_file __pyx_mstate_global->__pyx_kp_u_I_O_operation_on_closed_file | |
4724 #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0 | |
4725 #define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError | |
4726 #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError | |
4727 #define __pyx_kp_u_None __pyx_mstate_global->__pyx_kp_u_None | |
4728 #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError | |
4729 #define __pyx_n_s_StopIteration __pyx_mstate_global->__pyx_n_s_StopIteration | |
4730 #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError | |
4731 #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError | |
4732 #define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11 | |
4733 #define __pyx_kp_u__16 __pyx_mstate_global->__pyx_kp_u__16 | |
4734 #define __pyx_kp_u__17 __pyx_mstate_global->__pyx_kp_u__17 | |
4735 #define __pyx_kp_u__18 __pyx_mstate_global->__pyx_kp_u__18 | |
4736 #define __pyx_kp_u__19 __pyx_mstate_global->__pyx_kp_u__19 | |
4737 #define __pyx_kp_b__4 __pyx_mstate_global->__pyx_kp_b__4 | |
4738 #define __pyx_kp_u__47 __pyx_mstate_global->__pyx_kp_u__47 | |
4739 #define __pyx_n_s__48 __pyx_mstate_global->__pyx_n_s__48 | |
4740 #define __pyx_n_s__68 __pyx_mstate_global->__pyx_n_s__68 | |
4741 #define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all | |
4742 #define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append | |
4743 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines | |
4744 #define __pyx_n_s_bindex_filename __pyx_mstate_global->__pyx_n_s_bindex_filename | |
4745 #define __pyx_n_s_bindex_filename_compressed __pyx_mstate_global->__pyx_n_s_bindex_filename_compressed | |
4746 #define __pyx_kp_u_calling_len_on_closed_file __pyx_mstate_global->__pyx_kp_u_calling_len_on_closed_file | |
4747 #define __pyx_kp_u_can_not_write_record_without_a_s __pyx_mstate_global->__pyx_kp_u_can_not_write_record_without_a_s | |
4748 #define __pyx_kp_u_can_not_write_record_without_nam __pyx_mstate_global->__pyx_kp_u_can_not_write_record_without_nam | |
4749 #define __pyx_n_s_cfilename __pyx_mstate_global->__pyx_n_s_cfilename | |
4750 #define __pyx_n_s_cindexname __pyx_mstate_global->__pyx_n_s_cindexname | |
4751 #define __pyx_n_s_cindexname_compressed __pyx_mstate_global->__pyx_n_s_cindexname_compressed | |
4752 #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem | |
4753 #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback | |
4754 #define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close | |
4755 #define __pyx_n_s_comment __pyx_mstate_global->__pyx_n_s_comment | |
4756 #define __pyx_n_s_contig __pyx_mstate_global->__pyx_n_s_contig | |
4757 #define __pyx_n_s_contig_b __pyx_mstate_global->__pyx_n_s_contig_b | |
4758 #define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy | |
4759 #define __pyx_n_s_deepcopy __pyx_mstate_global->__pyx_n_s_deepcopy | |
4760 #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict | |
4761 #define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 | |
4762 #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable | |
4763 #define __pyx_kp_u_do_not_instantiate_FastqProxy_di __pyx_mstate_global->__pyx_kp_u_do_not_instantiate_FastqProxy_di | |
4764 #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable | |
4765 #define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end | |
4766 #define __pyx_n_s_enter __pyx_mstate_global->__pyx_n_s_enter | |
4767 #define __pyx_kp_u_error_when_opening_file_s __pyx_mstate_global->__pyx_kp_u_error_when_opening_file_s | |
4768 #define __pyx_n_s_exc_type __pyx_mstate_global->__pyx_n_s_exc_type | |
4769 #define __pyx_n_s_exc_value __pyx_mstate_global->__pyx_n_s_exc_value | |
4770 #define __pyx_n_s_exists __pyx_mstate_global->__pyx_n_s_exists | |
4771 #define __pyx_n_s_exit __pyx_mstate_global->__pyx_n_s_exit | |
4772 #define __pyx_kp_u_failure_when_retrieving_sequence __pyx_mstate_global->__pyx_kp_u_failure_when_retrieving_sequence | |
4773 #define __pyx_n_s_fetch __pyx_mstate_global->__pyx_n_s_fetch | |
4774 #define __pyx_kp_u_file_s_not_found __pyx_mstate_global->__pyx_kp_u_file_s_not_found | |
4775 #define __pyx_n_s_filename __pyx_mstate_global->__pyx_n_s_filename | |
4776 #define __pyx_kp_u_filename_does_not_exist __pyx_mstate_global->__pyx_kp_u_filename_does_not_exist | |
4777 #define __pyx_n_s_filepath_index __pyx_mstate_global->__pyx_n_s_filepath_index | |
4778 #define __pyx_n_s_filepath_index_compressed __pyx_mstate_global->__pyx_n_s_filepath_index_compressed | |
4779 #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format | |
4780 #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc | |
4781 #define __pyx_n_s_get_quality_array __pyx_mstate_global->__pyx_n_s_get_quality_array | |
4782 #define __pyx_n_s_get_reference_length __pyx_mstate_global->__pyx_n_s_get_reference_length | |
4783 #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate | |
4784 #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import | |
4785 #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing | |
4786 #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine | |
4787 #define __pyx_n_s_is_open __pyx_mstate_global->__pyx_n_s_is_open | |
4788 #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled | |
4789 #define __pyx_n_s_length __pyx_mstate_global->__pyx_n_s_length | |
4790 #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main | |
4791 #define __pyx_n_s_memo __pyx_mstate_global->__pyx_n_s_memo | |
4792 #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name | |
4793 #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 | |
4794 #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new | |
4795 #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non | |
4796 #define __pyx_kp_u_no_sequence_region_supplied __pyx_mstate_global->__pyx_kp_u_no_sequence_region_supplied | |
4797 #define __pyx_n_s_nreferences __pyx_mstate_global->__pyx_n_s_nreferences | |
4798 #define __pyx_n_s_offset __pyx_mstate_global->__pyx_n_s_offset | |
4799 #define __pyx_n_s_open __pyx_mstate_global->__pyx_n_s_open | |
4800 #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os | |
4801 #define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path | |
4802 #define __pyx_n_s_persist __pyx_mstate_global->__pyx_n_s_persist | |
4803 #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle | |
4804 #define __pyx_n_s_proxy __pyx_mstate_global->__pyx_n_s_proxy | |
4805 #define __pyx_n_s_pysam_libcfaidx __pyx_mstate_global->__pyx_n_s_pysam_libcfaidx | |
4806 #define __pyx_kp_s_pysam_libcfaidx_pyx __pyx_mstate_global->__pyx_kp_s_pysam_libcfaidx_pyx | |
4807 #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError | |
4808 #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum | |
4809 #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result | |
4810 #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state | |
4811 #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type | |
4812 #define __pyx_n_s_pyx_unpickle_FastxRecord __pyx_mstate_global->__pyx_n_s_pyx_unpickle_FastxRecord | |
4813 #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable | |
4814 #define __pyx_n_s_quality __pyx_mstate_global->__pyx_n_s_quality | |
4815 #define __pyx_n_s_re __pyx_mstate_global->__pyx_n_s_re | |
4816 #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce | |
4817 #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython | |
4818 #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex | |
4819 #define __pyx_n_s_ref __pyx_mstate_global->__pyx_n_s_ref | |
4820 #define __pyx_n_s_reference __pyx_mstate_global->__pyx_n_s_reference | |
4821 #define __pyx_n_s_references __pyx_mstate_global->__pyx_n_s_references | |
4822 #define __pyx_n_s_region __pyx_mstate_global->__pyx_n_s_region | |
4823 #define __pyx_n_s_rend __pyx_mstate_global->__pyx_n_s_rend | |
4824 #define __pyx_n_s_rstart __pyx_mstate_global->__pyx_n_s_rstart | |
4825 #define __pyx_kp_u_s __pyx_mstate_global->__pyx_kp_u_s | |
4826 #define __pyx_n_s_s_2 __pyx_mstate_global->__pyx_n_s_s_2 | |
4827 #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self | |
4828 #define __pyx_kp_s_self__delegate_cannot_be_convert __pyx_mstate_global->__pyx_kp_s_self__delegate_cannot_be_convert | |
4829 #define __pyx_n_s_seq __pyx_mstate_global->__pyx_n_s_seq | |
4830 #define __pyx_n_s_sequence __pyx_mstate_global->__pyx_n_s_sequence | |
4831 #define __pyx_kp_u_sequence_and_quality_length_do_n __pyx_mstate_global->__pyx_kp_u_sequence_and_quality_length_do_n | |
4832 #define __pyx_kp_u_sequence_s_not_present __pyx_mstate_global->__pyx_kp_u_sequence_s_not_present | |
4833 #define __pyx_n_s_set_comment __pyx_mstate_global->__pyx_n_s_set_comment | |
4834 #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name | |
4835 #define __pyx_n_s_set_sequence __pyx_mstate_global->__pyx_n_s_set_sequence | |
4836 #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate | |
4837 #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython | |
4838 #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec | |
4839 #define __pyx_n_s_ss __pyx_mstate_global->__pyx_n_s_ss | |
4840 #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start | |
4841 #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state | |
4842 #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource | |
4843 #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys | |
4844 #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test | |
4845 #define __pyx_n_s_traceback __pyx_mstate_global->__pyx_n_s_traceback | |
4846 #define __pyx_kp_u_truncated_quality_string_in_0 __pyx_mstate_global->__pyx_kp_u_truncated_quality_string_in_0 | |
4847 #define __pyx_kp_u_unknown_problem_parsing_0 __pyx_mstate_global->__pyx_kp_u_unknown_problem_parsing_0 | |
4848 #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update | |
4849 #define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate | |
4850 #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x | |
4851 #define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip | |
4852 #define __pyx_int_33 __pyx_mstate_global->__pyx_int_33 | |
4853 #define __pyx_int_29210129 __pyx_mstate_global->__pyx_int_29210129 | |
4854 #define __pyx_int_71291217 __pyx_mstate_global->__pyx_int_71291217 | |
4855 #define __pyx_int_191400582 __pyx_mstate_global->__pyx_int_191400582 | |
4856 #define __pyx_codeobj_ __pyx_mstate_global->__pyx_codeobj_ | |
4857 #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 | |
4858 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 | |
4859 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 | |
4860 #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 | |
4861 #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 | |
4862 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 | |
4863 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 | |
4864 #define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46 | |
4865 #define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49 | |
4866 #define __pyx_tuple__50 __pyx_mstate_global->__pyx_tuple__50 | |
4867 #define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51 | |
4868 #define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52 | |
4869 #define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53 | |
4870 #define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54 | |
4871 #define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55 | |
4872 #define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 | |
4873 #define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57 | |
4874 #define __pyx_tuple__58 __pyx_mstate_global->__pyx_tuple__58 | |
4875 #define __pyx_tuple__59 __pyx_mstate_global->__pyx_tuple__59 | |
4876 #define __pyx_tuple__60 __pyx_mstate_global->__pyx_tuple__60 | |
4877 #define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61 | |
4878 #define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62 | |
4879 #define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63 | |
4880 #define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64 | |
4881 #define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 | |
4882 #define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66 | |
4883 #define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 | |
4884 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 | |
4885 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 | |
4886 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 | |
4887 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 | |
4888 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 | |
4889 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 | |
4890 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 | |
4891 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 | |
4892 #define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 | |
4893 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 | |
4894 #define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 | |
4895 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 | |
4896 #define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 | |
4897 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 | |
4898 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 | |
4899 #define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 | |
4900 #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 | |
4901 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 | |
4902 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 | |
4903 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 | |
4904 #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 | |
4905 #define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 | |
4906 #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 | |
4907 #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 | |
4908 #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 | |
4909 #define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 | |
4910 #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 | |
4911 #define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42 | |
4912 #define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43 | |
4913 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 | |
4914 #define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45 | |
4915 /* #### Code section: module_code ### */ | |
4916 | |
4917 /* "cpython/complex.pxd":19 | |
4918 * | |
4919 * @property | |
4920 * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< | |
4921 * return self.cval.real | |
4922 * | |
4923 */ | |
4924 | |
4925 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) { | |
4926 double __pyx_r; | |
4927 | |
4928 /* "cpython/complex.pxd":20 | |
4929 * @property | |
4930 * cdef inline double real(self) noexcept: | |
4931 * return self.cval.real # <<<<<<<<<<<<<< | |
4932 * | |
4933 * @property | |
4934 */ | |
4935 __pyx_r = __pyx_v_self->cval.real; | |
4936 goto __pyx_L0; | |
4937 | |
4938 /* "cpython/complex.pxd":19 | |
4939 * | |
4940 * @property | |
4941 * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< | |
4942 * return self.cval.real | |
4943 * | |
4944 */ | |
4945 | |
4946 /* function exit code */ | |
4947 __pyx_L0:; | |
4948 return __pyx_r; | |
4949 } | |
4950 | |
4951 /* "cpython/complex.pxd":23 | |
4952 * | |
4953 * @property | |
4954 * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< | |
4955 * return self.cval.imag | |
4956 * | |
4957 */ | |
4958 | |
4959 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) { | |
4960 double __pyx_r; | |
4961 | |
4962 /* "cpython/complex.pxd":24 | |
4963 * @property | |
4964 * cdef inline double imag(self) noexcept: | |
4965 * return self.cval.imag # <<<<<<<<<<<<<< | |
4966 * | |
4967 * # PyTypeObject PyComplex_Type | |
4968 */ | |
4969 __pyx_r = __pyx_v_self->cval.imag; | |
4970 goto __pyx_L0; | |
4971 | |
4972 /* "cpython/complex.pxd":23 | |
4973 * | |
4974 * @property | |
4975 * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< | |
4976 * return self.cval.imag | |
4977 * | |
4978 */ | |
4979 | |
4980 /* function exit code */ | |
4981 __pyx_L0:; | |
4982 return __pyx_r; | |
4983 } | |
4984 | |
4985 /* "cpython/contextvars.pxd":112 | |
4986 * | |
4987 * | |
4988 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< | |
4989 * """Return a new reference to the value of the context variable, | |
4990 * or the default value of the context variable, | |
4991 */ | |
4992 | |
4993 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) { | |
4994 PyObject *__pyx_v_default_value = ((PyObject *)Py_None); | |
4995 PyObject *__pyx_v_value; | |
4996 PyObject *__pyx_v_pyvalue = NULL; | |
4997 PyObject *__pyx_r = NULL; | |
4998 __Pyx_RefNannyDeclarations | |
4999 int __pyx_t_1; | |
5000 int __pyx_t_2; | |
5001 PyObject *__pyx_t_3 = NULL; | |
5002 int __pyx_lineno = 0; | |
5003 const char *__pyx_filename = NULL; | |
5004 int __pyx_clineno = 0; | |
5005 __Pyx_RefNannySetupContext("get_value", 1); | |
5006 if (__pyx_optional_args) { | |
5007 if (__pyx_optional_args->__pyx_n > 0) { | |
5008 __pyx_v_default_value = __pyx_optional_args->default_value; | |
5009 } | |
5010 } | |
5011 | |
5012 /* "cpython/contextvars.pxd":117 | |
5013 * or None if no such value or default was found. | |
5014 * """ | |
5015 * cdef PyObject *value = NULL # <<<<<<<<<<<<<< | |
5016 * PyContextVar_Get(var, NULL, &value) | |
5017 * if value is NULL: | |
5018 */ | |
5019 __pyx_v_value = NULL; | |
5020 | |
5021 /* "cpython/contextvars.pxd":118 | |
5022 * """ | |
5023 * cdef PyObject *value = NULL | |
5024 * PyContextVar_Get(var, NULL, &value) # <<<<<<<<<<<<<< | |
5025 * if value is NULL: | |
5026 * # context variable does not have a default | |
5027 */ | |
5028 __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) | |
5029 | |
5030 /* "cpython/contextvars.pxd":119 | |
5031 * cdef PyObject *value = NULL | |
5032 * PyContextVar_Get(var, NULL, &value) | |
5033 * if value is NULL: # <<<<<<<<<<<<<< | |
5034 * # context variable does not have a default | |
5035 * pyvalue = default_value | |
5036 */ | |
5037 __pyx_t_2 = (__pyx_v_value == NULL); | |
5038 if (__pyx_t_2) { | |
5039 | |
5040 /* "cpython/contextvars.pxd":121 | |
5041 * if value is NULL: | |
5042 * # context variable does not have a default | |
5043 * pyvalue = default_value # <<<<<<<<<<<<<< | |
5044 * else: | |
5045 * # value or default value of context variable | |
5046 */ | |
5047 __Pyx_INCREF(__pyx_v_default_value); | |
5048 __pyx_v_pyvalue = __pyx_v_default_value; | |
5049 | |
5050 /* "cpython/contextvars.pxd":119 | |
5051 * cdef PyObject *value = NULL | |
5052 * PyContextVar_Get(var, NULL, &value) | |
5053 * if value is NULL: # <<<<<<<<<<<<<< | |
5054 * # context variable does not have a default | |
5055 * pyvalue = default_value | |
5056 */ | |
5057 goto __pyx_L3; | |
5058 } | |
5059 | |
5060 /* "cpython/contextvars.pxd":124 | |
5061 * else: | |
5062 * # value or default value of context variable | |
5063 * pyvalue = <object>value # <<<<<<<<<<<<<< | |
5064 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' | |
5065 * return pyvalue | |
5066 */ | |
5067 /*else*/ { | |
5068 __pyx_t_3 = ((PyObject *)__pyx_v_value); | |
5069 __Pyx_INCREF(__pyx_t_3); | |
5070 __pyx_v_pyvalue = __pyx_t_3; | |
5071 __pyx_t_3 = 0; | |
5072 | |
5073 /* "cpython/contextvars.pxd":125 | |
5074 * # value or default value of context variable | |
5075 * pyvalue = <object>value | |
5076 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< | |
5077 * return pyvalue | |
5078 * | |
5079 */ | |
5080 Py_XDECREF(__pyx_v_value); | |
5081 } | |
5082 __pyx_L3:; | |
5083 | |
5084 /* "cpython/contextvars.pxd":126 | |
5085 * pyvalue = <object>value | |
5086 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' | |
5087 * return pyvalue # <<<<<<<<<<<<<< | |
5088 * | |
5089 * | |
5090 */ | |
5091 __Pyx_XDECREF(__pyx_r); | |
5092 __Pyx_INCREF(__pyx_v_pyvalue); | |
5093 __pyx_r = __pyx_v_pyvalue; | |
5094 goto __pyx_L0; | |
5095 | |
5096 /* "cpython/contextvars.pxd":112 | |
5097 * | |
5098 * | |
5099 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< | |
5100 * """Return a new reference to the value of the context variable, | |
5101 * or the default value of the context variable, | |
5102 */ | |
5103 | |
5104 /* function exit code */ | |
5105 __pyx_L1_error:; | |
5106 __Pyx_XDECREF(__pyx_t_3); | |
5107 __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
5108 __pyx_r = 0; | |
5109 __pyx_L0:; | |
5110 __Pyx_XDECREF(__pyx_v_pyvalue); | |
5111 __Pyx_XGIVEREF(__pyx_r); | |
5112 __Pyx_RefNannyFinishContext(); | |
5113 return __pyx_r; | |
5114 } | |
5115 | |
5116 /* "cpython/contextvars.pxd":129 | |
5117 * | |
5118 * | |
5119 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< | |
5120 * """Return a new reference to the value of the context variable, | |
5121 * or the provided default value if no such value was found. | |
5122 */ | |
5123 | |
5124 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) { | |
5125 PyObject *__pyx_v_default_value = ((PyObject *)Py_None); | |
5126 PyObject *__pyx_v_value; | |
5127 PyObject *__pyx_v_pyvalue = NULL; | |
5128 PyObject *__pyx_r = NULL; | |
5129 __Pyx_RefNannyDeclarations | |
5130 int __pyx_t_1; | |
5131 PyObject *__pyx_t_2 = NULL; | |
5132 int __pyx_lineno = 0; | |
5133 const char *__pyx_filename = NULL; | |
5134 int __pyx_clineno = 0; | |
5135 __Pyx_RefNannySetupContext("get_value_no_default", 1); | |
5136 if (__pyx_optional_args) { | |
5137 if (__pyx_optional_args->__pyx_n > 0) { | |
5138 __pyx_v_default_value = __pyx_optional_args->default_value; | |
5139 } | |
5140 } | |
5141 | |
5142 /* "cpython/contextvars.pxd":135 | |
5143 * Ignores the default value of the context variable, if any. | |
5144 * """ | |
5145 * cdef PyObject *value = NULL # <<<<<<<<<<<<<< | |
5146 * PyContextVar_Get(var, <PyObject*>default_value, &value) | |
5147 * # value of context variable or 'default_value' | |
5148 */ | |
5149 __pyx_v_value = NULL; | |
5150 | |
5151 /* "cpython/contextvars.pxd":136 | |
5152 * """ | |
5153 * cdef PyObject *value = NULL | |
5154 * PyContextVar_Get(var, <PyObject*>default_value, &value) # <<<<<<<<<<<<<< | |
5155 * # value of context variable or 'default_value' | |
5156 * pyvalue = <object>value | |
5157 */ | |
5158 __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) | |
5159 | |
5160 /* "cpython/contextvars.pxd":138 | |
5161 * PyContextVar_Get(var, <PyObject*>default_value, &value) | |
5162 * # value of context variable or 'default_value' | |
5163 * pyvalue = <object>value # <<<<<<<<<<<<<< | |
5164 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' | |
5165 * return pyvalue | |
5166 */ | |
5167 __pyx_t_2 = ((PyObject *)__pyx_v_value); | |
5168 __Pyx_INCREF(__pyx_t_2); | |
5169 __pyx_v_pyvalue = __pyx_t_2; | |
5170 __pyx_t_2 = 0; | |
5171 | |
5172 /* "cpython/contextvars.pxd":139 | |
5173 * # value of context variable or 'default_value' | |
5174 * pyvalue = <object>value | |
5175 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< | |
5176 * return pyvalue | |
5177 */ | |
5178 Py_XDECREF(__pyx_v_value); | |
5179 | |
5180 /* "cpython/contextvars.pxd":140 | |
5181 * pyvalue = <object>value | |
5182 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' | |
5183 * return pyvalue # <<<<<<<<<<<<<< | |
5184 */ | |
5185 __Pyx_XDECREF(__pyx_r); | |
5186 __Pyx_INCREF(__pyx_v_pyvalue); | |
5187 __pyx_r = __pyx_v_pyvalue; | |
5188 goto __pyx_L0; | |
5189 | |
5190 /* "cpython/contextvars.pxd":129 | |
5191 * | |
5192 * | |
5193 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< | |
5194 * """Return a new reference to the value of the context variable, | |
5195 * or the provided default value if no such value was found. | |
5196 */ | |
5197 | |
5198 /* function exit code */ | |
5199 __pyx_L1_error:; | |
5200 __Pyx_XDECREF(__pyx_t_2); | |
5201 __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
5202 __pyx_r = 0; | |
5203 __pyx_L0:; | |
5204 __Pyx_XDECREF(__pyx_v_pyvalue); | |
5205 __Pyx_XGIVEREF(__pyx_r); | |
5206 __Pyx_RefNannyFinishContext(); | |
5207 return __pyx_r; | |
5208 } | |
5209 | |
5210 /* "array.pxd":104 | |
5211 * __data_union data | |
5212 * | |
5213 * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< | |
5214 * # This implementation of getbuffer is geared towards Cython | |
5215 * # requirements, and does not yet fulfill the PEP. | |
5216 */ | |
5217 | |
5218 /* Python wrapper */ | |
5219 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*/ | |
5220 CYTHON_UNUSED static int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { | |
5221 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
5222 int __pyx_r; | |
5223 __Pyx_RefNannyDeclarations | |
5224 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); | |
5225 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
5226 __pyx_r = __pyx_pf_7cpython_5array_5array___getbuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); | |
5227 | |
5228 /* function exit code */ | |
5229 __Pyx_RefNannyFinishContext(); | |
5230 return __pyx_r; | |
5231 } | |
5232 | |
5233 static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags) { | |
5234 PyObject *__pyx_v_item_count = NULL; | |
5235 int __pyx_r; | |
5236 __Pyx_RefNannyDeclarations | |
5237 PyObject *__pyx_t_1 = NULL; | |
5238 char *__pyx_t_2; | |
5239 int __pyx_t_3; | |
5240 PyObject *__pyx_t_4 = NULL; | |
5241 Py_ssize_t __pyx_t_5; | |
5242 int __pyx_t_6; | |
5243 char __pyx_t_7; | |
5244 int __pyx_lineno = 0; | |
5245 const char *__pyx_filename = NULL; | |
5246 int __pyx_clineno = 0; | |
5247 if (unlikely(__pyx_v_info == NULL)) { | |
5248 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); | |
5249 return -1; | |
5250 } | |
5251 __Pyx_RefNannySetupContext("__getbuffer__", 0); | |
5252 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); | |
5253 __Pyx_GIVEREF(__pyx_v_info->obj); | |
5254 | |
5255 /* "array.pxd":109 | |
5256 * # In particular strided access is always provided regardless | |
5257 * # of flags | |
5258 * item_count = Py_SIZE(self) # <<<<<<<<<<<<<< | |
5259 * | |
5260 * info.suboffsets = NULL | |
5261 */ | |
5262 __pyx_t_1 = PyInt_FromSsize_t(Py_SIZE(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 109, __pyx_L1_error) | |
5263 __Pyx_GOTREF(__pyx_t_1); | |
5264 __pyx_v_item_count = __pyx_t_1; | |
5265 __pyx_t_1 = 0; | |
5266 | |
5267 /* "array.pxd":111 | |
5268 * item_count = Py_SIZE(self) | |
5269 * | |
5270 * info.suboffsets = NULL # <<<<<<<<<<<<<< | |
5271 * info.buf = self.data.as_chars | |
5272 * info.readonly = 0 | |
5273 */ | |
5274 __pyx_v_info->suboffsets = NULL; | |
5275 | |
5276 /* "array.pxd":112 | |
5277 * | |
5278 * info.suboffsets = NULL | |
5279 * info.buf = self.data.as_chars # <<<<<<<<<<<<<< | |
5280 * info.readonly = 0 | |
5281 * info.ndim = 1 | |
5282 */ | |
5283 __pyx_t_2 = __pyx_v_self->data.as_chars; | |
5284 __pyx_v_info->buf = __pyx_t_2; | |
5285 | |
5286 /* "array.pxd":113 | |
5287 * info.suboffsets = NULL | |
5288 * info.buf = self.data.as_chars | |
5289 * info.readonly = 0 # <<<<<<<<<<<<<< | |
5290 * info.ndim = 1 | |
5291 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) | |
5292 */ | |
5293 __pyx_v_info->readonly = 0; | |
5294 | |
5295 /* "array.pxd":114 | |
5296 * info.buf = self.data.as_chars | |
5297 * info.readonly = 0 | |
5298 * info.ndim = 1 # <<<<<<<<<<<<<< | |
5299 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) | |
5300 * info.len = info.itemsize * item_count | |
5301 */ | |
5302 __pyx_v_info->ndim = 1; | |
5303 | |
5304 /* "array.pxd":115 | |
5305 * info.readonly = 0 | |
5306 * info.ndim = 1 | |
5307 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) # <<<<<<<<<<<<<< | |
5308 * info.len = info.itemsize * item_count | |
5309 * | |
5310 */ | |
5311 __pyx_t_3 = __pyx_v_self->ob_descr->itemsize; | |
5312 __pyx_v_info->itemsize = __pyx_t_3; | |
5313 | |
5314 /* "array.pxd":116 | |
5315 * info.ndim = 1 | |
5316 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) | |
5317 * info.len = info.itemsize * item_count # <<<<<<<<<<<<<< | |
5318 * | |
5319 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) | |
5320 */ | |
5321 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_info->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 116, __pyx_L1_error) | |
5322 __Pyx_GOTREF(__pyx_t_1); | |
5323 __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_item_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 116, __pyx_L1_error) | |
5324 __Pyx_GOTREF(__pyx_t_4); | |
5325 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
5326 __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) | |
5327 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
5328 __pyx_v_info->len = __pyx_t_5; | |
5329 | |
5330 /* "array.pxd":118 | |
5331 * info.len = info.itemsize * item_count | |
5332 * | |
5333 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) # <<<<<<<<<<<<<< | |
5334 * if not info.shape: | |
5335 * raise MemoryError() | |
5336 */ | |
5337 __pyx_v_info->shape = ((Py_ssize_t *)PyObject_Malloc(((sizeof(Py_ssize_t)) + 2))); | |
5338 | |
5339 /* "array.pxd":119 | |
5340 * | |
5341 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) | |
5342 * if not info.shape: # <<<<<<<<<<<<<< | |
5343 * raise MemoryError() | |
5344 * info.shape[0] = item_count # constant regardless of resizing | |
5345 */ | |
5346 __pyx_t_6 = (!(__pyx_v_info->shape != 0)); | |
5347 if (unlikely(__pyx_t_6)) { | |
5348 | |
5349 /* "array.pxd":120 | |
5350 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) | |
5351 * if not info.shape: | |
5352 * raise MemoryError() # <<<<<<<<<<<<<< | |
5353 * info.shape[0] = item_count # constant regardless of resizing | |
5354 * info.strides = &info.itemsize | |
5355 */ | |
5356 PyErr_NoMemory(); __PYX_ERR(3, 120, __pyx_L1_error) | |
5357 | |
5358 /* "array.pxd":119 | |
5359 * | |
5360 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) | |
5361 * if not info.shape: # <<<<<<<<<<<<<< | |
5362 * raise MemoryError() | |
5363 * info.shape[0] = item_count # constant regardless of resizing | |
5364 */ | |
5365 } | |
5366 | |
5367 /* "array.pxd":121 | |
5368 * if not info.shape: | |
5369 * raise MemoryError() | |
5370 * info.shape[0] = item_count # constant regardless of resizing # <<<<<<<<<<<<<< | |
5371 * info.strides = &info.itemsize | |
5372 * | |
5373 */ | |
5374 __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) | |
5375 (__pyx_v_info->shape[0]) = __pyx_t_5; | |
5376 | |
5377 /* "array.pxd":122 | |
5378 * raise MemoryError() | |
5379 * info.shape[0] = item_count # constant regardless of resizing | |
5380 * info.strides = &info.itemsize # <<<<<<<<<<<<<< | |
5381 * | |
5382 * info.format = <char*> (info.shape + 1) | |
5383 */ | |
5384 __pyx_v_info->strides = (&__pyx_v_info->itemsize); | |
5385 | |
5386 /* "array.pxd":124 | |
5387 * info.strides = &info.itemsize | |
5388 * | |
5389 * info.format = <char*> (info.shape + 1) # <<<<<<<<<<<<<< | |
5390 * info.format[0] = self.ob_descr.typecode | |
5391 * info.format[1] = 0 | |
5392 */ | |
5393 __pyx_v_info->format = ((char *)(__pyx_v_info->shape + 1)); | |
5394 | |
5395 /* "array.pxd":125 | |
5396 * | |
5397 * info.format = <char*> (info.shape + 1) | |
5398 * info.format[0] = self.ob_descr.typecode # <<<<<<<<<<<<<< | |
5399 * info.format[1] = 0 | |
5400 * info.obj = self | |
5401 */ | |
5402 __pyx_t_7 = __pyx_v_self->ob_descr->typecode; | |
5403 (__pyx_v_info->format[0]) = __pyx_t_7; | |
5404 | |
5405 /* "array.pxd":126 | |
5406 * info.format = <char*> (info.shape + 1) | |
5407 * info.format[0] = self.ob_descr.typecode | |
5408 * info.format[1] = 0 # <<<<<<<<<<<<<< | |
5409 * info.obj = self | |
5410 * | |
5411 */ | |
5412 (__pyx_v_info->format[1]) = 0; | |
5413 | |
5414 /* "array.pxd":127 | |
5415 * info.format[0] = self.ob_descr.typecode | |
5416 * info.format[1] = 0 | |
5417 * info.obj = self # <<<<<<<<<<<<<< | |
5418 * | |
5419 * def __releasebuffer__(self, Py_buffer* info): | |
5420 */ | |
5421 __Pyx_INCREF((PyObject *)__pyx_v_self); | |
5422 __Pyx_GIVEREF((PyObject *)__pyx_v_self); | |
5423 __Pyx_GOTREF(__pyx_v_info->obj); | |
5424 __Pyx_DECREF(__pyx_v_info->obj); | |
5425 __pyx_v_info->obj = ((PyObject *)__pyx_v_self); | |
5426 | |
5427 /* "array.pxd":104 | |
5428 * __data_union data | |
5429 * | |
5430 * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< | |
5431 * # This implementation of getbuffer is geared towards Cython | |
5432 * # requirements, and does not yet fulfill the PEP. | |
5433 */ | |
5434 | |
5435 /* function exit code */ | |
5436 __pyx_r = 0; | |
5437 goto __pyx_L0; | |
5438 __pyx_L1_error:; | |
5439 __Pyx_XDECREF(__pyx_t_1); | |
5440 __Pyx_XDECREF(__pyx_t_4); | |
5441 __Pyx_AddTraceback("cpython.array.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
5442 __pyx_r = -1; | |
5443 if (__pyx_v_info->obj != NULL) { | |
5444 __Pyx_GOTREF(__pyx_v_info->obj); | |
5445 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; | |
5446 } | |
5447 goto __pyx_L2; | |
5448 __pyx_L0:; | |
5449 if (__pyx_v_info->obj == Py_None) { | |
5450 __Pyx_GOTREF(__pyx_v_info->obj); | |
5451 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; | |
5452 } | |
5453 __pyx_L2:; | |
5454 __Pyx_XDECREF(__pyx_v_item_count); | |
5455 __Pyx_RefNannyFinishContext(); | |
5456 return __pyx_r; | |
5457 } | |
5458 | |
5459 /* "array.pxd":129 | |
5460 * info.obj = self | |
5461 * | |
5462 * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<< | |
5463 * PyObject_Free(info.shape) | |
5464 * | |
5465 */ | |
5466 | |
5467 /* Python wrapper */ | |
5468 CYTHON_UNUSED static void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ | |
5469 CYTHON_UNUSED static void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { | |
5470 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
5471 __Pyx_RefNannyDeclarations | |
5472 __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); | |
5473 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
5474 __pyx_pf_7cpython_5array_5array_2__releasebuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); | |
5475 | |
5476 /* function exit code */ | |
5477 __Pyx_RefNannyFinishContext(); | |
5478 } | |
5479 | |
5480 static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info) { | |
5481 | |
5482 /* "array.pxd":130 | |
5483 * | |
5484 * def __releasebuffer__(self, Py_buffer* info): | |
5485 * PyObject_Free(info.shape) # <<<<<<<<<<<<<< | |
5486 * | |
5487 * array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr) | |
5488 */ | |
5489 PyObject_Free(__pyx_v_info->shape); | |
5490 | |
5491 /* "array.pxd":129 | |
5492 * info.obj = self | |
5493 * | |
5494 * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<< | |
5495 * PyObject_Free(info.shape) | |
5496 * | |
5497 */ | |
5498 | |
5499 /* function exit code */ | |
5500 } | |
5501 | |
5502 /* "array.pxd":141 | |
5503 * | |
5504 * | |
5505 * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<< | |
5506 * """ fast creation of a new array, given a template array. | |
5507 * type will be same as template. | |
5508 */ | |
5509 | |
5510 static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) { | |
5511 arrayobject *__pyx_v_op = 0; | |
5512 arrayobject *__pyx_r = NULL; | |
5513 __Pyx_RefNannyDeclarations | |
5514 PyObject *__pyx_t_1 = NULL; | |
5515 int __pyx_t_2; | |
5516 int __pyx_t_3; | |
5517 int __pyx_lineno = 0; | |
5518 const char *__pyx_filename = NULL; | |
5519 int __pyx_clineno = 0; | |
5520 __Pyx_RefNannySetupContext("clone", 1); | |
5521 | |
5522 /* "array.pxd":145 | |
5523 * type will be same as template. | |
5524 * if zero is true, new array will be initialized with zeroes.""" | |
5525 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) # <<<<<<<<<<<<<< | |
5526 * if zero and op is not None: | |
5527 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) | |
5528 */ | |
5529 __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) | |
5530 __Pyx_GOTREF(__pyx_t_1); | |
5531 __pyx_v_op = ((arrayobject *)__pyx_t_1); | |
5532 __pyx_t_1 = 0; | |
5533 | |
5534 /* "array.pxd":146 | |
5535 * if zero is true, new array will be initialized with zeroes.""" | |
5536 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) | |
5537 * if zero and op is not None: # <<<<<<<<<<<<<< | |
5538 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) | |
5539 * return op | |
5540 */ | |
5541 if (__pyx_v_zero) { | |
5542 } else { | |
5543 __pyx_t_2 = __pyx_v_zero; | |
5544 goto __pyx_L4_bool_binop_done; | |
5545 } | |
5546 __pyx_t_3 = (((PyObject *)__pyx_v_op) != Py_None); | |
5547 __pyx_t_2 = __pyx_t_3; | |
5548 __pyx_L4_bool_binop_done:; | |
5549 if (__pyx_t_2) { | |
5550 | |
5551 /* "array.pxd":147 | |
5552 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) | |
5553 * if zero and op is not None: | |
5554 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) # <<<<<<<<<<<<<< | |
5555 * return op | |
5556 * | |
5557 */ | |
5558 (void)(memset(__pyx_v_op->data.as_chars, 0, (__pyx_v_length * __pyx_v_op->ob_descr->itemsize))); | |
5559 | |
5560 /* "array.pxd":146 | |
5561 * if zero is true, new array will be initialized with zeroes.""" | |
5562 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) | |
5563 * if zero and op is not None: # <<<<<<<<<<<<<< | |
5564 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) | |
5565 * return op | |
5566 */ | |
5567 } | |
5568 | |
5569 /* "array.pxd":148 | |
5570 * if zero and op is not None: | |
5571 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) | |
5572 * return op # <<<<<<<<<<<<<< | |
5573 * | |
5574 * cdef inline array copy(array self): | |
5575 */ | |
5576 __Pyx_XDECREF((PyObject *)__pyx_r); | |
5577 __Pyx_INCREF((PyObject *)__pyx_v_op); | |
5578 __pyx_r = __pyx_v_op; | |
5579 goto __pyx_L0; | |
5580 | |
5581 /* "array.pxd":141 | |
5582 * | |
5583 * | |
5584 * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<< | |
5585 * """ fast creation of a new array, given a template array. | |
5586 * type will be same as template. | |
5587 */ | |
5588 | |
5589 /* function exit code */ | |
5590 __pyx_L1_error:; | |
5591 __Pyx_XDECREF(__pyx_t_1); | |
5592 __Pyx_AddTraceback("cpython.array.clone", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
5593 __pyx_r = 0; | |
5594 __pyx_L0:; | |
5595 __Pyx_XDECREF((PyObject *)__pyx_v_op); | |
5596 __Pyx_XGIVEREF((PyObject *)__pyx_r); | |
5597 __Pyx_RefNannyFinishContext(); | |
5598 return __pyx_r; | |
5599 } | |
5600 | |
5601 /* "array.pxd":150 | |
5602 * return op | |
5603 * | |
5604 * cdef inline array copy(array self): # <<<<<<<<<<<<<< | |
5605 * """ make a copy of an array. """ | |
5606 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) | |
5607 */ | |
5608 | |
5609 static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) { | |
5610 arrayobject *__pyx_v_op = 0; | |
5611 arrayobject *__pyx_r = NULL; | |
5612 __Pyx_RefNannyDeclarations | |
5613 PyObject *__pyx_t_1 = NULL; | |
5614 int __pyx_lineno = 0; | |
5615 const char *__pyx_filename = NULL; | |
5616 int __pyx_clineno = 0; | |
5617 __Pyx_RefNannySetupContext("copy", 1); | |
5618 | |
5619 /* "array.pxd":152 | |
5620 * cdef inline array copy(array self): | |
5621 * """ make a copy of an array. """ | |
5622 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) # <<<<<<<<<<<<<< | |
5623 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) | |
5624 * return op | |
5625 */ | |
5626 __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) | |
5627 __Pyx_GOTREF(__pyx_t_1); | |
5628 __pyx_v_op = ((arrayobject *)__pyx_t_1); | |
5629 __pyx_t_1 = 0; | |
5630 | |
5631 /* "array.pxd":153 | |
5632 * """ make a copy of an array. """ | |
5633 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) | |
5634 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) # <<<<<<<<<<<<<< | |
5635 * return op | |
5636 * | |
5637 */ | |
5638 (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))); | |
5639 | |
5640 /* "array.pxd":154 | |
5641 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) | |
5642 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) | |
5643 * return op # <<<<<<<<<<<<<< | |
5644 * | |
5645 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: | |
5646 */ | |
5647 __Pyx_XDECREF((PyObject *)__pyx_r); | |
5648 __Pyx_INCREF((PyObject *)__pyx_v_op); | |
5649 __pyx_r = __pyx_v_op; | |
5650 goto __pyx_L0; | |
5651 | |
5652 /* "array.pxd":150 | |
5653 * return op | |
5654 * | |
5655 * cdef inline array copy(array self): # <<<<<<<<<<<<<< | |
5656 * """ make a copy of an array. """ | |
5657 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) | |
5658 */ | |
5659 | |
5660 /* function exit code */ | |
5661 __pyx_L1_error:; | |
5662 __Pyx_XDECREF(__pyx_t_1); | |
5663 __Pyx_AddTraceback("cpython.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
5664 __pyx_r = 0; | |
5665 __pyx_L0:; | |
5666 __Pyx_XDECREF((PyObject *)__pyx_v_op); | |
5667 __Pyx_XGIVEREF((PyObject *)__pyx_r); | |
5668 __Pyx_RefNannyFinishContext(); | |
5669 return __pyx_r; | |
5670 } | |
5671 | |
5672 /* "array.pxd":156 | |
5673 * return op | |
5674 * | |
5675 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<< | |
5676 * """ efficient appending of new stuff of same type | |
5677 * (e.g. of same array type) | |
5678 */ | |
5679 | |
5680 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) { | |
5681 Py_ssize_t __pyx_v_itemsize; | |
5682 Py_ssize_t __pyx_v_origsize; | |
5683 int __pyx_r; | |
5684 int __pyx_t_1; | |
5685 int __pyx_lineno = 0; | |
5686 const char *__pyx_filename = NULL; | |
5687 int __pyx_clineno = 0; | |
5688 | |
5689 /* "array.pxd":160 | |
5690 * (e.g. of same array type) | |
5691 * n: number of elements (not number of bytes!) """ | |
5692 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize # <<<<<<<<<<<<<< | |
5693 * cdef Py_ssize_t origsize = Py_SIZE(self) | |
5694 * resize_smart(self, origsize + n) | |
5695 */ | |
5696 __pyx_t_1 = __pyx_v_self->ob_descr->itemsize; | |
5697 __pyx_v_itemsize = __pyx_t_1; | |
5698 | |
5699 /* "array.pxd":161 | |
5700 * n: number of elements (not number of bytes!) """ | |
5701 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize | |
5702 * cdef Py_ssize_t origsize = Py_SIZE(self) # <<<<<<<<<<<<<< | |
5703 * resize_smart(self, origsize + n) | |
5704 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) | |
5705 */ | |
5706 __pyx_v_origsize = Py_SIZE(((PyObject *)__pyx_v_self)); | |
5707 | |
5708 /* "array.pxd":162 | |
5709 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize | |
5710 * cdef Py_ssize_t origsize = Py_SIZE(self) | |
5711 * resize_smart(self, origsize + n) # <<<<<<<<<<<<<< | |
5712 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) | |
5713 * return 0 | |
5714 */ | |
5715 __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) | |
5716 | |
5717 /* "array.pxd":163 | |
5718 * cdef Py_ssize_t origsize = Py_SIZE(self) | |
5719 * resize_smart(self, origsize + n) | |
5720 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) # <<<<<<<<<<<<<< | |
5721 * return 0 | |
5722 * | |
5723 */ | |
5724 (void)(memcpy((__pyx_v_self->data.as_chars + (__pyx_v_origsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize))); | |
5725 | |
5726 /* "array.pxd":164 | |
5727 * resize_smart(self, origsize + n) | |
5728 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) | |
5729 * return 0 # <<<<<<<<<<<<<< | |
5730 * | |
5731 * cdef inline int extend(array self, array other) except -1: | |
5732 */ | |
5733 __pyx_r = 0; | |
5734 goto __pyx_L0; | |
5735 | |
5736 /* "array.pxd":156 | |
5737 * return op | |
5738 * | |
5739 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<< | |
5740 * """ efficient appending of new stuff of same type | |
5741 * (e.g. of same array type) | |
5742 */ | |
5743 | |
5744 /* function exit code */ | |
5745 __pyx_L1_error:; | |
5746 __Pyx_AddTraceback("cpython.array.extend_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
5747 __pyx_r = -1; | |
5748 __pyx_L0:; | |
5749 return __pyx_r; | |
5750 } | |
5751 | |
5752 /* "array.pxd":166 | |
5753 * return 0 | |
5754 * | |
5755 * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<< | |
5756 * """ extend array with data from another array; types must match. """ | |
5757 * if self.ob_descr.typecode != other.ob_descr.typecode: | |
5758 */ | |
5759 | |
5760 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) { | |
5761 int __pyx_r; | |
5762 int __pyx_t_1; | |
5763 int __pyx_t_2; | |
5764 int __pyx_lineno = 0; | |
5765 const char *__pyx_filename = NULL; | |
5766 int __pyx_clineno = 0; | |
5767 | |
5768 /* "array.pxd":168 | |
5769 * cdef inline int extend(array self, array other) except -1: | |
5770 * """ extend array with data from another array; types must match. """ | |
5771 * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<< | |
5772 * PyErr_BadArgument() | |
5773 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) | |
5774 */ | |
5775 __pyx_t_1 = (__pyx_v_self->ob_descr->typecode != __pyx_v_other->ob_descr->typecode); | |
5776 if (__pyx_t_1) { | |
5777 | |
5778 /* "array.pxd":169 | |
5779 * """ extend array with data from another array; types must match. """ | |
5780 * if self.ob_descr.typecode != other.ob_descr.typecode: | |
5781 * PyErr_BadArgument() # <<<<<<<<<<<<<< | |
5782 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) | |
5783 * | |
5784 */ | |
5785 __pyx_t_2 = PyErr_BadArgument(); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(3, 169, __pyx_L1_error) | |
5786 | |
5787 /* "array.pxd":168 | |
5788 * cdef inline int extend(array self, array other) except -1: | |
5789 * """ extend array with data from another array; types must match. """ | |
5790 * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<< | |
5791 * PyErr_BadArgument() | |
5792 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) | |
5793 */ | |
5794 } | |
5795 | |
5796 /* "array.pxd":170 | |
5797 * if self.ob_descr.typecode != other.ob_descr.typecode: | |
5798 * PyErr_BadArgument() | |
5799 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) # <<<<<<<<<<<<<< | |
5800 * | |
5801 * cdef inline void zero(array self) noexcept: | |
5802 */ | |
5803 __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) | |
5804 __pyx_r = __pyx_t_2; | |
5805 goto __pyx_L0; | |
5806 | |
5807 /* "array.pxd":166 | |
5808 * return 0 | |
5809 * | |
5810 * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<< | |
5811 * """ extend array with data from another array; types must match. """ | |
5812 * if self.ob_descr.typecode != other.ob_descr.typecode: | |
5813 */ | |
5814 | |
5815 /* function exit code */ | |
5816 __pyx_L1_error:; | |
5817 __Pyx_AddTraceback("cpython.array.extend", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
5818 __pyx_r = -1; | |
5819 __pyx_L0:; | |
5820 return __pyx_r; | |
5821 } | |
5822 | |
5823 /* "array.pxd":172 | |
5824 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) | |
5825 * | |
5826 * cdef inline void zero(array self) noexcept: # <<<<<<<<<<<<<< | |
5827 * """ set all elements of array to zero. """ | |
5828 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) | |
5829 */ | |
5830 | |
5831 static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) { | |
5832 | |
5833 /* "array.pxd":174 | |
5834 * cdef inline void zero(array self) noexcept: | |
5835 * """ set all elements of array to zero. """ | |
5836 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) # <<<<<<<<<<<<<< | |
5837 */ | |
5838 (void)(memset(__pyx_v_self->data.as_chars, 0, (Py_SIZE(((PyObject *)__pyx_v_self)) * __pyx_v_self->ob_descr->itemsize))); | |
5839 | |
5840 /* "array.pxd":172 | |
5841 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) | |
5842 * | |
5843 * cdef inline void zero(array self) noexcept: # <<<<<<<<<<<<<< | |
5844 * """ set all elements of array to zero. """ | |
5845 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) | |
5846 */ | |
5847 | |
5848 /* function exit code */ | |
5849 } | |
5850 | |
5851 /* "pysam/libcfaidx.pyx":74 | |
5852 * | |
5853 * cdef class FastqProxy | |
5854 * cdef makeFastqProxy(kseq_t * src): # <<<<<<<<<<<<<< | |
5855 * '''enter src into AlignedRead.''' | |
5856 * cdef FastqProxy dest = FastqProxy.__new__(FastqProxy) | |
5857 */ | |
5858 | |
5859 static PyObject *__pyx_f_5pysam_9libcfaidx_makeFastqProxy(kseq_t *__pyx_v_src) { | |
5860 struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_dest = 0; | |
5861 PyObject *__pyx_r = NULL; | |
5862 __Pyx_TraceDeclarations | |
5863 __Pyx_RefNannyDeclarations | |
5864 PyObject *__pyx_t_1 = NULL; | |
5865 int __pyx_lineno = 0; | |
5866 const char *__pyx_filename = NULL; | |
5867 int __pyx_clineno = 0; | |
5868 __Pyx_RefNannySetupContext("makeFastqProxy", 1); | |
5869 __Pyx_TraceCall("makeFastqProxy", __pyx_f[0], 74, 0, __PYX_ERR(0, 74, __pyx_L1_error)); | |
5870 | |
5871 /* "pysam/libcfaidx.pyx":76 | |
5872 * cdef makeFastqProxy(kseq_t * src): | |
5873 * '''enter src into AlignedRead.''' | |
5874 * cdef FastqProxy dest = FastqProxy.__new__(FastqProxy) # <<<<<<<<<<<<<< | |
5875 * dest._delegate = src | |
5876 * return dest | |
5877 */ | |
5878 __pyx_t_1 = ((PyObject *)__pyx_tp_new_5pysam_9libcfaidx_FastqProxy(((PyTypeObject *)__pyx_ptype_5pysam_9libcfaidx_FastqProxy), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) | |
5879 __Pyx_GOTREF((PyObject *)__pyx_t_1); | |
5880 __pyx_v_dest = ((struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *)__pyx_t_1); | |
5881 __pyx_t_1 = 0; | |
5882 | |
5883 /* "pysam/libcfaidx.pyx":77 | |
5884 * '''enter src into AlignedRead.''' | |
5885 * cdef FastqProxy dest = FastqProxy.__new__(FastqProxy) | |
5886 * dest._delegate = src # <<<<<<<<<<<<<< | |
5887 * return dest | |
5888 * | |
5889 */ | |
5890 __pyx_v_dest->_delegate = __pyx_v_src; | |
5891 | |
5892 /* "pysam/libcfaidx.pyx":78 | |
5893 * cdef FastqProxy dest = FastqProxy.__new__(FastqProxy) | |
5894 * dest._delegate = src | |
5895 * return dest # <<<<<<<<<<<<<< | |
5896 * | |
5897 * ## TODO: | |
5898 */ | |
5899 __Pyx_XDECREF(__pyx_r); | |
5900 __Pyx_INCREF((PyObject *)__pyx_v_dest); | |
5901 __pyx_r = ((PyObject *)__pyx_v_dest); | |
5902 goto __pyx_L0; | |
5903 | |
5904 /* "pysam/libcfaidx.pyx":74 | |
5905 * | |
5906 * cdef class FastqProxy | |
5907 * cdef makeFastqProxy(kseq_t * src): # <<<<<<<<<<<<<< | |
5908 * '''enter src into AlignedRead.''' | |
5909 * cdef FastqProxy dest = FastqProxy.__new__(FastqProxy) | |
5910 */ | |
5911 | |
5912 /* function exit code */ | |
5913 __pyx_L1_error:; | |
5914 __Pyx_XDECREF(__pyx_t_1); | |
5915 __Pyx_AddTraceback("pysam.libcfaidx.makeFastqProxy", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
5916 __pyx_r = 0; | |
5917 __pyx_L0:; | |
5918 __Pyx_XDECREF((PyObject *)__pyx_v_dest); | |
5919 __Pyx_XGIVEREF(__pyx_r); | |
5920 __Pyx_TraceReturn(__pyx_r, 0); | |
5921 __Pyx_RefNannyFinishContext(); | |
5922 return __pyx_r; | |
5923 } | |
5924 | |
5925 /* "pysam/libcfaidx.pyx":115 | |
5926 * """ | |
5927 * | |
5928 * def __cinit__(self, *args, **kwargs): # <<<<<<<<<<<<<< | |
5929 * self.fastafile = NULL | |
5930 * self._filename = None | |
5931 */ | |
5932 | |
5933 /* Python wrapper */ | |
5934 static int __pyx_pw_5pysam_9libcfaidx_9FastaFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
5935 static int __pyx_pw_5pysam_9libcfaidx_9FastaFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
5936 PyObject *__pyx_v_args = 0; | |
5937 PyObject *__pyx_v_kwargs = 0; | |
5938 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
5939 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
5940 int __pyx_r; | |
5941 __Pyx_RefNannyDeclarations | |
5942 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); | |
5943 #if CYTHON_ASSUME_SAFE_MACROS | |
5944 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
5945 #else | |
5946 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; | |
5947 #endif | |
5948 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
5949 if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1; | |
5950 if (unlikely(__pyx_kwds)) { | |
5951 __pyx_v_kwargs = __Pyx_KwargsAsDict_VARARGS(__pyx_kwds, __pyx_kwvalues); | |
5952 if (unlikely(!__pyx_v_kwargs)) return -1; | |
5953 __Pyx_GOTREF(__pyx_v_kwargs); | |
5954 } else { | |
5955 __pyx_v_kwargs = PyDict_New(); | |
5956 if (unlikely(!__pyx_v_kwargs)) return -1; | |
5957 __Pyx_GOTREF(__pyx_v_kwargs); | |
5958 } | |
5959 __Pyx_INCREF(__pyx_args); | |
5960 __pyx_v_args = __pyx_args; | |
5961 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile___cinit__(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); | |
5962 | |
5963 /* function exit code */ | |
5964 __Pyx_DECREF(__pyx_v_args); | |
5965 __Pyx_DECREF(__pyx_v_kwargs); | |
5966 __Pyx_RefNannyFinishContext(); | |
5967 return __pyx_r; | |
5968 } | |
5969 | |
5970 static int __pyx_pf_5pysam_9libcfaidx_9FastaFile___cinit__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { | |
5971 int __pyx_r; | |
5972 __Pyx_TraceDeclarations | |
5973 __Pyx_RefNannyDeclarations | |
5974 PyObject *__pyx_t_1 = NULL; | |
5975 PyObject *__pyx_t_2 = NULL; | |
5976 PyObject *__pyx_t_3 = NULL; | |
5977 int __pyx_lineno = 0; | |
5978 const char *__pyx_filename = NULL; | |
5979 int __pyx_clineno = 0; | |
5980 __Pyx_RefNannySetupContext("__cinit__", 1); | |
5981 __Pyx_TraceCall("__cinit__", __pyx_f[0], 115, 0, __PYX_ERR(0, 115, __pyx_L1_error)); | |
5982 | |
5983 /* "pysam/libcfaidx.pyx":116 | |
5984 * | |
5985 * def __cinit__(self, *args, **kwargs): | |
5986 * self.fastafile = NULL # <<<<<<<<<<<<<< | |
5987 * self._filename = None | |
5988 * self._references = None | |
5989 */ | |
5990 __pyx_v_self->fastafile = NULL; | |
5991 | |
5992 /* "pysam/libcfaidx.pyx":117 | |
5993 * def __cinit__(self, *args, **kwargs): | |
5994 * self.fastafile = NULL | |
5995 * self._filename = None # <<<<<<<<<<<<<< | |
5996 * self._references = None | |
5997 * self._lengths = None | |
5998 */ | |
5999 __Pyx_INCREF(Py_None); | |
6000 __Pyx_GIVEREF(Py_None); | |
6001 __Pyx_GOTREF(__pyx_v_self->_filename); | |
6002 __Pyx_DECREF(__pyx_v_self->_filename); | |
6003 __pyx_v_self->_filename = Py_None; | |
6004 | |
6005 /* "pysam/libcfaidx.pyx":118 | |
6006 * self.fastafile = NULL | |
6007 * self._filename = None | |
6008 * self._references = None # <<<<<<<<<<<<<< | |
6009 * self._lengths = None | |
6010 * self.reference2length = None | |
6011 */ | |
6012 __Pyx_INCREF(Py_None); | |
6013 __Pyx_GIVEREF(Py_None); | |
6014 __Pyx_GOTREF(__pyx_v_self->_references); | |
6015 __Pyx_DECREF(__pyx_v_self->_references); | |
6016 __pyx_v_self->_references = Py_None; | |
6017 | |
6018 /* "pysam/libcfaidx.pyx":119 | |
6019 * self._filename = None | |
6020 * self._references = None | |
6021 * self._lengths = None # <<<<<<<<<<<<<< | |
6022 * self.reference2length = None | |
6023 * self._open(*args, **kwargs) | |
6024 */ | |
6025 __Pyx_INCREF(Py_None); | |
6026 __Pyx_GIVEREF(Py_None); | |
6027 __Pyx_GOTREF(__pyx_v_self->_lengths); | |
6028 __Pyx_DECREF(__pyx_v_self->_lengths); | |
6029 __pyx_v_self->_lengths = Py_None; | |
6030 | |
6031 /* "pysam/libcfaidx.pyx":120 | |
6032 * self._references = None | |
6033 * self._lengths = None | |
6034 * self.reference2length = None # <<<<<<<<<<<<<< | |
6035 * self._open(*args, **kwargs) | |
6036 * | |
6037 */ | |
6038 __Pyx_INCREF(Py_None); | |
6039 __Pyx_GIVEREF(Py_None); | |
6040 __Pyx_GOTREF(__pyx_v_self->reference2length); | |
6041 __Pyx_DECREF(__pyx_v_self->reference2length); | |
6042 __pyx_v_self->reference2length = Py_None; | |
6043 | |
6044 /* "pysam/libcfaidx.pyx":121 | |
6045 * self._lengths = None | |
6046 * self.reference2length = None | |
6047 * self._open(*args, **kwargs) # <<<<<<<<<<<<<< | |
6048 * | |
6049 * def is_open(self): | |
6050 */ | |
6051 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) | |
6052 __Pyx_GOTREF(__pyx_t_1); | |
6053 __pyx_t_2 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) | |
6054 __Pyx_GOTREF(__pyx_t_2); | |
6055 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error) | |
6056 __Pyx_GOTREF(__pyx_t_3); | |
6057 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
6058 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
6059 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
6060 | |
6061 /* "pysam/libcfaidx.pyx":115 | |
6062 * """ | |
6063 * | |
6064 * def __cinit__(self, *args, **kwargs): # <<<<<<<<<<<<<< | |
6065 * self.fastafile = NULL | |
6066 * self._filename = None | |
6067 */ | |
6068 | |
6069 /* function exit code */ | |
6070 __pyx_r = 0; | |
6071 goto __pyx_L0; | |
6072 __pyx_L1_error:; | |
6073 __Pyx_XDECREF(__pyx_t_1); | |
6074 __Pyx_XDECREF(__pyx_t_2); | |
6075 __Pyx_XDECREF(__pyx_t_3); | |
6076 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
6077 __pyx_r = -1; | |
6078 __pyx_L0:; | |
6079 __Pyx_TraceReturn(Py_None, 0); | |
6080 __Pyx_RefNannyFinishContext(); | |
6081 return __pyx_r; | |
6082 } | |
6083 | |
6084 /* "pysam/libcfaidx.pyx":123 | |
6085 * self._open(*args, **kwargs) | |
6086 * | |
6087 * def is_open(self): # <<<<<<<<<<<<<< | |
6088 * '''return true if samfile has been opened.''' | |
6089 * return self.fastafile != NULL | |
6090 */ | |
6091 | |
6092 /* Python wrapper */ | |
6093 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_3is_open(PyObject *__pyx_v_self, | |
6094 #if CYTHON_METH_FASTCALL | |
6095 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
6096 #else | |
6097 PyObject *__pyx_args, PyObject *__pyx_kwds | |
6098 #endif | |
6099 ); /*proto*/ | |
6100 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastaFile_2is_open, "FastaFile.is_open(self)\nreturn true if samfile has been opened."); | |
6101 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastaFile_3is_open = {"is_open", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_3is_open, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_2is_open}; | |
6102 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_3is_open(PyObject *__pyx_v_self, | |
6103 #if CYTHON_METH_FASTCALL | |
6104 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
6105 #else | |
6106 PyObject *__pyx_args, PyObject *__pyx_kwds | |
6107 #endif | |
6108 ) { | |
6109 #if !CYTHON_METH_FASTCALL | |
6110 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
6111 #endif | |
6112 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
6113 PyObject *__pyx_r = 0; | |
6114 __Pyx_RefNannyDeclarations | |
6115 __Pyx_RefNannySetupContext("is_open (wrapper)", 0); | |
6116 #if !CYTHON_METH_FASTCALL | |
6117 #if CYTHON_ASSUME_SAFE_MACROS | |
6118 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
6119 #else | |
6120 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
6121 #endif | |
6122 #endif | |
6123 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
6124 if (unlikely(__pyx_nargs > 0)) { | |
6125 __Pyx_RaiseArgtupleInvalid("is_open", 1, 0, 0, __pyx_nargs); return NULL;} | |
6126 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_open", 0))) return NULL; | |
6127 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_2is_open(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self)); | |
6128 | |
6129 /* function exit code */ | |
6130 __Pyx_RefNannyFinishContext(); | |
6131 return __pyx_r; | |
6132 } | |
6133 | |
6134 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_2is_open(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self) { | |
6135 PyObject *__pyx_r = NULL; | |
6136 __Pyx_TraceDeclarations | |
6137 __Pyx_RefNannyDeclarations | |
6138 PyObject *__pyx_t_1 = NULL; | |
6139 int __pyx_lineno = 0; | |
6140 const char *__pyx_filename = NULL; | |
6141 int __pyx_clineno = 0; | |
6142 __Pyx_TraceFrameInit(__pyx_codeobj_) | |
6143 __Pyx_RefNannySetupContext("is_open", 1); | |
6144 __Pyx_TraceCall("is_open", __pyx_f[0], 123, 0, __PYX_ERR(0, 123, __pyx_L1_error)); | |
6145 | |
6146 /* "pysam/libcfaidx.pyx":125 | |
6147 * def is_open(self): | |
6148 * '''return true if samfile has been opened.''' | |
6149 * return self.fastafile != NULL # <<<<<<<<<<<<<< | |
6150 * | |
6151 * def __len__(self): | |
6152 */ | |
6153 __Pyx_XDECREF(__pyx_r); | |
6154 __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->fastafile != NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) | |
6155 __Pyx_GOTREF(__pyx_t_1); | |
6156 __pyx_r = __pyx_t_1; | |
6157 __pyx_t_1 = 0; | |
6158 goto __pyx_L0; | |
6159 | |
6160 /* "pysam/libcfaidx.pyx":123 | |
6161 * self._open(*args, **kwargs) | |
6162 * | |
6163 * def is_open(self): # <<<<<<<<<<<<<< | |
6164 * '''return true if samfile has been opened.''' | |
6165 * return self.fastafile != NULL | |
6166 */ | |
6167 | |
6168 /* function exit code */ | |
6169 __pyx_L1_error:; | |
6170 __Pyx_XDECREF(__pyx_t_1); | |
6171 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.is_open", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
6172 __pyx_r = NULL; | |
6173 __pyx_L0:; | |
6174 __Pyx_XGIVEREF(__pyx_r); | |
6175 __Pyx_TraceReturn(__pyx_r, 0); | |
6176 __Pyx_RefNannyFinishContext(); | |
6177 return __pyx_r; | |
6178 } | |
6179 | |
6180 /* "pysam/libcfaidx.pyx":127 | |
6181 * return self.fastafile != NULL | |
6182 * | |
6183 * def __len__(self): # <<<<<<<<<<<<<< | |
6184 * if self.fastafile == NULL: | |
6185 * raise ValueError("calling len() on closed file") | |
6186 */ | |
6187 | |
6188 /* Python wrapper */ | |
6189 static Py_ssize_t __pyx_pw_5pysam_9libcfaidx_9FastaFile_5__len__(PyObject *__pyx_v_self); /*proto*/ | |
6190 static Py_ssize_t __pyx_pw_5pysam_9libcfaidx_9FastaFile_5__len__(PyObject *__pyx_v_self) { | |
6191 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
6192 Py_ssize_t __pyx_r; | |
6193 __Pyx_RefNannyDeclarations | |
6194 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); | |
6195 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
6196 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_4__len__(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self)); | |
6197 | |
6198 /* function exit code */ | |
6199 __Pyx_RefNannyFinishContext(); | |
6200 return __pyx_r; | |
6201 } | |
6202 | |
6203 static Py_ssize_t __pyx_pf_5pysam_9libcfaidx_9FastaFile_4__len__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self) { | |
6204 Py_ssize_t __pyx_r; | |
6205 __Pyx_TraceDeclarations | |
6206 __Pyx_RefNannyDeclarations | |
6207 int __pyx_t_1; | |
6208 PyObject *__pyx_t_2 = NULL; | |
6209 int __pyx_lineno = 0; | |
6210 const char *__pyx_filename = NULL; | |
6211 int __pyx_clineno = 0; | |
6212 __Pyx_RefNannySetupContext("__len__", 1); | |
6213 __Pyx_TraceCall("__len__", __pyx_f[0], 127, 0, __PYX_ERR(0, 127, __pyx_L1_error)); | |
6214 | |
6215 /* "pysam/libcfaidx.pyx":128 | |
6216 * | |
6217 * def __len__(self): | |
6218 * if self.fastafile == NULL: # <<<<<<<<<<<<<< | |
6219 * raise ValueError("calling len() on closed file") | |
6220 * | |
6221 */ | |
6222 __pyx_t_1 = (__pyx_v_self->fastafile == NULL); | |
6223 if (unlikely(__pyx_t_1)) { | |
6224 | |
6225 /* "pysam/libcfaidx.pyx":129 | |
6226 * def __len__(self): | |
6227 * if self.fastafile == NULL: | |
6228 * raise ValueError("calling len() on closed file") # <<<<<<<<<<<<<< | |
6229 * | |
6230 * return faidx_nseq(self.fastafile) | |
6231 */ | |
6232 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) | |
6233 __Pyx_GOTREF(__pyx_t_2); | |
6234 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
6235 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
6236 __PYX_ERR(0, 129, __pyx_L1_error) | |
6237 | |
6238 /* "pysam/libcfaidx.pyx":128 | |
6239 * | |
6240 * def __len__(self): | |
6241 * if self.fastafile == NULL: # <<<<<<<<<<<<<< | |
6242 * raise ValueError("calling len() on closed file") | |
6243 * | |
6244 */ | |
6245 } | |
6246 | |
6247 /* "pysam/libcfaidx.pyx":131 | |
6248 * raise ValueError("calling len() on closed file") | |
6249 * | |
6250 * return faidx_nseq(self.fastafile) # <<<<<<<<<<<<<< | |
6251 * | |
6252 * def _open(self, filename, filepath_index=None, filepath_index_compressed=None): | |
6253 */ | |
6254 __pyx_r = faidx_nseq(__pyx_v_self->fastafile); | |
6255 goto __pyx_L0; | |
6256 | |
6257 /* "pysam/libcfaidx.pyx":127 | |
6258 * return self.fastafile != NULL | |
6259 * | |
6260 * def __len__(self): # <<<<<<<<<<<<<< | |
6261 * if self.fastafile == NULL: | |
6262 * raise ValueError("calling len() on closed file") | |
6263 */ | |
6264 | |
6265 /* function exit code */ | |
6266 __pyx_L1_error:; | |
6267 __Pyx_XDECREF(__pyx_t_2); | |
6268 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
6269 __pyx_r = -1; | |
6270 __pyx_L0:; | |
6271 __Pyx_TraceReturn(Py_None, 0); | |
6272 __Pyx_RefNannyFinishContext(); | |
6273 return __pyx_r; | |
6274 } | |
6275 | |
6276 /* "pysam/libcfaidx.pyx":133 | |
6277 * return faidx_nseq(self.fastafile) | |
6278 * | |
6279 * def _open(self, filename, filepath_index=None, filepath_index_compressed=None): # <<<<<<<<<<<<<< | |
6280 * '''open an indexed fasta file. | |
6281 * | |
6282 */ | |
6283 | |
6284 /* Python wrapper */ | |
6285 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_7_open(PyObject *__pyx_v_self, | |
6286 #if CYTHON_METH_FASTCALL | |
6287 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
6288 #else | |
6289 PyObject *__pyx_args, PyObject *__pyx_kwds | |
6290 #endif | |
6291 ); /*proto*/ | |
6292 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastaFile_6_open, "FastaFile._open(self, filename, filepath_index=None, filepath_index_compressed=None)\nopen an indexed fasta file.\n\n This method expects an indexed fasta file.\n "); | |
6293 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastaFile_7_open = {"_open", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_7_open, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_6_open}; | |
6294 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_7_open(PyObject *__pyx_v_self, | |
6295 #if CYTHON_METH_FASTCALL | |
6296 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
6297 #else | |
6298 PyObject *__pyx_args, PyObject *__pyx_kwds | |
6299 #endif | |
6300 ) { | |
6301 PyObject *__pyx_v_filename = 0; | |
6302 PyObject *__pyx_v_filepath_index = 0; | |
6303 PyObject *__pyx_v_filepath_index_compressed = 0; | |
6304 #if !CYTHON_METH_FASTCALL | |
6305 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
6306 #endif | |
6307 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
6308 PyObject* values[3] = {0,0,0}; | |
6309 int __pyx_lineno = 0; | |
6310 const char *__pyx_filename = NULL; | |
6311 int __pyx_clineno = 0; | |
6312 PyObject *__pyx_r = 0; | |
6313 __Pyx_RefNannyDeclarations | |
6314 __Pyx_RefNannySetupContext("_open (wrapper)", 0); | |
6315 #if !CYTHON_METH_FASTCALL | |
6316 #if CYTHON_ASSUME_SAFE_MACROS | |
6317 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
6318 #else | |
6319 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
6320 #endif | |
6321 #endif | |
6322 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
6323 { | |
6324 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_filepath_index,&__pyx_n_s_filepath_index_compressed,0}; | |
6325 values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
6326 values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
6327 if (__pyx_kwds) { | |
6328 Py_ssize_t kw_args; | |
6329 switch (__pyx_nargs) { | |
6330 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
6331 CYTHON_FALLTHROUGH; | |
6332 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
6333 CYTHON_FALLTHROUGH; | |
6334 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
6335 CYTHON_FALLTHROUGH; | |
6336 case 0: break; | |
6337 default: goto __pyx_L5_argtuple_error; | |
6338 } | |
6339 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
6340 switch (__pyx_nargs) { | |
6341 case 0: | |
6342 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) { | |
6343 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
6344 kw_args--; | |
6345 } | |
6346 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) | |
6347 else goto __pyx_L5_argtuple_error; | |
6348 CYTHON_FALLTHROUGH; | |
6349 case 1: | |
6350 if (kw_args > 0) { | |
6351 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filepath_index); | |
6352 if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
6353 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) | |
6354 } | |
6355 CYTHON_FALLTHROUGH; | |
6356 case 2: | |
6357 if (kw_args > 0) { | |
6358 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filepath_index_compressed); | |
6359 if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
6360 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L3_error) | |
6361 } | |
6362 } | |
6363 if (unlikely(kw_args > 0)) { | |
6364 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
6365 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_open") < 0)) __PYX_ERR(0, 133, __pyx_L3_error) | |
6366 } | |
6367 } else { | |
6368 switch (__pyx_nargs) { | |
6369 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
6370 CYTHON_FALLTHROUGH; | |
6371 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
6372 CYTHON_FALLTHROUGH; | |
6373 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
6374 break; | |
6375 default: goto __pyx_L5_argtuple_error; | |
6376 } | |
6377 } | |
6378 __pyx_v_filename = values[0]; | |
6379 __pyx_v_filepath_index = values[1]; | |
6380 __pyx_v_filepath_index_compressed = values[2]; | |
6381 } | |
6382 goto __pyx_L6_skip; | |
6383 __pyx_L5_argtuple_error:; | |
6384 __Pyx_RaiseArgtupleInvalid("_open", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 133, __pyx_L3_error) | |
6385 __pyx_L6_skip:; | |
6386 goto __pyx_L4_argument_unpacking_done; | |
6387 __pyx_L3_error:; | |
6388 { | |
6389 Py_ssize_t __pyx_temp; | |
6390 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
6391 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
6392 } | |
6393 } | |
6394 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
6395 __Pyx_RefNannyFinishContext(); | |
6396 return NULL; | |
6397 __pyx_L4_argument_unpacking_done:; | |
6398 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_6_open(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self), __pyx_v_filename, __pyx_v_filepath_index, __pyx_v_filepath_index_compressed); | |
6399 | |
6400 /* function exit code */ | |
6401 { | |
6402 Py_ssize_t __pyx_temp; | |
6403 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
6404 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
6405 } | |
6406 } | |
6407 __Pyx_RefNannyFinishContext(); | |
6408 return __pyx_r; | |
6409 } | |
6410 | |
6411 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_6_open(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_filepath_index, PyObject *__pyx_v_filepath_index_compressed) { | |
6412 char *__pyx_v_cfilename; | |
6413 char *__pyx_v_cindexname; | |
6414 char *__pyx_v_cindexname_compressed; | |
6415 CYTHON_UNUSED PyObject *__pyx_v_bindex_filename = NULL; | |
6416 CYTHON_UNUSED PyObject *__pyx_v_bindex_filename_compressed = NULL; | |
6417 int __pyx_v_nreferences; | |
6418 int __pyx_v_x; | |
6419 char const *__pyx_v_s; | |
6420 PyObject *__pyx_v_ss = NULL; | |
6421 PyObject *__pyx_r = NULL; | |
6422 __Pyx_TraceDeclarations | |
6423 __Pyx_RefNannyDeclarations | |
6424 int __pyx_t_1; | |
6425 PyObject *__pyx_t_2 = NULL; | |
6426 PyObject *__pyx_t_3 = NULL; | |
6427 PyObject *__pyx_t_4 = NULL; | |
6428 unsigned int __pyx_t_5; | |
6429 char *__pyx_t_6; | |
6430 int __pyx_t_7; | |
6431 int __pyx_t_8; | |
6432 int __pyx_t_9; | |
6433 int __pyx_t_10; | |
6434 int __pyx_lineno = 0; | |
6435 const char *__pyx_filename = NULL; | |
6436 int __pyx_clineno = 0; | |
6437 __Pyx_TraceFrameInit(__pyx_codeobj__3) | |
6438 __Pyx_RefNannySetupContext("_open", 1); | |
6439 __Pyx_TraceCall("_open", __pyx_f[0], 133, 0, __PYX_ERR(0, 133, __pyx_L1_error)); | |
6440 | |
6441 /* "pysam/libcfaidx.pyx":140 | |
6442 * | |
6443 * # close a previously opened file | |
6444 * if self.fastafile != NULL: # <<<<<<<<<<<<<< | |
6445 * self.close() | |
6446 * | |
6447 */ | |
6448 __pyx_t_1 = (__pyx_v_self->fastafile != NULL); | |
6449 if (__pyx_t_1) { | |
6450 | |
6451 /* "pysam/libcfaidx.pyx":141 | |
6452 * # close a previously opened file | |
6453 * if self.fastafile != NULL: | |
6454 * self.close() # <<<<<<<<<<<<<< | |
6455 * | |
6456 * self._filename = encode_filename(filename) | |
6457 */ | |
6458 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) | |
6459 __Pyx_GOTREF(__pyx_t_3); | |
6460 __pyx_t_4 = NULL; | |
6461 __pyx_t_5 = 0; | |
6462 #if CYTHON_UNPACK_METHODS | |
6463 if (likely(PyMethod_Check(__pyx_t_3))) { | |
6464 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
6465 if (likely(__pyx_t_4)) { | |
6466 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
6467 __Pyx_INCREF(__pyx_t_4); | |
6468 __Pyx_INCREF(function); | |
6469 __Pyx_DECREF_SET(__pyx_t_3, function); | |
6470 __pyx_t_5 = 1; | |
6471 } | |
6472 } | |
6473 #endif | |
6474 { | |
6475 PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; | |
6476 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); | |
6477 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
6478 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) | |
6479 __Pyx_GOTREF(__pyx_t_2); | |
6480 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
6481 } | |
6482 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
6483 | |
6484 /* "pysam/libcfaidx.pyx":140 | |
6485 * | |
6486 * # close a previously opened file | |
6487 * if self.fastafile != NULL: # <<<<<<<<<<<<<< | |
6488 * self.close() | |
6489 * | |
6490 */ | |
6491 } | |
6492 | |
6493 /* "pysam/libcfaidx.pyx":143 | |
6494 * self.close() | |
6495 * | |
6496 * self._filename = encode_filename(filename) # <<<<<<<<<<<<<< | |
6497 * cdef char *cfilename = self._filename | |
6498 * cdef char *cindexname = NULL | |
6499 */ | |
6500 __pyx_t_2 = __pyx_f_5pysam_9libcutils_encode_filename(__pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) | |
6501 __Pyx_GOTREF(__pyx_t_2); | |
6502 __Pyx_GIVEREF(__pyx_t_2); | |
6503 __Pyx_GOTREF(__pyx_v_self->_filename); | |
6504 __Pyx_DECREF(__pyx_v_self->_filename); | |
6505 __pyx_v_self->_filename = __pyx_t_2; | |
6506 __pyx_t_2 = 0; | |
6507 | |
6508 /* "pysam/libcfaidx.pyx":144 | |
6509 * | |
6510 * self._filename = encode_filename(filename) | |
6511 * cdef char *cfilename = self._filename # <<<<<<<<<<<<<< | |
6512 * cdef char *cindexname = NULL | |
6513 * cdef char *cindexname_compressed = NULL | |
6514 */ | |
6515 __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_filename); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L1_error) | |
6516 __pyx_v_cfilename = __pyx_t_6; | |
6517 | |
6518 /* "pysam/libcfaidx.pyx":145 | |
6519 * self._filename = encode_filename(filename) | |
6520 * cdef char *cfilename = self._filename | |
6521 * cdef char *cindexname = NULL # <<<<<<<<<<<<<< | |
6522 * cdef char *cindexname_compressed = NULL | |
6523 * self.is_remote = hisremote(cfilename) | |
6524 */ | |
6525 __pyx_v_cindexname = NULL; | |
6526 | |
6527 /* "pysam/libcfaidx.pyx":146 | |
6528 * cdef char *cfilename = self._filename | |
6529 * cdef char *cindexname = NULL | |
6530 * cdef char *cindexname_compressed = NULL # <<<<<<<<<<<<<< | |
6531 * self.is_remote = hisremote(cfilename) | |
6532 * | |
6533 */ | |
6534 __pyx_v_cindexname_compressed = NULL; | |
6535 | |
6536 /* "pysam/libcfaidx.pyx":147 | |
6537 * cdef char *cindexname = NULL | |
6538 * cdef char *cindexname_compressed = NULL | |
6539 * self.is_remote = hisremote(cfilename) # <<<<<<<<<<<<<< | |
6540 * | |
6541 * # open file for reading | |
6542 */ | |
6543 __pyx_v_self->is_remote = hisremote(__pyx_v_cfilename); | |
6544 | |
6545 /* "pysam/libcfaidx.pyx":150 | |
6546 * | |
6547 * # open file for reading | |
6548 * if (self._filename != b"-" # <<<<<<<<<<<<<< | |
6549 * and not self.is_remote | |
6550 * and not os.path.exists(filename)): | |
6551 */ | |
6552 __pyx_t_7 = (__Pyx_PyBytes_Equals(__pyx_v_self->_filename, __pyx_kp_b__4, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 150, __pyx_L1_error) | |
6553 if (__pyx_t_7) { | |
6554 } else { | |
6555 __pyx_t_1 = __pyx_t_7; | |
6556 goto __pyx_L5_bool_binop_done; | |
6557 } | |
6558 | |
6559 /* "pysam/libcfaidx.pyx":151 | |
6560 * # open file for reading | |
6561 * if (self._filename != b"-" | |
6562 * and not self.is_remote # <<<<<<<<<<<<<< | |
6563 * and not os.path.exists(filename)): | |
6564 * raise IOError("file `%s` not found" % filename) | |
6565 */ | |
6566 __pyx_t_7 = (!__pyx_v_self->is_remote); | |
6567 if (__pyx_t_7) { | |
6568 } else { | |
6569 __pyx_t_1 = __pyx_t_7; | |
6570 goto __pyx_L5_bool_binop_done; | |
6571 } | |
6572 | |
6573 /* "pysam/libcfaidx.pyx":152 | |
6574 * if (self._filename != b"-" | |
6575 * and not self.is_remote | |
6576 * and not os.path.exists(filename)): # <<<<<<<<<<<<<< | |
6577 * raise IOError("file `%s` not found" % filename) | |
6578 * | |
6579 */ | |
6580 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error) | |
6581 __Pyx_GOTREF(__pyx_t_3); | |
6582 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error) | |
6583 __Pyx_GOTREF(__pyx_t_4); | |
6584 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
6585 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error) | |
6586 __Pyx_GOTREF(__pyx_t_3); | |
6587 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
6588 __pyx_t_4 = NULL; | |
6589 __pyx_t_5 = 0; | |
6590 #if CYTHON_UNPACK_METHODS | |
6591 if (likely(PyMethod_Check(__pyx_t_3))) { | |
6592 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
6593 if (likely(__pyx_t_4)) { | |
6594 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
6595 __Pyx_INCREF(__pyx_t_4); | |
6596 __Pyx_INCREF(function); | |
6597 __Pyx_DECREF_SET(__pyx_t_3, function); | |
6598 __pyx_t_5 = 1; | |
6599 } | |
6600 } | |
6601 #endif | |
6602 { | |
6603 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_filename}; | |
6604 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
6605 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
6606 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) | |
6607 __Pyx_GOTREF(__pyx_t_2); | |
6608 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
6609 } | |
6610 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 152, __pyx_L1_error) | |
6611 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
6612 __pyx_t_8 = (!__pyx_t_7); | |
6613 __pyx_t_1 = __pyx_t_8; | |
6614 __pyx_L5_bool_binop_done:; | |
6615 | |
6616 /* "pysam/libcfaidx.pyx":150 | |
6617 * | |
6618 * # open file for reading | |
6619 * if (self._filename != b"-" # <<<<<<<<<<<<<< | |
6620 * and not self.is_remote | |
6621 * and not os.path.exists(filename)): | |
6622 */ | |
6623 if (unlikely(__pyx_t_1)) { | |
6624 | |
6625 /* "pysam/libcfaidx.pyx":153 | |
6626 * and not self.is_remote | |
6627 * and not os.path.exists(filename)): | |
6628 * raise IOError("file `%s` not found" % filename) # <<<<<<<<<<<<<< | |
6629 * | |
6630 * # 3 modes to open: | |
6631 */ | |
6632 __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_file_s_not_found, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) | |
6633 __Pyx_GOTREF(__pyx_t_2); | |
6634 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error) | |
6635 __Pyx_GOTREF(__pyx_t_3); | |
6636 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
6637 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
6638 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
6639 __PYX_ERR(0, 153, __pyx_L1_error) | |
6640 | |
6641 /* "pysam/libcfaidx.pyx":150 | |
6642 * | |
6643 * # open file for reading | |
6644 * if (self._filename != b"-" # <<<<<<<<<<<<<< | |
6645 * and not self.is_remote | |
6646 * and not os.path.exists(filename)): | |
6647 */ | |
6648 } | |
6649 | |
6650 /* "pysam/libcfaidx.pyx":159 | |
6651 * # uncompressed fa: fai_load3 with filename and index_fai | |
6652 * # uncompressed fa: fai_load with default index name | |
6653 * if filepath_index: # <<<<<<<<<<<<<< | |
6654 * # when opening, set flags to 0 - do not automatically | |
6655 * # build index if it does not exist. | |
6656 */ | |
6657 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_filepath_index); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 159, __pyx_L1_error) | |
6658 if (__pyx_t_1) { | |
6659 | |
6660 /* "pysam/libcfaidx.pyx":163 | |
6661 * # build index if it does not exist. | |
6662 * | |
6663 * if not os.path.exists(filepath_index): # <<<<<<<<<<<<<< | |
6664 * raise IOError("filename {} does not exist".format(filepath_index)) | |
6665 * cindexname = bindex_filename = encode_filename(filepath_index) | |
6666 */ | |
6667 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) | |
6668 __Pyx_GOTREF(__pyx_t_2); | |
6669 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) | |
6670 __Pyx_GOTREF(__pyx_t_4); | |
6671 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
6672 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) | |
6673 __Pyx_GOTREF(__pyx_t_2); | |
6674 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
6675 __pyx_t_4 = NULL; | |
6676 __pyx_t_5 = 0; | |
6677 #if CYTHON_UNPACK_METHODS | |
6678 if (likely(PyMethod_Check(__pyx_t_2))) { | |
6679 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); | |
6680 if (likely(__pyx_t_4)) { | |
6681 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
6682 __Pyx_INCREF(__pyx_t_4); | |
6683 __Pyx_INCREF(function); | |
6684 __Pyx_DECREF_SET(__pyx_t_2, function); | |
6685 __pyx_t_5 = 1; | |
6686 } | |
6687 } | |
6688 #endif | |
6689 { | |
6690 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_filepath_index}; | |
6691 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
6692 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
6693 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) | |
6694 __Pyx_GOTREF(__pyx_t_3); | |
6695 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
6696 } | |
6697 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 163, __pyx_L1_error) | |
6698 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
6699 __pyx_t_8 = (!__pyx_t_1); | |
6700 if (unlikely(__pyx_t_8)) { | |
6701 | |
6702 /* "pysam/libcfaidx.pyx":164 | |
6703 * | |
6704 * if not os.path.exists(filepath_index): | |
6705 * raise IOError("filename {} does not exist".format(filepath_index)) # <<<<<<<<<<<<<< | |
6706 * cindexname = bindex_filename = encode_filename(filepath_index) | |
6707 * | |
6708 */ | |
6709 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_filename_does_not_exist, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) | |
6710 __Pyx_GOTREF(__pyx_t_2); | |
6711 __pyx_t_4 = NULL; | |
6712 __pyx_t_5 = 0; | |
6713 #if CYTHON_UNPACK_METHODS | |
6714 if (likely(PyMethod_Check(__pyx_t_2))) { | |
6715 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); | |
6716 if (likely(__pyx_t_4)) { | |
6717 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
6718 __Pyx_INCREF(__pyx_t_4); | |
6719 __Pyx_INCREF(function); | |
6720 __Pyx_DECREF_SET(__pyx_t_2, function); | |
6721 __pyx_t_5 = 1; | |
6722 } | |
6723 } | |
6724 #endif | |
6725 { | |
6726 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_filepath_index}; | |
6727 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
6728 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
6729 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) | |
6730 __Pyx_GOTREF(__pyx_t_3); | |
6731 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
6732 } | |
6733 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) | |
6734 __Pyx_GOTREF(__pyx_t_2); | |
6735 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
6736 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
6737 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
6738 __PYX_ERR(0, 164, __pyx_L1_error) | |
6739 | |
6740 /* "pysam/libcfaidx.pyx":163 | |
6741 * # build index if it does not exist. | |
6742 * | |
6743 * if not os.path.exists(filepath_index): # <<<<<<<<<<<<<< | |
6744 * raise IOError("filename {} does not exist".format(filepath_index)) | |
6745 * cindexname = bindex_filename = encode_filename(filepath_index) | |
6746 */ | |
6747 } | |
6748 | |
6749 /* "pysam/libcfaidx.pyx":165 | |
6750 * if not os.path.exists(filepath_index): | |
6751 * raise IOError("filename {} does not exist".format(filepath_index)) | |
6752 * cindexname = bindex_filename = encode_filename(filepath_index) # <<<<<<<<<<<<<< | |
6753 * | |
6754 * if filepath_index_compressed: | |
6755 */ | |
6756 __pyx_t_2 = __pyx_f_5pysam_9libcutils_encode_filename(__pyx_v_filepath_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) | |
6757 __Pyx_GOTREF(__pyx_t_2); | |
6758 if (unlikely(__pyx_t_2 == Py_None)) { | |
6759 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); | |
6760 __PYX_ERR(0, 165, __pyx_L1_error) | |
6761 } | |
6762 __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_t_2); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error) | |
6763 __pyx_v_cindexname = __pyx_t_6; | |
6764 __Pyx_INCREF(__pyx_t_2); | |
6765 __pyx_v_bindex_filename = ((PyObject*)__pyx_t_2); | |
6766 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
6767 | |
6768 /* "pysam/libcfaidx.pyx":167 | |
6769 * cindexname = bindex_filename = encode_filename(filepath_index) | |
6770 * | |
6771 * if filepath_index_compressed: # <<<<<<<<<<<<<< | |
6772 * if not os.path.exists(filepath_index_compressed): | |
6773 * raise IOError("filename {} does not exist".format(filepath_index_compressed)) | |
6774 */ | |
6775 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_filepath_index_compressed); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 167, __pyx_L1_error) | |
6776 if (__pyx_t_8) { | |
6777 | |
6778 /* "pysam/libcfaidx.pyx":168 | |
6779 * | |
6780 * if filepath_index_compressed: | |
6781 * if not os.path.exists(filepath_index_compressed): # <<<<<<<<<<<<<< | |
6782 * raise IOError("filename {} does not exist".format(filepath_index_compressed)) | |
6783 * cindexname_compressed = bindex_filename_compressed = encode_filename(filepath_index_compressed) | |
6784 */ | |
6785 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error) | |
6786 __Pyx_GOTREF(__pyx_t_3); | |
6787 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error) | |
6788 __Pyx_GOTREF(__pyx_t_4); | |
6789 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
6790 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error) | |
6791 __Pyx_GOTREF(__pyx_t_3); | |
6792 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
6793 __pyx_t_4 = NULL; | |
6794 __pyx_t_5 = 0; | |
6795 #if CYTHON_UNPACK_METHODS | |
6796 if (likely(PyMethod_Check(__pyx_t_3))) { | |
6797 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
6798 if (likely(__pyx_t_4)) { | |
6799 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
6800 __Pyx_INCREF(__pyx_t_4); | |
6801 __Pyx_INCREF(function); | |
6802 __Pyx_DECREF_SET(__pyx_t_3, function); | |
6803 __pyx_t_5 = 1; | |
6804 } | |
6805 } | |
6806 #endif | |
6807 { | |
6808 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_filepath_index_compressed}; | |
6809 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
6810 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
6811 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) | |
6812 __Pyx_GOTREF(__pyx_t_2); | |
6813 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
6814 } | |
6815 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 168, __pyx_L1_error) | |
6816 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
6817 __pyx_t_1 = (!__pyx_t_8); | |
6818 if (unlikely(__pyx_t_1)) { | |
6819 | |
6820 /* "pysam/libcfaidx.pyx":169 | |
6821 * if filepath_index_compressed: | |
6822 * if not os.path.exists(filepath_index_compressed): | |
6823 * raise IOError("filename {} does not exist".format(filepath_index_compressed)) # <<<<<<<<<<<<<< | |
6824 * cindexname_compressed = bindex_filename_compressed = encode_filename(filepath_index_compressed) | |
6825 * with nogil: | |
6826 */ | |
6827 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_filename_does_not_exist, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) | |
6828 __Pyx_GOTREF(__pyx_t_3); | |
6829 __pyx_t_4 = NULL; | |
6830 __pyx_t_5 = 0; | |
6831 #if CYTHON_UNPACK_METHODS | |
6832 if (likely(PyMethod_Check(__pyx_t_3))) { | |
6833 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
6834 if (likely(__pyx_t_4)) { | |
6835 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
6836 __Pyx_INCREF(__pyx_t_4); | |
6837 __Pyx_INCREF(function); | |
6838 __Pyx_DECREF_SET(__pyx_t_3, function); | |
6839 __pyx_t_5 = 1; | |
6840 } | |
6841 } | |
6842 #endif | |
6843 { | |
6844 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_filepath_index_compressed}; | |
6845 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
6846 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
6847 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) | |
6848 __Pyx_GOTREF(__pyx_t_2); | |
6849 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
6850 } | |
6851 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) | |
6852 __Pyx_GOTREF(__pyx_t_3); | |
6853 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
6854 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
6855 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
6856 __PYX_ERR(0, 169, __pyx_L1_error) | |
6857 | |
6858 /* "pysam/libcfaidx.pyx":168 | |
6859 * | |
6860 * if filepath_index_compressed: | |
6861 * if not os.path.exists(filepath_index_compressed): # <<<<<<<<<<<<<< | |
6862 * raise IOError("filename {} does not exist".format(filepath_index_compressed)) | |
6863 * cindexname_compressed = bindex_filename_compressed = encode_filename(filepath_index_compressed) | |
6864 */ | |
6865 } | |
6866 | |
6867 /* "pysam/libcfaidx.pyx":170 | |
6868 * if not os.path.exists(filepath_index_compressed): | |
6869 * raise IOError("filename {} does not exist".format(filepath_index_compressed)) | |
6870 * cindexname_compressed = bindex_filename_compressed = encode_filename(filepath_index_compressed) # <<<<<<<<<<<<<< | |
6871 * with nogil: | |
6872 * self.fastafile = fai_load3(cfilename, cindexname, cindexname_compressed, 0) | |
6873 */ | |
6874 __pyx_t_3 = __pyx_f_5pysam_9libcutils_encode_filename(__pyx_v_filepath_index_compressed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error) | |
6875 __Pyx_GOTREF(__pyx_t_3); | |
6876 if (unlikely(__pyx_t_3 == Py_None)) { | |
6877 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); | |
6878 __PYX_ERR(0, 170, __pyx_L1_error) | |
6879 } | |
6880 __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_t_3); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L1_error) | |
6881 __pyx_v_cindexname_compressed = __pyx_t_6; | |
6882 __Pyx_INCREF(__pyx_t_3); | |
6883 __pyx_v_bindex_filename_compressed = ((PyObject*)__pyx_t_3); | |
6884 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
6885 | |
6886 /* "pysam/libcfaidx.pyx":171 | |
6887 * raise IOError("filename {} does not exist".format(filepath_index_compressed)) | |
6888 * cindexname_compressed = bindex_filename_compressed = encode_filename(filepath_index_compressed) | |
6889 * with nogil: # <<<<<<<<<<<<<< | |
6890 * self.fastafile = fai_load3(cfilename, cindexname, cindexname_compressed, 0) | |
6891 * else: | |
6892 */ | |
6893 { | |
6894 #ifdef WITH_THREAD | |
6895 PyThreadState *_save; | |
6896 _save = NULL; | |
6897 Py_UNBLOCK_THREADS | |
6898 __Pyx_FastGIL_Remember(); | |
6899 #endif | |
6900 /*try:*/ { | |
6901 | |
6902 /* "pysam/libcfaidx.pyx":172 | |
6903 * cindexname_compressed = bindex_filename_compressed = encode_filename(filepath_index_compressed) | |
6904 * with nogil: | |
6905 * self.fastafile = fai_load3(cfilename, cindexname, cindexname_compressed, 0) # <<<<<<<<<<<<<< | |
6906 * else: | |
6907 * with nogil: | |
6908 */ | |
6909 __pyx_v_self->fastafile = fai_load3(__pyx_v_cfilename, __pyx_v_cindexname, __pyx_v_cindexname_compressed, 0); | |
6910 } | |
6911 | |
6912 /* "pysam/libcfaidx.pyx":171 | |
6913 * raise IOError("filename {} does not exist".format(filepath_index_compressed)) | |
6914 * cindexname_compressed = bindex_filename_compressed = encode_filename(filepath_index_compressed) | |
6915 * with nogil: # <<<<<<<<<<<<<< | |
6916 * self.fastafile = fai_load3(cfilename, cindexname, cindexname_compressed, 0) | |
6917 * else: | |
6918 */ | |
6919 /*finally:*/ { | |
6920 /*normal exit:*/{ | |
6921 #ifdef WITH_THREAD | |
6922 __Pyx_FastGIL_Forget(); | |
6923 Py_BLOCK_THREADS | |
6924 #endif | |
6925 goto __pyx_L14; | |
6926 } | |
6927 __pyx_L14:; | |
6928 } | |
6929 } | |
6930 | |
6931 /* "pysam/libcfaidx.pyx":167 | |
6932 * cindexname = bindex_filename = encode_filename(filepath_index) | |
6933 * | |
6934 * if filepath_index_compressed: # <<<<<<<<<<<<<< | |
6935 * if not os.path.exists(filepath_index_compressed): | |
6936 * raise IOError("filename {} does not exist".format(filepath_index_compressed)) | |
6937 */ | |
6938 goto __pyx_L10; | |
6939 } | |
6940 | |
6941 /* "pysam/libcfaidx.pyx":174 | |
6942 * self.fastafile = fai_load3(cfilename, cindexname, cindexname_compressed, 0) | |
6943 * else: | |
6944 * with nogil: # <<<<<<<<<<<<<< | |
6945 * self.fastafile = fai_load3(cfilename, cindexname, NULL, 0) | |
6946 * else: | |
6947 */ | |
6948 /*else*/ { | |
6949 { | |
6950 #ifdef WITH_THREAD | |
6951 PyThreadState *_save; | |
6952 _save = NULL; | |
6953 Py_UNBLOCK_THREADS | |
6954 __Pyx_FastGIL_Remember(); | |
6955 #endif | |
6956 /*try:*/ { | |
6957 | |
6958 /* "pysam/libcfaidx.pyx":175 | |
6959 * else: | |
6960 * with nogil: | |
6961 * self.fastafile = fai_load3(cfilename, cindexname, NULL, 0) # <<<<<<<<<<<<<< | |
6962 * else: | |
6963 * with nogil: | |
6964 */ | |
6965 __pyx_v_self->fastafile = fai_load3(__pyx_v_cfilename, __pyx_v_cindexname, NULL, 0); | |
6966 } | |
6967 | |
6968 /* "pysam/libcfaidx.pyx":174 | |
6969 * self.fastafile = fai_load3(cfilename, cindexname, cindexname_compressed, 0) | |
6970 * else: | |
6971 * with nogil: # <<<<<<<<<<<<<< | |
6972 * self.fastafile = fai_load3(cfilename, cindexname, NULL, 0) | |
6973 * else: | |
6974 */ | |
6975 /*finally:*/ { | |
6976 /*normal exit:*/{ | |
6977 #ifdef WITH_THREAD | |
6978 __Pyx_FastGIL_Forget(); | |
6979 Py_BLOCK_THREADS | |
6980 #endif | |
6981 goto __pyx_L17; | |
6982 } | |
6983 __pyx_L17:; | |
6984 } | |
6985 } | |
6986 } | |
6987 __pyx_L10:; | |
6988 | |
6989 /* "pysam/libcfaidx.pyx":159 | |
6990 * # uncompressed fa: fai_load3 with filename and index_fai | |
6991 * # uncompressed fa: fai_load with default index name | |
6992 * if filepath_index: # <<<<<<<<<<<<<< | |
6993 * # when opening, set flags to 0 - do not automatically | |
6994 * # build index if it does not exist. | |
6995 */ | |
6996 goto __pyx_L8; | |
6997 } | |
6998 | |
6999 /* "pysam/libcfaidx.pyx":177 | |
7000 * self.fastafile = fai_load3(cfilename, cindexname, NULL, 0) | |
7001 * else: | |
7002 * with nogil: # <<<<<<<<<<<<<< | |
7003 * self.fastafile = fai_load(cfilename) | |
7004 * | |
7005 */ | |
7006 /*else*/ { | |
7007 { | |
7008 #ifdef WITH_THREAD | |
7009 PyThreadState *_save; | |
7010 _save = NULL; | |
7011 Py_UNBLOCK_THREADS | |
7012 __Pyx_FastGIL_Remember(); | |
7013 #endif | |
7014 /*try:*/ { | |
7015 | |
7016 /* "pysam/libcfaidx.pyx":178 | |
7017 * else: | |
7018 * with nogil: | |
7019 * self.fastafile = fai_load(cfilename) # <<<<<<<<<<<<<< | |
7020 * | |
7021 * if self.fastafile == NULL: | |
7022 */ | |
7023 __pyx_v_self->fastafile = fai_load(__pyx_v_cfilename); | |
7024 } | |
7025 | |
7026 /* "pysam/libcfaidx.pyx":177 | |
7027 * self.fastafile = fai_load3(cfilename, cindexname, NULL, 0) | |
7028 * else: | |
7029 * with nogil: # <<<<<<<<<<<<<< | |
7030 * self.fastafile = fai_load(cfilename) | |
7031 * | |
7032 */ | |
7033 /*finally:*/ { | |
7034 /*normal exit:*/{ | |
7035 #ifdef WITH_THREAD | |
7036 __Pyx_FastGIL_Forget(); | |
7037 Py_BLOCK_THREADS | |
7038 #endif | |
7039 goto __pyx_L20; | |
7040 } | |
7041 __pyx_L20:; | |
7042 } | |
7043 } | |
7044 } | |
7045 __pyx_L8:; | |
7046 | |
7047 /* "pysam/libcfaidx.pyx":180 | |
7048 * self.fastafile = fai_load(cfilename) | |
7049 * | |
7050 * if self.fastafile == NULL: # <<<<<<<<<<<<<< | |
7051 * raise IOError("error when opening file `%s`" % filename) | |
7052 * | |
7053 */ | |
7054 __pyx_t_1 = (__pyx_v_self->fastafile == NULL); | |
7055 if (unlikely(__pyx_t_1)) { | |
7056 | |
7057 /* "pysam/libcfaidx.pyx":181 | |
7058 * | |
7059 * if self.fastafile == NULL: | |
7060 * raise IOError("error when opening file `%s`" % filename) # <<<<<<<<<<<<<< | |
7061 * | |
7062 * cdef int nreferences = faidx_nseq(self.fastafile) | |
7063 */ | |
7064 __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_error_when_opening_file_s, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) | |
7065 __Pyx_GOTREF(__pyx_t_3); | |
7066 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) | |
7067 __Pyx_GOTREF(__pyx_t_2); | |
7068 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
7069 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
7070 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
7071 __PYX_ERR(0, 181, __pyx_L1_error) | |
7072 | |
7073 /* "pysam/libcfaidx.pyx":180 | |
7074 * self.fastafile = fai_load(cfilename) | |
7075 * | |
7076 * if self.fastafile == NULL: # <<<<<<<<<<<<<< | |
7077 * raise IOError("error when opening file `%s`" % filename) | |
7078 * | |
7079 */ | |
7080 } | |
7081 | |
7082 /* "pysam/libcfaidx.pyx":183 | |
7083 * raise IOError("error when opening file `%s`" % filename) | |
7084 * | |
7085 * cdef int nreferences = faidx_nseq(self.fastafile) # <<<<<<<<<<<<<< | |
7086 * cdef int x | |
7087 * cdef const char * s | |
7088 */ | |
7089 __pyx_v_nreferences = faidx_nseq(__pyx_v_self->fastafile); | |
7090 | |
7091 /* "pysam/libcfaidx.pyx":186 | |
7092 * cdef int x | |
7093 * cdef const char * s | |
7094 * self._references = [] # <<<<<<<<<<<<<< | |
7095 * self._lengths = [] | |
7096 * for x from 0 <= x < nreferences: | |
7097 */ | |
7098 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) | |
7099 __Pyx_GOTREF(__pyx_t_2); | |
7100 __Pyx_GIVEREF(__pyx_t_2); | |
7101 __Pyx_GOTREF(__pyx_v_self->_references); | |
7102 __Pyx_DECREF(__pyx_v_self->_references); | |
7103 __pyx_v_self->_references = __pyx_t_2; | |
7104 __pyx_t_2 = 0; | |
7105 | |
7106 /* "pysam/libcfaidx.pyx":187 | |
7107 * cdef const char * s | |
7108 * self._references = [] | |
7109 * self._lengths = [] # <<<<<<<<<<<<<< | |
7110 * for x from 0 <= x < nreferences: | |
7111 * s = faidx_iseq(self.fastafile, x) | |
7112 */ | |
7113 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) | |
7114 __Pyx_GOTREF(__pyx_t_2); | |
7115 __Pyx_GIVEREF(__pyx_t_2); | |
7116 __Pyx_GOTREF(__pyx_v_self->_lengths); | |
7117 __Pyx_DECREF(__pyx_v_self->_lengths); | |
7118 __pyx_v_self->_lengths = __pyx_t_2; | |
7119 __pyx_t_2 = 0; | |
7120 | |
7121 /* "pysam/libcfaidx.pyx":188 | |
7122 * self._references = [] | |
7123 * self._lengths = [] | |
7124 * for x from 0 <= x < nreferences: # <<<<<<<<<<<<<< | |
7125 * s = faidx_iseq(self.fastafile, x) | |
7126 * ss = force_str(s) | |
7127 */ | |
7128 __pyx_t_9 = __pyx_v_nreferences; | |
7129 for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_9; __pyx_v_x++) { | |
7130 | |
7131 /* "pysam/libcfaidx.pyx":189 | |
7132 * self._lengths = [] | |
7133 * for x from 0 <= x < nreferences: | |
7134 * s = faidx_iseq(self.fastafile, x) # <<<<<<<<<<<<<< | |
7135 * ss = force_str(s) | |
7136 * self._references.append(ss) | |
7137 */ | |
7138 __pyx_v_s = faidx_iseq(__pyx_v_self->fastafile, __pyx_v_x); | |
7139 | |
7140 /* "pysam/libcfaidx.pyx":190 | |
7141 * for x from 0 <= x < nreferences: | |
7142 * s = faidx_iseq(self.fastafile, x) | |
7143 * ss = force_str(s) # <<<<<<<<<<<<<< | |
7144 * self._references.append(ss) | |
7145 * self._lengths.append(faidx_seq_len(self.fastafile, s)) | |
7146 */ | |
7147 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) | |
7148 __Pyx_GOTREF(__pyx_t_2); | |
7149 __pyx_t_3 = __pyx_f_5pysam_9libcutils_force_str(__pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) | |
7150 __Pyx_GOTREF(__pyx_t_3); | |
7151 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
7152 __Pyx_XDECREF_SET(__pyx_v_ss, __pyx_t_3); | |
7153 __pyx_t_3 = 0; | |
7154 | |
7155 /* "pysam/libcfaidx.pyx":191 | |
7156 * s = faidx_iseq(self.fastafile, x) | |
7157 * ss = force_str(s) | |
7158 * self._references.append(ss) # <<<<<<<<<<<<<< | |
7159 * self._lengths.append(faidx_seq_len(self.fastafile, s)) | |
7160 * self.reference2length = dict(zip(self._references, self._lengths)) | |
7161 */ | |
7162 __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_self->_references, __pyx_v_ss); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 191, __pyx_L1_error) | |
7163 | |
7164 /* "pysam/libcfaidx.pyx":192 | |
7165 * ss = force_str(s) | |
7166 * self._references.append(ss) | |
7167 * self._lengths.append(faidx_seq_len(self.fastafile, s)) # <<<<<<<<<<<<<< | |
7168 * self.reference2length = dict(zip(self._references, self._lengths)) | |
7169 * | |
7170 */ | |
7171 __pyx_t_3 = __Pyx_PyInt_From_int(faidx_seq_len(__pyx_v_self->fastafile, __pyx_v_s)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error) | |
7172 __Pyx_GOTREF(__pyx_t_3); | |
7173 __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_self->_lengths, __pyx_t_3); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 192, __pyx_L1_error) | |
7174 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
7175 } | |
7176 | |
7177 /* "pysam/libcfaidx.pyx":193 | |
7178 * self._references.append(ss) | |
7179 * self._lengths.append(faidx_seq_len(self.fastafile, s)) | |
7180 * self.reference2length = dict(zip(self._references, self._lengths)) # <<<<<<<<<<<<<< | |
7181 * | |
7182 * def close(self): | |
7183 */ | |
7184 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) | |
7185 __Pyx_GOTREF(__pyx_t_3); | |
7186 __Pyx_INCREF(__pyx_v_self->_references); | |
7187 __Pyx_GIVEREF(__pyx_v_self->_references); | |
7188 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->_references)) __PYX_ERR(0, 193, __pyx_L1_error); | |
7189 __Pyx_INCREF(__pyx_v_self->_lengths); | |
7190 __Pyx_GIVEREF(__pyx_v_self->_lengths); | |
7191 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->_lengths)) __PYX_ERR(0, 193, __pyx_L1_error); | |
7192 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) | |
7193 __Pyx_GOTREF(__pyx_t_2); | |
7194 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
7195 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) | |
7196 __Pyx_GOTREF(__pyx_t_3); | |
7197 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
7198 __Pyx_GIVEREF(__pyx_t_3); | |
7199 __Pyx_GOTREF(__pyx_v_self->reference2length); | |
7200 __Pyx_DECREF(__pyx_v_self->reference2length); | |
7201 __pyx_v_self->reference2length = __pyx_t_3; | |
7202 __pyx_t_3 = 0; | |
7203 | |
7204 /* "pysam/libcfaidx.pyx":133 | |
7205 * return faidx_nseq(self.fastafile) | |
7206 * | |
7207 * def _open(self, filename, filepath_index=None, filepath_index_compressed=None): # <<<<<<<<<<<<<< | |
7208 * '''open an indexed fasta file. | |
7209 * | |
7210 */ | |
7211 | |
7212 /* function exit code */ | |
7213 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
7214 goto __pyx_L0; | |
7215 __pyx_L1_error:; | |
7216 __Pyx_XDECREF(__pyx_t_2); | |
7217 __Pyx_XDECREF(__pyx_t_3); | |
7218 __Pyx_XDECREF(__pyx_t_4); | |
7219 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7220 __pyx_r = NULL; | |
7221 __pyx_L0:; | |
7222 __Pyx_XDECREF(__pyx_v_bindex_filename); | |
7223 __Pyx_XDECREF(__pyx_v_bindex_filename_compressed); | |
7224 __Pyx_XDECREF(__pyx_v_ss); | |
7225 __Pyx_XGIVEREF(__pyx_r); | |
7226 __Pyx_TraceReturn(__pyx_r, 0); | |
7227 __Pyx_RefNannyFinishContext(); | |
7228 return __pyx_r; | |
7229 } | |
7230 | |
7231 /* "pysam/libcfaidx.pyx":195 | |
7232 * self.reference2length = dict(zip(self._references, self._lengths)) | |
7233 * | |
7234 * def close(self): # <<<<<<<<<<<<<< | |
7235 * """close the file.""" | |
7236 * if self.fastafile != NULL: | |
7237 */ | |
7238 | |
7239 /* Python wrapper */ | |
7240 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_9close(PyObject *__pyx_v_self, | |
7241 #if CYTHON_METH_FASTCALL | |
7242 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
7243 #else | |
7244 PyObject *__pyx_args, PyObject *__pyx_kwds | |
7245 #endif | |
7246 ); /*proto*/ | |
7247 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastaFile_8close, "FastaFile.close(self)\nclose the file."); | |
7248 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastaFile_9close = {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_9close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_8close}; | |
7249 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_9close(PyObject *__pyx_v_self, | |
7250 #if CYTHON_METH_FASTCALL | |
7251 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
7252 #else | |
7253 PyObject *__pyx_args, PyObject *__pyx_kwds | |
7254 #endif | |
7255 ) { | |
7256 #if !CYTHON_METH_FASTCALL | |
7257 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
7258 #endif | |
7259 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
7260 PyObject *__pyx_r = 0; | |
7261 __Pyx_RefNannyDeclarations | |
7262 __Pyx_RefNannySetupContext("close (wrapper)", 0); | |
7263 #if !CYTHON_METH_FASTCALL | |
7264 #if CYTHON_ASSUME_SAFE_MACROS | |
7265 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
7266 #else | |
7267 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
7268 #endif | |
7269 #endif | |
7270 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
7271 if (unlikely(__pyx_nargs > 0)) { | |
7272 __Pyx_RaiseArgtupleInvalid("close", 1, 0, 0, __pyx_nargs); return NULL;} | |
7273 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "close", 0))) return NULL; | |
7274 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_8close(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self)); | |
7275 | |
7276 /* function exit code */ | |
7277 __Pyx_RefNannyFinishContext(); | |
7278 return __pyx_r; | |
7279 } | |
7280 | |
7281 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_8close(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self) { | |
7282 PyObject *__pyx_r = NULL; | |
7283 __Pyx_TraceDeclarations | |
7284 __Pyx_RefNannyDeclarations | |
7285 int __pyx_t_1; | |
7286 int __pyx_lineno = 0; | |
7287 const char *__pyx_filename = NULL; | |
7288 int __pyx_clineno = 0; | |
7289 __Pyx_TraceFrameInit(__pyx_codeobj__5) | |
7290 __Pyx_RefNannySetupContext("close", 1); | |
7291 __Pyx_TraceCall("close", __pyx_f[0], 195, 0, __PYX_ERR(0, 195, __pyx_L1_error)); | |
7292 | |
7293 /* "pysam/libcfaidx.pyx":197 | |
7294 * def close(self): | |
7295 * """close the file.""" | |
7296 * if self.fastafile != NULL: # <<<<<<<<<<<<<< | |
7297 * fai_destroy(self.fastafile) | |
7298 * self.fastafile = NULL | |
7299 */ | |
7300 __pyx_t_1 = (__pyx_v_self->fastafile != NULL); | |
7301 if (__pyx_t_1) { | |
7302 | |
7303 /* "pysam/libcfaidx.pyx":198 | |
7304 * """close the file.""" | |
7305 * if self.fastafile != NULL: | |
7306 * fai_destroy(self.fastafile) # <<<<<<<<<<<<<< | |
7307 * self.fastafile = NULL | |
7308 * | |
7309 */ | |
7310 fai_destroy(__pyx_v_self->fastafile); | |
7311 | |
7312 /* "pysam/libcfaidx.pyx":199 | |
7313 * if self.fastafile != NULL: | |
7314 * fai_destroy(self.fastafile) | |
7315 * self.fastafile = NULL # <<<<<<<<<<<<<< | |
7316 * | |
7317 * def __dealloc__(self): | |
7318 */ | |
7319 __pyx_v_self->fastafile = NULL; | |
7320 | |
7321 /* "pysam/libcfaidx.pyx":197 | |
7322 * def close(self): | |
7323 * """close the file.""" | |
7324 * if self.fastafile != NULL: # <<<<<<<<<<<<<< | |
7325 * fai_destroy(self.fastafile) | |
7326 * self.fastafile = NULL | |
7327 */ | |
7328 } | |
7329 | |
7330 /* "pysam/libcfaidx.pyx":195 | |
7331 * self.reference2length = dict(zip(self._references, self._lengths)) | |
7332 * | |
7333 * def close(self): # <<<<<<<<<<<<<< | |
7334 * """close the file.""" | |
7335 * if self.fastafile != NULL: | |
7336 */ | |
7337 | |
7338 /* function exit code */ | |
7339 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
7340 goto __pyx_L0; | |
7341 __pyx_L1_error:; | |
7342 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.close", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7343 __pyx_r = NULL; | |
7344 __pyx_L0:; | |
7345 __Pyx_XGIVEREF(__pyx_r); | |
7346 __Pyx_TraceReturn(__pyx_r, 0); | |
7347 __Pyx_RefNannyFinishContext(); | |
7348 return __pyx_r; | |
7349 } | |
7350 | |
7351 /* "pysam/libcfaidx.pyx":201 | |
7352 * self.fastafile = NULL | |
7353 * | |
7354 * def __dealloc__(self): # <<<<<<<<<<<<<< | |
7355 * if self.fastafile != NULL: | |
7356 * fai_destroy(self.fastafile) | |
7357 */ | |
7358 | |
7359 /* Python wrapper */ | |
7360 static void __pyx_pw_5pysam_9libcfaidx_9FastaFile_11__dealloc__(PyObject *__pyx_v_self); /*proto*/ | |
7361 static void __pyx_pw_5pysam_9libcfaidx_9FastaFile_11__dealloc__(PyObject *__pyx_v_self) { | |
7362 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
7363 __Pyx_RefNannyDeclarations | |
7364 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); | |
7365 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
7366 __pyx_pf_5pysam_9libcfaidx_9FastaFile_10__dealloc__(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self)); | |
7367 | |
7368 /* function exit code */ | |
7369 __Pyx_RefNannyFinishContext(); | |
7370 } | |
7371 | |
7372 static void __pyx_pf_5pysam_9libcfaidx_9FastaFile_10__dealloc__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self) { | |
7373 __Pyx_TraceDeclarations | |
7374 int __pyx_t_1; | |
7375 int __pyx_lineno = 0; | |
7376 const char *__pyx_filename = NULL; | |
7377 int __pyx_clineno = 0; | |
7378 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 201, 0, __PYX_ERR(0, 201, __pyx_L1_error)); | |
7379 | |
7380 /* "pysam/libcfaidx.pyx":202 | |
7381 * | |
7382 * def __dealloc__(self): | |
7383 * if self.fastafile != NULL: # <<<<<<<<<<<<<< | |
7384 * fai_destroy(self.fastafile) | |
7385 * self.fastafile = NULL | |
7386 */ | |
7387 __pyx_t_1 = (__pyx_v_self->fastafile != NULL); | |
7388 if (__pyx_t_1) { | |
7389 | |
7390 /* "pysam/libcfaidx.pyx":203 | |
7391 * def __dealloc__(self): | |
7392 * if self.fastafile != NULL: | |
7393 * fai_destroy(self.fastafile) # <<<<<<<<<<<<<< | |
7394 * self.fastafile = NULL | |
7395 * | |
7396 */ | |
7397 fai_destroy(__pyx_v_self->fastafile); | |
7398 | |
7399 /* "pysam/libcfaidx.pyx":204 | |
7400 * if self.fastafile != NULL: | |
7401 * fai_destroy(self.fastafile) | |
7402 * self.fastafile = NULL # <<<<<<<<<<<<<< | |
7403 * | |
7404 * # context manager interface | |
7405 */ | |
7406 __pyx_v_self->fastafile = NULL; | |
7407 | |
7408 /* "pysam/libcfaidx.pyx":202 | |
7409 * | |
7410 * def __dealloc__(self): | |
7411 * if self.fastafile != NULL: # <<<<<<<<<<<<<< | |
7412 * fai_destroy(self.fastafile) | |
7413 * self.fastafile = NULL | |
7414 */ | |
7415 } | |
7416 | |
7417 /* "pysam/libcfaidx.pyx":201 | |
7418 * self.fastafile = NULL | |
7419 * | |
7420 * def __dealloc__(self): # <<<<<<<<<<<<<< | |
7421 * if self.fastafile != NULL: | |
7422 * fai_destroy(self.fastafile) | |
7423 */ | |
7424 | |
7425 /* function exit code */ | |
7426 goto __pyx_L0; | |
7427 __pyx_L1_error:; | |
7428 __Pyx_WriteUnraisable("pysam.libcfaidx.FastaFile.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); | |
7429 __pyx_L0:; | |
7430 __Pyx_TraceReturn(Py_None, 0); | |
7431 } | |
7432 | |
7433 /* "pysam/libcfaidx.pyx":207 | |
7434 * | |
7435 * # context manager interface | |
7436 * def __enter__(self): # <<<<<<<<<<<<<< | |
7437 * return self | |
7438 * | |
7439 */ | |
7440 | |
7441 /* Python wrapper */ | |
7442 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_13__enter__(PyObject *__pyx_v_self, | |
7443 #if CYTHON_METH_FASTCALL | |
7444 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
7445 #else | |
7446 PyObject *__pyx_args, PyObject *__pyx_kwds | |
7447 #endif | |
7448 ); /*proto*/ | |
7449 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastaFile_12__enter__, "FastaFile.__enter__(self)"); | |
7450 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastaFile_13__enter__ = {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_13__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_12__enter__}; | |
7451 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_13__enter__(PyObject *__pyx_v_self, | |
7452 #if CYTHON_METH_FASTCALL | |
7453 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
7454 #else | |
7455 PyObject *__pyx_args, PyObject *__pyx_kwds | |
7456 #endif | |
7457 ) { | |
7458 #if !CYTHON_METH_FASTCALL | |
7459 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
7460 #endif | |
7461 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
7462 PyObject *__pyx_r = 0; | |
7463 __Pyx_RefNannyDeclarations | |
7464 __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); | |
7465 #if !CYTHON_METH_FASTCALL | |
7466 #if CYTHON_ASSUME_SAFE_MACROS | |
7467 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
7468 #else | |
7469 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
7470 #endif | |
7471 #endif | |
7472 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
7473 if (unlikely(__pyx_nargs > 0)) { | |
7474 __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, __pyx_nargs); return NULL;} | |
7475 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; | |
7476 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_12__enter__(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self)); | |
7477 | |
7478 /* function exit code */ | |
7479 __Pyx_RefNannyFinishContext(); | |
7480 return __pyx_r; | |
7481 } | |
7482 | |
7483 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_12__enter__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self) { | |
7484 PyObject *__pyx_r = NULL; | |
7485 __Pyx_TraceDeclarations | |
7486 __Pyx_RefNannyDeclarations | |
7487 int __pyx_lineno = 0; | |
7488 const char *__pyx_filename = NULL; | |
7489 int __pyx_clineno = 0; | |
7490 __Pyx_TraceFrameInit(__pyx_codeobj__6) | |
7491 __Pyx_RefNannySetupContext("__enter__", 1); | |
7492 __Pyx_TraceCall("__enter__", __pyx_f[0], 207, 0, __PYX_ERR(0, 207, __pyx_L1_error)); | |
7493 | |
7494 /* "pysam/libcfaidx.pyx":208 | |
7495 * # context manager interface | |
7496 * def __enter__(self): | |
7497 * return self # <<<<<<<<<<<<<< | |
7498 * | |
7499 * def __exit__(self, exc_type, exc_value, traceback): | |
7500 */ | |
7501 __Pyx_XDECREF(__pyx_r); | |
7502 __Pyx_INCREF((PyObject *)__pyx_v_self); | |
7503 __pyx_r = ((PyObject *)__pyx_v_self); | |
7504 goto __pyx_L0; | |
7505 | |
7506 /* "pysam/libcfaidx.pyx":207 | |
7507 * | |
7508 * # context manager interface | |
7509 * def __enter__(self): # <<<<<<<<<<<<<< | |
7510 * return self | |
7511 * | |
7512 */ | |
7513 | |
7514 /* function exit code */ | |
7515 __pyx_L1_error:; | |
7516 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7517 __pyx_r = NULL; | |
7518 __pyx_L0:; | |
7519 __Pyx_XGIVEREF(__pyx_r); | |
7520 __Pyx_TraceReturn(__pyx_r, 0); | |
7521 __Pyx_RefNannyFinishContext(); | |
7522 return __pyx_r; | |
7523 } | |
7524 | |
7525 /* "pysam/libcfaidx.pyx":210 | |
7526 * return self | |
7527 * | |
7528 * def __exit__(self, exc_type, exc_value, traceback): # <<<<<<<<<<<<<< | |
7529 * self.close() | |
7530 * return False | |
7531 */ | |
7532 | |
7533 /* Python wrapper */ | |
7534 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_15__exit__(PyObject *__pyx_v_self, | |
7535 #if CYTHON_METH_FASTCALL | |
7536 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
7537 #else | |
7538 PyObject *__pyx_args, PyObject *__pyx_kwds | |
7539 #endif | |
7540 ); /*proto*/ | |
7541 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastaFile_14__exit__, "FastaFile.__exit__(self, exc_type, exc_value, traceback)"); | |
7542 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastaFile_15__exit__ = {"__exit__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_15__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_14__exit__}; | |
7543 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_15__exit__(PyObject *__pyx_v_self, | |
7544 #if CYTHON_METH_FASTCALL | |
7545 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
7546 #else | |
7547 PyObject *__pyx_args, PyObject *__pyx_kwds | |
7548 #endif | |
7549 ) { | |
7550 CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0; | |
7551 CYTHON_UNUSED PyObject *__pyx_v_exc_value = 0; | |
7552 CYTHON_UNUSED PyObject *__pyx_v_traceback = 0; | |
7553 #if !CYTHON_METH_FASTCALL | |
7554 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
7555 #endif | |
7556 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
7557 PyObject* values[3] = {0,0,0}; | |
7558 int __pyx_lineno = 0; | |
7559 const char *__pyx_filename = NULL; | |
7560 int __pyx_clineno = 0; | |
7561 PyObject *__pyx_r = 0; | |
7562 __Pyx_RefNannyDeclarations | |
7563 __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); | |
7564 #if !CYTHON_METH_FASTCALL | |
7565 #if CYTHON_ASSUME_SAFE_MACROS | |
7566 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
7567 #else | |
7568 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
7569 #endif | |
7570 #endif | |
7571 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
7572 { | |
7573 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_value,&__pyx_n_s_traceback,0}; | |
7574 if (__pyx_kwds) { | |
7575 Py_ssize_t kw_args; | |
7576 switch (__pyx_nargs) { | |
7577 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
7578 CYTHON_FALLTHROUGH; | |
7579 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
7580 CYTHON_FALLTHROUGH; | |
7581 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
7582 CYTHON_FALLTHROUGH; | |
7583 case 0: break; | |
7584 default: goto __pyx_L5_argtuple_error; | |
7585 } | |
7586 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
7587 switch (__pyx_nargs) { | |
7588 case 0: | |
7589 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exc_type)) != 0)) { | |
7590 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
7591 kw_args--; | |
7592 } | |
7593 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 210, __pyx_L3_error) | |
7594 else goto __pyx_L5_argtuple_error; | |
7595 CYTHON_FALLTHROUGH; | |
7596 case 1: | |
7597 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exc_value)) != 0)) { | |
7598 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
7599 kw_args--; | |
7600 } | |
7601 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 210, __pyx_L3_error) | |
7602 else { | |
7603 __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 210, __pyx_L3_error) | |
7604 } | |
7605 CYTHON_FALLTHROUGH; | |
7606 case 2: | |
7607 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_traceback)) != 0)) { | |
7608 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
7609 kw_args--; | |
7610 } | |
7611 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 210, __pyx_L3_error) | |
7612 else { | |
7613 __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 210, __pyx_L3_error) | |
7614 } | |
7615 } | |
7616 if (unlikely(kw_args > 0)) { | |
7617 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
7618 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__exit__") < 0)) __PYX_ERR(0, 210, __pyx_L3_error) | |
7619 } | |
7620 } else if (unlikely(__pyx_nargs != 3)) { | |
7621 goto __pyx_L5_argtuple_error; | |
7622 } else { | |
7623 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
7624 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
7625 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
7626 } | |
7627 __pyx_v_exc_type = values[0]; | |
7628 __pyx_v_exc_value = values[1]; | |
7629 __pyx_v_traceback = values[2]; | |
7630 } | |
7631 goto __pyx_L6_skip; | |
7632 __pyx_L5_argtuple_error:; | |
7633 __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 210, __pyx_L3_error) | |
7634 __pyx_L6_skip:; | |
7635 goto __pyx_L4_argument_unpacking_done; | |
7636 __pyx_L3_error:; | |
7637 { | |
7638 Py_ssize_t __pyx_temp; | |
7639 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
7640 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
7641 } | |
7642 } | |
7643 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7644 __Pyx_RefNannyFinishContext(); | |
7645 return NULL; | |
7646 __pyx_L4_argument_unpacking_done:; | |
7647 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_14__exit__(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_value, __pyx_v_traceback); | |
7648 | |
7649 /* function exit code */ | |
7650 { | |
7651 Py_ssize_t __pyx_temp; | |
7652 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
7653 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
7654 } | |
7655 } | |
7656 __Pyx_RefNannyFinishContext(); | |
7657 return __pyx_r; | |
7658 } | |
7659 | |
7660 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_14__exit__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) { | |
7661 PyObject *__pyx_r = NULL; | |
7662 __Pyx_TraceDeclarations | |
7663 __Pyx_RefNannyDeclarations | |
7664 PyObject *__pyx_t_1 = NULL; | |
7665 PyObject *__pyx_t_2 = NULL; | |
7666 PyObject *__pyx_t_3 = NULL; | |
7667 unsigned int __pyx_t_4; | |
7668 int __pyx_lineno = 0; | |
7669 const char *__pyx_filename = NULL; | |
7670 int __pyx_clineno = 0; | |
7671 __Pyx_TraceFrameInit(__pyx_codeobj__7) | |
7672 __Pyx_RefNannySetupContext("__exit__", 1); | |
7673 __Pyx_TraceCall("__exit__", __pyx_f[0], 210, 0, __PYX_ERR(0, 210, __pyx_L1_error)); | |
7674 | |
7675 /* "pysam/libcfaidx.pyx":211 | |
7676 * | |
7677 * def __exit__(self, exc_type, exc_value, traceback): | |
7678 * self.close() # <<<<<<<<<<<<<< | |
7679 * return False | |
7680 * | |
7681 */ | |
7682 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) | |
7683 __Pyx_GOTREF(__pyx_t_2); | |
7684 __pyx_t_3 = NULL; | |
7685 __pyx_t_4 = 0; | |
7686 #if CYTHON_UNPACK_METHODS | |
7687 if (likely(PyMethod_Check(__pyx_t_2))) { | |
7688 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
7689 if (likely(__pyx_t_3)) { | |
7690 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
7691 __Pyx_INCREF(__pyx_t_3); | |
7692 __Pyx_INCREF(function); | |
7693 __Pyx_DECREF_SET(__pyx_t_2, function); | |
7694 __pyx_t_4 = 1; | |
7695 } | |
7696 } | |
7697 #endif | |
7698 { | |
7699 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
7700 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
7701 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
7702 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) | |
7703 __Pyx_GOTREF(__pyx_t_1); | |
7704 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
7705 } | |
7706 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
7707 | |
7708 /* "pysam/libcfaidx.pyx":212 | |
7709 * def __exit__(self, exc_type, exc_value, traceback): | |
7710 * self.close() | |
7711 * return False # <<<<<<<<<<<<<< | |
7712 * | |
7713 * property closed: | |
7714 */ | |
7715 __Pyx_XDECREF(__pyx_r); | |
7716 __Pyx_INCREF(Py_False); | |
7717 __pyx_r = Py_False; | |
7718 goto __pyx_L0; | |
7719 | |
7720 /* "pysam/libcfaidx.pyx":210 | |
7721 * return self | |
7722 * | |
7723 * def __exit__(self, exc_type, exc_value, traceback): # <<<<<<<<<<<<<< | |
7724 * self.close() | |
7725 * return False | |
7726 */ | |
7727 | |
7728 /* function exit code */ | |
7729 __pyx_L1_error:; | |
7730 __Pyx_XDECREF(__pyx_t_1); | |
7731 __Pyx_XDECREF(__pyx_t_2); | |
7732 __Pyx_XDECREF(__pyx_t_3); | |
7733 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7734 __pyx_r = NULL; | |
7735 __pyx_L0:; | |
7736 __Pyx_XGIVEREF(__pyx_r); | |
7737 __Pyx_TraceReturn(__pyx_r, 0); | |
7738 __Pyx_RefNannyFinishContext(); | |
7739 return __pyx_r; | |
7740 } | |
7741 | |
7742 /* "pysam/libcfaidx.pyx":218 | |
7743 * This is a read-only attribute; the close() method changes the value. | |
7744 * """ | |
7745 * def __get__(self): # <<<<<<<<<<<<<< | |
7746 * return not self.is_open() | |
7747 * | |
7748 */ | |
7749 | |
7750 /* Python wrapper */ | |
7751 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_6closed_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
7752 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_6closed_1__get__(PyObject *__pyx_v_self) { | |
7753 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
7754 PyObject *__pyx_r = 0; | |
7755 __Pyx_RefNannyDeclarations | |
7756 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
7757 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
7758 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_6closed___get__(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self)); | |
7759 | |
7760 /* function exit code */ | |
7761 __Pyx_RefNannyFinishContext(); | |
7762 return __pyx_r; | |
7763 } | |
7764 | |
7765 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_6closed___get__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self) { | |
7766 PyObject *__pyx_r = NULL; | |
7767 __Pyx_TraceDeclarations | |
7768 __Pyx_RefNannyDeclarations | |
7769 PyObject *__pyx_t_1 = NULL; | |
7770 PyObject *__pyx_t_2 = NULL; | |
7771 PyObject *__pyx_t_3 = NULL; | |
7772 unsigned int __pyx_t_4; | |
7773 int __pyx_t_5; | |
7774 int __pyx_lineno = 0; | |
7775 const char *__pyx_filename = NULL; | |
7776 int __pyx_clineno = 0; | |
7777 __Pyx_RefNannySetupContext("__get__", 1); | |
7778 __Pyx_TraceCall("__get__", __pyx_f[0], 218, 0, __PYX_ERR(0, 218, __pyx_L1_error)); | |
7779 | |
7780 /* "pysam/libcfaidx.pyx":219 | |
7781 * """ | |
7782 * def __get__(self): | |
7783 * return not self.is_open() # <<<<<<<<<<<<<< | |
7784 * | |
7785 * property filename: | |
7786 */ | |
7787 __Pyx_XDECREF(__pyx_r); | |
7788 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) | |
7789 __Pyx_GOTREF(__pyx_t_2); | |
7790 __pyx_t_3 = NULL; | |
7791 __pyx_t_4 = 0; | |
7792 #if CYTHON_UNPACK_METHODS | |
7793 if (likely(PyMethod_Check(__pyx_t_2))) { | |
7794 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
7795 if (likely(__pyx_t_3)) { | |
7796 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
7797 __Pyx_INCREF(__pyx_t_3); | |
7798 __Pyx_INCREF(function); | |
7799 __Pyx_DECREF_SET(__pyx_t_2, function); | |
7800 __pyx_t_4 = 1; | |
7801 } | |
7802 } | |
7803 #endif | |
7804 { | |
7805 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
7806 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
7807 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
7808 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) | |
7809 __Pyx_GOTREF(__pyx_t_1); | |
7810 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
7811 } | |
7812 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 219, __pyx_L1_error) | |
7813 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
7814 __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) | |
7815 __Pyx_GOTREF(__pyx_t_1); | |
7816 __pyx_r = __pyx_t_1; | |
7817 __pyx_t_1 = 0; | |
7818 goto __pyx_L0; | |
7819 | |
7820 /* "pysam/libcfaidx.pyx":218 | |
7821 * This is a read-only attribute; the close() method changes the value. | |
7822 * """ | |
7823 * def __get__(self): # <<<<<<<<<<<<<< | |
7824 * return not self.is_open() | |
7825 * | |
7826 */ | |
7827 | |
7828 /* function exit code */ | |
7829 __pyx_L1_error:; | |
7830 __Pyx_XDECREF(__pyx_t_1); | |
7831 __Pyx_XDECREF(__pyx_t_2); | |
7832 __Pyx_XDECREF(__pyx_t_3); | |
7833 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.closed.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7834 __pyx_r = NULL; | |
7835 __pyx_L0:; | |
7836 __Pyx_XGIVEREF(__pyx_r); | |
7837 __Pyx_TraceReturn(__pyx_r, 0); | |
7838 __Pyx_RefNannyFinishContext(); | |
7839 return __pyx_r; | |
7840 } | |
7841 | |
7842 /* "pysam/libcfaidx.pyx":223 | |
7843 * property filename: | |
7844 * """filename associated with this object. This is a read-only attribute.""" | |
7845 * def __get__(self): # <<<<<<<<<<<<<< | |
7846 * return self._filename | |
7847 * | |
7848 */ | |
7849 | |
7850 /* Python wrapper */ | |
7851 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_8filename_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
7852 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_8filename_1__get__(PyObject *__pyx_v_self) { | |
7853 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
7854 PyObject *__pyx_r = 0; | |
7855 __Pyx_RefNannyDeclarations | |
7856 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
7857 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
7858 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_8filename___get__(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self)); | |
7859 | |
7860 /* function exit code */ | |
7861 __Pyx_RefNannyFinishContext(); | |
7862 return __pyx_r; | |
7863 } | |
7864 | |
7865 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_8filename___get__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self) { | |
7866 PyObject *__pyx_r = NULL; | |
7867 __Pyx_TraceDeclarations | |
7868 __Pyx_RefNannyDeclarations | |
7869 int __pyx_lineno = 0; | |
7870 const char *__pyx_filename = NULL; | |
7871 int __pyx_clineno = 0; | |
7872 __Pyx_RefNannySetupContext("__get__", 1); | |
7873 __Pyx_TraceCall("__get__", __pyx_f[0], 223, 0, __PYX_ERR(0, 223, __pyx_L1_error)); | |
7874 | |
7875 /* "pysam/libcfaidx.pyx":224 | |
7876 * """filename associated with this object. This is a read-only attribute.""" | |
7877 * def __get__(self): | |
7878 * return self._filename # <<<<<<<<<<<<<< | |
7879 * | |
7880 * property references: | |
7881 */ | |
7882 __Pyx_XDECREF(__pyx_r); | |
7883 __Pyx_INCREF(__pyx_v_self->_filename); | |
7884 __pyx_r = __pyx_v_self->_filename; | |
7885 goto __pyx_L0; | |
7886 | |
7887 /* "pysam/libcfaidx.pyx":223 | |
7888 * property filename: | |
7889 * """filename associated with this object. This is a read-only attribute.""" | |
7890 * def __get__(self): # <<<<<<<<<<<<<< | |
7891 * return self._filename | |
7892 * | |
7893 */ | |
7894 | |
7895 /* function exit code */ | |
7896 __pyx_L1_error:; | |
7897 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.filename.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7898 __pyx_r = NULL; | |
7899 __pyx_L0:; | |
7900 __Pyx_XGIVEREF(__pyx_r); | |
7901 __Pyx_TraceReturn(__pyx_r, 0); | |
7902 __Pyx_RefNannyFinishContext(); | |
7903 return __pyx_r; | |
7904 } | |
7905 | |
7906 /* "pysam/libcfaidx.pyx":228 | |
7907 * property references: | |
7908 * '''tuple with the names of :term:`reference` sequences.''' | |
7909 * def __get__(self): # <<<<<<<<<<<<<< | |
7910 * return self._references | |
7911 * | |
7912 */ | |
7913 | |
7914 /* Python wrapper */ | |
7915 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_10references_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
7916 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_10references_1__get__(PyObject *__pyx_v_self) { | |
7917 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
7918 PyObject *__pyx_r = 0; | |
7919 __Pyx_RefNannyDeclarations | |
7920 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
7921 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
7922 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_10references___get__(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self)); | |
7923 | |
7924 /* function exit code */ | |
7925 __Pyx_RefNannyFinishContext(); | |
7926 return __pyx_r; | |
7927 } | |
7928 | |
7929 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_10references___get__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self) { | |
7930 PyObject *__pyx_r = NULL; | |
7931 __Pyx_TraceDeclarations | |
7932 __Pyx_RefNannyDeclarations | |
7933 int __pyx_lineno = 0; | |
7934 const char *__pyx_filename = NULL; | |
7935 int __pyx_clineno = 0; | |
7936 __Pyx_RefNannySetupContext("__get__", 1); | |
7937 __Pyx_TraceCall("__get__", __pyx_f[0], 228, 0, __PYX_ERR(0, 228, __pyx_L1_error)); | |
7938 | |
7939 /* "pysam/libcfaidx.pyx":229 | |
7940 * '''tuple with the names of :term:`reference` sequences.''' | |
7941 * def __get__(self): | |
7942 * return self._references # <<<<<<<<<<<<<< | |
7943 * | |
7944 * property nreferences: | |
7945 */ | |
7946 __Pyx_XDECREF(__pyx_r); | |
7947 __Pyx_INCREF(__pyx_v_self->_references); | |
7948 __pyx_r = __pyx_v_self->_references; | |
7949 goto __pyx_L0; | |
7950 | |
7951 /* "pysam/libcfaidx.pyx":228 | |
7952 * property references: | |
7953 * '''tuple with the names of :term:`reference` sequences.''' | |
7954 * def __get__(self): # <<<<<<<<<<<<<< | |
7955 * return self._references | |
7956 * | |
7957 */ | |
7958 | |
7959 /* function exit code */ | |
7960 __pyx_L1_error:; | |
7961 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.references.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
7962 __pyx_r = NULL; | |
7963 __pyx_L0:; | |
7964 __Pyx_XGIVEREF(__pyx_r); | |
7965 __Pyx_TraceReturn(__pyx_r, 0); | |
7966 __Pyx_RefNannyFinishContext(); | |
7967 return __pyx_r; | |
7968 } | |
7969 | |
7970 /* "pysam/libcfaidx.pyx":234 | |
7971 * """int with the number of :term:`reference` sequences in the file. | |
7972 * This is a read-only attribute.""" | |
7973 * def __get__(self): # <<<<<<<<<<<<<< | |
7974 * return len(self._references) if self.references else None | |
7975 * | |
7976 */ | |
7977 | |
7978 /* Python wrapper */ | |
7979 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_11nreferences_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
7980 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_11nreferences_1__get__(PyObject *__pyx_v_self) { | |
7981 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
7982 PyObject *__pyx_r = 0; | |
7983 __Pyx_RefNannyDeclarations | |
7984 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
7985 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
7986 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_11nreferences___get__(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self)); | |
7987 | |
7988 /* function exit code */ | |
7989 __Pyx_RefNannyFinishContext(); | |
7990 return __pyx_r; | |
7991 } | |
7992 | |
7993 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_11nreferences___get__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self) { | |
7994 PyObject *__pyx_r = NULL; | |
7995 __Pyx_TraceDeclarations | |
7996 __Pyx_RefNannyDeclarations | |
7997 PyObject *__pyx_t_1 = NULL; | |
7998 PyObject *__pyx_t_2 = NULL; | |
7999 int __pyx_t_3; | |
8000 Py_ssize_t __pyx_t_4; | |
8001 int __pyx_lineno = 0; | |
8002 const char *__pyx_filename = NULL; | |
8003 int __pyx_clineno = 0; | |
8004 __Pyx_RefNannySetupContext("__get__", 1); | |
8005 __Pyx_TraceCall("__get__", __pyx_f[0], 234, 0, __PYX_ERR(0, 234, __pyx_L1_error)); | |
8006 | |
8007 /* "pysam/libcfaidx.pyx":235 | |
8008 * This is a read-only attribute.""" | |
8009 * def __get__(self): | |
8010 * return len(self._references) if self.references else None # <<<<<<<<<<<<<< | |
8011 * | |
8012 * property lengths: | |
8013 */ | |
8014 __Pyx_XDECREF(__pyx_r); | |
8015 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_references); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) | |
8016 __Pyx_GOTREF(__pyx_t_2); | |
8017 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 235, __pyx_L1_error) | |
8018 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
8019 if (__pyx_t_3) { | |
8020 __pyx_t_2 = __pyx_v_self->_references; | |
8021 __Pyx_INCREF(__pyx_t_2); | |
8022 __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 235, __pyx_L1_error) | |
8023 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
8024 __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) | |
8025 __Pyx_GOTREF(__pyx_t_2); | |
8026 __pyx_t_1 = __pyx_t_2; | |
8027 __pyx_t_2 = 0; | |
8028 } else { | |
8029 __Pyx_INCREF(Py_None); | |
8030 __pyx_t_1 = Py_None; | |
8031 } | |
8032 __pyx_r = __pyx_t_1; | |
8033 __pyx_t_1 = 0; | |
8034 goto __pyx_L0; | |
8035 | |
8036 /* "pysam/libcfaidx.pyx":234 | |
8037 * """int with the number of :term:`reference` sequences in the file. | |
8038 * This is a read-only attribute.""" | |
8039 * def __get__(self): # <<<<<<<<<<<<<< | |
8040 * return len(self._references) if self.references else None | |
8041 * | |
8042 */ | |
8043 | |
8044 /* function exit code */ | |
8045 __pyx_L1_error:; | |
8046 __Pyx_XDECREF(__pyx_t_1); | |
8047 __Pyx_XDECREF(__pyx_t_2); | |
8048 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.nreferences.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8049 __pyx_r = NULL; | |
8050 __pyx_L0:; | |
8051 __Pyx_XGIVEREF(__pyx_r); | |
8052 __Pyx_TraceReturn(__pyx_r, 0); | |
8053 __Pyx_RefNannyFinishContext(); | |
8054 return __pyx_r; | |
8055 } | |
8056 | |
8057 /* "pysam/libcfaidx.pyx":239 | |
8058 * property lengths: | |
8059 * """tuple with the lengths of :term:`reference` sequences.""" | |
8060 * def __get__(self): # <<<<<<<<<<<<<< | |
8061 * return self._lengths | |
8062 * | |
8063 */ | |
8064 | |
8065 /* Python wrapper */ | |
8066 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_7lengths_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
8067 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_7lengths_1__get__(PyObject *__pyx_v_self) { | |
8068 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
8069 PyObject *__pyx_r = 0; | |
8070 __Pyx_RefNannyDeclarations | |
8071 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
8072 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
8073 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_7lengths___get__(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self)); | |
8074 | |
8075 /* function exit code */ | |
8076 __Pyx_RefNannyFinishContext(); | |
8077 return __pyx_r; | |
8078 } | |
8079 | |
8080 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_7lengths___get__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self) { | |
8081 PyObject *__pyx_r = NULL; | |
8082 __Pyx_TraceDeclarations | |
8083 __Pyx_RefNannyDeclarations | |
8084 int __pyx_lineno = 0; | |
8085 const char *__pyx_filename = NULL; | |
8086 int __pyx_clineno = 0; | |
8087 __Pyx_RefNannySetupContext("__get__", 1); | |
8088 __Pyx_TraceCall("__get__", __pyx_f[0], 239, 0, __PYX_ERR(0, 239, __pyx_L1_error)); | |
8089 | |
8090 /* "pysam/libcfaidx.pyx":240 | |
8091 * """tuple with the lengths of :term:`reference` sequences.""" | |
8092 * def __get__(self): | |
8093 * return self._lengths # <<<<<<<<<<<<<< | |
8094 * | |
8095 * def fetch(self, | |
8096 */ | |
8097 __Pyx_XDECREF(__pyx_r); | |
8098 __Pyx_INCREF(__pyx_v_self->_lengths); | |
8099 __pyx_r = __pyx_v_self->_lengths; | |
8100 goto __pyx_L0; | |
8101 | |
8102 /* "pysam/libcfaidx.pyx":239 | |
8103 * property lengths: | |
8104 * """tuple with the lengths of :term:`reference` sequences.""" | |
8105 * def __get__(self): # <<<<<<<<<<<<<< | |
8106 * return self._lengths | |
8107 * | |
8108 */ | |
8109 | |
8110 /* function exit code */ | |
8111 __pyx_L1_error:; | |
8112 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.lengths.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8113 __pyx_r = NULL; | |
8114 __pyx_L0:; | |
8115 __Pyx_XGIVEREF(__pyx_r); | |
8116 __Pyx_TraceReturn(__pyx_r, 0); | |
8117 __Pyx_RefNannyFinishContext(); | |
8118 return __pyx_r; | |
8119 } | |
8120 | |
8121 /* "pysam/libcfaidx.pyx":242 | |
8122 * return self._lengths | |
8123 * | |
8124 * def fetch(self, # <<<<<<<<<<<<<< | |
8125 * reference=None, | |
8126 * start=None, | |
8127 */ | |
8128 | |
8129 /* Python wrapper */ | |
8130 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_17fetch(PyObject *__pyx_v_self, | |
8131 #if CYTHON_METH_FASTCALL | |
8132 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
8133 #else | |
8134 PyObject *__pyx_args, PyObject *__pyx_kwds | |
8135 #endif | |
8136 ); /*proto*/ | |
8137 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastaFile_16fetch, "FastaFile.fetch(self, reference=None, start=None, end=None, region=None)\nfetch sequences in a :term:`region`.\n\n A region can\n either be specified by :term:`reference`, `start` and\n `end`. `start` and `end` denote 0-based, half-open\n intervals.\n\n Alternatively, a samtools :term:`region` string can be\n supplied.\n\n If any of the coordinates are missing they will be replaced by the\n minimum (`start`) or maximum (`end`) coordinate.\n\n Note that region strings are 1-based, while `start` and `end` denote\n an interval in python coordinates.\n The region is specified by :term:`reference`, `start` and `end`.\n\n Returns\n -------\n\n string : a string with the sequence specified by the region.\n\n Raises\n ------\n\n IndexError\n if the coordinates are out of range\n\n ValueError\n if the region is invalid\n\n "); | |
8138 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastaFile_17fetch = {"fetch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_17fetch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_16fetch}; | |
8139 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_17fetch(PyObject *__pyx_v_self, | |
8140 #if CYTHON_METH_FASTCALL | |
8141 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
8142 #else | |
8143 PyObject *__pyx_args, PyObject *__pyx_kwds | |
8144 #endif | |
8145 ) { | |
8146 PyObject *__pyx_v_reference = 0; | |
8147 PyObject *__pyx_v_start = 0; | |
8148 PyObject *__pyx_v_end = 0; | |
8149 PyObject *__pyx_v_region = 0; | |
8150 #if !CYTHON_METH_FASTCALL | |
8151 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
8152 #endif | |
8153 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
8154 PyObject* values[4] = {0,0,0,0}; | |
8155 int __pyx_lineno = 0; | |
8156 const char *__pyx_filename = NULL; | |
8157 int __pyx_clineno = 0; | |
8158 PyObject *__pyx_r = 0; | |
8159 __Pyx_RefNannyDeclarations | |
8160 __Pyx_RefNannySetupContext("fetch (wrapper)", 0); | |
8161 #if !CYTHON_METH_FASTCALL | |
8162 #if CYTHON_ASSUME_SAFE_MACROS | |
8163 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
8164 #else | |
8165 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
8166 #endif | |
8167 #endif | |
8168 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
8169 { | |
8170 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reference,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_region,0}; | |
8171 | |
8172 /* "pysam/libcfaidx.pyx":243 | |
8173 * | |
8174 * def fetch(self, | |
8175 * reference=None, # <<<<<<<<<<<<<< | |
8176 * start=None, | |
8177 * end=None, | |
8178 */ | |
8179 values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
8180 | |
8181 /* "pysam/libcfaidx.pyx":244 | |
8182 * def fetch(self, | |
8183 * reference=None, | |
8184 * start=None, # <<<<<<<<<<<<<< | |
8185 * end=None, | |
8186 * region=None): | |
8187 */ | |
8188 values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
8189 | |
8190 /* "pysam/libcfaidx.pyx":245 | |
8191 * reference=None, | |
8192 * start=None, | |
8193 * end=None, # <<<<<<<<<<<<<< | |
8194 * region=None): | |
8195 * """fetch sequences in a :term:`region`. | |
8196 */ | |
8197 values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
8198 | |
8199 /* "pysam/libcfaidx.pyx":246 | |
8200 * start=None, | |
8201 * end=None, | |
8202 * region=None): # <<<<<<<<<<<<<< | |
8203 * """fetch sequences in a :term:`region`. | |
8204 * | |
8205 */ | |
8206 values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
8207 if (__pyx_kwds) { | |
8208 Py_ssize_t kw_args; | |
8209 switch (__pyx_nargs) { | |
8210 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
8211 CYTHON_FALLTHROUGH; | |
8212 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
8213 CYTHON_FALLTHROUGH; | |
8214 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
8215 CYTHON_FALLTHROUGH; | |
8216 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
8217 CYTHON_FALLTHROUGH; | |
8218 case 0: break; | |
8219 default: goto __pyx_L5_argtuple_error; | |
8220 } | |
8221 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
8222 switch (__pyx_nargs) { | |
8223 case 0: | |
8224 if (kw_args > 0) { | |
8225 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reference); | |
8226 if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
8227 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error) | |
8228 } | |
8229 CYTHON_FALLTHROUGH; | |
8230 case 1: | |
8231 if (kw_args > 0) { | |
8232 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start); | |
8233 if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
8234 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error) | |
8235 } | |
8236 CYTHON_FALLTHROUGH; | |
8237 case 2: | |
8238 if (kw_args > 0) { | |
8239 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end); | |
8240 if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
8241 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error) | |
8242 } | |
8243 CYTHON_FALLTHROUGH; | |
8244 case 3: | |
8245 if (kw_args > 0) { | |
8246 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_region); | |
8247 if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
8248 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error) | |
8249 } | |
8250 } | |
8251 if (unlikely(kw_args > 0)) { | |
8252 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
8253 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fetch") < 0)) __PYX_ERR(0, 242, __pyx_L3_error) | |
8254 } | |
8255 } else { | |
8256 switch (__pyx_nargs) { | |
8257 case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); | |
8258 CYTHON_FALLTHROUGH; | |
8259 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
8260 CYTHON_FALLTHROUGH; | |
8261 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
8262 CYTHON_FALLTHROUGH; | |
8263 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
8264 CYTHON_FALLTHROUGH; | |
8265 case 0: break; | |
8266 default: goto __pyx_L5_argtuple_error; | |
8267 } | |
8268 } | |
8269 __pyx_v_reference = values[0]; | |
8270 __pyx_v_start = values[1]; | |
8271 __pyx_v_end = values[2]; | |
8272 __pyx_v_region = values[3]; | |
8273 } | |
8274 goto __pyx_L6_skip; | |
8275 __pyx_L5_argtuple_error:; | |
8276 __Pyx_RaiseArgtupleInvalid("fetch", 0, 0, 4, __pyx_nargs); __PYX_ERR(0, 242, __pyx_L3_error) | |
8277 __pyx_L6_skip:; | |
8278 goto __pyx_L4_argument_unpacking_done; | |
8279 __pyx_L3_error:; | |
8280 { | |
8281 Py_ssize_t __pyx_temp; | |
8282 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
8283 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
8284 } | |
8285 } | |
8286 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.fetch", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8287 __Pyx_RefNannyFinishContext(); | |
8288 return NULL; | |
8289 __pyx_L4_argument_unpacking_done:; | |
8290 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_16fetch(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self), __pyx_v_reference, __pyx_v_start, __pyx_v_end, __pyx_v_region); | |
8291 | |
8292 /* "pysam/libcfaidx.pyx":242 | |
8293 * return self._lengths | |
8294 * | |
8295 * def fetch(self, # <<<<<<<<<<<<<< | |
8296 * reference=None, | |
8297 * start=None, | |
8298 */ | |
8299 | |
8300 /* function exit code */ | |
8301 { | |
8302 Py_ssize_t __pyx_temp; | |
8303 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
8304 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
8305 } | |
8306 } | |
8307 __Pyx_RefNannyFinishContext(); | |
8308 return __pyx_r; | |
8309 } | |
8310 | |
8311 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_16fetch(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region) { | |
8312 int __pyx_v_length; | |
8313 char *__pyx_v_seq; | |
8314 char *__pyx_v_ref; | |
8315 int __pyx_v_rstart; | |
8316 int __pyx_v_rend; | |
8317 PyObject *__pyx_v_contig = NULL; | |
8318 PyObject *__pyx_v_contig_b = NULL; | |
8319 PyObject *__pyx_r = NULL; | |
8320 __Pyx_TraceDeclarations | |
8321 __Pyx_RefNannyDeclarations | |
8322 PyObject *__pyx_t_1 = NULL; | |
8323 PyObject *__pyx_t_2 = NULL; | |
8324 PyObject *__pyx_t_3 = NULL; | |
8325 unsigned int __pyx_t_4; | |
8326 int __pyx_t_5; | |
8327 int __pyx_t_6; | |
8328 struct __pyx_opt_args_5pysam_9libcutils_parse_region __pyx_t_7; | |
8329 PyObject *__pyx_t_8 = NULL; | |
8330 PyObject *__pyx_t_9 = NULL; | |
8331 PyObject *(*__pyx_t_10)(PyObject *); | |
8332 int __pyx_t_11; | |
8333 int __pyx_t_12; | |
8334 char *__pyx_t_13; | |
8335 char const *__pyx_t_14; | |
8336 PyObject *__pyx_t_15 = NULL; | |
8337 PyObject *__pyx_t_16 = NULL; | |
8338 PyObject *__pyx_t_17 = NULL; | |
8339 PyObject *__pyx_t_18 = NULL; | |
8340 PyObject *__pyx_t_19 = NULL; | |
8341 PyObject *__pyx_t_20 = NULL; | |
8342 int __pyx_lineno = 0; | |
8343 const char *__pyx_filename = NULL; | |
8344 int __pyx_clineno = 0; | |
8345 __Pyx_TraceFrameInit(__pyx_codeobj__8) | |
8346 __Pyx_RefNannySetupContext("fetch", 1); | |
8347 __Pyx_TraceCall("fetch", __pyx_f[0], 242, 0, __PYX_ERR(0, 242, __pyx_L1_error)); | |
8348 | |
8349 /* "pysam/libcfaidx.pyx":280 | |
8350 * """ | |
8351 * | |
8352 * if not self.is_open(): # <<<<<<<<<<<<<< | |
8353 * raise ValueError("I/O operation on closed file" ) | |
8354 * | |
8355 */ | |
8356 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error) | |
8357 __Pyx_GOTREF(__pyx_t_2); | |
8358 __pyx_t_3 = NULL; | |
8359 __pyx_t_4 = 0; | |
8360 #if CYTHON_UNPACK_METHODS | |
8361 if (likely(PyMethod_Check(__pyx_t_2))) { | |
8362 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
8363 if (likely(__pyx_t_3)) { | |
8364 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
8365 __Pyx_INCREF(__pyx_t_3); | |
8366 __Pyx_INCREF(function); | |
8367 __Pyx_DECREF_SET(__pyx_t_2, function); | |
8368 __pyx_t_4 = 1; | |
8369 } | |
8370 } | |
8371 #endif | |
8372 { | |
8373 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
8374 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
8375 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
8376 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error) | |
8377 __Pyx_GOTREF(__pyx_t_1); | |
8378 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
8379 } | |
8380 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 280, __pyx_L1_error) | |
8381 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8382 __pyx_t_6 = (!__pyx_t_5); | |
8383 if (unlikely(__pyx_t_6)) { | |
8384 | |
8385 /* "pysam/libcfaidx.pyx":281 | |
8386 * | |
8387 * if not self.is_open(): | |
8388 * raise ValueError("I/O operation on closed file" ) # <<<<<<<<<<<<<< | |
8389 * | |
8390 * cdef int length | |
8391 */ | |
8392 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) | |
8393 __Pyx_GOTREF(__pyx_t_1); | |
8394 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
8395 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8396 __PYX_ERR(0, 281, __pyx_L1_error) | |
8397 | |
8398 /* "pysam/libcfaidx.pyx":280 | |
8399 * """ | |
8400 * | |
8401 * if not self.is_open(): # <<<<<<<<<<<<<< | |
8402 * raise ValueError("I/O operation on closed file" ) | |
8403 * | |
8404 */ | |
8405 } | |
8406 | |
8407 /* "pysam/libcfaidx.pyx":288 | |
8408 * cdef int rstart, rend | |
8409 * | |
8410 * contig, rstart, rend = parse_region(reference, start, end, region) # <<<<<<<<<<<<<< | |
8411 * | |
8412 * if contig is None: | |
8413 */ | |
8414 __pyx_t_7.__pyx_n = 4; | |
8415 __pyx_t_7.contig = __pyx_v_reference; | |
8416 __pyx_t_7.start = __pyx_v_start; | |
8417 __pyx_t_7.stop = __pyx_v_end; | |
8418 __pyx_t_7.region = __pyx_v_region; | |
8419 __pyx_t_1 = __pyx_f_5pysam_9libcutils_parse_region(0, &__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error) | |
8420 __Pyx_GOTREF(__pyx_t_1); | |
8421 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { | |
8422 PyObject* sequence = __pyx_t_1; | |
8423 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); | |
8424 if (unlikely(size != 3)) { | |
8425 if (size > 3) __Pyx_RaiseTooManyValuesError(3); | |
8426 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
8427 __PYX_ERR(0, 288, __pyx_L1_error) | |
8428 } | |
8429 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
8430 if (likely(PyTuple_CheckExact(sequence))) { | |
8431 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); | |
8432 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); | |
8433 __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); | |
8434 } else { | |
8435 __pyx_t_2 = PyList_GET_ITEM(sequence, 0); | |
8436 __pyx_t_3 = PyList_GET_ITEM(sequence, 1); | |
8437 __pyx_t_8 = PyList_GET_ITEM(sequence, 2); | |
8438 } | |
8439 __Pyx_INCREF(__pyx_t_2); | |
8440 __Pyx_INCREF(__pyx_t_3); | |
8441 __Pyx_INCREF(__pyx_t_8); | |
8442 #else | |
8443 __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error) | |
8444 __Pyx_GOTREF(__pyx_t_2); | |
8445 __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) | |
8446 __Pyx_GOTREF(__pyx_t_3); | |
8447 __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error) | |
8448 __Pyx_GOTREF(__pyx_t_8); | |
8449 #endif | |
8450 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8451 } else { | |
8452 Py_ssize_t index = -1; | |
8453 __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 288, __pyx_L1_error) | |
8454 __Pyx_GOTREF(__pyx_t_9); | |
8455 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8456 __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); | |
8457 index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; | |
8458 __Pyx_GOTREF(__pyx_t_2); | |
8459 index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; | |
8460 __Pyx_GOTREF(__pyx_t_3); | |
8461 index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L4_unpacking_failed; | |
8462 __Pyx_GOTREF(__pyx_t_8); | |
8463 if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(0, 288, __pyx_L1_error) | |
8464 __pyx_t_10 = NULL; | |
8465 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
8466 goto __pyx_L5_unpacking_done; | |
8467 __pyx_L4_unpacking_failed:; | |
8468 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; | |
8469 __pyx_t_10 = NULL; | |
8470 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); | |
8471 __PYX_ERR(0, 288, __pyx_L1_error) | |
8472 __pyx_L5_unpacking_done:; | |
8473 } | |
8474 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L1_error) | |
8475 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
8476 __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L1_error) | |
8477 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
8478 __pyx_v_contig = __pyx_t_2; | |
8479 __pyx_t_2 = 0; | |
8480 __pyx_v_rstart = __pyx_t_11; | |
8481 __pyx_v_rend = __pyx_t_12; | |
8482 | |
8483 /* "pysam/libcfaidx.pyx":290 | |
8484 * contig, rstart, rend = parse_region(reference, start, end, region) | |
8485 * | |
8486 * if contig is None: # <<<<<<<<<<<<<< | |
8487 * raise ValueError("no sequence/region supplied.") | |
8488 * | |
8489 */ | |
8490 __pyx_t_6 = (__pyx_v_contig == Py_None); | |
8491 if (unlikely(__pyx_t_6)) { | |
8492 | |
8493 /* "pysam/libcfaidx.pyx":291 | |
8494 * | |
8495 * if contig is None: | |
8496 * raise ValueError("no sequence/region supplied.") # <<<<<<<<<<<<<< | |
8497 * | |
8498 * if rstart == rend: | |
8499 */ | |
8500 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) | |
8501 __Pyx_GOTREF(__pyx_t_1); | |
8502 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
8503 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8504 __PYX_ERR(0, 291, __pyx_L1_error) | |
8505 | |
8506 /* "pysam/libcfaidx.pyx":290 | |
8507 * contig, rstart, rend = parse_region(reference, start, end, region) | |
8508 * | |
8509 * if contig is None: # <<<<<<<<<<<<<< | |
8510 * raise ValueError("no sequence/region supplied.") | |
8511 * | |
8512 */ | |
8513 } | |
8514 | |
8515 /* "pysam/libcfaidx.pyx":293 | |
8516 * raise ValueError("no sequence/region supplied.") | |
8517 * | |
8518 * if rstart == rend: # <<<<<<<<<<<<<< | |
8519 * return "" | |
8520 * | |
8521 */ | |
8522 __pyx_t_6 = (__pyx_v_rstart == __pyx_v_rend); | |
8523 if (__pyx_t_6) { | |
8524 | |
8525 /* "pysam/libcfaidx.pyx":294 | |
8526 * | |
8527 * if rstart == rend: | |
8528 * return "" # <<<<<<<<<<<<<< | |
8529 * | |
8530 * contig_b = force_bytes(contig) | |
8531 */ | |
8532 __Pyx_XDECREF(__pyx_r); | |
8533 __Pyx_INCREF(__pyx_kp_u__11); | |
8534 __pyx_r = __pyx_kp_u__11; | |
8535 goto __pyx_L0; | |
8536 | |
8537 /* "pysam/libcfaidx.pyx":293 | |
8538 * raise ValueError("no sequence/region supplied.") | |
8539 * | |
8540 * if rstart == rend: # <<<<<<<<<<<<<< | |
8541 * return "" | |
8542 * | |
8543 */ | |
8544 } | |
8545 | |
8546 /* "pysam/libcfaidx.pyx":296 | |
8547 * return "" | |
8548 * | |
8549 * contig_b = force_bytes(contig) # <<<<<<<<<<<<<< | |
8550 * ref = contig_b | |
8551 * with nogil: | |
8552 */ | |
8553 __pyx_t_1 = __pyx_f_5pysam_9libcutils_force_bytes(__pyx_v_contig, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) | |
8554 __Pyx_GOTREF(__pyx_t_1); | |
8555 __pyx_v_contig_b = ((PyObject*)__pyx_t_1); | |
8556 __pyx_t_1 = 0; | |
8557 | |
8558 /* "pysam/libcfaidx.pyx":297 | |
8559 * | |
8560 * contig_b = force_bytes(contig) | |
8561 * ref = contig_b # <<<<<<<<<<<<<< | |
8562 * with nogil: | |
8563 * length = faidx_seq_len(self.fastafile, ref) | |
8564 */ | |
8565 if (unlikely(__pyx_v_contig_b == Py_None)) { | |
8566 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); | |
8567 __PYX_ERR(0, 297, __pyx_L1_error) | |
8568 } | |
8569 __pyx_t_13 = __Pyx_PyBytes_AsWritableString(__pyx_v_contig_b); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L1_error) | |
8570 __pyx_v_ref = __pyx_t_13; | |
8571 | |
8572 /* "pysam/libcfaidx.pyx":298 | |
8573 * contig_b = force_bytes(contig) | |
8574 * ref = contig_b | |
8575 * with nogil: # <<<<<<<<<<<<<< | |
8576 * length = faidx_seq_len(self.fastafile, ref) | |
8577 * if length == -1: | |
8578 */ | |
8579 { | |
8580 #ifdef WITH_THREAD | |
8581 PyThreadState *_save; | |
8582 _save = NULL; | |
8583 Py_UNBLOCK_THREADS | |
8584 __Pyx_FastGIL_Remember(); | |
8585 #endif | |
8586 /*try:*/ { | |
8587 | |
8588 /* "pysam/libcfaidx.pyx":299 | |
8589 * ref = contig_b | |
8590 * with nogil: | |
8591 * length = faidx_seq_len(self.fastafile, ref) # <<<<<<<<<<<<<< | |
8592 * if length == -1: | |
8593 * raise KeyError("sequence '%s' not present" % contig) | |
8594 */ | |
8595 __pyx_v_length = faidx_seq_len(__pyx_v_self->fastafile, __pyx_v_ref); | |
8596 } | |
8597 | |
8598 /* "pysam/libcfaidx.pyx":298 | |
8599 * contig_b = force_bytes(contig) | |
8600 * ref = contig_b | |
8601 * with nogil: # <<<<<<<<<<<<<< | |
8602 * length = faidx_seq_len(self.fastafile, ref) | |
8603 * if length == -1: | |
8604 */ | |
8605 /*finally:*/ { | |
8606 /*normal exit:*/{ | |
8607 #ifdef WITH_THREAD | |
8608 __Pyx_FastGIL_Forget(); | |
8609 Py_BLOCK_THREADS | |
8610 #endif | |
8611 goto __pyx_L10; | |
8612 } | |
8613 __pyx_L10:; | |
8614 } | |
8615 } | |
8616 | |
8617 /* "pysam/libcfaidx.pyx":300 | |
8618 * with nogil: | |
8619 * length = faidx_seq_len(self.fastafile, ref) | |
8620 * if length == -1: # <<<<<<<<<<<<<< | |
8621 * raise KeyError("sequence '%s' not present" % contig) | |
8622 * if rstart >= length: | |
8623 */ | |
8624 __pyx_t_6 = (__pyx_v_length == -1L); | |
8625 if (unlikely(__pyx_t_6)) { | |
8626 | |
8627 /* "pysam/libcfaidx.pyx":301 | |
8628 * length = faidx_seq_len(self.fastafile, ref) | |
8629 * if length == -1: | |
8630 * raise KeyError("sequence '%s' not present" % contig) # <<<<<<<<<<<<<< | |
8631 * if rstart >= length: | |
8632 * return "" | |
8633 */ | |
8634 __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_sequence_s_not_present, __pyx_v_contig); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) | |
8635 __Pyx_GOTREF(__pyx_t_1); | |
8636 __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L1_error) | |
8637 __Pyx_GOTREF(__pyx_t_8); | |
8638 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8639 __Pyx_Raise(__pyx_t_8, 0, 0, 0); | |
8640 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
8641 __PYX_ERR(0, 301, __pyx_L1_error) | |
8642 | |
8643 /* "pysam/libcfaidx.pyx":300 | |
8644 * with nogil: | |
8645 * length = faidx_seq_len(self.fastafile, ref) | |
8646 * if length == -1: # <<<<<<<<<<<<<< | |
8647 * raise KeyError("sequence '%s' not present" % contig) | |
8648 * if rstart >= length: | |
8649 */ | |
8650 } | |
8651 | |
8652 /* "pysam/libcfaidx.pyx":302 | |
8653 * if length == -1: | |
8654 * raise KeyError("sequence '%s' not present" % contig) | |
8655 * if rstart >= length: # <<<<<<<<<<<<<< | |
8656 * return "" | |
8657 * | |
8658 */ | |
8659 __pyx_t_6 = (__pyx_v_rstart >= __pyx_v_length); | |
8660 if (__pyx_t_6) { | |
8661 | |
8662 /* "pysam/libcfaidx.pyx":303 | |
8663 * raise KeyError("sequence '%s' not present" % contig) | |
8664 * if rstart >= length: | |
8665 * return "" # <<<<<<<<<<<<<< | |
8666 * | |
8667 * # fai_fetch adds a '\0' at the end | |
8668 */ | |
8669 __Pyx_XDECREF(__pyx_r); | |
8670 __Pyx_INCREF(__pyx_kp_u__11); | |
8671 __pyx_r = __pyx_kp_u__11; | |
8672 goto __pyx_L0; | |
8673 | |
8674 /* "pysam/libcfaidx.pyx":302 | |
8675 * if length == -1: | |
8676 * raise KeyError("sequence '%s' not present" % contig) | |
8677 * if rstart >= length: # <<<<<<<<<<<<<< | |
8678 * return "" | |
8679 * | |
8680 */ | |
8681 } | |
8682 | |
8683 /* "pysam/libcfaidx.pyx":306 | |
8684 * | |
8685 * # fai_fetch adds a '\0' at the end | |
8686 * with nogil: # <<<<<<<<<<<<<< | |
8687 * seq = faidx_fetch_seq(self.fastafile, | |
8688 * ref, | |
8689 */ | |
8690 { | |
8691 #ifdef WITH_THREAD | |
8692 PyThreadState *_save; | |
8693 _save = NULL; | |
8694 Py_UNBLOCK_THREADS | |
8695 __Pyx_FastGIL_Remember(); | |
8696 #endif | |
8697 /*try:*/ { | |
8698 | |
8699 /* "pysam/libcfaidx.pyx":307 | |
8700 * # fai_fetch adds a '\0' at the end | |
8701 * with nogil: | |
8702 * seq = faidx_fetch_seq(self.fastafile, # <<<<<<<<<<<<<< | |
8703 * ref, | |
8704 * rstart, | |
8705 */ | |
8706 __pyx_v_seq = faidx_fetch_seq(__pyx_v_self->fastafile, __pyx_v_ref, __pyx_v_rstart, (__pyx_v_rend - 1), (&__pyx_v_length)); | |
8707 } | |
8708 | |
8709 /* "pysam/libcfaidx.pyx":306 | |
8710 * | |
8711 * # fai_fetch adds a '\0' at the end | |
8712 * with nogil: # <<<<<<<<<<<<<< | |
8713 * seq = faidx_fetch_seq(self.fastafile, | |
8714 * ref, | |
8715 */ | |
8716 /*finally:*/ { | |
8717 /*normal exit:*/{ | |
8718 #ifdef WITH_THREAD | |
8719 __Pyx_FastGIL_Forget(); | |
8720 Py_BLOCK_THREADS | |
8721 #endif | |
8722 goto __pyx_L15; | |
8723 } | |
8724 __pyx_L15:; | |
8725 } | |
8726 } | |
8727 | |
8728 /* "pysam/libcfaidx.pyx":313 | |
8729 * &length) | |
8730 * | |
8731 * if not seq: # <<<<<<<<<<<<<< | |
8732 * if errno: | |
8733 * raise IOError(errno, strerror(errno)) | |
8734 */ | |
8735 __pyx_t_6 = (!(__pyx_v_seq != 0)); | |
8736 if (__pyx_t_6) { | |
8737 | |
8738 /* "pysam/libcfaidx.pyx":314 | |
8739 * | |
8740 * if not seq: | |
8741 * if errno: # <<<<<<<<<<<<<< | |
8742 * raise IOError(errno, strerror(errno)) | |
8743 * else: | |
8744 */ | |
8745 __pyx_t_6 = (errno != 0); | |
8746 if (unlikely(__pyx_t_6)) { | |
8747 | |
8748 /* "pysam/libcfaidx.pyx":315 | |
8749 * if not seq: | |
8750 * if errno: | |
8751 * raise IOError(errno, strerror(errno)) # <<<<<<<<<<<<<< | |
8752 * else: | |
8753 * raise ValueError("failure when retrieving sequence on '%s'" % contig) | |
8754 */ | |
8755 __pyx_t_8 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 315, __pyx_L1_error) | |
8756 __Pyx_GOTREF(__pyx_t_8); | |
8757 __pyx_t_1 = __Pyx_PyBytes_FromString(strerror(errno)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error) | |
8758 __Pyx_GOTREF(__pyx_t_1); | |
8759 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error) | |
8760 __Pyx_GOTREF(__pyx_t_3); | |
8761 __Pyx_GIVEREF(__pyx_t_8); | |
8762 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8)) __PYX_ERR(0, 315, __pyx_L1_error); | |
8763 __Pyx_GIVEREF(__pyx_t_1); | |
8764 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error); | |
8765 __pyx_t_8 = 0; | |
8766 __pyx_t_1 = 0; | |
8767 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error) | |
8768 __Pyx_GOTREF(__pyx_t_1); | |
8769 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
8770 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
8771 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8772 __PYX_ERR(0, 315, __pyx_L1_error) | |
8773 | |
8774 /* "pysam/libcfaidx.pyx":314 | |
8775 * | |
8776 * if not seq: | |
8777 * if errno: # <<<<<<<<<<<<<< | |
8778 * raise IOError(errno, strerror(errno)) | |
8779 * else: | |
8780 */ | |
8781 } | |
8782 | |
8783 /* "pysam/libcfaidx.pyx":317 | |
8784 * raise IOError(errno, strerror(errno)) | |
8785 * else: | |
8786 * raise ValueError("failure when retrieving sequence on '%s'" % contig) # <<<<<<<<<<<<<< | |
8787 * | |
8788 * try: | |
8789 */ | |
8790 /*else*/ { | |
8791 __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_failure_when_retrieving_sequence, __pyx_v_contig); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) | |
8792 __Pyx_GOTREF(__pyx_t_1); | |
8793 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) | |
8794 __Pyx_GOTREF(__pyx_t_3); | |
8795 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8796 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
8797 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
8798 __PYX_ERR(0, 317, __pyx_L1_error) | |
8799 } | |
8800 | |
8801 /* "pysam/libcfaidx.pyx":313 | |
8802 * &length) | |
8803 * | |
8804 * if not seq: # <<<<<<<<<<<<<< | |
8805 * if errno: | |
8806 * raise IOError(errno, strerror(errno)) | |
8807 */ | |
8808 } | |
8809 | |
8810 /* "pysam/libcfaidx.pyx":319 | |
8811 * raise ValueError("failure when retrieving sequence on '%s'" % contig) | |
8812 * | |
8813 * try: # <<<<<<<<<<<<<< | |
8814 * return charptr_to_str(seq) | |
8815 * finally: | |
8816 */ | |
8817 /*try:*/ { | |
8818 | |
8819 /* "pysam/libcfaidx.pyx":320 | |
8820 * | |
8821 * try: | |
8822 * return charptr_to_str(seq) # <<<<<<<<<<<<<< | |
8823 * finally: | |
8824 * free(seq) | |
8825 */ | |
8826 __Pyx_XDECREF(__pyx_r); | |
8827 __pyx_t_3 = __pyx_f_5pysam_9libcutils_charptr_to_str(__pyx_v_seq, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L19_error) | |
8828 __Pyx_GOTREF(__pyx_t_3); | |
8829 __pyx_r = __pyx_t_3; | |
8830 __pyx_t_3 = 0; | |
8831 goto __pyx_L18_return; | |
8832 } | |
8833 | |
8834 /* "pysam/libcfaidx.pyx":322 | |
8835 * return charptr_to_str(seq) | |
8836 * finally: | |
8837 * free(seq) # <<<<<<<<<<<<<< | |
8838 * | |
8839 * cdef char *_fetch(self, char *reference, int start, int end, int *length) except? NULL: | |
8840 */ | |
8841 /*finally:*/ { | |
8842 __pyx_L19_error:; | |
8843 /*exception exit:*/{ | |
8844 __Pyx_PyThreadState_declare | |
8845 __Pyx_PyThreadState_assign | |
8846 __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; | |
8847 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
8848 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; | |
8849 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
8850 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; | |
8851 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; | |
8852 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); | |
8853 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); | |
8854 __Pyx_XGOTREF(__pyx_t_15); | |
8855 __Pyx_XGOTREF(__pyx_t_16); | |
8856 __Pyx_XGOTREF(__pyx_t_17); | |
8857 __Pyx_XGOTREF(__pyx_t_18); | |
8858 __Pyx_XGOTREF(__pyx_t_19); | |
8859 __Pyx_XGOTREF(__pyx_t_20); | |
8860 __pyx_t_12 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_14 = __pyx_filename; | |
8861 { | |
8862 free(__pyx_v_seq); | |
8863 } | |
8864 if (PY_MAJOR_VERSION >= 3) { | |
8865 __Pyx_XGIVEREF(__pyx_t_18); | |
8866 __Pyx_XGIVEREF(__pyx_t_19); | |
8867 __Pyx_XGIVEREF(__pyx_t_20); | |
8868 __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); | |
8869 } | |
8870 __Pyx_XGIVEREF(__pyx_t_15); | |
8871 __Pyx_XGIVEREF(__pyx_t_16); | |
8872 __Pyx_XGIVEREF(__pyx_t_17); | |
8873 __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17); | |
8874 __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; | |
8875 __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_14; | |
8876 goto __pyx_L1_error; | |
8877 } | |
8878 __pyx_L18_return: { | |
8879 __pyx_t_20 = __pyx_r; | |
8880 __pyx_r = 0; | |
8881 free(__pyx_v_seq); | |
8882 __pyx_r = __pyx_t_20; | |
8883 __pyx_t_20 = 0; | |
8884 goto __pyx_L0; | |
8885 } | |
8886 } | |
8887 | |
8888 /* "pysam/libcfaidx.pyx":242 | |
8889 * return self._lengths | |
8890 * | |
8891 * def fetch(self, # <<<<<<<<<<<<<< | |
8892 * reference=None, | |
8893 * start=None, | |
8894 */ | |
8895 | |
8896 /* function exit code */ | |
8897 __pyx_L1_error:; | |
8898 __Pyx_XDECREF(__pyx_t_1); | |
8899 __Pyx_XDECREF(__pyx_t_2); | |
8900 __Pyx_XDECREF(__pyx_t_3); | |
8901 __Pyx_XDECREF(__pyx_t_8); | |
8902 __Pyx_XDECREF(__pyx_t_9); | |
8903 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.fetch", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
8904 __pyx_r = NULL; | |
8905 __pyx_L0:; | |
8906 __Pyx_XDECREF(__pyx_v_contig); | |
8907 __Pyx_XDECREF(__pyx_v_contig_b); | |
8908 __Pyx_XGIVEREF(__pyx_r); | |
8909 __Pyx_TraceReturn(__pyx_r, 0); | |
8910 __Pyx_RefNannyFinishContext(); | |
8911 return __pyx_r; | |
8912 } | |
8913 | |
8914 /* "pysam/libcfaidx.pyx":324 | |
8915 * free(seq) | |
8916 * | |
8917 * cdef char *_fetch(self, char *reference, int start, int end, int *length) except? NULL: # <<<<<<<<<<<<<< | |
8918 * '''fetch sequence for reference, start and end''' | |
8919 * | |
8920 */ | |
8921 | |
8922 static char *__pyx_f_5pysam_9libcfaidx_9FastaFile__fetch(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, char *__pyx_v_reference, int __pyx_v_start, int __pyx_v_end, int *__pyx_v_length) { | |
8923 char *__pyx_v_seq; | |
8924 char *__pyx_r; | |
8925 __Pyx_TraceDeclarations | |
8926 __Pyx_RefNannyDeclarations | |
8927 int __pyx_t_1; | |
8928 PyObject *__pyx_t_2 = NULL; | |
8929 PyObject *__pyx_t_3 = NULL; | |
8930 PyObject *__pyx_t_4 = NULL; | |
8931 int __pyx_lineno = 0; | |
8932 const char *__pyx_filename = NULL; | |
8933 int __pyx_clineno = 0; | |
8934 __Pyx_RefNannySetupContext("_fetch", 1); | |
8935 __Pyx_TraceCall("_fetch", __pyx_f[0], 324, 0, __PYX_ERR(0, 324, __pyx_L1_error)); | |
8936 | |
8937 /* "pysam/libcfaidx.pyx":328 | |
8938 * | |
8939 * cdef char *seq | |
8940 * with nogil: # <<<<<<<<<<<<<< | |
8941 * seq = faidx_fetch_seq(self.fastafile, | |
8942 * reference, | |
8943 */ | |
8944 { | |
8945 #ifdef WITH_THREAD | |
8946 PyThreadState *_save; | |
8947 _save = NULL; | |
8948 Py_UNBLOCK_THREADS | |
8949 __Pyx_FastGIL_Remember(); | |
8950 #endif | |
8951 /*try:*/ { | |
8952 | |
8953 /* "pysam/libcfaidx.pyx":329 | |
8954 * cdef char *seq | |
8955 * with nogil: | |
8956 * seq = faidx_fetch_seq(self.fastafile, # <<<<<<<<<<<<<< | |
8957 * reference, | |
8958 * start, | |
8959 */ | |
8960 __pyx_v_seq = faidx_fetch_seq(__pyx_v_self->fastafile, __pyx_v_reference, __pyx_v_start, (__pyx_v_end - 1), __pyx_v_length); | |
8961 } | |
8962 | |
8963 /* "pysam/libcfaidx.pyx":328 | |
8964 * | |
8965 * cdef char *seq | |
8966 * with nogil: # <<<<<<<<<<<<<< | |
8967 * seq = faidx_fetch_seq(self.fastafile, | |
8968 * reference, | |
8969 */ | |
8970 /*finally:*/ { | |
8971 /*normal exit:*/{ | |
8972 #ifdef WITH_THREAD | |
8973 __Pyx_FastGIL_Forget(); | |
8974 Py_BLOCK_THREADS | |
8975 #endif | |
8976 goto __pyx_L5; | |
8977 } | |
8978 __pyx_L5:; | |
8979 } | |
8980 } | |
8981 | |
8982 /* "pysam/libcfaidx.pyx":335 | |
8983 * length) | |
8984 * | |
8985 * if not seq: # <<<<<<<<<<<<<< | |
8986 * if errno: | |
8987 * raise IOError(errno, strerror(errno)) | |
8988 */ | |
8989 __pyx_t_1 = (!(__pyx_v_seq != 0)); | |
8990 if (__pyx_t_1) { | |
8991 | |
8992 /* "pysam/libcfaidx.pyx":336 | |
8993 * | |
8994 * if not seq: | |
8995 * if errno: # <<<<<<<<<<<<<< | |
8996 * raise IOError(errno, strerror(errno)) | |
8997 * else: | |
8998 */ | |
8999 __pyx_t_1 = (errno != 0); | |
9000 if (unlikely(__pyx_t_1)) { | |
9001 | |
9002 /* "pysam/libcfaidx.pyx":337 | |
9003 * if not seq: | |
9004 * if errno: | |
9005 * raise IOError(errno, strerror(errno)) # <<<<<<<<<<<<<< | |
9006 * else: | |
9007 * raise ValueError("failure when retrieving sequence on '%s'" % reference) | |
9008 */ | |
9009 __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) | |
9010 __Pyx_GOTREF(__pyx_t_2); | |
9011 __pyx_t_3 = __Pyx_PyBytes_FromString(strerror(errno)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error) | |
9012 __Pyx_GOTREF(__pyx_t_3); | |
9013 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error) | |
9014 __Pyx_GOTREF(__pyx_t_4); | |
9015 __Pyx_GIVEREF(__pyx_t_2); | |
9016 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error); | |
9017 __Pyx_GIVEREF(__pyx_t_3); | |
9018 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error); | |
9019 __pyx_t_2 = 0; | |
9020 __pyx_t_3 = 0; | |
9021 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error) | |
9022 __Pyx_GOTREF(__pyx_t_3); | |
9023 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
9024 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
9025 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
9026 __PYX_ERR(0, 337, __pyx_L1_error) | |
9027 | |
9028 /* "pysam/libcfaidx.pyx":336 | |
9029 * | |
9030 * if not seq: | |
9031 * if errno: # <<<<<<<<<<<<<< | |
9032 * raise IOError(errno, strerror(errno)) | |
9033 * else: | |
9034 */ | |
9035 } | |
9036 | |
9037 /* "pysam/libcfaidx.pyx":339 | |
9038 * raise IOError(errno, strerror(errno)) | |
9039 * else: | |
9040 * raise ValueError("failure when retrieving sequence on '%s'" % reference) # <<<<<<<<<<<<<< | |
9041 * | |
9042 * return seq | |
9043 */ | |
9044 /*else*/ { | |
9045 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_reference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __pyx_L1_error) | |
9046 __Pyx_GOTREF(__pyx_t_3); | |
9047 __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_failure_when_retrieving_sequence, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 339, __pyx_L1_error) | |
9048 __Pyx_GOTREF(__pyx_t_4); | |
9049 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
9050 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __pyx_L1_error) | |
9051 __Pyx_GOTREF(__pyx_t_3); | |
9052 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
9053 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
9054 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
9055 __PYX_ERR(0, 339, __pyx_L1_error) | |
9056 } | |
9057 | |
9058 /* "pysam/libcfaidx.pyx":335 | |
9059 * length) | |
9060 * | |
9061 * if not seq: # <<<<<<<<<<<<<< | |
9062 * if errno: | |
9063 * raise IOError(errno, strerror(errno)) | |
9064 */ | |
9065 } | |
9066 | |
9067 /* "pysam/libcfaidx.pyx":341 | |
9068 * raise ValueError("failure when retrieving sequence on '%s'" % reference) | |
9069 * | |
9070 * return seq # <<<<<<<<<<<<<< | |
9071 * | |
9072 * def get_reference_length(self, reference): | |
9073 */ | |
9074 __pyx_r = __pyx_v_seq; | |
9075 goto __pyx_L0; | |
9076 | |
9077 /* "pysam/libcfaidx.pyx":324 | |
9078 * free(seq) | |
9079 * | |
9080 * cdef char *_fetch(self, char *reference, int start, int end, int *length) except? NULL: # <<<<<<<<<<<<<< | |
9081 * '''fetch sequence for reference, start and end''' | |
9082 * | |
9083 */ | |
9084 | |
9085 /* function exit code */ | |
9086 __pyx_L1_error:; | |
9087 __Pyx_XDECREF(__pyx_t_2); | |
9088 __Pyx_XDECREF(__pyx_t_3); | |
9089 __Pyx_XDECREF(__pyx_t_4); | |
9090 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile._fetch", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9091 __pyx_r = NULL; | |
9092 __pyx_L0:; | |
9093 __Pyx_TraceReturn(Py_None, 0); | |
9094 __Pyx_RefNannyFinishContext(); | |
9095 return __pyx_r; | |
9096 } | |
9097 | |
9098 /* "pysam/libcfaidx.pyx":343 | |
9099 * return seq | |
9100 * | |
9101 * def get_reference_length(self, reference): # <<<<<<<<<<<<<< | |
9102 * '''return the length of reference.''' | |
9103 * return self.reference2length[reference] | |
9104 */ | |
9105 | |
9106 /* Python wrapper */ | |
9107 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_19get_reference_length(PyObject *__pyx_v_self, | |
9108 #if CYTHON_METH_FASTCALL | |
9109 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
9110 #else | |
9111 PyObject *__pyx_args, PyObject *__pyx_kwds | |
9112 #endif | |
9113 ); /*proto*/ | |
9114 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastaFile_18get_reference_length, "FastaFile.get_reference_length(self, reference)\nreturn the length of reference."); | |
9115 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastaFile_19get_reference_length = {"get_reference_length", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_19get_reference_length, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_18get_reference_length}; | |
9116 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_19get_reference_length(PyObject *__pyx_v_self, | |
9117 #if CYTHON_METH_FASTCALL | |
9118 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
9119 #else | |
9120 PyObject *__pyx_args, PyObject *__pyx_kwds | |
9121 #endif | |
9122 ) { | |
9123 PyObject *__pyx_v_reference = 0; | |
9124 #if !CYTHON_METH_FASTCALL | |
9125 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
9126 #endif | |
9127 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9128 PyObject* values[1] = {0}; | |
9129 int __pyx_lineno = 0; | |
9130 const char *__pyx_filename = NULL; | |
9131 int __pyx_clineno = 0; | |
9132 PyObject *__pyx_r = 0; | |
9133 __Pyx_RefNannyDeclarations | |
9134 __Pyx_RefNannySetupContext("get_reference_length (wrapper)", 0); | |
9135 #if !CYTHON_METH_FASTCALL | |
9136 #if CYTHON_ASSUME_SAFE_MACROS | |
9137 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
9138 #else | |
9139 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
9140 #endif | |
9141 #endif | |
9142 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
9143 { | |
9144 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reference,0}; | |
9145 if (__pyx_kwds) { | |
9146 Py_ssize_t kw_args; | |
9147 switch (__pyx_nargs) { | |
9148 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
9149 CYTHON_FALLTHROUGH; | |
9150 case 0: break; | |
9151 default: goto __pyx_L5_argtuple_error; | |
9152 } | |
9153 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
9154 switch (__pyx_nargs) { | |
9155 case 0: | |
9156 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reference)) != 0)) { | |
9157 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
9158 kw_args--; | |
9159 } | |
9160 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L3_error) | |
9161 else goto __pyx_L5_argtuple_error; | |
9162 } | |
9163 if (unlikely(kw_args > 0)) { | |
9164 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
9165 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_reference_length") < 0)) __PYX_ERR(0, 343, __pyx_L3_error) | |
9166 } | |
9167 } else if (unlikely(__pyx_nargs != 1)) { | |
9168 goto __pyx_L5_argtuple_error; | |
9169 } else { | |
9170 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
9171 } | |
9172 __pyx_v_reference = values[0]; | |
9173 } | |
9174 goto __pyx_L6_skip; | |
9175 __pyx_L5_argtuple_error:; | |
9176 __Pyx_RaiseArgtupleInvalid("get_reference_length", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 343, __pyx_L3_error) | |
9177 __pyx_L6_skip:; | |
9178 goto __pyx_L4_argument_unpacking_done; | |
9179 __pyx_L3_error:; | |
9180 { | |
9181 Py_ssize_t __pyx_temp; | |
9182 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
9183 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
9184 } | |
9185 } | |
9186 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.get_reference_length", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9187 __Pyx_RefNannyFinishContext(); | |
9188 return NULL; | |
9189 __pyx_L4_argument_unpacking_done:; | |
9190 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_18get_reference_length(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self), __pyx_v_reference); | |
9191 | |
9192 /* function exit code */ | |
9193 { | |
9194 Py_ssize_t __pyx_temp; | |
9195 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
9196 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
9197 } | |
9198 } | |
9199 __Pyx_RefNannyFinishContext(); | |
9200 return __pyx_r; | |
9201 } | |
9202 | |
9203 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_18get_reference_length(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_reference) { | |
9204 PyObject *__pyx_r = NULL; | |
9205 __Pyx_TraceDeclarations | |
9206 __Pyx_RefNannyDeclarations | |
9207 PyObject *__pyx_t_1 = NULL; | |
9208 int __pyx_lineno = 0; | |
9209 const char *__pyx_filename = NULL; | |
9210 int __pyx_clineno = 0; | |
9211 __Pyx_TraceFrameInit(__pyx_codeobj__12) | |
9212 __Pyx_RefNannySetupContext("get_reference_length", 1); | |
9213 __Pyx_TraceCall("get_reference_length", __pyx_f[0], 343, 0, __PYX_ERR(0, 343, __pyx_L1_error)); | |
9214 | |
9215 /* "pysam/libcfaidx.pyx":345 | |
9216 * def get_reference_length(self, reference): | |
9217 * '''return the length of reference.''' | |
9218 * return self.reference2length[reference] # <<<<<<<<<<<<<< | |
9219 * | |
9220 * def __getitem__(self, reference): | |
9221 */ | |
9222 __Pyx_XDECREF(__pyx_r); | |
9223 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->reference2length, __pyx_v_reference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error) | |
9224 __Pyx_GOTREF(__pyx_t_1); | |
9225 __pyx_r = __pyx_t_1; | |
9226 __pyx_t_1 = 0; | |
9227 goto __pyx_L0; | |
9228 | |
9229 /* "pysam/libcfaidx.pyx":343 | |
9230 * return seq | |
9231 * | |
9232 * def get_reference_length(self, reference): # <<<<<<<<<<<<<< | |
9233 * '''return the length of reference.''' | |
9234 * return self.reference2length[reference] | |
9235 */ | |
9236 | |
9237 /* function exit code */ | |
9238 __pyx_L1_error:; | |
9239 __Pyx_XDECREF(__pyx_t_1); | |
9240 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.get_reference_length", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9241 __pyx_r = NULL; | |
9242 __pyx_L0:; | |
9243 __Pyx_XGIVEREF(__pyx_r); | |
9244 __Pyx_TraceReturn(__pyx_r, 0); | |
9245 __Pyx_RefNannyFinishContext(); | |
9246 return __pyx_r; | |
9247 } | |
9248 | |
9249 /* "pysam/libcfaidx.pyx":347 | |
9250 * return self.reference2length[reference] | |
9251 * | |
9252 * def __getitem__(self, reference): # <<<<<<<<<<<<<< | |
9253 * return self.fetch(reference) | |
9254 * | |
9255 */ | |
9256 | |
9257 /* Python wrapper */ | |
9258 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_21__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_reference); /*proto*/ | |
9259 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_21__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_reference) { | |
9260 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9261 PyObject *__pyx_r = 0; | |
9262 __Pyx_RefNannyDeclarations | |
9263 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); | |
9264 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
9265 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_20__getitem__(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self), ((PyObject *)__pyx_v_reference)); | |
9266 | |
9267 /* function exit code */ | |
9268 __Pyx_RefNannyFinishContext(); | |
9269 return __pyx_r; | |
9270 } | |
9271 | |
9272 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_20__getitem__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_reference) { | |
9273 PyObject *__pyx_r = NULL; | |
9274 __Pyx_TraceDeclarations | |
9275 __Pyx_RefNannyDeclarations | |
9276 PyObject *__pyx_t_1 = NULL; | |
9277 PyObject *__pyx_t_2 = NULL; | |
9278 PyObject *__pyx_t_3 = NULL; | |
9279 unsigned int __pyx_t_4; | |
9280 int __pyx_lineno = 0; | |
9281 const char *__pyx_filename = NULL; | |
9282 int __pyx_clineno = 0; | |
9283 __Pyx_RefNannySetupContext("__getitem__", 1); | |
9284 __Pyx_TraceCall("__getitem__", __pyx_f[0], 347, 0, __PYX_ERR(0, 347, __pyx_L1_error)); | |
9285 | |
9286 /* "pysam/libcfaidx.pyx":348 | |
9287 * | |
9288 * def __getitem__(self, reference): | |
9289 * return self.fetch(reference) # <<<<<<<<<<<<<< | |
9290 * | |
9291 * def __contains__(self, reference): | |
9292 */ | |
9293 __Pyx_XDECREF(__pyx_r); | |
9294 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fetch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) | |
9295 __Pyx_GOTREF(__pyx_t_2); | |
9296 __pyx_t_3 = NULL; | |
9297 __pyx_t_4 = 0; | |
9298 #if CYTHON_UNPACK_METHODS | |
9299 if (likely(PyMethod_Check(__pyx_t_2))) { | |
9300 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
9301 if (likely(__pyx_t_3)) { | |
9302 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
9303 __Pyx_INCREF(__pyx_t_3); | |
9304 __Pyx_INCREF(function); | |
9305 __Pyx_DECREF_SET(__pyx_t_2, function); | |
9306 __pyx_t_4 = 1; | |
9307 } | |
9308 } | |
9309 #endif | |
9310 { | |
9311 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_reference}; | |
9312 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); | |
9313 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
9314 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) | |
9315 __Pyx_GOTREF(__pyx_t_1); | |
9316 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
9317 } | |
9318 __pyx_r = __pyx_t_1; | |
9319 __pyx_t_1 = 0; | |
9320 goto __pyx_L0; | |
9321 | |
9322 /* "pysam/libcfaidx.pyx":347 | |
9323 * return self.reference2length[reference] | |
9324 * | |
9325 * def __getitem__(self, reference): # <<<<<<<<<<<<<< | |
9326 * return self.fetch(reference) | |
9327 * | |
9328 */ | |
9329 | |
9330 /* function exit code */ | |
9331 __pyx_L1_error:; | |
9332 __Pyx_XDECREF(__pyx_t_1); | |
9333 __Pyx_XDECREF(__pyx_t_2); | |
9334 __Pyx_XDECREF(__pyx_t_3); | |
9335 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9336 __pyx_r = NULL; | |
9337 __pyx_L0:; | |
9338 __Pyx_XGIVEREF(__pyx_r); | |
9339 __Pyx_TraceReturn(__pyx_r, 0); | |
9340 __Pyx_RefNannyFinishContext(); | |
9341 return __pyx_r; | |
9342 } | |
9343 | |
9344 /* "pysam/libcfaidx.pyx":350 | |
9345 * return self.fetch(reference) | |
9346 * | |
9347 * def __contains__(self, reference): # <<<<<<<<<<<<<< | |
9348 * '''return true if reference in fasta file.''' | |
9349 * return reference in self.reference2length | |
9350 */ | |
9351 | |
9352 /* Python wrapper */ | |
9353 static int __pyx_pw_5pysam_9libcfaidx_9FastaFile_23__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_reference); /*proto*/ | |
9354 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastaFile_22__contains__, "return true if reference in fasta file."); | |
9355 #if CYTHON_UPDATE_DESCRIPTOR_DOC | |
9356 struct wrapperbase __pyx_wrapperbase_5pysam_9libcfaidx_9FastaFile_22__contains__; | |
9357 #endif | |
9358 static int __pyx_pw_5pysam_9libcfaidx_9FastaFile_23__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_reference) { | |
9359 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9360 int __pyx_r; | |
9361 __Pyx_RefNannyDeclarations | |
9362 __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); | |
9363 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
9364 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_22__contains__(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self), ((PyObject *)__pyx_v_reference)); | |
9365 | |
9366 /* function exit code */ | |
9367 __Pyx_RefNannyFinishContext(); | |
9368 return __pyx_r; | |
9369 } | |
9370 | |
9371 static int __pyx_pf_5pysam_9libcfaidx_9FastaFile_22__contains__(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_reference) { | |
9372 int __pyx_r; | |
9373 __Pyx_TraceDeclarations | |
9374 int __pyx_t_1; | |
9375 int __pyx_lineno = 0; | |
9376 const char *__pyx_filename = NULL; | |
9377 int __pyx_clineno = 0; | |
9378 __Pyx_TraceCall("__contains__", __pyx_f[0], 350, 0, __PYX_ERR(0, 350, __pyx_L1_error)); | |
9379 | |
9380 /* "pysam/libcfaidx.pyx":352 | |
9381 * def __contains__(self, reference): | |
9382 * '''return true if reference in fasta file.''' | |
9383 * return reference in self.reference2length # <<<<<<<<<<<<<< | |
9384 * | |
9385 * | |
9386 */ | |
9387 __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_reference, __pyx_v_self->reference2length, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) | |
9388 __pyx_r = __pyx_t_1; | |
9389 goto __pyx_L0; | |
9390 | |
9391 /* "pysam/libcfaidx.pyx":350 | |
9392 * return self.fetch(reference) | |
9393 * | |
9394 * def __contains__(self, reference): # <<<<<<<<<<<<<< | |
9395 * '''return true if reference in fasta file.''' | |
9396 * return reference in self.reference2length | |
9397 */ | |
9398 | |
9399 /* function exit code */ | |
9400 __pyx_L1_error:; | |
9401 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9402 __pyx_r = -1; | |
9403 __pyx_L0:; | |
9404 __Pyx_TraceReturn(Py_None, 0); | |
9405 return __pyx_r; | |
9406 } | |
9407 | |
9408 /* "(tree fragment)":1 | |
9409 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
9410 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
9411 * def __setstate_cython__(self, __pyx_state): | |
9412 */ | |
9413 | |
9414 /* Python wrapper */ | |
9415 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_25__reduce_cython__(PyObject *__pyx_v_self, | |
9416 #if CYTHON_METH_FASTCALL | |
9417 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
9418 #else | |
9419 PyObject *__pyx_args, PyObject *__pyx_kwds | |
9420 #endif | |
9421 ); /*proto*/ | |
9422 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastaFile_24__reduce_cython__, "FastaFile.__reduce_cython__(self)"); | |
9423 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastaFile_25__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_25__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_24__reduce_cython__}; | |
9424 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_25__reduce_cython__(PyObject *__pyx_v_self, | |
9425 #if CYTHON_METH_FASTCALL | |
9426 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
9427 #else | |
9428 PyObject *__pyx_args, PyObject *__pyx_kwds | |
9429 #endif | |
9430 ) { | |
9431 #if !CYTHON_METH_FASTCALL | |
9432 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
9433 #endif | |
9434 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9435 PyObject *__pyx_r = 0; | |
9436 __Pyx_RefNannyDeclarations | |
9437 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
9438 #if !CYTHON_METH_FASTCALL | |
9439 #if CYTHON_ASSUME_SAFE_MACROS | |
9440 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
9441 #else | |
9442 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
9443 #endif | |
9444 #endif | |
9445 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
9446 if (unlikely(__pyx_nargs > 0)) { | |
9447 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
9448 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
9449 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_24__reduce_cython__(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self)); | |
9450 | |
9451 /* function exit code */ | |
9452 __Pyx_RefNannyFinishContext(); | |
9453 return __pyx_r; | |
9454 } | |
9455 | |
9456 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self) { | |
9457 PyObject *__pyx_r = NULL; | |
9458 __Pyx_TraceDeclarations | |
9459 __Pyx_RefNannyDeclarations | |
9460 int __pyx_lineno = 0; | |
9461 const char *__pyx_filename = NULL; | |
9462 int __pyx_clineno = 0; | |
9463 __Pyx_TraceFrameInit(__pyx_codeobj__13) | |
9464 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
9465 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
9466 | |
9467 /* "(tree fragment)":2 | |
9468 * def __reduce_cython__(self): | |
9469 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< | |
9470 * def __setstate_cython__(self, __pyx_state): | |
9471 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
9472 */ | |
9473 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); | |
9474 __PYX_ERR(1, 2, __pyx_L1_error) | |
9475 | |
9476 /* "(tree fragment)":1 | |
9477 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
9478 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
9479 * def __setstate_cython__(self, __pyx_state): | |
9480 */ | |
9481 | |
9482 /* function exit code */ | |
9483 __pyx_L1_error:; | |
9484 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9485 __pyx_r = NULL; | |
9486 __Pyx_XGIVEREF(__pyx_r); | |
9487 __Pyx_TraceReturn(__pyx_r, 0); | |
9488 __Pyx_RefNannyFinishContext(); | |
9489 return __pyx_r; | |
9490 } | |
9491 | |
9492 /* "(tree fragment)":3 | |
9493 * def __reduce_cython__(self): | |
9494 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
9495 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
9496 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
9497 */ | |
9498 | |
9499 /* Python wrapper */ | |
9500 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_27__setstate_cython__(PyObject *__pyx_v_self, | |
9501 #if CYTHON_METH_FASTCALL | |
9502 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
9503 #else | |
9504 PyObject *__pyx_args, PyObject *__pyx_kwds | |
9505 #endif | |
9506 ); /*proto*/ | |
9507 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastaFile_26__setstate_cython__, "FastaFile.__setstate_cython__(self, __pyx_state)"); | |
9508 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastaFile_27__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_27__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_26__setstate_cython__}; | |
9509 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastaFile_27__setstate_cython__(PyObject *__pyx_v_self, | |
9510 #if CYTHON_METH_FASTCALL | |
9511 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
9512 #else | |
9513 PyObject *__pyx_args, PyObject *__pyx_kwds | |
9514 #endif | |
9515 ) { | |
9516 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; | |
9517 #if !CYTHON_METH_FASTCALL | |
9518 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
9519 #endif | |
9520 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9521 PyObject* values[1] = {0}; | |
9522 int __pyx_lineno = 0; | |
9523 const char *__pyx_filename = NULL; | |
9524 int __pyx_clineno = 0; | |
9525 PyObject *__pyx_r = 0; | |
9526 __Pyx_RefNannyDeclarations | |
9527 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
9528 #if !CYTHON_METH_FASTCALL | |
9529 #if CYTHON_ASSUME_SAFE_MACROS | |
9530 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
9531 #else | |
9532 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
9533 #endif | |
9534 #endif | |
9535 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
9536 { | |
9537 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
9538 if (__pyx_kwds) { | |
9539 Py_ssize_t kw_args; | |
9540 switch (__pyx_nargs) { | |
9541 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
9542 CYTHON_FALLTHROUGH; | |
9543 case 0: break; | |
9544 default: goto __pyx_L5_argtuple_error; | |
9545 } | |
9546 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
9547 switch (__pyx_nargs) { | |
9548 case 0: | |
9549 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
9550 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
9551 kw_args--; | |
9552 } | |
9553 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) | |
9554 else goto __pyx_L5_argtuple_error; | |
9555 } | |
9556 if (unlikely(kw_args > 0)) { | |
9557 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
9558 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) | |
9559 } | |
9560 } else if (unlikely(__pyx_nargs != 1)) { | |
9561 goto __pyx_L5_argtuple_error; | |
9562 } else { | |
9563 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
9564 } | |
9565 __pyx_v___pyx_state = values[0]; | |
9566 } | |
9567 goto __pyx_L6_skip; | |
9568 __pyx_L5_argtuple_error:; | |
9569 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) | |
9570 __pyx_L6_skip:; | |
9571 goto __pyx_L4_argument_unpacking_done; | |
9572 __pyx_L3_error:; | |
9573 { | |
9574 Py_ssize_t __pyx_temp; | |
9575 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
9576 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
9577 } | |
9578 } | |
9579 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9580 __Pyx_RefNannyFinishContext(); | |
9581 return NULL; | |
9582 __pyx_L4_argument_unpacking_done:; | |
9583 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastaFile_26__setstate_cython__(((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)__pyx_v_self), __pyx_v___pyx_state); | |
9584 | |
9585 /* function exit code */ | |
9586 { | |
9587 Py_ssize_t __pyx_temp; | |
9588 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
9589 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
9590 } | |
9591 } | |
9592 __Pyx_RefNannyFinishContext(); | |
9593 return __pyx_r; | |
9594 } | |
9595 | |
9596 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastaFile_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastaFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { | |
9597 PyObject *__pyx_r = NULL; | |
9598 __Pyx_TraceDeclarations | |
9599 __Pyx_RefNannyDeclarations | |
9600 int __pyx_lineno = 0; | |
9601 const char *__pyx_filename = NULL; | |
9602 int __pyx_clineno = 0; | |
9603 __Pyx_TraceFrameInit(__pyx_codeobj__14) | |
9604 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
9605 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); | |
9606 | |
9607 /* "(tree fragment)":4 | |
9608 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
9609 * def __setstate_cython__(self, __pyx_state): | |
9610 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< | |
9611 */ | |
9612 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); | |
9613 __PYX_ERR(1, 4, __pyx_L1_error) | |
9614 | |
9615 /* "(tree fragment)":3 | |
9616 * def __reduce_cython__(self): | |
9617 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
9618 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
9619 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
9620 */ | |
9621 | |
9622 /* function exit code */ | |
9623 __pyx_L1_error:; | |
9624 __Pyx_AddTraceback("pysam.libcfaidx.FastaFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9625 __pyx_r = NULL; | |
9626 __Pyx_XGIVEREF(__pyx_r); | |
9627 __Pyx_TraceReturn(__pyx_r, 0); | |
9628 __Pyx_RefNannyFinishContext(); | |
9629 return __pyx_r; | |
9630 } | |
9631 | |
9632 /* "pysam/libcfaidx.pyx":357 | |
9633 * cdef class FastqProxy: | |
9634 * """A single entry in a fastq file.""" | |
9635 * def __init__(self): # <<<<<<<<<<<<<< | |
9636 * raise ValueError("do not instantiate FastqProxy directly") | |
9637 * | |
9638 */ | |
9639 | |
9640 /* Python wrapper */ | |
9641 static int __pyx_pw_5pysam_9libcfaidx_10FastqProxy_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
9642 static int __pyx_pw_5pysam_9libcfaidx_10FastqProxy_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
9643 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
9644 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9645 int __pyx_r; | |
9646 __Pyx_RefNannyDeclarations | |
9647 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); | |
9648 #if CYTHON_ASSUME_SAFE_MACROS | |
9649 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
9650 #else | |
9651 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; | |
9652 #endif | |
9653 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
9654 if (unlikely(__pyx_nargs > 0)) { | |
9655 __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1;} | |
9656 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; | |
9657 __pyx_r = __pyx_pf_5pysam_9libcfaidx_10FastqProxy___init__(((struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *)__pyx_v_self)); | |
9658 | |
9659 /* function exit code */ | |
9660 __Pyx_RefNannyFinishContext(); | |
9661 return __pyx_r; | |
9662 } | |
9663 | |
9664 static int __pyx_pf_5pysam_9libcfaidx_10FastqProxy___init__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self) { | |
9665 int __pyx_r; | |
9666 __Pyx_TraceDeclarations | |
9667 __Pyx_RefNannyDeclarations | |
9668 PyObject *__pyx_t_1 = NULL; | |
9669 int __pyx_lineno = 0; | |
9670 const char *__pyx_filename = NULL; | |
9671 int __pyx_clineno = 0; | |
9672 __Pyx_RefNannySetupContext("__init__", 1); | |
9673 __Pyx_TraceCall("__init__", __pyx_f[0], 357, 0, __PYX_ERR(0, 357, __pyx_L1_error)); | |
9674 | |
9675 /* "pysam/libcfaidx.pyx":358 | |
9676 * """A single entry in a fastq file.""" | |
9677 * def __init__(self): | |
9678 * raise ValueError("do not instantiate FastqProxy directly") # <<<<<<<<<<<<<< | |
9679 * | |
9680 * property name: | |
9681 */ | |
9682 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) | |
9683 __Pyx_GOTREF(__pyx_t_1); | |
9684 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
9685 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
9686 __PYX_ERR(0, 358, __pyx_L1_error) | |
9687 | |
9688 /* "pysam/libcfaidx.pyx":357 | |
9689 * cdef class FastqProxy: | |
9690 * """A single entry in a fastq file.""" | |
9691 * def __init__(self): # <<<<<<<<<<<<<< | |
9692 * raise ValueError("do not instantiate FastqProxy directly") | |
9693 * | |
9694 */ | |
9695 | |
9696 /* function exit code */ | |
9697 __pyx_L1_error:; | |
9698 __Pyx_XDECREF(__pyx_t_1); | |
9699 __Pyx_AddTraceback("pysam.libcfaidx.FastqProxy.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9700 __pyx_r = -1; | |
9701 __Pyx_TraceReturn(Py_None, 0); | |
9702 __Pyx_RefNannyFinishContext(); | |
9703 return __pyx_r; | |
9704 } | |
9705 | |
9706 /* "pysam/libcfaidx.pyx":362 | |
9707 * property name: | |
9708 * """The name of each entry in the fastq file.""" | |
9709 * def __get__(self): # <<<<<<<<<<<<<< | |
9710 * return charptr_to_str(self._delegate.name.s) | |
9711 * | |
9712 */ | |
9713 | |
9714 /* Python wrapper */ | |
9715 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
9716 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_4name_1__get__(PyObject *__pyx_v_self) { | |
9717 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9718 PyObject *__pyx_r = 0; | |
9719 __Pyx_RefNannyDeclarations | |
9720 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
9721 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
9722 __pyx_r = __pyx_pf_5pysam_9libcfaidx_10FastqProxy_4name___get__(((struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *)__pyx_v_self)); | |
9723 | |
9724 /* function exit code */ | |
9725 __Pyx_RefNannyFinishContext(); | |
9726 return __pyx_r; | |
9727 } | |
9728 | |
9729 static PyObject *__pyx_pf_5pysam_9libcfaidx_10FastqProxy_4name___get__(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self) { | |
9730 PyObject *__pyx_r = NULL; | |
9731 __Pyx_TraceDeclarations | |
9732 __Pyx_RefNannyDeclarations | |
9733 PyObject *__pyx_t_1 = NULL; | |
9734 int __pyx_lineno = 0; | |
9735 const char *__pyx_filename = NULL; | |
9736 int __pyx_clineno = 0; | |
9737 __Pyx_RefNannySetupContext("__get__", 1); | |
9738 __Pyx_TraceCall("__get__", __pyx_f[0], 362, 0, __PYX_ERR(0, 362, __pyx_L1_error)); | |
9739 | |
9740 /* "pysam/libcfaidx.pyx":363 | |
9741 * """The name of each entry in the fastq file.""" | |
9742 * def __get__(self): | |
9743 * return charptr_to_str(self._delegate.name.s) # <<<<<<<<<<<<<< | |
9744 * | |
9745 * property sequence: | |
9746 */ | |
9747 __Pyx_XDECREF(__pyx_r); | |
9748 __pyx_t_1 = __pyx_f_5pysam_9libcutils_charptr_to_str(__pyx_v_self->_delegate->name.s, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) | |
9749 __Pyx_GOTREF(__pyx_t_1); | |
9750 __pyx_r = __pyx_t_1; | |
9751 __pyx_t_1 = 0; | |
9752 goto __pyx_L0; | |
9753 | |
9754 /* "pysam/libcfaidx.pyx":362 | |
9755 * property name: | |
9756 * """The name of each entry in the fastq file.""" | |
9757 * def __get__(self): # <<<<<<<<<<<<<< | |
9758 * return charptr_to_str(self._delegate.name.s) | |
9759 * | |
9760 */ | |
9761 | |
9762 /* function exit code */ | |
9763 __pyx_L1_error:; | |
9764 __Pyx_XDECREF(__pyx_t_1); | |
9765 __Pyx_AddTraceback("pysam.libcfaidx.FastqProxy.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9766 __pyx_r = NULL; | |
9767 __pyx_L0:; | |
9768 __Pyx_XGIVEREF(__pyx_r); | |
9769 __Pyx_TraceReturn(__pyx_r, 0); | |
9770 __Pyx_RefNannyFinishContext(); | |
9771 return __pyx_r; | |
9772 } | |
9773 | |
9774 /* "pysam/libcfaidx.pyx":367 | |
9775 * property sequence: | |
9776 * """The sequence of each entry in the fastq file.""" | |
9777 * def __get__(self): # <<<<<<<<<<<<<< | |
9778 * return charptr_to_str(self._delegate.seq.s) | |
9779 * | |
9780 */ | |
9781 | |
9782 /* Python wrapper */ | |
9783 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_8sequence_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
9784 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_8sequence_1__get__(PyObject *__pyx_v_self) { | |
9785 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9786 PyObject *__pyx_r = 0; | |
9787 __Pyx_RefNannyDeclarations | |
9788 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
9789 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
9790 __pyx_r = __pyx_pf_5pysam_9libcfaidx_10FastqProxy_8sequence___get__(((struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *)__pyx_v_self)); | |
9791 | |
9792 /* function exit code */ | |
9793 __Pyx_RefNannyFinishContext(); | |
9794 return __pyx_r; | |
9795 } | |
9796 | |
9797 static PyObject *__pyx_pf_5pysam_9libcfaidx_10FastqProxy_8sequence___get__(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self) { | |
9798 PyObject *__pyx_r = NULL; | |
9799 __Pyx_TraceDeclarations | |
9800 __Pyx_RefNannyDeclarations | |
9801 PyObject *__pyx_t_1 = NULL; | |
9802 int __pyx_lineno = 0; | |
9803 const char *__pyx_filename = NULL; | |
9804 int __pyx_clineno = 0; | |
9805 __Pyx_RefNannySetupContext("__get__", 1); | |
9806 __Pyx_TraceCall("__get__", __pyx_f[0], 367, 0, __PYX_ERR(0, 367, __pyx_L1_error)); | |
9807 | |
9808 /* "pysam/libcfaidx.pyx":368 | |
9809 * """The sequence of each entry in the fastq file.""" | |
9810 * def __get__(self): | |
9811 * return charptr_to_str(self._delegate.seq.s) # <<<<<<<<<<<<<< | |
9812 * | |
9813 * property comment: | |
9814 */ | |
9815 __Pyx_XDECREF(__pyx_r); | |
9816 __pyx_t_1 = __pyx_f_5pysam_9libcutils_charptr_to_str(__pyx_v_self->_delegate->seq.s, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) | |
9817 __Pyx_GOTREF(__pyx_t_1); | |
9818 __pyx_r = __pyx_t_1; | |
9819 __pyx_t_1 = 0; | |
9820 goto __pyx_L0; | |
9821 | |
9822 /* "pysam/libcfaidx.pyx":367 | |
9823 * property sequence: | |
9824 * """The sequence of each entry in the fastq file.""" | |
9825 * def __get__(self): # <<<<<<<<<<<<<< | |
9826 * return charptr_to_str(self._delegate.seq.s) | |
9827 * | |
9828 */ | |
9829 | |
9830 /* function exit code */ | |
9831 __pyx_L1_error:; | |
9832 __Pyx_XDECREF(__pyx_t_1); | |
9833 __Pyx_AddTraceback("pysam.libcfaidx.FastqProxy.sequence.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9834 __pyx_r = NULL; | |
9835 __pyx_L0:; | |
9836 __Pyx_XGIVEREF(__pyx_r); | |
9837 __Pyx_TraceReturn(__pyx_r, 0); | |
9838 __Pyx_RefNannyFinishContext(); | |
9839 return __pyx_r; | |
9840 } | |
9841 | |
9842 /* "pysam/libcfaidx.pyx":371 | |
9843 * | |
9844 * property comment: | |
9845 * def __get__(self): # <<<<<<<<<<<<<< | |
9846 * if self._delegate.comment.l: | |
9847 * return charptr_to_str(self._delegate.comment.s) | |
9848 */ | |
9849 | |
9850 /* Python wrapper */ | |
9851 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_7comment_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
9852 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_7comment_1__get__(PyObject *__pyx_v_self) { | |
9853 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9854 PyObject *__pyx_r = 0; | |
9855 __Pyx_RefNannyDeclarations | |
9856 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
9857 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
9858 __pyx_r = __pyx_pf_5pysam_9libcfaidx_10FastqProxy_7comment___get__(((struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *)__pyx_v_self)); | |
9859 | |
9860 /* function exit code */ | |
9861 __Pyx_RefNannyFinishContext(); | |
9862 return __pyx_r; | |
9863 } | |
9864 | |
9865 static PyObject *__pyx_pf_5pysam_9libcfaidx_10FastqProxy_7comment___get__(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self) { | |
9866 PyObject *__pyx_r = NULL; | |
9867 __Pyx_TraceDeclarations | |
9868 __Pyx_RefNannyDeclarations | |
9869 int __pyx_t_1; | |
9870 PyObject *__pyx_t_2 = NULL; | |
9871 int __pyx_lineno = 0; | |
9872 const char *__pyx_filename = NULL; | |
9873 int __pyx_clineno = 0; | |
9874 __Pyx_RefNannySetupContext("__get__", 1); | |
9875 __Pyx_TraceCall("__get__", __pyx_f[0], 371, 0, __PYX_ERR(0, 371, __pyx_L1_error)); | |
9876 | |
9877 /* "pysam/libcfaidx.pyx":372 | |
9878 * property comment: | |
9879 * def __get__(self): | |
9880 * if self._delegate.comment.l: # <<<<<<<<<<<<<< | |
9881 * return charptr_to_str(self._delegate.comment.s) | |
9882 * else: | |
9883 */ | |
9884 __pyx_t_1 = (__pyx_v_self->_delegate->comment.l != 0); | |
9885 if (__pyx_t_1) { | |
9886 | |
9887 /* "pysam/libcfaidx.pyx":373 | |
9888 * def __get__(self): | |
9889 * if self._delegate.comment.l: | |
9890 * return charptr_to_str(self._delegate.comment.s) # <<<<<<<<<<<<<< | |
9891 * else: | |
9892 * return None | |
9893 */ | |
9894 __Pyx_XDECREF(__pyx_r); | |
9895 __pyx_t_2 = __pyx_f_5pysam_9libcutils_charptr_to_str(__pyx_v_self->_delegate->comment.s, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) | |
9896 __Pyx_GOTREF(__pyx_t_2); | |
9897 __pyx_r = __pyx_t_2; | |
9898 __pyx_t_2 = 0; | |
9899 goto __pyx_L0; | |
9900 | |
9901 /* "pysam/libcfaidx.pyx":372 | |
9902 * property comment: | |
9903 * def __get__(self): | |
9904 * if self._delegate.comment.l: # <<<<<<<<<<<<<< | |
9905 * return charptr_to_str(self._delegate.comment.s) | |
9906 * else: | |
9907 */ | |
9908 } | |
9909 | |
9910 /* "pysam/libcfaidx.pyx":375 | |
9911 * return charptr_to_str(self._delegate.comment.s) | |
9912 * else: | |
9913 * return None # <<<<<<<<<<<<<< | |
9914 * | |
9915 * property quality: | |
9916 */ | |
9917 /*else*/ { | |
9918 __Pyx_XDECREF(__pyx_r); | |
9919 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
9920 goto __pyx_L0; | |
9921 } | |
9922 | |
9923 /* "pysam/libcfaidx.pyx":371 | |
9924 * | |
9925 * property comment: | |
9926 * def __get__(self): # <<<<<<<<<<<<<< | |
9927 * if self._delegate.comment.l: | |
9928 * return charptr_to_str(self._delegate.comment.s) | |
9929 */ | |
9930 | |
9931 /* function exit code */ | |
9932 __pyx_L1_error:; | |
9933 __Pyx_XDECREF(__pyx_t_2); | |
9934 __Pyx_AddTraceback("pysam.libcfaidx.FastqProxy.comment.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
9935 __pyx_r = NULL; | |
9936 __pyx_L0:; | |
9937 __Pyx_XGIVEREF(__pyx_r); | |
9938 __Pyx_TraceReturn(__pyx_r, 0); | |
9939 __Pyx_RefNannyFinishContext(); | |
9940 return __pyx_r; | |
9941 } | |
9942 | |
9943 /* "pysam/libcfaidx.pyx":379 | |
9944 * property quality: | |
9945 * """The quality score of each entry in the fastq file, represented as a string.""" | |
9946 * def __get__(self): # <<<<<<<<<<<<<< | |
9947 * if self._delegate.qual.l: | |
9948 * return charptr_to_str(self._delegate.qual.s) | |
9949 */ | |
9950 | |
9951 /* Python wrapper */ | |
9952 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_7quality_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
9953 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_7quality_1__get__(PyObject *__pyx_v_self) { | |
9954 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
9955 PyObject *__pyx_r = 0; | |
9956 __Pyx_RefNannyDeclarations | |
9957 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
9958 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
9959 __pyx_r = __pyx_pf_5pysam_9libcfaidx_10FastqProxy_7quality___get__(((struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *)__pyx_v_self)); | |
9960 | |
9961 /* function exit code */ | |
9962 __Pyx_RefNannyFinishContext(); | |
9963 return __pyx_r; | |
9964 } | |
9965 | |
9966 static PyObject *__pyx_pf_5pysam_9libcfaidx_10FastqProxy_7quality___get__(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self) { | |
9967 PyObject *__pyx_r = NULL; | |
9968 __Pyx_TraceDeclarations | |
9969 __Pyx_RefNannyDeclarations | |
9970 int __pyx_t_1; | |
9971 PyObject *__pyx_t_2 = NULL; | |
9972 int __pyx_lineno = 0; | |
9973 const char *__pyx_filename = NULL; | |
9974 int __pyx_clineno = 0; | |
9975 __Pyx_RefNannySetupContext("__get__", 1); | |
9976 __Pyx_TraceCall("__get__", __pyx_f[0], 379, 0, __PYX_ERR(0, 379, __pyx_L1_error)); | |
9977 | |
9978 /* "pysam/libcfaidx.pyx":380 | |
9979 * """The quality score of each entry in the fastq file, represented as a string.""" | |
9980 * def __get__(self): | |
9981 * if self._delegate.qual.l: # <<<<<<<<<<<<<< | |
9982 * return charptr_to_str(self._delegate.qual.s) | |
9983 * else: | |
9984 */ | |
9985 __pyx_t_1 = (__pyx_v_self->_delegate->qual.l != 0); | |
9986 if (__pyx_t_1) { | |
9987 | |
9988 /* "pysam/libcfaidx.pyx":381 | |
9989 * def __get__(self): | |
9990 * if self._delegate.qual.l: | |
9991 * return charptr_to_str(self._delegate.qual.s) # <<<<<<<<<<<<<< | |
9992 * else: | |
9993 * return None | |
9994 */ | |
9995 __Pyx_XDECREF(__pyx_r); | |
9996 __pyx_t_2 = __pyx_f_5pysam_9libcutils_charptr_to_str(__pyx_v_self->_delegate->qual.s, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) | |
9997 __Pyx_GOTREF(__pyx_t_2); | |
9998 __pyx_r = __pyx_t_2; | |
9999 __pyx_t_2 = 0; | |
10000 goto __pyx_L0; | |
10001 | |
10002 /* "pysam/libcfaidx.pyx":380 | |
10003 * """The quality score of each entry in the fastq file, represented as a string.""" | |
10004 * def __get__(self): | |
10005 * if self._delegate.qual.l: # <<<<<<<<<<<<<< | |
10006 * return charptr_to_str(self._delegate.qual.s) | |
10007 * else: | |
10008 */ | |
10009 } | |
10010 | |
10011 /* "pysam/libcfaidx.pyx":383 | |
10012 * return charptr_to_str(self._delegate.qual.s) | |
10013 * else: | |
10014 * return None # <<<<<<<<<<<<<< | |
10015 * | |
10016 * cdef cython.str to_string(self): | |
10017 */ | |
10018 /*else*/ { | |
10019 __Pyx_XDECREF(__pyx_r); | |
10020 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
10021 goto __pyx_L0; | |
10022 } | |
10023 | |
10024 /* "pysam/libcfaidx.pyx":379 | |
10025 * property quality: | |
10026 * """The quality score of each entry in the fastq file, represented as a string.""" | |
10027 * def __get__(self): # <<<<<<<<<<<<<< | |
10028 * if self._delegate.qual.l: | |
10029 * return charptr_to_str(self._delegate.qual.s) | |
10030 */ | |
10031 | |
10032 /* function exit code */ | |
10033 __pyx_L1_error:; | |
10034 __Pyx_XDECREF(__pyx_t_2); | |
10035 __Pyx_AddTraceback("pysam.libcfaidx.FastqProxy.quality.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10036 __pyx_r = NULL; | |
10037 __pyx_L0:; | |
10038 __Pyx_XGIVEREF(__pyx_r); | |
10039 __Pyx_TraceReturn(__pyx_r, 0); | |
10040 __Pyx_RefNannyFinishContext(); | |
10041 return __pyx_r; | |
10042 } | |
10043 | |
10044 /* "pysam/libcfaidx.pyx":385 | |
10045 * return None | |
10046 * | |
10047 * cdef cython.str to_string(self): # <<<<<<<<<<<<<< | |
10048 * if self.comment is None: | |
10049 * comment = "" | |
10050 */ | |
10051 | |
10052 static PyObject *__pyx_f_5pysam_9libcfaidx_10FastqProxy_to_string(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self) { | |
10053 PyObject *__pyx_v_comment = NULL; | |
10054 PyObject *__pyx_r = NULL; | |
10055 __Pyx_TraceDeclarations | |
10056 __Pyx_RefNannyDeclarations | |
10057 PyObject *__pyx_t_1 = NULL; | |
10058 int __pyx_t_2; | |
10059 PyObject *__pyx_t_3 = NULL; | |
10060 Py_ssize_t __pyx_t_4; | |
10061 Py_UCS4 __pyx_t_5; | |
10062 PyObject *__pyx_t_6 = NULL; | |
10063 int __pyx_lineno = 0; | |
10064 const char *__pyx_filename = NULL; | |
10065 int __pyx_clineno = 0; | |
10066 __Pyx_RefNannySetupContext("to_string", 1); | |
10067 __Pyx_TraceCall("to_string", __pyx_f[0], 385, 0, __PYX_ERR(0, 385, __pyx_L1_error)); | |
10068 | |
10069 /* "pysam/libcfaidx.pyx":386 | |
10070 * | |
10071 * cdef cython.str to_string(self): | |
10072 * if self.comment is None: # <<<<<<<<<<<<<< | |
10073 * comment = "" | |
10074 * else: | |
10075 */ | |
10076 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_comment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error) | |
10077 __Pyx_GOTREF(__pyx_t_1); | |
10078 __pyx_t_2 = (__pyx_t_1 == Py_None); | |
10079 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
10080 if (__pyx_t_2) { | |
10081 | |
10082 /* "pysam/libcfaidx.pyx":387 | |
10083 * cdef cython.str to_string(self): | |
10084 * if self.comment is None: | |
10085 * comment = "" # <<<<<<<<<<<<<< | |
10086 * else: | |
10087 * comment = " %s" % self.comment | |
10088 */ | |
10089 __Pyx_INCREF(__pyx_kp_u__11); | |
10090 __pyx_v_comment = __pyx_kp_u__11; | |
10091 | |
10092 /* "pysam/libcfaidx.pyx":386 | |
10093 * | |
10094 * cdef cython.str to_string(self): | |
10095 * if self.comment is None: # <<<<<<<<<<<<<< | |
10096 * comment = "" | |
10097 * else: | |
10098 */ | |
10099 goto __pyx_L3; | |
10100 } | |
10101 | |
10102 /* "pysam/libcfaidx.pyx":389 | |
10103 * comment = "" | |
10104 * else: | |
10105 * comment = " %s" % self.comment # <<<<<<<<<<<<<< | |
10106 * | |
10107 * if self.quality is None: | |
10108 */ | |
10109 /*else*/ { | |
10110 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_comment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) | |
10111 __Pyx_GOTREF(__pyx_t_1); | |
10112 __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error) | |
10113 __Pyx_GOTREF(__pyx_t_3); | |
10114 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
10115 __pyx_v_comment = ((PyObject*)__pyx_t_3); | |
10116 __pyx_t_3 = 0; | |
10117 } | |
10118 __pyx_L3:; | |
10119 | |
10120 /* "pysam/libcfaidx.pyx":391 | |
10121 * comment = " %s" % self.comment | |
10122 * | |
10123 * if self.quality is None: # <<<<<<<<<<<<<< | |
10124 * return ">%s%s\n%s" % (self.name, comment, self.sequence) | |
10125 * else: | |
10126 */ | |
10127 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_quality); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error) | |
10128 __Pyx_GOTREF(__pyx_t_3); | |
10129 __pyx_t_2 = (__pyx_t_3 == Py_None); | |
10130 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
10131 if (__pyx_t_2) { | |
10132 | |
10133 /* "pysam/libcfaidx.pyx":392 | |
10134 * | |
10135 * if self.quality is None: | |
10136 * return ">%s%s\n%s" % (self.name, comment, self.sequence) # <<<<<<<<<<<<<< | |
10137 * else: | |
10138 * return "@%s%s\n%s\n+\n%s" % (self.name, comment, | |
10139 */ | |
10140 __Pyx_XDECREF(__pyx_r); | |
10141 __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error) | |
10142 __Pyx_GOTREF(__pyx_t_3); | |
10143 __pyx_t_4 = 0; | |
10144 __pyx_t_5 = 127; | |
10145 __Pyx_INCREF(__pyx_kp_u__16); | |
10146 __pyx_t_4 += 1; | |
10147 __Pyx_GIVEREF(__pyx_kp_u__16); | |
10148 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__16); | |
10149 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error) | |
10150 __Pyx_GOTREF(__pyx_t_1); | |
10151 __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_1), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error) | |
10152 __Pyx_GOTREF(__pyx_t_6); | |
10153 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
10154 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5; | |
10155 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); | |
10156 __Pyx_GIVEREF(__pyx_t_6); | |
10157 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6); | |
10158 __pyx_t_6 = 0; | |
10159 __Pyx_INCREF(__pyx_v_comment); | |
10160 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_comment) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_comment) : __pyx_t_5; | |
10161 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_comment); | |
10162 __Pyx_GIVEREF(__pyx_v_comment); | |
10163 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_comment); | |
10164 __Pyx_INCREF(__pyx_kp_u__17); | |
10165 __pyx_t_4 += 1; | |
10166 __Pyx_GIVEREF(__pyx_kp_u__17); | |
10167 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_kp_u__17); | |
10168 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sequence); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error) | |
10169 __Pyx_GOTREF(__pyx_t_6); | |
10170 __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error) | |
10171 __Pyx_GOTREF(__pyx_t_1); | |
10172 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
10173 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_5; | |
10174 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1); | |
10175 __Pyx_GIVEREF(__pyx_t_1); | |
10176 PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_1); | |
10177 __pyx_t_1 = 0; | |
10178 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error) | |
10179 __Pyx_GOTREF(__pyx_t_1); | |
10180 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
10181 __pyx_r = ((PyObject*)__pyx_t_1); | |
10182 __pyx_t_1 = 0; | |
10183 goto __pyx_L0; | |
10184 | |
10185 /* "pysam/libcfaidx.pyx":391 | |
10186 * comment = " %s" % self.comment | |
10187 * | |
10188 * if self.quality is None: # <<<<<<<<<<<<<< | |
10189 * return ">%s%s\n%s" % (self.name, comment, self.sequence) | |
10190 * else: | |
10191 */ | |
10192 } | |
10193 | |
10194 /* "pysam/libcfaidx.pyx":394 | |
10195 * return ">%s%s\n%s" % (self.name, comment, self.sequence) | |
10196 * else: | |
10197 * return "@%s%s\n%s\n+\n%s" % (self.name, comment, # <<<<<<<<<<<<<< | |
10198 * self.sequence, self.quality) | |
10199 * | |
10200 */ | |
10201 /*else*/ { | |
10202 __Pyx_XDECREF(__pyx_r); | |
10203 __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error) | |
10204 __Pyx_GOTREF(__pyx_t_1); | |
10205 __pyx_t_4 = 0; | |
10206 __pyx_t_5 = 127; | |
10207 __Pyx_INCREF(__pyx_kp_u__18); | |
10208 __pyx_t_4 += 1; | |
10209 __Pyx_GIVEREF(__pyx_kp_u__18); | |
10210 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__18); | |
10211 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) | |
10212 __Pyx_GOTREF(__pyx_t_3); | |
10213 __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_3), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 394, __pyx_L1_error) | |
10214 __Pyx_GOTREF(__pyx_t_6); | |
10215 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
10216 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5; | |
10217 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); | |
10218 __Pyx_GIVEREF(__pyx_t_6); | |
10219 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6); | |
10220 __pyx_t_6 = 0; | |
10221 __Pyx_INCREF(__pyx_v_comment); | |
10222 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_comment) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_comment) : __pyx_t_5; | |
10223 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_comment); | |
10224 __Pyx_GIVEREF(__pyx_v_comment); | |
10225 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_comment); | |
10226 __Pyx_INCREF(__pyx_kp_u__17); | |
10227 __pyx_t_4 += 1; | |
10228 __Pyx_GIVEREF(__pyx_kp_u__17); | |
10229 PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__17); | |
10230 | |
10231 /* "pysam/libcfaidx.pyx":395 | |
10232 * else: | |
10233 * return "@%s%s\n%s\n+\n%s" % (self.name, comment, | |
10234 * self.sequence, self.quality) # <<<<<<<<<<<<<< | |
10235 * | |
10236 * cdef cython.str tostring(self): | |
10237 */ | |
10238 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sequence); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) | |
10239 __Pyx_GOTREF(__pyx_t_6); | |
10240 __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error) | |
10241 __Pyx_GOTREF(__pyx_t_3); | |
10242 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
10243 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_5; | |
10244 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); | |
10245 __Pyx_GIVEREF(__pyx_t_3); | |
10246 PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3); | |
10247 __pyx_t_3 = 0; | |
10248 __Pyx_INCREF(__pyx_kp_u__19); | |
10249 __pyx_t_4 += 3; | |
10250 __Pyx_GIVEREF(__pyx_kp_u__19); | |
10251 PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u__19); | |
10252 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_quality); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error) | |
10253 __Pyx_GOTREF(__pyx_t_3); | |
10254 __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_3), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) | |
10255 __Pyx_GOTREF(__pyx_t_6); | |
10256 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
10257 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5; | |
10258 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6); | |
10259 __Pyx_GIVEREF(__pyx_t_6); | |
10260 PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_6); | |
10261 __pyx_t_6 = 0; | |
10262 | |
10263 /* "pysam/libcfaidx.pyx":394 | |
10264 * return ">%s%s\n%s" % (self.name, comment, self.sequence) | |
10265 * else: | |
10266 * return "@%s%s\n%s\n+\n%s" % (self.name, comment, # <<<<<<<<<<<<<< | |
10267 * self.sequence, self.quality) | |
10268 * | |
10269 */ | |
10270 __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 394, __pyx_L1_error) | |
10271 __Pyx_GOTREF(__pyx_t_6); | |
10272 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
10273 __pyx_r = ((PyObject*)__pyx_t_6); | |
10274 __pyx_t_6 = 0; | |
10275 goto __pyx_L0; | |
10276 } | |
10277 | |
10278 /* "pysam/libcfaidx.pyx":385 | |
10279 * return None | |
10280 * | |
10281 * cdef cython.str to_string(self): # <<<<<<<<<<<<<< | |
10282 * if self.comment is None: | |
10283 * comment = "" | |
10284 */ | |
10285 | |
10286 /* function exit code */ | |
10287 __pyx_L1_error:; | |
10288 __Pyx_XDECREF(__pyx_t_1); | |
10289 __Pyx_XDECREF(__pyx_t_3); | |
10290 __Pyx_XDECREF(__pyx_t_6); | |
10291 __Pyx_AddTraceback("pysam.libcfaidx.FastqProxy.to_string", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10292 __pyx_r = 0; | |
10293 __pyx_L0:; | |
10294 __Pyx_XDECREF(__pyx_v_comment); | |
10295 __Pyx_XGIVEREF(__pyx_r); | |
10296 __Pyx_TraceReturn(__pyx_r, 0); | |
10297 __Pyx_RefNannyFinishContext(); | |
10298 return __pyx_r; | |
10299 } | |
10300 | |
10301 /* "pysam/libcfaidx.pyx":397 | |
10302 * self.sequence, self.quality) | |
10303 * | |
10304 * cdef cython.str tostring(self): # <<<<<<<<<<<<<< | |
10305 * """deprecated : use :meth:`to_string`""" | |
10306 * return self.to_string() | |
10307 */ | |
10308 | |
10309 static PyObject *__pyx_f_5pysam_9libcfaidx_10FastqProxy_tostring(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self) { | |
10310 PyObject *__pyx_r = NULL; | |
10311 __Pyx_TraceDeclarations | |
10312 __Pyx_RefNannyDeclarations | |
10313 PyObject *__pyx_t_1 = NULL; | |
10314 int __pyx_lineno = 0; | |
10315 const char *__pyx_filename = NULL; | |
10316 int __pyx_clineno = 0; | |
10317 __Pyx_RefNannySetupContext("tostring", 1); | |
10318 __Pyx_TraceCall("tostring", __pyx_f[0], 397, 0, __PYX_ERR(0, 397, __pyx_L1_error)); | |
10319 | |
10320 /* "pysam/libcfaidx.pyx":399 | |
10321 * cdef cython.str tostring(self): | |
10322 * """deprecated : use :meth:`to_string`""" | |
10323 * return self.to_string() # <<<<<<<<<<<<<< | |
10324 * | |
10325 * def __str__(self): | |
10326 */ | |
10327 __Pyx_XDECREF(__pyx_r); | |
10328 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqProxy *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error) | |
10329 __Pyx_GOTREF(__pyx_t_1); | |
10330 __pyx_r = ((PyObject*)__pyx_t_1); | |
10331 __pyx_t_1 = 0; | |
10332 goto __pyx_L0; | |
10333 | |
10334 /* "pysam/libcfaidx.pyx":397 | |
10335 * self.sequence, self.quality) | |
10336 * | |
10337 * cdef cython.str tostring(self): # <<<<<<<<<<<<<< | |
10338 * """deprecated : use :meth:`to_string`""" | |
10339 * return self.to_string() | |
10340 */ | |
10341 | |
10342 /* function exit code */ | |
10343 __pyx_L1_error:; | |
10344 __Pyx_XDECREF(__pyx_t_1); | |
10345 __Pyx_AddTraceback("pysam.libcfaidx.FastqProxy.tostring", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10346 __pyx_r = 0; | |
10347 __pyx_L0:; | |
10348 __Pyx_XGIVEREF(__pyx_r); | |
10349 __Pyx_TraceReturn(__pyx_r, 0); | |
10350 __Pyx_RefNannyFinishContext(); | |
10351 return __pyx_r; | |
10352 } | |
10353 | |
10354 /* "pysam/libcfaidx.pyx":401 | |
10355 * return self.to_string() | |
10356 * | |
10357 * def __str__(self): # <<<<<<<<<<<<<< | |
10358 * return self.to_string() | |
10359 * | |
10360 */ | |
10361 | |
10362 /* Python wrapper */ | |
10363 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_3__str__(PyObject *__pyx_v_self); /*proto*/ | |
10364 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_3__str__(PyObject *__pyx_v_self) { | |
10365 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10366 PyObject *__pyx_r = 0; | |
10367 __Pyx_RefNannyDeclarations | |
10368 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); | |
10369 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
10370 __pyx_r = __pyx_pf_5pysam_9libcfaidx_10FastqProxy_2__str__(((struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *)__pyx_v_self)); | |
10371 | |
10372 /* function exit code */ | |
10373 __Pyx_RefNannyFinishContext(); | |
10374 return __pyx_r; | |
10375 } | |
10376 | |
10377 static PyObject *__pyx_pf_5pysam_9libcfaidx_10FastqProxy_2__str__(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self) { | |
10378 PyObject *__pyx_r = NULL; | |
10379 __Pyx_TraceDeclarations | |
10380 __Pyx_RefNannyDeclarations | |
10381 PyObject *__pyx_t_1 = NULL; | |
10382 int __pyx_lineno = 0; | |
10383 const char *__pyx_filename = NULL; | |
10384 int __pyx_clineno = 0; | |
10385 __Pyx_RefNannySetupContext("__str__", 1); | |
10386 __Pyx_TraceCall("__str__", __pyx_f[0], 401, 0, __PYX_ERR(0, 401, __pyx_L1_error)); | |
10387 | |
10388 /* "pysam/libcfaidx.pyx":402 | |
10389 * | |
10390 * def __str__(self): | |
10391 * return self.to_string() # <<<<<<<<<<<<<< | |
10392 * | |
10393 * cpdef array.array get_quality_array(self, int offset=33): | |
10394 */ | |
10395 __Pyx_XDECREF(__pyx_r); | |
10396 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqProxy *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error) | |
10397 __Pyx_GOTREF(__pyx_t_1); | |
10398 __pyx_r = __pyx_t_1; | |
10399 __pyx_t_1 = 0; | |
10400 goto __pyx_L0; | |
10401 | |
10402 /* "pysam/libcfaidx.pyx":401 | |
10403 * return self.to_string() | |
10404 * | |
10405 * def __str__(self): # <<<<<<<<<<<<<< | |
10406 * return self.to_string() | |
10407 * | |
10408 */ | |
10409 | |
10410 /* function exit code */ | |
10411 __pyx_L1_error:; | |
10412 __Pyx_XDECREF(__pyx_t_1); | |
10413 __Pyx_AddTraceback("pysam.libcfaidx.FastqProxy.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10414 __pyx_r = NULL; | |
10415 __pyx_L0:; | |
10416 __Pyx_XGIVEREF(__pyx_r); | |
10417 __Pyx_TraceReturn(__pyx_r, 0); | |
10418 __Pyx_RefNannyFinishContext(); | |
10419 return __pyx_r; | |
10420 } | |
10421 | |
10422 /* "pysam/libcfaidx.pyx":404 | |
10423 * return self.to_string() | |
10424 * | |
10425 * cpdef array.array get_quality_array(self, int offset=33): # <<<<<<<<<<<<<< | |
10426 * '''return quality values as integer array after subtracting offset.''' | |
10427 * if self.quality is None: | |
10428 */ | |
10429 | |
10430 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_5get_quality_array(PyObject *__pyx_v_self, | |
10431 #if CYTHON_METH_FASTCALL | |
10432 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
10433 #else | |
10434 PyObject *__pyx_args, PyObject *__pyx_kwds | |
10435 #endif | |
10436 ); /*proto*/ | |
10437 static arrayobject *__pyx_f_5pysam_9libcfaidx_10FastqProxy_get_quality_array(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcfaidx_10FastqProxy_get_quality_array *__pyx_optional_args) { | |
10438 int __pyx_v_offset = ((int)33); | |
10439 arrayobject *__pyx_r = NULL; | |
10440 __Pyx_TraceDeclarations | |
10441 __Pyx_RefNannyDeclarations | |
10442 PyObject *__pyx_t_1 = NULL; | |
10443 PyObject *__pyx_t_2 = NULL; | |
10444 PyObject *__pyx_t_3 = NULL; | |
10445 PyObject *__pyx_t_4 = NULL; | |
10446 PyObject *__pyx_t_5 = NULL; | |
10447 unsigned int __pyx_t_6; | |
10448 int __pyx_t_7; | |
10449 struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array __pyx_t_8; | |
10450 int __pyx_lineno = 0; | |
10451 const char *__pyx_filename = NULL; | |
10452 int __pyx_clineno = 0; | |
10453 __Pyx_TraceFrameInit(__pyx_codeobj__20) | |
10454 __Pyx_RefNannySetupContext("get_quality_array", 1); | |
10455 __Pyx_TraceCall("get_quality_array", __pyx_f[0], 404, 0, __PYX_ERR(0, 404, __pyx_L1_error)); | |
10456 if (__pyx_optional_args) { | |
10457 if (__pyx_optional_args->__pyx_n > 0) { | |
10458 __pyx_v_offset = __pyx_optional_args->offset; | |
10459 } | |
10460 } | |
10461 /* Check if called by wrapper */ | |
10462 if (unlikely(__pyx_skip_dispatch)) ; | |
10463 /* Check if overridden in Python */ | |
10464 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { | |
10465 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS | |
10466 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; | |
10467 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { | |
10468 PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); | |
10469 #endif | |
10470 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_quality_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) | |
10471 __Pyx_GOTREF(__pyx_t_1); | |
10472 if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_5pysam_9libcfaidx_10FastqProxy_5get_quality_array)) { | |
10473 __Pyx_XDECREF((PyObject *)__pyx_r); | |
10474 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) | |
10475 __Pyx_GOTREF(__pyx_t_3); | |
10476 __Pyx_INCREF(__pyx_t_1); | |
10477 __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL; | |
10478 __pyx_t_6 = 0; | |
10479 #if CYTHON_UNPACK_METHODS | |
10480 if (unlikely(PyMethod_Check(__pyx_t_4))) { | |
10481 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); | |
10482 if (likely(__pyx_t_5)) { | |
10483 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
10484 __Pyx_INCREF(__pyx_t_5); | |
10485 __Pyx_INCREF(function); | |
10486 __Pyx_DECREF_SET(__pyx_t_4, function); | |
10487 __pyx_t_6 = 1; | |
10488 } | |
10489 } | |
10490 #endif | |
10491 { | |
10492 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; | |
10493 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); | |
10494 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
10495 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
10496 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) | |
10497 __Pyx_GOTREF(__pyx_t_2); | |
10498 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
10499 } | |
10500 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7cpython_5array_array))))) __PYX_ERR(0, 404, __pyx_L1_error) | |
10501 __pyx_r = ((arrayobject *)__pyx_t_2); | |
10502 __pyx_t_2 = 0; | |
10503 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
10504 goto __pyx_L0; | |
10505 } | |
10506 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS | |
10507 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); | |
10508 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); | |
10509 if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) { | |
10510 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; | |
10511 } | |
10512 #endif | |
10513 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
10514 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS | |
10515 } | |
10516 #endif | |
10517 } | |
10518 | |
10519 /* "pysam/libcfaidx.pyx":406 | |
10520 * cpdef array.array get_quality_array(self, int offset=33): | |
10521 * '''return quality values as integer array after subtracting offset.''' | |
10522 * if self.quality is None: # <<<<<<<<<<<<<< | |
10523 * return None | |
10524 * return qualitystring_to_array(force_bytes(self.quality), | |
10525 */ | |
10526 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_quality); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error) | |
10527 __Pyx_GOTREF(__pyx_t_1); | |
10528 __pyx_t_7 = (__pyx_t_1 == Py_None); | |
10529 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
10530 if (__pyx_t_7) { | |
10531 | |
10532 /* "pysam/libcfaidx.pyx":407 | |
10533 * '''return quality values as integer array after subtracting offset.''' | |
10534 * if self.quality is None: | |
10535 * return None # <<<<<<<<<<<<<< | |
10536 * return qualitystring_to_array(force_bytes(self.quality), | |
10537 * offset=offset) | |
10538 */ | |
10539 __Pyx_XDECREF((PyObject *)__pyx_r); | |
10540 __pyx_r = ((arrayobject *)Py_None); __Pyx_INCREF(Py_None); | |
10541 goto __pyx_L0; | |
10542 | |
10543 /* "pysam/libcfaidx.pyx":406 | |
10544 * cpdef array.array get_quality_array(self, int offset=33): | |
10545 * '''return quality values as integer array after subtracting offset.''' | |
10546 * if self.quality is None: # <<<<<<<<<<<<<< | |
10547 * return None | |
10548 * return qualitystring_to_array(force_bytes(self.quality), | |
10549 */ | |
10550 } | |
10551 | |
10552 /* "pysam/libcfaidx.pyx":408 | |
10553 * if self.quality is None: | |
10554 * return None | |
10555 * return qualitystring_to_array(force_bytes(self.quality), # <<<<<<<<<<<<<< | |
10556 * offset=offset) | |
10557 * | |
10558 */ | |
10559 __Pyx_XDECREF((PyObject *)__pyx_r); | |
10560 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_quality); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error) | |
10561 __Pyx_GOTREF(__pyx_t_1); | |
10562 __pyx_t_2 = __pyx_f_5pysam_9libcutils_force_bytes(__pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) | |
10563 __Pyx_GOTREF(__pyx_t_2); | |
10564 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
10565 | |
10566 /* "pysam/libcfaidx.pyx":409 | |
10567 * return None | |
10568 * return qualitystring_to_array(force_bytes(self.quality), | |
10569 * offset=offset) # <<<<<<<<<<<<<< | |
10570 * | |
10571 * cdef class FastxRecord: | |
10572 */ | |
10573 __pyx_t_8.__pyx_n = 1; | |
10574 __pyx_t_8.offset = __pyx_v_offset; | |
10575 __pyx_t_1 = ((PyObject *)__pyx_f_5pysam_9libcutils_qualitystring_to_array(__pyx_t_2, 0, &__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error) | |
10576 __Pyx_GOTREF(__pyx_t_1); | |
10577 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
10578 __pyx_r = ((arrayobject *)__pyx_t_1); | |
10579 __pyx_t_1 = 0; | |
10580 goto __pyx_L0; | |
10581 | |
10582 /* "pysam/libcfaidx.pyx":404 | |
10583 * return self.to_string() | |
10584 * | |
10585 * cpdef array.array get_quality_array(self, int offset=33): # <<<<<<<<<<<<<< | |
10586 * '''return quality values as integer array after subtracting offset.''' | |
10587 * if self.quality is None: | |
10588 */ | |
10589 | |
10590 /* function exit code */ | |
10591 __pyx_L1_error:; | |
10592 __Pyx_XDECREF(__pyx_t_1); | |
10593 __Pyx_XDECREF(__pyx_t_2); | |
10594 __Pyx_XDECREF(__pyx_t_3); | |
10595 __Pyx_XDECREF(__pyx_t_4); | |
10596 __Pyx_XDECREF(__pyx_t_5); | |
10597 __Pyx_AddTraceback("pysam.libcfaidx.FastqProxy.get_quality_array", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10598 __pyx_r = 0; | |
10599 __pyx_L0:; | |
10600 __Pyx_XGIVEREF((PyObject *)__pyx_r); | |
10601 __Pyx_TraceReturn(__pyx_r, 0); | |
10602 __Pyx_RefNannyFinishContext(); | |
10603 return __pyx_r; | |
10604 } | |
10605 | |
10606 /* Python wrapper */ | |
10607 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_5get_quality_array(PyObject *__pyx_v_self, | |
10608 #if CYTHON_METH_FASTCALL | |
10609 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
10610 #else | |
10611 PyObject *__pyx_args, PyObject *__pyx_kwds | |
10612 #endif | |
10613 ); /*proto*/ | |
10614 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_10FastqProxy_4get_quality_array, "FastqProxy.get_quality_array(self, int offset=33) -> array\nreturn quality values as integer array after subtracting offset."); | |
10615 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_10FastqProxy_5get_quality_array = {"get_quality_array", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_10FastqProxy_5get_quality_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_10FastqProxy_4get_quality_array}; | |
10616 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_5get_quality_array(PyObject *__pyx_v_self, | |
10617 #if CYTHON_METH_FASTCALL | |
10618 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
10619 #else | |
10620 PyObject *__pyx_args, PyObject *__pyx_kwds | |
10621 #endif | |
10622 ) { | |
10623 int __pyx_v_offset; | |
10624 #if !CYTHON_METH_FASTCALL | |
10625 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
10626 #endif | |
10627 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10628 PyObject* values[1] = {0}; | |
10629 int __pyx_lineno = 0; | |
10630 const char *__pyx_filename = NULL; | |
10631 int __pyx_clineno = 0; | |
10632 PyObject *__pyx_r = 0; | |
10633 __Pyx_RefNannyDeclarations | |
10634 __Pyx_RefNannySetupContext("get_quality_array (wrapper)", 0); | |
10635 #if !CYTHON_METH_FASTCALL | |
10636 #if CYTHON_ASSUME_SAFE_MACROS | |
10637 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
10638 #else | |
10639 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
10640 #endif | |
10641 #endif | |
10642 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
10643 { | |
10644 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,0}; | |
10645 if (__pyx_kwds) { | |
10646 Py_ssize_t kw_args; | |
10647 switch (__pyx_nargs) { | |
10648 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
10649 CYTHON_FALLTHROUGH; | |
10650 case 0: break; | |
10651 default: goto __pyx_L5_argtuple_error; | |
10652 } | |
10653 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
10654 switch (__pyx_nargs) { | |
10655 case 0: | |
10656 if (kw_args > 0) { | |
10657 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset); | |
10658 if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
10659 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 404, __pyx_L3_error) | |
10660 } | |
10661 } | |
10662 if (unlikely(kw_args > 0)) { | |
10663 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
10664 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_quality_array") < 0)) __PYX_ERR(0, 404, __pyx_L3_error) | |
10665 } | |
10666 } else { | |
10667 switch (__pyx_nargs) { | |
10668 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
10669 CYTHON_FALLTHROUGH; | |
10670 case 0: break; | |
10671 default: goto __pyx_L5_argtuple_error; | |
10672 } | |
10673 } | |
10674 if (values[0]) { | |
10675 __pyx_v_offset = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 404, __pyx_L3_error) | |
10676 } else { | |
10677 __pyx_v_offset = ((int)33); | |
10678 } | |
10679 } | |
10680 goto __pyx_L6_skip; | |
10681 __pyx_L5_argtuple_error:; | |
10682 __Pyx_RaiseArgtupleInvalid("get_quality_array", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 404, __pyx_L3_error) | |
10683 __pyx_L6_skip:; | |
10684 goto __pyx_L4_argument_unpacking_done; | |
10685 __pyx_L3_error:; | |
10686 { | |
10687 Py_ssize_t __pyx_temp; | |
10688 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
10689 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
10690 } | |
10691 } | |
10692 __Pyx_AddTraceback("pysam.libcfaidx.FastqProxy.get_quality_array", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10693 __Pyx_RefNannyFinishContext(); | |
10694 return NULL; | |
10695 __pyx_L4_argument_unpacking_done:; | |
10696 __pyx_r = __pyx_pf_5pysam_9libcfaidx_10FastqProxy_4get_quality_array(((struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *)__pyx_v_self), __pyx_v_offset); | |
10697 | |
10698 /* function exit code */ | |
10699 { | |
10700 Py_ssize_t __pyx_temp; | |
10701 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
10702 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
10703 } | |
10704 } | |
10705 __Pyx_RefNannyFinishContext(); | |
10706 return __pyx_r; | |
10707 } | |
10708 | |
10709 static PyObject *__pyx_pf_5pysam_9libcfaidx_10FastqProxy_4get_quality_array(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self, int __pyx_v_offset) { | |
10710 PyObject *__pyx_r = NULL; | |
10711 __Pyx_TraceDeclarations | |
10712 __Pyx_RefNannyDeclarations | |
10713 PyObject *__pyx_t_1 = NULL; | |
10714 struct __pyx_opt_args_5pysam_9libcfaidx_10FastqProxy_get_quality_array __pyx_t_2; | |
10715 int __pyx_lineno = 0; | |
10716 const char *__pyx_filename = NULL; | |
10717 int __pyx_clineno = 0; | |
10718 __Pyx_TraceFrameInit(__pyx_codeobj__20) | |
10719 __Pyx_RefNannySetupContext("get_quality_array", 1); | |
10720 __Pyx_TraceCall("get_quality_array (wrapper)", __pyx_f[0], 404, 0, __PYX_ERR(0, 404, __pyx_L1_error)); | |
10721 __Pyx_XDECREF(__pyx_r); | |
10722 __pyx_t_2.__pyx_n = 1; | |
10723 __pyx_t_2.offset = __pyx_v_offset; | |
10724 __pyx_t_1 = ((PyObject *)__pyx_vtabptr_5pysam_9libcfaidx_FastqProxy->get_quality_array(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) | |
10725 __Pyx_GOTREF(__pyx_t_1); | |
10726 __pyx_r = __pyx_t_1; | |
10727 __pyx_t_1 = 0; | |
10728 goto __pyx_L0; | |
10729 | |
10730 /* function exit code */ | |
10731 __pyx_L1_error:; | |
10732 __Pyx_XDECREF(__pyx_t_1); | |
10733 __Pyx_AddTraceback("pysam.libcfaidx.FastqProxy.get_quality_array", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10734 __pyx_r = NULL; | |
10735 __pyx_L0:; | |
10736 __Pyx_XGIVEREF(__pyx_r); | |
10737 __Pyx_TraceReturn(__pyx_r, 0); | |
10738 __Pyx_RefNannyFinishContext(); | |
10739 return __pyx_r; | |
10740 } | |
10741 | |
10742 /* "(tree fragment)":1 | |
10743 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
10744 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" | |
10745 * def __setstate_cython__(self, __pyx_state): | |
10746 */ | |
10747 | |
10748 /* Python wrapper */ | |
10749 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_7__reduce_cython__(PyObject *__pyx_v_self, | |
10750 #if CYTHON_METH_FASTCALL | |
10751 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
10752 #else | |
10753 PyObject *__pyx_args, PyObject *__pyx_kwds | |
10754 #endif | |
10755 ); /*proto*/ | |
10756 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_10FastqProxy_6__reduce_cython__, "FastqProxy.__reduce_cython__(self)"); | |
10757 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_10FastqProxy_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_10FastqProxy_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_10FastqProxy_6__reduce_cython__}; | |
10758 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_7__reduce_cython__(PyObject *__pyx_v_self, | |
10759 #if CYTHON_METH_FASTCALL | |
10760 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
10761 #else | |
10762 PyObject *__pyx_args, PyObject *__pyx_kwds | |
10763 #endif | |
10764 ) { | |
10765 #if !CYTHON_METH_FASTCALL | |
10766 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
10767 #endif | |
10768 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10769 PyObject *__pyx_r = 0; | |
10770 __Pyx_RefNannyDeclarations | |
10771 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
10772 #if !CYTHON_METH_FASTCALL | |
10773 #if CYTHON_ASSUME_SAFE_MACROS | |
10774 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
10775 #else | |
10776 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
10777 #endif | |
10778 #endif | |
10779 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
10780 if (unlikely(__pyx_nargs > 0)) { | |
10781 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
10782 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
10783 __pyx_r = __pyx_pf_5pysam_9libcfaidx_10FastqProxy_6__reduce_cython__(((struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *)__pyx_v_self)); | |
10784 | |
10785 /* function exit code */ | |
10786 __Pyx_RefNannyFinishContext(); | |
10787 return __pyx_r; | |
10788 } | |
10789 | |
10790 static PyObject *__pyx_pf_5pysam_9libcfaidx_10FastqProxy_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self) { | |
10791 PyObject *__pyx_r = NULL; | |
10792 __Pyx_TraceDeclarations | |
10793 __Pyx_RefNannyDeclarations | |
10794 int __pyx_lineno = 0; | |
10795 const char *__pyx_filename = NULL; | |
10796 int __pyx_clineno = 0; | |
10797 __Pyx_TraceFrameInit(__pyx_codeobj__21) | |
10798 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
10799 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
10800 | |
10801 /* "(tree fragment)":2 | |
10802 * def __reduce_cython__(self): | |
10803 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< | |
10804 * def __setstate_cython__(self, __pyx_state): | |
10805 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" | |
10806 */ | |
10807 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__delegate_cannot_be_convert, 0, 0); | |
10808 __PYX_ERR(1, 2, __pyx_L1_error) | |
10809 | |
10810 /* "(tree fragment)":1 | |
10811 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
10812 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" | |
10813 * def __setstate_cython__(self, __pyx_state): | |
10814 */ | |
10815 | |
10816 /* function exit code */ | |
10817 __pyx_L1_error:; | |
10818 __Pyx_AddTraceback("pysam.libcfaidx.FastqProxy.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10819 __pyx_r = NULL; | |
10820 __Pyx_XGIVEREF(__pyx_r); | |
10821 __Pyx_TraceReturn(__pyx_r, 0); | |
10822 __Pyx_RefNannyFinishContext(); | |
10823 return __pyx_r; | |
10824 } | |
10825 | |
10826 /* "(tree fragment)":3 | |
10827 * def __reduce_cython__(self): | |
10828 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" | |
10829 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
10830 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" | |
10831 */ | |
10832 | |
10833 /* Python wrapper */ | |
10834 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_9__setstate_cython__(PyObject *__pyx_v_self, | |
10835 #if CYTHON_METH_FASTCALL | |
10836 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
10837 #else | |
10838 PyObject *__pyx_args, PyObject *__pyx_kwds | |
10839 #endif | |
10840 ); /*proto*/ | |
10841 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_10FastqProxy_8__setstate_cython__, "FastqProxy.__setstate_cython__(self, __pyx_state)"); | |
10842 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_10FastqProxy_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_10FastqProxy_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_10FastqProxy_8__setstate_cython__}; | |
10843 static PyObject *__pyx_pw_5pysam_9libcfaidx_10FastqProxy_9__setstate_cython__(PyObject *__pyx_v_self, | |
10844 #if CYTHON_METH_FASTCALL | |
10845 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
10846 #else | |
10847 PyObject *__pyx_args, PyObject *__pyx_kwds | |
10848 #endif | |
10849 ) { | |
10850 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; | |
10851 #if !CYTHON_METH_FASTCALL | |
10852 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
10853 #endif | |
10854 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10855 PyObject* values[1] = {0}; | |
10856 int __pyx_lineno = 0; | |
10857 const char *__pyx_filename = NULL; | |
10858 int __pyx_clineno = 0; | |
10859 PyObject *__pyx_r = 0; | |
10860 __Pyx_RefNannyDeclarations | |
10861 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
10862 #if !CYTHON_METH_FASTCALL | |
10863 #if CYTHON_ASSUME_SAFE_MACROS | |
10864 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
10865 #else | |
10866 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
10867 #endif | |
10868 #endif | |
10869 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
10870 { | |
10871 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
10872 if (__pyx_kwds) { | |
10873 Py_ssize_t kw_args; | |
10874 switch (__pyx_nargs) { | |
10875 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
10876 CYTHON_FALLTHROUGH; | |
10877 case 0: break; | |
10878 default: goto __pyx_L5_argtuple_error; | |
10879 } | |
10880 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
10881 switch (__pyx_nargs) { | |
10882 case 0: | |
10883 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
10884 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
10885 kw_args--; | |
10886 } | |
10887 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) | |
10888 else goto __pyx_L5_argtuple_error; | |
10889 } | |
10890 if (unlikely(kw_args > 0)) { | |
10891 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
10892 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) | |
10893 } | |
10894 } else if (unlikely(__pyx_nargs != 1)) { | |
10895 goto __pyx_L5_argtuple_error; | |
10896 } else { | |
10897 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
10898 } | |
10899 __pyx_v___pyx_state = values[0]; | |
10900 } | |
10901 goto __pyx_L6_skip; | |
10902 __pyx_L5_argtuple_error:; | |
10903 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) | |
10904 __pyx_L6_skip:; | |
10905 goto __pyx_L4_argument_unpacking_done; | |
10906 __pyx_L3_error:; | |
10907 { | |
10908 Py_ssize_t __pyx_temp; | |
10909 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
10910 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
10911 } | |
10912 } | |
10913 __Pyx_AddTraceback("pysam.libcfaidx.FastqProxy.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10914 __Pyx_RefNannyFinishContext(); | |
10915 return NULL; | |
10916 __pyx_L4_argument_unpacking_done:; | |
10917 __pyx_r = __pyx_pf_5pysam_9libcfaidx_10FastqProxy_8__setstate_cython__(((struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *)__pyx_v_self), __pyx_v___pyx_state); | |
10918 | |
10919 /* function exit code */ | |
10920 { | |
10921 Py_ssize_t __pyx_temp; | |
10922 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
10923 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
10924 } | |
10925 } | |
10926 __Pyx_RefNannyFinishContext(); | |
10927 return __pyx_r; | |
10928 } | |
10929 | |
10930 static PyObject *__pyx_pf_5pysam_9libcfaidx_10FastqProxy_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { | |
10931 PyObject *__pyx_r = NULL; | |
10932 __Pyx_TraceDeclarations | |
10933 __Pyx_RefNannyDeclarations | |
10934 int __pyx_lineno = 0; | |
10935 const char *__pyx_filename = NULL; | |
10936 int __pyx_clineno = 0; | |
10937 __Pyx_TraceFrameInit(__pyx_codeobj__22) | |
10938 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
10939 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); | |
10940 | |
10941 /* "(tree fragment)":4 | |
10942 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" | |
10943 * def __setstate_cython__(self, __pyx_state): | |
10944 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< | |
10945 */ | |
10946 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__delegate_cannot_be_convert, 0, 0); | |
10947 __PYX_ERR(1, 4, __pyx_L1_error) | |
10948 | |
10949 /* "(tree fragment)":3 | |
10950 * def __reduce_cython__(self): | |
10951 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" | |
10952 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
10953 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" | |
10954 */ | |
10955 | |
10956 /* function exit code */ | |
10957 __pyx_L1_error:; | |
10958 __Pyx_AddTraceback("pysam.libcfaidx.FastqProxy.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
10959 __pyx_r = NULL; | |
10960 __Pyx_XGIVEREF(__pyx_r); | |
10961 __Pyx_TraceReturn(__pyx_r, 0); | |
10962 __Pyx_RefNannyFinishContext(); | |
10963 return __pyx_r; | |
10964 } | |
10965 | |
10966 /* "pysam/libcfaidx.pyx":418 | |
10967 * | |
10968 * """ | |
10969 * def __init__(self, # <<<<<<<<<<<<<< | |
10970 * name=None, | |
10971 * comment=None, | |
10972 */ | |
10973 | |
10974 /* Python wrapper */ | |
10975 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
10976 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
10977 PyObject *__pyx_v_name = 0; | |
10978 PyObject *__pyx_v_comment = 0; | |
10979 PyObject *__pyx_v_sequence = 0; | |
10980 PyObject *__pyx_v_quality = 0; | |
10981 struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_proxy = 0; | |
10982 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
10983 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
10984 PyObject* values[5] = {0,0,0,0,0}; | |
10985 int __pyx_lineno = 0; | |
10986 const char *__pyx_filename = NULL; | |
10987 int __pyx_clineno = 0; | |
10988 int __pyx_r; | |
10989 __Pyx_RefNannyDeclarations | |
10990 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); | |
10991 #if CYTHON_ASSUME_SAFE_MACROS | |
10992 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
10993 #else | |
10994 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; | |
10995 #endif | |
10996 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
10997 { | |
10998 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_comment,&__pyx_n_s_sequence,&__pyx_n_s_quality,&__pyx_n_s_proxy,0}; | |
10999 | |
11000 /* "pysam/libcfaidx.pyx":419 | |
11001 * """ | |
11002 * def __init__(self, | |
11003 * name=None, # <<<<<<<<<<<<<< | |
11004 * comment=None, | |
11005 * sequence=None, | |
11006 */ | |
11007 values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); | |
11008 | |
11009 /* "pysam/libcfaidx.pyx":420 | |
11010 * def __init__(self, | |
11011 * name=None, | |
11012 * comment=None, # <<<<<<<<<<<<<< | |
11013 * sequence=None, | |
11014 * quality=None, | |
11015 */ | |
11016 values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); | |
11017 | |
11018 /* "pysam/libcfaidx.pyx":421 | |
11019 * name=None, | |
11020 * comment=None, | |
11021 * sequence=None, # <<<<<<<<<<<<<< | |
11022 * quality=None, | |
11023 * FastqProxy proxy=None): | |
11024 */ | |
11025 values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); | |
11026 | |
11027 /* "pysam/libcfaidx.pyx":422 | |
11028 * comment=None, | |
11029 * sequence=None, | |
11030 * quality=None, # <<<<<<<<<<<<<< | |
11031 * FastqProxy proxy=None): | |
11032 * if proxy is not None: | |
11033 */ | |
11034 values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None)); | |
11035 | |
11036 /* "pysam/libcfaidx.pyx":423 | |
11037 * sequence=None, | |
11038 * quality=None, | |
11039 * FastqProxy proxy=None): # <<<<<<<<<<<<<< | |
11040 * if proxy is not None: | |
11041 * self.comment = proxy.comment | |
11042 */ | |
11043 values[4] = __Pyx_Arg_NewRef_VARARGS((PyObject *)((struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *)Py_None)); | |
11044 if (__pyx_kwds) { | |
11045 Py_ssize_t kw_args; | |
11046 switch (__pyx_nargs) { | |
11047 case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); | |
11048 CYTHON_FALLTHROUGH; | |
11049 case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); | |
11050 CYTHON_FALLTHROUGH; | |
11051 case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); | |
11052 CYTHON_FALLTHROUGH; | |
11053 case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); | |
11054 CYTHON_FALLTHROUGH; | |
11055 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
11056 CYTHON_FALLTHROUGH; | |
11057 case 0: break; | |
11058 default: goto __pyx_L5_argtuple_error; | |
11059 } | |
11060 kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); | |
11061 switch (__pyx_nargs) { | |
11062 case 0: | |
11063 if (kw_args > 0) { | |
11064 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name); | |
11065 if (value) { values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } | |
11066 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L3_error) | |
11067 } | |
11068 CYTHON_FALLTHROUGH; | |
11069 case 1: | |
11070 if (kw_args > 0) { | |
11071 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comment); | |
11072 if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } | |
11073 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L3_error) | |
11074 } | |
11075 CYTHON_FALLTHROUGH; | |
11076 case 2: | |
11077 if (kw_args > 0) { | |
11078 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sequence); | |
11079 if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } | |
11080 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L3_error) | |
11081 } | |
11082 CYTHON_FALLTHROUGH; | |
11083 case 3: | |
11084 if (kw_args > 0) { | |
11085 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_quality); | |
11086 if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } | |
11087 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L3_error) | |
11088 } | |
11089 CYTHON_FALLTHROUGH; | |
11090 case 4: | |
11091 if (kw_args > 0) { | |
11092 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_proxy); | |
11093 if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } | |
11094 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L3_error) | |
11095 } | |
11096 } | |
11097 if (unlikely(kw_args > 0)) { | |
11098 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
11099 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 418, __pyx_L3_error) | |
11100 } | |
11101 } else { | |
11102 switch (__pyx_nargs) { | |
11103 case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); | |
11104 CYTHON_FALLTHROUGH; | |
11105 case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); | |
11106 CYTHON_FALLTHROUGH; | |
11107 case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); | |
11108 CYTHON_FALLTHROUGH; | |
11109 case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); | |
11110 CYTHON_FALLTHROUGH; | |
11111 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); | |
11112 CYTHON_FALLTHROUGH; | |
11113 case 0: break; | |
11114 default: goto __pyx_L5_argtuple_error; | |
11115 } | |
11116 } | |
11117 __pyx_v_name = values[0]; | |
11118 __pyx_v_comment = values[1]; | |
11119 __pyx_v_sequence = values[2]; | |
11120 __pyx_v_quality = values[3]; | |
11121 __pyx_v_proxy = ((struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *)values[4]); | |
11122 } | |
11123 goto __pyx_L6_skip; | |
11124 __pyx_L5_argtuple_error:; | |
11125 __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, __pyx_nargs); __PYX_ERR(0, 418, __pyx_L3_error) | |
11126 __pyx_L6_skip:; | |
11127 goto __pyx_L4_argument_unpacking_done; | |
11128 __pyx_L3_error:; | |
11129 { | |
11130 Py_ssize_t __pyx_temp; | |
11131 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
11132 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
11133 } | |
11134 } | |
11135 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
11136 __Pyx_RefNannyFinishContext(); | |
11137 return -1; | |
11138 __pyx_L4_argument_unpacking_done:; | |
11139 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_proxy), __pyx_ptype_5pysam_9libcfaidx_FastqProxy, 1, "proxy", 0))) __PYX_ERR(0, 423, __pyx_L1_error) | |
11140 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord___init__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self), __pyx_v_name, __pyx_v_comment, __pyx_v_sequence, __pyx_v_quality, __pyx_v_proxy); | |
11141 | |
11142 /* "pysam/libcfaidx.pyx":418 | |
11143 * | |
11144 * """ | |
11145 * def __init__(self, # <<<<<<<<<<<<<< | |
11146 * name=None, | |
11147 * comment=None, | |
11148 */ | |
11149 | |
11150 /* function exit code */ | |
11151 goto __pyx_L0; | |
11152 __pyx_L1_error:; | |
11153 __pyx_r = -1; | |
11154 __pyx_L0:; | |
11155 { | |
11156 Py_ssize_t __pyx_temp; | |
11157 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
11158 __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); | |
11159 } | |
11160 } | |
11161 __Pyx_RefNannyFinishContext(); | |
11162 return __pyx_r; | |
11163 } | |
11164 | |
11165 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord___init__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_comment, PyObject *__pyx_v_sequence, PyObject *__pyx_v_quality, struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *__pyx_v_proxy) { | |
11166 int __pyx_r; | |
11167 __Pyx_TraceDeclarations | |
11168 __Pyx_RefNannyDeclarations | |
11169 int __pyx_t_1; | |
11170 PyObject *__pyx_t_2 = NULL; | |
11171 int __pyx_lineno = 0; | |
11172 const char *__pyx_filename = NULL; | |
11173 int __pyx_clineno = 0; | |
11174 __Pyx_RefNannySetupContext("__init__", 1); | |
11175 __Pyx_TraceCall("__init__", __pyx_f[0], 418, 0, __PYX_ERR(0, 418, __pyx_L1_error)); | |
11176 | |
11177 /* "pysam/libcfaidx.pyx":424 | |
11178 * quality=None, | |
11179 * FastqProxy proxy=None): | |
11180 * if proxy is not None: # <<<<<<<<<<<<<< | |
11181 * self.comment = proxy.comment | |
11182 * self.quality = proxy.quality | |
11183 */ | |
11184 __pyx_t_1 = (((PyObject *)__pyx_v_proxy) != Py_None); | |
11185 if (__pyx_t_1) { | |
11186 | |
11187 /* "pysam/libcfaidx.pyx":425 | |
11188 * FastqProxy proxy=None): | |
11189 * if proxy is not None: | |
11190 * self.comment = proxy.comment # <<<<<<<<<<<<<< | |
11191 * self.quality = proxy.quality | |
11192 * self.sequence = proxy.sequence | |
11193 */ | |
11194 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_proxy), __pyx_n_s_comment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error) | |
11195 __Pyx_GOTREF(__pyx_t_2); | |
11196 if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 425, __pyx_L1_error) | |
11197 __Pyx_GIVEREF(__pyx_t_2); | |
11198 __Pyx_GOTREF(__pyx_v_self->comment); | |
11199 __Pyx_DECREF(__pyx_v_self->comment); | |
11200 __pyx_v_self->comment = ((PyObject*)__pyx_t_2); | |
11201 __pyx_t_2 = 0; | |
11202 | |
11203 /* "pysam/libcfaidx.pyx":426 | |
11204 * if proxy is not None: | |
11205 * self.comment = proxy.comment | |
11206 * self.quality = proxy.quality # <<<<<<<<<<<<<< | |
11207 * self.sequence = proxy.sequence | |
11208 * self.name = proxy.name | |
11209 */ | |
11210 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_proxy), __pyx_n_s_quality); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error) | |
11211 __Pyx_GOTREF(__pyx_t_2); | |
11212 if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 426, __pyx_L1_error) | |
11213 __Pyx_GIVEREF(__pyx_t_2); | |
11214 __Pyx_GOTREF(__pyx_v_self->quality); | |
11215 __Pyx_DECREF(__pyx_v_self->quality); | |
11216 __pyx_v_self->quality = ((PyObject*)__pyx_t_2); | |
11217 __pyx_t_2 = 0; | |
11218 | |
11219 /* "pysam/libcfaidx.pyx":427 | |
11220 * self.comment = proxy.comment | |
11221 * self.quality = proxy.quality | |
11222 * self.sequence = proxy.sequence # <<<<<<<<<<<<<< | |
11223 * self.name = proxy.name | |
11224 * else: | |
11225 */ | |
11226 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_proxy), __pyx_n_s_sequence); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error) | |
11227 __Pyx_GOTREF(__pyx_t_2); | |
11228 if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 427, __pyx_L1_error) | |
11229 __Pyx_GIVEREF(__pyx_t_2); | |
11230 __Pyx_GOTREF(__pyx_v_self->sequence); | |
11231 __Pyx_DECREF(__pyx_v_self->sequence); | |
11232 __pyx_v_self->sequence = ((PyObject*)__pyx_t_2); | |
11233 __pyx_t_2 = 0; | |
11234 | |
11235 /* "pysam/libcfaidx.pyx":428 | |
11236 * self.quality = proxy.quality | |
11237 * self.sequence = proxy.sequence | |
11238 * self.name = proxy.name # <<<<<<<<<<<<<< | |
11239 * else: | |
11240 * self.comment = comment | |
11241 */ | |
11242 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_proxy), __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error) | |
11243 __Pyx_GOTREF(__pyx_t_2); | |
11244 if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 428, __pyx_L1_error) | |
11245 __Pyx_GIVEREF(__pyx_t_2); | |
11246 __Pyx_GOTREF(__pyx_v_self->name); | |
11247 __Pyx_DECREF(__pyx_v_self->name); | |
11248 __pyx_v_self->name = ((PyObject*)__pyx_t_2); | |
11249 __pyx_t_2 = 0; | |
11250 | |
11251 /* "pysam/libcfaidx.pyx":424 | |
11252 * quality=None, | |
11253 * FastqProxy proxy=None): | |
11254 * if proxy is not None: # <<<<<<<<<<<<<< | |
11255 * self.comment = proxy.comment | |
11256 * self.quality = proxy.quality | |
11257 */ | |
11258 goto __pyx_L3; | |
11259 } | |
11260 | |
11261 /* "pysam/libcfaidx.pyx":430 | |
11262 * self.name = proxy.name | |
11263 * else: | |
11264 * self.comment = comment # <<<<<<<<<<<<<< | |
11265 * self.quality = quality | |
11266 * self.sequence = sequence | |
11267 */ | |
11268 /*else*/ { | |
11269 if (!(likely(PyUnicode_CheckExact(__pyx_v_comment))||((__pyx_v_comment) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_comment))) __PYX_ERR(0, 430, __pyx_L1_error) | |
11270 __pyx_t_2 = __pyx_v_comment; | |
11271 __Pyx_INCREF(__pyx_t_2); | |
11272 __Pyx_GIVEREF(__pyx_t_2); | |
11273 __Pyx_GOTREF(__pyx_v_self->comment); | |
11274 __Pyx_DECREF(__pyx_v_self->comment); | |
11275 __pyx_v_self->comment = ((PyObject*)__pyx_t_2); | |
11276 __pyx_t_2 = 0; | |
11277 | |
11278 /* "pysam/libcfaidx.pyx":431 | |
11279 * else: | |
11280 * self.comment = comment | |
11281 * self.quality = quality # <<<<<<<<<<<<<< | |
11282 * self.sequence = sequence | |
11283 * self.name = name | |
11284 */ | |
11285 if (!(likely(PyUnicode_CheckExact(__pyx_v_quality))||((__pyx_v_quality) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_quality))) __PYX_ERR(0, 431, __pyx_L1_error) | |
11286 __pyx_t_2 = __pyx_v_quality; | |
11287 __Pyx_INCREF(__pyx_t_2); | |
11288 __Pyx_GIVEREF(__pyx_t_2); | |
11289 __Pyx_GOTREF(__pyx_v_self->quality); | |
11290 __Pyx_DECREF(__pyx_v_self->quality); | |
11291 __pyx_v_self->quality = ((PyObject*)__pyx_t_2); | |
11292 __pyx_t_2 = 0; | |
11293 | |
11294 /* "pysam/libcfaidx.pyx":432 | |
11295 * self.comment = comment | |
11296 * self.quality = quality | |
11297 * self.sequence = sequence # <<<<<<<<<<<<<< | |
11298 * self.name = name | |
11299 * | |
11300 */ | |
11301 if (!(likely(PyUnicode_CheckExact(__pyx_v_sequence))||((__pyx_v_sequence) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_sequence))) __PYX_ERR(0, 432, __pyx_L1_error) | |
11302 __pyx_t_2 = __pyx_v_sequence; | |
11303 __Pyx_INCREF(__pyx_t_2); | |
11304 __Pyx_GIVEREF(__pyx_t_2); | |
11305 __Pyx_GOTREF(__pyx_v_self->sequence); | |
11306 __Pyx_DECREF(__pyx_v_self->sequence); | |
11307 __pyx_v_self->sequence = ((PyObject*)__pyx_t_2); | |
11308 __pyx_t_2 = 0; | |
11309 | |
11310 /* "pysam/libcfaidx.pyx":433 | |
11311 * self.quality = quality | |
11312 * self.sequence = sequence | |
11313 * self.name = name # <<<<<<<<<<<<<< | |
11314 * | |
11315 * def __copy__(self): | |
11316 */ | |
11317 if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_name))) __PYX_ERR(0, 433, __pyx_L1_error) | |
11318 __pyx_t_2 = __pyx_v_name; | |
11319 __Pyx_INCREF(__pyx_t_2); | |
11320 __Pyx_GIVEREF(__pyx_t_2); | |
11321 __Pyx_GOTREF(__pyx_v_self->name); | |
11322 __Pyx_DECREF(__pyx_v_self->name); | |
11323 __pyx_v_self->name = ((PyObject*)__pyx_t_2); | |
11324 __pyx_t_2 = 0; | |
11325 } | |
11326 __pyx_L3:; | |
11327 | |
11328 /* "pysam/libcfaidx.pyx":418 | |
11329 * | |
11330 * """ | |
11331 * def __init__(self, # <<<<<<<<<<<<<< | |
11332 * name=None, | |
11333 * comment=None, | |
11334 */ | |
11335 | |
11336 /* function exit code */ | |
11337 __pyx_r = 0; | |
11338 goto __pyx_L0; | |
11339 __pyx_L1_error:; | |
11340 __Pyx_XDECREF(__pyx_t_2); | |
11341 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
11342 __pyx_r = -1; | |
11343 __pyx_L0:; | |
11344 __Pyx_TraceReturn(Py_None, 0); | |
11345 __Pyx_RefNannyFinishContext(); | |
11346 return __pyx_r; | |
11347 } | |
11348 | |
11349 /* "pysam/libcfaidx.pyx":435 | |
11350 * self.name = name | |
11351 * | |
11352 * def __copy__(self): # <<<<<<<<<<<<<< | |
11353 * return FastxRecord(self.name, self.comment, self.sequence, self.quality) | |
11354 * | |
11355 */ | |
11356 | |
11357 /* Python wrapper */ | |
11358 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_3__copy__(PyObject *__pyx_v_self, | |
11359 #if CYTHON_METH_FASTCALL | |
11360 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
11361 #else | |
11362 PyObject *__pyx_args, PyObject *__pyx_kwds | |
11363 #endif | |
11364 ); /*proto*/ | |
11365 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_11FastxRecord_2__copy__, "FastxRecord.__copy__(self)"); | |
11366 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_11FastxRecord_3__copy__ = {"__copy__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_3__copy__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_11FastxRecord_2__copy__}; | |
11367 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_3__copy__(PyObject *__pyx_v_self, | |
11368 #if CYTHON_METH_FASTCALL | |
11369 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
11370 #else | |
11371 PyObject *__pyx_args, PyObject *__pyx_kwds | |
11372 #endif | |
11373 ) { | |
11374 #if !CYTHON_METH_FASTCALL | |
11375 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
11376 #endif | |
11377 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
11378 PyObject *__pyx_r = 0; | |
11379 __Pyx_RefNannyDeclarations | |
11380 __Pyx_RefNannySetupContext("__copy__ (wrapper)", 0); | |
11381 #if !CYTHON_METH_FASTCALL | |
11382 #if CYTHON_ASSUME_SAFE_MACROS | |
11383 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
11384 #else | |
11385 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
11386 #endif | |
11387 #endif | |
11388 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
11389 if (unlikely(__pyx_nargs > 0)) { | |
11390 __Pyx_RaiseArgtupleInvalid("__copy__", 1, 0, 0, __pyx_nargs); return NULL;} | |
11391 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__copy__", 0))) return NULL; | |
11392 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_2__copy__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self)); | |
11393 | |
11394 /* function exit code */ | |
11395 __Pyx_RefNannyFinishContext(); | |
11396 return __pyx_r; | |
11397 } | |
11398 | |
11399 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_2__copy__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self) { | |
11400 PyObject *__pyx_r = NULL; | |
11401 __Pyx_TraceDeclarations | |
11402 __Pyx_RefNannyDeclarations | |
11403 PyObject *__pyx_t_1 = NULL; | |
11404 PyObject *__pyx_t_2 = NULL; | |
11405 int __pyx_lineno = 0; | |
11406 const char *__pyx_filename = NULL; | |
11407 int __pyx_clineno = 0; | |
11408 __Pyx_TraceFrameInit(__pyx_codeobj__23) | |
11409 __Pyx_RefNannySetupContext("__copy__", 1); | |
11410 __Pyx_TraceCall("__copy__", __pyx_f[0], 435, 0, __PYX_ERR(0, 435, __pyx_L1_error)); | |
11411 | |
11412 /* "pysam/libcfaidx.pyx":436 | |
11413 * | |
11414 * def __copy__(self): | |
11415 * return FastxRecord(self.name, self.comment, self.sequence, self.quality) # <<<<<<<<<<<<<< | |
11416 * | |
11417 * def __deepcopy__(self, memo): | |
11418 */ | |
11419 __Pyx_XDECREF(__pyx_r); | |
11420 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) | |
11421 __Pyx_GOTREF(__pyx_t_1); | |
11422 __Pyx_INCREF(__pyx_v_self->name); | |
11423 __Pyx_GIVEREF(__pyx_v_self->name); | |
11424 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name)) __PYX_ERR(0, 436, __pyx_L1_error); | |
11425 __Pyx_INCREF(__pyx_v_self->comment); | |
11426 __Pyx_GIVEREF(__pyx_v_self->comment); | |
11427 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->comment)) __PYX_ERR(0, 436, __pyx_L1_error); | |
11428 __Pyx_INCREF(__pyx_v_self->sequence); | |
11429 __Pyx_GIVEREF(__pyx_v_self->sequence); | |
11430 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_self->sequence)) __PYX_ERR(0, 436, __pyx_L1_error); | |
11431 __Pyx_INCREF(__pyx_v_self->quality); | |
11432 __Pyx_GIVEREF(__pyx_v_self->quality); | |
11433 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_self->quality)) __PYX_ERR(0, 436, __pyx_L1_error); | |
11434 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxRecord), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error) | |
11435 __Pyx_GOTREF(__pyx_t_2); | |
11436 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
11437 __pyx_r = __pyx_t_2; | |
11438 __pyx_t_2 = 0; | |
11439 goto __pyx_L0; | |
11440 | |
11441 /* "pysam/libcfaidx.pyx":435 | |
11442 * self.name = name | |
11443 * | |
11444 * def __copy__(self): # <<<<<<<<<<<<<< | |
11445 * return FastxRecord(self.name, self.comment, self.sequence, self.quality) | |
11446 * | |
11447 */ | |
11448 | |
11449 /* function exit code */ | |
11450 __pyx_L1_error:; | |
11451 __Pyx_XDECREF(__pyx_t_1); | |
11452 __Pyx_XDECREF(__pyx_t_2); | |
11453 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
11454 __pyx_r = NULL; | |
11455 __pyx_L0:; | |
11456 __Pyx_XGIVEREF(__pyx_r); | |
11457 __Pyx_TraceReturn(__pyx_r, 0); | |
11458 __Pyx_RefNannyFinishContext(); | |
11459 return __pyx_r; | |
11460 } | |
11461 | |
11462 /* "pysam/libcfaidx.pyx":438 | |
11463 * return FastxRecord(self.name, self.comment, self.sequence, self.quality) | |
11464 * | |
11465 * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< | |
11466 * return FastxRecord(self.name, self.comment, self.sequence, self.quality) | |
11467 * | |
11468 */ | |
11469 | |
11470 /* Python wrapper */ | |
11471 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_5__deepcopy__(PyObject *__pyx_v_self, | |
11472 #if CYTHON_METH_FASTCALL | |
11473 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
11474 #else | |
11475 PyObject *__pyx_args, PyObject *__pyx_kwds | |
11476 #endif | |
11477 ); /*proto*/ | |
11478 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_11FastxRecord_4__deepcopy__, "FastxRecord.__deepcopy__(self, memo)"); | |
11479 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_11FastxRecord_5__deepcopy__ = {"__deepcopy__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_5__deepcopy__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_11FastxRecord_4__deepcopy__}; | |
11480 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_5__deepcopy__(PyObject *__pyx_v_self, | |
11481 #if CYTHON_METH_FASTCALL | |
11482 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
11483 #else | |
11484 PyObject *__pyx_args, PyObject *__pyx_kwds | |
11485 #endif | |
11486 ) { | |
11487 CYTHON_UNUSED PyObject *__pyx_v_memo = 0; | |
11488 #if !CYTHON_METH_FASTCALL | |
11489 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
11490 #endif | |
11491 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
11492 PyObject* values[1] = {0}; | |
11493 int __pyx_lineno = 0; | |
11494 const char *__pyx_filename = NULL; | |
11495 int __pyx_clineno = 0; | |
11496 PyObject *__pyx_r = 0; | |
11497 __Pyx_RefNannyDeclarations | |
11498 __Pyx_RefNannySetupContext("__deepcopy__ (wrapper)", 0); | |
11499 #if !CYTHON_METH_FASTCALL | |
11500 #if CYTHON_ASSUME_SAFE_MACROS | |
11501 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
11502 #else | |
11503 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
11504 #endif | |
11505 #endif | |
11506 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
11507 { | |
11508 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memo,0}; | |
11509 if (__pyx_kwds) { | |
11510 Py_ssize_t kw_args; | |
11511 switch (__pyx_nargs) { | |
11512 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
11513 CYTHON_FALLTHROUGH; | |
11514 case 0: break; | |
11515 default: goto __pyx_L5_argtuple_error; | |
11516 } | |
11517 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
11518 switch (__pyx_nargs) { | |
11519 case 0: | |
11520 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_memo)) != 0)) { | |
11521 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
11522 kw_args--; | |
11523 } | |
11524 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L3_error) | |
11525 else goto __pyx_L5_argtuple_error; | |
11526 } | |
11527 if (unlikely(kw_args > 0)) { | |
11528 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
11529 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__deepcopy__") < 0)) __PYX_ERR(0, 438, __pyx_L3_error) | |
11530 } | |
11531 } else if (unlikely(__pyx_nargs != 1)) { | |
11532 goto __pyx_L5_argtuple_error; | |
11533 } else { | |
11534 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
11535 } | |
11536 __pyx_v_memo = values[0]; | |
11537 } | |
11538 goto __pyx_L6_skip; | |
11539 __pyx_L5_argtuple_error:; | |
11540 __Pyx_RaiseArgtupleInvalid("__deepcopy__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 438, __pyx_L3_error) | |
11541 __pyx_L6_skip:; | |
11542 goto __pyx_L4_argument_unpacking_done; | |
11543 __pyx_L3_error:; | |
11544 { | |
11545 Py_ssize_t __pyx_temp; | |
11546 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
11547 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
11548 } | |
11549 } | |
11550 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
11551 __Pyx_RefNannyFinishContext(); | |
11552 return NULL; | |
11553 __pyx_L4_argument_unpacking_done:; | |
11554 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_4__deepcopy__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self), __pyx_v_memo); | |
11555 | |
11556 /* function exit code */ | |
11557 { | |
11558 Py_ssize_t __pyx_temp; | |
11559 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
11560 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
11561 } | |
11562 } | |
11563 __Pyx_RefNannyFinishContext(); | |
11564 return __pyx_r; | |
11565 } | |
11566 | |
11567 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_4__deepcopy__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_memo) { | |
11568 PyObject *__pyx_r = NULL; | |
11569 __Pyx_TraceDeclarations | |
11570 __Pyx_RefNannyDeclarations | |
11571 PyObject *__pyx_t_1 = NULL; | |
11572 PyObject *__pyx_t_2 = NULL; | |
11573 int __pyx_lineno = 0; | |
11574 const char *__pyx_filename = NULL; | |
11575 int __pyx_clineno = 0; | |
11576 __Pyx_TraceFrameInit(__pyx_codeobj__24) | |
11577 __Pyx_RefNannySetupContext("__deepcopy__", 1); | |
11578 __Pyx_TraceCall("__deepcopy__", __pyx_f[0], 438, 0, __PYX_ERR(0, 438, __pyx_L1_error)); | |
11579 | |
11580 /* "pysam/libcfaidx.pyx":439 | |
11581 * | |
11582 * def __deepcopy__(self, memo): | |
11583 * return FastxRecord(self.name, self.comment, self.sequence, self.quality) # <<<<<<<<<<<<<< | |
11584 * | |
11585 * cdef cython.str to_string(self): | |
11586 */ | |
11587 __Pyx_XDECREF(__pyx_r); | |
11588 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) | |
11589 __Pyx_GOTREF(__pyx_t_1); | |
11590 __Pyx_INCREF(__pyx_v_self->name); | |
11591 __Pyx_GIVEREF(__pyx_v_self->name); | |
11592 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name)) __PYX_ERR(0, 439, __pyx_L1_error); | |
11593 __Pyx_INCREF(__pyx_v_self->comment); | |
11594 __Pyx_GIVEREF(__pyx_v_self->comment); | |
11595 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->comment)) __PYX_ERR(0, 439, __pyx_L1_error); | |
11596 __Pyx_INCREF(__pyx_v_self->sequence); | |
11597 __Pyx_GIVEREF(__pyx_v_self->sequence); | |
11598 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_self->sequence)) __PYX_ERR(0, 439, __pyx_L1_error); | |
11599 __Pyx_INCREF(__pyx_v_self->quality); | |
11600 __Pyx_GIVEREF(__pyx_v_self->quality); | |
11601 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_self->quality)) __PYX_ERR(0, 439, __pyx_L1_error); | |
11602 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxRecord), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) | |
11603 __Pyx_GOTREF(__pyx_t_2); | |
11604 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
11605 __pyx_r = __pyx_t_2; | |
11606 __pyx_t_2 = 0; | |
11607 goto __pyx_L0; | |
11608 | |
11609 /* "pysam/libcfaidx.pyx":438 | |
11610 * return FastxRecord(self.name, self.comment, self.sequence, self.quality) | |
11611 * | |
11612 * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< | |
11613 * return FastxRecord(self.name, self.comment, self.sequence, self.quality) | |
11614 * | |
11615 */ | |
11616 | |
11617 /* function exit code */ | |
11618 __pyx_L1_error:; | |
11619 __Pyx_XDECREF(__pyx_t_1); | |
11620 __Pyx_XDECREF(__pyx_t_2); | |
11621 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
11622 __pyx_r = NULL; | |
11623 __pyx_L0:; | |
11624 __Pyx_XGIVEREF(__pyx_r); | |
11625 __Pyx_TraceReturn(__pyx_r, 0); | |
11626 __Pyx_RefNannyFinishContext(); | |
11627 return __pyx_r; | |
11628 } | |
11629 | |
11630 /* "pysam/libcfaidx.pyx":441 | |
11631 * return FastxRecord(self.name, self.comment, self.sequence, self.quality) | |
11632 * | |
11633 * cdef cython.str to_string(self): # <<<<<<<<<<<<<< | |
11634 * if self.name is None: | |
11635 * raise ValueError("can not write record without name") | |
11636 */ | |
11637 | |
11638 static PyObject *__pyx_f_5pysam_9libcfaidx_11FastxRecord_to_string(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self) { | |
11639 PyObject *__pyx_v_comment = NULL; | |
11640 PyObject *__pyx_r = NULL; | |
11641 __Pyx_TraceDeclarations | |
11642 __Pyx_RefNannyDeclarations | |
11643 int __pyx_t_1; | |
11644 PyObject *__pyx_t_2 = NULL; | |
11645 Py_ssize_t __pyx_t_3; | |
11646 Py_UCS4 __pyx_t_4; | |
11647 PyObject *__pyx_t_5 = NULL; | |
11648 int __pyx_lineno = 0; | |
11649 const char *__pyx_filename = NULL; | |
11650 int __pyx_clineno = 0; | |
11651 __Pyx_RefNannySetupContext("to_string", 1); | |
11652 __Pyx_TraceCall("to_string", __pyx_f[0], 441, 0, __PYX_ERR(0, 441, __pyx_L1_error)); | |
11653 | |
11654 /* "pysam/libcfaidx.pyx":442 | |
11655 * | |
11656 * cdef cython.str to_string(self): | |
11657 * if self.name is None: # <<<<<<<<<<<<<< | |
11658 * raise ValueError("can not write record without name") | |
11659 * | |
11660 */ | |
11661 __pyx_t_1 = (__pyx_v_self->name == ((PyObject*)Py_None)); | |
11662 if (unlikely(__pyx_t_1)) { | |
11663 | |
11664 /* "pysam/libcfaidx.pyx":443 | |
11665 * cdef cython.str to_string(self): | |
11666 * if self.name is None: | |
11667 * raise ValueError("can not write record without name") # <<<<<<<<<<<<<< | |
11668 * | |
11669 * if self.sequence is None: | |
11670 */ | |
11671 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) | |
11672 __Pyx_GOTREF(__pyx_t_2); | |
11673 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
11674 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11675 __PYX_ERR(0, 443, __pyx_L1_error) | |
11676 | |
11677 /* "pysam/libcfaidx.pyx":442 | |
11678 * | |
11679 * cdef cython.str to_string(self): | |
11680 * if self.name is None: # <<<<<<<<<<<<<< | |
11681 * raise ValueError("can not write record without name") | |
11682 * | |
11683 */ | |
11684 } | |
11685 | |
11686 /* "pysam/libcfaidx.pyx":445 | |
11687 * raise ValueError("can not write record without name") | |
11688 * | |
11689 * if self.sequence is None: # <<<<<<<<<<<<<< | |
11690 * raise ValueError("can not write record without a sequence") | |
11691 * | |
11692 */ | |
11693 __pyx_t_1 = (__pyx_v_self->sequence == ((PyObject*)Py_None)); | |
11694 if (unlikely(__pyx_t_1)) { | |
11695 | |
11696 /* "pysam/libcfaidx.pyx":446 | |
11697 * | |
11698 * if self.sequence is None: | |
11699 * raise ValueError("can not write record without a sequence") # <<<<<<<<<<<<<< | |
11700 * | |
11701 * if self.comment is None: | |
11702 */ | |
11703 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) | |
11704 __Pyx_GOTREF(__pyx_t_2); | |
11705 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
11706 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11707 __PYX_ERR(0, 446, __pyx_L1_error) | |
11708 | |
11709 /* "pysam/libcfaidx.pyx":445 | |
11710 * raise ValueError("can not write record without name") | |
11711 * | |
11712 * if self.sequence is None: # <<<<<<<<<<<<<< | |
11713 * raise ValueError("can not write record without a sequence") | |
11714 * | |
11715 */ | |
11716 } | |
11717 | |
11718 /* "pysam/libcfaidx.pyx":448 | |
11719 * raise ValueError("can not write record without a sequence") | |
11720 * | |
11721 * if self.comment is None: # <<<<<<<<<<<<<< | |
11722 * comment = "" | |
11723 * else: | |
11724 */ | |
11725 __pyx_t_1 = (__pyx_v_self->comment == ((PyObject*)Py_None)); | |
11726 if (__pyx_t_1) { | |
11727 | |
11728 /* "pysam/libcfaidx.pyx":449 | |
11729 * | |
11730 * if self.comment is None: | |
11731 * comment = "" # <<<<<<<<<<<<<< | |
11732 * else: | |
11733 * comment = " %s" % self.comment | |
11734 */ | |
11735 __Pyx_INCREF(__pyx_kp_u__11); | |
11736 __pyx_v_comment = __pyx_kp_u__11; | |
11737 | |
11738 /* "pysam/libcfaidx.pyx":448 | |
11739 * raise ValueError("can not write record without a sequence") | |
11740 * | |
11741 * if self.comment is None: # <<<<<<<<<<<<<< | |
11742 * comment = "" | |
11743 * else: | |
11744 */ | |
11745 goto __pyx_L5; | |
11746 } | |
11747 | |
11748 /* "pysam/libcfaidx.pyx":451 | |
11749 * comment = "" | |
11750 * else: | |
11751 * comment = " %s" % self.comment # <<<<<<<<<<<<<< | |
11752 * | |
11753 * if self.quality is None: | |
11754 */ | |
11755 /*else*/ { | |
11756 __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_s, __pyx_v_self->comment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) | |
11757 __Pyx_GOTREF(__pyx_t_2); | |
11758 __pyx_v_comment = ((PyObject*)__pyx_t_2); | |
11759 __pyx_t_2 = 0; | |
11760 } | |
11761 __pyx_L5:; | |
11762 | |
11763 /* "pysam/libcfaidx.pyx":453 | |
11764 * comment = " %s" % self.comment | |
11765 * | |
11766 * if self.quality is None: # <<<<<<<<<<<<<< | |
11767 * return ">%s%s\n%s" % (self.name, comment, self.sequence) | |
11768 * else: | |
11769 */ | |
11770 __pyx_t_1 = (__pyx_v_self->quality == ((PyObject*)Py_None)); | |
11771 if (__pyx_t_1) { | |
11772 | |
11773 /* "pysam/libcfaidx.pyx":454 | |
11774 * | |
11775 * if self.quality is None: | |
11776 * return ">%s%s\n%s" % (self.name, comment, self.sequence) # <<<<<<<<<<<<<< | |
11777 * else: | |
11778 * return "@%s%s\n%s\n+\n%s" % (self.name, comment, | |
11779 */ | |
11780 __Pyx_XDECREF(__pyx_r); | |
11781 __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) | |
11782 __Pyx_GOTREF(__pyx_t_2); | |
11783 __pyx_t_3 = 0; | |
11784 __pyx_t_4 = 127; | |
11785 __Pyx_INCREF(__pyx_kp_u__16); | |
11786 __pyx_t_3 += 1; | |
11787 __Pyx_GIVEREF(__pyx_kp_u__16); | |
11788 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u__16); | |
11789 __pyx_t_5 = __Pyx_PyUnicode_Unicode(__pyx_v_self->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L1_error) | |
11790 __Pyx_GOTREF(__pyx_t_5); | |
11791 __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4; | |
11792 __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); | |
11793 __Pyx_GIVEREF(__pyx_t_5); | |
11794 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); | |
11795 __pyx_t_5 = 0; | |
11796 __Pyx_INCREF(__pyx_v_comment); | |
11797 __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_comment) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_comment) : __pyx_t_4; | |
11798 __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_comment); | |
11799 __Pyx_GIVEREF(__pyx_v_comment); | |
11800 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_comment); | |
11801 __Pyx_INCREF(__pyx_kp_u__17); | |
11802 __pyx_t_3 += 1; | |
11803 __Pyx_GIVEREF(__pyx_kp_u__17); | |
11804 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_kp_u__17); | |
11805 __pyx_t_5 = __Pyx_PyUnicode_Unicode(__pyx_v_self->sequence); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L1_error) | |
11806 __Pyx_GOTREF(__pyx_t_5); | |
11807 __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4; | |
11808 __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); | |
11809 __Pyx_GIVEREF(__pyx_t_5); | |
11810 PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_5); | |
11811 __pyx_t_5 = 0; | |
11812 __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L1_error) | |
11813 __Pyx_GOTREF(__pyx_t_5); | |
11814 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
11815 __pyx_r = ((PyObject*)__pyx_t_5); | |
11816 __pyx_t_5 = 0; | |
11817 goto __pyx_L0; | |
11818 | |
11819 /* "pysam/libcfaidx.pyx":453 | |
11820 * comment = " %s" % self.comment | |
11821 * | |
11822 * if self.quality is None: # <<<<<<<<<<<<<< | |
11823 * return ">%s%s\n%s" % (self.name, comment, self.sequence) | |
11824 * else: | |
11825 */ | |
11826 } | |
11827 | |
11828 /* "pysam/libcfaidx.pyx":456 | |
11829 * return ">%s%s\n%s" % (self.name, comment, self.sequence) | |
11830 * else: | |
11831 * return "@%s%s\n%s\n+\n%s" % (self.name, comment, # <<<<<<<<<<<<<< | |
11832 * self.sequence, self.quality) | |
11833 * | |
11834 */ | |
11835 /*else*/ { | |
11836 __Pyx_XDECREF(__pyx_r); | |
11837 __pyx_t_5 = PyTuple_New(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 456, __pyx_L1_error) | |
11838 __Pyx_GOTREF(__pyx_t_5); | |
11839 __pyx_t_3 = 0; | |
11840 __pyx_t_4 = 127; | |
11841 __Pyx_INCREF(__pyx_kp_u__18); | |
11842 __pyx_t_3 += 1; | |
11843 __Pyx_GIVEREF(__pyx_kp_u__18); | |
11844 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u__18); | |
11845 __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_self->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error) | |
11846 __Pyx_GOTREF(__pyx_t_2); | |
11847 __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4; | |
11848 __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); | |
11849 __Pyx_GIVEREF(__pyx_t_2); | |
11850 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); | |
11851 __pyx_t_2 = 0; | |
11852 __Pyx_INCREF(__pyx_v_comment); | |
11853 __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_comment) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_comment) : __pyx_t_4; | |
11854 __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_comment); | |
11855 __Pyx_GIVEREF(__pyx_v_comment); | |
11856 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_comment); | |
11857 __Pyx_INCREF(__pyx_kp_u__17); | |
11858 __pyx_t_3 += 1; | |
11859 __Pyx_GIVEREF(__pyx_kp_u__17); | |
11860 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_kp_u__17); | |
11861 | |
11862 /* "pysam/libcfaidx.pyx":457 | |
11863 * else: | |
11864 * return "@%s%s\n%s\n+\n%s" % (self.name, comment, | |
11865 * self.sequence, self.quality) # <<<<<<<<<<<<<< | |
11866 * | |
11867 * cdef cython.str tostring(self): | |
11868 */ | |
11869 __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_self->sequence); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) | |
11870 __Pyx_GOTREF(__pyx_t_2); | |
11871 __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4; | |
11872 __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); | |
11873 __Pyx_GIVEREF(__pyx_t_2); | |
11874 PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_2); | |
11875 __pyx_t_2 = 0; | |
11876 __Pyx_INCREF(__pyx_kp_u__19); | |
11877 __pyx_t_3 += 3; | |
11878 __Pyx_GIVEREF(__pyx_kp_u__19); | |
11879 PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_kp_u__19); | |
11880 __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_self->quality); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) | |
11881 __Pyx_GOTREF(__pyx_t_2); | |
11882 __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4; | |
11883 __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); | |
11884 __Pyx_GIVEREF(__pyx_t_2); | |
11885 PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_t_2); | |
11886 __pyx_t_2 = 0; | |
11887 | |
11888 /* "pysam/libcfaidx.pyx":456 | |
11889 * return ">%s%s\n%s" % (self.name, comment, self.sequence) | |
11890 * else: | |
11891 * return "@%s%s\n%s\n+\n%s" % (self.name, comment, # <<<<<<<<<<<<<< | |
11892 * self.sequence, self.quality) | |
11893 * | |
11894 */ | |
11895 __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 7, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error) | |
11896 __Pyx_GOTREF(__pyx_t_2); | |
11897 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
11898 __pyx_r = ((PyObject*)__pyx_t_2); | |
11899 __pyx_t_2 = 0; | |
11900 goto __pyx_L0; | |
11901 } | |
11902 | |
11903 /* "pysam/libcfaidx.pyx":441 | |
11904 * return FastxRecord(self.name, self.comment, self.sequence, self.quality) | |
11905 * | |
11906 * cdef cython.str to_string(self): # <<<<<<<<<<<<<< | |
11907 * if self.name is None: | |
11908 * raise ValueError("can not write record without name") | |
11909 */ | |
11910 | |
11911 /* function exit code */ | |
11912 __pyx_L1_error:; | |
11913 __Pyx_XDECREF(__pyx_t_2); | |
11914 __Pyx_XDECREF(__pyx_t_5); | |
11915 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.to_string", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
11916 __pyx_r = 0; | |
11917 __pyx_L0:; | |
11918 __Pyx_XDECREF(__pyx_v_comment); | |
11919 __Pyx_XGIVEREF(__pyx_r); | |
11920 __Pyx_TraceReturn(__pyx_r, 0); | |
11921 __Pyx_RefNannyFinishContext(); | |
11922 return __pyx_r; | |
11923 } | |
11924 | |
11925 /* "pysam/libcfaidx.pyx":459 | |
11926 * self.sequence, self.quality) | |
11927 * | |
11928 * cdef cython.str tostring(self): # <<<<<<<<<<<<<< | |
11929 * """deprecated : use :meth:`to_string`""" | |
11930 * return self.to_string() | |
11931 */ | |
11932 | |
11933 static PyObject *__pyx_f_5pysam_9libcfaidx_11FastxRecord_tostring(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self) { | |
11934 PyObject *__pyx_r = NULL; | |
11935 __Pyx_TraceDeclarations | |
11936 __Pyx_RefNannyDeclarations | |
11937 PyObject *__pyx_t_1 = NULL; | |
11938 int __pyx_lineno = 0; | |
11939 const char *__pyx_filename = NULL; | |
11940 int __pyx_clineno = 0; | |
11941 __Pyx_RefNannySetupContext("tostring", 1); | |
11942 __Pyx_TraceCall("tostring", __pyx_f[0], 459, 0, __PYX_ERR(0, 459, __pyx_L1_error)); | |
11943 | |
11944 /* "pysam/libcfaidx.pyx":461 | |
11945 * cdef cython.str tostring(self): | |
11946 * """deprecated : use :meth:`to_string`""" | |
11947 * return self.to_string() # <<<<<<<<<<<<<< | |
11948 * | |
11949 * def set_name(self, name): | |
11950 */ | |
11951 __Pyx_XDECREF(__pyx_r); | |
11952 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error) | |
11953 __Pyx_GOTREF(__pyx_t_1); | |
11954 __pyx_r = ((PyObject*)__pyx_t_1); | |
11955 __pyx_t_1 = 0; | |
11956 goto __pyx_L0; | |
11957 | |
11958 /* "pysam/libcfaidx.pyx":459 | |
11959 * self.sequence, self.quality) | |
11960 * | |
11961 * cdef cython.str tostring(self): # <<<<<<<<<<<<<< | |
11962 * """deprecated : use :meth:`to_string`""" | |
11963 * return self.to_string() | |
11964 */ | |
11965 | |
11966 /* function exit code */ | |
11967 __pyx_L1_error:; | |
11968 __Pyx_XDECREF(__pyx_t_1); | |
11969 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.tostring", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
11970 __pyx_r = 0; | |
11971 __pyx_L0:; | |
11972 __Pyx_XGIVEREF(__pyx_r); | |
11973 __Pyx_TraceReturn(__pyx_r, 0); | |
11974 __Pyx_RefNannyFinishContext(); | |
11975 return __pyx_r; | |
11976 } | |
11977 | |
11978 /* "pysam/libcfaidx.pyx":463 | |
11979 * return self.to_string() | |
11980 * | |
11981 * def set_name(self, name): # <<<<<<<<<<<<<< | |
11982 * if name is None: | |
11983 * raise ValueError("FastxRecord must have a name and not None") | |
11984 */ | |
11985 | |
11986 /* Python wrapper */ | |
11987 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_7set_name(PyObject *__pyx_v_self, | |
11988 #if CYTHON_METH_FASTCALL | |
11989 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
11990 #else | |
11991 PyObject *__pyx_args, PyObject *__pyx_kwds | |
11992 #endif | |
11993 ); /*proto*/ | |
11994 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_11FastxRecord_6set_name, "FastxRecord.set_name(self, name)"); | |
11995 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_11FastxRecord_7set_name = {"set_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_7set_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_11FastxRecord_6set_name}; | |
11996 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_7set_name(PyObject *__pyx_v_self, | |
11997 #if CYTHON_METH_FASTCALL | |
11998 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
11999 #else | |
12000 PyObject *__pyx_args, PyObject *__pyx_kwds | |
12001 #endif | |
12002 ) { | |
12003 PyObject *__pyx_v_name = 0; | |
12004 #if !CYTHON_METH_FASTCALL | |
12005 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
12006 #endif | |
12007 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
12008 PyObject* values[1] = {0}; | |
12009 int __pyx_lineno = 0; | |
12010 const char *__pyx_filename = NULL; | |
12011 int __pyx_clineno = 0; | |
12012 PyObject *__pyx_r = 0; | |
12013 __Pyx_RefNannyDeclarations | |
12014 __Pyx_RefNannySetupContext("set_name (wrapper)", 0); | |
12015 #if !CYTHON_METH_FASTCALL | |
12016 #if CYTHON_ASSUME_SAFE_MACROS | |
12017 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
12018 #else | |
12019 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
12020 #endif | |
12021 #endif | |
12022 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
12023 { | |
12024 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; | |
12025 if (__pyx_kwds) { | |
12026 Py_ssize_t kw_args; | |
12027 switch (__pyx_nargs) { | |
12028 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
12029 CYTHON_FALLTHROUGH; | |
12030 case 0: break; | |
12031 default: goto __pyx_L5_argtuple_error; | |
12032 } | |
12033 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
12034 switch (__pyx_nargs) { | |
12035 case 0: | |
12036 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { | |
12037 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
12038 kw_args--; | |
12039 } | |
12040 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L3_error) | |
12041 else goto __pyx_L5_argtuple_error; | |
12042 } | |
12043 if (unlikely(kw_args > 0)) { | |
12044 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
12045 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_name") < 0)) __PYX_ERR(0, 463, __pyx_L3_error) | |
12046 } | |
12047 } else if (unlikely(__pyx_nargs != 1)) { | |
12048 goto __pyx_L5_argtuple_error; | |
12049 } else { | |
12050 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
12051 } | |
12052 __pyx_v_name = values[0]; | |
12053 } | |
12054 goto __pyx_L6_skip; | |
12055 __pyx_L5_argtuple_error:; | |
12056 __Pyx_RaiseArgtupleInvalid("set_name", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 463, __pyx_L3_error) | |
12057 __pyx_L6_skip:; | |
12058 goto __pyx_L4_argument_unpacking_done; | |
12059 __pyx_L3_error:; | |
12060 { | |
12061 Py_ssize_t __pyx_temp; | |
12062 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
12063 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
12064 } | |
12065 } | |
12066 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.set_name", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
12067 __Pyx_RefNannyFinishContext(); | |
12068 return NULL; | |
12069 __pyx_L4_argument_unpacking_done:; | |
12070 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_6set_name(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self), __pyx_v_name); | |
12071 | |
12072 /* function exit code */ | |
12073 { | |
12074 Py_ssize_t __pyx_temp; | |
12075 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
12076 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
12077 } | |
12078 } | |
12079 __Pyx_RefNannyFinishContext(); | |
12080 return __pyx_r; | |
12081 } | |
12082 | |
12083 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_6set_name(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v_name) { | |
12084 PyObject *__pyx_r = NULL; | |
12085 __Pyx_TraceDeclarations | |
12086 __Pyx_RefNannyDeclarations | |
12087 int __pyx_t_1; | |
12088 PyObject *__pyx_t_2 = NULL; | |
12089 int __pyx_lineno = 0; | |
12090 const char *__pyx_filename = NULL; | |
12091 int __pyx_clineno = 0; | |
12092 __Pyx_TraceFrameInit(__pyx_codeobj__27) | |
12093 __Pyx_RefNannySetupContext("set_name", 1); | |
12094 __Pyx_TraceCall("set_name", __pyx_f[0], 463, 0, __PYX_ERR(0, 463, __pyx_L1_error)); | |
12095 | |
12096 /* "pysam/libcfaidx.pyx":464 | |
12097 * | |
12098 * def set_name(self, name): | |
12099 * if name is None: # <<<<<<<<<<<<<< | |
12100 * raise ValueError("FastxRecord must have a name and not None") | |
12101 * self.name = name | |
12102 */ | |
12103 __pyx_t_1 = (__pyx_v_name == Py_None); | |
12104 if (unlikely(__pyx_t_1)) { | |
12105 | |
12106 /* "pysam/libcfaidx.pyx":465 | |
12107 * def set_name(self, name): | |
12108 * if name is None: | |
12109 * raise ValueError("FastxRecord must have a name and not None") # <<<<<<<<<<<<<< | |
12110 * self.name = name | |
12111 * | |
12112 */ | |
12113 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error) | |
12114 __Pyx_GOTREF(__pyx_t_2); | |
12115 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
12116 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12117 __PYX_ERR(0, 465, __pyx_L1_error) | |
12118 | |
12119 /* "pysam/libcfaidx.pyx":464 | |
12120 * | |
12121 * def set_name(self, name): | |
12122 * if name is None: # <<<<<<<<<<<<<< | |
12123 * raise ValueError("FastxRecord must have a name and not None") | |
12124 * self.name = name | |
12125 */ | |
12126 } | |
12127 | |
12128 /* "pysam/libcfaidx.pyx":466 | |
12129 * if name is None: | |
12130 * raise ValueError("FastxRecord must have a name and not None") | |
12131 * self.name = name # <<<<<<<<<<<<<< | |
12132 * | |
12133 * def set_comment(self, comment): | |
12134 */ | |
12135 if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_name))) __PYX_ERR(0, 466, __pyx_L1_error) | |
12136 __pyx_t_2 = __pyx_v_name; | |
12137 __Pyx_INCREF(__pyx_t_2); | |
12138 __Pyx_GIVEREF(__pyx_t_2); | |
12139 __Pyx_GOTREF(__pyx_v_self->name); | |
12140 __Pyx_DECREF(__pyx_v_self->name); | |
12141 __pyx_v_self->name = ((PyObject*)__pyx_t_2); | |
12142 __pyx_t_2 = 0; | |
12143 | |
12144 /* "pysam/libcfaidx.pyx":463 | |
12145 * return self.to_string() | |
12146 * | |
12147 * def set_name(self, name): # <<<<<<<<<<<<<< | |
12148 * if name is None: | |
12149 * raise ValueError("FastxRecord must have a name and not None") | |
12150 */ | |
12151 | |
12152 /* function exit code */ | |
12153 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
12154 goto __pyx_L0; | |
12155 __pyx_L1_error:; | |
12156 __Pyx_XDECREF(__pyx_t_2); | |
12157 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.set_name", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
12158 __pyx_r = NULL; | |
12159 __pyx_L0:; | |
12160 __Pyx_XGIVEREF(__pyx_r); | |
12161 __Pyx_TraceReturn(__pyx_r, 0); | |
12162 __Pyx_RefNannyFinishContext(); | |
12163 return __pyx_r; | |
12164 } | |
12165 | |
12166 /* "pysam/libcfaidx.pyx":468 | |
12167 * self.name = name | |
12168 * | |
12169 * def set_comment(self, comment): # <<<<<<<<<<<<<< | |
12170 * self.comment = comment | |
12171 * | |
12172 */ | |
12173 | |
12174 /* Python wrapper */ | |
12175 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_9set_comment(PyObject *__pyx_v_self, | |
12176 #if CYTHON_METH_FASTCALL | |
12177 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
12178 #else | |
12179 PyObject *__pyx_args, PyObject *__pyx_kwds | |
12180 #endif | |
12181 ); /*proto*/ | |
12182 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_11FastxRecord_8set_comment, "FastxRecord.set_comment(self, comment)"); | |
12183 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_11FastxRecord_9set_comment = {"set_comment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_9set_comment, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_11FastxRecord_8set_comment}; | |
12184 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_9set_comment(PyObject *__pyx_v_self, | |
12185 #if CYTHON_METH_FASTCALL | |
12186 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
12187 #else | |
12188 PyObject *__pyx_args, PyObject *__pyx_kwds | |
12189 #endif | |
12190 ) { | |
12191 PyObject *__pyx_v_comment = 0; | |
12192 #if !CYTHON_METH_FASTCALL | |
12193 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
12194 #endif | |
12195 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
12196 PyObject* values[1] = {0}; | |
12197 int __pyx_lineno = 0; | |
12198 const char *__pyx_filename = NULL; | |
12199 int __pyx_clineno = 0; | |
12200 PyObject *__pyx_r = 0; | |
12201 __Pyx_RefNannyDeclarations | |
12202 __Pyx_RefNannySetupContext("set_comment (wrapper)", 0); | |
12203 #if !CYTHON_METH_FASTCALL | |
12204 #if CYTHON_ASSUME_SAFE_MACROS | |
12205 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
12206 #else | |
12207 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
12208 #endif | |
12209 #endif | |
12210 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
12211 { | |
12212 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comment,0}; | |
12213 if (__pyx_kwds) { | |
12214 Py_ssize_t kw_args; | |
12215 switch (__pyx_nargs) { | |
12216 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
12217 CYTHON_FALLTHROUGH; | |
12218 case 0: break; | |
12219 default: goto __pyx_L5_argtuple_error; | |
12220 } | |
12221 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
12222 switch (__pyx_nargs) { | |
12223 case 0: | |
12224 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_comment)) != 0)) { | |
12225 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
12226 kw_args--; | |
12227 } | |
12228 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L3_error) | |
12229 else goto __pyx_L5_argtuple_error; | |
12230 } | |
12231 if (unlikely(kw_args > 0)) { | |
12232 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
12233 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_comment") < 0)) __PYX_ERR(0, 468, __pyx_L3_error) | |
12234 } | |
12235 } else if (unlikely(__pyx_nargs != 1)) { | |
12236 goto __pyx_L5_argtuple_error; | |
12237 } else { | |
12238 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
12239 } | |
12240 __pyx_v_comment = values[0]; | |
12241 } | |
12242 goto __pyx_L6_skip; | |
12243 __pyx_L5_argtuple_error:; | |
12244 __Pyx_RaiseArgtupleInvalid("set_comment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 468, __pyx_L3_error) | |
12245 __pyx_L6_skip:; | |
12246 goto __pyx_L4_argument_unpacking_done; | |
12247 __pyx_L3_error:; | |
12248 { | |
12249 Py_ssize_t __pyx_temp; | |
12250 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
12251 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
12252 } | |
12253 } | |
12254 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.set_comment", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
12255 __Pyx_RefNannyFinishContext(); | |
12256 return NULL; | |
12257 __pyx_L4_argument_unpacking_done:; | |
12258 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_8set_comment(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self), __pyx_v_comment); | |
12259 | |
12260 /* function exit code */ | |
12261 { | |
12262 Py_ssize_t __pyx_temp; | |
12263 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
12264 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
12265 } | |
12266 } | |
12267 __Pyx_RefNannyFinishContext(); | |
12268 return __pyx_r; | |
12269 } | |
12270 | |
12271 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_8set_comment(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v_comment) { | |
12272 PyObject *__pyx_r = NULL; | |
12273 __Pyx_TraceDeclarations | |
12274 __Pyx_RefNannyDeclarations | |
12275 PyObject *__pyx_t_1 = NULL; | |
12276 int __pyx_lineno = 0; | |
12277 const char *__pyx_filename = NULL; | |
12278 int __pyx_clineno = 0; | |
12279 __Pyx_TraceFrameInit(__pyx_codeobj__29) | |
12280 __Pyx_RefNannySetupContext("set_comment", 1); | |
12281 __Pyx_TraceCall("set_comment", __pyx_f[0], 468, 0, __PYX_ERR(0, 468, __pyx_L1_error)); | |
12282 | |
12283 /* "pysam/libcfaidx.pyx":469 | |
12284 * | |
12285 * def set_comment(self, comment): | |
12286 * self.comment = comment # <<<<<<<<<<<<<< | |
12287 * | |
12288 * def set_sequence(self, sequence, quality=None): | |
12289 */ | |
12290 if (!(likely(PyUnicode_CheckExact(__pyx_v_comment))||((__pyx_v_comment) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_comment))) __PYX_ERR(0, 469, __pyx_L1_error) | |
12291 __pyx_t_1 = __pyx_v_comment; | |
12292 __Pyx_INCREF(__pyx_t_1); | |
12293 __Pyx_GIVEREF(__pyx_t_1); | |
12294 __Pyx_GOTREF(__pyx_v_self->comment); | |
12295 __Pyx_DECREF(__pyx_v_self->comment); | |
12296 __pyx_v_self->comment = ((PyObject*)__pyx_t_1); | |
12297 __pyx_t_1 = 0; | |
12298 | |
12299 /* "pysam/libcfaidx.pyx":468 | |
12300 * self.name = name | |
12301 * | |
12302 * def set_comment(self, comment): # <<<<<<<<<<<<<< | |
12303 * self.comment = comment | |
12304 * | |
12305 */ | |
12306 | |
12307 /* function exit code */ | |
12308 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
12309 goto __pyx_L0; | |
12310 __pyx_L1_error:; | |
12311 __Pyx_XDECREF(__pyx_t_1); | |
12312 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.set_comment", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
12313 __pyx_r = NULL; | |
12314 __pyx_L0:; | |
12315 __Pyx_XGIVEREF(__pyx_r); | |
12316 __Pyx_TraceReturn(__pyx_r, 0); | |
12317 __Pyx_RefNannyFinishContext(); | |
12318 return __pyx_r; | |
12319 } | |
12320 | |
12321 /* "pysam/libcfaidx.pyx":471 | |
12322 * self.comment = comment | |
12323 * | |
12324 * def set_sequence(self, sequence, quality=None): # <<<<<<<<<<<<<< | |
12325 * """set sequence of this record. | |
12326 * | |
12327 */ | |
12328 | |
12329 /* Python wrapper */ | |
12330 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_11set_sequence(PyObject *__pyx_v_self, | |
12331 #if CYTHON_METH_FASTCALL | |
12332 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
12333 #else | |
12334 PyObject *__pyx_args, PyObject *__pyx_kwds | |
12335 #endif | |
12336 ); /*proto*/ | |
12337 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_11FastxRecord_10set_sequence, "FastxRecord.set_sequence(self, sequence, quality=None)\nset sequence of this record.\n\n "); | |
12338 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_11FastxRecord_11set_sequence = {"set_sequence", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_11set_sequence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_11FastxRecord_10set_sequence}; | |
12339 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_11set_sequence(PyObject *__pyx_v_self, | |
12340 #if CYTHON_METH_FASTCALL | |
12341 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
12342 #else | |
12343 PyObject *__pyx_args, PyObject *__pyx_kwds | |
12344 #endif | |
12345 ) { | |
12346 PyObject *__pyx_v_sequence = 0; | |
12347 PyObject *__pyx_v_quality = 0; | |
12348 #if !CYTHON_METH_FASTCALL | |
12349 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
12350 #endif | |
12351 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
12352 PyObject* values[2] = {0,0}; | |
12353 int __pyx_lineno = 0; | |
12354 const char *__pyx_filename = NULL; | |
12355 int __pyx_clineno = 0; | |
12356 PyObject *__pyx_r = 0; | |
12357 __Pyx_RefNannyDeclarations | |
12358 __Pyx_RefNannySetupContext("set_sequence (wrapper)", 0); | |
12359 #if !CYTHON_METH_FASTCALL | |
12360 #if CYTHON_ASSUME_SAFE_MACROS | |
12361 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
12362 #else | |
12363 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
12364 #endif | |
12365 #endif | |
12366 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
12367 { | |
12368 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sequence,&__pyx_n_s_quality,0}; | |
12369 values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); | |
12370 if (__pyx_kwds) { | |
12371 Py_ssize_t kw_args; | |
12372 switch (__pyx_nargs) { | |
12373 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
12374 CYTHON_FALLTHROUGH; | |
12375 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
12376 CYTHON_FALLTHROUGH; | |
12377 case 0: break; | |
12378 default: goto __pyx_L5_argtuple_error; | |
12379 } | |
12380 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
12381 switch (__pyx_nargs) { | |
12382 case 0: | |
12383 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sequence)) != 0)) { | |
12384 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
12385 kw_args--; | |
12386 } | |
12387 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 471, __pyx_L3_error) | |
12388 else goto __pyx_L5_argtuple_error; | |
12389 CYTHON_FALLTHROUGH; | |
12390 case 1: | |
12391 if (kw_args > 0) { | |
12392 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_quality); | |
12393 if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
12394 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 471, __pyx_L3_error) | |
12395 } | |
12396 } | |
12397 if (unlikely(kw_args > 0)) { | |
12398 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
12399 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_sequence") < 0)) __PYX_ERR(0, 471, __pyx_L3_error) | |
12400 } | |
12401 } else { | |
12402 switch (__pyx_nargs) { | |
12403 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
12404 CYTHON_FALLTHROUGH; | |
12405 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
12406 break; | |
12407 default: goto __pyx_L5_argtuple_error; | |
12408 } | |
12409 } | |
12410 __pyx_v_sequence = values[0]; | |
12411 __pyx_v_quality = values[1]; | |
12412 } | |
12413 goto __pyx_L6_skip; | |
12414 __pyx_L5_argtuple_error:; | |
12415 __Pyx_RaiseArgtupleInvalid("set_sequence", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 471, __pyx_L3_error) | |
12416 __pyx_L6_skip:; | |
12417 goto __pyx_L4_argument_unpacking_done; | |
12418 __pyx_L3_error:; | |
12419 { | |
12420 Py_ssize_t __pyx_temp; | |
12421 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
12422 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
12423 } | |
12424 } | |
12425 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.set_sequence", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
12426 __Pyx_RefNannyFinishContext(); | |
12427 return NULL; | |
12428 __pyx_L4_argument_unpacking_done:; | |
12429 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_10set_sequence(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self), __pyx_v_sequence, __pyx_v_quality); | |
12430 | |
12431 /* function exit code */ | |
12432 { | |
12433 Py_ssize_t __pyx_temp; | |
12434 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
12435 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
12436 } | |
12437 } | |
12438 __Pyx_RefNannyFinishContext(); | |
12439 return __pyx_r; | |
12440 } | |
12441 | |
12442 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_10set_sequence(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v_sequence, PyObject *__pyx_v_quality) { | |
12443 PyObject *__pyx_r = NULL; | |
12444 __Pyx_TraceDeclarations | |
12445 __Pyx_RefNannyDeclarations | |
12446 PyObject *__pyx_t_1 = NULL; | |
12447 int __pyx_t_2; | |
12448 Py_ssize_t __pyx_t_3; | |
12449 Py_ssize_t __pyx_t_4; | |
12450 PyObject *__pyx_t_5 = NULL; | |
12451 PyObject *__pyx_t_6 = NULL; | |
12452 PyObject *__pyx_t_7 = NULL; | |
12453 PyObject *__pyx_t_8 = NULL; | |
12454 unsigned int __pyx_t_9; | |
12455 int __pyx_lineno = 0; | |
12456 const char *__pyx_filename = NULL; | |
12457 int __pyx_clineno = 0; | |
12458 __Pyx_TraceFrameInit(__pyx_codeobj__30) | |
12459 __Pyx_RefNannySetupContext("set_sequence", 1); | |
12460 __Pyx_TraceCall("set_sequence", __pyx_f[0], 471, 0, __PYX_ERR(0, 471, __pyx_L1_error)); | |
12461 | |
12462 /* "pysam/libcfaidx.pyx":475 | |
12463 * | |
12464 * """ | |
12465 * self.sequence = sequence # <<<<<<<<<<<<<< | |
12466 * if quality is not None: | |
12467 * if len(sequence) != len(quality): | |
12468 */ | |
12469 if (!(likely(PyUnicode_CheckExact(__pyx_v_sequence))||((__pyx_v_sequence) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_sequence))) __PYX_ERR(0, 475, __pyx_L1_error) | |
12470 __pyx_t_1 = __pyx_v_sequence; | |
12471 __Pyx_INCREF(__pyx_t_1); | |
12472 __Pyx_GIVEREF(__pyx_t_1); | |
12473 __Pyx_GOTREF(__pyx_v_self->sequence); | |
12474 __Pyx_DECREF(__pyx_v_self->sequence); | |
12475 __pyx_v_self->sequence = ((PyObject*)__pyx_t_1); | |
12476 __pyx_t_1 = 0; | |
12477 | |
12478 /* "pysam/libcfaidx.pyx":476 | |
12479 * """ | |
12480 * self.sequence = sequence | |
12481 * if quality is not None: # <<<<<<<<<<<<<< | |
12482 * if len(sequence) != len(quality): | |
12483 * raise ValueError("sequence and quality length do not match: {} vs {}".format( | |
12484 */ | |
12485 __pyx_t_2 = (__pyx_v_quality != Py_None); | |
12486 if (__pyx_t_2) { | |
12487 | |
12488 /* "pysam/libcfaidx.pyx":477 | |
12489 * self.sequence = sequence | |
12490 * if quality is not None: | |
12491 * if len(sequence) != len(quality): # <<<<<<<<<<<<<< | |
12492 * raise ValueError("sequence and quality length do not match: {} vs {}".format( | |
12493 * len(sequence), len(quality))) | |
12494 */ | |
12495 __pyx_t_3 = PyObject_Length(__pyx_v_sequence); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 477, __pyx_L1_error) | |
12496 __pyx_t_4 = PyObject_Length(__pyx_v_quality); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 477, __pyx_L1_error) | |
12497 __pyx_t_2 = (__pyx_t_3 != __pyx_t_4); | |
12498 if (unlikely(__pyx_t_2)) { | |
12499 | |
12500 /* "pysam/libcfaidx.pyx":478 | |
12501 * if quality is not None: | |
12502 * if len(sequence) != len(quality): | |
12503 * raise ValueError("sequence and quality length do not match: {} vs {}".format( # <<<<<<<<<<<<<< | |
12504 * len(sequence), len(quality))) | |
12505 * | |
12506 */ | |
12507 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_sequence_and_quality_length_do_n, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L1_error) | |
12508 __Pyx_GOTREF(__pyx_t_5); | |
12509 | |
12510 /* "pysam/libcfaidx.pyx":479 | |
12511 * if len(sequence) != len(quality): | |
12512 * raise ValueError("sequence and quality length do not match: {} vs {}".format( | |
12513 * len(sequence), len(quality))) # <<<<<<<<<<<<<< | |
12514 * | |
12515 * self.quality = quality | |
12516 */ | |
12517 __pyx_t_4 = PyObject_Length(__pyx_v_sequence); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 479, __pyx_L1_error) | |
12518 __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 479, __pyx_L1_error) | |
12519 __Pyx_GOTREF(__pyx_t_6); | |
12520 __pyx_t_4 = PyObject_Length(__pyx_v_quality); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 479, __pyx_L1_error) | |
12521 __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 479, __pyx_L1_error) | |
12522 __Pyx_GOTREF(__pyx_t_7); | |
12523 __pyx_t_8 = NULL; | |
12524 __pyx_t_9 = 0; | |
12525 #if CYTHON_UNPACK_METHODS | |
12526 if (likely(PyMethod_Check(__pyx_t_5))) { | |
12527 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); | |
12528 if (likely(__pyx_t_8)) { | |
12529 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); | |
12530 __Pyx_INCREF(__pyx_t_8); | |
12531 __Pyx_INCREF(function); | |
12532 __Pyx_DECREF_SET(__pyx_t_5, function); | |
12533 __pyx_t_9 = 1; | |
12534 } | |
12535 } | |
12536 #endif | |
12537 { | |
12538 PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; | |
12539 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); | |
12540 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; | |
12541 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
12542 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; | |
12543 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error) | |
12544 __Pyx_GOTREF(__pyx_t_1); | |
12545 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
12546 } | |
12547 | |
12548 /* "pysam/libcfaidx.pyx":478 | |
12549 * if quality is not None: | |
12550 * if len(sequence) != len(quality): | |
12551 * raise ValueError("sequence and quality length do not match: {} vs {}".format( # <<<<<<<<<<<<<< | |
12552 * len(sequence), len(quality))) | |
12553 * | |
12554 */ | |
12555 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L1_error) | |
12556 __Pyx_GOTREF(__pyx_t_5); | |
12557 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12558 __Pyx_Raise(__pyx_t_5, 0, 0, 0); | |
12559 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
12560 __PYX_ERR(0, 478, __pyx_L1_error) | |
12561 | |
12562 /* "pysam/libcfaidx.pyx":477 | |
12563 * self.sequence = sequence | |
12564 * if quality is not None: | |
12565 * if len(sequence) != len(quality): # <<<<<<<<<<<<<< | |
12566 * raise ValueError("sequence and quality length do not match: {} vs {}".format( | |
12567 * len(sequence), len(quality))) | |
12568 */ | |
12569 } | |
12570 | |
12571 /* "pysam/libcfaidx.pyx":481 | |
12572 * len(sequence), len(quality))) | |
12573 * | |
12574 * self.quality = quality # <<<<<<<<<<<<<< | |
12575 * else: | |
12576 * self.quality = None | |
12577 */ | |
12578 if (!(likely(PyUnicode_CheckExact(__pyx_v_quality))||((__pyx_v_quality) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_quality))) __PYX_ERR(0, 481, __pyx_L1_error) | |
12579 __pyx_t_5 = __pyx_v_quality; | |
12580 __Pyx_INCREF(__pyx_t_5); | |
12581 __Pyx_GIVEREF(__pyx_t_5); | |
12582 __Pyx_GOTREF(__pyx_v_self->quality); | |
12583 __Pyx_DECREF(__pyx_v_self->quality); | |
12584 __pyx_v_self->quality = ((PyObject*)__pyx_t_5); | |
12585 __pyx_t_5 = 0; | |
12586 | |
12587 /* "pysam/libcfaidx.pyx":476 | |
12588 * """ | |
12589 * self.sequence = sequence | |
12590 * if quality is not None: # <<<<<<<<<<<<<< | |
12591 * if len(sequence) != len(quality): | |
12592 * raise ValueError("sequence and quality length do not match: {} vs {}".format( | |
12593 */ | |
12594 goto __pyx_L3; | |
12595 } | |
12596 | |
12597 /* "pysam/libcfaidx.pyx":483 | |
12598 * self.quality = quality | |
12599 * else: | |
12600 * self.quality = None # <<<<<<<<<<<<<< | |
12601 * | |
12602 * def __str__(self): | |
12603 */ | |
12604 /*else*/ { | |
12605 __Pyx_INCREF(Py_None); | |
12606 __Pyx_GIVEREF(Py_None); | |
12607 __Pyx_GOTREF(__pyx_v_self->quality); | |
12608 __Pyx_DECREF(__pyx_v_self->quality); | |
12609 __pyx_v_self->quality = ((PyObject*)Py_None); | |
12610 } | |
12611 __pyx_L3:; | |
12612 | |
12613 /* "pysam/libcfaidx.pyx":471 | |
12614 * self.comment = comment | |
12615 * | |
12616 * def set_sequence(self, sequence, quality=None): # <<<<<<<<<<<<<< | |
12617 * """set sequence of this record. | |
12618 * | |
12619 */ | |
12620 | |
12621 /* function exit code */ | |
12622 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
12623 goto __pyx_L0; | |
12624 __pyx_L1_error:; | |
12625 __Pyx_XDECREF(__pyx_t_1); | |
12626 __Pyx_XDECREF(__pyx_t_5); | |
12627 __Pyx_XDECREF(__pyx_t_6); | |
12628 __Pyx_XDECREF(__pyx_t_7); | |
12629 __Pyx_XDECREF(__pyx_t_8); | |
12630 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.set_sequence", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
12631 __pyx_r = NULL; | |
12632 __pyx_L0:; | |
12633 __Pyx_XGIVEREF(__pyx_r); | |
12634 __Pyx_TraceReturn(__pyx_r, 0); | |
12635 __Pyx_RefNannyFinishContext(); | |
12636 return __pyx_r; | |
12637 } | |
12638 | |
12639 /* "pysam/libcfaidx.pyx":485 | |
12640 * self.quality = None | |
12641 * | |
12642 * def __str__(self): # <<<<<<<<<<<<<< | |
12643 * return self.to_string() | |
12644 * | |
12645 */ | |
12646 | |
12647 /* Python wrapper */ | |
12648 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_13__str__(PyObject *__pyx_v_self); /*proto*/ | |
12649 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_13__str__(PyObject *__pyx_v_self) { | |
12650 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
12651 PyObject *__pyx_r = 0; | |
12652 __Pyx_RefNannyDeclarations | |
12653 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); | |
12654 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
12655 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_12__str__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self)); | |
12656 | |
12657 /* function exit code */ | |
12658 __Pyx_RefNannyFinishContext(); | |
12659 return __pyx_r; | |
12660 } | |
12661 | |
12662 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_12__str__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self) { | |
12663 PyObject *__pyx_r = NULL; | |
12664 __Pyx_TraceDeclarations | |
12665 __Pyx_RefNannyDeclarations | |
12666 PyObject *__pyx_t_1 = NULL; | |
12667 int __pyx_lineno = 0; | |
12668 const char *__pyx_filename = NULL; | |
12669 int __pyx_clineno = 0; | |
12670 __Pyx_RefNannySetupContext("__str__", 1); | |
12671 __Pyx_TraceCall("__str__", __pyx_f[0], 485, 0, __PYX_ERR(0, 485, __pyx_L1_error)); | |
12672 | |
12673 /* "pysam/libcfaidx.pyx":486 | |
12674 * | |
12675 * def __str__(self): | |
12676 * return self.to_string() # <<<<<<<<<<<<<< | |
12677 * | |
12678 * cpdef array.array get_quality_array(self, int offset=33): | |
12679 */ | |
12680 __Pyx_XDECREF(__pyx_r); | |
12681 __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error) | |
12682 __Pyx_GOTREF(__pyx_t_1); | |
12683 __pyx_r = __pyx_t_1; | |
12684 __pyx_t_1 = 0; | |
12685 goto __pyx_L0; | |
12686 | |
12687 /* "pysam/libcfaidx.pyx":485 | |
12688 * self.quality = None | |
12689 * | |
12690 * def __str__(self): # <<<<<<<<<<<<<< | |
12691 * return self.to_string() | |
12692 * | |
12693 */ | |
12694 | |
12695 /* function exit code */ | |
12696 __pyx_L1_error:; | |
12697 __Pyx_XDECREF(__pyx_t_1); | |
12698 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
12699 __pyx_r = NULL; | |
12700 __pyx_L0:; | |
12701 __Pyx_XGIVEREF(__pyx_r); | |
12702 __Pyx_TraceReturn(__pyx_r, 0); | |
12703 __Pyx_RefNannyFinishContext(); | |
12704 return __pyx_r; | |
12705 } | |
12706 | |
12707 /* "pysam/libcfaidx.pyx":488 | |
12708 * return self.to_string() | |
12709 * | |
12710 * cpdef array.array get_quality_array(self, int offset=33): # <<<<<<<<<<<<<< | |
12711 * '''return quality values as array after subtracting offset.''' | |
12712 * if self.quality is None: | |
12713 */ | |
12714 | |
12715 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_15get_quality_array(PyObject *__pyx_v_self, | |
12716 #if CYTHON_METH_FASTCALL | |
12717 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
12718 #else | |
12719 PyObject *__pyx_args, PyObject *__pyx_kwds | |
12720 #endif | |
12721 ); /*proto*/ | |
12722 static arrayobject *__pyx_f_5pysam_9libcfaidx_11FastxRecord_get_quality_array(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcfaidx_11FastxRecord_get_quality_array *__pyx_optional_args) { | |
12723 int __pyx_v_offset = ((int)33); | |
12724 arrayobject *__pyx_r = NULL; | |
12725 __Pyx_TraceDeclarations | |
12726 __Pyx_RefNannyDeclarations | |
12727 PyObject *__pyx_t_1 = NULL; | |
12728 PyObject *__pyx_t_2 = NULL; | |
12729 PyObject *__pyx_t_3 = NULL; | |
12730 PyObject *__pyx_t_4 = NULL; | |
12731 PyObject *__pyx_t_5 = NULL; | |
12732 unsigned int __pyx_t_6; | |
12733 int __pyx_t_7; | |
12734 struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array __pyx_t_8; | |
12735 int __pyx_lineno = 0; | |
12736 const char *__pyx_filename = NULL; | |
12737 int __pyx_clineno = 0; | |
12738 __Pyx_TraceFrameInit(__pyx_codeobj__31) | |
12739 __Pyx_RefNannySetupContext("get_quality_array", 1); | |
12740 __Pyx_TraceCall("get_quality_array", __pyx_f[0], 488, 0, __PYX_ERR(0, 488, __pyx_L1_error)); | |
12741 if (__pyx_optional_args) { | |
12742 if (__pyx_optional_args->__pyx_n > 0) { | |
12743 __pyx_v_offset = __pyx_optional_args->offset; | |
12744 } | |
12745 } | |
12746 /* Check if called by wrapper */ | |
12747 if (unlikely(__pyx_skip_dispatch)) ; | |
12748 /* Check if overridden in Python */ | |
12749 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { | |
12750 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS | |
12751 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; | |
12752 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { | |
12753 PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); | |
12754 #endif | |
12755 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_quality_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error) | |
12756 __Pyx_GOTREF(__pyx_t_1); | |
12757 if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_5pysam_9libcfaidx_11FastxRecord_15get_quality_array)) { | |
12758 __Pyx_XDECREF((PyObject *)__pyx_r); | |
12759 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L1_error) | |
12760 __Pyx_GOTREF(__pyx_t_3); | |
12761 __Pyx_INCREF(__pyx_t_1); | |
12762 __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL; | |
12763 __pyx_t_6 = 0; | |
12764 #if CYTHON_UNPACK_METHODS | |
12765 if (unlikely(PyMethod_Check(__pyx_t_4))) { | |
12766 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); | |
12767 if (likely(__pyx_t_5)) { | |
12768 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); | |
12769 __Pyx_INCREF(__pyx_t_5); | |
12770 __Pyx_INCREF(function); | |
12771 __Pyx_DECREF_SET(__pyx_t_4, function); | |
12772 __pyx_t_6 = 1; | |
12773 } | |
12774 } | |
12775 #endif | |
12776 { | |
12777 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; | |
12778 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); | |
12779 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; | |
12780 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
12781 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) | |
12782 __Pyx_GOTREF(__pyx_t_2); | |
12783 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
12784 } | |
12785 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7cpython_5array_array))))) __PYX_ERR(0, 488, __pyx_L1_error) | |
12786 __pyx_r = ((arrayobject *)__pyx_t_2); | |
12787 __pyx_t_2 = 0; | |
12788 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12789 goto __pyx_L0; | |
12790 } | |
12791 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS | |
12792 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); | |
12793 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); | |
12794 if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) { | |
12795 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; | |
12796 } | |
12797 #endif | |
12798 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12799 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS | |
12800 } | |
12801 #endif | |
12802 } | |
12803 | |
12804 /* "pysam/libcfaidx.pyx":490 | |
12805 * cpdef array.array get_quality_array(self, int offset=33): | |
12806 * '''return quality values as array after subtracting offset.''' | |
12807 * if self.quality is None: # <<<<<<<<<<<<<< | |
12808 * return None | |
12809 * return qualitystring_to_array(force_bytes(self.quality), | |
12810 */ | |
12811 __pyx_t_7 = (__pyx_v_self->quality == ((PyObject*)Py_None)); | |
12812 if (__pyx_t_7) { | |
12813 | |
12814 /* "pysam/libcfaidx.pyx":491 | |
12815 * '''return quality values as array after subtracting offset.''' | |
12816 * if self.quality is None: | |
12817 * return None # <<<<<<<<<<<<<< | |
12818 * return qualitystring_to_array(force_bytes(self.quality), | |
12819 * offset=offset) | |
12820 */ | |
12821 __Pyx_XDECREF((PyObject *)__pyx_r); | |
12822 __pyx_r = ((arrayobject *)Py_None); __Pyx_INCREF(Py_None); | |
12823 goto __pyx_L0; | |
12824 | |
12825 /* "pysam/libcfaidx.pyx":490 | |
12826 * cpdef array.array get_quality_array(self, int offset=33): | |
12827 * '''return quality values as array after subtracting offset.''' | |
12828 * if self.quality is None: # <<<<<<<<<<<<<< | |
12829 * return None | |
12830 * return qualitystring_to_array(force_bytes(self.quality), | |
12831 */ | |
12832 } | |
12833 | |
12834 /* "pysam/libcfaidx.pyx":492 | |
12835 * if self.quality is None: | |
12836 * return None | |
12837 * return qualitystring_to_array(force_bytes(self.quality), # <<<<<<<<<<<<<< | |
12838 * offset=offset) | |
12839 * | |
12840 */ | |
12841 __Pyx_XDECREF((PyObject *)__pyx_r); | |
12842 __pyx_t_1 = __pyx_v_self->quality; | |
12843 __Pyx_INCREF(__pyx_t_1); | |
12844 __pyx_t_2 = __pyx_f_5pysam_9libcutils_force_bytes(__pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error) | |
12845 __Pyx_GOTREF(__pyx_t_2); | |
12846 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
12847 | |
12848 /* "pysam/libcfaidx.pyx":493 | |
12849 * return None | |
12850 * return qualitystring_to_array(force_bytes(self.quality), | |
12851 * offset=offset) # <<<<<<<<<<<<<< | |
12852 * | |
12853 * | |
12854 */ | |
12855 __pyx_t_8.__pyx_n = 1; | |
12856 __pyx_t_8.offset = __pyx_v_offset; | |
12857 __pyx_t_1 = ((PyObject *)__pyx_f_5pysam_9libcutils_qualitystring_to_array(__pyx_t_2, 0, &__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error) | |
12858 __Pyx_GOTREF(__pyx_t_1); | |
12859 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
12860 __pyx_r = ((arrayobject *)__pyx_t_1); | |
12861 __pyx_t_1 = 0; | |
12862 goto __pyx_L0; | |
12863 | |
12864 /* "pysam/libcfaidx.pyx":488 | |
12865 * return self.to_string() | |
12866 * | |
12867 * cpdef array.array get_quality_array(self, int offset=33): # <<<<<<<<<<<<<< | |
12868 * '''return quality values as array after subtracting offset.''' | |
12869 * if self.quality is None: | |
12870 */ | |
12871 | |
12872 /* function exit code */ | |
12873 __pyx_L1_error:; | |
12874 __Pyx_XDECREF(__pyx_t_1); | |
12875 __Pyx_XDECREF(__pyx_t_2); | |
12876 __Pyx_XDECREF(__pyx_t_3); | |
12877 __Pyx_XDECREF(__pyx_t_4); | |
12878 __Pyx_XDECREF(__pyx_t_5); | |
12879 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.get_quality_array", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
12880 __pyx_r = 0; | |
12881 __pyx_L0:; | |
12882 __Pyx_XGIVEREF((PyObject *)__pyx_r); | |
12883 __Pyx_TraceReturn(__pyx_r, 0); | |
12884 __Pyx_RefNannyFinishContext(); | |
12885 return __pyx_r; | |
12886 } | |
12887 | |
12888 /* Python wrapper */ | |
12889 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_15get_quality_array(PyObject *__pyx_v_self, | |
12890 #if CYTHON_METH_FASTCALL | |
12891 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
12892 #else | |
12893 PyObject *__pyx_args, PyObject *__pyx_kwds | |
12894 #endif | |
12895 ); /*proto*/ | |
12896 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_11FastxRecord_14get_quality_array, "FastxRecord.get_quality_array(self, int offset=33) -> array\nreturn quality values as array after subtracting offset."); | |
12897 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_11FastxRecord_15get_quality_array = {"get_quality_array", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_15get_quality_array, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_11FastxRecord_14get_quality_array}; | |
12898 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_15get_quality_array(PyObject *__pyx_v_self, | |
12899 #if CYTHON_METH_FASTCALL | |
12900 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
12901 #else | |
12902 PyObject *__pyx_args, PyObject *__pyx_kwds | |
12903 #endif | |
12904 ) { | |
12905 int __pyx_v_offset; | |
12906 #if !CYTHON_METH_FASTCALL | |
12907 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
12908 #endif | |
12909 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
12910 PyObject* values[1] = {0}; | |
12911 int __pyx_lineno = 0; | |
12912 const char *__pyx_filename = NULL; | |
12913 int __pyx_clineno = 0; | |
12914 PyObject *__pyx_r = 0; | |
12915 __Pyx_RefNannyDeclarations | |
12916 __Pyx_RefNannySetupContext("get_quality_array (wrapper)", 0); | |
12917 #if !CYTHON_METH_FASTCALL | |
12918 #if CYTHON_ASSUME_SAFE_MACROS | |
12919 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
12920 #else | |
12921 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
12922 #endif | |
12923 #endif | |
12924 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
12925 { | |
12926 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,0}; | |
12927 if (__pyx_kwds) { | |
12928 Py_ssize_t kw_args; | |
12929 switch (__pyx_nargs) { | |
12930 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
12931 CYTHON_FALLTHROUGH; | |
12932 case 0: break; | |
12933 default: goto __pyx_L5_argtuple_error; | |
12934 } | |
12935 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
12936 switch (__pyx_nargs) { | |
12937 case 0: | |
12938 if (kw_args > 0) { | |
12939 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset); | |
12940 if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
12941 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 488, __pyx_L3_error) | |
12942 } | |
12943 } | |
12944 if (unlikely(kw_args > 0)) { | |
12945 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
12946 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_quality_array") < 0)) __PYX_ERR(0, 488, __pyx_L3_error) | |
12947 } | |
12948 } else { | |
12949 switch (__pyx_nargs) { | |
12950 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
12951 CYTHON_FALLTHROUGH; | |
12952 case 0: break; | |
12953 default: goto __pyx_L5_argtuple_error; | |
12954 } | |
12955 } | |
12956 if (values[0]) { | |
12957 __pyx_v_offset = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 488, __pyx_L3_error) | |
12958 } else { | |
12959 __pyx_v_offset = ((int)33); | |
12960 } | |
12961 } | |
12962 goto __pyx_L6_skip; | |
12963 __pyx_L5_argtuple_error:; | |
12964 __Pyx_RaiseArgtupleInvalid("get_quality_array", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 488, __pyx_L3_error) | |
12965 __pyx_L6_skip:; | |
12966 goto __pyx_L4_argument_unpacking_done; | |
12967 __pyx_L3_error:; | |
12968 { | |
12969 Py_ssize_t __pyx_temp; | |
12970 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
12971 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
12972 } | |
12973 } | |
12974 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.get_quality_array", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
12975 __Pyx_RefNannyFinishContext(); | |
12976 return NULL; | |
12977 __pyx_L4_argument_unpacking_done:; | |
12978 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_14get_quality_array(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self), __pyx_v_offset); | |
12979 | |
12980 /* function exit code */ | |
12981 { | |
12982 Py_ssize_t __pyx_temp; | |
12983 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
12984 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
12985 } | |
12986 } | |
12987 __Pyx_RefNannyFinishContext(); | |
12988 return __pyx_r; | |
12989 } | |
12990 | |
12991 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_14get_quality_array(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, int __pyx_v_offset) { | |
12992 PyObject *__pyx_r = NULL; | |
12993 __Pyx_TraceDeclarations | |
12994 __Pyx_RefNannyDeclarations | |
12995 PyObject *__pyx_t_1 = NULL; | |
12996 struct __pyx_opt_args_5pysam_9libcfaidx_11FastxRecord_get_quality_array __pyx_t_2; | |
12997 int __pyx_lineno = 0; | |
12998 const char *__pyx_filename = NULL; | |
12999 int __pyx_clineno = 0; | |
13000 __Pyx_TraceFrameInit(__pyx_codeobj__31) | |
13001 __Pyx_RefNannySetupContext("get_quality_array", 1); | |
13002 __Pyx_TraceCall("get_quality_array (wrapper)", __pyx_f[0], 488, 0, __PYX_ERR(0, 488, __pyx_L1_error)); | |
13003 __Pyx_XDECREF(__pyx_r); | |
13004 __pyx_t_2.__pyx_n = 1; | |
13005 __pyx_t_2.offset = __pyx_v_offset; | |
13006 __pyx_t_1 = ((PyObject *)__pyx_vtabptr_5pysam_9libcfaidx_FastxRecord->get_quality_array(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error) | |
13007 __Pyx_GOTREF(__pyx_t_1); | |
13008 __pyx_r = __pyx_t_1; | |
13009 __pyx_t_1 = 0; | |
13010 goto __pyx_L0; | |
13011 | |
13012 /* function exit code */ | |
13013 __pyx_L1_error:; | |
13014 __Pyx_XDECREF(__pyx_t_1); | |
13015 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.get_quality_array", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13016 __pyx_r = NULL; | |
13017 __pyx_L0:; | |
13018 __Pyx_XGIVEREF(__pyx_r); | |
13019 __Pyx_TraceReturn(__pyx_r, 0); | |
13020 __Pyx_RefNannyFinishContext(); | |
13021 return __pyx_r; | |
13022 } | |
13023 | |
13024 /* "pysam/libcfaidx.pxd":57 | |
13025 * Python container for pysam.libcfaidx.FastqProxy with persistence. | |
13026 * """ | |
13027 * cdef public str comment, quality, sequence, name # <<<<<<<<<<<<<< | |
13028 * cdef cython.str to_string(self) | |
13029 * cdef cython.str tostring(self) | |
13030 */ | |
13031 | |
13032 /* Python wrapper */ | |
13033 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_7comment_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
13034 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_7comment_1__get__(PyObject *__pyx_v_self) { | |
13035 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13036 PyObject *__pyx_r = 0; | |
13037 __Pyx_RefNannyDeclarations | |
13038 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
13039 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
13040 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_7comment___get__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self)); | |
13041 | |
13042 /* function exit code */ | |
13043 __Pyx_RefNannyFinishContext(); | |
13044 return __pyx_r; | |
13045 } | |
13046 | |
13047 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_7comment___get__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self) { | |
13048 PyObject *__pyx_r = NULL; | |
13049 __Pyx_TraceDeclarations | |
13050 __Pyx_RefNannyDeclarations | |
13051 int __pyx_lineno = 0; | |
13052 const char *__pyx_filename = NULL; | |
13053 int __pyx_clineno = 0; | |
13054 __Pyx_RefNannySetupContext("__get__", 1); | |
13055 __Pyx_TraceCall("__get__", __pyx_f[4], 57, 0, __PYX_ERR(4, 57, __pyx_L1_error)); | |
13056 __Pyx_XDECREF(__pyx_r); | |
13057 __Pyx_INCREF(__pyx_v_self->comment); | |
13058 __pyx_r = __pyx_v_self->comment; | |
13059 goto __pyx_L0; | |
13060 | |
13061 /* function exit code */ | |
13062 __pyx_L1_error:; | |
13063 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.comment.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13064 __pyx_r = NULL; | |
13065 __pyx_L0:; | |
13066 __Pyx_XGIVEREF(__pyx_r); | |
13067 __Pyx_TraceReturn(__pyx_r, 0); | |
13068 __Pyx_RefNannyFinishContext(); | |
13069 return __pyx_r; | |
13070 } | |
13071 | |
13072 /* Python wrapper */ | |
13073 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_7comment_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ | |
13074 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_7comment_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { | |
13075 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13076 int __pyx_r; | |
13077 __Pyx_RefNannyDeclarations | |
13078 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); | |
13079 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
13080 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_7comment_2__set__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self), ((PyObject *)__pyx_v_value)); | |
13081 | |
13082 /* function exit code */ | |
13083 __Pyx_RefNannyFinishContext(); | |
13084 return __pyx_r; | |
13085 } | |
13086 | |
13087 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord_7comment_2__set__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v_value) { | |
13088 int __pyx_r; | |
13089 __Pyx_TraceDeclarations | |
13090 __Pyx_RefNannyDeclarations | |
13091 PyObject *__pyx_t_1 = NULL; | |
13092 int __pyx_lineno = 0; | |
13093 const char *__pyx_filename = NULL; | |
13094 int __pyx_clineno = 0; | |
13095 __Pyx_RefNannySetupContext("__set__", 1); | |
13096 __Pyx_TraceCall("__set__", __pyx_f[4], 57, 0, __PYX_ERR(4, 57, __pyx_L1_error)); | |
13097 if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_value))) __PYX_ERR(4, 57, __pyx_L1_error) | |
13098 __pyx_t_1 = __pyx_v_value; | |
13099 __Pyx_INCREF(__pyx_t_1); | |
13100 __Pyx_GIVEREF(__pyx_t_1); | |
13101 __Pyx_GOTREF(__pyx_v_self->comment); | |
13102 __Pyx_DECREF(__pyx_v_self->comment); | |
13103 __pyx_v_self->comment = ((PyObject*)__pyx_t_1); | |
13104 __pyx_t_1 = 0; | |
13105 | |
13106 /* function exit code */ | |
13107 __pyx_r = 0; | |
13108 goto __pyx_L0; | |
13109 __pyx_L1_error:; | |
13110 __Pyx_XDECREF(__pyx_t_1); | |
13111 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.comment.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13112 __pyx_r = -1; | |
13113 __pyx_L0:; | |
13114 __Pyx_TraceReturn(Py_None, 0); | |
13115 __Pyx_RefNannyFinishContext(); | |
13116 return __pyx_r; | |
13117 } | |
13118 | |
13119 /* Python wrapper */ | |
13120 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_7comment_5__del__(PyObject *__pyx_v_self); /*proto*/ | |
13121 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_7comment_5__del__(PyObject *__pyx_v_self) { | |
13122 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13123 int __pyx_r; | |
13124 __Pyx_RefNannyDeclarations | |
13125 __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); | |
13126 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
13127 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_7comment_4__del__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self)); | |
13128 | |
13129 /* function exit code */ | |
13130 __Pyx_RefNannyFinishContext(); | |
13131 return __pyx_r; | |
13132 } | |
13133 | |
13134 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord_7comment_4__del__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self) { | |
13135 int __pyx_r; | |
13136 __Pyx_TraceDeclarations | |
13137 __Pyx_RefNannyDeclarations | |
13138 int __pyx_lineno = 0; | |
13139 const char *__pyx_filename = NULL; | |
13140 int __pyx_clineno = 0; | |
13141 __Pyx_RefNannySetupContext("__del__", 1); | |
13142 __Pyx_TraceCall("__del__", __pyx_f[4], 57, 0, __PYX_ERR(4, 57, __pyx_L1_error)); | |
13143 __Pyx_INCREF(Py_None); | |
13144 __Pyx_GIVEREF(Py_None); | |
13145 __Pyx_GOTREF(__pyx_v_self->comment); | |
13146 __Pyx_DECREF(__pyx_v_self->comment); | |
13147 __pyx_v_self->comment = ((PyObject*)Py_None); | |
13148 | |
13149 /* function exit code */ | |
13150 __pyx_r = 0; | |
13151 goto __pyx_L0; | |
13152 __pyx_L1_error:; | |
13153 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.comment.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13154 __pyx_r = -1; | |
13155 __pyx_L0:; | |
13156 __Pyx_TraceReturn(Py_None, 0); | |
13157 __Pyx_RefNannyFinishContext(); | |
13158 return __pyx_r; | |
13159 } | |
13160 | |
13161 /* Python wrapper */ | |
13162 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_7quality_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
13163 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_7quality_1__get__(PyObject *__pyx_v_self) { | |
13164 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13165 PyObject *__pyx_r = 0; | |
13166 __Pyx_RefNannyDeclarations | |
13167 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
13168 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
13169 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_7quality___get__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self)); | |
13170 | |
13171 /* function exit code */ | |
13172 __Pyx_RefNannyFinishContext(); | |
13173 return __pyx_r; | |
13174 } | |
13175 | |
13176 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_7quality___get__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self) { | |
13177 PyObject *__pyx_r = NULL; | |
13178 __Pyx_TraceDeclarations | |
13179 __Pyx_RefNannyDeclarations | |
13180 int __pyx_lineno = 0; | |
13181 const char *__pyx_filename = NULL; | |
13182 int __pyx_clineno = 0; | |
13183 __Pyx_RefNannySetupContext("__get__", 1); | |
13184 __Pyx_TraceCall("__get__", __pyx_f[4], 57, 0, __PYX_ERR(4, 57, __pyx_L1_error)); | |
13185 __Pyx_XDECREF(__pyx_r); | |
13186 __Pyx_INCREF(__pyx_v_self->quality); | |
13187 __pyx_r = __pyx_v_self->quality; | |
13188 goto __pyx_L0; | |
13189 | |
13190 /* function exit code */ | |
13191 __pyx_L1_error:; | |
13192 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.quality.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13193 __pyx_r = NULL; | |
13194 __pyx_L0:; | |
13195 __Pyx_XGIVEREF(__pyx_r); | |
13196 __Pyx_TraceReturn(__pyx_r, 0); | |
13197 __Pyx_RefNannyFinishContext(); | |
13198 return __pyx_r; | |
13199 } | |
13200 | |
13201 /* Python wrapper */ | |
13202 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_7quality_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ | |
13203 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_7quality_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { | |
13204 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13205 int __pyx_r; | |
13206 __Pyx_RefNannyDeclarations | |
13207 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); | |
13208 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
13209 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_7quality_2__set__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self), ((PyObject *)__pyx_v_value)); | |
13210 | |
13211 /* function exit code */ | |
13212 __Pyx_RefNannyFinishContext(); | |
13213 return __pyx_r; | |
13214 } | |
13215 | |
13216 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord_7quality_2__set__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v_value) { | |
13217 int __pyx_r; | |
13218 __Pyx_TraceDeclarations | |
13219 __Pyx_RefNannyDeclarations | |
13220 PyObject *__pyx_t_1 = NULL; | |
13221 int __pyx_lineno = 0; | |
13222 const char *__pyx_filename = NULL; | |
13223 int __pyx_clineno = 0; | |
13224 __Pyx_RefNannySetupContext("__set__", 1); | |
13225 __Pyx_TraceCall("__set__", __pyx_f[4], 57, 0, __PYX_ERR(4, 57, __pyx_L1_error)); | |
13226 if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_value))) __PYX_ERR(4, 57, __pyx_L1_error) | |
13227 __pyx_t_1 = __pyx_v_value; | |
13228 __Pyx_INCREF(__pyx_t_1); | |
13229 __Pyx_GIVEREF(__pyx_t_1); | |
13230 __Pyx_GOTREF(__pyx_v_self->quality); | |
13231 __Pyx_DECREF(__pyx_v_self->quality); | |
13232 __pyx_v_self->quality = ((PyObject*)__pyx_t_1); | |
13233 __pyx_t_1 = 0; | |
13234 | |
13235 /* function exit code */ | |
13236 __pyx_r = 0; | |
13237 goto __pyx_L0; | |
13238 __pyx_L1_error:; | |
13239 __Pyx_XDECREF(__pyx_t_1); | |
13240 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.quality.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13241 __pyx_r = -1; | |
13242 __pyx_L0:; | |
13243 __Pyx_TraceReturn(Py_None, 0); | |
13244 __Pyx_RefNannyFinishContext(); | |
13245 return __pyx_r; | |
13246 } | |
13247 | |
13248 /* Python wrapper */ | |
13249 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_7quality_5__del__(PyObject *__pyx_v_self); /*proto*/ | |
13250 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_7quality_5__del__(PyObject *__pyx_v_self) { | |
13251 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13252 int __pyx_r; | |
13253 __Pyx_RefNannyDeclarations | |
13254 __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); | |
13255 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
13256 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_7quality_4__del__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self)); | |
13257 | |
13258 /* function exit code */ | |
13259 __Pyx_RefNannyFinishContext(); | |
13260 return __pyx_r; | |
13261 } | |
13262 | |
13263 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord_7quality_4__del__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self) { | |
13264 int __pyx_r; | |
13265 __Pyx_TraceDeclarations | |
13266 __Pyx_RefNannyDeclarations | |
13267 int __pyx_lineno = 0; | |
13268 const char *__pyx_filename = NULL; | |
13269 int __pyx_clineno = 0; | |
13270 __Pyx_RefNannySetupContext("__del__", 1); | |
13271 __Pyx_TraceCall("__del__", __pyx_f[4], 57, 0, __PYX_ERR(4, 57, __pyx_L1_error)); | |
13272 __Pyx_INCREF(Py_None); | |
13273 __Pyx_GIVEREF(Py_None); | |
13274 __Pyx_GOTREF(__pyx_v_self->quality); | |
13275 __Pyx_DECREF(__pyx_v_self->quality); | |
13276 __pyx_v_self->quality = ((PyObject*)Py_None); | |
13277 | |
13278 /* function exit code */ | |
13279 __pyx_r = 0; | |
13280 goto __pyx_L0; | |
13281 __pyx_L1_error:; | |
13282 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.quality.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13283 __pyx_r = -1; | |
13284 __pyx_L0:; | |
13285 __Pyx_TraceReturn(Py_None, 0); | |
13286 __Pyx_RefNannyFinishContext(); | |
13287 return __pyx_r; | |
13288 } | |
13289 | |
13290 /* Python wrapper */ | |
13291 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_8sequence_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
13292 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_8sequence_1__get__(PyObject *__pyx_v_self) { | |
13293 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13294 PyObject *__pyx_r = 0; | |
13295 __Pyx_RefNannyDeclarations | |
13296 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
13297 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
13298 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_8sequence___get__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self)); | |
13299 | |
13300 /* function exit code */ | |
13301 __Pyx_RefNannyFinishContext(); | |
13302 return __pyx_r; | |
13303 } | |
13304 | |
13305 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_8sequence___get__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self) { | |
13306 PyObject *__pyx_r = NULL; | |
13307 __Pyx_TraceDeclarations | |
13308 __Pyx_RefNannyDeclarations | |
13309 int __pyx_lineno = 0; | |
13310 const char *__pyx_filename = NULL; | |
13311 int __pyx_clineno = 0; | |
13312 __Pyx_RefNannySetupContext("__get__", 1); | |
13313 __Pyx_TraceCall("__get__", __pyx_f[4], 57, 0, __PYX_ERR(4, 57, __pyx_L1_error)); | |
13314 __Pyx_XDECREF(__pyx_r); | |
13315 __Pyx_INCREF(__pyx_v_self->sequence); | |
13316 __pyx_r = __pyx_v_self->sequence; | |
13317 goto __pyx_L0; | |
13318 | |
13319 /* function exit code */ | |
13320 __pyx_L1_error:; | |
13321 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.sequence.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13322 __pyx_r = NULL; | |
13323 __pyx_L0:; | |
13324 __Pyx_XGIVEREF(__pyx_r); | |
13325 __Pyx_TraceReturn(__pyx_r, 0); | |
13326 __Pyx_RefNannyFinishContext(); | |
13327 return __pyx_r; | |
13328 } | |
13329 | |
13330 /* Python wrapper */ | |
13331 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_8sequence_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ | |
13332 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_8sequence_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { | |
13333 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13334 int __pyx_r; | |
13335 __Pyx_RefNannyDeclarations | |
13336 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); | |
13337 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
13338 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_8sequence_2__set__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self), ((PyObject *)__pyx_v_value)); | |
13339 | |
13340 /* function exit code */ | |
13341 __Pyx_RefNannyFinishContext(); | |
13342 return __pyx_r; | |
13343 } | |
13344 | |
13345 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord_8sequence_2__set__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v_value) { | |
13346 int __pyx_r; | |
13347 __Pyx_TraceDeclarations | |
13348 __Pyx_RefNannyDeclarations | |
13349 PyObject *__pyx_t_1 = NULL; | |
13350 int __pyx_lineno = 0; | |
13351 const char *__pyx_filename = NULL; | |
13352 int __pyx_clineno = 0; | |
13353 __Pyx_RefNannySetupContext("__set__", 1); | |
13354 __Pyx_TraceCall("__set__", __pyx_f[4], 57, 0, __PYX_ERR(4, 57, __pyx_L1_error)); | |
13355 if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_value))) __PYX_ERR(4, 57, __pyx_L1_error) | |
13356 __pyx_t_1 = __pyx_v_value; | |
13357 __Pyx_INCREF(__pyx_t_1); | |
13358 __Pyx_GIVEREF(__pyx_t_1); | |
13359 __Pyx_GOTREF(__pyx_v_self->sequence); | |
13360 __Pyx_DECREF(__pyx_v_self->sequence); | |
13361 __pyx_v_self->sequence = ((PyObject*)__pyx_t_1); | |
13362 __pyx_t_1 = 0; | |
13363 | |
13364 /* function exit code */ | |
13365 __pyx_r = 0; | |
13366 goto __pyx_L0; | |
13367 __pyx_L1_error:; | |
13368 __Pyx_XDECREF(__pyx_t_1); | |
13369 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.sequence.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13370 __pyx_r = -1; | |
13371 __pyx_L0:; | |
13372 __Pyx_TraceReturn(Py_None, 0); | |
13373 __Pyx_RefNannyFinishContext(); | |
13374 return __pyx_r; | |
13375 } | |
13376 | |
13377 /* Python wrapper */ | |
13378 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_8sequence_5__del__(PyObject *__pyx_v_self); /*proto*/ | |
13379 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_8sequence_5__del__(PyObject *__pyx_v_self) { | |
13380 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13381 int __pyx_r; | |
13382 __Pyx_RefNannyDeclarations | |
13383 __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); | |
13384 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
13385 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_8sequence_4__del__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self)); | |
13386 | |
13387 /* function exit code */ | |
13388 __Pyx_RefNannyFinishContext(); | |
13389 return __pyx_r; | |
13390 } | |
13391 | |
13392 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord_8sequence_4__del__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self) { | |
13393 int __pyx_r; | |
13394 __Pyx_TraceDeclarations | |
13395 __Pyx_RefNannyDeclarations | |
13396 int __pyx_lineno = 0; | |
13397 const char *__pyx_filename = NULL; | |
13398 int __pyx_clineno = 0; | |
13399 __Pyx_RefNannySetupContext("__del__", 1); | |
13400 __Pyx_TraceCall("__del__", __pyx_f[4], 57, 0, __PYX_ERR(4, 57, __pyx_L1_error)); | |
13401 __Pyx_INCREF(Py_None); | |
13402 __Pyx_GIVEREF(Py_None); | |
13403 __Pyx_GOTREF(__pyx_v_self->sequence); | |
13404 __Pyx_DECREF(__pyx_v_self->sequence); | |
13405 __pyx_v_self->sequence = ((PyObject*)Py_None); | |
13406 | |
13407 /* function exit code */ | |
13408 __pyx_r = 0; | |
13409 goto __pyx_L0; | |
13410 __pyx_L1_error:; | |
13411 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.sequence.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13412 __pyx_r = -1; | |
13413 __pyx_L0:; | |
13414 __Pyx_TraceReturn(Py_None, 0); | |
13415 __Pyx_RefNannyFinishContext(); | |
13416 return __pyx_r; | |
13417 } | |
13418 | |
13419 /* Python wrapper */ | |
13420 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
13421 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_4name_1__get__(PyObject *__pyx_v_self) { | |
13422 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13423 PyObject *__pyx_r = 0; | |
13424 __Pyx_RefNannyDeclarations | |
13425 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
13426 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
13427 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_4name___get__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self)); | |
13428 | |
13429 /* function exit code */ | |
13430 __Pyx_RefNannyFinishContext(); | |
13431 return __pyx_r; | |
13432 } | |
13433 | |
13434 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_4name___get__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self) { | |
13435 PyObject *__pyx_r = NULL; | |
13436 __Pyx_TraceDeclarations | |
13437 __Pyx_RefNannyDeclarations | |
13438 int __pyx_lineno = 0; | |
13439 const char *__pyx_filename = NULL; | |
13440 int __pyx_clineno = 0; | |
13441 __Pyx_RefNannySetupContext("__get__", 1); | |
13442 __Pyx_TraceCall("__get__", __pyx_f[4], 57, 0, __PYX_ERR(4, 57, __pyx_L1_error)); | |
13443 __Pyx_XDECREF(__pyx_r); | |
13444 __Pyx_INCREF(__pyx_v_self->name); | |
13445 __pyx_r = __pyx_v_self->name; | |
13446 goto __pyx_L0; | |
13447 | |
13448 /* function exit code */ | |
13449 __pyx_L1_error:; | |
13450 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13451 __pyx_r = NULL; | |
13452 __pyx_L0:; | |
13453 __Pyx_XGIVEREF(__pyx_r); | |
13454 __Pyx_TraceReturn(__pyx_r, 0); | |
13455 __Pyx_RefNannyFinishContext(); | |
13456 return __pyx_r; | |
13457 } | |
13458 | |
13459 /* Python wrapper */ | |
13460 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ | |
13461 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { | |
13462 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13463 int __pyx_r; | |
13464 __Pyx_RefNannyDeclarations | |
13465 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); | |
13466 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
13467 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_4name_2__set__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self), ((PyObject *)__pyx_v_value)); | |
13468 | |
13469 /* function exit code */ | |
13470 __Pyx_RefNannyFinishContext(); | |
13471 return __pyx_r; | |
13472 } | |
13473 | |
13474 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord_4name_2__set__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v_value) { | |
13475 int __pyx_r; | |
13476 __Pyx_TraceDeclarations | |
13477 __Pyx_RefNannyDeclarations | |
13478 PyObject *__pyx_t_1 = NULL; | |
13479 int __pyx_lineno = 0; | |
13480 const char *__pyx_filename = NULL; | |
13481 int __pyx_clineno = 0; | |
13482 __Pyx_RefNannySetupContext("__set__", 1); | |
13483 __Pyx_TraceCall("__set__", __pyx_f[4], 57, 0, __PYX_ERR(4, 57, __pyx_L1_error)); | |
13484 if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_value))) __PYX_ERR(4, 57, __pyx_L1_error) | |
13485 __pyx_t_1 = __pyx_v_value; | |
13486 __Pyx_INCREF(__pyx_t_1); | |
13487 __Pyx_GIVEREF(__pyx_t_1); | |
13488 __Pyx_GOTREF(__pyx_v_self->name); | |
13489 __Pyx_DECREF(__pyx_v_self->name); | |
13490 __pyx_v_self->name = ((PyObject*)__pyx_t_1); | |
13491 __pyx_t_1 = 0; | |
13492 | |
13493 /* function exit code */ | |
13494 __pyx_r = 0; | |
13495 goto __pyx_L0; | |
13496 __pyx_L1_error:; | |
13497 __Pyx_XDECREF(__pyx_t_1); | |
13498 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13499 __pyx_r = -1; | |
13500 __pyx_L0:; | |
13501 __Pyx_TraceReturn(Py_None, 0); | |
13502 __Pyx_RefNannyFinishContext(); | |
13503 return __pyx_r; | |
13504 } | |
13505 | |
13506 /* Python wrapper */ | |
13507 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_4name_5__del__(PyObject *__pyx_v_self); /*proto*/ | |
13508 static int __pyx_pw_5pysam_9libcfaidx_11FastxRecord_4name_5__del__(PyObject *__pyx_v_self) { | |
13509 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13510 int __pyx_r; | |
13511 __Pyx_RefNannyDeclarations | |
13512 __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); | |
13513 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
13514 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_4name_4__del__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self)); | |
13515 | |
13516 /* function exit code */ | |
13517 __Pyx_RefNannyFinishContext(); | |
13518 return __pyx_r; | |
13519 } | |
13520 | |
13521 static int __pyx_pf_5pysam_9libcfaidx_11FastxRecord_4name_4__del__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self) { | |
13522 int __pyx_r; | |
13523 __Pyx_TraceDeclarations | |
13524 __Pyx_RefNannyDeclarations | |
13525 int __pyx_lineno = 0; | |
13526 const char *__pyx_filename = NULL; | |
13527 int __pyx_clineno = 0; | |
13528 __Pyx_RefNannySetupContext("__del__", 1); | |
13529 __Pyx_TraceCall("__del__", __pyx_f[4], 57, 0, __PYX_ERR(4, 57, __pyx_L1_error)); | |
13530 __Pyx_INCREF(Py_None); | |
13531 __Pyx_GIVEREF(Py_None); | |
13532 __Pyx_GOTREF(__pyx_v_self->name); | |
13533 __Pyx_DECREF(__pyx_v_self->name); | |
13534 __pyx_v_self->name = ((PyObject*)Py_None); | |
13535 | |
13536 /* function exit code */ | |
13537 __pyx_r = 0; | |
13538 goto __pyx_L0; | |
13539 __pyx_L1_error:; | |
13540 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.name.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13541 __pyx_r = -1; | |
13542 __pyx_L0:; | |
13543 __Pyx_TraceReturn(Py_None, 0); | |
13544 __Pyx_RefNannyFinishContext(); | |
13545 return __pyx_r; | |
13546 } | |
13547 | |
13548 /* "(tree fragment)":1 | |
13549 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
13550 * cdef tuple state | |
13551 * cdef object _dict | |
13552 */ | |
13553 | |
13554 /* Python wrapper */ | |
13555 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_17__reduce_cython__(PyObject *__pyx_v_self, | |
13556 #if CYTHON_METH_FASTCALL | |
13557 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
13558 #else | |
13559 PyObject *__pyx_args, PyObject *__pyx_kwds | |
13560 #endif | |
13561 ); /*proto*/ | |
13562 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_11FastxRecord_16__reduce_cython__, "FastxRecord.__reduce_cython__(self)"); | |
13563 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_11FastxRecord_17__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_11FastxRecord_16__reduce_cython__}; | |
13564 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_17__reduce_cython__(PyObject *__pyx_v_self, | |
13565 #if CYTHON_METH_FASTCALL | |
13566 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
13567 #else | |
13568 PyObject *__pyx_args, PyObject *__pyx_kwds | |
13569 #endif | |
13570 ) { | |
13571 #if !CYTHON_METH_FASTCALL | |
13572 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
13573 #endif | |
13574 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13575 PyObject *__pyx_r = 0; | |
13576 __Pyx_RefNannyDeclarations | |
13577 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
13578 #if !CYTHON_METH_FASTCALL | |
13579 #if CYTHON_ASSUME_SAFE_MACROS | |
13580 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
13581 #else | |
13582 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
13583 #endif | |
13584 #endif | |
13585 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
13586 if (unlikely(__pyx_nargs > 0)) { | |
13587 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
13588 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
13589 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_16__reduce_cython__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self)); | |
13590 | |
13591 /* function exit code */ | |
13592 __Pyx_RefNannyFinishContext(); | |
13593 return __pyx_r; | |
13594 } | |
13595 | |
13596 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_16__reduce_cython__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self) { | |
13597 PyObject *__pyx_v_state = 0; | |
13598 PyObject *__pyx_v__dict = 0; | |
13599 int __pyx_v_use_setstate; | |
13600 PyObject *__pyx_r = NULL; | |
13601 __Pyx_TraceDeclarations | |
13602 __Pyx_RefNannyDeclarations | |
13603 PyObject *__pyx_t_1 = NULL; | |
13604 int __pyx_t_2; | |
13605 PyObject *__pyx_t_3 = NULL; | |
13606 int __pyx_t_4; | |
13607 PyObject *__pyx_t_5 = NULL; | |
13608 int __pyx_lineno = 0; | |
13609 const char *__pyx_filename = NULL; | |
13610 int __pyx_clineno = 0; | |
13611 __Pyx_TraceFrameInit(__pyx_codeobj__32) | |
13612 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
13613 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
13614 | |
13615 /* "(tree fragment)":5 | |
13616 * cdef object _dict | |
13617 * cdef bint use_setstate | |
13618 * state = (self.comment, self.name, self.quality, self.sequence) # <<<<<<<<<<<<<< | |
13619 * _dict = getattr(self, '__dict__', None) | |
13620 * if _dict is not None: | |
13621 */ | |
13622 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
13623 __Pyx_GOTREF(__pyx_t_1); | |
13624 __Pyx_INCREF(__pyx_v_self->comment); | |
13625 __Pyx_GIVEREF(__pyx_v_self->comment); | |
13626 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->comment)) __PYX_ERR(1, 5, __pyx_L1_error); | |
13627 __Pyx_INCREF(__pyx_v_self->name); | |
13628 __Pyx_GIVEREF(__pyx_v_self->name); | |
13629 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->name)) __PYX_ERR(1, 5, __pyx_L1_error); | |
13630 __Pyx_INCREF(__pyx_v_self->quality); | |
13631 __Pyx_GIVEREF(__pyx_v_self->quality); | |
13632 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_self->quality)) __PYX_ERR(1, 5, __pyx_L1_error); | |
13633 __Pyx_INCREF(__pyx_v_self->sequence); | |
13634 __Pyx_GIVEREF(__pyx_v_self->sequence); | |
13635 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_self->sequence)) __PYX_ERR(1, 5, __pyx_L1_error); | |
13636 __pyx_v_state = ((PyObject*)__pyx_t_1); | |
13637 __pyx_t_1 = 0; | |
13638 | |
13639 /* "(tree fragment)":6 | |
13640 * cdef bint use_setstate | |
13641 * state = (self.comment, self.name, self.quality, self.sequence) | |
13642 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< | |
13643 * if _dict is not None: | |
13644 * state += (_dict,) | |
13645 */ | |
13646 __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) | |
13647 __Pyx_GOTREF(__pyx_t_1); | |
13648 __pyx_v__dict = __pyx_t_1; | |
13649 __pyx_t_1 = 0; | |
13650 | |
13651 /* "(tree fragment)":7 | |
13652 * state = (self.comment, self.name, self.quality, self.sequence) | |
13653 * _dict = getattr(self, '__dict__', None) | |
13654 * if _dict is not None: # <<<<<<<<<<<<<< | |
13655 * state += (_dict,) | |
13656 * use_setstate = True | |
13657 */ | |
13658 __pyx_t_2 = (__pyx_v__dict != Py_None); | |
13659 if (__pyx_t_2) { | |
13660 | |
13661 /* "(tree fragment)":8 | |
13662 * _dict = getattr(self, '__dict__', None) | |
13663 * if _dict is not None: | |
13664 * state += (_dict,) # <<<<<<<<<<<<<< | |
13665 * use_setstate = True | |
13666 * else: | |
13667 */ | |
13668 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) | |
13669 __Pyx_GOTREF(__pyx_t_1); | |
13670 __Pyx_INCREF(__pyx_v__dict); | |
13671 __Pyx_GIVEREF(__pyx_v__dict); | |
13672 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error); | |
13673 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error) | |
13674 __Pyx_GOTREF(__pyx_t_3); | |
13675 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13676 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3)); | |
13677 __pyx_t_3 = 0; | |
13678 | |
13679 /* "(tree fragment)":9 | |
13680 * if _dict is not None: | |
13681 * state += (_dict,) | |
13682 * use_setstate = True # <<<<<<<<<<<<<< | |
13683 * else: | |
13684 * use_setstate = self.comment is not None or self.name is not None or self.quality is not None or self.sequence is not None | |
13685 */ | |
13686 __pyx_v_use_setstate = 1; | |
13687 | |
13688 /* "(tree fragment)":7 | |
13689 * state = (self.comment, self.name, self.quality, self.sequence) | |
13690 * _dict = getattr(self, '__dict__', None) | |
13691 * if _dict is not None: # <<<<<<<<<<<<<< | |
13692 * state += (_dict,) | |
13693 * use_setstate = True | |
13694 */ | |
13695 goto __pyx_L3; | |
13696 } | |
13697 | |
13698 /* "(tree fragment)":11 | |
13699 * use_setstate = True | |
13700 * else: | |
13701 * use_setstate = self.comment is not None or self.name is not None or self.quality is not None or self.sequence is not None # <<<<<<<<<<<<<< | |
13702 * if use_setstate: | |
13703 * return __pyx_unpickle_FastxRecord, (type(self), 0x1bdb611, None), state | |
13704 */ | |
13705 /*else*/ { | |
13706 __pyx_t_4 = (__pyx_v_self->comment != ((PyObject*)Py_None)); | |
13707 if (!__pyx_t_4) { | |
13708 } else { | |
13709 __pyx_t_2 = __pyx_t_4; | |
13710 goto __pyx_L4_bool_binop_done; | |
13711 } | |
13712 __pyx_t_4 = (__pyx_v_self->name != ((PyObject*)Py_None)); | |
13713 if (!__pyx_t_4) { | |
13714 } else { | |
13715 __pyx_t_2 = __pyx_t_4; | |
13716 goto __pyx_L4_bool_binop_done; | |
13717 } | |
13718 __pyx_t_4 = (__pyx_v_self->quality != ((PyObject*)Py_None)); | |
13719 if (!__pyx_t_4) { | |
13720 } else { | |
13721 __pyx_t_2 = __pyx_t_4; | |
13722 goto __pyx_L4_bool_binop_done; | |
13723 } | |
13724 __pyx_t_4 = (__pyx_v_self->sequence != ((PyObject*)Py_None)); | |
13725 __pyx_t_2 = __pyx_t_4; | |
13726 __pyx_L4_bool_binop_done:; | |
13727 __pyx_v_use_setstate = __pyx_t_2; | |
13728 } | |
13729 __pyx_L3:; | |
13730 | |
13731 /* "(tree fragment)":12 | |
13732 * else: | |
13733 * use_setstate = self.comment is not None or self.name is not None or self.quality is not None or self.sequence is not None | |
13734 * if use_setstate: # <<<<<<<<<<<<<< | |
13735 * return __pyx_unpickle_FastxRecord, (type(self), 0x1bdb611, None), state | |
13736 * else: | |
13737 */ | |
13738 if (__pyx_v_use_setstate) { | |
13739 | |
13740 /* "(tree fragment)":13 | |
13741 * use_setstate = self.comment is not None or self.name is not None or self.quality is not None or self.sequence is not None | |
13742 * if use_setstate: | |
13743 * return __pyx_unpickle_FastxRecord, (type(self), 0x1bdb611, None), state # <<<<<<<<<<<<<< | |
13744 * else: | |
13745 * return __pyx_unpickle_FastxRecord, (type(self), 0x1bdb611, state) | |
13746 */ | |
13747 __Pyx_XDECREF(__pyx_r); | |
13748 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_FastxRecord); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) | |
13749 __Pyx_GOTREF(__pyx_t_3); | |
13750 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) | |
13751 __Pyx_GOTREF(__pyx_t_1); | |
13752 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
13753 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
13754 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error); | |
13755 __Pyx_INCREF(__pyx_int_29210129); | |
13756 __Pyx_GIVEREF(__pyx_int_29210129); | |
13757 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_29210129)) __PYX_ERR(1, 13, __pyx_L1_error); | |
13758 __Pyx_INCREF(Py_None); | |
13759 __Pyx_GIVEREF(Py_None); | |
13760 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error); | |
13761 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) | |
13762 __Pyx_GOTREF(__pyx_t_5); | |
13763 __Pyx_GIVEREF(__pyx_t_3); | |
13764 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error); | |
13765 __Pyx_GIVEREF(__pyx_t_1); | |
13766 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error); | |
13767 __Pyx_INCREF(__pyx_v_state); | |
13768 __Pyx_GIVEREF(__pyx_v_state); | |
13769 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error); | |
13770 __pyx_t_3 = 0; | |
13771 __pyx_t_1 = 0; | |
13772 __pyx_r = __pyx_t_5; | |
13773 __pyx_t_5 = 0; | |
13774 goto __pyx_L0; | |
13775 | |
13776 /* "(tree fragment)":12 | |
13777 * else: | |
13778 * use_setstate = self.comment is not None or self.name is not None or self.quality is not None or self.sequence is not None | |
13779 * if use_setstate: # <<<<<<<<<<<<<< | |
13780 * return __pyx_unpickle_FastxRecord, (type(self), 0x1bdb611, None), state | |
13781 * else: | |
13782 */ | |
13783 } | |
13784 | |
13785 /* "(tree fragment)":15 | |
13786 * return __pyx_unpickle_FastxRecord, (type(self), 0x1bdb611, None), state | |
13787 * else: | |
13788 * return __pyx_unpickle_FastxRecord, (type(self), 0x1bdb611, state) # <<<<<<<<<<<<<< | |
13789 * def __setstate_cython__(self, __pyx_state): | |
13790 * __pyx_unpickle_FastxRecord__set_state(self, __pyx_state) | |
13791 */ | |
13792 /*else*/ { | |
13793 __Pyx_XDECREF(__pyx_r); | |
13794 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_FastxRecord); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) | |
13795 __Pyx_GOTREF(__pyx_t_5); | |
13796 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) | |
13797 __Pyx_GOTREF(__pyx_t_1); | |
13798 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
13799 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); | |
13800 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error); | |
13801 __Pyx_INCREF(__pyx_int_29210129); | |
13802 __Pyx_GIVEREF(__pyx_int_29210129); | |
13803 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_29210129)) __PYX_ERR(1, 15, __pyx_L1_error); | |
13804 __Pyx_INCREF(__pyx_v_state); | |
13805 __Pyx_GIVEREF(__pyx_v_state); | |
13806 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error); | |
13807 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) | |
13808 __Pyx_GOTREF(__pyx_t_3); | |
13809 __Pyx_GIVEREF(__pyx_t_5); | |
13810 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error); | |
13811 __Pyx_GIVEREF(__pyx_t_1); | |
13812 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error); | |
13813 __pyx_t_5 = 0; | |
13814 __pyx_t_1 = 0; | |
13815 __pyx_r = __pyx_t_3; | |
13816 __pyx_t_3 = 0; | |
13817 goto __pyx_L0; | |
13818 } | |
13819 | |
13820 /* "(tree fragment)":1 | |
13821 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
13822 * cdef tuple state | |
13823 * cdef object _dict | |
13824 */ | |
13825 | |
13826 /* function exit code */ | |
13827 __pyx_L1_error:; | |
13828 __Pyx_XDECREF(__pyx_t_1); | |
13829 __Pyx_XDECREF(__pyx_t_3); | |
13830 __Pyx_XDECREF(__pyx_t_5); | |
13831 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13832 __pyx_r = NULL; | |
13833 __pyx_L0:; | |
13834 __Pyx_XDECREF(__pyx_v_state); | |
13835 __Pyx_XDECREF(__pyx_v__dict); | |
13836 __Pyx_XGIVEREF(__pyx_r); | |
13837 __Pyx_TraceReturn(__pyx_r, 0); | |
13838 __Pyx_RefNannyFinishContext(); | |
13839 return __pyx_r; | |
13840 } | |
13841 | |
13842 /* "(tree fragment)":16 | |
13843 * else: | |
13844 * return __pyx_unpickle_FastxRecord, (type(self), 0x1bdb611, state) | |
13845 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
13846 * __pyx_unpickle_FastxRecord__set_state(self, __pyx_state) | |
13847 */ | |
13848 | |
13849 /* Python wrapper */ | |
13850 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_19__setstate_cython__(PyObject *__pyx_v_self, | |
13851 #if CYTHON_METH_FASTCALL | |
13852 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
13853 #else | |
13854 PyObject *__pyx_args, PyObject *__pyx_kwds | |
13855 #endif | |
13856 ); /*proto*/ | |
13857 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_11FastxRecord_18__setstate_cython__, "FastxRecord.__setstate_cython__(self, __pyx_state)"); | |
13858 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_11FastxRecord_19__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_11FastxRecord_18__setstate_cython__}; | |
13859 static PyObject *__pyx_pw_5pysam_9libcfaidx_11FastxRecord_19__setstate_cython__(PyObject *__pyx_v_self, | |
13860 #if CYTHON_METH_FASTCALL | |
13861 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
13862 #else | |
13863 PyObject *__pyx_args, PyObject *__pyx_kwds | |
13864 #endif | |
13865 ) { | |
13866 PyObject *__pyx_v___pyx_state = 0; | |
13867 #if !CYTHON_METH_FASTCALL | |
13868 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
13869 #endif | |
13870 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
13871 PyObject* values[1] = {0}; | |
13872 int __pyx_lineno = 0; | |
13873 const char *__pyx_filename = NULL; | |
13874 int __pyx_clineno = 0; | |
13875 PyObject *__pyx_r = 0; | |
13876 __Pyx_RefNannyDeclarations | |
13877 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
13878 #if !CYTHON_METH_FASTCALL | |
13879 #if CYTHON_ASSUME_SAFE_MACROS | |
13880 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
13881 #else | |
13882 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
13883 #endif | |
13884 #endif | |
13885 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
13886 { | |
13887 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
13888 if (__pyx_kwds) { | |
13889 Py_ssize_t kw_args; | |
13890 switch (__pyx_nargs) { | |
13891 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
13892 CYTHON_FALLTHROUGH; | |
13893 case 0: break; | |
13894 default: goto __pyx_L5_argtuple_error; | |
13895 } | |
13896 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
13897 switch (__pyx_nargs) { | |
13898 case 0: | |
13899 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
13900 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
13901 kw_args--; | |
13902 } | |
13903 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error) | |
13904 else goto __pyx_L5_argtuple_error; | |
13905 } | |
13906 if (unlikely(kw_args > 0)) { | |
13907 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
13908 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) | |
13909 } | |
13910 } else if (unlikely(__pyx_nargs != 1)) { | |
13911 goto __pyx_L5_argtuple_error; | |
13912 } else { | |
13913 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
13914 } | |
13915 __pyx_v___pyx_state = values[0]; | |
13916 } | |
13917 goto __pyx_L6_skip; | |
13918 __pyx_L5_argtuple_error:; | |
13919 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error) | |
13920 __pyx_L6_skip:; | |
13921 goto __pyx_L4_argument_unpacking_done; | |
13922 __pyx_L3_error:; | |
13923 { | |
13924 Py_ssize_t __pyx_temp; | |
13925 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
13926 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
13927 } | |
13928 } | |
13929 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13930 __Pyx_RefNannyFinishContext(); | |
13931 return NULL; | |
13932 __pyx_L4_argument_unpacking_done:; | |
13933 __pyx_r = __pyx_pf_5pysam_9libcfaidx_11FastxRecord_18__setstate_cython__(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v_self), __pyx_v___pyx_state); | |
13934 | |
13935 /* function exit code */ | |
13936 { | |
13937 Py_ssize_t __pyx_temp; | |
13938 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
13939 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
13940 } | |
13941 } | |
13942 __Pyx_RefNannyFinishContext(); | |
13943 return __pyx_r; | |
13944 } | |
13945 | |
13946 static PyObject *__pyx_pf_5pysam_9libcfaidx_11FastxRecord_18__setstate_cython__(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v_self, PyObject *__pyx_v___pyx_state) { | |
13947 PyObject *__pyx_r = NULL; | |
13948 __Pyx_TraceDeclarations | |
13949 __Pyx_RefNannyDeclarations | |
13950 PyObject *__pyx_t_1 = NULL; | |
13951 int __pyx_lineno = 0; | |
13952 const char *__pyx_filename = NULL; | |
13953 int __pyx_clineno = 0; | |
13954 __Pyx_TraceFrameInit(__pyx_codeobj__33) | |
13955 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
13956 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error)); | |
13957 | |
13958 /* "(tree fragment)":17 | |
13959 * return __pyx_unpickle_FastxRecord, (type(self), 0x1bdb611, state) | |
13960 * def __setstate_cython__(self, __pyx_state): | |
13961 * __pyx_unpickle_FastxRecord__set_state(self, __pyx_state) # <<<<<<<<<<<<<< | |
13962 */ | |
13963 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) | |
13964 __pyx_t_1 = __pyx_f_5pysam_9libcfaidx___pyx_unpickle_FastxRecord__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) | |
13965 __Pyx_GOTREF(__pyx_t_1); | |
13966 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
13967 | |
13968 /* "(tree fragment)":16 | |
13969 * else: | |
13970 * return __pyx_unpickle_FastxRecord, (type(self), 0x1bdb611, state) | |
13971 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
13972 * __pyx_unpickle_FastxRecord__set_state(self, __pyx_state) | |
13973 */ | |
13974 | |
13975 /* function exit code */ | |
13976 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
13977 goto __pyx_L0; | |
13978 __pyx_L1_error:; | |
13979 __Pyx_XDECREF(__pyx_t_1); | |
13980 __Pyx_AddTraceback("pysam.libcfaidx.FastxRecord.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
13981 __pyx_r = NULL; | |
13982 __pyx_L0:; | |
13983 __Pyx_XGIVEREF(__pyx_r); | |
13984 __Pyx_TraceReturn(__pyx_r, 0); | |
13985 __Pyx_RefNannyFinishContext(); | |
13986 return __pyx_r; | |
13987 } | |
13988 | |
13989 /* "pysam/libcfaidx.pyx":545 | |
13990 * | |
13991 * """ | |
13992 * def __cinit__(self, *args, **kwargs): # <<<<<<<<<<<<<< | |
13993 * # self.fastqfile = <gzFile*>NULL | |
13994 * self._filename = None | |
13995 */ | |
13996 | |
13997 /* Python wrapper */ | |
13998 static int __pyx_pw_5pysam_9libcfaidx_9FastxFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
13999 static int __pyx_pw_5pysam_9libcfaidx_9FastxFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
14000 PyObject *__pyx_v_args = 0; | |
14001 PyObject *__pyx_v_kwargs = 0; | |
14002 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
14003 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
14004 int __pyx_r; | |
14005 __Pyx_RefNannyDeclarations | |
14006 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); | |
14007 #if CYTHON_ASSUME_SAFE_MACROS | |
14008 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
14009 #else | |
14010 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; | |
14011 #endif | |
14012 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
14013 if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1; | |
14014 if (unlikely(__pyx_kwds)) { | |
14015 __pyx_v_kwargs = __Pyx_KwargsAsDict_VARARGS(__pyx_kwds, __pyx_kwvalues); | |
14016 if (unlikely(!__pyx_v_kwargs)) return -1; | |
14017 __Pyx_GOTREF(__pyx_v_kwargs); | |
14018 } else { | |
14019 __pyx_v_kwargs = PyDict_New(); | |
14020 if (unlikely(!__pyx_v_kwargs)) return -1; | |
14021 __Pyx_GOTREF(__pyx_v_kwargs); | |
14022 } | |
14023 __Pyx_INCREF(__pyx_args); | |
14024 __pyx_v_args = __pyx_args; | |
14025 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastxFile___cinit__(((struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); | |
14026 | |
14027 /* function exit code */ | |
14028 __Pyx_DECREF(__pyx_v_args); | |
14029 __Pyx_DECREF(__pyx_v_kwargs); | |
14030 __Pyx_RefNannyFinishContext(); | |
14031 return __pyx_r; | |
14032 } | |
14033 | |
14034 static int __pyx_pf_5pysam_9libcfaidx_9FastxFile___cinit__(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { | |
14035 int __pyx_r; | |
14036 __Pyx_TraceDeclarations | |
14037 __Pyx_RefNannyDeclarations | |
14038 PyObject *__pyx_t_1 = NULL; | |
14039 PyObject *__pyx_t_2 = NULL; | |
14040 PyObject *__pyx_t_3 = NULL; | |
14041 int __pyx_lineno = 0; | |
14042 const char *__pyx_filename = NULL; | |
14043 int __pyx_clineno = 0; | |
14044 __Pyx_RefNannySetupContext("__cinit__", 1); | |
14045 __Pyx_TraceCall("__cinit__", __pyx_f[0], 545, 0, __PYX_ERR(0, 545, __pyx_L1_error)); | |
14046 | |
14047 /* "pysam/libcfaidx.pyx":547 | |
14048 * def __cinit__(self, *args, **kwargs): | |
14049 * # self.fastqfile = <gzFile*>NULL | |
14050 * self._filename = None # <<<<<<<<<<<<<< | |
14051 * self.entry = NULL | |
14052 * self._open(*args, **kwargs) | |
14053 */ | |
14054 __Pyx_INCREF(Py_None); | |
14055 __Pyx_GIVEREF(Py_None); | |
14056 __Pyx_GOTREF(__pyx_v_self->_filename); | |
14057 __Pyx_DECREF(__pyx_v_self->_filename); | |
14058 __pyx_v_self->_filename = Py_None; | |
14059 | |
14060 /* "pysam/libcfaidx.pyx":548 | |
14061 * # self.fastqfile = <gzFile*>NULL | |
14062 * self._filename = None | |
14063 * self.entry = NULL # <<<<<<<<<<<<<< | |
14064 * self._open(*args, **kwargs) | |
14065 * | |
14066 */ | |
14067 __pyx_v_self->entry = NULL; | |
14068 | |
14069 /* "pysam/libcfaidx.pyx":549 | |
14070 * self._filename = None | |
14071 * self.entry = NULL | |
14072 * self._open(*args, **kwargs) # <<<<<<<<<<<<<< | |
14073 * | |
14074 * def is_open(self): | |
14075 */ | |
14076 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) | |
14077 __Pyx_GOTREF(__pyx_t_1); | |
14078 __pyx_t_2 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 549, __pyx_L1_error) | |
14079 __Pyx_GOTREF(__pyx_t_2); | |
14080 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error) | |
14081 __Pyx_GOTREF(__pyx_t_3); | |
14082 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
14083 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
14084 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14085 | |
14086 /* "pysam/libcfaidx.pyx":545 | |
14087 * | |
14088 * """ | |
14089 * def __cinit__(self, *args, **kwargs): # <<<<<<<<<<<<<< | |
14090 * # self.fastqfile = <gzFile*>NULL | |
14091 * self._filename = None | |
14092 */ | |
14093 | |
14094 /* function exit code */ | |
14095 __pyx_r = 0; | |
14096 goto __pyx_L0; | |
14097 __pyx_L1_error:; | |
14098 __Pyx_XDECREF(__pyx_t_1); | |
14099 __Pyx_XDECREF(__pyx_t_2); | |
14100 __Pyx_XDECREF(__pyx_t_3); | |
14101 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14102 __pyx_r = -1; | |
14103 __pyx_L0:; | |
14104 __Pyx_TraceReturn(Py_None, 0); | |
14105 __Pyx_RefNannyFinishContext(); | |
14106 return __pyx_r; | |
14107 } | |
14108 | |
14109 /* "pysam/libcfaidx.pyx":551 | |
14110 * self._open(*args, **kwargs) | |
14111 * | |
14112 * def is_open(self): # <<<<<<<<<<<<<< | |
14113 * '''return true if samfile has been opened.''' | |
14114 * return self.entry != NULL | |
14115 */ | |
14116 | |
14117 /* Python wrapper */ | |
14118 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_3is_open(PyObject *__pyx_v_self, | |
14119 #if CYTHON_METH_FASTCALL | |
14120 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14121 #else | |
14122 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14123 #endif | |
14124 ); /*proto*/ | |
14125 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastxFile_2is_open, "FastxFile.is_open(self)\nreturn true if samfile has been opened."); | |
14126 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastxFile_3is_open = {"is_open", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastxFile_3is_open, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastxFile_2is_open}; | |
14127 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_3is_open(PyObject *__pyx_v_self, | |
14128 #if CYTHON_METH_FASTCALL | |
14129 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14130 #else | |
14131 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14132 #endif | |
14133 ) { | |
14134 #if !CYTHON_METH_FASTCALL | |
14135 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
14136 #endif | |
14137 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
14138 PyObject *__pyx_r = 0; | |
14139 __Pyx_RefNannyDeclarations | |
14140 __Pyx_RefNannySetupContext("is_open (wrapper)", 0); | |
14141 #if !CYTHON_METH_FASTCALL | |
14142 #if CYTHON_ASSUME_SAFE_MACROS | |
14143 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
14144 #else | |
14145 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
14146 #endif | |
14147 #endif | |
14148 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
14149 if (unlikely(__pyx_nargs > 0)) { | |
14150 __Pyx_RaiseArgtupleInvalid("is_open", 1, 0, 0, __pyx_nargs); return NULL;} | |
14151 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_open", 0))) return NULL; | |
14152 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastxFile_2is_open(((struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)__pyx_v_self)); | |
14153 | |
14154 /* function exit code */ | |
14155 __Pyx_RefNannyFinishContext(); | |
14156 return __pyx_r; | |
14157 } | |
14158 | |
14159 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_2is_open(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self) { | |
14160 PyObject *__pyx_r = NULL; | |
14161 __Pyx_TraceDeclarations | |
14162 __Pyx_RefNannyDeclarations | |
14163 PyObject *__pyx_t_1 = NULL; | |
14164 int __pyx_lineno = 0; | |
14165 const char *__pyx_filename = NULL; | |
14166 int __pyx_clineno = 0; | |
14167 __Pyx_TraceFrameInit(__pyx_codeobj__34) | |
14168 __Pyx_RefNannySetupContext("is_open", 1); | |
14169 __Pyx_TraceCall("is_open", __pyx_f[0], 551, 0, __PYX_ERR(0, 551, __pyx_L1_error)); | |
14170 | |
14171 /* "pysam/libcfaidx.pyx":553 | |
14172 * def is_open(self): | |
14173 * '''return true if samfile has been opened.''' | |
14174 * return self.entry != NULL # <<<<<<<<<<<<<< | |
14175 * | |
14176 * def _open(self, filename, persist=True): | |
14177 */ | |
14178 __Pyx_XDECREF(__pyx_r); | |
14179 __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->entry != NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) | |
14180 __Pyx_GOTREF(__pyx_t_1); | |
14181 __pyx_r = __pyx_t_1; | |
14182 __pyx_t_1 = 0; | |
14183 goto __pyx_L0; | |
14184 | |
14185 /* "pysam/libcfaidx.pyx":551 | |
14186 * self._open(*args, **kwargs) | |
14187 * | |
14188 * def is_open(self): # <<<<<<<<<<<<<< | |
14189 * '''return true if samfile has been opened.''' | |
14190 * return self.entry != NULL | |
14191 */ | |
14192 | |
14193 /* function exit code */ | |
14194 __pyx_L1_error:; | |
14195 __Pyx_XDECREF(__pyx_t_1); | |
14196 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile.is_open", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14197 __pyx_r = NULL; | |
14198 __pyx_L0:; | |
14199 __Pyx_XGIVEREF(__pyx_r); | |
14200 __Pyx_TraceReturn(__pyx_r, 0); | |
14201 __Pyx_RefNannyFinishContext(); | |
14202 return __pyx_r; | |
14203 } | |
14204 | |
14205 /* "pysam/libcfaidx.pyx":555 | |
14206 * return self.entry != NULL | |
14207 * | |
14208 * def _open(self, filename, persist=True): # <<<<<<<<<<<<<< | |
14209 * '''open a fastq/fasta file in *filename* | |
14210 * | |
14211 */ | |
14212 | |
14213 /* Python wrapper */ | |
14214 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_5_open(PyObject *__pyx_v_self, | |
14215 #if CYTHON_METH_FASTCALL | |
14216 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14217 #else | |
14218 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14219 #endif | |
14220 ); /*proto*/ | |
14221 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastxFile_4_open, "FastxFile._open(self, filename, persist=True)\nopen a fastq/fasta file in *filename*\n\n Paramentes\n ----------\n\n persist : bool\n\n if True return a copy of the underlying data (default\n True). The copy will persist even if the iteration\n on the file continues.\n\n "); | |
14222 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastxFile_5_open = {"_open", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastxFile_5_open, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastxFile_4_open}; | |
14223 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_5_open(PyObject *__pyx_v_self, | |
14224 #if CYTHON_METH_FASTCALL | |
14225 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14226 #else | |
14227 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14228 #endif | |
14229 ) { | |
14230 PyObject *__pyx_v_filename = 0; | |
14231 PyObject *__pyx_v_persist = 0; | |
14232 #if !CYTHON_METH_FASTCALL | |
14233 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
14234 #endif | |
14235 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
14236 PyObject* values[2] = {0,0}; | |
14237 int __pyx_lineno = 0; | |
14238 const char *__pyx_filename = NULL; | |
14239 int __pyx_clineno = 0; | |
14240 PyObject *__pyx_r = 0; | |
14241 __Pyx_RefNannyDeclarations | |
14242 __Pyx_RefNannySetupContext("_open (wrapper)", 0); | |
14243 #if !CYTHON_METH_FASTCALL | |
14244 #if CYTHON_ASSUME_SAFE_MACROS | |
14245 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
14246 #else | |
14247 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
14248 #endif | |
14249 #endif | |
14250 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
14251 { | |
14252 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_persist,0}; | |
14253 values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True)); | |
14254 if (__pyx_kwds) { | |
14255 Py_ssize_t kw_args; | |
14256 switch (__pyx_nargs) { | |
14257 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
14258 CYTHON_FALLTHROUGH; | |
14259 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
14260 CYTHON_FALLTHROUGH; | |
14261 case 0: break; | |
14262 default: goto __pyx_L5_argtuple_error; | |
14263 } | |
14264 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
14265 switch (__pyx_nargs) { | |
14266 case 0: | |
14267 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_filename)) != 0)) { | |
14268 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
14269 kw_args--; | |
14270 } | |
14271 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 555, __pyx_L3_error) | |
14272 else goto __pyx_L5_argtuple_error; | |
14273 CYTHON_FALLTHROUGH; | |
14274 case 1: | |
14275 if (kw_args > 0) { | |
14276 PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_persist); | |
14277 if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } | |
14278 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 555, __pyx_L3_error) | |
14279 } | |
14280 } | |
14281 if (unlikely(kw_args > 0)) { | |
14282 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
14283 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_open") < 0)) __PYX_ERR(0, 555, __pyx_L3_error) | |
14284 } | |
14285 } else { | |
14286 switch (__pyx_nargs) { | |
14287 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
14288 CYTHON_FALLTHROUGH; | |
14289 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
14290 break; | |
14291 default: goto __pyx_L5_argtuple_error; | |
14292 } | |
14293 } | |
14294 __pyx_v_filename = values[0]; | |
14295 __pyx_v_persist = values[1]; | |
14296 } | |
14297 goto __pyx_L6_skip; | |
14298 __pyx_L5_argtuple_error:; | |
14299 __Pyx_RaiseArgtupleInvalid("_open", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 555, __pyx_L3_error) | |
14300 __pyx_L6_skip:; | |
14301 goto __pyx_L4_argument_unpacking_done; | |
14302 __pyx_L3_error:; | |
14303 { | |
14304 Py_ssize_t __pyx_temp; | |
14305 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
14306 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
14307 } | |
14308 } | |
14309 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14310 __Pyx_RefNannyFinishContext(); | |
14311 return NULL; | |
14312 __pyx_L4_argument_unpacking_done:; | |
14313 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastxFile_4_open(((struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)__pyx_v_self), __pyx_v_filename, __pyx_v_persist); | |
14314 | |
14315 /* function exit code */ | |
14316 { | |
14317 Py_ssize_t __pyx_temp; | |
14318 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
14319 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
14320 } | |
14321 } | |
14322 __Pyx_RefNannyFinishContext(); | |
14323 return __pyx_r; | |
14324 } | |
14325 | |
14326 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_4_open(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_persist) { | |
14327 char *__pyx_v_cfilename; | |
14328 PyObject *__pyx_r = NULL; | |
14329 __Pyx_TraceDeclarations | |
14330 __Pyx_RefNannyDeclarations | |
14331 int __pyx_t_1; | |
14332 PyObject *__pyx_t_2 = NULL; | |
14333 PyObject *__pyx_t_3 = NULL; | |
14334 PyObject *__pyx_t_4 = NULL; | |
14335 unsigned int __pyx_t_5; | |
14336 char *__pyx_t_6; | |
14337 int __pyx_t_7; | |
14338 int __pyx_t_8; | |
14339 int __pyx_lineno = 0; | |
14340 const char *__pyx_filename = NULL; | |
14341 int __pyx_clineno = 0; | |
14342 __Pyx_TraceFrameInit(__pyx_codeobj__35) | |
14343 __Pyx_RefNannySetupContext("_open", 1); | |
14344 __Pyx_TraceCall("_open", __pyx_f[0], 555, 0, __PYX_ERR(0, 555, __pyx_L1_error)); | |
14345 | |
14346 /* "pysam/libcfaidx.pyx":568 | |
14347 * | |
14348 * ''' | |
14349 * if self.fastqfile != NULL: # <<<<<<<<<<<<<< | |
14350 * self.close() | |
14351 * | |
14352 */ | |
14353 __pyx_t_1 = (__pyx_v_self->fastqfile != NULL); | |
14354 if (__pyx_t_1) { | |
14355 | |
14356 /* "pysam/libcfaidx.pyx":569 | |
14357 * ''' | |
14358 * if self.fastqfile != NULL: | |
14359 * self.close() # <<<<<<<<<<<<<< | |
14360 * | |
14361 * self._filename = encode_filename(filename) | |
14362 */ | |
14363 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error) | |
14364 __Pyx_GOTREF(__pyx_t_3); | |
14365 __pyx_t_4 = NULL; | |
14366 __pyx_t_5 = 0; | |
14367 #if CYTHON_UNPACK_METHODS | |
14368 if (likely(PyMethod_Check(__pyx_t_3))) { | |
14369 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
14370 if (likely(__pyx_t_4)) { | |
14371 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
14372 __Pyx_INCREF(__pyx_t_4); | |
14373 __Pyx_INCREF(function); | |
14374 __Pyx_DECREF_SET(__pyx_t_3, function); | |
14375 __pyx_t_5 = 1; | |
14376 } | |
14377 } | |
14378 #endif | |
14379 { | |
14380 PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; | |
14381 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); | |
14382 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14383 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error) | |
14384 __Pyx_GOTREF(__pyx_t_2); | |
14385 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14386 } | |
14387 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
14388 | |
14389 /* "pysam/libcfaidx.pyx":568 | |
14390 * | |
14391 * ''' | |
14392 * if self.fastqfile != NULL: # <<<<<<<<<<<<<< | |
14393 * self.close() | |
14394 * | |
14395 */ | |
14396 } | |
14397 | |
14398 /* "pysam/libcfaidx.pyx":571 | |
14399 * self.close() | |
14400 * | |
14401 * self._filename = encode_filename(filename) # <<<<<<<<<<<<<< | |
14402 * cdef char *cfilename = self._filename | |
14403 * self.is_remote = hisremote(cfilename) | |
14404 */ | |
14405 __pyx_t_2 = __pyx_f_5pysam_9libcutils_encode_filename(__pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error) | |
14406 __Pyx_GOTREF(__pyx_t_2); | |
14407 __Pyx_GIVEREF(__pyx_t_2); | |
14408 __Pyx_GOTREF(__pyx_v_self->_filename); | |
14409 __Pyx_DECREF(__pyx_v_self->_filename); | |
14410 __pyx_v_self->_filename = __pyx_t_2; | |
14411 __pyx_t_2 = 0; | |
14412 | |
14413 /* "pysam/libcfaidx.pyx":572 | |
14414 * | |
14415 * self._filename = encode_filename(filename) | |
14416 * cdef char *cfilename = self._filename # <<<<<<<<<<<<<< | |
14417 * self.is_remote = hisremote(cfilename) | |
14418 * | |
14419 */ | |
14420 __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_self->_filename); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 572, __pyx_L1_error) | |
14421 __pyx_v_cfilename = __pyx_t_6; | |
14422 | |
14423 /* "pysam/libcfaidx.pyx":573 | |
14424 * self._filename = encode_filename(filename) | |
14425 * cdef char *cfilename = self._filename | |
14426 * self.is_remote = hisremote(cfilename) # <<<<<<<<<<<<<< | |
14427 * | |
14428 * # open file for reading | |
14429 */ | |
14430 __pyx_v_self->is_remote = hisremote(__pyx_v_cfilename); | |
14431 | |
14432 /* "pysam/libcfaidx.pyx":576 | |
14433 * | |
14434 * # open file for reading | |
14435 * if (self._filename != b"-" # <<<<<<<<<<<<<< | |
14436 * and not self.is_remote | |
14437 * and not os.path.exists(filename)): | |
14438 */ | |
14439 __pyx_t_7 = (__Pyx_PyBytes_Equals(__pyx_v_self->_filename, __pyx_kp_b__4, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 576, __pyx_L1_error) | |
14440 if (__pyx_t_7) { | |
14441 } else { | |
14442 __pyx_t_1 = __pyx_t_7; | |
14443 goto __pyx_L5_bool_binop_done; | |
14444 } | |
14445 | |
14446 /* "pysam/libcfaidx.pyx":577 | |
14447 * # open file for reading | |
14448 * if (self._filename != b"-" | |
14449 * and not self.is_remote # <<<<<<<<<<<<<< | |
14450 * and not os.path.exists(filename)): | |
14451 * raise IOError("file `%s` not found" % filename) | |
14452 */ | |
14453 __pyx_t_7 = (!__pyx_v_self->is_remote); | |
14454 if (__pyx_t_7) { | |
14455 } else { | |
14456 __pyx_t_1 = __pyx_t_7; | |
14457 goto __pyx_L5_bool_binop_done; | |
14458 } | |
14459 | |
14460 /* "pysam/libcfaidx.pyx":578 | |
14461 * if (self._filename != b"-" | |
14462 * and not self.is_remote | |
14463 * and not os.path.exists(filename)): # <<<<<<<<<<<<<< | |
14464 * raise IOError("file `%s` not found" % filename) | |
14465 * | |
14466 */ | |
14467 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error) | |
14468 __Pyx_GOTREF(__pyx_t_3); | |
14469 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 578, __pyx_L1_error) | |
14470 __Pyx_GOTREF(__pyx_t_4); | |
14471 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14472 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error) | |
14473 __Pyx_GOTREF(__pyx_t_3); | |
14474 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14475 __pyx_t_4 = NULL; | |
14476 __pyx_t_5 = 0; | |
14477 #if CYTHON_UNPACK_METHODS | |
14478 if (likely(PyMethod_Check(__pyx_t_3))) { | |
14479 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
14480 if (likely(__pyx_t_4)) { | |
14481 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
14482 __Pyx_INCREF(__pyx_t_4); | |
14483 __Pyx_INCREF(function); | |
14484 __Pyx_DECREF_SET(__pyx_t_3, function); | |
14485 __pyx_t_5 = 1; | |
14486 } | |
14487 } | |
14488 #endif | |
14489 { | |
14490 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_filename}; | |
14491 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
14492 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
14493 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error) | |
14494 __Pyx_GOTREF(__pyx_t_2); | |
14495 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14496 } | |
14497 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 578, __pyx_L1_error) | |
14498 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
14499 __pyx_t_8 = (!__pyx_t_7); | |
14500 __pyx_t_1 = __pyx_t_8; | |
14501 __pyx_L5_bool_binop_done:; | |
14502 | |
14503 /* "pysam/libcfaidx.pyx":576 | |
14504 * | |
14505 * # open file for reading | |
14506 * if (self._filename != b"-" # <<<<<<<<<<<<<< | |
14507 * and not self.is_remote | |
14508 * and not os.path.exists(filename)): | |
14509 */ | |
14510 if (unlikely(__pyx_t_1)) { | |
14511 | |
14512 /* "pysam/libcfaidx.pyx":579 | |
14513 * and not self.is_remote | |
14514 * and not os.path.exists(filename)): | |
14515 * raise IOError("file `%s` not found" % filename) # <<<<<<<<<<<<<< | |
14516 * | |
14517 * self.persist = persist | |
14518 */ | |
14519 __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_file_s_not_found, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) | |
14520 __Pyx_GOTREF(__pyx_t_2); | |
14521 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error) | |
14522 __Pyx_GOTREF(__pyx_t_3); | |
14523 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
14524 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
14525 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
14526 __PYX_ERR(0, 579, __pyx_L1_error) | |
14527 | |
14528 /* "pysam/libcfaidx.pyx":576 | |
14529 * | |
14530 * # open file for reading | |
14531 * if (self._filename != b"-" # <<<<<<<<<<<<<< | |
14532 * and not self.is_remote | |
14533 * and not os.path.exists(filename)): | |
14534 */ | |
14535 } | |
14536 | |
14537 /* "pysam/libcfaidx.pyx":581 | |
14538 * raise IOError("file `%s` not found" % filename) | |
14539 * | |
14540 * self.persist = persist # <<<<<<<<<<<<<< | |
14541 * | |
14542 * with nogil: | |
14543 */ | |
14544 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_persist); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 581, __pyx_L1_error) | |
14545 __pyx_v_self->persist = __pyx_t_1; | |
14546 | |
14547 /* "pysam/libcfaidx.pyx":583 | |
14548 * self.persist = persist | |
14549 * | |
14550 * with nogil: # <<<<<<<<<<<<<< | |
14551 * self.fastqfile = bgzf_open(cfilename, "r") | |
14552 * self.entry = kseq_init(self.fastqfile) | |
14553 */ | |
14554 { | |
14555 #ifdef WITH_THREAD | |
14556 PyThreadState *_save; | |
14557 _save = NULL; | |
14558 Py_UNBLOCK_THREADS | |
14559 __Pyx_FastGIL_Remember(); | |
14560 #endif | |
14561 /*try:*/ { | |
14562 | |
14563 /* "pysam/libcfaidx.pyx":584 | |
14564 * | |
14565 * with nogil: | |
14566 * self.fastqfile = bgzf_open(cfilename, "r") # <<<<<<<<<<<<<< | |
14567 * self.entry = kseq_init(self.fastqfile) | |
14568 * self._filename = filename | |
14569 */ | |
14570 __pyx_v_self->fastqfile = bgzf_open(__pyx_v_cfilename, ((char const *)"r")); | |
14571 | |
14572 /* "pysam/libcfaidx.pyx":585 | |
14573 * with nogil: | |
14574 * self.fastqfile = bgzf_open(cfilename, "r") | |
14575 * self.entry = kseq_init(self.fastqfile) # <<<<<<<<<<<<<< | |
14576 * self._filename = filename | |
14577 * | |
14578 */ | |
14579 __pyx_v_self->entry = kseq_init(__pyx_v_self->fastqfile); | |
14580 } | |
14581 | |
14582 /* "pysam/libcfaidx.pyx":583 | |
14583 * self.persist = persist | |
14584 * | |
14585 * with nogil: # <<<<<<<<<<<<<< | |
14586 * self.fastqfile = bgzf_open(cfilename, "r") | |
14587 * self.entry = kseq_init(self.fastqfile) | |
14588 */ | |
14589 /*finally:*/ { | |
14590 /*normal exit:*/{ | |
14591 #ifdef WITH_THREAD | |
14592 __Pyx_FastGIL_Forget(); | |
14593 Py_BLOCK_THREADS | |
14594 #endif | |
14595 goto __pyx_L10; | |
14596 } | |
14597 __pyx_L10:; | |
14598 } | |
14599 } | |
14600 | |
14601 /* "pysam/libcfaidx.pyx":586 | |
14602 * self.fastqfile = bgzf_open(cfilename, "r") | |
14603 * self.entry = kseq_init(self.fastqfile) | |
14604 * self._filename = filename # <<<<<<<<<<<<<< | |
14605 * | |
14606 * def close(self): | |
14607 */ | |
14608 __Pyx_INCREF(__pyx_v_filename); | |
14609 __Pyx_GIVEREF(__pyx_v_filename); | |
14610 __Pyx_GOTREF(__pyx_v_self->_filename); | |
14611 __Pyx_DECREF(__pyx_v_self->_filename); | |
14612 __pyx_v_self->_filename = __pyx_v_filename; | |
14613 | |
14614 /* "pysam/libcfaidx.pyx":555 | |
14615 * return self.entry != NULL | |
14616 * | |
14617 * def _open(self, filename, persist=True): # <<<<<<<<<<<<<< | |
14618 * '''open a fastq/fasta file in *filename* | |
14619 * | |
14620 */ | |
14621 | |
14622 /* function exit code */ | |
14623 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
14624 goto __pyx_L0; | |
14625 __pyx_L1_error:; | |
14626 __Pyx_XDECREF(__pyx_t_2); | |
14627 __Pyx_XDECREF(__pyx_t_3); | |
14628 __Pyx_XDECREF(__pyx_t_4); | |
14629 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14630 __pyx_r = NULL; | |
14631 __pyx_L0:; | |
14632 __Pyx_XGIVEREF(__pyx_r); | |
14633 __Pyx_TraceReturn(__pyx_r, 0); | |
14634 __Pyx_RefNannyFinishContext(); | |
14635 return __pyx_r; | |
14636 } | |
14637 | |
14638 /* "pysam/libcfaidx.pyx":588 | |
14639 * self._filename = filename | |
14640 * | |
14641 * def close(self): # <<<<<<<<<<<<<< | |
14642 * '''close the file.''' | |
14643 * if self.fastqfile != NULL: | |
14644 */ | |
14645 | |
14646 /* Python wrapper */ | |
14647 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_7close(PyObject *__pyx_v_self, | |
14648 #if CYTHON_METH_FASTCALL | |
14649 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14650 #else | |
14651 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14652 #endif | |
14653 ); /*proto*/ | |
14654 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastxFile_6close, "FastxFile.close(self)\nclose the file."); | |
14655 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastxFile_7close = {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastxFile_7close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastxFile_6close}; | |
14656 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_7close(PyObject *__pyx_v_self, | |
14657 #if CYTHON_METH_FASTCALL | |
14658 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14659 #else | |
14660 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14661 #endif | |
14662 ) { | |
14663 #if !CYTHON_METH_FASTCALL | |
14664 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
14665 #endif | |
14666 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
14667 PyObject *__pyx_r = 0; | |
14668 __Pyx_RefNannyDeclarations | |
14669 __Pyx_RefNannySetupContext("close (wrapper)", 0); | |
14670 #if !CYTHON_METH_FASTCALL | |
14671 #if CYTHON_ASSUME_SAFE_MACROS | |
14672 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
14673 #else | |
14674 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
14675 #endif | |
14676 #endif | |
14677 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
14678 if (unlikely(__pyx_nargs > 0)) { | |
14679 __Pyx_RaiseArgtupleInvalid("close", 1, 0, 0, __pyx_nargs); return NULL;} | |
14680 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "close", 0))) return NULL; | |
14681 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastxFile_6close(((struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)__pyx_v_self)); | |
14682 | |
14683 /* function exit code */ | |
14684 __Pyx_RefNannyFinishContext(); | |
14685 return __pyx_r; | |
14686 } | |
14687 | |
14688 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_6close(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self) { | |
14689 PyObject *__pyx_r = NULL; | |
14690 __Pyx_TraceDeclarations | |
14691 __Pyx_RefNannyDeclarations | |
14692 int __pyx_t_1; | |
14693 int __pyx_lineno = 0; | |
14694 const char *__pyx_filename = NULL; | |
14695 int __pyx_clineno = 0; | |
14696 __Pyx_TraceFrameInit(__pyx_codeobj__36) | |
14697 __Pyx_RefNannySetupContext("close", 1); | |
14698 __Pyx_TraceCall("close", __pyx_f[0], 588, 0, __PYX_ERR(0, 588, __pyx_L1_error)); | |
14699 | |
14700 /* "pysam/libcfaidx.pyx":590 | |
14701 * def close(self): | |
14702 * '''close the file.''' | |
14703 * if self.fastqfile != NULL: # <<<<<<<<<<<<<< | |
14704 * bgzf_close(self.fastqfile) | |
14705 * self.fastqfile = NULL | |
14706 */ | |
14707 __pyx_t_1 = (__pyx_v_self->fastqfile != NULL); | |
14708 if (__pyx_t_1) { | |
14709 | |
14710 /* "pysam/libcfaidx.pyx":591 | |
14711 * '''close the file.''' | |
14712 * if self.fastqfile != NULL: | |
14713 * bgzf_close(self.fastqfile) # <<<<<<<<<<<<<< | |
14714 * self.fastqfile = NULL | |
14715 * if self.entry != NULL: | |
14716 */ | |
14717 (void)(bgzf_close(__pyx_v_self->fastqfile)); | |
14718 | |
14719 /* "pysam/libcfaidx.pyx":592 | |
14720 * if self.fastqfile != NULL: | |
14721 * bgzf_close(self.fastqfile) | |
14722 * self.fastqfile = NULL # <<<<<<<<<<<<<< | |
14723 * if self.entry != NULL: | |
14724 * kseq_destroy(self.entry) | |
14725 */ | |
14726 __pyx_v_self->fastqfile = NULL; | |
14727 | |
14728 /* "pysam/libcfaidx.pyx":590 | |
14729 * def close(self): | |
14730 * '''close the file.''' | |
14731 * if self.fastqfile != NULL: # <<<<<<<<<<<<<< | |
14732 * bgzf_close(self.fastqfile) | |
14733 * self.fastqfile = NULL | |
14734 */ | |
14735 } | |
14736 | |
14737 /* "pysam/libcfaidx.pyx":593 | |
14738 * bgzf_close(self.fastqfile) | |
14739 * self.fastqfile = NULL | |
14740 * if self.entry != NULL: # <<<<<<<<<<<<<< | |
14741 * kseq_destroy(self.entry) | |
14742 * self.entry = NULL | |
14743 */ | |
14744 __pyx_t_1 = (__pyx_v_self->entry != NULL); | |
14745 if (__pyx_t_1) { | |
14746 | |
14747 /* "pysam/libcfaidx.pyx":594 | |
14748 * self.fastqfile = NULL | |
14749 * if self.entry != NULL: | |
14750 * kseq_destroy(self.entry) # <<<<<<<<<<<<<< | |
14751 * self.entry = NULL | |
14752 * | |
14753 */ | |
14754 kseq_destroy(__pyx_v_self->entry); | |
14755 | |
14756 /* "pysam/libcfaidx.pyx":595 | |
14757 * if self.entry != NULL: | |
14758 * kseq_destroy(self.entry) | |
14759 * self.entry = NULL # <<<<<<<<<<<<<< | |
14760 * | |
14761 * def __dealloc__(self): | |
14762 */ | |
14763 __pyx_v_self->entry = NULL; | |
14764 | |
14765 /* "pysam/libcfaidx.pyx":593 | |
14766 * bgzf_close(self.fastqfile) | |
14767 * self.fastqfile = NULL | |
14768 * if self.entry != NULL: # <<<<<<<<<<<<<< | |
14769 * kseq_destroy(self.entry) | |
14770 * self.entry = NULL | |
14771 */ | |
14772 } | |
14773 | |
14774 /* "pysam/libcfaidx.pyx":588 | |
14775 * self._filename = filename | |
14776 * | |
14777 * def close(self): # <<<<<<<<<<<<<< | |
14778 * '''close the file.''' | |
14779 * if self.fastqfile != NULL: | |
14780 */ | |
14781 | |
14782 /* function exit code */ | |
14783 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
14784 goto __pyx_L0; | |
14785 __pyx_L1_error:; | |
14786 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile.close", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14787 __pyx_r = NULL; | |
14788 __pyx_L0:; | |
14789 __Pyx_XGIVEREF(__pyx_r); | |
14790 __Pyx_TraceReturn(__pyx_r, 0); | |
14791 __Pyx_RefNannyFinishContext(); | |
14792 return __pyx_r; | |
14793 } | |
14794 | |
14795 /* "pysam/libcfaidx.pyx":597 | |
14796 * self.entry = NULL | |
14797 * | |
14798 * def __dealloc__(self): # <<<<<<<<<<<<<< | |
14799 * if self.fastqfile != NULL: | |
14800 * bgzf_close(self.fastqfile) | |
14801 */ | |
14802 | |
14803 /* Python wrapper */ | |
14804 static void __pyx_pw_5pysam_9libcfaidx_9FastxFile_9__dealloc__(PyObject *__pyx_v_self); /*proto*/ | |
14805 static void __pyx_pw_5pysam_9libcfaidx_9FastxFile_9__dealloc__(PyObject *__pyx_v_self) { | |
14806 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
14807 __Pyx_RefNannyDeclarations | |
14808 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); | |
14809 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
14810 __pyx_pf_5pysam_9libcfaidx_9FastxFile_8__dealloc__(((struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)__pyx_v_self)); | |
14811 | |
14812 /* function exit code */ | |
14813 __Pyx_RefNannyFinishContext(); | |
14814 } | |
14815 | |
14816 static void __pyx_pf_5pysam_9libcfaidx_9FastxFile_8__dealloc__(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self) { | |
14817 __Pyx_TraceDeclarations | |
14818 int __pyx_t_1; | |
14819 int __pyx_lineno = 0; | |
14820 const char *__pyx_filename = NULL; | |
14821 int __pyx_clineno = 0; | |
14822 __Pyx_TraceCall("__dealloc__", __pyx_f[0], 597, 0, __PYX_ERR(0, 597, __pyx_L1_error)); | |
14823 | |
14824 /* "pysam/libcfaidx.pyx":598 | |
14825 * | |
14826 * def __dealloc__(self): | |
14827 * if self.fastqfile != NULL: # <<<<<<<<<<<<<< | |
14828 * bgzf_close(self.fastqfile) | |
14829 * if self.entry: | |
14830 */ | |
14831 __pyx_t_1 = (__pyx_v_self->fastqfile != NULL); | |
14832 if (__pyx_t_1) { | |
14833 | |
14834 /* "pysam/libcfaidx.pyx":599 | |
14835 * def __dealloc__(self): | |
14836 * if self.fastqfile != NULL: | |
14837 * bgzf_close(self.fastqfile) # <<<<<<<<<<<<<< | |
14838 * if self.entry: | |
14839 * kseq_destroy(self.entry) | |
14840 */ | |
14841 (void)(bgzf_close(__pyx_v_self->fastqfile)); | |
14842 | |
14843 /* "pysam/libcfaidx.pyx":598 | |
14844 * | |
14845 * def __dealloc__(self): | |
14846 * if self.fastqfile != NULL: # <<<<<<<<<<<<<< | |
14847 * bgzf_close(self.fastqfile) | |
14848 * if self.entry: | |
14849 */ | |
14850 } | |
14851 | |
14852 /* "pysam/libcfaidx.pyx":600 | |
14853 * if self.fastqfile != NULL: | |
14854 * bgzf_close(self.fastqfile) | |
14855 * if self.entry: # <<<<<<<<<<<<<< | |
14856 * kseq_destroy(self.entry) | |
14857 * | |
14858 */ | |
14859 __pyx_t_1 = (__pyx_v_self->entry != 0); | |
14860 if (__pyx_t_1) { | |
14861 | |
14862 /* "pysam/libcfaidx.pyx":601 | |
14863 * bgzf_close(self.fastqfile) | |
14864 * if self.entry: | |
14865 * kseq_destroy(self.entry) # <<<<<<<<<<<<<< | |
14866 * | |
14867 * # context manager interface | |
14868 */ | |
14869 kseq_destroy(__pyx_v_self->entry); | |
14870 | |
14871 /* "pysam/libcfaidx.pyx":600 | |
14872 * if self.fastqfile != NULL: | |
14873 * bgzf_close(self.fastqfile) | |
14874 * if self.entry: # <<<<<<<<<<<<<< | |
14875 * kseq_destroy(self.entry) | |
14876 * | |
14877 */ | |
14878 } | |
14879 | |
14880 /* "pysam/libcfaidx.pyx":597 | |
14881 * self.entry = NULL | |
14882 * | |
14883 * def __dealloc__(self): # <<<<<<<<<<<<<< | |
14884 * if self.fastqfile != NULL: | |
14885 * bgzf_close(self.fastqfile) | |
14886 */ | |
14887 | |
14888 /* function exit code */ | |
14889 goto __pyx_L0; | |
14890 __pyx_L1_error:; | |
14891 __Pyx_WriteUnraisable("pysam.libcfaidx.FastxFile.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); | |
14892 __pyx_L0:; | |
14893 __Pyx_TraceReturn(Py_None, 0); | |
14894 } | |
14895 | |
14896 /* "pysam/libcfaidx.pyx":604 | |
14897 * | |
14898 * # context manager interface | |
14899 * def __enter__(self): # <<<<<<<<<<<<<< | |
14900 * return self | |
14901 * | |
14902 */ | |
14903 | |
14904 /* Python wrapper */ | |
14905 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_11__enter__(PyObject *__pyx_v_self, | |
14906 #if CYTHON_METH_FASTCALL | |
14907 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14908 #else | |
14909 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14910 #endif | |
14911 ); /*proto*/ | |
14912 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastxFile_10__enter__, "FastxFile.__enter__(self)"); | |
14913 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastxFile_11__enter__ = {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastxFile_11__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastxFile_10__enter__}; | |
14914 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_11__enter__(PyObject *__pyx_v_self, | |
14915 #if CYTHON_METH_FASTCALL | |
14916 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
14917 #else | |
14918 PyObject *__pyx_args, PyObject *__pyx_kwds | |
14919 #endif | |
14920 ) { | |
14921 #if !CYTHON_METH_FASTCALL | |
14922 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
14923 #endif | |
14924 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
14925 PyObject *__pyx_r = 0; | |
14926 __Pyx_RefNannyDeclarations | |
14927 __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); | |
14928 #if !CYTHON_METH_FASTCALL | |
14929 #if CYTHON_ASSUME_SAFE_MACROS | |
14930 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
14931 #else | |
14932 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
14933 #endif | |
14934 #endif | |
14935 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
14936 if (unlikely(__pyx_nargs > 0)) { | |
14937 __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, __pyx_nargs); return NULL;} | |
14938 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; | |
14939 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastxFile_10__enter__(((struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)__pyx_v_self)); | |
14940 | |
14941 /* function exit code */ | |
14942 __Pyx_RefNannyFinishContext(); | |
14943 return __pyx_r; | |
14944 } | |
14945 | |
14946 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_10__enter__(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self) { | |
14947 PyObject *__pyx_r = NULL; | |
14948 __Pyx_TraceDeclarations | |
14949 __Pyx_RefNannyDeclarations | |
14950 int __pyx_lineno = 0; | |
14951 const char *__pyx_filename = NULL; | |
14952 int __pyx_clineno = 0; | |
14953 __Pyx_TraceFrameInit(__pyx_codeobj__37) | |
14954 __Pyx_RefNannySetupContext("__enter__", 1); | |
14955 __Pyx_TraceCall("__enter__", __pyx_f[0], 604, 0, __PYX_ERR(0, 604, __pyx_L1_error)); | |
14956 | |
14957 /* "pysam/libcfaidx.pyx":605 | |
14958 * # context manager interface | |
14959 * def __enter__(self): | |
14960 * return self # <<<<<<<<<<<<<< | |
14961 * | |
14962 * def __exit__(self, exc_type, exc_value, traceback): | |
14963 */ | |
14964 __Pyx_XDECREF(__pyx_r); | |
14965 __Pyx_INCREF((PyObject *)__pyx_v_self); | |
14966 __pyx_r = ((PyObject *)__pyx_v_self); | |
14967 goto __pyx_L0; | |
14968 | |
14969 /* "pysam/libcfaidx.pyx":604 | |
14970 * | |
14971 * # context manager interface | |
14972 * def __enter__(self): # <<<<<<<<<<<<<< | |
14973 * return self | |
14974 * | |
14975 */ | |
14976 | |
14977 /* function exit code */ | |
14978 __pyx_L1_error:; | |
14979 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
14980 __pyx_r = NULL; | |
14981 __pyx_L0:; | |
14982 __Pyx_XGIVEREF(__pyx_r); | |
14983 __Pyx_TraceReturn(__pyx_r, 0); | |
14984 __Pyx_RefNannyFinishContext(); | |
14985 return __pyx_r; | |
14986 } | |
14987 | |
14988 /* "pysam/libcfaidx.pyx":607 | |
14989 * return self | |
14990 * | |
14991 * def __exit__(self, exc_type, exc_value, traceback): # <<<<<<<<<<<<<< | |
14992 * self.close() | |
14993 * return False | |
14994 */ | |
14995 | |
14996 /* Python wrapper */ | |
14997 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_13__exit__(PyObject *__pyx_v_self, | |
14998 #if CYTHON_METH_FASTCALL | |
14999 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
15000 #else | |
15001 PyObject *__pyx_args, PyObject *__pyx_kwds | |
15002 #endif | |
15003 ); /*proto*/ | |
15004 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastxFile_12__exit__, "FastxFile.__exit__(self, exc_type, exc_value, traceback)"); | |
15005 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastxFile_13__exit__ = {"__exit__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastxFile_13__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastxFile_12__exit__}; | |
15006 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_13__exit__(PyObject *__pyx_v_self, | |
15007 #if CYTHON_METH_FASTCALL | |
15008 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
15009 #else | |
15010 PyObject *__pyx_args, PyObject *__pyx_kwds | |
15011 #endif | |
15012 ) { | |
15013 CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0; | |
15014 CYTHON_UNUSED PyObject *__pyx_v_exc_value = 0; | |
15015 CYTHON_UNUSED PyObject *__pyx_v_traceback = 0; | |
15016 #if !CYTHON_METH_FASTCALL | |
15017 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
15018 #endif | |
15019 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
15020 PyObject* values[3] = {0,0,0}; | |
15021 int __pyx_lineno = 0; | |
15022 const char *__pyx_filename = NULL; | |
15023 int __pyx_clineno = 0; | |
15024 PyObject *__pyx_r = 0; | |
15025 __Pyx_RefNannyDeclarations | |
15026 __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); | |
15027 #if !CYTHON_METH_FASTCALL | |
15028 #if CYTHON_ASSUME_SAFE_MACROS | |
15029 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
15030 #else | |
15031 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
15032 #endif | |
15033 #endif | |
15034 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
15035 { | |
15036 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_value,&__pyx_n_s_traceback,0}; | |
15037 if (__pyx_kwds) { | |
15038 Py_ssize_t kw_args; | |
15039 switch (__pyx_nargs) { | |
15040 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
15041 CYTHON_FALLTHROUGH; | |
15042 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
15043 CYTHON_FALLTHROUGH; | |
15044 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
15045 CYTHON_FALLTHROUGH; | |
15046 case 0: break; | |
15047 default: goto __pyx_L5_argtuple_error; | |
15048 } | |
15049 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
15050 switch (__pyx_nargs) { | |
15051 case 0: | |
15052 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exc_type)) != 0)) { | |
15053 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
15054 kw_args--; | |
15055 } | |
15056 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 607, __pyx_L3_error) | |
15057 else goto __pyx_L5_argtuple_error; | |
15058 CYTHON_FALLTHROUGH; | |
15059 case 1: | |
15060 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exc_value)) != 0)) { | |
15061 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
15062 kw_args--; | |
15063 } | |
15064 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 607, __pyx_L3_error) | |
15065 else { | |
15066 __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 607, __pyx_L3_error) | |
15067 } | |
15068 CYTHON_FALLTHROUGH; | |
15069 case 2: | |
15070 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_traceback)) != 0)) { | |
15071 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
15072 kw_args--; | |
15073 } | |
15074 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 607, __pyx_L3_error) | |
15075 else { | |
15076 __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 607, __pyx_L3_error) | |
15077 } | |
15078 } | |
15079 if (unlikely(kw_args > 0)) { | |
15080 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
15081 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__exit__") < 0)) __PYX_ERR(0, 607, __pyx_L3_error) | |
15082 } | |
15083 } else if (unlikely(__pyx_nargs != 3)) { | |
15084 goto __pyx_L5_argtuple_error; | |
15085 } else { | |
15086 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
15087 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
15088 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
15089 } | |
15090 __pyx_v_exc_type = values[0]; | |
15091 __pyx_v_exc_value = values[1]; | |
15092 __pyx_v_traceback = values[2]; | |
15093 } | |
15094 goto __pyx_L6_skip; | |
15095 __pyx_L5_argtuple_error:; | |
15096 __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 607, __pyx_L3_error) | |
15097 __pyx_L6_skip:; | |
15098 goto __pyx_L4_argument_unpacking_done; | |
15099 __pyx_L3_error:; | |
15100 { | |
15101 Py_ssize_t __pyx_temp; | |
15102 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
15103 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
15104 } | |
15105 } | |
15106 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15107 __Pyx_RefNannyFinishContext(); | |
15108 return NULL; | |
15109 __pyx_L4_argument_unpacking_done:; | |
15110 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastxFile_12__exit__(((struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_value, __pyx_v_traceback); | |
15111 | |
15112 /* function exit code */ | |
15113 { | |
15114 Py_ssize_t __pyx_temp; | |
15115 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
15116 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
15117 } | |
15118 } | |
15119 __Pyx_RefNannyFinishContext(); | |
15120 return __pyx_r; | |
15121 } | |
15122 | |
15123 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_12__exit__(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) { | |
15124 PyObject *__pyx_r = NULL; | |
15125 __Pyx_TraceDeclarations | |
15126 __Pyx_RefNannyDeclarations | |
15127 PyObject *__pyx_t_1 = NULL; | |
15128 PyObject *__pyx_t_2 = NULL; | |
15129 PyObject *__pyx_t_3 = NULL; | |
15130 unsigned int __pyx_t_4; | |
15131 int __pyx_lineno = 0; | |
15132 const char *__pyx_filename = NULL; | |
15133 int __pyx_clineno = 0; | |
15134 __Pyx_TraceFrameInit(__pyx_codeobj__38) | |
15135 __Pyx_RefNannySetupContext("__exit__", 1); | |
15136 __Pyx_TraceCall("__exit__", __pyx_f[0], 607, 0, __PYX_ERR(0, 607, __pyx_L1_error)); | |
15137 | |
15138 /* "pysam/libcfaidx.pyx":608 | |
15139 * | |
15140 * def __exit__(self, exc_type, exc_value, traceback): | |
15141 * self.close() # <<<<<<<<<<<<<< | |
15142 * return False | |
15143 * | |
15144 */ | |
15145 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) | |
15146 __Pyx_GOTREF(__pyx_t_2); | |
15147 __pyx_t_3 = NULL; | |
15148 __pyx_t_4 = 0; | |
15149 #if CYTHON_UNPACK_METHODS | |
15150 if (likely(PyMethod_Check(__pyx_t_2))) { | |
15151 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
15152 if (likely(__pyx_t_3)) { | |
15153 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
15154 __Pyx_INCREF(__pyx_t_3); | |
15155 __Pyx_INCREF(function); | |
15156 __Pyx_DECREF_SET(__pyx_t_2, function); | |
15157 __pyx_t_4 = 1; | |
15158 } | |
15159 } | |
15160 #endif | |
15161 { | |
15162 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
15163 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
15164 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15165 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error) | |
15166 __Pyx_GOTREF(__pyx_t_1); | |
15167 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
15168 } | |
15169 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15170 | |
15171 /* "pysam/libcfaidx.pyx":609 | |
15172 * def __exit__(self, exc_type, exc_value, traceback): | |
15173 * self.close() | |
15174 * return False # <<<<<<<<<<<<<< | |
15175 * | |
15176 * property closed: | |
15177 */ | |
15178 __Pyx_XDECREF(__pyx_r); | |
15179 __Pyx_INCREF(Py_False); | |
15180 __pyx_r = Py_False; | |
15181 goto __pyx_L0; | |
15182 | |
15183 /* "pysam/libcfaidx.pyx":607 | |
15184 * return self | |
15185 * | |
15186 * def __exit__(self, exc_type, exc_value, traceback): # <<<<<<<<<<<<<< | |
15187 * self.close() | |
15188 * return False | |
15189 */ | |
15190 | |
15191 /* function exit code */ | |
15192 __pyx_L1_error:; | |
15193 __Pyx_XDECREF(__pyx_t_1); | |
15194 __Pyx_XDECREF(__pyx_t_2); | |
15195 __Pyx_XDECREF(__pyx_t_3); | |
15196 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15197 __pyx_r = NULL; | |
15198 __pyx_L0:; | |
15199 __Pyx_XGIVEREF(__pyx_r); | |
15200 __Pyx_TraceReturn(__pyx_r, 0); | |
15201 __Pyx_RefNannyFinishContext(); | |
15202 return __pyx_r; | |
15203 } | |
15204 | |
15205 /* "pysam/libcfaidx.pyx":615 | |
15206 * This is a read-only attribute; the close() method changes the value. | |
15207 * """ | |
15208 * def __get__(self): # <<<<<<<<<<<<<< | |
15209 * return not self.is_open() | |
15210 * | |
15211 */ | |
15212 | |
15213 /* Python wrapper */ | |
15214 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_6closed_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
15215 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_6closed_1__get__(PyObject *__pyx_v_self) { | |
15216 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
15217 PyObject *__pyx_r = 0; | |
15218 __Pyx_RefNannyDeclarations | |
15219 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
15220 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
15221 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastxFile_6closed___get__(((struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)__pyx_v_self)); | |
15222 | |
15223 /* function exit code */ | |
15224 __Pyx_RefNannyFinishContext(); | |
15225 return __pyx_r; | |
15226 } | |
15227 | |
15228 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_6closed___get__(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self) { | |
15229 PyObject *__pyx_r = NULL; | |
15230 __Pyx_TraceDeclarations | |
15231 __Pyx_RefNannyDeclarations | |
15232 PyObject *__pyx_t_1 = NULL; | |
15233 PyObject *__pyx_t_2 = NULL; | |
15234 PyObject *__pyx_t_3 = NULL; | |
15235 unsigned int __pyx_t_4; | |
15236 int __pyx_t_5; | |
15237 int __pyx_lineno = 0; | |
15238 const char *__pyx_filename = NULL; | |
15239 int __pyx_clineno = 0; | |
15240 __Pyx_RefNannySetupContext("__get__", 1); | |
15241 __Pyx_TraceCall("__get__", __pyx_f[0], 615, 0, __PYX_ERR(0, 615, __pyx_L1_error)); | |
15242 | |
15243 /* "pysam/libcfaidx.pyx":616 | |
15244 * """ | |
15245 * def __get__(self): | |
15246 * return not self.is_open() # <<<<<<<<<<<<<< | |
15247 * | |
15248 * property filename: | |
15249 */ | |
15250 __Pyx_XDECREF(__pyx_r); | |
15251 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error) | |
15252 __Pyx_GOTREF(__pyx_t_2); | |
15253 __pyx_t_3 = NULL; | |
15254 __pyx_t_4 = 0; | |
15255 #if CYTHON_UNPACK_METHODS | |
15256 if (likely(PyMethod_Check(__pyx_t_2))) { | |
15257 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
15258 if (likely(__pyx_t_3)) { | |
15259 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
15260 __Pyx_INCREF(__pyx_t_3); | |
15261 __Pyx_INCREF(function); | |
15262 __Pyx_DECREF_SET(__pyx_t_2, function); | |
15263 __pyx_t_4 = 1; | |
15264 } | |
15265 } | |
15266 #endif | |
15267 { | |
15268 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
15269 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
15270 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15271 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error) | |
15272 __Pyx_GOTREF(__pyx_t_1); | |
15273 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
15274 } | |
15275 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 616, __pyx_L1_error) | |
15276 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15277 __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error) | |
15278 __Pyx_GOTREF(__pyx_t_1); | |
15279 __pyx_r = __pyx_t_1; | |
15280 __pyx_t_1 = 0; | |
15281 goto __pyx_L0; | |
15282 | |
15283 /* "pysam/libcfaidx.pyx":615 | |
15284 * This is a read-only attribute; the close() method changes the value. | |
15285 * """ | |
15286 * def __get__(self): # <<<<<<<<<<<<<< | |
15287 * return not self.is_open() | |
15288 * | |
15289 */ | |
15290 | |
15291 /* function exit code */ | |
15292 __pyx_L1_error:; | |
15293 __Pyx_XDECREF(__pyx_t_1); | |
15294 __Pyx_XDECREF(__pyx_t_2); | |
15295 __Pyx_XDECREF(__pyx_t_3); | |
15296 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile.closed.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15297 __pyx_r = NULL; | |
15298 __pyx_L0:; | |
15299 __Pyx_XGIVEREF(__pyx_r); | |
15300 __Pyx_TraceReturn(__pyx_r, 0); | |
15301 __Pyx_RefNannyFinishContext(); | |
15302 return __pyx_r; | |
15303 } | |
15304 | |
15305 /* "pysam/libcfaidx.pyx":620 | |
15306 * property filename: | |
15307 * """string with the filename associated with this object.""" | |
15308 * def __get__(self): # <<<<<<<<<<<<<< | |
15309 * return self._filename | |
15310 * | |
15311 */ | |
15312 | |
15313 /* Python wrapper */ | |
15314 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_8filename_1__get__(PyObject *__pyx_v_self); /*proto*/ | |
15315 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_8filename_1__get__(PyObject *__pyx_v_self) { | |
15316 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
15317 PyObject *__pyx_r = 0; | |
15318 __Pyx_RefNannyDeclarations | |
15319 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); | |
15320 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
15321 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastxFile_8filename___get__(((struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)__pyx_v_self)); | |
15322 | |
15323 /* function exit code */ | |
15324 __Pyx_RefNannyFinishContext(); | |
15325 return __pyx_r; | |
15326 } | |
15327 | |
15328 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_8filename___get__(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self) { | |
15329 PyObject *__pyx_r = NULL; | |
15330 __Pyx_TraceDeclarations | |
15331 __Pyx_RefNannyDeclarations | |
15332 int __pyx_lineno = 0; | |
15333 const char *__pyx_filename = NULL; | |
15334 int __pyx_clineno = 0; | |
15335 __Pyx_RefNannySetupContext("__get__", 1); | |
15336 __Pyx_TraceCall("__get__", __pyx_f[0], 620, 0, __PYX_ERR(0, 620, __pyx_L1_error)); | |
15337 | |
15338 /* "pysam/libcfaidx.pyx":621 | |
15339 * """string with the filename associated with this object.""" | |
15340 * def __get__(self): | |
15341 * return self._filename # <<<<<<<<<<<<<< | |
15342 * | |
15343 * def __iter__(self): | |
15344 */ | |
15345 __Pyx_XDECREF(__pyx_r); | |
15346 __Pyx_INCREF(__pyx_v_self->_filename); | |
15347 __pyx_r = __pyx_v_self->_filename; | |
15348 goto __pyx_L0; | |
15349 | |
15350 /* "pysam/libcfaidx.pyx":620 | |
15351 * property filename: | |
15352 * """string with the filename associated with this object.""" | |
15353 * def __get__(self): # <<<<<<<<<<<<<< | |
15354 * return self._filename | |
15355 * | |
15356 */ | |
15357 | |
15358 /* function exit code */ | |
15359 __pyx_L1_error:; | |
15360 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile.filename.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15361 __pyx_r = NULL; | |
15362 __pyx_L0:; | |
15363 __Pyx_XGIVEREF(__pyx_r); | |
15364 __Pyx_TraceReturn(__pyx_r, 0); | |
15365 __Pyx_RefNannyFinishContext(); | |
15366 return __pyx_r; | |
15367 } | |
15368 | |
15369 /* "pysam/libcfaidx.pyx":623 | |
15370 * return self._filename | |
15371 * | |
15372 * def __iter__(self): # <<<<<<<<<<<<<< | |
15373 * if not self.is_open(): | |
15374 * raise ValueError("I/O operation on closed file") | |
15375 */ | |
15376 | |
15377 /* Python wrapper */ | |
15378 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_15__iter__(PyObject *__pyx_v_self); /*proto*/ | |
15379 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_15__iter__(PyObject *__pyx_v_self) { | |
15380 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
15381 PyObject *__pyx_r = 0; | |
15382 __Pyx_RefNannyDeclarations | |
15383 __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); | |
15384 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
15385 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastxFile_14__iter__(((struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)__pyx_v_self)); | |
15386 | |
15387 /* function exit code */ | |
15388 __Pyx_RefNannyFinishContext(); | |
15389 return __pyx_r; | |
15390 } | |
15391 | |
15392 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_14__iter__(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self) { | |
15393 PyObject *__pyx_r = NULL; | |
15394 __Pyx_TraceDeclarations | |
15395 __Pyx_RefNannyDeclarations | |
15396 PyObject *__pyx_t_1 = NULL; | |
15397 PyObject *__pyx_t_2 = NULL; | |
15398 PyObject *__pyx_t_3 = NULL; | |
15399 unsigned int __pyx_t_4; | |
15400 int __pyx_t_5; | |
15401 int __pyx_t_6; | |
15402 int __pyx_lineno = 0; | |
15403 const char *__pyx_filename = NULL; | |
15404 int __pyx_clineno = 0; | |
15405 __Pyx_RefNannySetupContext("__iter__", 1); | |
15406 __Pyx_TraceCall("__iter__", __pyx_f[0], 623, 0, __PYX_ERR(0, 623, __pyx_L1_error)); | |
15407 | |
15408 /* "pysam/libcfaidx.pyx":624 | |
15409 * | |
15410 * def __iter__(self): | |
15411 * if not self.is_open(): # <<<<<<<<<<<<<< | |
15412 * raise ValueError("I/O operation on closed file") | |
15413 * return self | |
15414 */ | |
15415 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error) | |
15416 __Pyx_GOTREF(__pyx_t_2); | |
15417 __pyx_t_3 = NULL; | |
15418 __pyx_t_4 = 0; | |
15419 #if CYTHON_UNPACK_METHODS | |
15420 if (likely(PyMethod_Check(__pyx_t_2))) { | |
15421 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); | |
15422 if (likely(__pyx_t_3)) { | |
15423 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
15424 __Pyx_INCREF(__pyx_t_3); | |
15425 __Pyx_INCREF(function); | |
15426 __Pyx_DECREF_SET(__pyx_t_2, function); | |
15427 __pyx_t_4 = 1; | |
15428 } | |
15429 } | |
15430 #endif | |
15431 { | |
15432 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; | |
15433 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); | |
15434 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15435 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error) | |
15436 __Pyx_GOTREF(__pyx_t_1); | |
15437 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
15438 } | |
15439 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 624, __pyx_L1_error) | |
15440 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15441 __pyx_t_6 = (!__pyx_t_5); | |
15442 if (unlikely(__pyx_t_6)) { | |
15443 | |
15444 /* "pysam/libcfaidx.pyx":625 | |
15445 * def __iter__(self): | |
15446 * if not self.is_open(): | |
15447 * raise ValueError("I/O operation on closed file") # <<<<<<<<<<<<<< | |
15448 * return self | |
15449 * | |
15450 */ | |
15451 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error) | |
15452 __Pyx_GOTREF(__pyx_t_1); | |
15453 __Pyx_Raise(__pyx_t_1, 0, 0, 0); | |
15454 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
15455 __PYX_ERR(0, 625, __pyx_L1_error) | |
15456 | |
15457 /* "pysam/libcfaidx.pyx":624 | |
15458 * | |
15459 * def __iter__(self): | |
15460 * if not self.is_open(): # <<<<<<<<<<<<<< | |
15461 * raise ValueError("I/O operation on closed file") | |
15462 * return self | |
15463 */ | |
15464 } | |
15465 | |
15466 /* "pysam/libcfaidx.pyx":626 | |
15467 * if not self.is_open(): | |
15468 * raise ValueError("I/O operation on closed file") | |
15469 * return self # <<<<<<<<<<<<<< | |
15470 * | |
15471 * cdef kseq_t * getCurrent(self): | |
15472 */ | |
15473 __Pyx_XDECREF(__pyx_r); | |
15474 __Pyx_INCREF((PyObject *)__pyx_v_self); | |
15475 __pyx_r = ((PyObject *)__pyx_v_self); | |
15476 goto __pyx_L0; | |
15477 | |
15478 /* "pysam/libcfaidx.pyx":623 | |
15479 * return self._filename | |
15480 * | |
15481 * def __iter__(self): # <<<<<<<<<<<<<< | |
15482 * if not self.is_open(): | |
15483 * raise ValueError("I/O operation on closed file") | |
15484 */ | |
15485 | |
15486 /* function exit code */ | |
15487 __pyx_L1_error:; | |
15488 __Pyx_XDECREF(__pyx_t_1); | |
15489 __Pyx_XDECREF(__pyx_t_2); | |
15490 __Pyx_XDECREF(__pyx_t_3); | |
15491 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15492 __pyx_r = NULL; | |
15493 __pyx_L0:; | |
15494 __Pyx_XGIVEREF(__pyx_r); | |
15495 __Pyx_TraceReturn(__pyx_r, 0); | |
15496 __Pyx_RefNannyFinishContext(); | |
15497 return __pyx_r; | |
15498 } | |
15499 | |
15500 /* "pysam/libcfaidx.pyx":628 | |
15501 * return self | |
15502 * | |
15503 * cdef kseq_t * getCurrent(self): # <<<<<<<<<<<<<< | |
15504 * return self.entry | |
15505 * | |
15506 */ | |
15507 | |
15508 static kseq_t *__pyx_f_5pysam_9libcfaidx_9FastxFile_getCurrent(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self) { | |
15509 kseq_t *__pyx_r; | |
15510 __Pyx_TraceDeclarations | |
15511 int __pyx_lineno = 0; | |
15512 const char *__pyx_filename = NULL; | |
15513 int __pyx_clineno = 0; | |
15514 __Pyx_TraceCall("getCurrent", __pyx_f[0], 628, 0, __PYX_ERR(0, 628, __pyx_L1_error)); | |
15515 | |
15516 /* "pysam/libcfaidx.pyx":629 | |
15517 * | |
15518 * cdef kseq_t * getCurrent(self): | |
15519 * return self.entry # <<<<<<<<<<<<<< | |
15520 * | |
15521 * cdef int cnext(self): | |
15522 */ | |
15523 __pyx_r = __pyx_v_self->entry; | |
15524 goto __pyx_L0; | |
15525 | |
15526 /* "pysam/libcfaidx.pyx":628 | |
15527 * return self | |
15528 * | |
15529 * cdef kseq_t * getCurrent(self): # <<<<<<<<<<<<<< | |
15530 * return self.entry | |
15531 * | |
15532 */ | |
15533 | |
15534 /* function exit code */ | |
15535 __pyx_L1_error:; | |
15536 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile.getCurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15537 __pyx_r = 0; | |
15538 __pyx_L0:; | |
15539 __Pyx_TraceReturn(Py_None, 0); | |
15540 return __pyx_r; | |
15541 } | |
15542 | |
15543 /* "pysam/libcfaidx.pyx":631 | |
15544 * return self.entry | |
15545 * | |
15546 * cdef int cnext(self): # <<<<<<<<<<<<<< | |
15547 * '''C version of iterator | |
15548 * ''' | |
15549 */ | |
15550 | |
15551 static int __pyx_f_5pysam_9libcfaidx_9FastxFile_cnext(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self) { | |
15552 int __pyx_r; | |
15553 __Pyx_TraceDeclarations | |
15554 int __pyx_lineno = 0; | |
15555 const char *__pyx_filename = NULL; | |
15556 int __pyx_clineno = 0; | |
15557 __Pyx_TraceCall("cnext", __pyx_f[0], 631, 0, __PYX_ERR(0, 631, __pyx_L1_error)); | |
15558 | |
15559 /* "pysam/libcfaidx.pyx":634 | |
15560 * '''C version of iterator | |
15561 * ''' | |
15562 * with nogil: # <<<<<<<<<<<<<< | |
15563 * return kseq_read(self.entry) | |
15564 * | |
15565 */ | |
15566 { | |
15567 #ifdef WITH_THREAD | |
15568 PyThreadState *_save; | |
15569 _save = NULL; | |
15570 Py_UNBLOCK_THREADS | |
15571 __Pyx_FastGIL_Remember(); | |
15572 #endif | |
15573 /*try:*/ { | |
15574 | |
15575 /* "pysam/libcfaidx.pyx":635 | |
15576 * ''' | |
15577 * with nogil: | |
15578 * return kseq_read(self.entry) # <<<<<<<<<<<<<< | |
15579 * | |
15580 * def __next__(self): | |
15581 */ | |
15582 __pyx_r = kseq_read(__pyx_v_self->entry); | |
15583 goto __pyx_L3_return; | |
15584 } | |
15585 | |
15586 /* "pysam/libcfaidx.pyx":634 | |
15587 * '''C version of iterator | |
15588 * ''' | |
15589 * with nogil: # <<<<<<<<<<<<<< | |
15590 * return kseq_read(self.entry) | |
15591 * | |
15592 */ | |
15593 /*finally:*/ { | |
15594 __pyx_L3_return: { | |
15595 #ifdef WITH_THREAD | |
15596 __Pyx_FastGIL_Forget(); | |
15597 Py_BLOCK_THREADS | |
15598 #endif | |
15599 goto __pyx_L0; | |
15600 } | |
15601 } | |
15602 } | |
15603 | |
15604 /* "pysam/libcfaidx.pyx":631 | |
15605 * return self.entry | |
15606 * | |
15607 * cdef int cnext(self): # <<<<<<<<<<<<<< | |
15608 * '''C version of iterator | |
15609 * ''' | |
15610 */ | |
15611 | |
15612 /* function exit code */ | |
15613 __pyx_L1_error:; | |
15614 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile.cnext", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15615 __pyx_r = 0; | |
15616 __pyx_L0:; | |
15617 __Pyx_TraceReturn(Py_None, 0); | |
15618 return __pyx_r; | |
15619 } | |
15620 | |
15621 /* "pysam/libcfaidx.pyx":637 | |
15622 * return kseq_read(self.entry) | |
15623 * | |
15624 * def __next__(self): # <<<<<<<<<<<<<< | |
15625 * """ | |
15626 * python version of next(). | |
15627 */ | |
15628 | |
15629 /* Python wrapper */ | |
15630 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_17__next__(PyObject *__pyx_v_self); /*proto*/ | |
15631 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastxFile_16__next__, "\n python version of next().\n "); | |
15632 #if CYTHON_UPDATE_DESCRIPTOR_DOC | |
15633 struct wrapperbase __pyx_wrapperbase_5pysam_9libcfaidx_9FastxFile_16__next__; | |
15634 #endif | |
15635 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_17__next__(PyObject *__pyx_v_self) { | |
15636 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
15637 PyObject *__pyx_r = 0; | |
15638 __Pyx_RefNannyDeclarations | |
15639 __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); | |
15640 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); | |
15641 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastxFile_16__next__(((struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)__pyx_v_self)); | |
15642 | |
15643 /* function exit code */ | |
15644 __Pyx_RefNannyFinishContext(); | |
15645 return __pyx_r; | |
15646 } | |
15647 | |
15648 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_16__next__(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self) { | |
15649 int __pyx_v_l; | |
15650 PyObject *__pyx_r = NULL; | |
15651 __Pyx_TraceDeclarations | |
15652 __Pyx_RefNannyDeclarations | |
15653 int __pyx_error_without_exception = 0; /* StopIteration */ | |
15654 int __pyx_t_1; | |
15655 PyObject *__pyx_t_2 = NULL; | |
15656 PyObject *__pyx_t_3 = NULL; | |
15657 PyObject *__pyx_t_4 = NULL; | |
15658 unsigned int __pyx_t_5; | |
15659 int __pyx_lineno = 0; | |
15660 const char *__pyx_filename = NULL; | |
15661 int __pyx_clineno = 0; | |
15662 __Pyx_RefNannySetupContext("__next__", 1); | |
15663 __Pyx_TraceCall("__next__", __pyx_f[0], 637, 0, __PYX_ERR(0, 637, __pyx_L1_error)); | |
15664 | |
15665 /* "pysam/libcfaidx.pyx":642 | |
15666 * """ | |
15667 * cdef int l | |
15668 * with nogil: # <<<<<<<<<<<<<< | |
15669 * l = kseq_read(self.entry) | |
15670 * if (l >= 0): | |
15671 */ | |
15672 { | |
15673 #ifdef WITH_THREAD | |
15674 PyThreadState *_save; | |
15675 _save = NULL; | |
15676 Py_UNBLOCK_THREADS | |
15677 __Pyx_FastGIL_Remember(); | |
15678 #endif | |
15679 /*try:*/ { | |
15680 | |
15681 /* "pysam/libcfaidx.pyx":643 | |
15682 * cdef int l | |
15683 * with nogil: | |
15684 * l = kseq_read(self.entry) # <<<<<<<<<<<<<< | |
15685 * if (l >= 0): | |
15686 * if self.persist: | |
15687 */ | |
15688 __pyx_v_l = kseq_read(__pyx_v_self->entry); | |
15689 } | |
15690 | |
15691 /* "pysam/libcfaidx.pyx":642 | |
15692 * """ | |
15693 * cdef int l | |
15694 * with nogil: # <<<<<<<<<<<<<< | |
15695 * l = kseq_read(self.entry) | |
15696 * if (l >= 0): | |
15697 */ | |
15698 /*finally:*/ { | |
15699 /*normal exit:*/{ | |
15700 #ifdef WITH_THREAD | |
15701 __Pyx_FastGIL_Forget(); | |
15702 Py_BLOCK_THREADS | |
15703 #endif | |
15704 goto __pyx_L5; | |
15705 } | |
15706 __pyx_L5:; | |
15707 } | |
15708 } | |
15709 | |
15710 /* "pysam/libcfaidx.pyx":644 | |
15711 * with nogil: | |
15712 * l = kseq_read(self.entry) | |
15713 * if (l >= 0): # <<<<<<<<<<<<<< | |
15714 * if self.persist: | |
15715 * return FastxRecord(proxy=makeFastqProxy(self.entry)) | |
15716 */ | |
15717 __pyx_t_1 = (__pyx_v_l >= 0); | |
15718 if (likely(__pyx_t_1)) { | |
15719 | |
15720 /* "pysam/libcfaidx.pyx":645 | |
15721 * l = kseq_read(self.entry) | |
15722 * if (l >= 0): | |
15723 * if self.persist: # <<<<<<<<<<<<<< | |
15724 * return FastxRecord(proxy=makeFastqProxy(self.entry)) | |
15725 * return makeFastqProxy(self.entry) | |
15726 */ | |
15727 if (__pyx_v_self->persist) { | |
15728 | |
15729 /* "pysam/libcfaidx.pyx":646 | |
15730 * if (l >= 0): | |
15731 * if self.persist: | |
15732 * return FastxRecord(proxy=makeFastqProxy(self.entry)) # <<<<<<<<<<<<<< | |
15733 * return makeFastqProxy(self.entry) | |
15734 * elif (l == -1): | |
15735 */ | |
15736 __Pyx_XDECREF(__pyx_r); | |
15737 __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) | |
15738 __Pyx_GOTREF(__pyx_t_2); | |
15739 __pyx_t_3 = __pyx_f_5pysam_9libcfaidx_makeFastqProxy(__pyx_v_self->entry); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) | |
15740 __Pyx_GOTREF(__pyx_t_3); | |
15741 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_proxy, __pyx_t_3) < 0) __PYX_ERR(0, 646, __pyx_L1_error) | |
15742 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15743 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxRecord), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) | |
15744 __Pyx_GOTREF(__pyx_t_3); | |
15745 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
15746 __pyx_r = __pyx_t_3; | |
15747 __pyx_t_3 = 0; | |
15748 goto __pyx_L0; | |
15749 | |
15750 /* "pysam/libcfaidx.pyx":645 | |
15751 * l = kseq_read(self.entry) | |
15752 * if (l >= 0): | |
15753 * if self.persist: # <<<<<<<<<<<<<< | |
15754 * return FastxRecord(proxy=makeFastqProxy(self.entry)) | |
15755 * return makeFastqProxy(self.entry) | |
15756 */ | |
15757 } | |
15758 | |
15759 /* "pysam/libcfaidx.pyx":647 | |
15760 * if self.persist: | |
15761 * return FastxRecord(proxy=makeFastqProxy(self.entry)) | |
15762 * return makeFastqProxy(self.entry) # <<<<<<<<<<<<<< | |
15763 * elif (l == -1): | |
15764 * raise StopIteration | |
15765 */ | |
15766 __Pyx_XDECREF(__pyx_r); | |
15767 __pyx_t_3 = __pyx_f_5pysam_9libcfaidx_makeFastqProxy(__pyx_v_self->entry); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 647, __pyx_L1_error) | |
15768 __Pyx_GOTREF(__pyx_t_3); | |
15769 __pyx_r = __pyx_t_3; | |
15770 __pyx_t_3 = 0; | |
15771 goto __pyx_L0; | |
15772 | |
15773 /* "pysam/libcfaidx.pyx":644 | |
15774 * with nogil: | |
15775 * l = kseq_read(self.entry) | |
15776 * if (l >= 0): # <<<<<<<<<<<<<< | |
15777 * if self.persist: | |
15778 * return FastxRecord(proxy=makeFastqProxy(self.entry)) | |
15779 */ | |
15780 } | |
15781 | |
15782 /* "pysam/libcfaidx.pyx":648 | |
15783 * return FastxRecord(proxy=makeFastqProxy(self.entry)) | |
15784 * return makeFastqProxy(self.entry) | |
15785 * elif (l == -1): # <<<<<<<<<<<<<< | |
15786 * raise StopIteration | |
15787 * elif (l == -2): | |
15788 */ | |
15789 __pyx_t_1 = (__pyx_v_l == -1L); | |
15790 if (unlikely(__pyx_t_1)) { | |
15791 | |
15792 /* "pysam/libcfaidx.pyx":649 | |
15793 * return makeFastqProxy(self.entry) | |
15794 * elif (l == -1): | |
15795 * raise StopIteration # <<<<<<<<<<<<<< | |
15796 * elif (l == -2): | |
15797 * raise ValueError('truncated quality string in {0}' | |
15798 */ | |
15799 __pyx_error_without_exception = 1; | |
15800 goto __pyx_L1_error;; | |
15801 | |
15802 /* "pysam/libcfaidx.pyx":648 | |
15803 * return FastxRecord(proxy=makeFastqProxy(self.entry)) | |
15804 * return makeFastqProxy(self.entry) | |
15805 * elif (l == -1): # <<<<<<<<<<<<<< | |
15806 * raise StopIteration | |
15807 * elif (l == -2): | |
15808 */ | |
15809 } | |
15810 | |
15811 /* "pysam/libcfaidx.pyx":650 | |
15812 * elif (l == -1): | |
15813 * raise StopIteration | |
15814 * elif (l == -2): # <<<<<<<<<<<<<< | |
15815 * raise ValueError('truncated quality string in {0}' | |
15816 * .format(self._filename)) | |
15817 */ | |
15818 __pyx_t_1 = (__pyx_v_l == -2L); | |
15819 if (unlikely(__pyx_t_1)) { | |
15820 | |
15821 /* "pysam/libcfaidx.pyx":652 | |
15822 * elif (l == -2): | |
15823 * raise ValueError('truncated quality string in {0}' | |
15824 * .format(self._filename)) # <<<<<<<<<<<<<< | |
15825 * else: | |
15826 * raise ValueError('unknown problem parsing {0}' | |
15827 */ | |
15828 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_truncated_quality_string_in_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) | |
15829 __Pyx_GOTREF(__pyx_t_2); | |
15830 __pyx_t_4 = NULL; | |
15831 __pyx_t_5 = 0; | |
15832 #if CYTHON_UNPACK_METHODS | |
15833 if (likely(PyMethod_Check(__pyx_t_2))) { | |
15834 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); | |
15835 if (likely(__pyx_t_4)) { | |
15836 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); | |
15837 __Pyx_INCREF(__pyx_t_4); | |
15838 __Pyx_INCREF(function); | |
15839 __Pyx_DECREF_SET(__pyx_t_2, function); | |
15840 __pyx_t_5 = 1; | |
15841 } | |
15842 } | |
15843 #endif | |
15844 { | |
15845 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self->_filename}; | |
15846 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
15847 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15848 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 652, __pyx_L1_error) | |
15849 __Pyx_GOTREF(__pyx_t_3); | |
15850 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
15851 } | |
15852 | |
15853 /* "pysam/libcfaidx.pyx":651 | |
15854 * raise StopIteration | |
15855 * elif (l == -2): | |
15856 * raise ValueError('truncated quality string in {0}' # <<<<<<<<<<<<<< | |
15857 * .format(self._filename)) | |
15858 * else: | |
15859 */ | |
15860 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __pyx_L1_error) | |
15861 __Pyx_GOTREF(__pyx_t_2); | |
15862 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15863 __Pyx_Raise(__pyx_t_2, 0, 0, 0); | |
15864 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
15865 __PYX_ERR(0, 651, __pyx_L1_error) | |
15866 | |
15867 /* "pysam/libcfaidx.pyx":650 | |
15868 * elif (l == -1): | |
15869 * raise StopIteration | |
15870 * elif (l == -2): # <<<<<<<<<<<<<< | |
15871 * raise ValueError('truncated quality string in {0}' | |
15872 * .format(self._filename)) | |
15873 */ | |
15874 } | |
15875 | |
15876 /* "pysam/libcfaidx.pyx":654 | |
15877 * .format(self._filename)) | |
15878 * else: | |
15879 * raise ValueError('unknown problem parsing {0}' # <<<<<<<<<<<<<< | |
15880 * .format(self._filename)) | |
15881 * | |
15882 */ | |
15883 /*else*/ { | |
15884 | |
15885 /* "pysam/libcfaidx.pyx":655 | |
15886 * else: | |
15887 * raise ValueError('unknown problem parsing {0}' | |
15888 * .format(self._filename)) # <<<<<<<<<<<<<< | |
15889 * | |
15890 * # Compatibility Layer for pysam 0.8.1 | |
15891 */ | |
15892 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unknown_problem_parsing_0, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error) | |
15893 __Pyx_GOTREF(__pyx_t_3); | |
15894 __pyx_t_4 = NULL; | |
15895 __pyx_t_5 = 0; | |
15896 #if CYTHON_UNPACK_METHODS | |
15897 if (likely(PyMethod_Check(__pyx_t_3))) { | |
15898 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
15899 if (likely(__pyx_t_4)) { | |
15900 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
15901 __Pyx_INCREF(__pyx_t_4); | |
15902 __Pyx_INCREF(function); | |
15903 __Pyx_DECREF_SET(__pyx_t_3, function); | |
15904 __pyx_t_5 = 1; | |
15905 } | |
15906 } | |
15907 #endif | |
15908 { | |
15909 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self->_filename}; | |
15910 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
15911 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
15912 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error) | |
15913 __Pyx_GOTREF(__pyx_t_2); | |
15914 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15915 } | |
15916 | |
15917 /* "pysam/libcfaidx.pyx":654 | |
15918 * .format(self._filename)) | |
15919 * else: | |
15920 * raise ValueError('unknown problem parsing {0}' # <<<<<<<<<<<<<< | |
15921 * .format(self._filename)) | |
15922 * | |
15923 */ | |
15924 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) | |
15925 __Pyx_GOTREF(__pyx_t_3); | |
15926 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
15927 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
15928 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
15929 __PYX_ERR(0, 654, __pyx_L1_error) | |
15930 } | |
15931 | |
15932 /* "pysam/libcfaidx.pyx":637 | |
15933 * return kseq_read(self.entry) | |
15934 * | |
15935 * def __next__(self): # <<<<<<<<<<<<<< | |
15936 * """ | |
15937 * python version of next(). | |
15938 */ | |
15939 | |
15940 /* function exit code */ | |
15941 __pyx_L1_error:; | |
15942 __Pyx_XDECREF(__pyx_t_2); | |
15943 __Pyx_XDECREF(__pyx_t_3); | |
15944 __Pyx_XDECREF(__pyx_t_4); | |
15945 if (!__pyx_error_without_exception) { | |
15946 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
15947 } | |
15948 __pyx_r = NULL; | |
15949 __pyx_L0:; | |
15950 __Pyx_XGIVEREF(__pyx_r); | |
15951 __Pyx_TraceReturn(__pyx_r, 0); | |
15952 __Pyx_RefNannyFinishContext(); | |
15953 return __pyx_r; | |
15954 } | |
15955 | |
15956 /* "(tree fragment)":1 | |
15957 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
15958 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
15959 * def __setstate_cython__(self, __pyx_state): | |
15960 */ | |
15961 | |
15962 /* Python wrapper */ | |
15963 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_19__reduce_cython__(PyObject *__pyx_v_self, | |
15964 #if CYTHON_METH_FASTCALL | |
15965 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
15966 #else | |
15967 PyObject *__pyx_args, PyObject *__pyx_kwds | |
15968 #endif | |
15969 ); /*proto*/ | |
15970 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastxFile_18__reduce_cython__, "FastxFile.__reduce_cython__(self)"); | |
15971 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastxFile_19__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastxFile_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastxFile_18__reduce_cython__}; | |
15972 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_19__reduce_cython__(PyObject *__pyx_v_self, | |
15973 #if CYTHON_METH_FASTCALL | |
15974 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
15975 #else | |
15976 PyObject *__pyx_args, PyObject *__pyx_kwds | |
15977 #endif | |
15978 ) { | |
15979 #if !CYTHON_METH_FASTCALL | |
15980 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
15981 #endif | |
15982 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
15983 PyObject *__pyx_r = 0; | |
15984 __Pyx_RefNannyDeclarations | |
15985 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
15986 #if !CYTHON_METH_FASTCALL | |
15987 #if CYTHON_ASSUME_SAFE_MACROS | |
15988 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
15989 #else | |
15990 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
15991 #endif | |
15992 #endif | |
15993 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
15994 if (unlikely(__pyx_nargs > 0)) { | |
15995 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
15996 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
15997 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastxFile_18__reduce_cython__(((struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)__pyx_v_self)); | |
15998 | |
15999 /* function exit code */ | |
16000 __Pyx_RefNannyFinishContext(); | |
16001 return __pyx_r; | |
16002 } | |
16003 | |
16004 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self) { | |
16005 PyObject *__pyx_r = NULL; | |
16006 __Pyx_TraceDeclarations | |
16007 __Pyx_RefNannyDeclarations | |
16008 int __pyx_lineno = 0; | |
16009 const char *__pyx_filename = NULL; | |
16010 int __pyx_clineno = 0; | |
16011 __Pyx_TraceFrameInit(__pyx_codeobj__39) | |
16012 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
16013 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
16014 | |
16015 /* "(tree fragment)":2 | |
16016 * def __reduce_cython__(self): | |
16017 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< | |
16018 * def __setstate_cython__(self, __pyx_state): | |
16019 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16020 */ | |
16021 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); | |
16022 __PYX_ERR(1, 2, __pyx_L1_error) | |
16023 | |
16024 /* "(tree fragment)":1 | |
16025 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
16026 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16027 * def __setstate_cython__(self, __pyx_state): | |
16028 */ | |
16029 | |
16030 /* function exit code */ | |
16031 __pyx_L1_error:; | |
16032 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16033 __pyx_r = NULL; | |
16034 __Pyx_XGIVEREF(__pyx_r); | |
16035 __Pyx_TraceReturn(__pyx_r, 0); | |
16036 __Pyx_RefNannyFinishContext(); | |
16037 return __pyx_r; | |
16038 } | |
16039 | |
16040 /* "(tree fragment)":3 | |
16041 * def __reduce_cython__(self): | |
16042 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16043 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
16044 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16045 */ | |
16046 | |
16047 /* Python wrapper */ | |
16048 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_21__setstate_cython__(PyObject *__pyx_v_self, | |
16049 #if CYTHON_METH_FASTCALL | |
16050 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16051 #else | |
16052 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16053 #endif | |
16054 ); /*proto*/ | |
16055 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastxFile_20__setstate_cython__, "FastxFile.__setstate_cython__(self, __pyx_state)"); | |
16056 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastxFile_21__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastxFile_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastxFile_20__setstate_cython__}; | |
16057 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastxFile_21__setstate_cython__(PyObject *__pyx_v_self, | |
16058 #if CYTHON_METH_FASTCALL | |
16059 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16060 #else | |
16061 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16062 #endif | |
16063 ) { | |
16064 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; | |
16065 #if !CYTHON_METH_FASTCALL | |
16066 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
16067 #endif | |
16068 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
16069 PyObject* values[1] = {0}; | |
16070 int __pyx_lineno = 0; | |
16071 const char *__pyx_filename = NULL; | |
16072 int __pyx_clineno = 0; | |
16073 PyObject *__pyx_r = 0; | |
16074 __Pyx_RefNannyDeclarations | |
16075 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
16076 #if !CYTHON_METH_FASTCALL | |
16077 #if CYTHON_ASSUME_SAFE_MACROS | |
16078 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
16079 #else | |
16080 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
16081 #endif | |
16082 #endif | |
16083 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
16084 { | |
16085 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
16086 if (__pyx_kwds) { | |
16087 Py_ssize_t kw_args; | |
16088 switch (__pyx_nargs) { | |
16089 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
16090 CYTHON_FALLTHROUGH; | |
16091 case 0: break; | |
16092 default: goto __pyx_L5_argtuple_error; | |
16093 } | |
16094 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
16095 switch (__pyx_nargs) { | |
16096 case 0: | |
16097 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
16098 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
16099 kw_args--; | |
16100 } | |
16101 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) | |
16102 else goto __pyx_L5_argtuple_error; | |
16103 } | |
16104 if (unlikely(kw_args > 0)) { | |
16105 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
16106 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) | |
16107 } | |
16108 } else if (unlikely(__pyx_nargs != 1)) { | |
16109 goto __pyx_L5_argtuple_error; | |
16110 } else { | |
16111 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
16112 } | |
16113 __pyx_v___pyx_state = values[0]; | |
16114 } | |
16115 goto __pyx_L6_skip; | |
16116 __pyx_L5_argtuple_error:; | |
16117 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) | |
16118 __pyx_L6_skip:; | |
16119 goto __pyx_L4_argument_unpacking_done; | |
16120 __pyx_L3_error:; | |
16121 { | |
16122 Py_ssize_t __pyx_temp; | |
16123 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
16124 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
16125 } | |
16126 } | |
16127 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16128 __Pyx_RefNannyFinishContext(); | |
16129 return NULL; | |
16130 __pyx_L4_argument_unpacking_done:; | |
16131 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastxFile_20__setstate_cython__(((struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)__pyx_v_self), __pyx_v___pyx_state); | |
16132 | |
16133 /* function exit code */ | |
16134 { | |
16135 Py_ssize_t __pyx_temp; | |
16136 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
16137 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
16138 } | |
16139 } | |
16140 __Pyx_RefNannyFinishContext(); | |
16141 return __pyx_r; | |
16142 } | |
16143 | |
16144 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastxFile_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastxFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { | |
16145 PyObject *__pyx_r = NULL; | |
16146 __Pyx_TraceDeclarations | |
16147 __Pyx_RefNannyDeclarations | |
16148 int __pyx_lineno = 0; | |
16149 const char *__pyx_filename = NULL; | |
16150 int __pyx_clineno = 0; | |
16151 __Pyx_TraceFrameInit(__pyx_codeobj__40) | |
16152 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
16153 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); | |
16154 | |
16155 /* "(tree fragment)":4 | |
16156 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16157 * def __setstate_cython__(self, __pyx_state): | |
16158 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< | |
16159 */ | |
16160 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); | |
16161 __PYX_ERR(1, 4, __pyx_L1_error) | |
16162 | |
16163 /* "(tree fragment)":3 | |
16164 * def __reduce_cython__(self): | |
16165 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16166 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
16167 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16168 */ | |
16169 | |
16170 /* function exit code */ | |
16171 __pyx_L1_error:; | |
16172 __Pyx_AddTraceback("pysam.libcfaidx.FastxFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16173 __pyx_r = NULL; | |
16174 __Pyx_XGIVEREF(__pyx_r); | |
16175 __Pyx_TraceReturn(__pyx_r, 0); | |
16176 __Pyx_RefNannyFinishContext(); | |
16177 return __pyx_r; | |
16178 } | |
16179 | |
16180 /* "(tree fragment)":1 | |
16181 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
16182 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16183 * def __setstate_cython__(self, __pyx_state): | |
16184 */ | |
16185 | |
16186 /* Python wrapper */ | |
16187 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastqFile_1__reduce_cython__(PyObject *__pyx_v_self, | |
16188 #if CYTHON_METH_FASTCALL | |
16189 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16190 #else | |
16191 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16192 #endif | |
16193 ); /*proto*/ | |
16194 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastqFile___reduce_cython__, "FastqFile.__reduce_cython__(self)"); | |
16195 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastqFile_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastqFile_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastqFile___reduce_cython__}; | |
16196 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastqFile_1__reduce_cython__(PyObject *__pyx_v_self, | |
16197 #if CYTHON_METH_FASTCALL | |
16198 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16199 #else | |
16200 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16201 #endif | |
16202 ) { | |
16203 #if !CYTHON_METH_FASTCALL | |
16204 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
16205 #endif | |
16206 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
16207 PyObject *__pyx_r = 0; | |
16208 __Pyx_RefNannyDeclarations | |
16209 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
16210 #if !CYTHON_METH_FASTCALL | |
16211 #if CYTHON_ASSUME_SAFE_MACROS | |
16212 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
16213 #else | |
16214 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
16215 #endif | |
16216 #endif | |
16217 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
16218 if (unlikely(__pyx_nargs > 0)) { | |
16219 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
16220 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
16221 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastqFile___reduce_cython__(((struct __pyx_obj_5pysam_9libcfaidx_FastqFile *)__pyx_v_self)); | |
16222 | |
16223 /* function exit code */ | |
16224 __Pyx_RefNannyFinishContext(); | |
16225 return __pyx_r; | |
16226 } | |
16227 | |
16228 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastqFile___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastqFile *__pyx_v_self) { | |
16229 PyObject *__pyx_r = NULL; | |
16230 __Pyx_TraceDeclarations | |
16231 __Pyx_RefNannyDeclarations | |
16232 int __pyx_lineno = 0; | |
16233 const char *__pyx_filename = NULL; | |
16234 int __pyx_clineno = 0; | |
16235 __Pyx_TraceFrameInit(__pyx_codeobj__41) | |
16236 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
16237 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
16238 | |
16239 /* "(tree fragment)":2 | |
16240 * def __reduce_cython__(self): | |
16241 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< | |
16242 * def __setstate_cython__(self, __pyx_state): | |
16243 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16244 */ | |
16245 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); | |
16246 __PYX_ERR(1, 2, __pyx_L1_error) | |
16247 | |
16248 /* "(tree fragment)":1 | |
16249 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
16250 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16251 * def __setstate_cython__(self, __pyx_state): | |
16252 */ | |
16253 | |
16254 /* function exit code */ | |
16255 __pyx_L1_error:; | |
16256 __Pyx_AddTraceback("pysam.libcfaidx.FastqFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16257 __pyx_r = NULL; | |
16258 __Pyx_XGIVEREF(__pyx_r); | |
16259 __Pyx_TraceReturn(__pyx_r, 0); | |
16260 __Pyx_RefNannyFinishContext(); | |
16261 return __pyx_r; | |
16262 } | |
16263 | |
16264 /* "(tree fragment)":3 | |
16265 * def __reduce_cython__(self): | |
16266 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16267 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
16268 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16269 */ | |
16270 | |
16271 /* Python wrapper */ | |
16272 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastqFile_3__setstate_cython__(PyObject *__pyx_v_self, | |
16273 #if CYTHON_METH_FASTCALL | |
16274 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16275 #else | |
16276 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16277 #endif | |
16278 ); /*proto*/ | |
16279 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9FastqFile_2__setstate_cython__, "FastqFile.__setstate_cython__(self, __pyx_state)"); | |
16280 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9FastqFile_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastqFile_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastqFile_2__setstate_cython__}; | |
16281 static PyObject *__pyx_pw_5pysam_9libcfaidx_9FastqFile_3__setstate_cython__(PyObject *__pyx_v_self, | |
16282 #if CYTHON_METH_FASTCALL | |
16283 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16284 #else | |
16285 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16286 #endif | |
16287 ) { | |
16288 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; | |
16289 #if !CYTHON_METH_FASTCALL | |
16290 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
16291 #endif | |
16292 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
16293 PyObject* values[1] = {0}; | |
16294 int __pyx_lineno = 0; | |
16295 const char *__pyx_filename = NULL; | |
16296 int __pyx_clineno = 0; | |
16297 PyObject *__pyx_r = 0; | |
16298 __Pyx_RefNannyDeclarations | |
16299 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
16300 #if !CYTHON_METH_FASTCALL | |
16301 #if CYTHON_ASSUME_SAFE_MACROS | |
16302 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
16303 #else | |
16304 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
16305 #endif | |
16306 #endif | |
16307 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
16308 { | |
16309 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
16310 if (__pyx_kwds) { | |
16311 Py_ssize_t kw_args; | |
16312 switch (__pyx_nargs) { | |
16313 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
16314 CYTHON_FALLTHROUGH; | |
16315 case 0: break; | |
16316 default: goto __pyx_L5_argtuple_error; | |
16317 } | |
16318 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
16319 switch (__pyx_nargs) { | |
16320 case 0: | |
16321 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
16322 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
16323 kw_args--; | |
16324 } | |
16325 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) | |
16326 else goto __pyx_L5_argtuple_error; | |
16327 } | |
16328 if (unlikely(kw_args > 0)) { | |
16329 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
16330 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) | |
16331 } | |
16332 } else if (unlikely(__pyx_nargs != 1)) { | |
16333 goto __pyx_L5_argtuple_error; | |
16334 } else { | |
16335 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
16336 } | |
16337 __pyx_v___pyx_state = values[0]; | |
16338 } | |
16339 goto __pyx_L6_skip; | |
16340 __pyx_L5_argtuple_error:; | |
16341 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) | |
16342 __pyx_L6_skip:; | |
16343 goto __pyx_L4_argument_unpacking_done; | |
16344 __pyx_L3_error:; | |
16345 { | |
16346 Py_ssize_t __pyx_temp; | |
16347 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
16348 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
16349 } | |
16350 } | |
16351 __Pyx_AddTraceback("pysam.libcfaidx.FastqFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16352 __Pyx_RefNannyFinishContext(); | |
16353 return NULL; | |
16354 __pyx_L4_argument_unpacking_done:; | |
16355 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9FastqFile_2__setstate_cython__(((struct __pyx_obj_5pysam_9libcfaidx_FastqFile *)__pyx_v_self), __pyx_v___pyx_state); | |
16356 | |
16357 /* function exit code */ | |
16358 { | |
16359 Py_ssize_t __pyx_temp; | |
16360 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
16361 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
16362 } | |
16363 } | |
16364 __Pyx_RefNannyFinishContext(); | |
16365 return __pyx_r; | |
16366 } | |
16367 | |
16368 static PyObject *__pyx_pf_5pysam_9libcfaidx_9FastqFile_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_FastqFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { | |
16369 PyObject *__pyx_r = NULL; | |
16370 __Pyx_TraceDeclarations | |
16371 __Pyx_RefNannyDeclarations | |
16372 int __pyx_lineno = 0; | |
16373 const char *__pyx_filename = NULL; | |
16374 int __pyx_clineno = 0; | |
16375 __Pyx_TraceFrameInit(__pyx_codeobj__42) | |
16376 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
16377 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); | |
16378 | |
16379 /* "(tree fragment)":4 | |
16380 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16381 * def __setstate_cython__(self, __pyx_state): | |
16382 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< | |
16383 */ | |
16384 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); | |
16385 __PYX_ERR(1, 4, __pyx_L1_error) | |
16386 | |
16387 /* "(tree fragment)":3 | |
16388 * def __reduce_cython__(self): | |
16389 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16390 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
16391 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16392 */ | |
16393 | |
16394 /* function exit code */ | |
16395 __pyx_L1_error:; | |
16396 __Pyx_AddTraceback("pysam.libcfaidx.FastqFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16397 __pyx_r = NULL; | |
16398 __Pyx_XGIVEREF(__pyx_r); | |
16399 __Pyx_TraceReturn(__pyx_r, 0); | |
16400 __Pyx_RefNannyFinishContext(); | |
16401 return __pyx_r; | |
16402 } | |
16403 | |
16404 /* "(tree fragment)":1 | |
16405 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
16406 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16407 * def __setstate_cython__(self, __pyx_state): | |
16408 */ | |
16409 | |
16410 /* Python wrapper */ | |
16411 static PyObject *__pyx_pw_5pysam_9libcfaidx_9Fastafile_1__reduce_cython__(PyObject *__pyx_v_self, | |
16412 #if CYTHON_METH_FASTCALL | |
16413 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16414 #else | |
16415 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16416 #endif | |
16417 ); /*proto*/ | |
16418 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9Fastafile___reduce_cython__, "Fastafile.__reduce_cython__(self)"); | |
16419 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9Fastafile_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9Fastafile_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9Fastafile___reduce_cython__}; | |
16420 static PyObject *__pyx_pw_5pysam_9libcfaidx_9Fastafile_1__reduce_cython__(PyObject *__pyx_v_self, | |
16421 #if CYTHON_METH_FASTCALL | |
16422 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16423 #else | |
16424 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16425 #endif | |
16426 ) { | |
16427 #if !CYTHON_METH_FASTCALL | |
16428 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
16429 #endif | |
16430 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
16431 PyObject *__pyx_r = 0; | |
16432 __Pyx_RefNannyDeclarations | |
16433 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); | |
16434 #if !CYTHON_METH_FASTCALL | |
16435 #if CYTHON_ASSUME_SAFE_MACROS | |
16436 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
16437 #else | |
16438 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
16439 #endif | |
16440 #endif | |
16441 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
16442 if (unlikely(__pyx_nargs > 0)) { | |
16443 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} | |
16444 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; | |
16445 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9Fastafile___reduce_cython__(((struct __pyx_obj_5pysam_9libcfaidx_Fastafile *)__pyx_v_self)); | |
16446 | |
16447 /* function exit code */ | |
16448 __Pyx_RefNannyFinishContext(); | |
16449 return __pyx_r; | |
16450 } | |
16451 | |
16452 static PyObject *__pyx_pf_5pysam_9libcfaidx_9Fastafile___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_Fastafile *__pyx_v_self) { | |
16453 PyObject *__pyx_r = NULL; | |
16454 __Pyx_TraceDeclarations | |
16455 __Pyx_RefNannyDeclarations | |
16456 int __pyx_lineno = 0; | |
16457 const char *__pyx_filename = NULL; | |
16458 int __pyx_clineno = 0; | |
16459 __Pyx_TraceFrameInit(__pyx_codeobj__43) | |
16460 __Pyx_RefNannySetupContext("__reduce_cython__", 1); | |
16461 __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
16462 | |
16463 /* "(tree fragment)":2 | |
16464 * def __reduce_cython__(self): | |
16465 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< | |
16466 * def __setstate_cython__(self, __pyx_state): | |
16467 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16468 */ | |
16469 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); | |
16470 __PYX_ERR(1, 2, __pyx_L1_error) | |
16471 | |
16472 /* "(tree fragment)":1 | |
16473 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
16474 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16475 * def __setstate_cython__(self, __pyx_state): | |
16476 */ | |
16477 | |
16478 /* function exit code */ | |
16479 __pyx_L1_error:; | |
16480 __Pyx_AddTraceback("pysam.libcfaidx.Fastafile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16481 __pyx_r = NULL; | |
16482 __Pyx_XGIVEREF(__pyx_r); | |
16483 __Pyx_TraceReturn(__pyx_r, 0); | |
16484 __Pyx_RefNannyFinishContext(); | |
16485 return __pyx_r; | |
16486 } | |
16487 | |
16488 /* "(tree fragment)":3 | |
16489 * def __reduce_cython__(self): | |
16490 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16491 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
16492 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16493 */ | |
16494 | |
16495 /* Python wrapper */ | |
16496 static PyObject *__pyx_pw_5pysam_9libcfaidx_9Fastafile_3__setstate_cython__(PyObject *__pyx_v_self, | |
16497 #if CYTHON_METH_FASTCALL | |
16498 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16499 #else | |
16500 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16501 #endif | |
16502 ); /*proto*/ | |
16503 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx_9Fastafile_2__setstate_cython__, "Fastafile.__setstate_cython__(self, __pyx_state)"); | |
16504 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_9Fastafile_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9Fastafile_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9Fastafile_2__setstate_cython__}; | |
16505 static PyObject *__pyx_pw_5pysam_9libcfaidx_9Fastafile_3__setstate_cython__(PyObject *__pyx_v_self, | |
16506 #if CYTHON_METH_FASTCALL | |
16507 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16508 #else | |
16509 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16510 #endif | |
16511 ) { | |
16512 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; | |
16513 #if !CYTHON_METH_FASTCALL | |
16514 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
16515 #endif | |
16516 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
16517 PyObject* values[1] = {0}; | |
16518 int __pyx_lineno = 0; | |
16519 const char *__pyx_filename = NULL; | |
16520 int __pyx_clineno = 0; | |
16521 PyObject *__pyx_r = 0; | |
16522 __Pyx_RefNannyDeclarations | |
16523 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); | |
16524 #if !CYTHON_METH_FASTCALL | |
16525 #if CYTHON_ASSUME_SAFE_MACROS | |
16526 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
16527 #else | |
16528 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
16529 #endif | |
16530 #endif | |
16531 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
16532 { | |
16533 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; | |
16534 if (__pyx_kwds) { | |
16535 Py_ssize_t kw_args; | |
16536 switch (__pyx_nargs) { | |
16537 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
16538 CYTHON_FALLTHROUGH; | |
16539 case 0: break; | |
16540 default: goto __pyx_L5_argtuple_error; | |
16541 } | |
16542 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
16543 switch (__pyx_nargs) { | |
16544 case 0: | |
16545 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
16546 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
16547 kw_args--; | |
16548 } | |
16549 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error) | |
16550 else goto __pyx_L5_argtuple_error; | |
16551 } | |
16552 if (unlikely(kw_args > 0)) { | |
16553 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
16554 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) | |
16555 } | |
16556 } else if (unlikely(__pyx_nargs != 1)) { | |
16557 goto __pyx_L5_argtuple_error; | |
16558 } else { | |
16559 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
16560 } | |
16561 __pyx_v___pyx_state = values[0]; | |
16562 } | |
16563 goto __pyx_L6_skip; | |
16564 __pyx_L5_argtuple_error:; | |
16565 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error) | |
16566 __pyx_L6_skip:; | |
16567 goto __pyx_L4_argument_unpacking_done; | |
16568 __pyx_L3_error:; | |
16569 { | |
16570 Py_ssize_t __pyx_temp; | |
16571 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
16572 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
16573 } | |
16574 } | |
16575 __Pyx_AddTraceback("pysam.libcfaidx.Fastafile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16576 __Pyx_RefNannyFinishContext(); | |
16577 return NULL; | |
16578 __pyx_L4_argument_unpacking_done:; | |
16579 __pyx_r = __pyx_pf_5pysam_9libcfaidx_9Fastafile_2__setstate_cython__(((struct __pyx_obj_5pysam_9libcfaidx_Fastafile *)__pyx_v_self), __pyx_v___pyx_state); | |
16580 | |
16581 /* function exit code */ | |
16582 { | |
16583 Py_ssize_t __pyx_temp; | |
16584 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
16585 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
16586 } | |
16587 } | |
16588 __Pyx_RefNannyFinishContext(); | |
16589 return __pyx_r; | |
16590 } | |
16591 | |
16592 static PyObject *__pyx_pf_5pysam_9libcfaidx_9Fastafile_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_9libcfaidx_Fastafile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { | |
16593 PyObject *__pyx_r = NULL; | |
16594 __Pyx_TraceDeclarations | |
16595 __Pyx_RefNannyDeclarations | |
16596 int __pyx_lineno = 0; | |
16597 const char *__pyx_filename = NULL; | |
16598 int __pyx_clineno = 0; | |
16599 __Pyx_TraceFrameInit(__pyx_codeobj__44) | |
16600 __Pyx_RefNannySetupContext("__setstate_cython__", 1); | |
16601 __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error)); | |
16602 | |
16603 /* "(tree fragment)":4 | |
16604 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16605 * def __setstate_cython__(self, __pyx_state): | |
16606 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< | |
16607 */ | |
16608 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); | |
16609 __PYX_ERR(1, 4, __pyx_L1_error) | |
16610 | |
16611 /* "(tree fragment)":3 | |
16612 * def __reduce_cython__(self): | |
16613 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16614 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
16615 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
16616 */ | |
16617 | |
16618 /* function exit code */ | |
16619 __pyx_L1_error:; | |
16620 __Pyx_AddTraceback("pysam.libcfaidx.Fastafile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16621 __pyx_r = NULL; | |
16622 __Pyx_XGIVEREF(__pyx_r); | |
16623 __Pyx_TraceReturn(__pyx_r, 0); | |
16624 __Pyx_RefNannyFinishContext(); | |
16625 return __pyx_r; | |
16626 } | |
16627 | |
16628 /* "(tree fragment)":1 | |
16629 * def __pyx_unpickle_FastxRecord(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
16630 * cdef object __pyx_PickleError | |
16631 * cdef object __pyx_result | |
16632 */ | |
16633 | |
16634 /* Python wrapper */ | |
16635 static PyObject *__pyx_pw_5pysam_9libcfaidx_1__pyx_unpickle_FastxRecord(PyObject *__pyx_self, | |
16636 #if CYTHON_METH_FASTCALL | |
16637 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16638 #else | |
16639 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16640 #endif | |
16641 ); /*proto*/ | |
16642 PyDoc_STRVAR(__pyx_doc_5pysam_9libcfaidx___pyx_unpickle_FastxRecord, "__pyx_unpickle_FastxRecord(__pyx_type, long __pyx_checksum, __pyx_state)"); | |
16643 static PyMethodDef __pyx_mdef_5pysam_9libcfaidx_1__pyx_unpickle_FastxRecord = {"__pyx_unpickle_FastxRecord", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_1__pyx_unpickle_FastxRecord, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx___pyx_unpickle_FastxRecord}; | |
16644 static PyObject *__pyx_pw_5pysam_9libcfaidx_1__pyx_unpickle_FastxRecord(PyObject *__pyx_self, | |
16645 #if CYTHON_METH_FASTCALL | |
16646 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds | |
16647 #else | |
16648 PyObject *__pyx_args, PyObject *__pyx_kwds | |
16649 #endif | |
16650 ) { | |
16651 PyObject *__pyx_v___pyx_type = 0; | |
16652 long __pyx_v___pyx_checksum; | |
16653 PyObject *__pyx_v___pyx_state = 0; | |
16654 #if !CYTHON_METH_FASTCALL | |
16655 CYTHON_UNUSED Py_ssize_t __pyx_nargs; | |
16656 #endif | |
16657 CYTHON_UNUSED PyObject *const *__pyx_kwvalues; | |
16658 PyObject* values[3] = {0,0,0}; | |
16659 int __pyx_lineno = 0; | |
16660 const char *__pyx_filename = NULL; | |
16661 int __pyx_clineno = 0; | |
16662 PyObject *__pyx_r = 0; | |
16663 __Pyx_RefNannyDeclarations | |
16664 __Pyx_RefNannySetupContext("__pyx_unpickle_FastxRecord (wrapper)", 0); | |
16665 #if !CYTHON_METH_FASTCALL | |
16666 #if CYTHON_ASSUME_SAFE_MACROS | |
16667 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); | |
16668 #else | |
16669 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; | |
16670 #endif | |
16671 #endif | |
16672 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); | |
16673 { | |
16674 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; | |
16675 if (__pyx_kwds) { | |
16676 Py_ssize_t kw_args; | |
16677 switch (__pyx_nargs) { | |
16678 case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
16679 CYTHON_FALLTHROUGH; | |
16680 case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
16681 CYTHON_FALLTHROUGH; | |
16682 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
16683 CYTHON_FALLTHROUGH; | |
16684 case 0: break; | |
16685 default: goto __pyx_L5_argtuple_error; | |
16686 } | |
16687 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); | |
16688 switch (__pyx_nargs) { | |
16689 case 0: | |
16690 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { | |
16691 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); | |
16692 kw_args--; | |
16693 } | |
16694 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
16695 else goto __pyx_L5_argtuple_error; | |
16696 CYTHON_FALLTHROUGH; | |
16697 case 1: | |
16698 if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { | |
16699 (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); | |
16700 kw_args--; | |
16701 } | |
16702 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
16703 else { | |
16704 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FastxRecord", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) | |
16705 } | |
16706 CYTHON_FALLTHROUGH; | |
16707 case 2: | |
16708 if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { | |
16709 (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); | |
16710 kw_args--; | |
16711 } | |
16712 else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) | |
16713 else { | |
16714 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FastxRecord", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) | |
16715 } | |
16716 } | |
16717 if (unlikely(kw_args > 0)) { | |
16718 const Py_ssize_t kwd_pos_args = __pyx_nargs; | |
16719 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_FastxRecord") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) | |
16720 } | |
16721 } else if (unlikely(__pyx_nargs != 3)) { | |
16722 goto __pyx_L5_argtuple_error; | |
16723 } else { | |
16724 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); | |
16725 values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); | |
16726 values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); | |
16727 } | |
16728 __pyx_v___pyx_type = values[0]; | |
16729 __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) | |
16730 __pyx_v___pyx_state = values[2]; | |
16731 } | |
16732 goto __pyx_L6_skip; | |
16733 __pyx_L5_argtuple_error:; | |
16734 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FastxRecord", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error) | |
16735 __pyx_L6_skip:; | |
16736 goto __pyx_L4_argument_unpacking_done; | |
16737 __pyx_L3_error:; | |
16738 { | |
16739 Py_ssize_t __pyx_temp; | |
16740 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
16741 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
16742 } | |
16743 } | |
16744 __Pyx_AddTraceback("pysam.libcfaidx.__pyx_unpickle_FastxRecord", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16745 __Pyx_RefNannyFinishContext(); | |
16746 return NULL; | |
16747 __pyx_L4_argument_unpacking_done:; | |
16748 __pyx_r = __pyx_pf_5pysam_9libcfaidx___pyx_unpickle_FastxRecord(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); | |
16749 | |
16750 /* function exit code */ | |
16751 { | |
16752 Py_ssize_t __pyx_temp; | |
16753 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { | |
16754 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); | |
16755 } | |
16756 } | |
16757 __Pyx_RefNannyFinishContext(); | |
16758 return __pyx_r; | |
16759 } | |
16760 | |
16761 static PyObject *__pyx_pf_5pysam_9libcfaidx___pyx_unpickle_FastxRecord(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { | |
16762 PyObject *__pyx_v___pyx_PickleError = 0; | |
16763 PyObject *__pyx_v___pyx_result = 0; | |
16764 PyObject *__pyx_r = NULL; | |
16765 __Pyx_TraceDeclarations | |
16766 __Pyx_RefNannyDeclarations | |
16767 PyObject *__pyx_t_1 = NULL; | |
16768 int __pyx_t_2; | |
16769 PyObject *__pyx_t_3 = NULL; | |
16770 PyObject *__pyx_t_4 = NULL; | |
16771 unsigned int __pyx_t_5; | |
16772 int __pyx_lineno = 0; | |
16773 const char *__pyx_filename = NULL; | |
16774 int __pyx_clineno = 0; | |
16775 __Pyx_TraceFrameInit(__pyx_codeobj__45) | |
16776 __Pyx_RefNannySetupContext("__pyx_unpickle_FastxRecord", 1); | |
16777 __Pyx_TraceCall("__pyx_unpickle_FastxRecord", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error)); | |
16778 | |
16779 /* "(tree fragment)":4 | |
16780 * cdef object __pyx_PickleError | |
16781 * cdef object __pyx_result | |
16782 * if __pyx_checksum not in (0x1bdb611, 0xb688a86, 0x43fd151): # <<<<<<<<<<<<<< | |
16783 * from pickle import PickleError as __pyx_PickleError | |
16784 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x1bdb611, 0xb688a86, 0x43fd151) = (comment, name, quality, sequence))" % __pyx_checksum | |
16785 */ | |
16786 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) | |
16787 __Pyx_GOTREF(__pyx_t_1); | |
16788 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__46, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error) | |
16789 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16790 if (__pyx_t_2) { | |
16791 | |
16792 /* "(tree fragment)":5 | |
16793 * cdef object __pyx_result | |
16794 * if __pyx_checksum not in (0x1bdb611, 0xb688a86, 0x43fd151): | |
16795 * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< | |
16796 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x1bdb611, 0xb688a86, 0x43fd151) = (comment, name, quality, sequence))" % __pyx_checksum | |
16797 * __pyx_result = FastxRecord.__new__(__pyx_type) | |
16798 */ | |
16799 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
16800 __Pyx_GOTREF(__pyx_t_1); | |
16801 __Pyx_INCREF(__pyx_n_s_PickleError); | |
16802 __Pyx_GIVEREF(__pyx_n_s_PickleError); | |
16803 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error); | |
16804 __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) | |
16805 __Pyx_GOTREF(__pyx_t_3); | |
16806 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16807 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) | |
16808 __Pyx_GOTREF(__pyx_t_1); | |
16809 __Pyx_INCREF(__pyx_t_1); | |
16810 __pyx_v___pyx_PickleError = __pyx_t_1; | |
16811 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16812 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
16813 | |
16814 /* "(tree fragment)":6 | |
16815 * if __pyx_checksum not in (0x1bdb611, 0xb688a86, 0x43fd151): | |
16816 * from pickle import PickleError as __pyx_PickleError | |
16817 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x1bdb611, 0xb688a86, 0x43fd151) = (comment, name, quality, sequence))" % __pyx_checksum # <<<<<<<<<<<<<< | |
16818 * __pyx_result = FastxRecord.__new__(__pyx_type) | |
16819 * if __pyx_state is not None: | |
16820 */ | |
16821 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) | |
16822 __Pyx_GOTREF(__pyx_t_3); | |
16823 __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) | |
16824 __Pyx_GOTREF(__pyx_t_1); | |
16825 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
16826 __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); | |
16827 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16828 __PYX_ERR(1, 6, __pyx_L1_error) | |
16829 | |
16830 /* "(tree fragment)":4 | |
16831 * cdef object __pyx_PickleError | |
16832 * cdef object __pyx_result | |
16833 * if __pyx_checksum not in (0x1bdb611, 0xb688a86, 0x43fd151): # <<<<<<<<<<<<<< | |
16834 * from pickle import PickleError as __pyx_PickleError | |
16835 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x1bdb611, 0xb688a86, 0x43fd151) = (comment, name, quality, sequence))" % __pyx_checksum | |
16836 */ | |
16837 } | |
16838 | |
16839 /* "(tree fragment)":7 | |
16840 * from pickle import PickleError as __pyx_PickleError | |
16841 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x1bdb611, 0xb688a86, 0x43fd151) = (comment, name, quality, sequence))" % __pyx_checksum | |
16842 * __pyx_result = FastxRecord.__new__(__pyx_type) # <<<<<<<<<<<<<< | |
16843 * if __pyx_state is not None: | |
16844 * __pyx_unpickle_FastxRecord__set_state(<FastxRecord> __pyx_result, __pyx_state) | |
16845 */ | |
16846 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxRecord), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) | |
16847 __Pyx_GOTREF(__pyx_t_3); | |
16848 __pyx_t_4 = NULL; | |
16849 __pyx_t_5 = 0; | |
16850 #if CYTHON_UNPACK_METHODS | |
16851 if (likely(PyMethod_Check(__pyx_t_3))) { | |
16852 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); | |
16853 if (likely(__pyx_t_4)) { | |
16854 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); | |
16855 __Pyx_INCREF(__pyx_t_4); | |
16856 __Pyx_INCREF(function); | |
16857 __Pyx_DECREF_SET(__pyx_t_3, function); | |
16858 __pyx_t_5 = 1; | |
16859 } | |
16860 } | |
16861 #endif | |
16862 { | |
16863 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; | |
16864 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); | |
16865 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; | |
16866 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error) | |
16867 __Pyx_GOTREF(__pyx_t_1); | |
16868 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
16869 } | |
16870 __pyx_v___pyx_result = __pyx_t_1; | |
16871 __pyx_t_1 = 0; | |
16872 | |
16873 /* "(tree fragment)":8 | |
16874 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x1bdb611, 0xb688a86, 0x43fd151) = (comment, name, quality, sequence))" % __pyx_checksum | |
16875 * __pyx_result = FastxRecord.__new__(__pyx_type) | |
16876 * if __pyx_state is not None: # <<<<<<<<<<<<<< | |
16877 * __pyx_unpickle_FastxRecord__set_state(<FastxRecord> __pyx_result, __pyx_state) | |
16878 * return __pyx_result | |
16879 */ | |
16880 __pyx_t_2 = (__pyx_v___pyx_state != Py_None); | |
16881 if (__pyx_t_2) { | |
16882 | |
16883 /* "(tree fragment)":9 | |
16884 * __pyx_result = FastxRecord.__new__(__pyx_type) | |
16885 * if __pyx_state is not None: | |
16886 * __pyx_unpickle_FastxRecord__set_state(<FastxRecord> __pyx_result, __pyx_state) # <<<<<<<<<<<<<< | |
16887 * return __pyx_result | |
16888 * cdef __pyx_unpickle_FastxRecord__set_state(FastxRecord __pyx_result, tuple __pyx_state): | |
16889 */ | |
16890 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) | |
16891 __pyx_t_1 = __pyx_f_5pysam_9libcfaidx___pyx_unpickle_FastxRecord__set_state(((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) | |
16892 __Pyx_GOTREF(__pyx_t_1); | |
16893 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
16894 | |
16895 /* "(tree fragment)":8 | |
16896 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x1bdb611, 0xb688a86, 0x43fd151) = (comment, name, quality, sequence))" % __pyx_checksum | |
16897 * __pyx_result = FastxRecord.__new__(__pyx_type) | |
16898 * if __pyx_state is not None: # <<<<<<<<<<<<<< | |
16899 * __pyx_unpickle_FastxRecord__set_state(<FastxRecord> __pyx_result, __pyx_state) | |
16900 * return __pyx_result | |
16901 */ | |
16902 } | |
16903 | |
16904 /* "(tree fragment)":10 | |
16905 * if __pyx_state is not None: | |
16906 * __pyx_unpickle_FastxRecord__set_state(<FastxRecord> __pyx_result, __pyx_state) | |
16907 * return __pyx_result # <<<<<<<<<<<<<< | |
16908 * cdef __pyx_unpickle_FastxRecord__set_state(FastxRecord __pyx_result, tuple __pyx_state): | |
16909 * __pyx_result.comment = __pyx_state[0]; __pyx_result.name = __pyx_state[1]; __pyx_result.quality = __pyx_state[2]; __pyx_result.sequence = __pyx_state[3] | |
16910 */ | |
16911 __Pyx_XDECREF(__pyx_r); | |
16912 __Pyx_INCREF(__pyx_v___pyx_result); | |
16913 __pyx_r = __pyx_v___pyx_result; | |
16914 goto __pyx_L0; | |
16915 | |
16916 /* "(tree fragment)":1 | |
16917 * def __pyx_unpickle_FastxRecord(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
16918 * cdef object __pyx_PickleError | |
16919 * cdef object __pyx_result | |
16920 */ | |
16921 | |
16922 /* function exit code */ | |
16923 __pyx_L1_error:; | |
16924 __Pyx_XDECREF(__pyx_t_1); | |
16925 __Pyx_XDECREF(__pyx_t_3); | |
16926 __Pyx_XDECREF(__pyx_t_4); | |
16927 __Pyx_AddTraceback("pysam.libcfaidx.__pyx_unpickle_FastxRecord", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
16928 __pyx_r = NULL; | |
16929 __pyx_L0:; | |
16930 __Pyx_XDECREF(__pyx_v___pyx_PickleError); | |
16931 __Pyx_XDECREF(__pyx_v___pyx_result); | |
16932 __Pyx_XGIVEREF(__pyx_r); | |
16933 __Pyx_TraceReturn(__pyx_r, 0); | |
16934 __Pyx_RefNannyFinishContext(); | |
16935 return __pyx_r; | |
16936 } | |
16937 | |
16938 /* "(tree fragment)":11 | |
16939 * __pyx_unpickle_FastxRecord__set_state(<FastxRecord> __pyx_result, __pyx_state) | |
16940 * return __pyx_result | |
16941 * cdef __pyx_unpickle_FastxRecord__set_state(FastxRecord __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
16942 * __pyx_result.comment = __pyx_state[0]; __pyx_result.name = __pyx_state[1]; __pyx_result.quality = __pyx_state[2]; __pyx_result.sequence = __pyx_state[3] | |
16943 * if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'): | |
16944 */ | |
16945 | |
16946 static PyObject *__pyx_f_5pysam_9libcfaidx___pyx_unpickle_FastxRecord__set_state(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { | |
16947 PyObject *__pyx_r = NULL; | |
16948 __Pyx_TraceDeclarations | |
16949 __Pyx_RefNannyDeclarations | |
16950 PyObject *__pyx_t_1 = NULL; | |
16951 int __pyx_t_2; | |
16952 Py_ssize_t __pyx_t_3; | |
16953 int __pyx_t_4; | |
16954 PyObject *__pyx_t_5 = NULL; | |
16955 PyObject *__pyx_t_6 = NULL; | |
16956 PyObject *__pyx_t_7 = NULL; | |
16957 unsigned int __pyx_t_8; | |
16958 int __pyx_lineno = 0; | |
16959 const char *__pyx_filename = NULL; | |
16960 int __pyx_clineno = 0; | |
16961 __Pyx_RefNannySetupContext("__pyx_unpickle_FastxRecord__set_state", 1); | |
16962 __Pyx_TraceCall("__pyx_unpickle_FastxRecord__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error)); | |
16963 | |
16964 /* "(tree fragment)":12 | |
16965 * return __pyx_result | |
16966 * cdef __pyx_unpickle_FastxRecord__set_state(FastxRecord __pyx_result, tuple __pyx_state): | |
16967 * __pyx_result.comment = __pyx_state[0]; __pyx_result.name = __pyx_state[1]; __pyx_result.quality = __pyx_state[2]; __pyx_result.sequence = __pyx_state[3] # <<<<<<<<<<<<<< | |
16968 * if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'): | |
16969 * __pyx_result.__dict__.update(__pyx_state[4]) | |
16970 */ | |
16971 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
16972 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
16973 __PYX_ERR(1, 12, __pyx_L1_error) | |
16974 } | |
16975 __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) | |
16976 __Pyx_GOTREF(__pyx_t_1); | |
16977 if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(1, 12, __pyx_L1_error) | |
16978 __Pyx_GIVEREF(__pyx_t_1); | |
16979 __Pyx_GOTREF(__pyx_v___pyx_result->comment); | |
16980 __Pyx_DECREF(__pyx_v___pyx_result->comment); | |
16981 __pyx_v___pyx_result->comment = ((PyObject*)__pyx_t_1); | |
16982 __pyx_t_1 = 0; | |
16983 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
16984 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
16985 __PYX_ERR(1, 12, __pyx_L1_error) | |
16986 } | |
16987 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) | |
16988 __Pyx_GOTREF(__pyx_t_1); | |
16989 if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(1, 12, __pyx_L1_error) | |
16990 __Pyx_GIVEREF(__pyx_t_1); | |
16991 __Pyx_GOTREF(__pyx_v___pyx_result->name); | |
16992 __Pyx_DECREF(__pyx_v___pyx_result->name); | |
16993 __pyx_v___pyx_result->name = ((PyObject*)__pyx_t_1); | |
16994 __pyx_t_1 = 0; | |
16995 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
16996 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
16997 __PYX_ERR(1, 12, __pyx_L1_error) | |
16998 } | |
16999 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) | |
17000 __Pyx_GOTREF(__pyx_t_1); | |
17001 if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(1, 12, __pyx_L1_error) | |
17002 __Pyx_GIVEREF(__pyx_t_1); | |
17003 __Pyx_GOTREF(__pyx_v___pyx_result->quality); | |
17004 __Pyx_DECREF(__pyx_v___pyx_result->quality); | |
17005 __pyx_v___pyx_result->quality = ((PyObject*)__pyx_t_1); | |
17006 __pyx_t_1 = 0; | |
17007 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
17008 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
17009 __PYX_ERR(1, 12, __pyx_L1_error) | |
17010 } | |
17011 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) | |
17012 __Pyx_GOTREF(__pyx_t_1); | |
17013 if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(1, 12, __pyx_L1_error) | |
17014 __Pyx_GIVEREF(__pyx_t_1); | |
17015 __Pyx_GOTREF(__pyx_v___pyx_result->sequence); | |
17016 __Pyx_DECREF(__pyx_v___pyx_result->sequence); | |
17017 __pyx_v___pyx_result->sequence = ((PyObject*)__pyx_t_1); | |
17018 __pyx_t_1 = 0; | |
17019 | |
17020 /* "(tree fragment)":13 | |
17021 * cdef __pyx_unpickle_FastxRecord__set_state(FastxRecord __pyx_result, tuple __pyx_state): | |
17022 * __pyx_result.comment = __pyx_state[0]; __pyx_result.name = __pyx_state[1]; __pyx_result.quality = __pyx_state[2]; __pyx_result.sequence = __pyx_state[3] | |
17023 * if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< | |
17024 * __pyx_result.__dict__.update(__pyx_state[4]) | |
17025 */ | |
17026 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
17027 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); | |
17028 __PYX_ERR(1, 13, __pyx_L1_error) | |
17029 } | |
17030 __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) | |
17031 __pyx_t_4 = (__pyx_t_3 > 4); | |
17032 if (__pyx_t_4) { | |
17033 } else { | |
17034 __pyx_t_2 = __pyx_t_4; | |
17035 goto __pyx_L4_bool_binop_done; | |
17036 } | |
17037 __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) | |
17038 __pyx_t_2 = __pyx_t_4; | |
17039 __pyx_L4_bool_binop_done:; | |
17040 if (__pyx_t_2) { | |
17041 | |
17042 /* "(tree fragment)":14 | |
17043 * __pyx_result.comment = __pyx_state[0]; __pyx_result.name = __pyx_state[1]; __pyx_result.quality = __pyx_state[2]; __pyx_result.sequence = __pyx_state[3] | |
17044 * if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'): | |
17045 * __pyx_result.__dict__.update(__pyx_state[4]) # <<<<<<<<<<<<<< | |
17046 */ | |
17047 __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) | |
17048 __Pyx_GOTREF(__pyx_t_5); | |
17049 __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) | |
17050 __Pyx_GOTREF(__pyx_t_6); | |
17051 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
17052 if (unlikely(__pyx_v___pyx_state == Py_None)) { | |
17053 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); | |
17054 __PYX_ERR(1, 14, __pyx_L1_error) | |
17055 } | |
17056 __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error) | |
17057 __Pyx_GOTREF(__pyx_t_5); | |
17058 __pyx_t_7 = NULL; | |
17059 __pyx_t_8 = 0; | |
17060 #if CYTHON_UNPACK_METHODS | |
17061 if (likely(PyMethod_Check(__pyx_t_6))) { | |
17062 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); | |
17063 if (likely(__pyx_t_7)) { | |
17064 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); | |
17065 __Pyx_INCREF(__pyx_t_7); | |
17066 __Pyx_INCREF(function); | |
17067 __Pyx_DECREF_SET(__pyx_t_6, function); | |
17068 __pyx_t_8 = 1; | |
17069 } | |
17070 } | |
17071 #endif | |
17072 { | |
17073 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; | |
17074 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); | |
17075 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; | |
17076 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
17077 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) | |
17078 __Pyx_GOTREF(__pyx_t_1); | |
17079 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; | |
17080 } | |
17081 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
17082 | |
17083 /* "(tree fragment)":13 | |
17084 * cdef __pyx_unpickle_FastxRecord__set_state(FastxRecord __pyx_result, tuple __pyx_state): | |
17085 * __pyx_result.comment = __pyx_state[0]; __pyx_result.name = __pyx_state[1]; __pyx_result.quality = __pyx_state[2]; __pyx_result.sequence = __pyx_state[3] | |
17086 * if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< | |
17087 * __pyx_result.__dict__.update(__pyx_state[4]) | |
17088 */ | |
17089 } | |
17090 | |
17091 /* "(tree fragment)":11 | |
17092 * __pyx_unpickle_FastxRecord__set_state(<FastxRecord> __pyx_result, __pyx_state) | |
17093 * return __pyx_result | |
17094 * cdef __pyx_unpickle_FastxRecord__set_state(FastxRecord __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< | |
17095 * __pyx_result.comment = __pyx_state[0]; __pyx_result.name = __pyx_state[1]; __pyx_result.quality = __pyx_state[2]; __pyx_result.sequence = __pyx_state[3] | |
17096 * if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'): | |
17097 */ | |
17098 | |
17099 /* function exit code */ | |
17100 __pyx_r = Py_None; __Pyx_INCREF(Py_None); | |
17101 goto __pyx_L0; | |
17102 __pyx_L1_error:; | |
17103 __Pyx_XDECREF(__pyx_t_1); | |
17104 __Pyx_XDECREF(__pyx_t_5); | |
17105 __Pyx_XDECREF(__pyx_t_6); | |
17106 __Pyx_XDECREF(__pyx_t_7); | |
17107 __Pyx_AddTraceback("pysam.libcfaidx.__pyx_unpickle_FastxRecord__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
17108 __pyx_r = 0; | |
17109 __pyx_L0:; | |
17110 __Pyx_XGIVEREF(__pyx_r); | |
17111 __Pyx_TraceReturn(__pyx_r, 0); | |
17112 __Pyx_RefNannyFinishContext(); | |
17113 return __pyx_r; | |
17114 } | |
17115 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastaFile __pyx_vtable_5pysam_9libcfaidx_FastaFile; | |
17116 | |
17117 static PyObject *__pyx_tp_new_5pysam_9libcfaidx_FastaFile(PyTypeObject *t, PyObject *a, PyObject *k) { | |
17118 struct __pyx_obj_5pysam_9libcfaidx_FastaFile *p; | |
17119 PyObject *o; | |
17120 #if CYTHON_COMPILING_IN_LIMITED_API | |
17121 allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); | |
17122 o = alloc_func(t, 0); | |
17123 #else | |
17124 if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { | |
17125 o = (*t->tp_alloc)(t, 0); | |
17126 } else { | |
17127 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); | |
17128 } | |
17129 if (unlikely(!o)) return 0; | |
17130 #endif | |
17131 p = ((struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)o); | |
17132 p->__pyx_vtab = __pyx_vtabptr_5pysam_9libcfaidx_FastaFile; | |
17133 p->_filename = Py_None; Py_INCREF(Py_None); | |
17134 p->_references = Py_None; Py_INCREF(Py_None); | |
17135 p->_lengths = Py_None; Py_INCREF(Py_None); | |
17136 p->reference2length = Py_None; Py_INCREF(Py_None); | |
17137 if (unlikely(__pyx_pw_5pysam_9libcfaidx_9FastaFile_1__cinit__(o, a, k) < 0)) goto bad; | |
17138 return o; | |
17139 bad: | |
17140 Py_DECREF(o); o = 0; | |
17141 return NULL; | |
17142 } | |
17143 | |
17144 static void __pyx_tp_dealloc_5pysam_9libcfaidx_FastaFile(PyObject *o) { | |
17145 struct __pyx_obj_5pysam_9libcfaidx_FastaFile *p = (struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)o; | |
17146 #if CYTHON_USE_TP_FINALIZE | |
17147 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)) { | |
17148 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5pysam_9libcfaidx_FastaFile) { | |
17149 if (PyObject_CallFinalizerFromDealloc(o)) return; | |
17150 } | |
17151 } | |
17152 #endif | |
17153 PyObject_GC_UnTrack(o); | |
17154 { | |
17155 PyObject *etype, *eval, *etb; | |
17156 PyErr_Fetch(&etype, &eval, &etb); | |
17157 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); | |
17158 __pyx_pw_5pysam_9libcfaidx_9FastaFile_11__dealloc__(o); | |
17159 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); | |
17160 PyErr_Restore(etype, eval, etb); | |
17161 } | |
17162 Py_CLEAR(p->_filename); | |
17163 Py_CLEAR(p->_references); | |
17164 Py_CLEAR(p->_lengths); | |
17165 Py_CLEAR(p->reference2length); | |
17166 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY | |
17167 (*Py_TYPE(o)->tp_free)(o); | |
17168 #else | |
17169 { | |
17170 freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); | |
17171 if (tp_free) tp_free(o); | |
17172 } | |
17173 #endif | |
17174 } | |
17175 | |
17176 static int __pyx_tp_traverse_5pysam_9libcfaidx_FastaFile(PyObject *o, visitproc v, void *a) { | |
17177 int e; | |
17178 struct __pyx_obj_5pysam_9libcfaidx_FastaFile *p = (struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)o; | |
17179 if (p->_filename) { | |
17180 e = (*v)(p->_filename, a); if (e) return e; | |
17181 } | |
17182 if (p->_references) { | |
17183 e = (*v)(p->_references, a); if (e) return e; | |
17184 } | |
17185 if (p->_lengths) { | |
17186 e = (*v)(p->_lengths, a); if (e) return e; | |
17187 } | |
17188 if (p->reference2length) { | |
17189 e = (*v)(p->reference2length, a); if (e) return e; | |
17190 } | |
17191 return 0; | |
17192 } | |
17193 | |
17194 static int __pyx_tp_clear_5pysam_9libcfaidx_FastaFile(PyObject *o) { | |
17195 PyObject* tmp; | |
17196 struct __pyx_obj_5pysam_9libcfaidx_FastaFile *p = (struct __pyx_obj_5pysam_9libcfaidx_FastaFile *)o; | |
17197 tmp = ((PyObject*)p->_filename); | |
17198 p->_filename = Py_None; Py_INCREF(Py_None); | |
17199 Py_XDECREF(tmp); | |
17200 tmp = ((PyObject*)p->_references); | |
17201 p->_references = Py_None; Py_INCREF(Py_None); | |
17202 Py_XDECREF(tmp); | |
17203 tmp = ((PyObject*)p->_lengths); | |
17204 p->_lengths = Py_None; Py_INCREF(Py_None); | |
17205 Py_XDECREF(tmp); | |
17206 tmp = ((PyObject*)p->reference2length); | |
17207 p->reference2length = Py_None; Py_INCREF(Py_None); | |
17208 Py_XDECREF(tmp); | |
17209 return 0; | |
17210 } | |
17211 static PyObject *__pyx_sq_item_5pysam_9libcfaidx_FastaFile(PyObject *o, Py_ssize_t i) { | |
17212 PyObject *r; | |
17213 PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; | |
17214 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); | |
17215 Py_DECREF(x); | |
17216 return r; | |
17217 } | |
17218 | |
17219 static PyObject *__pyx_getprop_5pysam_9libcfaidx_9FastaFile_closed(PyObject *o, CYTHON_UNUSED void *x) { | |
17220 return __pyx_pw_5pysam_9libcfaidx_9FastaFile_6closed_1__get__(o); | |
17221 } | |
17222 | |
17223 static PyObject *__pyx_getprop_5pysam_9libcfaidx_9FastaFile_filename(PyObject *o, CYTHON_UNUSED void *x) { | |
17224 return __pyx_pw_5pysam_9libcfaidx_9FastaFile_8filename_1__get__(o); | |
17225 } | |
17226 | |
17227 static PyObject *__pyx_getprop_5pysam_9libcfaidx_9FastaFile_references(PyObject *o, CYTHON_UNUSED void *x) { | |
17228 return __pyx_pw_5pysam_9libcfaidx_9FastaFile_10references_1__get__(o); | |
17229 } | |
17230 | |
17231 static PyObject *__pyx_getprop_5pysam_9libcfaidx_9FastaFile_nreferences(PyObject *o, CYTHON_UNUSED void *x) { | |
17232 return __pyx_pw_5pysam_9libcfaidx_9FastaFile_11nreferences_1__get__(o); | |
17233 } | |
17234 | |
17235 static PyObject *__pyx_getprop_5pysam_9libcfaidx_9FastaFile_lengths(PyObject *o, CYTHON_UNUSED void *x) { | |
17236 return __pyx_pw_5pysam_9libcfaidx_9FastaFile_7lengths_1__get__(o); | |
17237 } | |
17238 | |
17239 static PyMethodDef __pyx_methods_5pysam_9libcfaidx_FastaFile[] = { | |
17240 {"is_open", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_3is_open, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_2is_open}, | |
17241 {"_open", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_7_open, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_6_open}, | |
17242 {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_9close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_8close}, | |
17243 {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_13__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_12__enter__}, | |
17244 {"__exit__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_15__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_14__exit__}, | |
17245 {"fetch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_17fetch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_16fetch}, | |
17246 {"get_reference_length", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_19get_reference_length, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_18get_reference_length}, | |
17247 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_25__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_24__reduce_cython__}, | |
17248 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastaFile_27__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastaFile_26__setstate_cython__}, | |
17249 {0, 0, 0, 0} | |
17250 }; | |
17251 | |
17252 static struct PyGetSetDef __pyx_getsets_5pysam_9libcfaidx_FastaFile[] = { | |
17253 {(char *)"closed", __pyx_getprop_5pysam_9libcfaidx_9FastaFile_closed, 0, (char *)PyDoc_STR("bool indicating the current state of the file object.\n This is a read-only attribute; the close() method changes the value.\n "), 0}, | |
17254 {(char *)"filename", __pyx_getprop_5pysam_9libcfaidx_9FastaFile_filename, 0, (char *)PyDoc_STR("filename associated with this object. This is a read-only attribute."), 0}, | |
17255 {(char *)"references", __pyx_getprop_5pysam_9libcfaidx_9FastaFile_references, 0, (char *)PyDoc_STR("tuple with the names of :term:`reference` sequences."), 0}, | |
17256 {(char *)"nreferences", __pyx_getprop_5pysam_9libcfaidx_9FastaFile_nreferences, 0, (char *)PyDoc_STR("int with the number of :term:`reference` sequences in the file.\n This is a read-only attribute."), 0}, | |
17257 {(char *)"lengths", __pyx_getprop_5pysam_9libcfaidx_9FastaFile_lengths, 0, (char *)PyDoc_STR("tuple with the lengths of :term:`reference` sequences."), 0}, | |
17258 {0, 0, 0, 0, 0} | |
17259 }; | |
17260 #if CYTHON_USE_TYPE_SPECS | |
17261 static PyType_Slot __pyx_type_5pysam_9libcfaidx_FastaFile_slots[] = { | |
17262 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5pysam_9libcfaidx_FastaFile}, | |
17263 {Py_sq_length, (void *)__pyx_pw_5pysam_9libcfaidx_9FastaFile_5__len__}, | |
17264 {Py_sq_item, (void *)__pyx_sq_item_5pysam_9libcfaidx_FastaFile}, | |
17265 {Py_sq_contains, (void *)__pyx_pw_5pysam_9libcfaidx_9FastaFile_23__contains__}, | |
17266 {Py_mp_length, (void *)__pyx_pw_5pysam_9libcfaidx_9FastaFile_5__len__}, | |
17267 {Py_mp_subscript, (void *)__pyx_pw_5pysam_9libcfaidx_9FastaFile_21__getitem__}, | |
17268 {Py_tp_doc, (void *)PyDoc_STR("Random access to fasta formatted files that\n have been indexed by :term:`faidx`.\n\n The file is automatically opened. The index file of file\n ``<filename>`` is expected to be called ``<filename>.fai``.\n\n Parameters\n ----------\n\n filename : string\n Filename of fasta file to be opened.\n\n filepath_index : string\n Optional, filename of the index. By default this is\n the filename + \".fai\".\n\n filepath_index_compressed : string\n Optional, filename of the index if fasta file is. By default this is\n the filename + \".gzi\".\n\n Raises\n ------\n\n ValueError\n if index file is missing\n\n IOError\n if file could not be opened\n\n ")}, | |
17269 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libcfaidx_FastaFile}, | |
17270 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libcfaidx_FastaFile}, | |
17271 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libcfaidx_FastaFile}, | |
17272 {Py_tp_getset, (void *)__pyx_getsets_5pysam_9libcfaidx_FastaFile}, | |
17273 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libcfaidx_FastaFile}, | |
17274 {0, 0}, | |
17275 }; | |
17276 static PyType_Spec __pyx_type_5pysam_9libcfaidx_FastaFile_spec = { | |
17277 "pysam.libcfaidx.FastaFile", | |
17278 sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastaFile), | |
17279 0, | |
17280 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, | |
17281 __pyx_type_5pysam_9libcfaidx_FastaFile_slots, | |
17282 }; | |
17283 #else | |
17284 | |
17285 static PySequenceMethods __pyx_tp_as_sequence_FastaFile = { | |
17286 __pyx_pw_5pysam_9libcfaidx_9FastaFile_5__len__, /*sq_length*/ | |
17287 0, /*sq_concat*/ | |
17288 0, /*sq_repeat*/ | |
17289 __pyx_sq_item_5pysam_9libcfaidx_FastaFile, /*sq_item*/ | |
17290 0, /*sq_slice*/ | |
17291 0, /*sq_ass_item*/ | |
17292 0, /*sq_ass_slice*/ | |
17293 __pyx_pw_5pysam_9libcfaidx_9FastaFile_23__contains__, /*sq_contains*/ | |
17294 0, /*sq_inplace_concat*/ | |
17295 0, /*sq_inplace_repeat*/ | |
17296 }; | |
17297 | |
17298 static PyMappingMethods __pyx_tp_as_mapping_FastaFile = { | |
17299 __pyx_pw_5pysam_9libcfaidx_9FastaFile_5__len__, /*mp_length*/ | |
17300 __pyx_pw_5pysam_9libcfaidx_9FastaFile_21__getitem__, /*mp_subscript*/ | |
17301 0, /*mp_ass_subscript*/ | |
17302 }; | |
17303 | |
17304 static PyTypeObject __pyx_type_5pysam_9libcfaidx_FastaFile = { | |
17305 PyVarObject_HEAD_INIT(0, 0) | |
17306 "pysam.libcfaidx.""FastaFile", /*tp_name*/ | |
17307 sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastaFile), /*tp_basicsize*/ | |
17308 0, /*tp_itemsize*/ | |
17309 __pyx_tp_dealloc_5pysam_9libcfaidx_FastaFile, /*tp_dealloc*/ | |
17310 #if PY_VERSION_HEX < 0x030800b4 | |
17311 0, /*tp_print*/ | |
17312 #endif | |
17313 #if PY_VERSION_HEX >= 0x030800b4 | |
17314 0, /*tp_vectorcall_offset*/ | |
17315 #endif | |
17316 0, /*tp_getattr*/ | |
17317 0, /*tp_setattr*/ | |
17318 #if PY_MAJOR_VERSION < 3 | |
17319 0, /*tp_compare*/ | |
17320 #endif | |
17321 #if PY_MAJOR_VERSION >= 3 | |
17322 0, /*tp_as_async*/ | |
17323 #endif | |
17324 0, /*tp_repr*/ | |
17325 0, /*tp_as_number*/ | |
17326 &__pyx_tp_as_sequence_FastaFile, /*tp_as_sequence*/ | |
17327 &__pyx_tp_as_mapping_FastaFile, /*tp_as_mapping*/ | |
17328 0, /*tp_hash*/ | |
17329 0, /*tp_call*/ | |
17330 0, /*tp_str*/ | |
17331 0, /*tp_getattro*/ | |
17332 0, /*tp_setattro*/ | |
17333 0, /*tp_as_buffer*/ | |
17334 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | |
17335 PyDoc_STR("Random access to fasta formatted files that\n have been indexed by :term:`faidx`.\n\n The file is automatically opened. The index file of file\n ``<filename>`` is expected to be called ``<filename>.fai``.\n\n Parameters\n ----------\n\n filename : string\n Filename of fasta file to be opened.\n\n filepath_index : string\n Optional, filename of the index. By default this is\n the filename + \".fai\".\n\n filepath_index_compressed : string\n Optional, filename of the index if fasta file is. By default this is\n the filename + \".gzi\".\n\n Raises\n ------\n\n ValueError\n if index file is missing\n\n IOError\n if file could not be opened\n\n "), /*tp_doc*/ | |
17336 __pyx_tp_traverse_5pysam_9libcfaidx_FastaFile, /*tp_traverse*/ | |
17337 __pyx_tp_clear_5pysam_9libcfaidx_FastaFile, /*tp_clear*/ | |
17338 0, /*tp_richcompare*/ | |
17339 0, /*tp_weaklistoffset*/ | |
17340 0, /*tp_iter*/ | |
17341 0, /*tp_iternext*/ | |
17342 __pyx_methods_5pysam_9libcfaidx_FastaFile, /*tp_methods*/ | |
17343 0, /*tp_members*/ | |
17344 __pyx_getsets_5pysam_9libcfaidx_FastaFile, /*tp_getset*/ | |
17345 0, /*tp_base*/ | |
17346 0, /*tp_dict*/ | |
17347 0, /*tp_descr_get*/ | |
17348 0, /*tp_descr_set*/ | |
17349 #if !CYTHON_USE_TYPE_SPECS | |
17350 0, /*tp_dictoffset*/ | |
17351 #endif | |
17352 0, /*tp_init*/ | |
17353 0, /*tp_alloc*/ | |
17354 __pyx_tp_new_5pysam_9libcfaidx_FastaFile, /*tp_new*/ | |
17355 0, /*tp_free*/ | |
17356 0, /*tp_is_gc*/ | |
17357 0, /*tp_bases*/ | |
17358 0, /*tp_mro*/ | |
17359 0, /*tp_cache*/ | |
17360 0, /*tp_subclasses*/ | |
17361 0, /*tp_weaklist*/ | |
17362 0, /*tp_del*/ | |
17363 0, /*tp_version_tag*/ | |
17364 #if PY_VERSION_HEX >= 0x030400a1 | |
17365 #if CYTHON_USE_TP_FINALIZE | |
17366 0, /*tp_finalize*/ | |
17367 #else | |
17368 NULL, /*tp_finalize*/ | |
17369 #endif | |
17370 #endif | |
17371 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
17372 0, /*tp_vectorcall*/ | |
17373 #endif | |
17374 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
17375 0, /*tp_print*/ | |
17376 #endif | |
17377 #if PY_VERSION_HEX >= 0x030C0000 | |
17378 0, /*tp_watched*/ | |
17379 #endif | |
17380 #if PY_VERSION_HEX >= 0x030d00A4 | |
17381 0, /*tp_versions_used*/ | |
17382 #endif | |
17383 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
17384 0, /*tp_pypy_flags*/ | |
17385 #endif | |
17386 }; | |
17387 #endif | |
17388 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqProxy __pyx_vtable_5pysam_9libcfaidx_FastqProxy; | |
17389 | |
17390 static PyObject *__pyx_tp_new_5pysam_9libcfaidx_FastqProxy(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { | |
17391 struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *p; | |
17392 PyObject *o; | |
17393 #if CYTHON_COMPILING_IN_LIMITED_API | |
17394 allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); | |
17395 o = alloc_func(t, 0); | |
17396 #else | |
17397 if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { | |
17398 o = (*t->tp_alloc)(t, 0); | |
17399 } else { | |
17400 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); | |
17401 } | |
17402 if (unlikely(!o)) return 0; | |
17403 #endif | |
17404 p = ((struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *)o); | |
17405 p->__pyx_vtab = __pyx_vtabptr_5pysam_9libcfaidx_FastqProxy; | |
17406 return o; | |
17407 } | |
17408 | |
17409 static void __pyx_tp_dealloc_5pysam_9libcfaidx_FastqProxy(PyObject *o) { | |
17410 #if CYTHON_USE_TP_FINALIZE | |
17411 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { | |
17412 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5pysam_9libcfaidx_FastqProxy) { | |
17413 if (PyObject_CallFinalizerFromDealloc(o)) return; | |
17414 } | |
17415 } | |
17416 #endif | |
17417 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY | |
17418 (*Py_TYPE(o)->tp_free)(o); | |
17419 #else | |
17420 { | |
17421 freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); | |
17422 if (tp_free) tp_free(o); | |
17423 } | |
17424 #endif | |
17425 } | |
17426 | |
17427 static PyObject *__pyx_getprop_5pysam_9libcfaidx_10FastqProxy_name(PyObject *o, CYTHON_UNUSED void *x) { | |
17428 return __pyx_pw_5pysam_9libcfaidx_10FastqProxy_4name_1__get__(o); | |
17429 } | |
17430 | |
17431 static PyObject *__pyx_getprop_5pysam_9libcfaidx_10FastqProxy_sequence(PyObject *o, CYTHON_UNUSED void *x) { | |
17432 return __pyx_pw_5pysam_9libcfaidx_10FastqProxy_8sequence_1__get__(o); | |
17433 } | |
17434 | |
17435 static PyObject *__pyx_getprop_5pysam_9libcfaidx_10FastqProxy_comment(PyObject *o, CYTHON_UNUSED void *x) { | |
17436 return __pyx_pw_5pysam_9libcfaidx_10FastqProxy_7comment_1__get__(o); | |
17437 } | |
17438 | |
17439 static PyObject *__pyx_getprop_5pysam_9libcfaidx_10FastqProxy_quality(PyObject *o, CYTHON_UNUSED void *x) { | |
17440 return __pyx_pw_5pysam_9libcfaidx_10FastqProxy_7quality_1__get__(o); | |
17441 } | |
17442 | |
17443 static PyMethodDef __pyx_methods_5pysam_9libcfaidx_FastqProxy[] = { | |
17444 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_10FastqProxy_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_10FastqProxy_6__reduce_cython__}, | |
17445 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_10FastqProxy_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_10FastqProxy_8__setstate_cython__}, | |
17446 {0, 0, 0, 0} | |
17447 }; | |
17448 | |
17449 static struct PyGetSetDef __pyx_getsets_5pysam_9libcfaidx_FastqProxy[] = { | |
17450 {(char *)"name", __pyx_getprop_5pysam_9libcfaidx_10FastqProxy_name, 0, (char *)PyDoc_STR("The name of each entry in the fastq file."), 0}, | |
17451 {(char *)"sequence", __pyx_getprop_5pysam_9libcfaidx_10FastqProxy_sequence, 0, (char *)PyDoc_STR("The sequence of each entry in the fastq file."), 0}, | |
17452 {(char *)"comment", __pyx_getprop_5pysam_9libcfaidx_10FastqProxy_comment, 0, (char *)0, 0}, | |
17453 {(char *)"quality", __pyx_getprop_5pysam_9libcfaidx_10FastqProxy_quality, 0, (char *)PyDoc_STR("The quality score of each entry in the fastq file, represented as a string."), 0}, | |
17454 {0, 0, 0, 0, 0} | |
17455 }; | |
17456 #if CYTHON_USE_TYPE_SPECS | |
17457 static PyType_Slot __pyx_type_5pysam_9libcfaidx_FastqProxy_slots[] = { | |
17458 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5pysam_9libcfaidx_FastqProxy}, | |
17459 {Py_tp_str, (void *)__pyx_pw_5pysam_9libcfaidx_10FastqProxy_3__str__}, | |
17460 {Py_tp_doc, (void *)PyDoc_STR("FastqProxy()\nA single entry in a fastq file.")}, | |
17461 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libcfaidx_FastqProxy}, | |
17462 {Py_tp_getset, (void *)__pyx_getsets_5pysam_9libcfaidx_FastqProxy}, | |
17463 {Py_tp_init, (void *)__pyx_pw_5pysam_9libcfaidx_10FastqProxy_1__init__}, | |
17464 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libcfaidx_FastqProxy}, | |
17465 {0, 0}, | |
17466 }; | |
17467 static PyType_Spec __pyx_type_5pysam_9libcfaidx_FastqProxy_spec = { | |
17468 "pysam.libcfaidx.FastqProxy", | |
17469 sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy), | |
17470 0, | |
17471 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, | |
17472 __pyx_type_5pysam_9libcfaidx_FastqProxy_slots, | |
17473 }; | |
17474 #else | |
17475 | |
17476 static PyTypeObject __pyx_type_5pysam_9libcfaidx_FastqProxy = { | |
17477 PyVarObject_HEAD_INIT(0, 0) | |
17478 "pysam.libcfaidx.""FastqProxy", /*tp_name*/ | |
17479 sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy), /*tp_basicsize*/ | |
17480 0, /*tp_itemsize*/ | |
17481 __pyx_tp_dealloc_5pysam_9libcfaidx_FastqProxy, /*tp_dealloc*/ | |
17482 #if PY_VERSION_HEX < 0x030800b4 | |
17483 0, /*tp_print*/ | |
17484 #endif | |
17485 #if PY_VERSION_HEX >= 0x030800b4 | |
17486 0, /*tp_vectorcall_offset*/ | |
17487 #endif | |
17488 0, /*tp_getattr*/ | |
17489 0, /*tp_setattr*/ | |
17490 #if PY_MAJOR_VERSION < 3 | |
17491 0, /*tp_compare*/ | |
17492 #endif | |
17493 #if PY_MAJOR_VERSION >= 3 | |
17494 0, /*tp_as_async*/ | |
17495 #endif | |
17496 0, /*tp_repr*/ | |
17497 0, /*tp_as_number*/ | |
17498 0, /*tp_as_sequence*/ | |
17499 0, /*tp_as_mapping*/ | |
17500 0, /*tp_hash*/ | |
17501 0, /*tp_call*/ | |
17502 __pyx_pw_5pysam_9libcfaidx_10FastqProxy_3__str__, /*tp_str*/ | |
17503 0, /*tp_getattro*/ | |
17504 0, /*tp_setattro*/ | |
17505 0, /*tp_as_buffer*/ | |
17506 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ | |
17507 PyDoc_STR("FastqProxy()\nA single entry in a fastq file."), /*tp_doc*/ | |
17508 0, /*tp_traverse*/ | |
17509 0, /*tp_clear*/ | |
17510 0, /*tp_richcompare*/ | |
17511 0, /*tp_weaklistoffset*/ | |
17512 0, /*tp_iter*/ | |
17513 0, /*tp_iternext*/ | |
17514 __pyx_methods_5pysam_9libcfaidx_FastqProxy, /*tp_methods*/ | |
17515 0, /*tp_members*/ | |
17516 __pyx_getsets_5pysam_9libcfaidx_FastqProxy, /*tp_getset*/ | |
17517 0, /*tp_base*/ | |
17518 0, /*tp_dict*/ | |
17519 0, /*tp_descr_get*/ | |
17520 0, /*tp_descr_set*/ | |
17521 #if !CYTHON_USE_TYPE_SPECS | |
17522 0, /*tp_dictoffset*/ | |
17523 #endif | |
17524 __pyx_pw_5pysam_9libcfaidx_10FastqProxy_1__init__, /*tp_init*/ | |
17525 0, /*tp_alloc*/ | |
17526 __pyx_tp_new_5pysam_9libcfaidx_FastqProxy, /*tp_new*/ | |
17527 0, /*tp_free*/ | |
17528 0, /*tp_is_gc*/ | |
17529 0, /*tp_bases*/ | |
17530 0, /*tp_mro*/ | |
17531 0, /*tp_cache*/ | |
17532 0, /*tp_subclasses*/ | |
17533 0, /*tp_weaklist*/ | |
17534 0, /*tp_del*/ | |
17535 0, /*tp_version_tag*/ | |
17536 #if PY_VERSION_HEX >= 0x030400a1 | |
17537 #if CYTHON_USE_TP_FINALIZE | |
17538 0, /*tp_finalize*/ | |
17539 #else | |
17540 NULL, /*tp_finalize*/ | |
17541 #endif | |
17542 #endif | |
17543 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
17544 0, /*tp_vectorcall*/ | |
17545 #endif | |
17546 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
17547 0, /*tp_print*/ | |
17548 #endif | |
17549 #if PY_VERSION_HEX >= 0x030C0000 | |
17550 0, /*tp_watched*/ | |
17551 #endif | |
17552 #if PY_VERSION_HEX >= 0x030d00A4 | |
17553 0, /*tp_versions_used*/ | |
17554 #endif | |
17555 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
17556 0, /*tp_pypy_flags*/ | |
17557 #endif | |
17558 }; | |
17559 #endif | |
17560 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxRecord __pyx_vtable_5pysam_9libcfaidx_FastxRecord; | |
17561 | |
17562 static PyObject *__pyx_tp_new_5pysam_9libcfaidx_FastxRecord(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { | |
17563 struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *p; | |
17564 PyObject *o; | |
17565 #if CYTHON_COMPILING_IN_LIMITED_API | |
17566 allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); | |
17567 o = alloc_func(t, 0); | |
17568 #else | |
17569 if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { | |
17570 o = (*t->tp_alloc)(t, 0); | |
17571 } else { | |
17572 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); | |
17573 } | |
17574 if (unlikely(!o)) return 0; | |
17575 #endif | |
17576 p = ((struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)o); | |
17577 p->__pyx_vtab = __pyx_vtabptr_5pysam_9libcfaidx_FastxRecord; | |
17578 p->comment = ((PyObject*)Py_None); Py_INCREF(Py_None); | |
17579 p->quality = ((PyObject*)Py_None); Py_INCREF(Py_None); | |
17580 p->sequence = ((PyObject*)Py_None); Py_INCREF(Py_None); | |
17581 p->name = ((PyObject*)Py_None); Py_INCREF(Py_None); | |
17582 return o; | |
17583 } | |
17584 | |
17585 static void __pyx_tp_dealloc_5pysam_9libcfaidx_FastxRecord(PyObject *o) { | |
17586 struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *p = (struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *)o; | |
17587 #if CYTHON_USE_TP_FINALIZE | |
17588 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { | |
17589 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5pysam_9libcfaidx_FastxRecord) { | |
17590 if (PyObject_CallFinalizerFromDealloc(o)) return; | |
17591 } | |
17592 } | |
17593 #endif | |
17594 Py_CLEAR(p->comment); | |
17595 Py_CLEAR(p->quality); | |
17596 Py_CLEAR(p->sequence); | |
17597 Py_CLEAR(p->name); | |
17598 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY | |
17599 (*Py_TYPE(o)->tp_free)(o); | |
17600 #else | |
17601 { | |
17602 freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); | |
17603 if (tp_free) tp_free(o); | |
17604 } | |
17605 #endif | |
17606 } | |
17607 | |
17608 static PyObject *__pyx_getprop_5pysam_9libcfaidx_11FastxRecord_comment(PyObject *o, CYTHON_UNUSED void *x) { | |
17609 return __pyx_pw_5pysam_9libcfaidx_11FastxRecord_7comment_1__get__(o); | |
17610 } | |
17611 | |
17612 static int __pyx_setprop_5pysam_9libcfaidx_11FastxRecord_comment(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { | |
17613 if (v) { | |
17614 return __pyx_pw_5pysam_9libcfaidx_11FastxRecord_7comment_3__set__(o, v); | |
17615 } | |
17616 else { | |
17617 return __pyx_pw_5pysam_9libcfaidx_11FastxRecord_7comment_5__del__(o); | |
17618 } | |
17619 } | |
17620 | |
17621 static PyObject *__pyx_getprop_5pysam_9libcfaidx_11FastxRecord_quality(PyObject *o, CYTHON_UNUSED void *x) { | |
17622 return __pyx_pw_5pysam_9libcfaidx_11FastxRecord_7quality_1__get__(o); | |
17623 } | |
17624 | |
17625 static int __pyx_setprop_5pysam_9libcfaidx_11FastxRecord_quality(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { | |
17626 if (v) { | |
17627 return __pyx_pw_5pysam_9libcfaidx_11FastxRecord_7quality_3__set__(o, v); | |
17628 } | |
17629 else { | |
17630 return __pyx_pw_5pysam_9libcfaidx_11FastxRecord_7quality_5__del__(o); | |
17631 } | |
17632 } | |
17633 | |
17634 static PyObject *__pyx_getprop_5pysam_9libcfaidx_11FastxRecord_sequence(PyObject *o, CYTHON_UNUSED void *x) { | |
17635 return __pyx_pw_5pysam_9libcfaidx_11FastxRecord_8sequence_1__get__(o); | |
17636 } | |
17637 | |
17638 static int __pyx_setprop_5pysam_9libcfaidx_11FastxRecord_sequence(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { | |
17639 if (v) { | |
17640 return __pyx_pw_5pysam_9libcfaidx_11FastxRecord_8sequence_3__set__(o, v); | |
17641 } | |
17642 else { | |
17643 return __pyx_pw_5pysam_9libcfaidx_11FastxRecord_8sequence_5__del__(o); | |
17644 } | |
17645 } | |
17646 | |
17647 static PyObject *__pyx_getprop_5pysam_9libcfaidx_11FastxRecord_name(PyObject *o, CYTHON_UNUSED void *x) { | |
17648 return __pyx_pw_5pysam_9libcfaidx_11FastxRecord_4name_1__get__(o); | |
17649 } | |
17650 | |
17651 static int __pyx_setprop_5pysam_9libcfaidx_11FastxRecord_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { | |
17652 if (v) { | |
17653 return __pyx_pw_5pysam_9libcfaidx_11FastxRecord_4name_3__set__(o, v); | |
17654 } | |
17655 else { | |
17656 return __pyx_pw_5pysam_9libcfaidx_11FastxRecord_4name_5__del__(o); | |
17657 } | |
17658 } | |
17659 | |
17660 static PyMethodDef __pyx_methods_5pysam_9libcfaidx_FastxRecord[] = { | |
17661 {"__copy__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_3__copy__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_11FastxRecord_2__copy__}, | |
17662 {"__deepcopy__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_5__deepcopy__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_11FastxRecord_4__deepcopy__}, | |
17663 {"set_name", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_7set_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_11FastxRecord_6set_name}, | |
17664 {"set_comment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_9set_comment, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_11FastxRecord_8set_comment}, | |
17665 {"set_sequence", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_11set_sequence, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_11FastxRecord_10set_sequence}, | |
17666 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_11FastxRecord_16__reduce_cython__}, | |
17667 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_11FastxRecord_18__setstate_cython__}, | |
17668 {0, 0, 0, 0} | |
17669 }; | |
17670 | |
17671 static struct PyGetSetDef __pyx_getsets_5pysam_9libcfaidx_FastxRecord[] = { | |
17672 {(char *)"comment", __pyx_getprop_5pysam_9libcfaidx_11FastxRecord_comment, __pyx_setprop_5pysam_9libcfaidx_11FastxRecord_comment, (char *)PyDoc_STR("comment: unicode"), 0}, | |
17673 {(char *)"quality", __pyx_getprop_5pysam_9libcfaidx_11FastxRecord_quality, __pyx_setprop_5pysam_9libcfaidx_11FastxRecord_quality, (char *)PyDoc_STR("quality: unicode"), 0}, | |
17674 {(char *)"sequence", __pyx_getprop_5pysam_9libcfaidx_11FastxRecord_sequence, __pyx_setprop_5pysam_9libcfaidx_11FastxRecord_sequence, (char *)PyDoc_STR("sequence: unicode"), 0}, | |
17675 {(char *)"name", __pyx_getprop_5pysam_9libcfaidx_11FastxRecord_name, __pyx_setprop_5pysam_9libcfaidx_11FastxRecord_name, (char *)PyDoc_STR("name: unicode"), 0}, | |
17676 {0, 0, 0, 0, 0} | |
17677 }; | |
17678 #if CYTHON_USE_TYPE_SPECS | |
17679 static PyType_Slot __pyx_type_5pysam_9libcfaidx_FastxRecord_slots[] = { | |
17680 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5pysam_9libcfaidx_FastxRecord}, | |
17681 {Py_tp_str, (void *)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_13__str__}, | |
17682 {Py_tp_doc, (void *)PyDoc_STR("FastxRecord(name=None, comment=None, sequence=None, quality=None, FastqProxy proxy=None)\nA fasta/fastq record.\n\n A record must contain a name and a sequence. If either of them are\n None, a ValueError is raised on writing.\n\n ")}, | |
17683 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libcfaidx_FastxRecord}, | |
17684 {Py_tp_getset, (void *)__pyx_getsets_5pysam_9libcfaidx_FastxRecord}, | |
17685 {Py_tp_init, (void *)__pyx_pw_5pysam_9libcfaidx_11FastxRecord_1__init__}, | |
17686 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libcfaidx_FastxRecord}, | |
17687 {0, 0}, | |
17688 }; | |
17689 static PyType_Spec __pyx_type_5pysam_9libcfaidx_FastxRecord_spec = { | |
17690 "pysam.libcfaidx.FastxRecord", | |
17691 sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord), | |
17692 0, | |
17693 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, | |
17694 __pyx_type_5pysam_9libcfaidx_FastxRecord_slots, | |
17695 }; | |
17696 #else | |
17697 | |
17698 static PyTypeObject __pyx_type_5pysam_9libcfaidx_FastxRecord = { | |
17699 PyVarObject_HEAD_INIT(0, 0) | |
17700 "pysam.libcfaidx.""FastxRecord", /*tp_name*/ | |
17701 sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord), /*tp_basicsize*/ | |
17702 0, /*tp_itemsize*/ | |
17703 __pyx_tp_dealloc_5pysam_9libcfaidx_FastxRecord, /*tp_dealloc*/ | |
17704 #if PY_VERSION_HEX < 0x030800b4 | |
17705 0, /*tp_print*/ | |
17706 #endif | |
17707 #if PY_VERSION_HEX >= 0x030800b4 | |
17708 0, /*tp_vectorcall_offset*/ | |
17709 #endif | |
17710 0, /*tp_getattr*/ | |
17711 0, /*tp_setattr*/ | |
17712 #if PY_MAJOR_VERSION < 3 | |
17713 0, /*tp_compare*/ | |
17714 #endif | |
17715 #if PY_MAJOR_VERSION >= 3 | |
17716 0, /*tp_as_async*/ | |
17717 #endif | |
17718 0, /*tp_repr*/ | |
17719 0, /*tp_as_number*/ | |
17720 0, /*tp_as_sequence*/ | |
17721 0, /*tp_as_mapping*/ | |
17722 0, /*tp_hash*/ | |
17723 0, /*tp_call*/ | |
17724 __pyx_pw_5pysam_9libcfaidx_11FastxRecord_13__str__, /*tp_str*/ | |
17725 0, /*tp_getattro*/ | |
17726 0, /*tp_setattro*/ | |
17727 0, /*tp_as_buffer*/ | |
17728 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ | |
17729 PyDoc_STR("FastxRecord(name=None, comment=None, sequence=None, quality=None, FastqProxy proxy=None)\nA fasta/fastq record.\n\n A record must contain a name and a sequence. If either of them are\n None, a ValueError is raised on writing.\n\n "), /*tp_doc*/ | |
17730 0, /*tp_traverse*/ | |
17731 0, /*tp_clear*/ | |
17732 0, /*tp_richcompare*/ | |
17733 0, /*tp_weaklistoffset*/ | |
17734 0, /*tp_iter*/ | |
17735 0, /*tp_iternext*/ | |
17736 __pyx_methods_5pysam_9libcfaidx_FastxRecord, /*tp_methods*/ | |
17737 0, /*tp_members*/ | |
17738 __pyx_getsets_5pysam_9libcfaidx_FastxRecord, /*tp_getset*/ | |
17739 0, /*tp_base*/ | |
17740 0, /*tp_dict*/ | |
17741 0, /*tp_descr_get*/ | |
17742 0, /*tp_descr_set*/ | |
17743 #if !CYTHON_USE_TYPE_SPECS | |
17744 0, /*tp_dictoffset*/ | |
17745 #endif | |
17746 __pyx_pw_5pysam_9libcfaidx_11FastxRecord_1__init__, /*tp_init*/ | |
17747 0, /*tp_alloc*/ | |
17748 __pyx_tp_new_5pysam_9libcfaidx_FastxRecord, /*tp_new*/ | |
17749 0, /*tp_free*/ | |
17750 0, /*tp_is_gc*/ | |
17751 0, /*tp_bases*/ | |
17752 0, /*tp_mro*/ | |
17753 0, /*tp_cache*/ | |
17754 0, /*tp_subclasses*/ | |
17755 0, /*tp_weaklist*/ | |
17756 0, /*tp_del*/ | |
17757 0, /*tp_version_tag*/ | |
17758 #if PY_VERSION_HEX >= 0x030400a1 | |
17759 #if CYTHON_USE_TP_FINALIZE | |
17760 0, /*tp_finalize*/ | |
17761 #else | |
17762 NULL, /*tp_finalize*/ | |
17763 #endif | |
17764 #endif | |
17765 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
17766 0, /*tp_vectorcall*/ | |
17767 #endif | |
17768 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
17769 0, /*tp_print*/ | |
17770 #endif | |
17771 #if PY_VERSION_HEX >= 0x030C0000 | |
17772 0, /*tp_watched*/ | |
17773 #endif | |
17774 #if PY_VERSION_HEX >= 0x030d00A4 | |
17775 0, /*tp_versions_used*/ | |
17776 #endif | |
17777 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
17778 0, /*tp_pypy_flags*/ | |
17779 #endif | |
17780 }; | |
17781 #endif | |
17782 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxFile __pyx_vtable_5pysam_9libcfaidx_FastxFile; | |
17783 | |
17784 static PyObject *__pyx_tp_new_5pysam_9libcfaidx_FastxFile(PyTypeObject *t, PyObject *a, PyObject *k) { | |
17785 struct __pyx_obj_5pysam_9libcfaidx_FastxFile *p; | |
17786 PyObject *o; | |
17787 #if CYTHON_COMPILING_IN_LIMITED_API | |
17788 allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); | |
17789 o = alloc_func(t, 0); | |
17790 #else | |
17791 if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { | |
17792 o = (*t->tp_alloc)(t, 0); | |
17793 } else { | |
17794 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); | |
17795 } | |
17796 if (unlikely(!o)) return 0; | |
17797 #endif | |
17798 p = ((struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)o); | |
17799 p->__pyx_vtab = __pyx_vtabptr_5pysam_9libcfaidx_FastxFile; | |
17800 p->_filename = Py_None; Py_INCREF(Py_None); | |
17801 if (unlikely(__pyx_pw_5pysam_9libcfaidx_9FastxFile_1__cinit__(o, a, k) < 0)) goto bad; | |
17802 return o; | |
17803 bad: | |
17804 Py_DECREF(o); o = 0; | |
17805 return NULL; | |
17806 } | |
17807 | |
17808 static void __pyx_tp_dealloc_5pysam_9libcfaidx_FastxFile(PyObject *o) { | |
17809 struct __pyx_obj_5pysam_9libcfaidx_FastxFile *p = (struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)o; | |
17810 #if CYTHON_USE_TP_FINALIZE | |
17811 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)) { | |
17812 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_5pysam_9libcfaidx_FastxFile) { | |
17813 if (PyObject_CallFinalizerFromDealloc(o)) return; | |
17814 } | |
17815 } | |
17816 #endif | |
17817 PyObject_GC_UnTrack(o); | |
17818 { | |
17819 PyObject *etype, *eval, *etb; | |
17820 PyErr_Fetch(&etype, &eval, &etb); | |
17821 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); | |
17822 __pyx_pw_5pysam_9libcfaidx_9FastxFile_9__dealloc__(o); | |
17823 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); | |
17824 PyErr_Restore(etype, eval, etb); | |
17825 } | |
17826 Py_CLEAR(p->_filename); | |
17827 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY | |
17828 (*Py_TYPE(o)->tp_free)(o); | |
17829 #else | |
17830 { | |
17831 freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); | |
17832 if (tp_free) tp_free(o); | |
17833 } | |
17834 #endif | |
17835 } | |
17836 | |
17837 static int __pyx_tp_traverse_5pysam_9libcfaidx_FastxFile(PyObject *o, visitproc v, void *a) { | |
17838 int e; | |
17839 struct __pyx_obj_5pysam_9libcfaidx_FastxFile *p = (struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)o; | |
17840 if (p->_filename) { | |
17841 e = (*v)(p->_filename, a); if (e) return e; | |
17842 } | |
17843 return 0; | |
17844 } | |
17845 | |
17846 static int __pyx_tp_clear_5pysam_9libcfaidx_FastxFile(PyObject *o) { | |
17847 PyObject* tmp; | |
17848 struct __pyx_obj_5pysam_9libcfaidx_FastxFile *p = (struct __pyx_obj_5pysam_9libcfaidx_FastxFile *)o; | |
17849 tmp = ((PyObject*)p->_filename); | |
17850 p->_filename = Py_None; Py_INCREF(Py_None); | |
17851 Py_XDECREF(tmp); | |
17852 return 0; | |
17853 } | |
17854 | |
17855 static PyObject *__pyx_getprop_5pysam_9libcfaidx_9FastxFile_closed(PyObject *o, CYTHON_UNUSED void *x) { | |
17856 return __pyx_pw_5pysam_9libcfaidx_9FastxFile_6closed_1__get__(o); | |
17857 } | |
17858 | |
17859 static PyObject *__pyx_getprop_5pysam_9libcfaidx_9FastxFile_filename(PyObject *o, CYTHON_UNUSED void *x) { | |
17860 return __pyx_pw_5pysam_9libcfaidx_9FastxFile_8filename_1__get__(o); | |
17861 } | |
17862 | |
17863 static PyObject *__pyx_specialmethod___pyx_pw_5pysam_9libcfaidx_9FastxFile_17__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) { | |
17864 PyObject *res = __pyx_pw_5pysam_9libcfaidx_9FastxFile_17__next__(self); | |
17865 if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); } | |
17866 return res; | |
17867 } | |
17868 | |
17869 static PyMethodDef __pyx_methods_5pysam_9libcfaidx_FastxFile[] = { | |
17870 {"is_open", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastxFile_3is_open, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastxFile_2is_open}, | |
17871 {"_open", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastxFile_5_open, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastxFile_4_open}, | |
17872 {"close", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastxFile_7close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastxFile_6close}, | |
17873 {"__enter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastxFile_11__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastxFile_10__enter__}, | |
17874 {"__exit__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastxFile_13__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastxFile_12__exit__}, | |
17875 {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_5pysam_9libcfaidx_9FastxFile_17__next__, METH_NOARGS|METH_COEXIST, __pyx_doc_5pysam_9libcfaidx_9FastxFile_16__next__}, | |
17876 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastxFile_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastxFile_18__reduce_cython__}, | |
17877 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastxFile_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastxFile_20__setstate_cython__}, | |
17878 {0, 0, 0, 0} | |
17879 }; | |
17880 | |
17881 static struct PyGetSetDef __pyx_getsets_5pysam_9libcfaidx_FastxFile[] = { | |
17882 {(char *)"closed", __pyx_getprop_5pysam_9libcfaidx_9FastxFile_closed, 0, (char *)PyDoc_STR("bool indicating the current state of the file object.\n This is a read-only attribute; the close() method changes the value.\n "), 0}, | |
17883 {(char *)"filename", __pyx_getprop_5pysam_9libcfaidx_9FastxFile_filename, 0, (char *)PyDoc_STR("string with the filename associated with this object."), 0}, | |
17884 {0, 0, 0, 0, 0} | |
17885 }; | |
17886 #if CYTHON_USE_TYPE_SPECS | |
17887 static PyType_Slot __pyx_type_5pysam_9libcfaidx_FastxFile_slots[] = { | |
17888 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_5pysam_9libcfaidx_FastxFile}, | |
17889 {Py_tp_doc, (void *)PyDoc_STR("Stream access to :term:`fasta` or :term:`fastq` formatted files.\n\n The file is automatically opened.\n\n Entries in the file can be both fastq or fasta formatted or even a\n mixture of the two.\n\n This file object permits iterating over all entries in the\n file. Random access is not implemented. The iteration returns\n objects of type :class:`FastqProxy`\n\n Parameters\n ----------\n\n filename : string\n Filename of fasta/fastq file to be opened.\n\n persist : bool\n\n If True (default) make a copy of the entry in the file during\n iteration. If set to False, no copy will be made. This will\n permit much faster iteration, but an entry will not persist\n when the iteration continues and an entry is read-only.\n\n Notes\n -----\n Prior to version 0.8.2, this class was called FastqFile.\n\n Raises\n ------\n\n IOError\n if file could not be opened\n\n\n Examples\n --------\n >>> with pysam.FastxFile(filename) as fh:\n ... for entry in fh:\n ... print(entry.name)\n ... print(entry.sequence)\n ... print(entry.comment)\n ... print(entry.quality)\n >>> with pysam.FastxFile(filename) as fin, open(out_filename, mode='w') as fout:\n ... for entry in fin:\n ... fout.write(str(entry) + '\\n')\n\n ")}, | |
17890 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libcfaidx_FastxFile}, | |
17891 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libcfaidx_FastxFile}, | |
17892 {Py_tp_iter, (void *)__pyx_pw_5pysam_9libcfaidx_9FastxFile_15__iter__}, | |
17893 {Py_tp_iternext, (void *)__pyx_pw_5pysam_9libcfaidx_9FastxFile_17__next__}, | |
17894 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libcfaidx_FastxFile}, | |
17895 {Py_tp_getset, (void *)__pyx_getsets_5pysam_9libcfaidx_FastxFile}, | |
17896 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libcfaidx_FastxFile}, | |
17897 {0, 0}, | |
17898 }; | |
17899 static PyType_Spec __pyx_type_5pysam_9libcfaidx_FastxFile_spec = { | |
17900 "pysam.libcfaidx.FastxFile", | |
17901 sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastxFile), | |
17902 0, | |
17903 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, | |
17904 __pyx_type_5pysam_9libcfaidx_FastxFile_slots, | |
17905 }; | |
17906 #else | |
17907 | |
17908 static PyTypeObject __pyx_type_5pysam_9libcfaidx_FastxFile = { | |
17909 PyVarObject_HEAD_INIT(0, 0) | |
17910 "pysam.libcfaidx.""FastxFile", /*tp_name*/ | |
17911 sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastxFile), /*tp_basicsize*/ | |
17912 0, /*tp_itemsize*/ | |
17913 __pyx_tp_dealloc_5pysam_9libcfaidx_FastxFile, /*tp_dealloc*/ | |
17914 #if PY_VERSION_HEX < 0x030800b4 | |
17915 0, /*tp_print*/ | |
17916 #endif | |
17917 #if PY_VERSION_HEX >= 0x030800b4 | |
17918 0, /*tp_vectorcall_offset*/ | |
17919 #endif | |
17920 0, /*tp_getattr*/ | |
17921 0, /*tp_setattr*/ | |
17922 #if PY_MAJOR_VERSION < 3 | |
17923 0, /*tp_compare*/ | |
17924 #endif | |
17925 #if PY_MAJOR_VERSION >= 3 | |
17926 0, /*tp_as_async*/ | |
17927 #endif | |
17928 0, /*tp_repr*/ | |
17929 0, /*tp_as_number*/ | |
17930 0, /*tp_as_sequence*/ | |
17931 0, /*tp_as_mapping*/ | |
17932 0, /*tp_hash*/ | |
17933 0, /*tp_call*/ | |
17934 0, /*tp_str*/ | |
17935 0, /*tp_getattro*/ | |
17936 0, /*tp_setattro*/ | |
17937 0, /*tp_as_buffer*/ | |
17938 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | |
17939 PyDoc_STR("Stream access to :term:`fasta` or :term:`fastq` formatted files.\n\n The file is automatically opened.\n\n Entries in the file can be both fastq or fasta formatted or even a\n mixture of the two.\n\n This file object permits iterating over all entries in the\n file. Random access is not implemented. The iteration returns\n objects of type :class:`FastqProxy`\n\n Parameters\n ----------\n\n filename : string\n Filename of fasta/fastq file to be opened.\n\n persist : bool\n\n If True (default) make a copy of the entry in the file during\n iteration. If set to False, no copy will be made. This will\n permit much faster iteration, but an entry will not persist\n when the iteration continues and an entry is read-only.\n\n Notes\n -----\n Prior to version 0.8.2, this class was called FastqFile.\n\n Raises\n ------\n\n IOError\n if file could not be opened\n\n\n Examples\n --------\n >>> with pysam.FastxFile(filename) as fh:\n ... for entry in fh:\n ... print(entry.name)\n ... print(entry.sequence)\n ... print(entry.comment)\n ... print(entry.quality)\n >>> with pysam.FastxFile(filename) as fin, open(out_filename, mode='w') as fout:\n ... for entry in fin:\n ... fout.write(str(entry) + '\\n')\n\n "), /*tp_doc*/ | |
17940 __pyx_tp_traverse_5pysam_9libcfaidx_FastxFile, /*tp_traverse*/ | |
17941 __pyx_tp_clear_5pysam_9libcfaidx_FastxFile, /*tp_clear*/ | |
17942 0, /*tp_richcompare*/ | |
17943 0, /*tp_weaklistoffset*/ | |
17944 __pyx_pw_5pysam_9libcfaidx_9FastxFile_15__iter__, /*tp_iter*/ | |
17945 __pyx_pw_5pysam_9libcfaidx_9FastxFile_17__next__, /*tp_iternext*/ | |
17946 __pyx_methods_5pysam_9libcfaidx_FastxFile, /*tp_methods*/ | |
17947 0, /*tp_members*/ | |
17948 __pyx_getsets_5pysam_9libcfaidx_FastxFile, /*tp_getset*/ | |
17949 0, /*tp_base*/ | |
17950 0, /*tp_dict*/ | |
17951 0, /*tp_descr_get*/ | |
17952 0, /*tp_descr_set*/ | |
17953 #if !CYTHON_USE_TYPE_SPECS | |
17954 0, /*tp_dictoffset*/ | |
17955 #endif | |
17956 0, /*tp_init*/ | |
17957 0, /*tp_alloc*/ | |
17958 __pyx_tp_new_5pysam_9libcfaidx_FastxFile, /*tp_new*/ | |
17959 0, /*tp_free*/ | |
17960 0, /*tp_is_gc*/ | |
17961 0, /*tp_bases*/ | |
17962 0, /*tp_mro*/ | |
17963 0, /*tp_cache*/ | |
17964 0, /*tp_subclasses*/ | |
17965 0, /*tp_weaklist*/ | |
17966 0, /*tp_del*/ | |
17967 0, /*tp_version_tag*/ | |
17968 #if PY_VERSION_HEX >= 0x030400a1 | |
17969 #if CYTHON_USE_TP_FINALIZE | |
17970 0, /*tp_finalize*/ | |
17971 #else | |
17972 NULL, /*tp_finalize*/ | |
17973 #endif | |
17974 #endif | |
17975 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
17976 0, /*tp_vectorcall*/ | |
17977 #endif | |
17978 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
17979 0, /*tp_print*/ | |
17980 #endif | |
17981 #if PY_VERSION_HEX >= 0x030C0000 | |
17982 0, /*tp_watched*/ | |
17983 #endif | |
17984 #if PY_VERSION_HEX >= 0x030d00A4 | |
17985 0, /*tp_versions_used*/ | |
17986 #endif | |
17987 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
17988 0, /*tp_pypy_flags*/ | |
17989 #endif | |
17990 }; | |
17991 #endif | |
17992 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqFile __pyx_vtable_5pysam_9libcfaidx_FastqFile; | |
17993 | |
17994 static PyObject *__pyx_tp_new_5pysam_9libcfaidx_FastqFile(PyTypeObject *t, PyObject *a, PyObject *k) { | |
17995 struct __pyx_obj_5pysam_9libcfaidx_FastqFile *p; | |
17996 PyObject *o = __pyx_tp_new_5pysam_9libcfaidx_FastxFile(t, a, k); | |
17997 if (unlikely(!o)) return 0; | |
17998 p = ((struct __pyx_obj_5pysam_9libcfaidx_FastqFile *)o); | |
17999 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxFile*)__pyx_vtabptr_5pysam_9libcfaidx_FastqFile; | |
18000 return o; | |
18001 } | |
18002 | |
18003 static PyMethodDef __pyx_methods_5pysam_9libcfaidx_FastqFile[] = { | |
18004 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastqFile_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastqFile___reduce_cython__}, | |
18005 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9FastqFile_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9FastqFile_2__setstate_cython__}, | |
18006 {0, 0, 0, 0} | |
18007 }; | |
18008 #if CYTHON_USE_TYPE_SPECS | |
18009 static PyType_Slot __pyx_type_5pysam_9libcfaidx_FastqFile_slots[] = { | |
18010 {Py_tp_doc, (void *)PyDoc_STR("FastqFile is deprecated: use FastxFile instead")}, | |
18011 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libcfaidx_FastxFile}, | |
18012 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libcfaidx_FastxFile}, | |
18013 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libcfaidx_FastqFile}, | |
18014 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libcfaidx_FastqFile}, | |
18015 {0, 0}, | |
18016 }; | |
18017 static PyType_Spec __pyx_type_5pysam_9libcfaidx_FastqFile_spec = { | |
18018 "pysam.libcfaidx.FastqFile", | |
18019 sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastqFile), | |
18020 0, | |
18021 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, | |
18022 __pyx_type_5pysam_9libcfaidx_FastqFile_slots, | |
18023 }; | |
18024 #else | |
18025 | |
18026 static PyTypeObject __pyx_type_5pysam_9libcfaidx_FastqFile = { | |
18027 PyVarObject_HEAD_INIT(0, 0) | |
18028 "pysam.libcfaidx.""FastqFile", /*tp_name*/ | |
18029 sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastqFile), /*tp_basicsize*/ | |
18030 0, /*tp_itemsize*/ | |
18031 __pyx_tp_dealloc_5pysam_9libcfaidx_FastxFile, /*tp_dealloc*/ | |
18032 #if PY_VERSION_HEX < 0x030800b4 | |
18033 0, /*tp_print*/ | |
18034 #endif | |
18035 #if PY_VERSION_HEX >= 0x030800b4 | |
18036 0, /*tp_vectorcall_offset*/ | |
18037 #endif | |
18038 0, /*tp_getattr*/ | |
18039 0, /*tp_setattr*/ | |
18040 #if PY_MAJOR_VERSION < 3 | |
18041 0, /*tp_compare*/ | |
18042 #endif | |
18043 #if PY_MAJOR_VERSION >= 3 | |
18044 0, /*tp_as_async*/ | |
18045 #endif | |
18046 0, /*tp_repr*/ | |
18047 0, /*tp_as_number*/ | |
18048 0, /*tp_as_sequence*/ | |
18049 0, /*tp_as_mapping*/ | |
18050 0, /*tp_hash*/ | |
18051 0, /*tp_call*/ | |
18052 0, /*tp_str*/ | |
18053 0, /*tp_getattro*/ | |
18054 0, /*tp_setattro*/ | |
18055 0, /*tp_as_buffer*/ | |
18056 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | |
18057 PyDoc_STR("FastqFile is deprecated: use FastxFile instead"), /*tp_doc*/ | |
18058 __pyx_tp_traverse_5pysam_9libcfaidx_FastxFile, /*tp_traverse*/ | |
18059 __pyx_tp_clear_5pysam_9libcfaidx_FastxFile, /*tp_clear*/ | |
18060 0, /*tp_richcompare*/ | |
18061 0, /*tp_weaklistoffset*/ | |
18062 #if CYTHON_COMPILING_IN_PYPY || 0 | |
18063 __pyx_pw_5pysam_9libcfaidx_9FastxFile_15__iter__, /*tp_iter*/ | |
18064 #else | |
18065 0, /*tp_iter*/ | |
18066 #endif | |
18067 #if CYTHON_COMPILING_IN_PYPY || 0 | |
18068 __pyx_pw_5pysam_9libcfaidx_9FastxFile_17__next__, /*tp_iternext*/ | |
18069 #else | |
18070 0, /*tp_iternext*/ | |
18071 #endif | |
18072 __pyx_methods_5pysam_9libcfaidx_FastqFile, /*tp_methods*/ | |
18073 0, /*tp_members*/ | |
18074 0, /*tp_getset*/ | |
18075 0, /*tp_base*/ | |
18076 0, /*tp_dict*/ | |
18077 0, /*tp_descr_get*/ | |
18078 0, /*tp_descr_set*/ | |
18079 #if !CYTHON_USE_TYPE_SPECS | |
18080 0, /*tp_dictoffset*/ | |
18081 #endif | |
18082 0, /*tp_init*/ | |
18083 0, /*tp_alloc*/ | |
18084 __pyx_tp_new_5pysam_9libcfaidx_FastqFile, /*tp_new*/ | |
18085 0, /*tp_free*/ | |
18086 0, /*tp_is_gc*/ | |
18087 0, /*tp_bases*/ | |
18088 0, /*tp_mro*/ | |
18089 0, /*tp_cache*/ | |
18090 0, /*tp_subclasses*/ | |
18091 0, /*tp_weaklist*/ | |
18092 0, /*tp_del*/ | |
18093 0, /*tp_version_tag*/ | |
18094 #if PY_VERSION_HEX >= 0x030400a1 | |
18095 #if CYTHON_USE_TP_FINALIZE | |
18096 0, /*tp_finalize*/ | |
18097 #else | |
18098 NULL, /*tp_finalize*/ | |
18099 #endif | |
18100 #endif | |
18101 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
18102 0, /*tp_vectorcall*/ | |
18103 #endif | |
18104 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
18105 0, /*tp_print*/ | |
18106 #endif | |
18107 #if PY_VERSION_HEX >= 0x030C0000 | |
18108 0, /*tp_watched*/ | |
18109 #endif | |
18110 #if PY_VERSION_HEX >= 0x030d00A4 | |
18111 0, /*tp_versions_used*/ | |
18112 #endif | |
18113 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
18114 0, /*tp_pypy_flags*/ | |
18115 #endif | |
18116 }; | |
18117 #endif | |
18118 static struct __pyx_vtabstruct_5pysam_9libcfaidx_Fastafile __pyx_vtable_5pysam_9libcfaidx_Fastafile; | |
18119 | |
18120 static PyObject *__pyx_tp_new_5pysam_9libcfaidx_Fastafile(PyTypeObject *t, PyObject *a, PyObject *k) { | |
18121 struct __pyx_obj_5pysam_9libcfaidx_Fastafile *p; | |
18122 PyObject *o = __pyx_tp_new_5pysam_9libcfaidx_FastaFile(t, a, k); | |
18123 if (unlikely(!o)) return 0; | |
18124 p = ((struct __pyx_obj_5pysam_9libcfaidx_Fastafile *)o); | |
18125 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_9libcfaidx_FastaFile*)__pyx_vtabptr_5pysam_9libcfaidx_Fastafile; | |
18126 return o; | |
18127 } | |
18128 | |
18129 static PyMethodDef __pyx_methods_5pysam_9libcfaidx_Fastafile[] = { | |
18130 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9Fastafile_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9Fastafile___reduce_cython__}, | |
18131 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_9libcfaidx_9Fastafile_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_9libcfaidx_9Fastafile_2__setstate_cython__}, | |
18132 {0, 0, 0, 0} | |
18133 }; | |
18134 #if CYTHON_USE_TYPE_SPECS | |
18135 static PyType_Slot __pyx_type_5pysam_9libcfaidx_Fastafile_slots[] = { | |
18136 {Py_tp_doc, (void *)PyDoc_STR("Fastafile is deprecated: use FastaFile instead")}, | |
18137 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_9libcfaidx_FastaFile}, | |
18138 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_9libcfaidx_FastaFile}, | |
18139 {Py_tp_methods, (void *)__pyx_methods_5pysam_9libcfaidx_Fastafile}, | |
18140 {Py_tp_new, (void *)__pyx_tp_new_5pysam_9libcfaidx_Fastafile}, | |
18141 {0, 0}, | |
18142 }; | |
18143 static PyType_Spec __pyx_type_5pysam_9libcfaidx_Fastafile_spec = { | |
18144 "pysam.libcfaidx.Fastafile", | |
18145 sizeof(struct __pyx_obj_5pysam_9libcfaidx_Fastafile), | |
18146 0, | |
18147 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, | |
18148 __pyx_type_5pysam_9libcfaidx_Fastafile_slots, | |
18149 }; | |
18150 #else | |
18151 | |
18152 static PyTypeObject __pyx_type_5pysam_9libcfaidx_Fastafile = { | |
18153 PyVarObject_HEAD_INIT(0, 0) | |
18154 "pysam.libcfaidx.""Fastafile", /*tp_name*/ | |
18155 sizeof(struct __pyx_obj_5pysam_9libcfaidx_Fastafile), /*tp_basicsize*/ | |
18156 0, /*tp_itemsize*/ | |
18157 __pyx_tp_dealloc_5pysam_9libcfaidx_FastaFile, /*tp_dealloc*/ | |
18158 #if PY_VERSION_HEX < 0x030800b4 | |
18159 0, /*tp_print*/ | |
18160 #endif | |
18161 #if PY_VERSION_HEX >= 0x030800b4 | |
18162 0, /*tp_vectorcall_offset*/ | |
18163 #endif | |
18164 0, /*tp_getattr*/ | |
18165 0, /*tp_setattr*/ | |
18166 #if PY_MAJOR_VERSION < 3 | |
18167 0, /*tp_compare*/ | |
18168 #endif | |
18169 #if PY_MAJOR_VERSION >= 3 | |
18170 0, /*tp_as_async*/ | |
18171 #endif | |
18172 0, /*tp_repr*/ | |
18173 0, /*tp_as_number*/ | |
18174 0, /*tp_as_sequence*/ | |
18175 0, /*tp_as_mapping*/ | |
18176 0, /*tp_hash*/ | |
18177 0, /*tp_call*/ | |
18178 0, /*tp_str*/ | |
18179 0, /*tp_getattro*/ | |
18180 0, /*tp_setattro*/ | |
18181 0, /*tp_as_buffer*/ | |
18182 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ | |
18183 PyDoc_STR("Fastafile is deprecated: use FastaFile instead"), /*tp_doc*/ | |
18184 __pyx_tp_traverse_5pysam_9libcfaidx_FastaFile, /*tp_traverse*/ | |
18185 __pyx_tp_clear_5pysam_9libcfaidx_FastaFile, /*tp_clear*/ | |
18186 0, /*tp_richcompare*/ | |
18187 0, /*tp_weaklistoffset*/ | |
18188 0, /*tp_iter*/ | |
18189 0, /*tp_iternext*/ | |
18190 __pyx_methods_5pysam_9libcfaidx_Fastafile, /*tp_methods*/ | |
18191 0, /*tp_members*/ | |
18192 0, /*tp_getset*/ | |
18193 0, /*tp_base*/ | |
18194 0, /*tp_dict*/ | |
18195 0, /*tp_descr_get*/ | |
18196 0, /*tp_descr_set*/ | |
18197 #if !CYTHON_USE_TYPE_SPECS | |
18198 0, /*tp_dictoffset*/ | |
18199 #endif | |
18200 0, /*tp_init*/ | |
18201 0, /*tp_alloc*/ | |
18202 __pyx_tp_new_5pysam_9libcfaidx_Fastafile, /*tp_new*/ | |
18203 0, /*tp_free*/ | |
18204 0, /*tp_is_gc*/ | |
18205 0, /*tp_bases*/ | |
18206 0, /*tp_mro*/ | |
18207 0, /*tp_cache*/ | |
18208 0, /*tp_subclasses*/ | |
18209 0, /*tp_weaklist*/ | |
18210 0, /*tp_del*/ | |
18211 0, /*tp_version_tag*/ | |
18212 #if PY_VERSION_HEX >= 0x030400a1 | |
18213 #if CYTHON_USE_TP_FINALIZE | |
18214 0, /*tp_finalize*/ | |
18215 #else | |
18216 NULL, /*tp_finalize*/ | |
18217 #endif | |
18218 #endif | |
18219 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
18220 0, /*tp_vectorcall*/ | |
18221 #endif | |
18222 #if __PYX_NEED_TP_PRINT_SLOT == 1 | |
18223 0, /*tp_print*/ | |
18224 #endif | |
18225 #if PY_VERSION_HEX >= 0x030C0000 | |
18226 0, /*tp_watched*/ | |
18227 #endif | |
18228 #if PY_VERSION_HEX >= 0x030d00A4 | |
18229 0, /*tp_versions_used*/ | |
18230 #endif | |
18231 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
18232 0, /*tp_pypy_flags*/ | |
18233 #endif | |
18234 }; | |
18235 #endif | |
18236 | |
18237 static PyMethodDef __pyx_methods[] = { | |
18238 {0, 0, 0, 0} | |
18239 }; | |
18240 #ifndef CYTHON_SMALL_CODE | |
18241 #if defined(__clang__) | |
18242 #define CYTHON_SMALL_CODE | |
18243 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) | |
18244 #define CYTHON_SMALL_CODE __attribute__((cold)) | |
18245 #else | |
18246 #define CYTHON_SMALL_CODE | |
18247 #endif | |
18248 #endif | |
18249 /* #### Code section: pystring_table ### */ | |
18250 | |
18251 static int __Pyx_CreateStringTabAndInitStrings(void) { | |
18252 __Pyx_StringTabEntry __pyx_string_tab[] = { | |
18253 {&__pyx_n_s_FastaFile, __pyx_k_FastaFile, sizeof(__pyx_k_FastaFile), 0, 0, 1, 1}, | |
18254 {&__pyx_n_u_FastaFile, __pyx_k_FastaFile, sizeof(__pyx_k_FastaFile), 0, 1, 0, 1}, | |
18255 {&__pyx_n_s_FastaFile___enter, __pyx_k_FastaFile___enter, sizeof(__pyx_k_FastaFile___enter), 0, 0, 1, 1}, | |
18256 {&__pyx_n_s_FastaFile___exit, __pyx_k_FastaFile___exit, sizeof(__pyx_k_FastaFile___exit), 0, 0, 1, 1}, | |
18257 {&__pyx_n_s_FastaFile___reduce_cython, __pyx_k_FastaFile___reduce_cython, sizeof(__pyx_k_FastaFile___reduce_cython), 0, 0, 1, 1}, | |
18258 {&__pyx_n_s_FastaFile___setstate_cython, __pyx_k_FastaFile___setstate_cython, sizeof(__pyx_k_FastaFile___setstate_cython), 0, 0, 1, 1}, | |
18259 {&__pyx_n_s_FastaFile__open, __pyx_k_FastaFile__open, sizeof(__pyx_k_FastaFile__open), 0, 0, 1, 1}, | |
18260 {&__pyx_n_s_FastaFile_close, __pyx_k_FastaFile_close, sizeof(__pyx_k_FastaFile_close), 0, 0, 1, 1}, | |
18261 {&__pyx_n_s_FastaFile_fetch, __pyx_k_FastaFile_fetch, sizeof(__pyx_k_FastaFile_fetch), 0, 0, 1, 1}, | |
18262 {&__pyx_n_s_FastaFile_get_reference_length, __pyx_k_FastaFile_get_reference_length, sizeof(__pyx_k_FastaFile_get_reference_length), 0, 0, 1, 1}, | |
18263 {&__pyx_n_s_FastaFile_is_open, __pyx_k_FastaFile_is_open, sizeof(__pyx_k_FastaFile_is_open), 0, 0, 1, 1}, | |
18264 {&__pyx_n_s_Fastafile, __pyx_k_Fastafile, sizeof(__pyx_k_Fastafile), 0, 0, 1, 1}, | |
18265 {&__pyx_n_u_Fastafile, __pyx_k_Fastafile, sizeof(__pyx_k_Fastafile), 0, 1, 0, 1}, | |
18266 {&__pyx_n_s_Fastafile___reduce_cython, __pyx_k_Fastafile___reduce_cython, sizeof(__pyx_k_Fastafile___reduce_cython), 0, 0, 1, 1}, | |
18267 {&__pyx_n_s_Fastafile___setstate_cython, __pyx_k_Fastafile___setstate_cython, sizeof(__pyx_k_Fastafile___setstate_cython), 0, 0, 1, 1}, | |
18268 {&__pyx_n_s_FastqFile, __pyx_k_FastqFile, sizeof(__pyx_k_FastqFile), 0, 0, 1, 1}, | |
18269 {&__pyx_n_u_FastqFile, __pyx_k_FastqFile, sizeof(__pyx_k_FastqFile), 0, 1, 0, 1}, | |
18270 {&__pyx_n_s_FastqFile___reduce_cython, __pyx_k_FastqFile___reduce_cython, sizeof(__pyx_k_FastqFile___reduce_cython), 0, 0, 1, 1}, | |
18271 {&__pyx_n_s_FastqFile___setstate_cython, __pyx_k_FastqFile___setstate_cython, sizeof(__pyx_k_FastqFile___setstate_cython), 0, 0, 1, 1}, | |
18272 {&__pyx_n_s_FastqProxy, __pyx_k_FastqProxy, sizeof(__pyx_k_FastqProxy), 0, 0, 1, 1}, | |
18273 {&__pyx_n_u_FastqProxy, __pyx_k_FastqProxy, sizeof(__pyx_k_FastqProxy), 0, 1, 0, 1}, | |
18274 {&__pyx_n_s_FastqProxy___reduce_cython, __pyx_k_FastqProxy___reduce_cython, sizeof(__pyx_k_FastqProxy___reduce_cython), 0, 0, 1, 1}, | |
18275 {&__pyx_n_s_FastqProxy___setstate_cython, __pyx_k_FastqProxy___setstate_cython, sizeof(__pyx_k_FastqProxy___setstate_cython), 0, 0, 1, 1}, | |
18276 {&__pyx_n_s_FastqProxy_get_quality_array, __pyx_k_FastqProxy_get_quality_array, sizeof(__pyx_k_FastqProxy_get_quality_array), 0, 0, 1, 1}, | |
18277 {&__pyx_n_s_FastxFile, __pyx_k_FastxFile, sizeof(__pyx_k_FastxFile), 0, 0, 1, 1}, | |
18278 {&__pyx_n_u_FastxFile, __pyx_k_FastxFile, sizeof(__pyx_k_FastxFile), 0, 1, 0, 1}, | |
18279 {&__pyx_n_s_FastxFile___enter, __pyx_k_FastxFile___enter, sizeof(__pyx_k_FastxFile___enter), 0, 0, 1, 1}, | |
18280 {&__pyx_n_s_FastxFile___exit, __pyx_k_FastxFile___exit, sizeof(__pyx_k_FastxFile___exit), 0, 0, 1, 1}, | |
18281 {&__pyx_n_s_FastxFile___reduce_cython, __pyx_k_FastxFile___reduce_cython, sizeof(__pyx_k_FastxFile___reduce_cython), 0, 0, 1, 1}, | |
18282 {&__pyx_n_s_FastxFile___setstate_cython, __pyx_k_FastxFile___setstate_cython, sizeof(__pyx_k_FastxFile___setstate_cython), 0, 0, 1, 1}, | |
18283 {&__pyx_n_s_FastxFile__open, __pyx_k_FastxFile__open, sizeof(__pyx_k_FastxFile__open), 0, 0, 1, 1}, | |
18284 {&__pyx_n_s_FastxFile_close, __pyx_k_FastxFile_close, sizeof(__pyx_k_FastxFile_close), 0, 0, 1, 1}, | |
18285 {&__pyx_n_s_FastxFile_is_open, __pyx_k_FastxFile_is_open, sizeof(__pyx_k_FastxFile_is_open), 0, 0, 1, 1}, | |
18286 {&__pyx_n_s_FastxRecord, __pyx_k_FastxRecord, sizeof(__pyx_k_FastxRecord), 0, 0, 1, 1}, | |
18287 {&__pyx_n_u_FastxRecord, __pyx_k_FastxRecord, sizeof(__pyx_k_FastxRecord), 0, 1, 0, 1}, | |
18288 {&__pyx_n_s_FastxRecord___copy, __pyx_k_FastxRecord___copy, sizeof(__pyx_k_FastxRecord___copy), 0, 0, 1, 1}, | |
18289 {&__pyx_n_s_FastxRecord___deepcopy, __pyx_k_FastxRecord___deepcopy, sizeof(__pyx_k_FastxRecord___deepcopy), 0, 0, 1, 1}, | |
18290 {&__pyx_n_s_FastxRecord___reduce_cython, __pyx_k_FastxRecord___reduce_cython, sizeof(__pyx_k_FastxRecord___reduce_cython), 0, 0, 1, 1}, | |
18291 {&__pyx_n_s_FastxRecord___setstate_cython, __pyx_k_FastxRecord___setstate_cython, sizeof(__pyx_k_FastxRecord___setstate_cython), 0, 0, 1, 1}, | |
18292 {&__pyx_n_s_FastxRecord_get_quality_array, __pyx_k_FastxRecord_get_quality_array, sizeof(__pyx_k_FastxRecord_get_quality_array), 0, 0, 1, 1}, | |
18293 {&__pyx_kp_u_FastxRecord_must_have_a_name_and, __pyx_k_FastxRecord_must_have_a_name_and, sizeof(__pyx_k_FastxRecord_must_have_a_name_and), 0, 1, 0, 0}, | |
18294 {&__pyx_n_s_FastxRecord_set_comment, __pyx_k_FastxRecord_set_comment, sizeof(__pyx_k_FastxRecord_set_comment), 0, 0, 1, 1}, | |
18295 {&__pyx_n_s_FastxRecord_set_name, __pyx_k_FastxRecord_set_name, sizeof(__pyx_k_FastxRecord_set_name), 0, 0, 1, 1}, | |
18296 {&__pyx_n_s_FastxRecord_set_sequence, __pyx_k_FastxRecord_set_sequence, sizeof(__pyx_k_FastxRecord_set_sequence), 0, 0, 1, 1}, | |
18297 {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, | |
18298 {&__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}, | |
18299 {&__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}, | |
18300 {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, | |
18301 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, | |
18302 {&__pyx_kp_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 0}, | |
18303 {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, | |
18304 {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, | |
18305 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, | |
18306 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, | |
18307 {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, | |
18308 {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0}, | |
18309 {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0}, | |
18310 {&__pyx_kp_u__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0, 0}, | |
18311 {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0}, | |
18312 {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0}, | |
18313 {&__pyx_kp_u__47, __pyx_k__47, sizeof(__pyx_k__47), 0, 1, 0, 0}, | |
18314 {&__pyx_n_s__48, __pyx_k__48, sizeof(__pyx_k__48), 0, 0, 1, 1}, | |
18315 {&__pyx_n_s__68, __pyx_k__68, sizeof(__pyx_k__68), 0, 0, 1, 1}, | |
18316 {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, | |
18317 {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, | |
18318 {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, | |
18319 {&__pyx_n_s_bindex_filename, __pyx_k_bindex_filename, sizeof(__pyx_k_bindex_filename), 0, 0, 1, 1}, | |
18320 {&__pyx_n_s_bindex_filename_compressed, __pyx_k_bindex_filename_compressed, sizeof(__pyx_k_bindex_filename_compressed), 0, 0, 1, 1}, | |
18321 {&__pyx_kp_u_calling_len_on_closed_file, __pyx_k_calling_len_on_closed_file, sizeof(__pyx_k_calling_len_on_closed_file), 0, 1, 0, 0}, | |
18322 {&__pyx_kp_u_can_not_write_record_without_a_s, __pyx_k_can_not_write_record_without_a_s, sizeof(__pyx_k_can_not_write_record_without_a_s), 0, 1, 0, 0}, | |
18323 {&__pyx_kp_u_can_not_write_record_without_nam, __pyx_k_can_not_write_record_without_nam, sizeof(__pyx_k_can_not_write_record_without_nam), 0, 1, 0, 0}, | |
18324 {&__pyx_n_s_cfilename, __pyx_k_cfilename, sizeof(__pyx_k_cfilename), 0, 0, 1, 1}, | |
18325 {&__pyx_n_s_cindexname, __pyx_k_cindexname, sizeof(__pyx_k_cindexname), 0, 0, 1, 1}, | |
18326 {&__pyx_n_s_cindexname_compressed, __pyx_k_cindexname_compressed, sizeof(__pyx_k_cindexname_compressed), 0, 0, 1, 1}, | |
18327 {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, | |
18328 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, | |
18329 {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, | |
18330 {&__pyx_n_s_comment, __pyx_k_comment, sizeof(__pyx_k_comment), 0, 0, 1, 1}, | |
18331 {&__pyx_n_s_contig, __pyx_k_contig, sizeof(__pyx_k_contig), 0, 0, 1, 1}, | |
18332 {&__pyx_n_s_contig_b, __pyx_k_contig_b, sizeof(__pyx_k_contig_b), 0, 0, 1, 1}, | |
18333 {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, | |
18334 {&__pyx_n_s_deepcopy, __pyx_k_deepcopy, sizeof(__pyx_k_deepcopy), 0, 0, 1, 1}, | |
18335 {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, | |
18336 {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, | |
18337 {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, | |
18338 {&__pyx_kp_u_do_not_instantiate_FastqProxy_di, __pyx_k_do_not_instantiate_FastqProxy_di, sizeof(__pyx_k_do_not_instantiate_FastqProxy_di), 0, 1, 0, 0}, | |
18339 {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, | |
18340 {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, | |
18341 {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, | |
18342 {&__pyx_kp_u_error_when_opening_file_s, __pyx_k_error_when_opening_file_s, sizeof(__pyx_k_error_when_opening_file_s), 0, 1, 0, 0}, | |
18343 {&__pyx_n_s_exc_type, __pyx_k_exc_type, sizeof(__pyx_k_exc_type), 0, 0, 1, 1}, | |
18344 {&__pyx_n_s_exc_value, __pyx_k_exc_value, sizeof(__pyx_k_exc_value), 0, 0, 1, 1}, | |
18345 {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1}, | |
18346 {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, | |
18347 {&__pyx_kp_u_failure_when_retrieving_sequence, __pyx_k_failure_when_retrieving_sequence, sizeof(__pyx_k_failure_when_retrieving_sequence), 0, 1, 0, 0}, | |
18348 {&__pyx_n_s_fetch, __pyx_k_fetch, sizeof(__pyx_k_fetch), 0, 0, 1, 1}, | |
18349 {&__pyx_kp_u_file_s_not_found, __pyx_k_file_s_not_found, sizeof(__pyx_k_file_s_not_found), 0, 1, 0, 0}, | |
18350 {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, | |
18351 {&__pyx_kp_u_filename_does_not_exist, __pyx_k_filename_does_not_exist, sizeof(__pyx_k_filename_does_not_exist), 0, 1, 0, 0}, | |
18352 {&__pyx_n_s_filepath_index, __pyx_k_filepath_index, sizeof(__pyx_k_filepath_index), 0, 0, 1, 1}, | |
18353 {&__pyx_n_s_filepath_index_compressed, __pyx_k_filepath_index_compressed, sizeof(__pyx_k_filepath_index_compressed), 0, 0, 1, 1}, | |
18354 {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, | |
18355 {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, | |
18356 {&__pyx_n_s_get_quality_array, __pyx_k_get_quality_array, sizeof(__pyx_k_get_quality_array), 0, 0, 1, 1}, | |
18357 {&__pyx_n_s_get_reference_length, __pyx_k_get_reference_length, sizeof(__pyx_k_get_reference_length), 0, 0, 1, 1}, | |
18358 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, | |
18359 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, | |
18360 {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, | |
18361 {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, | |
18362 {&__pyx_n_s_is_open, __pyx_k_is_open, sizeof(__pyx_k_is_open), 0, 0, 1, 1}, | |
18363 {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, | |
18364 {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, | |
18365 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, | |
18366 {&__pyx_n_s_memo, __pyx_k_memo, sizeof(__pyx_k_memo), 0, 0, 1, 1}, | |
18367 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, | |
18368 {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, | |
18369 {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, | |
18370 {&__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}, | |
18371 {&__pyx_kp_u_no_sequence_region_supplied, __pyx_k_no_sequence_region_supplied, sizeof(__pyx_k_no_sequence_region_supplied), 0, 1, 0, 0}, | |
18372 {&__pyx_n_s_nreferences, __pyx_k_nreferences, sizeof(__pyx_k_nreferences), 0, 0, 1, 1}, | |
18373 {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, | |
18374 {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, | |
18375 {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, | |
18376 {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, | |
18377 {&__pyx_n_s_persist, __pyx_k_persist, sizeof(__pyx_k_persist), 0, 0, 1, 1}, | |
18378 {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, | |
18379 {&__pyx_n_s_proxy, __pyx_k_proxy, sizeof(__pyx_k_proxy), 0, 0, 1, 1}, | |
18380 {&__pyx_n_s_pysam_libcfaidx, __pyx_k_pysam_libcfaidx, sizeof(__pyx_k_pysam_libcfaidx), 0, 0, 1, 1}, | |
18381 {&__pyx_kp_s_pysam_libcfaidx_pyx, __pyx_k_pysam_libcfaidx_pyx, sizeof(__pyx_k_pysam_libcfaidx_pyx), 0, 0, 1, 0}, | |
18382 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, | |
18383 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, | |
18384 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, | |
18385 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, | |
18386 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, | |
18387 {&__pyx_n_s_pyx_unpickle_FastxRecord, __pyx_k_pyx_unpickle_FastxRecord, sizeof(__pyx_k_pyx_unpickle_FastxRecord), 0, 0, 1, 1}, | |
18388 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, | |
18389 {&__pyx_n_s_quality, __pyx_k_quality, sizeof(__pyx_k_quality), 0, 0, 1, 1}, | |
18390 {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, | |
18391 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, | |
18392 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, | |
18393 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, | |
18394 {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1}, | |
18395 {&__pyx_n_s_reference, __pyx_k_reference, sizeof(__pyx_k_reference), 0, 0, 1, 1}, | |
18396 {&__pyx_n_s_references, __pyx_k_references, sizeof(__pyx_k_references), 0, 0, 1, 1}, | |
18397 {&__pyx_n_s_region, __pyx_k_region, sizeof(__pyx_k_region), 0, 0, 1, 1}, | |
18398 {&__pyx_n_s_rend, __pyx_k_rend, sizeof(__pyx_k_rend), 0, 0, 1, 1}, | |
18399 {&__pyx_n_s_rstart, __pyx_k_rstart, sizeof(__pyx_k_rstart), 0, 0, 1, 1}, | |
18400 {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0}, | |
18401 {&__pyx_n_s_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 0, 1, 1}, | |
18402 {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, | |
18403 {&__pyx_kp_s_self__delegate_cannot_be_convert, __pyx_k_self__delegate_cannot_be_convert, sizeof(__pyx_k_self__delegate_cannot_be_convert), 0, 0, 1, 0}, | |
18404 {&__pyx_n_s_seq, __pyx_k_seq, sizeof(__pyx_k_seq), 0, 0, 1, 1}, | |
18405 {&__pyx_n_s_sequence, __pyx_k_sequence, sizeof(__pyx_k_sequence), 0, 0, 1, 1}, | |
18406 {&__pyx_kp_u_sequence_and_quality_length_do_n, __pyx_k_sequence_and_quality_length_do_n, sizeof(__pyx_k_sequence_and_quality_length_do_n), 0, 1, 0, 0}, | |
18407 {&__pyx_kp_u_sequence_s_not_present, __pyx_k_sequence_s_not_present, sizeof(__pyx_k_sequence_s_not_present), 0, 1, 0, 0}, | |
18408 {&__pyx_n_s_set_comment, __pyx_k_set_comment, sizeof(__pyx_k_set_comment), 0, 0, 1, 1}, | |
18409 {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, | |
18410 {&__pyx_n_s_set_sequence, __pyx_k_set_sequence, sizeof(__pyx_k_set_sequence), 0, 0, 1, 1}, | |
18411 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, | |
18412 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, | |
18413 {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, | |
18414 {&__pyx_n_s_ss, __pyx_k_ss, sizeof(__pyx_k_ss), 0, 0, 1, 1}, | |
18415 {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, | |
18416 {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, | |
18417 {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, | |
18418 {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, | |
18419 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, | |
18420 {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1}, | |
18421 {&__pyx_kp_u_truncated_quality_string_in_0, __pyx_k_truncated_quality_string_in_0, sizeof(__pyx_k_truncated_quality_string_in_0), 0, 1, 0, 0}, | |
18422 {&__pyx_kp_u_unknown_problem_parsing_0, __pyx_k_unknown_problem_parsing_0, sizeof(__pyx_k_unknown_problem_parsing_0), 0, 1, 0, 0}, | |
18423 {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, | |
18424 {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1}, | |
18425 {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, | |
18426 {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, | |
18427 {0, 0, 0, 0, 0, 0, 0} | |
18428 }; | |
18429 return __Pyx_InitStrings(__pyx_string_tab); | |
18430 } | |
18431 /* #### Code section: cached_builtins ### */ | |
18432 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { | |
18433 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 129, __pyx_L1_error) | |
18434 __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 153, __pyx_L1_error) | |
18435 __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 193, __pyx_L1_error) | |
18436 __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 301, __pyx_L1_error) | |
18437 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) | |
18438 __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 649, __pyx_L1_error) | |
18439 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 120, __pyx_L1_error) | |
18440 return 0; | |
18441 __pyx_L1_error:; | |
18442 return -1; | |
18443 } | |
18444 /* #### Code section: cached_constants ### */ | |
18445 | |
18446 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { | |
18447 __Pyx_RefNannyDeclarations | |
18448 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); | |
18449 | |
18450 /* "pysam/libcfaidx.pyx":129 | |
18451 * def __len__(self): | |
18452 * if self.fastafile == NULL: | |
18453 * raise ValueError("calling len() on closed file") # <<<<<<<<<<<<<< | |
18454 * | |
18455 * return faidx_nseq(self.fastafile) | |
18456 */ | |
18457 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_calling_len_on_closed_file); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 129, __pyx_L1_error) | |
18458 __Pyx_GOTREF(__pyx_tuple__2); | |
18459 __Pyx_GIVEREF(__pyx_tuple__2); | |
18460 | |
18461 /* "pysam/libcfaidx.pyx":281 | |
18462 * | |
18463 * if not self.is_open(): | |
18464 * raise ValueError("I/O operation on closed file" ) # <<<<<<<<<<<<<< | |
18465 * | |
18466 * cdef int length | |
18467 */ | |
18468 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 281, __pyx_L1_error) | |
18469 __Pyx_GOTREF(__pyx_tuple__9); | |
18470 __Pyx_GIVEREF(__pyx_tuple__9); | |
18471 | |
18472 /* "pysam/libcfaidx.pyx":291 | |
18473 * | |
18474 * if contig is None: | |
18475 * raise ValueError("no sequence/region supplied.") # <<<<<<<<<<<<<< | |
18476 * | |
18477 * if rstart == rend: | |
18478 */ | |
18479 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_no_sequence_region_supplied); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 291, __pyx_L1_error) | |
18480 __Pyx_GOTREF(__pyx_tuple__10); | |
18481 __Pyx_GIVEREF(__pyx_tuple__10); | |
18482 | |
18483 /* "pysam/libcfaidx.pyx":358 | |
18484 * """A single entry in a fastq file.""" | |
18485 * def __init__(self): | |
18486 * raise ValueError("do not instantiate FastqProxy directly") # <<<<<<<<<<<<<< | |
18487 * | |
18488 * property name: | |
18489 */ | |
18490 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_do_not_instantiate_FastqProxy_di); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 358, __pyx_L1_error) | |
18491 __Pyx_GOTREF(__pyx_tuple__15); | |
18492 __Pyx_GIVEREF(__pyx_tuple__15); | |
18493 | |
18494 /* "pysam/libcfaidx.pyx":443 | |
18495 * cdef cython.str to_string(self): | |
18496 * if self.name is None: | |
18497 * raise ValueError("can not write record without name") # <<<<<<<<<<<<<< | |
18498 * | |
18499 * if self.sequence is None: | |
18500 */ | |
18501 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_can_not_write_record_without_nam); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 443, __pyx_L1_error) | |
18502 __Pyx_GOTREF(__pyx_tuple__25); | |
18503 __Pyx_GIVEREF(__pyx_tuple__25); | |
18504 | |
18505 /* "pysam/libcfaidx.pyx":446 | |
18506 * | |
18507 * if self.sequence is None: | |
18508 * raise ValueError("can not write record without a sequence") # <<<<<<<<<<<<<< | |
18509 * | |
18510 * if self.comment is None: | |
18511 */ | |
18512 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_can_not_write_record_without_a_s); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 446, __pyx_L1_error) | |
18513 __Pyx_GOTREF(__pyx_tuple__26); | |
18514 __Pyx_GIVEREF(__pyx_tuple__26); | |
18515 | |
18516 /* "pysam/libcfaidx.pyx":465 | |
18517 * def set_name(self, name): | |
18518 * if name is None: | |
18519 * raise ValueError("FastxRecord must have a name and not None") # <<<<<<<<<<<<<< | |
18520 * self.name = name | |
18521 * | |
18522 */ | |
18523 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_FastxRecord_must_have_a_name_and); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 465, __pyx_L1_error) | |
18524 __Pyx_GOTREF(__pyx_tuple__28); | |
18525 __Pyx_GIVEREF(__pyx_tuple__28); | |
18526 | |
18527 /* "(tree fragment)":4 | |
18528 * cdef object __pyx_PickleError | |
18529 * cdef object __pyx_result | |
18530 * if __pyx_checksum not in (0x1bdb611, 0xb688a86, 0x43fd151): # <<<<<<<<<<<<<< | |
18531 * from pickle import PickleError as __pyx_PickleError | |
18532 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x1bdb611, 0xb688a86, 0x43fd151) = (comment, name, quality, sequence))" % __pyx_checksum | |
18533 */ | |
18534 __pyx_tuple__46 = PyTuple_Pack(3, __pyx_int_29210129, __pyx_int_191400582, __pyx_int_71291217); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 4, __pyx_L1_error) | |
18535 __Pyx_GOTREF(__pyx_tuple__46); | |
18536 __Pyx_GIVEREF(__pyx_tuple__46); | |
18537 | |
18538 /* "pysam/libcfaidx.pyx":123 | |
18539 * self._open(*args, **kwargs) | |
18540 * | |
18541 * def is_open(self): # <<<<<<<<<<<<<< | |
18542 * '''return true if samfile has been opened.''' | |
18543 * return self.fastafile != NULL | |
18544 */ | |
18545 __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 123, __pyx_L1_error) | |
18546 __Pyx_GOTREF(__pyx_tuple__49); | |
18547 __Pyx_GIVEREF(__pyx_tuple__49); | |
18548 __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_is_open, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 123, __pyx_L1_error) | |
18549 | |
18550 /* "pysam/libcfaidx.pyx":133 | |
18551 * return faidx_nseq(self.fastafile) | |
18552 * | |
18553 * def _open(self, filename, filepath_index=None, filepath_index_compressed=None): # <<<<<<<<<<<<<< | |
18554 * '''open an indexed fasta file. | |
18555 * | |
18556 */ | |
18557 __pyx_tuple__50 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_filepath_index, __pyx_n_s_filepath_index_compressed, __pyx_n_s_cfilename, __pyx_n_s_cindexname, __pyx_n_s_cindexname_compressed, __pyx_n_s_bindex_filename, __pyx_n_s_bindex_filename_compressed, __pyx_n_s_nreferences, __pyx_n_s_x, __pyx_n_s_s_2, __pyx_n_s_ss); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 133, __pyx_L1_error) | |
18558 __Pyx_GOTREF(__pyx_tuple__50); | |
18559 __Pyx_GIVEREF(__pyx_tuple__50); | |
18560 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_open, 133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 133, __pyx_L1_error) | |
18561 __pyx_tuple__51 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 133, __pyx_L1_error) | |
18562 __Pyx_GOTREF(__pyx_tuple__51); | |
18563 __Pyx_GIVEREF(__pyx_tuple__51); | |
18564 | |
18565 /* "pysam/libcfaidx.pyx":195 | |
18566 * self.reference2length = dict(zip(self._references, self._lengths)) | |
18567 * | |
18568 * def close(self): # <<<<<<<<<<<<<< | |
18569 * """close the file.""" | |
18570 * if self.fastafile != NULL: | |
18571 */ | |
18572 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_close, 195, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 195, __pyx_L1_error) | |
18573 | |
18574 /* "pysam/libcfaidx.pyx":207 | |
18575 * | |
18576 * # context manager interface | |
18577 * def __enter__(self): # <<<<<<<<<<<<<< | |
18578 * return self | |
18579 * | |
18580 */ | |
18581 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_enter, 207, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 207, __pyx_L1_error) | |
18582 | |
18583 /* "pysam/libcfaidx.pyx":210 | |
18584 * return self | |
18585 * | |
18586 * def __exit__(self, exc_type, exc_value, traceback): # <<<<<<<<<<<<<< | |
18587 * self.close() | |
18588 * return False | |
18589 */ | |
18590 __pyx_tuple__52 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_value, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 210, __pyx_L1_error) | |
18591 __Pyx_GOTREF(__pyx_tuple__52); | |
18592 __Pyx_GIVEREF(__pyx_tuple__52); | |
18593 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_exit, 210, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 210, __pyx_L1_error) | |
18594 | |
18595 /* "pysam/libcfaidx.pyx":242 | |
18596 * return self._lengths | |
18597 * | |
18598 * def fetch(self, # <<<<<<<<<<<<<< | |
18599 * reference=None, | |
18600 * start=None, | |
18601 */ | |
18602 __pyx_tuple__53 = 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_length, __pyx_n_s_seq, __pyx_n_s_ref, __pyx_n_s_rstart, __pyx_n_s_rend, __pyx_n_s_contig, __pyx_n_s_contig_b); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 242, __pyx_L1_error) | |
18603 __Pyx_GOTREF(__pyx_tuple__53); | |
18604 __Pyx_GIVEREF(__pyx_tuple__53); | |
18605 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_fetch, 242, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 242, __pyx_L1_error) | |
18606 __pyx_tuple__54 = PyTuple_Pack(4, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 242, __pyx_L1_error) | |
18607 __Pyx_GOTREF(__pyx_tuple__54); | |
18608 __Pyx_GIVEREF(__pyx_tuple__54); | |
18609 | |
18610 /* "pysam/libcfaidx.pyx":343 | |
18611 * return seq | |
18612 * | |
18613 * def get_reference_length(self, reference): # <<<<<<<<<<<<<< | |
18614 * '''return the length of reference.''' | |
18615 * return self.reference2length[reference] | |
18616 */ | |
18617 __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_reference); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 343, __pyx_L1_error) | |
18618 __Pyx_GOTREF(__pyx_tuple__55); | |
18619 __Pyx_GIVEREF(__pyx_tuple__55); | |
18620 __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__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_get_reference_length, 343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 343, __pyx_L1_error) | |
18621 | |
18622 /* "(tree fragment)":1 | |
18623 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
18624 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
18625 * def __setstate_cython__(self, __pyx_state): | |
18626 */ | |
18627 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __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) | |
18628 | |
18629 /* "(tree fragment)":3 | |
18630 * def __reduce_cython__(self): | |
18631 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
18632 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
18633 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
18634 */ | |
18635 __pyx_tuple__56 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 3, __pyx_L1_error) | |
18636 __Pyx_GOTREF(__pyx_tuple__56); | |
18637 __Pyx_GIVEREF(__pyx_tuple__56); | |
18638 __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__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 3, __pyx_L1_error) | |
18639 | |
18640 /* "pysam/libcfaidx.pyx":404 | |
18641 * return self.to_string() | |
18642 * | |
18643 * cpdef array.array get_quality_array(self, int offset=33): # <<<<<<<<<<<<<< | |
18644 * '''return quality values as integer array after subtracting offset.''' | |
18645 * if self.quality is None: | |
18646 */ | |
18647 __pyx_tuple__57 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 404, __pyx_L1_error) | |
18648 __Pyx_GOTREF(__pyx_tuple__57); | |
18649 __Pyx_GIVEREF(__pyx_tuple__57); | |
18650 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_get_quality_array, 404, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 404, __pyx_L1_error) | |
18651 __pyx_tuple__58 = PyTuple_Pack(1, __pyx_int_33); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 404, __pyx_L1_error) | |
18652 __Pyx_GOTREF(__pyx_tuple__58); | |
18653 __Pyx_GIVEREF(__pyx_tuple__58); | |
18654 | |
18655 /* "(tree fragment)":1 | |
18656 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
18657 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" | |
18658 * def __setstate_cython__(self, __pyx_state): | |
18659 */ | |
18660 __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__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 1, __pyx_L1_error) | |
18661 | |
18662 /* "(tree fragment)":3 | |
18663 * def __reduce_cython__(self): | |
18664 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" | |
18665 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
18666 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" | |
18667 */ | |
18668 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(1, 3, __pyx_L1_error) | |
18669 | |
18670 /* "pysam/libcfaidx.pyx":435 | |
18671 * self.name = name | |
18672 * | |
18673 * def __copy__(self): # <<<<<<<<<<<<<< | |
18674 * return FastxRecord(self.name, self.comment, self.sequence, self.quality) | |
18675 * | |
18676 */ | |
18677 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_copy, 435, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 435, __pyx_L1_error) | |
18678 | |
18679 /* "pysam/libcfaidx.pyx":438 | |
18680 * return FastxRecord(self.name, self.comment, self.sequence, self.quality) | |
18681 * | |
18682 * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< | |
18683 * return FastxRecord(self.name, self.comment, self.sequence, self.quality) | |
18684 * | |
18685 */ | |
18686 __pyx_tuple__59 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_memo); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 438, __pyx_L1_error) | |
18687 __Pyx_GOTREF(__pyx_tuple__59); | |
18688 __Pyx_GIVEREF(__pyx_tuple__59); | |
18689 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_deepcopy, 438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 438, __pyx_L1_error) | |
18690 | |
18691 /* "pysam/libcfaidx.pyx":463 | |
18692 * return self.to_string() | |
18693 * | |
18694 * def set_name(self, name): # <<<<<<<<<<<<<< | |
18695 * if name is None: | |
18696 * raise ValueError("FastxRecord must have a name and not None") | |
18697 */ | |
18698 __pyx_tuple__60 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 463, __pyx_L1_error) | |
18699 __Pyx_GOTREF(__pyx_tuple__60); | |
18700 __Pyx_GIVEREF(__pyx_tuple__60); | |
18701 __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_set_name, 463, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 463, __pyx_L1_error) | |
18702 | |
18703 /* "pysam/libcfaidx.pyx":468 | |
18704 * self.name = name | |
18705 * | |
18706 * def set_comment(self, comment): # <<<<<<<<<<<<<< | |
18707 * self.comment = comment | |
18708 * | |
18709 */ | |
18710 __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_comment); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 468, __pyx_L1_error) | |
18711 __Pyx_GOTREF(__pyx_tuple__61); | |
18712 __Pyx_GIVEREF(__pyx_tuple__61); | |
18713 __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_set_comment, 468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 468, __pyx_L1_error) | |
18714 | |
18715 /* "pysam/libcfaidx.pyx":471 | |
18716 * self.comment = comment | |
18717 * | |
18718 * def set_sequence(self, sequence, quality=None): # <<<<<<<<<<<<<< | |
18719 * """set sequence of this record. | |
18720 * | |
18721 */ | |
18722 __pyx_tuple__62 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_sequence, __pyx_n_s_quality); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 471, __pyx_L1_error) | |
18723 __Pyx_GOTREF(__pyx_tuple__62); | |
18724 __Pyx_GIVEREF(__pyx_tuple__62); | |
18725 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_set_sequence, 471, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 471, __pyx_L1_error) | |
18726 __pyx_tuple__63 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 471, __pyx_L1_error) | |
18727 __Pyx_GOTREF(__pyx_tuple__63); | |
18728 __Pyx_GIVEREF(__pyx_tuple__63); | |
18729 | |
18730 /* "pysam/libcfaidx.pyx":488 | |
18731 * return self.to_string() | |
18732 * | |
18733 * cpdef array.array get_quality_array(self, int offset=33): # <<<<<<<<<<<<<< | |
18734 * '''return quality values as array after subtracting offset.''' | |
18735 * if self.quality is None: | |
18736 */ | |
18737 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_get_quality_array, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 488, __pyx_L1_error) | |
18738 | |
18739 /* "(tree fragment)":1 | |
18740 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
18741 * cdef tuple state | |
18742 * cdef object _dict | |
18743 */ | |
18744 __pyx_tuple__64 = 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__64)) __PYX_ERR(1, 1, __pyx_L1_error) | |
18745 __Pyx_GOTREF(__pyx_tuple__64); | |
18746 __Pyx_GIVEREF(__pyx_tuple__64); | |
18747 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 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__32)) __PYX_ERR(1, 1, __pyx_L1_error) | |
18748 | |
18749 /* "(tree fragment)":16 | |
18750 * else: | |
18751 * return __pyx_unpickle_FastxRecord, (type(self), 0x1bdb611, state) | |
18752 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
18753 * __pyx_unpickle_FastxRecord__set_state(self, __pyx_state) | |
18754 */ | |
18755 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(1, 16, __pyx_L1_error) | |
18756 | |
18757 /* "pysam/libcfaidx.pyx":551 | |
18758 * self._open(*args, **kwargs) | |
18759 * | |
18760 * def is_open(self): # <<<<<<<<<<<<<< | |
18761 * '''return true if samfile has been opened.''' | |
18762 * return self.entry != NULL | |
18763 */ | |
18764 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_is_open, 551, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 551, __pyx_L1_error) | |
18765 | |
18766 /* "pysam/libcfaidx.pyx":555 | |
18767 * return self.entry != NULL | |
18768 * | |
18769 * def _open(self, filename, persist=True): # <<<<<<<<<<<<<< | |
18770 * '''open a fastq/fasta file in *filename* | |
18771 * | |
18772 */ | |
18773 __pyx_tuple__65 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_persist, __pyx_n_s_cfilename); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 555, __pyx_L1_error) | |
18774 __Pyx_GOTREF(__pyx_tuple__65); | |
18775 __Pyx_GIVEREF(__pyx_tuple__65); | |
18776 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 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_pysam_libcfaidx_pyx, __pyx_n_s_open, 555, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 555, __pyx_L1_error) | |
18777 __pyx_tuple__66 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 555, __pyx_L1_error) | |
18778 __Pyx_GOTREF(__pyx_tuple__66); | |
18779 __Pyx_GIVEREF(__pyx_tuple__66); | |
18780 | |
18781 /* "pysam/libcfaidx.pyx":588 | |
18782 * self._filename = filename | |
18783 * | |
18784 * def close(self): # <<<<<<<<<<<<<< | |
18785 * '''close the file.''' | |
18786 * if self.fastqfile != NULL: | |
18787 */ | |
18788 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_close, 588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 588, __pyx_L1_error) | |
18789 | |
18790 /* "pysam/libcfaidx.pyx":604 | |
18791 * | |
18792 * # context manager interface | |
18793 * def __enter__(self): # <<<<<<<<<<<<<< | |
18794 * return self | |
18795 * | |
18796 */ | |
18797 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_enter, 604, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 604, __pyx_L1_error) | |
18798 | |
18799 /* "pysam/libcfaidx.pyx":607 | |
18800 * return self | |
18801 * | |
18802 * def __exit__(self, exc_type, exc_value, traceback): # <<<<<<<<<<<<<< | |
18803 * self.close() | |
18804 * return False | |
18805 */ | |
18806 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pysam_libcfaidx_pyx, __pyx_n_s_exit, 607, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 607, __pyx_L1_error) | |
18807 | |
18808 /* "(tree fragment)":1 | |
18809 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
18810 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
18811 * def __setstate_cython__(self, __pyx_state): | |
18812 */ | |
18813 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 1, __pyx_L1_error) | |
18814 | |
18815 /* "(tree fragment)":3 | |
18816 * def __reduce_cython__(self): | |
18817 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
18818 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
18819 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
18820 */ | |
18821 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(1, 3, __pyx_L1_error) | |
18822 | |
18823 /* "(tree fragment)":1 | |
18824 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
18825 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
18826 * def __setstate_cython__(self, __pyx_state): | |
18827 */ | |
18828 __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(1, 1, __pyx_L1_error) | |
18829 | |
18830 /* "(tree fragment)":3 | |
18831 * def __reduce_cython__(self): | |
18832 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
18833 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
18834 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
18835 */ | |
18836 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(1, 3, __pyx_L1_error) | |
18837 | |
18838 /* "(tree fragment)":1 | |
18839 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
18840 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
18841 * def __setstate_cython__(self, __pyx_state): | |
18842 */ | |
18843 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(1, 1, __pyx_L1_error) | |
18844 | |
18845 /* "(tree fragment)":3 | |
18846 * def __reduce_cython__(self): | |
18847 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
18848 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
18849 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
18850 */ | |
18851 __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(1, 3, __pyx_L1_error) | |
18852 | |
18853 /* "(tree fragment)":1 | |
18854 * def __pyx_unpickle_FastxRecord(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
18855 * cdef object __pyx_PickleError | |
18856 * cdef object __pyx_result | |
18857 */ | |
18858 __pyx_tuple__67 = 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__67)) __PYX_ERR(1, 1, __pyx_L1_error) | |
18859 __Pyx_GOTREF(__pyx_tuple__67); | |
18860 __Pyx_GIVEREF(__pyx_tuple__67); | |
18861 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 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_stringsource, __pyx_n_s_pyx_unpickle_FastxRecord, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(1, 1, __pyx_L1_error) | |
18862 __Pyx_RefNannyFinishContext(); | |
18863 return 0; | |
18864 __pyx_L1_error:; | |
18865 __Pyx_RefNannyFinishContext(); | |
18866 return -1; | |
18867 } | |
18868 /* #### Code section: init_constants ### */ | |
18869 | |
18870 static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { | |
18871 if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); | |
18872 __pyx_int_33 = PyInt_FromLong(33); if (unlikely(!__pyx_int_33)) __PYX_ERR(0, 1, __pyx_L1_error) | |
18873 __pyx_int_29210129 = PyInt_FromLong(29210129L); if (unlikely(!__pyx_int_29210129)) __PYX_ERR(0, 1, __pyx_L1_error) | |
18874 __pyx_int_71291217 = PyInt_FromLong(71291217L); if (unlikely(!__pyx_int_71291217)) __PYX_ERR(0, 1, __pyx_L1_error) | |
18875 __pyx_int_191400582 = PyInt_FromLong(191400582L); if (unlikely(!__pyx_int_191400582)) __PYX_ERR(0, 1, __pyx_L1_error) | |
18876 return 0; | |
18877 __pyx_L1_error:; | |
18878 return -1; | |
18879 } | |
18880 /* #### Code section: init_globals ### */ | |
18881 | |
18882 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { | |
18883 return 0; | |
18884 } | |
18885 /* #### Code section: init_module ### */ | |
18886 | |
18887 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ | |
18888 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ | |
18889 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ | |
18890 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ | |
18891 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ | |
18892 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ | |
18893 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ | |
18894 | |
18895 static int __Pyx_modinit_global_init_code(void) { | |
18896 __Pyx_RefNannyDeclarations | |
18897 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); | |
18898 /*--- Global init code ---*/ | |
18899 __Pyx_RefNannyFinishContext(); | |
18900 return 0; | |
18901 } | |
18902 | |
18903 static int __Pyx_modinit_variable_export_code(void) { | |
18904 __Pyx_RefNannyDeclarations | |
18905 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); | |
18906 /*--- Variable export code ---*/ | |
18907 __Pyx_RefNannyFinishContext(); | |
18908 return 0; | |
18909 } | |
18910 | |
18911 static int __Pyx_modinit_function_export_code(void) { | |
18912 __Pyx_RefNannyDeclarations | |
18913 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); | |
18914 /*--- Function export code ---*/ | |
18915 __Pyx_RefNannyFinishContext(); | |
18916 return 0; | |
18917 } | |
18918 | |
18919 static int __Pyx_modinit_type_init_code(void) { | |
18920 __Pyx_RefNannyDeclarations | |
18921 PyObject *__pyx_t_1 = NULL; | |
18922 int __pyx_lineno = 0; | |
18923 const char *__pyx_filename = NULL; | |
18924 int __pyx_clineno = 0; | |
18925 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); | |
18926 /*--- Type init code ---*/ | |
18927 __pyx_vtabptr_5pysam_9libcfaidx_FastaFile = &__pyx_vtable_5pysam_9libcfaidx_FastaFile; | |
18928 __pyx_vtable_5pysam_9libcfaidx_FastaFile._fetch = (char *(*)(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *, char *, int, int, int *))__pyx_f_5pysam_9libcfaidx_9FastaFile__fetch; | |
18929 #if CYTHON_USE_TYPE_SPECS | |
18930 __pyx_ptype_5pysam_9libcfaidx_FastaFile = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libcfaidx_FastaFile_spec, NULL); if (unlikely(!__pyx_ptype_5pysam_9libcfaidx_FastaFile)) __PYX_ERR(0, 83, __pyx_L1_error) | |
18931 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libcfaidx_FastaFile_spec, __pyx_ptype_5pysam_9libcfaidx_FastaFile) < 0) __PYX_ERR(0, 83, __pyx_L1_error) | |
18932 #else | |
18933 __pyx_ptype_5pysam_9libcfaidx_FastaFile = &__pyx_type_5pysam_9libcfaidx_FastaFile; | |
18934 #endif | |
18935 #if !CYTHON_COMPILING_IN_LIMITED_API | |
18936 #endif | |
18937 #if !CYTHON_USE_TYPE_SPECS | |
18938 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libcfaidx_FastaFile) < 0) __PYX_ERR(0, 83, __pyx_L1_error) | |
18939 #endif | |
18940 #if PY_MAJOR_VERSION < 3 | |
18941 __pyx_ptype_5pysam_9libcfaidx_FastaFile->tp_print = 0; | |
18942 #endif | |
18943 #if !CYTHON_COMPILING_IN_LIMITED_API | |
18944 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libcfaidx_FastaFile->tp_dictoffset && __pyx_ptype_5pysam_9libcfaidx_FastaFile->tp_getattro == PyObject_GenericGetAttr)) { | |
18945 __pyx_ptype_5pysam_9libcfaidx_FastaFile->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
18946 } | |
18947 #endif | |
18948 #if CYTHON_UPDATE_DESCRIPTOR_DOC | |
18949 { | |
18950 PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastaFile, "__contains__"); if (unlikely(!wrapper)) __PYX_ERR(0, 83, __pyx_L1_error) | |
18951 if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { | |
18952 __pyx_wrapperbase_5pysam_9libcfaidx_9FastaFile_22__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base; | |
18953 __pyx_wrapperbase_5pysam_9libcfaidx_9FastaFile_22__contains__.doc = __pyx_doc_5pysam_9libcfaidx_9FastaFile_22__contains__; | |
18954 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_9libcfaidx_9FastaFile_22__contains__; | |
18955 } | |
18956 } | |
18957 #endif | |
18958 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libcfaidx_FastaFile, __pyx_vtabptr_5pysam_9libcfaidx_FastaFile) < 0) __PYX_ERR(0, 83, __pyx_L1_error) | |
18959 #if !CYTHON_COMPILING_IN_LIMITED_API | |
18960 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libcfaidx_FastaFile) < 0) __PYX_ERR(0, 83, __pyx_L1_error) | |
18961 #endif | |
18962 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FastaFile, (PyObject *) __pyx_ptype_5pysam_9libcfaidx_FastaFile) < 0) __PYX_ERR(0, 83, __pyx_L1_error) | |
18963 #if !CYTHON_COMPILING_IN_LIMITED_API | |
18964 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libcfaidx_FastaFile) < 0) __PYX_ERR(0, 83, __pyx_L1_error) | |
18965 #endif | |
18966 __pyx_vtabptr_5pysam_9libcfaidx_FastqProxy = &__pyx_vtable_5pysam_9libcfaidx_FastqProxy; | |
18967 __pyx_vtable_5pysam_9libcfaidx_FastqProxy.to_string = (PyObject *(*)(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *))__pyx_f_5pysam_9libcfaidx_10FastqProxy_to_string; | |
18968 __pyx_vtable_5pysam_9libcfaidx_FastqProxy.tostring = (PyObject *(*)(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *))__pyx_f_5pysam_9libcfaidx_10FastqProxy_tostring; | |
18969 __pyx_vtable_5pysam_9libcfaidx_FastqProxy.get_quality_array = (arrayobject *(*)(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcfaidx_10FastqProxy_get_quality_array *__pyx_optional_args))__pyx_f_5pysam_9libcfaidx_10FastqProxy_get_quality_array; | |
18970 #if CYTHON_USE_TYPE_SPECS | |
18971 __pyx_ptype_5pysam_9libcfaidx_FastqProxy = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libcfaidx_FastqProxy_spec, NULL); if (unlikely(!__pyx_ptype_5pysam_9libcfaidx_FastqProxy)) __PYX_ERR(0, 355, __pyx_L1_error) | |
18972 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libcfaidx_FastqProxy_spec, __pyx_ptype_5pysam_9libcfaidx_FastqProxy) < 0) __PYX_ERR(0, 355, __pyx_L1_error) | |
18973 #else | |
18974 __pyx_ptype_5pysam_9libcfaidx_FastqProxy = &__pyx_type_5pysam_9libcfaidx_FastqProxy; | |
18975 #endif | |
18976 #if !CYTHON_COMPILING_IN_LIMITED_API | |
18977 #endif | |
18978 #if !CYTHON_USE_TYPE_SPECS | |
18979 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libcfaidx_FastqProxy) < 0) __PYX_ERR(0, 355, __pyx_L1_error) | |
18980 #endif | |
18981 #if PY_MAJOR_VERSION < 3 | |
18982 __pyx_ptype_5pysam_9libcfaidx_FastqProxy->tp_print = 0; | |
18983 #endif | |
18984 #if !CYTHON_COMPILING_IN_LIMITED_API | |
18985 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libcfaidx_FastqProxy->tp_dictoffset && __pyx_ptype_5pysam_9libcfaidx_FastqProxy->tp_getattro == PyObject_GenericGetAttr)) { | |
18986 __pyx_ptype_5pysam_9libcfaidx_FastqProxy->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
18987 } | |
18988 #endif | |
18989 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libcfaidx_FastqProxy, __pyx_vtabptr_5pysam_9libcfaidx_FastqProxy) < 0) __PYX_ERR(0, 355, __pyx_L1_error) | |
18990 #if !CYTHON_COMPILING_IN_LIMITED_API | |
18991 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libcfaidx_FastqProxy) < 0) __PYX_ERR(0, 355, __pyx_L1_error) | |
18992 #endif | |
18993 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FastqProxy, (PyObject *) __pyx_ptype_5pysam_9libcfaidx_FastqProxy) < 0) __PYX_ERR(0, 355, __pyx_L1_error) | |
18994 #if !CYTHON_COMPILING_IN_LIMITED_API | |
18995 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libcfaidx_FastqProxy) < 0) __PYX_ERR(0, 355, __pyx_L1_error) | |
18996 #endif | |
18997 __pyx_vtabptr_5pysam_9libcfaidx_FastxRecord = &__pyx_vtable_5pysam_9libcfaidx_FastxRecord; | |
18998 __pyx_vtable_5pysam_9libcfaidx_FastxRecord.to_string = (PyObject *(*)(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *))__pyx_f_5pysam_9libcfaidx_11FastxRecord_to_string; | |
18999 __pyx_vtable_5pysam_9libcfaidx_FastxRecord.tostring = (PyObject *(*)(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *))__pyx_f_5pysam_9libcfaidx_11FastxRecord_tostring; | |
19000 __pyx_vtable_5pysam_9libcfaidx_FastxRecord.get_quality_array = (arrayobject *(*)(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcfaidx_11FastxRecord_get_quality_array *__pyx_optional_args))__pyx_f_5pysam_9libcfaidx_11FastxRecord_get_quality_array; | |
19001 #if CYTHON_USE_TYPE_SPECS | |
19002 __pyx_ptype_5pysam_9libcfaidx_FastxRecord = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libcfaidx_FastxRecord_spec, NULL); if (unlikely(!__pyx_ptype_5pysam_9libcfaidx_FastxRecord)) __PYX_ERR(0, 411, __pyx_L1_error) | |
19003 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libcfaidx_FastxRecord_spec, __pyx_ptype_5pysam_9libcfaidx_FastxRecord) < 0) __PYX_ERR(0, 411, __pyx_L1_error) | |
19004 #else | |
19005 __pyx_ptype_5pysam_9libcfaidx_FastxRecord = &__pyx_type_5pysam_9libcfaidx_FastxRecord; | |
19006 #endif | |
19007 #if !CYTHON_COMPILING_IN_LIMITED_API | |
19008 #endif | |
19009 #if !CYTHON_USE_TYPE_SPECS | |
19010 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libcfaidx_FastxRecord) < 0) __PYX_ERR(0, 411, __pyx_L1_error) | |
19011 #endif | |
19012 #if PY_MAJOR_VERSION < 3 | |
19013 __pyx_ptype_5pysam_9libcfaidx_FastxRecord->tp_print = 0; | |
19014 #endif | |
19015 #if !CYTHON_COMPILING_IN_LIMITED_API | |
19016 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libcfaidx_FastxRecord->tp_dictoffset && __pyx_ptype_5pysam_9libcfaidx_FastxRecord->tp_getattro == PyObject_GenericGetAttr)) { | |
19017 __pyx_ptype_5pysam_9libcfaidx_FastxRecord->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
19018 } | |
19019 #endif | |
19020 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libcfaidx_FastxRecord, __pyx_vtabptr_5pysam_9libcfaidx_FastxRecord) < 0) __PYX_ERR(0, 411, __pyx_L1_error) | |
19021 #if !CYTHON_COMPILING_IN_LIMITED_API | |
19022 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libcfaidx_FastxRecord) < 0) __PYX_ERR(0, 411, __pyx_L1_error) | |
19023 #endif | |
19024 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FastxRecord, (PyObject *) __pyx_ptype_5pysam_9libcfaidx_FastxRecord) < 0) __PYX_ERR(0, 411, __pyx_L1_error) | |
19025 #if !CYTHON_COMPILING_IN_LIMITED_API | |
19026 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libcfaidx_FastxRecord) < 0) __PYX_ERR(0, 411, __pyx_L1_error) | |
19027 #endif | |
19028 __pyx_vtabptr_5pysam_9libcfaidx_FastxFile = &__pyx_vtable_5pysam_9libcfaidx_FastxFile; | |
19029 __pyx_vtable_5pysam_9libcfaidx_FastxFile.getCurrent = (kseq_t *(*)(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *))__pyx_f_5pysam_9libcfaidx_9FastxFile_getCurrent; | |
19030 __pyx_vtable_5pysam_9libcfaidx_FastxFile.cnext = (int (*)(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *))__pyx_f_5pysam_9libcfaidx_9FastxFile_cnext; | |
19031 #if CYTHON_USE_TYPE_SPECS | |
19032 __pyx_ptype_5pysam_9libcfaidx_FastxFile = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libcfaidx_FastxFile_spec, NULL); if (unlikely(!__pyx_ptype_5pysam_9libcfaidx_FastxFile)) __PYX_ERR(0, 496, __pyx_L1_error) | |
19033 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libcfaidx_FastxFile_spec, __pyx_ptype_5pysam_9libcfaidx_FastxFile) < 0) __PYX_ERR(0, 496, __pyx_L1_error) | |
19034 #else | |
19035 __pyx_ptype_5pysam_9libcfaidx_FastxFile = &__pyx_type_5pysam_9libcfaidx_FastxFile; | |
19036 #endif | |
19037 #if !CYTHON_COMPILING_IN_LIMITED_API | |
19038 #endif | |
19039 #if !CYTHON_USE_TYPE_SPECS | |
19040 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libcfaidx_FastxFile) < 0) __PYX_ERR(0, 496, __pyx_L1_error) | |
19041 #endif | |
19042 #if PY_MAJOR_VERSION < 3 | |
19043 __pyx_ptype_5pysam_9libcfaidx_FastxFile->tp_print = 0; | |
19044 #endif | |
19045 #if !CYTHON_COMPILING_IN_LIMITED_API | |
19046 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libcfaidx_FastxFile->tp_dictoffset && __pyx_ptype_5pysam_9libcfaidx_FastxFile->tp_getattro == PyObject_GenericGetAttr)) { | |
19047 __pyx_ptype_5pysam_9libcfaidx_FastxFile->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
19048 } | |
19049 #endif | |
19050 #if CYTHON_UPDATE_DESCRIPTOR_DOC | |
19051 { | |
19052 PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxFile, "__next__"); if (unlikely(!wrapper)) __PYX_ERR(0, 496, __pyx_L1_error) | |
19053 if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { | |
19054 __pyx_wrapperbase_5pysam_9libcfaidx_9FastxFile_16__next__ = *((PyWrapperDescrObject *)wrapper)->d_base; | |
19055 __pyx_wrapperbase_5pysam_9libcfaidx_9FastxFile_16__next__.doc = __pyx_doc_5pysam_9libcfaidx_9FastxFile_16__next__; | |
19056 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_9libcfaidx_9FastxFile_16__next__; | |
19057 } | |
19058 } | |
19059 #endif | |
19060 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libcfaidx_FastxFile, __pyx_vtabptr_5pysam_9libcfaidx_FastxFile) < 0) __PYX_ERR(0, 496, __pyx_L1_error) | |
19061 #if !CYTHON_COMPILING_IN_LIMITED_API | |
19062 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libcfaidx_FastxFile) < 0) __PYX_ERR(0, 496, __pyx_L1_error) | |
19063 #endif | |
19064 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FastxFile, (PyObject *) __pyx_ptype_5pysam_9libcfaidx_FastxFile) < 0) __PYX_ERR(0, 496, __pyx_L1_error) | |
19065 #if !CYTHON_COMPILING_IN_LIMITED_API | |
19066 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libcfaidx_FastxFile) < 0) __PYX_ERR(0, 496, __pyx_L1_error) | |
19067 #endif | |
19068 __pyx_vtabptr_5pysam_9libcfaidx_FastqFile = &__pyx_vtable_5pysam_9libcfaidx_FastqFile; | |
19069 __pyx_vtable_5pysam_9libcfaidx_FastqFile.__pyx_base = *__pyx_vtabptr_5pysam_9libcfaidx_FastxFile; | |
19070 #if CYTHON_USE_TYPE_SPECS | |
19071 __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxFile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error) | |
19072 __Pyx_GOTREF(__pyx_t_1); | |
19073 __pyx_ptype_5pysam_9libcfaidx_FastqFile = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libcfaidx_FastqFile_spec, __pyx_t_1); | |
19074 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
19075 if (unlikely(!__pyx_ptype_5pysam_9libcfaidx_FastqFile)) __PYX_ERR(0, 658, __pyx_L1_error) | |
19076 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libcfaidx_FastqFile_spec, __pyx_ptype_5pysam_9libcfaidx_FastqFile) < 0) __PYX_ERR(0, 658, __pyx_L1_error) | |
19077 #else | |
19078 __pyx_ptype_5pysam_9libcfaidx_FastqFile = &__pyx_type_5pysam_9libcfaidx_FastqFile; | |
19079 #endif | |
19080 #if !CYTHON_COMPILING_IN_LIMITED_API | |
19081 __pyx_ptype_5pysam_9libcfaidx_FastqFile->tp_base = __pyx_ptype_5pysam_9libcfaidx_FastxFile; | |
19082 #endif | |
19083 #if !CYTHON_USE_TYPE_SPECS | |
19084 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libcfaidx_FastqFile) < 0) __PYX_ERR(0, 658, __pyx_L1_error) | |
19085 #endif | |
19086 #if PY_MAJOR_VERSION < 3 | |
19087 __pyx_ptype_5pysam_9libcfaidx_FastqFile->tp_print = 0; | |
19088 #endif | |
19089 #if !CYTHON_COMPILING_IN_LIMITED_API | |
19090 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libcfaidx_FastqFile->tp_dictoffset && __pyx_ptype_5pysam_9libcfaidx_FastqFile->tp_getattro == PyObject_GenericGetAttr)) { | |
19091 __pyx_ptype_5pysam_9libcfaidx_FastqFile->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
19092 } | |
19093 #endif | |
19094 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libcfaidx_FastqFile, __pyx_vtabptr_5pysam_9libcfaidx_FastqFile) < 0) __PYX_ERR(0, 658, __pyx_L1_error) | |
19095 #if !CYTHON_COMPILING_IN_LIMITED_API | |
19096 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libcfaidx_FastqFile) < 0) __PYX_ERR(0, 658, __pyx_L1_error) | |
19097 #endif | |
19098 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FastqFile, (PyObject *) __pyx_ptype_5pysam_9libcfaidx_FastqFile) < 0) __PYX_ERR(0, 658, __pyx_L1_error) | |
19099 #if !CYTHON_COMPILING_IN_LIMITED_API | |
19100 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libcfaidx_FastqFile) < 0) __PYX_ERR(0, 658, __pyx_L1_error) | |
19101 #endif | |
19102 __pyx_vtabptr_5pysam_9libcfaidx_Fastafile = &__pyx_vtable_5pysam_9libcfaidx_Fastafile; | |
19103 __pyx_vtable_5pysam_9libcfaidx_Fastafile.__pyx_base = *__pyx_vtabptr_5pysam_9libcfaidx_FastaFile; | |
19104 #if CYTHON_USE_TYPE_SPECS | |
19105 __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastaFile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __pyx_L1_error) | |
19106 __Pyx_GOTREF(__pyx_t_1); | |
19107 __pyx_ptype_5pysam_9libcfaidx_Fastafile = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_9libcfaidx_Fastafile_spec, __pyx_t_1); | |
19108 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; | |
19109 if (unlikely(!__pyx_ptype_5pysam_9libcfaidx_Fastafile)) __PYX_ERR(0, 663, __pyx_L1_error) | |
19110 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_9libcfaidx_Fastafile_spec, __pyx_ptype_5pysam_9libcfaidx_Fastafile) < 0) __PYX_ERR(0, 663, __pyx_L1_error) | |
19111 #else | |
19112 __pyx_ptype_5pysam_9libcfaidx_Fastafile = &__pyx_type_5pysam_9libcfaidx_Fastafile; | |
19113 #endif | |
19114 #if !CYTHON_COMPILING_IN_LIMITED_API | |
19115 __pyx_ptype_5pysam_9libcfaidx_Fastafile->tp_base = __pyx_ptype_5pysam_9libcfaidx_FastaFile; | |
19116 #endif | |
19117 #if !CYTHON_USE_TYPE_SPECS | |
19118 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_9libcfaidx_Fastafile) < 0) __PYX_ERR(0, 663, __pyx_L1_error) | |
19119 #endif | |
19120 #if PY_MAJOR_VERSION < 3 | |
19121 __pyx_ptype_5pysam_9libcfaidx_Fastafile->tp_print = 0; | |
19122 #endif | |
19123 #if !CYTHON_COMPILING_IN_LIMITED_API | |
19124 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_9libcfaidx_Fastafile->tp_dictoffset && __pyx_ptype_5pysam_9libcfaidx_Fastafile->tp_getattro == PyObject_GenericGetAttr)) { | |
19125 __pyx_ptype_5pysam_9libcfaidx_Fastafile->tp_getattro = __Pyx_PyObject_GenericGetAttr; | |
19126 } | |
19127 #endif | |
19128 if (__Pyx_SetVtable(__pyx_ptype_5pysam_9libcfaidx_Fastafile, __pyx_vtabptr_5pysam_9libcfaidx_Fastafile) < 0) __PYX_ERR(0, 663, __pyx_L1_error) | |
19129 #if !CYTHON_COMPILING_IN_LIMITED_API | |
19130 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_9libcfaidx_Fastafile) < 0) __PYX_ERR(0, 663, __pyx_L1_error) | |
19131 #endif | |
19132 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Fastafile, (PyObject *) __pyx_ptype_5pysam_9libcfaidx_Fastafile) < 0) __PYX_ERR(0, 663, __pyx_L1_error) | |
19133 #if !CYTHON_COMPILING_IN_LIMITED_API | |
19134 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_9libcfaidx_Fastafile) < 0) __PYX_ERR(0, 663, __pyx_L1_error) | |
19135 #endif | |
19136 __Pyx_RefNannyFinishContext(); | |
19137 return 0; | |
19138 __pyx_L1_error:; | |
19139 __Pyx_XDECREF(__pyx_t_1); | |
19140 __Pyx_RefNannyFinishContext(); | |
19141 return -1; | |
19142 } | |
19143 | |
19144 static int __Pyx_modinit_type_import_code(void) { | |
19145 __Pyx_RefNannyDeclarations | |
19146 PyObject *__pyx_t_1 = NULL; | |
19147 int __pyx_lineno = 0; | |
19148 const char *__pyx_filename = NULL; | |
19149 int __pyx_clineno = 0; | |
19150 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); | |
19151 /*--- Type import code ---*/ | |
19152 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 9, __pyx_L1_error) | |
19153 __Pyx_GOTREF(__pyx_t_1); | |
19154 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", | |
19155 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 | |
19156 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject), | |
19157 #elif CYTHON_COMPILING_IN_LIMITED_API | |
19158 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject), | |
19159 #else | |
19160 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject), | |
19161 #endif | |
19162 __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(5, 9, __pyx_L1_error) | |
19163 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
19164 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 8, __pyx_L1_error) | |
19165 __Pyx_GOTREF(__pyx_t_1); | |
19166 __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) | |
19167 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
19168 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 15, __pyx_L1_error) | |
19169 __Pyx_GOTREF(__pyx_t_1); | |
19170 __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) | |
19171 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
19172 __pyx_t_1 = PyImport_ImportModule("array"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 69, __pyx_L1_error) | |
19173 __Pyx_GOTREF(__pyx_t_1); | |
19174 __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) | |
19175 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
19176 __pyx_t_1 = PyImport_ImportModule("pysam.libchtslib"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 2706, __pyx_L1_error) | |
19177 __Pyx_GOTREF(__pyx_t_1); | |
19178 __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(8, 2706, __pyx_L1_error) | |
19179 __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(8, 2706, __pyx_L1_error) | |
19180 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
19181 __Pyx_RefNannyFinishContext(); | |
19182 return 0; | |
19183 __pyx_L1_error:; | |
19184 __Pyx_XDECREF(__pyx_t_1); | |
19185 __Pyx_RefNannyFinishContext(); | |
19186 return -1; | |
19187 } | |
19188 | |
19189 static int __Pyx_modinit_variable_import_code(void) { | |
19190 __Pyx_RefNannyDeclarations | |
19191 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); | |
19192 /*--- Variable import code ---*/ | |
19193 __Pyx_RefNannyFinishContext(); | |
19194 return 0; | |
19195 } | |
19196 | |
19197 static int __Pyx_modinit_function_import_code(void) { | |
19198 __Pyx_RefNannyDeclarations | |
19199 PyObject *__pyx_t_1 = NULL; | |
19200 int __pyx_lineno = 0; | |
19201 const char *__pyx_filename = NULL; | |
19202 int __pyx_clineno = 0; | |
19203 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); | |
19204 /*--- Function import code ---*/ | |
19205 __pyx_t_1 = PyImport_ImportModule("pysam.libcutils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) | |
19206 __Pyx_GOTREF(__pyx_t_1); | |
19207 if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "parse_region", (void (**)(void))&__pyx_f_5pysam_9libcutils_parse_region, "PyObject *(int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcutils_parse_region *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19208 if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "qualitystring_to_array", (void (**)(void))&__pyx_f_5pysam_9libcutils_qualitystring_to_array, "arrayobject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcutils_qualitystring_to_array *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19209 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) | |
19210 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) | |
19211 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) | |
19212 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) | |
19213 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) | |
19214 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
19215 __Pyx_RefNannyFinishContext(); | |
19216 return 0; | |
19217 __pyx_L1_error:; | |
19218 __Pyx_XDECREF(__pyx_t_1); | |
19219 __Pyx_RefNannyFinishContext(); | |
19220 return -1; | |
19221 } | |
19222 | |
19223 | |
19224 #if PY_MAJOR_VERSION >= 3 | |
19225 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
19226 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ | |
19227 static int __pyx_pymod_exec_libcfaidx(PyObject* module); /*proto*/ | |
19228 static PyModuleDef_Slot __pyx_moduledef_slots[] = { | |
19229 {Py_mod_create, (void*)__pyx_pymod_create}, | |
19230 {Py_mod_exec, (void*)__pyx_pymod_exec_libcfaidx}, | |
19231 {0, NULL} | |
19232 }; | |
19233 #endif | |
19234 | |
19235 #ifdef __cplusplus | |
19236 namespace { | |
19237 struct PyModuleDef __pyx_moduledef = | |
19238 #else | |
19239 static struct PyModuleDef __pyx_moduledef = | |
19240 #endif | |
19241 { | |
19242 PyModuleDef_HEAD_INIT, | |
19243 "libcfaidx", | |
19244 0, /* m_doc */ | |
19245 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
19246 0, /* m_size */ | |
19247 #elif CYTHON_USE_MODULE_STATE | |
19248 sizeof(__pyx_mstate), /* m_size */ | |
19249 #else | |
19250 -1, /* m_size */ | |
19251 #endif | |
19252 __pyx_methods /* m_methods */, | |
19253 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
19254 __pyx_moduledef_slots, /* m_slots */ | |
19255 #else | |
19256 NULL, /* m_reload */ | |
19257 #endif | |
19258 #if CYTHON_USE_MODULE_STATE | |
19259 __pyx_m_traverse, /* m_traverse */ | |
19260 __pyx_m_clear, /* m_clear */ | |
19261 NULL /* m_free */ | |
19262 #else | |
19263 NULL, /* m_traverse */ | |
19264 NULL, /* m_clear */ | |
19265 NULL /* m_free */ | |
19266 #endif | |
19267 }; | |
19268 #ifdef __cplusplus | |
19269 } /* anonymous namespace */ | |
19270 #endif | |
19271 #endif | |
19272 | |
19273 #ifndef CYTHON_NO_PYINIT_EXPORT | |
19274 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC | |
19275 #elif PY_MAJOR_VERSION < 3 | |
19276 #ifdef __cplusplus | |
19277 #define __Pyx_PyMODINIT_FUNC extern "C" void | |
19278 #else | |
19279 #define __Pyx_PyMODINIT_FUNC void | |
19280 #endif | |
19281 #else | |
19282 #ifdef __cplusplus | |
19283 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * | |
19284 #else | |
19285 #define __Pyx_PyMODINIT_FUNC PyObject * | |
19286 #endif | |
19287 #endif | |
19288 | |
19289 | |
19290 #if PY_MAJOR_VERSION < 3 | |
19291 __Pyx_PyMODINIT_FUNC initlibcfaidx(void) CYTHON_SMALL_CODE; /*proto*/ | |
19292 __Pyx_PyMODINIT_FUNC initlibcfaidx(void) | |
19293 #else | |
19294 __Pyx_PyMODINIT_FUNC PyInit_libcfaidx(void) CYTHON_SMALL_CODE; /*proto*/ | |
19295 __Pyx_PyMODINIT_FUNC PyInit_libcfaidx(void) | |
19296 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
19297 { | |
19298 return PyModuleDef_Init(&__pyx_moduledef); | |
19299 } | |
19300 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { | |
19301 #if PY_VERSION_HEX >= 0x030700A1 | |
19302 static PY_INT64_T main_interpreter_id = -1; | |
19303 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); | |
19304 if (main_interpreter_id == -1) { | |
19305 main_interpreter_id = current_id; | |
19306 return (unlikely(current_id == -1)) ? -1 : 0; | |
19307 } else if (unlikely(main_interpreter_id != current_id)) | |
19308 #else | |
19309 static PyInterpreterState *main_interpreter = NULL; | |
19310 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; | |
19311 if (!main_interpreter) { | |
19312 main_interpreter = current_interpreter; | |
19313 } else if (unlikely(main_interpreter != current_interpreter)) | |
19314 #endif | |
19315 { | |
19316 PyErr_SetString( | |
19317 PyExc_ImportError, | |
19318 "Interpreter change detected - this module can only be loaded into one interpreter per process."); | |
19319 return -1; | |
19320 } | |
19321 return 0; | |
19322 } | |
19323 #if CYTHON_COMPILING_IN_LIMITED_API | |
19324 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) | |
19325 #else | |
19326 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) | |
19327 #endif | |
19328 { | |
19329 PyObject *value = PyObject_GetAttrString(spec, from_name); | |
19330 int result = 0; | |
19331 if (likely(value)) { | |
19332 if (allow_none || value != Py_None) { | |
19333 #if CYTHON_COMPILING_IN_LIMITED_API | |
19334 result = PyModule_AddObject(module, to_name, value); | |
19335 #else | |
19336 result = PyDict_SetItemString(moddict, to_name, value); | |
19337 #endif | |
19338 } | |
19339 Py_DECREF(value); | |
19340 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { | |
19341 PyErr_Clear(); | |
19342 } else { | |
19343 result = -1; | |
19344 } | |
19345 return result; | |
19346 } | |
19347 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { | |
19348 PyObject *module = NULL, *moddict, *modname; | |
19349 CYTHON_UNUSED_VAR(def); | |
19350 if (__Pyx_check_single_interpreter()) | |
19351 return NULL; | |
19352 if (__pyx_m) | |
19353 return __Pyx_NewRef(__pyx_m); | |
19354 modname = PyObject_GetAttrString(spec, "name"); | |
19355 if (unlikely(!modname)) goto bad; | |
19356 module = PyModule_NewObject(modname); | |
19357 Py_DECREF(modname); | |
19358 if (unlikely(!module)) goto bad; | |
19359 #if CYTHON_COMPILING_IN_LIMITED_API | |
19360 moddict = module; | |
19361 #else | |
19362 moddict = PyModule_GetDict(module); | |
19363 if (unlikely(!moddict)) goto bad; | |
19364 #endif | |
19365 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; | |
19366 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; | |
19367 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; | |
19368 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; | |
19369 return module; | |
19370 bad: | |
19371 Py_XDECREF(module); | |
19372 return NULL; | |
19373 } | |
19374 | |
19375 | |
19376 static CYTHON_SMALL_CODE int __pyx_pymod_exec_libcfaidx(PyObject *__pyx_pyinit_module) | |
19377 #endif | |
19378 #endif | |
19379 { | |
19380 int stringtab_initialized = 0; | |
19381 #if CYTHON_USE_MODULE_STATE | |
19382 int pystate_addmodule_run = 0; | |
19383 #endif | |
19384 __Pyx_TraceDeclarations | |
19385 PyObject *__pyx_t_1 = NULL; | |
19386 PyObject *__pyx_t_2 = NULL; | |
19387 int __pyx_lineno = 0; | |
19388 const char *__pyx_filename = NULL; | |
19389 int __pyx_clineno = 0; | |
19390 __Pyx_RefNannyDeclarations | |
19391 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
19392 if (__pyx_m) { | |
19393 if (__pyx_m == __pyx_pyinit_module) return 0; | |
19394 PyErr_SetString(PyExc_RuntimeError, "Module 'libcfaidx' has already been imported. Re-initialisation is not supported."); | |
19395 return -1; | |
19396 } | |
19397 #elif PY_MAJOR_VERSION >= 3 | |
19398 if (__pyx_m) return __Pyx_NewRef(__pyx_m); | |
19399 #endif | |
19400 /*--- Module creation code ---*/ | |
19401 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
19402 __pyx_m = __pyx_pyinit_module; | |
19403 Py_INCREF(__pyx_m); | |
19404 #else | |
19405 #if PY_MAJOR_VERSION < 3 | |
19406 __pyx_m = Py_InitModule4("libcfaidx", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); | |
19407 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) | |
19408 #elif CYTHON_USE_MODULE_STATE | |
19409 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) | |
19410 { | |
19411 int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); | |
19412 __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "libcfaidx" pseudovariable */ | |
19413 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
19414 pystate_addmodule_run = 1; | |
19415 } | |
19416 #else | |
19417 __pyx_m = PyModule_Create(&__pyx_moduledef); | |
19418 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) | |
19419 #endif | |
19420 #endif | |
19421 CYTHON_UNUSED_VAR(__pyx_t_1); | |
19422 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) | |
19423 Py_INCREF(__pyx_d); | |
19424 __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) | |
19425 __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) | |
19426 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19427 #if CYTHON_REFNANNY | |
19428 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); | |
19429 if (!__Pyx_RefNanny) { | |
19430 PyErr_Clear(); | |
19431 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); | |
19432 if (!__Pyx_RefNanny) | |
19433 Py_FatalError("failed to import 'refnanny' module"); | |
19434 } | |
19435 #endif | |
19436 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_libcfaidx(void)", 0); | |
19437 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) | |
19438 #ifdef __Pxy_PyFrame_Initialize_Offsets | |
19439 __Pxy_PyFrame_Initialize_Offsets(); | |
19440 #endif | |
19441 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) | |
19442 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) | |
19443 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) | |
19444 #ifdef __Pyx_CyFunction_USED | |
19445 if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19446 #endif | |
19447 #ifdef __Pyx_FusedFunction_USED | |
19448 if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19449 #endif | |
19450 #ifdef __Pyx_Coroutine_USED | |
19451 if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19452 #endif | |
19453 #ifdef __Pyx_Generator_USED | |
19454 if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19455 #endif | |
19456 #ifdef __Pyx_AsyncGen_USED | |
19457 if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19458 #endif | |
19459 #ifdef __Pyx_StopAsyncIteration_USED | |
19460 if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19461 #endif | |
19462 /*--- Library function declarations ---*/ | |
19463 /*--- Threads initialization code ---*/ | |
19464 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS | |
19465 PyEval_InitThreads(); | |
19466 #endif | |
19467 /*--- Initialize various global constants etc. ---*/ | |
19468 if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19469 stringtab_initialized = 1; | |
19470 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19471 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) | |
19472 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19473 #endif | |
19474 if (__pyx_module_is_main_pysam__libcfaidx) { | |
19475 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19476 } | |
19477 #if PY_MAJOR_VERSION >= 3 | |
19478 { | |
19479 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) | |
19480 if (!PyDict_GetItemString(modules, "pysam.libcfaidx")) { | |
19481 if (unlikely((PyDict_SetItemString(modules, "pysam.libcfaidx", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
19482 } | |
19483 } | |
19484 #endif | |
19485 /*--- Builtin init code ---*/ | |
19486 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19487 /*--- Constants init code ---*/ | |
19488 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19489 /*--- Global type/function init code ---*/ | |
19490 (void)__Pyx_modinit_global_init_code(); | |
19491 (void)__Pyx_modinit_variable_export_code(); | |
19492 (void)__Pyx_modinit_function_export_code(); | |
19493 if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
19494 if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
19495 (void)__Pyx_modinit_variable_import_code(); | |
19496 if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) | |
19497 /*--- Execution code ---*/ | |
19498 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) | |
19499 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19500 #endif | |
19501 __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_libcfaidx(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error)); | |
19502 | |
19503 /* "pysam/libcfaidx.pyx":48 | |
19504 * # | |
19505 * ############################################################################### | |
19506 * import sys # <<<<<<<<<<<<<< | |
19507 * import os | |
19508 * import re | |
19509 */ | |
19510 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) | |
19511 __Pyx_GOTREF(__pyx_t_2); | |
19512 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 48, __pyx_L1_error) | |
19513 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19514 | |
19515 /* "pysam/libcfaidx.pyx":49 | |
19516 * ############################################################################### | |
19517 * import sys | |
19518 * import os # <<<<<<<<<<<<<< | |
19519 * import re | |
19520 * | |
19521 */ | |
19522 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) | |
19523 __Pyx_GOTREF(__pyx_t_2); | |
19524 if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error) | |
19525 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19526 | |
19527 /* "pysam/libcfaidx.pyx":50 | |
19528 * import sys | |
19529 * import os | |
19530 * import re # <<<<<<<<<<<<<< | |
19531 * | |
19532 * | |
19533 */ | |
19534 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_re, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) | |
19535 __Pyx_GOTREF(__pyx_t_2); | |
19536 if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_2) < 0) __PYX_ERR(0, 50, __pyx_L1_error) | |
19537 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19538 | |
19539 /* "pysam/libcfaidx.pyx":123 | |
19540 * self._open(*args, **kwargs) | |
19541 * | |
19542 * def is_open(self): # <<<<<<<<<<<<<< | |
19543 * '''return true if samfile has been opened.''' | |
19544 * return self.fastafile != NULL | |
19545 */ | |
19546 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastaFile_3is_open, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastaFile_is_open, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) | |
19547 __Pyx_GOTREF(__pyx_t_2); | |
19548 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastaFile, __pyx_n_s_is_open, __pyx_t_2) < 0) __PYX_ERR(0, 123, __pyx_L1_error) | |
19549 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19550 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastaFile); | |
19551 | |
19552 /* "pysam/libcfaidx.pyx":133 | |
19553 * return faidx_nseq(self.fastafile) | |
19554 * | |
19555 * def _open(self, filename, filepath_index=None, filepath_index_compressed=None): # <<<<<<<<<<<<<< | |
19556 * '''open an indexed fasta file. | |
19557 * | |
19558 */ | |
19559 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastaFile_7_open, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastaFile__open, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) | |
19560 __Pyx_GOTREF(__pyx_t_2); | |
19561 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__51); | |
19562 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastaFile, __pyx_n_s_open, __pyx_t_2) < 0) __PYX_ERR(0, 133, __pyx_L1_error) | |
19563 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19564 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastaFile); | |
19565 | |
19566 /* "pysam/libcfaidx.pyx":195 | |
19567 * self.reference2length = dict(zip(self._references, self._lengths)) | |
19568 * | |
19569 * def close(self): # <<<<<<<<<<<<<< | |
19570 * """close the file.""" | |
19571 * if self.fastafile != NULL: | |
19572 */ | |
19573 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastaFile_9close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastaFile_close, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) | |
19574 __Pyx_GOTREF(__pyx_t_2); | |
19575 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastaFile, __pyx_n_s_close, __pyx_t_2) < 0) __PYX_ERR(0, 195, __pyx_L1_error) | |
19576 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19577 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastaFile); | |
19578 | |
19579 /* "pysam/libcfaidx.pyx":207 | |
19580 * | |
19581 * # context manager interface | |
19582 * def __enter__(self): # <<<<<<<<<<<<<< | |
19583 * return self | |
19584 * | |
19585 */ | |
19586 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastaFile_13__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastaFile___enter, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) | |
19587 __Pyx_GOTREF(__pyx_t_2); | |
19588 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastaFile, __pyx_n_s_enter, __pyx_t_2) < 0) __PYX_ERR(0, 207, __pyx_L1_error) | |
19589 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19590 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastaFile); | |
19591 | |
19592 /* "pysam/libcfaidx.pyx":210 | |
19593 * return self | |
19594 * | |
19595 * def __exit__(self, exc_type, exc_value, traceback): # <<<<<<<<<<<<<< | |
19596 * self.close() | |
19597 * return False | |
19598 */ | |
19599 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastaFile_15__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastaFile___exit, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) | |
19600 __Pyx_GOTREF(__pyx_t_2); | |
19601 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastaFile, __pyx_n_s_exit, __pyx_t_2) < 0) __PYX_ERR(0, 210, __pyx_L1_error) | |
19602 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19603 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastaFile); | |
19604 | |
19605 /* "pysam/libcfaidx.pyx":242 | |
19606 * return self._lengths | |
19607 * | |
19608 * def fetch(self, # <<<<<<<<<<<<<< | |
19609 * reference=None, | |
19610 * start=None, | |
19611 */ | |
19612 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastaFile_17fetch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastaFile_fetch, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) | |
19613 __Pyx_GOTREF(__pyx_t_2); | |
19614 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__54); | |
19615 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastaFile, __pyx_n_s_fetch, __pyx_t_2) < 0) __PYX_ERR(0, 242, __pyx_L1_error) | |
19616 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19617 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastaFile); | |
19618 | |
19619 /* "pysam/libcfaidx.pyx":343 | |
19620 * return seq | |
19621 * | |
19622 * def get_reference_length(self, reference): # <<<<<<<<<<<<<< | |
19623 * '''return the length of reference.''' | |
19624 * return self.reference2length[reference] | |
19625 */ | |
19626 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastaFile_19get_reference_length, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastaFile_get_reference_length, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) | |
19627 __Pyx_GOTREF(__pyx_t_2); | |
19628 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastaFile, __pyx_n_s_get_reference_length, __pyx_t_2) < 0) __PYX_ERR(0, 343, __pyx_L1_error) | |
19629 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19630 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastaFile); | |
19631 | |
19632 /* "(tree fragment)":1 | |
19633 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
19634 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
19635 * def __setstate_cython__(self, __pyx_state): | |
19636 */ | |
19637 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastaFile_25__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastaFile___reduce_cython, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
19638 __Pyx_GOTREF(__pyx_t_2); | |
19639 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
19640 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19641 | |
19642 /* "(tree fragment)":3 | |
19643 * def __reduce_cython__(self): | |
19644 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
19645 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
19646 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
19647 */ | |
19648 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastaFile_27__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastaFile___setstate_cython, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) | |
19649 __Pyx_GOTREF(__pyx_t_2); | |
19650 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) | |
19651 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19652 | |
19653 /* "pysam/libcfaidx.pyx":404 | |
19654 * return self.to_string() | |
19655 * | |
19656 * cpdef array.array get_quality_array(self, int offset=33): # <<<<<<<<<<<<<< | |
19657 * '''return quality values as integer array after subtracting offset.''' | |
19658 * if self.quality is None: | |
19659 */ | |
19660 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_10FastqProxy_5get_quality_array, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastqProxy_get_quality_array, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) | |
19661 __Pyx_GOTREF(__pyx_t_2); | |
19662 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__58); | |
19663 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastqProxy, __pyx_n_s_get_quality_array, __pyx_t_2) < 0) __PYX_ERR(0, 404, __pyx_L1_error) | |
19664 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19665 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastqProxy); | |
19666 | |
19667 /* "(tree fragment)":1 | |
19668 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
19669 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" | |
19670 * def __setstate_cython__(self, __pyx_state): | |
19671 */ | |
19672 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_10FastqProxy_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastqProxy___reduce_cython, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
19673 __Pyx_GOTREF(__pyx_t_2); | |
19674 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
19675 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19676 | |
19677 /* "(tree fragment)":3 | |
19678 * def __reduce_cython__(self): | |
19679 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" | |
19680 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
19681 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" | |
19682 */ | |
19683 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_10FastqProxy_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastqProxy___setstate_cython, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) | |
19684 __Pyx_GOTREF(__pyx_t_2); | |
19685 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) | |
19686 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19687 | |
19688 /* "pysam/libcfaidx.pyx":435 | |
19689 * self.name = name | |
19690 * | |
19691 * def __copy__(self): # <<<<<<<<<<<<<< | |
19692 * return FastxRecord(self.name, self.comment, self.sequence, self.quality) | |
19693 * | |
19694 */ | |
19695 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_11FastxRecord_3__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastxRecord___copy, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error) | |
19696 __Pyx_GOTREF(__pyx_t_2); | |
19697 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxRecord, __pyx_n_s_copy, __pyx_t_2) < 0) __PYX_ERR(0, 435, __pyx_L1_error) | |
19698 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19699 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastxRecord); | |
19700 | |
19701 /* "pysam/libcfaidx.pyx":438 | |
19702 * return FastxRecord(self.name, self.comment, self.sequence, self.quality) | |
19703 * | |
19704 * def __deepcopy__(self, memo): # <<<<<<<<<<<<<< | |
19705 * return FastxRecord(self.name, self.comment, self.sequence, self.quality) | |
19706 * | |
19707 */ | |
19708 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_11FastxRecord_5__deepcopy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastxRecord___deepcopy, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) | |
19709 __Pyx_GOTREF(__pyx_t_2); | |
19710 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxRecord, __pyx_n_s_deepcopy, __pyx_t_2) < 0) __PYX_ERR(0, 438, __pyx_L1_error) | |
19711 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19712 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastxRecord); | |
19713 | |
19714 /* "pysam/libcfaidx.pyx":463 | |
19715 * return self.to_string() | |
19716 * | |
19717 * def set_name(self, name): # <<<<<<<<<<<<<< | |
19718 * if name is None: | |
19719 * raise ValueError("FastxRecord must have a name and not None") | |
19720 */ | |
19721 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_11FastxRecord_7set_name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastxRecord_set_name, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) | |
19722 __Pyx_GOTREF(__pyx_t_2); | |
19723 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxRecord, __pyx_n_s_set_name, __pyx_t_2) < 0) __PYX_ERR(0, 463, __pyx_L1_error) | |
19724 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19725 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastxRecord); | |
19726 | |
19727 /* "pysam/libcfaidx.pyx":468 | |
19728 * self.name = name | |
19729 * | |
19730 * def set_comment(self, comment): # <<<<<<<<<<<<<< | |
19731 * self.comment = comment | |
19732 * | |
19733 */ | |
19734 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_11FastxRecord_9set_comment, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastxRecord_set_comment, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) | |
19735 __Pyx_GOTREF(__pyx_t_2); | |
19736 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxRecord, __pyx_n_s_set_comment, __pyx_t_2) < 0) __PYX_ERR(0, 468, __pyx_L1_error) | |
19737 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19738 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastxRecord); | |
19739 | |
19740 /* "pysam/libcfaidx.pyx":471 | |
19741 * self.comment = comment | |
19742 * | |
19743 * def set_sequence(self, sequence, quality=None): # <<<<<<<<<<<<<< | |
19744 * """set sequence of this record. | |
19745 * | |
19746 */ | |
19747 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_11FastxRecord_11set_sequence, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastxRecord_set_sequence, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) | |
19748 __Pyx_GOTREF(__pyx_t_2); | |
19749 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__63); | |
19750 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxRecord, __pyx_n_s_set_sequence, __pyx_t_2) < 0) __PYX_ERR(0, 471, __pyx_L1_error) | |
19751 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19752 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastxRecord); | |
19753 | |
19754 /* "pysam/libcfaidx.pyx":488 | |
19755 * return self.to_string() | |
19756 * | |
19757 * cpdef array.array get_quality_array(self, int offset=33): # <<<<<<<<<<<<<< | |
19758 * '''return quality values as array after subtracting offset.''' | |
19759 * if self.quality is None: | |
19760 */ | |
19761 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_11FastxRecord_15get_quality_array, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastxRecord_get_quality_array, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) | |
19762 __Pyx_GOTREF(__pyx_t_2); | |
19763 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__58); | |
19764 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxRecord, __pyx_n_s_get_quality_array, __pyx_t_2) < 0) __PYX_ERR(0, 488, __pyx_L1_error) | |
19765 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19766 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastxRecord); | |
19767 | |
19768 /* "(tree fragment)":1 | |
19769 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
19770 * cdef tuple state | |
19771 * cdef object _dict | |
19772 */ | |
19773 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_11FastxRecord_17__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastxRecord___reduce_cython, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
19774 __Pyx_GOTREF(__pyx_t_2); | |
19775 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxRecord, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
19776 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19777 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastxRecord); | |
19778 | |
19779 /* "(tree fragment)":16 | |
19780 * else: | |
19781 * return __pyx_unpickle_FastxRecord, (type(self), 0x1bdb611, state) | |
19782 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
19783 * __pyx_unpickle_FastxRecord__set_state(self, __pyx_state) | |
19784 */ | |
19785 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_11FastxRecord_19__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastxRecord___setstate_cython, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) | |
19786 __Pyx_GOTREF(__pyx_t_2); | |
19787 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxRecord, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 16, __pyx_L1_error) | |
19788 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19789 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastxRecord); | |
19790 | |
19791 /* "pysam/libcfaidx.pyx":551 | |
19792 * self._open(*args, **kwargs) | |
19793 * | |
19794 * def is_open(self): # <<<<<<<<<<<<<< | |
19795 * '''return true if samfile has been opened.''' | |
19796 * return self.entry != NULL | |
19797 */ | |
19798 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastxFile_3is_open, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastxFile_is_open, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) | |
19799 __Pyx_GOTREF(__pyx_t_2); | |
19800 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxFile, __pyx_n_s_is_open, __pyx_t_2) < 0) __PYX_ERR(0, 551, __pyx_L1_error) | |
19801 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19802 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastxFile); | |
19803 | |
19804 /* "pysam/libcfaidx.pyx":555 | |
19805 * return self.entry != NULL | |
19806 * | |
19807 * def _open(self, filename, persist=True): # <<<<<<<<<<<<<< | |
19808 * '''open a fastq/fasta file in *filename* | |
19809 * | |
19810 */ | |
19811 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastxFile_5_open, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastxFile__open, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error) | |
19812 __Pyx_GOTREF(__pyx_t_2); | |
19813 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__66); | |
19814 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxFile, __pyx_n_s_open, __pyx_t_2) < 0) __PYX_ERR(0, 555, __pyx_L1_error) | |
19815 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19816 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastxFile); | |
19817 | |
19818 /* "pysam/libcfaidx.pyx":588 | |
19819 * self._filename = filename | |
19820 * | |
19821 * def close(self): # <<<<<<<<<<<<<< | |
19822 * '''close the file.''' | |
19823 * if self.fastqfile != NULL: | |
19824 */ | |
19825 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastxFile_7close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastxFile_close, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error) | |
19826 __Pyx_GOTREF(__pyx_t_2); | |
19827 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxFile, __pyx_n_s_close, __pyx_t_2) < 0) __PYX_ERR(0, 588, __pyx_L1_error) | |
19828 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19829 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastxFile); | |
19830 | |
19831 /* "pysam/libcfaidx.pyx":604 | |
19832 * | |
19833 * # context manager interface | |
19834 * def __enter__(self): # <<<<<<<<<<<<<< | |
19835 * return self | |
19836 * | |
19837 */ | |
19838 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastxFile_11__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastxFile___enter, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) | |
19839 __Pyx_GOTREF(__pyx_t_2); | |
19840 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxFile, __pyx_n_s_enter, __pyx_t_2) < 0) __PYX_ERR(0, 604, __pyx_L1_error) | |
19841 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19842 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastxFile); | |
19843 | |
19844 /* "pysam/libcfaidx.pyx":607 | |
19845 * return self | |
19846 * | |
19847 * def __exit__(self, exc_type, exc_value, traceback): # <<<<<<<<<<<<<< | |
19848 * self.close() | |
19849 * return False | |
19850 */ | |
19851 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastxFile_13__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastxFile___exit, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error) | |
19852 __Pyx_GOTREF(__pyx_t_2); | |
19853 if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_5pysam_9libcfaidx_FastxFile, __pyx_n_s_exit, __pyx_t_2) < 0) __PYX_ERR(0, 607, __pyx_L1_error) | |
19854 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19855 PyType_Modified(__pyx_ptype_5pysam_9libcfaidx_FastxFile); | |
19856 | |
19857 /* "(tree fragment)":1 | |
19858 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
19859 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
19860 * def __setstate_cython__(self, __pyx_state): | |
19861 */ | |
19862 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastxFile_19__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastxFile___reduce_cython, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
19863 __Pyx_GOTREF(__pyx_t_2); | |
19864 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
19865 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19866 | |
19867 /* "(tree fragment)":3 | |
19868 * def __reduce_cython__(self): | |
19869 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
19870 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
19871 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
19872 */ | |
19873 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastxFile_21__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastxFile___setstate_cython, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) | |
19874 __Pyx_GOTREF(__pyx_t_2); | |
19875 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) | |
19876 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19877 | |
19878 /* "(tree fragment)":1 | |
19879 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
19880 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
19881 * def __setstate_cython__(self, __pyx_state): | |
19882 */ | |
19883 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastqFile_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastqFile___reduce_cython, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
19884 __Pyx_GOTREF(__pyx_t_2); | |
19885 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
19886 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19887 | |
19888 /* "(tree fragment)":3 | |
19889 * def __reduce_cython__(self): | |
19890 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
19891 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
19892 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
19893 */ | |
19894 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9FastqFile_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FastqFile___setstate_cython, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) | |
19895 __Pyx_GOTREF(__pyx_t_2); | |
19896 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) | |
19897 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19898 | |
19899 /* "(tree fragment)":1 | |
19900 * def __reduce_cython__(self): # <<<<<<<<<<<<<< | |
19901 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
19902 * def __setstate_cython__(self, __pyx_state): | |
19903 */ | |
19904 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9Fastafile_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Fastafile___reduce_cython, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
19905 __Pyx_GOTREF(__pyx_t_2); | |
19906 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
19907 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19908 | |
19909 /* "(tree fragment)":3 | |
19910 * def __reduce_cython__(self): | |
19911 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
19912 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< | |
19913 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" | |
19914 */ | |
19915 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_9Fastafile_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Fastafile___setstate_cython, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) | |
19916 __Pyx_GOTREF(__pyx_t_2); | |
19917 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) | |
19918 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19919 | |
19920 /* "pysam/libcfaidx.pyx":667 | |
19921 * pass | |
19922 * | |
19923 * __all__ = ["FastaFile", # <<<<<<<<<<<<<< | |
19924 * "FastqFile", | |
19925 * "FastxFile", | |
19926 */ | |
19927 __pyx_t_2 = PyList_New(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error) | |
19928 __Pyx_GOTREF(__pyx_t_2); | |
19929 __Pyx_INCREF(__pyx_n_u_FastaFile); | |
19930 __Pyx_GIVEREF(__pyx_n_u_FastaFile); | |
19931 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_FastaFile)) __PYX_ERR(0, 667, __pyx_L1_error); | |
19932 __Pyx_INCREF(__pyx_n_u_FastqFile); | |
19933 __Pyx_GIVEREF(__pyx_n_u_FastqFile); | |
19934 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_FastqFile)) __PYX_ERR(0, 667, __pyx_L1_error); | |
19935 __Pyx_INCREF(__pyx_n_u_FastxFile); | |
19936 __Pyx_GIVEREF(__pyx_n_u_FastxFile); | |
19937 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_u_FastxFile)) __PYX_ERR(0, 667, __pyx_L1_error); | |
19938 __Pyx_INCREF(__pyx_n_u_Fastafile); | |
19939 __Pyx_GIVEREF(__pyx_n_u_Fastafile); | |
19940 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_u_Fastafile)) __PYX_ERR(0, 667, __pyx_L1_error); | |
19941 __Pyx_INCREF(__pyx_n_u_FastxRecord); | |
19942 __Pyx_GIVEREF(__pyx_n_u_FastxRecord); | |
19943 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_u_FastxRecord)) __PYX_ERR(0, 667, __pyx_L1_error); | |
19944 __Pyx_INCREF(__pyx_n_u_FastqProxy); | |
19945 __Pyx_GIVEREF(__pyx_n_u_FastqProxy); | |
19946 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_u_FastqProxy)) __PYX_ERR(0, 667, __pyx_L1_error); | |
19947 if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 667, __pyx_L1_error) | |
19948 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19949 | |
19950 /* "(tree fragment)":1 | |
19951 * def __pyx_unpickle_FastxRecord(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< | |
19952 * cdef object __pyx_PickleError | |
19953 * cdef object __pyx_result | |
19954 */ | |
19955 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_9libcfaidx_1__pyx_unpickle_FastxRecord, 0, __pyx_n_s_pyx_unpickle_FastxRecord, NULL, __pyx_n_s_pysam_libcfaidx, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) | |
19956 __Pyx_GOTREF(__pyx_t_2); | |
19957 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_FastxRecord, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) | |
19958 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19959 | |
19960 /* "pysam/libcfaidx.pyx":1 | |
19961 * # cython: embedsignature=True # <<<<<<<<<<<<<< | |
19962 * # cython: profile=True | |
19963 * ############################################################################### | |
19964 */ | |
19965 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) | |
19966 __Pyx_GOTREF(__pyx_t_2); | |
19967 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) | |
19968 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
19969 __Pyx_TraceReturn(Py_None, 0); | |
19970 | |
19971 /*--- Wrapped vars code ---*/ | |
19972 | |
19973 goto __pyx_L0; | |
19974 __pyx_L1_error:; | |
19975 __Pyx_XDECREF(__pyx_t_2); | |
19976 if (__pyx_m) { | |
19977 if (__pyx_d && stringtab_initialized) { | |
19978 __Pyx_AddTraceback("init pysam.libcfaidx", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
19979 } | |
19980 #if !CYTHON_USE_MODULE_STATE | |
19981 Py_CLEAR(__pyx_m); | |
19982 #else | |
19983 Py_DECREF(__pyx_m); | |
19984 if (pystate_addmodule_run) { | |
19985 PyObject *tp, *value, *tb; | |
19986 PyErr_Fetch(&tp, &value, &tb); | |
19987 PyState_RemoveModule(&__pyx_moduledef); | |
19988 PyErr_Restore(tp, value, tb); | |
19989 } | |
19990 #endif | |
19991 } else if (!PyErr_Occurred()) { | |
19992 PyErr_SetString(PyExc_ImportError, "init pysam.libcfaidx"); | |
19993 } | |
19994 __pyx_L0:; | |
19995 __Pyx_RefNannyFinishContext(); | |
19996 #if CYTHON_PEP489_MULTI_PHASE_INIT | |
19997 return (__pyx_m != NULL) ? 0 : -1; | |
19998 #elif PY_MAJOR_VERSION >= 3 | |
19999 return __pyx_m; | |
20000 #else | |
20001 return; | |
20002 #endif | |
20003 } | |
20004 /* #### Code section: cleanup_globals ### */ | |
20005 /* #### Code section: cleanup_module ### */ | |
20006 /* #### Code section: main_method ### */ | |
20007 /* #### Code section: utility_code_pragmas ### */ | |
20008 #ifdef _MSC_VER | |
20009 #pragma warning( push ) | |
20010 /* Warning 4127: conditional expression is constant | |
20011 * Cython uses constant conditional expressions to allow in inline functions to be optimized at | |
20012 * compile-time, so this warning is not useful | |
20013 */ | |
20014 #pragma warning( disable : 4127 ) | |
20015 #endif | |
20016 | |
20017 | |
20018 | |
20019 /* #### Code section: utility_code_def ### */ | |
20020 | |
20021 /* --- Runtime support code --- */ | |
20022 /* Refnanny */ | |
20023 #if CYTHON_REFNANNY | |
20024 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { | |
20025 PyObject *m = NULL, *p = NULL; | |
20026 void *r = NULL; | |
20027 m = PyImport_ImportModule(modname); | |
20028 if (!m) goto end; | |
20029 p = PyObject_GetAttrString(m, "RefNannyAPI"); | |
20030 if (!p) goto end; | |
20031 r = PyLong_AsVoidPtr(p); | |
20032 end: | |
20033 Py_XDECREF(p); | |
20034 Py_XDECREF(m); | |
20035 return (__Pyx_RefNannyAPIStruct *)r; | |
20036 } | |
20037 #endif | |
20038 | |
20039 /* PyErrExceptionMatches */ | |
20040 #if CYTHON_FAST_THREAD_STATE | |
20041 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { | |
20042 Py_ssize_t i, n; | |
20043 n = PyTuple_GET_SIZE(tuple); | |
20044 #if PY_MAJOR_VERSION >= 3 | |
20045 for (i=0; i<n; i++) { | |
20046 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1; | |
20047 } | |
20048 #endif | |
20049 for (i=0; i<n; i++) { | |
20050 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1; | |
20051 } | |
20052 return 0; | |
20053 } | |
20054 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { | |
20055 int result; | |
20056 PyObject *exc_type; | |
20057 #if PY_VERSION_HEX >= 0x030C00A6 | |
20058 PyObject *current_exception = tstate->current_exception; | |
20059 if (unlikely(!current_exception)) return 0; | |
20060 exc_type = (PyObject*) Py_TYPE(current_exception); | |
20061 if (exc_type == err) return 1; | |
20062 #else | |
20063 exc_type = tstate->curexc_type; | |
20064 if (exc_type == err) return 1; | |
20065 if (unlikely(!exc_type)) return 0; | |
20066 #endif | |
20067 #if CYTHON_AVOID_BORROWED_REFS | |
20068 Py_INCREF(exc_type); | |
20069 #endif | |
20070 if (unlikely(PyTuple_Check(err))) { | |
20071 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); | |
20072 } else { | |
20073 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); | |
20074 } | |
20075 #if CYTHON_AVOID_BORROWED_REFS | |
20076 Py_DECREF(exc_type); | |
20077 #endif | |
20078 return result; | |
20079 } | |
20080 #endif | |
20081 | |
20082 /* PyErrFetchRestore */ | |
20083 #if CYTHON_FAST_THREAD_STATE | |
20084 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { | |
20085 #if PY_VERSION_HEX >= 0x030C00A6 | |
20086 PyObject *tmp_value; | |
20087 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); | |
20088 if (value) { | |
20089 #if CYTHON_COMPILING_IN_CPYTHON | |
20090 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) | |
20091 #endif | |
20092 PyException_SetTraceback(value, tb); | |
20093 } | |
20094 tmp_value = tstate->current_exception; | |
20095 tstate->current_exception = value; | |
20096 Py_XDECREF(tmp_value); | |
20097 Py_XDECREF(type); | |
20098 Py_XDECREF(tb); | |
20099 #else | |
20100 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
20101 tmp_type = tstate->curexc_type; | |
20102 tmp_value = tstate->curexc_value; | |
20103 tmp_tb = tstate->curexc_traceback; | |
20104 tstate->curexc_type = type; | |
20105 tstate->curexc_value = value; | |
20106 tstate->curexc_traceback = tb; | |
20107 Py_XDECREF(tmp_type); | |
20108 Py_XDECREF(tmp_value); | |
20109 Py_XDECREF(tmp_tb); | |
20110 #endif | |
20111 } | |
20112 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { | |
20113 #if PY_VERSION_HEX >= 0x030C00A6 | |
20114 PyObject* exc_value; | |
20115 exc_value = tstate->current_exception; | |
20116 tstate->current_exception = 0; | |
20117 *value = exc_value; | |
20118 *type = NULL; | |
20119 *tb = NULL; | |
20120 if (exc_value) { | |
20121 *type = (PyObject*) Py_TYPE(exc_value); | |
20122 Py_INCREF(*type); | |
20123 #if CYTHON_COMPILING_IN_CPYTHON | |
20124 *tb = ((PyBaseExceptionObject*) exc_value)->traceback; | |
20125 Py_XINCREF(*tb); | |
20126 #else | |
20127 *tb = PyException_GetTraceback(exc_value); | |
20128 #endif | |
20129 } | |
20130 #else | |
20131 *type = tstate->curexc_type; | |
20132 *value = tstate->curexc_value; | |
20133 *tb = tstate->curexc_traceback; | |
20134 tstate->curexc_type = 0; | |
20135 tstate->curexc_value = 0; | |
20136 tstate->curexc_traceback = 0; | |
20137 #endif | |
20138 } | |
20139 #endif | |
20140 | |
20141 /* PyObjectGetAttrStr */ | |
20142 #if CYTHON_USE_TYPE_SLOTS | |
20143 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { | |
20144 PyTypeObject* tp = Py_TYPE(obj); | |
20145 if (likely(tp->tp_getattro)) | |
20146 return tp->tp_getattro(obj, attr_name); | |
20147 #if PY_MAJOR_VERSION < 3 | |
20148 if (likely(tp->tp_getattr)) | |
20149 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); | |
20150 #endif | |
20151 return PyObject_GetAttr(obj, attr_name); | |
20152 } | |
20153 #endif | |
20154 | |
20155 /* PyObjectGetAttrStrNoError */ | |
20156 #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 | |
20157 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { | |
20158 __Pyx_PyThreadState_declare | |
20159 __Pyx_PyThreadState_assign | |
20160 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) | |
20161 __Pyx_PyErr_Clear(); | |
20162 } | |
20163 #endif | |
20164 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { | |
20165 PyObject *result; | |
20166 #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 | |
20167 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); | |
20168 return result; | |
20169 #else | |
20170 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 | |
20171 PyTypeObject* tp = Py_TYPE(obj); | |
20172 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { | |
20173 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); | |
20174 } | |
20175 #endif | |
20176 result = __Pyx_PyObject_GetAttrStr(obj, attr_name); | |
20177 if (unlikely(!result)) { | |
20178 __Pyx_PyObject_GetAttrStr_ClearAttributeError(); | |
20179 } | |
20180 return result; | |
20181 #endif | |
20182 } | |
20183 | |
20184 /* GetBuiltinName */ | |
20185 static PyObject *__Pyx_GetBuiltinName(PyObject *name) { | |
20186 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); | |
20187 if (unlikely(!result) && !PyErr_Occurred()) { | |
20188 PyErr_Format(PyExc_NameError, | |
20189 #if PY_MAJOR_VERSION >= 3 | |
20190 "name '%U' is not defined", name); | |
20191 #else | |
20192 "name '%.200s' is not defined", PyString_AS_STRING(name)); | |
20193 #endif | |
20194 } | |
20195 return result; | |
20196 } | |
20197 | |
20198 /* TupleAndListFromArray */ | |
20199 #if CYTHON_COMPILING_IN_CPYTHON | |
20200 static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { | |
20201 PyObject *v; | |
20202 Py_ssize_t i; | |
20203 for (i = 0; i < length; i++) { | |
20204 v = dest[i] = src[i]; | |
20205 Py_INCREF(v); | |
20206 } | |
20207 } | |
20208 static CYTHON_INLINE PyObject * | |
20209 __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) | |
20210 { | |
20211 PyObject *res; | |
20212 if (n <= 0) { | |
20213 Py_INCREF(__pyx_empty_tuple); | |
20214 return __pyx_empty_tuple; | |
20215 } | |
20216 res = PyTuple_New(n); | |
20217 if (unlikely(res == NULL)) return NULL; | |
20218 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); | |
20219 return res; | |
20220 } | |
20221 static CYTHON_INLINE PyObject * | |
20222 __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) | |
20223 { | |
20224 PyObject *res; | |
20225 if (n <= 0) { | |
20226 return PyList_New(0); | |
20227 } | |
20228 res = PyList_New(n); | |
20229 if (unlikely(res == NULL)) return NULL; | |
20230 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); | |
20231 return res; | |
20232 } | |
20233 #endif | |
20234 | |
20235 /* BytesEquals */ | |
20236 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { | |
20237 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API | |
20238 return PyObject_RichCompareBool(s1, s2, equals); | |
20239 #else | |
20240 if (s1 == s2) { | |
20241 return (equals == Py_EQ); | |
20242 } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { | |
20243 const char *ps1, *ps2; | |
20244 Py_ssize_t length = PyBytes_GET_SIZE(s1); | |
20245 if (length != PyBytes_GET_SIZE(s2)) | |
20246 return (equals == Py_NE); | |
20247 ps1 = PyBytes_AS_STRING(s1); | |
20248 ps2 = PyBytes_AS_STRING(s2); | |
20249 if (ps1[0] != ps2[0]) { | |
20250 return (equals == Py_NE); | |
20251 } else if (length == 1) { | |
20252 return (equals == Py_EQ); | |
20253 } else { | |
20254 int result; | |
20255 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) | |
20256 Py_hash_t hash1, hash2; | |
20257 hash1 = ((PyBytesObject*)s1)->ob_shash; | |
20258 hash2 = ((PyBytesObject*)s2)->ob_shash; | |
20259 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { | |
20260 return (equals == Py_NE); | |
20261 } | |
20262 #endif | |
20263 result = memcmp(ps1, ps2, (size_t)length); | |
20264 return (equals == Py_EQ) ? (result == 0) : (result != 0); | |
20265 } | |
20266 } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { | |
20267 return (equals == Py_NE); | |
20268 } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { | |
20269 return (equals == Py_NE); | |
20270 } else { | |
20271 int result; | |
20272 PyObject* py_result = PyObject_RichCompare(s1, s2, equals); | |
20273 if (!py_result) | |
20274 return -1; | |
20275 result = __Pyx_PyObject_IsTrue(py_result); | |
20276 Py_DECREF(py_result); | |
20277 return result; | |
20278 } | |
20279 #endif | |
20280 } | |
20281 | |
20282 /* UnicodeEquals */ | |
20283 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { | |
20284 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API | |
20285 return PyObject_RichCompareBool(s1, s2, equals); | |
20286 #else | |
20287 #if PY_MAJOR_VERSION < 3 | |
20288 PyObject* owned_ref = NULL; | |
20289 #endif | |
20290 int s1_is_unicode, s2_is_unicode; | |
20291 if (s1 == s2) { | |
20292 goto return_eq; | |
20293 } | |
20294 s1_is_unicode = PyUnicode_CheckExact(s1); | |
20295 s2_is_unicode = PyUnicode_CheckExact(s2); | |
20296 #if PY_MAJOR_VERSION < 3 | |
20297 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { | |
20298 owned_ref = PyUnicode_FromObject(s2); | |
20299 if (unlikely(!owned_ref)) | |
20300 return -1; | |
20301 s2 = owned_ref; | |
20302 s2_is_unicode = 1; | |
20303 } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { | |
20304 owned_ref = PyUnicode_FromObject(s1); | |
20305 if (unlikely(!owned_ref)) | |
20306 return -1; | |
20307 s1 = owned_ref; | |
20308 s1_is_unicode = 1; | |
20309 } else if (((!s2_is_unicode) & (!s1_is_unicode))) { | |
20310 return __Pyx_PyBytes_Equals(s1, s2, equals); | |
20311 } | |
20312 #endif | |
20313 if (s1_is_unicode & s2_is_unicode) { | |
20314 Py_ssize_t length; | |
20315 int kind; | |
20316 void *data1, *data2; | |
20317 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) | |
20318 return -1; | |
20319 length = __Pyx_PyUnicode_GET_LENGTH(s1); | |
20320 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { | |
20321 goto return_ne; | |
20322 } | |
20323 #if CYTHON_USE_UNICODE_INTERNALS | |
20324 { | |
20325 Py_hash_t hash1, hash2; | |
20326 #if CYTHON_PEP393_ENABLED | |
20327 hash1 = ((PyASCIIObject*)s1)->hash; | |
20328 hash2 = ((PyASCIIObject*)s2)->hash; | |
20329 #else | |
20330 hash1 = ((PyUnicodeObject*)s1)->hash; | |
20331 hash2 = ((PyUnicodeObject*)s2)->hash; | |
20332 #endif | |
20333 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { | |
20334 goto return_ne; | |
20335 } | |
20336 } | |
20337 #endif | |
20338 kind = __Pyx_PyUnicode_KIND(s1); | |
20339 if (kind != __Pyx_PyUnicode_KIND(s2)) { | |
20340 goto return_ne; | |
20341 } | |
20342 data1 = __Pyx_PyUnicode_DATA(s1); | |
20343 data2 = __Pyx_PyUnicode_DATA(s2); | |
20344 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { | |
20345 goto return_ne; | |
20346 } else if (length == 1) { | |
20347 goto return_eq; | |
20348 } else { | |
20349 int result = memcmp(data1, data2, (size_t)(length * kind)); | |
20350 #if PY_MAJOR_VERSION < 3 | |
20351 Py_XDECREF(owned_ref); | |
20352 #endif | |
20353 return (equals == Py_EQ) ? (result == 0) : (result != 0); | |
20354 } | |
20355 } else if ((s1 == Py_None) & s2_is_unicode) { | |
20356 goto return_ne; | |
20357 } else if ((s2 == Py_None) & s1_is_unicode) { | |
20358 goto return_ne; | |
20359 } else { | |
20360 int result; | |
20361 PyObject* py_result = PyObject_RichCompare(s1, s2, equals); | |
20362 #if PY_MAJOR_VERSION < 3 | |
20363 Py_XDECREF(owned_ref); | |
20364 #endif | |
20365 if (!py_result) | |
20366 return -1; | |
20367 result = __Pyx_PyObject_IsTrue(py_result); | |
20368 Py_DECREF(py_result); | |
20369 return result; | |
20370 } | |
20371 return_eq: | |
20372 #if PY_MAJOR_VERSION < 3 | |
20373 Py_XDECREF(owned_ref); | |
20374 #endif | |
20375 return (equals == Py_EQ); | |
20376 return_ne: | |
20377 #if PY_MAJOR_VERSION < 3 | |
20378 Py_XDECREF(owned_ref); | |
20379 #endif | |
20380 return (equals == Py_NE); | |
20381 #endif | |
20382 } | |
20383 | |
20384 /* fastcall */ | |
20385 #if CYTHON_METH_FASTCALL | |
20386 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) | |
20387 { | |
20388 Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); | |
20389 for (i = 0; i < n; i++) | |
20390 { | |
20391 if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; | |
20392 } | |
20393 for (i = 0; i < n; i++) | |
20394 { | |
20395 int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); | |
20396 if (unlikely(eq != 0)) { | |
20397 if (unlikely(eq < 0)) return NULL; | |
20398 return kwvalues[i]; | |
20399 } | |
20400 } | |
20401 return NULL; | |
20402 } | |
20403 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 | |
20404 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { | |
20405 Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); | |
20406 PyObject *dict; | |
20407 dict = PyDict_New(); | |
20408 if (unlikely(!dict)) | |
20409 return NULL; | |
20410 for (i=0; i<nkwargs; i++) { | |
20411 PyObject *key = PyTuple_GET_ITEM(kwnames, i); | |
20412 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0)) | |
20413 goto bad; | |
20414 } | |
20415 return dict; | |
20416 bad: | |
20417 Py_DECREF(dict); | |
20418 return NULL; | |
20419 } | |
20420 #endif | |
20421 #endif | |
20422 | |
20423 /* Profile */ | |
20424 #if CYTHON_PROFILE | |
20425 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, | |
20426 PyFrameObject** frame, | |
20427 PyThreadState* tstate, | |
20428 const char *funcname, | |
20429 const char *srcfile, | |
20430 int firstlineno) { | |
20431 PyObject *type, *value, *traceback; | |
20432 int retval; | |
20433 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { | |
20434 if (*code == NULL) { | |
20435 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); | |
20436 if (*code == NULL) return 0; | |
20437 } | |
20438 *frame = PyFrame_New( | |
20439 tstate, /*PyThreadState *tstate*/ | |
20440 *code, /*PyCodeObject *code*/ | |
20441 __pyx_d, /*PyObject *globals*/ | |
20442 0 /*PyObject *locals*/ | |
20443 ); | |
20444 if (*frame == NULL) return 0; | |
20445 if (CYTHON_TRACE && (*frame)->f_trace == NULL) { | |
20446 Py_INCREF(Py_None); | |
20447 (*frame)->f_trace = Py_None; | |
20448 } | |
20449 #if PY_VERSION_HEX < 0x030400B1 | |
20450 } else { | |
20451 (*frame)->f_tstate = tstate; | |
20452 #endif | |
20453 } | |
20454 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno); | |
20455 retval = 1; | |
20456 __Pyx_EnterTracing(tstate); | |
20457 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback); | |
20458 #if CYTHON_TRACE | |
20459 if (tstate->c_tracefunc) | |
20460 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0; | |
20461 if (retval && tstate->c_profilefunc) | |
20462 #endif | |
20463 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; | |
20464 __Pyx_LeaveTracing(tstate); | |
20465 if (retval) { | |
20466 __Pyx_ErrRestoreInState(tstate, type, value, traceback); | |
20467 return __Pyx_IsTracing(tstate, 0, 0) && retval; | |
20468 } else { | |
20469 Py_XDECREF(type); | |
20470 Py_XDECREF(value); | |
20471 Py_XDECREF(traceback); | |
20472 return -1; | |
20473 } | |
20474 } | |
20475 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { | |
20476 PyCodeObject *py_code = 0; | |
20477 #if PY_MAJOR_VERSION >= 3 | |
20478 py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno); | |
20479 if (likely(py_code)) { | |
20480 py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS; | |
20481 } | |
20482 #else | |
20483 PyObject *py_srcfile = 0; | |
20484 PyObject *py_funcname = 0; | |
20485 py_funcname = PyString_FromString(funcname); | |
20486 if (unlikely(!py_funcname)) goto bad; | |
20487 py_srcfile = PyString_FromString(srcfile); | |
20488 if (unlikely(!py_srcfile)) goto bad; | |
20489 py_code = PyCode_New( | |
20490 0, | |
20491 0, | |
20492 0, | |
20493 CO_OPTIMIZED | CO_NEWLOCALS, | |
20494 __pyx_empty_bytes, /*PyObject *code,*/ | |
20495 __pyx_empty_tuple, /*PyObject *consts,*/ | |
20496 __pyx_empty_tuple, /*PyObject *names,*/ | |
20497 __pyx_empty_tuple, /*PyObject *varnames,*/ | |
20498 __pyx_empty_tuple, /*PyObject *freevars,*/ | |
20499 __pyx_empty_tuple, /*PyObject *cellvars,*/ | |
20500 py_srcfile, /*PyObject *filename,*/ | |
20501 py_funcname, /*PyObject *name,*/ | |
20502 firstlineno, | |
20503 __pyx_empty_bytes /*PyObject *lnotab*/ | |
20504 ); | |
20505 bad: | |
20506 Py_XDECREF(py_srcfile); | |
20507 Py_XDECREF(py_funcname); | |
20508 #endif | |
20509 return py_code; | |
20510 } | |
20511 #endif | |
20512 | |
20513 /* KeywordStringCheck */ | |
20514 static int __Pyx_CheckKeywordStrings( | |
20515 PyObject *kw, | |
20516 const char* function_name, | |
20517 int kw_allowed) | |
20518 { | |
20519 PyObject* key = 0; | |
20520 Py_ssize_t pos = 0; | |
20521 #if CYTHON_COMPILING_IN_PYPY | |
20522 if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) | |
20523 goto invalid_keyword; | |
20524 return 1; | |
20525 #else | |
20526 if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { | |
20527 Py_ssize_t kwsize; | |
20528 #if CYTHON_ASSUME_SAFE_MACROS | |
20529 kwsize = PyTuple_GET_SIZE(kw); | |
20530 #else | |
20531 kwsize = PyTuple_Size(kw); | |
20532 if (kwsize < 0) return 0; | |
20533 #endif | |
20534 if (unlikely(kwsize == 0)) | |
20535 return 1; | |
20536 if (!kw_allowed) { | |
20537 #if CYTHON_ASSUME_SAFE_MACROS | |
20538 key = PyTuple_GET_ITEM(kw, 0); | |
20539 #else | |
20540 key = PyTuple_GetItem(kw, pos); | |
20541 if (!key) return 0; | |
20542 #endif | |
20543 goto invalid_keyword; | |
20544 } | |
20545 #if PY_VERSION_HEX < 0x03090000 | |
20546 for (pos = 0; pos < kwsize; pos++) { | |
20547 #if CYTHON_ASSUME_SAFE_MACROS | |
20548 key = PyTuple_GET_ITEM(kw, pos); | |
20549 #else | |
20550 key = PyTuple_GetItem(kw, pos); | |
20551 if (!key) return 0; | |
20552 #endif | |
20553 if (unlikely(!PyUnicode_Check(key))) | |
20554 goto invalid_keyword_type; | |
20555 } | |
20556 #endif | |
20557 return 1; | |
20558 } | |
20559 while (PyDict_Next(kw, &pos, &key, 0)) { | |
20560 #if PY_MAJOR_VERSION < 3 | |
20561 if (unlikely(!PyString_Check(key))) | |
20562 #endif | |
20563 if (unlikely(!PyUnicode_Check(key))) | |
20564 goto invalid_keyword_type; | |
20565 } | |
20566 if (!kw_allowed && unlikely(key)) | |
20567 goto invalid_keyword; | |
20568 return 1; | |
20569 invalid_keyword_type: | |
20570 PyErr_Format(PyExc_TypeError, | |
20571 "%.200s() keywords must be strings", function_name); | |
20572 return 0; | |
20573 #endif | |
20574 invalid_keyword: | |
20575 #if PY_MAJOR_VERSION < 3 | |
20576 PyErr_Format(PyExc_TypeError, | |
20577 "%.200s() got an unexpected keyword argument '%.200s'", | |
20578 function_name, PyString_AsString(key)); | |
20579 #else | |
20580 PyErr_Format(PyExc_TypeError, | |
20581 "%s() got an unexpected keyword argument '%U'", | |
20582 function_name, key); | |
20583 #endif | |
20584 return 0; | |
20585 } | |
20586 | |
20587 /* PyObjectCall */ | |
20588 #if CYTHON_COMPILING_IN_CPYTHON | |
20589 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { | |
20590 PyObject *result; | |
20591 ternaryfunc call = Py_TYPE(func)->tp_call; | |
20592 if (unlikely(!call)) | |
20593 return PyObject_Call(func, arg, kw); | |
20594 #if PY_MAJOR_VERSION < 3 | |
20595 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) | |
20596 return NULL; | |
20597 #else | |
20598 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) | |
20599 return NULL; | |
20600 #endif | |
20601 result = (*call)(func, arg, kw); | |
20602 Py_LeaveRecursiveCall(); | |
20603 if (unlikely(!result) && unlikely(!PyErr_Occurred())) { | |
20604 PyErr_SetString( | |
20605 PyExc_SystemError, | |
20606 "NULL result without error in PyObject_Call"); | |
20607 } | |
20608 return result; | |
20609 } | |
20610 #endif | |
20611 | |
20612 /* RaiseArgTupleInvalid */ | |
20613 static void __Pyx_RaiseArgtupleInvalid( | |
20614 const char* func_name, | |
20615 int exact, | |
20616 Py_ssize_t num_min, | |
20617 Py_ssize_t num_max, | |
20618 Py_ssize_t num_found) | |
20619 { | |
20620 Py_ssize_t num_expected; | |
20621 const char *more_or_less; | |
20622 if (num_found < num_min) { | |
20623 num_expected = num_min; | |
20624 more_or_less = "at least"; | |
20625 } else { | |
20626 num_expected = num_max; | |
20627 more_or_less = "at most"; | |
20628 } | |
20629 if (exact) { | |
20630 more_or_less = "exactly"; | |
20631 } | |
20632 PyErr_Format(PyExc_TypeError, | |
20633 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
20634 func_name, more_or_less, num_expected, | |
20635 (num_expected == 1) ? "" : "s", num_found); | |
20636 } | |
20637 | |
20638 /* RaiseException */ | |
20639 #if PY_MAJOR_VERSION < 3 | |
20640 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { | |
20641 __Pyx_PyThreadState_declare | |
20642 CYTHON_UNUSED_VAR(cause); | |
20643 Py_XINCREF(type); | |
20644 if (!value || value == Py_None) | |
20645 value = NULL; | |
20646 else | |
20647 Py_INCREF(value); | |
20648 if (!tb || tb == Py_None) | |
20649 tb = NULL; | |
20650 else { | |
20651 Py_INCREF(tb); | |
20652 if (!PyTraceBack_Check(tb)) { | |
20653 PyErr_SetString(PyExc_TypeError, | |
20654 "raise: arg 3 must be a traceback or None"); | |
20655 goto raise_error; | |
20656 } | |
20657 } | |
20658 if (PyType_Check(type)) { | |
20659 #if CYTHON_COMPILING_IN_PYPY | |
20660 if (!value) { | |
20661 Py_INCREF(Py_None); | |
20662 value = Py_None; | |
20663 } | |
20664 #endif | |
20665 PyErr_NormalizeException(&type, &value, &tb); | |
20666 } else { | |
20667 if (value) { | |
20668 PyErr_SetString(PyExc_TypeError, | |
20669 "instance exception may not have a separate value"); | |
20670 goto raise_error; | |
20671 } | |
20672 value = type; | |
20673 type = (PyObject*) Py_TYPE(type); | |
20674 Py_INCREF(type); | |
20675 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { | |
20676 PyErr_SetString(PyExc_TypeError, | |
20677 "raise: exception class must be a subclass of BaseException"); | |
20678 goto raise_error; | |
20679 } | |
20680 } | |
20681 __Pyx_PyThreadState_assign | |
20682 __Pyx_ErrRestore(type, value, tb); | |
20683 return; | |
20684 raise_error: | |
20685 Py_XDECREF(value); | |
20686 Py_XDECREF(type); | |
20687 Py_XDECREF(tb); | |
20688 return; | |
20689 } | |
20690 #else | |
20691 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { | |
20692 PyObject* owned_instance = NULL; | |
20693 if (tb == Py_None) { | |
20694 tb = 0; | |
20695 } else if (tb && !PyTraceBack_Check(tb)) { | |
20696 PyErr_SetString(PyExc_TypeError, | |
20697 "raise: arg 3 must be a traceback or None"); | |
20698 goto bad; | |
20699 } | |
20700 if (value == Py_None) | |
20701 value = 0; | |
20702 if (PyExceptionInstance_Check(type)) { | |
20703 if (value) { | |
20704 PyErr_SetString(PyExc_TypeError, | |
20705 "instance exception may not have a separate value"); | |
20706 goto bad; | |
20707 } | |
20708 value = type; | |
20709 type = (PyObject*) Py_TYPE(value); | |
20710 } else if (PyExceptionClass_Check(type)) { | |
20711 PyObject *instance_class = NULL; | |
20712 if (value && PyExceptionInstance_Check(value)) { | |
20713 instance_class = (PyObject*) Py_TYPE(value); | |
20714 if (instance_class != type) { | |
20715 int is_subclass = PyObject_IsSubclass(instance_class, type); | |
20716 if (!is_subclass) { | |
20717 instance_class = NULL; | |
20718 } else if (unlikely(is_subclass == -1)) { | |
20719 goto bad; | |
20720 } else { | |
20721 type = instance_class; | |
20722 } | |
20723 } | |
20724 } | |
20725 if (!instance_class) { | |
20726 PyObject *args; | |
20727 if (!value) | |
20728 args = PyTuple_New(0); | |
20729 else if (PyTuple_Check(value)) { | |
20730 Py_INCREF(value); | |
20731 args = value; | |
20732 } else | |
20733 args = PyTuple_Pack(1, value); | |
20734 if (!args) | |
20735 goto bad; | |
20736 owned_instance = PyObject_Call(type, args, NULL); | |
20737 Py_DECREF(args); | |
20738 if (!owned_instance) | |
20739 goto bad; | |
20740 value = owned_instance; | |
20741 if (!PyExceptionInstance_Check(value)) { | |
20742 PyErr_Format(PyExc_TypeError, | |
20743 "calling %R should have returned an instance of " | |
20744 "BaseException, not %R", | |
20745 type, Py_TYPE(value)); | |
20746 goto bad; | |
20747 } | |
20748 } | |
20749 } else { | |
20750 PyErr_SetString(PyExc_TypeError, | |
20751 "raise: exception class must be a subclass of BaseException"); | |
20752 goto bad; | |
20753 } | |
20754 if (cause) { | |
20755 PyObject *fixed_cause; | |
20756 if (cause == Py_None) { | |
20757 fixed_cause = NULL; | |
20758 } else if (PyExceptionClass_Check(cause)) { | |
20759 fixed_cause = PyObject_CallObject(cause, NULL); | |
20760 if (fixed_cause == NULL) | |
20761 goto bad; | |
20762 } else if (PyExceptionInstance_Check(cause)) { | |
20763 fixed_cause = cause; | |
20764 Py_INCREF(fixed_cause); | |
20765 } else { | |
20766 PyErr_SetString(PyExc_TypeError, | |
20767 "exception causes must derive from " | |
20768 "BaseException"); | |
20769 goto bad; | |
20770 } | |
20771 PyException_SetCause(value, fixed_cause); | |
20772 } | |
20773 PyErr_SetObject(type, value); | |
20774 if (tb) { | |
20775 #if PY_VERSION_HEX >= 0x030C00A6 | |
20776 PyException_SetTraceback(value, tb); | |
20777 #elif CYTHON_FAST_THREAD_STATE | |
20778 PyThreadState *tstate = __Pyx_PyThreadState_Current; | |
20779 PyObject* tmp_tb = tstate->curexc_traceback; | |
20780 if (tb != tmp_tb) { | |
20781 Py_INCREF(tb); | |
20782 tstate->curexc_traceback = tb; | |
20783 Py_XDECREF(tmp_tb); | |
20784 } | |
20785 #else | |
20786 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
20787 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); | |
20788 Py_INCREF(tb); | |
20789 PyErr_Restore(tmp_type, tmp_value, tb); | |
20790 Py_XDECREF(tmp_tb); | |
20791 #endif | |
20792 } | |
20793 bad: | |
20794 Py_XDECREF(owned_instance); | |
20795 return; | |
20796 } | |
20797 #endif | |
20798 | |
20799 /* RaiseDoubleKeywords */ | |
20800 static void __Pyx_RaiseDoubleKeywordsError( | |
20801 const char* func_name, | |
20802 PyObject* kw_name) | |
20803 { | |
20804 PyErr_Format(PyExc_TypeError, | |
20805 #if PY_MAJOR_VERSION >= 3 | |
20806 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); | |
20807 #else | |
20808 "%s() got multiple values for keyword argument '%s'", func_name, | |
20809 PyString_AsString(kw_name)); | |
20810 #endif | |
20811 } | |
20812 | |
20813 /* ParseKeywords */ | |
20814 static int __Pyx_ParseOptionalKeywords( | |
20815 PyObject *kwds, | |
20816 PyObject *const *kwvalues, | |
20817 PyObject **argnames[], | |
20818 PyObject *kwds2, | |
20819 PyObject *values[], | |
20820 Py_ssize_t num_pos_args, | |
20821 const char* function_name) | |
20822 { | |
20823 PyObject *key = 0, *value = 0; | |
20824 Py_ssize_t pos = 0; | |
20825 PyObject*** name; | |
20826 PyObject*** first_kw_arg = argnames + num_pos_args; | |
20827 int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); | |
20828 while (1) { | |
20829 Py_XDECREF(key); key = NULL; | |
20830 Py_XDECREF(value); value = NULL; | |
20831 if (kwds_is_tuple) { | |
20832 Py_ssize_t size; | |
20833 #if CYTHON_ASSUME_SAFE_MACROS | |
20834 size = PyTuple_GET_SIZE(kwds); | |
20835 #else | |
20836 size = PyTuple_Size(kwds); | |
20837 if (size < 0) goto bad; | |
20838 #endif | |
20839 if (pos >= size) break; | |
20840 #if CYTHON_AVOID_BORROWED_REFS | |
20841 key = __Pyx_PySequence_ITEM(kwds, pos); | |
20842 if (!key) goto bad; | |
20843 #elif CYTHON_ASSUME_SAFE_MACROS | |
20844 key = PyTuple_GET_ITEM(kwds, pos); | |
20845 #else | |
20846 key = PyTuple_GetItem(kwds, pos); | |
20847 if (!key) goto bad; | |
20848 #endif | |
20849 value = kwvalues[pos]; | |
20850 pos++; | |
20851 } | |
20852 else | |
20853 { | |
20854 if (!PyDict_Next(kwds, &pos, &key, &value)) break; | |
20855 #if CYTHON_AVOID_BORROWED_REFS | |
20856 Py_INCREF(key); | |
20857 #endif | |
20858 } | |
20859 name = first_kw_arg; | |
20860 while (*name && (**name != key)) name++; | |
20861 if (*name) { | |
20862 values[name-argnames] = value; | |
20863 #if CYTHON_AVOID_BORROWED_REFS | |
20864 Py_INCREF(value); | |
20865 Py_DECREF(key); | |
20866 #endif | |
20867 key = NULL; | |
20868 value = NULL; | |
20869 continue; | |
20870 } | |
20871 #if !CYTHON_AVOID_BORROWED_REFS | |
20872 Py_INCREF(key); | |
20873 #endif | |
20874 Py_INCREF(value); | |
20875 name = first_kw_arg; | |
20876 #if PY_MAJOR_VERSION < 3 | |
20877 if (likely(PyString_Check(key))) { | |
20878 while (*name) { | |
20879 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) | |
20880 && _PyString_Eq(**name, key)) { | |
20881 values[name-argnames] = value; | |
20882 #if CYTHON_AVOID_BORROWED_REFS | |
20883 value = NULL; | |
20884 #endif | |
20885 break; | |
20886 } | |
20887 name++; | |
20888 } | |
20889 if (*name) continue; | |
20890 else { | |
20891 PyObject*** argname = argnames; | |
20892 while (argname != first_kw_arg) { | |
20893 if ((**argname == key) || ( | |
20894 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) | |
20895 && _PyString_Eq(**argname, key))) { | |
20896 goto arg_passed_twice; | |
20897 } | |
20898 argname++; | |
20899 } | |
20900 } | |
20901 } else | |
20902 #endif | |
20903 if (likely(PyUnicode_Check(key))) { | |
20904 while (*name) { | |
20905 int cmp = ( | |
20906 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 | |
20907 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : | |
20908 #endif | |
20909 PyUnicode_Compare(**name, key) | |
20910 ); | |
20911 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; | |
20912 if (cmp == 0) { | |
20913 values[name-argnames] = value; | |
20914 #if CYTHON_AVOID_BORROWED_REFS | |
20915 value = NULL; | |
20916 #endif | |
20917 break; | |
20918 } | |
20919 name++; | |
20920 } | |
20921 if (*name) continue; | |
20922 else { | |
20923 PyObject*** argname = argnames; | |
20924 while (argname != first_kw_arg) { | |
20925 int cmp = (**argname == key) ? 0 : | |
20926 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 | |
20927 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : | |
20928 #endif | |
20929 PyUnicode_Compare(**argname, key); | |
20930 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; | |
20931 if (cmp == 0) goto arg_passed_twice; | |
20932 argname++; | |
20933 } | |
20934 } | |
20935 } else | |
20936 goto invalid_keyword_type; | |
20937 if (kwds2) { | |
20938 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; | |
20939 } else { | |
20940 goto invalid_keyword; | |
20941 } | |
20942 } | |
20943 Py_XDECREF(key); | |
20944 Py_XDECREF(value); | |
20945 return 0; | |
20946 arg_passed_twice: | |
20947 __Pyx_RaiseDoubleKeywordsError(function_name, key); | |
20948 goto bad; | |
20949 invalid_keyword_type: | |
20950 PyErr_Format(PyExc_TypeError, | |
20951 "%.200s() keywords must be strings", function_name); | |
20952 goto bad; | |
20953 invalid_keyword: | |
20954 #if PY_MAJOR_VERSION < 3 | |
20955 PyErr_Format(PyExc_TypeError, | |
20956 "%.200s() got an unexpected keyword argument '%.200s'", | |
20957 function_name, PyString_AsString(key)); | |
20958 #else | |
20959 PyErr_Format(PyExc_TypeError, | |
20960 "%s() got an unexpected keyword argument '%U'", | |
20961 function_name, key); | |
20962 #endif | |
20963 bad: | |
20964 Py_XDECREF(key); | |
20965 Py_XDECREF(value); | |
20966 return -1; | |
20967 } | |
20968 | |
20969 /* PyFunctionFastCall */ | |
20970 #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL | |
20971 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, | |
20972 PyObject *globals) { | |
20973 PyFrameObject *f; | |
20974 PyThreadState *tstate = __Pyx_PyThreadState_Current; | |
20975 PyObject **fastlocals; | |
20976 Py_ssize_t i; | |
20977 PyObject *result; | |
20978 assert(globals != NULL); | |
20979 /* XXX Perhaps we should create a specialized | |
20980 PyFrame_New() that doesn't take locals, but does | |
20981 take builtins without sanity checking them. | |
20982 */ | |
20983 assert(tstate != NULL); | |
20984 f = PyFrame_New(tstate, co, globals, NULL); | |
20985 if (f == NULL) { | |
20986 return NULL; | |
20987 } | |
20988 fastlocals = __Pyx_PyFrame_GetLocalsplus(f); | |
20989 for (i = 0; i < na; i++) { | |
20990 Py_INCREF(*args); | |
20991 fastlocals[i] = *args++; | |
20992 } | |
20993 result = PyEval_EvalFrameEx(f,0); | |
20994 ++tstate->recursion_depth; | |
20995 Py_DECREF(f); | |
20996 --tstate->recursion_depth; | |
20997 return result; | |
20998 } | |
20999 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { | |
21000 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); | |
21001 PyObject *globals = PyFunction_GET_GLOBALS(func); | |
21002 PyObject *argdefs = PyFunction_GET_DEFAULTS(func); | |
21003 PyObject *closure; | |
21004 #if PY_MAJOR_VERSION >= 3 | |
21005 PyObject *kwdefs; | |
21006 #endif | |
21007 PyObject *kwtuple, **k; | |
21008 PyObject **d; | |
21009 Py_ssize_t nd; | |
21010 Py_ssize_t nk; | |
21011 PyObject *result; | |
21012 assert(kwargs == NULL || PyDict_Check(kwargs)); | |
21013 nk = kwargs ? PyDict_Size(kwargs) : 0; | |
21014 #if PY_MAJOR_VERSION < 3 | |
21015 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { | |
21016 return NULL; | |
21017 } | |
21018 #else | |
21019 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { | |
21020 return NULL; | |
21021 } | |
21022 #endif | |
21023 if ( | |
21024 #if PY_MAJOR_VERSION >= 3 | |
21025 co->co_kwonlyargcount == 0 && | |
21026 #endif | |
21027 likely(kwargs == NULL || nk == 0) && | |
21028 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { | |
21029 if (argdefs == NULL && co->co_argcount == nargs) { | |
21030 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); | |
21031 goto done; | |
21032 } | |
21033 else if (nargs == 0 && argdefs != NULL | |
21034 && co->co_argcount == Py_SIZE(argdefs)) { | |
21035 /* function called with no arguments, but all parameters have | |
21036 a default value: use default values as arguments .*/ | |
21037 args = &PyTuple_GET_ITEM(argdefs, 0); | |
21038 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); | |
21039 goto done; | |
21040 } | |
21041 } | |
21042 if (kwargs != NULL) { | |
21043 Py_ssize_t pos, i; | |
21044 kwtuple = PyTuple_New(2 * nk); | |
21045 if (kwtuple == NULL) { | |
21046 result = NULL; | |
21047 goto done; | |
21048 } | |
21049 k = &PyTuple_GET_ITEM(kwtuple, 0); | |
21050 pos = i = 0; | |
21051 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { | |
21052 Py_INCREF(k[i]); | |
21053 Py_INCREF(k[i+1]); | |
21054 i += 2; | |
21055 } | |
21056 nk = i / 2; | |
21057 } | |
21058 else { | |
21059 kwtuple = NULL; | |
21060 k = NULL; | |
21061 } | |
21062 closure = PyFunction_GET_CLOSURE(func); | |
21063 #if PY_MAJOR_VERSION >= 3 | |
21064 kwdefs = PyFunction_GET_KW_DEFAULTS(func); | |
21065 #endif | |
21066 if (argdefs != NULL) { | |
21067 d = &PyTuple_GET_ITEM(argdefs, 0); | |
21068 nd = Py_SIZE(argdefs); | |
21069 } | |
21070 else { | |
21071 d = NULL; | |
21072 nd = 0; | |
21073 } | |
21074 #if PY_MAJOR_VERSION >= 3 | |
21075 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, | |
21076 args, (int)nargs, | |
21077 k, (int)nk, | |
21078 d, (int)nd, kwdefs, closure); | |
21079 #else | |
21080 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, | |
21081 args, (int)nargs, | |
21082 k, (int)nk, | |
21083 d, (int)nd, closure); | |
21084 #endif | |
21085 Py_XDECREF(kwtuple); | |
21086 done: | |
21087 Py_LeaveRecursiveCall(); | |
21088 return result; | |
21089 } | |
21090 #endif | |
21091 | |
21092 /* PyObjectCallMethO */ | |
21093 #if CYTHON_COMPILING_IN_CPYTHON | |
21094 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { | |
21095 PyObject *self, *result; | |
21096 PyCFunction cfunc; | |
21097 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); | |
21098 self = __Pyx_CyOrPyCFunction_GET_SELF(func); | |
21099 #if PY_MAJOR_VERSION < 3 | |
21100 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) | |
21101 return NULL; | |
21102 #else | |
21103 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) | |
21104 return NULL; | |
21105 #endif | |
21106 result = cfunc(self, arg); | |
21107 Py_LeaveRecursiveCall(); | |
21108 if (unlikely(!result) && unlikely(!PyErr_Occurred())) { | |
21109 PyErr_SetString( | |
21110 PyExc_SystemError, | |
21111 "NULL result without error in PyObject_Call"); | |
21112 } | |
21113 return result; | |
21114 } | |
21115 #endif | |
21116 | |
21117 /* PyObjectFastCall */ | |
21118 #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API | |
21119 static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { | |
21120 PyObject *argstuple; | |
21121 PyObject *result = 0; | |
21122 size_t i; | |
21123 argstuple = PyTuple_New((Py_ssize_t)nargs); | |
21124 if (unlikely(!argstuple)) return NULL; | |
21125 for (i = 0; i < nargs; i++) { | |
21126 Py_INCREF(args[i]); | |
21127 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; | |
21128 } | |
21129 result = __Pyx_PyObject_Call(func, argstuple, kwargs); | |
21130 bad: | |
21131 Py_DECREF(argstuple); | |
21132 return result; | |
21133 } | |
21134 #endif | |
21135 static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { | |
21136 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); | |
21137 #if CYTHON_COMPILING_IN_CPYTHON | |
21138 if (nargs == 0 && kwargs == NULL) { | |
21139 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) | |
21140 return __Pyx_PyObject_CallMethO(func, NULL); | |
21141 } | |
21142 else if (nargs == 1 && kwargs == NULL) { | |
21143 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) | |
21144 return __Pyx_PyObject_CallMethO(func, args[0]); | |
21145 } | |
21146 #endif | |
21147 #if PY_VERSION_HEX < 0x030800B1 | |
21148 #if CYTHON_FAST_PYCCALL | |
21149 if (PyCFunction_Check(func)) { | |
21150 if (kwargs) { | |
21151 return _PyCFunction_FastCallDict(func, args, nargs, kwargs); | |
21152 } else { | |
21153 return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); | |
21154 } | |
21155 } | |
21156 #if PY_VERSION_HEX >= 0x030700A1 | |
21157 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { | |
21158 return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); | |
21159 } | |
21160 #endif | |
21161 #endif | |
21162 #if CYTHON_FAST_PYCALL | |
21163 if (PyFunction_Check(func)) { | |
21164 return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); | |
21165 } | |
21166 #endif | |
21167 #endif | |
21168 if (kwargs == NULL) { | |
21169 #if CYTHON_VECTORCALL | |
21170 #if PY_VERSION_HEX < 0x03090000 | |
21171 vectorcallfunc f = _PyVectorcall_Function(func); | |
21172 #else | |
21173 vectorcallfunc f = PyVectorcall_Function(func); | |
21174 #endif | |
21175 if (f) { | |
21176 return f(func, args, (size_t)nargs, NULL); | |
21177 } | |
21178 #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL | |
21179 if (__Pyx_CyFunction_CheckExact(func)) { | |
21180 __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); | |
21181 if (f) return f(func, args, (size_t)nargs, NULL); | |
21182 } | |
21183 #endif | |
21184 } | |
21185 if (nargs == 0) { | |
21186 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); | |
21187 } | |
21188 #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API | |
21189 return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); | |
21190 #else | |
21191 return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); | |
21192 #endif | |
21193 } | |
21194 | |
21195 /* PyDictVersioning */ | |
21196 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS | |
21197 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { | |
21198 PyObject *dict = Py_TYPE(obj)->tp_dict; | |
21199 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; | |
21200 } | |
21201 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { | |
21202 PyObject **dictptr = NULL; | |
21203 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; | |
21204 if (offset) { | |
21205 #if CYTHON_COMPILING_IN_CPYTHON | |
21206 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); | |
21207 #else | |
21208 dictptr = _PyObject_GetDictPtr(obj); | |
21209 #endif | |
21210 } | |
21211 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; | |
21212 } | |
21213 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { | |
21214 PyObject *dict = Py_TYPE(obj)->tp_dict; | |
21215 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) | |
21216 return 0; | |
21217 return obj_dict_version == __Pyx_get_object_dict_version(obj); | |
21218 } | |
21219 #endif | |
21220 | |
21221 /* GetModuleGlobalName */ | |
21222 #if CYTHON_USE_DICT_VERSIONS | |
21223 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) | |
21224 #else | |
21225 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) | |
21226 #endif | |
21227 { | |
21228 PyObject *result; | |
21229 #if !CYTHON_AVOID_BORROWED_REFS | |
21230 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 | |
21231 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); | |
21232 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) | |
21233 if (likely(result)) { | |
21234 return __Pyx_NewRef(result); | |
21235 } else if (unlikely(PyErr_Occurred())) { | |
21236 return NULL; | |
21237 } | |
21238 #elif CYTHON_COMPILING_IN_LIMITED_API | |
21239 if (unlikely(!__pyx_m)) { | |
21240 return NULL; | |
21241 } | |
21242 result = PyObject_GetAttr(__pyx_m, name); | |
21243 if (likely(result)) { | |
21244 return result; | |
21245 } | |
21246 #else | |
21247 result = PyDict_GetItem(__pyx_d, name); | |
21248 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) | |
21249 if (likely(result)) { | |
21250 return __Pyx_NewRef(result); | |
21251 } | |
21252 #endif | |
21253 #else | |
21254 result = PyObject_GetItem(__pyx_d, name); | |
21255 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) | |
21256 if (likely(result)) { | |
21257 return __Pyx_NewRef(result); | |
21258 } | |
21259 PyErr_Clear(); | |
21260 #endif | |
21261 return __Pyx_GetBuiltinName(name); | |
21262 } | |
21263 | |
21264 /* PyObjectCallOneArg */ | |
21265 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { | |
21266 PyObject *args[2] = {NULL, arg}; | |
21267 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); | |
21268 } | |
21269 | |
21270 /* PyObjectCall2Args */ | |
21271 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { | |
21272 PyObject *args[3] = {NULL, arg1, arg2}; | |
21273 return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); | |
21274 } | |
21275 | |
21276 /* PyObjectGetMethod */ | |
21277 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { | |
21278 PyObject *attr; | |
21279 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP | |
21280 __Pyx_TypeName type_name; | |
21281 PyTypeObject *tp = Py_TYPE(obj); | |
21282 PyObject *descr; | |
21283 descrgetfunc f = NULL; | |
21284 PyObject **dictptr, *dict; | |
21285 int meth_found = 0; | |
21286 assert (*method == NULL); | |
21287 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { | |
21288 attr = __Pyx_PyObject_GetAttrStr(obj, name); | |
21289 goto try_unpack; | |
21290 } | |
21291 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { | |
21292 return 0; | |
21293 } | |
21294 descr = _PyType_Lookup(tp, name); | |
21295 if (likely(descr != NULL)) { | |
21296 Py_INCREF(descr); | |
21297 #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR | |
21298 if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) | |
21299 #elif PY_MAJOR_VERSION >= 3 | |
21300 #ifdef __Pyx_CyFunction_USED | |
21301 if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) | |
21302 #else | |
21303 if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) | |
21304 #endif | |
21305 #else | |
21306 #ifdef __Pyx_CyFunction_USED | |
21307 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) | |
21308 #else | |
21309 if (likely(PyFunction_Check(descr))) | |
21310 #endif | |
21311 #endif | |
21312 { | |
21313 meth_found = 1; | |
21314 } else { | |
21315 f = Py_TYPE(descr)->tp_descr_get; | |
21316 if (f != NULL && PyDescr_IsData(descr)) { | |
21317 attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); | |
21318 Py_DECREF(descr); | |
21319 goto try_unpack; | |
21320 } | |
21321 } | |
21322 } | |
21323 dictptr = _PyObject_GetDictPtr(obj); | |
21324 if (dictptr != NULL && (dict = *dictptr) != NULL) { | |
21325 Py_INCREF(dict); | |
21326 attr = __Pyx_PyDict_GetItemStr(dict, name); | |
21327 if (attr != NULL) { | |
21328 Py_INCREF(attr); | |
21329 Py_DECREF(dict); | |
21330 Py_XDECREF(descr); | |
21331 goto try_unpack; | |
21332 } | |
21333 Py_DECREF(dict); | |
21334 } | |
21335 if (meth_found) { | |
21336 *method = descr; | |
21337 return 1; | |
21338 } | |
21339 if (f != NULL) { | |
21340 attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); | |
21341 Py_DECREF(descr); | |
21342 goto try_unpack; | |
21343 } | |
21344 if (likely(descr != NULL)) { | |
21345 *method = descr; | |
21346 return 0; | |
21347 } | |
21348 type_name = __Pyx_PyType_GetName(tp); | |
21349 PyErr_Format(PyExc_AttributeError, | |
21350 #if PY_MAJOR_VERSION >= 3 | |
21351 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", | |
21352 type_name, name); | |
21353 #else | |
21354 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", | |
21355 type_name, PyString_AS_STRING(name)); | |
21356 #endif | |
21357 __Pyx_DECREF_TypeName(type_name); | |
21358 return 0; | |
21359 #else | |
21360 attr = __Pyx_PyObject_GetAttrStr(obj, name); | |
21361 goto try_unpack; | |
21362 #endif | |
21363 try_unpack: | |
21364 #if CYTHON_UNPACK_METHODS | |
21365 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { | |
21366 PyObject *function = PyMethod_GET_FUNCTION(attr); | |
21367 Py_INCREF(function); | |
21368 Py_DECREF(attr); | |
21369 *method = function; | |
21370 return 1; | |
21371 } | |
21372 #endif | |
21373 *method = attr; | |
21374 return 0; | |
21375 } | |
21376 | |
21377 /* PyObjectCallMethod1 */ | |
21378 #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) | |
21379 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { | |
21380 PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); | |
21381 Py_DECREF(method); | |
21382 return result; | |
21383 } | |
21384 #endif | |
21385 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { | |
21386 #if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2 | |
21387 PyObject *args[2] = {obj, arg}; | |
21388 (void) __Pyx_PyObject_GetMethod; | |
21389 (void) __Pyx_PyObject_CallOneArg; | |
21390 (void) __Pyx_PyObject_Call2Args; | |
21391 return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); | |
21392 #else | |
21393 PyObject *method = NULL, *result; | |
21394 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); | |
21395 if (likely(is_method)) { | |
21396 result = __Pyx_PyObject_Call2Args(method, obj, arg); | |
21397 Py_DECREF(method); | |
21398 return result; | |
21399 } | |
21400 if (unlikely(!method)) return NULL; | |
21401 return __Pyx__PyObject_CallMethod1(method, arg); | |
21402 #endif | |
21403 } | |
21404 | |
21405 /* append */ | |
21406 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { | |
21407 if (likely(PyList_CheckExact(L))) { | |
21408 if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; | |
21409 } else { | |
21410 PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); | |
21411 if (unlikely(!retval)) | |
21412 return -1; | |
21413 Py_DECREF(retval); | |
21414 } | |
21415 return 0; | |
21416 } | |
21417 | |
21418 /* WriteUnraisableException */ | |
21419 static void __Pyx_WriteUnraisable(const char *name, int clineno, | |
21420 int lineno, const char *filename, | |
21421 int full_traceback, int nogil) { | |
21422 PyObject *old_exc, *old_val, *old_tb; | |
21423 PyObject *ctx; | |
21424 __Pyx_PyThreadState_declare | |
21425 #ifdef WITH_THREAD | |
21426 PyGILState_STATE state; | |
21427 if (nogil) | |
21428 state = PyGILState_Ensure(); | |
21429 else state = (PyGILState_STATE)0; | |
21430 #endif | |
21431 CYTHON_UNUSED_VAR(clineno); | |
21432 CYTHON_UNUSED_VAR(lineno); | |
21433 CYTHON_UNUSED_VAR(filename); | |
21434 CYTHON_MAYBE_UNUSED_VAR(nogil); | |
21435 __Pyx_PyThreadState_assign | |
21436 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); | |
21437 if (full_traceback) { | |
21438 Py_XINCREF(old_exc); | |
21439 Py_XINCREF(old_val); | |
21440 Py_XINCREF(old_tb); | |
21441 __Pyx_ErrRestore(old_exc, old_val, old_tb); | |
21442 PyErr_PrintEx(0); | |
21443 } | |
21444 #if PY_MAJOR_VERSION < 3 | |
21445 ctx = PyString_FromString(name); | |
21446 #else | |
21447 ctx = PyUnicode_FromString(name); | |
21448 #endif | |
21449 __Pyx_ErrRestore(old_exc, old_val, old_tb); | |
21450 if (!ctx) { | |
21451 PyErr_WriteUnraisable(Py_None); | |
21452 } else { | |
21453 PyErr_WriteUnraisable(ctx); | |
21454 Py_DECREF(ctx); | |
21455 } | |
21456 #ifdef WITH_THREAD | |
21457 if (nogil) | |
21458 PyGILState_Release(state); | |
21459 #endif | |
21460 } | |
21461 | |
21462 /* RaiseTooManyValuesToUnpack */ | |
21463 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { | |
21464 PyErr_Format(PyExc_ValueError, | |
21465 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); | |
21466 } | |
21467 | |
21468 /* RaiseNeedMoreValuesToUnpack */ | |
21469 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { | |
21470 PyErr_Format(PyExc_ValueError, | |
21471 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", | |
21472 index, (index == 1) ? "" : "s"); | |
21473 } | |
21474 | |
21475 /* IterFinish */ | |
21476 static CYTHON_INLINE int __Pyx_IterFinish(void) { | |
21477 PyObject* exc_type; | |
21478 __Pyx_PyThreadState_declare | |
21479 __Pyx_PyThreadState_assign | |
21480 exc_type = __Pyx_PyErr_CurrentExceptionType(); | |
21481 if (unlikely(exc_type)) { | |
21482 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) | |
21483 return -1; | |
21484 __Pyx_PyErr_Clear(); | |
21485 return 0; | |
21486 } | |
21487 return 0; | |
21488 } | |
21489 | |
21490 /* UnpackItemEndCheck */ | |
21491 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { | |
21492 if (unlikely(retval)) { | |
21493 Py_DECREF(retval); | |
21494 __Pyx_RaiseTooManyValuesError(expected); | |
21495 return -1; | |
21496 } | |
21497 return __Pyx_IterFinish(); | |
21498 } | |
21499 | |
21500 /* GetException */ | |
21501 #if CYTHON_FAST_THREAD_STATE | |
21502 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) | |
21503 #else | |
21504 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) | |
21505 #endif | |
21506 { | |
21507 PyObject *local_type = NULL, *local_value, *local_tb = NULL; | |
21508 #if CYTHON_FAST_THREAD_STATE | |
21509 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
21510 #if PY_VERSION_HEX >= 0x030C00A6 | |
21511 local_value = tstate->current_exception; | |
21512 tstate->current_exception = 0; | |
21513 if (likely(local_value)) { | |
21514 local_type = (PyObject*) Py_TYPE(local_value); | |
21515 Py_INCREF(local_type); | |
21516 local_tb = PyException_GetTraceback(local_value); | |
21517 } | |
21518 #else | |
21519 local_type = tstate->curexc_type; | |
21520 local_value = tstate->curexc_value; | |
21521 local_tb = tstate->curexc_traceback; | |
21522 tstate->curexc_type = 0; | |
21523 tstate->curexc_value = 0; | |
21524 tstate->curexc_traceback = 0; | |
21525 #endif | |
21526 #else | |
21527 PyErr_Fetch(&local_type, &local_value, &local_tb); | |
21528 #endif | |
21529 PyErr_NormalizeException(&local_type, &local_value, &local_tb); | |
21530 #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 | |
21531 if (unlikely(tstate->current_exception)) | |
21532 #elif CYTHON_FAST_THREAD_STATE | |
21533 if (unlikely(tstate->curexc_type)) | |
21534 #else | |
21535 if (unlikely(PyErr_Occurred())) | |
21536 #endif | |
21537 goto bad; | |
21538 #if PY_MAJOR_VERSION >= 3 | |
21539 if (local_tb) { | |
21540 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) | |
21541 goto bad; | |
21542 } | |
21543 #endif | |
21544 Py_XINCREF(local_tb); | |
21545 Py_XINCREF(local_type); | |
21546 Py_XINCREF(local_value); | |
21547 *type = local_type; | |
21548 *value = local_value; | |
21549 *tb = local_tb; | |
21550 #if CYTHON_FAST_THREAD_STATE | |
21551 #if CYTHON_USE_EXC_INFO_STACK | |
21552 { | |
21553 _PyErr_StackItem *exc_info = tstate->exc_info; | |
21554 #if PY_VERSION_HEX >= 0x030B00a4 | |
21555 tmp_value = exc_info->exc_value; | |
21556 exc_info->exc_value = local_value; | |
21557 tmp_type = NULL; | |
21558 tmp_tb = NULL; | |
21559 Py_XDECREF(local_type); | |
21560 Py_XDECREF(local_tb); | |
21561 #else | |
21562 tmp_type = exc_info->exc_type; | |
21563 tmp_value = exc_info->exc_value; | |
21564 tmp_tb = exc_info->exc_traceback; | |
21565 exc_info->exc_type = local_type; | |
21566 exc_info->exc_value = local_value; | |
21567 exc_info->exc_traceback = local_tb; | |
21568 #endif | |
21569 } | |
21570 #else | |
21571 tmp_type = tstate->exc_type; | |
21572 tmp_value = tstate->exc_value; | |
21573 tmp_tb = tstate->exc_traceback; | |
21574 tstate->exc_type = local_type; | |
21575 tstate->exc_value = local_value; | |
21576 tstate->exc_traceback = local_tb; | |
21577 #endif | |
21578 Py_XDECREF(tmp_type); | |
21579 Py_XDECREF(tmp_value); | |
21580 Py_XDECREF(tmp_tb); | |
21581 #else | |
21582 PyErr_SetExcInfo(local_type, local_value, local_tb); | |
21583 #endif | |
21584 return 0; | |
21585 bad: | |
21586 *type = 0; | |
21587 *value = 0; | |
21588 *tb = 0; | |
21589 Py_XDECREF(local_type); | |
21590 Py_XDECREF(local_value); | |
21591 Py_XDECREF(local_tb); | |
21592 return -1; | |
21593 } | |
21594 | |
21595 /* SwapException */ | |
21596 #if CYTHON_FAST_THREAD_STATE | |
21597 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { | |
21598 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
21599 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 | |
21600 _PyErr_StackItem *exc_info = tstate->exc_info; | |
21601 tmp_value = exc_info->exc_value; | |
21602 exc_info->exc_value = *value; | |
21603 if (tmp_value == NULL || tmp_value == Py_None) { | |
21604 Py_XDECREF(tmp_value); | |
21605 tmp_value = NULL; | |
21606 tmp_type = NULL; | |
21607 tmp_tb = NULL; | |
21608 } else { | |
21609 tmp_type = (PyObject*) Py_TYPE(tmp_value); | |
21610 Py_INCREF(tmp_type); | |
21611 #if CYTHON_COMPILING_IN_CPYTHON | |
21612 tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; | |
21613 Py_XINCREF(tmp_tb); | |
21614 #else | |
21615 tmp_tb = PyException_GetTraceback(tmp_value); | |
21616 #endif | |
21617 } | |
21618 #elif CYTHON_USE_EXC_INFO_STACK | |
21619 _PyErr_StackItem *exc_info = tstate->exc_info; | |
21620 tmp_type = exc_info->exc_type; | |
21621 tmp_value = exc_info->exc_value; | |
21622 tmp_tb = exc_info->exc_traceback; | |
21623 exc_info->exc_type = *type; | |
21624 exc_info->exc_value = *value; | |
21625 exc_info->exc_traceback = *tb; | |
21626 #else | |
21627 tmp_type = tstate->exc_type; | |
21628 tmp_value = tstate->exc_value; | |
21629 tmp_tb = tstate->exc_traceback; | |
21630 tstate->exc_type = *type; | |
21631 tstate->exc_value = *value; | |
21632 tstate->exc_traceback = *tb; | |
21633 #endif | |
21634 *type = tmp_type; | |
21635 *value = tmp_value; | |
21636 *tb = tmp_tb; | |
21637 } | |
21638 #else | |
21639 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { | |
21640 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
21641 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); | |
21642 PyErr_SetExcInfo(*type, *value, *tb); | |
21643 *type = tmp_type; | |
21644 *value = tmp_value; | |
21645 *tb = tmp_tb; | |
21646 } | |
21647 #endif | |
21648 | |
21649 /* GetTopmostException */ | |
21650 #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE | |
21651 static _PyErr_StackItem * | |
21652 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) | |
21653 { | |
21654 _PyErr_StackItem *exc_info = tstate->exc_info; | |
21655 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && | |
21656 exc_info->previous_item != NULL) | |
21657 { | |
21658 exc_info = exc_info->previous_item; | |
21659 } | |
21660 return exc_info; | |
21661 } | |
21662 #endif | |
21663 | |
21664 /* SaveResetException */ | |
21665 #if CYTHON_FAST_THREAD_STATE | |
21666 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { | |
21667 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 | |
21668 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); | |
21669 PyObject *exc_value = exc_info->exc_value; | |
21670 if (exc_value == NULL || exc_value == Py_None) { | |
21671 *value = NULL; | |
21672 *type = NULL; | |
21673 *tb = NULL; | |
21674 } else { | |
21675 *value = exc_value; | |
21676 Py_INCREF(*value); | |
21677 *type = (PyObject*) Py_TYPE(exc_value); | |
21678 Py_INCREF(*type); | |
21679 *tb = PyException_GetTraceback(exc_value); | |
21680 } | |
21681 #elif CYTHON_USE_EXC_INFO_STACK | |
21682 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); | |
21683 *type = exc_info->exc_type; | |
21684 *value = exc_info->exc_value; | |
21685 *tb = exc_info->exc_traceback; | |
21686 Py_XINCREF(*type); | |
21687 Py_XINCREF(*value); | |
21688 Py_XINCREF(*tb); | |
21689 #else | |
21690 *type = tstate->exc_type; | |
21691 *value = tstate->exc_value; | |
21692 *tb = tstate->exc_traceback; | |
21693 Py_XINCREF(*type); | |
21694 Py_XINCREF(*value); | |
21695 Py_XINCREF(*tb); | |
21696 #endif | |
21697 } | |
21698 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { | |
21699 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 | |
21700 _PyErr_StackItem *exc_info = tstate->exc_info; | |
21701 PyObject *tmp_value = exc_info->exc_value; | |
21702 exc_info->exc_value = value; | |
21703 Py_XDECREF(tmp_value); | |
21704 Py_XDECREF(type); | |
21705 Py_XDECREF(tb); | |
21706 #else | |
21707 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
21708 #if CYTHON_USE_EXC_INFO_STACK | |
21709 _PyErr_StackItem *exc_info = tstate->exc_info; | |
21710 tmp_type = exc_info->exc_type; | |
21711 tmp_value = exc_info->exc_value; | |
21712 tmp_tb = exc_info->exc_traceback; | |
21713 exc_info->exc_type = type; | |
21714 exc_info->exc_value = value; | |
21715 exc_info->exc_traceback = tb; | |
21716 #else | |
21717 tmp_type = tstate->exc_type; | |
21718 tmp_value = tstate->exc_value; | |
21719 tmp_tb = tstate->exc_traceback; | |
21720 tstate->exc_type = type; | |
21721 tstate->exc_value = value; | |
21722 tstate->exc_traceback = tb; | |
21723 #endif | |
21724 Py_XDECREF(tmp_type); | |
21725 Py_XDECREF(tmp_value); | |
21726 Py_XDECREF(tmp_tb); | |
21727 #endif | |
21728 } | |
21729 #endif | |
21730 | |
21731 /* GetItemInt */ | |
21732 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { | |
21733 PyObject *r; | |
21734 if (unlikely(!j)) return NULL; | |
21735 r = PyObject_GetItem(o, j); | |
21736 Py_DECREF(j); | |
21737 return r; | |
21738 } | |
21739 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, | |
21740 CYTHON_NCP_UNUSED int wraparound, | |
21741 CYTHON_NCP_UNUSED int boundscheck) { | |
21742 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
21743 Py_ssize_t wrapped_i = i; | |
21744 if (wraparound & unlikely(i < 0)) { | |
21745 wrapped_i += PyList_GET_SIZE(o); | |
21746 } | |
21747 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { | |
21748 PyObject *r = PyList_GET_ITEM(o, wrapped_i); | |
21749 Py_INCREF(r); | |
21750 return r; | |
21751 } | |
21752 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); | |
21753 #else | |
21754 return PySequence_GetItem(o, i); | |
21755 #endif | |
21756 } | |
21757 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, | |
21758 CYTHON_NCP_UNUSED int wraparound, | |
21759 CYTHON_NCP_UNUSED int boundscheck) { | |
21760 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
21761 Py_ssize_t wrapped_i = i; | |
21762 if (wraparound & unlikely(i < 0)) { | |
21763 wrapped_i += PyTuple_GET_SIZE(o); | |
21764 } | |
21765 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { | |
21766 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); | |
21767 Py_INCREF(r); | |
21768 return r; | |
21769 } | |
21770 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); | |
21771 #else | |
21772 return PySequence_GetItem(o, i); | |
21773 #endif | |
21774 } | |
21775 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, | |
21776 CYTHON_NCP_UNUSED int wraparound, | |
21777 CYTHON_NCP_UNUSED int boundscheck) { | |
21778 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS | |
21779 if (is_list || PyList_CheckExact(o)) { | |
21780 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); | |
21781 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { | |
21782 PyObject *r = PyList_GET_ITEM(o, n); | |
21783 Py_INCREF(r); | |
21784 return r; | |
21785 } | |
21786 } | |
21787 else if (PyTuple_CheckExact(o)) { | |
21788 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); | |
21789 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { | |
21790 PyObject *r = PyTuple_GET_ITEM(o, n); | |
21791 Py_INCREF(r); | |
21792 return r; | |
21793 } | |
21794 } else { | |
21795 PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; | |
21796 PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; | |
21797 if (mm && mm->mp_subscript) { | |
21798 PyObject *r, *key = PyInt_FromSsize_t(i); | |
21799 if (unlikely(!key)) return NULL; | |
21800 r = mm->mp_subscript(o, key); | |
21801 Py_DECREF(key); | |
21802 return r; | |
21803 } | |
21804 if (likely(sm && sm->sq_item)) { | |
21805 if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { | |
21806 Py_ssize_t l = sm->sq_length(o); | |
21807 if (likely(l >= 0)) { | |
21808 i += l; | |
21809 } else { | |
21810 if (!PyErr_ExceptionMatches(PyExc_OverflowError)) | |
21811 return NULL; | |
21812 PyErr_Clear(); | |
21813 } | |
21814 } | |
21815 return sm->sq_item(o, i); | |
21816 } | |
21817 } | |
21818 #else | |
21819 if (is_list || !PyMapping_Check(o)) { | |
21820 return PySequence_GetItem(o, i); | |
21821 } | |
21822 #endif | |
21823 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); | |
21824 } | |
21825 | |
21826 /* ObjectGetItem */ | |
21827 #if CYTHON_USE_TYPE_SLOTS | |
21828 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { | |
21829 PyObject *runerr = NULL; | |
21830 Py_ssize_t key_value; | |
21831 key_value = __Pyx_PyIndex_AsSsize_t(index); | |
21832 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { | |
21833 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); | |
21834 } | |
21835 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { | |
21836 __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); | |
21837 PyErr_Clear(); | |
21838 PyErr_Format(PyExc_IndexError, | |
21839 "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); | |
21840 __Pyx_DECREF_TypeName(index_type_name); | |
21841 } | |
21842 return NULL; | |
21843 } | |
21844 static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { | |
21845 __Pyx_TypeName obj_type_name; | |
21846 if (likely(PyType_Check(obj))) { | |
21847 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); | |
21848 if (!meth) { | |
21849 PyErr_Clear(); | |
21850 } else { | |
21851 PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); | |
21852 Py_DECREF(meth); | |
21853 return result; | |
21854 } | |
21855 } | |
21856 obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); | |
21857 PyErr_Format(PyExc_TypeError, | |
21858 "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); | |
21859 __Pyx_DECREF_TypeName(obj_type_name); | |
21860 return NULL; | |
21861 } | |
21862 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { | |
21863 PyTypeObject *tp = Py_TYPE(obj); | |
21864 PyMappingMethods *mm = tp->tp_as_mapping; | |
21865 PySequenceMethods *sm = tp->tp_as_sequence; | |
21866 if (likely(mm && mm->mp_subscript)) { | |
21867 return mm->mp_subscript(obj, key); | |
21868 } | |
21869 if (likely(sm && sm->sq_item)) { | |
21870 return __Pyx_PyObject_GetIndex(obj, key); | |
21871 } | |
21872 return __Pyx_PyObject_GetItem_Slow(obj, key); | |
21873 } | |
21874 #endif | |
21875 | |
21876 /* PyObjectFormatAndDecref */ | |
21877 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { | |
21878 if (unlikely(!s)) return NULL; | |
21879 if (likely(PyUnicode_CheckExact(s))) return s; | |
21880 #if PY_MAJOR_VERSION < 3 | |
21881 if (likely(PyString_CheckExact(s))) { | |
21882 PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); | |
21883 Py_DECREF(s); | |
21884 return result; | |
21885 } | |
21886 #endif | |
21887 return __Pyx_PyObject_FormatAndDecref(s, f); | |
21888 } | |
21889 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { | |
21890 PyObject *result; | |
21891 if (unlikely(!s)) return NULL; | |
21892 result = PyObject_Format(s, f); | |
21893 Py_DECREF(s); | |
21894 return result; | |
21895 } | |
21896 | |
21897 /* JoinPyUnicode */ | |
21898 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, | |
21899 Py_UCS4 max_char) { | |
21900 #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
21901 PyObject *result_uval; | |
21902 int result_ukind, kind_shift; | |
21903 Py_ssize_t i, char_pos; | |
21904 void *result_udata; | |
21905 CYTHON_MAYBE_UNUSED_VAR(max_char); | |
21906 #if CYTHON_PEP393_ENABLED | |
21907 result_uval = PyUnicode_New(result_ulength, max_char); | |
21908 if (unlikely(!result_uval)) return NULL; | |
21909 result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; | |
21910 kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; | |
21911 result_udata = PyUnicode_DATA(result_uval); | |
21912 #else | |
21913 result_uval = PyUnicode_FromUnicode(NULL, result_ulength); | |
21914 if (unlikely(!result_uval)) return NULL; | |
21915 result_ukind = sizeof(Py_UNICODE); | |
21916 kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; | |
21917 result_udata = PyUnicode_AS_UNICODE(result_uval); | |
21918 #endif | |
21919 assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); | |
21920 char_pos = 0; | |
21921 for (i=0; i < value_count; i++) { | |
21922 int ukind; | |
21923 Py_ssize_t ulength; | |
21924 void *udata; | |
21925 PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); | |
21926 if (unlikely(__Pyx_PyUnicode_READY(uval))) | |
21927 goto bad; | |
21928 ulength = __Pyx_PyUnicode_GET_LENGTH(uval); | |
21929 if (unlikely(!ulength)) | |
21930 continue; | |
21931 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) | |
21932 goto overflow; | |
21933 ukind = __Pyx_PyUnicode_KIND(uval); | |
21934 udata = __Pyx_PyUnicode_DATA(uval); | |
21935 if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { | |
21936 memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); | |
21937 } else { | |
21938 #if PY_VERSION_HEX >= 0x030d0000 | |
21939 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; | |
21940 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) | |
21941 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); | |
21942 #else | |
21943 Py_ssize_t j; | |
21944 for (j=0; j < ulength; j++) { | |
21945 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); | |
21946 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); | |
21947 } | |
21948 #endif | |
21949 } | |
21950 char_pos += ulength; | |
21951 } | |
21952 return result_uval; | |
21953 overflow: | |
21954 PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); | |
21955 bad: | |
21956 Py_DECREF(result_uval); | |
21957 return NULL; | |
21958 #else | |
21959 CYTHON_UNUSED_VAR(max_char); | |
21960 CYTHON_UNUSED_VAR(result_ulength); | |
21961 CYTHON_UNUSED_VAR(value_count); | |
21962 return PyUnicode_Join(__pyx_empty_unicode, value_tuple); | |
21963 #endif | |
21964 } | |
21965 | |
21966 /* ExtTypeTest */ | |
21967 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { | |
21968 __Pyx_TypeName obj_type_name; | |
21969 __Pyx_TypeName type_name; | |
21970 if (unlikely(!type)) { | |
21971 PyErr_SetString(PyExc_SystemError, "Missing type object"); | |
21972 return 0; | |
21973 } | |
21974 if (likely(__Pyx_TypeCheck(obj, type))) | |
21975 return 1; | |
21976 obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); | |
21977 type_name = __Pyx_PyType_GetName(type); | |
21978 PyErr_Format(PyExc_TypeError, | |
21979 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, | |
21980 obj_type_name, type_name); | |
21981 __Pyx_DECREF_TypeName(obj_type_name); | |
21982 __Pyx_DECREF_TypeName(type_name); | |
21983 return 0; | |
21984 } | |
21985 | |
21986 /* ArgTypeTest */ | |
21987 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) | |
21988 { | |
21989 __Pyx_TypeName type_name; | |
21990 __Pyx_TypeName obj_type_name; | |
21991 if (unlikely(!type)) { | |
21992 PyErr_SetString(PyExc_SystemError, "Missing type object"); | |
21993 return 0; | |
21994 } | |
21995 else if (exact) { | |
21996 #if PY_MAJOR_VERSION == 2 | |
21997 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; | |
21998 #endif | |
21999 } | |
22000 else { | |
22001 if (likely(__Pyx_TypeCheck(obj, type))) return 1; | |
22002 } | |
22003 type_name = __Pyx_PyType_GetName(type); | |
22004 obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); | |
22005 PyErr_Format(PyExc_TypeError, | |
22006 "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME | |
22007 ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); | |
22008 __Pyx_DECREF_TypeName(type_name); | |
22009 __Pyx_DECREF_TypeName(obj_type_name); | |
22010 return 0; | |
22011 } | |
22012 | |
22013 /* RaiseUnexpectedTypeError */ | |
22014 static int | |
22015 __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) | |
22016 { | |
22017 __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); | |
22018 PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, | |
22019 expected, obj_type_name); | |
22020 __Pyx_DECREF_TypeName(obj_type_name); | |
22021 return 0; | |
22022 } | |
22023 | |
22024 /* PyUnicode_Unicode */ | |
22025 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) { | |
22026 if (unlikely(obj == Py_None)) | |
22027 obj = __pyx_kp_u_None; | |
22028 return __Pyx_NewRef(obj); | |
22029 } | |
22030 | |
22031 /* GetAttr3 */ | |
22032 #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 | |
22033 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { | |
22034 __Pyx_PyThreadState_declare | |
22035 __Pyx_PyThreadState_assign | |
22036 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) | |
22037 return NULL; | |
22038 __Pyx_PyErr_Clear(); | |
22039 Py_INCREF(d); | |
22040 return d; | |
22041 } | |
22042 #endif | |
22043 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { | |
22044 PyObject *r; | |
22045 #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 | |
22046 int res = PyObject_GetOptionalAttr(o, n, &r); | |
22047 return (res != 0) ? r : __Pyx_NewRef(d); | |
22048 #else | |
22049 #if CYTHON_USE_TYPE_SLOTS | |
22050 if (likely(PyString_Check(n))) { | |
22051 r = __Pyx_PyObject_GetAttrStrNoError(o, n); | |
22052 if (unlikely(!r) && likely(!PyErr_Occurred())) { | |
22053 r = __Pyx_NewRef(d); | |
22054 } | |
22055 return r; | |
22056 } | |
22057 #endif | |
22058 r = PyObject_GetAttr(o, n); | |
22059 return (likely(r)) ? r : __Pyx_GetAttr3Default(d); | |
22060 #endif | |
22061 } | |
22062 | |
22063 /* Import */ | |
22064 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { | |
22065 PyObject *module = 0; | |
22066 PyObject *empty_dict = 0; | |
22067 PyObject *empty_list = 0; | |
22068 #if PY_MAJOR_VERSION < 3 | |
22069 PyObject *py_import; | |
22070 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); | |
22071 if (unlikely(!py_import)) | |
22072 goto bad; | |
22073 if (!from_list) { | |
22074 empty_list = PyList_New(0); | |
22075 if (unlikely(!empty_list)) | |
22076 goto bad; | |
22077 from_list = empty_list; | |
22078 } | |
22079 #endif | |
22080 empty_dict = PyDict_New(); | |
22081 if (unlikely(!empty_dict)) | |
22082 goto bad; | |
22083 { | |
22084 #if PY_MAJOR_VERSION >= 3 | |
22085 if (level == -1) { | |
22086 if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { | |
22087 module = PyImport_ImportModuleLevelObject( | |
22088 name, __pyx_d, empty_dict, from_list, 1); | |
22089 if (unlikely(!module)) { | |
22090 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) | |
22091 goto bad; | |
22092 PyErr_Clear(); | |
22093 } | |
22094 } | |
22095 level = 0; | |
22096 } | |
22097 #endif | |
22098 if (!module) { | |
22099 #if PY_MAJOR_VERSION < 3 | |
22100 PyObject *py_level = PyInt_FromLong(level); | |
22101 if (unlikely(!py_level)) | |
22102 goto bad; | |
22103 module = PyObject_CallFunctionObjArgs(py_import, | |
22104 name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); | |
22105 Py_DECREF(py_level); | |
22106 #else | |
22107 module = PyImport_ImportModuleLevelObject( | |
22108 name, __pyx_d, empty_dict, from_list, level); | |
22109 #endif | |
22110 } | |
22111 } | |
22112 bad: | |
22113 Py_XDECREF(empty_dict); | |
22114 Py_XDECREF(empty_list); | |
22115 #if PY_MAJOR_VERSION < 3 | |
22116 Py_XDECREF(py_import); | |
22117 #endif | |
22118 return module; | |
22119 } | |
22120 | |
22121 /* ImportFrom */ | |
22122 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { | |
22123 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); | |
22124 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { | |
22125 const char* module_name_str = 0; | |
22126 PyObject* module_name = 0; | |
22127 PyObject* module_dot = 0; | |
22128 PyObject* full_name = 0; | |
22129 PyErr_Clear(); | |
22130 module_name_str = PyModule_GetName(module); | |
22131 if (unlikely(!module_name_str)) { goto modbad; } | |
22132 module_name = PyUnicode_FromString(module_name_str); | |
22133 if (unlikely(!module_name)) { goto modbad; } | |
22134 module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__47); | |
22135 if (unlikely(!module_dot)) { goto modbad; } | |
22136 full_name = PyUnicode_Concat(module_dot, name); | |
22137 if (unlikely(!full_name)) { goto modbad; } | |
22138 #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) | |
22139 { | |
22140 PyObject *modules = PyImport_GetModuleDict(); | |
22141 if (unlikely(!modules)) | |
22142 goto modbad; | |
22143 value = PyObject_GetItem(modules, full_name); | |
22144 } | |
22145 #else | |
22146 value = PyImport_GetModule(full_name); | |
22147 #endif | |
22148 modbad: | |
22149 Py_XDECREF(full_name); | |
22150 Py_XDECREF(module_dot); | |
22151 Py_XDECREF(module_name); | |
22152 } | |
22153 if (unlikely(!value)) { | |
22154 PyErr_Format(PyExc_ImportError, | |
22155 #if PY_MAJOR_VERSION < 3 | |
22156 "cannot import name %.230s", PyString_AS_STRING(name)); | |
22157 #else | |
22158 "cannot import name %S", name); | |
22159 #endif | |
22160 } | |
22161 return value; | |
22162 } | |
22163 | |
22164 /* GetAttr */ | |
22165 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { | |
22166 #if CYTHON_USE_TYPE_SLOTS | |
22167 #if PY_MAJOR_VERSION >= 3 | |
22168 if (likely(PyUnicode_Check(n))) | |
22169 #else | |
22170 if (likely(PyString_Check(n))) | |
22171 #endif | |
22172 return __Pyx_PyObject_GetAttrStr(o, n); | |
22173 #endif | |
22174 return PyObject_GetAttr(o, n); | |
22175 } | |
22176 | |
22177 /* HasAttr */ | |
22178 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { | |
22179 PyObject *r; | |
22180 if (unlikely(!__Pyx_PyBaseString_Check(n))) { | |
22181 PyErr_SetString(PyExc_TypeError, | |
22182 "hasattr(): attribute name must be string"); | |
22183 return -1; | |
22184 } | |
22185 r = __Pyx_GetAttr(o, n); | |
22186 if (!r) { | |
22187 PyErr_Clear(); | |
22188 return 0; | |
22189 } else { | |
22190 Py_DECREF(r); | |
22191 return 1; | |
22192 } | |
22193 } | |
22194 | |
22195 /* FixUpExtensionType */ | |
22196 #if CYTHON_USE_TYPE_SPECS | |
22197 static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { | |
22198 #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API | |
22199 CYTHON_UNUSED_VAR(spec); | |
22200 CYTHON_UNUSED_VAR(type); | |
22201 #else | |
22202 const PyType_Slot *slot = spec->slots; | |
22203 while (slot && slot->slot && slot->slot != Py_tp_members) | |
22204 slot++; | |
22205 if (slot && slot->slot == Py_tp_members) { | |
22206 int changed = 0; | |
22207 #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) | |
22208 const | |
22209 #endif | |
22210 PyMemberDef *memb = (PyMemberDef*) slot->pfunc; | |
22211 while (memb && memb->name) { | |
22212 if (memb->name[0] == '_' && memb->name[1] == '_') { | |
22213 #if PY_VERSION_HEX < 0x030900b1 | |
22214 if (strcmp(memb->name, "__weaklistoffset__") == 0) { | |
22215 assert(memb->type == T_PYSSIZET); | |
22216 assert(memb->flags == READONLY); | |
22217 type->tp_weaklistoffset = memb->offset; | |
22218 changed = 1; | |
22219 } | |
22220 else if (strcmp(memb->name, "__dictoffset__") == 0) { | |
22221 assert(memb->type == T_PYSSIZET); | |
22222 assert(memb->flags == READONLY); | |
22223 type->tp_dictoffset = memb->offset; | |
22224 changed = 1; | |
22225 } | |
22226 #if CYTHON_METH_FASTCALL | |
22227 else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { | |
22228 assert(memb->type == T_PYSSIZET); | |
22229 assert(memb->flags == READONLY); | |
22230 #if PY_VERSION_HEX >= 0x030800b4 | |
22231 type->tp_vectorcall_offset = memb->offset; | |
22232 #else | |
22233 type->tp_print = (printfunc) memb->offset; | |
22234 #endif | |
22235 changed = 1; | |
22236 } | |
22237 #endif | |
22238 #else | |
22239 if ((0)); | |
22240 #endif | |
22241 #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON | |
22242 else if (strcmp(memb->name, "__module__") == 0) { | |
22243 PyObject *descr; | |
22244 assert(memb->type == T_OBJECT); | |
22245 assert(memb->flags == 0 || memb->flags == READONLY); | |
22246 descr = PyDescr_NewMember(type, memb); | |
22247 if (unlikely(!descr)) | |
22248 return -1; | |
22249 if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { | |
22250 Py_DECREF(descr); | |
22251 return -1; | |
22252 } | |
22253 Py_DECREF(descr); | |
22254 changed = 1; | |
22255 } | |
22256 #endif | |
22257 } | |
22258 memb++; | |
22259 } | |
22260 if (changed) | |
22261 PyType_Modified(type); | |
22262 } | |
22263 #endif | |
22264 return 0; | |
22265 } | |
22266 #endif | |
22267 | |
22268 /* PyObjectCallNoArg */ | |
22269 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { | |
22270 PyObject *arg[2] = {NULL, NULL}; | |
22271 return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); | |
22272 } | |
22273 | |
22274 /* PyObjectCallMethod0 */ | |
22275 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { | |
22276 PyObject *method = NULL, *result = NULL; | |
22277 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); | |
22278 if (likely(is_method)) { | |
22279 result = __Pyx_PyObject_CallOneArg(method, obj); | |
22280 Py_DECREF(method); | |
22281 return result; | |
22282 } | |
22283 if (unlikely(!method)) goto bad; | |
22284 result = __Pyx_PyObject_CallNoArg(method); | |
22285 Py_DECREF(method); | |
22286 bad: | |
22287 return result; | |
22288 } | |
22289 | |
22290 /* ValidateBasesTuple */ | |
22291 #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS | |
22292 static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { | |
22293 Py_ssize_t i, n; | |
22294 #if CYTHON_ASSUME_SAFE_MACROS | |
22295 n = PyTuple_GET_SIZE(bases); | |
22296 #else | |
22297 n = PyTuple_Size(bases); | |
22298 if (n < 0) return -1; | |
22299 #endif | |
22300 for (i = 1; i < n; i++) | |
22301 { | |
22302 #if CYTHON_AVOID_BORROWED_REFS | |
22303 PyObject *b0 = PySequence_GetItem(bases, i); | |
22304 if (!b0) return -1; | |
22305 #elif CYTHON_ASSUME_SAFE_MACROS | |
22306 PyObject *b0 = PyTuple_GET_ITEM(bases, i); | |
22307 #else | |
22308 PyObject *b0 = PyTuple_GetItem(bases, i); | |
22309 if (!b0) return -1; | |
22310 #endif | |
22311 PyTypeObject *b; | |
22312 #if PY_MAJOR_VERSION < 3 | |
22313 if (PyClass_Check(b0)) | |
22314 { | |
22315 PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", | |
22316 PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); | |
22317 #if CYTHON_AVOID_BORROWED_REFS | |
22318 Py_DECREF(b0); | |
22319 #endif | |
22320 return -1; | |
22321 } | |
22322 #endif | |
22323 b = (PyTypeObject*) b0; | |
22324 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) | |
22325 { | |
22326 __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); | |
22327 PyErr_Format(PyExc_TypeError, | |
22328 "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); | |
22329 __Pyx_DECREF_TypeName(b_name); | |
22330 #if CYTHON_AVOID_BORROWED_REFS | |
22331 Py_DECREF(b0); | |
22332 #endif | |
22333 return -1; | |
22334 } | |
22335 if (dictoffset == 0) | |
22336 { | |
22337 Py_ssize_t b_dictoffset = 0; | |
22338 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY | |
22339 b_dictoffset = b->tp_dictoffset; | |
22340 #else | |
22341 PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); | |
22342 if (!py_b_dictoffset) goto dictoffset_return; | |
22343 b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); | |
22344 Py_DECREF(py_b_dictoffset); | |
22345 if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; | |
22346 #endif | |
22347 if (b_dictoffset) { | |
22348 { | |
22349 __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); | |
22350 PyErr_Format(PyExc_TypeError, | |
22351 "extension type '%.200s' has no __dict__ slot, " | |
22352 "but base type '" __Pyx_FMT_TYPENAME "' has: " | |
22353 "either add 'cdef dict __dict__' to the extension type " | |
22354 "or add '__slots__ = [...]' to the base type", | |
22355 type_name, b_name); | |
22356 __Pyx_DECREF_TypeName(b_name); | |
22357 } | |
22358 #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) | |
22359 dictoffset_return: | |
22360 #endif | |
22361 #if CYTHON_AVOID_BORROWED_REFS | |
22362 Py_DECREF(b0); | |
22363 #endif | |
22364 return -1; | |
22365 } | |
22366 } | |
22367 #if CYTHON_AVOID_BORROWED_REFS | |
22368 Py_DECREF(b0); | |
22369 #endif | |
22370 } | |
22371 return 0; | |
22372 } | |
22373 #endif | |
22374 | |
22375 /* PyType_Ready */ | |
22376 static int __Pyx_PyType_Ready(PyTypeObject *t) { | |
22377 #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) | |
22378 (void)__Pyx_PyObject_CallMethod0; | |
22379 #if CYTHON_USE_TYPE_SPECS | |
22380 (void)__Pyx_validate_bases_tuple; | |
22381 #endif | |
22382 return PyType_Ready(t); | |
22383 #else | |
22384 int r; | |
22385 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); | |
22386 if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) | |
22387 return -1; | |
22388 #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) | |
22389 { | |
22390 int gc_was_enabled; | |
22391 #if PY_VERSION_HEX >= 0x030A00b1 | |
22392 gc_was_enabled = PyGC_Disable(); | |
22393 (void)__Pyx_PyObject_CallMethod0; | |
22394 #else | |
22395 PyObject *ret, *py_status; | |
22396 PyObject *gc = NULL; | |
22397 #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) | |
22398 gc = PyImport_GetModule(__pyx_kp_u_gc); | |
22399 #endif | |
22400 if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); | |
22401 if (unlikely(!gc)) return -1; | |
22402 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); | |
22403 if (unlikely(!py_status)) { | |
22404 Py_DECREF(gc); | |
22405 return -1; | |
22406 } | |
22407 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); | |
22408 Py_DECREF(py_status); | |
22409 if (gc_was_enabled > 0) { | |
22410 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); | |
22411 if (unlikely(!ret)) { | |
22412 Py_DECREF(gc); | |
22413 return -1; | |
22414 } | |
22415 Py_DECREF(ret); | |
22416 } else if (unlikely(gc_was_enabled == -1)) { | |
22417 Py_DECREF(gc); | |
22418 return -1; | |
22419 } | |
22420 #endif | |
22421 t->tp_flags |= Py_TPFLAGS_HEAPTYPE; | |
22422 #if PY_VERSION_HEX >= 0x030A0000 | |
22423 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; | |
22424 #endif | |
22425 #else | |
22426 (void)__Pyx_PyObject_CallMethod0; | |
22427 #endif | |
22428 r = PyType_Ready(t); | |
22429 #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) | |
22430 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; | |
22431 #if PY_VERSION_HEX >= 0x030A00b1 | |
22432 if (gc_was_enabled) | |
22433 PyGC_Enable(); | |
22434 #else | |
22435 if (gc_was_enabled) { | |
22436 PyObject *tp, *v, *tb; | |
22437 PyErr_Fetch(&tp, &v, &tb); | |
22438 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); | |
22439 if (likely(ret || r == -1)) { | |
22440 Py_XDECREF(ret); | |
22441 PyErr_Restore(tp, v, tb); | |
22442 } else { | |
22443 Py_XDECREF(tp); | |
22444 Py_XDECREF(v); | |
22445 Py_XDECREF(tb); | |
22446 r = -1; | |
22447 } | |
22448 } | |
22449 Py_DECREF(gc); | |
22450 #endif | |
22451 } | |
22452 #endif | |
22453 return r; | |
22454 #endif | |
22455 } | |
22456 | |
22457 /* PyObject_GenericGetAttrNoDict */ | |
22458 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 | |
22459 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { | |
22460 __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); | |
22461 PyErr_Format(PyExc_AttributeError, | |
22462 #if PY_MAJOR_VERSION >= 3 | |
22463 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", | |
22464 type_name, attr_name); | |
22465 #else | |
22466 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", | |
22467 type_name, PyString_AS_STRING(attr_name)); | |
22468 #endif | |
22469 __Pyx_DECREF_TypeName(type_name); | |
22470 return NULL; | |
22471 } | |
22472 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { | |
22473 PyObject *descr; | |
22474 PyTypeObject *tp = Py_TYPE(obj); | |
22475 if (unlikely(!PyString_Check(attr_name))) { | |
22476 return PyObject_GenericGetAttr(obj, attr_name); | |
22477 } | |
22478 assert(!tp->tp_dictoffset); | |
22479 descr = _PyType_Lookup(tp, attr_name); | |
22480 if (unlikely(!descr)) { | |
22481 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); | |
22482 } | |
22483 Py_INCREF(descr); | |
22484 #if PY_MAJOR_VERSION < 3 | |
22485 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) | |
22486 #endif | |
22487 { | |
22488 descrgetfunc f = Py_TYPE(descr)->tp_descr_get; | |
22489 if (unlikely(f)) { | |
22490 PyObject *res = f(descr, obj, (PyObject *)tp); | |
22491 Py_DECREF(descr); | |
22492 return res; | |
22493 } | |
22494 } | |
22495 return descr; | |
22496 } | |
22497 #endif | |
22498 | |
22499 /* PyObject_GenericGetAttr */ | |
22500 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 | |
22501 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { | |
22502 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { | |
22503 return PyObject_GenericGetAttr(obj, attr_name); | |
22504 } | |
22505 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); | |
22506 } | |
22507 #endif | |
22508 | |
22509 /* SetVTable */ | |
22510 static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) { | |
22511 PyObject *ob = PyCapsule_New(vtable, 0, 0); | |
22512 if (unlikely(!ob)) | |
22513 goto bad; | |
22514 #if CYTHON_COMPILING_IN_LIMITED_API | |
22515 if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0)) | |
22516 #else | |
22517 if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0)) | |
22518 #endif | |
22519 goto bad; | |
22520 Py_DECREF(ob); | |
22521 return 0; | |
22522 bad: | |
22523 Py_XDECREF(ob); | |
22524 return -1; | |
22525 } | |
22526 | |
22527 /* GetVTable */ | |
22528 static void* __Pyx_GetVtable(PyTypeObject *type) { | |
22529 void* ptr; | |
22530 #if CYTHON_COMPILING_IN_LIMITED_API | |
22531 PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable); | |
22532 #else | |
22533 PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable); | |
22534 #endif | |
22535 if (!ob) | |
22536 goto bad; | |
22537 ptr = PyCapsule_GetPointer(ob, 0); | |
22538 if (!ptr && !PyErr_Occurred()) | |
22539 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); | |
22540 Py_DECREF(ob); | |
22541 return ptr; | |
22542 bad: | |
22543 Py_XDECREF(ob); | |
22544 return NULL; | |
22545 } | |
22546 | |
22547 /* MergeVTables */ | |
22548 #if !CYTHON_COMPILING_IN_LIMITED_API | |
22549 static int __Pyx_MergeVtables(PyTypeObject *type) { | |
22550 int i; | |
22551 void** base_vtables; | |
22552 __Pyx_TypeName tp_base_name; | |
22553 __Pyx_TypeName base_name; | |
22554 void* unknown = (void*)-1; | |
22555 PyObject* bases = type->tp_bases; | |
22556 int base_depth = 0; | |
22557 { | |
22558 PyTypeObject* base = type->tp_base; | |
22559 while (base) { | |
22560 base_depth += 1; | |
22561 base = base->tp_base; | |
22562 } | |
22563 } | |
22564 base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1)); | |
22565 base_vtables[0] = unknown; | |
22566 for (i = 1; i < PyTuple_GET_SIZE(bases); i++) { | |
22567 void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i))); | |
22568 if (base_vtable != NULL) { | |
22569 int j; | |
22570 PyTypeObject* base = type->tp_base; | |
22571 for (j = 0; j < base_depth; j++) { | |
22572 if (base_vtables[j] == unknown) { | |
22573 base_vtables[j] = __Pyx_GetVtable(base); | |
22574 base_vtables[j + 1] = unknown; | |
22575 } | |
22576 if (base_vtables[j] == base_vtable) { | |
22577 break; | |
22578 } else if (base_vtables[j] == NULL) { | |
22579 goto bad; | |
22580 } | |
22581 base = base->tp_base; | |
22582 } | |
22583 } | |
22584 } | |
22585 PyErr_Clear(); | |
22586 free(base_vtables); | |
22587 return 0; | |
22588 bad: | |
22589 tp_base_name = __Pyx_PyType_GetName(type->tp_base); | |
22590 base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i)); | |
22591 PyErr_Format(PyExc_TypeError, | |
22592 "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name); | |
22593 __Pyx_DECREF_TypeName(tp_base_name); | |
22594 __Pyx_DECREF_TypeName(base_name); | |
22595 free(base_vtables); | |
22596 return -1; | |
22597 } | |
22598 #endif | |
22599 | |
22600 /* SetupReduce */ | |
22601 #if !CYTHON_COMPILING_IN_LIMITED_API | |
22602 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { | |
22603 int ret; | |
22604 PyObject *name_attr; | |
22605 name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2); | |
22606 if (likely(name_attr)) { | |
22607 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); | |
22608 } else { | |
22609 ret = -1; | |
22610 } | |
22611 if (unlikely(ret < 0)) { | |
22612 PyErr_Clear(); | |
22613 ret = 0; | |
22614 } | |
22615 Py_XDECREF(name_attr); | |
22616 return ret; | |
22617 } | |
22618 static int __Pyx_setup_reduce(PyObject* type_obj) { | |
22619 int ret = 0; | |
22620 PyObject *object_reduce = NULL; | |
22621 PyObject *object_getstate = NULL; | |
22622 PyObject *object_reduce_ex = NULL; | |
22623 PyObject *reduce = NULL; | |
22624 PyObject *reduce_ex = NULL; | |
22625 PyObject *reduce_cython = NULL; | |
22626 PyObject *setstate = NULL; | |
22627 PyObject *setstate_cython = NULL; | |
22628 PyObject *getstate = NULL; | |
22629 #if CYTHON_USE_PYTYPE_LOOKUP | |
22630 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); | |
22631 #else | |
22632 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); | |
22633 if (!getstate && PyErr_Occurred()) { | |
22634 goto __PYX_BAD; | |
22635 } | |
22636 #endif | |
22637 if (getstate) { | |
22638 #if CYTHON_USE_PYTYPE_LOOKUP | |
22639 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); | |
22640 #else | |
22641 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); | |
22642 if (!object_getstate && PyErr_Occurred()) { | |
22643 goto __PYX_BAD; | |
22644 } | |
22645 #endif | |
22646 if (object_getstate != getstate) { | |
22647 goto __PYX_GOOD; | |
22648 } | |
22649 } | |
22650 #if CYTHON_USE_PYTYPE_LOOKUP | |
22651 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; | |
22652 #else | |
22653 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; | |
22654 #endif | |
22655 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; | |
22656 if (reduce_ex == object_reduce_ex) { | |
22657 #if CYTHON_USE_PYTYPE_LOOKUP | |
22658 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; | |
22659 #else | |
22660 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; | |
22661 #endif | |
22662 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; | |
22663 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { | |
22664 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); | |
22665 if (likely(reduce_cython)) { | |
22666 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; | |
22667 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; | |
22668 } else if (reduce == object_reduce || PyErr_Occurred()) { | |
22669 goto __PYX_BAD; | |
22670 } | |
22671 setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); | |
22672 if (!setstate) PyErr_Clear(); | |
22673 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { | |
22674 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); | |
22675 if (likely(setstate_cython)) { | |
22676 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; | |
22677 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; | |
22678 } else if (!setstate || PyErr_Occurred()) { | |
22679 goto __PYX_BAD; | |
22680 } | |
22681 } | |
22682 PyType_Modified((PyTypeObject*)type_obj); | |
22683 } | |
22684 } | |
22685 goto __PYX_GOOD; | |
22686 __PYX_BAD: | |
22687 if (!PyErr_Occurred()) { | |
22688 __Pyx_TypeName type_obj_name = | |
22689 __Pyx_PyType_GetName((PyTypeObject*)type_obj); | |
22690 PyErr_Format(PyExc_RuntimeError, | |
22691 "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); | |
22692 __Pyx_DECREF_TypeName(type_obj_name); | |
22693 } | |
22694 ret = -1; | |
22695 __PYX_GOOD: | |
22696 #if !CYTHON_USE_PYTYPE_LOOKUP | |
22697 Py_XDECREF(object_reduce); | |
22698 Py_XDECREF(object_reduce_ex); | |
22699 Py_XDECREF(object_getstate); | |
22700 Py_XDECREF(getstate); | |
22701 #endif | |
22702 Py_XDECREF(reduce); | |
22703 Py_XDECREF(reduce_ex); | |
22704 Py_XDECREF(reduce_cython); | |
22705 Py_XDECREF(setstate); | |
22706 Py_XDECREF(setstate_cython); | |
22707 return ret; | |
22708 } | |
22709 #endif | |
22710 | |
22711 /* TypeImport */ | |
22712 #ifndef __PYX_HAVE_RT_ImportType_3_0_11 | |
22713 #define __PYX_HAVE_RT_ImportType_3_0_11 | |
22714 static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name, | |
22715 size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size) | |
22716 { | |
22717 PyObject *result = 0; | |
22718 char warning[200]; | |
22719 Py_ssize_t basicsize; | |
22720 Py_ssize_t itemsize; | |
22721 #if CYTHON_COMPILING_IN_LIMITED_API | |
22722 PyObject *py_basicsize; | |
22723 PyObject *py_itemsize; | |
22724 #endif | |
22725 result = PyObject_GetAttrString(module, class_name); | |
22726 if (!result) | |
22727 goto bad; | |
22728 if (!PyType_Check(result)) { | |
22729 PyErr_Format(PyExc_TypeError, | |
22730 "%.200s.%.200s is not a type object", | |
22731 module_name, class_name); | |
22732 goto bad; | |
22733 } | |
22734 #if !CYTHON_COMPILING_IN_LIMITED_API | |
22735 basicsize = ((PyTypeObject *)result)->tp_basicsize; | |
22736 itemsize = ((PyTypeObject *)result)->tp_itemsize; | |
22737 #else | |
22738 py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); | |
22739 if (!py_basicsize) | |
22740 goto bad; | |
22741 basicsize = PyLong_AsSsize_t(py_basicsize); | |
22742 Py_DECREF(py_basicsize); | |
22743 py_basicsize = 0; | |
22744 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) | |
22745 goto bad; | |
22746 py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); | |
22747 if (!py_itemsize) | |
22748 goto bad; | |
22749 itemsize = PyLong_AsSsize_t(py_itemsize); | |
22750 Py_DECREF(py_itemsize); | |
22751 py_itemsize = 0; | |
22752 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) | |
22753 goto bad; | |
22754 #endif | |
22755 if (itemsize) { | |
22756 if (size % alignment) { | |
22757 alignment = size % alignment; | |
22758 } | |
22759 if (itemsize < (Py_ssize_t)alignment) | |
22760 itemsize = (Py_ssize_t)alignment; | |
22761 } | |
22762 if ((size_t)(basicsize + itemsize) < size) { | |
22763 PyErr_Format(PyExc_ValueError, | |
22764 "%.200s.%.200s size changed, may indicate binary incompatibility. " | |
22765 "Expected %zd from C header, got %zd from PyObject", | |
22766 module_name, class_name, size, basicsize+itemsize); | |
22767 goto bad; | |
22768 } | |
22769 if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 && | |
22770 ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { | |
22771 PyErr_Format(PyExc_ValueError, | |
22772 "%.200s.%.200s size changed, may indicate binary incompatibility. " | |
22773 "Expected %zd from C header, got %zd-%zd from PyObject", | |
22774 module_name, class_name, size, basicsize, basicsize+itemsize); | |
22775 goto bad; | |
22776 } | |
22777 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) { | |
22778 PyOS_snprintf(warning, sizeof(warning), | |
22779 "%s.%s size changed, may indicate binary incompatibility. " | |
22780 "Expected %zd from C header, got %zd from PyObject", | |
22781 module_name, class_name, size, basicsize); | |
22782 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; | |
22783 } | |
22784 return (PyTypeObject *)result; | |
22785 bad: | |
22786 Py_XDECREF(result); | |
22787 return NULL; | |
22788 } | |
22789 #endif | |
22790 | |
22791 /* ImportDottedModule */ | |
22792 #if PY_MAJOR_VERSION >= 3 | |
22793 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { | |
22794 PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; | |
22795 if (unlikely(PyErr_Occurred())) { | |
22796 PyErr_Clear(); | |
22797 } | |
22798 if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { | |
22799 partial_name = name; | |
22800 } else { | |
22801 slice = PySequence_GetSlice(parts_tuple, 0, count); | |
22802 if (unlikely(!slice)) | |
22803 goto bad; | |
22804 sep = PyUnicode_FromStringAndSize(".", 1); | |
22805 if (unlikely(!sep)) | |
22806 goto bad; | |
22807 partial_name = PyUnicode_Join(sep, slice); | |
22808 } | |
22809 PyErr_Format( | |
22810 #if PY_MAJOR_VERSION < 3 | |
22811 PyExc_ImportError, | |
22812 "No module named '%s'", PyString_AS_STRING(partial_name)); | |
22813 #else | |
22814 #if PY_VERSION_HEX >= 0x030600B1 | |
22815 PyExc_ModuleNotFoundError, | |
22816 #else | |
22817 PyExc_ImportError, | |
22818 #endif | |
22819 "No module named '%U'", partial_name); | |
22820 #endif | |
22821 bad: | |
22822 Py_XDECREF(sep); | |
22823 Py_XDECREF(slice); | |
22824 Py_XDECREF(partial_name); | |
22825 return NULL; | |
22826 } | |
22827 #endif | |
22828 #if PY_MAJOR_VERSION >= 3 | |
22829 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { | |
22830 PyObject *imported_module; | |
22831 #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) | |
22832 PyObject *modules = PyImport_GetModuleDict(); | |
22833 if (unlikely(!modules)) | |
22834 return NULL; | |
22835 imported_module = __Pyx_PyDict_GetItemStr(modules, name); | |
22836 Py_XINCREF(imported_module); | |
22837 #else | |
22838 imported_module = PyImport_GetModule(name); | |
22839 #endif | |
22840 return imported_module; | |
22841 } | |
22842 #endif | |
22843 #if PY_MAJOR_VERSION >= 3 | |
22844 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { | |
22845 Py_ssize_t i, nparts; | |
22846 nparts = PyTuple_GET_SIZE(parts_tuple); | |
22847 for (i=1; i < nparts && module; i++) { | |
22848 PyObject *part, *submodule; | |
22849 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
22850 part = PyTuple_GET_ITEM(parts_tuple, i); | |
22851 #else | |
22852 part = PySequence_ITEM(parts_tuple, i); | |
22853 #endif | |
22854 submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); | |
22855 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) | |
22856 Py_DECREF(part); | |
22857 #endif | |
22858 Py_DECREF(module); | |
22859 module = submodule; | |
22860 } | |
22861 if (unlikely(!module)) { | |
22862 return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); | |
22863 } | |
22864 return module; | |
22865 } | |
22866 #endif | |
22867 static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { | |
22868 #if PY_MAJOR_VERSION < 3 | |
22869 PyObject *module, *from_list, *star = __pyx_n_s__48; | |
22870 CYTHON_UNUSED_VAR(parts_tuple); | |
22871 from_list = PyList_New(1); | |
22872 if (unlikely(!from_list)) | |
22873 return NULL; | |
22874 Py_INCREF(star); | |
22875 PyList_SET_ITEM(from_list, 0, star); | |
22876 module = __Pyx_Import(name, from_list, 0); | |
22877 Py_DECREF(from_list); | |
22878 return module; | |
22879 #else | |
22880 PyObject *imported_module; | |
22881 PyObject *module = __Pyx_Import(name, NULL, 0); | |
22882 if (!parts_tuple || unlikely(!module)) | |
22883 return module; | |
22884 imported_module = __Pyx__ImportDottedModule_Lookup(name); | |
22885 if (likely(imported_module)) { | |
22886 Py_DECREF(module); | |
22887 return imported_module; | |
22888 } | |
22889 PyErr_Clear(); | |
22890 return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); | |
22891 #endif | |
22892 } | |
22893 static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { | |
22894 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 | |
22895 PyObject *module = __Pyx__ImportDottedModule_Lookup(name); | |
22896 if (likely(module)) { | |
22897 PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); | |
22898 if (likely(spec)) { | |
22899 PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); | |
22900 if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { | |
22901 Py_DECREF(spec); | |
22902 spec = NULL; | |
22903 } | |
22904 Py_XDECREF(unsafe); | |
22905 } | |
22906 if (likely(!spec)) { | |
22907 PyErr_Clear(); | |
22908 return module; | |
22909 } | |
22910 Py_DECREF(spec); | |
22911 Py_DECREF(module); | |
22912 } else if (PyErr_Occurred()) { | |
22913 PyErr_Clear(); | |
22914 } | |
22915 #endif | |
22916 return __Pyx__ImportDottedModule(name, parts_tuple); | |
22917 } | |
22918 | |
22919 /* FetchSharedCythonModule */ | |
22920 static PyObject *__Pyx_FetchSharedCythonABIModule(void) { | |
22921 return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); | |
22922 } | |
22923 | |
22924 /* FetchCommonType */ | |
22925 static int __Pyx_VerifyCachedType(PyObject *cached_type, | |
22926 const char *name, | |
22927 Py_ssize_t basicsize, | |
22928 Py_ssize_t expected_basicsize) { | |
22929 if (!PyType_Check(cached_type)) { | |
22930 PyErr_Format(PyExc_TypeError, | |
22931 "Shared Cython type %.200s is not a type object", name); | |
22932 return -1; | |
22933 } | |
22934 if (basicsize != expected_basicsize) { | |
22935 PyErr_Format(PyExc_TypeError, | |
22936 "Shared Cython type %.200s has the wrong size, try recompiling", | |
22937 name); | |
22938 return -1; | |
22939 } | |
22940 return 0; | |
22941 } | |
22942 #if !CYTHON_USE_TYPE_SPECS | |
22943 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { | |
22944 PyObject* abi_module; | |
22945 const char* object_name; | |
22946 PyTypeObject *cached_type = NULL; | |
22947 abi_module = __Pyx_FetchSharedCythonABIModule(); | |
22948 if (!abi_module) return NULL; | |
22949 object_name = strrchr(type->tp_name, '.'); | |
22950 object_name = object_name ? object_name+1 : type->tp_name; | |
22951 cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); | |
22952 if (cached_type) { | |
22953 if (__Pyx_VerifyCachedType( | |
22954 (PyObject *)cached_type, | |
22955 object_name, | |
22956 cached_type->tp_basicsize, | |
22957 type->tp_basicsize) < 0) { | |
22958 goto bad; | |
22959 } | |
22960 goto done; | |
22961 } | |
22962 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; | |
22963 PyErr_Clear(); | |
22964 if (PyType_Ready(type) < 0) goto bad; | |
22965 if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) | |
22966 goto bad; | |
22967 Py_INCREF(type); | |
22968 cached_type = type; | |
22969 done: | |
22970 Py_DECREF(abi_module); | |
22971 return cached_type; | |
22972 bad: | |
22973 Py_XDECREF(cached_type); | |
22974 cached_type = NULL; | |
22975 goto done; | |
22976 } | |
22977 #else | |
22978 static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { | |
22979 PyObject *abi_module, *cached_type = NULL; | |
22980 const char* object_name = strrchr(spec->name, '.'); | |
22981 object_name = object_name ? object_name+1 : spec->name; | |
22982 abi_module = __Pyx_FetchSharedCythonABIModule(); | |
22983 if (!abi_module) return NULL; | |
22984 cached_type = PyObject_GetAttrString(abi_module, object_name); | |
22985 if (cached_type) { | |
22986 Py_ssize_t basicsize; | |
22987 #if CYTHON_COMPILING_IN_LIMITED_API | |
22988 PyObject *py_basicsize; | |
22989 py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); | |
22990 if (unlikely(!py_basicsize)) goto bad; | |
22991 basicsize = PyLong_AsSsize_t(py_basicsize); | |
22992 Py_DECREF(py_basicsize); | |
22993 py_basicsize = 0; | |
22994 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; | |
22995 #else | |
22996 basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; | |
22997 #endif | |
22998 if (__Pyx_VerifyCachedType( | |
22999 cached_type, | |
23000 object_name, | |
23001 basicsize, | |
23002 spec->basicsize) < 0) { | |
23003 goto bad; | |
23004 } | |
23005 goto done; | |
23006 } | |
23007 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; | |
23008 PyErr_Clear(); | |
23009 CYTHON_UNUSED_VAR(module); | |
23010 cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); | |
23011 if (unlikely(!cached_type)) goto bad; | |
23012 if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; | |
23013 if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; | |
23014 done: | |
23015 Py_DECREF(abi_module); | |
23016 assert(cached_type == NULL || PyType_Check(cached_type)); | |
23017 return (PyTypeObject *) cached_type; | |
23018 bad: | |
23019 Py_XDECREF(cached_type); | |
23020 cached_type = NULL; | |
23021 goto done; | |
23022 } | |
23023 #endif | |
23024 | |
23025 /* PyVectorcallFastCallDict */ | |
23026 #if CYTHON_METH_FASTCALL | |
23027 static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) | |
23028 { | |
23029 PyObject *res = NULL; | |
23030 PyObject *kwnames; | |
23031 PyObject **newargs; | |
23032 PyObject **kwvalues; | |
23033 Py_ssize_t i, pos; | |
23034 size_t j; | |
23035 PyObject *key, *value; | |
23036 unsigned long keys_are_strings; | |
23037 Py_ssize_t nkw = PyDict_GET_SIZE(kw); | |
23038 newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); | |
23039 if (unlikely(newargs == NULL)) { | |
23040 PyErr_NoMemory(); | |
23041 return NULL; | |
23042 } | |
23043 for (j = 0; j < nargs; j++) newargs[j] = args[j]; | |
23044 kwnames = PyTuple_New(nkw); | |
23045 if (unlikely(kwnames == NULL)) { | |
23046 PyMem_Free(newargs); | |
23047 return NULL; | |
23048 } | |
23049 kwvalues = newargs + nargs; | |
23050 pos = i = 0; | |
23051 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; | |
23052 while (PyDict_Next(kw, &pos, &key, &value)) { | |
23053 keys_are_strings &= Py_TYPE(key)->tp_flags; | |
23054 Py_INCREF(key); | |
23055 Py_INCREF(value); | |
23056 PyTuple_SET_ITEM(kwnames, i, key); | |
23057 kwvalues[i] = value; | |
23058 i++; | |
23059 } | |
23060 if (unlikely(!keys_are_strings)) { | |
23061 PyErr_SetString(PyExc_TypeError, "keywords must be strings"); | |
23062 goto cleanup; | |
23063 } | |
23064 res = vc(func, newargs, nargs, kwnames); | |
23065 cleanup: | |
23066 Py_DECREF(kwnames); | |
23067 for (i = 0; i < nkw; i++) | |
23068 Py_DECREF(kwvalues[i]); | |
23069 PyMem_Free(newargs); | |
23070 return res; | |
23071 } | |
23072 static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) | |
23073 { | |
23074 if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { | |
23075 return vc(func, args, nargs, NULL); | |
23076 } | |
23077 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); | |
23078 } | |
23079 #endif | |
23080 | |
23081 /* CythonFunctionShared */ | |
23082 #if CYTHON_COMPILING_IN_LIMITED_API | |
23083 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { | |
23084 if (__Pyx_CyFunction_Check(func)) { | |
23085 return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; | |
23086 } else if (PyCFunction_Check(func)) { | |
23087 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; | |
23088 } | |
23089 return 0; | |
23090 } | |
23091 #else | |
23092 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { | |
23093 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; | |
23094 } | |
23095 #endif | |
23096 static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { | |
23097 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API | |
23098 __Pyx_Py_XDECREF_SET( | |
23099 __Pyx_CyFunction_GetClassObj(f), | |
23100 ((classobj) ? __Pyx_NewRef(classobj) : NULL)); | |
23101 #else | |
23102 __Pyx_Py_XDECREF_SET( | |
23103 ((PyCMethodObject *) (f))->mm_class, | |
23104 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); | |
23105 #endif | |
23106 } | |
23107 static PyObject * | |
23108 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) | |
23109 { | |
23110 CYTHON_UNUSED_VAR(closure); | |
23111 if (unlikely(op->func_doc == NULL)) { | |
23112 #if CYTHON_COMPILING_IN_LIMITED_API | |
23113 op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); | |
23114 if (unlikely(!op->func_doc)) return NULL; | |
23115 #else | |
23116 if (((PyCFunctionObject*)op)->m_ml->ml_doc) { | |
23117 #if PY_MAJOR_VERSION >= 3 | |
23118 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); | |
23119 #else | |
23120 op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); | |
23121 #endif | |
23122 if (unlikely(op->func_doc == NULL)) | |
23123 return NULL; | |
23124 } else { | |
23125 Py_INCREF(Py_None); | |
23126 return Py_None; | |
23127 } | |
23128 #endif | |
23129 } | |
23130 Py_INCREF(op->func_doc); | |
23131 return op->func_doc; | |
23132 } | |
23133 static int | |
23134 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) | |
23135 { | |
23136 CYTHON_UNUSED_VAR(context); | |
23137 if (value == NULL) { | |
23138 value = Py_None; | |
23139 } | |
23140 Py_INCREF(value); | |
23141 __Pyx_Py_XDECREF_SET(op->func_doc, value); | |
23142 return 0; | |
23143 } | |
23144 static PyObject * | |
23145 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) | |
23146 { | |
23147 CYTHON_UNUSED_VAR(context); | |
23148 if (unlikely(op->func_name == NULL)) { | |
23149 #if CYTHON_COMPILING_IN_LIMITED_API | |
23150 op->func_name = PyObject_GetAttrString(op->func, "__name__"); | |
23151 #elif PY_MAJOR_VERSION >= 3 | |
23152 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); | |
23153 #else | |
23154 op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); | |
23155 #endif | |
23156 if (unlikely(op->func_name == NULL)) | |
23157 return NULL; | |
23158 } | |
23159 Py_INCREF(op->func_name); | |
23160 return op->func_name; | |
23161 } | |
23162 static int | |
23163 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) | |
23164 { | |
23165 CYTHON_UNUSED_VAR(context); | |
23166 #if PY_MAJOR_VERSION >= 3 | |
23167 if (unlikely(value == NULL || !PyUnicode_Check(value))) | |
23168 #else | |
23169 if (unlikely(value == NULL || !PyString_Check(value))) | |
23170 #endif | |
23171 { | |
23172 PyErr_SetString(PyExc_TypeError, | |
23173 "__name__ must be set to a string object"); | |
23174 return -1; | |
23175 } | |
23176 Py_INCREF(value); | |
23177 __Pyx_Py_XDECREF_SET(op->func_name, value); | |
23178 return 0; | |
23179 } | |
23180 static PyObject * | |
23181 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) | |
23182 { | |
23183 CYTHON_UNUSED_VAR(context); | |
23184 Py_INCREF(op->func_qualname); | |
23185 return op->func_qualname; | |
23186 } | |
23187 static int | |
23188 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) | |
23189 { | |
23190 CYTHON_UNUSED_VAR(context); | |
23191 #if PY_MAJOR_VERSION >= 3 | |
23192 if (unlikely(value == NULL || !PyUnicode_Check(value))) | |
23193 #else | |
23194 if (unlikely(value == NULL || !PyString_Check(value))) | |
23195 #endif | |
23196 { | |
23197 PyErr_SetString(PyExc_TypeError, | |
23198 "__qualname__ must be set to a string object"); | |
23199 return -1; | |
23200 } | |
23201 Py_INCREF(value); | |
23202 __Pyx_Py_XDECREF_SET(op->func_qualname, value); | |
23203 return 0; | |
23204 } | |
23205 static PyObject * | |
23206 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) | |
23207 { | |
23208 CYTHON_UNUSED_VAR(context); | |
23209 if (unlikely(op->func_dict == NULL)) { | |
23210 op->func_dict = PyDict_New(); | |
23211 if (unlikely(op->func_dict == NULL)) | |
23212 return NULL; | |
23213 } | |
23214 Py_INCREF(op->func_dict); | |
23215 return op->func_dict; | |
23216 } | |
23217 static int | |
23218 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) | |
23219 { | |
23220 CYTHON_UNUSED_VAR(context); | |
23221 if (unlikely(value == NULL)) { | |
23222 PyErr_SetString(PyExc_TypeError, | |
23223 "function's dictionary may not be deleted"); | |
23224 return -1; | |
23225 } | |
23226 if (unlikely(!PyDict_Check(value))) { | |
23227 PyErr_SetString(PyExc_TypeError, | |
23228 "setting function's dictionary to a non-dict"); | |
23229 return -1; | |
23230 } | |
23231 Py_INCREF(value); | |
23232 __Pyx_Py_XDECREF_SET(op->func_dict, value); | |
23233 return 0; | |
23234 } | |
23235 static PyObject * | |
23236 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) | |
23237 { | |
23238 CYTHON_UNUSED_VAR(context); | |
23239 Py_INCREF(op->func_globals); | |
23240 return op->func_globals; | |
23241 } | |
23242 static PyObject * | |
23243 __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) | |
23244 { | |
23245 CYTHON_UNUSED_VAR(op); | |
23246 CYTHON_UNUSED_VAR(context); | |
23247 Py_INCREF(Py_None); | |
23248 return Py_None; | |
23249 } | |
23250 static PyObject * | |
23251 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) | |
23252 { | |
23253 PyObject* result = (op->func_code) ? op->func_code : Py_None; | |
23254 CYTHON_UNUSED_VAR(context); | |
23255 Py_INCREF(result); | |
23256 return result; | |
23257 } | |
23258 static int | |
23259 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { | |
23260 int result = 0; | |
23261 PyObject *res = op->defaults_getter((PyObject *) op); | |
23262 if (unlikely(!res)) | |
23263 return -1; | |
23264 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
23265 op->defaults_tuple = PyTuple_GET_ITEM(res, 0); | |
23266 Py_INCREF(op->defaults_tuple); | |
23267 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); | |
23268 Py_INCREF(op->defaults_kwdict); | |
23269 #else | |
23270 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); | |
23271 if (unlikely(!op->defaults_tuple)) result = -1; | |
23272 else { | |
23273 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); | |
23274 if (unlikely(!op->defaults_kwdict)) result = -1; | |
23275 } | |
23276 #endif | |
23277 Py_DECREF(res); | |
23278 return result; | |
23279 } | |
23280 static int | |
23281 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { | |
23282 CYTHON_UNUSED_VAR(context); | |
23283 if (!value) { | |
23284 value = Py_None; | |
23285 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { | |
23286 PyErr_SetString(PyExc_TypeError, | |
23287 "__defaults__ must be set to a tuple object"); | |
23288 return -1; | |
23289 } | |
23290 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " | |
23291 "currently affect the values used in function calls", 1); | |
23292 Py_INCREF(value); | |
23293 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); | |
23294 return 0; | |
23295 } | |
23296 static PyObject * | |
23297 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { | |
23298 PyObject* result = op->defaults_tuple; | |
23299 CYTHON_UNUSED_VAR(context); | |
23300 if (unlikely(!result)) { | |
23301 if (op->defaults_getter) { | |
23302 if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; | |
23303 result = op->defaults_tuple; | |
23304 } else { | |
23305 result = Py_None; | |
23306 } | |
23307 } | |
23308 Py_INCREF(result); | |
23309 return result; | |
23310 } | |
23311 static int | |
23312 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { | |
23313 CYTHON_UNUSED_VAR(context); | |
23314 if (!value) { | |
23315 value = Py_None; | |
23316 } else if (unlikely(value != Py_None && !PyDict_Check(value))) { | |
23317 PyErr_SetString(PyExc_TypeError, | |
23318 "__kwdefaults__ must be set to a dict object"); | |
23319 return -1; | |
23320 } | |
23321 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " | |
23322 "currently affect the values used in function calls", 1); | |
23323 Py_INCREF(value); | |
23324 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); | |
23325 return 0; | |
23326 } | |
23327 static PyObject * | |
23328 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { | |
23329 PyObject* result = op->defaults_kwdict; | |
23330 CYTHON_UNUSED_VAR(context); | |
23331 if (unlikely(!result)) { | |
23332 if (op->defaults_getter) { | |
23333 if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; | |
23334 result = op->defaults_kwdict; | |
23335 } else { | |
23336 result = Py_None; | |
23337 } | |
23338 } | |
23339 Py_INCREF(result); | |
23340 return result; | |
23341 } | |
23342 static int | |
23343 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { | |
23344 CYTHON_UNUSED_VAR(context); | |
23345 if (!value || value == Py_None) { | |
23346 value = NULL; | |
23347 } else if (unlikely(!PyDict_Check(value))) { | |
23348 PyErr_SetString(PyExc_TypeError, | |
23349 "__annotations__ must be set to a dict object"); | |
23350 return -1; | |
23351 } | |
23352 Py_XINCREF(value); | |
23353 __Pyx_Py_XDECREF_SET(op->func_annotations, value); | |
23354 return 0; | |
23355 } | |
23356 static PyObject * | |
23357 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { | |
23358 PyObject* result = op->func_annotations; | |
23359 CYTHON_UNUSED_VAR(context); | |
23360 if (unlikely(!result)) { | |
23361 result = PyDict_New(); | |
23362 if (unlikely(!result)) return NULL; | |
23363 op->func_annotations = result; | |
23364 } | |
23365 Py_INCREF(result); | |
23366 return result; | |
23367 } | |
23368 static PyObject * | |
23369 __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { | |
23370 int is_coroutine; | |
23371 CYTHON_UNUSED_VAR(context); | |
23372 if (op->func_is_coroutine) { | |
23373 return __Pyx_NewRef(op->func_is_coroutine); | |
23374 } | |
23375 is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; | |
23376 #if PY_VERSION_HEX >= 0x03050000 | |
23377 if (is_coroutine) { | |
23378 PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; | |
23379 fromlist = PyList_New(1); | |
23380 if (unlikely(!fromlist)) return NULL; | |
23381 Py_INCREF(marker); | |
23382 #if CYTHON_ASSUME_SAFE_MACROS | |
23383 PyList_SET_ITEM(fromlist, 0, marker); | |
23384 #else | |
23385 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { | |
23386 Py_DECREF(marker); | |
23387 Py_DECREF(fromlist); | |
23388 return NULL; | |
23389 } | |
23390 #endif | |
23391 module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); | |
23392 Py_DECREF(fromlist); | |
23393 if (unlikely(!module)) goto ignore; | |
23394 op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); | |
23395 Py_DECREF(module); | |
23396 if (likely(op->func_is_coroutine)) { | |
23397 return __Pyx_NewRef(op->func_is_coroutine); | |
23398 } | |
23399 ignore: | |
23400 PyErr_Clear(); | |
23401 } | |
23402 #endif | |
23403 op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); | |
23404 return __Pyx_NewRef(op->func_is_coroutine); | |
23405 } | |
23406 #if CYTHON_COMPILING_IN_LIMITED_API | |
23407 static PyObject * | |
23408 __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { | |
23409 CYTHON_UNUSED_VAR(context); | |
23410 return PyObject_GetAttrString(op->func, "__module__"); | |
23411 } | |
23412 static int | |
23413 __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { | |
23414 CYTHON_UNUSED_VAR(context); | |
23415 return PyObject_SetAttrString(op->func, "__module__", value); | |
23416 } | |
23417 #endif | |
23418 static PyGetSetDef __pyx_CyFunction_getsets[] = { | |
23419 {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, | |
23420 {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, | |
23421 {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, | |
23422 {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, | |
23423 {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, | |
23424 {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, | |
23425 {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, | |
23426 {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, | |
23427 {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, | |
23428 {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, | |
23429 {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, | |
23430 {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, | |
23431 {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, | |
23432 {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, | |
23433 {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, | |
23434 {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, | |
23435 {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, | |
23436 {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, | |
23437 #if CYTHON_COMPILING_IN_LIMITED_API | |
23438 {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, | |
23439 #endif | |
23440 {0, 0, 0, 0, 0} | |
23441 }; | |
23442 static PyMemberDef __pyx_CyFunction_members[] = { | |
23443 #if !CYTHON_COMPILING_IN_LIMITED_API | |
23444 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, | |
23445 #endif | |
23446 #if CYTHON_USE_TYPE_SPECS | |
23447 {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, | |
23448 #if CYTHON_METH_FASTCALL | |
23449 #if CYTHON_BACKPORT_VECTORCALL | |
23450 {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, | |
23451 #else | |
23452 #if !CYTHON_COMPILING_IN_LIMITED_API | |
23453 {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, | |
23454 #endif | |
23455 #endif | |
23456 #endif | |
23457 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API | |
23458 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, | |
23459 #else | |
23460 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, | |
23461 #endif | |
23462 #endif | |
23463 {0, 0, 0, 0, 0} | |
23464 }; | |
23465 static PyObject * | |
23466 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) | |
23467 { | |
23468 CYTHON_UNUSED_VAR(args); | |
23469 #if PY_MAJOR_VERSION >= 3 | |
23470 Py_INCREF(m->func_qualname); | |
23471 return m->func_qualname; | |
23472 #else | |
23473 return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); | |
23474 #endif | |
23475 } | |
23476 static PyMethodDef __pyx_CyFunction_methods[] = { | |
23477 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, | |
23478 {0, 0, 0, 0} | |
23479 }; | |
23480 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API | |
23481 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) | |
23482 #else | |
23483 #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) | |
23484 #endif | |
23485 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, | |
23486 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { | |
23487 #if !CYTHON_COMPILING_IN_LIMITED_API | |
23488 PyCFunctionObject *cf = (PyCFunctionObject*) op; | |
23489 #endif | |
23490 if (unlikely(op == NULL)) | |
23491 return NULL; | |
23492 #if CYTHON_COMPILING_IN_LIMITED_API | |
23493 op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); | |
23494 if (unlikely(!op->func)) return NULL; | |
23495 #endif | |
23496 op->flags = flags; | |
23497 __Pyx_CyFunction_weakreflist(op) = NULL; | |
23498 #if !CYTHON_COMPILING_IN_LIMITED_API | |
23499 cf->m_ml = ml; | |
23500 cf->m_self = (PyObject *) op; | |
23501 #endif | |
23502 Py_XINCREF(closure); | |
23503 op->func_closure = closure; | |
23504 #if !CYTHON_COMPILING_IN_LIMITED_API | |
23505 Py_XINCREF(module); | |
23506 cf->m_module = module; | |
23507 #endif | |
23508 op->func_dict = NULL; | |
23509 op->func_name = NULL; | |
23510 Py_INCREF(qualname); | |
23511 op->func_qualname = qualname; | |
23512 op->func_doc = NULL; | |
23513 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API | |
23514 op->func_classobj = NULL; | |
23515 #else | |
23516 ((PyCMethodObject*)op)->mm_class = NULL; | |
23517 #endif | |
23518 op->func_globals = globals; | |
23519 Py_INCREF(op->func_globals); | |
23520 Py_XINCREF(code); | |
23521 op->func_code = code; | |
23522 op->defaults_pyobjects = 0; | |
23523 op->defaults_size = 0; | |
23524 op->defaults = NULL; | |
23525 op->defaults_tuple = NULL; | |
23526 op->defaults_kwdict = NULL; | |
23527 op->defaults_getter = NULL; | |
23528 op->func_annotations = NULL; | |
23529 op->func_is_coroutine = NULL; | |
23530 #if CYTHON_METH_FASTCALL | |
23531 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { | |
23532 case METH_NOARGS: | |
23533 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; | |
23534 break; | |
23535 case METH_O: | |
23536 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; | |
23537 break; | |
23538 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: | |
23539 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; | |
23540 break; | |
23541 case METH_FASTCALL | METH_KEYWORDS: | |
23542 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; | |
23543 break; | |
23544 case METH_VARARGS | METH_KEYWORDS: | |
23545 __Pyx_CyFunction_func_vectorcall(op) = NULL; | |
23546 break; | |
23547 default: | |
23548 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); | |
23549 Py_DECREF(op); | |
23550 return NULL; | |
23551 } | |
23552 #endif | |
23553 return (PyObject *) op; | |
23554 } | |
23555 static int | |
23556 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) | |
23557 { | |
23558 Py_CLEAR(m->func_closure); | |
23559 #if CYTHON_COMPILING_IN_LIMITED_API | |
23560 Py_CLEAR(m->func); | |
23561 #else | |
23562 Py_CLEAR(((PyCFunctionObject*)m)->m_module); | |
23563 #endif | |
23564 Py_CLEAR(m->func_dict); | |
23565 Py_CLEAR(m->func_name); | |
23566 Py_CLEAR(m->func_qualname); | |
23567 Py_CLEAR(m->func_doc); | |
23568 Py_CLEAR(m->func_globals); | |
23569 Py_CLEAR(m->func_code); | |
23570 #if !CYTHON_COMPILING_IN_LIMITED_API | |
23571 #if PY_VERSION_HEX < 0x030900B1 | |
23572 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); | |
23573 #else | |
23574 { | |
23575 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; | |
23576 ((PyCMethodObject *) (m))->mm_class = NULL; | |
23577 Py_XDECREF(cls); | |
23578 } | |
23579 #endif | |
23580 #endif | |
23581 Py_CLEAR(m->defaults_tuple); | |
23582 Py_CLEAR(m->defaults_kwdict); | |
23583 Py_CLEAR(m->func_annotations); | |
23584 Py_CLEAR(m->func_is_coroutine); | |
23585 if (m->defaults) { | |
23586 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); | |
23587 int i; | |
23588 for (i = 0; i < m->defaults_pyobjects; i++) | |
23589 Py_XDECREF(pydefaults[i]); | |
23590 PyObject_Free(m->defaults); | |
23591 m->defaults = NULL; | |
23592 } | |
23593 return 0; | |
23594 } | |
23595 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) | |
23596 { | |
23597 if (__Pyx_CyFunction_weakreflist(m) != NULL) | |
23598 PyObject_ClearWeakRefs((PyObject *) m); | |
23599 __Pyx_CyFunction_clear(m); | |
23600 __Pyx_PyHeapTypeObject_GC_Del(m); | |
23601 } | |
23602 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) | |
23603 { | |
23604 PyObject_GC_UnTrack(m); | |
23605 __Pyx__CyFunction_dealloc(m); | |
23606 } | |
23607 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) | |
23608 { | |
23609 Py_VISIT(m->func_closure); | |
23610 #if CYTHON_COMPILING_IN_LIMITED_API | |
23611 Py_VISIT(m->func); | |
23612 #else | |
23613 Py_VISIT(((PyCFunctionObject*)m)->m_module); | |
23614 #endif | |
23615 Py_VISIT(m->func_dict); | |
23616 Py_VISIT(m->func_name); | |
23617 Py_VISIT(m->func_qualname); | |
23618 Py_VISIT(m->func_doc); | |
23619 Py_VISIT(m->func_globals); | |
23620 Py_VISIT(m->func_code); | |
23621 #if !CYTHON_COMPILING_IN_LIMITED_API | |
23622 Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); | |
23623 #endif | |
23624 Py_VISIT(m->defaults_tuple); | |
23625 Py_VISIT(m->defaults_kwdict); | |
23626 Py_VISIT(m->func_is_coroutine); | |
23627 if (m->defaults) { | |
23628 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); | |
23629 int i; | |
23630 for (i = 0; i < m->defaults_pyobjects; i++) | |
23631 Py_VISIT(pydefaults[i]); | |
23632 } | |
23633 return 0; | |
23634 } | |
23635 static PyObject* | |
23636 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) | |
23637 { | |
23638 #if PY_MAJOR_VERSION >= 3 | |
23639 return PyUnicode_FromFormat("<cyfunction %U at %p>", | |
23640 op->func_qualname, (void *)op); | |
23641 #else | |
23642 return PyString_FromFormat("<cyfunction %s at %p>", | |
23643 PyString_AsString(op->func_qualname), (void *)op); | |
23644 #endif | |
23645 } | |
23646 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { | |
23647 #if CYTHON_COMPILING_IN_LIMITED_API | |
23648 PyObject *f = ((__pyx_CyFunctionObject*)func)->func; | |
23649 PyObject *py_name = NULL; | |
23650 PyCFunction meth; | |
23651 int flags; | |
23652 meth = PyCFunction_GetFunction(f); | |
23653 if (unlikely(!meth)) return NULL; | |
23654 flags = PyCFunction_GetFlags(f); | |
23655 if (unlikely(flags < 0)) return NULL; | |
23656 #else | |
23657 PyCFunctionObject* f = (PyCFunctionObject*)func; | |
23658 PyCFunction meth = f->m_ml->ml_meth; | |
23659 int flags = f->m_ml->ml_flags; | |
23660 #endif | |
23661 Py_ssize_t size; | |
23662 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { | |
23663 case METH_VARARGS: | |
23664 if (likely(kw == NULL || PyDict_Size(kw) == 0)) | |
23665 return (*meth)(self, arg); | |
23666 break; | |
23667 case METH_VARARGS | METH_KEYWORDS: | |
23668 return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); | |
23669 case METH_NOARGS: | |
23670 if (likely(kw == NULL || PyDict_Size(kw) == 0)) { | |
23671 #if CYTHON_ASSUME_SAFE_MACROS | |
23672 size = PyTuple_GET_SIZE(arg); | |
23673 #else | |
23674 size = PyTuple_Size(arg); | |
23675 if (unlikely(size < 0)) return NULL; | |
23676 #endif | |
23677 if (likely(size == 0)) | |
23678 return (*meth)(self, NULL); | |
23679 #if CYTHON_COMPILING_IN_LIMITED_API | |
23680 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); | |
23681 if (!py_name) return NULL; | |
23682 PyErr_Format(PyExc_TypeError, | |
23683 "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
23684 py_name, size); | |
23685 Py_DECREF(py_name); | |
23686 #else | |
23687 PyErr_Format(PyExc_TypeError, | |
23688 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
23689 f->m_ml->ml_name, size); | |
23690 #endif | |
23691 return NULL; | |
23692 } | |
23693 break; | |
23694 case METH_O: | |
23695 if (likely(kw == NULL || PyDict_Size(kw) == 0)) { | |
23696 #if CYTHON_ASSUME_SAFE_MACROS | |
23697 size = PyTuple_GET_SIZE(arg); | |
23698 #else | |
23699 size = PyTuple_Size(arg); | |
23700 if (unlikely(size < 0)) return NULL; | |
23701 #endif | |
23702 if (likely(size == 1)) { | |
23703 PyObject *result, *arg0; | |
23704 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS | |
23705 arg0 = PyTuple_GET_ITEM(arg, 0); | |
23706 #else | |
23707 arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; | |
23708 #endif | |
23709 result = (*meth)(self, arg0); | |
23710 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) | |
23711 Py_DECREF(arg0); | |
23712 #endif | |
23713 return result; | |
23714 } | |
23715 #if CYTHON_COMPILING_IN_LIMITED_API | |
23716 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); | |
23717 if (!py_name) return NULL; | |
23718 PyErr_Format(PyExc_TypeError, | |
23719 "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
23720 py_name, size); | |
23721 Py_DECREF(py_name); | |
23722 #else | |
23723 PyErr_Format(PyExc_TypeError, | |
23724 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
23725 f->m_ml->ml_name, size); | |
23726 #endif | |
23727 return NULL; | |
23728 } | |
23729 break; | |
23730 default: | |
23731 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); | |
23732 return NULL; | |
23733 } | |
23734 #if CYTHON_COMPILING_IN_LIMITED_API | |
23735 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); | |
23736 if (!py_name) return NULL; | |
23737 PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", | |
23738 py_name); | |
23739 Py_DECREF(py_name); | |
23740 #else | |
23741 PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", | |
23742 f->m_ml->ml_name); | |
23743 #endif | |
23744 return NULL; | |
23745 } | |
23746 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { | |
23747 PyObject *self, *result; | |
23748 #if CYTHON_COMPILING_IN_LIMITED_API | |
23749 self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); | |
23750 if (unlikely(!self) && PyErr_Occurred()) return NULL; | |
23751 #else | |
23752 self = ((PyCFunctionObject*)func)->m_self; | |
23753 #endif | |
23754 result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); | |
23755 return result; | |
23756 } | |
23757 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { | |
23758 PyObject *result; | |
23759 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; | |
23760 #if CYTHON_METH_FASTCALL | |
23761 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); | |
23762 if (vc) { | |
23763 #if CYTHON_ASSUME_SAFE_MACROS | |
23764 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); | |
23765 #else | |
23766 (void) &__Pyx_PyVectorcall_FastCallDict; | |
23767 return PyVectorcall_Call(func, args, kw); | |
23768 #endif | |
23769 } | |
23770 #endif | |
23771 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { | |
23772 Py_ssize_t argc; | |
23773 PyObject *new_args; | |
23774 PyObject *self; | |
23775 #if CYTHON_ASSUME_SAFE_MACROS | |
23776 argc = PyTuple_GET_SIZE(args); | |
23777 #else | |
23778 argc = PyTuple_Size(args); | |
23779 if (unlikely(!argc) < 0) return NULL; | |
23780 #endif | |
23781 new_args = PyTuple_GetSlice(args, 1, argc); | |
23782 if (unlikely(!new_args)) | |
23783 return NULL; | |
23784 self = PyTuple_GetItem(args, 0); | |
23785 if (unlikely(!self)) { | |
23786 Py_DECREF(new_args); | |
23787 #if PY_MAJOR_VERSION > 2 | |
23788 PyErr_Format(PyExc_TypeError, | |
23789 "unbound method %.200S() needs an argument", | |
23790 cyfunc->func_qualname); | |
23791 #else | |
23792 PyErr_SetString(PyExc_TypeError, | |
23793 "unbound method needs an argument"); | |
23794 #endif | |
23795 return NULL; | |
23796 } | |
23797 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); | |
23798 Py_DECREF(new_args); | |
23799 } else { | |
23800 result = __Pyx_CyFunction_Call(func, args, kw); | |
23801 } | |
23802 return result; | |
23803 } | |
23804 #if CYTHON_METH_FASTCALL | |
23805 static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) | |
23806 { | |
23807 int ret = 0; | |
23808 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { | |
23809 if (unlikely(nargs < 1)) { | |
23810 PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", | |
23811 ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); | |
23812 return -1; | |
23813 } | |
23814 ret = 1; | |
23815 } | |
23816 if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { | |
23817 PyErr_Format(PyExc_TypeError, | |
23818 "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); | |
23819 return -1; | |
23820 } | |
23821 return ret; | |
23822 } | |
23823 static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) | |
23824 { | |
23825 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; | |
23826 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; | |
23827 #if CYTHON_BACKPORT_VECTORCALL | |
23828 Py_ssize_t nargs = (Py_ssize_t)nargsf; | |
23829 #else | |
23830 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); | |
23831 #endif | |
23832 PyObject *self; | |
23833 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { | |
23834 case 1: | |
23835 self = args[0]; | |
23836 args += 1; | |
23837 nargs -= 1; | |
23838 break; | |
23839 case 0: | |
23840 self = ((PyCFunctionObject*)cyfunc)->m_self; | |
23841 break; | |
23842 default: | |
23843 return NULL; | |
23844 } | |
23845 if (unlikely(nargs != 0)) { | |
23846 PyErr_Format(PyExc_TypeError, | |
23847 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
23848 def->ml_name, nargs); | |
23849 return NULL; | |
23850 } | |
23851 return def->ml_meth(self, NULL); | |
23852 } | |
23853 static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) | |
23854 { | |
23855 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; | |
23856 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; | |
23857 #if CYTHON_BACKPORT_VECTORCALL | |
23858 Py_ssize_t nargs = (Py_ssize_t)nargsf; | |
23859 #else | |
23860 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); | |
23861 #endif | |
23862 PyObject *self; | |
23863 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { | |
23864 case 1: | |
23865 self = args[0]; | |
23866 args += 1; | |
23867 nargs -= 1; | |
23868 break; | |
23869 case 0: | |
23870 self = ((PyCFunctionObject*)cyfunc)->m_self; | |
23871 break; | |
23872 default: | |
23873 return NULL; | |
23874 } | |
23875 if (unlikely(nargs != 1)) { | |
23876 PyErr_Format(PyExc_TypeError, | |
23877 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
23878 def->ml_name, nargs); | |
23879 return NULL; | |
23880 } | |
23881 return def->ml_meth(self, args[0]); | |
23882 } | |
23883 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) | |
23884 { | |
23885 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; | |
23886 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; | |
23887 #if CYTHON_BACKPORT_VECTORCALL | |
23888 Py_ssize_t nargs = (Py_ssize_t)nargsf; | |
23889 #else | |
23890 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); | |
23891 #endif | |
23892 PyObject *self; | |
23893 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { | |
23894 case 1: | |
23895 self = args[0]; | |
23896 args += 1; | |
23897 nargs -= 1; | |
23898 break; | |
23899 case 0: | |
23900 self = ((PyCFunctionObject*)cyfunc)->m_self; | |
23901 break; | |
23902 default: | |
23903 return NULL; | |
23904 } | |
23905 return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); | |
23906 } | |
23907 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) | |
23908 { | |
23909 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; | |
23910 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; | |
23911 PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); | |
23912 #if CYTHON_BACKPORT_VECTORCALL | |
23913 Py_ssize_t nargs = (Py_ssize_t)nargsf; | |
23914 #else | |
23915 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); | |
23916 #endif | |
23917 PyObject *self; | |
23918 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { | |
23919 case 1: | |
23920 self = args[0]; | |
23921 args += 1; | |
23922 nargs -= 1; | |
23923 break; | |
23924 case 0: | |
23925 self = ((PyCFunctionObject*)cyfunc)->m_self; | |
23926 break; | |
23927 default: | |
23928 return NULL; | |
23929 } | |
23930 return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); | |
23931 } | |
23932 #endif | |
23933 #if CYTHON_USE_TYPE_SPECS | |
23934 static PyType_Slot __pyx_CyFunctionType_slots[] = { | |
23935 {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, | |
23936 {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, | |
23937 {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, | |
23938 {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, | |
23939 {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, | |
23940 {Py_tp_methods, (void *)__pyx_CyFunction_methods}, | |
23941 {Py_tp_members, (void *)__pyx_CyFunction_members}, | |
23942 {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, | |
23943 {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, | |
23944 {0, 0}, | |
23945 }; | |
23946 static PyType_Spec __pyx_CyFunctionType_spec = { | |
23947 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", | |
23948 sizeof(__pyx_CyFunctionObject), | |
23949 0, | |
23950 #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR | |
23951 Py_TPFLAGS_METHOD_DESCRIPTOR | | |
23952 #endif | |
23953 #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) | |
23954 _Py_TPFLAGS_HAVE_VECTORCALL | | |
23955 #endif | |
23956 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, | |
23957 __pyx_CyFunctionType_slots | |
23958 }; | |
23959 #else | |
23960 static PyTypeObject __pyx_CyFunctionType_type = { | |
23961 PyVarObject_HEAD_INIT(0, 0) | |
23962 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", | |
23963 sizeof(__pyx_CyFunctionObject), | |
23964 0, | |
23965 (destructor) __Pyx_CyFunction_dealloc, | |
23966 #if !CYTHON_METH_FASTCALL | |
23967 0, | |
23968 #elif CYTHON_BACKPORT_VECTORCALL | |
23969 (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), | |
23970 #else | |
23971 offsetof(PyCFunctionObject, vectorcall), | |
23972 #endif | |
23973 0, | |
23974 0, | |
23975 #if PY_MAJOR_VERSION < 3 | |
23976 0, | |
23977 #else | |
23978 0, | |
23979 #endif | |
23980 (reprfunc) __Pyx_CyFunction_repr, | |
23981 0, | |
23982 0, | |
23983 0, | |
23984 0, | |
23985 __Pyx_CyFunction_CallAsMethod, | |
23986 0, | |
23987 0, | |
23988 0, | |
23989 0, | |
23990 #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR | |
23991 Py_TPFLAGS_METHOD_DESCRIPTOR | | |
23992 #endif | |
23993 #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL | |
23994 _Py_TPFLAGS_HAVE_VECTORCALL | | |
23995 #endif | |
23996 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, | |
23997 0, | |
23998 (traverseproc) __Pyx_CyFunction_traverse, | |
23999 (inquiry) __Pyx_CyFunction_clear, | |
24000 0, | |
24001 #if PY_VERSION_HEX < 0x030500A0 | |
24002 offsetof(__pyx_CyFunctionObject, func_weakreflist), | |
24003 #else | |
24004 offsetof(PyCFunctionObject, m_weakreflist), | |
24005 #endif | |
24006 0, | |
24007 0, | |
24008 __pyx_CyFunction_methods, | |
24009 __pyx_CyFunction_members, | |
24010 __pyx_CyFunction_getsets, | |
24011 0, | |
24012 0, | |
24013 __Pyx_PyMethod_New, | |
24014 0, | |
24015 offsetof(__pyx_CyFunctionObject, func_dict), | |
24016 0, | |
24017 0, | |
24018 0, | |
24019 0, | |
24020 0, | |
24021 0, | |
24022 0, | |
24023 0, | |
24024 0, | |
24025 0, | |
24026 0, | |
24027 0, | |
24028 #if PY_VERSION_HEX >= 0x030400a1 | |
24029 0, | |
24030 #endif | |
24031 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) | |
24032 0, | |
24033 #endif | |
24034 #if __PYX_NEED_TP_PRINT_SLOT | |
24035 0, | |
24036 #endif | |
24037 #if PY_VERSION_HEX >= 0x030C0000 | |
24038 0, | |
24039 #endif | |
24040 #if PY_VERSION_HEX >= 0x030d00A4 | |
24041 0, | |
24042 #endif | |
24043 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 | |
24044 0, | |
24045 #endif | |
24046 }; | |
24047 #endif | |
24048 static int __pyx_CyFunction_init(PyObject *module) { | |
24049 #if CYTHON_USE_TYPE_SPECS | |
24050 __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); | |
24051 #else | |
24052 CYTHON_UNUSED_VAR(module); | |
24053 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); | |
24054 #endif | |
24055 if (unlikely(__pyx_CyFunctionType == NULL)) { | |
24056 return -1; | |
24057 } | |
24058 return 0; | |
24059 } | |
24060 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { | |
24061 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
24062 m->defaults = PyObject_Malloc(size); | |
24063 if (unlikely(!m->defaults)) | |
24064 return PyErr_NoMemory(); | |
24065 memset(m->defaults, 0, size); | |
24066 m->defaults_pyobjects = pyobjects; | |
24067 m->defaults_size = size; | |
24068 return m->defaults; | |
24069 } | |
24070 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { | |
24071 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
24072 m->defaults_tuple = tuple; | |
24073 Py_INCREF(tuple); | |
24074 } | |
24075 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { | |
24076 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
24077 m->defaults_kwdict = dict; | |
24078 Py_INCREF(dict); | |
24079 } | |
24080 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { | |
24081 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
24082 m->func_annotations = dict; | |
24083 Py_INCREF(dict); | |
24084 } | |
24085 | |
24086 /* CythonFunction */ | |
24087 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, | |
24088 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { | |
24089 PyObject *op = __Pyx_CyFunction_Init( | |
24090 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), | |
24091 ml, flags, qualname, closure, module, globals, code | |
24092 ); | |
24093 if (likely(op)) { | |
24094 PyObject_GC_Track(op); | |
24095 } | |
24096 return op; | |
24097 } | |
24098 | |
24099 /* CLineInTraceback */ | |
24100 #ifndef CYTHON_CLINE_IN_TRACEBACK | |
24101 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { | |
24102 PyObject *use_cline; | |
24103 PyObject *ptype, *pvalue, *ptraceback; | |
24104 #if CYTHON_COMPILING_IN_CPYTHON | |
24105 PyObject **cython_runtime_dict; | |
24106 #endif | |
24107 CYTHON_MAYBE_UNUSED_VAR(tstate); | |
24108 if (unlikely(!__pyx_cython_runtime)) { | |
24109 return c_line; | |
24110 } | |
24111 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); | |
24112 #if CYTHON_COMPILING_IN_CPYTHON | |
24113 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); | |
24114 if (likely(cython_runtime_dict)) { | |
24115 __PYX_PY_DICT_LOOKUP_IF_MODIFIED( | |
24116 use_cline, *cython_runtime_dict, | |
24117 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) | |
24118 } else | |
24119 #endif | |
24120 { | |
24121 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); | |
24122 if (use_cline_obj) { | |
24123 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; | |
24124 Py_DECREF(use_cline_obj); | |
24125 } else { | |
24126 PyErr_Clear(); | |
24127 use_cline = NULL; | |
24128 } | |
24129 } | |
24130 if (!use_cline) { | |
24131 c_line = 0; | |
24132 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); | |
24133 } | |
24134 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { | |
24135 c_line = 0; | |
24136 } | |
24137 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); | |
24138 return c_line; | |
24139 } | |
24140 #endif | |
24141 | |
24142 /* CodeObjectCache */ | |
24143 #if !CYTHON_COMPILING_IN_LIMITED_API | |
24144 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { | |
24145 int start = 0, mid = 0, end = count - 1; | |
24146 if (end >= 0 && code_line > entries[end].code_line) { | |
24147 return count; | |
24148 } | |
24149 while (start < end) { | |
24150 mid = start + (end - start) / 2; | |
24151 if (code_line < entries[mid].code_line) { | |
24152 end = mid; | |
24153 } else if (code_line > entries[mid].code_line) { | |
24154 start = mid + 1; | |
24155 } else { | |
24156 return mid; | |
24157 } | |
24158 } | |
24159 if (code_line <= entries[mid].code_line) { | |
24160 return mid; | |
24161 } else { | |
24162 return mid + 1; | |
24163 } | |
24164 } | |
24165 static PyCodeObject *__pyx_find_code_object(int code_line) { | |
24166 PyCodeObject* code_object; | |
24167 int pos; | |
24168 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { | |
24169 return NULL; | |
24170 } | |
24171 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); | |
24172 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { | |
24173 return NULL; | |
24174 } | |
24175 code_object = __pyx_code_cache.entries[pos].code_object; | |
24176 Py_INCREF(code_object); | |
24177 return code_object; | |
24178 } | |
24179 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { | |
24180 int pos, i; | |
24181 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; | |
24182 if (unlikely(!code_line)) { | |
24183 return; | |
24184 } | |
24185 if (unlikely(!entries)) { | |
24186 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); | |
24187 if (likely(entries)) { | |
24188 __pyx_code_cache.entries = entries; | |
24189 __pyx_code_cache.max_count = 64; | |
24190 __pyx_code_cache.count = 1; | |
24191 entries[0].code_line = code_line; | |
24192 entries[0].code_object = code_object; | |
24193 Py_INCREF(code_object); | |
24194 } | |
24195 return; | |
24196 } | |
24197 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); | |
24198 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { | |
24199 PyCodeObject* tmp = entries[pos].code_object; | |
24200 entries[pos].code_object = code_object; | |
24201 Py_DECREF(tmp); | |
24202 return; | |
24203 } | |
24204 if (__pyx_code_cache.count == __pyx_code_cache.max_count) { | |
24205 int new_max = __pyx_code_cache.max_count + 64; | |
24206 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( | |
24207 __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); | |
24208 if (unlikely(!entries)) { | |
24209 return; | |
24210 } | |
24211 __pyx_code_cache.entries = entries; | |
24212 __pyx_code_cache.max_count = new_max; | |
24213 } | |
24214 for (i=__pyx_code_cache.count; i>pos; i--) { | |
24215 entries[i] = entries[i-1]; | |
24216 } | |
24217 entries[pos].code_line = code_line; | |
24218 entries[pos].code_object = code_object; | |
24219 __pyx_code_cache.count++; | |
24220 Py_INCREF(code_object); | |
24221 } | |
24222 #endif | |
24223 | |
24224 /* AddTraceback */ | |
24225 #include "compile.h" | |
24226 #include "frameobject.h" | |
24227 #include "traceback.h" | |
24228 #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API | |
24229 #ifndef Py_BUILD_CORE | |
24230 #define Py_BUILD_CORE 1 | |
24231 #endif | |
24232 #include "internal/pycore_frame.h" | |
24233 #endif | |
24234 #if CYTHON_COMPILING_IN_LIMITED_API | |
24235 static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, | |
24236 PyObject *firstlineno, PyObject *name) { | |
24237 PyObject *replace = NULL; | |
24238 if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; | |
24239 if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; | |
24240 replace = PyObject_GetAttrString(code, "replace"); | |
24241 if (likely(replace)) { | |
24242 PyObject *result; | |
24243 result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); | |
24244 Py_DECREF(replace); | |
24245 return result; | |
24246 } | |
24247 PyErr_Clear(); | |
24248 #if __PYX_LIMITED_VERSION_HEX < 0x030780000 | |
24249 { | |
24250 PyObject *compiled = NULL, *result = NULL; | |
24251 if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; | |
24252 if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; | |
24253 compiled = Py_CompileString( | |
24254 "out = type(code)(\n" | |
24255 " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" | |
24256 " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" | |
24257 " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" | |
24258 " code.co_lnotab)\n", "<dummy>", Py_file_input); | |
24259 if (!compiled) return NULL; | |
24260 result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); | |
24261 Py_DECREF(compiled); | |
24262 if (!result) PyErr_Print(); | |
24263 Py_DECREF(result); | |
24264 result = PyDict_GetItemString(scratch_dict, "out"); | |
24265 if (result) Py_INCREF(result); | |
24266 return result; | |
24267 } | |
24268 #else | |
24269 return NULL; | |
24270 #endif | |
24271 } | |
24272 static void __Pyx_AddTraceback(const char *funcname, int c_line, | |
24273 int py_line, const char *filename) { | |
24274 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; | |
24275 PyObject *replace = NULL, *getframe = NULL, *frame = NULL; | |
24276 PyObject *exc_type, *exc_value, *exc_traceback; | |
24277 int success = 0; | |
24278 if (c_line) { | |
24279 (void) __pyx_cfilenm; | |
24280 (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); | |
24281 } | |
24282 PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); | |
24283 code_object = Py_CompileString("_getframe()", filename, Py_eval_input); | |
24284 if (unlikely(!code_object)) goto bad; | |
24285 py_py_line = PyLong_FromLong(py_line); | |
24286 if (unlikely(!py_py_line)) goto bad; | |
24287 py_funcname = PyUnicode_FromString(funcname); | |
24288 if (unlikely(!py_funcname)) goto bad; | |
24289 dict = PyDict_New(); | |
24290 if (unlikely(!dict)) goto bad; | |
24291 { | |
24292 PyObject *old_code_object = code_object; | |
24293 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); | |
24294 Py_DECREF(old_code_object); | |
24295 } | |
24296 if (unlikely(!code_object)) goto bad; | |
24297 getframe = PySys_GetObject("_getframe"); | |
24298 if (unlikely(!getframe)) goto bad; | |
24299 if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; | |
24300 frame = PyEval_EvalCode(code_object, dict, dict); | |
24301 if (unlikely(!frame) || frame == Py_None) goto bad; | |
24302 success = 1; | |
24303 bad: | |
24304 PyErr_Restore(exc_type, exc_value, exc_traceback); | |
24305 Py_XDECREF(code_object); | |
24306 Py_XDECREF(py_py_line); | |
24307 Py_XDECREF(py_funcname); | |
24308 Py_XDECREF(dict); | |
24309 Py_XDECREF(replace); | |
24310 if (success) { | |
24311 PyTraceBack_Here( | |
24312 (struct _frame*)frame); | |
24313 } | |
24314 Py_XDECREF(frame); | |
24315 } | |
24316 #else | |
24317 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( | |
24318 const char *funcname, int c_line, | |
24319 int py_line, const char *filename) { | |
24320 PyCodeObject *py_code = NULL; | |
24321 PyObject *py_funcname = NULL; | |
24322 #if PY_MAJOR_VERSION < 3 | |
24323 PyObject *py_srcfile = NULL; | |
24324 py_srcfile = PyString_FromString(filename); | |
24325 if (!py_srcfile) goto bad; | |
24326 #endif | |
24327 if (c_line) { | |
24328 #if PY_MAJOR_VERSION < 3 | |
24329 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); | |
24330 if (!py_funcname) goto bad; | |
24331 #else | |
24332 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); | |
24333 if (!py_funcname) goto bad; | |
24334 funcname = PyUnicode_AsUTF8(py_funcname); | |
24335 if (!funcname) goto bad; | |
24336 #endif | |
24337 } | |
24338 else { | |
24339 #if PY_MAJOR_VERSION < 3 | |
24340 py_funcname = PyString_FromString(funcname); | |
24341 if (!py_funcname) goto bad; | |
24342 #endif | |
24343 } | |
24344 #if PY_MAJOR_VERSION < 3 | |
24345 py_code = __Pyx_PyCode_New( | |
24346 0, | |
24347 0, | |
24348 0, | |
24349 0, | |
24350 0, | |
24351 0, | |
24352 __pyx_empty_bytes, /*PyObject *code,*/ | |
24353 __pyx_empty_tuple, /*PyObject *consts,*/ | |
24354 __pyx_empty_tuple, /*PyObject *names,*/ | |
24355 __pyx_empty_tuple, /*PyObject *varnames,*/ | |
24356 __pyx_empty_tuple, /*PyObject *freevars,*/ | |
24357 __pyx_empty_tuple, /*PyObject *cellvars,*/ | |
24358 py_srcfile, /*PyObject *filename,*/ | |
24359 py_funcname, /*PyObject *name,*/ | |
24360 py_line, | |
24361 __pyx_empty_bytes /*PyObject *lnotab*/ | |
24362 ); | |
24363 Py_DECREF(py_srcfile); | |
24364 #else | |
24365 py_code = PyCode_NewEmpty(filename, funcname, py_line); | |
24366 #endif | |
24367 Py_XDECREF(py_funcname); | |
24368 return py_code; | |
24369 bad: | |
24370 Py_XDECREF(py_funcname); | |
24371 #if PY_MAJOR_VERSION < 3 | |
24372 Py_XDECREF(py_srcfile); | |
24373 #endif | |
24374 return NULL; | |
24375 } | |
24376 static void __Pyx_AddTraceback(const char *funcname, int c_line, | |
24377 int py_line, const char *filename) { | |
24378 PyCodeObject *py_code = 0; | |
24379 PyFrameObject *py_frame = 0; | |
24380 PyThreadState *tstate = __Pyx_PyThreadState_Current; | |
24381 PyObject *ptype, *pvalue, *ptraceback; | |
24382 if (c_line) { | |
24383 c_line = __Pyx_CLineForTraceback(tstate, c_line); | |
24384 } | |
24385 py_code = __pyx_find_code_object(c_line ? -c_line : py_line); | |
24386 if (!py_code) { | |
24387 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); | |
24388 py_code = __Pyx_CreateCodeObjectForTraceback( | |
24389 funcname, c_line, py_line, filename); | |
24390 if (!py_code) { | |
24391 /* If the code object creation fails, then we should clear the | |
24392 fetched exception references and propagate the new exception */ | |
24393 Py_XDECREF(ptype); | |
24394 Py_XDECREF(pvalue); | |
24395 Py_XDECREF(ptraceback); | |
24396 goto bad; | |
24397 } | |
24398 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); | |
24399 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); | |
24400 } | |
24401 py_frame = PyFrame_New( | |
24402 tstate, /*PyThreadState *tstate,*/ | |
24403 py_code, /*PyCodeObject *code,*/ | |
24404 __pyx_d, /*PyObject *globals,*/ | |
24405 0 /*PyObject *locals*/ | |
24406 ); | |
24407 if (!py_frame) goto bad; | |
24408 __Pyx_PyFrame_SetLineNumber(py_frame, py_line); | |
24409 PyTraceBack_Here(py_frame); | |
24410 bad: | |
24411 Py_XDECREF(py_code); | |
24412 Py_XDECREF(py_frame); | |
24413 } | |
24414 #endif | |
24415 | |
24416 /* CIntFromPyVerify */ | |
24417 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ | |
24418 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) | |
24419 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ | |
24420 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) | |
24421 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ | |
24422 {\ | |
24423 func_type value = func_value;\ | |
24424 if (sizeof(target_type) < sizeof(func_type)) {\ | |
24425 if (unlikely(value != (func_type) (target_type) value)) {\ | |
24426 func_type zero = 0;\ | |
24427 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ | |
24428 return (target_type) -1;\ | |
24429 if (is_unsigned && unlikely(value < zero))\ | |
24430 goto raise_neg_overflow;\ | |
24431 else\ | |
24432 goto raise_overflow;\ | |
24433 }\ | |
24434 }\ | |
24435 return (target_type) value;\ | |
24436 } | |
24437 | |
24438 /* CIntFromPy */ | |
24439 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { | |
24440 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
24441 #pragma GCC diagnostic push | |
24442 #pragma GCC diagnostic ignored "-Wconversion" | |
24443 #endif | |
24444 const int neg_one = (int) -1, const_zero = (int) 0; | |
24445 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
24446 #pragma GCC diagnostic pop | |
24447 #endif | |
24448 const int is_unsigned = neg_one > const_zero; | |
24449 #if PY_MAJOR_VERSION < 3 | |
24450 if (likely(PyInt_Check(x))) { | |
24451 if ((sizeof(int) < sizeof(long))) { | |
24452 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) | |
24453 } else { | |
24454 long val = PyInt_AS_LONG(x); | |
24455 if (is_unsigned && unlikely(val < 0)) { | |
24456 goto raise_neg_overflow; | |
24457 } | |
24458 return (int) val; | |
24459 } | |
24460 } | |
24461 #endif | |
24462 if (unlikely(!PyLong_Check(x))) { | |
24463 int val; | |
24464 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); | |
24465 if (!tmp) return (int) -1; | |
24466 val = __Pyx_PyInt_As_int(tmp); | |
24467 Py_DECREF(tmp); | |
24468 return val; | |
24469 } | |
24470 if (is_unsigned) { | |
24471 #if CYTHON_USE_PYLONG_INTERNALS | |
24472 if (unlikely(__Pyx_PyLong_IsNeg(x))) { | |
24473 goto raise_neg_overflow; | |
24474 } else if (__Pyx_PyLong_IsCompact(x)) { | |
24475 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) | |
24476 } else { | |
24477 const digit* digits = __Pyx_PyLong_Digits(x); | |
24478 assert(__Pyx_PyLong_DigitCount(x) > 1); | |
24479 switch (__Pyx_PyLong_DigitCount(x)) { | |
24480 case 2: | |
24481 if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { | |
24482 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
24483 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
24484 } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { | |
24485 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); | |
24486 } | |
24487 } | |
24488 break; | |
24489 case 3: | |
24490 if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { | |
24491 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
24492 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
24493 } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { | |
24494 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); | |
24495 } | |
24496 } | |
24497 break; | |
24498 case 4: | |
24499 if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { | |
24500 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
24501 __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]))) | |
24502 } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { | |
24503 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); | |
24504 } | |
24505 } | |
24506 break; | |
24507 } | |
24508 } | |
24509 #endif | |
24510 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 | |
24511 if (unlikely(Py_SIZE(x) < 0)) { | |
24512 goto raise_neg_overflow; | |
24513 } | |
24514 #else | |
24515 { | |
24516 int result = PyObject_RichCompareBool(x, Py_False, Py_LT); | |
24517 if (unlikely(result < 0)) | |
24518 return (int) -1; | |
24519 if (unlikely(result == 1)) | |
24520 goto raise_neg_overflow; | |
24521 } | |
24522 #endif | |
24523 if ((sizeof(int) <= sizeof(unsigned long))) { | |
24524 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) | |
24525 #ifdef HAVE_LONG_LONG | |
24526 } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { | |
24527 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) | |
24528 #endif | |
24529 } | |
24530 } else { | |
24531 #if CYTHON_USE_PYLONG_INTERNALS | |
24532 if (__Pyx_PyLong_IsCompact(x)) { | |
24533 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) | |
24534 } else { | |
24535 const digit* digits = __Pyx_PyLong_Digits(x); | |
24536 assert(__Pyx_PyLong_DigitCount(x) > 1); | |
24537 switch (__Pyx_PyLong_SignedDigitCount(x)) { | |
24538 case -2: | |
24539 if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { | |
24540 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
24541 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
24542 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { | |
24543 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
24544 } | |
24545 } | |
24546 break; | |
24547 case 2: | |
24548 if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { | |
24549 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
24550 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
24551 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { | |
24552 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
24553 } | |
24554 } | |
24555 break; | |
24556 case -3: | |
24557 if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { | |
24558 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
24559 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
24560 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { | |
24561 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
24562 } | |
24563 } | |
24564 break; | |
24565 case 3: | |
24566 if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { | |
24567 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
24568 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
24569 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { | |
24570 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
24571 } | |
24572 } | |
24573 break; | |
24574 case -4: | |
24575 if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { | |
24576 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
24577 __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]))) | |
24578 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { | |
24579 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
24580 } | |
24581 } | |
24582 break; | |
24583 case 4: | |
24584 if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { | |
24585 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
24586 __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]))) | |
24587 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { | |
24588 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); | |
24589 } | |
24590 } | |
24591 break; | |
24592 } | |
24593 } | |
24594 #endif | |
24595 if ((sizeof(int) <= sizeof(long))) { | |
24596 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) | |
24597 #ifdef HAVE_LONG_LONG | |
24598 } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { | |
24599 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) | |
24600 #endif | |
24601 } | |
24602 } | |
24603 { | |
24604 int val; | |
24605 int ret = -1; | |
24606 #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API | |
24607 Py_ssize_t bytes_copied = PyLong_AsNativeBytes( | |
24608 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); | |
24609 if (unlikely(bytes_copied == -1)) { | |
24610 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { | |
24611 goto raise_overflow; | |
24612 } else { | |
24613 ret = 0; | |
24614 } | |
24615 #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) | |
24616 int one = 1; int is_little = (int)*(unsigned char *)&one; | |
24617 unsigned char *bytes = (unsigned char *)&val; | |
24618 ret = _PyLong_AsByteArray((PyLongObject *)x, | |
24619 bytes, sizeof(val), | |
24620 is_little, !is_unsigned); | |
24621 #else | |
24622 PyObject *v; | |
24623 PyObject *stepval = NULL, *mask = NULL, *shift = NULL; | |
24624 int bits, remaining_bits, is_negative = 0; | |
24625 int chunk_size = (sizeof(long) < 8) ? 30 : 62; | |
24626 if (likely(PyLong_CheckExact(x))) { | |
24627 v = __Pyx_NewRef(x); | |
24628 } else { | |
24629 v = PyNumber_Long(x); | |
24630 if (unlikely(!v)) return (int) -1; | |
24631 assert(PyLong_CheckExact(v)); | |
24632 } | |
24633 { | |
24634 int result = PyObject_RichCompareBool(v, Py_False, Py_LT); | |
24635 if (unlikely(result < 0)) { | |
24636 Py_DECREF(v); | |
24637 return (int) -1; | |
24638 } | |
24639 is_negative = result == 1; | |
24640 } | |
24641 if (is_unsigned && unlikely(is_negative)) { | |
24642 Py_DECREF(v); | |
24643 goto raise_neg_overflow; | |
24644 } else if (is_negative) { | |
24645 stepval = PyNumber_Invert(v); | |
24646 Py_DECREF(v); | |
24647 if (unlikely(!stepval)) | |
24648 return (int) -1; | |
24649 } else { | |
24650 stepval = v; | |
24651 } | |
24652 v = NULL; | |
24653 val = (int) 0; | |
24654 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; | |
24655 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; | |
24656 for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { | |
24657 PyObject *tmp, *digit; | |
24658 long idigit; | |
24659 digit = PyNumber_And(stepval, mask); | |
24660 if (unlikely(!digit)) goto done; | |
24661 idigit = PyLong_AsLong(digit); | |
24662 Py_DECREF(digit); | |
24663 if (unlikely(idigit < 0)) goto done; | |
24664 val |= ((int) idigit) << bits; | |
24665 tmp = PyNumber_Rshift(stepval, shift); | |
24666 if (unlikely(!tmp)) goto done; | |
24667 Py_DECREF(stepval); stepval = tmp; | |
24668 } | |
24669 Py_DECREF(shift); shift = NULL; | |
24670 Py_DECREF(mask); mask = NULL; | |
24671 { | |
24672 long idigit = PyLong_AsLong(stepval); | |
24673 if (unlikely(idigit < 0)) goto done; | |
24674 remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); | |
24675 if (unlikely(idigit >= (1L << remaining_bits))) | |
24676 goto raise_overflow; | |
24677 val |= ((int) idigit) << bits; | |
24678 } | |
24679 if (!is_unsigned) { | |
24680 if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) | |
24681 goto raise_overflow; | |
24682 if (is_negative) | |
24683 val = ~val; | |
24684 } | |
24685 ret = 0; | |
24686 done: | |
24687 Py_XDECREF(shift); | |
24688 Py_XDECREF(mask); | |
24689 Py_XDECREF(stepval); | |
24690 #endif | |
24691 if (unlikely(ret)) | |
24692 return (int) -1; | |
24693 return val; | |
24694 } | |
24695 raise_overflow: | |
24696 PyErr_SetString(PyExc_OverflowError, | |
24697 "value too large to convert to int"); | |
24698 return (int) -1; | |
24699 raise_neg_overflow: | |
24700 PyErr_SetString(PyExc_OverflowError, | |
24701 "can't convert negative value to int"); | |
24702 return (int) -1; | |
24703 } | |
24704 | |
24705 /* CIntFromPy */ | |
24706 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { | |
24707 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
24708 #pragma GCC diagnostic push | |
24709 #pragma GCC diagnostic ignored "-Wconversion" | |
24710 #endif | |
24711 const long neg_one = (long) -1, const_zero = (long) 0; | |
24712 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
24713 #pragma GCC diagnostic pop | |
24714 #endif | |
24715 const int is_unsigned = neg_one > const_zero; | |
24716 #if PY_MAJOR_VERSION < 3 | |
24717 if (likely(PyInt_Check(x))) { | |
24718 if ((sizeof(long) < sizeof(long))) { | |
24719 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) | |
24720 } else { | |
24721 long val = PyInt_AS_LONG(x); | |
24722 if (is_unsigned && unlikely(val < 0)) { | |
24723 goto raise_neg_overflow; | |
24724 } | |
24725 return (long) val; | |
24726 } | |
24727 } | |
24728 #endif | |
24729 if (unlikely(!PyLong_Check(x))) { | |
24730 long val; | |
24731 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); | |
24732 if (!tmp) return (long) -1; | |
24733 val = __Pyx_PyInt_As_long(tmp); | |
24734 Py_DECREF(tmp); | |
24735 return val; | |
24736 } | |
24737 if (is_unsigned) { | |
24738 #if CYTHON_USE_PYLONG_INTERNALS | |
24739 if (unlikely(__Pyx_PyLong_IsNeg(x))) { | |
24740 goto raise_neg_overflow; | |
24741 } else if (__Pyx_PyLong_IsCompact(x)) { | |
24742 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) | |
24743 } else { | |
24744 const digit* digits = __Pyx_PyLong_Digits(x); | |
24745 assert(__Pyx_PyLong_DigitCount(x) > 1); | |
24746 switch (__Pyx_PyLong_DigitCount(x)) { | |
24747 case 2: | |
24748 if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { | |
24749 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
24750 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
24751 } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { | |
24752 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); | |
24753 } | |
24754 } | |
24755 break; | |
24756 case 3: | |
24757 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { | |
24758 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
24759 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
24760 } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { | |
24761 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); | |
24762 } | |
24763 } | |
24764 break; | |
24765 case 4: | |
24766 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { | |
24767 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
24768 __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]))) | |
24769 } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { | |
24770 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); | |
24771 } | |
24772 } | |
24773 break; | |
24774 } | |
24775 } | |
24776 #endif | |
24777 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 | |
24778 if (unlikely(Py_SIZE(x) < 0)) { | |
24779 goto raise_neg_overflow; | |
24780 } | |
24781 #else | |
24782 { | |
24783 int result = PyObject_RichCompareBool(x, Py_False, Py_LT); | |
24784 if (unlikely(result < 0)) | |
24785 return (long) -1; | |
24786 if (unlikely(result == 1)) | |
24787 goto raise_neg_overflow; | |
24788 } | |
24789 #endif | |
24790 if ((sizeof(long) <= sizeof(unsigned long))) { | |
24791 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) | |
24792 #ifdef HAVE_LONG_LONG | |
24793 } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { | |
24794 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) | |
24795 #endif | |
24796 } | |
24797 } else { | |
24798 #if CYTHON_USE_PYLONG_INTERNALS | |
24799 if (__Pyx_PyLong_IsCompact(x)) { | |
24800 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) | |
24801 } else { | |
24802 const digit* digits = __Pyx_PyLong_Digits(x); | |
24803 assert(__Pyx_PyLong_DigitCount(x) > 1); | |
24804 switch (__Pyx_PyLong_SignedDigitCount(x)) { | |
24805 case -2: | |
24806 if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { | |
24807 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
24808 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
24809 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { | |
24810 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
24811 } | |
24812 } | |
24813 break; | |
24814 case 2: | |
24815 if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { | |
24816 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { | |
24817 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
24818 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { | |
24819 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
24820 } | |
24821 } | |
24822 break; | |
24823 case -3: | |
24824 if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { | |
24825 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
24826 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
24827 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { | |
24828 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
24829 } | |
24830 } | |
24831 break; | |
24832 case 3: | |
24833 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { | |
24834 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { | |
24835 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) | |
24836 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { | |
24837 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
24838 } | |
24839 } | |
24840 break; | |
24841 case -4: | |
24842 if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { | |
24843 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
24844 __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]))) | |
24845 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { | |
24846 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
24847 } | |
24848 } | |
24849 break; | |
24850 case 4: | |
24851 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { | |
24852 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { | |
24853 __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]))) | |
24854 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { | |
24855 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); | |
24856 } | |
24857 } | |
24858 break; | |
24859 } | |
24860 } | |
24861 #endif | |
24862 if ((sizeof(long) <= sizeof(long))) { | |
24863 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) | |
24864 #ifdef HAVE_LONG_LONG | |
24865 } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { | |
24866 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) | |
24867 #endif | |
24868 } | |
24869 } | |
24870 { | |
24871 long val; | |
24872 int ret = -1; | |
24873 #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API | |
24874 Py_ssize_t bytes_copied = PyLong_AsNativeBytes( | |
24875 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); | |
24876 if (unlikely(bytes_copied == -1)) { | |
24877 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { | |
24878 goto raise_overflow; | |
24879 } else { | |
24880 ret = 0; | |
24881 } | |
24882 #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) | |
24883 int one = 1; int is_little = (int)*(unsigned char *)&one; | |
24884 unsigned char *bytes = (unsigned char *)&val; | |
24885 ret = _PyLong_AsByteArray((PyLongObject *)x, | |
24886 bytes, sizeof(val), | |
24887 is_little, !is_unsigned); | |
24888 #else | |
24889 PyObject *v; | |
24890 PyObject *stepval = NULL, *mask = NULL, *shift = NULL; | |
24891 int bits, remaining_bits, is_negative = 0; | |
24892 int chunk_size = (sizeof(long) < 8) ? 30 : 62; | |
24893 if (likely(PyLong_CheckExact(x))) { | |
24894 v = __Pyx_NewRef(x); | |
24895 } else { | |
24896 v = PyNumber_Long(x); | |
24897 if (unlikely(!v)) return (long) -1; | |
24898 assert(PyLong_CheckExact(v)); | |
24899 } | |
24900 { | |
24901 int result = PyObject_RichCompareBool(v, Py_False, Py_LT); | |
24902 if (unlikely(result < 0)) { | |
24903 Py_DECREF(v); | |
24904 return (long) -1; | |
24905 } | |
24906 is_negative = result == 1; | |
24907 } | |
24908 if (is_unsigned && unlikely(is_negative)) { | |
24909 Py_DECREF(v); | |
24910 goto raise_neg_overflow; | |
24911 } else if (is_negative) { | |
24912 stepval = PyNumber_Invert(v); | |
24913 Py_DECREF(v); | |
24914 if (unlikely(!stepval)) | |
24915 return (long) -1; | |
24916 } else { | |
24917 stepval = v; | |
24918 } | |
24919 v = NULL; | |
24920 val = (long) 0; | |
24921 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; | |
24922 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; | |
24923 for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { | |
24924 PyObject *tmp, *digit; | |
24925 long idigit; | |
24926 digit = PyNumber_And(stepval, mask); | |
24927 if (unlikely(!digit)) goto done; | |
24928 idigit = PyLong_AsLong(digit); | |
24929 Py_DECREF(digit); | |
24930 if (unlikely(idigit < 0)) goto done; | |
24931 val |= ((long) idigit) << bits; | |
24932 tmp = PyNumber_Rshift(stepval, shift); | |
24933 if (unlikely(!tmp)) goto done; | |
24934 Py_DECREF(stepval); stepval = tmp; | |
24935 } | |
24936 Py_DECREF(shift); shift = NULL; | |
24937 Py_DECREF(mask); mask = NULL; | |
24938 { | |
24939 long idigit = PyLong_AsLong(stepval); | |
24940 if (unlikely(idigit < 0)) goto done; | |
24941 remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); | |
24942 if (unlikely(idigit >= (1L << remaining_bits))) | |
24943 goto raise_overflow; | |
24944 val |= ((long) idigit) << bits; | |
24945 } | |
24946 if (!is_unsigned) { | |
24947 if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) | |
24948 goto raise_overflow; | |
24949 if (is_negative) | |
24950 val = ~val; | |
24951 } | |
24952 ret = 0; | |
24953 done: | |
24954 Py_XDECREF(shift); | |
24955 Py_XDECREF(mask); | |
24956 Py_XDECREF(stepval); | |
24957 #endif | |
24958 if (unlikely(ret)) | |
24959 return (long) -1; | |
24960 return val; | |
24961 } | |
24962 raise_overflow: | |
24963 PyErr_SetString(PyExc_OverflowError, | |
24964 "value too large to convert to long"); | |
24965 return (long) -1; | |
24966 raise_neg_overflow: | |
24967 PyErr_SetString(PyExc_OverflowError, | |
24968 "can't convert negative value to long"); | |
24969 return (long) -1; | |
24970 } | |
24971 | |
24972 /* CIntToPy */ | |
24973 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { | |
24974 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
24975 #pragma GCC diagnostic push | |
24976 #pragma GCC diagnostic ignored "-Wconversion" | |
24977 #endif | |
24978 const int neg_one = (int) -1, const_zero = (int) 0; | |
24979 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
24980 #pragma GCC diagnostic pop | |
24981 #endif | |
24982 const int is_unsigned = neg_one > const_zero; | |
24983 if (is_unsigned) { | |
24984 if (sizeof(int) < sizeof(long)) { | |
24985 return PyInt_FromLong((long) value); | |
24986 } else if (sizeof(int) <= sizeof(unsigned long)) { | |
24987 return PyLong_FromUnsignedLong((unsigned long) value); | |
24988 #ifdef HAVE_LONG_LONG | |
24989 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { | |
24990 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); | |
24991 #endif | |
24992 } | |
24993 } else { | |
24994 if (sizeof(int) <= sizeof(long)) { | |
24995 return PyInt_FromLong((long) value); | |
24996 #ifdef HAVE_LONG_LONG | |
24997 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { | |
24998 return PyLong_FromLongLong((PY_LONG_LONG) value); | |
24999 #endif | |
25000 } | |
25001 } | |
25002 { | |
25003 unsigned char *bytes = (unsigned char *)&value; | |
25004 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 | |
25005 if (is_unsigned) { | |
25006 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); | |
25007 } else { | |
25008 return PyLong_FromNativeBytes(bytes, sizeof(value), -1); | |
25009 } | |
25010 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 | |
25011 int one = 1; int little = (int)*(unsigned char *)&one; | |
25012 return _PyLong_FromByteArray(bytes, sizeof(int), | |
25013 little, !is_unsigned); | |
25014 #else | |
25015 int one = 1; int little = (int)*(unsigned char *)&one; | |
25016 PyObject *from_bytes, *result = NULL; | |
25017 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; | |
25018 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); | |
25019 if (!from_bytes) return NULL; | |
25020 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); | |
25021 if (!py_bytes) goto limited_bad; | |
25022 order_str = PyUnicode_FromString(little ? "little" : "big"); | |
25023 if (!order_str) goto limited_bad; | |
25024 arg_tuple = PyTuple_Pack(2, py_bytes, order_str); | |
25025 if (!arg_tuple) goto limited_bad; | |
25026 if (!is_unsigned) { | |
25027 kwds = PyDict_New(); | |
25028 if (!kwds) goto limited_bad; | |
25029 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; | |
25030 } | |
25031 result = PyObject_Call(from_bytes, arg_tuple, kwds); | |
25032 limited_bad: | |
25033 Py_XDECREF(kwds); | |
25034 Py_XDECREF(arg_tuple); | |
25035 Py_XDECREF(order_str); | |
25036 Py_XDECREF(py_bytes); | |
25037 Py_XDECREF(from_bytes); | |
25038 return result; | |
25039 #endif | |
25040 } | |
25041 } | |
25042 | |
25043 /* CIntToPy */ | |
25044 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { | |
25045 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
25046 #pragma GCC diagnostic push | |
25047 #pragma GCC diagnostic ignored "-Wconversion" | |
25048 #endif | |
25049 const long neg_one = (long) -1, const_zero = (long) 0; | |
25050 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC | |
25051 #pragma GCC diagnostic pop | |
25052 #endif | |
25053 const int is_unsigned = neg_one > const_zero; | |
25054 if (is_unsigned) { | |
25055 if (sizeof(long) < sizeof(long)) { | |
25056 return PyInt_FromLong((long) value); | |
25057 } else if (sizeof(long) <= sizeof(unsigned long)) { | |
25058 return PyLong_FromUnsignedLong((unsigned long) value); | |
25059 #ifdef HAVE_LONG_LONG | |
25060 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { | |
25061 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); | |
25062 #endif | |
25063 } | |
25064 } else { | |
25065 if (sizeof(long) <= sizeof(long)) { | |
25066 return PyInt_FromLong((long) value); | |
25067 #ifdef HAVE_LONG_LONG | |
25068 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { | |
25069 return PyLong_FromLongLong((PY_LONG_LONG) value); | |
25070 #endif | |
25071 } | |
25072 } | |
25073 { | |
25074 unsigned char *bytes = (unsigned char *)&value; | |
25075 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 | |
25076 if (is_unsigned) { | |
25077 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); | |
25078 } else { | |
25079 return PyLong_FromNativeBytes(bytes, sizeof(value), -1); | |
25080 } | |
25081 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 | |
25082 int one = 1; int little = (int)*(unsigned char *)&one; | |
25083 return _PyLong_FromByteArray(bytes, sizeof(long), | |
25084 little, !is_unsigned); | |
25085 #else | |
25086 int one = 1; int little = (int)*(unsigned char *)&one; | |
25087 PyObject *from_bytes, *result = NULL; | |
25088 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; | |
25089 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); | |
25090 if (!from_bytes) return NULL; | |
25091 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); | |
25092 if (!py_bytes) goto limited_bad; | |
25093 order_str = PyUnicode_FromString(little ? "little" : "big"); | |
25094 if (!order_str) goto limited_bad; | |
25095 arg_tuple = PyTuple_Pack(2, py_bytes, order_str); | |
25096 if (!arg_tuple) goto limited_bad; | |
25097 if (!is_unsigned) { | |
25098 kwds = PyDict_New(); | |
25099 if (!kwds) goto limited_bad; | |
25100 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; | |
25101 } | |
25102 result = PyObject_Call(from_bytes, arg_tuple, kwds); | |
25103 limited_bad: | |
25104 Py_XDECREF(kwds); | |
25105 Py_XDECREF(arg_tuple); | |
25106 Py_XDECREF(order_str); | |
25107 Py_XDECREF(py_bytes); | |
25108 Py_XDECREF(from_bytes); | |
25109 return result; | |
25110 #endif | |
25111 } | |
25112 } | |
25113 | |
25114 /* FormatTypeName */ | |
25115 #if CYTHON_COMPILING_IN_LIMITED_API | |
25116 static __Pyx_TypeName | |
25117 __Pyx_PyType_GetName(PyTypeObject* tp) | |
25118 { | |
25119 PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, | |
25120 __pyx_n_s_name_2); | |
25121 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { | |
25122 PyErr_Clear(); | |
25123 Py_XDECREF(name); | |
25124 name = __Pyx_NewRef(__pyx_n_s__68); | |
25125 } | |
25126 return name; | |
25127 } | |
25128 #endif | |
25129 | |
25130 /* FastTypeChecks */ | |
25131 #if CYTHON_COMPILING_IN_CPYTHON | |
25132 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { | |
25133 while (a) { | |
25134 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); | |
25135 if (a == b) | |
25136 return 1; | |
25137 } | |
25138 return b == &PyBaseObject_Type; | |
25139 } | |
25140 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { | |
25141 PyObject *mro; | |
25142 if (a == b) return 1; | |
25143 mro = a->tp_mro; | |
25144 if (likely(mro)) { | |
25145 Py_ssize_t i, n; | |
25146 n = PyTuple_GET_SIZE(mro); | |
25147 for (i = 0; i < n; i++) { | |
25148 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) | |
25149 return 1; | |
25150 } | |
25151 return 0; | |
25152 } | |
25153 return __Pyx_InBases(a, b); | |
25154 } | |
25155 static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { | |
25156 PyObject *mro; | |
25157 if (cls == a || cls == b) return 1; | |
25158 mro = cls->tp_mro; | |
25159 if (likely(mro)) { | |
25160 Py_ssize_t i, n; | |
25161 n = PyTuple_GET_SIZE(mro); | |
25162 for (i = 0; i < n; i++) { | |
25163 PyObject *base = PyTuple_GET_ITEM(mro, i); | |
25164 if (base == (PyObject *)a || base == (PyObject *)b) | |
25165 return 1; | |
25166 } | |
25167 return 0; | |
25168 } | |
25169 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); | |
25170 } | |
25171 #if PY_MAJOR_VERSION == 2 | |
25172 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { | |
25173 PyObject *exception, *value, *tb; | |
25174 int res; | |
25175 __Pyx_PyThreadState_declare | |
25176 __Pyx_PyThreadState_assign | |
25177 __Pyx_ErrFetch(&exception, &value, &tb); | |
25178 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; | |
25179 if (unlikely(res == -1)) { | |
25180 PyErr_WriteUnraisable(err); | |
25181 res = 0; | |
25182 } | |
25183 if (!res) { | |
25184 res = PyObject_IsSubclass(err, exc_type2); | |
25185 if (unlikely(res == -1)) { | |
25186 PyErr_WriteUnraisable(err); | |
25187 res = 0; | |
25188 } | |
25189 } | |
25190 __Pyx_ErrRestore(exception, value, tb); | |
25191 return res; | |
25192 } | |
25193 #else | |
25194 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { | |
25195 if (exc_type1) { | |
25196 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); | |
25197 } else { | |
25198 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); | |
25199 } | |
25200 } | |
25201 #endif | |
25202 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { | |
25203 Py_ssize_t i, n; | |
25204 assert(PyExceptionClass_Check(exc_type)); | |
25205 n = PyTuple_GET_SIZE(tuple); | |
25206 #if PY_MAJOR_VERSION >= 3 | |
25207 for (i=0; i<n; i++) { | |
25208 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1; | |
25209 } | |
25210 #endif | |
25211 for (i=0; i<n; i++) { | |
25212 PyObject *t = PyTuple_GET_ITEM(tuple, i); | |
25213 #if PY_MAJOR_VERSION < 3 | |
25214 if (likely(exc_type == t)) return 1; | |
25215 #endif | |
25216 if (likely(PyExceptionClass_Check(t))) { | |
25217 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1; | |
25218 } else { | |
25219 } | |
25220 } | |
25221 return 0; | |
25222 } | |
25223 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) { | |
25224 if (likely(err == exc_type)) return 1; | |
25225 if (likely(PyExceptionClass_Check(err))) { | |
25226 if (likely(PyExceptionClass_Check(exc_type))) { | |
25227 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type); | |
25228 } else if (likely(PyTuple_Check(exc_type))) { | |
25229 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type); | |
25230 } else { | |
25231 } | |
25232 } | |
25233 return PyErr_GivenExceptionMatches(err, exc_type); | |
25234 } | |
25235 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) { | |
25236 assert(PyExceptionClass_Check(exc_type1)); | |
25237 assert(PyExceptionClass_Check(exc_type2)); | |
25238 if (likely(err == exc_type1 || err == exc_type2)) return 1; | |
25239 if (likely(PyExceptionClass_Check(err))) { | |
25240 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2); | |
25241 } | |
25242 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2)); | |
25243 } | |
25244 #endif | |
25245 | |
25246 /* CheckBinaryVersion */ | |
25247 static unsigned long __Pyx_get_runtime_version(void) { | |
25248 #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 | |
25249 return Py_Version & ~0xFFUL; | |
25250 #else | |
25251 const char* rt_version = Py_GetVersion(); | |
25252 unsigned long version = 0; | |
25253 unsigned long factor = 0x01000000UL; | |
25254 unsigned int digit = 0; | |
25255 int i = 0; | |
25256 while (factor) { | |
25257 while ('0' <= rt_version[i] && rt_version[i] <= '9') { | |
25258 digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); | |
25259 ++i; | |
25260 } | |
25261 version += factor * digit; | |
25262 if (rt_version[i] != '.') | |
25263 break; | |
25264 digit = 0; | |
25265 factor >>= 8; | |
25266 ++i; | |
25267 } | |
25268 return version; | |
25269 #endif | |
25270 } | |
25271 static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { | |
25272 const unsigned long MAJOR_MINOR = 0xFFFF0000UL; | |
25273 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) | |
25274 return 0; | |
25275 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) | |
25276 return 1; | |
25277 { | |
25278 char message[200]; | |
25279 PyOS_snprintf(message, sizeof(message), | |
25280 "compile time Python version %d.%d " | |
25281 "of module '%.100s' " | |
25282 "%s " | |
25283 "runtime version %d.%d", | |
25284 (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), | |
25285 __Pyx_MODULE_NAME, | |
25286 (allow_newer) ? "was newer than" : "does not match", | |
25287 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) | |
25288 ); | |
25289 return PyErr_WarnEx(NULL, message, 1); | |
25290 } | |
25291 } | |
25292 | |
25293 /* FunctionImport */ | |
25294 #ifndef __PYX_HAVE_RT_ImportFunction_3_0_11 | |
25295 #define __PYX_HAVE_RT_ImportFunction_3_0_11 | |
25296 static int __Pyx_ImportFunction_3_0_11(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { | |
25297 PyObject *d = 0; | |
25298 PyObject *cobj = 0; | |
25299 union { | |
25300 void (*fp)(void); | |
25301 void *p; | |
25302 } tmp; | |
25303 d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); | |
25304 if (!d) | |
25305 goto bad; | |
25306 cobj = PyDict_GetItemString(d, funcname); | |
25307 if (!cobj) { | |
25308 PyErr_Format(PyExc_ImportError, | |
25309 "%.200s does not export expected C function %.200s", | |
25310 PyModule_GetName(module), funcname); | |
25311 goto bad; | |
25312 } | |
25313 if (!PyCapsule_IsValid(cobj, sig)) { | |
25314 PyErr_Format(PyExc_TypeError, | |
25315 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", | |
25316 PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); | |
25317 goto bad; | |
25318 } | |
25319 tmp.p = PyCapsule_GetPointer(cobj, sig); | |
25320 *f = tmp.fp; | |
25321 if (!(*f)) | |
25322 goto bad; | |
25323 Py_DECREF(d); | |
25324 return 0; | |
25325 bad: | |
25326 Py_XDECREF(d); | |
25327 return -1; | |
25328 } | |
25329 #endif | |
25330 | |
25331 /* InitStrings */ | |
25332 #if PY_MAJOR_VERSION >= 3 | |
25333 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { | |
25334 if (t.is_unicode | t.is_str) { | |
25335 if (t.intern) { | |
25336 *str = PyUnicode_InternFromString(t.s); | |
25337 } else if (t.encoding) { | |
25338 *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); | |
25339 } else { | |
25340 *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); | |
25341 } | |
25342 } else { | |
25343 *str = PyBytes_FromStringAndSize(t.s, t.n - 1); | |
25344 } | |
25345 if (!*str) | |
25346 return -1; | |
25347 if (PyObject_Hash(*str) == -1) | |
25348 return -1; | |
25349 return 0; | |
25350 } | |
25351 #endif | |
25352 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { | |
25353 while (t->p) { | |
25354 #if PY_MAJOR_VERSION >= 3 | |
25355 __Pyx_InitString(*t, t->p); | |
25356 #else | |
25357 if (t->is_unicode) { | |
25358 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); | |
25359 } else if (t->intern) { | |
25360 *t->p = PyString_InternFromString(t->s); | |
25361 } else { | |
25362 *t->p = PyString_FromStringAndSize(t->s, t->n - 1); | |
25363 } | |
25364 if (!*t->p) | |
25365 return -1; | |
25366 if (PyObject_Hash(*t->p) == -1) | |
25367 return -1; | |
25368 #endif | |
25369 ++t; | |
25370 } | |
25371 return 0; | |
25372 } | |
25373 | |
25374 #include <string.h> | |
25375 static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { | |
25376 size_t len = strlen(s); | |
25377 if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { | |
25378 PyErr_SetString(PyExc_OverflowError, "byte string is too long"); | |
25379 return -1; | |
25380 } | |
25381 return (Py_ssize_t) len; | |
25382 } | |
25383 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { | |
25384 Py_ssize_t len = __Pyx_ssize_strlen(c_str); | |
25385 if (unlikely(len < 0)) return NULL; | |
25386 return __Pyx_PyUnicode_FromStringAndSize(c_str, len); | |
25387 } | |
25388 static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { | |
25389 Py_ssize_t len = __Pyx_ssize_strlen(c_str); | |
25390 if (unlikely(len < 0)) return NULL; | |
25391 return PyByteArray_FromStringAndSize(c_str, len); | |
25392 } | |
25393 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { | |
25394 Py_ssize_t ignore; | |
25395 return __Pyx_PyObject_AsStringAndSize(o, &ignore); | |
25396 } | |
25397 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT | |
25398 #if !CYTHON_PEP393_ENABLED | |
25399 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { | |
25400 char* defenc_c; | |
25401 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); | |
25402 if (!defenc) return NULL; | |
25403 defenc_c = PyBytes_AS_STRING(defenc); | |
25404 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
25405 { | |
25406 char* end = defenc_c + PyBytes_GET_SIZE(defenc); | |
25407 char* c; | |
25408 for (c = defenc_c; c < end; c++) { | |
25409 if ((unsigned char) (*c) >= 128) { | |
25410 PyUnicode_AsASCIIString(o); | |
25411 return NULL; | |
25412 } | |
25413 } | |
25414 } | |
25415 #endif | |
25416 *length = PyBytes_GET_SIZE(defenc); | |
25417 return defenc_c; | |
25418 } | |
25419 #else | |
25420 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { | |
25421 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; | |
25422 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
25423 if (likely(PyUnicode_IS_ASCII(o))) { | |
25424 *length = PyUnicode_GET_LENGTH(o); | |
25425 return PyUnicode_AsUTF8(o); | |
25426 } else { | |
25427 PyUnicode_AsASCIIString(o); | |
25428 return NULL; | |
25429 } | |
25430 #else | |
25431 return PyUnicode_AsUTF8AndSize(o, length); | |
25432 #endif | |
25433 } | |
25434 #endif | |
25435 #endif | |
25436 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { | |
25437 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT | |
25438 if ( | |
25439 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
25440 __Pyx_sys_getdefaultencoding_not_ascii && | |
25441 #endif | |
25442 PyUnicode_Check(o)) { | |
25443 return __Pyx_PyUnicode_AsStringAndSize(o, length); | |
25444 } else | |
25445 #endif | |
25446 #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) | |
25447 if (PyByteArray_Check(o)) { | |
25448 *length = PyByteArray_GET_SIZE(o); | |
25449 return PyByteArray_AS_STRING(o); | |
25450 } else | |
25451 #endif | |
25452 { | |
25453 char* result; | |
25454 int r = PyBytes_AsStringAndSize(o, &result, length); | |
25455 if (unlikely(r < 0)) { | |
25456 return NULL; | |
25457 } else { | |
25458 return result; | |
25459 } | |
25460 } | |
25461 } | |
25462 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { | |
25463 int is_true = x == Py_True; | |
25464 if (is_true | (x == Py_False) | (x == Py_None)) return is_true; | |
25465 else return PyObject_IsTrue(x); | |
25466 } | |
25467 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { | |
25468 int retval; | |
25469 if (unlikely(!x)) return -1; | |
25470 retval = __Pyx_PyObject_IsTrue(x); | |
25471 Py_DECREF(x); | |
25472 return retval; | |
25473 } | |
25474 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { | |
25475 __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); | |
25476 #if PY_MAJOR_VERSION >= 3 | |
25477 if (PyLong_Check(result)) { | |
25478 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, | |
25479 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " | |
25480 "The ability to return an instance of a strict subclass of int is deprecated, " | |
25481 "and may be removed in a future version of Python.", | |
25482 result_type_name)) { | |
25483 __Pyx_DECREF_TypeName(result_type_name); | |
25484 Py_DECREF(result); | |
25485 return NULL; | |
25486 } | |
25487 __Pyx_DECREF_TypeName(result_type_name); | |
25488 return result; | |
25489 } | |
25490 #endif | |
25491 PyErr_Format(PyExc_TypeError, | |
25492 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", | |
25493 type_name, type_name, result_type_name); | |
25494 __Pyx_DECREF_TypeName(result_type_name); | |
25495 Py_DECREF(result); | |
25496 return NULL; | |
25497 } | |
25498 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { | |
25499 #if CYTHON_USE_TYPE_SLOTS | |
25500 PyNumberMethods *m; | |
25501 #endif | |
25502 const char *name = NULL; | |
25503 PyObject *res = NULL; | |
25504 #if PY_MAJOR_VERSION < 3 | |
25505 if (likely(PyInt_Check(x) || PyLong_Check(x))) | |
25506 #else | |
25507 if (likely(PyLong_Check(x))) | |
25508 #endif | |
25509 return __Pyx_NewRef(x); | |
25510 #if CYTHON_USE_TYPE_SLOTS | |
25511 m = Py_TYPE(x)->tp_as_number; | |
25512 #if PY_MAJOR_VERSION < 3 | |
25513 if (m && m->nb_int) { | |
25514 name = "int"; | |
25515 res = m->nb_int(x); | |
25516 } | |
25517 else if (m && m->nb_long) { | |
25518 name = "long"; | |
25519 res = m->nb_long(x); | |
25520 } | |
25521 #else | |
25522 if (likely(m && m->nb_int)) { | |
25523 name = "int"; | |
25524 res = m->nb_int(x); | |
25525 } | |
25526 #endif | |
25527 #else | |
25528 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { | |
25529 res = PyNumber_Int(x); | |
25530 } | |
25531 #endif | |
25532 if (likely(res)) { | |
25533 #if PY_MAJOR_VERSION < 3 | |
25534 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { | |
25535 #else | |
25536 if (unlikely(!PyLong_CheckExact(res))) { | |
25537 #endif | |
25538 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); | |
25539 } | |
25540 } | |
25541 else if (!PyErr_Occurred()) { | |
25542 PyErr_SetString(PyExc_TypeError, | |
25543 "an integer is required"); | |
25544 } | |
25545 return res; | |
25546 } | |
25547 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { | |
25548 Py_ssize_t ival; | |
25549 PyObject *x; | |
25550 #if PY_MAJOR_VERSION < 3 | |
25551 if (likely(PyInt_CheckExact(b))) { | |
25552 if (sizeof(Py_ssize_t) >= sizeof(long)) | |
25553 return PyInt_AS_LONG(b); | |
25554 else | |
25555 return PyInt_AsSsize_t(b); | |
25556 } | |
25557 #endif | |
25558 if (likely(PyLong_CheckExact(b))) { | |
25559 #if CYTHON_USE_PYLONG_INTERNALS | |
25560 if (likely(__Pyx_PyLong_IsCompact(b))) { | |
25561 return __Pyx_PyLong_CompactValue(b); | |
25562 } else { | |
25563 const digit* digits = __Pyx_PyLong_Digits(b); | |
25564 const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); | |
25565 switch (size) { | |
25566 case 2: | |
25567 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { | |
25568 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
25569 } | |
25570 break; | |
25571 case -2: | |
25572 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { | |
25573 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
25574 } | |
25575 break; | |
25576 case 3: | |
25577 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { | |
25578 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
25579 } | |
25580 break; | |
25581 case -3: | |
25582 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { | |
25583 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); | |
25584 } | |
25585 break; | |
25586 case 4: | |
25587 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { | |
25588 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])); | |
25589 } | |
25590 break; | |
25591 case -4: | |
25592 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { | |
25593 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])); | |
25594 } | |
25595 break; | |
25596 } | |
25597 } | |
25598 #endif | |
25599 return PyLong_AsSsize_t(b); | |
25600 } | |
25601 x = PyNumber_Index(b); | |
25602 if (!x) return -1; | |
25603 ival = PyInt_AsSsize_t(x); | |
25604 Py_DECREF(x); | |
25605 return ival; | |
25606 } | |
25607 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { | |
25608 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { | |
25609 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); | |
25610 #if PY_MAJOR_VERSION < 3 | |
25611 } else if (likely(PyInt_CheckExact(o))) { | |
25612 return PyInt_AS_LONG(o); | |
25613 #endif | |
25614 } else { | |
25615 Py_ssize_t ival; | |
25616 PyObject *x; | |
25617 x = PyNumber_Index(o); | |
25618 if (!x) return -1; | |
25619 ival = PyInt_AsLong(x); | |
25620 Py_DECREF(x); | |
25621 return ival; | |
25622 } | |
25623 } | |
25624 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { | |
25625 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); | |
25626 } | |
25627 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { | |
25628 return PyInt_FromSize_t(ival); | |
25629 } | |
25630 | |
25631 | |
25632 /* #### Code section: utility_code_pragmas_end ### */ | |
25633 #ifdef _MSC_VER | |
25634 #pragma warning( pop ) | |
25635 #endif | |
25636 | |
25637 | |
25638 | |
25639 /* #### Code section: end ### */ | |
25640 #endif /* Py_PYTHON_H */ |