1 /* Generated by Cython 0.29.25 */
2 
3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
5 #endif /* PY_SSIZE_T_CLEAN */
6 #include "Python.h"
7 #ifndef Py_PYTHON_H
8     #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10     #error Cython requires Python 2.6+ or Python 3.3+.
11 #else
12 #define CYTHON_ABI "0_29_25"
13 #define CYTHON_HEX_VERSION 0x001D19F0
14 #define CYTHON_FUTURE_DIVISION 0
15 #include <stddef.h>
16 #ifndef offsetof
17   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
18 #endif
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
20   #ifndef __stdcall
21     #define __stdcall
22   #endif
23   #ifndef __cdecl
24     #define __cdecl
25   #endif
26   #ifndef __fastcall
27     #define __fastcall
28   #endif
29 #endif
30 #ifndef DL_IMPORT
31   #define DL_IMPORT(t) t
32 #endif
33 #ifndef DL_EXPORT
34   #define DL_EXPORT(t) t
35 #endif
36 #define __PYX_COMMA ,
37 #ifndef HAVE_LONG_LONG
38   #if PY_VERSION_HEX >= 0x02070000
39     #define HAVE_LONG_LONG
40   #endif
41 #endif
42 #ifndef PY_LONG_LONG
43   #define PY_LONG_LONG LONG_LONG
44 #endif
45 #ifndef Py_HUGE_VAL
46   #define Py_HUGE_VAL HUGE_VAL
47 #endif
48 #ifdef PYPY_VERSION
49   #define CYTHON_COMPILING_IN_PYPY 1
50   #define CYTHON_COMPILING_IN_PYSTON 0
51   #define CYTHON_COMPILING_IN_CPYTHON 0
52   #undef CYTHON_USE_TYPE_SLOTS
53   #define CYTHON_USE_TYPE_SLOTS 0
54   #undef CYTHON_USE_PYTYPE_LOOKUP
55   #define CYTHON_USE_PYTYPE_LOOKUP 0
56   #if PY_VERSION_HEX < 0x03050000
57     #undef CYTHON_USE_ASYNC_SLOTS
58     #define CYTHON_USE_ASYNC_SLOTS 0
59   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60     #define CYTHON_USE_ASYNC_SLOTS 1
61   #endif
62   #undef CYTHON_USE_PYLIST_INTERNALS
63   #define CYTHON_USE_PYLIST_INTERNALS 0
64   #undef CYTHON_USE_UNICODE_INTERNALS
65   #define CYTHON_USE_UNICODE_INTERNALS 0
66   #undef CYTHON_USE_UNICODE_WRITER
67   #define CYTHON_USE_UNICODE_WRITER 0
68   #undef CYTHON_USE_PYLONG_INTERNALS
69   #define CYTHON_USE_PYLONG_INTERNALS 0
70   #undef CYTHON_AVOID_BORROWED_REFS
71   #define CYTHON_AVOID_BORROWED_REFS 1
72   #undef CYTHON_ASSUME_SAFE_MACROS
73   #define CYTHON_ASSUME_SAFE_MACROS 0
74   #undef CYTHON_UNPACK_METHODS
75   #define CYTHON_UNPACK_METHODS 0
76   #undef CYTHON_FAST_THREAD_STATE
77   #define CYTHON_FAST_THREAD_STATE 0
78   #undef CYTHON_FAST_PYCALL
79   #define CYTHON_FAST_PYCALL 0
80   #undef CYTHON_PEP489_MULTI_PHASE_INIT
81   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82   #undef CYTHON_USE_TP_FINALIZE
83   #define CYTHON_USE_TP_FINALIZE 0
84   #undef CYTHON_USE_DICT_VERSIONS
85   #define CYTHON_USE_DICT_VERSIONS 0
86   #undef CYTHON_USE_EXC_INFO_STACK
87   #define CYTHON_USE_EXC_INFO_STACK 0
88 #elif defined(PYSTON_VERSION)
89   #define CYTHON_COMPILING_IN_PYPY 0
90   #define CYTHON_COMPILING_IN_PYSTON 1
91   #define CYTHON_COMPILING_IN_CPYTHON 0
92   #ifndef CYTHON_USE_TYPE_SLOTS
93     #define CYTHON_USE_TYPE_SLOTS 1
94   #endif
95   #undef CYTHON_USE_PYTYPE_LOOKUP
96   #define CYTHON_USE_PYTYPE_LOOKUP 0
97   #undef CYTHON_USE_ASYNC_SLOTS
98   #define CYTHON_USE_ASYNC_SLOTS 0
99   #undef CYTHON_USE_PYLIST_INTERNALS
100   #define CYTHON_USE_PYLIST_INTERNALS 0
101   #ifndef CYTHON_USE_UNICODE_INTERNALS
102     #define CYTHON_USE_UNICODE_INTERNALS 1
103   #endif
104   #undef CYTHON_USE_UNICODE_WRITER
105   #define CYTHON_USE_UNICODE_WRITER 0
106   #undef CYTHON_USE_PYLONG_INTERNALS
107   #define CYTHON_USE_PYLONG_INTERNALS 0
108   #ifndef CYTHON_AVOID_BORROWED_REFS
109     #define CYTHON_AVOID_BORROWED_REFS 0
110   #endif
111   #ifndef CYTHON_ASSUME_SAFE_MACROS
112     #define CYTHON_ASSUME_SAFE_MACROS 1
113   #endif
114   #ifndef CYTHON_UNPACK_METHODS
115     #define CYTHON_UNPACK_METHODS 1
116   #endif
117   #undef CYTHON_FAST_THREAD_STATE
118   #define CYTHON_FAST_THREAD_STATE 0
119   #undef CYTHON_FAST_PYCALL
120   #define CYTHON_FAST_PYCALL 0
121   #undef CYTHON_PEP489_MULTI_PHASE_INIT
122   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
123   #undef CYTHON_USE_TP_FINALIZE
124   #define CYTHON_USE_TP_FINALIZE 0
125   #undef CYTHON_USE_DICT_VERSIONS
126   #define CYTHON_USE_DICT_VERSIONS 0
127   #undef CYTHON_USE_EXC_INFO_STACK
128   #define CYTHON_USE_EXC_INFO_STACK 0
129 #else
130   #define CYTHON_COMPILING_IN_PYPY 0
131   #define CYTHON_COMPILING_IN_PYSTON 0
132   #define CYTHON_COMPILING_IN_CPYTHON 1
133   #ifndef CYTHON_USE_TYPE_SLOTS
134     #define CYTHON_USE_TYPE_SLOTS 1
135   #endif
136   #if PY_VERSION_HEX < 0x02070000
137     #undef CYTHON_USE_PYTYPE_LOOKUP
138     #define CYTHON_USE_PYTYPE_LOOKUP 0
139   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
140     #define CYTHON_USE_PYTYPE_LOOKUP 1
141   #endif
142   #if PY_MAJOR_VERSION < 3
143     #undef CYTHON_USE_ASYNC_SLOTS
144     #define CYTHON_USE_ASYNC_SLOTS 0
145   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
146     #define CYTHON_USE_ASYNC_SLOTS 1
147   #endif
148   #if PY_VERSION_HEX < 0x02070000
149     #undef CYTHON_USE_PYLONG_INTERNALS
150     #define CYTHON_USE_PYLONG_INTERNALS 0
151   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
152     #define CYTHON_USE_PYLONG_INTERNALS 1
153   #endif
154   #ifndef CYTHON_USE_PYLIST_INTERNALS
155     #define CYTHON_USE_PYLIST_INTERNALS 1
156   #endif
157   #ifndef CYTHON_USE_UNICODE_INTERNALS
158     #define CYTHON_USE_UNICODE_INTERNALS 1
159   #endif
160   #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
161     #undef CYTHON_USE_UNICODE_WRITER
162     #define CYTHON_USE_UNICODE_WRITER 0
163   #elif !defined(CYTHON_USE_UNICODE_WRITER)
164     #define CYTHON_USE_UNICODE_WRITER 1
165   #endif
166   #ifndef CYTHON_AVOID_BORROWED_REFS
167     #define CYTHON_AVOID_BORROWED_REFS 0
168   #endif
169   #ifndef CYTHON_ASSUME_SAFE_MACROS
170     #define CYTHON_ASSUME_SAFE_MACROS 1
171   #endif
172   #ifndef CYTHON_UNPACK_METHODS
173     #define CYTHON_UNPACK_METHODS 1
174   #endif
175   #ifndef CYTHON_FAST_THREAD_STATE
176     #define CYTHON_FAST_THREAD_STATE 1
177   #endif
178   #ifndef CYTHON_FAST_PYCALL
179     #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030B00A1)
180   #endif
181   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
182     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
183   #endif
184   #ifndef CYTHON_USE_TP_FINALIZE
185     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
186   #endif
187   #ifndef CYTHON_USE_DICT_VERSIONS
188     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
189   #endif
190   #ifndef CYTHON_USE_EXC_INFO_STACK
191     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
192   #endif
193 #endif
194 #if !defined(CYTHON_FAST_PYCCALL)
195 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
196 #endif
197 #if CYTHON_USE_PYLONG_INTERNALS
198   #if PY_MAJOR_VERSION < 3
199     #include "longintrepr.h"
200   #endif
201   #undef SHIFT
202   #undef BASE
203   #undef MASK
204   #ifdef SIZEOF_VOID_P
205     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
206   #endif
207 #endif
208 #ifndef __has_attribute
209   #define __has_attribute(x) 0
210 #endif
211 #ifndef __has_cpp_attribute
212   #define __has_cpp_attribute(x) 0
213 #endif
214 #ifndef CYTHON_RESTRICT
215   #if defined(__GNUC__)
216     #define CYTHON_RESTRICT __restrict__
217   #elif defined(_MSC_VER) && _MSC_VER >= 1400
218     #define CYTHON_RESTRICT __restrict
219   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
220     #define CYTHON_RESTRICT restrict
221   #else
222     #define CYTHON_RESTRICT
223   #endif
224 #endif
225 #ifndef CYTHON_UNUSED
226 # if defined(__GNUC__)
227 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
228 #     define CYTHON_UNUSED __attribute__ ((__unused__))
229 #   else
230 #     define CYTHON_UNUSED
231 #   endif
232 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
233 #   define CYTHON_UNUSED __attribute__ ((__unused__))
234 # else
235 #   define CYTHON_UNUSED
236 # endif
237 #endif
238 #ifndef CYTHON_MAYBE_UNUSED_VAR
239 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)240      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
241 #  else
242 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
243 #  endif
244 #endif
245 #ifndef CYTHON_NCP_UNUSED
246 # if CYTHON_COMPILING_IN_CPYTHON
247 #  define CYTHON_NCP_UNUSED
248 # else
249 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
250 # endif
251 #endif
252 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
253 #ifdef _MSC_VER
254     #ifndef _MSC_STDINT_H_
255         #if _MSC_VER < 1300
256            typedef unsigned char     uint8_t;
257            typedef unsigned int      uint32_t;
258         #else
259            typedef unsigned __int8   uint8_t;
260            typedef unsigned __int32  uint32_t;
261         #endif
262     #endif
263 #else
264    #include <stdint.h>
265 #endif
266 #ifndef CYTHON_FALLTHROUGH
267   #if defined(__cplusplus) && __cplusplus >= 201103L
268     #if __has_cpp_attribute(fallthrough)
269       #define CYTHON_FALLTHROUGH [[fallthrough]]
270     #elif __has_cpp_attribute(clang::fallthrough)
271       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
272     #elif __has_cpp_attribute(gnu::fallthrough)
273       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
274     #endif
275   #endif
276   #ifndef CYTHON_FALLTHROUGH
277     #if __has_attribute(fallthrough)
278       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
279     #else
280       #define CYTHON_FALLTHROUGH
281     #endif
282   #endif
283   #if defined(__clang__ ) && defined(__apple_build_version__)
284     #if __apple_build_version__ < 7000000
285       #undef  CYTHON_FALLTHROUGH
286       #define CYTHON_FALLTHROUGH
287     #endif
288   #endif
289 #endif
290 
291 #ifndef CYTHON_INLINE
292   #if defined(__clang__)
293     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
294   #elif defined(__GNUC__)
295     #define CYTHON_INLINE __inline__
296   #elif defined(_MSC_VER)
297     #define CYTHON_INLINE __inline
298   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
299     #define CYTHON_INLINE inline
300   #else
301     #define CYTHON_INLINE
302   #endif
303 #endif
304 
305 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
306   #define Py_OptimizeFlag 0
307 #endif
308 #define __PYX_BUILD_PY_SSIZE_T "n"
309 #define CYTHON_FORMAT_SSIZE_T "z"
310 #if PY_MAJOR_VERSION < 3
311   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
312   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
313           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
314   #define __Pyx_DefaultClassType PyClass_Type
315 #else
316   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
317   #define __Pyx_DefaultClassType PyType_Type
318 #if PY_VERSION_HEX >= 0x030B00A1
__Pyx_PyCode_New(int a,int k,int l,int s,int f,PyObject * code,PyObject * c,PyObject * n,PyObject * v,PyObject * fv,PyObject * cell,PyObject * fn,PyObject * name,int fline,PyObject * lnos)319     static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
320                                                     PyObject *code, PyObject *c, PyObject* n, PyObject *v,
321                                                     PyObject *fv, PyObject *cell, PyObject* fn,
322                                                     PyObject *name, int fline, PyObject *lnos) {
323         PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
324         PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
325         const char *fn_cstr=NULL;
326         const char *name_cstr=NULL;
327         PyCodeObject* co=NULL;
328         PyObject *type, *value, *traceback;
329         PyErr_Fetch(&type, &value, &traceback);
330         if (!(kwds=PyDict_New())) goto end;
331         if (!(argcount=PyLong_FromLong(a))) goto end;
332         if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
333         if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
334         if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
335         if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
336         if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
337         if (!(nlocals=PyLong_FromLong(l))) goto end;
338         if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
339         if (!(stacksize=PyLong_FromLong(s))) goto end;
340         if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
341         if (!(flags=PyLong_FromLong(f))) goto end;
342         if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
343         if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
344         if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
345         if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
346         if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
347         if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
348         if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
349         if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
350         if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
351         if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
352         if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
353         if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
354         if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
355         if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
356         Py_XDECREF((PyObject*)co);
357         co = (PyCodeObject*)call_result;
358         call_result = NULL;
359         if (0) {
360             cleanup_code_too:
361             Py_XDECREF((PyObject*)co);
362             co = NULL;
363         }
364         end:
365         Py_XDECREF(kwds);
366         Py_XDECREF(argcount);
367         Py_XDECREF(posonlyargcount);
368         Py_XDECREF(kwonlyargcount);
369         Py_XDECREF(nlocals);
370         Py_XDECREF(stacksize);
371         Py_XDECREF(replace);
372         Py_XDECREF(call_result);
373         Py_XDECREF(empty);
374         if (type) {
375             PyErr_Restore(type, value, traceback);
376         }
377         return co;
378     }
379 #else
380   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
381           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
382 #endif
383   #define __Pyx_DefaultClassType PyType_Type
384 #endif
385 #ifndef Py_TPFLAGS_CHECKTYPES
386   #define Py_TPFLAGS_CHECKTYPES 0
387 #endif
388 #ifndef Py_TPFLAGS_HAVE_INDEX
389   #define Py_TPFLAGS_HAVE_INDEX 0
390 #endif
391 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
392   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
393 #endif
394 #ifndef Py_TPFLAGS_HAVE_FINALIZE
395   #define Py_TPFLAGS_HAVE_FINALIZE 0
396 #endif
397 #ifndef METH_STACKLESS
398   #define METH_STACKLESS 0
399 #endif
400 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
401   #ifndef METH_FASTCALL
402      #define METH_FASTCALL 0x80
403   #endif
404   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
405   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
406                                                           Py_ssize_t nargs, PyObject *kwnames);
407 #else
408   #define __Pyx_PyCFunctionFast _PyCFunctionFast
409   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
410 #endif
411 #if CYTHON_FAST_PYCCALL
412 #define __Pyx_PyFastCFunction_Check(func)\
413     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
414 #else
415 #define __Pyx_PyFastCFunction_Check(func) 0
416 #endif
417 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
418   #define PyObject_Malloc(s)   PyMem_Malloc(s)
419   #define PyObject_Free(p)     PyMem_Free(p)
420   #define PyObject_Realloc(p)  PyMem_Realloc(p)
421 #endif
422 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
423   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
424   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
425   #define PyMem_RawFree(p)             PyMem_Free(p)
426 #endif
427 #if CYTHON_COMPILING_IN_PYSTON
428   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
429   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
430 #else
431   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
432   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
433 #endif
434 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
435   #define __Pyx_PyThreadState_Current PyThreadState_GET()
436 #elif PY_VERSION_HEX >= 0x03060000
437   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
438 #elif PY_VERSION_HEX >= 0x03000000
439   #define __Pyx_PyThreadState_Current PyThreadState_GET()
440 #else
441   #define __Pyx_PyThreadState_Current _PyThreadState_Current
442 #endif
443 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
444 #include "pythread.h"
445 #define Py_tss_NEEDS_INIT 0
446 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)447 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
448   *key = PyThread_create_key();
449   return 0;
450 }
PyThread_tss_alloc(void)451 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
452   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
453   *key = Py_tss_NEEDS_INIT;
454   return key;
455 }
PyThread_tss_free(Py_tss_t * key)456 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
457   PyObject_Free(key);
458 }
PyThread_tss_is_created(Py_tss_t * key)459 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
460   return *key != Py_tss_NEEDS_INIT;
461 }
PyThread_tss_delete(Py_tss_t * key)462 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
463   PyThread_delete_key(*key);
464   *key = Py_tss_NEEDS_INIT;
465 }
PyThread_tss_set(Py_tss_t * key,void * value)466 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
467   return PyThread_set_key_value(*key, value);
468 }
PyThread_tss_get(Py_tss_t * key)469 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
470   return PyThread_get_key_value(*key);
471 }
472 #endif
473 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
474 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
475 #else
476 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
477 #endif
478 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
479   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
480   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
481 #else
482   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
483   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
484 #endif
485 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
486 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
487 #else
488 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
489 #endif
490 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
491   #define CYTHON_PEP393_ENABLED 1
492   #if defined(PyUnicode_IS_READY)
493   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
494                                               0 : _PyUnicode_Ready((PyObject *)(op)))
495   #else
496   #define __Pyx_PyUnicode_READY(op)       (0)
497   #endif
498   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
499   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
500   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
501   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
502   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
503   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
504   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
505   #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
506   #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
507   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
508   #else
509   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
510   #endif
511   #else
512   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
513   #endif
514 #else
515   #define CYTHON_PEP393_ENABLED 0
516   #define PyUnicode_1BYTE_KIND  1
517   #define PyUnicode_2BYTE_KIND  2
518   #define PyUnicode_4BYTE_KIND  4
519   #define __Pyx_PyUnicode_READY(op)       (0)
520   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
521   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
522   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
523   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
524   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
525   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
526   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
527   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
528 #endif
529 #if CYTHON_COMPILING_IN_PYPY
530   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
531   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
532 #else
533   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
534   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
535       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
536 #endif
537 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
538   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
539 #endif
540 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
541   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
542 #endif
543 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
544   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
545 #endif
546 #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))
547 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
548 #if PY_MAJOR_VERSION >= 3
549   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
550 #else
551   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
552 #endif
553 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
554   #define PyObject_ASCII(o)            PyObject_Repr(o)
555 #endif
556 #if PY_MAJOR_VERSION >= 3
557   #define PyBaseString_Type            PyUnicode_Type
558   #define PyStringObject               PyUnicodeObject
559   #define PyString_Type                PyUnicode_Type
560   #define PyString_Check               PyUnicode_Check
561   #define PyString_CheckExact          PyUnicode_CheckExact
562 #ifndef PyObject_Unicode
563   #define PyObject_Unicode             PyObject_Str
564 #endif
565 #endif
566 #if PY_MAJOR_VERSION >= 3
567   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
568   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
569 #else
570   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
571   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
572 #endif
573 #ifndef PySet_CheckExact
574   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
575 #endif
576 #if PY_VERSION_HEX >= 0x030900A4
577   #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
578   #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
579 #else
580   #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
581   #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
582 #endif
583 #if CYTHON_ASSUME_SAFE_MACROS
584   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
585 #else
586   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
587 #endif
588 #if PY_MAJOR_VERSION >= 3
589   #define PyIntObject                  PyLongObject
590   #define PyInt_Type                   PyLong_Type
591   #define PyInt_Check(op)              PyLong_Check(op)
592   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
593   #define PyInt_FromString             PyLong_FromString
594   #define PyInt_FromUnicode            PyLong_FromUnicode
595   #define PyInt_FromLong               PyLong_FromLong
596   #define PyInt_FromSize_t             PyLong_FromSize_t
597   #define PyInt_FromSsize_t            PyLong_FromSsize_t
598   #define PyInt_AsLong                 PyLong_AsLong
599   #define PyInt_AS_LONG                PyLong_AS_LONG
600   #define PyInt_AsSsize_t              PyLong_AsSsize_t
601   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
602   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
603   #define PyNumber_Int                 PyNumber_Long
604 #endif
605 #if PY_MAJOR_VERSION >= 3
606   #define PyBoolObject                 PyLongObject
607 #endif
608 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
609   #ifndef PyUnicode_InternFromString
610     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
611   #endif
612 #endif
613 #if PY_VERSION_HEX < 0x030200A4
614   typedef long Py_hash_t;
615   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
616   #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsHash_t
617 #else
618   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
619   #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsSsize_t
620 #endif
621 #if PY_MAJOR_VERSION >= 3
622   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
623 #else
624   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
625 #endif
626 #if CYTHON_USE_ASYNC_SLOTS
627   #if PY_VERSION_HEX >= 0x030500B1
628     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
629     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
630   #else
631     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
632   #endif
633 #else
634   #define __Pyx_PyType_AsAsync(obj) NULL
635 #endif
636 #ifndef __Pyx_PyAsyncMethodsStruct
637     typedef struct {
638         unaryfunc am_await;
639         unaryfunc am_aiter;
640         unaryfunc am_anext;
641     } __Pyx_PyAsyncMethodsStruct;
642 #endif
643 
644 #if defined(WIN32) || defined(MS_WINDOWS)
645   #define _USE_MATH_DEFINES
646 #endif
647 #include <math.h>
648 #ifdef NAN
649 #define __PYX_NAN() ((float) NAN)
650 #else
__PYX_NAN()651 static CYTHON_INLINE float __PYX_NAN() {
652   float value;
653   memset(&value, 0xFF, sizeof(value));
654   return value;
655 }
656 #endif
657 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
658 #define __Pyx_truncl trunc
659 #else
660 #define __Pyx_truncl truncl
661 #endif
662 
663 #define __PYX_MARK_ERR_POS(f_index, lineno) \
664     { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
665 #define __PYX_ERR(f_index, lineno, Ln_error) \
666     { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
667 
668 #ifndef __PYX_EXTERN_C
669   #ifdef __cplusplus
670     #define __PYX_EXTERN_C extern "C"
671   #else
672     #define __PYX_EXTERN_C extern
673   #endif
674 #endif
675 
676 #define __PYX_HAVE__bx__bbi__bigbed_file
677 #define __PYX_HAVE_API__bx__bbi__bigbed_file
678 /* Early includes */
679 #include <string.h>
680 #include <stdio.h>
681 #include "numpy/arrayobject.h"
682 #include "numpy/ndarrayobject.h"
683 #include "numpy/ndarraytypes.h"
684 #include "numpy/arrayscalars.h"
685 #include "numpy/ufuncobject.h"
686 
687     /* NumPy API declarations from "numpy/__init__.pxd" */
688 
689 #ifdef _OPENMP
690 #include <omp.h>
691 #endif /* _OPENMP */
692 
693 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
694 #define CYTHON_WITHOUT_ASSERTIONS
695 #endif
696 
697 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
698                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
699 
700 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
701 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
702 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
703 #define __PYX_DEFAULT_STRING_ENCODING ""
704 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
705 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
706 #define __Pyx_uchar_cast(c) ((unsigned char)c)
707 #define __Pyx_long_cast(x) ((long)x)
708 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
709     (sizeof(type) < sizeof(Py_ssize_t))  ||\
710     (sizeof(type) > sizeof(Py_ssize_t) &&\
711           likely(v < (type)PY_SSIZE_T_MAX ||\
712                  v == (type)PY_SSIZE_T_MAX)  &&\
713           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
714                                 v == (type)PY_SSIZE_T_MIN)))  ||\
715     (sizeof(type) == sizeof(Py_ssize_t) &&\
716           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
717                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)718 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
719     return (size_t) i < (size_t) limit;
720 }
721 #if defined (__cplusplus) && __cplusplus >= 201103L
722     #include <cstdlib>
723     #define __Pyx_sst_abs(value) std::abs(value)
724 #elif SIZEOF_INT >= SIZEOF_SIZE_T
725     #define __Pyx_sst_abs(value) abs(value)
726 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
727     #define __Pyx_sst_abs(value) labs(value)
728 #elif defined (_MSC_VER)
729     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
730 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
731     #define __Pyx_sst_abs(value) llabs(value)
732 #elif defined (__GNUC__)
733     #define __Pyx_sst_abs(value) __builtin_llabs(value)
734 #else
735     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
736 #endif
737 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
738 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
739 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
740 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
741 #define __Pyx_PyBytes_FromString        PyBytes_FromString
742 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
743 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
744 #if PY_MAJOR_VERSION < 3
745     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
746     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
747 #else
748     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
749     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
750 #endif
751 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
752 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
753 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
754 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
755 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
756 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
757 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
758 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
759 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
760 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
761 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
762 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
763 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
764 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
765 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
766 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)767 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
768     const Py_UNICODE *u_end = u;
769     while (*u_end++) ;
770     return (size_t)(u_end - u - 1);
771 }
772 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
773 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
774 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
775 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
776 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
777 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
778 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
779 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
780 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
781 #define __Pyx_PySequence_Tuple(obj)\
782     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
783 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
784 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
785 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
786 #if CYTHON_ASSUME_SAFE_MACROS
787 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
788 #else
789 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
790 #endif
791 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
792 #if PY_MAJOR_VERSION >= 3
793 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
794 #else
795 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
796 #endif
797 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
798 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
799 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)800 static int __Pyx_init_sys_getdefaultencoding_params(void) {
801     PyObject* sys;
802     PyObject* default_encoding = NULL;
803     PyObject* ascii_chars_u = NULL;
804     PyObject* ascii_chars_b = NULL;
805     const char* default_encoding_c;
806     sys = PyImport_ImportModule("sys");
807     if (!sys) goto bad;
808     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
809     Py_DECREF(sys);
810     if (!default_encoding) goto bad;
811     default_encoding_c = PyBytes_AsString(default_encoding);
812     if (!default_encoding_c) goto bad;
813     if (strcmp(default_encoding_c, "ascii") == 0) {
814         __Pyx_sys_getdefaultencoding_not_ascii = 0;
815     } else {
816         char ascii_chars[128];
817         int c;
818         for (c = 0; c < 128; c++) {
819             ascii_chars[c] = c;
820         }
821         __Pyx_sys_getdefaultencoding_not_ascii = 1;
822         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
823         if (!ascii_chars_u) goto bad;
824         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
825         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
826             PyErr_Format(
827                 PyExc_ValueError,
828                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
829                 default_encoding_c);
830             goto bad;
831         }
832         Py_DECREF(ascii_chars_u);
833         Py_DECREF(ascii_chars_b);
834     }
835     Py_DECREF(default_encoding);
836     return 0;
837 bad:
838     Py_XDECREF(default_encoding);
839     Py_XDECREF(ascii_chars_u);
840     Py_XDECREF(ascii_chars_b);
841     return -1;
842 }
843 #endif
844 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
845 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
846 #else
847 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
848 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
849 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)850 static int __Pyx_init_sys_getdefaultencoding_params(void) {
851     PyObject* sys;
852     PyObject* default_encoding = NULL;
853     char* default_encoding_c;
854     sys = PyImport_ImportModule("sys");
855     if (!sys) goto bad;
856     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
857     Py_DECREF(sys);
858     if (!default_encoding) goto bad;
859     default_encoding_c = PyBytes_AsString(default_encoding);
860     if (!default_encoding_c) goto bad;
861     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
862     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
863     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
864     Py_DECREF(default_encoding);
865     return 0;
866 bad:
867     Py_XDECREF(default_encoding);
868     return -1;
869 }
870 #endif
871 #endif
872 
873 
874 /* Test for GCC > 2.95 */
875 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
876   #define likely(x)   __builtin_expect(!!(x), 1)
877   #define unlikely(x) __builtin_expect(!!(x), 0)
878 #else /* !__GNUC__ or GCC < 2.95 */
879   #define likely(x)   (x)
880   #define unlikely(x) (x)
881 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)882 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
883 
884 static PyObject *__pyx_m = NULL;
885 static PyObject *__pyx_d;
886 static PyObject *__pyx_b;
887 static PyObject *__pyx_cython_runtime = NULL;
888 static PyObject *__pyx_empty_tuple;
889 static PyObject *__pyx_empty_bytes;
890 static PyObject *__pyx_empty_unicode;
891 static int __pyx_lineno;
892 static int __pyx_clineno = 0;
893 static const char * __pyx_cfilenm= __FILE__;
894 static const char *__pyx_filename;
895 
896 /* Header.proto */
897 #if !defined(CYTHON_CCOMPLEX)
898   #if defined(__cplusplus)
899     #define CYTHON_CCOMPLEX 1
900   #elif defined(_Complex_I)
901     #define CYTHON_CCOMPLEX 1
902   #else
903     #define CYTHON_CCOMPLEX 0
904   #endif
905 #endif
906 #if CYTHON_CCOMPLEX
907   #ifdef __cplusplus
908     #include <complex>
909   #else
910     #include <complex.h>
911   #endif
912 #endif
913 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
914   #undef _Complex_I
915   #define _Complex_I 1.0fj
916 #endif
917 
918 
919 static const char *__pyx_f[] = {
920   "lib/bx/bbi/bigbed_file.pyx",
921   "stringsource",
922   "__init__.pxd",
923   "lib/bx/bbi/bpt_file.pxd",
924   "lib/bx/bbi/cirtree_file.pxd",
925   "type.pxd",
926   "lib/bx/bbi/bbi_file.pxd",
927 };
928 
929 /* "types.pxd":1
930  * ctypedef unsigned char UBYTE             # <<<<<<<<<<<<<<
931  * ctypedef signed char BYTE
932  * ctypedef unsigned short UWORD
933  */
934 typedef unsigned char __pyx_t_2bx_3bbi_5types_UBYTE;
935 
936 /* "types.pxd":2
937  * ctypedef unsigned char UBYTE
938  * ctypedef signed char BYTE             # <<<<<<<<<<<<<<
939  * ctypedef unsigned short UWORD
940  * ctypedef short WORD
941  */
942 typedef signed char __pyx_t_2bx_3bbi_5types_BYTE;
943 
944 /* "types.pxd":3
945  * ctypedef unsigned char UBYTE
946  * ctypedef signed char BYTE
947  * ctypedef unsigned short UWORD             # <<<<<<<<<<<<<<
948  * ctypedef short WORD
949  * ctypedef unsigned long long bits64
950  */
951 typedef unsigned short __pyx_t_2bx_3bbi_5types_UWORD;
952 
953 /* "types.pxd":4
954  * ctypedef signed char BYTE
955  * ctypedef unsigned short UWORD
956  * ctypedef short WORD             # <<<<<<<<<<<<<<
957  * ctypedef unsigned long long bits64
958  * ctypedef unsigned bits32
959  */
960 typedef short __pyx_t_2bx_3bbi_5types_WORD;
961 
962 /* "types.pxd":5
963  * ctypedef unsigned short UWORD
964  * ctypedef short WORD
965  * ctypedef unsigned long long bits64             # <<<<<<<<<<<<<<
966  * ctypedef unsigned bits32
967  * ctypedef unsigned short bits16
968  */
969 typedef unsigned PY_LONG_LONG __pyx_t_2bx_3bbi_5types_bits64;
970 
971 /* "types.pxd":6
972  * ctypedef short WORD
973  * ctypedef unsigned long long bits64
974  * ctypedef unsigned bits32             # <<<<<<<<<<<<<<
975  * ctypedef unsigned short bits16
976  * ctypedef unsigned char bits8
977  */
978 typedef unsigned int __pyx_t_2bx_3bbi_5types_bits32;
979 
980 /* "types.pxd":7
981  * ctypedef unsigned long long bits64
982  * ctypedef unsigned bits32
983  * ctypedef unsigned short bits16             # <<<<<<<<<<<<<<
984  * ctypedef unsigned char bits8
985  * ctypedef int signed32
986  */
987 typedef unsigned short __pyx_t_2bx_3bbi_5types_bits16;
988 
989 /* "types.pxd":8
990  * ctypedef unsigned bits32
991  * ctypedef unsigned short bits16
992  * ctypedef unsigned char bits8             # <<<<<<<<<<<<<<
993  * ctypedef int signed32
994  *
995  */
996 typedef unsigned char __pyx_t_2bx_3bbi_5types_bits8;
997 
998 /* "types.pxd":9
999  * ctypedef unsigned short bits16
1000  * ctypedef unsigned char bits8
1001  * ctypedef int signed32             # <<<<<<<<<<<<<<
1002  *
1003  * ctypedef bint boolean
1004  */
1005 typedef int __pyx_t_2bx_3bbi_5types_signed32;
1006 
1007 /* "types.pxd":11
1008  * ctypedef int signed32
1009  *
1010  * ctypedef bint boolean             # <<<<<<<<<<<<<<
1011  *
1012  */
1013 typedef int __pyx_t_2bx_3bbi_5types_boolean;
1014 
1015 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":690
1016  * # in Cython to enable them only on the right systems.
1017  *
1018  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
1019  * ctypedef npy_int16      int16_t
1020  * ctypedef npy_int32      int32_t
1021  */
1022 typedef npy_int8 __pyx_t_5numpy_int8_t;
1023 
1024 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":691
1025  *
1026  * ctypedef npy_int8       int8_t
1027  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
1028  * ctypedef npy_int32      int32_t
1029  * ctypedef npy_int64      int64_t
1030  */
1031 typedef npy_int16 __pyx_t_5numpy_int16_t;
1032 
1033 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":692
1034  * ctypedef npy_int8       int8_t
1035  * ctypedef npy_int16      int16_t
1036  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
1037  * ctypedef npy_int64      int64_t
1038  * #ctypedef npy_int96      int96_t
1039  */
1040 typedef npy_int32 __pyx_t_5numpy_int32_t;
1041 
1042 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":693
1043  * ctypedef npy_int16      int16_t
1044  * ctypedef npy_int32      int32_t
1045  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
1046  * #ctypedef npy_int96      int96_t
1047  * #ctypedef npy_int128     int128_t
1048  */
1049 typedef npy_int64 __pyx_t_5numpy_int64_t;
1050 
1051 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":697
1052  * #ctypedef npy_int128     int128_t
1053  *
1054  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
1055  * ctypedef npy_uint16     uint16_t
1056  * ctypedef npy_uint32     uint32_t
1057  */
1058 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1059 
1060 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":698
1061  *
1062  * ctypedef npy_uint8      uint8_t
1063  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
1064  * ctypedef npy_uint32     uint32_t
1065  * ctypedef npy_uint64     uint64_t
1066  */
1067 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1068 
1069 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":699
1070  * ctypedef npy_uint8      uint8_t
1071  * ctypedef npy_uint16     uint16_t
1072  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
1073  * ctypedef npy_uint64     uint64_t
1074  * #ctypedef npy_uint96     uint96_t
1075  */
1076 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1077 
1078 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":700
1079  * ctypedef npy_uint16     uint16_t
1080  * ctypedef npy_uint32     uint32_t
1081  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
1082  * #ctypedef npy_uint96     uint96_t
1083  * #ctypedef npy_uint128    uint128_t
1084  */
1085 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1086 
1087 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":704
1088  * #ctypedef npy_uint128    uint128_t
1089  *
1090  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
1091  * ctypedef npy_float64    float64_t
1092  * #ctypedef npy_float80    float80_t
1093  */
1094 typedef npy_float32 __pyx_t_5numpy_float32_t;
1095 
1096 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":705
1097  *
1098  * ctypedef npy_float32    float32_t
1099  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
1100  * #ctypedef npy_float80    float80_t
1101  * #ctypedef npy_float128   float128_t
1102  */
1103 typedef npy_float64 __pyx_t_5numpy_float64_t;
1104 
1105 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":714
1106  * # The int types are mapped a bit surprising --
1107  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1108  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
1109  * ctypedef npy_longlong   long_t
1110  * ctypedef npy_longlong   longlong_t
1111  */
1112 typedef npy_long __pyx_t_5numpy_int_t;
1113 
1114 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":715
1115  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1116  * ctypedef npy_long       int_t
1117  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
1118  * ctypedef npy_longlong   longlong_t
1119  *
1120  */
1121 typedef npy_longlong __pyx_t_5numpy_long_t;
1122 
1123 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":716
1124  * ctypedef npy_long       int_t
1125  * ctypedef npy_longlong   long_t
1126  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
1127  *
1128  * ctypedef npy_ulong      uint_t
1129  */
1130 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1131 
1132 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":718
1133  * ctypedef npy_longlong   longlong_t
1134  *
1135  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
1136  * ctypedef npy_ulonglong  ulong_t
1137  * ctypedef npy_ulonglong  ulonglong_t
1138  */
1139 typedef npy_ulong __pyx_t_5numpy_uint_t;
1140 
1141 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":719
1142  *
1143  * ctypedef npy_ulong      uint_t
1144  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
1145  * ctypedef npy_ulonglong  ulonglong_t
1146  *
1147  */
1148 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1149 
1150 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":720
1151  * ctypedef npy_ulong      uint_t
1152  * ctypedef npy_ulonglong  ulong_t
1153  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
1154  *
1155  * ctypedef npy_intp       intp_t
1156  */
1157 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1158 
1159 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":722
1160  * ctypedef npy_ulonglong  ulonglong_t
1161  *
1162  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1163  * ctypedef npy_uintp      uintp_t
1164  *
1165  */
1166 typedef npy_intp __pyx_t_5numpy_intp_t;
1167 
1168 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":723
1169  *
1170  * ctypedef npy_intp       intp_t
1171  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1172  *
1173  * ctypedef npy_double     float_t
1174  */
1175 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1176 
1177 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":725
1178  * ctypedef npy_uintp      uintp_t
1179  *
1180  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1181  * ctypedef npy_double     double_t
1182  * ctypedef npy_longdouble longdouble_t
1183  */
1184 typedef npy_double __pyx_t_5numpy_float_t;
1185 
1186 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":726
1187  *
1188  * ctypedef npy_double     float_t
1189  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1190  * ctypedef npy_longdouble longdouble_t
1191  *
1192  */
1193 typedef npy_double __pyx_t_5numpy_double_t;
1194 
1195 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":727
1196  * ctypedef npy_double     float_t
1197  * ctypedef npy_double     double_t
1198  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1199  *
1200  * ctypedef npy_cfloat      cfloat_t
1201  */
1202 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1203 /* Declarations.proto */
1204 #if CYTHON_CCOMPLEX
1205   #ifdef __cplusplus
1206     typedef ::std::complex< float > __pyx_t_float_complex;
1207   #else
1208     typedef float _Complex __pyx_t_float_complex;
1209   #endif
1210 #else
1211     typedef struct { float real, imag; } __pyx_t_float_complex;
1212 #endif
1213 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1214 
1215 /* Declarations.proto */
1216 #if CYTHON_CCOMPLEX
1217   #ifdef __cplusplus
1218     typedef ::std::complex< double > __pyx_t_double_complex;
1219   #else
1220     typedef double _Complex __pyx_t_double_complex;
1221   #endif
1222 #else
1223     typedef struct { double real, imag; } __pyx_t_double_complex;
1224 #endif
1225 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1226 
1227 
1228 /*--- Type declarations ---*/
1229 struct __pyx_obj_2bx_3bbi_8bpt_file_BPTFile;
1230 struct __pyx_obj_2bx_3bbi_12cirtree_file_CIRTreeFile;
1231 struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock;
1232 struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData;
1233 struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler;
1234 struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile;
1235 struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler;
1236 struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler;
1237 struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler;
1238 struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile;
1239 
1240 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":729
1241  * ctypedef npy_longdouble longdouble_t
1242  *
1243  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1244  * ctypedef npy_cdouble     cdouble_t
1245  * ctypedef npy_clongdouble clongdouble_t
1246  */
1247 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1248 
1249 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":730
1250  *
1251  * ctypedef npy_cfloat      cfloat_t
1252  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1253  * ctypedef npy_clongdouble clongdouble_t
1254  *
1255  */
1256 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1257 
1258 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":731
1259  * ctypedef npy_cfloat      cfloat_t
1260  * ctypedef npy_cdouble     cdouble_t
1261  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1262  *
1263  * ctypedef npy_cdouble     complex_t
1264  */
1265 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1266 
1267 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":733
1268  * ctypedef npy_clongdouble clongdouble_t
1269  *
1270  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1271  *
1272  * cdef inline object PyArray_MultiIterNew1(a):
1273  */
1274 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1275 
1276 /* "bpt_file.pxd":5
1277  * from types cimport *
1278  *
1279  * cdef class BPTFile:             # <<<<<<<<<<<<<<
1280  *     """
1281  *     On disk B+ tree compatible with Jim Kent's bPlusTree.c
1282  */
1283 struct __pyx_obj_2bx_3bbi_8bpt_file_BPTFile {
1284   PyObject_HEAD
1285   PyObject *file;
1286   PyObject *reader;
1287   __pyx_t_2bx_3bbi_5types_boolean is_byteswapped;
1288   __pyx_t_2bx_3bbi_5types_bits32 block_size;
1289   __pyx_t_2bx_3bbi_5types_bits32 key_size;
1290   __pyx_t_2bx_3bbi_5types_bits32 value_size;
1291   __pyx_t_2bx_3bbi_5types_bits64 item_count;
1292   __pyx_t_2bx_3bbi_5types_bits64 root_offset;
1293 };
1294 
1295 
1296 /* "cirtree_file.pxd":3
1297  * from types cimport *
1298  *
1299  * cdef class CIRTreeFile:             # <<<<<<<<<<<<<<
1300  *     cdef object file
1301  *     cdef object reader
1302  */
1303 struct __pyx_obj_2bx_3bbi_12cirtree_file_CIRTreeFile {
1304   PyObject_HEAD
1305   PyObject *file;
1306   PyObject *reader;
1307   __pyx_t_2bx_3bbi_5types_boolean is_byteswapped;
1308   __pyx_t_2bx_3bbi_5types_bits64 root_offset;
1309   __pyx_t_2bx_3bbi_5types_bits32 block_size;
1310   __pyx_t_2bx_3bbi_5types_bits64 item_count;
1311   __pyx_t_2bx_3bbi_5types_bits32 start_chrom_ix;
1312   __pyx_t_2bx_3bbi_5types_bits32 start_base;
1313   __pyx_t_2bx_3bbi_5types_bits32 end_chrom_ix;
1314   __pyx_t_2bx_3bbi_5types_bits32 end_base;
1315   __pyx_t_2bx_3bbi_5types_bits64 file_size;
1316   __pyx_t_2bx_3bbi_5types_bits32 items_per_slot;
1317 };
1318 
1319 
1320 /* "bbi_file.pxd":8
1321  * cimport numpy
1322  *
1323  * cdef class SummaryBlock:             # <<<<<<<<<<<<<<
1324  *     """
1325  *     A block of summary data from disk
1326  */
1327 struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock {
1328   PyObject_HEAD
1329   __pyx_t_2bx_3bbi_5types_bits32 chrom_id;
1330   __pyx_t_2bx_3bbi_5types_bits32 start;
1331   __pyx_t_2bx_3bbi_5types_bits32 end;
1332   __pyx_t_2bx_3bbi_5types_bits32 valid_count;
1333   double min_val;
1334   double max_val;
1335   double sum_data;
1336   double sum_squares;
1337 };
1338 
1339 
1340 /* "bbi_file.pxd":21
1341  *     cdef public double sum_squares
1342  *
1343  * cdef class SummarizedData:             # <<<<<<<<<<<<<<
1344  *     """
1345  *     The result of using SummaryBlocks read from the file to produce a
1346  */
1347 struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData {
1348   PyObject_HEAD
1349   struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_SummarizedData *__pyx_vtab;
1350   __pyx_t_2bx_3bbi_5types_bits32 start;
1351   __pyx_t_2bx_3bbi_5types_bits32 end;
1352   int size;
1353   PyArrayObject *valid_count;
1354   PyArrayObject *min_val;
1355   PyArrayObject *max_val;
1356   PyArrayObject *sum_data;
1357   PyArrayObject *sum_squares;
1358 };
1359 
1360 
1361 /* "bbi_file.pxd":39
1362  * cdef class BBIFile
1363  *
1364  * cdef class BlockHandler:             # <<<<<<<<<<<<<<
1365  *     """
1366  *     Callback for `BBIFile.visit_blocks_in_region`
1367  */
1368 struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler {
1369   PyObject_HEAD
1370   struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BlockHandler *__pyx_vtab;
1371 };
1372 
1373 
1374 /* "bbi_file.pxd":37
1375  *     cdef accumulate_interval_value( self, bits32 s, bits32 e, float val )
1376  *
1377  * cdef class BBIFile             # <<<<<<<<<<<<<<
1378  *
1379  * cdef class BlockHandler:
1380  */
1381 struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile {
1382   PyObject_HEAD
1383   struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BBIFile *__pyx_vtab;
1384   PyObject *file;
1385   PyObject *reader;
1386   __pyx_t_2bx_3bbi_5types_bits32 magic;
1387   __pyx_t_2bx_3bbi_5types_boolean is_byteswapped;
1388   struct __pyx_obj_2bx_3bbi_8bpt_file_BPTFile *chrom_bpt;
1389   __pyx_t_2bx_3bbi_5types_bits16 version;
1390   __pyx_t_2bx_3bbi_5types_bits16 zoom_levels;
1391   __pyx_t_2bx_3bbi_5types_bits64 chrom_tree_offset;
1392   __pyx_t_2bx_3bbi_5types_bits64 unzoomed_data_offset;
1393   __pyx_t_2bx_3bbi_5types_bits64 unzoomed_index_offset;
1394   __pyx_t_2bx_3bbi_5types_bits16 field_count;
1395   __pyx_t_2bx_3bbi_5types_bits16 defined_field_count;
1396   __pyx_t_2bx_3bbi_5types_bits64 as_offset;
1397   __pyx_t_2bx_3bbi_5types_bits64 total_summary_offset;
1398   __pyx_t_2bx_3bbi_5types_bits32 uncompress_buf_size;
1399   PyObject *level_list;
1400 };
1401 
1402 
1403 /* "bx/bbi/bigbed_file.pyx":20
1404  *     return min( end1, end2 ) - max( start1, start2 )
1405  *
1406  * cdef class BigBedBlockHandler( BlockHandler ):             # <<<<<<<<<<<<<<
1407  *     """
1408  *     BlockHandler that parses the block into a series of BED records
1409  */
1410 struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler {
1411   struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler __pyx_base;
1412   __pyx_t_2bx_3bbi_5types_bits32 chrom_id;
1413   __pyx_t_2bx_3bbi_5types_bits32 start;
1414   __pyx_t_2bx_3bbi_5types_bits32 end;
1415 };
1416 
1417 
1418 /* "bx/bbi/bigbed_file.pyx":54
1419  *         pass
1420  *
1421  * cdef class SummarizingBlockHandler( BigBedBlockHandler ):             # <<<<<<<<<<<<<<
1422  *     """
1423  *     Accumulates intervals into a SummarizedData
1424  */
1425 struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler {
1426   struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler __pyx_base;
1427   struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *sd;
1428 };
1429 
1430 
1431 /* "bx/bbi/bigbed_file.pyx":73
1432  *         self.sd.accumulate_interval_value( s, e, 1 )
1433  *
1434  * cdef class IntervalAccumulatingBlockHandler( BigBedBlockHandler ):             # <<<<<<<<<<<<<<
1435  *     cdef list intervals
1436  *     """
1437  */
1438 struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler {
1439   struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler __pyx_base;
1440   PyObject *intervals;
1441 };
1442 
1443 
1444 /* "bx/bbi/bigbed_file.pyx":85
1445  *         self.intervals.append( ( s, e, rest ) )
1446  *
1447  * cdef class BigBedFile( BBIFile ):             # <<<<<<<<<<<<<<
1448  *     """
1449  *     A "big binary indexed" file whose raw data is in BED format.
1450  */
1451 struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile {
1452   struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile __pyx_base;
1453 };
1454 
1455 
1456 
1457 /* "bbi_file.pxd":21
1458  *     cdef public double sum_squares
1459  *
1460  * cdef class SummarizedData:             # <<<<<<<<<<<<<<
1461  *     """
1462  *     The result of using SummaryBlocks read from the file to produce a
1463  */
1464 
1465 struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_SummarizedData {
1466   PyObject *(*accumulate_interval_value)(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, float);
1467 };
1468 static struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_SummarizedData *__pyx_vtabptr_2bx_3bbi_8bbi_file_SummarizedData;
1469 
1470 
1471 /* "bbi_file.pxd":37
1472  *     cdef accumulate_interval_value( self, bits32 s, bits32 e, float val )
1473  *
1474  * cdef class BBIFile             # <<<<<<<<<<<<<<
1475  *
1476  * cdef class BlockHandler:
1477  */
1478 
1479 struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BBIFile {
1480   PyObject *(*visit_blocks_in_region)(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *);
1481   PyObject *(*_get_chrom_id_and_size)(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *, char *);
1482   PyObject *(*_best_zoom_level)(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *, int);
1483   PyObject *(*summarize)(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *, PyObject *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, int, int __pyx_skip_dispatch);
1484   PyObject *(*summarize_from_full)(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *, char *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, int, int __pyx_skip_dispatch);
1485   PyObject *(*query)(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *, PyObject *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, int, int __pyx_skip_dispatch);
1486   PyObject *(*_summarize_from_full)(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, int);
1487 };
1488 static struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BBIFile *__pyx_vtabptr_2bx_3bbi_8bbi_file_BBIFile;
1489 
1490 
1491 /* "bbi_file.pxd":39
1492  * cdef class BBIFile
1493  *
1494  * cdef class BlockHandler:             # <<<<<<<<<<<<<<
1495  *     """
1496  *     Callback for `BBIFile.visit_blocks_in_region`
1497  */
1498 
1499 struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BlockHandler {
1500   PyObject *(*handle_block)(struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *, PyObject *, struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *);
1501 };
1502 static struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BlockHandler *__pyx_vtabptr_2bx_3bbi_8bbi_file_BlockHandler;
1503 
1504 
1505 /* "bx/bbi/bigbed_file.pyx":20
1506  *     return min( end1, end2 ) - max( start1, start2 )
1507  *
1508  * cdef class BigBedBlockHandler( BlockHandler ):             # <<<<<<<<<<<<<<
1509  *     """
1510  *     BlockHandler that parses the block into a series of BED records
1511  */
1512 
1513 struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_BigBedBlockHandler {
1514   struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BlockHandler __pyx_base;
1515   PyObject *(*handle_interval_value)(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, PyObject *);
1516 };
1517 static struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_BigBedBlockHandler *__pyx_vtabptr_2bx_3bbi_11bigbed_file_BigBedBlockHandler;
1518 
1519 
1520 /* "bx/bbi/bigbed_file.pyx":54
1521  *         pass
1522  *
1523  * cdef class SummarizingBlockHandler( BigBedBlockHandler ):             # <<<<<<<<<<<<<<
1524  *     """
1525  *     Accumulates intervals into a SummarizedData
1526  */
1527 
1528 struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_SummarizingBlockHandler {
1529   struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_BigBedBlockHandler __pyx_base;
1530 };
1531 static struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *__pyx_vtabptr_2bx_3bbi_11bigbed_file_SummarizingBlockHandler;
1532 
1533 
1534 /* "bx/bbi/bigbed_file.pyx":73
1535  *         self.sd.accumulate_interval_value( s, e, 1 )
1536  *
1537  * cdef class IntervalAccumulatingBlockHandler( BigBedBlockHandler ):             # <<<<<<<<<<<<<<
1538  *     cdef list intervals
1539  *     """
1540  */
1541 
1542 struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler {
1543   struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_BigBedBlockHandler __pyx_base;
1544 };
1545 static struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *__pyx_vtabptr_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler;
1546 
1547 
1548 /* "bx/bbi/bigbed_file.pyx":85
1549  *         self.intervals.append( ( s, e, rest ) )
1550  *
1551  * cdef class BigBedFile( BBIFile ):             # <<<<<<<<<<<<<<
1552  *     """
1553  *     A "big binary indexed" file whose raw data is in BED format.
1554  */
1555 
1556 struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_BigBedFile {
1557   struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BBIFile __pyx_base;
1558   PyObject *(*get)(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *, char *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, int __pyx_skip_dispatch);
1559 };
1560 static struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_BigBedFile *__pyx_vtabptr_2bx_3bbi_11bigbed_file_BigBedFile;
1561 
1562 /* --- Runtime support code (head) --- */
1563 /* Refnanny.proto */
1564 #ifndef CYTHON_REFNANNY
1565   #define CYTHON_REFNANNY 0
1566 #endif
1567 #if CYTHON_REFNANNY
1568   typedef struct {
1569     void (*INCREF)(void*, PyObject*, int);
1570     void (*DECREF)(void*, PyObject*, int);
1571     void (*GOTREF)(void*, PyObject*, int);
1572     void (*GIVEREF)(void*, PyObject*, int);
1573     void* (*SetupContext)(const char*, int, const char*);
1574     void (*FinishContext)(void**);
1575   } __Pyx_RefNannyAPIStruct;
1576   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1577   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1578   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1579 #ifdef WITH_THREAD
1580   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1581           if (acquire_gil) {\
1582               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1583               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1584               PyGILState_Release(__pyx_gilstate_save);\
1585           } else {\
1586               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1587           }
1588 #else
1589   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1590           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1591 #endif
1592   #define __Pyx_RefNannyFinishContext()\
1593           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1594   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1595   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1596   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1597   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1598   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1599   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1600   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1601   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1602 #else
1603   #define __Pyx_RefNannyDeclarations
1604   #define __Pyx_RefNannySetupContext(name, acquire_gil)
1605   #define __Pyx_RefNannyFinishContext()
1606   #define __Pyx_INCREF(r) Py_INCREF(r)
1607   #define __Pyx_DECREF(r) Py_DECREF(r)
1608   #define __Pyx_GOTREF(r)
1609   #define __Pyx_GIVEREF(r)
1610   #define __Pyx_XINCREF(r) Py_XINCREF(r)
1611   #define __Pyx_XDECREF(r) Py_XDECREF(r)
1612   #define __Pyx_XGOTREF(r)
1613   #define __Pyx_XGIVEREF(r)
1614 #endif
1615 #define __Pyx_XDECREF_SET(r, v) do {\
1616         PyObject *tmp = (PyObject *) r;\
1617         r = v; __Pyx_XDECREF(tmp);\
1618     } while (0)
1619 #define __Pyx_DECREF_SET(r, v) do {\
1620         PyObject *tmp = (PyObject *) r;\
1621         r = v; __Pyx_DECREF(tmp);\
1622     } while (0)
1623 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1624 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1625 
1626 /* PyObjectGetAttrStr.proto */
1627 #if CYTHON_USE_TYPE_SLOTS
1628 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1629 #else
1630 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1631 #endif
1632 
1633 /* GetBuiltinName.proto */
1634 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1635 
1636 /* RaiseArgTupleInvalid.proto */
1637 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1638     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1639 
1640 /* RaiseDoubleKeywords.proto */
1641 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1642 
1643 /* ParseKeywords.proto */
1644 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1645     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1646     const char* function_name);
1647 
1648 /* PyCFunctionFastCall.proto */
1649 #if CYTHON_FAST_PYCCALL
1650 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1651 #else
1652 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
1653 #endif
1654 
1655 /* PyFunctionFastCall.proto */
1656 #if CYTHON_FAST_PYCALL
1657 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1658     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1659 #if 1 || PY_VERSION_HEX < 0x030600B1
1660 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1661 #else
1662 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1663 #endif
1664 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1665     (sizeof(char [1 - 2*!(cond)]) - 1)
1666 #ifndef Py_MEMBER_SIZE
1667 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1668 #endif
1669 #if CYTHON_FAST_PYCALL
1670   static size_t __pyx_pyframe_localsplus_offset = 0;
1671   #include "frameobject.h"
1672   #define __Pxy_PyFrame_Initialize_Offsets()\
1673     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1674      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1675   #define __Pyx_PyFrame_GetLocalsplus(frame)\
1676     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1677 #endif // CYTHON_FAST_PYCALL
1678 #endif
1679 
1680 /* PyObjectCall.proto */
1681 #if CYTHON_COMPILING_IN_CPYTHON
1682 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1683 #else
1684 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1685 #endif
1686 
1687 /* PyObjectCall2Args.proto */
1688 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1689 
1690 /* PyObjectCallMethO.proto */
1691 #if CYTHON_COMPILING_IN_CPYTHON
1692 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1693 #endif
1694 
1695 /* PyObjectCallOneArg.proto */
1696 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1697 
1698 /* PyDictVersioning.proto */
1699 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1700 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
1701 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
1702 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1703     (version_var) = __PYX_GET_DICT_VERSION(dict);\
1704     (cache_var) = (value);
1705 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1706     static PY_UINT64_T __pyx_dict_version = 0;\
1707     static PyObject *__pyx_dict_cached_value = NULL;\
1708     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1709         (VAR) = __pyx_dict_cached_value;\
1710     } else {\
1711         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1712         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1713     }\
1714 }
1715 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1716 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1717 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1718 #else
1719 #define __PYX_GET_DICT_VERSION(dict)  (0)
1720 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1721 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
1722 #endif
1723 
1724 /* GetModuleGlobalName.proto */
1725 #if CYTHON_USE_DICT_VERSIONS
1726 #define __Pyx_GetModuleGlobalName(var, name)  {\
1727     static PY_UINT64_T __pyx_dict_version = 0;\
1728     static PyObject *__pyx_dict_cached_value = NULL;\
1729     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1730         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1731         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1732 }
1733 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
1734     PY_UINT64_T __pyx_dict_version;\
1735     PyObject *__pyx_dict_cached_value;\
1736     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1737 }
1738 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1739 #else
1740 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1741 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1742 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1743 #endif
1744 
1745 /* PyObjectCallNoArg.proto */
1746 #if CYTHON_COMPILING_IN_CPYTHON
1747 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1748 #else
1749 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1750 #endif
1751 
1752 /* PyErrExceptionMatches.proto */
1753 #if CYTHON_FAST_THREAD_STATE
1754 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1755 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1756 #else
1757 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
1758 #endif
1759 
1760 /* PyThreadStateGet.proto */
1761 #if CYTHON_FAST_THREAD_STATE
1762 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
1763 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
1764 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
1765 #else
1766 #define __Pyx_PyThreadState_declare
1767 #define __Pyx_PyThreadState_assign
1768 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
1769 #endif
1770 
1771 /* PyErrFetchRestore.proto */
1772 #if CYTHON_FAST_THREAD_STATE
1773 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1774 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1775 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1776 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1777 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1778 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1779 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1780 #if CYTHON_COMPILING_IN_CPYTHON
1781 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1782 #else
1783 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1784 #endif
1785 #else
1786 #define __Pyx_PyErr_Clear() PyErr_Clear()
1787 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1788 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
1789 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
1790 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
1791 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
1792 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
1793 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
1794 #endif
1795 
1796 /* GetAttr.proto */
1797 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1798 
1799 /* GetAttr3.proto */
1800 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1801 
1802 /* SetItemInt.proto */
1803 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1804     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1805     __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
1806     (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
1807                __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
1808 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1809 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
1810                                                int is_list, int wraparound, int boundscheck);
1811 
1812 /* ListAppend.proto */
1813 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)1814 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1815     PyListObject* L = (PyListObject*) list;
1816     Py_ssize_t len = Py_SIZE(list);
1817     if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1818         Py_INCREF(x);
1819         PyList_SET_ITEM(list, len, x);
1820         __Pyx_SET_SIZE(list, len + 1);
1821         return 0;
1822     }
1823     return PyList_Append(list, x);
1824 }
1825 #else
1826 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1827 #endif
1828 
1829 /* GetItemInt.proto */
1830 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1831     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1832     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1833     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1834                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1835 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1836     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1837     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1838     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1839 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1840                                                               int wraparound, int boundscheck);
1841 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1842     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1843     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1844     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1845 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1846                                                               int wraparound, int boundscheck);
1847 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1848 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1849                                                      int is_list, int wraparound, int boundscheck);
1850 
1851 /* RaiseTooManyValuesToUnpack.proto */
1852 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1853 
1854 /* RaiseNeedMoreValuesToUnpack.proto */
1855 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1856 
1857 /* IterFinish.proto */
1858 static CYTHON_INLINE int __Pyx_IterFinish(void);
1859 
1860 /* UnpackItemEndCheck.proto */
1861 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1862 
1863 /* Import.proto */
1864 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1865 
1866 /* ImportFrom.proto */
1867 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1868 
1869 /* RaiseException.proto */
1870 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1871 
1872 /* HasAttr.proto */
1873 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1874 
1875 /* ExtTypeTest.proto */
1876 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1877 
1878 /* GetTopmostException.proto */
1879 #if CYTHON_USE_EXC_INFO_STACK
1880 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1881 #endif
1882 
1883 /* SaveResetException.proto */
1884 #if CYTHON_FAST_THREAD_STATE
1885 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1886 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1887 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1888 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1889 #else
1890 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
1891 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
1892 #endif
1893 
1894 /* GetException.proto */
1895 #if CYTHON_FAST_THREAD_STATE
1896 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
1897 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1898 #else
1899 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1900 #endif
1901 
1902 /* CallNextTpDealloc.proto */
1903 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
1904 
1905 /* CallNextTpTraverse.proto */
1906 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
1907 
1908 /* CallNextTpClear.proto */
1909 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
1910 
1911 /* TypeImport.proto */
1912 #ifndef __PYX_HAVE_RT_ImportType_proto
1913 #define __PYX_HAVE_RT_ImportType_proto
1914 enum __Pyx_ImportType_CheckSize {
1915    __Pyx_ImportType_CheckSize_Error = 0,
1916    __Pyx_ImportType_CheckSize_Warn = 1,
1917    __Pyx_ImportType_CheckSize_Ignore = 2
1918 };
1919 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1920 #endif
1921 
1922 /* GetVTable.proto */
1923 static void* __Pyx_GetVtable(PyObject *dict);
1924 
1925 /* PyObject_GenericGetAttrNoDict.proto */
1926 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1927 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1928 #else
1929 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1930 #endif
1931 
1932 /* PyObject_GenericGetAttr.proto */
1933 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1934 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1935 #else
1936 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1937 #endif
1938 
1939 /* SetVTable.proto */
1940 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1941 
1942 /* PyObjectGetAttrStrNoError.proto */
1943 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1944 
1945 /* SetupReduce.proto */
1946 static int __Pyx_setup_reduce(PyObject* type_obj);
1947 
1948 /* CLineInTraceback.proto */
1949 #ifdef CYTHON_CLINE_IN_TRACEBACK
1950 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1951 #else
1952 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1953 #endif
1954 
1955 /* CodeObjectCache.proto */
1956 typedef struct {
1957     PyCodeObject* code_object;
1958     int code_line;
1959 } __Pyx_CodeObjectCacheEntry;
1960 struct __Pyx_CodeObjectCache {
1961     int count;
1962     int max_count;
1963     __Pyx_CodeObjectCacheEntry* entries;
1964 };
1965 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1966 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1967 static PyCodeObject *__pyx_find_code_object(int code_line);
1968 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1969 
1970 /* AddTraceback.proto */
1971 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1972                                int py_line, const char *filename);
1973 
1974 /* GCCDiagnostics.proto */
1975 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1976 #define __Pyx_HAS_GCC_DIAGNOSTIC
1977 #endif
1978 
1979 /* RealImag.proto */
1980 #if CYTHON_CCOMPLEX
1981   #ifdef __cplusplus
1982     #define __Pyx_CREAL(z) ((z).real())
1983     #define __Pyx_CIMAG(z) ((z).imag())
1984   #else
1985     #define __Pyx_CREAL(z) (__real__(z))
1986     #define __Pyx_CIMAG(z) (__imag__(z))
1987   #endif
1988 #else
1989     #define __Pyx_CREAL(z) ((z).real)
1990     #define __Pyx_CIMAG(z) ((z).imag)
1991 #endif
1992 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1993         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1994     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1995     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1996 #else
1997     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1998     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1999 #endif
2000 
2001 /* Arithmetic.proto */
2002 #if CYTHON_CCOMPLEX
2003     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
2004     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
2005     #define __Pyx_c_diff_float(a, b) ((a)-(b))
2006     #define __Pyx_c_prod_float(a, b) ((a)*(b))
2007     #define __Pyx_c_quot_float(a, b) ((a)/(b))
2008     #define __Pyx_c_neg_float(a)     (-(a))
2009   #ifdef __cplusplus
2010     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2011     #define __Pyx_c_conj_float(z)    (::std::conj(z))
2012     #if 1
2013         #define __Pyx_c_abs_float(z)     (::std::abs(z))
2014         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
2015     #endif
2016   #else
2017     #define __Pyx_c_is_zero_float(z) ((z)==0)
2018     #define __Pyx_c_conj_float(z)    (conjf(z))
2019     #if 1
2020         #define __Pyx_c_abs_float(z)     (cabsf(z))
2021         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
2022     #endif
2023  #endif
2024 #else
2025     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2026     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2027     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2028     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2029     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2030     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2031     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2032     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2033     #if 1
2034         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2035         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2036     #endif
2037 #endif
2038 
2039 /* Arithmetic.proto */
2040 #if CYTHON_CCOMPLEX
2041     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
2042     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
2043     #define __Pyx_c_diff_double(a, b) ((a)-(b))
2044     #define __Pyx_c_prod_double(a, b) ((a)*(b))
2045     #define __Pyx_c_quot_double(a, b) ((a)/(b))
2046     #define __Pyx_c_neg_double(a)     (-(a))
2047   #ifdef __cplusplus
2048     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2049     #define __Pyx_c_conj_double(z)    (::std::conj(z))
2050     #if 1
2051         #define __Pyx_c_abs_double(z)     (::std::abs(z))
2052         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
2053     #endif
2054   #else
2055     #define __Pyx_c_is_zero_double(z) ((z)==0)
2056     #define __Pyx_c_conj_double(z)    (conj(z))
2057     #if 1
2058         #define __Pyx_c_abs_double(z)     (cabs(z))
2059         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
2060     #endif
2061  #endif
2062 #else
2063     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2064     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2065     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2066     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2067     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2068     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2069     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2070     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2071     #if 1
2072         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2073         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2074     #endif
2075 #endif
2076 
2077 /* CIntToPy.proto */
2078 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);
2079 
2080 /* CIntFromPy.proto */
2081 static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);
2082 
2083 /* CIntToPy.proto */
2084 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value);
2085 
2086 /* CIntFromPy.proto */
2087 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject *);
2088 
2089 /* CIntToPy.proto */
2090 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_short(unsigned short value);
2091 
2092 /* CIntFromPy.proto */
2093 static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *);
2094 
2095 /* CIntFromPy.proto */
2096 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2097 
2098 /* CIntFromPy.proto */
2099 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2100 
2101 /* CIntToPy.proto */
2102 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2103 
2104 /* CIntToPy.proto */
2105 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2106 
2107 /* FastTypeChecks.proto */
2108 #if CYTHON_COMPILING_IN_CPYTHON
2109 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2110 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2111 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2112 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2113 #else
2114 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2115 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2116 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2117 #endif
2118 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2119 
2120 /* CheckBinaryVersion.proto */
2121 static int __Pyx_check_binary_version(void);
2122 
2123 /* InitStrings.proto */
2124 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2125 
2126 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_handle_block(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *__pyx_v_self, PyObject *__pyx_v_block_data, struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_bbi_file); /* proto*/
2127 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_handle_interval_value(CYTHON_UNUSED struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *__pyx_v_self, CYTHON_UNUSED __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_s, CYTHON_UNUSED __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_e, CYTHON_UNUSED PyObject *__pyx_v_rest); /* proto*/
2128 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_handle_interval_value(struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_s, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_e, CYTHON_UNUSED PyObject *__pyx_v_rest); /* proto*/
2129 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_handle_interval_value(struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_s, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_e, PyObject *__pyx_v_rest); /* proto*/
2130 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file_10BigBedFile__summarize_from_full(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, int __pyx_v_summary_size); /* proto*/
2131 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file_10BigBedFile_get(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *__pyx_v_self, char *__pyx_v_chrom, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, int __pyx_skip_dispatch); /* proto*/
2132 
2133 /* Module declarations from 'bx.bbi.types' */
2134 
2135 /* Module declarations from 'bx.bbi.bpt_file' */
2136 static PyTypeObject *__pyx_ptype_2bx_3bbi_8bpt_file_BPTFile = 0;
2137 
2138 /* Module declarations from 'bx.bbi.cirtree_file' */
2139 static PyTypeObject *__pyx_ptype_2bx_3bbi_12cirtree_file_CIRTreeFile = 0;
2140 
2141 /* Module declarations from 'cpython.buffer' */
2142 
2143 /* Module declarations from 'libc.string' */
2144 
2145 /* Module declarations from 'libc.stdio' */
2146 
2147 /* Module declarations from '__builtin__' */
2148 
2149 /* Module declarations from 'cpython.type' */
2150 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2151 
2152 /* Module declarations from 'cpython' */
2153 
2154 /* Module declarations from 'cpython.object' */
2155 
2156 /* Module declarations from 'cpython.ref' */
2157 
2158 /* Module declarations from 'cpython.mem' */
2159 
2160 /* Module declarations from 'numpy' */
2161 
2162 /* Module declarations from 'numpy' */
2163 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2164 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2165 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2166 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2167 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2168 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2169 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2170 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2171 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2172 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2173 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2174 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2175 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2176 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2177 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2178 
2179 /* Module declarations from 'bx.bbi.bbi_file' */
2180 static PyTypeObject *__pyx_ptype_2bx_3bbi_8bbi_file_SummaryBlock = 0;
2181 static PyTypeObject *__pyx_ptype_2bx_3bbi_8bbi_file_SummarizedData = 0;
2182 static PyTypeObject *__pyx_ptype_2bx_3bbi_8bbi_file_BBIFile = 0;
2183 static PyTypeObject *__pyx_ptype_2bx_3bbi_8bbi_file_BlockHandler = 0;
2184 
2185 /* Module declarations from 'bx.bbi.bigbed_file' */
2186 static PyTypeObject *__pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler = 0;
2187 static PyTypeObject *__pyx_ptype_2bx_3bbi_11bigbed_file_SummarizingBlockHandler = 0;
2188 static PyTypeObject *__pyx_ptype_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler = 0;
2189 static PyTypeObject *__pyx_ptype_2bx_3bbi_11bigbed_file_BigBedFile = 0;
2190 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_BigBedBlockHandler__set_state(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *, PyObject *); /*proto*/
2191 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_SummarizingBlockHandler__set_state(struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *, PyObject *); /*proto*/
2192 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *, PyObject *); /*proto*/
2193 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_BigBedFile__set_state(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *, PyObject *); /*proto*/
2194 #define __Pyx_MODULE_NAME "bx.bbi.bigbed_file"
2195 extern int __pyx_module_is_main_bx__bbi__bigbed_file;
2196 int __pyx_module_is_main_bx__bbi__bigbed_file = 0;
2197 
2198 /* Implementation of 'bx.bbi.bigbed_file' */
2199 static PyObject *__pyx_builtin_range;
2200 static PyObject *__pyx_builtin_round;
2201 static PyObject *__pyx_builtin_ImportError;
2202 static const char __pyx_k_[] = "\t";
2203 static const char __pyx_k__2[] = "+";
2204 static const char __pyx_k_io[] = "io";
2205 static const char __pyx_k_end[] = "end";
2206 static const char __pyx_k_get[] = "get";
2207 static const char __pyx_k_inf[] = "inf";
2208 static const char __pyx_k_new[] = "__new__";
2209 static const char __pyx_k_dict[] = "__dict__";
2210 static const char __pyx_k_file[] = "file";
2211 static const char __pyx_k_init[] = "__init__";
2212 static const char __pyx_k_main[] = "__main__";
2213 static const char __pyx_k_name[] = "__name__";
2214 static const char __pyx_k_tell[] = "tell";
2215 static const char __pyx_k_test[] = "__test__";
2216 static const char __pyx_k_zlib[] = "zlib";
2217 static const char __pyx_k_chrom[] = "chrom";
2218 static const char __pyx_k_numpy[] = "numpy";
2219 static const char __pyx_k_range[] = "range";
2220 static const char __pyx_k_round[] = "round";
2221 static const char __pyx_k_split[] = "split";
2222 static const char __pyx_k_start[] = "start";
2223 static const char __pyx_k_bigbed[] = "bigbed";
2224 static const char __pyx_k_import[] = "__import__";
2225 static const char __pyx_k_pickle[] = "pickle";
2226 static const char __pyx_k_reduce[] = "__reduce__";
2227 static const char __pyx_k_update[] = "update";
2228 static const char __pyx_k_BytesIO[] = "BytesIO";
2229 static const char __pyx_k_chrom_id[] = "chrom_id";
2230 static const char __pyx_k_getstate[] = "__getstate__";
2231 static const char __pyx_k_pyx_type[] = "__pyx_type";
2232 static const char __pyx_k_setstate[] = "__setstate__";
2233 static const char __pyx_k_pyx_state[] = "__pyx_state";
2234 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2235 static const char __pyx_k_BigBedFile[] = "BigBedFile";
2236 static const char __pyx_k_pyx_result[] = "__pyx_result";
2237 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2238 static const char __pyx_k_BigBed_file[] = "\nBigBed file.\n";
2239 static const char __pyx_k_ImportError[] = "ImportError";
2240 static const char __pyx_k_PickleError[] = "PickleError";
2241 static const char __pyx_k_read_uint32[] = "read_uint32";
2242 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2243 static const char __pyx_k_stringsource[] = "stringsource";
2244 static const char __pyx_k_summary_size[] = "summary_size";
2245 static const char __pyx_k_read_c_string[] = "read_c_string";
2246 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2247 static const char __pyx_k_GenomicInterval[] = "GenomicInterval";
2248 static const char __pyx_k_bx_intervals_io[] = "bx.intervals.io";
2249 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2250 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2251 static const char __pyx_k_BinaryFileReader[] = "BinaryFileReader";
2252 static const char __pyx_k_is_little_endian[] = "is_little_endian";
2253 static const char __pyx_k_BigBedBlockHandler[] = "BigBedBlockHandler";
2254 static const char __pyx_k_bx_bbi_bigbed_file[] = "bx.bbi.bigbed_file";
2255 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2256 static const char __pyx_k_bx_misc_binary_file[] = "bx.misc.binary_file";
2257 static const char __pyx_k_SummarizingBlockHandler[] = "SummarizingBlockHandler";
2258 static const char __pyx_k_pyx_unpickle_BigBedFile[] = "__pyx_unpickle_BigBedFile";
2259 static const char __pyx_k_pyx_unpickle_BigBedBlockHandle[] = "__pyx_unpickle_BigBedBlockHandler";
2260 static const char __pyx_k_pyx_unpickle_IntervalAccumulat[] = "__pyx_unpickle_IntervalAccumulatingBlockHandler";
2261 static const char __pyx_k_pyx_unpickle_SummarizingBlockH[] = "__pyx_unpickle_SummarizingBlockHandler";
2262 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2263 static const char __pyx_k_Incompatible_checksums_s_vs_0x55[] = "Incompatible checksums (%s vs 0x5566878 = (as_offset, chrom_bpt, chrom_tree_offset, defined_field_count, field_count, file, is_byteswapped, level_list, magic, reader, total_summary_offset, uncompress_buf_size, unzoomed_data_offset, unzoomed_index_offset, version, zoom_levels))";
2264 static const char __pyx_k_Incompatible_checksums_s_vs_0x72[] = "Incompatible checksums (%s vs 0x725a786 = (chrom_id, end, sd, start))";
2265 static const char __pyx_k_Incompatible_checksums_s_vs_0xe0[] = "Incompatible checksums (%s vs 0xe0ff5c2 = (chrom_id, end, intervals, start))";
2266 static const char __pyx_k_Incompatible_checksums_s_vs_0xfe[] = "Incompatible checksums (%s vs 0xfe9487d = (chrom_id, end, start))";
2267 static const char __pyx_k_IntervalAccumulatingBlockHandler[] = "IntervalAccumulatingBlockHandler";
2268 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2269 static PyObject *__pyx_kp_s_;
2270 static PyObject *__pyx_n_s_BigBedBlockHandler;
2271 static PyObject *__pyx_n_s_BigBedFile;
2272 static PyObject *__pyx_n_s_BinaryFileReader;
2273 static PyObject *__pyx_n_s_BytesIO;
2274 static PyObject *__pyx_n_s_GenomicInterval;
2275 static PyObject *__pyx_n_s_ImportError;
2276 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x55;
2277 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x72;
2278 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xe0;
2279 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xfe;
2280 static PyObject *__pyx_n_s_IntervalAccumulatingBlockHandler;
2281 static PyObject *__pyx_n_s_PickleError;
2282 static PyObject *__pyx_n_s_SummarizingBlockHandler;
2283 static PyObject *__pyx_kp_s__2;
2284 static PyObject *__pyx_n_s_bigbed;
2285 static PyObject *__pyx_n_s_bx_bbi_bigbed_file;
2286 static PyObject *__pyx_n_s_bx_intervals_io;
2287 static PyObject *__pyx_n_s_bx_misc_binary_file;
2288 static PyObject *__pyx_n_s_chrom;
2289 static PyObject *__pyx_n_s_chrom_id;
2290 static PyObject *__pyx_n_s_cline_in_traceback;
2291 static PyObject *__pyx_n_s_dict;
2292 static PyObject *__pyx_n_s_end;
2293 static PyObject *__pyx_n_s_file;
2294 static PyObject *__pyx_n_s_get;
2295 static PyObject *__pyx_n_s_getstate;
2296 static PyObject *__pyx_n_s_import;
2297 static PyObject *__pyx_n_s_inf;
2298 static PyObject *__pyx_n_s_init;
2299 static PyObject *__pyx_n_s_io;
2300 static PyObject *__pyx_n_s_is_little_endian;
2301 static PyObject *__pyx_n_s_main;
2302 static PyObject *__pyx_n_s_name;
2303 static PyObject *__pyx_n_s_new;
2304 static PyObject *__pyx_n_s_numpy;
2305 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2306 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2307 static PyObject *__pyx_n_s_pickle;
2308 static PyObject *__pyx_n_s_pyx_PickleError;
2309 static PyObject *__pyx_n_s_pyx_checksum;
2310 static PyObject *__pyx_n_s_pyx_result;
2311 static PyObject *__pyx_n_s_pyx_state;
2312 static PyObject *__pyx_n_s_pyx_type;
2313 static PyObject *__pyx_n_s_pyx_unpickle_BigBedBlockHandle;
2314 static PyObject *__pyx_n_s_pyx_unpickle_BigBedFile;
2315 static PyObject *__pyx_n_s_pyx_unpickle_IntervalAccumulat;
2316 static PyObject *__pyx_n_s_pyx_unpickle_SummarizingBlockH;
2317 static PyObject *__pyx_n_s_pyx_vtable;
2318 static PyObject *__pyx_n_s_range;
2319 static PyObject *__pyx_n_s_read_c_string;
2320 static PyObject *__pyx_n_s_read_uint32;
2321 static PyObject *__pyx_n_s_reduce;
2322 static PyObject *__pyx_n_s_reduce_cython;
2323 static PyObject *__pyx_n_s_reduce_ex;
2324 static PyObject *__pyx_n_s_round;
2325 static PyObject *__pyx_n_s_setstate;
2326 static PyObject *__pyx_n_s_setstate_cython;
2327 static PyObject *__pyx_n_s_split;
2328 static PyObject *__pyx_n_s_start;
2329 static PyObject *__pyx_kp_s_stringsource;
2330 static PyObject *__pyx_n_s_summary_size;
2331 static PyObject *__pyx_n_s_tell;
2332 static PyObject *__pyx_n_s_test;
2333 static PyObject *__pyx_n_s_update;
2334 static PyObject *__pyx_n_s_zlib;
2335 static int __pyx_pf_2bx_3bbi_11bigbed_file_18BigBedBlockHandler___init__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end); /* proto */
2336 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_2__reduce_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *__pyx_v_self); /* proto */
2337 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_4__setstate_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2338 static int __pyx_pf_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler___init__(struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, int __pyx_v_summary_size); /* proto */
2339 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_2__reduce_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *__pyx_v_self); /* proto */
2340 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_4__setstate_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2341 static int __pyx_pf_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler___init__(struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end); /* proto */
2342 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_2__reduce_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *__pyx_v_self); /* proto */
2343 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_4__setstate_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2344 static int __pyx_pf_2bx_3bbi_11bigbed_file_10BigBedFile___init__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *__pyx_v_self, PyObject *__pyx_v_file); /* proto */
2345 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_10BigBedFile_2get(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *__pyx_v_self, char *__pyx_v_chrom, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end); /* proto */
2346 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_10BigBedFile_4__reduce_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *__pyx_v_self); /* proto */
2347 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_10BigBedFile_6__setstate_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2348 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file___pyx_unpickle_BigBedBlockHandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2349 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_2__pyx_unpickle_SummarizingBlockHandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2350 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_4__pyx_unpickle_IntervalAccumulatingBlockHandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2351 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_6__pyx_unpickle_BigBedFile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2352 static PyObject *__pyx_tp_new_2bx_3bbi_11bigbed_file_BigBedBlockHandler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2353 static PyObject *__pyx_tp_new_2bx_3bbi_11bigbed_file_SummarizingBlockHandler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2354 static PyObject *__pyx_tp_new_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2355 static PyObject *__pyx_tp_new_2bx_3bbi_11bigbed_file_BigBedFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2356 static PyObject *__pyx_int_0;
2357 static PyObject *__pyx_int_1;
2358 static PyObject *__pyx_int_2;
2359 static PyObject *__pyx_int_5;
2360 static PyObject *__pyx_int_89548920;
2361 static PyObject *__pyx_int_119908230;
2362 static PyObject *__pyx_int_235926978;
2363 static PyObject *__pyx_int_266946685;
2364 static PyObject *__pyx_int_2273964779;
2365 static PyObject *__pyx_tuple__3;
2366 static PyObject *__pyx_tuple__4;
2367 static PyObject *__pyx_tuple__5;
2368 static PyObject *__pyx_tuple__7;
2369 static PyObject *__pyx_tuple__9;
2370 static PyObject *__pyx_tuple__11;
2371 static PyObject *__pyx_codeobj__6;
2372 static PyObject *__pyx_codeobj__8;
2373 static PyObject *__pyx_codeobj__10;
2374 static PyObject *__pyx_codeobj__12;
2375 /* Late includes */
2376 
2377 /* "bx/bbi/bigbed_file.pyx":17
2378  * DEF big_bed_sig = 0x8789F2EB
2379  *
2380  * cdef inline int range_intersection( int start1, int end1, int start2, int end2 ):             # <<<<<<<<<<<<<<
2381  *     return min( end1, end2 ) - max( start1, start2 )
2382  *
2383  */
2384 
__pyx_f_2bx_3bbi_11bigbed_file_range_intersection(int __pyx_v_start1,int __pyx_v_end1,int __pyx_v_start2,int __pyx_v_end2)2385 static CYTHON_INLINE int __pyx_f_2bx_3bbi_11bigbed_file_range_intersection(int __pyx_v_start1, int __pyx_v_end1, int __pyx_v_start2, int __pyx_v_end2) {
2386   int __pyx_r;
2387   __Pyx_RefNannyDeclarations
2388   int __pyx_t_1;
2389   int __pyx_t_2;
2390   int __pyx_t_3;
2391   int __pyx_t_4;
2392   __Pyx_RefNannySetupContext("range_intersection", 0);
2393 
2394   /* "bx/bbi/bigbed_file.pyx":18
2395  *
2396  * cdef inline int range_intersection( int start1, int end1, int start2, int end2 ):
2397  *     return min( end1, end2 ) - max( start1, start2 )             # <<<<<<<<<<<<<<
2398  *
2399  * cdef class BigBedBlockHandler( BlockHandler ):
2400  */
2401   __pyx_t_1 = __pyx_v_end2;
2402   __pyx_t_2 = __pyx_v_end1;
2403   if (((__pyx_t_1 < __pyx_t_2) != 0)) {
2404     __pyx_t_3 = __pyx_t_1;
2405   } else {
2406     __pyx_t_3 = __pyx_t_2;
2407   }
2408   __pyx_t_1 = __pyx_v_start2;
2409   __pyx_t_2 = __pyx_v_start1;
2410   if (((__pyx_t_1 > __pyx_t_2) != 0)) {
2411     __pyx_t_4 = __pyx_t_1;
2412   } else {
2413     __pyx_t_4 = __pyx_t_2;
2414   }
2415   __pyx_r = (__pyx_t_3 - __pyx_t_4);
2416   goto __pyx_L0;
2417 
2418   /* "bx/bbi/bigbed_file.pyx":17
2419  * DEF big_bed_sig = 0x8789F2EB
2420  *
2421  * cdef inline int range_intersection( int start1, int end1, int start2, int end2 ):             # <<<<<<<<<<<<<<
2422  *     return min( end1, end2 ) - max( start1, start2 )
2423  *
2424  */
2425 
2426   /* function exit code */
2427   __pyx_L0:;
2428   __Pyx_RefNannyFinishContext();
2429   return __pyx_r;
2430 }
2431 
2432 /* "bx/bbi/bigbed_file.pyx":27
2433  *     cdef bits32 start
2434  *     cdef bits32 end
2435  *     def __init__( self, bits32 chrom_id, bits32 start, bits32 end ):             # <<<<<<<<<<<<<<
2436  *         BlockHandler.__init__( self )
2437  *         self.chrom_id = chrom_id
2438  */
2439 
2440 /* Python wrapper */
2441 static int __pyx_pw_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2442 static int __pyx_pw_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2443   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id;
2444   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start;
2445   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end;
2446   int __pyx_lineno = 0;
2447   const char *__pyx_filename = NULL;
2448   int __pyx_clineno = 0;
2449   int __pyx_r;
2450   __Pyx_RefNannyDeclarations
2451   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2452   {
2453     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom_id,&__pyx_n_s_start,&__pyx_n_s_end,0};
2454     PyObject* values[3] = {0,0,0};
2455     if (unlikely(__pyx_kwds)) {
2456       Py_ssize_t kw_args;
2457       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2458       switch (pos_args) {
2459         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2460         CYTHON_FALLTHROUGH;
2461         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2462         CYTHON_FALLTHROUGH;
2463         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2464         CYTHON_FALLTHROUGH;
2465         case  0: break;
2466         default: goto __pyx_L5_argtuple_error;
2467       }
2468       kw_args = PyDict_Size(__pyx_kwds);
2469       switch (pos_args) {
2470         case  0:
2471         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom_id)) != 0)) kw_args--;
2472         else goto __pyx_L5_argtuple_error;
2473         CYTHON_FALLTHROUGH;
2474         case  1:
2475         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
2476         else {
2477           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 27, __pyx_L3_error)
2478         }
2479         CYTHON_FALLTHROUGH;
2480         case  2:
2481         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
2482         else {
2483           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 27, __pyx_L3_error)
2484         }
2485       }
2486       if (unlikely(kw_args > 0)) {
2487         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 27, __pyx_L3_error)
2488       }
2489     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2490       goto __pyx_L5_argtuple_error;
2491     } else {
2492       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2493       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2494       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2495     }
2496     __pyx_v_chrom_id = __Pyx_PyInt_As_unsigned_int(values[0]); if (unlikely((__pyx_v_chrom_id == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error)
2497     __pyx_v_start = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_start == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error)
2498     __pyx_v_end = __Pyx_PyInt_As_unsigned_int(values[2]); if (unlikely((__pyx_v_end == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error)
2499   }
2500   goto __pyx_L4_argument_unpacking_done;
2501   __pyx_L5_argtuple_error:;
2502   __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 27, __pyx_L3_error)
2503   __pyx_L3_error:;
2504   __Pyx_AddTraceback("bx.bbi.bigbed_file.BigBedBlockHandler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2505   __Pyx_RefNannyFinishContext();
2506   return -1;
2507   __pyx_L4_argument_unpacking_done:;
2508   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file_18BigBedBlockHandler___init__(((struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *)__pyx_v_self), __pyx_v_chrom_id, __pyx_v_start, __pyx_v_end);
2509 
2510   /* function exit code */
2511   __Pyx_RefNannyFinishContext();
2512   return __pyx_r;
2513 }
2514 
__pyx_pf_2bx_3bbi_11bigbed_file_18BigBedBlockHandler___init__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler * __pyx_v_self,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end)2515 static int __pyx_pf_2bx_3bbi_11bigbed_file_18BigBedBlockHandler___init__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end) {
2516   int __pyx_r;
2517   __Pyx_RefNannyDeclarations
2518   PyObject *__pyx_t_1 = NULL;
2519   PyObject *__pyx_t_2 = NULL;
2520   PyObject *__pyx_t_3 = NULL;
2521   int __pyx_lineno = 0;
2522   const char *__pyx_filename = NULL;
2523   int __pyx_clineno = 0;
2524   __Pyx_RefNannySetupContext("__init__", 0);
2525 
2526   /* "bx/bbi/bigbed_file.pyx":28
2527  *     cdef bits32 end
2528  *     def __init__( self, bits32 chrom_id, bits32 start, bits32 end ):
2529  *         BlockHandler.__init__( self )             # <<<<<<<<<<<<<<
2530  *         self.chrom_id = chrom_id
2531  *         self.start = start
2532  */
2533   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_3bbi_8bbi_file_BlockHandler), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
2534   __Pyx_GOTREF(__pyx_t_2);
2535   __pyx_t_3 = NULL;
2536   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
2537     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
2538     if (likely(__pyx_t_3)) {
2539       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2540       __Pyx_INCREF(__pyx_t_3);
2541       __Pyx_INCREF(function);
2542       __Pyx_DECREF_SET(__pyx_t_2, function);
2543     }
2544   }
2545   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
2546   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2547   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
2548   __Pyx_GOTREF(__pyx_t_1);
2549   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2550   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2551 
2552   /* "bx/bbi/bigbed_file.pyx":29
2553  *     def __init__( self, bits32 chrom_id, bits32 start, bits32 end ):
2554  *         BlockHandler.__init__( self )
2555  *         self.chrom_id = chrom_id             # <<<<<<<<<<<<<<
2556  *         self.start = start
2557  *         self.end = end
2558  */
2559   __pyx_v_self->chrom_id = __pyx_v_chrom_id;
2560 
2561   /* "bx/bbi/bigbed_file.pyx":30
2562  *         BlockHandler.__init__( self )
2563  *         self.chrom_id = chrom_id
2564  *         self.start = start             # <<<<<<<<<<<<<<
2565  *         self.end = end
2566  *     cdef handle_block( self, bytes block_data, BBIFile bbi_file ):
2567  */
2568   __pyx_v_self->start = __pyx_v_start;
2569 
2570   /* "bx/bbi/bigbed_file.pyx":31
2571  *         self.chrom_id = chrom_id
2572  *         self.start = start
2573  *         self.end = end             # <<<<<<<<<<<<<<
2574  *     cdef handle_block( self, bytes block_data, BBIFile bbi_file ):
2575  *         cdef object bytes_io
2576  */
2577   __pyx_v_self->end = __pyx_v_end;
2578 
2579   /* "bx/bbi/bigbed_file.pyx":27
2580  *     cdef bits32 start
2581  *     cdef bits32 end
2582  *     def __init__( self, bits32 chrom_id, bits32 start, bits32 end ):             # <<<<<<<<<<<<<<
2583  *         BlockHandler.__init__( self )
2584  *         self.chrom_id = chrom_id
2585  */
2586 
2587   /* function exit code */
2588   __pyx_r = 0;
2589   goto __pyx_L0;
2590   __pyx_L1_error:;
2591   __Pyx_XDECREF(__pyx_t_1);
2592   __Pyx_XDECREF(__pyx_t_2);
2593   __Pyx_XDECREF(__pyx_t_3);
2594   __Pyx_AddTraceback("bx.bbi.bigbed_file.BigBedBlockHandler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2595   __pyx_r = -1;
2596   __pyx_L0:;
2597   __Pyx_RefNannyFinishContext();
2598   return __pyx_r;
2599 }
2600 
2601 /* "bx/bbi/bigbed_file.pyx":32
2602  *         self.start = start
2603  *         self.end = end
2604  *     cdef handle_block( self, bytes block_data, BBIFile bbi_file ):             # <<<<<<<<<<<<<<
2605  *         cdef object bytes_io
2606  *         cdef int length
2607  */
2608 
__pyx_f_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_handle_block(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler * __pyx_v_self,PyObject * __pyx_v_block_data,struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_bbi_file)2609 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_handle_block(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *__pyx_v_self, PyObject *__pyx_v_block_data, struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_bbi_file) {
2610   PyObject *__pyx_v_bytes_io = 0;
2611   int __pyx_v_length;
2612   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id;
2613   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_s;
2614   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_e;
2615   PyObject *__pyx_v_rest = 0;
2616   PyObject *__pyx_v_block_reader = NULL;
2617   PyObject *__pyx_r = NULL;
2618   __Pyx_RefNannyDeclarations
2619   PyObject *__pyx_t_1 = NULL;
2620   PyObject *__pyx_t_2 = NULL;
2621   PyObject *__pyx_t_3 = NULL;
2622   PyObject *__pyx_t_4 = NULL;
2623   Py_ssize_t __pyx_t_5;
2624   int __pyx_t_6;
2625   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_7;
2626   int __pyx_t_8;
2627   int __pyx_lineno = 0;
2628   const char *__pyx_filename = NULL;
2629   int __pyx_clineno = 0;
2630   __Pyx_RefNannySetupContext("handle_block", 0);
2631 
2632   /* "bx/bbi/bigbed_file.pyx":38
2633  *         cdef str rest
2634  *         # Now we parse the block, which should just be a bunch of BED records
2635  *         bytes_io = BytesIO( block_data )             # <<<<<<<<<<<<<<
2636  *         block_reader = BinaryFileReader( bytes_io, is_little_endian=bbi_file.reader.is_little_endian )
2637  *         length = len( block_data )
2638  */
2639   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BytesIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
2640   __Pyx_GOTREF(__pyx_t_2);
2641   __pyx_t_3 = NULL;
2642   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
2643     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
2644     if (likely(__pyx_t_3)) {
2645       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2646       __Pyx_INCREF(__pyx_t_3);
2647       __Pyx_INCREF(function);
2648       __Pyx_DECREF_SET(__pyx_t_2, function);
2649     }
2650   }
2651   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_block_data) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_block_data);
2652   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2653   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
2654   __Pyx_GOTREF(__pyx_t_1);
2655   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2656   __pyx_v_bytes_io = __pyx_t_1;
2657   __pyx_t_1 = 0;
2658 
2659   /* "bx/bbi/bigbed_file.pyx":39
2660  *         # Now we parse the block, which should just be a bunch of BED records
2661  *         bytes_io = BytesIO( block_data )
2662  *         block_reader = BinaryFileReader( bytes_io, is_little_endian=bbi_file.reader.is_little_endian )             # <<<<<<<<<<<<<<
2663  *         length = len( block_data )
2664  *         while bytes_io.tell() < length:
2665  */
2666   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BinaryFileReader); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
2667   __Pyx_GOTREF(__pyx_t_1);
2668   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
2669   __Pyx_GOTREF(__pyx_t_2);
2670   __Pyx_INCREF(__pyx_v_bytes_io);
2671   __Pyx_GIVEREF(__pyx_v_bytes_io);
2672   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_bytes_io);
2673   __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error)
2674   __Pyx_GOTREF(__pyx_t_3);
2675   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_bbi_file->reader, __pyx_n_s_is_little_endian); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error)
2676   __Pyx_GOTREF(__pyx_t_4);
2677   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_little_endian, __pyx_t_4) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
2678   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2679   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error)
2680   __Pyx_GOTREF(__pyx_t_4);
2681   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2682   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2683   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2684   __pyx_v_block_reader = __pyx_t_4;
2685   __pyx_t_4 = 0;
2686 
2687   /* "bx/bbi/bigbed_file.pyx":40
2688  *         bytes_io = BytesIO( block_data )
2689  *         block_reader = BinaryFileReader( bytes_io, is_little_endian=bbi_file.reader.is_little_endian )
2690  *         length = len( block_data )             # <<<<<<<<<<<<<<
2691  *         while bytes_io.tell() < length:
2692  *             chrom_id = block_reader.read_uint32()
2693  */
2694   if (unlikely(__pyx_v_block_data == Py_None)) {
2695     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
2696     __PYX_ERR(0, 40, __pyx_L1_error)
2697   }
2698   __pyx_t_5 = PyBytes_GET_SIZE(__pyx_v_block_data); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 40, __pyx_L1_error)
2699   __pyx_v_length = __pyx_t_5;
2700 
2701   /* "bx/bbi/bigbed_file.pyx":41
2702  *         block_reader = BinaryFileReader( bytes_io, is_little_endian=bbi_file.reader.is_little_endian )
2703  *         length = len( block_data )
2704  *         while bytes_io.tell() < length:             # <<<<<<<<<<<<<<
2705  *             chrom_id = block_reader.read_uint32()
2706  *             s = block_reader.read_uint32()
2707  */
2708   while (1) {
2709     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_bytes_io, __pyx_n_s_tell); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)
2710     __Pyx_GOTREF(__pyx_t_3);
2711     __pyx_t_2 = NULL;
2712     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
2713       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
2714       if (likely(__pyx_t_2)) {
2715         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2716         __Pyx_INCREF(__pyx_t_2);
2717         __Pyx_INCREF(function);
2718         __Pyx_DECREF_SET(__pyx_t_3, function);
2719       }
2720     }
2721     __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
2722     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
2723     if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error)
2724     __Pyx_GOTREF(__pyx_t_4);
2725     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2726     __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)
2727     __Pyx_GOTREF(__pyx_t_3);
2728     __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
2729     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2730     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2731     __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 41, __pyx_L1_error)
2732     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2733     if (!__pyx_t_6) break;
2734 
2735     /* "bx/bbi/bigbed_file.pyx":42
2736  *         length = len( block_data )
2737  *         while bytes_io.tell() < length:
2738  *             chrom_id = block_reader.read_uint32()             # <<<<<<<<<<<<<<
2739  *             s = block_reader.read_uint32()
2740  *             e = block_reader.read_uint32()
2741  */
2742     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_block_reader, __pyx_n_s_read_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
2743     __Pyx_GOTREF(__pyx_t_3);
2744     __pyx_t_4 = NULL;
2745     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
2746       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2747       if (likely(__pyx_t_4)) {
2748         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2749         __Pyx_INCREF(__pyx_t_4);
2750         __Pyx_INCREF(function);
2751         __Pyx_DECREF_SET(__pyx_t_3, function);
2752       }
2753     }
2754     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
2755     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2756     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
2757     __Pyx_GOTREF(__pyx_t_2);
2758     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2759     __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L1_error)
2760     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2761     __pyx_v_chrom_id = __pyx_t_7;
2762 
2763     /* "bx/bbi/bigbed_file.pyx":43
2764  *         while bytes_io.tell() < length:
2765  *             chrom_id = block_reader.read_uint32()
2766  *             s = block_reader.read_uint32()             # <<<<<<<<<<<<<<
2767  *             e = block_reader.read_uint32()
2768  *             rest = block_reader.read_c_string()
2769  */
2770     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_block_reader, __pyx_n_s_read_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
2771     __Pyx_GOTREF(__pyx_t_3);
2772     __pyx_t_4 = NULL;
2773     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
2774       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2775       if (likely(__pyx_t_4)) {
2776         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2777         __Pyx_INCREF(__pyx_t_4);
2778         __Pyx_INCREF(function);
2779         __Pyx_DECREF_SET(__pyx_t_3, function);
2780       }
2781     }
2782     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
2783     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2784     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
2785     __Pyx_GOTREF(__pyx_t_2);
2786     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2787     __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L1_error)
2788     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2789     __pyx_v_s = __pyx_t_7;
2790 
2791     /* "bx/bbi/bigbed_file.pyx":44
2792  *             chrom_id = block_reader.read_uint32()
2793  *             s = block_reader.read_uint32()
2794  *             e = block_reader.read_uint32()             # <<<<<<<<<<<<<<
2795  *             rest = block_reader.read_c_string()
2796  *             if chrom_id != self.chrom_id:
2797  */
2798     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_block_reader, __pyx_n_s_read_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
2799     __Pyx_GOTREF(__pyx_t_3);
2800     __pyx_t_4 = NULL;
2801     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
2802       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2803       if (likely(__pyx_t_4)) {
2804         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2805         __Pyx_INCREF(__pyx_t_4);
2806         __Pyx_INCREF(function);
2807         __Pyx_DECREF_SET(__pyx_t_3, function);
2808       }
2809     }
2810     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
2811     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2812     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
2813     __Pyx_GOTREF(__pyx_t_2);
2814     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2815     __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error)
2816     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2817     __pyx_v_e = __pyx_t_7;
2818 
2819     /* "bx/bbi/bigbed_file.pyx":45
2820  *             s = block_reader.read_uint32()
2821  *             e = block_reader.read_uint32()
2822  *             rest = block_reader.read_c_string()             # <<<<<<<<<<<<<<
2823  *             if chrom_id != self.chrom_id:
2824  *                 continue
2825  */
2826     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_block_reader, __pyx_n_s_read_c_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
2827     __Pyx_GOTREF(__pyx_t_3);
2828     __pyx_t_4 = NULL;
2829     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
2830       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2831       if (likely(__pyx_t_4)) {
2832         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2833         __Pyx_INCREF(__pyx_t_4);
2834         __Pyx_INCREF(function);
2835         __Pyx_DECREF_SET(__pyx_t_3, function);
2836       }
2837     }
2838     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
2839     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2840     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
2841     __Pyx_GOTREF(__pyx_t_2);
2842     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2843     if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 45, __pyx_L1_error)
2844     __Pyx_XDECREF_SET(__pyx_v_rest, ((PyObject*)__pyx_t_2));
2845     __pyx_t_2 = 0;
2846 
2847     /* "bx/bbi/bigbed_file.pyx":46
2848  *             e = block_reader.read_uint32()
2849  *             rest = block_reader.read_c_string()
2850  *             if chrom_id != self.chrom_id:             # <<<<<<<<<<<<<<
2851  *                 continue
2852  *             if s < self.end and e > self.start:
2853  */
2854     __pyx_t_6 = ((__pyx_v_chrom_id != __pyx_v_self->chrom_id) != 0);
2855     if (__pyx_t_6) {
2856 
2857       /* "bx/bbi/bigbed_file.pyx":47
2858  *             rest = block_reader.read_c_string()
2859  *             if chrom_id != self.chrom_id:
2860  *                 continue             # <<<<<<<<<<<<<<
2861  *             if s < self.end and e > self.start:
2862  *                 self.handle_interval_value( s, e, rest )
2863  */
2864       goto __pyx_L3_continue;
2865 
2866       /* "bx/bbi/bigbed_file.pyx":46
2867  *             e = block_reader.read_uint32()
2868  *             rest = block_reader.read_c_string()
2869  *             if chrom_id != self.chrom_id:             # <<<<<<<<<<<<<<
2870  *                 continue
2871  *             if s < self.end and e > self.start:
2872  */
2873     }
2874 
2875     /* "bx/bbi/bigbed_file.pyx":48
2876  *             if chrom_id != self.chrom_id:
2877  *                 continue
2878  *             if s < self.end and e > self.start:             # <<<<<<<<<<<<<<
2879  *                 self.handle_interval_value( s, e, rest )
2880  *
2881  */
2882     __pyx_t_8 = ((__pyx_v_s < __pyx_v_self->end) != 0);
2883     if (__pyx_t_8) {
2884     } else {
2885       __pyx_t_6 = __pyx_t_8;
2886       goto __pyx_L7_bool_binop_done;
2887     }
2888     __pyx_t_8 = ((__pyx_v_e > __pyx_v_self->start) != 0);
2889     __pyx_t_6 = __pyx_t_8;
2890     __pyx_L7_bool_binop_done:;
2891     if (__pyx_t_6) {
2892 
2893       /* "bx/bbi/bigbed_file.pyx":49
2894  *                 continue
2895  *             if s < self.end and e > self.start:
2896  *                 self.handle_interval_value( s, e, rest )             # <<<<<<<<<<<<<<
2897  *
2898  *     cdef handle_interval_value( self, bits32 s, bits32 e, str rest ):
2899  */
2900       __pyx_t_2 = ((struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_BigBedBlockHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->handle_interval_value(__pyx_v_self, __pyx_v_s, __pyx_v_e, __pyx_v_rest); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
2901       __Pyx_GOTREF(__pyx_t_2);
2902       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2903 
2904       /* "bx/bbi/bigbed_file.pyx":48
2905  *             if chrom_id != self.chrom_id:
2906  *                 continue
2907  *             if s < self.end and e > self.start:             # <<<<<<<<<<<<<<
2908  *                 self.handle_interval_value( s, e, rest )
2909  *
2910  */
2911     }
2912     __pyx_L3_continue:;
2913   }
2914 
2915   /* "bx/bbi/bigbed_file.pyx":32
2916  *         self.start = start
2917  *         self.end = end
2918  *     cdef handle_block( self, bytes block_data, BBIFile bbi_file ):             # <<<<<<<<<<<<<<
2919  *         cdef object bytes_io
2920  *         cdef int length
2921  */
2922 
2923   /* function exit code */
2924   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2925   goto __pyx_L0;
2926   __pyx_L1_error:;
2927   __Pyx_XDECREF(__pyx_t_1);
2928   __Pyx_XDECREF(__pyx_t_2);
2929   __Pyx_XDECREF(__pyx_t_3);
2930   __Pyx_XDECREF(__pyx_t_4);
2931   __Pyx_AddTraceback("bx.bbi.bigbed_file.BigBedBlockHandler.handle_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
2932   __pyx_r = 0;
2933   __pyx_L0:;
2934   __Pyx_XDECREF(__pyx_v_bytes_io);
2935   __Pyx_XDECREF(__pyx_v_rest);
2936   __Pyx_XDECREF(__pyx_v_block_reader);
2937   __Pyx_XGIVEREF(__pyx_r);
2938   __Pyx_RefNannyFinishContext();
2939   return __pyx_r;
2940 }
2941 
2942 /* "bx/bbi/bigbed_file.pyx":51
2943  *                 self.handle_interval_value( s, e, rest )
2944  *
2945  *     cdef handle_interval_value( self, bits32 s, bits32 e, str rest ):             # <<<<<<<<<<<<<<
2946  *         pass
2947  *
2948  */
2949 
__pyx_f_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_handle_interval_value(CYTHON_UNUSED struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler * __pyx_v_self,CYTHON_UNUSED __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_s,CYTHON_UNUSED __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_e,CYTHON_UNUSED PyObject * __pyx_v_rest)2950 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_handle_interval_value(CYTHON_UNUSED struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *__pyx_v_self, CYTHON_UNUSED __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_s, CYTHON_UNUSED __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_e, CYTHON_UNUSED PyObject *__pyx_v_rest) {
2951   PyObject *__pyx_r = NULL;
2952   __Pyx_RefNannyDeclarations
2953   __Pyx_RefNannySetupContext("handle_interval_value", 0);
2954 
2955   /* function exit code */
2956   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2957   __Pyx_XGIVEREF(__pyx_r);
2958   __Pyx_RefNannyFinishContext();
2959   return __pyx_r;
2960 }
2961 
2962 /* "(tree fragment)":1
2963  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
2964  *     cdef tuple state
2965  *     cdef object _dict
2966  */
2967 
2968 /* Python wrapper */
2969 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_3__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)2970 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2971   PyObject *__pyx_r = 0;
2972   __Pyx_RefNannyDeclarations
2973   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
2974   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_2__reduce_cython__(((struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *)__pyx_v_self));
2975 
2976   /* function exit code */
2977   __Pyx_RefNannyFinishContext();
2978   return __pyx_r;
2979 }
2980 
__pyx_pf_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_2__reduce_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler * __pyx_v_self)2981 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_2__reduce_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *__pyx_v_self) {
2982   PyObject *__pyx_v_state = 0;
2983   PyObject *__pyx_v__dict = 0;
2984   int __pyx_v_use_setstate;
2985   PyObject *__pyx_r = NULL;
2986   __Pyx_RefNannyDeclarations
2987   PyObject *__pyx_t_1 = NULL;
2988   PyObject *__pyx_t_2 = NULL;
2989   PyObject *__pyx_t_3 = NULL;
2990   PyObject *__pyx_t_4 = NULL;
2991   int __pyx_t_5;
2992   int __pyx_t_6;
2993   int __pyx_lineno = 0;
2994   const char *__pyx_filename = NULL;
2995   int __pyx_clineno = 0;
2996   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
2997 
2998   /* "(tree fragment)":5
2999  *     cdef object _dict
3000  *     cdef bint use_setstate
3001  *     state = (self.chrom_id, self.end, self.start)             # <<<<<<<<<<<<<<
3002  *     _dict = getattr(self, '__dict__', None)
3003  *     if _dict is not None:
3004  */
3005   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->chrom_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
3006   __Pyx_GOTREF(__pyx_t_1);
3007   __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->end); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
3008   __Pyx_GOTREF(__pyx_t_2);
3009   __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->start); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
3010   __Pyx_GOTREF(__pyx_t_3);
3011   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
3012   __Pyx_GOTREF(__pyx_t_4);
3013   __Pyx_GIVEREF(__pyx_t_1);
3014   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
3015   __Pyx_GIVEREF(__pyx_t_2);
3016   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
3017   __Pyx_GIVEREF(__pyx_t_3);
3018   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
3019   __pyx_t_1 = 0;
3020   __pyx_t_2 = 0;
3021   __pyx_t_3 = 0;
3022   __pyx_v_state = ((PyObject*)__pyx_t_4);
3023   __pyx_t_4 = 0;
3024 
3025   /* "(tree fragment)":6
3026  *     cdef bint use_setstate
3027  *     state = (self.chrom_id, self.end, self.start)
3028  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
3029  *     if _dict is not None:
3030  *         state += (_dict,)
3031  */
3032   __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
3033   __Pyx_GOTREF(__pyx_t_4);
3034   __pyx_v__dict = __pyx_t_4;
3035   __pyx_t_4 = 0;
3036 
3037   /* "(tree fragment)":7
3038  *     state = (self.chrom_id, self.end, self.start)
3039  *     _dict = getattr(self, '__dict__', None)
3040  *     if _dict is not None:             # <<<<<<<<<<<<<<
3041  *         state += (_dict,)
3042  *         use_setstate = True
3043  */
3044   __pyx_t_5 = (__pyx_v__dict != Py_None);
3045   __pyx_t_6 = (__pyx_t_5 != 0);
3046   if (__pyx_t_6) {
3047 
3048     /* "(tree fragment)":8
3049  *     _dict = getattr(self, '__dict__', None)
3050  *     if _dict is not None:
3051  *         state += (_dict,)             # <<<<<<<<<<<<<<
3052  *         use_setstate = True
3053  *     else:
3054  */
3055     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
3056     __Pyx_GOTREF(__pyx_t_4);
3057     __Pyx_INCREF(__pyx_v__dict);
3058     __Pyx_GIVEREF(__pyx_v__dict);
3059     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__dict);
3060     __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
3061     __Pyx_GOTREF(__pyx_t_3);
3062     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3063     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
3064     __pyx_t_3 = 0;
3065 
3066     /* "(tree fragment)":9
3067  *     if _dict is not None:
3068  *         state += (_dict,)
3069  *         use_setstate = True             # <<<<<<<<<<<<<<
3070  *     else:
3071  *         use_setstate = False
3072  */
3073     __pyx_v_use_setstate = 1;
3074 
3075     /* "(tree fragment)":7
3076  *     state = (self.chrom_id, self.end, self.start)
3077  *     _dict = getattr(self, '__dict__', None)
3078  *     if _dict is not None:             # <<<<<<<<<<<<<<
3079  *         state += (_dict,)
3080  *         use_setstate = True
3081  */
3082     goto __pyx_L3;
3083   }
3084 
3085   /* "(tree fragment)":11
3086  *         use_setstate = True
3087  *     else:
3088  *         use_setstate = False             # <<<<<<<<<<<<<<
3089  *     if use_setstate:
3090  *         return __pyx_unpickle_BigBedBlockHandler, (type(self), 0xfe9487d, None), state
3091  */
3092   /*else*/ {
3093     __pyx_v_use_setstate = 0;
3094   }
3095   __pyx_L3:;
3096 
3097   /* "(tree fragment)":12
3098  *     else:
3099  *         use_setstate = False
3100  *     if use_setstate:             # <<<<<<<<<<<<<<
3101  *         return __pyx_unpickle_BigBedBlockHandler, (type(self), 0xfe9487d, None), state
3102  *     else:
3103  */
3104   __pyx_t_6 = (__pyx_v_use_setstate != 0);
3105   if (__pyx_t_6) {
3106 
3107     /* "(tree fragment)":13
3108  *         use_setstate = False
3109  *     if use_setstate:
3110  *         return __pyx_unpickle_BigBedBlockHandler, (type(self), 0xfe9487d, None), state             # <<<<<<<<<<<<<<
3111  *     else:
3112  *         return __pyx_unpickle_BigBedBlockHandler, (type(self), 0xfe9487d, state)
3113  */
3114     __Pyx_XDECREF(__pyx_r);
3115     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_BigBedBlockHandle); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
3116     __Pyx_GOTREF(__pyx_t_3);
3117     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
3118     __Pyx_GOTREF(__pyx_t_4);
3119     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3120     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3121     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3122     __Pyx_INCREF(__pyx_int_266946685);
3123     __Pyx_GIVEREF(__pyx_int_266946685);
3124     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_266946685);
3125     __Pyx_INCREF(Py_None);
3126     __Pyx_GIVEREF(Py_None);
3127     PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None);
3128     __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
3129     __Pyx_GOTREF(__pyx_t_2);
3130     __Pyx_GIVEREF(__pyx_t_3);
3131     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
3132     __Pyx_GIVEREF(__pyx_t_4);
3133     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
3134     __Pyx_INCREF(__pyx_v_state);
3135     __Pyx_GIVEREF(__pyx_v_state);
3136     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);
3137     __pyx_t_3 = 0;
3138     __pyx_t_4 = 0;
3139     __pyx_r = __pyx_t_2;
3140     __pyx_t_2 = 0;
3141     goto __pyx_L0;
3142 
3143     /* "(tree fragment)":12
3144  *     else:
3145  *         use_setstate = False
3146  *     if use_setstate:             # <<<<<<<<<<<<<<
3147  *         return __pyx_unpickle_BigBedBlockHandler, (type(self), 0xfe9487d, None), state
3148  *     else:
3149  */
3150   }
3151 
3152   /* "(tree fragment)":15
3153  *         return __pyx_unpickle_BigBedBlockHandler, (type(self), 0xfe9487d, None), state
3154  *     else:
3155  *         return __pyx_unpickle_BigBedBlockHandler, (type(self), 0xfe9487d, state)             # <<<<<<<<<<<<<<
3156  * def __setstate_cython__(self, __pyx_state):
3157  *     __pyx_unpickle_BigBedBlockHandler__set_state(self, __pyx_state)
3158  */
3159   /*else*/ {
3160     __Pyx_XDECREF(__pyx_r);
3161     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_BigBedBlockHandle); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
3162     __Pyx_GOTREF(__pyx_t_2);
3163     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
3164     __Pyx_GOTREF(__pyx_t_4);
3165     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3166     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3167     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3168     __Pyx_INCREF(__pyx_int_266946685);
3169     __Pyx_GIVEREF(__pyx_int_266946685);
3170     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_266946685);
3171     __Pyx_INCREF(__pyx_v_state);
3172     __Pyx_GIVEREF(__pyx_v_state);
3173     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state);
3174     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
3175     __Pyx_GOTREF(__pyx_t_3);
3176     __Pyx_GIVEREF(__pyx_t_2);
3177     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3178     __Pyx_GIVEREF(__pyx_t_4);
3179     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
3180     __pyx_t_2 = 0;
3181     __pyx_t_4 = 0;
3182     __pyx_r = __pyx_t_3;
3183     __pyx_t_3 = 0;
3184     goto __pyx_L0;
3185   }
3186 
3187   /* "(tree fragment)":1
3188  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
3189  *     cdef tuple state
3190  *     cdef object _dict
3191  */
3192 
3193   /* function exit code */
3194   __pyx_L1_error:;
3195   __Pyx_XDECREF(__pyx_t_1);
3196   __Pyx_XDECREF(__pyx_t_2);
3197   __Pyx_XDECREF(__pyx_t_3);
3198   __Pyx_XDECREF(__pyx_t_4);
3199   __Pyx_AddTraceback("bx.bbi.bigbed_file.BigBedBlockHandler.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3200   __pyx_r = NULL;
3201   __pyx_L0:;
3202   __Pyx_XDECREF(__pyx_v_state);
3203   __Pyx_XDECREF(__pyx_v__dict);
3204   __Pyx_XGIVEREF(__pyx_r);
3205   __Pyx_RefNannyFinishContext();
3206   return __pyx_r;
3207 }
3208 
3209 /* "(tree fragment)":16
3210  *     else:
3211  *         return __pyx_unpickle_BigBedBlockHandler, (type(self), 0xfe9487d, state)
3212  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
3213  *     __pyx_unpickle_BigBedBlockHandler__set_state(self, __pyx_state)
3214  */
3215 
3216 /* Python wrapper */
3217 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_5__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)3218 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3219   PyObject *__pyx_r = 0;
3220   __Pyx_RefNannyDeclarations
3221   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3222   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_4__setstate_cython__(((struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3223 
3224   /* function exit code */
3225   __Pyx_RefNannyFinishContext();
3226   return __pyx_r;
3227 }
3228 
__pyx_pf_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_4__setstate_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler * __pyx_v_self,PyObject * __pyx_v___pyx_state)3229 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_4__setstate_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3230   PyObject *__pyx_r = NULL;
3231   __Pyx_RefNannyDeclarations
3232   PyObject *__pyx_t_1 = NULL;
3233   int __pyx_lineno = 0;
3234   const char *__pyx_filename = NULL;
3235   int __pyx_clineno = 0;
3236   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3237 
3238   /* "(tree fragment)":17
3239  *         return __pyx_unpickle_BigBedBlockHandler, (type(self), 0xfe9487d, state)
3240  * def __setstate_cython__(self, __pyx_state):
3241  *     __pyx_unpickle_BigBedBlockHandler__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
3242  */
3243   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
3244   __pyx_t_1 = __pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_BigBedBlockHandler__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
3245   __Pyx_GOTREF(__pyx_t_1);
3246   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3247 
3248   /* "(tree fragment)":16
3249  *     else:
3250  *         return __pyx_unpickle_BigBedBlockHandler, (type(self), 0xfe9487d, state)
3251  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
3252  *     __pyx_unpickle_BigBedBlockHandler__set_state(self, __pyx_state)
3253  */
3254 
3255   /* function exit code */
3256   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3257   goto __pyx_L0;
3258   __pyx_L1_error:;
3259   __Pyx_XDECREF(__pyx_t_1);
3260   __Pyx_AddTraceback("bx.bbi.bigbed_file.BigBedBlockHandler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3261   __pyx_r = NULL;
3262   __pyx_L0:;
3263   __Pyx_XGIVEREF(__pyx_r);
3264   __Pyx_RefNannyFinishContext();
3265   return __pyx_r;
3266 }
3267 
3268 /* "bx/bbi/bigbed_file.pyx":59
3269  *     """
3270  *     cdef SummarizedData sd
3271  *     def __init__( self, bits32 chrom_id, bits32 start, bits32 end, int summary_size ):             # <<<<<<<<<<<<<<
3272  *         BigBedBlockHandler.__init__( self, chrom_id, start, end )
3273  *         # What we will load into
3274  */
3275 
3276 /* Python wrapper */
3277 static int __pyx_pw_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3278 static int __pyx_pw_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3279   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id;
3280   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start;
3281   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end;
3282   int __pyx_v_summary_size;
3283   int __pyx_lineno = 0;
3284   const char *__pyx_filename = NULL;
3285   int __pyx_clineno = 0;
3286   int __pyx_r;
3287   __Pyx_RefNannyDeclarations
3288   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3289   {
3290     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom_id,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_summary_size,0};
3291     PyObject* values[4] = {0,0,0,0};
3292     if (unlikely(__pyx_kwds)) {
3293       Py_ssize_t kw_args;
3294       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3295       switch (pos_args) {
3296         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3297         CYTHON_FALLTHROUGH;
3298         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3299         CYTHON_FALLTHROUGH;
3300         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3301         CYTHON_FALLTHROUGH;
3302         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3303         CYTHON_FALLTHROUGH;
3304         case  0: break;
3305         default: goto __pyx_L5_argtuple_error;
3306       }
3307       kw_args = PyDict_Size(__pyx_kwds);
3308       switch (pos_args) {
3309         case  0:
3310         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom_id)) != 0)) kw_args--;
3311         else goto __pyx_L5_argtuple_error;
3312         CYTHON_FALLTHROUGH;
3313         case  1:
3314         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
3315         else {
3316           __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 59, __pyx_L3_error)
3317         }
3318         CYTHON_FALLTHROUGH;
3319         case  2:
3320         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
3321         else {
3322           __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 59, __pyx_L3_error)
3323         }
3324         CYTHON_FALLTHROUGH;
3325         case  3:
3326         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_summary_size)) != 0)) kw_args--;
3327         else {
3328           __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 59, __pyx_L3_error)
3329         }
3330       }
3331       if (unlikely(kw_args > 0)) {
3332         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 59, __pyx_L3_error)
3333       }
3334     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3335       goto __pyx_L5_argtuple_error;
3336     } else {
3337       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3338       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3339       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3340       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3341     }
3342     __pyx_v_chrom_id = __Pyx_PyInt_As_unsigned_int(values[0]); if (unlikely((__pyx_v_chrom_id == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error)
3343     __pyx_v_start = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_start == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error)
3344     __pyx_v_end = __Pyx_PyInt_As_unsigned_int(values[2]); if (unlikely((__pyx_v_end == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error)
3345     __pyx_v_summary_size = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_summary_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L3_error)
3346   }
3347   goto __pyx_L4_argument_unpacking_done;
3348   __pyx_L5_argtuple_error:;
3349   __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 59, __pyx_L3_error)
3350   __pyx_L3_error:;
3351   __Pyx_AddTraceback("bx.bbi.bigbed_file.SummarizingBlockHandler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3352   __Pyx_RefNannyFinishContext();
3353   return -1;
3354   __pyx_L4_argument_unpacking_done:;
3355   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler___init__(((struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *)__pyx_v_self), __pyx_v_chrom_id, __pyx_v_start, __pyx_v_end, __pyx_v_summary_size);
3356 
3357   /* function exit code */
3358   __Pyx_RefNannyFinishContext();
3359   return __pyx_r;
3360 }
3361 
__pyx_pf_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler___init__(struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler * __pyx_v_self,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end,int __pyx_v_summary_size)3362 static int __pyx_pf_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler___init__(struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, int __pyx_v_summary_size) {
3363   int __pyx_v_i;
3364   int __pyx_r;
3365   __Pyx_RefNannyDeclarations
3366   PyObject *__pyx_t_1 = NULL;
3367   PyObject *__pyx_t_2 = NULL;
3368   PyObject *__pyx_t_3 = NULL;
3369   PyObject *__pyx_t_4 = NULL;
3370   PyObject *__pyx_t_5 = NULL;
3371   PyObject *__pyx_t_6 = NULL;
3372   int __pyx_t_7;
3373   PyObject *__pyx_t_8 = NULL;
3374   int __pyx_t_9;
3375   int __pyx_t_10;
3376   int __pyx_lineno = 0;
3377   const char *__pyx_filename = NULL;
3378   int __pyx_clineno = 0;
3379   __Pyx_RefNannySetupContext("__init__", 0);
3380 
3381   /* "bx/bbi/bigbed_file.pyx":60
3382  *     cdef SummarizedData sd
3383  *     def __init__( self, bits32 chrom_id, bits32 start, bits32 end, int summary_size ):
3384  *         BigBedBlockHandler.__init__( self, chrom_id, start, end )             # <<<<<<<<<<<<<<
3385  *         # What we will load into
3386  *         self.sd = SummarizedData( start, end, summary_size )
3387  */
3388   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
3389   __Pyx_GOTREF(__pyx_t_2);
3390   __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_chrom_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error)
3391   __Pyx_GOTREF(__pyx_t_3);
3392   __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error)
3393   __Pyx_GOTREF(__pyx_t_4);
3394   __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L1_error)
3395   __Pyx_GOTREF(__pyx_t_5);
3396   __pyx_t_6 = NULL;
3397   __pyx_t_7 = 0;
3398   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3399     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
3400     if (likely(__pyx_t_6)) {
3401       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3402       __Pyx_INCREF(__pyx_t_6);
3403       __Pyx_INCREF(function);
3404       __Pyx_DECREF_SET(__pyx_t_2, function);
3405       __pyx_t_7 = 1;
3406     }
3407   }
3408   #if CYTHON_FAST_PYCALL
3409   if (PyFunction_Check(__pyx_t_2)) {
3410     PyObject *__pyx_temp[5] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_t_4, __pyx_t_5};
3411     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
3412     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3413     __Pyx_GOTREF(__pyx_t_1);
3414     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3415     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3416     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3417   } else
3418   #endif
3419   #if CYTHON_FAST_PYCCALL
3420   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
3421     PyObject *__pyx_temp[5] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_t_4, __pyx_t_5};
3422     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
3423     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3424     __Pyx_GOTREF(__pyx_t_1);
3425     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3426     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3427     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3428   } else
3429   #endif
3430   {
3431     __pyx_t_8 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L1_error)
3432     __Pyx_GOTREF(__pyx_t_8);
3433     if (__pyx_t_6) {
3434       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
3435     }
3436     __Pyx_INCREF(((PyObject *)__pyx_v_self));
3437     __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
3438     PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_v_self));
3439     __Pyx_GIVEREF(__pyx_t_3);
3440     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3);
3441     __Pyx_GIVEREF(__pyx_t_4);
3442     PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_4);
3443     __Pyx_GIVEREF(__pyx_t_5);
3444     PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_t_5);
3445     __pyx_t_3 = 0;
3446     __pyx_t_4 = 0;
3447     __pyx_t_5 = 0;
3448     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
3449     __Pyx_GOTREF(__pyx_t_1);
3450     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3451   }
3452   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3453   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3454 
3455   /* "bx/bbi/bigbed_file.pyx":62
3456  *         BigBedBlockHandler.__init__( self, chrom_id, start, end )
3457  *         # What we will load into
3458  *         self.sd = SummarizedData( start, end, summary_size )             # <<<<<<<<<<<<<<
3459  *         for i in range(summary_size):
3460  *             self.sd.min_val[i] = +numpy.inf
3461  */
3462   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
3463   __Pyx_GOTREF(__pyx_t_1);
3464   __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3465   __Pyx_GOTREF(__pyx_t_2);
3466   __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_summary_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 62, __pyx_L1_error)
3467   __Pyx_GOTREF(__pyx_t_8);
3468   __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 62, __pyx_L1_error)
3469   __Pyx_GOTREF(__pyx_t_5);
3470   __Pyx_GIVEREF(__pyx_t_1);
3471   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
3472   __Pyx_GIVEREF(__pyx_t_2);
3473   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
3474   __Pyx_GIVEREF(__pyx_t_8);
3475   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_8);
3476   __pyx_t_1 = 0;
3477   __pyx_t_2 = 0;
3478   __pyx_t_8 = 0;
3479   __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2bx_3bbi_8bbi_file_SummarizedData), __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 62, __pyx_L1_error)
3480   __Pyx_GOTREF(__pyx_t_8);
3481   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3482   __Pyx_GIVEREF(__pyx_t_8);
3483   __Pyx_GOTREF(__pyx_v_self->sd);
3484   __Pyx_DECREF(((PyObject *)__pyx_v_self->sd));
3485   __pyx_v_self->sd = ((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_t_8);
3486   __pyx_t_8 = 0;
3487 
3488   /* "bx/bbi/bigbed_file.pyx":63
3489  *         # What we will load into
3490  *         self.sd = SummarizedData( start, end, summary_size )
3491  *         for i in range(summary_size):             # <<<<<<<<<<<<<<
3492  *             self.sd.min_val[i] = +numpy.inf
3493  *         for i in range(summary_size):
3494  */
3495   __pyx_t_7 = __pyx_v_summary_size;
3496   __pyx_t_9 = __pyx_t_7;
3497   for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
3498     __pyx_v_i = __pyx_t_10;
3499 
3500     /* "bx/bbi/bigbed_file.pyx":64
3501  *         self.sd = SummarizedData( start, end, summary_size )
3502  *         for i in range(summary_size):
3503  *             self.sd.min_val[i] = +numpy.inf             # <<<<<<<<<<<<<<
3504  *         for i in range(summary_size):
3505  *             self.sd.max_val[i] = -numpy.inf
3506  */
3507     __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_numpy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 64, __pyx_L1_error)
3508     __Pyx_GOTREF(__pyx_t_8);
3509     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error)
3510     __Pyx_GOTREF(__pyx_t_5);
3511     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3512     __pyx_t_8 = PyNumber_Positive(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 64, __pyx_L1_error)
3513     __Pyx_GOTREF(__pyx_t_8);
3514     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3515     if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_self->sd->min_val), __pyx_v_i, __pyx_t_8, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 64, __pyx_L1_error)
3516     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3517   }
3518 
3519   /* "bx/bbi/bigbed_file.pyx":65
3520  *         for i in range(summary_size):
3521  *             self.sd.min_val[i] = +numpy.inf
3522  *         for i in range(summary_size):             # <<<<<<<<<<<<<<
3523  *             self.sd.max_val[i] = -numpy.inf
3524  *
3525  */
3526   __pyx_t_7 = __pyx_v_summary_size;
3527   __pyx_t_9 = __pyx_t_7;
3528   for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
3529     __pyx_v_i = __pyx_t_10;
3530 
3531     /* "bx/bbi/bigbed_file.pyx":66
3532  *             self.sd.min_val[i] = +numpy.inf
3533  *         for i in range(summary_size):
3534  *             self.sd.max_val[i] = -numpy.inf             # <<<<<<<<<<<<<<
3535  *
3536  *     cdef handle_interval_value( self, bits32 s, bits32 e, str rest ):
3537  */
3538     __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_numpy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error)
3539     __Pyx_GOTREF(__pyx_t_8);
3540     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 66, __pyx_L1_error)
3541     __Pyx_GOTREF(__pyx_t_5);
3542     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3543     __pyx_t_8 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error)
3544     __Pyx_GOTREF(__pyx_t_8);
3545     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3546     if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_self->sd->max_val), __pyx_v_i, __pyx_t_8, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 66, __pyx_L1_error)
3547     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3548   }
3549 
3550   /* "bx/bbi/bigbed_file.pyx":59
3551  *     """
3552  *     cdef SummarizedData sd
3553  *     def __init__( self, bits32 chrom_id, bits32 start, bits32 end, int summary_size ):             # <<<<<<<<<<<<<<
3554  *         BigBedBlockHandler.__init__( self, chrom_id, start, end )
3555  *         # What we will load into
3556  */
3557 
3558   /* function exit code */
3559   __pyx_r = 0;
3560   goto __pyx_L0;
3561   __pyx_L1_error:;
3562   __Pyx_XDECREF(__pyx_t_1);
3563   __Pyx_XDECREF(__pyx_t_2);
3564   __Pyx_XDECREF(__pyx_t_3);
3565   __Pyx_XDECREF(__pyx_t_4);
3566   __Pyx_XDECREF(__pyx_t_5);
3567   __Pyx_XDECREF(__pyx_t_6);
3568   __Pyx_XDECREF(__pyx_t_8);
3569   __Pyx_AddTraceback("bx.bbi.bigbed_file.SummarizingBlockHandler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3570   __pyx_r = -1;
3571   __pyx_L0:;
3572   __Pyx_RefNannyFinishContext();
3573   return __pyx_r;
3574 }
3575 
3576 /* "bx/bbi/bigbed_file.pyx":68
3577  *             self.sd.max_val[i] = -numpy.inf
3578  *
3579  *     cdef handle_interval_value( self, bits32 s, bits32 e, str rest ):             # <<<<<<<<<<<<<<
3580  *         # FIXME: Does this really obvious thing actually do what we want?
3581  *         #        No... sum_data will end up being the coverage, but min/max/etc are wrong
3582  */
3583 
__pyx_f_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_handle_interval_value(struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler * __pyx_v_self,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_s,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_e,CYTHON_UNUSED PyObject * __pyx_v_rest)3584 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_handle_interval_value(struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_s, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_e, CYTHON_UNUSED PyObject *__pyx_v_rest) {
3585   PyObject *__pyx_r = NULL;
3586   __Pyx_RefNannyDeclarations
3587   PyObject *__pyx_t_1 = NULL;
3588   int __pyx_lineno = 0;
3589   const char *__pyx_filename = NULL;
3590   int __pyx_clineno = 0;
3591   __Pyx_RefNannySetupContext("handle_interval_value", 0);
3592 
3593   /* "bx/bbi/bigbed_file.pyx":71
3594  *         # FIXME: Does this really obvious thing actually do what we want?
3595  *         #        No... sum_data will end up being the coverage, but min/max/etc are wrong
3596  *         self.sd.accumulate_interval_value( s, e, 1 )             # <<<<<<<<<<<<<<
3597  *
3598  * cdef class IntervalAccumulatingBlockHandler( BigBedBlockHandler ):
3599  */
3600   __pyx_t_1 = ((struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self->sd->__pyx_vtab)->accumulate_interval_value(__pyx_v_self->sd, __pyx_v_s, __pyx_v_e, 1.0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
3601   __Pyx_GOTREF(__pyx_t_1);
3602   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3603 
3604   /* "bx/bbi/bigbed_file.pyx":68
3605  *             self.sd.max_val[i] = -numpy.inf
3606  *
3607  *     cdef handle_interval_value( self, bits32 s, bits32 e, str rest ):             # <<<<<<<<<<<<<<
3608  *         # FIXME: Does this really obvious thing actually do what we want?
3609  *         #        No... sum_data will end up being the coverage, but min/max/etc are wrong
3610  */
3611 
3612   /* function exit code */
3613   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3614   goto __pyx_L0;
3615   __pyx_L1_error:;
3616   __Pyx_XDECREF(__pyx_t_1);
3617   __Pyx_AddTraceback("bx.bbi.bigbed_file.SummarizingBlockHandler.handle_interval_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
3618   __pyx_r = 0;
3619   __pyx_L0:;
3620   __Pyx_XGIVEREF(__pyx_r);
3621   __Pyx_RefNannyFinishContext();
3622   return __pyx_r;
3623 }
3624 
3625 /* "(tree fragment)":1
3626  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
3627  *     cdef tuple state
3628  *     cdef object _dict
3629  */
3630 
3631 /* Python wrapper */
3632 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_3__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)3633 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3634   PyObject *__pyx_r = 0;
3635   __Pyx_RefNannyDeclarations
3636   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3637   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_2__reduce_cython__(((struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *)__pyx_v_self));
3638 
3639   /* function exit code */
3640   __Pyx_RefNannyFinishContext();
3641   return __pyx_r;
3642 }
3643 
__pyx_pf_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_2__reduce_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler * __pyx_v_self)3644 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_2__reduce_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *__pyx_v_self) {
3645   PyObject *__pyx_v_state = 0;
3646   PyObject *__pyx_v__dict = 0;
3647   int __pyx_v_use_setstate;
3648   PyObject *__pyx_r = NULL;
3649   __Pyx_RefNannyDeclarations
3650   PyObject *__pyx_t_1 = NULL;
3651   PyObject *__pyx_t_2 = NULL;
3652   PyObject *__pyx_t_3 = NULL;
3653   PyObject *__pyx_t_4 = NULL;
3654   int __pyx_t_5;
3655   int __pyx_t_6;
3656   int __pyx_lineno = 0;
3657   const char *__pyx_filename = NULL;
3658   int __pyx_clineno = 0;
3659   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3660 
3661   /* "(tree fragment)":5
3662  *     cdef object _dict
3663  *     cdef bint use_setstate
3664  *     state = (self.chrom_id, self.end, self.sd, self.start)             # <<<<<<<<<<<<<<
3665  *     _dict = getattr(self, '__dict__', None)
3666  *     if _dict is not None:
3667  */
3668   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->__pyx_base.chrom_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
3669   __Pyx_GOTREF(__pyx_t_1);
3670   __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->__pyx_base.end); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
3671   __Pyx_GOTREF(__pyx_t_2);
3672   __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->__pyx_base.start); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
3673   __Pyx_GOTREF(__pyx_t_3);
3674   __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
3675   __Pyx_GOTREF(__pyx_t_4);
3676   __Pyx_GIVEREF(__pyx_t_1);
3677   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
3678   __Pyx_GIVEREF(__pyx_t_2);
3679   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
3680   __Pyx_INCREF(((PyObject *)__pyx_v_self->sd));
3681   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->sd));
3682   PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_self->sd));
3683   __Pyx_GIVEREF(__pyx_t_3);
3684   PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
3685   __pyx_t_1 = 0;
3686   __pyx_t_2 = 0;
3687   __pyx_t_3 = 0;
3688   __pyx_v_state = ((PyObject*)__pyx_t_4);
3689   __pyx_t_4 = 0;
3690 
3691   /* "(tree fragment)":6
3692  *     cdef bint use_setstate
3693  *     state = (self.chrom_id, self.end, self.sd, self.start)
3694  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
3695  *     if _dict is not None:
3696  *         state += (_dict,)
3697  */
3698   __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
3699   __Pyx_GOTREF(__pyx_t_4);
3700   __pyx_v__dict = __pyx_t_4;
3701   __pyx_t_4 = 0;
3702 
3703   /* "(tree fragment)":7
3704  *     state = (self.chrom_id, self.end, self.sd, self.start)
3705  *     _dict = getattr(self, '__dict__', None)
3706  *     if _dict is not None:             # <<<<<<<<<<<<<<
3707  *         state += (_dict,)
3708  *         use_setstate = True
3709  */
3710   __pyx_t_5 = (__pyx_v__dict != Py_None);
3711   __pyx_t_6 = (__pyx_t_5 != 0);
3712   if (__pyx_t_6) {
3713 
3714     /* "(tree fragment)":8
3715  *     _dict = getattr(self, '__dict__', None)
3716  *     if _dict is not None:
3717  *         state += (_dict,)             # <<<<<<<<<<<<<<
3718  *         use_setstate = True
3719  *     else:
3720  */
3721     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
3722     __Pyx_GOTREF(__pyx_t_4);
3723     __Pyx_INCREF(__pyx_v__dict);
3724     __Pyx_GIVEREF(__pyx_v__dict);
3725     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__dict);
3726     __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
3727     __Pyx_GOTREF(__pyx_t_3);
3728     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3729     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
3730     __pyx_t_3 = 0;
3731 
3732     /* "(tree fragment)":9
3733  *     if _dict is not None:
3734  *         state += (_dict,)
3735  *         use_setstate = True             # <<<<<<<<<<<<<<
3736  *     else:
3737  *         use_setstate = self.sd is not None
3738  */
3739     __pyx_v_use_setstate = 1;
3740 
3741     /* "(tree fragment)":7
3742  *     state = (self.chrom_id, self.end, self.sd, self.start)
3743  *     _dict = getattr(self, '__dict__', None)
3744  *     if _dict is not None:             # <<<<<<<<<<<<<<
3745  *         state += (_dict,)
3746  *         use_setstate = True
3747  */
3748     goto __pyx_L3;
3749   }
3750 
3751   /* "(tree fragment)":11
3752  *         use_setstate = True
3753  *     else:
3754  *         use_setstate = self.sd is not None             # <<<<<<<<<<<<<<
3755  *     if use_setstate:
3756  *         return __pyx_unpickle_SummarizingBlockHandler, (type(self), 0x725a786, None), state
3757  */
3758   /*else*/ {
3759     __pyx_t_6 = (((PyObject *)__pyx_v_self->sd) != Py_None);
3760     __pyx_v_use_setstate = __pyx_t_6;
3761   }
3762   __pyx_L3:;
3763 
3764   /* "(tree fragment)":12
3765  *     else:
3766  *         use_setstate = self.sd is not None
3767  *     if use_setstate:             # <<<<<<<<<<<<<<
3768  *         return __pyx_unpickle_SummarizingBlockHandler, (type(self), 0x725a786, None), state
3769  *     else:
3770  */
3771   __pyx_t_6 = (__pyx_v_use_setstate != 0);
3772   if (__pyx_t_6) {
3773 
3774     /* "(tree fragment)":13
3775  *         use_setstate = self.sd is not None
3776  *     if use_setstate:
3777  *         return __pyx_unpickle_SummarizingBlockHandler, (type(self), 0x725a786, None), state             # <<<<<<<<<<<<<<
3778  *     else:
3779  *         return __pyx_unpickle_SummarizingBlockHandler, (type(self), 0x725a786, state)
3780  */
3781     __Pyx_XDECREF(__pyx_r);
3782     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_SummarizingBlockH); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
3783     __Pyx_GOTREF(__pyx_t_3);
3784     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
3785     __Pyx_GOTREF(__pyx_t_4);
3786     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3787     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3788     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3789     __Pyx_INCREF(__pyx_int_119908230);
3790     __Pyx_GIVEREF(__pyx_int_119908230);
3791     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_119908230);
3792     __Pyx_INCREF(Py_None);
3793     __Pyx_GIVEREF(Py_None);
3794     PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None);
3795     __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
3796     __Pyx_GOTREF(__pyx_t_2);
3797     __Pyx_GIVEREF(__pyx_t_3);
3798     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
3799     __Pyx_GIVEREF(__pyx_t_4);
3800     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
3801     __Pyx_INCREF(__pyx_v_state);
3802     __Pyx_GIVEREF(__pyx_v_state);
3803     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);
3804     __pyx_t_3 = 0;
3805     __pyx_t_4 = 0;
3806     __pyx_r = __pyx_t_2;
3807     __pyx_t_2 = 0;
3808     goto __pyx_L0;
3809 
3810     /* "(tree fragment)":12
3811  *     else:
3812  *         use_setstate = self.sd is not None
3813  *     if use_setstate:             # <<<<<<<<<<<<<<
3814  *         return __pyx_unpickle_SummarizingBlockHandler, (type(self), 0x725a786, None), state
3815  *     else:
3816  */
3817   }
3818 
3819   /* "(tree fragment)":15
3820  *         return __pyx_unpickle_SummarizingBlockHandler, (type(self), 0x725a786, None), state
3821  *     else:
3822  *         return __pyx_unpickle_SummarizingBlockHandler, (type(self), 0x725a786, state)             # <<<<<<<<<<<<<<
3823  * def __setstate_cython__(self, __pyx_state):
3824  *     __pyx_unpickle_SummarizingBlockHandler__set_state(self, __pyx_state)
3825  */
3826   /*else*/ {
3827     __Pyx_XDECREF(__pyx_r);
3828     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_SummarizingBlockH); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
3829     __Pyx_GOTREF(__pyx_t_2);
3830     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
3831     __Pyx_GOTREF(__pyx_t_4);
3832     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3833     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3834     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3835     __Pyx_INCREF(__pyx_int_119908230);
3836     __Pyx_GIVEREF(__pyx_int_119908230);
3837     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_119908230);
3838     __Pyx_INCREF(__pyx_v_state);
3839     __Pyx_GIVEREF(__pyx_v_state);
3840     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state);
3841     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
3842     __Pyx_GOTREF(__pyx_t_3);
3843     __Pyx_GIVEREF(__pyx_t_2);
3844     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3845     __Pyx_GIVEREF(__pyx_t_4);
3846     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
3847     __pyx_t_2 = 0;
3848     __pyx_t_4 = 0;
3849     __pyx_r = __pyx_t_3;
3850     __pyx_t_3 = 0;
3851     goto __pyx_L0;
3852   }
3853 
3854   /* "(tree fragment)":1
3855  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
3856  *     cdef tuple state
3857  *     cdef object _dict
3858  */
3859 
3860   /* function exit code */
3861   __pyx_L1_error:;
3862   __Pyx_XDECREF(__pyx_t_1);
3863   __Pyx_XDECREF(__pyx_t_2);
3864   __Pyx_XDECREF(__pyx_t_3);
3865   __Pyx_XDECREF(__pyx_t_4);
3866   __Pyx_AddTraceback("bx.bbi.bigbed_file.SummarizingBlockHandler.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3867   __pyx_r = NULL;
3868   __pyx_L0:;
3869   __Pyx_XDECREF(__pyx_v_state);
3870   __Pyx_XDECREF(__pyx_v__dict);
3871   __Pyx_XGIVEREF(__pyx_r);
3872   __Pyx_RefNannyFinishContext();
3873   return __pyx_r;
3874 }
3875 
3876 /* "(tree fragment)":16
3877  *     else:
3878  *         return __pyx_unpickle_SummarizingBlockHandler, (type(self), 0x725a786, state)
3879  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
3880  *     __pyx_unpickle_SummarizingBlockHandler__set_state(self, __pyx_state)
3881  */
3882 
3883 /* Python wrapper */
3884 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_5__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)3885 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3886   PyObject *__pyx_r = 0;
3887   __Pyx_RefNannyDeclarations
3888   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3889   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_4__setstate_cython__(((struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3890 
3891   /* function exit code */
3892   __Pyx_RefNannyFinishContext();
3893   return __pyx_r;
3894 }
3895 
__pyx_pf_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_4__setstate_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler * __pyx_v_self,PyObject * __pyx_v___pyx_state)3896 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_4__setstate_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3897   PyObject *__pyx_r = NULL;
3898   __Pyx_RefNannyDeclarations
3899   PyObject *__pyx_t_1 = NULL;
3900   int __pyx_lineno = 0;
3901   const char *__pyx_filename = NULL;
3902   int __pyx_clineno = 0;
3903   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3904 
3905   /* "(tree fragment)":17
3906  *         return __pyx_unpickle_SummarizingBlockHandler, (type(self), 0x725a786, state)
3907  * def __setstate_cython__(self, __pyx_state):
3908  *     __pyx_unpickle_SummarizingBlockHandler__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
3909  */
3910   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
3911   __pyx_t_1 = __pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_SummarizingBlockHandler__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
3912   __Pyx_GOTREF(__pyx_t_1);
3913   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3914 
3915   /* "(tree fragment)":16
3916  *     else:
3917  *         return __pyx_unpickle_SummarizingBlockHandler, (type(self), 0x725a786, state)
3918  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
3919  *     __pyx_unpickle_SummarizingBlockHandler__set_state(self, __pyx_state)
3920  */
3921 
3922   /* function exit code */
3923   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3924   goto __pyx_L0;
3925   __pyx_L1_error:;
3926   __Pyx_XDECREF(__pyx_t_1);
3927   __Pyx_AddTraceback("bx.bbi.bigbed_file.SummarizingBlockHandler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3928   __pyx_r = NULL;
3929   __pyx_L0:;
3930   __Pyx_XGIVEREF(__pyx_r);
3931   __Pyx_RefNannyFinishContext();
3932   return __pyx_r;
3933 }
3934 
3935 /* "bx/bbi/bigbed_file.pyx":78
3936  *     Accumulates intervals into a list of intervals with values
3937  *     """
3938  *     def __init__( self, bits32 chrom_id, bits32 start, bits32 end ):             # <<<<<<<<<<<<<<
3939  *         BigBedBlockHandler.__init__( self, chrom_id, start, end )
3940  *         self.intervals = []
3941  */
3942 
3943 /* Python wrapper */
3944 static int __pyx_pw_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3945 static int __pyx_pw_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3946   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id;
3947   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start;
3948   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end;
3949   int __pyx_lineno = 0;
3950   const char *__pyx_filename = NULL;
3951   int __pyx_clineno = 0;
3952   int __pyx_r;
3953   __Pyx_RefNannyDeclarations
3954   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3955   {
3956     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom_id,&__pyx_n_s_start,&__pyx_n_s_end,0};
3957     PyObject* values[3] = {0,0,0};
3958     if (unlikely(__pyx_kwds)) {
3959       Py_ssize_t kw_args;
3960       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3961       switch (pos_args) {
3962         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3963         CYTHON_FALLTHROUGH;
3964         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3965         CYTHON_FALLTHROUGH;
3966         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3967         CYTHON_FALLTHROUGH;
3968         case  0: break;
3969         default: goto __pyx_L5_argtuple_error;
3970       }
3971       kw_args = PyDict_Size(__pyx_kwds);
3972       switch (pos_args) {
3973         case  0:
3974         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom_id)) != 0)) kw_args--;
3975         else goto __pyx_L5_argtuple_error;
3976         CYTHON_FALLTHROUGH;
3977         case  1:
3978         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
3979         else {
3980           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 78, __pyx_L3_error)
3981         }
3982         CYTHON_FALLTHROUGH;
3983         case  2:
3984         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
3985         else {
3986           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 78, __pyx_L3_error)
3987         }
3988       }
3989       if (unlikely(kw_args > 0)) {
3990         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 78, __pyx_L3_error)
3991       }
3992     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3993       goto __pyx_L5_argtuple_error;
3994     } else {
3995       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3996       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3997       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3998     }
3999     __pyx_v_chrom_id = __Pyx_PyInt_As_unsigned_int(values[0]); if (unlikely((__pyx_v_chrom_id == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error)
4000     __pyx_v_start = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_start == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error)
4001     __pyx_v_end = __Pyx_PyInt_As_unsigned_int(values[2]); if (unlikely((__pyx_v_end == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L3_error)
4002   }
4003   goto __pyx_L4_argument_unpacking_done;
4004   __pyx_L5_argtuple_error:;
4005   __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 78, __pyx_L3_error)
4006   __pyx_L3_error:;
4007   __Pyx_AddTraceback("bx.bbi.bigbed_file.IntervalAccumulatingBlockHandler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4008   __Pyx_RefNannyFinishContext();
4009   return -1;
4010   __pyx_L4_argument_unpacking_done:;
4011   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler___init__(((struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *)__pyx_v_self), __pyx_v_chrom_id, __pyx_v_start, __pyx_v_end);
4012 
4013   /* function exit code */
4014   __Pyx_RefNannyFinishContext();
4015   return __pyx_r;
4016 }
4017 
__pyx_pf_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler___init__(struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler * __pyx_v_self,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end)4018 static int __pyx_pf_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler___init__(struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end) {
4019   int __pyx_r;
4020   __Pyx_RefNannyDeclarations
4021   PyObject *__pyx_t_1 = NULL;
4022   PyObject *__pyx_t_2 = NULL;
4023   PyObject *__pyx_t_3 = NULL;
4024   PyObject *__pyx_t_4 = NULL;
4025   PyObject *__pyx_t_5 = NULL;
4026   PyObject *__pyx_t_6 = NULL;
4027   int __pyx_t_7;
4028   PyObject *__pyx_t_8 = NULL;
4029   int __pyx_lineno = 0;
4030   const char *__pyx_filename = NULL;
4031   int __pyx_clineno = 0;
4032   __Pyx_RefNannySetupContext("__init__", 0);
4033 
4034   /* "bx/bbi/bigbed_file.pyx":79
4035  *     """
4036  *     def __init__( self, bits32 chrom_id, bits32 start, bits32 end ):
4037  *         BigBedBlockHandler.__init__( self, chrom_id, start, end )             # <<<<<<<<<<<<<<
4038  *         self.intervals = []
4039  *
4040  */
4041   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
4042   __Pyx_GOTREF(__pyx_t_2);
4043   __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_chrom_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
4044   __Pyx_GOTREF(__pyx_t_3);
4045   __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
4046   __Pyx_GOTREF(__pyx_t_4);
4047   __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error)
4048   __Pyx_GOTREF(__pyx_t_5);
4049   __pyx_t_6 = NULL;
4050   __pyx_t_7 = 0;
4051   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4052     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
4053     if (likely(__pyx_t_6)) {
4054       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4055       __Pyx_INCREF(__pyx_t_6);
4056       __Pyx_INCREF(function);
4057       __Pyx_DECREF_SET(__pyx_t_2, function);
4058       __pyx_t_7 = 1;
4059     }
4060   }
4061   #if CYTHON_FAST_PYCALL
4062   if (PyFunction_Check(__pyx_t_2)) {
4063     PyObject *__pyx_temp[5] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_t_4, __pyx_t_5};
4064     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
4065     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4066     __Pyx_GOTREF(__pyx_t_1);
4067     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4068     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4069     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4070   } else
4071   #endif
4072   #if CYTHON_FAST_PYCCALL
4073   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
4074     PyObject *__pyx_temp[5] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_t_4, __pyx_t_5};
4075     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
4076     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4077     __Pyx_GOTREF(__pyx_t_1);
4078     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4079     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4080     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4081   } else
4082   #endif
4083   {
4084     __pyx_t_8 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 79, __pyx_L1_error)
4085     __Pyx_GOTREF(__pyx_t_8);
4086     if (__pyx_t_6) {
4087       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
4088     }
4089     __Pyx_INCREF(((PyObject *)__pyx_v_self));
4090     __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
4091     PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_v_self));
4092     __Pyx_GIVEREF(__pyx_t_3);
4093     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3);
4094     __Pyx_GIVEREF(__pyx_t_4);
4095     PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_4);
4096     __Pyx_GIVEREF(__pyx_t_5);
4097     PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_t_5);
4098     __pyx_t_3 = 0;
4099     __pyx_t_4 = 0;
4100     __pyx_t_5 = 0;
4101     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
4102     __Pyx_GOTREF(__pyx_t_1);
4103     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4104   }
4105   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4106   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4107 
4108   /* "bx/bbi/bigbed_file.pyx":80
4109  *     def __init__( self, bits32 chrom_id, bits32 start, bits32 end ):
4110  *         BigBedBlockHandler.__init__( self, chrom_id, start, end )
4111  *         self.intervals = []             # <<<<<<<<<<<<<<
4112  *
4113  *     cdef handle_interval_value( self, bits32 s, bits32 e, str rest ):
4114  */
4115   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
4116   __Pyx_GOTREF(__pyx_t_1);
4117   __Pyx_GIVEREF(__pyx_t_1);
4118   __Pyx_GOTREF(__pyx_v_self->intervals);
4119   __Pyx_DECREF(__pyx_v_self->intervals);
4120   __pyx_v_self->intervals = ((PyObject*)__pyx_t_1);
4121   __pyx_t_1 = 0;
4122 
4123   /* "bx/bbi/bigbed_file.pyx":78
4124  *     Accumulates intervals into a list of intervals with values
4125  *     """
4126  *     def __init__( self, bits32 chrom_id, bits32 start, bits32 end ):             # <<<<<<<<<<<<<<
4127  *         BigBedBlockHandler.__init__( self, chrom_id, start, end )
4128  *         self.intervals = []
4129  */
4130 
4131   /* function exit code */
4132   __pyx_r = 0;
4133   goto __pyx_L0;
4134   __pyx_L1_error:;
4135   __Pyx_XDECREF(__pyx_t_1);
4136   __Pyx_XDECREF(__pyx_t_2);
4137   __Pyx_XDECREF(__pyx_t_3);
4138   __Pyx_XDECREF(__pyx_t_4);
4139   __Pyx_XDECREF(__pyx_t_5);
4140   __Pyx_XDECREF(__pyx_t_6);
4141   __Pyx_XDECREF(__pyx_t_8);
4142   __Pyx_AddTraceback("bx.bbi.bigbed_file.IntervalAccumulatingBlockHandler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4143   __pyx_r = -1;
4144   __pyx_L0:;
4145   __Pyx_RefNannyFinishContext();
4146   return __pyx_r;
4147 }
4148 
4149 /* "bx/bbi/bigbed_file.pyx":82
4150  *         self.intervals = []
4151  *
4152  *     cdef handle_interval_value( self, bits32 s, bits32 e, str rest ):             # <<<<<<<<<<<<<<
4153  *         self.intervals.append( ( s, e, rest ) )
4154  *
4155  */
4156 
__pyx_f_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_handle_interval_value(struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler * __pyx_v_self,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_s,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_e,PyObject * __pyx_v_rest)4157 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_handle_interval_value(struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_s, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_e, PyObject *__pyx_v_rest) {
4158   PyObject *__pyx_r = NULL;
4159   __Pyx_RefNannyDeclarations
4160   PyObject *__pyx_t_1 = NULL;
4161   PyObject *__pyx_t_2 = NULL;
4162   PyObject *__pyx_t_3 = NULL;
4163   int __pyx_t_4;
4164   int __pyx_lineno = 0;
4165   const char *__pyx_filename = NULL;
4166   int __pyx_clineno = 0;
4167   __Pyx_RefNannySetupContext("handle_interval_value", 0);
4168 
4169   /* "bx/bbi/bigbed_file.pyx":83
4170  *
4171  *     cdef handle_interval_value( self, bits32 s, bits32 e, str rest ):
4172  *         self.intervals.append( ( s, e, rest ) )             # <<<<<<<<<<<<<<
4173  *
4174  * cdef class BigBedFile( BBIFile ):
4175  */
4176   if (unlikely(__pyx_v_self->intervals == Py_None)) {
4177     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
4178     __PYX_ERR(0, 83, __pyx_L1_error)
4179   }
4180   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
4181   __Pyx_GOTREF(__pyx_t_1);
4182   __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
4183   __Pyx_GOTREF(__pyx_t_2);
4184   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
4185   __Pyx_GOTREF(__pyx_t_3);
4186   __Pyx_GIVEREF(__pyx_t_1);
4187   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
4188   __Pyx_GIVEREF(__pyx_t_2);
4189   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
4190   __Pyx_INCREF(__pyx_v_rest);
4191   __Pyx_GIVEREF(__pyx_v_rest);
4192   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_rest);
4193   __pyx_t_1 = 0;
4194   __pyx_t_2 = 0;
4195   __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_self->intervals, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 83, __pyx_L1_error)
4196   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4197 
4198   /* "bx/bbi/bigbed_file.pyx":82
4199  *         self.intervals = []
4200  *
4201  *     cdef handle_interval_value( self, bits32 s, bits32 e, str rest ):             # <<<<<<<<<<<<<<
4202  *         self.intervals.append( ( s, e, rest ) )
4203  *
4204  */
4205 
4206   /* function exit code */
4207   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4208   goto __pyx_L0;
4209   __pyx_L1_error:;
4210   __Pyx_XDECREF(__pyx_t_1);
4211   __Pyx_XDECREF(__pyx_t_2);
4212   __Pyx_XDECREF(__pyx_t_3);
4213   __Pyx_AddTraceback("bx.bbi.bigbed_file.IntervalAccumulatingBlockHandler.handle_interval_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
4214   __pyx_r = 0;
4215   __pyx_L0:;
4216   __Pyx_XGIVEREF(__pyx_r);
4217   __Pyx_RefNannyFinishContext();
4218   return __pyx_r;
4219 }
4220 
4221 /* "(tree fragment)":1
4222  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
4223  *     cdef tuple state
4224  *     cdef object _dict
4225  */
4226 
4227 /* Python wrapper */
4228 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_3__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)4229 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4230   PyObject *__pyx_r = 0;
4231   __Pyx_RefNannyDeclarations
4232   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4233   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_2__reduce_cython__(((struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *)__pyx_v_self));
4234 
4235   /* function exit code */
4236   __Pyx_RefNannyFinishContext();
4237   return __pyx_r;
4238 }
4239 
__pyx_pf_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_2__reduce_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler * __pyx_v_self)4240 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_2__reduce_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *__pyx_v_self) {
4241   PyObject *__pyx_v_state = 0;
4242   PyObject *__pyx_v__dict = 0;
4243   int __pyx_v_use_setstate;
4244   PyObject *__pyx_r = NULL;
4245   __Pyx_RefNannyDeclarations
4246   PyObject *__pyx_t_1 = NULL;
4247   PyObject *__pyx_t_2 = NULL;
4248   PyObject *__pyx_t_3 = NULL;
4249   PyObject *__pyx_t_4 = NULL;
4250   int __pyx_t_5;
4251   int __pyx_t_6;
4252   int __pyx_lineno = 0;
4253   const char *__pyx_filename = NULL;
4254   int __pyx_clineno = 0;
4255   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4256 
4257   /* "(tree fragment)":5
4258  *     cdef object _dict
4259  *     cdef bint use_setstate
4260  *     state = (self.chrom_id, self.end, self.intervals, self.start)             # <<<<<<<<<<<<<<
4261  *     _dict = getattr(self, '__dict__', None)
4262  *     if _dict is not None:
4263  */
4264   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->__pyx_base.chrom_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
4265   __Pyx_GOTREF(__pyx_t_1);
4266   __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->__pyx_base.end); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
4267   __Pyx_GOTREF(__pyx_t_2);
4268   __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->__pyx_base.start); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
4269   __Pyx_GOTREF(__pyx_t_3);
4270   __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
4271   __Pyx_GOTREF(__pyx_t_4);
4272   __Pyx_GIVEREF(__pyx_t_1);
4273   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
4274   __Pyx_GIVEREF(__pyx_t_2);
4275   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
4276   __Pyx_INCREF(__pyx_v_self->intervals);
4277   __Pyx_GIVEREF(__pyx_v_self->intervals);
4278   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->intervals);
4279   __Pyx_GIVEREF(__pyx_t_3);
4280   PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
4281   __pyx_t_1 = 0;
4282   __pyx_t_2 = 0;
4283   __pyx_t_3 = 0;
4284   __pyx_v_state = ((PyObject*)__pyx_t_4);
4285   __pyx_t_4 = 0;
4286 
4287   /* "(tree fragment)":6
4288  *     cdef bint use_setstate
4289  *     state = (self.chrom_id, self.end, self.intervals, self.start)
4290  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
4291  *     if _dict is not None:
4292  *         state += (_dict,)
4293  */
4294   __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
4295   __Pyx_GOTREF(__pyx_t_4);
4296   __pyx_v__dict = __pyx_t_4;
4297   __pyx_t_4 = 0;
4298 
4299   /* "(tree fragment)":7
4300  *     state = (self.chrom_id, self.end, self.intervals, self.start)
4301  *     _dict = getattr(self, '__dict__', None)
4302  *     if _dict is not None:             # <<<<<<<<<<<<<<
4303  *         state += (_dict,)
4304  *         use_setstate = True
4305  */
4306   __pyx_t_5 = (__pyx_v__dict != Py_None);
4307   __pyx_t_6 = (__pyx_t_5 != 0);
4308   if (__pyx_t_6) {
4309 
4310     /* "(tree fragment)":8
4311  *     _dict = getattr(self, '__dict__', None)
4312  *     if _dict is not None:
4313  *         state += (_dict,)             # <<<<<<<<<<<<<<
4314  *         use_setstate = True
4315  *     else:
4316  */
4317     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
4318     __Pyx_GOTREF(__pyx_t_4);
4319     __Pyx_INCREF(__pyx_v__dict);
4320     __Pyx_GIVEREF(__pyx_v__dict);
4321     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__dict);
4322     __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
4323     __Pyx_GOTREF(__pyx_t_3);
4324     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4325     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
4326     __pyx_t_3 = 0;
4327 
4328     /* "(tree fragment)":9
4329  *     if _dict is not None:
4330  *         state += (_dict,)
4331  *         use_setstate = True             # <<<<<<<<<<<<<<
4332  *     else:
4333  *         use_setstate = self.intervals is not None
4334  */
4335     __pyx_v_use_setstate = 1;
4336 
4337     /* "(tree fragment)":7
4338  *     state = (self.chrom_id, self.end, self.intervals, self.start)
4339  *     _dict = getattr(self, '__dict__', None)
4340  *     if _dict is not None:             # <<<<<<<<<<<<<<
4341  *         state += (_dict,)
4342  *         use_setstate = True
4343  */
4344     goto __pyx_L3;
4345   }
4346 
4347   /* "(tree fragment)":11
4348  *         use_setstate = True
4349  *     else:
4350  *         use_setstate = self.intervals is not None             # <<<<<<<<<<<<<<
4351  *     if use_setstate:
4352  *         return __pyx_unpickle_IntervalAccumulatingBlockHandler, (type(self), 0xe0ff5c2, None), state
4353  */
4354   /*else*/ {
4355     __pyx_t_6 = (__pyx_v_self->intervals != ((PyObject*)Py_None));
4356     __pyx_v_use_setstate = __pyx_t_6;
4357   }
4358   __pyx_L3:;
4359 
4360   /* "(tree fragment)":12
4361  *     else:
4362  *         use_setstate = self.intervals is not None
4363  *     if use_setstate:             # <<<<<<<<<<<<<<
4364  *         return __pyx_unpickle_IntervalAccumulatingBlockHandler, (type(self), 0xe0ff5c2, None), state
4365  *     else:
4366  */
4367   __pyx_t_6 = (__pyx_v_use_setstate != 0);
4368   if (__pyx_t_6) {
4369 
4370     /* "(tree fragment)":13
4371  *         use_setstate = self.intervals is not None
4372  *     if use_setstate:
4373  *         return __pyx_unpickle_IntervalAccumulatingBlockHandler, (type(self), 0xe0ff5c2, None), state             # <<<<<<<<<<<<<<
4374  *     else:
4375  *         return __pyx_unpickle_IntervalAccumulatingBlockHandler, (type(self), 0xe0ff5c2, state)
4376  */
4377     __Pyx_XDECREF(__pyx_r);
4378     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_IntervalAccumulat); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
4379     __Pyx_GOTREF(__pyx_t_3);
4380     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
4381     __Pyx_GOTREF(__pyx_t_4);
4382     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4383     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4384     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4385     __Pyx_INCREF(__pyx_int_235926978);
4386     __Pyx_GIVEREF(__pyx_int_235926978);
4387     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_235926978);
4388     __Pyx_INCREF(Py_None);
4389     __Pyx_GIVEREF(Py_None);
4390     PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None);
4391     __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
4392     __Pyx_GOTREF(__pyx_t_2);
4393     __Pyx_GIVEREF(__pyx_t_3);
4394     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
4395     __Pyx_GIVEREF(__pyx_t_4);
4396     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
4397     __Pyx_INCREF(__pyx_v_state);
4398     __Pyx_GIVEREF(__pyx_v_state);
4399     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);
4400     __pyx_t_3 = 0;
4401     __pyx_t_4 = 0;
4402     __pyx_r = __pyx_t_2;
4403     __pyx_t_2 = 0;
4404     goto __pyx_L0;
4405 
4406     /* "(tree fragment)":12
4407  *     else:
4408  *         use_setstate = self.intervals is not None
4409  *     if use_setstate:             # <<<<<<<<<<<<<<
4410  *         return __pyx_unpickle_IntervalAccumulatingBlockHandler, (type(self), 0xe0ff5c2, None), state
4411  *     else:
4412  */
4413   }
4414 
4415   /* "(tree fragment)":15
4416  *         return __pyx_unpickle_IntervalAccumulatingBlockHandler, (type(self), 0xe0ff5c2, None), state
4417  *     else:
4418  *         return __pyx_unpickle_IntervalAccumulatingBlockHandler, (type(self), 0xe0ff5c2, state)             # <<<<<<<<<<<<<<
4419  * def __setstate_cython__(self, __pyx_state):
4420  *     __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(self, __pyx_state)
4421  */
4422   /*else*/ {
4423     __Pyx_XDECREF(__pyx_r);
4424     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_IntervalAccumulat); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
4425     __Pyx_GOTREF(__pyx_t_2);
4426     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
4427     __Pyx_GOTREF(__pyx_t_4);
4428     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4429     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4430     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4431     __Pyx_INCREF(__pyx_int_235926978);
4432     __Pyx_GIVEREF(__pyx_int_235926978);
4433     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_235926978);
4434     __Pyx_INCREF(__pyx_v_state);
4435     __Pyx_GIVEREF(__pyx_v_state);
4436     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state);
4437     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
4438     __Pyx_GOTREF(__pyx_t_3);
4439     __Pyx_GIVEREF(__pyx_t_2);
4440     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
4441     __Pyx_GIVEREF(__pyx_t_4);
4442     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
4443     __pyx_t_2 = 0;
4444     __pyx_t_4 = 0;
4445     __pyx_r = __pyx_t_3;
4446     __pyx_t_3 = 0;
4447     goto __pyx_L0;
4448   }
4449 
4450   /* "(tree fragment)":1
4451  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
4452  *     cdef tuple state
4453  *     cdef object _dict
4454  */
4455 
4456   /* function exit code */
4457   __pyx_L1_error:;
4458   __Pyx_XDECREF(__pyx_t_1);
4459   __Pyx_XDECREF(__pyx_t_2);
4460   __Pyx_XDECREF(__pyx_t_3);
4461   __Pyx_XDECREF(__pyx_t_4);
4462   __Pyx_AddTraceback("bx.bbi.bigbed_file.IntervalAccumulatingBlockHandler.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4463   __pyx_r = NULL;
4464   __pyx_L0:;
4465   __Pyx_XDECREF(__pyx_v_state);
4466   __Pyx_XDECREF(__pyx_v__dict);
4467   __Pyx_XGIVEREF(__pyx_r);
4468   __Pyx_RefNannyFinishContext();
4469   return __pyx_r;
4470 }
4471 
4472 /* "(tree fragment)":16
4473  *     else:
4474  *         return __pyx_unpickle_IntervalAccumulatingBlockHandler, (type(self), 0xe0ff5c2, state)
4475  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
4476  *     __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(self, __pyx_state)
4477  */
4478 
4479 /* Python wrapper */
4480 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_5__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)4481 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4482   PyObject *__pyx_r = 0;
4483   __Pyx_RefNannyDeclarations
4484   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4485   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_4__setstate_cython__(((struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4486 
4487   /* function exit code */
4488   __Pyx_RefNannyFinishContext();
4489   return __pyx_r;
4490 }
4491 
__pyx_pf_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_4__setstate_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler * __pyx_v_self,PyObject * __pyx_v___pyx_state)4492 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_4__setstate_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4493   PyObject *__pyx_r = NULL;
4494   __Pyx_RefNannyDeclarations
4495   PyObject *__pyx_t_1 = NULL;
4496   int __pyx_lineno = 0;
4497   const char *__pyx_filename = NULL;
4498   int __pyx_clineno = 0;
4499   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4500 
4501   /* "(tree fragment)":17
4502  *         return __pyx_unpickle_IntervalAccumulatingBlockHandler, (type(self), 0xe0ff5c2, state)
4503  * def __setstate_cython__(self, __pyx_state):
4504  *     __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
4505  */
4506   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
4507   __pyx_t_1 = __pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
4508   __Pyx_GOTREF(__pyx_t_1);
4509   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4510 
4511   /* "(tree fragment)":16
4512  *     else:
4513  *         return __pyx_unpickle_IntervalAccumulatingBlockHandler, (type(self), 0xe0ff5c2, state)
4514  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
4515  *     __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(self, __pyx_state)
4516  */
4517 
4518   /* function exit code */
4519   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4520   goto __pyx_L0;
4521   __pyx_L1_error:;
4522   __Pyx_XDECREF(__pyx_t_1);
4523   __Pyx_AddTraceback("bx.bbi.bigbed_file.IntervalAccumulatingBlockHandler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4524   __pyx_r = NULL;
4525   __pyx_L0:;
4526   __Pyx_XGIVEREF(__pyx_r);
4527   __Pyx_RefNannyFinishContext();
4528   return __pyx_r;
4529 }
4530 
4531 /* "bx/bbi/bigbed_file.pyx":89
4532  *     A "big binary indexed" file whose raw data is in BED format.
4533  *     """
4534  *     def __init__( self, file=None ):             # <<<<<<<<<<<<<<
4535  *         BBIFile.__init__( self, file, big_bed_sig, "bigbed" )
4536  *
4537  */
4538 
4539 /* Python wrapper */
4540 static int __pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4541 static int __pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4542   PyObject *__pyx_v_file = 0;
4543   int __pyx_lineno = 0;
4544   const char *__pyx_filename = NULL;
4545   int __pyx_clineno = 0;
4546   int __pyx_r;
4547   __Pyx_RefNannyDeclarations
4548   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4549   {
4550     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file,0};
4551     PyObject* values[1] = {0};
4552     values[0] = ((PyObject *)Py_None);
4553     if (unlikely(__pyx_kwds)) {
4554       Py_ssize_t kw_args;
4555       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4556       switch (pos_args) {
4557         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4558         CYTHON_FALLTHROUGH;
4559         case  0: break;
4560         default: goto __pyx_L5_argtuple_error;
4561       }
4562       kw_args = PyDict_Size(__pyx_kwds);
4563       switch (pos_args) {
4564         case  0:
4565         if (kw_args > 0) {
4566           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_file);
4567           if (value) { values[0] = value; kw_args--; }
4568         }
4569       }
4570       if (unlikely(kw_args > 0)) {
4571         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 89, __pyx_L3_error)
4572       }
4573     } else {
4574       switch (PyTuple_GET_SIZE(__pyx_args)) {
4575         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4576         CYTHON_FALLTHROUGH;
4577         case  0: break;
4578         default: goto __pyx_L5_argtuple_error;
4579       }
4580     }
4581     __pyx_v_file = values[0];
4582   }
4583   goto __pyx_L4_argument_unpacking_done;
4584   __pyx_L5_argtuple_error:;
4585   __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 89, __pyx_L3_error)
4586   __pyx_L3_error:;
4587   __Pyx_AddTraceback("bx.bbi.bigbed_file.BigBedFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4588   __Pyx_RefNannyFinishContext();
4589   return -1;
4590   __pyx_L4_argument_unpacking_done:;
4591   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file_10BigBedFile___init__(((struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *)__pyx_v_self), __pyx_v_file);
4592 
4593   /* function exit code */
4594   __Pyx_RefNannyFinishContext();
4595   return __pyx_r;
4596 }
4597 
__pyx_pf_2bx_3bbi_11bigbed_file_10BigBedFile___init__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile * __pyx_v_self,PyObject * __pyx_v_file)4598 static int __pyx_pf_2bx_3bbi_11bigbed_file_10BigBedFile___init__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *__pyx_v_self, PyObject *__pyx_v_file) {
4599   int __pyx_r;
4600   __Pyx_RefNannyDeclarations
4601   PyObject *__pyx_t_1 = NULL;
4602   PyObject *__pyx_t_2 = NULL;
4603   PyObject *__pyx_t_3 = NULL;
4604   int __pyx_t_4;
4605   PyObject *__pyx_t_5 = NULL;
4606   int __pyx_lineno = 0;
4607   const char *__pyx_filename = NULL;
4608   int __pyx_clineno = 0;
4609   __Pyx_RefNannySetupContext("__init__", 0);
4610 
4611   /* "bx/bbi/bigbed_file.pyx":90
4612  *     """
4613  *     def __init__( self, file=None ):
4614  *         BBIFile.__init__( self, file, big_bed_sig, "bigbed" )             # <<<<<<<<<<<<<<
4615  *
4616  *     cdef _summarize_from_full( self, bits32 chrom_id, bits32 start, bits32 end, int summary_size ):
4617  */
4618   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_3bbi_8bbi_file_BBIFile), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
4619   __Pyx_GOTREF(__pyx_t_2);
4620   __pyx_t_3 = NULL;
4621   __pyx_t_4 = 0;
4622   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4623     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4624     if (likely(__pyx_t_3)) {
4625       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4626       __Pyx_INCREF(__pyx_t_3);
4627       __Pyx_INCREF(function);
4628       __Pyx_DECREF_SET(__pyx_t_2, function);
4629       __pyx_t_4 = 1;
4630     }
4631   }
4632   #if CYTHON_FAST_PYCALL
4633   if (PyFunction_Check(__pyx_t_2)) {
4634     PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_file, __pyx_int_2273964779, __pyx_n_s_bigbed};
4635     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
4636     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4637     __Pyx_GOTREF(__pyx_t_1);
4638   } else
4639   #endif
4640   #if CYTHON_FAST_PYCCALL
4641   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
4642     PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_file, __pyx_int_2273964779, __pyx_n_s_bigbed};
4643     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
4644     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4645     __Pyx_GOTREF(__pyx_t_1);
4646   } else
4647   #endif
4648   {
4649     __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 90, __pyx_L1_error)
4650     __Pyx_GOTREF(__pyx_t_5);
4651     if (__pyx_t_3) {
4652       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
4653     }
4654     __Pyx_INCREF(((PyObject *)__pyx_v_self));
4655     __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
4656     PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
4657     __Pyx_INCREF(__pyx_v_file);
4658     __Pyx_GIVEREF(__pyx_v_file);
4659     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_file);
4660     __Pyx_INCREF(__pyx_int_2273964779);
4661     __Pyx_GIVEREF(__pyx_int_2273964779);
4662     PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_int_2273964779);
4663     __Pyx_INCREF(__pyx_n_s_bigbed);
4664     __Pyx_GIVEREF(__pyx_n_s_bigbed);
4665     PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_n_s_bigbed);
4666     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
4667     __Pyx_GOTREF(__pyx_t_1);
4668     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4669   }
4670   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4671   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4672 
4673   /* "bx/bbi/bigbed_file.pyx":89
4674  *     A "big binary indexed" file whose raw data is in BED format.
4675  *     """
4676  *     def __init__( self, file=None ):             # <<<<<<<<<<<<<<
4677  *         BBIFile.__init__( self, file, big_bed_sig, "bigbed" )
4678  *
4679  */
4680 
4681   /* function exit code */
4682   __pyx_r = 0;
4683   goto __pyx_L0;
4684   __pyx_L1_error:;
4685   __Pyx_XDECREF(__pyx_t_1);
4686   __Pyx_XDECREF(__pyx_t_2);
4687   __Pyx_XDECREF(__pyx_t_3);
4688   __Pyx_XDECREF(__pyx_t_5);
4689   __Pyx_AddTraceback("bx.bbi.bigbed_file.BigBedFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4690   __pyx_r = -1;
4691   __pyx_L0:;
4692   __Pyx_RefNannyFinishContext();
4693   return __pyx_r;
4694 }
4695 
4696 /* "bx/bbi/bigbed_file.pyx":92
4697  *         BBIFile.__init__( self, file, big_bed_sig, "bigbed" )
4698  *
4699  *     cdef _summarize_from_full( self, bits32 chrom_id, bits32 start, bits32 end, int summary_size ):             # <<<<<<<<<<<<<<
4700  *         """
4701  *         Create summary from full data.
4702  */
4703 
__pyx_f_2bx_3bbi_11bigbed_file_10BigBedFile__summarize_from_full(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile * __pyx_v_self,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end,int __pyx_v_summary_size)4704 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file_10BigBedFile__summarize_from_full(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, int __pyx_v_summary_size) {
4705   struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *__pyx_v_v = NULL;
4706   long __pyx_v_i;
4707   PyObject *__pyx_r = NULL;
4708   __Pyx_RefNannyDeclarations
4709   PyObject *__pyx_t_1 = NULL;
4710   PyObject *__pyx_t_2 = NULL;
4711   PyObject *__pyx_t_3 = NULL;
4712   PyObject *__pyx_t_4 = NULL;
4713   PyObject *__pyx_t_5 = NULL;
4714   int __pyx_t_6;
4715   int __pyx_lineno = 0;
4716   const char *__pyx_filename = NULL;
4717   int __pyx_clineno = 0;
4718   __Pyx_RefNannySetupContext("_summarize_from_full", 0);
4719 
4720   /* "bx/bbi/bigbed_file.pyx":96
4721  *         Create summary from full data.
4722  *         """
4723  *         v = SummarizingBlockHandler( chrom_id, start, end, summary_size )             # <<<<<<<<<<<<<<
4724  *         self.visit_blocks_in_region( chrom_id, start, end, v )
4725  *         # Round valid count, in place
4726  */
4727   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_chrom_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
4728   __Pyx_GOTREF(__pyx_t_1);
4729   __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
4730   __Pyx_GOTREF(__pyx_t_2);
4731   __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4732   __Pyx_GOTREF(__pyx_t_3);
4733   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_summary_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
4734   __Pyx_GOTREF(__pyx_t_4);
4735   __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
4736   __Pyx_GOTREF(__pyx_t_5);
4737   __Pyx_GIVEREF(__pyx_t_1);
4738   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
4739   __Pyx_GIVEREF(__pyx_t_2);
4740   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
4741   __Pyx_GIVEREF(__pyx_t_3);
4742   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
4743   __Pyx_GIVEREF(__pyx_t_4);
4744   PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
4745   __pyx_t_1 = 0;
4746   __pyx_t_2 = 0;
4747   __pyx_t_3 = 0;
4748   __pyx_t_4 = 0;
4749   __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2bx_3bbi_11bigbed_file_SummarizingBlockHandler), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
4750   __Pyx_GOTREF(__pyx_t_4);
4751   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4752   __pyx_v_v = ((struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *)__pyx_t_4);
4753   __pyx_t_4 = 0;
4754 
4755   /* "bx/bbi/bigbed_file.pyx":97
4756  *         """
4757  *         v = SummarizingBlockHandler( chrom_id, start, end, summary_size )
4758  *         self.visit_blocks_in_region( chrom_id, start, end, v )             # <<<<<<<<<<<<<<
4759  *         # Round valid count, in place
4760  *         for i from 0 <= i < summary_size:
4761  */
4762   __pyx_t_4 = ((struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_BigBedFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.visit_blocks_in_region(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self), __pyx_v_chrom_id, __pyx_v_start, __pyx_v_end, ((struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *)__pyx_v_v)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
4763   __Pyx_GOTREF(__pyx_t_4);
4764   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4765 
4766   /* "bx/bbi/bigbed_file.pyx":99
4767  *         self.visit_blocks_in_region( chrom_id, start, end, v )
4768  *         # Round valid count, in place
4769  *         for i from 0 <= i < summary_size:             # <<<<<<<<<<<<<<
4770  *             v.sd.valid_count[i] = round( v.sd.valid_count[i] )
4771  *         return v.sd
4772  */
4773   __pyx_t_6 = __pyx_v_summary_size;
4774   for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {
4775 
4776     /* "bx/bbi/bigbed_file.pyx":100
4777  *         # Round valid count, in place
4778  *         for i from 0 <= i < summary_size:
4779  *             v.sd.valid_count[i] = round( v.sd.valid_count[i] )             # <<<<<<<<<<<<<<
4780  *         return v.sd
4781  *
4782  */
4783     __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_v->sd->valid_count), __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L1_error)
4784     __Pyx_GOTREF(__pyx_t_4);
4785     __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_round, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L1_error)
4786     __Pyx_GOTREF(__pyx_t_5);
4787     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4788     if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_v->sd->valid_count), __pyx_v_i, __pyx_t_5, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 100, __pyx_L1_error)
4789     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4790   }
4791 
4792   /* "bx/bbi/bigbed_file.pyx":101
4793  *         for i from 0 <= i < summary_size:
4794  *             v.sd.valid_count[i] = round( v.sd.valid_count[i] )
4795  *         return v.sd             # <<<<<<<<<<<<<<
4796  *
4797  *     cpdef get( self, char * chrom, bits32 start, bits32 end ):
4798  */
4799   __Pyx_XDECREF(__pyx_r);
4800   __Pyx_INCREF(((PyObject *)__pyx_v_v->sd));
4801   __pyx_r = ((PyObject *)__pyx_v_v->sd);
4802   goto __pyx_L0;
4803 
4804   /* "bx/bbi/bigbed_file.pyx":92
4805  *         BBIFile.__init__( self, file, big_bed_sig, "bigbed" )
4806  *
4807  *     cdef _summarize_from_full( self, bits32 chrom_id, bits32 start, bits32 end, int summary_size ):             # <<<<<<<<<<<<<<
4808  *         """
4809  *         Create summary from full data.
4810  */
4811 
4812   /* function exit code */
4813   __pyx_L1_error:;
4814   __Pyx_XDECREF(__pyx_t_1);
4815   __Pyx_XDECREF(__pyx_t_2);
4816   __Pyx_XDECREF(__pyx_t_3);
4817   __Pyx_XDECREF(__pyx_t_4);
4818   __Pyx_XDECREF(__pyx_t_5);
4819   __Pyx_AddTraceback("bx.bbi.bigbed_file.BigBedFile._summarize_from_full", __pyx_clineno, __pyx_lineno, __pyx_filename);
4820   __pyx_r = 0;
4821   __pyx_L0:;
4822   __Pyx_XDECREF((PyObject *)__pyx_v_v);
4823   __Pyx_XGIVEREF(__pyx_r);
4824   __Pyx_RefNannyFinishContext();
4825   return __pyx_r;
4826 }
4827 
4828 /* "bx/bbi/bigbed_file.pyx":103
4829  *         return v.sd
4830  *
4831  *     cpdef get( self, char * chrom, bits32 start, bits32 end ):             # <<<<<<<<<<<<<<
4832  *         """
4833  *         Gets all data points over the regions `chrom`:`start`-`end`.
4834  */
4835 
4836 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_3get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_2bx_3bbi_11bigbed_file_10BigBedFile_get(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile * __pyx_v_self,char * __pyx_v_chrom,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end,int __pyx_skip_dispatch)4837 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file_10BigBedFile_get(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *__pyx_v_self, char *__pyx_v_chrom, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, int __pyx_skip_dispatch) {
4838   PyObject *__pyx_v_chrom_id = NULL;
4839   CYTHON_UNUSED PyObject *__pyx_v_chrom_size = NULL;
4840   struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *__pyx_v_v = NULL;
4841   PyObject *__pyx_v_rval = NULL;
4842   PyObject *__pyx_v_s = NULL;
4843   PyObject *__pyx_v_e = NULL;
4844   PyObject *__pyx_v_rest = NULL;
4845   PyObject *__pyx_v_fields = NULL;
4846   PyObject *__pyx_r = NULL;
4847   __Pyx_RefNannyDeclarations
4848   PyObject *__pyx_t_1 = NULL;
4849   PyObject *__pyx_t_2 = NULL;
4850   PyObject *__pyx_t_3 = NULL;
4851   PyObject *__pyx_t_4 = NULL;
4852   PyObject *__pyx_t_5 = NULL;
4853   PyObject *__pyx_t_6 = NULL;
4854   PyObject *__pyx_t_7 = NULL;
4855   int __pyx_t_8;
4856   PyObject *__pyx_t_9 = NULL;
4857   int __pyx_t_10;
4858   PyObject *(*__pyx_t_11)(PyObject *);
4859   int __pyx_t_12;
4860   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_13;
4861   Py_ssize_t __pyx_t_14;
4862   int __pyx_t_15;
4863   int __pyx_lineno = 0;
4864   const char *__pyx_filename = NULL;
4865   int __pyx_clineno = 0;
4866   __Pyx_RefNannySetupContext("get", 0);
4867   /* Check if called by wrapper */
4868   if (unlikely(__pyx_skip_dispatch)) ;
4869   /* Check if overridden in Python */
4870   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
4871     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4872     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4873     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
4874       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4875       #endif
4876       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
4877       __Pyx_GOTREF(__pyx_t_1);
4878       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_3get)) {
4879         __Pyx_XDECREF(__pyx_r);
4880         __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_chrom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error)
4881         __Pyx_GOTREF(__pyx_t_3);
4882         __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error)
4883         __Pyx_GOTREF(__pyx_t_4);
4884         __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 103, __pyx_L1_error)
4885         __Pyx_GOTREF(__pyx_t_5);
4886         __Pyx_INCREF(__pyx_t_1);
4887         __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
4888         __pyx_t_8 = 0;
4889         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
4890           __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
4891           if (likely(__pyx_t_7)) {
4892             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
4893             __Pyx_INCREF(__pyx_t_7);
4894             __Pyx_INCREF(function);
4895             __Pyx_DECREF_SET(__pyx_t_6, function);
4896             __pyx_t_8 = 1;
4897           }
4898         }
4899         #if CYTHON_FAST_PYCALL
4900         if (PyFunction_Check(__pyx_t_6)) {
4901           PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
4902           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
4903           __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4904           __Pyx_GOTREF(__pyx_t_2);
4905           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4906           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4907           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4908         } else
4909         #endif
4910         #if CYTHON_FAST_PYCCALL
4911         if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
4912           PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
4913           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
4914           __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4915           __Pyx_GOTREF(__pyx_t_2);
4916           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4917           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4918           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4919         } else
4920         #endif
4921         {
4922           __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 103, __pyx_L1_error)
4923           __Pyx_GOTREF(__pyx_t_9);
4924           if (__pyx_t_7) {
4925             __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
4926           }
4927           __Pyx_GIVEREF(__pyx_t_3);
4928           PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
4929           __Pyx_GIVEREF(__pyx_t_4);
4930           PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
4931           __Pyx_GIVEREF(__pyx_t_5);
4932           PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
4933           __pyx_t_3 = 0;
4934           __pyx_t_4 = 0;
4935           __pyx_t_5 = 0;
4936           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
4937           __Pyx_GOTREF(__pyx_t_2);
4938           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4939         }
4940         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4941         __pyx_r = __pyx_t_2;
4942         __pyx_t_2 = 0;
4943         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4944         goto __pyx_L0;
4945       }
4946       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4947       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4948       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
4949       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
4950         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4951       }
4952       #endif
4953       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4954       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4955     }
4956     #endif
4957   }
4958 
4959   /* "bx/bbi/bigbed_file.pyx":107
4960  *         Gets all data points over the regions `chrom`:`start`-`end`.
4961  *         """
4962  *         if start >= end:             # <<<<<<<<<<<<<<
4963  *             return None
4964  *         chrom_id, chrom_size = self._get_chrom_id_and_size( chrom )
4965  */
4966   __pyx_t_10 = ((__pyx_v_start >= __pyx_v_end) != 0);
4967   if (__pyx_t_10) {
4968 
4969     /* "bx/bbi/bigbed_file.pyx":108
4970  *         """
4971  *         if start >= end:
4972  *             return None             # <<<<<<<<<<<<<<
4973  *         chrom_id, chrom_size = self._get_chrom_id_and_size( chrom )
4974  *         if chrom_id is None:
4975  */
4976     __Pyx_XDECREF(__pyx_r);
4977     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4978     goto __pyx_L0;
4979 
4980     /* "bx/bbi/bigbed_file.pyx":107
4981  *         Gets all data points over the regions `chrom`:`start`-`end`.
4982  *         """
4983  *         if start >= end:             # <<<<<<<<<<<<<<
4984  *             return None
4985  *         chrom_id, chrom_size = self._get_chrom_id_and_size( chrom )
4986  */
4987   }
4988 
4989   /* "bx/bbi/bigbed_file.pyx":109
4990  *         if start >= end:
4991  *             return None
4992  *         chrom_id, chrom_size = self._get_chrom_id_and_size( chrom )             # <<<<<<<<<<<<<<
4993  *         if chrom_id is None:
4994  *             return None
4995  */
4996   __pyx_t_1 = ((struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_BigBedFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_chrom_id_and_size(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self), __pyx_v_chrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
4997   __Pyx_GOTREF(__pyx_t_1);
4998   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
4999     PyObject* sequence = __pyx_t_1;
5000     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
5001     if (unlikely(size != 2)) {
5002       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
5003       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
5004       __PYX_ERR(0, 109, __pyx_L1_error)
5005     }
5006     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5007     if (likely(PyTuple_CheckExact(sequence))) {
5008       __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
5009       __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
5010     } else {
5011       __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
5012       __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
5013     }
5014     __Pyx_INCREF(__pyx_t_2);
5015     __Pyx_INCREF(__pyx_t_6);
5016     #else
5017     __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
5018     __Pyx_GOTREF(__pyx_t_2);
5019     __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 109, __pyx_L1_error)
5020     __Pyx_GOTREF(__pyx_t_6);
5021     #endif
5022     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5023   } else {
5024     Py_ssize_t index = -1;
5025     __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 109, __pyx_L1_error)
5026     __Pyx_GOTREF(__pyx_t_9);
5027     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5028     __pyx_t_11 = Py_TYPE(__pyx_t_9)->tp_iternext;
5029     index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
5030     __Pyx_GOTREF(__pyx_t_2);
5031     index = 1; __pyx_t_6 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
5032     __Pyx_GOTREF(__pyx_t_6);
5033     if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
5034     __pyx_t_11 = NULL;
5035     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5036     goto __pyx_L5_unpacking_done;
5037     __pyx_L4_unpacking_failed:;
5038     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5039     __pyx_t_11 = NULL;
5040     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
5041     __PYX_ERR(0, 109, __pyx_L1_error)
5042     __pyx_L5_unpacking_done:;
5043   }
5044   __pyx_v_chrom_id = __pyx_t_2;
5045   __pyx_t_2 = 0;
5046   __pyx_v_chrom_size = __pyx_t_6;
5047   __pyx_t_6 = 0;
5048 
5049   /* "bx/bbi/bigbed_file.pyx":110
5050  *             return None
5051  *         chrom_id, chrom_size = self._get_chrom_id_and_size( chrom )
5052  *         if chrom_id is None:             # <<<<<<<<<<<<<<
5053  *             return None
5054  *         v = IntervalAccumulatingBlockHandler( chrom_id, start, end )
5055  */
5056   __pyx_t_10 = (__pyx_v_chrom_id == Py_None);
5057   __pyx_t_12 = (__pyx_t_10 != 0);
5058   if (__pyx_t_12) {
5059 
5060     /* "bx/bbi/bigbed_file.pyx":111
5061  *         chrom_id, chrom_size = self._get_chrom_id_and_size( chrom )
5062  *         if chrom_id is None:
5063  *             return None             # <<<<<<<<<<<<<<
5064  *         v = IntervalAccumulatingBlockHandler( chrom_id, start, end )
5065  *         self.visit_blocks_in_region( chrom_id, start, end, v )
5066  */
5067     __Pyx_XDECREF(__pyx_r);
5068     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5069     goto __pyx_L0;
5070 
5071     /* "bx/bbi/bigbed_file.pyx":110
5072  *             return None
5073  *         chrom_id, chrom_size = self._get_chrom_id_and_size( chrom )
5074  *         if chrom_id is None:             # <<<<<<<<<<<<<<
5075  *             return None
5076  *         v = IntervalAccumulatingBlockHandler( chrom_id, start, end )
5077  */
5078   }
5079 
5080   /* "bx/bbi/bigbed_file.pyx":112
5081  *         if chrom_id is None:
5082  *             return None
5083  *         v = IntervalAccumulatingBlockHandler( chrom_id, start, end )             # <<<<<<<<<<<<<<
5084  *         self.visit_blocks_in_region( chrom_id, start, end, v )
5085  *         rval = []
5086  */
5087   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
5088   __Pyx_GOTREF(__pyx_t_1);
5089   __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 112, __pyx_L1_error)
5090   __Pyx_GOTREF(__pyx_t_6);
5091   __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
5092   __Pyx_GOTREF(__pyx_t_2);
5093   __Pyx_INCREF(__pyx_v_chrom_id);
5094   __Pyx_GIVEREF(__pyx_v_chrom_id);
5095   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom_id);
5096   __Pyx_GIVEREF(__pyx_t_1);
5097   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
5098   __Pyx_GIVEREF(__pyx_t_6);
5099   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_6);
5100   __pyx_t_1 = 0;
5101   __pyx_t_6 = 0;
5102   __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler), __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 112, __pyx_L1_error)
5103   __Pyx_GOTREF(__pyx_t_6);
5104   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5105   __pyx_v_v = ((struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *)__pyx_t_6);
5106   __pyx_t_6 = 0;
5107 
5108   /* "bx/bbi/bigbed_file.pyx":113
5109  *             return None
5110  *         v = IntervalAccumulatingBlockHandler( chrom_id, start, end )
5111  *         self.visit_blocks_in_region( chrom_id, start, end, v )             # <<<<<<<<<<<<<<
5112  *         rval = []
5113  *         # FIXME: Not sure the best way to return, will user GenomicInterval for
5114  */
5115   __pyx_t_13 = __Pyx_PyInt_As_unsigned_int(__pyx_v_chrom_id); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error)
5116   __pyx_t_6 = ((struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_BigBedFile *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.visit_blocks_in_region(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self), __pyx_t_13, __pyx_v_start, __pyx_v_end, ((struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *)__pyx_v_v)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error)
5117   __Pyx_GOTREF(__pyx_t_6);
5118   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5119 
5120   /* "bx/bbi/bigbed_file.pyx":114
5121  *         v = IntervalAccumulatingBlockHandler( chrom_id, start, end )
5122  *         self.visit_blocks_in_region( chrom_id, start, end, v )
5123  *         rval = []             # <<<<<<<<<<<<<<
5124  *         # FIXME: Not sure the best way to return, will user GenomicInterval for
5125  *         # now.
5126  */
5127   __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error)
5128   __Pyx_GOTREF(__pyx_t_6);
5129   __pyx_v_rval = ((PyObject*)__pyx_t_6);
5130   __pyx_t_6 = 0;
5131 
5132   /* "bx/bbi/bigbed_file.pyx":117
5133  *         # FIXME: Not sure the best way to return, will user GenomicInterval for
5134  *         # now.
5135  *         for ( s, e, rest ) in v.intervals:             # <<<<<<<<<<<<<<
5136  *             fields = [ chrom, str( s ), str( e ) ] + rest.split( "\t" )
5137  *             rval.append( GenomicInterval( None, fields, 0, 1, 2, 5, "+" ) )
5138  */
5139   if (unlikely(__pyx_v_v->intervals == Py_None)) {
5140     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
5141     __PYX_ERR(0, 117, __pyx_L1_error)
5142   }
5143   __pyx_t_6 = __pyx_v_v->intervals; __Pyx_INCREF(__pyx_t_6); __pyx_t_14 = 0;
5144   for (;;) {
5145     if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_6)) break;
5146     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5147     __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_14); __Pyx_INCREF(__pyx_t_2); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 117, __pyx_L1_error)
5148     #else
5149     __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
5150     __Pyx_GOTREF(__pyx_t_2);
5151     #endif
5152     if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
5153       PyObject* sequence = __pyx_t_2;
5154       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
5155       if (unlikely(size != 3)) {
5156         if (size > 3) __Pyx_RaiseTooManyValuesError(3);
5157         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
5158         __PYX_ERR(0, 117, __pyx_L1_error)
5159       }
5160       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5161       if (likely(PyTuple_CheckExact(sequence))) {
5162         __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
5163         __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
5164         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
5165       } else {
5166         __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
5167         __pyx_t_9 = PyList_GET_ITEM(sequence, 1);
5168         __pyx_t_5 = PyList_GET_ITEM(sequence, 2);
5169       }
5170       __Pyx_INCREF(__pyx_t_1);
5171       __Pyx_INCREF(__pyx_t_9);
5172       __Pyx_INCREF(__pyx_t_5);
5173       #else
5174       __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
5175       __Pyx_GOTREF(__pyx_t_1);
5176       __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 117, __pyx_L1_error)
5177       __Pyx_GOTREF(__pyx_t_9);
5178       __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 117, __pyx_L1_error)
5179       __Pyx_GOTREF(__pyx_t_5);
5180       #endif
5181       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5182     } else {
5183       Py_ssize_t index = -1;
5184       __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error)
5185       __Pyx_GOTREF(__pyx_t_4);
5186       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5187       __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext;
5188       index = 0; __pyx_t_1 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed;
5189       __Pyx_GOTREF(__pyx_t_1);
5190       index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_9)) goto __pyx_L9_unpacking_failed;
5191       __Pyx_GOTREF(__pyx_t_9);
5192       index = 2; __pyx_t_5 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L9_unpacking_failed;
5193       __Pyx_GOTREF(__pyx_t_5);
5194       if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_4), 3) < 0) __PYX_ERR(0, 117, __pyx_L1_error)
5195       __pyx_t_11 = NULL;
5196       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5197       goto __pyx_L10_unpacking_done;
5198       __pyx_L9_unpacking_failed:;
5199       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5200       __pyx_t_11 = NULL;
5201       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
5202       __PYX_ERR(0, 117, __pyx_L1_error)
5203       __pyx_L10_unpacking_done:;
5204     }
5205     __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1);
5206     __pyx_t_1 = 0;
5207     __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_9);
5208     __pyx_t_9 = 0;
5209     __Pyx_XDECREF_SET(__pyx_v_rest, __pyx_t_5);
5210     __pyx_t_5 = 0;
5211 
5212     /* "bx/bbi/bigbed_file.pyx":118
5213  *         # now.
5214  *         for ( s, e, rest ) in v.intervals:
5215  *             fields = [ chrom, str( s ), str( e ) ] + rest.split( "\t" )             # <<<<<<<<<<<<<<
5216  *             rval.append( GenomicInterval( None, fields, 0, 1, 2, 5, "+" ) )
5217  *         return rval
5218  */
5219     __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_chrom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
5220     __Pyx_GOTREF(__pyx_t_2);
5221     __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error)
5222     __Pyx_GOTREF(__pyx_t_5);
5223     __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_e); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 118, __pyx_L1_error)
5224     __Pyx_GOTREF(__pyx_t_9);
5225     __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
5226     __Pyx_GOTREF(__pyx_t_1);
5227     __Pyx_GIVEREF(__pyx_t_2);
5228     PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
5229     __Pyx_GIVEREF(__pyx_t_5);
5230     PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
5231     __Pyx_GIVEREF(__pyx_t_9);
5232     PyList_SET_ITEM(__pyx_t_1, 2, __pyx_t_9);
5233     __pyx_t_2 = 0;
5234     __pyx_t_5 = 0;
5235     __pyx_t_9 = 0;
5236     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rest, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error)
5237     __Pyx_GOTREF(__pyx_t_5);
5238     __pyx_t_2 = NULL;
5239     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
5240       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
5241       if (likely(__pyx_t_2)) {
5242         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5243         __Pyx_INCREF(__pyx_t_2);
5244         __Pyx_INCREF(function);
5245         __Pyx_DECREF_SET(__pyx_t_5, function);
5246       }
5247     }
5248     __pyx_t_9 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_kp_s_) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_);
5249     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5250     if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 118, __pyx_L1_error)
5251     __Pyx_GOTREF(__pyx_t_9);
5252     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5253     __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error)
5254     __Pyx_GOTREF(__pyx_t_5);
5255     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5256     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5257     __Pyx_XDECREF_SET(__pyx_v_fields, __pyx_t_5);
5258     __pyx_t_5 = 0;
5259 
5260     /* "bx/bbi/bigbed_file.pyx":119
5261  *         for ( s, e, rest ) in v.intervals:
5262  *             fields = [ chrom, str( s ), str( e ) ] + rest.split( "\t" )
5263  *             rval.append( GenomicInterval( None, fields, 0, 1, 2, 5, "+" ) )             # <<<<<<<<<<<<<<
5264  *         return rval
5265  *
5266  */
5267     __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_GenomicInterval); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 119, __pyx_L1_error)
5268     __Pyx_GOTREF(__pyx_t_9);
5269     __pyx_t_1 = NULL;
5270     __pyx_t_8 = 0;
5271     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
5272       __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
5273       if (likely(__pyx_t_1)) {
5274         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
5275         __Pyx_INCREF(__pyx_t_1);
5276         __Pyx_INCREF(function);
5277         __Pyx_DECREF_SET(__pyx_t_9, function);
5278         __pyx_t_8 = 1;
5279       }
5280     }
5281     #if CYTHON_FAST_PYCALL
5282     if (PyFunction_Check(__pyx_t_9)) {
5283       PyObject *__pyx_temp[8] = {__pyx_t_1, Py_None, __pyx_v_fields, __pyx_int_0, __pyx_int_1, __pyx_int_2, __pyx_int_5, __pyx_kp_s__2};
5284       __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 7+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error)
5285       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5286       __Pyx_GOTREF(__pyx_t_5);
5287     } else
5288     #endif
5289     #if CYTHON_FAST_PYCCALL
5290     if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
5291       PyObject *__pyx_temp[8] = {__pyx_t_1, Py_None, __pyx_v_fields, __pyx_int_0, __pyx_int_1, __pyx_int_2, __pyx_int_5, __pyx_kp_s__2};
5292       __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 7+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error)
5293       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5294       __Pyx_GOTREF(__pyx_t_5);
5295     } else
5296     #endif
5297     {
5298       __pyx_t_2 = PyTuple_New(7+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
5299       __Pyx_GOTREF(__pyx_t_2);
5300       if (__pyx_t_1) {
5301         __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
5302       }
5303       __Pyx_INCREF(Py_None);
5304       __Pyx_GIVEREF(Py_None);
5305       PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_8, Py_None);
5306       __Pyx_INCREF(__pyx_v_fields);
5307       __Pyx_GIVEREF(__pyx_v_fields);
5308       PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_8, __pyx_v_fields);
5309       __Pyx_INCREF(__pyx_int_0);
5310       __Pyx_GIVEREF(__pyx_int_0);
5311       PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_8, __pyx_int_0);
5312       __Pyx_INCREF(__pyx_int_1);
5313       __Pyx_GIVEREF(__pyx_int_1);
5314       PyTuple_SET_ITEM(__pyx_t_2, 3+__pyx_t_8, __pyx_int_1);
5315       __Pyx_INCREF(__pyx_int_2);
5316       __Pyx_GIVEREF(__pyx_int_2);
5317       PyTuple_SET_ITEM(__pyx_t_2, 4+__pyx_t_8, __pyx_int_2);
5318       __Pyx_INCREF(__pyx_int_5);
5319       __Pyx_GIVEREF(__pyx_int_5);
5320       PyTuple_SET_ITEM(__pyx_t_2, 5+__pyx_t_8, __pyx_int_5);
5321       __Pyx_INCREF(__pyx_kp_s__2);
5322       __Pyx_GIVEREF(__pyx_kp_s__2);
5323       PyTuple_SET_ITEM(__pyx_t_2, 6+__pyx_t_8, __pyx_kp_s__2);
5324       __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error)
5325       __Pyx_GOTREF(__pyx_t_5);
5326       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5327     }
5328     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5329     __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_rval, __pyx_t_5); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 119, __pyx_L1_error)
5330     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5331 
5332     /* "bx/bbi/bigbed_file.pyx":117
5333  *         # FIXME: Not sure the best way to return, will user GenomicInterval for
5334  *         # now.
5335  *         for ( s, e, rest ) in v.intervals:             # <<<<<<<<<<<<<<
5336  *             fields = [ chrom, str( s ), str( e ) ] + rest.split( "\t" )
5337  *             rval.append( GenomicInterval( None, fields, 0, 1, 2, 5, "+" ) )
5338  */
5339   }
5340   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5341 
5342   /* "bx/bbi/bigbed_file.pyx":120
5343  *             fields = [ chrom, str( s ), str( e ) ] + rest.split( "\t" )
5344  *             rval.append( GenomicInterval( None, fields, 0, 1, 2, 5, "+" ) )
5345  *         return rval             # <<<<<<<<<<<<<<
5346  *
5347  *
5348  */
5349   __Pyx_XDECREF(__pyx_r);
5350   __Pyx_INCREF(__pyx_v_rval);
5351   __pyx_r = __pyx_v_rval;
5352   goto __pyx_L0;
5353 
5354   /* "bx/bbi/bigbed_file.pyx":103
5355  *         return v.sd
5356  *
5357  *     cpdef get( self, char * chrom, bits32 start, bits32 end ):             # <<<<<<<<<<<<<<
5358  *         """
5359  *         Gets all data points over the regions `chrom`:`start`-`end`.
5360  */
5361 
5362   /* function exit code */
5363   __pyx_L1_error:;
5364   __Pyx_XDECREF(__pyx_t_1);
5365   __Pyx_XDECREF(__pyx_t_2);
5366   __Pyx_XDECREF(__pyx_t_3);
5367   __Pyx_XDECREF(__pyx_t_4);
5368   __Pyx_XDECREF(__pyx_t_5);
5369   __Pyx_XDECREF(__pyx_t_6);
5370   __Pyx_XDECREF(__pyx_t_7);
5371   __Pyx_XDECREF(__pyx_t_9);
5372   __Pyx_AddTraceback("bx.bbi.bigbed_file.BigBedFile.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
5373   __pyx_r = 0;
5374   __pyx_L0:;
5375   __Pyx_XDECREF(__pyx_v_chrom_id);
5376   __Pyx_XDECREF(__pyx_v_chrom_size);
5377   __Pyx_XDECREF((PyObject *)__pyx_v_v);
5378   __Pyx_XDECREF(__pyx_v_rval);
5379   __Pyx_XDECREF(__pyx_v_s);
5380   __Pyx_XDECREF(__pyx_v_e);
5381   __Pyx_XDECREF(__pyx_v_rest);
5382   __Pyx_XDECREF(__pyx_v_fields);
5383   __Pyx_XGIVEREF(__pyx_r);
5384   __Pyx_RefNannyFinishContext();
5385   return __pyx_r;
5386 }
5387 
5388 /* Python wrapper */
5389 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_3get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5390 static char __pyx_doc_2bx_3bbi_11bigbed_file_10BigBedFile_2get[] = "\n        Gets all data points over the regions `chrom`:`start`-`end`.\n        ";
__pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_3get(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5391 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_3get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5392   char *__pyx_v_chrom;
5393   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start;
5394   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end;
5395   int __pyx_lineno = 0;
5396   const char *__pyx_filename = NULL;
5397   int __pyx_clineno = 0;
5398   PyObject *__pyx_r = 0;
5399   __Pyx_RefNannyDeclarations
5400   __Pyx_RefNannySetupContext("get (wrapper)", 0);
5401   {
5402     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom,&__pyx_n_s_start,&__pyx_n_s_end,0};
5403     PyObject* values[3] = {0,0,0};
5404     if (unlikely(__pyx_kwds)) {
5405       Py_ssize_t kw_args;
5406       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5407       switch (pos_args) {
5408         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5409         CYTHON_FALLTHROUGH;
5410         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5411         CYTHON_FALLTHROUGH;
5412         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5413         CYTHON_FALLTHROUGH;
5414         case  0: break;
5415         default: goto __pyx_L5_argtuple_error;
5416       }
5417       kw_args = PyDict_Size(__pyx_kwds);
5418       switch (pos_args) {
5419         case  0:
5420         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
5421         else goto __pyx_L5_argtuple_error;
5422         CYTHON_FALLTHROUGH;
5423         case  1:
5424         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
5425         else {
5426           __Pyx_RaiseArgtupleInvalid("get", 1, 3, 3, 1); __PYX_ERR(0, 103, __pyx_L3_error)
5427         }
5428         CYTHON_FALLTHROUGH;
5429         case  2:
5430         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
5431         else {
5432           __Pyx_RaiseArgtupleInvalid("get", 1, 3, 3, 2); __PYX_ERR(0, 103, __pyx_L3_error)
5433         }
5434       }
5435       if (unlikely(kw_args > 0)) {
5436         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 103, __pyx_L3_error)
5437       }
5438     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5439       goto __pyx_L5_argtuple_error;
5440     } else {
5441       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5442       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5443       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5444     }
5445     __pyx_v_chrom = __Pyx_PyObject_AsWritableString(values[0]); if (unlikely((!__pyx_v_chrom) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error)
5446     __pyx_v_start = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_start == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error)
5447     __pyx_v_end = __Pyx_PyInt_As_unsigned_int(values[2]); if (unlikely((__pyx_v_end == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error)
5448   }
5449   goto __pyx_L4_argument_unpacking_done;
5450   __pyx_L5_argtuple_error:;
5451   __Pyx_RaiseArgtupleInvalid("get", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 103, __pyx_L3_error)
5452   __pyx_L3_error:;
5453   __Pyx_AddTraceback("bx.bbi.bigbed_file.BigBedFile.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
5454   __Pyx_RefNannyFinishContext();
5455   return NULL;
5456   __pyx_L4_argument_unpacking_done:;
5457   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file_10BigBedFile_2get(((struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *)__pyx_v_self), __pyx_v_chrom, __pyx_v_start, __pyx_v_end);
5458 
5459   /* function exit code */
5460   __Pyx_RefNannyFinishContext();
5461   return __pyx_r;
5462 }
5463 
__pyx_pf_2bx_3bbi_11bigbed_file_10BigBedFile_2get(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile * __pyx_v_self,char * __pyx_v_chrom,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end)5464 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_10BigBedFile_2get(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *__pyx_v_self, char *__pyx_v_chrom, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end) {
5465   PyObject *__pyx_r = NULL;
5466   __Pyx_RefNannyDeclarations
5467   PyObject *__pyx_t_1 = NULL;
5468   int __pyx_lineno = 0;
5469   const char *__pyx_filename = NULL;
5470   int __pyx_clineno = 0;
5471   __Pyx_RefNannySetupContext("get", 0);
5472   __Pyx_XDECREF(__pyx_r);
5473   __pyx_t_1 = __pyx_f_2bx_3bbi_11bigbed_file_10BigBedFile_get(__pyx_v_self, __pyx_v_chrom, __pyx_v_start, __pyx_v_end, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
5474   __Pyx_GOTREF(__pyx_t_1);
5475   __pyx_r = __pyx_t_1;
5476   __pyx_t_1 = 0;
5477   goto __pyx_L0;
5478 
5479   /* function exit code */
5480   __pyx_L1_error:;
5481   __Pyx_XDECREF(__pyx_t_1);
5482   __Pyx_AddTraceback("bx.bbi.bigbed_file.BigBedFile.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
5483   __pyx_r = NULL;
5484   __pyx_L0:;
5485   __Pyx_XGIVEREF(__pyx_r);
5486   __Pyx_RefNannyFinishContext();
5487   return __pyx_r;
5488 }
5489 
5490 /* "(tree fragment)":1
5491  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
5492  *     cdef tuple state
5493  *     cdef object _dict
5494  */
5495 
5496 /* Python wrapper */
5497 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_5__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)5498 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5499   PyObject *__pyx_r = 0;
5500   __Pyx_RefNannyDeclarations
5501   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5502   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file_10BigBedFile_4__reduce_cython__(((struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *)__pyx_v_self));
5503 
5504   /* function exit code */
5505   __Pyx_RefNannyFinishContext();
5506   return __pyx_r;
5507 }
5508 
__pyx_pf_2bx_3bbi_11bigbed_file_10BigBedFile_4__reduce_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile * __pyx_v_self)5509 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_10BigBedFile_4__reduce_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *__pyx_v_self) {
5510   PyObject *__pyx_v_state = 0;
5511   PyObject *__pyx_v__dict = 0;
5512   int __pyx_v_use_setstate;
5513   PyObject *__pyx_r = NULL;
5514   __Pyx_RefNannyDeclarations
5515   PyObject *__pyx_t_1 = NULL;
5516   PyObject *__pyx_t_2 = NULL;
5517   PyObject *__pyx_t_3 = NULL;
5518   PyObject *__pyx_t_4 = NULL;
5519   PyObject *__pyx_t_5 = NULL;
5520   PyObject *__pyx_t_6 = NULL;
5521   PyObject *__pyx_t_7 = NULL;
5522   PyObject *__pyx_t_8 = NULL;
5523   PyObject *__pyx_t_9 = NULL;
5524   PyObject *__pyx_t_10 = NULL;
5525   PyObject *__pyx_t_11 = NULL;
5526   PyObject *__pyx_t_12 = NULL;
5527   PyObject *__pyx_t_13 = NULL;
5528   int __pyx_t_14;
5529   int __pyx_t_15;
5530   int __pyx_t_16;
5531   int __pyx_lineno = 0;
5532   const char *__pyx_filename = NULL;
5533   int __pyx_clineno = 0;
5534   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5535 
5536   /* "(tree fragment)":5
5537  *     cdef object _dict
5538  *     cdef bint use_setstate
5539  *     state = (self.as_offset, self.chrom_bpt, self.chrom_tree_offset, self.defined_field_count, self.field_count, self.file, self.is_byteswapped, self.level_list, self.magic, self.reader, self.total_summary_offset, self.uncompress_buf_size, self.unzoomed_data_offset, self.unzoomed_index_offset, self.version, self.zoom_levels)             # <<<<<<<<<<<<<<
5540  *     _dict = getattr(self, '__dict__', None)
5541  *     if _dict is not None:
5542  */
5543   __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->__pyx_base.as_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
5544   __Pyx_GOTREF(__pyx_t_1);
5545   __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->__pyx_base.chrom_tree_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
5546   __Pyx_GOTREF(__pyx_t_2);
5547   __pyx_t_3 = __Pyx_PyInt_From_unsigned_short(__pyx_v_self->__pyx_base.defined_field_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
5548   __Pyx_GOTREF(__pyx_t_3);
5549   __pyx_t_4 = __Pyx_PyInt_From_unsigned_short(__pyx_v_self->__pyx_base.field_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
5550   __Pyx_GOTREF(__pyx_t_4);
5551   __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.is_byteswapped); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
5552   __Pyx_GOTREF(__pyx_t_5);
5553   __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->__pyx_base.magic); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error)
5554   __Pyx_GOTREF(__pyx_t_6);
5555   __pyx_t_7 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->__pyx_base.total_summary_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5, __pyx_L1_error)
5556   __Pyx_GOTREF(__pyx_t_7);
5557   __pyx_t_8 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->__pyx_base.uncompress_buf_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 5, __pyx_L1_error)
5558   __Pyx_GOTREF(__pyx_t_8);
5559   __pyx_t_9 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->__pyx_base.unzoomed_data_offset); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 5, __pyx_L1_error)
5560   __Pyx_GOTREF(__pyx_t_9);
5561   __pyx_t_10 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->__pyx_base.unzoomed_index_offset); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 5, __pyx_L1_error)
5562   __Pyx_GOTREF(__pyx_t_10);
5563   __pyx_t_11 = __Pyx_PyInt_From_unsigned_short(__pyx_v_self->__pyx_base.version); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 5, __pyx_L1_error)
5564   __Pyx_GOTREF(__pyx_t_11);
5565   __pyx_t_12 = __Pyx_PyInt_From_unsigned_short(__pyx_v_self->__pyx_base.zoom_levels); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 5, __pyx_L1_error)
5566   __Pyx_GOTREF(__pyx_t_12);
5567   __pyx_t_13 = PyTuple_New(16); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 5, __pyx_L1_error)
5568   __Pyx_GOTREF(__pyx_t_13);
5569   __Pyx_GIVEREF(__pyx_t_1);
5570   PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
5571   __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.chrom_bpt));
5572   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.chrom_bpt));
5573   PyTuple_SET_ITEM(__pyx_t_13, 1, ((PyObject *)__pyx_v_self->__pyx_base.chrom_bpt));
5574   __Pyx_GIVEREF(__pyx_t_2);
5575   PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_2);
5576   __Pyx_GIVEREF(__pyx_t_3);
5577   PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_3);
5578   __Pyx_GIVEREF(__pyx_t_4);
5579   PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_4);
5580   __Pyx_INCREF(__pyx_v_self->__pyx_base.file);
5581   __Pyx_GIVEREF(__pyx_v_self->__pyx_base.file);
5582   PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_v_self->__pyx_base.file);
5583   __Pyx_GIVEREF(__pyx_t_5);
5584   PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_5);
5585   __Pyx_INCREF(__pyx_v_self->__pyx_base.level_list);
5586   __Pyx_GIVEREF(__pyx_v_self->__pyx_base.level_list);
5587   PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_v_self->__pyx_base.level_list);
5588   __Pyx_GIVEREF(__pyx_t_6);
5589   PyTuple_SET_ITEM(__pyx_t_13, 8, __pyx_t_6);
5590   __Pyx_INCREF(__pyx_v_self->__pyx_base.reader);
5591   __Pyx_GIVEREF(__pyx_v_self->__pyx_base.reader);
5592   PyTuple_SET_ITEM(__pyx_t_13, 9, __pyx_v_self->__pyx_base.reader);
5593   __Pyx_GIVEREF(__pyx_t_7);
5594   PyTuple_SET_ITEM(__pyx_t_13, 10, __pyx_t_7);
5595   __Pyx_GIVEREF(__pyx_t_8);
5596   PyTuple_SET_ITEM(__pyx_t_13, 11, __pyx_t_8);
5597   __Pyx_GIVEREF(__pyx_t_9);
5598   PyTuple_SET_ITEM(__pyx_t_13, 12, __pyx_t_9);
5599   __Pyx_GIVEREF(__pyx_t_10);
5600   PyTuple_SET_ITEM(__pyx_t_13, 13, __pyx_t_10);
5601   __Pyx_GIVEREF(__pyx_t_11);
5602   PyTuple_SET_ITEM(__pyx_t_13, 14, __pyx_t_11);
5603   __Pyx_GIVEREF(__pyx_t_12);
5604   PyTuple_SET_ITEM(__pyx_t_13, 15, __pyx_t_12);
5605   __pyx_t_1 = 0;
5606   __pyx_t_2 = 0;
5607   __pyx_t_3 = 0;
5608   __pyx_t_4 = 0;
5609   __pyx_t_5 = 0;
5610   __pyx_t_6 = 0;
5611   __pyx_t_7 = 0;
5612   __pyx_t_8 = 0;
5613   __pyx_t_9 = 0;
5614   __pyx_t_10 = 0;
5615   __pyx_t_11 = 0;
5616   __pyx_t_12 = 0;
5617   __pyx_v_state = ((PyObject*)__pyx_t_13);
5618   __pyx_t_13 = 0;
5619 
5620   /* "(tree fragment)":6
5621  *     cdef bint use_setstate
5622  *     state = (self.as_offset, self.chrom_bpt, self.chrom_tree_offset, self.defined_field_count, self.field_count, self.file, self.is_byteswapped, self.level_list, self.magic, self.reader, self.total_summary_offset, self.uncompress_buf_size, self.unzoomed_data_offset, self.unzoomed_index_offset, self.version, self.zoom_levels)
5623  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
5624  *     if _dict is not None:
5625  *         state += (_dict,)
5626  */
5627   __pyx_t_13 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 6, __pyx_L1_error)
5628   __Pyx_GOTREF(__pyx_t_13);
5629   __pyx_v__dict = __pyx_t_13;
5630   __pyx_t_13 = 0;
5631 
5632   /* "(tree fragment)":7
5633  *     state = (self.as_offset, self.chrom_bpt, self.chrom_tree_offset, self.defined_field_count, self.field_count, self.file, self.is_byteswapped, self.level_list, self.magic, self.reader, self.total_summary_offset, self.uncompress_buf_size, self.unzoomed_data_offset, self.unzoomed_index_offset, self.version, self.zoom_levels)
5634  *     _dict = getattr(self, '__dict__', None)
5635  *     if _dict is not None:             # <<<<<<<<<<<<<<
5636  *         state += (_dict,)
5637  *         use_setstate = True
5638  */
5639   __pyx_t_14 = (__pyx_v__dict != Py_None);
5640   __pyx_t_15 = (__pyx_t_14 != 0);
5641   if (__pyx_t_15) {
5642 
5643     /* "(tree fragment)":8
5644  *     _dict = getattr(self, '__dict__', None)
5645  *     if _dict is not None:
5646  *         state += (_dict,)             # <<<<<<<<<<<<<<
5647  *         use_setstate = True
5648  *     else:
5649  */
5650     __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 8, __pyx_L1_error)
5651     __Pyx_GOTREF(__pyx_t_13);
5652     __Pyx_INCREF(__pyx_v__dict);
5653     __Pyx_GIVEREF(__pyx_v__dict);
5654     PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v__dict);
5655     __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 8, __pyx_L1_error)
5656     __Pyx_GOTREF(__pyx_t_12);
5657     __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5658     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_12));
5659     __pyx_t_12 = 0;
5660 
5661     /* "(tree fragment)":9
5662  *     if _dict is not None:
5663  *         state += (_dict,)
5664  *         use_setstate = True             # <<<<<<<<<<<<<<
5665  *     else:
5666  *         use_setstate = self.chrom_bpt is not None or self.file is not None or self.level_list is not None or self.reader is not None
5667  */
5668     __pyx_v_use_setstate = 1;
5669 
5670     /* "(tree fragment)":7
5671  *     state = (self.as_offset, self.chrom_bpt, self.chrom_tree_offset, self.defined_field_count, self.field_count, self.file, self.is_byteswapped, self.level_list, self.magic, self.reader, self.total_summary_offset, self.uncompress_buf_size, self.unzoomed_data_offset, self.unzoomed_index_offset, self.version, self.zoom_levels)
5672  *     _dict = getattr(self, '__dict__', None)
5673  *     if _dict is not None:             # <<<<<<<<<<<<<<
5674  *         state += (_dict,)
5675  *         use_setstate = True
5676  */
5677     goto __pyx_L3;
5678   }
5679 
5680   /* "(tree fragment)":11
5681  *         use_setstate = True
5682  *     else:
5683  *         use_setstate = self.chrom_bpt is not None or self.file is not None or self.level_list is not None or self.reader is not None             # <<<<<<<<<<<<<<
5684  *     if use_setstate:
5685  *         return __pyx_unpickle_BigBedFile, (type(self), 0x5566878, None), state
5686  */
5687   /*else*/ {
5688     __pyx_t_14 = (((PyObject *)__pyx_v_self->__pyx_base.chrom_bpt) != Py_None);
5689     __pyx_t_16 = (__pyx_t_14 != 0);
5690     if (!__pyx_t_16) {
5691     } else {
5692       __pyx_t_15 = __pyx_t_16;
5693       goto __pyx_L4_bool_binop_done;
5694     }
5695     __pyx_t_16 = (__pyx_v_self->__pyx_base.file != Py_None);
5696     __pyx_t_14 = (__pyx_t_16 != 0);
5697     if (!__pyx_t_14) {
5698     } else {
5699       __pyx_t_15 = __pyx_t_14;
5700       goto __pyx_L4_bool_binop_done;
5701     }
5702     __pyx_t_14 = (__pyx_v_self->__pyx_base.level_list != Py_None);
5703     __pyx_t_16 = (__pyx_t_14 != 0);
5704     if (!__pyx_t_16) {
5705     } else {
5706       __pyx_t_15 = __pyx_t_16;
5707       goto __pyx_L4_bool_binop_done;
5708     }
5709     __pyx_t_16 = (__pyx_v_self->__pyx_base.reader != Py_None);
5710     __pyx_t_14 = (__pyx_t_16 != 0);
5711     __pyx_t_15 = __pyx_t_14;
5712     __pyx_L4_bool_binop_done:;
5713     __pyx_v_use_setstate = __pyx_t_15;
5714   }
5715   __pyx_L3:;
5716 
5717   /* "(tree fragment)":12
5718  *     else:
5719  *         use_setstate = self.chrom_bpt is not None or self.file is not None or self.level_list is not None or self.reader is not None
5720  *     if use_setstate:             # <<<<<<<<<<<<<<
5721  *         return __pyx_unpickle_BigBedFile, (type(self), 0x5566878, None), state
5722  *     else:
5723  */
5724   __pyx_t_15 = (__pyx_v_use_setstate != 0);
5725   if (__pyx_t_15) {
5726 
5727     /* "(tree fragment)":13
5728  *         use_setstate = self.chrom_bpt is not None or self.file is not None or self.level_list is not None or self.reader is not None
5729  *     if use_setstate:
5730  *         return __pyx_unpickle_BigBedFile, (type(self), 0x5566878, None), state             # <<<<<<<<<<<<<<
5731  *     else:
5732  *         return __pyx_unpickle_BigBedFile, (type(self), 0x5566878, state)
5733  */
5734     __Pyx_XDECREF(__pyx_r);
5735     __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_pyx_unpickle_BigBedFile); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error)
5736     __Pyx_GOTREF(__pyx_t_12);
5737     __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 13, __pyx_L1_error)
5738     __Pyx_GOTREF(__pyx_t_13);
5739     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5740     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5741     PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5742     __Pyx_INCREF(__pyx_int_89548920);
5743     __Pyx_GIVEREF(__pyx_int_89548920);
5744     PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_int_89548920);
5745     __Pyx_INCREF(Py_None);
5746     __Pyx_GIVEREF(Py_None);
5747     PyTuple_SET_ITEM(__pyx_t_13, 2, Py_None);
5748     __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error)
5749     __Pyx_GOTREF(__pyx_t_11);
5750     __Pyx_GIVEREF(__pyx_t_12);
5751     PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12);
5752     __Pyx_GIVEREF(__pyx_t_13);
5753     PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13);
5754     __Pyx_INCREF(__pyx_v_state);
5755     __Pyx_GIVEREF(__pyx_v_state);
5756     PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_state);
5757     __pyx_t_12 = 0;
5758     __pyx_t_13 = 0;
5759     __pyx_r = __pyx_t_11;
5760     __pyx_t_11 = 0;
5761     goto __pyx_L0;
5762 
5763     /* "(tree fragment)":12
5764  *     else:
5765  *         use_setstate = self.chrom_bpt is not None or self.file is not None or self.level_list is not None or self.reader is not None
5766  *     if use_setstate:             # <<<<<<<<<<<<<<
5767  *         return __pyx_unpickle_BigBedFile, (type(self), 0x5566878, None), state
5768  *     else:
5769  */
5770   }
5771 
5772   /* "(tree fragment)":15
5773  *         return __pyx_unpickle_BigBedFile, (type(self), 0x5566878, None), state
5774  *     else:
5775  *         return __pyx_unpickle_BigBedFile, (type(self), 0x5566878, state)             # <<<<<<<<<<<<<<
5776  * def __setstate_cython__(self, __pyx_state):
5777  *     __pyx_unpickle_BigBedFile__set_state(self, __pyx_state)
5778  */
5779   /*else*/ {
5780     __Pyx_XDECREF(__pyx_r);
5781     __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_pyx_unpickle_BigBedFile); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 15, __pyx_L1_error)
5782     __Pyx_GOTREF(__pyx_t_11);
5783     __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 15, __pyx_L1_error)
5784     __Pyx_GOTREF(__pyx_t_13);
5785     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5786     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5787     PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5788     __Pyx_INCREF(__pyx_int_89548920);
5789     __Pyx_GIVEREF(__pyx_int_89548920);
5790     PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_int_89548920);
5791     __Pyx_INCREF(__pyx_v_state);
5792     __Pyx_GIVEREF(__pyx_v_state);
5793     PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_state);
5794     __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 15, __pyx_L1_error)
5795     __Pyx_GOTREF(__pyx_t_12);
5796     __Pyx_GIVEREF(__pyx_t_11);
5797     PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11);
5798     __Pyx_GIVEREF(__pyx_t_13);
5799     PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13);
5800     __pyx_t_11 = 0;
5801     __pyx_t_13 = 0;
5802     __pyx_r = __pyx_t_12;
5803     __pyx_t_12 = 0;
5804     goto __pyx_L0;
5805   }
5806 
5807   /* "(tree fragment)":1
5808  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
5809  *     cdef tuple state
5810  *     cdef object _dict
5811  */
5812 
5813   /* function exit code */
5814   __pyx_L1_error:;
5815   __Pyx_XDECREF(__pyx_t_1);
5816   __Pyx_XDECREF(__pyx_t_2);
5817   __Pyx_XDECREF(__pyx_t_3);
5818   __Pyx_XDECREF(__pyx_t_4);
5819   __Pyx_XDECREF(__pyx_t_5);
5820   __Pyx_XDECREF(__pyx_t_6);
5821   __Pyx_XDECREF(__pyx_t_7);
5822   __Pyx_XDECREF(__pyx_t_8);
5823   __Pyx_XDECREF(__pyx_t_9);
5824   __Pyx_XDECREF(__pyx_t_10);
5825   __Pyx_XDECREF(__pyx_t_11);
5826   __Pyx_XDECREF(__pyx_t_12);
5827   __Pyx_XDECREF(__pyx_t_13);
5828   __Pyx_AddTraceback("bx.bbi.bigbed_file.BigBedFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5829   __pyx_r = NULL;
5830   __pyx_L0:;
5831   __Pyx_XDECREF(__pyx_v_state);
5832   __Pyx_XDECREF(__pyx_v__dict);
5833   __Pyx_XGIVEREF(__pyx_r);
5834   __Pyx_RefNannyFinishContext();
5835   return __pyx_r;
5836 }
5837 
5838 /* "(tree fragment)":16
5839  *     else:
5840  *         return __pyx_unpickle_BigBedFile, (type(self), 0x5566878, state)
5841  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
5842  *     __pyx_unpickle_BigBedFile__set_state(self, __pyx_state)
5843  */
5844 
5845 /* Python wrapper */
5846 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_7__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)5847 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5848   PyObject *__pyx_r = 0;
5849   __Pyx_RefNannyDeclarations
5850   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5851   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file_10BigBedFile_6__setstate_cython__(((struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5852 
5853   /* function exit code */
5854   __Pyx_RefNannyFinishContext();
5855   return __pyx_r;
5856 }
5857 
__pyx_pf_2bx_3bbi_11bigbed_file_10BigBedFile_6__setstate_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile * __pyx_v_self,PyObject * __pyx_v___pyx_state)5858 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_10BigBedFile_6__setstate_cython__(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5859   PyObject *__pyx_r = NULL;
5860   __Pyx_RefNannyDeclarations
5861   PyObject *__pyx_t_1 = NULL;
5862   int __pyx_lineno = 0;
5863   const char *__pyx_filename = NULL;
5864   int __pyx_clineno = 0;
5865   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5866 
5867   /* "(tree fragment)":17
5868  *         return __pyx_unpickle_BigBedFile, (type(self), 0x5566878, state)
5869  * def __setstate_cython__(self, __pyx_state):
5870  *     __pyx_unpickle_BigBedFile__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
5871  */
5872   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
5873   __pyx_t_1 = __pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_BigBedFile__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
5874   __Pyx_GOTREF(__pyx_t_1);
5875   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5876 
5877   /* "(tree fragment)":16
5878  *     else:
5879  *         return __pyx_unpickle_BigBedFile, (type(self), 0x5566878, state)
5880  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
5881  *     __pyx_unpickle_BigBedFile__set_state(self, __pyx_state)
5882  */
5883 
5884   /* function exit code */
5885   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5886   goto __pyx_L0;
5887   __pyx_L1_error:;
5888   __Pyx_XDECREF(__pyx_t_1);
5889   __Pyx_AddTraceback("bx.bbi.bigbed_file.BigBedFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5890   __pyx_r = NULL;
5891   __pyx_L0:;
5892   __Pyx_XGIVEREF(__pyx_r);
5893   __Pyx_RefNannyFinishContext();
5894   return __pyx_r;
5895 }
5896 
5897 /* "(tree fragment)":1
5898  * def __pyx_unpickle_BigBedBlockHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
5899  *     cdef object __pyx_PickleError
5900  *     cdef object __pyx_result
5901  */
5902 
5903 /* Python wrapper */
5904 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_1__pyx_unpickle_BigBedBlockHandler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5905 static PyMethodDef __pyx_mdef_2bx_3bbi_11bigbed_file_1__pyx_unpickle_BigBedBlockHandler = {"__pyx_unpickle_BigBedBlockHandler", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_3bbi_11bigbed_file_1__pyx_unpickle_BigBedBlockHandler, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2bx_3bbi_11bigbed_file_1__pyx_unpickle_BigBedBlockHandler(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5906 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_1__pyx_unpickle_BigBedBlockHandler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5907   PyObject *__pyx_v___pyx_type = 0;
5908   long __pyx_v___pyx_checksum;
5909   PyObject *__pyx_v___pyx_state = 0;
5910   int __pyx_lineno = 0;
5911   const char *__pyx_filename = NULL;
5912   int __pyx_clineno = 0;
5913   PyObject *__pyx_r = 0;
5914   __Pyx_RefNannyDeclarations
5915   __Pyx_RefNannySetupContext("__pyx_unpickle_BigBedBlockHandler (wrapper)", 0);
5916   {
5917     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
5918     PyObject* values[3] = {0,0,0};
5919     if (unlikely(__pyx_kwds)) {
5920       Py_ssize_t kw_args;
5921       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5922       switch (pos_args) {
5923         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5924         CYTHON_FALLTHROUGH;
5925         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5926         CYTHON_FALLTHROUGH;
5927         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5928         CYTHON_FALLTHROUGH;
5929         case  0: break;
5930         default: goto __pyx_L5_argtuple_error;
5931       }
5932       kw_args = PyDict_Size(__pyx_kwds);
5933       switch (pos_args) {
5934         case  0:
5935         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
5936         else goto __pyx_L5_argtuple_error;
5937         CYTHON_FALLTHROUGH;
5938         case  1:
5939         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
5940         else {
5941           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BigBedBlockHandler", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
5942         }
5943         CYTHON_FALLTHROUGH;
5944         case  2:
5945         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
5946         else {
5947           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BigBedBlockHandler", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
5948         }
5949       }
5950       if (unlikely(kw_args > 0)) {
5951         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_BigBedBlockHandler") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
5952       }
5953     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5954       goto __pyx_L5_argtuple_error;
5955     } else {
5956       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5957       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5958       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5959     }
5960     __pyx_v___pyx_type = values[0];
5961     __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)
5962     __pyx_v___pyx_state = values[2];
5963   }
5964   goto __pyx_L4_argument_unpacking_done;
5965   __pyx_L5_argtuple_error:;
5966   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BigBedBlockHandler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
5967   __pyx_L3_error:;
5968   __Pyx_AddTraceback("bx.bbi.bigbed_file.__pyx_unpickle_BigBedBlockHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
5969   __Pyx_RefNannyFinishContext();
5970   return NULL;
5971   __pyx_L4_argument_unpacking_done:;
5972   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file___pyx_unpickle_BigBedBlockHandler(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
5973 
5974   /* function exit code */
5975   __Pyx_RefNannyFinishContext();
5976   return __pyx_r;
5977 }
5978 
__pyx_pf_2bx_3bbi_11bigbed_file___pyx_unpickle_BigBedBlockHandler(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)5979 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file___pyx_unpickle_BigBedBlockHandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
5980   PyObject *__pyx_v___pyx_PickleError = 0;
5981   PyObject *__pyx_v___pyx_result = 0;
5982   PyObject *__pyx_r = NULL;
5983   __Pyx_RefNannyDeclarations
5984   int __pyx_t_1;
5985   PyObject *__pyx_t_2 = NULL;
5986   PyObject *__pyx_t_3 = NULL;
5987   PyObject *__pyx_t_4 = NULL;
5988   PyObject *__pyx_t_5 = NULL;
5989   int __pyx_t_6;
5990   int __pyx_lineno = 0;
5991   const char *__pyx_filename = NULL;
5992   int __pyx_clineno = 0;
5993   __Pyx_RefNannySetupContext("__pyx_unpickle_BigBedBlockHandler", 0);
5994 
5995   /* "(tree fragment)":4
5996  *     cdef object __pyx_PickleError
5997  *     cdef object __pyx_result
5998  *     if __pyx_checksum != 0xfe9487d:             # <<<<<<<<<<<<<<
5999  *         from pickle import PickleError as __pyx_PickleError
6000  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xfe9487d = (chrom_id, end, start))" % __pyx_checksum)
6001  */
6002   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xfe9487d) != 0);
6003   if (__pyx_t_1) {
6004 
6005     /* "(tree fragment)":5
6006  *     cdef object __pyx_result
6007  *     if __pyx_checksum != 0xfe9487d:
6008  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
6009  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xfe9487d = (chrom_id, end, start))" % __pyx_checksum)
6010  *     __pyx_result = BigBedBlockHandler.__new__(__pyx_type)
6011  */
6012     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6013     __Pyx_GOTREF(__pyx_t_2);
6014     __Pyx_INCREF(__pyx_n_s_PickleError);
6015     __Pyx_GIVEREF(__pyx_n_s_PickleError);
6016     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
6017     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
6018     __Pyx_GOTREF(__pyx_t_3);
6019     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6020     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6021     __Pyx_GOTREF(__pyx_t_2);
6022     __Pyx_INCREF(__pyx_t_2);
6023     __pyx_v___pyx_PickleError = __pyx_t_2;
6024     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6025     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6026 
6027     /* "(tree fragment)":6
6028  *     if __pyx_checksum != 0xfe9487d:
6029  *         from pickle import PickleError as __pyx_PickleError
6030  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xfe9487d = (chrom_id, end, start))" % __pyx_checksum)             # <<<<<<<<<<<<<<
6031  *     __pyx_result = BigBedBlockHandler.__new__(__pyx_type)
6032  *     if __pyx_state is not None:
6033  */
6034     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
6035     __Pyx_GOTREF(__pyx_t_2);
6036     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xfe, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
6037     __Pyx_GOTREF(__pyx_t_4);
6038     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6039     __Pyx_INCREF(__pyx_v___pyx_PickleError);
6040     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
6041     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6042       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
6043       if (likely(__pyx_t_5)) {
6044         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6045         __Pyx_INCREF(__pyx_t_5);
6046         __Pyx_INCREF(function);
6047         __Pyx_DECREF_SET(__pyx_t_2, function);
6048       }
6049     }
6050     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
6051     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6052     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6053     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
6054     __Pyx_GOTREF(__pyx_t_3);
6055     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6056     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6057     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6058     __PYX_ERR(1, 6, __pyx_L1_error)
6059 
6060     /* "(tree fragment)":4
6061  *     cdef object __pyx_PickleError
6062  *     cdef object __pyx_result
6063  *     if __pyx_checksum != 0xfe9487d:             # <<<<<<<<<<<<<<
6064  *         from pickle import PickleError as __pyx_PickleError
6065  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xfe9487d = (chrom_id, end, start))" % __pyx_checksum)
6066  */
6067   }
6068 
6069   /* "(tree fragment)":7
6070  *         from pickle import PickleError as __pyx_PickleError
6071  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xfe9487d = (chrom_id, end, start))" % __pyx_checksum)
6072  *     __pyx_result = BigBedBlockHandler.__new__(__pyx_type)             # <<<<<<<<<<<<<<
6073  *     if __pyx_state is not None:
6074  *         __pyx_unpickle_BigBedBlockHandler__set_state(<BigBedBlockHandler> __pyx_result, __pyx_state)
6075  */
6076   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
6077   __Pyx_GOTREF(__pyx_t_2);
6078   __pyx_t_4 = NULL;
6079   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6080     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
6081     if (likely(__pyx_t_4)) {
6082       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6083       __Pyx_INCREF(__pyx_t_4);
6084       __Pyx_INCREF(function);
6085       __Pyx_DECREF_SET(__pyx_t_2, function);
6086     }
6087   }
6088   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
6089   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6090   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
6091   __Pyx_GOTREF(__pyx_t_3);
6092   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6093   __pyx_v___pyx_result = __pyx_t_3;
6094   __pyx_t_3 = 0;
6095 
6096   /* "(tree fragment)":8
6097  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xfe9487d = (chrom_id, end, start))" % __pyx_checksum)
6098  *     __pyx_result = BigBedBlockHandler.__new__(__pyx_type)
6099  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
6100  *         __pyx_unpickle_BigBedBlockHandler__set_state(<BigBedBlockHandler> __pyx_result, __pyx_state)
6101  *     return __pyx_result
6102  */
6103   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
6104   __pyx_t_6 = (__pyx_t_1 != 0);
6105   if (__pyx_t_6) {
6106 
6107     /* "(tree fragment)":9
6108  *     __pyx_result = BigBedBlockHandler.__new__(__pyx_type)
6109  *     if __pyx_state is not None:
6110  *         __pyx_unpickle_BigBedBlockHandler__set_state(<BigBedBlockHandler> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
6111  *     return __pyx_result
6112  * cdef __pyx_unpickle_BigBedBlockHandler__set_state(BigBedBlockHandler __pyx_result, tuple __pyx_state):
6113  */
6114     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
6115     __pyx_t_3 = __pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_BigBedBlockHandler__set_state(((struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
6116     __Pyx_GOTREF(__pyx_t_3);
6117     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6118 
6119     /* "(tree fragment)":8
6120  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xfe9487d = (chrom_id, end, start))" % __pyx_checksum)
6121  *     __pyx_result = BigBedBlockHandler.__new__(__pyx_type)
6122  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
6123  *         __pyx_unpickle_BigBedBlockHandler__set_state(<BigBedBlockHandler> __pyx_result, __pyx_state)
6124  *     return __pyx_result
6125  */
6126   }
6127 
6128   /* "(tree fragment)":10
6129  *     if __pyx_state is not None:
6130  *         __pyx_unpickle_BigBedBlockHandler__set_state(<BigBedBlockHandler> __pyx_result, __pyx_state)
6131  *     return __pyx_result             # <<<<<<<<<<<<<<
6132  * cdef __pyx_unpickle_BigBedBlockHandler__set_state(BigBedBlockHandler __pyx_result, tuple __pyx_state):
6133  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.start = __pyx_state[2]
6134  */
6135   __Pyx_XDECREF(__pyx_r);
6136   __Pyx_INCREF(__pyx_v___pyx_result);
6137   __pyx_r = __pyx_v___pyx_result;
6138   goto __pyx_L0;
6139 
6140   /* "(tree fragment)":1
6141  * def __pyx_unpickle_BigBedBlockHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
6142  *     cdef object __pyx_PickleError
6143  *     cdef object __pyx_result
6144  */
6145 
6146   /* function exit code */
6147   __pyx_L1_error:;
6148   __Pyx_XDECREF(__pyx_t_2);
6149   __Pyx_XDECREF(__pyx_t_3);
6150   __Pyx_XDECREF(__pyx_t_4);
6151   __Pyx_XDECREF(__pyx_t_5);
6152   __Pyx_AddTraceback("bx.bbi.bigbed_file.__pyx_unpickle_BigBedBlockHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
6153   __pyx_r = NULL;
6154   __pyx_L0:;
6155   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
6156   __Pyx_XDECREF(__pyx_v___pyx_result);
6157   __Pyx_XGIVEREF(__pyx_r);
6158   __Pyx_RefNannyFinishContext();
6159   return __pyx_r;
6160 }
6161 
6162 /* "(tree fragment)":11
6163  *         __pyx_unpickle_BigBedBlockHandler__set_state(<BigBedBlockHandler> __pyx_result, __pyx_state)
6164  *     return __pyx_result
6165  * cdef __pyx_unpickle_BigBedBlockHandler__set_state(BigBedBlockHandler __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
6166  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.start = __pyx_state[2]
6167  *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
6168  */
6169 
__pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_BigBedBlockHandler__set_state(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)6170 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_BigBedBlockHandler__set_state(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
6171   PyObject *__pyx_r = NULL;
6172   __Pyx_RefNannyDeclarations
6173   PyObject *__pyx_t_1 = NULL;
6174   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_2;
6175   int __pyx_t_3;
6176   Py_ssize_t __pyx_t_4;
6177   int __pyx_t_5;
6178   int __pyx_t_6;
6179   PyObject *__pyx_t_7 = NULL;
6180   PyObject *__pyx_t_8 = NULL;
6181   PyObject *__pyx_t_9 = NULL;
6182   int __pyx_lineno = 0;
6183   const char *__pyx_filename = NULL;
6184   int __pyx_clineno = 0;
6185   __Pyx_RefNannySetupContext("__pyx_unpickle_BigBedBlockHandler__set_state", 0);
6186 
6187   /* "(tree fragment)":12
6188  *     return __pyx_result
6189  * cdef __pyx_unpickle_BigBedBlockHandler__set_state(BigBedBlockHandler __pyx_result, tuple __pyx_state):
6190  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.start = __pyx_state[2]             # <<<<<<<<<<<<<<
6191  *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
6192  *         __pyx_result.__dict__.update(__pyx_state[3])
6193  */
6194   if (unlikely(__pyx_v___pyx_state == Py_None)) {
6195     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6196     __PYX_ERR(1, 12, __pyx_L1_error)
6197   }
6198   __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)
6199   __Pyx_GOTREF(__pyx_t_1);
6200   __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
6201   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6202   __pyx_v___pyx_result->chrom_id = __pyx_t_2;
6203   if (unlikely(__pyx_v___pyx_state == Py_None)) {
6204     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6205     __PYX_ERR(1, 12, __pyx_L1_error)
6206   }
6207   __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)
6208   __Pyx_GOTREF(__pyx_t_1);
6209   __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
6210   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6211   __pyx_v___pyx_result->end = __pyx_t_2;
6212   if (unlikely(__pyx_v___pyx_state == Py_None)) {
6213     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6214     __PYX_ERR(1, 12, __pyx_L1_error)
6215   }
6216   __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)
6217   __Pyx_GOTREF(__pyx_t_1);
6218   __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
6219   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6220   __pyx_v___pyx_result->start = __pyx_t_2;
6221 
6222   /* "(tree fragment)":13
6223  * cdef __pyx_unpickle_BigBedBlockHandler__set_state(BigBedBlockHandler __pyx_result, tuple __pyx_state):
6224  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.start = __pyx_state[2]
6225  *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
6226  *         __pyx_result.__dict__.update(__pyx_state[3])
6227  */
6228   if (unlikely(__pyx_v___pyx_state == Py_None)) {
6229     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
6230     __PYX_ERR(1, 13, __pyx_L1_error)
6231   }
6232   __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6233   __pyx_t_5 = ((__pyx_t_4 > 3) != 0);
6234   if (__pyx_t_5) {
6235   } else {
6236     __pyx_t_3 = __pyx_t_5;
6237     goto __pyx_L4_bool_binop_done;
6238   }
6239   __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6240   __pyx_t_6 = (__pyx_t_5 != 0);
6241   __pyx_t_3 = __pyx_t_6;
6242   __pyx_L4_bool_binop_done:;
6243   if (__pyx_t_3) {
6244 
6245     /* "(tree fragment)":14
6246  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.start = __pyx_state[2]
6247  *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
6248  *         __pyx_result.__dict__.update(__pyx_state[3])             # <<<<<<<<<<<<<<
6249  */
6250     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
6251     __Pyx_GOTREF(__pyx_t_7);
6252     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
6253     __Pyx_GOTREF(__pyx_t_8);
6254     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6255     if (unlikely(__pyx_v___pyx_state == Py_None)) {
6256       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6257       __PYX_ERR(1, 14, __pyx_L1_error)
6258     }
6259     __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
6260     __Pyx_GOTREF(__pyx_t_7);
6261     __pyx_t_9 = NULL;
6262     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
6263       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
6264       if (likely(__pyx_t_9)) {
6265         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
6266         __Pyx_INCREF(__pyx_t_9);
6267         __Pyx_INCREF(function);
6268         __Pyx_DECREF_SET(__pyx_t_8, function);
6269       }
6270     }
6271     __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
6272     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
6273     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6274     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
6275     __Pyx_GOTREF(__pyx_t_1);
6276     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6277     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6278 
6279     /* "(tree fragment)":13
6280  * cdef __pyx_unpickle_BigBedBlockHandler__set_state(BigBedBlockHandler __pyx_result, tuple __pyx_state):
6281  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.start = __pyx_state[2]
6282  *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
6283  *         __pyx_result.__dict__.update(__pyx_state[3])
6284  */
6285   }
6286 
6287   /* "(tree fragment)":11
6288  *         __pyx_unpickle_BigBedBlockHandler__set_state(<BigBedBlockHandler> __pyx_result, __pyx_state)
6289  *     return __pyx_result
6290  * cdef __pyx_unpickle_BigBedBlockHandler__set_state(BigBedBlockHandler __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
6291  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.start = __pyx_state[2]
6292  *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
6293  */
6294 
6295   /* function exit code */
6296   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6297   goto __pyx_L0;
6298   __pyx_L1_error:;
6299   __Pyx_XDECREF(__pyx_t_1);
6300   __Pyx_XDECREF(__pyx_t_7);
6301   __Pyx_XDECREF(__pyx_t_8);
6302   __Pyx_XDECREF(__pyx_t_9);
6303   __Pyx_AddTraceback("bx.bbi.bigbed_file.__pyx_unpickle_BigBedBlockHandler__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
6304   __pyx_r = 0;
6305   __pyx_L0:;
6306   __Pyx_XGIVEREF(__pyx_r);
6307   __Pyx_RefNannyFinishContext();
6308   return __pyx_r;
6309 }
6310 
6311 /* "(tree fragment)":1
6312  * def __pyx_unpickle_SummarizingBlockHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
6313  *     cdef object __pyx_PickleError
6314  *     cdef object __pyx_result
6315  */
6316 
6317 /* Python wrapper */
6318 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_3__pyx_unpickle_SummarizingBlockHandler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6319 static PyMethodDef __pyx_mdef_2bx_3bbi_11bigbed_file_3__pyx_unpickle_SummarizingBlockHandler = {"__pyx_unpickle_SummarizingBlockHandler", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_3bbi_11bigbed_file_3__pyx_unpickle_SummarizingBlockHandler, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2bx_3bbi_11bigbed_file_3__pyx_unpickle_SummarizingBlockHandler(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6320 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_3__pyx_unpickle_SummarizingBlockHandler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6321   PyObject *__pyx_v___pyx_type = 0;
6322   long __pyx_v___pyx_checksum;
6323   PyObject *__pyx_v___pyx_state = 0;
6324   int __pyx_lineno = 0;
6325   const char *__pyx_filename = NULL;
6326   int __pyx_clineno = 0;
6327   PyObject *__pyx_r = 0;
6328   __Pyx_RefNannyDeclarations
6329   __Pyx_RefNannySetupContext("__pyx_unpickle_SummarizingBlockHandler (wrapper)", 0);
6330   {
6331     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
6332     PyObject* values[3] = {0,0,0};
6333     if (unlikely(__pyx_kwds)) {
6334       Py_ssize_t kw_args;
6335       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6336       switch (pos_args) {
6337         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6338         CYTHON_FALLTHROUGH;
6339         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6340         CYTHON_FALLTHROUGH;
6341         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6342         CYTHON_FALLTHROUGH;
6343         case  0: break;
6344         default: goto __pyx_L5_argtuple_error;
6345       }
6346       kw_args = PyDict_Size(__pyx_kwds);
6347       switch (pos_args) {
6348         case  0:
6349         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
6350         else goto __pyx_L5_argtuple_error;
6351         CYTHON_FALLTHROUGH;
6352         case  1:
6353         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
6354         else {
6355           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SummarizingBlockHandler", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
6356         }
6357         CYTHON_FALLTHROUGH;
6358         case  2:
6359         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
6360         else {
6361           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SummarizingBlockHandler", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
6362         }
6363       }
6364       if (unlikely(kw_args > 0)) {
6365         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_SummarizingBlockHandler") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
6366       }
6367     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6368       goto __pyx_L5_argtuple_error;
6369     } else {
6370       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6371       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6372       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6373     }
6374     __pyx_v___pyx_type = values[0];
6375     __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)
6376     __pyx_v___pyx_state = values[2];
6377   }
6378   goto __pyx_L4_argument_unpacking_done;
6379   __pyx_L5_argtuple_error:;
6380   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SummarizingBlockHandler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
6381   __pyx_L3_error:;
6382   __Pyx_AddTraceback("bx.bbi.bigbed_file.__pyx_unpickle_SummarizingBlockHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
6383   __Pyx_RefNannyFinishContext();
6384   return NULL;
6385   __pyx_L4_argument_unpacking_done:;
6386   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file_2__pyx_unpickle_SummarizingBlockHandler(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
6387 
6388   /* function exit code */
6389   __Pyx_RefNannyFinishContext();
6390   return __pyx_r;
6391 }
6392 
__pyx_pf_2bx_3bbi_11bigbed_file_2__pyx_unpickle_SummarizingBlockHandler(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)6393 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_2__pyx_unpickle_SummarizingBlockHandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
6394   PyObject *__pyx_v___pyx_PickleError = 0;
6395   PyObject *__pyx_v___pyx_result = 0;
6396   PyObject *__pyx_r = NULL;
6397   __Pyx_RefNannyDeclarations
6398   int __pyx_t_1;
6399   PyObject *__pyx_t_2 = NULL;
6400   PyObject *__pyx_t_3 = NULL;
6401   PyObject *__pyx_t_4 = NULL;
6402   PyObject *__pyx_t_5 = NULL;
6403   int __pyx_t_6;
6404   int __pyx_lineno = 0;
6405   const char *__pyx_filename = NULL;
6406   int __pyx_clineno = 0;
6407   __Pyx_RefNannySetupContext("__pyx_unpickle_SummarizingBlockHandler", 0);
6408 
6409   /* "(tree fragment)":4
6410  *     cdef object __pyx_PickleError
6411  *     cdef object __pyx_result
6412  *     if __pyx_checksum != 0x725a786:             # <<<<<<<<<<<<<<
6413  *         from pickle import PickleError as __pyx_PickleError
6414  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x725a786 = (chrom_id, end, sd, start))" % __pyx_checksum)
6415  */
6416   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x725a786) != 0);
6417   if (__pyx_t_1) {
6418 
6419     /* "(tree fragment)":5
6420  *     cdef object __pyx_result
6421  *     if __pyx_checksum != 0x725a786:
6422  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
6423  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x725a786 = (chrom_id, end, sd, start))" % __pyx_checksum)
6424  *     __pyx_result = SummarizingBlockHandler.__new__(__pyx_type)
6425  */
6426     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6427     __Pyx_GOTREF(__pyx_t_2);
6428     __Pyx_INCREF(__pyx_n_s_PickleError);
6429     __Pyx_GIVEREF(__pyx_n_s_PickleError);
6430     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
6431     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
6432     __Pyx_GOTREF(__pyx_t_3);
6433     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6434     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6435     __Pyx_GOTREF(__pyx_t_2);
6436     __Pyx_INCREF(__pyx_t_2);
6437     __pyx_v___pyx_PickleError = __pyx_t_2;
6438     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6439     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6440 
6441     /* "(tree fragment)":6
6442  *     if __pyx_checksum != 0x725a786:
6443  *         from pickle import PickleError as __pyx_PickleError
6444  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x725a786 = (chrom_id, end, sd, start))" % __pyx_checksum)             # <<<<<<<<<<<<<<
6445  *     __pyx_result = SummarizingBlockHandler.__new__(__pyx_type)
6446  *     if __pyx_state is not None:
6447  */
6448     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
6449     __Pyx_GOTREF(__pyx_t_2);
6450     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x72, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
6451     __Pyx_GOTREF(__pyx_t_4);
6452     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6453     __Pyx_INCREF(__pyx_v___pyx_PickleError);
6454     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
6455     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6456       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
6457       if (likely(__pyx_t_5)) {
6458         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6459         __Pyx_INCREF(__pyx_t_5);
6460         __Pyx_INCREF(function);
6461         __Pyx_DECREF_SET(__pyx_t_2, function);
6462       }
6463     }
6464     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
6465     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6466     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6467     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
6468     __Pyx_GOTREF(__pyx_t_3);
6469     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6470     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6471     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6472     __PYX_ERR(1, 6, __pyx_L1_error)
6473 
6474     /* "(tree fragment)":4
6475  *     cdef object __pyx_PickleError
6476  *     cdef object __pyx_result
6477  *     if __pyx_checksum != 0x725a786:             # <<<<<<<<<<<<<<
6478  *         from pickle import PickleError as __pyx_PickleError
6479  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x725a786 = (chrom_id, end, sd, start))" % __pyx_checksum)
6480  */
6481   }
6482 
6483   /* "(tree fragment)":7
6484  *         from pickle import PickleError as __pyx_PickleError
6485  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x725a786 = (chrom_id, end, sd, start))" % __pyx_checksum)
6486  *     __pyx_result = SummarizingBlockHandler.__new__(__pyx_type)             # <<<<<<<<<<<<<<
6487  *     if __pyx_state is not None:
6488  *         __pyx_unpickle_SummarizingBlockHandler__set_state(<SummarizingBlockHandler> __pyx_result, __pyx_state)
6489  */
6490   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_3bbi_11bigbed_file_SummarizingBlockHandler), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
6491   __Pyx_GOTREF(__pyx_t_2);
6492   __pyx_t_4 = NULL;
6493   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6494     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
6495     if (likely(__pyx_t_4)) {
6496       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6497       __Pyx_INCREF(__pyx_t_4);
6498       __Pyx_INCREF(function);
6499       __Pyx_DECREF_SET(__pyx_t_2, function);
6500     }
6501   }
6502   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
6503   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6504   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
6505   __Pyx_GOTREF(__pyx_t_3);
6506   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6507   __pyx_v___pyx_result = __pyx_t_3;
6508   __pyx_t_3 = 0;
6509 
6510   /* "(tree fragment)":8
6511  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x725a786 = (chrom_id, end, sd, start))" % __pyx_checksum)
6512  *     __pyx_result = SummarizingBlockHandler.__new__(__pyx_type)
6513  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
6514  *         __pyx_unpickle_SummarizingBlockHandler__set_state(<SummarizingBlockHandler> __pyx_result, __pyx_state)
6515  *     return __pyx_result
6516  */
6517   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
6518   __pyx_t_6 = (__pyx_t_1 != 0);
6519   if (__pyx_t_6) {
6520 
6521     /* "(tree fragment)":9
6522  *     __pyx_result = SummarizingBlockHandler.__new__(__pyx_type)
6523  *     if __pyx_state is not None:
6524  *         __pyx_unpickle_SummarizingBlockHandler__set_state(<SummarizingBlockHandler> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
6525  *     return __pyx_result
6526  * cdef __pyx_unpickle_SummarizingBlockHandler__set_state(SummarizingBlockHandler __pyx_result, tuple __pyx_state):
6527  */
6528     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
6529     __pyx_t_3 = __pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_SummarizingBlockHandler__set_state(((struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
6530     __Pyx_GOTREF(__pyx_t_3);
6531     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6532 
6533     /* "(tree fragment)":8
6534  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x725a786 = (chrom_id, end, sd, start))" % __pyx_checksum)
6535  *     __pyx_result = SummarizingBlockHandler.__new__(__pyx_type)
6536  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
6537  *         __pyx_unpickle_SummarizingBlockHandler__set_state(<SummarizingBlockHandler> __pyx_result, __pyx_state)
6538  *     return __pyx_result
6539  */
6540   }
6541 
6542   /* "(tree fragment)":10
6543  *     if __pyx_state is not None:
6544  *         __pyx_unpickle_SummarizingBlockHandler__set_state(<SummarizingBlockHandler> __pyx_result, __pyx_state)
6545  *     return __pyx_result             # <<<<<<<<<<<<<<
6546  * cdef __pyx_unpickle_SummarizingBlockHandler__set_state(SummarizingBlockHandler __pyx_result, tuple __pyx_state):
6547  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.sd = __pyx_state[2]; __pyx_result.start = __pyx_state[3]
6548  */
6549   __Pyx_XDECREF(__pyx_r);
6550   __Pyx_INCREF(__pyx_v___pyx_result);
6551   __pyx_r = __pyx_v___pyx_result;
6552   goto __pyx_L0;
6553 
6554   /* "(tree fragment)":1
6555  * def __pyx_unpickle_SummarizingBlockHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
6556  *     cdef object __pyx_PickleError
6557  *     cdef object __pyx_result
6558  */
6559 
6560   /* function exit code */
6561   __pyx_L1_error:;
6562   __Pyx_XDECREF(__pyx_t_2);
6563   __Pyx_XDECREF(__pyx_t_3);
6564   __Pyx_XDECREF(__pyx_t_4);
6565   __Pyx_XDECREF(__pyx_t_5);
6566   __Pyx_AddTraceback("bx.bbi.bigbed_file.__pyx_unpickle_SummarizingBlockHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
6567   __pyx_r = NULL;
6568   __pyx_L0:;
6569   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
6570   __Pyx_XDECREF(__pyx_v___pyx_result);
6571   __Pyx_XGIVEREF(__pyx_r);
6572   __Pyx_RefNannyFinishContext();
6573   return __pyx_r;
6574 }
6575 
6576 /* "(tree fragment)":11
6577  *         __pyx_unpickle_SummarizingBlockHandler__set_state(<SummarizingBlockHandler> __pyx_result, __pyx_state)
6578  *     return __pyx_result
6579  * cdef __pyx_unpickle_SummarizingBlockHandler__set_state(SummarizingBlockHandler __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
6580  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.sd = __pyx_state[2]; __pyx_result.start = __pyx_state[3]
6581  *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
6582  */
6583 
__pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_SummarizingBlockHandler__set_state(struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)6584 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_SummarizingBlockHandler__set_state(struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
6585   PyObject *__pyx_r = NULL;
6586   __Pyx_RefNannyDeclarations
6587   PyObject *__pyx_t_1 = NULL;
6588   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_2;
6589   int __pyx_t_3;
6590   Py_ssize_t __pyx_t_4;
6591   int __pyx_t_5;
6592   int __pyx_t_6;
6593   PyObject *__pyx_t_7 = NULL;
6594   PyObject *__pyx_t_8 = NULL;
6595   PyObject *__pyx_t_9 = NULL;
6596   int __pyx_lineno = 0;
6597   const char *__pyx_filename = NULL;
6598   int __pyx_clineno = 0;
6599   __Pyx_RefNannySetupContext("__pyx_unpickle_SummarizingBlockHandler__set_state", 0);
6600 
6601   /* "(tree fragment)":12
6602  *     return __pyx_result
6603  * cdef __pyx_unpickle_SummarizingBlockHandler__set_state(SummarizingBlockHandler __pyx_result, tuple __pyx_state):
6604  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.sd = __pyx_state[2]; __pyx_result.start = __pyx_state[3]             # <<<<<<<<<<<<<<
6605  *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
6606  *         __pyx_result.__dict__.update(__pyx_state[4])
6607  */
6608   if (unlikely(__pyx_v___pyx_state == Py_None)) {
6609     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6610     __PYX_ERR(1, 12, __pyx_L1_error)
6611   }
6612   __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)
6613   __Pyx_GOTREF(__pyx_t_1);
6614   __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
6615   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6616   __pyx_v___pyx_result->__pyx_base.chrom_id = __pyx_t_2;
6617   if (unlikely(__pyx_v___pyx_state == Py_None)) {
6618     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6619     __PYX_ERR(1, 12, __pyx_L1_error)
6620   }
6621   __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)
6622   __Pyx_GOTREF(__pyx_t_1);
6623   __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
6624   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6625   __pyx_v___pyx_result->__pyx_base.end = __pyx_t_2;
6626   if (unlikely(__pyx_v___pyx_state == Py_None)) {
6627     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6628     __PYX_ERR(1, 12, __pyx_L1_error)
6629   }
6630   __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)
6631   __Pyx_GOTREF(__pyx_t_1);
6632   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2bx_3bbi_8bbi_file_SummarizedData))))) __PYX_ERR(1, 12, __pyx_L1_error)
6633   __Pyx_GIVEREF(__pyx_t_1);
6634   __Pyx_GOTREF(__pyx_v___pyx_result->sd);
6635   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->sd));
6636   __pyx_v___pyx_result->sd = ((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_t_1);
6637   __pyx_t_1 = 0;
6638   if (unlikely(__pyx_v___pyx_state == Py_None)) {
6639     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6640     __PYX_ERR(1, 12, __pyx_L1_error)
6641   }
6642   __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)
6643   __Pyx_GOTREF(__pyx_t_1);
6644   __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
6645   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6646   __pyx_v___pyx_result->__pyx_base.start = __pyx_t_2;
6647 
6648   /* "(tree fragment)":13
6649  * cdef __pyx_unpickle_SummarizingBlockHandler__set_state(SummarizingBlockHandler __pyx_result, tuple __pyx_state):
6650  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.sd = __pyx_state[2]; __pyx_result.start = __pyx_state[3]
6651  *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
6652  *         __pyx_result.__dict__.update(__pyx_state[4])
6653  */
6654   if (unlikely(__pyx_v___pyx_state == Py_None)) {
6655     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
6656     __PYX_ERR(1, 13, __pyx_L1_error)
6657   }
6658   __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6659   __pyx_t_5 = ((__pyx_t_4 > 4) != 0);
6660   if (__pyx_t_5) {
6661   } else {
6662     __pyx_t_3 = __pyx_t_5;
6663     goto __pyx_L4_bool_binop_done;
6664   }
6665   __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6666   __pyx_t_6 = (__pyx_t_5 != 0);
6667   __pyx_t_3 = __pyx_t_6;
6668   __pyx_L4_bool_binop_done:;
6669   if (__pyx_t_3) {
6670 
6671     /* "(tree fragment)":14
6672  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.sd = __pyx_state[2]; __pyx_result.start = __pyx_state[3]
6673  *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
6674  *         __pyx_result.__dict__.update(__pyx_state[4])             # <<<<<<<<<<<<<<
6675  */
6676     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
6677     __Pyx_GOTREF(__pyx_t_7);
6678     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
6679     __Pyx_GOTREF(__pyx_t_8);
6680     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6681     if (unlikely(__pyx_v___pyx_state == Py_None)) {
6682       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6683       __PYX_ERR(1, 14, __pyx_L1_error)
6684     }
6685     __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
6686     __Pyx_GOTREF(__pyx_t_7);
6687     __pyx_t_9 = NULL;
6688     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
6689       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
6690       if (likely(__pyx_t_9)) {
6691         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
6692         __Pyx_INCREF(__pyx_t_9);
6693         __Pyx_INCREF(function);
6694         __Pyx_DECREF_SET(__pyx_t_8, function);
6695       }
6696     }
6697     __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
6698     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
6699     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6700     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
6701     __Pyx_GOTREF(__pyx_t_1);
6702     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6703     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6704 
6705     /* "(tree fragment)":13
6706  * cdef __pyx_unpickle_SummarizingBlockHandler__set_state(SummarizingBlockHandler __pyx_result, tuple __pyx_state):
6707  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.sd = __pyx_state[2]; __pyx_result.start = __pyx_state[3]
6708  *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
6709  *         __pyx_result.__dict__.update(__pyx_state[4])
6710  */
6711   }
6712 
6713   /* "(tree fragment)":11
6714  *         __pyx_unpickle_SummarizingBlockHandler__set_state(<SummarizingBlockHandler> __pyx_result, __pyx_state)
6715  *     return __pyx_result
6716  * cdef __pyx_unpickle_SummarizingBlockHandler__set_state(SummarizingBlockHandler __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
6717  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.sd = __pyx_state[2]; __pyx_result.start = __pyx_state[3]
6718  *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
6719  */
6720 
6721   /* function exit code */
6722   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6723   goto __pyx_L0;
6724   __pyx_L1_error:;
6725   __Pyx_XDECREF(__pyx_t_1);
6726   __Pyx_XDECREF(__pyx_t_7);
6727   __Pyx_XDECREF(__pyx_t_8);
6728   __Pyx_XDECREF(__pyx_t_9);
6729   __Pyx_AddTraceback("bx.bbi.bigbed_file.__pyx_unpickle_SummarizingBlockHandler__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
6730   __pyx_r = 0;
6731   __pyx_L0:;
6732   __Pyx_XGIVEREF(__pyx_r);
6733   __Pyx_RefNannyFinishContext();
6734   return __pyx_r;
6735 }
6736 
6737 /* "(tree fragment)":1
6738  * def __pyx_unpickle_IntervalAccumulatingBlockHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
6739  *     cdef object __pyx_PickleError
6740  *     cdef object __pyx_result
6741  */
6742 
6743 /* Python wrapper */
6744 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_5__pyx_unpickle_IntervalAccumulatingBlockHandler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6745 static PyMethodDef __pyx_mdef_2bx_3bbi_11bigbed_file_5__pyx_unpickle_IntervalAccumulatingBlockHandler = {"__pyx_unpickle_IntervalAccumulatingBlockHandler", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_3bbi_11bigbed_file_5__pyx_unpickle_IntervalAccumulatingBlockHandler, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2bx_3bbi_11bigbed_file_5__pyx_unpickle_IntervalAccumulatingBlockHandler(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6746 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_5__pyx_unpickle_IntervalAccumulatingBlockHandler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6747   PyObject *__pyx_v___pyx_type = 0;
6748   long __pyx_v___pyx_checksum;
6749   PyObject *__pyx_v___pyx_state = 0;
6750   int __pyx_lineno = 0;
6751   const char *__pyx_filename = NULL;
6752   int __pyx_clineno = 0;
6753   PyObject *__pyx_r = 0;
6754   __Pyx_RefNannyDeclarations
6755   __Pyx_RefNannySetupContext("__pyx_unpickle_IntervalAccumulatingBlockHandler (wrapper)", 0);
6756   {
6757     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
6758     PyObject* values[3] = {0,0,0};
6759     if (unlikely(__pyx_kwds)) {
6760       Py_ssize_t kw_args;
6761       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6762       switch (pos_args) {
6763         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6764         CYTHON_FALLTHROUGH;
6765         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6766         CYTHON_FALLTHROUGH;
6767         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6768         CYTHON_FALLTHROUGH;
6769         case  0: break;
6770         default: goto __pyx_L5_argtuple_error;
6771       }
6772       kw_args = PyDict_Size(__pyx_kwds);
6773       switch (pos_args) {
6774         case  0:
6775         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
6776         else goto __pyx_L5_argtuple_error;
6777         CYTHON_FALLTHROUGH;
6778         case  1:
6779         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
6780         else {
6781           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_IntervalAccumulatingBlockHandler", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
6782         }
6783         CYTHON_FALLTHROUGH;
6784         case  2:
6785         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
6786         else {
6787           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_IntervalAccumulatingBlockHandler", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
6788         }
6789       }
6790       if (unlikely(kw_args > 0)) {
6791         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_IntervalAccumulatingBlockHandler") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
6792       }
6793     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6794       goto __pyx_L5_argtuple_error;
6795     } else {
6796       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6797       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6798       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6799     }
6800     __pyx_v___pyx_type = values[0];
6801     __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)
6802     __pyx_v___pyx_state = values[2];
6803   }
6804   goto __pyx_L4_argument_unpacking_done;
6805   __pyx_L5_argtuple_error:;
6806   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_IntervalAccumulatingBlockHandler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
6807   __pyx_L3_error:;
6808   __Pyx_AddTraceback("bx.bbi.bigbed_file.__pyx_unpickle_IntervalAccumulatingBlockHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
6809   __Pyx_RefNannyFinishContext();
6810   return NULL;
6811   __pyx_L4_argument_unpacking_done:;
6812   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file_4__pyx_unpickle_IntervalAccumulatingBlockHandler(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
6813 
6814   /* function exit code */
6815   __Pyx_RefNannyFinishContext();
6816   return __pyx_r;
6817 }
6818 
__pyx_pf_2bx_3bbi_11bigbed_file_4__pyx_unpickle_IntervalAccumulatingBlockHandler(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)6819 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_4__pyx_unpickle_IntervalAccumulatingBlockHandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
6820   PyObject *__pyx_v___pyx_PickleError = 0;
6821   PyObject *__pyx_v___pyx_result = 0;
6822   PyObject *__pyx_r = NULL;
6823   __Pyx_RefNannyDeclarations
6824   int __pyx_t_1;
6825   PyObject *__pyx_t_2 = NULL;
6826   PyObject *__pyx_t_3 = NULL;
6827   PyObject *__pyx_t_4 = NULL;
6828   PyObject *__pyx_t_5 = NULL;
6829   int __pyx_t_6;
6830   int __pyx_lineno = 0;
6831   const char *__pyx_filename = NULL;
6832   int __pyx_clineno = 0;
6833   __Pyx_RefNannySetupContext("__pyx_unpickle_IntervalAccumulatingBlockHandler", 0);
6834 
6835   /* "(tree fragment)":4
6836  *     cdef object __pyx_PickleError
6837  *     cdef object __pyx_result
6838  *     if __pyx_checksum != 0xe0ff5c2:             # <<<<<<<<<<<<<<
6839  *         from pickle import PickleError as __pyx_PickleError
6840  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xe0ff5c2 = (chrom_id, end, intervals, start))" % __pyx_checksum)
6841  */
6842   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xe0ff5c2) != 0);
6843   if (__pyx_t_1) {
6844 
6845     /* "(tree fragment)":5
6846  *     cdef object __pyx_result
6847  *     if __pyx_checksum != 0xe0ff5c2:
6848  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
6849  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xe0ff5c2 = (chrom_id, end, intervals, start))" % __pyx_checksum)
6850  *     __pyx_result = IntervalAccumulatingBlockHandler.__new__(__pyx_type)
6851  */
6852     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6853     __Pyx_GOTREF(__pyx_t_2);
6854     __Pyx_INCREF(__pyx_n_s_PickleError);
6855     __Pyx_GIVEREF(__pyx_n_s_PickleError);
6856     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
6857     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
6858     __Pyx_GOTREF(__pyx_t_3);
6859     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6860     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6861     __Pyx_GOTREF(__pyx_t_2);
6862     __Pyx_INCREF(__pyx_t_2);
6863     __pyx_v___pyx_PickleError = __pyx_t_2;
6864     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6865     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6866 
6867     /* "(tree fragment)":6
6868  *     if __pyx_checksum != 0xe0ff5c2:
6869  *         from pickle import PickleError as __pyx_PickleError
6870  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xe0ff5c2 = (chrom_id, end, intervals, start))" % __pyx_checksum)             # <<<<<<<<<<<<<<
6871  *     __pyx_result = IntervalAccumulatingBlockHandler.__new__(__pyx_type)
6872  *     if __pyx_state is not None:
6873  */
6874     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
6875     __Pyx_GOTREF(__pyx_t_2);
6876     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xe0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
6877     __Pyx_GOTREF(__pyx_t_4);
6878     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6879     __Pyx_INCREF(__pyx_v___pyx_PickleError);
6880     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
6881     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6882       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
6883       if (likely(__pyx_t_5)) {
6884         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6885         __Pyx_INCREF(__pyx_t_5);
6886         __Pyx_INCREF(function);
6887         __Pyx_DECREF_SET(__pyx_t_2, function);
6888       }
6889     }
6890     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
6891     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6892     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6893     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
6894     __Pyx_GOTREF(__pyx_t_3);
6895     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6896     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6897     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6898     __PYX_ERR(1, 6, __pyx_L1_error)
6899 
6900     /* "(tree fragment)":4
6901  *     cdef object __pyx_PickleError
6902  *     cdef object __pyx_result
6903  *     if __pyx_checksum != 0xe0ff5c2:             # <<<<<<<<<<<<<<
6904  *         from pickle import PickleError as __pyx_PickleError
6905  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xe0ff5c2 = (chrom_id, end, intervals, start))" % __pyx_checksum)
6906  */
6907   }
6908 
6909   /* "(tree fragment)":7
6910  *         from pickle import PickleError as __pyx_PickleError
6911  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xe0ff5c2 = (chrom_id, end, intervals, start))" % __pyx_checksum)
6912  *     __pyx_result = IntervalAccumulatingBlockHandler.__new__(__pyx_type)             # <<<<<<<<<<<<<<
6913  *     if __pyx_state is not None:
6914  *         __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(<IntervalAccumulatingBlockHandler> __pyx_result, __pyx_state)
6915  */
6916   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
6917   __Pyx_GOTREF(__pyx_t_2);
6918   __pyx_t_4 = NULL;
6919   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6920     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
6921     if (likely(__pyx_t_4)) {
6922       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6923       __Pyx_INCREF(__pyx_t_4);
6924       __Pyx_INCREF(function);
6925       __Pyx_DECREF_SET(__pyx_t_2, function);
6926     }
6927   }
6928   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
6929   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6930   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
6931   __Pyx_GOTREF(__pyx_t_3);
6932   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6933   __pyx_v___pyx_result = __pyx_t_3;
6934   __pyx_t_3 = 0;
6935 
6936   /* "(tree fragment)":8
6937  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xe0ff5c2 = (chrom_id, end, intervals, start))" % __pyx_checksum)
6938  *     __pyx_result = IntervalAccumulatingBlockHandler.__new__(__pyx_type)
6939  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
6940  *         __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(<IntervalAccumulatingBlockHandler> __pyx_result, __pyx_state)
6941  *     return __pyx_result
6942  */
6943   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
6944   __pyx_t_6 = (__pyx_t_1 != 0);
6945   if (__pyx_t_6) {
6946 
6947     /* "(tree fragment)":9
6948  *     __pyx_result = IntervalAccumulatingBlockHandler.__new__(__pyx_type)
6949  *     if __pyx_state is not None:
6950  *         __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(<IntervalAccumulatingBlockHandler> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
6951  *     return __pyx_result
6952  * cdef __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(IntervalAccumulatingBlockHandler __pyx_result, tuple __pyx_state):
6953  */
6954     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
6955     __pyx_t_3 = __pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(((struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
6956     __Pyx_GOTREF(__pyx_t_3);
6957     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6958 
6959     /* "(tree fragment)":8
6960  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xe0ff5c2 = (chrom_id, end, intervals, start))" % __pyx_checksum)
6961  *     __pyx_result = IntervalAccumulatingBlockHandler.__new__(__pyx_type)
6962  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
6963  *         __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(<IntervalAccumulatingBlockHandler> __pyx_result, __pyx_state)
6964  *     return __pyx_result
6965  */
6966   }
6967 
6968   /* "(tree fragment)":10
6969  *     if __pyx_state is not None:
6970  *         __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(<IntervalAccumulatingBlockHandler> __pyx_result, __pyx_state)
6971  *     return __pyx_result             # <<<<<<<<<<<<<<
6972  * cdef __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(IntervalAccumulatingBlockHandler __pyx_result, tuple __pyx_state):
6973  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.intervals = __pyx_state[2]; __pyx_result.start = __pyx_state[3]
6974  */
6975   __Pyx_XDECREF(__pyx_r);
6976   __Pyx_INCREF(__pyx_v___pyx_result);
6977   __pyx_r = __pyx_v___pyx_result;
6978   goto __pyx_L0;
6979 
6980   /* "(tree fragment)":1
6981  * def __pyx_unpickle_IntervalAccumulatingBlockHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
6982  *     cdef object __pyx_PickleError
6983  *     cdef object __pyx_result
6984  */
6985 
6986   /* function exit code */
6987   __pyx_L1_error:;
6988   __Pyx_XDECREF(__pyx_t_2);
6989   __Pyx_XDECREF(__pyx_t_3);
6990   __Pyx_XDECREF(__pyx_t_4);
6991   __Pyx_XDECREF(__pyx_t_5);
6992   __Pyx_AddTraceback("bx.bbi.bigbed_file.__pyx_unpickle_IntervalAccumulatingBlockHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
6993   __pyx_r = NULL;
6994   __pyx_L0:;
6995   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
6996   __Pyx_XDECREF(__pyx_v___pyx_result);
6997   __Pyx_XGIVEREF(__pyx_r);
6998   __Pyx_RefNannyFinishContext();
6999   return __pyx_r;
7000 }
7001 
7002 /* "(tree fragment)":11
7003  *         __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(<IntervalAccumulatingBlockHandler> __pyx_result, __pyx_state)
7004  *     return __pyx_result
7005  * cdef __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(IntervalAccumulatingBlockHandler __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
7006  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.intervals = __pyx_state[2]; __pyx_result.start = __pyx_state[3]
7007  *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
7008  */
7009 
__pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)7010 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
7011   PyObject *__pyx_r = NULL;
7012   __Pyx_RefNannyDeclarations
7013   PyObject *__pyx_t_1 = NULL;
7014   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_2;
7015   int __pyx_t_3;
7016   Py_ssize_t __pyx_t_4;
7017   int __pyx_t_5;
7018   int __pyx_t_6;
7019   PyObject *__pyx_t_7 = NULL;
7020   PyObject *__pyx_t_8 = NULL;
7021   PyObject *__pyx_t_9 = NULL;
7022   int __pyx_lineno = 0;
7023   const char *__pyx_filename = NULL;
7024   int __pyx_clineno = 0;
7025   __Pyx_RefNannySetupContext("__pyx_unpickle_IntervalAccumulatingBlockHandler__set_state", 0);
7026 
7027   /* "(tree fragment)":12
7028  *     return __pyx_result
7029  * cdef __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(IntervalAccumulatingBlockHandler __pyx_result, tuple __pyx_state):
7030  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.intervals = __pyx_state[2]; __pyx_result.start = __pyx_state[3]             # <<<<<<<<<<<<<<
7031  *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
7032  *         __pyx_result.__dict__.update(__pyx_state[4])
7033  */
7034   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7035     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7036     __PYX_ERR(1, 12, __pyx_L1_error)
7037   }
7038   __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)
7039   __Pyx_GOTREF(__pyx_t_1);
7040   __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
7041   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7042   __pyx_v___pyx_result->__pyx_base.chrom_id = __pyx_t_2;
7043   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7044     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7045     __PYX_ERR(1, 12, __pyx_L1_error)
7046   }
7047   __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)
7048   __Pyx_GOTREF(__pyx_t_1);
7049   __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
7050   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7051   __pyx_v___pyx_result->__pyx_base.end = __pyx_t_2;
7052   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7053     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7054     __PYX_ERR(1, 12, __pyx_L1_error)
7055   }
7056   __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)
7057   __Pyx_GOTREF(__pyx_t_1);
7058   if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
7059   __Pyx_GIVEREF(__pyx_t_1);
7060   __Pyx_GOTREF(__pyx_v___pyx_result->intervals);
7061   __Pyx_DECREF(__pyx_v___pyx_result->intervals);
7062   __pyx_v___pyx_result->intervals = ((PyObject*)__pyx_t_1);
7063   __pyx_t_1 = 0;
7064   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7065     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7066     __PYX_ERR(1, 12, __pyx_L1_error)
7067   }
7068   __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)
7069   __Pyx_GOTREF(__pyx_t_1);
7070   __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
7071   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7072   __pyx_v___pyx_result->__pyx_base.start = __pyx_t_2;
7073 
7074   /* "(tree fragment)":13
7075  * cdef __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(IntervalAccumulatingBlockHandler __pyx_result, tuple __pyx_state):
7076  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.intervals = __pyx_state[2]; __pyx_result.start = __pyx_state[3]
7077  *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
7078  *         __pyx_result.__dict__.update(__pyx_state[4])
7079  */
7080   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7081     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
7082     __PYX_ERR(1, 13, __pyx_L1_error)
7083   }
7084   __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
7085   __pyx_t_5 = ((__pyx_t_4 > 4) != 0);
7086   if (__pyx_t_5) {
7087   } else {
7088     __pyx_t_3 = __pyx_t_5;
7089     goto __pyx_L4_bool_binop_done;
7090   }
7091   __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
7092   __pyx_t_6 = (__pyx_t_5 != 0);
7093   __pyx_t_3 = __pyx_t_6;
7094   __pyx_L4_bool_binop_done:;
7095   if (__pyx_t_3) {
7096 
7097     /* "(tree fragment)":14
7098  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.intervals = __pyx_state[2]; __pyx_result.start = __pyx_state[3]
7099  *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
7100  *         __pyx_result.__dict__.update(__pyx_state[4])             # <<<<<<<<<<<<<<
7101  */
7102     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
7103     __Pyx_GOTREF(__pyx_t_7);
7104     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
7105     __Pyx_GOTREF(__pyx_t_8);
7106     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7107     if (unlikely(__pyx_v___pyx_state == Py_None)) {
7108       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7109       __PYX_ERR(1, 14, __pyx_L1_error)
7110     }
7111     __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
7112     __Pyx_GOTREF(__pyx_t_7);
7113     __pyx_t_9 = NULL;
7114     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
7115       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
7116       if (likely(__pyx_t_9)) {
7117         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
7118         __Pyx_INCREF(__pyx_t_9);
7119         __Pyx_INCREF(function);
7120         __Pyx_DECREF_SET(__pyx_t_8, function);
7121       }
7122     }
7123     __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
7124     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
7125     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7126     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
7127     __Pyx_GOTREF(__pyx_t_1);
7128     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7129     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7130 
7131     /* "(tree fragment)":13
7132  * cdef __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(IntervalAccumulatingBlockHandler __pyx_result, tuple __pyx_state):
7133  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.intervals = __pyx_state[2]; __pyx_result.start = __pyx_state[3]
7134  *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
7135  *         __pyx_result.__dict__.update(__pyx_state[4])
7136  */
7137   }
7138 
7139   /* "(tree fragment)":11
7140  *         __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(<IntervalAccumulatingBlockHandler> __pyx_result, __pyx_state)
7141  *     return __pyx_result
7142  * cdef __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(IntervalAccumulatingBlockHandler __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
7143  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.intervals = __pyx_state[2]; __pyx_result.start = __pyx_state[3]
7144  *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
7145  */
7146 
7147   /* function exit code */
7148   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7149   goto __pyx_L0;
7150   __pyx_L1_error:;
7151   __Pyx_XDECREF(__pyx_t_1);
7152   __Pyx_XDECREF(__pyx_t_7);
7153   __Pyx_XDECREF(__pyx_t_8);
7154   __Pyx_XDECREF(__pyx_t_9);
7155   __Pyx_AddTraceback("bx.bbi.bigbed_file.__pyx_unpickle_IntervalAccumulatingBlockHandler__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
7156   __pyx_r = 0;
7157   __pyx_L0:;
7158   __Pyx_XGIVEREF(__pyx_r);
7159   __Pyx_RefNannyFinishContext();
7160   return __pyx_r;
7161 }
7162 
7163 /* "(tree fragment)":1
7164  * def __pyx_unpickle_BigBedFile(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
7165  *     cdef object __pyx_PickleError
7166  *     cdef object __pyx_result
7167  */
7168 
7169 /* Python wrapper */
7170 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_7__pyx_unpickle_BigBedFile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7171 static PyMethodDef __pyx_mdef_2bx_3bbi_11bigbed_file_7__pyx_unpickle_BigBedFile = {"__pyx_unpickle_BigBedFile", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_3bbi_11bigbed_file_7__pyx_unpickle_BigBedFile, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2bx_3bbi_11bigbed_file_7__pyx_unpickle_BigBedFile(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)7172 static PyObject *__pyx_pw_2bx_3bbi_11bigbed_file_7__pyx_unpickle_BigBedFile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7173   PyObject *__pyx_v___pyx_type = 0;
7174   long __pyx_v___pyx_checksum;
7175   PyObject *__pyx_v___pyx_state = 0;
7176   int __pyx_lineno = 0;
7177   const char *__pyx_filename = NULL;
7178   int __pyx_clineno = 0;
7179   PyObject *__pyx_r = 0;
7180   __Pyx_RefNannyDeclarations
7181   __Pyx_RefNannySetupContext("__pyx_unpickle_BigBedFile (wrapper)", 0);
7182   {
7183     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
7184     PyObject* values[3] = {0,0,0};
7185     if (unlikely(__pyx_kwds)) {
7186       Py_ssize_t kw_args;
7187       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7188       switch (pos_args) {
7189         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7190         CYTHON_FALLTHROUGH;
7191         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7192         CYTHON_FALLTHROUGH;
7193         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7194         CYTHON_FALLTHROUGH;
7195         case  0: break;
7196         default: goto __pyx_L5_argtuple_error;
7197       }
7198       kw_args = PyDict_Size(__pyx_kwds);
7199       switch (pos_args) {
7200         case  0:
7201         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
7202         else goto __pyx_L5_argtuple_error;
7203         CYTHON_FALLTHROUGH;
7204         case  1:
7205         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
7206         else {
7207           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BigBedFile", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
7208         }
7209         CYTHON_FALLTHROUGH;
7210         case  2:
7211         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
7212         else {
7213           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BigBedFile", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
7214         }
7215       }
7216       if (unlikely(kw_args > 0)) {
7217         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_BigBedFile") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
7218       }
7219     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
7220       goto __pyx_L5_argtuple_error;
7221     } else {
7222       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7223       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7224       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7225     }
7226     __pyx_v___pyx_type = values[0];
7227     __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)
7228     __pyx_v___pyx_state = values[2];
7229   }
7230   goto __pyx_L4_argument_unpacking_done;
7231   __pyx_L5_argtuple_error:;
7232   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BigBedFile", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
7233   __pyx_L3_error:;
7234   __Pyx_AddTraceback("bx.bbi.bigbed_file.__pyx_unpickle_BigBedFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
7235   __Pyx_RefNannyFinishContext();
7236   return NULL;
7237   __pyx_L4_argument_unpacking_done:;
7238   __pyx_r = __pyx_pf_2bx_3bbi_11bigbed_file_6__pyx_unpickle_BigBedFile(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
7239 
7240   /* function exit code */
7241   __Pyx_RefNannyFinishContext();
7242   return __pyx_r;
7243 }
7244 
__pyx_pf_2bx_3bbi_11bigbed_file_6__pyx_unpickle_BigBedFile(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)7245 static PyObject *__pyx_pf_2bx_3bbi_11bigbed_file_6__pyx_unpickle_BigBedFile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
7246   PyObject *__pyx_v___pyx_PickleError = 0;
7247   PyObject *__pyx_v___pyx_result = 0;
7248   PyObject *__pyx_r = NULL;
7249   __Pyx_RefNannyDeclarations
7250   int __pyx_t_1;
7251   PyObject *__pyx_t_2 = NULL;
7252   PyObject *__pyx_t_3 = NULL;
7253   PyObject *__pyx_t_4 = NULL;
7254   PyObject *__pyx_t_5 = NULL;
7255   int __pyx_t_6;
7256   int __pyx_lineno = 0;
7257   const char *__pyx_filename = NULL;
7258   int __pyx_clineno = 0;
7259   __Pyx_RefNannySetupContext("__pyx_unpickle_BigBedFile", 0);
7260 
7261   /* "(tree fragment)":4
7262  *     cdef object __pyx_PickleError
7263  *     cdef object __pyx_result
7264  *     if __pyx_checksum != 0x5566878:             # <<<<<<<<<<<<<<
7265  *         from pickle import PickleError as __pyx_PickleError
7266  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x5566878 = (as_offset, chrom_bpt, chrom_tree_offset, defined_field_count, field_count, file, is_byteswapped, level_list, magic, reader, total_summary_offset, uncompress_buf_size, unzoomed_data_offset, unzoomed_index_offset, version, zoom_levels))" % __pyx_checksum)
7267  */
7268   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x5566878) != 0);
7269   if (__pyx_t_1) {
7270 
7271     /* "(tree fragment)":5
7272  *     cdef object __pyx_result
7273  *     if __pyx_checksum != 0x5566878:
7274  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
7275  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x5566878 = (as_offset, chrom_bpt, chrom_tree_offset, defined_field_count, field_count, file, is_byteswapped, level_list, magic, reader, total_summary_offset, uncompress_buf_size, unzoomed_data_offset, unzoomed_index_offset, version, zoom_levels))" % __pyx_checksum)
7276  *     __pyx_result = BigBedFile.__new__(__pyx_type)
7277  */
7278     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
7279     __Pyx_GOTREF(__pyx_t_2);
7280     __Pyx_INCREF(__pyx_n_s_PickleError);
7281     __Pyx_GIVEREF(__pyx_n_s_PickleError);
7282     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
7283     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
7284     __Pyx_GOTREF(__pyx_t_3);
7285     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7286     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
7287     __Pyx_GOTREF(__pyx_t_2);
7288     __Pyx_INCREF(__pyx_t_2);
7289     __pyx_v___pyx_PickleError = __pyx_t_2;
7290     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7291     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7292 
7293     /* "(tree fragment)":6
7294  *     if __pyx_checksum != 0x5566878:
7295  *         from pickle import PickleError as __pyx_PickleError
7296  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x5566878 = (as_offset, chrom_bpt, chrom_tree_offset, defined_field_count, field_count, file, is_byteswapped, level_list, magic, reader, total_summary_offset, uncompress_buf_size, unzoomed_data_offset, unzoomed_index_offset, version, zoom_levels))" % __pyx_checksum)             # <<<<<<<<<<<<<<
7297  *     __pyx_result = BigBedFile.__new__(__pyx_type)
7298  *     if __pyx_state is not None:
7299  */
7300     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
7301     __Pyx_GOTREF(__pyx_t_2);
7302     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x55, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
7303     __Pyx_GOTREF(__pyx_t_4);
7304     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7305     __Pyx_INCREF(__pyx_v___pyx_PickleError);
7306     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
7307     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
7308       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
7309       if (likely(__pyx_t_5)) {
7310         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7311         __Pyx_INCREF(__pyx_t_5);
7312         __Pyx_INCREF(function);
7313         __Pyx_DECREF_SET(__pyx_t_2, function);
7314       }
7315     }
7316     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
7317     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7318     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7319     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
7320     __Pyx_GOTREF(__pyx_t_3);
7321     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7322     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7323     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7324     __PYX_ERR(1, 6, __pyx_L1_error)
7325 
7326     /* "(tree fragment)":4
7327  *     cdef object __pyx_PickleError
7328  *     cdef object __pyx_result
7329  *     if __pyx_checksum != 0x5566878:             # <<<<<<<<<<<<<<
7330  *         from pickle import PickleError as __pyx_PickleError
7331  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x5566878 = (as_offset, chrom_bpt, chrom_tree_offset, defined_field_count, field_count, file, is_byteswapped, level_list, magic, reader, total_summary_offset, uncompress_buf_size, unzoomed_data_offset, unzoomed_index_offset, version, zoom_levels))" % __pyx_checksum)
7332  */
7333   }
7334 
7335   /* "(tree fragment)":7
7336  *         from pickle import PickleError as __pyx_PickleError
7337  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x5566878 = (as_offset, chrom_bpt, chrom_tree_offset, defined_field_count, field_count, file, is_byteswapped, level_list, magic, reader, total_summary_offset, uncompress_buf_size, unzoomed_data_offset, unzoomed_index_offset, version, zoom_levels))" % __pyx_checksum)
7338  *     __pyx_result = BigBedFile.__new__(__pyx_type)             # <<<<<<<<<<<<<<
7339  *     if __pyx_state is not None:
7340  *         __pyx_unpickle_BigBedFile__set_state(<BigBedFile> __pyx_result, __pyx_state)
7341  */
7342   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_3bbi_11bigbed_file_BigBedFile), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
7343   __Pyx_GOTREF(__pyx_t_2);
7344   __pyx_t_4 = NULL;
7345   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7346     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
7347     if (likely(__pyx_t_4)) {
7348       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7349       __Pyx_INCREF(__pyx_t_4);
7350       __Pyx_INCREF(function);
7351       __Pyx_DECREF_SET(__pyx_t_2, function);
7352     }
7353   }
7354   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
7355   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7356   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
7357   __Pyx_GOTREF(__pyx_t_3);
7358   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7359   __pyx_v___pyx_result = __pyx_t_3;
7360   __pyx_t_3 = 0;
7361 
7362   /* "(tree fragment)":8
7363  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x5566878 = (as_offset, chrom_bpt, chrom_tree_offset, defined_field_count, field_count, file, is_byteswapped, level_list, magic, reader, total_summary_offset, uncompress_buf_size, unzoomed_data_offset, unzoomed_index_offset, version, zoom_levels))" % __pyx_checksum)
7364  *     __pyx_result = BigBedFile.__new__(__pyx_type)
7365  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
7366  *         __pyx_unpickle_BigBedFile__set_state(<BigBedFile> __pyx_result, __pyx_state)
7367  *     return __pyx_result
7368  */
7369   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
7370   __pyx_t_6 = (__pyx_t_1 != 0);
7371   if (__pyx_t_6) {
7372 
7373     /* "(tree fragment)":9
7374  *     __pyx_result = BigBedFile.__new__(__pyx_type)
7375  *     if __pyx_state is not None:
7376  *         __pyx_unpickle_BigBedFile__set_state(<BigBedFile> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
7377  *     return __pyx_result
7378  * cdef __pyx_unpickle_BigBedFile__set_state(BigBedFile __pyx_result, tuple __pyx_state):
7379  */
7380     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
7381     __pyx_t_3 = __pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_BigBedFile__set_state(((struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
7382     __Pyx_GOTREF(__pyx_t_3);
7383     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7384 
7385     /* "(tree fragment)":8
7386  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x5566878 = (as_offset, chrom_bpt, chrom_tree_offset, defined_field_count, field_count, file, is_byteswapped, level_list, magic, reader, total_summary_offset, uncompress_buf_size, unzoomed_data_offset, unzoomed_index_offset, version, zoom_levels))" % __pyx_checksum)
7387  *     __pyx_result = BigBedFile.__new__(__pyx_type)
7388  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
7389  *         __pyx_unpickle_BigBedFile__set_state(<BigBedFile> __pyx_result, __pyx_state)
7390  *     return __pyx_result
7391  */
7392   }
7393 
7394   /* "(tree fragment)":10
7395  *     if __pyx_state is not None:
7396  *         __pyx_unpickle_BigBedFile__set_state(<BigBedFile> __pyx_result, __pyx_state)
7397  *     return __pyx_result             # <<<<<<<<<<<<<<
7398  * cdef __pyx_unpickle_BigBedFile__set_state(BigBedFile __pyx_result, tuple __pyx_state):
7399  *     __pyx_result.as_offset = __pyx_state[0]; __pyx_result.chrom_bpt = __pyx_state[1]; __pyx_result.chrom_tree_offset = __pyx_state[2]; __pyx_result.defined_field_count = __pyx_state[3]; __pyx_result.field_count = __pyx_state[4]; __pyx_result.file = __pyx_state[5]; __pyx_result.is_byteswapped = __pyx_state[6]; __pyx_result.level_list = __pyx_state[7]; __pyx_result.magic = __pyx_state[8]; __pyx_result.reader = __pyx_state[9]; __pyx_result.total_summary_offset = __pyx_state[10]; __pyx_result.uncompress_buf_size = __pyx_state[11]; __pyx_result.unzoomed_data_offset = __pyx_state[12]; __pyx_result.unzoomed_index_offset = __pyx_state[13]; __pyx_result.version = __pyx_state[14]; __pyx_result.zoom_levels = __pyx_state[15]
7400  */
7401   __Pyx_XDECREF(__pyx_r);
7402   __Pyx_INCREF(__pyx_v___pyx_result);
7403   __pyx_r = __pyx_v___pyx_result;
7404   goto __pyx_L0;
7405 
7406   /* "(tree fragment)":1
7407  * def __pyx_unpickle_BigBedFile(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
7408  *     cdef object __pyx_PickleError
7409  *     cdef object __pyx_result
7410  */
7411 
7412   /* function exit code */
7413   __pyx_L1_error:;
7414   __Pyx_XDECREF(__pyx_t_2);
7415   __Pyx_XDECREF(__pyx_t_3);
7416   __Pyx_XDECREF(__pyx_t_4);
7417   __Pyx_XDECREF(__pyx_t_5);
7418   __Pyx_AddTraceback("bx.bbi.bigbed_file.__pyx_unpickle_BigBedFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
7419   __pyx_r = NULL;
7420   __pyx_L0:;
7421   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
7422   __Pyx_XDECREF(__pyx_v___pyx_result);
7423   __Pyx_XGIVEREF(__pyx_r);
7424   __Pyx_RefNannyFinishContext();
7425   return __pyx_r;
7426 }
7427 
7428 /* "(tree fragment)":11
7429  *         __pyx_unpickle_BigBedFile__set_state(<BigBedFile> __pyx_result, __pyx_state)
7430  *     return __pyx_result
7431  * cdef __pyx_unpickle_BigBedFile__set_state(BigBedFile __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
7432  *     __pyx_result.as_offset = __pyx_state[0]; __pyx_result.chrom_bpt = __pyx_state[1]; __pyx_result.chrom_tree_offset = __pyx_state[2]; __pyx_result.defined_field_count = __pyx_state[3]; __pyx_result.field_count = __pyx_state[4]; __pyx_result.file = __pyx_state[5]; __pyx_result.is_byteswapped = __pyx_state[6]; __pyx_result.level_list = __pyx_state[7]; __pyx_result.magic = __pyx_state[8]; __pyx_result.reader = __pyx_state[9]; __pyx_result.total_summary_offset = __pyx_state[10]; __pyx_result.uncompress_buf_size = __pyx_state[11]; __pyx_result.unzoomed_data_offset = __pyx_state[12]; __pyx_result.unzoomed_index_offset = __pyx_state[13]; __pyx_result.version = __pyx_state[14]; __pyx_result.zoom_levels = __pyx_state[15]
7433  *     if len(__pyx_state) > 16 and hasattr(__pyx_result, '__dict__'):
7434  */
7435 
__pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_BigBedFile__set_state(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)7436 static PyObject *__pyx_f_2bx_3bbi_11bigbed_file___pyx_unpickle_BigBedFile__set_state(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
7437   PyObject *__pyx_r = NULL;
7438   __Pyx_RefNannyDeclarations
7439   PyObject *__pyx_t_1 = NULL;
7440   __pyx_t_2bx_3bbi_5types_bits64 __pyx_t_2;
7441   __pyx_t_2bx_3bbi_5types_bits16 __pyx_t_3;
7442   __pyx_t_2bx_3bbi_5types_boolean __pyx_t_4;
7443   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_5;
7444   int __pyx_t_6;
7445   Py_ssize_t __pyx_t_7;
7446   int __pyx_t_8;
7447   int __pyx_t_9;
7448   PyObject *__pyx_t_10 = NULL;
7449   PyObject *__pyx_t_11 = NULL;
7450   PyObject *__pyx_t_12 = NULL;
7451   int __pyx_lineno = 0;
7452   const char *__pyx_filename = NULL;
7453   int __pyx_clineno = 0;
7454   __Pyx_RefNannySetupContext("__pyx_unpickle_BigBedFile__set_state", 0);
7455 
7456   /* "(tree fragment)":12
7457  *     return __pyx_result
7458  * cdef __pyx_unpickle_BigBedFile__set_state(BigBedFile __pyx_result, tuple __pyx_state):
7459  *     __pyx_result.as_offset = __pyx_state[0]; __pyx_result.chrom_bpt = __pyx_state[1]; __pyx_result.chrom_tree_offset = __pyx_state[2]; __pyx_result.defined_field_count = __pyx_state[3]; __pyx_result.field_count = __pyx_state[4]; __pyx_result.file = __pyx_state[5]; __pyx_result.is_byteswapped = __pyx_state[6]; __pyx_result.level_list = __pyx_state[7]; __pyx_result.magic = __pyx_state[8]; __pyx_result.reader = __pyx_state[9]; __pyx_result.total_summary_offset = __pyx_state[10]; __pyx_result.uncompress_buf_size = __pyx_state[11]; __pyx_result.unzoomed_data_offset = __pyx_state[12]; __pyx_result.unzoomed_index_offset = __pyx_state[13]; __pyx_result.version = __pyx_state[14]; __pyx_result.zoom_levels = __pyx_state[15]             # <<<<<<<<<<<<<<
7460  *     if len(__pyx_state) > 16 and hasattr(__pyx_result, '__dict__'):
7461  *         __pyx_result.__dict__.update(__pyx_state[16])
7462  */
7463   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7464     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7465     __PYX_ERR(1, 12, __pyx_L1_error)
7466   }
7467   __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)
7468   __Pyx_GOTREF(__pyx_t_1);
7469   __pyx_t_2 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
7470   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7471   __pyx_v___pyx_result->__pyx_base.as_offset = __pyx_t_2;
7472   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7473     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7474     __PYX_ERR(1, 12, __pyx_L1_error)
7475   }
7476   __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)
7477   __Pyx_GOTREF(__pyx_t_1);
7478   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2bx_3bbi_8bpt_file_BPTFile))))) __PYX_ERR(1, 12, __pyx_L1_error)
7479   __Pyx_GIVEREF(__pyx_t_1);
7480   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.chrom_bpt);
7481   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.chrom_bpt));
7482   __pyx_v___pyx_result->__pyx_base.chrom_bpt = ((struct __pyx_obj_2bx_3bbi_8bpt_file_BPTFile *)__pyx_t_1);
7483   __pyx_t_1 = 0;
7484   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7485     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7486     __PYX_ERR(1, 12, __pyx_L1_error)
7487   }
7488   __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)
7489   __Pyx_GOTREF(__pyx_t_1);
7490   __pyx_t_2 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
7491   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7492   __pyx_v___pyx_result->__pyx_base.chrom_tree_offset = __pyx_t_2;
7493   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7494     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7495     __PYX_ERR(1, 12, __pyx_L1_error)
7496   }
7497   __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)
7498   __Pyx_GOTREF(__pyx_t_1);
7499   __pyx_t_3 = __Pyx_PyInt_As_unsigned_short(__pyx_t_1); if (unlikely((__pyx_t_3 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
7500   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7501   __pyx_v___pyx_result->__pyx_base.defined_field_count = __pyx_t_3;
7502   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7503     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7504     __PYX_ERR(1, 12, __pyx_L1_error)
7505   }
7506   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
7507   __Pyx_GOTREF(__pyx_t_1);
7508   __pyx_t_3 = __Pyx_PyInt_As_unsigned_short(__pyx_t_1); if (unlikely((__pyx_t_3 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
7509   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7510   __pyx_v___pyx_result->__pyx_base.field_count = __pyx_t_3;
7511   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7512     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7513     __PYX_ERR(1, 12, __pyx_L1_error)
7514   }
7515   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
7516   __Pyx_GOTREF(__pyx_t_1);
7517   __Pyx_GIVEREF(__pyx_t_1);
7518   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.file);
7519   __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.file);
7520   __pyx_v___pyx_result->__pyx_base.file = __pyx_t_1;
7521   __pyx_t_1 = 0;
7522   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7523     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7524     __PYX_ERR(1, 12, __pyx_L1_error)
7525   }
7526   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
7527   __Pyx_GOTREF(__pyx_t_1);
7528   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
7529   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7530   __pyx_v___pyx_result->__pyx_base.is_byteswapped = __pyx_t_4;
7531   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7532     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7533     __PYX_ERR(1, 12, __pyx_L1_error)
7534   }
7535   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
7536   __Pyx_GOTREF(__pyx_t_1);
7537   __Pyx_GIVEREF(__pyx_t_1);
7538   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.level_list);
7539   __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.level_list);
7540   __pyx_v___pyx_result->__pyx_base.level_list = __pyx_t_1;
7541   __pyx_t_1 = 0;
7542   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7543     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7544     __PYX_ERR(1, 12, __pyx_L1_error)
7545   }
7546   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
7547   __Pyx_GOTREF(__pyx_t_1);
7548   __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
7549   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7550   __pyx_v___pyx_result->__pyx_base.magic = __pyx_t_5;
7551   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7552     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7553     __PYX_ERR(1, 12, __pyx_L1_error)
7554   }
7555   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
7556   __Pyx_GOTREF(__pyx_t_1);
7557   __Pyx_GIVEREF(__pyx_t_1);
7558   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.reader);
7559   __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.reader);
7560   __pyx_v___pyx_result->__pyx_base.reader = __pyx_t_1;
7561   __pyx_t_1 = 0;
7562   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7563     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7564     __PYX_ERR(1, 12, __pyx_L1_error)
7565   }
7566   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
7567   __Pyx_GOTREF(__pyx_t_1);
7568   __pyx_t_2 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
7569   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7570   __pyx_v___pyx_result->__pyx_base.total_summary_offset = __pyx_t_2;
7571   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7572     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7573     __PYX_ERR(1, 12, __pyx_L1_error)
7574   }
7575   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
7576   __Pyx_GOTREF(__pyx_t_1);
7577   __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
7578   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7579   __pyx_v___pyx_result->__pyx_base.uncompress_buf_size = __pyx_t_5;
7580   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7581     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7582     __PYX_ERR(1, 12, __pyx_L1_error)
7583   }
7584   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
7585   __Pyx_GOTREF(__pyx_t_1);
7586   __pyx_t_2 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
7587   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7588   __pyx_v___pyx_result->__pyx_base.unzoomed_data_offset = __pyx_t_2;
7589   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7590     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7591     __PYX_ERR(1, 12, __pyx_L1_error)
7592   }
7593   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
7594   __Pyx_GOTREF(__pyx_t_1);
7595   __pyx_t_2 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
7596   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7597   __pyx_v___pyx_result->__pyx_base.unzoomed_index_offset = __pyx_t_2;
7598   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7599     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7600     __PYX_ERR(1, 12, __pyx_L1_error)
7601   }
7602   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
7603   __Pyx_GOTREF(__pyx_t_1);
7604   __pyx_t_3 = __Pyx_PyInt_As_unsigned_short(__pyx_t_1); if (unlikely((__pyx_t_3 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
7605   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7606   __pyx_v___pyx_result->__pyx_base.version = __pyx_t_3;
7607   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7608     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7609     __PYX_ERR(1, 12, __pyx_L1_error)
7610   }
7611   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
7612   __Pyx_GOTREF(__pyx_t_1);
7613   __pyx_t_3 = __Pyx_PyInt_As_unsigned_short(__pyx_t_1); if (unlikely((__pyx_t_3 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
7614   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7615   __pyx_v___pyx_result->__pyx_base.zoom_levels = __pyx_t_3;
7616 
7617   /* "(tree fragment)":13
7618  * cdef __pyx_unpickle_BigBedFile__set_state(BigBedFile __pyx_result, tuple __pyx_state):
7619  *     __pyx_result.as_offset = __pyx_state[0]; __pyx_result.chrom_bpt = __pyx_state[1]; __pyx_result.chrom_tree_offset = __pyx_state[2]; __pyx_result.defined_field_count = __pyx_state[3]; __pyx_result.field_count = __pyx_state[4]; __pyx_result.file = __pyx_state[5]; __pyx_result.is_byteswapped = __pyx_state[6]; __pyx_result.level_list = __pyx_state[7]; __pyx_result.magic = __pyx_state[8]; __pyx_result.reader = __pyx_state[9]; __pyx_result.total_summary_offset = __pyx_state[10]; __pyx_result.uncompress_buf_size = __pyx_state[11]; __pyx_result.unzoomed_data_offset = __pyx_state[12]; __pyx_result.unzoomed_index_offset = __pyx_state[13]; __pyx_result.version = __pyx_state[14]; __pyx_result.zoom_levels = __pyx_state[15]
7620  *     if len(__pyx_state) > 16 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
7621  *         __pyx_result.__dict__.update(__pyx_state[16])
7622  */
7623   if (unlikely(__pyx_v___pyx_state == Py_None)) {
7624     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
7625     __PYX_ERR(1, 13, __pyx_L1_error)
7626   }
7627   __pyx_t_7 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
7628   __pyx_t_8 = ((__pyx_t_7 > 16) != 0);
7629   if (__pyx_t_8) {
7630   } else {
7631     __pyx_t_6 = __pyx_t_8;
7632     goto __pyx_L4_bool_binop_done;
7633   }
7634   __pyx_t_8 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
7635   __pyx_t_9 = (__pyx_t_8 != 0);
7636   __pyx_t_6 = __pyx_t_9;
7637   __pyx_L4_bool_binop_done:;
7638   if (__pyx_t_6) {
7639 
7640     /* "(tree fragment)":14
7641  *     __pyx_result.as_offset = __pyx_state[0]; __pyx_result.chrom_bpt = __pyx_state[1]; __pyx_result.chrom_tree_offset = __pyx_state[2]; __pyx_result.defined_field_count = __pyx_state[3]; __pyx_result.field_count = __pyx_state[4]; __pyx_result.file = __pyx_state[5]; __pyx_result.is_byteswapped = __pyx_state[6]; __pyx_result.level_list = __pyx_state[7]; __pyx_result.magic = __pyx_state[8]; __pyx_result.reader = __pyx_state[9]; __pyx_result.total_summary_offset = __pyx_state[10]; __pyx_result.uncompress_buf_size = __pyx_state[11]; __pyx_result.unzoomed_data_offset = __pyx_state[12]; __pyx_result.unzoomed_index_offset = __pyx_state[13]; __pyx_result.version = __pyx_state[14]; __pyx_result.zoom_levels = __pyx_state[15]
7642  *     if len(__pyx_state) > 16 and hasattr(__pyx_result, '__dict__'):
7643  *         __pyx_result.__dict__.update(__pyx_state[16])             # <<<<<<<<<<<<<<
7644  */
7645     __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
7646     __Pyx_GOTREF(__pyx_t_10);
7647     __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_update); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 14, __pyx_L1_error)
7648     __Pyx_GOTREF(__pyx_t_11);
7649     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7650     if (unlikely(__pyx_v___pyx_state == Py_None)) {
7651       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7652       __PYX_ERR(1, 14, __pyx_L1_error)
7653     }
7654     __pyx_t_10 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
7655     __Pyx_GOTREF(__pyx_t_10);
7656     __pyx_t_12 = NULL;
7657     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
7658       __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
7659       if (likely(__pyx_t_12)) {
7660         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
7661         __Pyx_INCREF(__pyx_t_12);
7662         __Pyx_INCREF(function);
7663         __Pyx_DECREF_SET(__pyx_t_11, function);
7664       }
7665     }
7666     __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10);
7667     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7668     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7669     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
7670     __Pyx_GOTREF(__pyx_t_1);
7671     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7672     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7673 
7674     /* "(tree fragment)":13
7675  * cdef __pyx_unpickle_BigBedFile__set_state(BigBedFile __pyx_result, tuple __pyx_state):
7676  *     __pyx_result.as_offset = __pyx_state[0]; __pyx_result.chrom_bpt = __pyx_state[1]; __pyx_result.chrom_tree_offset = __pyx_state[2]; __pyx_result.defined_field_count = __pyx_state[3]; __pyx_result.field_count = __pyx_state[4]; __pyx_result.file = __pyx_state[5]; __pyx_result.is_byteswapped = __pyx_state[6]; __pyx_result.level_list = __pyx_state[7]; __pyx_result.magic = __pyx_state[8]; __pyx_result.reader = __pyx_state[9]; __pyx_result.total_summary_offset = __pyx_state[10]; __pyx_result.uncompress_buf_size = __pyx_state[11]; __pyx_result.unzoomed_data_offset = __pyx_state[12]; __pyx_result.unzoomed_index_offset = __pyx_state[13]; __pyx_result.version = __pyx_state[14]; __pyx_result.zoom_levels = __pyx_state[15]
7677  *     if len(__pyx_state) > 16 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
7678  *         __pyx_result.__dict__.update(__pyx_state[16])
7679  */
7680   }
7681 
7682   /* "(tree fragment)":11
7683  *         __pyx_unpickle_BigBedFile__set_state(<BigBedFile> __pyx_result, __pyx_state)
7684  *     return __pyx_result
7685  * cdef __pyx_unpickle_BigBedFile__set_state(BigBedFile __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
7686  *     __pyx_result.as_offset = __pyx_state[0]; __pyx_result.chrom_bpt = __pyx_state[1]; __pyx_result.chrom_tree_offset = __pyx_state[2]; __pyx_result.defined_field_count = __pyx_state[3]; __pyx_result.field_count = __pyx_state[4]; __pyx_result.file = __pyx_state[5]; __pyx_result.is_byteswapped = __pyx_state[6]; __pyx_result.level_list = __pyx_state[7]; __pyx_result.magic = __pyx_state[8]; __pyx_result.reader = __pyx_state[9]; __pyx_result.total_summary_offset = __pyx_state[10]; __pyx_result.uncompress_buf_size = __pyx_state[11]; __pyx_result.unzoomed_data_offset = __pyx_state[12]; __pyx_result.unzoomed_index_offset = __pyx_state[13]; __pyx_result.version = __pyx_state[14]; __pyx_result.zoom_levels = __pyx_state[15]
7687  *     if len(__pyx_state) > 16 and hasattr(__pyx_result, '__dict__'):
7688  */
7689 
7690   /* function exit code */
7691   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7692   goto __pyx_L0;
7693   __pyx_L1_error:;
7694   __Pyx_XDECREF(__pyx_t_1);
7695   __Pyx_XDECREF(__pyx_t_10);
7696   __Pyx_XDECREF(__pyx_t_11);
7697   __Pyx_XDECREF(__pyx_t_12);
7698   __Pyx_AddTraceback("bx.bbi.bigbed_file.__pyx_unpickle_BigBedFile__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
7699   __pyx_r = 0;
7700   __pyx_L0:;
7701   __Pyx_XGIVEREF(__pyx_r);
7702   __Pyx_RefNannyFinishContext();
7703   return __pyx_r;
7704 }
7705 
7706 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":735
7707  * ctypedef npy_cdouble     complex_t
7708  *
7709  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
7710  *     return PyArray_MultiIterNew(1, <void*>a)
7711  *
7712  */
7713 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)7714 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7715   PyObject *__pyx_r = NULL;
7716   __Pyx_RefNannyDeclarations
7717   PyObject *__pyx_t_1 = NULL;
7718   int __pyx_lineno = 0;
7719   const char *__pyx_filename = NULL;
7720   int __pyx_clineno = 0;
7721   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
7722 
7723   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":736
7724  *
7725  * cdef inline object PyArray_MultiIterNew1(a):
7726  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
7727  *
7728  * cdef inline object PyArray_MultiIterNew2(a, b):
7729  */
7730   __Pyx_XDECREF(__pyx_r);
7731   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
7732   __Pyx_GOTREF(__pyx_t_1);
7733   __pyx_r = __pyx_t_1;
7734   __pyx_t_1 = 0;
7735   goto __pyx_L0;
7736 
7737   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":735
7738  * ctypedef npy_cdouble     complex_t
7739  *
7740  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
7741  *     return PyArray_MultiIterNew(1, <void*>a)
7742  *
7743  */
7744 
7745   /* function exit code */
7746   __pyx_L1_error:;
7747   __Pyx_XDECREF(__pyx_t_1);
7748   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7749   __pyx_r = 0;
7750   __pyx_L0:;
7751   __Pyx_XGIVEREF(__pyx_r);
7752   __Pyx_RefNannyFinishContext();
7753   return __pyx_r;
7754 }
7755 
7756 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":738
7757  *     return PyArray_MultiIterNew(1, <void*>a)
7758  *
7759  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
7760  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7761  *
7762  */
7763 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)7764 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7765   PyObject *__pyx_r = NULL;
7766   __Pyx_RefNannyDeclarations
7767   PyObject *__pyx_t_1 = NULL;
7768   int __pyx_lineno = 0;
7769   const char *__pyx_filename = NULL;
7770   int __pyx_clineno = 0;
7771   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
7772 
7773   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":739
7774  *
7775  * cdef inline object PyArray_MultiIterNew2(a, b):
7776  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
7777  *
7778  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7779  */
7780   __Pyx_XDECREF(__pyx_r);
7781   __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error)
7782   __Pyx_GOTREF(__pyx_t_1);
7783   __pyx_r = __pyx_t_1;
7784   __pyx_t_1 = 0;
7785   goto __pyx_L0;
7786 
7787   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":738
7788  *     return PyArray_MultiIterNew(1, <void*>a)
7789  *
7790  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
7791  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7792  *
7793  */
7794 
7795   /* function exit code */
7796   __pyx_L1_error:;
7797   __Pyx_XDECREF(__pyx_t_1);
7798   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7799   __pyx_r = 0;
7800   __pyx_L0:;
7801   __Pyx_XGIVEREF(__pyx_r);
7802   __Pyx_RefNannyFinishContext();
7803   return __pyx_r;
7804 }
7805 
7806 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":741
7807  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7808  *
7809  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
7810  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7811  *
7812  */
7813 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)7814 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7815   PyObject *__pyx_r = NULL;
7816   __Pyx_RefNannyDeclarations
7817   PyObject *__pyx_t_1 = NULL;
7818   int __pyx_lineno = 0;
7819   const char *__pyx_filename = NULL;
7820   int __pyx_clineno = 0;
7821   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
7822 
7823   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":742
7824  *
7825  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7826  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
7827  *
7828  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7829  */
7830   __Pyx_XDECREF(__pyx_r);
7831   __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error)
7832   __Pyx_GOTREF(__pyx_t_1);
7833   __pyx_r = __pyx_t_1;
7834   __pyx_t_1 = 0;
7835   goto __pyx_L0;
7836 
7837   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":741
7838  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7839  *
7840  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
7841  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7842  *
7843  */
7844 
7845   /* function exit code */
7846   __pyx_L1_error:;
7847   __Pyx_XDECREF(__pyx_t_1);
7848   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7849   __pyx_r = 0;
7850   __pyx_L0:;
7851   __Pyx_XGIVEREF(__pyx_r);
7852   __Pyx_RefNannyFinishContext();
7853   return __pyx_r;
7854 }
7855 
7856 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":744
7857  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7858  *
7859  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
7860  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7861  *
7862  */
7863 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)7864 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
7865   PyObject *__pyx_r = NULL;
7866   __Pyx_RefNannyDeclarations
7867   PyObject *__pyx_t_1 = NULL;
7868   int __pyx_lineno = 0;
7869   const char *__pyx_filename = NULL;
7870   int __pyx_clineno = 0;
7871   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
7872 
7873   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":745
7874  *
7875  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7876  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
7877  *
7878  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7879  */
7880   __Pyx_XDECREF(__pyx_r);
7881   __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error)
7882   __Pyx_GOTREF(__pyx_t_1);
7883   __pyx_r = __pyx_t_1;
7884   __pyx_t_1 = 0;
7885   goto __pyx_L0;
7886 
7887   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":744
7888  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7889  *
7890  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
7891  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7892  *
7893  */
7894 
7895   /* function exit code */
7896   __pyx_L1_error:;
7897   __Pyx_XDECREF(__pyx_t_1);
7898   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7899   __pyx_r = 0;
7900   __pyx_L0:;
7901   __Pyx_XGIVEREF(__pyx_r);
7902   __Pyx_RefNannyFinishContext();
7903   return __pyx_r;
7904 }
7905 
7906 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":747
7907  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7908  *
7909  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
7910  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7911  *
7912  */
7913 
__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d,PyObject * __pyx_v_e)7914 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7915   PyObject *__pyx_r = NULL;
7916   __Pyx_RefNannyDeclarations
7917   PyObject *__pyx_t_1 = NULL;
7918   int __pyx_lineno = 0;
7919   const char *__pyx_filename = NULL;
7920   int __pyx_clineno = 0;
7921   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
7922 
7923   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":748
7924  *
7925  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7926  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
7927  *
7928  * cdef inline tuple PyDataType_SHAPE(dtype d):
7929  */
7930   __Pyx_XDECREF(__pyx_r);
7931   __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error)
7932   __Pyx_GOTREF(__pyx_t_1);
7933   __pyx_r = __pyx_t_1;
7934   __pyx_t_1 = 0;
7935   goto __pyx_L0;
7936 
7937   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":747
7938  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7939  *
7940  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
7941  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7942  *
7943  */
7944 
7945   /* function exit code */
7946   __pyx_L1_error:;
7947   __Pyx_XDECREF(__pyx_t_1);
7948   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7949   __pyx_r = 0;
7950   __pyx_L0:;
7951   __Pyx_XGIVEREF(__pyx_r);
7952   __Pyx_RefNannyFinishContext();
7953   return __pyx_r;
7954 }
7955 
7956 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":750
7957  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7958  *
7959  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
7960  *     if PyDataType_HASSUBARRAY(d):
7961  *         return <tuple>d.subarray.shape
7962  */
7963 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)7964 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7965   PyObject *__pyx_r = NULL;
7966   __Pyx_RefNannyDeclarations
7967   int __pyx_t_1;
7968   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
7969 
7970   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":751
7971  *
7972  * cdef inline tuple PyDataType_SHAPE(dtype d):
7973  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
7974  *         return <tuple>d.subarray.shape
7975  *     else:
7976  */
7977   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7978   if (__pyx_t_1) {
7979 
7980     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":752
7981  * cdef inline tuple PyDataType_SHAPE(dtype d):
7982  *     if PyDataType_HASSUBARRAY(d):
7983  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
7984  *     else:
7985  *         return ()
7986  */
7987     __Pyx_XDECREF(__pyx_r);
7988     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7989     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7990     goto __pyx_L0;
7991 
7992     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":751
7993  *
7994  * cdef inline tuple PyDataType_SHAPE(dtype d):
7995  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
7996  *         return <tuple>d.subarray.shape
7997  *     else:
7998  */
7999   }
8000 
8001   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":754
8002  *         return <tuple>d.subarray.shape
8003  *     else:
8004  *         return ()             # <<<<<<<<<<<<<<
8005  *
8006  *
8007  */
8008   /*else*/ {
8009     __Pyx_XDECREF(__pyx_r);
8010     __Pyx_INCREF(__pyx_empty_tuple);
8011     __pyx_r = __pyx_empty_tuple;
8012     goto __pyx_L0;
8013   }
8014 
8015   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":750
8016  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
8017  *
8018  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
8019  *     if PyDataType_HASSUBARRAY(d):
8020  *         return <tuple>d.subarray.shape
8021  */
8022 
8023   /* function exit code */
8024   __pyx_L0:;
8025   __Pyx_XGIVEREF(__pyx_r);
8026   __Pyx_RefNannyFinishContext();
8027   return __pyx_r;
8028 }
8029 
8030 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":929
8031  *     int _import_umath() except -1
8032  *
8033  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
8034  *     Py_INCREF(base) # important to do this before stealing the reference below!
8035  *     PyArray_SetBaseObject(arr, base)
8036  */
8037 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)8038 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
8039   __Pyx_RefNannyDeclarations
8040   __Pyx_RefNannySetupContext("set_array_base", 0);
8041 
8042   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":930
8043  *
8044  * cdef inline void set_array_base(ndarray arr, object base):
8045  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
8046  *     PyArray_SetBaseObject(arr, base)
8047  *
8048  */
8049   Py_INCREF(__pyx_v_base);
8050 
8051   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":931
8052  * cdef inline void set_array_base(ndarray arr, object base):
8053  *     Py_INCREF(base) # important to do this before stealing the reference below!
8054  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
8055  *
8056  * cdef inline object get_array_base(ndarray arr):
8057  */
8058   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
8059 
8060   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":929
8061  *     int _import_umath() except -1
8062  *
8063  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
8064  *     Py_INCREF(base) # important to do this before stealing the reference below!
8065  *     PyArray_SetBaseObject(arr, base)
8066  */
8067 
8068   /* function exit code */
8069   __Pyx_RefNannyFinishContext();
8070 }
8071 
8072 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":933
8073  *     PyArray_SetBaseObject(arr, base)
8074  *
8075  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
8076  *     base = PyArray_BASE(arr)
8077  *     if base is NULL:
8078  */
8079 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)8080 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
8081   PyObject *__pyx_v_base;
8082   PyObject *__pyx_r = NULL;
8083   __Pyx_RefNannyDeclarations
8084   int __pyx_t_1;
8085   __Pyx_RefNannySetupContext("get_array_base", 0);
8086 
8087   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":934
8088  *
8089  * cdef inline object get_array_base(ndarray arr):
8090  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
8091  *     if base is NULL:
8092  *         return None
8093  */
8094   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
8095 
8096   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":935
8097  * cdef inline object get_array_base(ndarray arr):
8098  *     base = PyArray_BASE(arr)
8099  *     if base is NULL:             # <<<<<<<<<<<<<<
8100  *         return None
8101  *     return <object>base
8102  */
8103   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
8104   if (__pyx_t_1) {
8105 
8106     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":936
8107  *     base = PyArray_BASE(arr)
8108  *     if base is NULL:
8109  *         return None             # <<<<<<<<<<<<<<
8110  *     return <object>base
8111  *
8112  */
8113     __Pyx_XDECREF(__pyx_r);
8114     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8115     goto __pyx_L0;
8116 
8117     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":935
8118  * cdef inline object get_array_base(ndarray arr):
8119  *     base = PyArray_BASE(arr)
8120  *     if base is NULL:             # <<<<<<<<<<<<<<
8121  *         return None
8122  *     return <object>base
8123  */
8124   }
8125 
8126   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":937
8127  *     if base is NULL:
8128  *         return None
8129  *     return <object>base             # <<<<<<<<<<<<<<
8130  *
8131  * # Versions of the import_* functions which are more suitable for
8132  */
8133   __Pyx_XDECREF(__pyx_r);
8134   __Pyx_INCREF(((PyObject *)__pyx_v_base));
8135   __pyx_r = ((PyObject *)__pyx_v_base);
8136   goto __pyx_L0;
8137 
8138   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":933
8139  *     PyArray_SetBaseObject(arr, base)
8140  *
8141  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
8142  *     base = PyArray_BASE(arr)
8143  *     if base is NULL:
8144  */
8145 
8146   /* function exit code */
8147   __pyx_L0:;
8148   __Pyx_XGIVEREF(__pyx_r);
8149   __Pyx_RefNannyFinishContext();
8150   return __pyx_r;
8151 }
8152 
8153 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":941
8154  * # Versions of the import_* functions which are more suitable for
8155  * # Cython code.
8156  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
8157  *     try:
8158  *         __pyx_import_array()
8159  */
8160 
__pyx_f_5numpy_import_array(void)8161 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
8162   int __pyx_r;
8163   __Pyx_RefNannyDeclarations
8164   PyObject *__pyx_t_1 = NULL;
8165   PyObject *__pyx_t_2 = NULL;
8166   PyObject *__pyx_t_3 = NULL;
8167   int __pyx_t_4;
8168   PyObject *__pyx_t_5 = NULL;
8169   PyObject *__pyx_t_6 = NULL;
8170   PyObject *__pyx_t_7 = NULL;
8171   PyObject *__pyx_t_8 = NULL;
8172   int __pyx_lineno = 0;
8173   const char *__pyx_filename = NULL;
8174   int __pyx_clineno = 0;
8175   __Pyx_RefNannySetupContext("import_array", 0);
8176 
8177   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":942
8178  * # Cython code.
8179  * cdef inline int import_array() except -1:
8180  *     try:             # <<<<<<<<<<<<<<
8181  *         __pyx_import_array()
8182  *     except Exception:
8183  */
8184   {
8185     __Pyx_PyThreadState_declare
8186     __Pyx_PyThreadState_assign
8187     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8188     __Pyx_XGOTREF(__pyx_t_1);
8189     __Pyx_XGOTREF(__pyx_t_2);
8190     __Pyx_XGOTREF(__pyx_t_3);
8191     /*try:*/ {
8192 
8193       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":943
8194  * cdef inline int import_array() except -1:
8195  *     try:
8196  *         __pyx_import_array()             # <<<<<<<<<<<<<<
8197  *     except Exception:
8198  *         raise ImportError("numpy.core.multiarray failed to import")
8199  */
8200       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
8201 
8202       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":942
8203  * # Cython code.
8204  * cdef inline int import_array() except -1:
8205  *     try:             # <<<<<<<<<<<<<<
8206  *         __pyx_import_array()
8207  *     except Exception:
8208  */
8209     }
8210     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8211     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8212     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8213     goto __pyx_L8_try_end;
8214     __pyx_L3_error:;
8215 
8216     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":944
8217  *     try:
8218  *         __pyx_import_array()
8219  *     except Exception:             # <<<<<<<<<<<<<<
8220  *         raise ImportError("numpy.core.multiarray failed to import")
8221  *
8222  */
8223     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8224     if (__pyx_t_4) {
8225       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8226       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
8227       __Pyx_GOTREF(__pyx_t_5);
8228       __Pyx_GOTREF(__pyx_t_6);
8229       __Pyx_GOTREF(__pyx_t_7);
8230 
8231       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":945
8232  *         __pyx_import_array()
8233  *     except Exception:
8234  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
8235  *
8236  * cdef inline int import_umath() except -1:
8237  */
8238       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
8239       __Pyx_GOTREF(__pyx_t_8);
8240       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8241       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8242       __PYX_ERR(2, 945, __pyx_L5_except_error)
8243     }
8244     goto __pyx_L5_except_error;
8245     __pyx_L5_except_error:;
8246 
8247     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":942
8248  * # Cython code.
8249  * cdef inline int import_array() except -1:
8250  *     try:             # <<<<<<<<<<<<<<
8251  *         __pyx_import_array()
8252  *     except Exception:
8253  */
8254     __Pyx_XGIVEREF(__pyx_t_1);
8255     __Pyx_XGIVEREF(__pyx_t_2);
8256     __Pyx_XGIVEREF(__pyx_t_3);
8257     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8258     goto __pyx_L1_error;
8259     __pyx_L8_try_end:;
8260   }
8261 
8262   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":941
8263  * # Versions of the import_* functions which are more suitable for
8264  * # Cython code.
8265  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
8266  *     try:
8267  *         __pyx_import_array()
8268  */
8269 
8270   /* function exit code */
8271   __pyx_r = 0;
8272   goto __pyx_L0;
8273   __pyx_L1_error:;
8274   __Pyx_XDECREF(__pyx_t_5);
8275   __Pyx_XDECREF(__pyx_t_6);
8276   __Pyx_XDECREF(__pyx_t_7);
8277   __Pyx_XDECREF(__pyx_t_8);
8278   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8279   __pyx_r = -1;
8280   __pyx_L0:;
8281   __Pyx_RefNannyFinishContext();
8282   return __pyx_r;
8283 }
8284 
8285 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":947
8286  *         raise ImportError("numpy.core.multiarray failed to import")
8287  *
8288  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
8289  *     try:
8290  *         _import_umath()
8291  */
8292 
__pyx_f_5numpy_import_umath(void)8293 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
8294   int __pyx_r;
8295   __Pyx_RefNannyDeclarations
8296   PyObject *__pyx_t_1 = NULL;
8297   PyObject *__pyx_t_2 = NULL;
8298   PyObject *__pyx_t_3 = NULL;
8299   int __pyx_t_4;
8300   PyObject *__pyx_t_5 = NULL;
8301   PyObject *__pyx_t_6 = NULL;
8302   PyObject *__pyx_t_7 = NULL;
8303   PyObject *__pyx_t_8 = NULL;
8304   int __pyx_lineno = 0;
8305   const char *__pyx_filename = NULL;
8306   int __pyx_clineno = 0;
8307   __Pyx_RefNannySetupContext("import_umath", 0);
8308 
8309   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":948
8310  *
8311  * cdef inline int import_umath() except -1:
8312  *     try:             # <<<<<<<<<<<<<<
8313  *         _import_umath()
8314  *     except Exception:
8315  */
8316   {
8317     __Pyx_PyThreadState_declare
8318     __Pyx_PyThreadState_assign
8319     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8320     __Pyx_XGOTREF(__pyx_t_1);
8321     __Pyx_XGOTREF(__pyx_t_2);
8322     __Pyx_XGOTREF(__pyx_t_3);
8323     /*try:*/ {
8324 
8325       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":949
8326  * cdef inline int import_umath() except -1:
8327  *     try:
8328  *         _import_umath()             # <<<<<<<<<<<<<<
8329  *     except Exception:
8330  *         raise ImportError("numpy.core.umath failed to import")
8331  */
8332       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
8333 
8334       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":948
8335  *
8336  * cdef inline int import_umath() except -1:
8337  *     try:             # <<<<<<<<<<<<<<
8338  *         _import_umath()
8339  *     except Exception:
8340  */
8341     }
8342     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8343     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8344     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8345     goto __pyx_L8_try_end;
8346     __pyx_L3_error:;
8347 
8348     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":950
8349  *     try:
8350  *         _import_umath()
8351  *     except Exception:             # <<<<<<<<<<<<<<
8352  *         raise ImportError("numpy.core.umath failed to import")
8353  *
8354  */
8355     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8356     if (__pyx_t_4) {
8357       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8358       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
8359       __Pyx_GOTREF(__pyx_t_5);
8360       __Pyx_GOTREF(__pyx_t_6);
8361       __Pyx_GOTREF(__pyx_t_7);
8362 
8363       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":951
8364  *         _import_umath()
8365  *     except Exception:
8366  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
8367  *
8368  * cdef inline int import_ufunc() except -1:
8369  */
8370       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
8371       __Pyx_GOTREF(__pyx_t_8);
8372       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8373       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8374       __PYX_ERR(2, 951, __pyx_L5_except_error)
8375     }
8376     goto __pyx_L5_except_error;
8377     __pyx_L5_except_error:;
8378 
8379     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":948
8380  *
8381  * cdef inline int import_umath() except -1:
8382  *     try:             # <<<<<<<<<<<<<<
8383  *         _import_umath()
8384  *     except Exception:
8385  */
8386     __Pyx_XGIVEREF(__pyx_t_1);
8387     __Pyx_XGIVEREF(__pyx_t_2);
8388     __Pyx_XGIVEREF(__pyx_t_3);
8389     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8390     goto __pyx_L1_error;
8391     __pyx_L8_try_end:;
8392   }
8393 
8394   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":947
8395  *         raise ImportError("numpy.core.multiarray failed to import")
8396  *
8397  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
8398  *     try:
8399  *         _import_umath()
8400  */
8401 
8402   /* function exit code */
8403   __pyx_r = 0;
8404   goto __pyx_L0;
8405   __pyx_L1_error:;
8406   __Pyx_XDECREF(__pyx_t_5);
8407   __Pyx_XDECREF(__pyx_t_6);
8408   __Pyx_XDECREF(__pyx_t_7);
8409   __Pyx_XDECREF(__pyx_t_8);
8410   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8411   __pyx_r = -1;
8412   __pyx_L0:;
8413   __Pyx_RefNannyFinishContext();
8414   return __pyx_r;
8415 }
8416 
8417 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":953
8418  *         raise ImportError("numpy.core.umath failed to import")
8419  *
8420  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
8421  *     try:
8422  *         _import_umath()
8423  */
8424 
__pyx_f_5numpy_import_ufunc(void)8425 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
8426   int __pyx_r;
8427   __Pyx_RefNannyDeclarations
8428   PyObject *__pyx_t_1 = NULL;
8429   PyObject *__pyx_t_2 = NULL;
8430   PyObject *__pyx_t_3 = NULL;
8431   int __pyx_t_4;
8432   PyObject *__pyx_t_5 = NULL;
8433   PyObject *__pyx_t_6 = NULL;
8434   PyObject *__pyx_t_7 = NULL;
8435   PyObject *__pyx_t_8 = NULL;
8436   int __pyx_lineno = 0;
8437   const char *__pyx_filename = NULL;
8438   int __pyx_clineno = 0;
8439   __Pyx_RefNannySetupContext("import_ufunc", 0);
8440 
8441   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":954
8442  *
8443  * cdef inline int import_ufunc() except -1:
8444  *     try:             # <<<<<<<<<<<<<<
8445  *         _import_umath()
8446  *     except Exception:
8447  */
8448   {
8449     __Pyx_PyThreadState_declare
8450     __Pyx_PyThreadState_assign
8451     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8452     __Pyx_XGOTREF(__pyx_t_1);
8453     __Pyx_XGOTREF(__pyx_t_2);
8454     __Pyx_XGOTREF(__pyx_t_3);
8455     /*try:*/ {
8456 
8457       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":955
8458  * cdef inline int import_ufunc() except -1:
8459  *     try:
8460  *         _import_umath()             # <<<<<<<<<<<<<<
8461  *     except Exception:
8462  *         raise ImportError("numpy.core.umath failed to import")
8463  */
8464       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
8465 
8466       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":954
8467  *
8468  * cdef inline int import_ufunc() except -1:
8469  *     try:             # <<<<<<<<<<<<<<
8470  *         _import_umath()
8471  *     except Exception:
8472  */
8473     }
8474     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8475     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8476     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8477     goto __pyx_L8_try_end;
8478     __pyx_L3_error:;
8479 
8480     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":956
8481  *     try:
8482  *         _import_umath()
8483  *     except Exception:             # <<<<<<<<<<<<<<
8484  *         raise ImportError("numpy.core.umath failed to import")
8485  *
8486  */
8487     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8488     if (__pyx_t_4) {
8489       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8490       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
8491       __Pyx_GOTREF(__pyx_t_5);
8492       __Pyx_GOTREF(__pyx_t_6);
8493       __Pyx_GOTREF(__pyx_t_7);
8494 
8495       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":957
8496  *         _import_umath()
8497  *     except Exception:
8498  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
8499  *
8500  * cdef extern from *:
8501  */
8502       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
8503       __Pyx_GOTREF(__pyx_t_8);
8504       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8505       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8506       __PYX_ERR(2, 957, __pyx_L5_except_error)
8507     }
8508     goto __pyx_L5_except_error;
8509     __pyx_L5_except_error:;
8510 
8511     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":954
8512  *
8513  * cdef inline int import_ufunc() except -1:
8514  *     try:             # <<<<<<<<<<<<<<
8515  *         _import_umath()
8516  *     except Exception:
8517  */
8518     __Pyx_XGIVEREF(__pyx_t_1);
8519     __Pyx_XGIVEREF(__pyx_t_2);
8520     __Pyx_XGIVEREF(__pyx_t_3);
8521     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8522     goto __pyx_L1_error;
8523     __pyx_L8_try_end:;
8524   }
8525 
8526   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":953
8527  *         raise ImportError("numpy.core.umath failed to import")
8528  *
8529  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
8530  *     try:
8531  *         _import_umath()
8532  */
8533 
8534   /* function exit code */
8535   __pyx_r = 0;
8536   goto __pyx_L0;
8537   __pyx_L1_error:;
8538   __Pyx_XDECREF(__pyx_t_5);
8539   __Pyx_XDECREF(__pyx_t_6);
8540   __Pyx_XDECREF(__pyx_t_7);
8541   __Pyx_XDECREF(__pyx_t_8);
8542   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8543   __pyx_r = -1;
8544   __pyx_L0:;
8545   __Pyx_RefNannyFinishContext();
8546   return __pyx_r;
8547 }
8548 
8549 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":967
8550  *
8551  *
8552  * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
8553  *     """
8554  *     Cython equivalent of `isinstance(obj, np.timedelta64)`
8555  */
8556 
__pyx_f_5numpy_is_timedelta64_object(PyObject * __pyx_v_obj)8557 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
8558   int __pyx_r;
8559   __Pyx_RefNannyDeclarations
8560   __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
8561 
8562   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":979
8563  *     bool
8564  *     """
8565  *     return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type)             # <<<<<<<<<<<<<<
8566  *
8567  *
8568  */
8569   __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
8570   goto __pyx_L0;
8571 
8572   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":967
8573  *
8574  *
8575  * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
8576  *     """
8577  *     Cython equivalent of `isinstance(obj, np.timedelta64)`
8578  */
8579 
8580   /* function exit code */
8581   __pyx_L0:;
8582   __Pyx_RefNannyFinishContext();
8583   return __pyx_r;
8584 }
8585 
8586 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":982
8587  *
8588  *
8589  * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
8590  *     """
8591  *     Cython equivalent of `isinstance(obj, np.datetime64)`
8592  */
8593 
__pyx_f_5numpy_is_datetime64_object(PyObject * __pyx_v_obj)8594 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
8595   int __pyx_r;
8596   __Pyx_RefNannyDeclarations
8597   __Pyx_RefNannySetupContext("is_datetime64_object", 0);
8598 
8599   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":994
8600  *     bool
8601  *     """
8602  *     return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type)             # <<<<<<<<<<<<<<
8603  *
8604  *
8605  */
8606   __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
8607   goto __pyx_L0;
8608 
8609   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":982
8610  *
8611  *
8612  * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
8613  *     """
8614  *     Cython equivalent of `isinstance(obj, np.datetime64)`
8615  */
8616 
8617   /* function exit code */
8618   __pyx_L0:;
8619   __Pyx_RefNannyFinishContext();
8620   return __pyx_r;
8621 }
8622 
8623 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":997
8624  *
8625  *
8626  * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
8627  *     """
8628  *     returns the int64 value underlying scalar numpy datetime64 object
8629  */
8630 
__pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_v_obj)8631 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
8632   npy_datetime __pyx_r;
8633 
8634   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1004
8635  *     also needed.  That can be found using `get_datetime64_unit`.
8636  *     """
8637  *     return (<PyDatetimeScalarObject*>obj).obval             # <<<<<<<<<<<<<<
8638  *
8639  *
8640  */
8641   __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
8642   goto __pyx_L0;
8643 
8644   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":997
8645  *
8646  *
8647  * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
8648  *     """
8649  *     returns the int64 value underlying scalar numpy datetime64 object
8650  */
8651 
8652   /* function exit code */
8653   __pyx_L0:;
8654   return __pyx_r;
8655 }
8656 
8657 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1007
8658  *
8659  *
8660  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
8661  *     """
8662  *     returns the int64 value underlying scalar numpy timedelta64 object
8663  */
8664 
__pyx_f_5numpy_get_timedelta64_value(PyObject * __pyx_v_obj)8665 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
8666   npy_timedelta __pyx_r;
8667 
8668   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1011
8669  *     returns the int64 value underlying scalar numpy timedelta64 object
8670  *     """
8671  *     return (<PyTimedeltaScalarObject*>obj).obval             # <<<<<<<<<<<<<<
8672  *
8673  *
8674  */
8675   __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
8676   goto __pyx_L0;
8677 
8678   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1007
8679  *
8680  *
8681  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
8682  *     """
8683  *     returns the int64 value underlying scalar numpy timedelta64 object
8684  */
8685 
8686   /* function exit code */
8687   __pyx_L0:;
8688   return __pyx_r;
8689 }
8690 
8691 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1014
8692  *
8693  *
8694  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
8695  *     """
8696  *     returns the unit part of the dtype for a numpy datetime64 object.
8697  */
8698 
__pyx_f_5numpy_get_datetime64_unit(PyObject * __pyx_v_obj)8699 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
8700   NPY_DATETIMEUNIT __pyx_r;
8701 
8702   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1018
8703  *     returns the unit part of the dtype for a numpy datetime64 object.
8704  *     """
8705  *     return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base             # <<<<<<<<<<<<<<
8706  */
8707   __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
8708   goto __pyx_L0;
8709 
8710   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1014
8711  *
8712  *
8713  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
8714  *     """
8715  *     returns the unit part of the dtype for a numpy datetime64 object.
8716  */
8717 
8718   /* function exit code */
8719   __pyx_L0:;
8720   return __pyx_r;
8721 }
8722 static struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_BigBedBlockHandler __pyx_vtable_2bx_3bbi_11bigbed_file_BigBedBlockHandler;
8723 
__pyx_tp_new_2bx_3bbi_11bigbed_file_BigBedBlockHandler(PyTypeObject * t,PyObject * a,PyObject * k)8724 static PyObject *__pyx_tp_new_2bx_3bbi_11bigbed_file_BigBedBlockHandler(PyTypeObject *t, PyObject *a, PyObject *k) {
8725   struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *p;
8726   PyObject *o = __pyx_ptype_2bx_3bbi_8bbi_file_BlockHandler->tp_new(t, a, k);
8727   if (unlikely(!o)) return 0;
8728   p = ((struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *)o);
8729   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BlockHandler*)__pyx_vtabptr_2bx_3bbi_11bigbed_file_BigBedBlockHandler;
8730   return o;
8731 }
8732 
__pyx_tp_dealloc_2bx_3bbi_11bigbed_file_BigBedBlockHandler(PyObject * o)8733 static void __pyx_tp_dealloc_2bx_3bbi_11bigbed_file_BigBedBlockHandler(PyObject *o) {
8734   #if CYTHON_USE_TP_FINALIZE
8735   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
8736     if (PyObject_CallFinalizerFromDealloc(o)) return;
8737   }
8738   #endif
8739   if (likely(__pyx_ptype_2bx_3bbi_8bbi_file_BlockHandler)) __pyx_ptype_2bx_3bbi_8bbi_file_BlockHandler->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_2bx_3bbi_11bigbed_file_BigBedBlockHandler);
8740 }
8741 
8742 static PyMethodDef __pyx_methods_2bx_3bbi_11bigbed_file_BigBedBlockHandler[] = {
8743   {"__reduce_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_3__reduce_cython__, METH_NOARGS, 0},
8744   {"__setstate_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_5__setstate_cython__, METH_O, 0},
8745   {0, 0, 0, 0}
8746 };
8747 
8748 static PyTypeObject __pyx_type_2bx_3bbi_11bigbed_file_BigBedBlockHandler = {
8749   PyVarObject_HEAD_INIT(0, 0)
8750   "bx.bbi.bigbed_file.BigBedBlockHandler", /*tp_name*/
8751   sizeof(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler), /*tp_basicsize*/
8752   0, /*tp_itemsize*/
8753   __pyx_tp_dealloc_2bx_3bbi_11bigbed_file_BigBedBlockHandler, /*tp_dealloc*/
8754   #if PY_VERSION_HEX < 0x030800b4
8755   0, /*tp_print*/
8756   #endif
8757   #if PY_VERSION_HEX >= 0x030800b4
8758   0, /*tp_vectorcall_offset*/
8759   #endif
8760   0, /*tp_getattr*/
8761   0, /*tp_setattr*/
8762   #if PY_MAJOR_VERSION < 3
8763   0, /*tp_compare*/
8764   #endif
8765   #if PY_MAJOR_VERSION >= 3
8766   0, /*tp_as_async*/
8767   #endif
8768   0, /*tp_repr*/
8769   0, /*tp_as_number*/
8770   0, /*tp_as_sequence*/
8771   0, /*tp_as_mapping*/
8772   0, /*tp_hash*/
8773   0, /*tp_call*/
8774   0, /*tp_str*/
8775   0, /*tp_getattro*/
8776   0, /*tp_setattro*/
8777   0, /*tp_as_buffer*/
8778   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
8779   "\n    BlockHandler that parses the block into a series of BED records\n    ", /*tp_doc*/
8780   0, /*tp_traverse*/
8781   0, /*tp_clear*/
8782   0, /*tp_richcompare*/
8783   0, /*tp_weaklistoffset*/
8784   0, /*tp_iter*/
8785   0, /*tp_iternext*/
8786   __pyx_methods_2bx_3bbi_11bigbed_file_BigBedBlockHandler, /*tp_methods*/
8787   0, /*tp_members*/
8788   0, /*tp_getset*/
8789   0, /*tp_base*/
8790   0, /*tp_dict*/
8791   0, /*tp_descr_get*/
8792   0, /*tp_descr_set*/
8793   0, /*tp_dictoffset*/
8794   __pyx_pw_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_1__init__, /*tp_init*/
8795   0, /*tp_alloc*/
8796   __pyx_tp_new_2bx_3bbi_11bigbed_file_BigBedBlockHandler, /*tp_new*/
8797   0, /*tp_free*/
8798   0, /*tp_is_gc*/
8799   0, /*tp_bases*/
8800   0, /*tp_mro*/
8801   0, /*tp_cache*/
8802   0, /*tp_subclasses*/
8803   0, /*tp_weaklist*/
8804   0, /*tp_del*/
8805   0, /*tp_version_tag*/
8806   #if PY_VERSION_HEX >= 0x030400a1
8807   0, /*tp_finalize*/
8808   #endif
8809   #if PY_VERSION_HEX >= 0x030800b1
8810   0, /*tp_vectorcall*/
8811   #endif
8812   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
8813   0, /*tp_print*/
8814   #endif
8815   #if PY_VERSION_HEX >= 0x030B00A2
8816   0, /*tp_inline_values_offset*/
8817   #endif
8818 };
8819 static struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_SummarizingBlockHandler __pyx_vtable_2bx_3bbi_11bigbed_file_SummarizingBlockHandler;
8820 
__pyx_tp_new_2bx_3bbi_11bigbed_file_SummarizingBlockHandler(PyTypeObject * t,PyObject * a,PyObject * k)8821 static PyObject *__pyx_tp_new_2bx_3bbi_11bigbed_file_SummarizingBlockHandler(PyTypeObject *t, PyObject *a, PyObject *k) {
8822   struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *p;
8823   PyObject *o = __pyx_tp_new_2bx_3bbi_11bigbed_file_BigBedBlockHandler(t, a, k);
8824   if (unlikely(!o)) return 0;
8825   p = ((struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *)o);
8826   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BlockHandler*)__pyx_vtabptr_2bx_3bbi_11bigbed_file_SummarizingBlockHandler;
8827   p->sd = ((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)Py_None); Py_INCREF(Py_None);
8828   return o;
8829 }
8830 
__pyx_tp_dealloc_2bx_3bbi_11bigbed_file_SummarizingBlockHandler(PyObject * o)8831 static void __pyx_tp_dealloc_2bx_3bbi_11bigbed_file_SummarizingBlockHandler(PyObject *o) {
8832   struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *p = (struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *)o;
8833   #if CYTHON_USE_TP_FINALIZE
8834   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
8835     if (PyObject_CallFinalizerFromDealloc(o)) return;
8836   }
8837   #endif
8838   PyObject_GC_UnTrack(o);
8839   Py_CLEAR(p->sd);
8840   #if CYTHON_USE_TYPE_SLOTS
8841   if (PyType_IS_GC(Py_TYPE(o)->tp_base))
8842   #endif
8843   PyObject_GC_Track(o);
8844   __pyx_tp_dealloc_2bx_3bbi_11bigbed_file_BigBedBlockHandler(o);
8845 }
8846 
__pyx_tp_traverse_2bx_3bbi_11bigbed_file_SummarizingBlockHandler(PyObject * o,visitproc v,void * a)8847 static int __pyx_tp_traverse_2bx_3bbi_11bigbed_file_SummarizingBlockHandler(PyObject *o, visitproc v, void *a) {
8848   int e;
8849   struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *p = (struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *)o;
8850   e = ((likely(__pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler)) ? ((__pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler->tp_traverse) ? __pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2bx_3bbi_11bigbed_file_SummarizingBlockHandler)); if (e) return e;
8851   if (p->sd) {
8852     e = (*v)(((PyObject *)p->sd), a); if (e) return e;
8853   }
8854   return 0;
8855 }
8856 
__pyx_tp_clear_2bx_3bbi_11bigbed_file_SummarizingBlockHandler(PyObject * o)8857 static int __pyx_tp_clear_2bx_3bbi_11bigbed_file_SummarizingBlockHandler(PyObject *o) {
8858   PyObject* tmp;
8859   struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *p = (struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler *)o;
8860   if (likely(__pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler)) { if (__pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler->tp_clear) __pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2bx_3bbi_11bigbed_file_SummarizingBlockHandler);
8861   tmp = ((PyObject*)p->sd);
8862   p->sd = ((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)Py_None); Py_INCREF(Py_None);
8863   Py_XDECREF(tmp);
8864   return 0;
8865 }
8866 
8867 static PyMethodDef __pyx_methods_2bx_3bbi_11bigbed_file_SummarizingBlockHandler[] = {
8868   {"__reduce_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_3__reduce_cython__, METH_NOARGS, 0},
8869   {"__setstate_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_5__setstate_cython__, METH_O, 0},
8870   {0, 0, 0, 0}
8871 };
8872 
8873 static PyTypeObject __pyx_type_2bx_3bbi_11bigbed_file_SummarizingBlockHandler = {
8874   PyVarObject_HEAD_INIT(0, 0)
8875   "bx.bbi.bigbed_file.SummarizingBlockHandler", /*tp_name*/
8876   sizeof(struct __pyx_obj_2bx_3bbi_11bigbed_file_SummarizingBlockHandler), /*tp_basicsize*/
8877   0, /*tp_itemsize*/
8878   __pyx_tp_dealloc_2bx_3bbi_11bigbed_file_SummarizingBlockHandler, /*tp_dealloc*/
8879   #if PY_VERSION_HEX < 0x030800b4
8880   0, /*tp_print*/
8881   #endif
8882   #if PY_VERSION_HEX >= 0x030800b4
8883   0, /*tp_vectorcall_offset*/
8884   #endif
8885   0, /*tp_getattr*/
8886   0, /*tp_setattr*/
8887   #if PY_MAJOR_VERSION < 3
8888   0, /*tp_compare*/
8889   #endif
8890   #if PY_MAJOR_VERSION >= 3
8891   0, /*tp_as_async*/
8892   #endif
8893   0, /*tp_repr*/
8894   0, /*tp_as_number*/
8895   0, /*tp_as_sequence*/
8896   0, /*tp_as_mapping*/
8897   0, /*tp_hash*/
8898   0, /*tp_call*/
8899   0, /*tp_str*/
8900   0, /*tp_getattro*/
8901   0, /*tp_setattro*/
8902   0, /*tp_as_buffer*/
8903   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
8904   "\n    Accumulates intervals into a SummarizedData\n    ", /*tp_doc*/
8905   __pyx_tp_traverse_2bx_3bbi_11bigbed_file_SummarizingBlockHandler, /*tp_traverse*/
8906   __pyx_tp_clear_2bx_3bbi_11bigbed_file_SummarizingBlockHandler, /*tp_clear*/
8907   0, /*tp_richcompare*/
8908   0, /*tp_weaklistoffset*/
8909   0, /*tp_iter*/
8910   0, /*tp_iternext*/
8911   __pyx_methods_2bx_3bbi_11bigbed_file_SummarizingBlockHandler, /*tp_methods*/
8912   0, /*tp_members*/
8913   0, /*tp_getset*/
8914   0, /*tp_base*/
8915   0, /*tp_dict*/
8916   0, /*tp_descr_get*/
8917   0, /*tp_descr_set*/
8918   0, /*tp_dictoffset*/
8919   __pyx_pw_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_1__init__, /*tp_init*/
8920   0, /*tp_alloc*/
8921   __pyx_tp_new_2bx_3bbi_11bigbed_file_SummarizingBlockHandler, /*tp_new*/
8922   0, /*tp_free*/
8923   0, /*tp_is_gc*/
8924   0, /*tp_bases*/
8925   0, /*tp_mro*/
8926   0, /*tp_cache*/
8927   0, /*tp_subclasses*/
8928   0, /*tp_weaklist*/
8929   0, /*tp_del*/
8930   0, /*tp_version_tag*/
8931   #if PY_VERSION_HEX >= 0x030400a1
8932   0, /*tp_finalize*/
8933   #endif
8934   #if PY_VERSION_HEX >= 0x030800b1
8935   0, /*tp_vectorcall*/
8936   #endif
8937   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
8938   0, /*tp_print*/
8939   #endif
8940   #if PY_VERSION_HEX >= 0x030B00A2
8941   0, /*tp_inline_values_offset*/
8942   #endif
8943 };
8944 static struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler __pyx_vtable_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler;
8945 
__pyx_tp_new_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler(PyTypeObject * t,PyObject * a,PyObject * k)8946 static PyObject *__pyx_tp_new_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler(PyTypeObject *t, PyObject *a, PyObject *k) {
8947   struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *p;
8948   PyObject *o = __pyx_tp_new_2bx_3bbi_11bigbed_file_BigBedBlockHandler(t, a, k);
8949   if (unlikely(!o)) return 0;
8950   p = ((struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *)o);
8951   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BlockHandler*)__pyx_vtabptr_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler;
8952   p->intervals = ((PyObject*)Py_None); Py_INCREF(Py_None);
8953   return o;
8954 }
8955 
__pyx_tp_dealloc_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler(PyObject * o)8956 static void __pyx_tp_dealloc_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler(PyObject *o) {
8957   struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *p = (struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *)o;
8958   #if CYTHON_USE_TP_FINALIZE
8959   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
8960     if (PyObject_CallFinalizerFromDealloc(o)) return;
8961   }
8962   #endif
8963   PyObject_GC_UnTrack(o);
8964   Py_CLEAR(p->intervals);
8965   #if CYTHON_USE_TYPE_SLOTS
8966   if (PyType_IS_GC(Py_TYPE(o)->tp_base))
8967   #endif
8968   PyObject_GC_Track(o);
8969   __pyx_tp_dealloc_2bx_3bbi_11bigbed_file_BigBedBlockHandler(o);
8970 }
8971 
__pyx_tp_traverse_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler(PyObject * o,visitproc v,void * a)8972 static int __pyx_tp_traverse_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler(PyObject *o, visitproc v, void *a) {
8973   int e;
8974   struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *p = (struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *)o;
8975   e = ((likely(__pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler)) ? ((__pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler->tp_traverse) ? __pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler)); if (e) return e;
8976   if (p->intervals) {
8977     e = (*v)(p->intervals, a); if (e) return e;
8978   }
8979   return 0;
8980 }
8981 
__pyx_tp_clear_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler(PyObject * o)8982 static int __pyx_tp_clear_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler(PyObject *o) {
8983   PyObject* tmp;
8984   struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *p = (struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler *)o;
8985   if (likely(__pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler)) { if (__pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler->tp_clear) __pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler);
8986   tmp = ((PyObject*)p->intervals);
8987   p->intervals = ((PyObject*)Py_None); Py_INCREF(Py_None);
8988   Py_XDECREF(tmp);
8989   return 0;
8990 }
8991 
8992 static PyMethodDef __pyx_methods_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler[] = {
8993   {"__reduce_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_3__reduce_cython__, METH_NOARGS, 0},
8994   {"__setstate_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_5__setstate_cython__, METH_O, 0},
8995   {0, 0, 0, 0}
8996 };
8997 
8998 static PyTypeObject __pyx_type_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler = {
8999   PyVarObject_HEAD_INIT(0, 0)
9000   "bx.bbi.bigbed_file.IntervalAccumulatingBlockHandler", /*tp_name*/
9001   sizeof(struct __pyx_obj_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler), /*tp_basicsize*/
9002   0, /*tp_itemsize*/
9003   __pyx_tp_dealloc_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler, /*tp_dealloc*/
9004   #if PY_VERSION_HEX < 0x030800b4
9005   0, /*tp_print*/
9006   #endif
9007   #if PY_VERSION_HEX >= 0x030800b4
9008   0, /*tp_vectorcall_offset*/
9009   #endif
9010   0, /*tp_getattr*/
9011   0, /*tp_setattr*/
9012   #if PY_MAJOR_VERSION < 3
9013   0, /*tp_compare*/
9014   #endif
9015   #if PY_MAJOR_VERSION >= 3
9016   0, /*tp_as_async*/
9017   #endif
9018   0, /*tp_repr*/
9019   0, /*tp_as_number*/
9020   0, /*tp_as_sequence*/
9021   0, /*tp_as_mapping*/
9022   0, /*tp_hash*/
9023   0, /*tp_call*/
9024   0, /*tp_str*/
9025   0, /*tp_getattro*/
9026   0, /*tp_setattro*/
9027   0, /*tp_as_buffer*/
9028   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
9029   0, /*tp_doc*/
9030   __pyx_tp_traverse_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler, /*tp_traverse*/
9031   __pyx_tp_clear_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler, /*tp_clear*/
9032   0, /*tp_richcompare*/
9033   0, /*tp_weaklistoffset*/
9034   0, /*tp_iter*/
9035   0, /*tp_iternext*/
9036   __pyx_methods_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler, /*tp_methods*/
9037   0, /*tp_members*/
9038   0, /*tp_getset*/
9039   0, /*tp_base*/
9040   0, /*tp_dict*/
9041   0, /*tp_descr_get*/
9042   0, /*tp_descr_set*/
9043   0, /*tp_dictoffset*/
9044   __pyx_pw_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_1__init__, /*tp_init*/
9045   0, /*tp_alloc*/
9046   __pyx_tp_new_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler, /*tp_new*/
9047   0, /*tp_free*/
9048   0, /*tp_is_gc*/
9049   0, /*tp_bases*/
9050   0, /*tp_mro*/
9051   0, /*tp_cache*/
9052   0, /*tp_subclasses*/
9053   0, /*tp_weaklist*/
9054   0, /*tp_del*/
9055   0, /*tp_version_tag*/
9056   #if PY_VERSION_HEX >= 0x030400a1
9057   0, /*tp_finalize*/
9058   #endif
9059   #if PY_VERSION_HEX >= 0x030800b1
9060   0, /*tp_vectorcall*/
9061   #endif
9062   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
9063   0, /*tp_print*/
9064   #endif
9065   #if PY_VERSION_HEX >= 0x030B00A2
9066   0, /*tp_inline_values_offset*/
9067   #endif
9068 };
9069 static struct __pyx_vtabstruct_2bx_3bbi_11bigbed_file_BigBedFile __pyx_vtable_2bx_3bbi_11bigbed_file_BigBedFile;
9070 
__pyx_tp_new_2bx_3bbi_11bigbed_file_BigBedFile(PyTypeObject * t,PyObject * a,PyObject * k)9071 static PyObject *__pyx_tp_new_2bx_3bbi_11bigbed_file_BigBedFile(PyTypeObject *t, PyObject *a, PyObject *k) {
9072   struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *p;
9073   PyObject *o = __pyx_ptype_2bx_3bbi_8bbi_file_BBIFile->tp_new(t, a, k);
9074   if (unlikely(!o)) return 0;
9075   p = ((struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *)o);
9076   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BBIFile*)__pyx_vtabptr_2bx_3bbi_11bigbed_file_BigBedFile;
9077   return o;
9078 }
9079 
__pyx_tp_dealloc_2bx_3bbi_11bigbed_file_BigBedFile(PyObject * o)9080 static void __pyx_tp_dealloc_2bx_3bbi_11bigbed_file_BigBedFile(PyObject *o) {
9081   #if CYTHON_USE_TP_FINALIZE
9082   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
9083     if (PyObject_CallFinalizerFromDealloc(o)) return;
9084   }
9085   #endif
9086   PyObject_GC_UnTrack(o);
9087   PyObject_GC_Track(o);
9088   if (likely(__pyx_ptype_2bx_3bbi_8bbi_file_BBIFile)) __pyx_ptype_2bx_3bbi_8bbi_file_BBIFile->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_2bx_3bbi_11bigbed_file_BigBedFile);
9089 }
9090 
__pyx_tp_traverse_2bx_3bbi_11bigbed_file_BigBedFile(PyObject * o,visitproc v,void * a)9091 static int __pyx_tp_traverse_2bx_3bbi_11bigbed_file_BigBedFile(PyObject *o, visitproc v, void *a) {
9092   int e;
9093   e = ((likely(__pyx_ptype_2bx_3bbi_8bbi_file_BBIFile)) ? ((__pyx_ptype_2bx_3bbi_8bbi_file_BBIFile->tp_traverse) ? __pyx_ptype_2bx_3bbi_8bbi_file_BBIFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_2bx_3bbi_11bigbed_file_BigBedFile)); if (e) return e;
9094   return 0;
9095 }
9096 
__pyx_tp_clear_2bx_3bbi_11bigbed_file_BigBedFile(PyObject * o)9097 static int __pyx_tp_clear_2bx_3bbi_11bigbed_file_BigBedFile(PyObject *o) {
9098   if (likely(__pyx_ptype_2bx_3bbi_8bbi_file_BBIFile)) { if (__pyx_ptype_2bx_3bbi_8bbi_file_BBIFile->tp_clear) __pyx_ptype_2bx_3bbi_8bbi_file_BBIFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_2bx_3bbi_11bigbed_file_BigBedFile);
9099   return 0;
9100 }
9101 
9102 static PyMethodDef __pyx_methods_2bx_3bbi_11bigbed_file_BigBedFile[] = {
9103   {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_3get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2bx_3bbi_11bigbed_file_10BigBedFile_2get},
9104   {"__reduce_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_5__reduce_cython__, METH_NOARGS, 0},
9105   {"__setstate_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_7__setstate_cython__, METH_O, 0},
9106   {0, 0, 0, 0}
9107 };
9108 
9109 static PyTypeObject __pyx_type_2bx_3bbi_11bigbed_file_BigBedFile = {
9110   PyVarObject_HEAD_INIT(0, 0)
9111   "bx.bbi.bigbed_file.BigBedFile", /*tp_name*/
9112   sizeof(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile), /*tp_basicsize*/
9113   0, /*tp_itemsize*/
9114   __pyx_tp_dealloc_2bx_3bbi_11bigbed_file_BigBedFile, /*tp_dealloc*/
9115   #if PY_VERSION_HEX < 0x030800b4
9116   0, /*tp_print*/
9117   #endif
9118   #if PY_VERSION_HEX >= 0x030800b4
9119   0, /*tp_vectorcall_offset*/
9120   #endif
9121   0, /*tp_getattr*/
9122   0, /*tp_setattr*/
9123   #if PY_MAJOR_VERSION < 3
9124   0, /*tp_compare*/
9125   #endif
9126   #if PY_MAJOR_VERSION >= 3
9127   0, /*tp_as_async*/
9128   #endif
9129   0, /*tp_repr*/
9130   0, /*tp_as_number*/
9131   0, /*tp_as_sequence*/
9132   0, /*tp_as_mapping*/
9133   0, /*tp_hash*/
9134   0, /*tp_call*/
9135   0, /*tp_str*/
9136   0, /*tp_getattro*/
9137   0, /*tp_setattro*/
9138   0, /*tp_as_buffer*/
9139   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
9140   "\n    A \"big binary indexed\" file whose raw data is in BED format.\n    ", /*tp_doc*/
9141   __pyx_tp_traverse_2bx_3bbi_11bigbed_file_BigBedFile, /*tp_traverse*/
9142   __pyx_tp_clear_2bx_3bbi_11bigbed_file_BigBedFile, /*tp_clear*/
9143   0, /*tp_richcompare*/
9144   0, /*tp_weaklistoffset*/
9145   0, /*tp_iter*/
9146   0, /*tp_iternext*/
9147   __pyx_methods_2bx_3bbi_11bigbed_file_BigBedFile, /*tp_methods*/
9148   0, /*tp_members*/
9149   0, /*tp_getset*/
9150   0, /*tp_base*/
9151   0, /*tp_dict*/
9152   0, /*tp_descr_get*/
9153   0, /*tp_descr_set*/
9154   0, /*tp_dictoffset*/
9155   __pyx_pw_2bx_3bbi_11bigbed_file_10BigBedFile_1__init__, /*tp_init*/
9156   0, /*tp_alloc*/
9157   __pyx_tp_new_2bx_3bbi_11bigbed_file_BigBedFile, /*tp_new*/
9158   0, /*tp_free*/
9159   0, /*tp_is_gc*/
9160   0, /*tp_bases*/
9161   0, /*tp_mro*/
9162   0, /*tp_cache*/
9163   0, /*tp_subclasses*/
9164   0, /*tp_weaklist*/
9165   0, /*tp_del*/
9166   0, /*tp_version_tag*/
9167   #if PY_VERSION_HEX >= 0x030400a1
9168   0, /*tp_finalize*/
9169   #endif
9170   #if PY_VERSION_HEX >= 0x030800b1
9171   0, /*tp_vectorcall*/
9172   #endif
9173   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
9174   0, /*tp_print*/
9175   #endif
9176   #if PY_VERSION_HEX >= 0x030B00A2
9177   0, /*tp_inline_values_offset*/
9178   #endif
9179 };
9180 
9181 static PyMethodDef __pyx_methods[] = {
9182   {0, 0, 0, 0}
9183 };
9184 
9185 #if PY_MAJOR_VERSION >= 3
9186 #if CYTHON_PEP489_MULTI_PHASE_INIT
9187 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
9188 static int __pyx_pymod_exec_bigbed_file(PyObject* module); /*proto*/
9189 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
9190   {Py_mod_create, (void*)__pyx_pymod_create},
9191   {Py_mod_exec, (void*)__pyx_pymod_exec_bigbed_file},
9192   {0, NULL}
9193 };
9194 #endif
9195 
9196 static struct PyModuleDef __pyx_moduledef = {
9197     PyModuleDef_HEAD_INIT,
9198     "bigbed_file",
9199     __pyx_k_BigBed_file, /* m_doc */
9200   #if CYTHON_PEP489_MULTI_PHASE_INIT
9201     0, /* m_size */
9202   #else
9203     -1, /* m_size */
9204   #endif
9205     __pyx_methods /* m_methods */,
9206   #if CYTHON_PEP489_MULTI_PHASE_INIT
9207     __pyx_moduledef_slots, /* m_slots */
9208   #else
9209     NULL, /* m_reload */
9210   #endif
9211     NULL, /* m_traverse */
9212     NULL, /* m_clear */
9213     NULL /* m_free */
9214 };
9215 #endif
9216 #ifndef CYTHON_SMALL_CODE
9217 #if defined(__clang__)
9218     #define CYTHON_SMALL_CODE
9219 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
9220     #define CYTHON_SMALL_CODE __attribute__((cold))
9221 #else
9222     #define CYTHON_SMALL_CODE
9223 #endif
9224 #endif
9225 
9226 static __Pyx_StringTabEntry __pyx_string_tab[] = {
9227   {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0},
9228   {&__pyx_n_s_BigBedBlockHandler, __pyx_k_BigBedBlockHandler, sizeof(__pyx_k_BigBedBlockHandler), 0, 0, 1, 1},
9229   {&__pyx_n_s_BigBedFile, __pyx_k_BigBedFile, sizeof(__pyx_k_BigBedFile), 0, 0, 1, 1},
9230   {&__pyx_n_s_BinaryFileReader, __pyx_k_BinaryFileReader, sizeof(__pyx_k_BinaryFileReader), 0, 0, 1, 1},
9231   {&__pyx_n_s_BytesIO, __pyx_k_BytesIO, sizeof(__pyx_k_BytesIO), 0, 0, 1, 1},
9232   {&__pyx_n_s_GenomicInterval, __pyx_k_GenomicInterval, sizeof(__pyx_k_GenomicInterval), 0, 0, 1, 1},
9233   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
9234   {&__pyx_kp_s_Incompatible_checksums_s_vs_0x55, __pyx_k_Incompatible_checksums_s_vs_0x55, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x55), 0, 0, 1, 0},
9235   {&__pyx_kp_s_Incompatible_checksums_s_vs_0x72, __pyx_k_Incompatible_checksums_s_vs_0x72, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x72), 0, 0, 1, 0},
9236   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xe0, __pyx_k_Incompatible_checksums_s_vs_0xe0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xe0), 0, 0, 1, 0},
9237   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xfe, __pyx_k_Incompatible_checksums_s_vs_0xfe, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xfe), 0, 0, 1, 0},
9238   {&__pyx_n_s_IntervalAccumulatingBlockHandler, __pyx_k_IntervalAccumulatingBlockHandler, sizeof(__pyx_k_IntervalAccumulatingBlockHandler), 0, 0, 1, 1},
9239   {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
9240   {&__pyx_n_s_SummarizingBlockHandler, __pyx_k_SummarizingBlockHandler, sizeof(__pyx_k_SummarizingBlockHandler), 0, 0, 1, 1},
9241   {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
9242   {&__pyx_n_s_bigbed, __pyx_k_bigbed, sizeof(__pyx_k_bigbed), 0, 0, 1, 1},
9243   {&__pyx_n_s_bx_bbi_bigbed_file, __pyx_k_bx_bbi_bigbed_file, sizeof(__pyx_k_bx_bbi_bigbed_file), 0, 0, 1, 1},
9244   {&__pyx_n_s_bx_intervals_io, __pyx_k_bx_intervals_io, sizeof(__pyx_k_bx_intervals_io), 0, 0, 1, 1},
9245   {&__pyx_n_s_bx_misc_binary_file, __pyx_k_bx_misc_binary_file, sizeof(__pyx_k_bx_misc_binary_file), 0, 0, 1, 1},
9246   {&__pyx_n_s_chrom, __pyx_k_chrom, sizeof(__pyx_k_chrom), 0, 0, 1, 1},
9247   {&__pyx_n_s_chrom_id, __pyx_k_chrom_id, sizeof(__pyx_k_chrom_id), 0, 0, 1, 1},
9248   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
9249   {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
9250   {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
9251   {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
9252   {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
9253   {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
9254   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
9255   {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1},
9256   {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
9257   {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1},
9258   {&__pyx_n_s_is_little_endian, __pyx_k_is_little_endian, sizeof(__pyx_k_is_little_endian), 0, 0, 1, 1},
9259   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
9260   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
9261   {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
9262   {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
9263   {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
9264   {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
9265   {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
9266   {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
9267   {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
9268   {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
9269   {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
9270   {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
9271   {&__pyx_n_s_pyx_unpickle_BigBedBlockHandle, __pyx_k_pyx_unpickle_BigBedBlockHandle, sizeof(__pyx_k_pyx_unpickle_BigBedBlockHandle), 0, 0, 1, 1},
9272   {&__pyx_n_s_pyx_unpickle_BigBedFile, __pyx_k_pyx_unpickle_BigBedFile, sizeof(__pyx_k_pyx_unpickle_BigBedFile), 0, 0, 1, 1},
9273   {&__pyx_n_s_pyx_unpickle_IntervalAccumulat, __pyx_k_pyx_unpickle_IntervalAccumulat, sizeof(__pyx_k_pyx_unpickle_IntervalAccumulat), 0, 0, 1, 1},
9274   {&__pyx_n_s_pyx_unpickle_SummarizingBlockH, __pyx_k_pyx_unpickle_SummarizingBlockH, sizeof(__pyx_k_pyx_unpickle_SummarizingBlockH), 0, 0, 1, 1},
9275   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
9276   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
9277   {&__pyx_n_s_read_c_string, __pyx_k_read_c_string, sizeof(__pyx_k_read_c_string), 0, 0, 1, 1},
9278   {&__pyx_n_s_read_uint32, __pyx_k_read_uint32, sizeof(__pyx_k_read_uint32), 0, 0, 1, 1},
9279   {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
9280   {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
9281   {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
9282   {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1},
9283   {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
9284   {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
9285   {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
9286   {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
9287   {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
9288   {&__pyx_n_s_summary_size, __pyx_k_summary_size, sizeof(__pyx_k_summary_size), 0, 0, 1, 1},
9289   {&__pyx_n_s_tell, __pyx_k_tell, sizeof(__pyx_k_tell), 0, 0, 1, 1},
9290   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
9291   {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
9292   {&__pyx_n_s_zlib, __pyx_k_zlib, sizeof(__pyx_k_zlib), 0, 0, 1, 1},
9293   {0, 0, 0, 0, 0, 0, 0}
9294 };
__Pyx_InitCachedBuiltins(void)9295 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
9296   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 63, __pyx_L1_error)
9297   __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 100, __pyx_L1_error)
9298   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
9299   return 0;
9300   __pyx_L1_error:;
9301   return -1;
9302 }
9303 
__Pyx_InitCachedConstants(void)9304 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
9305   __Pyx_RefNannyDeclarations
9306   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
9307 
9308   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":945
9309  *         __pyx_import_array()
9310  *     except Exception:
9311  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
9312  *
9313  * cdef inline int import_umath() except -1:
9314  */
9315   __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 945, __pyx_L1_error)
9316   __Pyx_GOTREF(__pyx_tuple__3);
9317   __Pyx_GIVEREF(__pyx_tuple__3);
9318 
9319   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":951
9320  *         _import_umath()
9321  *     except Exception:
9322  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
9323  *
9324  * cdef inline int import_ufunc() except -1:
9325  */
9326   __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 951, __pyx_L1_error)
9327   __Pyx_GOTREF(__pyx_tuple__4);
9328   __Pyx_GIVEREF(__pyx_tuple__4);
9329 
9330   /* "(tree fragment)":1
9331  * def __pyx_unpickle_BigBedBlockHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
9332  *     cdef object __pyx_PickleError
9333  *     cdef object __pyx_result
9334  */
9335   __pyx_tuple__5 = 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__5)) __PYX_ERR(1, 1, __pyx_L1_error)
9336   __Pyx_GOTREF(__pyx_tuple__5);
9337   __Pyx_GIVEREF(__pyx_tuple__5);
9338   __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BigBedBlockHandle, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(1, 1, __pyx_L1_error)
9339   __pyx_tuple__7 = 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__7)) __PYX_ERR(1, 1, __pyx_L1_error)
9340   __Pyx_GOTREF(__pyx_tuple__7);
9341   __Pyx_GIVEREF(__pyx_tuple__7);
9342   __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_SummarizingBlockH, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 1, __pyx_L1_error)
9343   __pyx_tuple__9 = 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__9)) __PYX_ERR(1, 1, __pyx_L1_error)
9344   __Pyx_GOTREF(__pyx_tuple__9);
9345   __Pyx_GIVEREF(__pyx_tuple__9);
9346   __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_IntervalAccumulat, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 1, __pyx_L1_error)
9347   __pyx_tuple__11 = 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__11)) __PYX_ERR(1, 1, __pyx_L1_error)
9348   __Pyx_GOTREF(__pyx_tuple__11);
9349   __Pyx_GIVEREF(__pyx_tuple__11);
9350   __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BigBedFile, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 1, __pyx_L1_error)
9351   __Pyx_RefNannyFinishContext();
9352   return 0;
9353   __pyx_L1_error:;
9354   __Pyx_RefNannyFinishContext();
9355   return -1;
9356 }
9357 
__Pyx_InitGlobals(void)9358 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
9359   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9360   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
9361   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
9362   __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
9363   __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
9364   __pyx_int_89548920 = PyInt_FromLong(89548920L); if (unlikely(!__pyx_int_89548920)) __PYX_ERR(0, 1, __pyx_L1_error)
9365   __pyx_int_119908230 = PyInt_FromLong(119908230L); if (unlikely(!__pyx_int_119908230)) __PYX_ERR(0, 1, __pyx_L1_error)
9366   __pyx_int_235926978 = PyInt_FromLong(235926978L); if (unlikely(!__pyx_int_235926978)) __PYX_ERR(0, 1, __pyx_L1_error)
9367   __pyx_int_266946685 = PyInt_FromLong(266946685L); if (unlikely(!__pyx_int_266946685)) __PYX_ERR(0, 1, __pyx_L1_error)
9368   __pyx_int_2273964779 = PyInt_FromString((char *)"2273964779", 0, 0); if (unlikely(!__pyx_int_2273964779)) __PYX_ERR(0, 1, __pyx_L1_error)
9369   return 0;
9370   __pyx_L1_error:;
9371   return -1;
9372 }
9373 
9374 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
9375 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
9376 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
9377 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
9378 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
9379 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
9380 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
9381 
__Pyx_modinit_global_init_code(void)9382 static int __Pyx_modinit_global_init_code(void) {
9383   __Pyx_RefNannyDeclarations
9384   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
9385   /*--- Global init code ---*/
9386   __Pyx_RefNannyFinishContext();
9387   return 0;
9388 }
9389 
__Pyx_modinit_variable_export_code(void)9390 static int __Pyx_modinit_variable_export_code(void) {
9391   __Pyx_RefNannyDeclarations
9392   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
9393   /*--- Variable export code ---*/
9394   __Pyx_RefNannyFinishContext();
9395   return 0;
9396 }
9397 
__Pyx_modinit_function_export_code(void)9398 static int __Pyx_modinit_function_export_code(void) {
9399   __Pyx_RefNannyDeclarations
9400   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
9401   /*--- Function export code ---*/
9402   __Pyx_RefNannyFinishContext();
9403   return 0;
9404 }
9405 
__Pyx_modinit_type_init_code(void)9406 static int __Pyx_modinit_type_init_code(void) {
9407   __Pyx_RefNannyDeclarations
9408   PyObject *__pyx_t_1 = NULL;
9409   int __pyx_lineno = 0;
9410   const char *__pyx_filename = NULL;
9411   int __pyx_clineno = 0;
9412   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
9413   /*--- Type init code ---*/
9414   __pyx_t_1 = PyImport_ImportModule("bx.bbi.bbi_file"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
9415   __Pyx_GOTREF(__pyx_t_1);
9416   __pyx_ptype_2bx_3bbi_8bbi_file_BlockHandler = __Pyx_ImportType(__pyx_t_1, "bx.bbi.bbi_file", "BlockHandler", sizeof(struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler), __Pyx_ImportType_CheckSize_Warn);
9417    if (!__pyx_ptype_2bx_3bbi_8bbi_file_BlockHandler) __PYX_ERR(0, 1, __pyx_L1_error)
9418   __pyx_vtabptr_2bx_3bbi_8bbi_file_BlockHandler = (struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BlockHandler*)__Pyx_GetVtable(__pyx_ptype_2bx_3bbi_8bbi_file_BlockHandler->tp_dict); if (unlikely(!__pyx_vtabptr_2bx_3bbi_8bbi_file_BlockHandler)) __PYX_ERR(0, 1, __pyx_L1_error)
9419   __pyx_vtabptr_2bx_3bbi_11bigbed_file_BigBedBlockHandler = &__pyx_vtable_2bx_3bbi_11bigbed_file_BigBedBlockHandler;
9420   __pyx_vtable_2bx_3bbi_11bigbed_file_BigBedBlockHandler.__pyx_base = *__pyx_vtabptr_2bx_3bbi_8bbi_file_BlockHandler;
9421   __pyx_vtable_2bx_3bbi_11bigbed_file_BigBedBlockHandler.__pyx_base.handle_block = (PyObject *(*)(struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *, PyObject *, struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *))__pyx_f_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_handle_block;
9422   __pyx_vtable_2bx_3bbi_11bigbed_file_BigBedBlockHandler.handle_interval_value = (PyObject *(*)(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, PyObject *))__pyx_f_2bx_3bbi_11bigbed_file_18BigBedBlockHandler_handle_interval_value;
9423   __pyx_type_2bx_3bbi_11bigbed_file_BigBedBlockHandler.tp_base = __pyx_ptype_2bx_3bbi_8bbi_file_BlockHandler;
9424   if (PyType_Ready(&__pyx_type_2bx_3bbi_11bigbed_file_BigBedBlockHandler) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
9425   #if PY_VERSION_HEX < 0x030800B1
9426   __pyx_type_2bx_3bbi_11bigbed_file_BigBedBlockHandler.tp_print = 0;
9427   #endif
9428   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2bx_3bbi_11bigbed_file_BigBedBlockHandler.tp_dictoffset && __pyx_type_2bx_3bbi_11bigbed_file_BigBedBlockHandler.tp_getattro == PyObject_GenericGetAttr)) {
9429     __pyx_type_2bx_3bbi_11bigbed_file_BigBedBlockHandler.tp_getattro = __Pyx_PyObject_GenericGetAttr;
9430   }
9431   if (__Pyx_SetVtable(__pyx_type_2bx_3bbi_11bigbed_file_BigBedBlockHandler.tp_dict, __pyx_vtabptr_2bx_3bbi_11bigbed_file_BigBedBlockHandler) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
9432   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BigBedBlockHandler, (PyObject *)&__pyx_type_2bx_3bbi_11bigbed_file_BigBedBlockHandler) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
9433   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2bx_3bbi_11bigbed_file_BigBedBlockHandler) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
9434   __pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler = &__pyx_type_2bx_3bbi_11bigbed_file_BigBedBlockHandler;
9435   __pyx_vtabptr_2bx_3bbi_11bigbed_file_SummarizingBlockHandler = &__pyx_vtable_2bx_3bbi_11bigbed_file_SummarizingBlockHandler;
9436   __pyx_vtable_2bx_3bbi_11bigbed_file_SummarizingBlockHandler.__pyx_base = *__pyx_vtabptr_2bx_3bbi_11bigbed_file_BigBedBlockHandler;
9437   __pyx_vtable_2bx_3bbi_11bigbed_file_SummarizingBlockHandler.__pyx_base.handle_interval_value = (PyObject *(*)(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, PyObject *))__pyx_f_2bx_3bbi_11bigbed_file_23SummarizingBlockHandler_handle_interval_value;
9438   __pyx_type_2bx_3bbi_11bigbed_file_SummarizingBlockHandler.tp_base = __pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler;
9439   if (PyType_Ready(&__pyx_type_2bx_3bbi_11bigbed_file_SummarizingBlockHandler) < 0) __PYX_ERR(0, 54, __pyx_L1_error)
9440   #if PY_VERSION_HEX < 0x030800B1
9441   __pyx_type_2bx_3bbi_11bigbed_file_SummarizingBlockHandler.tp_print = 0;
9442   #endif
9443   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2bx_3bbi_11bigbed_file_SummarizingBlockHandler.tp_dictoffset && __pyx_type_2bx_3bbi_11bigbed_file_SummarizingBlockHandler.tp_getattro == PyObject_GenericGetAttr)) {
9444     __pyx_type_2bx_3bbi_11bigbed_file_SummarizingBlockHandler.tp_getattro = __Pyx_PyObject_GenericGetAttr;
9445   }
9446   if (__Pyx_SetVtable(__pyx_type_2bx_3bbi_11bigbed_file_SummarizingBlockHandler.tp_dict, __pyx_vtabptr_2bx_3bbi_11bigbed_file_SummarizingBlockHandler) < 0) __PYX_ERR(0, 54, __pyx_L1_error)
9447   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SummarizingBlockHandler, (PyObject *)&__pyx_type_2bx_3bbi_11bigbed_file_SummarizingBlockHandler) < 0) __PYX_ERR(0, 54, __pyx_L1_error)
9448   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2bx_3bbi_11bigbed_file_SummarizingBlockHandler) < 0) __PYX_ERR(0, 54, __pyx_L1_error)
9449   __pyx_ptype_2bx_3bbi_11bigbed_file_SummarizingBlockHandler = &__pyx_type_2bx_3bbi_11bigbed_file_SummarizingBlockHandler;
9450   __pyx_vtabptr_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler = &__pyx_vtable_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler;
9451   __pyx_vtable_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler.__pyx_base = *__pyx_vtabptr_2bx_3bbi_11bigbed_file_BigBedBlockHandler;
9452   __pyx_vtable_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler.__pyx_base.handle_interval_value = (PyObject *(*)(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedBlockHandler *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, PyObject *))__pyx_f_2bx_3bbi_11bigbed_file_32IntervalAccumulatingBlockHandler_handle_interval_value;
9453   __pyx_type_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler.tp_base = __pyx_ptype_2bx_3bbi_11bigbed_file_BigBedBlockHandler;
9454   if (PyType_Ready(&__pyx_type_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
9455   #if PY_VERSION_HEX < 0x030800B1
9456   __pyx_type_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler.tp_print = 0;
9457   #endif
9458   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler.tp_dictoffset && __pyx_type_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler.tp_getattro == PyObject_GenericGetAttr)) {
9459     __pyx_type_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler.tp_getattro = __Pyx_PyObject_GenericGetAttr;
9460   }
9461   if (__Pyx_SetVtable(__pyx_type_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler.tp_dict, __pyx_vtabptr_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
9462   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IntervalAccumulatingBlockHandler, (PyObject *)&__pyx_type_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
9463   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
9464   __pyx_ptype_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler = &__pyx_type_2bx_3bbi_11bigbed_file_IntervalAccumulatingBlockHandler;
9465   __pyx_ptype_2bx_3bbi_8bbi_file_BBIFile = __Pyx_ImportType(__pyx_t_1, "bx.bbi.bbi_file", "BBIFile", sizeof(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile), __Pyx_ImportType_CheckSize_Warn);
9466    if (!__pyx_ptype_2bx_3bbi_8bbi_file_BBIFile) __PYX_ERR(0, 1, __pyx_L1_error)
9467   __pyx_vtabptr_2bx_3bbi_8bbi_file_BBIFile = (struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BBIFile*)__Pyx_GetVtable(__pyx_ptype_2bx_3bbi_8bbi_file_BBIFile->tp_dict); if (unlikely(!__pyx_vtabptr_2bx_3bbi_8bbi_file_BBIFile)) __PYX_ERR(0, 1, __pyx_L1_error)
9468   __pyx_vtabptr_2bx_3bbi_11bigbed_file_BigBedFile = &__pyx_vtable_2bx_3bbi_11bigbed_file_BigBedFile;
9469   __pyx_vtable_2bx_3bbi_11bigbed_file_BigBedFile.__pyx_base = *__pyx_vtabptr_2bx_3bbi_8bbi_file_BBIFile;
9470   __pyx_vtable_2bx_3bbi_11bigbed_file_BigBedFile.__pyx_base._summarize_from_full = (PyObject *(*)(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, int))__pyx_f_2bx_3bbi_11bigbed_file_10BigBedFile__summarize_from_full;
9471   __pyx_vtable_2bx_3bbi_11bigbed_file_BigBedFile.get = (PyObject *(*)(struct __pyx_obj_2bx_3bbi_11bigbed_file_BigBedFile *, char *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, int __pyx_skip_dispatch))__pyx_f_2bx_3bbi_11bigbed_file_10BigBedFile_get;
9472   __pyx_type_2bx_3bbi_11bigbed_file_BigBedFile.tp_base = __pyx_ptype_2bx_3bbi_8bbi_file_BBIFile;
9473   if (PyType_Ready(&__pyx_type_2bx_3bbi_11bigbed_file_BigBedFile) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
9474   #if PY_VERSION_HEX < 0x030800B1
9475   __pyx_type_2bx_3bbi_11bigbed_file_BigBedFile.tp_print = 0;
9476   #endif
9477   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2bx_3bbi_11bigbed_file_BigBedFile.tp_dictoffset && __pyx_type_2bx_3bbi_11bigbed_file_BigBedFile.tp_getattro == PyObject_GenericGetAttr)) {
9478     __pyx_type_2bx_3bbi_11bigbed_file_BigBedFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
9479   }
9480   if (__Pyx_SetVtable(__pyx_type_2bx_3bbi_11bigbed_file_BigBedFile.tp_dict, __pyx_vtabptr_2bx_3bbi_11bigbed_file_BigBedFile) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
9481   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BigBedFile, (PyObject *)&__pyx_type_2bx_3bbi_11bigbed_file_BigBedFile) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
9482   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2bx_3bbi_11bigbed_file_BigBedFile) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
9483   __pyx_ptype_2bx_3bbi_11bigbed_file_BigBedFile = &__pyx_type_2bx_3bbi_11bigbed_file_BigBedFile;
9484   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9485   __Pyx_RefNannyFinishContext();
9486   return 0;
9487   __pyx_L1_error:;
9488   __Pyx_XDECREF(__pyx_t_1);
9489   __Pyx_RefNannyFinishContext();
9490   return -1;
9491 }
9492 
__Pyx_modinit_type_import_code(void)9493 static int __Pyx_modinit_type_import_code(void) {
9494   __Pyx_RefNannyDeclarations
9495   PyObject *__pyx_t_1 = NULL;
9496   int __pyx_lineno = 0;
9497   const char *__pyx_filename = NULL;
9498   int __pyx_clineno = 0;
9499   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
9500   /*--- Type import code ---*/
9501   __pyx_t_1 = PyImport_ImportModule("bx.bbi.bpt_file"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5, __pyx_L1_error)
9502   __Pyx_GOTREF(__pyx_t_1);
9503   __pyx_ptype_2bx_3bbi_8bpt_file_BPTFile = __Pyx_ImportType(__pyx_t_1, "bx.bbi.bpt_file", "BPTFile", sizeof(struct __pyx_obj_2bx_3bbi_8bpt_file_BPTFile), __Pyx_ImportType_CheckSize_Warn);
9504    if (!__pyx_ptype_2bx_3bbi_8bpt_file_BPTFile) __PYX_ERR(3, 5, __pyx_L1_error)
9505   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9506   __pyx_t_1 = PyImport_ImportModule("bx.bbi.cirtree_file"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 3, __pyx_L1_error)
9507   __Pyx_GOTREF(__pyx_t_1);
9508   __pyx_ptype_2bx_3bbi_12cirtree_file_CIRTreeFile = __Pyx_ImportType(__pyx_t_1, "bx.bbi.cirtree_file", "CIRTreeFile", sizeof(struct __pyx_obj_2bx_3bbi_12cirtree_file_CIRTreeFile), __Pyx_ImportType_CheckSize_Warn);
9509    if (!__pyx_ptype_2bx_3bbi_12cirtree_file_CIRTreeFile) __PYX_ERR(4, 3, __pyx_L1_error)
9510   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9511   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 9, __pyx_L1_error)
9512   __Pyx_GOTREF(__pyx_t_1);
9513   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
9514   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
9515   sizeof(PyTypeObject),
9516   #else
9517   sizeof(PyHeapTypeObject),
9518   #endif
9519   __Pyx_ImportType_CheckSize_Warn);
9520    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(5, 9, __pyx_L1_error)
9521   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9522   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
9523   __Pyx_GOTREF(__pyx_t_1);
9524   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
9525    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
9526   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
9527    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
9528   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
9529    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
9530   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
9531    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
9532   __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9533    if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
9534   __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9535    if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
9536   __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9537    if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
9538   __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9539    if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
9540   __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9541    if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
9542   __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9543    if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
9544   __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9545    if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
9546   __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9547    if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
9548   __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9549    if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
9550   __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9551    if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
9552   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
9553    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
9554   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9555   __pyx_t_1 = PyImport_ImportModule("bx.bbi.bbi_file"); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 8, __pyx_L1_error)
9556   __Pyx_GOTREF(__pyx_t_1);
9557   __pyx_ptype_2bx_3bbi_8bbi_file_SummaryBlock = __Pyx_ImportType(__pyx_t_1, "bx.bbi.bbi_file", "SummaryBlock", sizeof(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock), __Pyx_ImportType_CheckSize_Warn);
9558    if (!__pyx_ptype_2bx_3bbi_8bbi_file_SummaryBlock) __PYX_ERR(6, 8, __pyx_L1_error)
9559   __pyx_ptype_2bx_3bbi_8bbi_file_SummarizedData = __Pyx_ImportType(__pyx_t_1, "bx.bbi.bbi_file", "SummarizedData", sizeof(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData), __Pyx_ImportType_CheckSize_Warn);
9560    if (!__pyx_ptype_2bx_3bbi_8bbi_file_SummarizedData) __PYX_ERR(6, 21, __pyx_L1_error)
9561   __pyx_vtabptr_2bx_3bbi_8bbi_file_SummarizedData = (struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_SummarizedData*)__Pyx_GetVtable(__pyx_ptype_2bx_3bbi_8bbi_file_SummarizedData->tp_dict); if (unlikely(!__pyx_vtabptr_2bx_3bbi_8bbi_file_SummarizedData)) __PYX_ERR(6, 21, __pyx_L1_error)
9562   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9563   __Pyx_RefNannyFinishContext();
9564   return 0;
9565   __pyx_L1_error:;
9566   __Pyx_XDECREF(__pyx_t_1);
9567   __Pyx_RefNannyFinishContext();
9568   return -1;
9569 }
9570 
__Pyx_modinit_variable_import_code(void)9571 static int __Pyx_modinit_variable_import_code(void) {
9572   __Pyx_RefNannyDeclarations
9573   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
9574   /*--- Variable import code ---*/
9575   __Pyx_RefNannyFinishContext();
9576   return 0;
9577 }
9578 
__Pyx_modinit_function_import_code(void)9579 static int __Pyx_modinit_function_import_code(void) {
9580   __Pyx_RefNannyDeclarations
9581   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
9582   /*--- Function import code ---*/
9583   __Pyx_RefNannyFinishContext();
9584   return 0;
9585 }
9586 
9587 
9588 #ifndef CYTHON_NO_PYINIT_EXPORT
9589 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
9590 #elif PY_MAJOR_VERSION < 3
9591 #ifdef __cplusplus
9592 #define __Pyx_PyMODINIT_FUNC extern "C" void
9593 #else
9594 #define __Pyx_PyMODINIT_FUNC void
9595 #endif
9596 #else
9597 #ifdef __cplusplus
9598 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
9599 #else
9600 #define __Pyx_PyMODINIT_FUNC PyObject *
9601 #endif
9602 #endif
9603 
9604 
9605 #if PY_MAJOR_VERSION < 3
9606 __Pyx_PyMODINIT_FUNC initbigbed_file(void) CYTHON_SMALL_CODE; /*proto*/
initbigbed_file(void)9607 __Pyx_PyMODINIT_FUNC initbigbed_file(void)
9608 #else
9609 __Pyx_PyMODINIT_FUNC PyInit_bigbed_file(void) CYTHON_SMALL_CODE; /*proto*/
9610 __Pyx_PyMODINIT_FUNC PyInit_bigbed_file(void)
9611 #if CYTHON_PEP489_MULTI_PHASE_INIT
9612 {
9613   return PyModuleDef_Init(&__pyx_moduledef);
9614 }
9615 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
9616     #if PY_VERSION_HEX >= 0x030700A1
9617     static PY_INT64_T main_interpreter_id = -1;
9618     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
9619     if (main_interpreter_id == -1) {
9620         main_interpreter_id = current_id;
9621         return (unlikely(current_id == -1)) ? -1 : 0;
9622     } else if (unlikely(main_interpreter_id != current_id))
9623     #else
9624     static PyInterpreterState *main_interpreter = NULL;
9625     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
9626     if (!main_interpreter) {
9627         main_interpreter = current_interpreter;
9628     } else if (unlikely(main_interpreter != current_interpreter))
9629     #endif
9630     {
9631         PyErr_SetString(
9632             PyExc_ImportError,
9633             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
9634         return -1;
9635     }
9636     return 0;
9637 }
9638 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) {
9639     PyObject *value = PyObject_GetAttrString(spec, from_name);
9640     int result = 0;
9641     if (likely(value)) {
9642         if (allow_none || value != Py_None) {
9643             result = PyDict_SetItemString(moddict, to_name, value);
9644         }
9645         Py_DECREF(value);
9646     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
9647         PyErr_Clear();
9648     } else {
9649         result = -1;
9650     }
9651     return result;
9652 }
9653 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
9654     PyObject *module = NULL, *moddict, *modname;
9655     if (__Pyx_check_single_interpreter())
9656         return NULL;
9657     if (__pyx_m)
9658         return __Pyx_NewRef(__pyx_m);
9659     modname = PyObject_GetAttrString(spec, "name");
9660     if (unlikely(!modname)) goto bad;
9661     module = PyModule_NewObject(modname);
9662     Py_DECREF(modname);
9663     if (unlikely(!module)) goto bad;
9664     moddict = PyModule_GetDict(module);
9665     if (unlikely(!moddict)) goto bad;
9666     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
9667     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
9668     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
9669     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
9670     return module;
9671 bad:
9672     Py_XDECREF(module);
9673     return NULL;
9674 }
9675 
9676 
9677 static CYTHON_SMALL_CODE int __pyx_pymod_exec_bigbed_file(PyObject *__pyx_pyinit_module)
9678 #endif
9679 #endif
9680 {
9681   PyObject *__pyx_t_1 = NULL;
9682   PyObject *__pyx_t_2 = NULL;
9683   int __pyx_lineno = 0;
9684   const char *__pyx_filename = NULL;
9685   int __pyx_clineno = 0;
9686   __Pyx_RefNannyDeclarations
9687   #if CYTHON_PEP489_MULTI_PHASE_INIT
9688   if (__pyx_m) {
9689     if (__pyx_m == __pyx_pyinit_module) return 0;
9690     PyErr_SetString(PyExc_RuntimeError, "Module 'bigbed_file' has already been imported. Re-initialisation is not supported.");
9691     return -1;
9692   }
9693   #elif PY_MAJOR_VERSION >= 3
9694   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
9695   #endif
9696   #if CYTHON_REFNANNY
9697 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
9698 if (!__Pyx_RefNanny) {
9699   PyErr_Clear();
9700   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
9701   if (!__Pyx_RefNanny)
9702       Py_FatalError("failed to import 'refnanny' module");
9703 }
9704 #endif
9705   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_bigbed_file(void)", 0);
9706   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9707   #ifdef __Pxy_PyFrame_Initialize_Offsets
9708   __Pxy_PyFrame_Initialize_Offsets();
9709   #endif
9710   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
9711   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
9712   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
9713   #ifdef __Pyx_CyFunction_USED
9714   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9715   #endif
9716   #ifdef __Pyx_FusedFunction_USED
9717   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9718   #endif
9719   #ifdef __Pyx_Coroutine_USED
9720   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9721   #endif
9722   #ifdef __Pyx_Generator_USED
9723   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9724   #endif
9725   #ifdef __Pyx_AsyncGen_USED
9726   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9727   #endif
9728   #ifdef __Pyx_StopAsyncIteration_USED
9729   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9730   #endif
9731   /*--- Library function declarations ---*/
9732   /*--- Threads initialization code ---*/
9733   #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
9734   PyEval_InitThreads();
9735   #endif
9736   /*--- Module creation code ---*/
9737   #if CYTHON_PEP489_MULTI_PHASE_INIT
9738   __pyx_m = __pyx_pyinit_module;
9739   Py_INCREF(__pyx_m);
9740   #else
9741   #if PY_MAJOR_VERSION < 3
9742   __pyx_m = Py_InitModule4("bigbed_file", __pyx_methods, __pyx_k_BigBed_file, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
9743   #else
9744   __pyx_m = PyModule_Create(&__pyx_moduledef);
9745   #endif
9746   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
9747   #endif
9748   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
9749   Py_INCREF(__pyx_d);
9750   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
9751   Py_INCREF(__pyx_b);
9752   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
9753   Py_INCREF(__pyx_cython_runtime);
9754   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9755   /*--- Initialize various global constants etc. ---*/
9756   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9757   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
9758   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9759   #endif
9760   if (__pyx_module_is_main_bx__bbi__bigbed_file) {
9761     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9762   }
9763   #if PY_MAJOR_VERSION >= 3
9764   {
9765     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
9766     if (!PyDict_GetItemString(modules, "bx.bbi.bigbed_file")) {
9767       if (unlikely(PyDict_SetItemString(modules, "bx.bbi.bigbed_file", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
9768     }
9769   }
9770   #endif
9771   /*--- Builtin init code ---*/
9772   if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9773   /*--- Constants init code ---*/
9774   if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9775   /*--- Global type/function init code ---*/
9776   (void)__Pyx_modinit_global_init_code();
9777   (void)__Pyx_modinit_variable_export_code();
9778   (void)__Pyx_modinit_function_export_code();
9779   if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
9780   if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
9781   (void)__Pyx_modinit_variable_import_code();
9782   (void)__Pyx_modinit_function_import_code();
9783   /*--- Execution code ---*/
9784   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
9785   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9786   #endif
9787 
9788   /* "bx/bbi/bigbed_file.pyx":7
9789  * from bbi_file cimport *
9790  * from cirtree_file cimport CIRTreeFile
9791  * import numpy             # <<<<<<<<<<<<<<
9792  * cimport numpy
9793  * from types cimport *
9794  */
9795   __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
9796   __Pyx_GOTREF(__pyx_t_1);
9797   if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
9798   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9799 
9800   /* "bx/bbi/bigbed_file.pyx":10
9801  * cimport numpy
9802  * from types cimport *
9803  * from bx.intervals.io import GenomicInterval             # <<<<<<<<<<<<<<
9804  * from bx.misc.binary_file import BinaryFileReader
9805  * from io import BytesIO
9806  */
9807   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
9808   __Pyx_GOTREF(__pyx_t_1);
9809   __Pyx_INCREF(__pyx_n_s_GenomicInterval);
9810   __Pyx_GIVEREF(__pyx_n_s_GenomicInterval);
9811   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_GenomicInterval);
9812   __pyx_t_2 = __Pyx_Import(__pyx_n_s_bx_intervals_io, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)
9813   __Pyx_GOTREF(__pyx_t_2);
9814   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9815   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_GenomicInterval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
9816   __Pyx_GOTREF(__pyx_t_1);
9817   if (PyDict_SetItem(__pyx_d, __pyx_n_s_GenomicInterval, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
9818   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9819   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9820 
9821   /* "bx/bbi/bigbed_file.pyx":11
9822  * from types cimport *
9823  * from bx.intervals.io import GenomicInterval
9824  * from bx.misc.binary_file import BinaryFileReader             # <<<<<<<<<<<<<<
9825  * from io import BytesIO
9826  * import zlib
9827  */
9828   __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
9829   __Pyx_GOTREF(__pyx_t_2);
9830   __Pyx_INCREF(__pyx_n_s_BinaryFileReader);
9831   __Pyx_GIVEREF(__pyx_n_s_BinaryFileReader);
9832   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BinaryFileReader);
9833   __pyx_t_1 = __Pyx_Import(__pyx_n_s_bx_misc_binary_file, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
9834   __Pyx_GOTREF(__pyx_t_1);
9835   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9836   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_BinaryFileReader); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
9837   __Pyx_GOTREF(__pyx_t_2);
9838   if (PyDict_SetItem(__pyx_d, __pyx_n_s_BinaryFileReader, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
9839   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9840   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9841 
9842   /* "bx/bbi/bigbed_file.pyx":12
9843  * from bx.intervals.io import GenomicInterval
9844  * from bx.misc.binary_file import BinaryFileReader
9845  * from io import BytesIO             # <<<<<<<<<<<<<<
9846  * import zlib
9847  *
9848  */
9849   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
9850   __Pyx_GOTREF(__pyx_t_1);
9851   __Pyx_INCREF(__pyx_n_s_BytesIO);
9852   __Pyx_GIVEREF(__pyx_n_s_BytesIO);
9853   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_BytesIO);
9854   __pyx_t_2 = __Pyx_Import(__pyx_n_s_io, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
9855   __Pyx_GOTREF(__pyx_t_2);
9856   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9857   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_BytesIO); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
9858   __Pyx_GOTREF(__pyx_t_1);
9859   if (PyDict_SetItem(__pyx_d, __pyx_n_s_BytesIO, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
9860   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9861   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9862 
9863   /* "bx/bbi/bigbed_file.pyx":13
9864  * from bx.misc.binary_file import BinaryFileReader
9865  * from io import BytesIO
9866  * import zlib             # <<<<<<<<<<<<<<
9867  *
9868  * DEF big_bed_sig = 0x8789F2EB
9869  */
9870   __pyx_t_2 = __Pyx_Import(__pyx_n_s_zlib, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
9871   __Pyx_GOTREF(__pyx_t_2);
9872   if (PyDict_SetItem(__pyx_d, __pyx_n_s_zlib, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
9873   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9874 
9875   /* "(tree fragment)":1
9876  * def __pyx_unpickle_BigBedBlockHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
9877  *     cdef object __pyx_PickleError
9878  *     cdef object __pyx_result
9879  */
9880   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2bx_3bbi_11bigbed_file_1__pyx_unpickle_BigBedBlockHandler, NULL, __pyx_n_s_bx_bbi_bigbed_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
9881   __Pyx_GOTREF(__pyx_t_2);
9882   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BigBedBlockHandle, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9883   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9884 
9885   /* "(tree fragment)":11
9886  *         __pyx_unpickle_BigBedBlockHandler__set_state(<BigBedBlockHandler> __pyx_result, __pyx_state)
9887  *     return __pyx_result
9888  * cdef __pyx_unpickle_BigBedBlockHandler__set_state(BigBedBlockHandler __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
9889  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.start = __pyx_state[2]
9890  *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
9891  */
9892   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2bx_3bbi_11bigbed_file_3__pyx_unpickle_SummarizingBlockHandler, NULL, __pyx_n_s_bx_bbi_bigbed_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
9893   __Pyx_GOTREF(__pyx_t_2);
9894   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_SummarizingBlockH, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9895   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9896 
9897   /* "(tree fragment)":1
9898  * def __pyx_unpickle_IntervalAccumulatingBlockHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
9899  *     cdef object __pyx_PickleError
9900  *     cdef object __pyx_result
9901  */
9902   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2bx_3bbi_11bigbed_file_5__pyx_unpickle_IntervalAccumulatingBlockHandler, NULL, __pyx_n_s_bx_bbi_bigbed_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
9903   __Pyx_GOTREF(__pyx_t_2);
9904   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_IntervalAccumulat, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9905   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9906 
9907   /* "(tree fragment)":11
9908  *         __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(<IntervalAccumulatingBlockHandler> __pyx_result, __pyx_state)
9909  *     return __pyx_result
9910  * cdef __pyx_unpickle_IntervalAccumulatingBlockHandler__set_state(IntervalAccumulatingBlockHandler __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
9911  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.intervals = __pyx_state[2]; __pyx_result.start = __pyx_state[3]
9912  *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
9913  */
9914   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2bx_3bbi_11bigbed_file_7__pyx_unpickle_BigBedFile, NULL, __pyx_n_s_bx_bbi_bigbed_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
9915   __Pyx_GOTREF(__pyx_t_2);
9916   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BigBedFile, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9917   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9918 
9919   /* "bx/bbi/bigbed_file.pyx":1
9920  * """             # <<<<<<<<<<<<<<
9921  * BigBed file.
9922  * """
9923  */
9924   __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
9925   __Pyx_GOTREF(__pyx_t_2);
9926   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9927   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9928 
9929   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1014
9930  *
9931  *
9932  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
9933  *     """
9934  *     returns the unit part of the dtype for a numpy datetime64 object.
9935  */
9936 
9937   /*--- Wrapped vars code ---*/
9938 
9939   goto __pyx_L0;
9940   __pyx_L1_error:;
9941   __Pyx_XDECREF(__pyx_t_1);
9942   __Pyx_XDECREF(__pyx_t_2);
9943   if (__pyx_m) {
9944     if (__pyx_d) {
9945       __Pyx_AddTraceback("init bx.bbi.bigbed_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
9946     }
9947     Py_CLEAR(__pyx_m);
9948   } else if (!PyErr_Occurred()) {
9949     PyErr_SetString(PyExc_ImportError, "init bx.bbi.bigbed_file");
9950   }
9951   __pyx_L0:;
9952   __Pyx_RefNannyFinishContext();
9953   #if CYTHON_PEP489_MULTI_PHASE_INIT
9954   return (__pyx_m != NULL) ? 0 : -1;
9955   #elif PY_MAJOR_VERSION >= 3
9956   return __pyx_m;
9957   #else
9958   return;
9959   #endif
9960 }
9961 
9962 /* --- Runtime support code --- */
9963 /* Refnanny */
9964 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)9965 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
9966     PyObject *m = NULL, *p = NULL;
9967     void *r = NULL;
9968     m = PyImport_ImportModule(modname);
9969     if (!m) goto end;
9970     p = PyObject_GetAttrString(m, "RefNannyAPI");
9971     if (!p) goto end;
9972     r = PyLong_AsVoidPtr(p);
9973 end:
9974     Py_XDECREF(p);
9975     Py_XDECREF(m);
9976     return (__Pyx_RefNannyAPIStruct *)r;
9977 }
9978 #endif
9979 
9980 /* PyObjectGetAttrStr */
9981 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)9982 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
9983     PyTypeObject* tp = Py_TYPE(obj);
9984     if (likely(tp->tp_getattro))
9985         return tp->tp_getattro(obj, attr_name);
9986 #if PY_MAJOR_VERSION < 3
9987     if (likely(tp->tp_getattr))
9988         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
9989 #endif
9990     return PyObject_GetAttr(obj, attr_name);
9991 }
9992 #endif
9993 
9994 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)9995 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
9996     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
9997     if (unlikely(!result)) {
9998         PyErr_Format(PyExc_NameError,
9999 #if PY_MAJOR_VERSION >= 3
10000             "name '%U' is not defined", name);
10001 #else
10002             "name '%.200s' is not defined", PyString_AS_STRING(name));
10003 #endif
10004     }
10005     return result;
10006 }
10007 
10008 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)10009 static void __Pyx_RaiseArgtupleInvalid(
10010     const char* func_name,
10011     int exact,
10012     Py_ssize_t num_min,
10013     Py_ssize_t num_max,
10014     Py_ssize_t num_found)
10015 {
10016     Py_ssize_t num_expected;
10017     const char *more_or_less;
10018     if (num_found < num_min) {
10019         num_expected = num_min;
10020         more_or_less = "at least";
10021     } else {
10022         num_expected = num_max;
10023         more_or_less = "at most";
10024     }
10025     if (exact) {
10026         more_or_less = "exactly";
10027     }
10028     PyErr_Format(PyExc_TypeError,
10029                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
10030                  func_name, more_or_less, num_expected,
10031                  (num_expected == 1) ? "" : "s", num_found);
10032 }
10033 
10034 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)10035 static void __Pyx_RaiseDoubleKeywordsError(
10036     const char* func_name,
10037     PyObject* kw_name)
10038 {
10039     PyErr_Format(PyExc_TypeError,
10040         #if PY_MAJOR_VERSION >= 3
10041         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
10042         #else
10043         "%s() got multiple values for keyword argument '%s'", func_name,
10044         PyString_AsString(kw_name));
10045         #endif
10046 }
10047 
10048 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)10049 static int __Pyx_ParseOptionalKeywords(
10050     PyObject *kwds,
10051     PyObject **argnames[],
10052     PyObject *kwds2,
10053     PyObject *values[],
10054     Py_ssize_t num_pos_args,
10055     const char* function_name)
10056 {
10057     PyObject *key = 0, *value = 0;
10058     Py_ssize_t pos = 0;
10059     PyObject*** name;
10060     PyObject*** first_kw_arg = argnames + num_pos_args;
10061     while (PyDict_Next(kwds, &pos, &key, &value)) {
10062         name = first_kw_arg;
10063         while (*name && (**name != key)) name++;
10064         if (*name) {
10065             values[name-argnames] = value;
10066             continue;
10067         }
10068         name = first_kw_arg;
10069         #if PY_MAJOR_VERSION < 3
10070         if (likely(PyString_Check(key))) {
10071             while (*name) {
10072                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
10073                         && _PyString_Eq(**name, key)) {
10074                     values[name-argnames] = value;
10075                     break;
10076                 }
10077                 name++;
10078             }
10079             if (*name) continue;
10080             else {
10081                 PyObject*** argname = argnames;
10082                 while (argname != first_kw_arg) {
10083                     if ((**argname == key) || (
10084                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
10085                              && _PyString_Eq(**argname, key))) {
10086                         goto arg_passed_twice;
10087                     }
10088                     argname++;
10089                 }
10090             }
10091         } else
10092         #endif
10093         if (likely(PyUnicode_Check(key))) {
10094             while (*name) {
10095                 int cmp = (**name == key) ? 0 :
10096                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
10097                     (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
10098                 #endif
10099                     PyUnicode_Compare(**name, key);
10100                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
10101                 if (cmp == 0) {
10102                     values[name-argnames] = value;
10103                     break;
10104                 }
10105                 name++;
10106             }
10107             if (*name) continue;
10108             else {
10109                 PyObject*** argname = argnames;
10110                 while (argname != first_kw_arg) {
10111                     int cmp = (**argname == key) ? 0 :
10112                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
10113                         (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
10114                     #endif
10115                         PyUnicode_Compare(**argname, key);
10116                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
10117                     if (cmp == 0) goto arg_passed_twice;
10118                     argname++;
10119                 }
10120             }
10121         } else
10122             goto invalid_keyword_type;
10123         if (kwds2) {
10124             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
10125         } else {
10126             goto invalid_keyword;
10127         }
10128     }
10129     return 0;
10130 arg_passed_twice:
10131     __Pyx_RaiseDoubleKeywordsError(function_name, key);
10132     goto bad;
10133 invalid_keyword_type:
10134     PyErr_Format(PyExc_TypeError,
10135         "%.200s() keywords must be strings", function_name);
10136     goto bad;
10137 invalid_keyword:
10138     PyErr_Format(PyExc_TypeError,
10139     #if PY_MAJOR_VERSION < 3
10140         "%.200s() got an unexpected keyword argument '%.200s'",
10141         function_name, PyString_AsString(key));
10142     #else
10143         "%s() got an unexpected keyword argument '%U'",
10144         function_name, key);
10145     #endif
10146 bad:
10147     return -1;
10148 }
10149 
10150 /* PyCFunctionFastCall */
10151 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)10152 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
10153     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
10154     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
10155     PyObject *self = PyCFunction_GET_SELF(func);
10156     int flags = PyCFunction_GET_FLAGS(func);
10157     assert(PyCFunction_Check(func));
10158     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
10159     assert(nargs >= 0);
10160     assert(nargs == 0 || args != NULL);
10161     /* _PyCFunction_FastCallDict() must not be called with an exception set,
10162        because it may clear it (directly or indirectly) and so the
10163        caller loses its exception */
10164     assert(!PyErr_Occurred());
10165     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
10166         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
10167     } else {
10168         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
10169     }
10170 }
10171 #endif
10172 
10173 /* PyFunctionFastCall */
10174 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)10175 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
10176                                                PyObject *globals) {
10177     PyFrameObject *f;
10178     PyThreadState *tstate = __Pyx_PyThreadState_Current;
10179     PyObject **fastlocals;
10180     Py_ssize_t i;
10181     PyObject *result;
10182     assert(globals != NULL);
10183     /* XXX Perhaps we should create a specialized
10184        PyFrame_New() that doesn't take locals, but does
10185        take builtins without sanity checking them.
10186        */
10187     assert(tstate != NULL);
10188     f = PyFrame_New(tstate, co, globals, NULL);
10189     if (f == NULL) {
10190         return NULL;
10191     }
10192     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
10193     for (i = 0; i < na; i++) {
10194         Py_INCREF(*args);
10195         fastlocals[i] = *args++;
10196     }
10197     result = PyEval_EvalFrameEx(f,0);
10198     ++tstate->recursion_depth;
10199     Py_DECREF(f);
10200     --tstate->recursion_depth;
10201     return result;
10202 }
10203 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)10204 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
10205     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
10206     PyObject *globals = PyFunction_GET_GLOBALS(func);
10207     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
10208     PyObject *closure;
10209 #if PY_MAJOR_VERSION >= 3
10210     PyObject *kwdefs;
10211 #endif
10212     PyObject *kwtuple, **k;
10213     PyObject **d;
10214     Py_ssize_t nd;
10215     Py_ssize_t nk;
10216     PyObject *result;
10217     assert(kwargs == NULL || PyDict_Check(kwargs));
10218     nk = kwargs ? PyDict_Size(kwargs) : 0;
10219     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
10220         return NULL;
10221     }
10222     if (
10223 #if PY_MAJOR_VERSION >= 3
10224             co->co_kwonlyargcount == 0 &&
10225 #endif
10226             likely(kwargs == NULL || nk == 0) &&
10227             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
10228         if (argdefs == NULL && co->co_argcount == nargs) {
10229             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
10230             goto done;
10231         }
10232         else if (nargs == 0 && argdefs != NULL
10233                  && co->co_argcount == Py_SIZE(argdefs)) {
10234             /* function called with no arguments, but all parameters have
10235                a default value: use default values as arguments .*/
10236             args = &PyTuple_GET_ITEM(argdefs, 0);
10237             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
10238             goto done;
10239         }
10240     }
10241     if (kwargs != NULL) {
10242         Py_ssize_t pos, i;
10243         kwtuple = PyTuple_New(2 * nk);
10244         if (kwtuple == NULL) {
10245             result = NULL;
10246             goto done;
10247         }
10248         k = &PyTuple_GET_ITEM(kwtuple, 0);
10249         pos = i = 0;
10250         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
10251             Py_INCREF(k[i]);
10252             Py_INCREF(k[i+1]);
10253             i += 2;
10254         }
10255         nk = i / 2;
10256     }
10257     else {
10258         kwtuple = NULL;
10259         k = NULL;
10260     }
10261     closure = PyFunction_GET_CLOSURE(func);
10262 #if PY_MAJOR_VERSION >= 3
10263     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
10264 #endif
10265     if (argdefs != NULL) {
10266         d = &PyTuple_GET_ITEM(argdefs, 0);
10267         nd = Py_SIZE(argdefs);
10268     }
10269     else {
10270         d = NULL;
10271         nd = 0;
10272     }
10273 #if PY_MAJOR_VERSION >= 3
10274     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
10275                                args, (int)nargs,
10276                                k, (int)nk,
10277                                d, (int)nd, kwdefs, closure);
10278 #else
10279     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
10280                                args, (int)nargs,
10281                                k, (int)nk,
10282                                d, (int)nd, closure);
10283 #endif
10284     Py_XDECREF(kwtuple);
10285 done:
10286     Py_LeaveRecursiveCall();
10287     return result;
10288 }
10289 #endif
10290 #endif
10291 
10292 /* PyObjectCall */
10293 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)10294 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
10295     PyObject *result;
10296     ternaryfunc call = Py_TYPE(func)->tp_call;
10297     if (unlikely(!call))
10298         return PyObject_Call(func, arg, kw);
10299     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
10300         return NULL;
10301     result = (*call)(func, arg, kw);
10302     Py_LeaveRecursiveCall();
10303     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
10304         PyErr_SetString(
10305             PyExc_SystemError,
10306             "NULL result without error in PyObject_Call");
10307     }
10308     return result;
10309 }
10310 #endif
10311 
10312 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)10313 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
10314     PyObject *args, *result = NULL;
10315     #if CYTHON_FAST_PYCALL
10316     if (PyFunction_Check(function)) {
10317         PyObject *args[2] = {arg1, arg2};
10318         return __Pyx_PyFunction_FastCall(function, args, 2);
10319     }
10320     #endif
10321     #if CYTHON_FAST_PYCCALL
10322     if (__Pyx_PyFastCFunction_Check(function)) {
10323         PyObject *args[2] = {arg1, arg2};
10324         return __Pyx_PyCFunction_FastCall(function, args, 2);
10325     }
10326     #endif
10327     args = PyTuple_New(2);
10328     if (unlikely(!args)) goto done;
10329     Py_INCREF(arg1);
10330     PyTuple_SET_ITEM(args, 0, arg1);
10331     Py_INCREF(arg2);
10332     PyTuple_SET_ITEM(args, 1, arg2);
10333     Py_INCREF(function);
10334     result = __Pyx_PyObject_Call(function, args, NULL);
10335     Py_DECREF(args);
10336     Py_DECREF(function);
10337 done:
10338     return result;
10339 }
10340 
10341 /* PyObjectCallMethO */
10342 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)10343 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
10344     PyObject *self, *result;
10345     PyCFunction cfunc;
10346     cfunc = PyCFunction_GET_FUNCTION(func);
10347     self = PyCFunction_GET_SELF(func);
10348     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
10349         return NULL;
10350     result = cfunc(self, arg);
10351     Py_LeaveRecursiveCall();
10352     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
10353         PyErr_SetString(
10354             PyExc_SystemError,
10355             "NULL result without error in PyObject_Call");
10356     }
10357     return result;
10358 }
10359 #endif
10360 
10361 /* PyObjectCallOneArg */
10362 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)10363 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
10364     PyObject *result;
10365     PyObject *args = PyTuple_New(1);
10366     if (unlikely(!args)) return NULL;
10367     Py_INCREF(arg);
10368     PyTuple_SET_ITEM(args, 0, arg);
10369     result = __Pyx_PyObject_Call(func, args, NULL);
10370     Py_DECREF(args);
10371     return result;
10372 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)10373 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
10374 #if CYTHON_FAST_PYCALL
10375     if (PyFunction_Check(func)) {
10376         return __Pyx_PyFunction_FastCall(func, &arg, 1);
10377     }
10378 #endif
10379     if (likely(PyCFunction_Check(func))) {
10380         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
10381             return __Pyx_PyObject_CallMethO(func, arg);
10382 #if CYTHON_FAST_PYCCALL
10383         } else if (__Pyx_PyFastCFunction_Check(func)) {
10384             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
10385 #endif
10386         }
10387     }
10388     return __Pyx__PyObject_CallOneArg(func, arg);
10389 }
10390 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)10391 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
10392     PyObject *result;
10393     PyObject *args = PyTuple_Pack(1, arg);
10394     if (unlikely(!args)) return NULL;
10395     result = __Pyx_PyObject_Call(func, args, NULL);
10396     Py_DECREF(args);
10397     return result;
10398 }
10399 #endif
10400 
10401 /* PyDictVersioning */
10402 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)10403 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
10404     PyObject *dict = Py_TYPE(obj)->tp_dict;
10405     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
10406 }
__Pyx_get_object_dict_version(PyObject * obj)10407 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
10408     PyObject **dictptr = NULL;
10409     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
10410     if (offset) {
10411 #if CYTHON_COMPILING_IN_CPYTHON
10412         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
10413 #else
10414         dictptr = _PyObject_GetDictPtr(obj);
10415 #endif
10416     }
10417     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
10418 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)10419 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
10420     PyObject *dict = Py_TYPE(obj)->tp_dict;
10421     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
10422         return 0;
10423     return obj_dict_version == __Pyx_get_object_dict_version(obj);
10424 }
10425 #endif
10426 
10427 /* GetModuleGlobalName */
10428 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)10429 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
10430 #else
10431 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
10432 #endif
10433 {
10434     PyObject *result;
10435 #if !CYTHON_AVOID_BORROWED_REFS
10436 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
10437     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
10438     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
10439     if (likely(result)) {
10440         return __Pyx_NewRef(result);
10441     } else if (unlikely(PyErr_Occurred())) {
10442         return NULL;
10443     }
10444 #else
10445     result = PyDict_GetItem(__pyx_d, name);
10446     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
10447     if (likely(result)) {
10448         return __Pyx_NewRef(result);
10449     }
10450 #endif
10451 #else
10452     result = PyObject_GetItem(__pyx_d, name);
10453     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
10454     if (likely(result)) {
10455         return __Pyx_NewRef(result);
10456     }
10457     PyErr_Clear();
10458 #endif
10459     return __Pyx_GetBuiltinName(name);
10460 }
10461 
10462 /* PyObjectCallNoArg */
10463 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallNoArg(PyObject * func)10464 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
10465 #if CYTHON_FAST_PYCALL
10466     if (PyFunction_Check(func)) {
10467         return __Pyx_PyFunction_FastCall(func, NULL, 0);
10468     }
10469 #endif
10470 #ifdef __Pyx_CyFunction_USED
10471     if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
10472 #else
10473     if (likely(PyCFunction_Check(func)))
10474 #endif
10475     {
10476         if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
10477             return __Pyx_PyObject_CallMethO(func, NULL);
10478         }
10479     }
10480     return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
10481 }
10482 #endif
10483 
10484 /* PyErrExceptionMatches */
10485 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)10486 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
10487     Py_ssize_t i, n;
10488     n = PyTuple_GET_SIZE(tuple);
10489 #if PY_MAJOR_VERSION >= 3
10490     for (i=0; i<n; i++) {
10491         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
10492     }
10493 #endif
10494     for (i=0; i<n; i++) {
10495         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
10496     }
10497     return 0;
10498 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)10499 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
10500     PyObject *exc_type = tstate->curexc_type;
10501     if (exc_type == err) return 1;
10502     if (unlikely(!exc_type)) return 0;
10503     if (unlikely(PyTuple_Check(err)))
10504         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
10505     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
10506 }
10507 #endif
10508 
10509 /* PyErrFetchRestore */
10510 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)10511 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
10512     PyObject *tmp_type, *tmp_value, *tmp_tb;
10513     tmp_type = tstate->curexc_type;
10514     tmp_value = tstate->curexc_value;
10515     tmp_tb = tstate->curexc_traceback;
10516     tstate->curexc_type = type;
10517     tstate->curexc_value = value;
10518     tstate->curexc_traceback = tb;
10519     Py_XDECREF(tmp_type);
10520     Py_XDECREF(tmp_value);
10521     Py_XDECREF(tmp_tb);
10522 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)10523 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
10524     *type = tstate->curexc_type;
10525     *value = tstate->curexc_value;
10526     *tb = tstate->curexc_traceback;
10527     tstate->curexc_type = 0;
10528     tstate->curexc_value = 0;
10529     tstate->curexc_traceback = 0;
10530 }
10531 #endif
10532 
10533 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)10534 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
10535 #if CYTHON_USE_TYPE_SLOTS
10536 #if PY_MAJOR_VERSION >= 3
10537     if (likely(PyUnicode_Check(n)))
10538 #else
10539     if (likely(PyString_Check(n)))
10540 #endif
10541         return __Pyx_PyObject_GetAttrStr(o, n);
10542 #endif
10543     return PyObject_GetAttr(o, n);
10544 }
10545 
10546 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)10547 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
10548     __Pyx_PyThreadState_declare
10549     __Pyx_PyThreadState_assign
10550     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
10551         return NULL;
10552     __Pyx_PyErr_Clear();
10553     Py_INCREF(d);
10554     return d;
10555 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)10556 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
10557     PyObject *r = __Pyx_GetAttr(o, n);
10558     return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
10559 }
10560 
10561 /* SetItemInt */
__Pyx_SetItemInt_Generic(PyObject * o,PyObject * j,PyObject * v)10562 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
10563     int r;
10564     if (!j) return -1;
10565     r = PyObject_SetItem(o, j, v);
10566     Py_DECREF(j);
10567     return r;
10568 }
__Pyx_SetItemInt_Fast(PyObject * o,Py_ssize_t i,PyObject * v,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)10569 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
10570                                                CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
10571 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
10572     if (is_list || PyList_CheckExact(o)) {
10573         Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
10574         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
10575             PyObject* old = PyList_GET_ITEM(o, n);
10576             Py_INCREF(v);
10577             PyList_SET_ITEM(o, n, v);
10578             Py_DECREF(old);
10579             return 1;
10580         }
10581     } else {
10582         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
10583         if (likely(m && m->sq_ass_item)) {
10584             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
10585                 Py_ssize_t l = m->sq_length(o);
10586                 if (likely(l >= 0)) {
10587                     i += l;
10588                 } else {
10589                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
10590                         return -1;
10591                     PyErr_Clear();
10592                 }
10593             }
10594             return m->sq_ass_item(o, i, v);
10595         }
10596     }
10597 #else
10598 #if CYTHON_COMPILING_IN_PYPY
10599     if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
10600 #else
10601     if (is_list || PySequence_Check(o))
10602 #endif
10603     {
10604         return PySequence_SetItem(o, i, v);
10605     }
10606 #endif
10607     return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
10608 }
10609 
10610 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)10611 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
10612     PyObject *r;
10613     if (!j) return NULL;
10614     r = PyObject_GetItem(o, j);
10615     Py_DECREF(j);
10616     return r;
10617 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)10618 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
10619                                                               CYTHON_NCP_UNUSED int wraparound,
10620                                                               CYTHON_NCP_UNUSED int boundscheck) {
10621 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10622     Py_ssize_t wrapped_i = i;
10623     if (wraparound & unlikely(i < 0)) {
10624         wrapped_i += PyList_GET_SIZE(o);
10625     }
10626     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
10627         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
10628         Py_INCREF(r);
10629         return r;
10630     }
10631     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
10632 #else
10633     return PySequence_GetItem(o, i);
10634 #endif
10635 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)10636 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
10637                                                               CYTHON_NCP_UNUSED int wraparound,
10638                                                               CYTHON_NCP_UNUSED int boundscheck) {
10639 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10640     Py_ssize_t wrapped_i = i;
10641     if (wraparound & unlikely(i < 0)) {
10642         wrapped_i += PyTuple_GET_SIZE(o);
10643     }
10644     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
10645         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
10646         Py_INCREF(r);
10647         return r;
10648     }
10649     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
10650 #else
10651     return PySequence_GetItem(o, i);
10652 #endif
10653 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)10654 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
10655                                                      CYTHON_NCP_UNUSED int wraparound,
10656                                                      CYTHON_NCP_UNUSED int boundscheck) {
10657 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
10658     if (is_list || PyList_CheckExact(o)) {
10659         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
10660         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
10661             PyObject *r = PyList_GET_ITEM(o, n);
10662             Py_INCREF(r);
10663             return r;
10664         }
10665     }
10666     else if (PyTuple_CheckExact(o)) {
10667         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
10668         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
10669             PyObject *r = PyTuple_GET_ITEM(o, n);
10670             Py_INCREF(r);
10671             return r;
10672         }
10673     } else {
10674         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
10675         if (likely(m && m->sq_item)) {
10676             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
10677                 Py_ssize_t l = m->sq_length(o);
10678                 if (likely(l >= 0)) {
10679                     i += l;
10680                 } else {
10681                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
10682                         return NULL;
10683                     PyErr_Clear();
10684                 }
10685             }
10686             return m->sq_item(o, i);
10687         }
10688     }
10689 #else
10690     if (is_list || PySequence_Check(o)) {
10691         return PySequence_GetItem(o, i);
10692     }
10693 #endif
10694     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
10695 }
10696 
10697 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)10698 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
10699     PyErr_Format(PyExc_ValueError,
10700                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
10701 }
10702 
10703 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)10704 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
10705     PyErr_Format(PyExc_ValueError,
10706                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
10707                  index, (index == 1) ? "" : "s");
10708 }
10709 
10710 /* IterFinish */
__Pyx_IterFinish(void)10711 static CYTHON_INLINE int __Pyx_IterFinish(void) {
10712 #if CYTHON_FAST_THREAD_STATE
10713     PyThreadState *tstate = __Pyx_PyThreadState_Current;
10714     PyObject* exc_type = tstate->curexc_type;
10715     if (unlikely(exc_type)) {
10716         if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
10717             PyObject *exc_value, *exc_tb;
10718             exc_value = tstate->curexc_value;
10719             exc_tb = tstate->curexc_traceback;
10720             tstate->curexc_type = 0;
10721             tstate->curexc_value = 0;
10722             tstate->curexc_traceback = 0;
10723             Py_DECREF(exc_type);
10724             Py_XDECREF(exc_value);
10725             Py_XDECREF(exc_tb);
10726             return 0;
10727         } else {
10728             return -1;
10729         }
10730     }
10731     return 0;
10732 #else
10733     if (unlikely(PyErr_Occurred())) {
10734         if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
10735             PyErr_Clear();
10736             return 0;
10737         } else {
10738             return -1;
10739         }
10740     }
10741     return 0;
10742 #endif
10743 }
10744 
10745 /* UnpackItemEndCheck */
__Pyx_IternextUnpackEndCheck(PyObject * retval,Py_ssize_t expected)10746 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
10747     if (unlikely(retval)) {
10748         Py_DECREF(retval);
10749         __Pyx_RaiseTooManyValuesError(expected);
10750         return -1;
10751     } else {
10752         return __Pyx_IterFinish();
10753     }
10754     return 0;
10755 }
10756 
10757 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)10758 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
10759     PyObject *empty_list = 0;
10760     PyObject *module = 0;
10761     PyObject *global_dict = 0;
10762     PyObject *empty_dict = 0;
10763     PyObject *list;
10764     #if PY_MAJOR_VERSION < 3
10765     PyObject *py_import;
10766     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
10767     if (!py_import)
10768         goto bad;
10769     #endif
10770     if (from_list)
10771         list = from_list;
10772     else {
10773         empty_list = PyList_New(0);
10774         if (!empty_list)
10775             goto bad;
10776         list = empty_list;
10777     }
10778     global_dict = PyModule_GetDict(__pyx_m);
10779     if (!global_dict)
10780         goto bad;
10781     empty_dict = PyDict_New();
10782     if (!empty_dict)
10783         goto bad;
10784     {
10785         #if PY_MAJOR_VERSION >= 3
10786         if (level == -1) {
10787             if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
10788                 module = PyImport_ImportModuleLevelObject(
10789                     name, global_dict, empty_dict, list, 1);
10790                 if (!module) {
10791                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
10792                         goto bad;
10793                     PyErr_Clear();
10794                 }
10795             }
10796             level = 0;
10797         }
10798         #endif
10799         if (!module) {
10800             #if PY_MAJOR_VERSION < 3
10801             PyObject *py_level = PyInt_FromLong(level);
10802             if (!py_level)
10803                 goto bad;
10804             module = PyObject_CallFunctionObjArgs(py_import,
10805                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
10806             Py_DECREF(py_level);
10807             #else
10808             module = PyImport_ImportModuleLevelObject(
10809                 name, global_dict, empty_dict, list, level);
10810             #endif
10811         }
10812     }
10813 bad:
10814     #if PY_MAJOR_VERSION < 3
10815     Py_XDECREF(py_import);
10816     #endif
10817     Py_XDECREF(empty_list);
10818     Py_XDECREF(empty_dict);
10819     return module;
10820 }
10821 
10822 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)10823 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
10824     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
10825     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
10826         PyErr_Format(PyExc_ImportError,
10827         #if PY_MAJOR_VERSION < 3
10828             "cannot import name %.230s", PyString_AS_STRING(name));
10829         #else
10830             "cannot import name %S", name);
10831         #endif
10832     }
10833     return value;
10834 }
10835 
10836 /* RaiseException */
10837 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)10838 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
10839                         CYTHON_UNUSED PyObject *cause) {
10840     __Pyx_PyThreadState_declare
10841     Py_XINCREF(type);
10842     if (!value || value == Py_None)
10843         value = NULL;
10844     else
10845         Py_INCREF(value);
10846     if (!tb || tb == Py_None)
10847         tb = NULL;
10848     else {
10849         Py_INCREF(tb);
10850         if (!PyTraceBack_Check(tb)) {
10851             PyErr_SetString(PyExc_TypeError,
10852                 "raise: arg 3 must be a traceback or None");
10853             goto raise_error;
10854         }
10855     }
10856     if (PyType_Check(type)) {
10857 #if CYTHON_COMPILING_IN_PYPY
10858         if (!value) {
10859             Py_INCREF(Py_None);
10860             value = Py_None;
10861         }
10862 #endif
10863         PyErr_NormalizeException(&type, &value, &tb);
10864     } else {
10865         if (value) {
10866             PyErr_SetString(PyExc_TypeError,
10867                 "instance exception may not have a separate value");
10868             goto raise_error;
10869         }
10870         value = type;
10871         type = (PyObject*) Py_TYPE(type);
10872         Py_INCREF(type);
10873         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
10874             PyErr_SetString(PyExc_TypeError,
10875                 "raise: exception class must be a subclass of BaseException");
10876             goto raise_error;
10877         }
10878     }
10879     __Pyx_PyThreadState_assign
10880     __Pyx_ErrRestore(type, value, tb);
10881     return;
10882 raise_error:
10883     Py_XDECREF(value);
10884     Py_XDECREF(type);
10885     Py_XDECREF(tb);
10886     return;
10887 }
10888 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)10889 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
10890     PyObject* owned_instance = NULL;
10891     if (tb == Py_None) {
10892         tb = 0;
10893     } else if (tb && !PyTraceBack_Check(tb)) {
10894         PyErr_SetString(PyExc_TypeError,
10895             "raise: arg 3 must be a traceback or None");
10896         goto bad;
10897     }
10898     if (value == Py_None)
10899         value = 0;
10900     if (PyExceptionInstance_Check(type)) {
10901         if (value) {
10902             PyErr_SetString(PyExc_TypeError,
10903                 "instance exception may not have a separate value");
10904             goto bad;
10905         }
10906         value = type;
10907         type = (PyObject*) Py_TYPE(value);
10908     } else if (PyExceptionClass_Check(type)) {
10909         PyObject *instance_class = NULL;
10910         if (value && PyExceptionInstance_Check(value)) {
10911             instance_class = (PyObject*) Py_TYPE(value);
10912             if (instance_class != type) {
10913                 int is_subclass = PyObject_IsSubclass(instance_class, type);
10914                 if (!is_subclass) {
10915                     instance_class = NULL;
10916                 } else if (unlikely(is_subclass == -1)) {
10917                     goto bad;
10918                 } else {
10919                     type = instance_class;
10920                 }
10921             }
10922         }
10923         if (!instance_class) {
10924             PyObject *args;
10925             if (!value)
10926                 args = PyTuple_New(0);
10927             else if (PyTuple_Check(value)) {
10928                 Py_INCREF(value);
10929                 args = value;
10930             } else
10931                 args = PyTuple_Pack(1, value);
10932             if (!args)
10933                 goto bad;
10934             owned_instance = PyObject_Call(type, args, NULL);
10935             Py_DECREF(args);
10936             if (!owned_instance)
10937                 goto bad;
10938             value = owned_instance;
10939             if (!PyExceptionInstance_Check(value)) {
10940                 PyErr_Format(PyExc_TypeError,
10941                              "calling %R should have returned an instance of "
10942                              "BaseException, not %R",
10943                              type, Py_TYPE(value));
10944                 goto bad;
10945             }
10946         }
10947     } else {
10948         PyErr_SetString(PyExc_TypeError,
10949             "raise: exception class must be a subclass of BaseException");
10950         goto bad;
10951     }
10952     if (cause) {
10953         PyObject *fixed_cause;
10954         if (cause == Py_None) {
10955             fixed_cause = NULL;
10956         } else if (PyExceptionClass_Check(cause)) {
10957             fixed_cause = PyObject_CallObject(cause, NULL);
10958             if (fixed_cause == NULL)
10959                 goto bad;
10960         } else if (PyExceptionInstance_Check(cause)) {
10961             fixed_cause = cause;
10962             Py_INCREF(fixed_cause);
10963         } else {
10964             PyErr_SetString(PyExc_TypeError,
10965                             "exception causes must derive from "
10966                             "BaseException");
10967             goto bad;
10968         }
10969         PyException_SetCause(value, fixed_cause);
10970     }
10971     PyErr_SetObject(type, value);
10972     if (tb) {
10973 #if CYTHON_COMPILING_IN_PYPY
10974         PyObject *tmp_type, *tmp_value, *tmp_tb;
10975         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
10976         Py_INCREF(tb);
10977         PyErr_Restore(tmp_type, tmp_value, tb);
10978         Py_XDECREF(tmp_tb);
10979 #else
10980         PyThreadState *tstate = __Pyx_PyThreadState_Current;
10981         PyObject* tmp_tb = tstate->curexc_traceback;
10982         if (tb != tmp_tb) {
10983             Py_INCREF(tb);
10984             tstate->curexc_traceback = tb;
10985             Py_XDECREF(tmp_tb);
10986         }
10987 #endif
10988     }
10989 bad:
10990     Py_XDECREF(owned_instance);
10991     return;
10992 }
10993 #endif
10994 
10995 /* HasAttr */
__Pyx_HasAttr(PyObject * o,PyObject * n)10996 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
10997     PyObject *r;
10998     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
10999         PyErr_SetString(PyExc_TypeError,
11000                         "hasattr(): attribute name must be string");
11001         return -1;
11002     }
11003     r = __Pyx_GetAttr(o, n);
11004     if (unlikely(!r)) {
11005         PyErr_Clear();
11006         return 0;
11007     } else {
11008         Py_DECREF(r);
11009         return 1;
11010     }
11011 }
11012 
11013 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)11014 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
11015     if (unlikely(!type)) {
11016         PyErr_SetString(PyExc_SystemError, "Missing type object");
11017         return 0;
11018     }
11019     if (likely(__Pyx_TypeCheck(obj, type)))
11020         return 1;
11021     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
11022                  Py_TYPE(obj)->tp_name, type->tp_name);
11023     return 0;
11024 }
11025 
11026 /* GetTopmostException */
11027 #if CYTHON_USE_EXC_INFO_STACK
11028 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)11029 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
11030 {
11031     _PyErr_StackItem *exc_info = tstate->exc_info;
11032     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
11033            exc_info->previous_item != NULL)
11034     {
11035         exc_info = exc_info->previous_item;
11036     }
11037     return exc_info;
11038 }
11039 #endif
11040 
11041 /* SaveResetException */
11042 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)11043 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
11044     #if CYTHON_USE_EXC_INFO_STACK
11045     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
11046     *type = exc_info->exc_type;
11047     *value = exc_info->exc_value;
11048     *tb = exc_info->exc_traceback;
11049     #else
11050     *type = tstate->exc_type;
11051     *value = tstate->exc_value;
11052     *tb = tstate->exc_traceback;
11053     #endif
11054     Py_XINCREF(*type);
11055     Py_XINCREF(*value);
11056     Py_XINCREF(*tb);
11057 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)11058 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
11059     PyObject *tmp_type, *tmp_value, *tmp_tb;
11060     #if CYTHON_USE_EXC_INFO_STACK
11061     _PyErr_StackItem *exc_info = tstate->exc_info;
11062     tmp_type = exc_info->exc_type;
11063     tmp_value = exc_info->exc_value;
11064     tmp_tb = exc_info->exc_traceback;
11065     exc_info->exc_type = type;
11066     exc_info->exc_value = value;
11067     exc_info->exc_traceback = tb;
11068     #else
11069     tmp_type = tstate->exc_type;
11070     tmp_value = tstate->exc_value;
11071     tmp_tb = tstate->exc_traceback;
11072     tstate->exc_type = type;
11073     tstate->exc_value = value;
11074     tstate->exc_traceback = tb;
11075     #endif
11076     Py_XDECREF(tmp_type);
11077     Py_XDECREF(tmp_value);
11078     Py_XDECREF(tmp_tb);
11079 }
11080 #endif
11081 
11082 /* GetException */
11083 #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)11084 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
11085 #else
11086 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
11087 #endif
11088 {
11089     PyObject *local_type, *local_value, *local_tb;
11090 #if CYTHON_FAST_THREAD_STATE
11091     PyObject *tmp_type, *tmp_value, *tmp_tb;
11092     local_type = tstate->curexc_type;
11093     local_value = tstate->curexc_value;
11094     local_tb = tstate->curexc_traceback;
11095     tstate->curexc_type = 0;
11096     tstate->curexc_value = 0;
11097     tstate->curexc_traceback = 0;
11098 #else
11099     PyErr_Fetch(&local_type, &local_value, &local_tb);
11100 #endif
11101     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
11102 #if CYTHON_FAST_THREAD_STATE
11103     if (unlikely(tstate->curexc_type))
11104 #else
11105     if (unlikely(PyErr_Occurred()))
11106 #endif
11107         goto bad;
11108     #if PY_MAJOR_VERSION >= 3
11109     if (local_tb) {
11110         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
11111             goto bad;
11112     }
11113     #endif
11114     Py_XINCREF(local_tb);
11115     Py_XINCREF(local_type);
11116     Py_XINCREF(local_value);
11117     *type = local_type;
11118     *value = local_value;
11119     *tb = local_tb;
11120 #if CYTHON_FAST_THREAD_STATE
11121     #if CYTHON_USE_EXC_INFO_STACK
11122     {
11123         _PyErr_StackItem *exc_info = tstate->exc_info;
11124         tmp_type = exc_info->exc_type;
11125         tmp_value = exc_info->exc_value;
11126         tmp_tb = exc_info->exc_traceback;
11127         exc_info->exc_type = local_type;
11128         exc_info->exc_value = local_value;
11129         exc_info->exc_traceback = local_tb;
11130     }
11131     #else
11132     tmp_type = tstate->exc_type;
11133     tmp_value = tstate->exc_value;
11134     tmp_tb = tstate->exc_traceback;
11135     tstate->exc_type = local_type;
11136     tstate->exc_value = local_value;
11137     tstate->exc_traceback = local_tb;
11138     #endif
11139     Py_XDECREF(tmp_type);
11140     Py_XDECREF(tmp_value);
11141     Py_XDECREF(tmp_tb);
11142 #else
11143     PyErr_SetExcInfo(local_type, local_value, local_tb);
11144 #endif
11145     return 0;
11146 bad:
11147     *type = 0;
11148     *value = 0;
11149     *tb = 0;
11150     Py_XDECREF(local_type);
11151     Py_XDECREF(local_value);
11152     Py_XDECREF(local_tb);
11153     return -1;
11154 }
11155 
11156 /* CallNextTpDealloc */
__Pyx_call_next_tp_dealloc(PyObject * obj,destructor current_tp_dealloc)11157 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
11158     PyTypeObject* type = Py_TYPE(obj);
11159     while (type && type->tp_dealloc != current_tp_dealloc)
11160         type = type->tp_base;
11161     while (type && type->tp_dealloc == current_tp_dealloc)
11162         type = type->tp_base;
11163     if (type)
11164         type->tp_dealloc(obj);
11165 }
11166 
11167 /* CallNextTpTraverse */
__Pyx_call_next_tp_traverse(PyObject * obj,visitproc v,void * a,traverseproc current_tp_traverse)11168 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
11169     PyTypeObject* type = Py_TYPE(obj);
11170     while (type && type->tp_traverse != current_tp_traverse)
11171         type = type->tp_base;
11172     while (type && type->tp_traverse == current_tp_traverse)
11173         type = type->tp_base;
11174     if (type && type->tp_traverse)
11175         return type->tp_traverse(obj, v, a);
11176     return 0;
11177 }
11178 
11179 /* CallNextTpClear */
__Pyx_call_next_tp_clear(PyObject * obj,inquiry current_tp_clear)11180 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
11181     PyTypeObject* type = Py_TYPE(obj);
11182     while (type && type->tp_clear != current_tp_clear)
11183         type = type->tp_base;
11184     while (type && type->tp_clear == current_tp_clear)
11185         type = type->tp_base;
11186     if (type && type->tp_clear)
11187         type->tp_clear(obj);
11188 }
11189 
11190 /* TypeImport */
11191 #ifndef __PYX_HAVE_RT_ImportType
11192 #define __PYX_HAVE_RT_ImportType
__Pyx_ImportType(PyObject * module,const char * module_name,const char * class_name,size_t size,enum __Pyx_ImportType_CheckSize check_size)11193 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
11194     size_t size, enum __Pyx_ImportType_CheckSize check_size)
11195 {
11196     PyObject *result = 0;
11197     char warning[200];
11198     Py_ssize_t basicsize;
11199 #ifdef Py_LIMITED_API
11200     PyObject *py_basicsize;
11201 #endif
11202     result = PyObject_GetAttrString(module, class_name);
11203     if (!result)
11204         goto bad;
11205     if (!PyType_Check(result)) {
11206         PyErr_Format(PyExc_TypeError,
11207             "%.200s.%.200s is not a type object",
11208             module_name, class_name);
11209         goto bad;
11210     }
11211 #ifndef Py_LIMITED_API
11212     basicsize = ((PyTypeObject *)result)->tp_basicsize;
11213 #else
11214     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
11215     if (!py_basicsize)
11216         goto bad;
11217     basicsize = PyLong_AsSsize_t(py_basicsize);
11218     Py_DECREF(py_basicsize);
11219     py_basicsize = 0;
11220     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
11221         goto bad;
11222 #endif
11223     if ((size_t)basicsize < size) {
11224         PyErr_Format(PyExc_ValueError,
11225             "%.200s.%.200s size changed, may indicate binary incompatibility. "
11226             "Expected %zd from C header, got %zd from PyObject",
11227             module_name, class_name, size, basicsize);
11228         goto bad;
11229     }
11230     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
11231         PyErr_Format(PyExc_ValueError,
11232             "%.200s.%.200s size changed, may indicate binary incompatibility. "
11233             "Expected %zd from C header, got %zd from PyObject",
11234             module_name, class_name, size, basicsize);
11235         goto bad;
11236     }
11237     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
11238         PyOS_snprintf(warning, sizeof(warning),
11239             "%s.%s size changed, may indicate binary incompatibility. "
11240             "Expected %zd from C header, got %zd from PyObject",
11241             module_name, class_name, size, basicsize);
11242         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
11243     }
11244     return (PyTypeObject *)result;
11245 bad:
11246     Py_XDECREF(result);
11247     return NULL;
11248 }
11249 #endif
11250 
11251 /* GetVTable */
__Pyx_GetVtable(PyObject * dict)11252 static void* __Pyx_GetVtable(PyObject *dict) {
11253     void* ptr;
11254     PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
11255     if (!ob)
11256         goto bad;
11257 #if PY_VERSION_HEX >= 0x02070000
11258     ptr = PyCapsule_GetPointer(ob, 0);
11259 #else
11260     ptr = PyCObject_AsVoidPtr(ob);
11261 #endif
11262     if (!ptr && !PyErr_Occurred())
11263         PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
11264     Py_DECREF(ob);
11265     return ptr;
11266 bad:
11267     Py_XDECREF(ob);
11268     return NULL;
11269 }
11270 
11271 /* PyObject_GenericGetAttrNoDict */
11272 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)11273 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
11274     PyErr_Format(PyExc_AttributeError,
11275 #if PY_MAJOR_VERSION >= 3
11276                  "'%.50s' object has no attribute '%U'",
11277                  tp->tp_name, attr_name);
11278 #else
11279                  "'%.50s' object has no attribute '%.400s'",
11280                  tp->tp_name, PyString_AS_STRING(attr_name));
11281 #endif
11282     return NULL;
11283 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)11284 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
11285     PyObject *descr;
11286     PyTypeObject *tp = Py_TYPE(obj);
11287     if (unlikely(!PyString_Check(attr_name))) {
11288         return PyObject_GenericGetAttr(obj, attr_name);
11289     }
11290     assert(!tp->tp_dictoffset);
11291     descr = _PyType_Lookup(tp, attr_name);
11292     if (unlikely(!descr)) {
11293         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
11294     }
11295     Py_INCREF(descr);
11296     #if PY_MAJOR_VERSION < 3
11297     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
11298     #endif
11299     {
11300         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
11301         if (unlikely(f)) {
11302             PyObject *res = f(descr, obj, (PyObject *)tp);
11303             Py_DECREF(descr);
11304             return res;
11305         }
11306     }
11307     return descr;
11308 }
11309 #endif
11310 
11311 /* PyObject_GenericGetAttr */
11312 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)11313 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
11314     if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
11315         return PyObject_GenericGetAttr(obj, attr_name);
11316     }
11317     return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
11318 }
11319 #endif
11320 
11321 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)11322 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
11323 #if PY_VERSION_HEX >= 0x02070000
11324     PyObject *ob = PyCapsule_New(vtable, 0, 0);
11325 #else
11326     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
11327 #endif
11328     if (!ob)
11329         goto bad;
11330     if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
11331         goto bad;
11332     Py_DECREF(ob);
11333     return 0;
11334 bad:
11335     Py_XDECREF(ob);
11336     return -1;
11337 }
11338 
11339 /* PyObjectGetAttrStrNoError */
__Pyx_PyObject_GetAttrStr_ClearAttributeError(void)11340 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
11341     __Pyx_PyThreadState_declare
11342     __Pyx_PyThreadState_assign
11343     if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
11344         __Pyx_PyErr_Clear();
11345 }
__Pyx_PyObject_GetAttrStrNoError(PyObject * obj,PyObject * attr_name)11346 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
11347     PyObject *result;
11348 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
11349     PyTypeObject* tp = Py_TYPE(obj);
11350     if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
11351         return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
11352     }
11353 #endif
11354     result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
11355     if (unlikely(!result)) {
11356         __Pyx_PyObject_GetAttrStr_ClearAttributeError();
11357     }
11358     return result;
11359 }
11360 
11361 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)11362 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
11363   int ret;
11364   PyObject *name_attr;
11365   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
11366   if (likely(name_attr)) {
11367       ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
11368   } else {
11369       ret = -1;
11370   }
11371   if (unlikely(ret < 0)) {
11372       PyErr_Clear();
11373       ret = 0;
11374   }
11375   Py_XDECREF(name_attr);
11376   return ret;
11377 }
__Pyx_setup_reduce(PyObject * type_obj)11378 static int __Pyx_setup_reduce(PyObject* type_obj) {
11379     int ret = 0;
11380     PyObject *object_reduce = NULL;
11381     PyObject *object_reduce_ex = NULL;
11382     PyObject *reduce = NULL;
11383     PyObject *reduce_ex = NULL;
11384     PyObject *reduce_cython = NULL;
11385     PyObject *setstate = NULL;
11386     PyObject *setstate_cython = NULL;
11387 #if CYTHON_USE_PYTYPE_LOOKUP
11388     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
11389 #else
11390     if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
11391 #endif
11392 #if CYTHON_USE_PYTYPE_LOOKUP
11393     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
11394 #else
11395     object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
11396 #endif
11397     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
11398     if (reduce_ex == object_reduce_ex) {
11399 #if CYTHON_USE_PYTYPE_LOOKUP
11400         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
11401 #else
11402         object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
11403 #endif
11404         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
11405         if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
11406             reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
11407             if (likely(reduce_cython)) {
11408                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
11409                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
11410             } else if (reduce == object_reduce || PyErr_Occurred()) {
11411                 goto __PYX_BAD;
11412             }
11413             setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
11414             if (!setstate) PyErr_Clear();
11415             if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
11416                 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
11417                 if (likely(setstate_cython)) {
11418                     ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
11419                     ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
11420                 } else if (!setstate || PyErr_Occurred()) {
11421                     goto __PYX_BAD;
11422                 }
11423             }
11424             PyType_Modified((PyTypeObject*)type_obj);
11425         }
11426     }
11427     goto __PYX_GOOD;
11428 __PYX_BAD:
11429     if (!PyErr_Occurred())
11430         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
11431     ret = -1;
11432 __PYX_GOOD:
11433 #if !CYTHON_USE_PYTYPE_LOOKUP
11434     Py_XDECREF(object_reduce);
11435     Py_XDECREF(object_reduce_ex);
11436 #endif
11437     Py_XDECREF(reduce);
11438     Py_XDECREF(reduce_ex);
11439     Py_XDECREF(reduce_cython);
11440     Py_XDECREF(setstate);
11441     Py_XDECREF(setstate_cython);
11442     return ret;
11443 }
11444 
11445 /* CLineInTraceback */
11446 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)11447 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
11448     PyObject *use_cline;
11449     PyObject *ptype, *pvalue, *ptraceback;
11450 #if CYTHON_COMPILING_IN_CPYTHON
11451     PyObject **cython_runtime_dict;
11452 #endif
11453     if (unlikely(!__pyx_cython_runtime)) {
11454         return c_line;
11455     }
11456     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
11457 #if CYTHON_COMPILING_IN_CPYTHON
11458     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
11459     if (likely(cython_runtime_dict)) {
11460         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
11461             use_cline, *cython_runtime_dict,
11462             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
11463     } else
11464 #endif
11465     {
11466       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
11467       if (use_cline_obj) {
11468         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
11469         Py_DECREF(use_cline_obj);
11470       } else {
11471         PyErr_Clear();
11472         use_cline = NULL;
11473       }
11474     }
11475     if (!use_cline) {
11476         c_line = 0;
11477         (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
11478     }
11479     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
11480         c_line = 0;
11481     }
11482     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
11483     return c_line;
11484 }
11485 #endif
11486 
11487 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)11488 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
11489     int start = 0, mid = 0, end = count - 1;
11490     if (end >= 0 && code_line > entries[end].code_line) {
11491         return count;
11492     }
11493     while (start < end) {
11494         mid = start + (end - start) / 2;
11495         if (code_line < entries[mid].code_line) {
11496             end = mid;
11497         } else if (code_line > entries[mid].code_line) {
11498              start = mid + 1;
11499         } else {
11500             return mid;
11501         }
11502     }
11503     if (code_line <= entries[mid].code_line) {
11504         return mid;
11505     } else {
11506         return mid + 1;
11507     }
11508 }
__pyx_find_code_object(int code_line)11509 static PyCodeObject *__pyx_find_code_object(int code_line) {
11510     PyCodeObject* code_object;
11511     int pos;
11512     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
11513         return NULL;
11514     }
11515     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
11516     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
11517         return NULL;
11518     }
11519     code_object = __pyx_code_cache.entries[pos].code_object;
11520     Py_INCREF(code_object);
11521     return code_object;
11522 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)11523 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
11524     int pos, i;
11525     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
11526     if (unlikely(!code_line)) {
11527         return;
11528     }
11529     if (unlikely(!entries)) {
11530         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
11531         if (likely(entries)) {
11532             __pyx_code_cache.entries = entries;
11533             __pyx_code_cache.max_count = 64;
11534             __pyx_code_cache.count = 1;
11535             entries[0].code_line = code_line;
11536             entries[0].code_object = code_object;
11537             Py_INCREF(code_object);
11538         }
11539         return;
11540     }
11541     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
11542     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
11543         PyCodeObject* tmp = entries[pos].code_object;
11544         entries[pos].code_object = code_object;
11545         Py_DECREF(tmp);
11546         return;
11547     }
11548     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
11549         int new_max = __pyx_code_cache.max_count + 64;
11550         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
11551             __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
11552         if (unlikely(!entries)) {
11553             return;
11554         }
11555         __pyx_code_cache.entries = entries;
11556         __pyx_code_cache.max_count = new_max;
11557     }
11558     for (i=__pyx_code_cache.count; i>pos; i--) {
11559         entries[i] = entries[i-1];
11560     }
11561     entries[pos].code_line = code_line;
11562     entries[pos].code_object = code_object;
11563     __pyx_code_cache.count++;
11564     Py_INCREF(code_object);
11565 }
11566 
11567 /* AddTraceback */
11568 #include "compile.h"
11569 #include "frameobject.h"
11570 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)11571 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
11572             const char *funcname, int c_line,
11573             int py_line, const char *filename) {
11574     PyCodeObject *py_code = NULL;
11575     PyObject *py_funcname = NULL;
11576     #if PY_MAJOR_VERSION < 3
11577     PyObject *py_srcfile = NULL;
11578     py_srcfile = PyString_FromString(filename);
11579     if (!py_srcfile) goto bad;
11580     #endif
11581     if (c_line) {
11582         #if PY_MAJOR_VERSION < 3
11583         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
11584         if (!py_funcname) goto bad;
11585         #else
11586         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
11587         if (!py_funcname) goto bad;
11588         funcname = PyUnicode_AsUTF8(py_funcname);
11589         if (!funcname) goto bad;
11590         #endif
11591     }
11592     else {
11593         #if PY_MAJOR_VERSION < 3
11594         py_funcname = PyString_FromString(funcname);
11595         if (!py_funcname) goto bad;
11596         #endif
11597     }
11598     #if PY_MAJOR_VERSION < 3
11599     py_code = __Pyx_PyCode_New(
11600         0,
11601         0,
11602         0,
11603         0,
11604         0,
11605         __pyx_empty_bytes, /*PyObject *code,*/
11606         __pyx_empty_tuple, /*PyObject *consts,*/
11607         __pyx_empty_tuple, /*PyObject *names,*/
11608         __pyx_empty_tuple, /*PyObject *varnames,*/
11609         __pyx_empty_tuple, /*PyObject *freevars,*/
11610         __pyx_empty_tuple, /*PyObject *cellvars,*/
11611         py_srcfile,   /*PyObject *filename,*/
11612         py_funcname,  /*PyObject *name,*/
11613         py_line,
11614         __pyx_empty_bytes  /*PyObject *lnotab*/
11615     );
11616     Py_DECREF(py_srcfile);
11617     #else
11618     py_code = PyCode_NewEmpty(filename, funcname, py_line);
11619     #endif
11620     Py_XDECREF(py_funcname);  // XDECREF since it's only set on Py3 if cline
11621     return py_code;
11622 bad:
11623     Py_XDECREF(py_funcname);
11624     #if PY_MAJOR_VERSION < 3
11625     Py_XDECREF(py_srcfile);
11626     #endif
11627     return NULL;
11628 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)11629 static void __Pyx_AddTraceback(const char *funcname, int c_line,
11630                                int py_line, const char *filename) {
11631     PyCodeObject *py_code = 0;
11632     PyFrameObject *py_frame = 0;
11633     PyThreadState *tstate = __Pyx_PyThreadState_Current;
11634     if (c_line) {
11635         c_line = __Pyx_CLineForTraceback(tstate, c_line);
11636     }
11637     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
11638     if (!py_code) {
11639         py_code = __Pyx_CreateCodeObjectForTraceback(
11640             funcname, c_line, py_line, filename);
11641         if (!py_code) goto bad;
11642         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
11643     }
11644     py_frame = PyFrame_New(
11645         tstate,            /*PyThreadState *tstate,*/
11646         py_code,           /*PyCodeObject *code,*/
11647         __pyx_d,    /*PyObject *globals,*/
11648         0                  /*PyObject *locals*/
11649     );
11650     if (!py_frame) goto bad;
11651     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
11652     PyTraceBack_Here(py_frame);
11653 bad:
11654     Py_XDECREF(py_code);
11655     Py_XDECREF(py_frame);
11656 }
11657 
11658 /* CIntFromPyVerify */
11659 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
11660     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
11661 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
11662     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
11663 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
11664     {\
11665         func_type value = func_value;\
11666         if (sizeof(target_type) < sizeof(func_type)) {\
11667             if (unlikely(value != (func_type) (target_type) value)) {\
11668                 func_type zero = 0;\
11669                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
11670                     return (target_type) -1;\
11671                 if (is_unsigned && unlikely(value < zero))\
11672                     goto raise_neg_overflow;\
11673                 else\
11674                     goto raise_overflow;\
11675             }\
11676         }\
11677         return (target_type) value;\
11678     }
11679 
11680 /* Declarations */
11681 #if CYTHON_CCOMPLEX
11682   #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)11683     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
11684       return ::std::complex< float >(x, y);
11685     }
11686   #else
__pyx_t_float_complex_from_parts(float x,float y)11687     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
11688       return x + y*(__pyx_t_float_complex)_Complex_I;
11689     }
11690   #endif
11691 #else
__pyx_t_float_complex_from_parts(float x,float y)11692     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
11693       __pyx_t_float_complex z;
11694       z.real = x;
11695       z.imag = y;
11696       return z;
11697     }
11698 #endif
11699 
11700 /* Arithmetic */
11701 #if CYTHON_CCOMPLEX
11702 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)11703     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11704        return (a.real == b.real) && (a.imag == b.imag);
11705     }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)11706     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11707         __pyx_t_float_complex z;
11708         z.real = a.real + b.real;
11709         z.imag = a.imag + b.imag;
11710         return z;
11711     }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)11712     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11713         __pyx_t_float_complex z;
11714         z.real = a.real - b.real;
11715         z.imag = a.imag - b.imag;
11716         return z;
11717     }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)11718     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11719         __pyx_t_float_complex z;
11720         z.real = a.real * b.real - a.imag * b.imag;
11721         z.imag = a.real * b.imag + a.imag * b.real;
11722         return z;
11723     }
11724     #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)11725     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11726         if (b.imag == 0) {
11727             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
11728         } else if (fabsf(b.real) >= fabsf(b.imag)) {
11729             if (b.real == 0 && b.imag == 0) {
11730                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
11731             } else {
11732                 float r = b.imag / b.real;
11733                 float s = (float)(1.0) / (b.real + b.imag * r);
11734                 return __pyx_t_float_complex_from_parts(
11735                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
11736             }
11737         } else {
11738             float r = b.real / b.imag;
11739             float s = (float)(1.0) / (b.imag + b.real * r);
11740             return __pyx_t_float_complex_from_parts(
11741                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
11742         }
11743     }
11744     #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)11745     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11746         if (b.imag == 0) {
11747             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
11748         } else {
11749             float denom = b.real * b.real + b.imag * b.imag;
11750             return __pyx_t_float_complex_from_parts(
11751                 (a.real * b.real + a.imag * b.imag) / denom,
11752                 (a.imag * b.real - a.real * b.imag) / denom);
11753         }
11754     }
11755     #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)11756     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
11757         __pyx_t_float_complex z;
11758         z.real = -a.real;
11759         z.imag = -a.imag;
11760         return z;
11761     }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)11762     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
11763        return (a.real == 0) && (a.imag == 0);
11764     }
__Pyx_c_conj_float(__pyx_t_float_complex a)11765     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
11766         __pyx_t_float_complex z;
11767         z.real =  a.real;
11768         z.imag = -a.imag;
11769         return z;
11770     }
11771     #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)11772         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
11773           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
11774             return sqrtf(z.real*z.real + z.imag*z.imag);
11775           #else
11776             return hypotf(z.real, z.imag);
11777           #endif
11778         }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)11779         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11780             __pyx_t_float_complex z;
11781             float r, lnr, theta, z_r, z_theta;
11782             if (b.imag == 0 && b.real == (int)b.real) {
11783                 if (b.real < 0) {
11784                     float denom = a.real * a.real + a.imag * a.imag;
11785                     a.real = a.real / denom;
11786                     a.imag = -a.imag / denom;
11787                     b.real = -b.real;
11788                 }
11789                 switch ((int)b.real) {
11790                     case 0:
11791                         z.real = 1;
11792                         z.imag = 0;
11793                         return z;
11794                     case 1:
11795                         return a;
11796                     case 2:
11797                         return __Pyx_c_prod_float(a, a);
11798                     case 3:
11799                         z = __Pyx_c_prod_float(a, a);
11800                         return __Pyx_c_prod_float(z, a);
11801                     case 4:
11802                         z = __Pyx_c_prod_float(a, a);
11803                         return __Pyx_c_prod_float(z, z);
11804                 }
11805             }
11806             if (a.imag == 0) {
11807                 if (a.real == 0) {
11808                     return a;
11809                 } else if (b.imag == 0) {
11810                     z.real = powf(a.real, b.real);
11811                     z.imag = 0;
11812                     return z;
11813                 } else if (a.real > 0) {
11814                     r = a.real;
11815                     theta = 0;
11816                 } else {
11817                     r = -a.real;
11818                     theta = atan2f(0.0, -1.0);
11819                 }
11820             } else {
11821                 r = __Pyx_c_abs_float(a);
11822                 theta = atan2f(a.imag, a.real);
11823             }
11824             lnr = logf(r);
11825             z_r = expf(lnr * b.real - theta * b.imag);
11826             z_theta = theta * b.real + lnr * b.imag;
11827             z.real = z_r * cosf(z_theta);
11828             z.imag = z_r * sinf(z_theta);
11829             return z;
11830         }
11831     #endif
11832 #endif
11833 
11834 /* Declarations */
11835 #if CYTHON_CCOMPLEX
11836   #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)11837     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
11838       return ::std::complex< double >(x, y);
11839     }
11840   #else
__pyx_t_double_complex_from_parts(double x,double y)11841     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
11842       return x + y*(__pyx_t_double_complex)_Complex_I;
11843     }
11844   #endif
11845 #else
__pyx_t_double_complex_from_parts(double x,double y)11846     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
11847       __pyx_t_double_complex z;
11848       z.real = x;
11849       z.imag = y;
11850       return z;
11851     }
11852 #endif
11853 
11854 /* Arithmetic */
11855 #if CYTHON_CCOMPLEX
11856 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)11857     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11858        return (a.real == b.real) && (a.imag == b.imag);
11859     }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)11860     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11861         __pyx_t_double_complex z;
11862         z.real = a.real + b.real;
11863         z.imag = a.imag + b.imag;
11864         return z;
11865     }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)11866     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11867         __pyx_t_double_complex z;
11868         z.real = a.real - b.real;
11869         z.imag = a.imag - b.imag;
11870         return z;
11871     }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)11872     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11873         __pyx_t_double_complex z;
11874         z.real = a.real * b.real - a.imag * b.imag;
11875         z.imag = a.real * b.imag + a.imag * b.real;
11876         return z;
11877     }
11878     #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)11879     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11880         if (b.imag == 0) {
11881             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
11882         } else if (fabs(b.real) >= fabs(b.imag)) {
11883             if (b.real == 0 && b.imag == 0) {
11884                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
11885             } else {
11886                 double r = b.imag / b.real;
11887                 double s = (double)(1.0) / (b.real + b.imag * r);
11888                 return __pyx_t_double_complex_from_parts(
11889                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
11890             }
11891         } else {
11892             double r = b.real / b.imag;
11893             double s = (double)(1.0) / (b.imag + b.real * r);
11894             return __pyx_t_double_complex_from_parts(
11895                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
11896         }
11897     }
11898     #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)11899     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11900         if (b.imag == 0) {
11901             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
11902         } else {
11903             double denom = b.real * b.real + b.imag * b.imag;
11904             return __pyx_t_double_complex_from_parts(
11905                 (a.real * b.real + a.imag * b.imag) / denom,
11906                 (a.imag * b.real - a.real * b.imag) / denom);
11907         }
11908     }
11909     #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)11910     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
11911         __pyx_t_double_complex z;
11912         z.real = -a.real;
11913         z.imag = -a.imag;
11914         return z;
11915     }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)11916     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
11917        return (a.real == 0) && (a.imag == 0);
11918     }
__Pyx_c_conj_double(__pyx_t_double_complex a)11919     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
11920         __pyx_t_double_complex z;
11921         z.real =  a.real;
11922         z.imag = -a.imag;
11923         return z;
11924     }
11925     #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)11926         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
11927           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
11928             return sqrt(z.real*z.real + z.imag*z.imag);
11929           #else
11930             return hypot(z.real, z.imag);
11931           #endif
11932         }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)11933         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11934             __pyx_t_double_complex z;
11935             double r, lnr, theta, z_r, z_theta;
11936             if (b.imag == 0 && b.real == (int)b.real) {
11937                 if (b.real < 0) {
11938                     double denom = a.real * a.real + a.imag * a.imag;
11939                     a.real = a.real / denom;
11940                     a.imag = -a.imag / denom;
11941                     b.real = -b.real;
11942                 }
11943                 switch ((int)b.real) {
11944                     case 0:
11945                         z.real = 1;
11946                         z.imag = 0;
11947                         return z;
11948                     case 1:
11949                         return a;
11950                     case 2:
11951                         return __Pyx_c_prod_double(a, a);
11952                     case 3:
11953                         z = __Pyx_c_prod_double(a, a);
11954                         return __Pyx_c_prod_double(z, a);
11955                     case 4:
11956                         z = __Pyx_c_prod_double(a, a);
11957                         return __Pyx_c_prod_double(z, z);
11958                 }
11959             }
11960             if (a.imag == 0) {
11961                 if (a.real == 0) {
11962                     return a;
11963                 } else if (b.imag == 0) {
11964                     z.real = pow(a.real, b.real);
11965                     z.imag = 0;
11966                     return z;
11967                 } else if (a.real > 0) {
11968                     r = a.real;
11969                     theta = 0;
11970                 } else {
11971                     r = -a.real;
11972                     theta = atan2(0.0, -1.0);
11973                 }
11974             } else {
11975                 r = __Pyx_c_abs_double(a);
11976                 theta = atan2(a.imag, a.real);
11977             }
11978             lnr = log(r);
11979             z_r = exp(lnr * b.real - theta * b.imag);
11980             z_theta = theta * b.real + lnr * b.imag;
11981             z.real = z_r * cos(z_theta);
11982             z.imag = z_r * sin(z_theta);
11983             return z;
11984         }
11985     #endif
11986 #endif
11987 
11988 /* CIntToPy */
__Pyx_PyInt_From_unsigned_int(unsigned int value)11989 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
11990 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11991 #pragma GCC diagnostic push
11992 #pragma GCC diagnostic ignored "-Wconversion"
11993 #endif
11994     const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
11995 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11996 #pragma GCC diagnostic pop
11997 #endif
11998     const int is_unsigned = neg_one > const_zero;
11999     if (is_unsigned) {
12000         if (sizeof(unsigned int) < sizeof(long)) {
12001             return PyInt_FromLong((long) value);
12002         } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
12003             return PyLong_FromUnsignedLong((unsigned long) value);
12004 #ifdef HAVE_LONG_LONG
12005         } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
12006             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
12007 #endif
12008         }
12009     } else {
12010         if (sizeof(unsigned int) <= sizeof(long)) {
12011             return PyInt_FromLong((long) value);
12012 #ifdef HAVE_LONG_LONG
12013         } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
12014             return PyLong_FromLongLong((PY_LONG_LONG) value);
12015 #endif
12016         }
12017     }
12018     {
12019         int one = 1; int little = (int)*(unsigned char *)&one;
12020         unsigned char *bytes = (unsigned char *)&value;
12021         return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
12022                                      little, !is_unsigned);
12023     }
12024 }
12025 
12026 /* CIntFromPy */
__Pyx_PyInt_As_unsigned_int(PyObject * x)12027 static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
12028 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12029 #pragma GCC diagnostic push
12030 #pragma GCC diagnostic ignored "-Wconversion"
12031 #endif
12032     const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
12033 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12034 #pragma GCC diagnostic pop
12035 #endif
12036     const int is_unsigned = neg_one > const_zero;
12037 #if PY_MAJOR_VERSION < 3
12038     if (likely(PyInt_Check(x))) {
12039         if (sizeof(unsigned int) < sizeof(long)) {
12040             __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
12041         } else {
12042             long val = PyInt_AS_LONG(x);
12043             if (is_unsigned && unlikely(val < 0)) {
12044                 goto raise_neg_overflow;
12045             }
12046             return (unsigned int) val;
12047         }
12048     } else
12049 #endif
12050     if (likely(PyLong_Check(x))) {
12051         if (is_unsigned) {
12052 #if CYTHON_USE_PYLONG_INTERNALS
12053             const digit* digits = ((PyLongObject*)x)->ob_digit;
12054             switch (Py_SIZE(x)) {
12055                 case  0: return (unsigned int) 0;
12056                 case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0])
12057                 case 2:
12058                     if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
12059                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12060                             __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12061                         } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) {
12062                             return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
12063                         }
12064                     }
12065                     break;
12066                 case 3:
12067                     if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
12068                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12069                             __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12070                         } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) {
12071                             return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
12072                         }
12073                     }
12074                     break;
12075                 case 4:
12076                     if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
12077                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12078                             __PYX_VERIFY_RETURN_INT(unsigned 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])))
12079                         } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) {
12080                             return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
12081                         }
12082                     }
12083                     break;
12084             }
12085 #endif
12086 #if CYTHON_COMPILING_IN_CPYTHON
12087             if (unlikely(Py_SIZE(x) < 0)) {
12088                 goto raise_neg_overflow;
12089             }
12090 #else
12091             {
12092                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12093                 if (unlikely(result < 0))
12094                     return (unsigned int) -1;
12095                 if (unlikely(result == 1))
12096                     goto raise_neg_overflow;
12097             }
12098 #endif
12099             if (sizeof(unsigned int) <= sizeof(unsigned long)) {
12100                 __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
12101 #ifdef HAVE_LONG_LONG
12102             } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
12103                 __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
12104 #endif
12105             }
12106         } else {
12107 #if CYTHON_USE_PYLONG_INTERNALS
12108             const digit* digits = ((PyLongObject*)x)->ob_digit;
12109             switch (Py_SIZE(x)) {
12110                 case  0: return (unsigned int) 0;
12111                 case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0]))
12112                 case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +digits[0])
12113                 case -2:
12114                     if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) {
12115                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12116                             __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12117                         } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
12118                             return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
12119                         }
12120                     }
12121                     break;
12122                 case 2:
12123                     if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
12124                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12125                             __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12126                         } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
12127                             return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
12128                         }
12129                     }
12130                     break;
12131                 case -3:
12132                     if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
12133                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12134                             __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12135                         } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
12136                             return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
12137                         }
12138                     }
12139                     break;
12140                 case 3:
12141                     if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
12142                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12143                             __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12144                         } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
12145                             return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
12146                         }
12147                     }
12148                     break;
12149                 case -4:
12150                     if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
12151                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12152                             __PYX_VERIFY_RETURN_INT(unsigned 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])))
12153                         } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
12154                             return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
12155                         }
12156                     }
12157                     break;
12158                 case 4:
12159                     if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
12160                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12161                             __PYX_VERIFY_RETURN_INT(unsigned 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])))
12162                         } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
12163                             return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
12164                         }
12165                     }
12166                     break;
12167             }
12168 #endif
12169             if (sizeof(unsigned int) <= sizeof(long)) {
12170                 __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
12171 #ifdef HAVE_LONG_LONG
12172             } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
12173                 __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
12174 #endif
12175             }
12176         }
12177         {
12178 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
12179             PyErr_SetString(PyExc_RuntimeError,
12180                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
12181 #else
12182             unsigned int val;
12183             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
12184  #if PY_MAJOR_VERSION < 3
12185             if (likely(v) && !PyLong_Check(v)) {
12186                 PyObject *tmp = v;
12187                 v = PyNumber_Long(tmp);
12188                 Py_DECREF(tmp);
12189             }
12190  #endif
12191             if (likely(v)) {
12192                 int one = 1; int is_little = (int)*(unsigned char *)&one;
12193                 unsigned char *bytes = (unsigned char *)&val;
12194                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
12195                                               bytes, sizeof(val),
12196                                               is_little, !is_unsigned);
12197                 Py_DECREF(v);
12198                 if (likely(!ret))
12199                     return val;
12200             }
12201 #endif
12202             return (unsigned int) -1;
12203         }
12204     } else {
12205         unsigned int val;
12206         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
12207         if (!tmp) return (unsigned int) -1;
12208         val = __Pyx_PyInt_As_unsigned_int(tmp);
12209         Py_DECREF(tmp);
12210         return val;
12211     }
12212 raise_overflow:
12213     PyErr_SetString(PyExc_OverflowError,
12214         "value too large to convert to unsigned int");
12215     return (unsigned int) -1;
12216 raise_neg_overflow:
12217     PyErr_SetString(PyExc_OverflowError,
12218         "can't convert negative value to unsigned int");
12219     return (unsigned int) -1;
12220 }
12221 
12222 /* CIntToPy */
__Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value)12223 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value) {
12224 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12225 #pragma GCC diagnostic push
12226 #pragma GCC diagnostic ignored "-Wconversion"
12227 #endif
12228     const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG) -1, const_zero = (unsigned PY_LONG_LONG) 0;
12229 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12230 #pragma GCC diagnostic pop
12231 #endif
12232     const int is_unsigned = neg_one > const_zero;
12233     if (is_unsigned) {
12234         if (sizeof(unsigned PY_LONG_LONG) < sizeof(long)) {
12235             return PyInt_FromLong((long) value);
12236         } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long)) {
12237             return PyLong_FromUnsignedLong((unsigned long) value);
12238 #ifdef HAVE_LONG_LONG
12239         } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
12240             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
12241 #endif
12242         }
12243     } else {
12244         if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long)) {
12245             return PyInt_FromLong((long) value);
12246 #ifdef HAVE_LONG_LONG
12247         } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
12248             return PyLong_FromLongLong((PY_LONG_LONG) value);
12249 #endif
12250         }
12251     }
12252     {
12253         int one = 1; int little = (int)*(unsigned char *)&one;
12254         unsigned char *bytes = (unsigned char *)&value;
12255         return _PyLong_FromByteArray(bytes, sizeof(unsigned PY_LONG_LONG),
12256                                      little, !is_unsigned);
12257     }
12258 }
12259 
12260 /* CIntFromPy */
__Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject * x)12261 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject *x) {
12262 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12263 #pragma GCC diagnostic push
12264 #pragma GCC diagnostic ignored "-Wconversion"
12265 #endif
12266     const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG) -1, const_zero = (unsigned PY_LONG_LONG) 0;
12267 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12268 #pragma GCC diagnostic pop
12269 #endif
12270     const int is_unsigned = neg_one > const_zero;
12271 #if PY_MAJOR_VERSION < 3
12272     if (likely(PyInt_Check(x))) {
12273         if (sizeof(unsigned PY_LONG_LONG) < sizeof(long)) {
12274             __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, PyInt_AS_LONG(x))
12275         } else {
12276             long val = PyInt_AS_LONG(x);
12277             if (is_unsigned && unlikely(val < 0)) {
12278                 goto raise_neg_overflow;
12279             }
12280             return (unsigned PY_LONG_LONG) val;
12281         }
12282     } else
12283 #endif
12284     if (likely(PyLong_Check(x))) {
12285         if (is_unsigned) {
12286 #if CYTHON_USE_PYLONG_INTERNALS
12287             const digit* digits = ((PyLongObject*)x)->ob_digit;
12288             switch (Py_SIZE(x)) {
12289                 case  0: return (unsigned PY_LONG_LONG) 0;
12290                 case  1: __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, digit, digits[0])
12291                 case 2:
12292                     if (8 * sizeof(unsigned PY_LONG_LONG) > 1 * PyLong_SHIFT) {
12293                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12294                             __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12295                         } else if (8 * sizeof(unsigned PY_LONG_LONG) >= 2 * PyLong_SHIFT) {
12296                             return (unsigned PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
12297                         }
12298                     }
12299                     break;
12300                 case 3:
12301                     if (8 * sizeof(unsigned PY_LONG_LONG) > 2 * PyLong_SHIFT) {
12302                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12303                             __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12304                         } else if (8 * sizeof(unsigned PY_LONG_LONG) >= 3 * PyLong_SHIFT) {
12305                             return (unsigned PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
12306                         }
12307                     }
12308                     break;
12309                 case 4:
12310                     if (8 * sizeof(unsigned PY_LONG_LONG) > 3 * PyLong_SHIFT) {
12311                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12312                             __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_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])))
12313                         } else if (8 * sizeof(unsigned PY_LONG_LONG) >= 4 * PyLong_SHIFT) {
12314                             return (unsigned PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
12315                         }
12316                     }
12317                     break;
12318             }
12319 #endif
12320 #if CYTHON_COMPILING_IN_CPYTHON
12321             if (unlikely(Py_SIZE(x) < 0)) {
12322                 goto raise_neg_overflow;
12323             }
12324 #else
12325             {
12326                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12327                 if (unlikely(result < 0))
12328                     return (unsigned PY_LONG_LONG) -1;
12329                 if (unlikely(result == 1))
12330                     goto raise_neg_overflow;
12331             }
12332 #endif
12333             if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long)) {
12334                 __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x))
12335 #ifdef HAVE_LONG_LONG
12336             } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
12337                 __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
12338 #endif
12339             }
12340         } else {
12341 #if CYTHON_USE_PYLONG_INTERNALS
12342             const digit* digits = ((PyLongObject*)x)->ob_digit;
12343             switch (Py_SIZE(x)) {
12344                 case  0: return (unsigned PY_LONG_LONG) 0;
12345                 case -1: __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, sdigit, (sdigit) (-(sdigit)digits[0]))
12346                 case  1: __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG,  digit, +digits[0])
12347                 case -2:
12348                     if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT) {
12349                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12350                             __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12351                         } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
12352                             return (unsigned PY_LONG_LONG) (((unsigned PY_LONG_LONG)-1)*(((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
12353                         }
12354                     }
12355                     break;
12356                 case 2:
12357                     if (8 * sizeof(unsigned PY_LONG_LONG) > 1 * PyLong_SHIFT) {
12358                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12359                             __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12360                         } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
12361                             return (unsigned PY_LONG_LONG) ((((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
12362                         }
12363                     }
12364                     break;
12365                 case -3:
12366                     if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
12367                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12368                             __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12369                         } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
12370                             return (unsigned PY_LONG_LONG) (((unsigned PY_LONG_LONG)-1)*(((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
12371                         }
12372                     }
12373                     break;
12374                 case 3:
12375                     if (8 * sizeof(unsigned PY_LONG_LONG) > 2 * PyLong_SHIFT) {
12376                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12377                             __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12378                         } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
12379                             return (unsigned PY_LONG_LONG) ((((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
12380                         }
12381                     }
12382                     break;
12383                 case -4:
12384                     if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
12385                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12386                             __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_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])))
12387                         } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
12388                             return (unsigned PY_LONG_LONG) (((unsigned PY_LONG_LONG)-1)*(((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
12389                         }
12390                     }
12391                     break;
12392                 case 4:
12393                     if (8 * sizeof(unsigned PY_LONG_LONG) > 3 * PyLong_SHIFT) {
12394                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12395                             __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_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])))
12396                         } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
12397                             return (unsigned PY_LONG_LONG) ((((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
12398                         }
12399                     }
12400                     break;
12401             }
12402 #endif
12403             if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long)) {
12404                 __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, long, PyLong_AsLong(x))
12405 #ifdef HAVE_LONG_LONG
12406             } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
12407                 __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x))
12408 #endif
12409             }
12410         }
12411         {
12412 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
12413             PyErr_SetString(PyExc_RuntimeError,
12414                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
12415 #else
12416             unsigned PY_LONG_LONG val;
12417             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
12418  #if PY_MAJOR_VERSION < 3
12419             if (likely(v) && !PyLong_Check(v)) {
12420                 PyObject *tmp = v;
12421                 v = PyNumber_Long(tmp);
12422                 Py_DECREF(tmp);
12423             }
12424  #endif
12425             if (likely(v)) {
12426                 int one = 1; int is_little = (int)*(unsigned char *)&one;
12427                 unsigned char *bytes = (unsigned char *)&val;
12428                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
12429                                               bytes, sizeof(val),
12430                                               is_little, !is_unsigned);
12431                 Py_DECREF(v);
12432                 if (likely(!ret))
12433                     return val;
12434             }
12435 #endif
12436             return (unsigned PY_LONG_LONG) -1;
12437         }
12438     } else {
12439         unsigned PY_LONG_LONG val;
12440         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
12441         if (!tmp) return (unsigned PY_LONG_LONG) -1;
12442         val = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(tmp);
12443         Py_DECREF(tmp);
12444         return val;
12445     }
12446 raise_overflow:
12447     PyErr_SetString(PyExc_OverflowError,
12448         "value too large to convert to unsigned PY_LONG_LONG");
12449     return (unsigned PY_LONG_LONG) -1;
12450 raise_neg_overflow:
12451     PyErr_SetString(PyExc_OverflowError,
12452         "can't convert negative value to unsigned PY_LONG_LONG");
12453     return (unsigned PY_LONG_LONG) -1;
12454 }
12455 
12456 /* CIntToPy */
__Pyx_PyInt_From_unsigned_short(unsigned short value)12457 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_short(unsigned short value) {
12458 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12459 #pragma GCC diagnostic push
12460 #pragma GCC diagnostic ignored "-Wconversion"
12461 #endif
12462     const unsigned short neg_one = (unsigned short) -1, const_zero = (unsigned short) 0;
12463 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12464 #pragma GCC diagnostic pop
12465 #endif
12466     const int is_unsigned = neg_one > const_zero;
12467     if (is_unsigned) {
12468         if (sizeof(unsigned short) < sizeof(long)) {
12469             return PyInt_FromLong((long) value);
12470         } else if (sizeof(unsigned short) <= sizeof(unsigned long)) {
12471             return PyLong_FromUnsignedLong((unsigned long) value);
12472 #ifdef HAVE_LONG_LONG
12473         } else if (sizeof(unsigned short) <= sizeof(unsigned PY_LONG_LONG)) {
12474             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
12475 #endif
12476         }
12477     } else {
12478         if (sizeof(unsigned short) <= sizeof(long)) {
12479             return PyInt_FromLong((long) value);
12480 #ifdef HAVE_LONG_LONG
12481         } else if (sizeof(unsigned short) <= sizeof(PY_LONG_LONG)) {
12482             return PyLong_FromLongLong((PY_LONG_LONG) value);
12483 #endif
12484         }
12485     }
12486     {
12487         int one = 1; int little = (int)*(unsigned char *)&one;
12488         unsigned char *bytes = (unsigned char *)&value;
12489         return _PyLong_FromByteArray(bytes, sizeof(unsigned short),
12490                                      little, !is_unsigned);
12491     }
12492 }
12493 
12494 /* CIntFromPy */
__Pyx_PyInt_As_unsigned_short(PyObject * x)12495 static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *x) {
12496 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12497 #pragma GCC diagnostic push
12498 #pragma GCC diagnostic ignored "-Wconversion"
12499 #endif
12500     const unsigned short neg_one = (unsigned short) -1, const_zero = (unsigned short) 0;
12501 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12502 #pragma GCC diagnostic pop
12503 #endif
12504     const int is_unsigned = neg_one > const_zero;
12505 #if PY_MAJOR_VERSION < 3
12506     if (likely(PyInt_Check(x))) {
12507         if (sizeof(unsigned short) < sizeof(long)) {
12508             __PYX_VERIFY_RETURN_INT(unsigned short, long, PyInt_AS_LONG(x))
12509         } else {
12510             long val = PyInt_AS_LONG(x);
12511             if (is_unsigned && unlikely(val < 0)) {
12512                 goto raise_neg_overflow;
12513             }
12514             return (unsigned short) val;
12515         }
12516     } else
12517 #endif
12518     if (likely(PyLong_Check(x))) {
12519         if (is_unsigned) {
12520 #if CYTHON_USE_PYLONG_INTERNALS
12521             const digit* digits = ((PyLongObject*)x)->ob_digit;
12522             switch (Py_SIZE(x)) {
12523                 case  0: return (unsigned short) 0;
12524                 case  1: __PYX_VERIFY_RETURN_INT(unsigned short, digit, digits[0])
12525                 case 2:
12526                     if (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT) {
12527                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12528                             __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12529                         } else if (8 * sizeof(unsigned short) >= 2 * PyLong_SHIFT) {
12530                             return (unsigned short) (((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
12531                         }
12532                     }
12533                     break;
12534                 case 3:
12535                     if (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT) {
12536                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12537                             __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12538                         } else if (8 * sizeof(unsigned short) >= 3 * PyLong_SHIFT) {
12539                             return (unsigned short) (((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
12540                         }
12541                     }
12542                     break;
12543                 case 4:
12544                     if (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT) {
12545                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12546                             __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12547                         } else if (8 * sizeof(unsigned short) >= 4 * PyLong_SHIFT) {
12548                             return (unsigned short) (((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
12549                         }
12550                     }
12551                     break;
12552             }
12553 #endif
12554 #if CYTHON_COMPILING_IN_CPYTHON
12555             if (unlikely(Py_SIZE(x) < 0)) {
12556                 goto raise_neg_overflow;
12557             }
12558 #else
12559             {
12560                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12561                 if (unlikely(result < 0))
12562                     return (unsigned short) -1;
12563                 if (unlikely(result == 1))
12564                     goto raise_neg_overflow;
12565             }
12566 #endif
12567             if (sizeof(unsigned short) <= sizeof(unsigned long)) {
12568                 __PYX_VERIFY_RETURN_INT_EXC(unsigned short, unsigned long, PyLong_AsUnsignedLong(x))
12569 #ifdef HAVE_LONG_LONG
12570             } else if (sizeof(unsigned short) <= sizeof(unsigned PY_LONG_LONG)) {
12571                 __PYX_VERIFY_RETURN_INT_EXC(unsigned short, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
12572 #endif
12573             }
12574         } else {
12575 #if CYTHON_USE_PYLONG_INTERNALS
12576             const digit* digits = ((PyLongObject*)x)->ob_digit;
12577             switch (Py_SIZE(x)) {
12578                 case  0: return (unsigned short) 0;
12579                 case -1: __PYX_VERIFY_RETURN_INT(unsigned short, sdigit, (sdigit) (-(sdigit)digits[0]))
12580                 case  1: __PYX_VERIFY_RETURN_INT(unsigned short,  digit, +digits[0])
12581                 case -2:
12582                     if (8 * sizeof(unsigned short) - 1 > 1 * PyLong_SHIFT) {
12583                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12584                             __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12585                         } else if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) {
12586                             return (unsigned short) (((unsigned short)-1)*(((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
12587                         }
12588                     }
12589                     break;
12590                 case 2:
12591                     if (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT) {
12592                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12593                             __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12594                         } else if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) {
12595                             return (unsigned short) ((((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
12596                         }
12597                     }
12598                     break;
12599                 case -3:
12600                     if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) {
12601                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12602                             __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12603                         } else if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) {
12604                             return (unsigned short) (((unsigned short)-1)*(((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
12605                         }
12606                     }
12607                     break;
12608                 case 3:
12609                     if (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT) {
12610                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12611                             __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12612                         } else if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) {
12613                             return (unsigned short) ((((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
12614                         }
12615                     }
12616                     break;
12617                 case -4:
12618                     if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) {
12619                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12620                             __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12621                         } else if (8 * sizeof(unsigned short) - 1 > 4 * PyLong_SHIFT) {
12622                             return (unsigned short) (((unsigned short)-1)*(((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
12623                         }
12624                     }
12625                     break;
12626                 case 4:
12627                     if (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT) {
12628                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12629                             __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12630                         } else if (8 * sizeof(unsigned short) - 1 > 4 * PyLong_SHIFT) {
12631                             return (unsigned short) ((((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
12632                         }
12633                     }
12634                     break;
12635             }
12636 #endif
12637             if (sizeof(unsigned short) <= sizeof(long)) {
12638                 __PYX_VERIFY_RETURN_INT_EXC(unsigned short, long, PyLong_AsLong(x))
12639 #ifdef HAVE_LONG_LONG
12640             } else if (sizeof(unsigned short) <= sizeof(PY_LONG_LONG)) {
12641                 __PYX_VERIFY_RETURN_INT_EXC(unsigned short, PY_LONG_LONG, PyLong_AsLongLong(x))
12642 #endif
12643             }
12644         }
12645         {
12646 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
12647             PyErr_SetString(PyExc_RuntimeError,
12648                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
12649 #else
12650             unsigned short val;
12651             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
12652  #if PY_MAJOR_VERSION < 3
12653             if (likely(v) && !PyLong_Check(v)) {
12654                 PyObject *tmp = v;
12655                 v = PyNumber_Long(tmp);
12656                 Py_DECREF(tmp);
12657             }
12658  #endif
12659             if (likely(v)) {
12660                 int one = 1; int is_little = (int)*(unsigned char *)&one;
12661                 unsigned char *bytes = (unsigned char *)&val;
12662                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
12663                                               bytes, sizeof(val),
12664                                               is_little, !is_unsigned);
12665                 Py_DECREF(v);
12666                 if (likely(!ret))
12667                     return val;
12668             }
12669 #endif
12670             return (unsigned short) -1;
12671         }
12672     } else {
12673         unsigned short val;
12674         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
12675         if (!tmp) return (unsigned short) -1;
12676         val = __Pyx_PyInt_As_unsigned_short(tmp);
12677         Py_DECREF(tmp);
12678         return val;
12679     }
12680 raise_overflow:
12681     PyErr_SetString(PyExc_OverflowError,
12682         "value too large to convert to unsigned short");
12683     return (unsigned short) -1;
12684 raise_neg_overflow:
12685     PyErr_SetString(PyExc_OverflowError,
12686         "can't convert negative value to unsigned short");
12687     return (unsigned short) -1;
12688 }
12689 
12690 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)12691 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
12692 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12693 #pragma GCC diagnostic push
12694 #pragma GCC diagnostic ignored "-Wconversion"
12695 #endif
12696     const int neg_one = (int) -1, const_zero = (int) 0;
12697 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12698 #pragma GCC diagnostic pop
12699 #endif
12700     const int is_unsigned = neg_one > const_zero;
12701 #if PY_MAJOR_VERSION < 3
12702     if (likely(PyInt_Check(x))) {
12703         if (sizeof(int) < sizeof(long)) {
12704             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
12705         } else {
12706             long val = PyInt_AS_LONG(x);
12707             if (is_unsigned && unlikely(val < 0)) {
12708                 goto raise_neg_overflow;
12709             }
12710             return (int) val;
12711         }
12712     } else
12713 #endif
12714     if (likely(PyLong_Check(x))) {
12715         if (is_unsigned) {
12716 #if CYTHON_USE_PYLONG_INTERNALS
12717             const digit* digits = ((PyLongObject*)x)->ob_digit;
12718             switch (Py_SIZE(x)) {
12719                 case  0: return (int) 0;
12720                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
12721                 case 2:
12722                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
12723                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12724                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12725                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
12726                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12727                         }
12728                     }
12729                     break;
12730                 case 3:
12731                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
12732                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12733                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12734                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
12735                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12736                         }
12737                     }
12738                     break;
12739                 case 4:
12740                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
12741                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12742                             __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])))
12743                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
12744                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12745                         }
12746                     }
12747                     break;
12748             }
12749 #endif
12750 #if CYTHON_COMPILING_IN_CPYTHON
12751             if (unlikely(Py_SIZE(x) < 0)) {
12752                 goto raise_neg_overflow;
12753             }
12754 #else
12755             {
12756                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12757                 if (unlikely(result < 0))
12758                     return (int) -1;
12759                 if (unlikely(result == 1))
12760                     goto raise_neg_overflow;
12761             }
12762 #endif
12763             if (sizeof(int) <= sizeof(unsigned long)) {
12764                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
12765 #ifdef HAVE_LONG_LONG
12766             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
12767                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
12768 #endif
12769             }
12770         } else {
12771 #if CYTHON_USE_PYLONG_INTERNALS
12772             const digit* digits = ((PyLongObject*)x)->ob_digit;
12773             switch (Py_SIZE(x)) {
12774                 case  0: return (int) 0;
12775                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
12776                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
12777                 case -2:
12778                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
12779                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12780                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12781                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
12782                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12783                         }
12784                     }
12785                     break;
12786                 case 2:
12787                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
12788                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12789                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12790                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
12791                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12792                         }
12793                     }
12794                     break;
12795                 case -3:
12796                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
12797                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12798                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12799                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
12800                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12801                         }
12802                     }
12803                     break;
12804                 case 3:
12805                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
12806                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12807                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12808                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
12809                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12810                         }
12811                     }
12812                     break;
12813                 case -4:
12814                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
12815                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12816                             __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])))
12817                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
12818                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12819                         }
12820                     }
12821                     break;
12822                 case 4:
12823                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
12824                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12825                             __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])))
12826                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
12827                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12828                         }
12829                     }
12830                     break;
12831             }
12832 #endif
12833             if (sizeof(int) <= sizeof(long)) {
12834                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
12835 #ifdef HAVE_LONG_LONG
12836             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
12837                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
12838 #endif
12839             }
12840         }
12841         {
12842 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
12843             PyErr_SetString(PyExc_RuntimeError,
12844                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
12845 #else
12846             int val;
12847             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
12848  #if PY_MAJOR_VERSION < 3
12849             if (likely(v) && !PyLong_Check(v)) {
12850                 PyObject *tmp = v;
12851                 v = PyNumber_Long(tmp);
12852                 Py_DECREF(tmp);
12853             }
12854  #endif
12855             if (likely(v)) {
12856                 int one = 1; int is_little = (int)*(unsigned char *)&one;
12857                 unsigned char *bytes = (unsigned char *)&val;
12858                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
12859                                               bytes, sizeof(val),
12860                                               is_little, !is_unsigned);
12861                 Py_DECREF(v);
12862                 if (likely(!ret))
12863                     return val;
12864             }
12865 #endif
12866             return (int) -1;
12867         }
12868     } else {
12869         int val;
12870         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
12871         if (!tmp) return (int) -1;
12872         val = __Pyx_PyInt_As_int(tmp);
12873         Py_DECREF(tmp);
12874         return val;
12875     }
12876 raise_overflow:
12877     PyErr_SetString(PyExc_OverflowError,
12878         "value too large to convert to int");
12879     return (int) -1;
12880 raise_neg_overflow:
12881     PyErr_SetString(PyExc_OverflowError,
12882         "can't convert negative value to int");
12883     return (int) -1;
12884 }
12885 
12886 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)12887 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
12888 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12889 #pragma GCC diagnostic push
12890 #pragma GCC diagnostic ignored "-Wconversion"
12891 #endif
12892     const long neg_one = (long) -1, const_zero = (long) 0;
12893 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12894 #pragma GCC diagnostic pop
12895 #endif
12896     const int is_unsigned = neg_one > const_zero;
12897 #if PY_MAJOR_VERSION < 3
12898     if (likely(PyInt_Check(x))) {
12899         if (sizeof(long) < sizeof(long)) {
12900             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
12901         } else {
12902             long val = PyInt_AS_LONG(x);
12903             if (is_unsigned && unlikely(val < 0)) {
12904                 goto raise_neg_overflow;
12905             }
12906             return (long) val;
12907         }
12908     } else
12909 #endif
12910     if (likely(PyLong_Check(x))) {
12911         if (is_unsigned) {
12912 #if CYTHON_USE_PYLONG_INTERNALS
12913             const digit* digits = ((PyLongObject*)x)->ob_digit;
12914             switch (Py_SIZE(x)) {
12915                 case  0: return (long) 0;
12916                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
12917                 case 2:
12918                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
12919                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12920                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12921                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
12922                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12923                         }
12924                     }
12925                     break;
12926                 case 3:
12927                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
12928                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12929                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12930                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
12931                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12932                         }
12933                     }
12934                     break;
12935                 case 4:
12936                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
12937                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12938                             __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])))
12939                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
12940                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
12941                         }
12942                     }
12943                     break;
12944             }
12945 #endif
12946 #if CYTHON_COMPILING_IN_CPYTHON
12947             if (unlikely(Py_SIZE(x) < 0)) {
12948                 goto raise_neg_overflow;
12949             }
12950 #else
12951             {
12952                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12953                 if (unlikely(result < 0))
12954                     return (long) -1;
12955                 if (unlikely(result == 1))
12956                     goto raise_neg_overflow;
12957             }
12958 #endif
12959             if (sizeof(long) <= sizeof(unsigned long)) {
12960                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
12961 #ifdef HAVE_LONG_LONG
12962             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
12963                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
12964 #endif
12965             }
12966         } else {
12967 #if CYTHON_USE_PYLONG_INTERNALS
12968             const digit* digits = ((PyLongObject*)x)->ob_digit;
12969             switch (Py_SIZE(x)) {
12970                 case  0: return (long) 0;
12971                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
12972                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
12973                 case -2:
12974                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
12975                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12976                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12977                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
12978                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12979                         }
12980                     }
12981                     break;
12982                 case 2:
12983                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
12984                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12985                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12986                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
12987                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12988                         }
12989                     }
12990                     break;
12991                 case -3:
12992                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
12993                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12994                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12995                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
12996                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12997                         }
12998                     }
12999                     break;
13000                 case 3:
13001                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
13002                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13003                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13004                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
13005                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13006                         }
13007                     }
13008                     break;
13009                 case -4:
13010                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
13011                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13012                             __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])))
13013                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
13014                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13015                         }
13016                     }
13017                     break;
13018                 case 4:
13019                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
13020                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13021                             __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])))
13022                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
13023                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13024                         }
13025                     }
13026                     break;
13027             }
13028 #endif
13029             if (sizeof(long) <= sizeof(long)) {
13030                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
13031 #ifdef HAVE_LONG_LONG
13032             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
13033                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
13034 #endif
13035             }
13036         }
13037         {
13038 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
13039             PyErr_SetString(PyExc_RuntimeError,
13040                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
13041 #else
13042             long val;
13043             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
13044  #if PY_MAJOR_VERSION < 3
13045             if (likely(v) && !PyLong_Check(v)) {
13046                 PyObject *tmp = v;
13047                 v = PyNumber_Long(tmp);
13048                 Py_DECREF(tmp);
13049             }
13050  #endif
13051             if (likely(v)) {
13052                 int one = 1; int is_little = (int)*(unsigned char *)&one;
13053                 unsigned char *bytes = (unsigned char *)&val;
13054                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
13055                                               bytes, sizeof(val),
13056                                               is_little, !is_unsigned);
13057                 Py_DECREF(v);
13058                 if (likely(!ret))
13059                     return val;
13060             }
13061 #endif
13062             return (long) -1;
13063         }
13064     } else {
13065         long val;
13066         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
13067         if (!tmp) return (long) -1;
13068         val = __Pyx_PyInt_As_long(tmp);
13069         Py_DECREF(tmp);
13070         return val;
13071     }
13072 raise_overflow:
13073     PyErr_SetString(PyExc_OverflowError,
13074         "value too large to convert to long");
13075     return (long) -1;
13076 raise_neg_overflow:
13077     PyErr_SetString(PyExc_OverflowError,
13078         "can't convert negative value to long");
13079     return (long) -1;
13080 }
13081 
13082 /* CIntToPy */
__Pyx_PyInt_From_int(int value)13083 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
13084 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13085 #pragma GCC diagnostic push
13086 #pragma GCC diagnostic ignored "-Wconversion"
13087 #endif
13088     const int neg_one = (int) -1, const_zero = (int) 0;
13089 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13090 #pragma GCC diagnostic pop
13091 #endif
13092     const int is_unsigned = neg_one > const_zero;
13093     if (is_unsigned) {
13094         if (sizeof(int) < sizeof(long)) {
13095             return PyInt_FromLong((long) value);
13096         } else if (sizeof(int) <= sizeof(unsigned long)) {
13097             return PyLong_FromUnsignedLong((unsigned long) value);
13098 #ifdef HAVE_LONG_LONG
13099         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
13100             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
13101 #endif
13102         }
13103     } else {
13104         if (sizeof(int) <= sizeof(long)) {
13105             return PyInt_FromLong((long) value);
13106 #ifdef HAVE_LONG_LONG
13107         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
13108             return PyLong_FromLongLong((PY_LONG_LONG) value);
13109 #endif
13110         }
13111     }
13112     {
13113         int one = 1; int little = (int)*(unsigned char *)&one;
13114         unsigned char *bytes = (unsigned char *)&value;
13115         return _PyLong_FromByteArray(bytes, sizeof(int),
13116                                      little, !is_unsigned);
13117     }
13118 }
13119 
13120 /* CIntToPy */
__Pyx_PyInt_From_long(long value)13121 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
13122 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13123 #pragma GCC diagnostic push
13124 #pragma GCC diagnostic ignored "-Wconversion"
13125 #endif
13126     const long neg_one = (long) -1, const_zero = (long) 0;
13127 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13128 #pragma GCC diagnostic pop
13129 #endif
13130     const int is_unsigned = neg_one > const_zero;
13131     if (is_unsigned) {
13132         if (sizeof(long) < sizeof(long)) {
13133             return PyInt_FromLong((long) value);
13134         } else if (sizeof(long) <= sizeof(unsigned long)) {
13135             return PyLong_FromUnsignedLong((unsigned long) value);
13136 #ifdef HAVE_LONG_LONG
13137         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
13138             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
13139 #endif
13140         }
13141     } else {
13142         if (sizeof(long) <= sizeof(long)) {
13143             return PyInt_FromLong((long) value);
13144 #ifdef HAVE_LONG_LONG
13145         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
13146             return PyLong_FromLongLong((PY_LONG_LONG) value);
13147 #endif
13148         }
13149     }
13150     {
13151         int one = 1; int little = (int)*(unsigned char *)&one;
13152         unsigned char *bytes = (unsigned char *)&value;
13153         return _PyLong_FromByteArray(bytes, sizeof(long),
13154                                      little, !is_unsigned);
13155     }
13156 }
13157 
13158 /* FastTypeChecks */
13159 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)13160 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
13161     while (a) {
13162         a = a->tp_base;
13163         if (a == b)
13164             return 1;
13165     }
13166     return b == &PyBaseObject_Type;
13167 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)13168 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
13169     PyObject *mro;
13170     if (a == b) return 1;
13171     mro = a->tp_mro;
13172     if (likely(mro)) {
13173         Py_ssize_t i, n;
13174         n = PyTuple_GET_SIZE(mro);
13175         for (i = 0; i < n; i++) {
13176             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
13177                 return 1;
13178         }
13179         return 0;
13180     }
13181     return __Pyx_InBases(a, b);
13182 }
13183 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)13184 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
13185     PyObject *exception, *value, *tb;
13186     int res;
13187     __Pyx_PyThreadState_declare
13188     __Pyx_PyThreadState_assign
13189     __Pyx_ErrFetch(&exception, &value, &tb);
13190     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
13191     if (unlikely(res == -1)) {
13192         PyErr_WriteUnraisable(err);
13193         res = 0;
13194     }
13195     if (!res) {
13196         res = PyObject_IsSubclass(err, exc_type2);
13197         if (unlikely(res == -1)) {
13198             PyErr_WriteUnraisable(err);
13199             res = 0;
13200         }
13201     }
13202     __Pyx_ErrRestore(exception, value, tb);
13203     return res;
13204 }
13205 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)13206 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
13207     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
13208     if (!res) {
13209         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
13210     }
13211     return res;
13212 }
13213 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)13214 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
13215     Py_ssize_t i, n;
13216     assert(PyExceptionClass_Check(exc_type));
13217     n = PyTuple_GET_SIZE(tuple);
13218 #if PY_MAJOR_VERSION >= 3
13219     for (i=0; i<n; i++) {
13220         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
13221     }
13222 #endif
13223     for (i=0; i<n; i++) {
13224         PyObject *t = PyTuple_GET_ITEM(tuple, i);
13225         #if PY_MAJOR_VERSION < 3
13226         if (likely(exc_type == t)) return 1;
13227         #endif
13228         if (likely(PyExceptionClass_Check(t))) {
13229             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
13230         } else {
13231         }
13232     }
13233     return 0;
13234 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)13235 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
13236     if (likely(err == exc_type)) return 1;
13237     if (likely(PyExceptionClass_Check(err))) {
13238         if (likely(PyExceptionClass_Check(exc_type))) {
13239             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
13240         } else if (likely(PyTuple_Check(exc_type))) {
13241             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
13242         } else {
13243         }
13244     }
13245     return PyErr_GivenExceptionMatches(err, exc_type);
13246 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)13247 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
13248     assert(PyExceptionClass_Check(exc_type1));
13249     assert(PyExceptionClass_Check(exc_type2));
13250     if (likely(err == exc_type1 || err == exc_type2)) return 1;
13251     if (likely(PyExceptionClass_Check(err))) {
13252         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
13253     }
13254     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
13255 }
13256 #endif
13257 
13258 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)13259 static int __Pyx_check_binary_version(void) {
13260     char ctversion[4], rtversion[4];
13261     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
13262     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
13263     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
13264         char message[200];
13265         PyOS_snprintf(message, sizeof(message),
13266                       "compiletime version %s of module '%.100s' "
13267                       "does not match runtime version %s",
13268                       ctversion, __Pyx_MODULE_NAME, rtversion);
13269         return PyErr_WarnEx(NULL, message, 1);
13270     }
13271     return 0;
13272 }
13273 
13274 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)13275 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
13276     while (t->p) {
13277         #if PY_MAJOR_VERSION < 3
13278         if (t->is_unicode) {
13279             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
13280         } else if (t->intern) {
13281             *t->p = PyString_InternFromString(t->s);
13282         } else {
13283             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
13284         }
13285         #else
13286         if (t->is_unicode | t->is_str) {
13287             if (t->intern) {
13288                 *t->p = PyUnicode_InternFromString(t->s);
13289             } else if (t->encoding) {
13290                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
13291             } else {
13292                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
13293             }
13294         } else {
13295             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
13296         }
13297         #endif
13298         if (!*t->p)
13299             return -1;
13300         if (PyObject_Hash(*t->p) == -1)
13301             return -1;
13302         ++t;
13303     }
13304     return 0;
13305 }
13306 
__Pyx_PyUnicode_FromString(const char * c_str)13307 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
13308     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
13309 }
__Pyx_PyObject_AsString(PyObject * o)13310 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
13311     Py_ssize_t ignore;
13312     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
13313 }
13314 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
13315 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)13316 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13317     char* defenc_c;
13318     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
13319     if (!defenc) return NULL;
13320     defenc_c = PyBytes_AS_STRING(defenc);
13321 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13322     {
13323         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
13324         char* c;
13325         for (c = defenc_c; c < end; c++) {
13326             if ((unsigned char) (*c) >= 128) {
13327                 PyUnicode_AsASCIIString(o);
13328                 return NULL;
13329             }
13330         }
13331     }
13332 #endif
13333     *length = PyBytes_GET_SIZE(defenc);
13334     return defenc_c;
13335 }
13336 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)13337 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13338     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
13339 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13340     if (likely(PyUnicode_IS_ASCII(o))) {
13341         *length = PyUnicode_GET_LENGTH(o);
13342         return PyUnicode_AsUTF8(o);
13343     } else {
13344         PyUnicode_AsASCIIString(o);
13345         return NULL;
13346     }
13347 #else
13348     return PyUnicode_AsUTF8AndSize(o, length);
13349 #endif
13350 }
13351 #endif
13352 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)13353 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13354 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
13355     if (
13356 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13357             __Pyx_sys_getdefaultencoding_not_ascii &&
13358 #endif
13359             PyUnicode_Check(o)) {
13360         return __Pyx_PyUnicode_AsStringAndSize(o, length);
13361     } else
13362 #endif
13363 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
13364     if (PyByteArray_Check(o)) {
13365         *length = PyByteArray_GET_SIZE(o);
13366         return PyByteArray_AS_STRING(o);
13367     } else
13368 #endif
13369     {
13370         char* result;
13371         int r = PyBytes_AsStringAndSize(o, &result, length);
13372         if (unlikely(r < 0)) {
13373             return NULL;
13374         } else {
13375             return result;
13376         }
13377     }
13378 }
__Pyx_PyObject_IsTrue(PyObject * x)13379 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
13380    int is_true = x == Py_True;
13381    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
13382    else return PyObject_IsTrue(x);
13383 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)13384 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
13385     int retval;
13386     if (unlikely(!x)) return -1;
13387     retval = __Pyx_PyObject_IsTrue(x);
13388     Py_DECREF(x);
13389     return retval;
13390 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)13391 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
13392 #if PY_MAJOR_VERSION >= 3
13393     if (PyLong_Check(result)) {
13394         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
13395                 "__int__ returned non-int (type %.200s).  "
13396                 "The ability to return an instance of a strict subclass of int "
13397                 "is deprecated, and may be removed in a future version of Python.",
13398                 Py_TYPE(result)->tp_name)) {
13399             Py_DECREF(result);
13400             return NULL;
13401         }
13402         return result;
13403     }
13404 #endif
13405     PyErr_Format(PyExc_TypeError,
13406                  "__%.4s__ returned non-%.4s (type %.200s)",
13407                  type_name, type_name, Py_TYPE(result)->tp_name);
13408     Py_DECREF(result);
13409     return NULL;
13410 }
__Pyx_PyNumber_IntOrLong(PyObject * x)13411 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
13412 #if CYTHON_USE_TYPE_SLOTS
13413   PyNumberMethods *m;
13414 #endif
13415   const char *name = NULL;
13416   PyObject *res = NULL;
13417 #if PY_MAJOR_VERSION < 3
13418   if (likely(PyInt_Check(x) || PyLong_Check(x)))
13419 #else
13420   if (likely(PyLong_Check(x)))
13421 #endif
13422     return __Pyx_NewRef(x);
13423 #if CYTHON_USE_TYPE_SLOTS
13424   m = Py_TYPE(x)->tp_as_number;
13425   #if PY_MAJOR_VERSION < 3
13426   if (m && m->nb_int) {
13427     name = "int";
13428     res = m->nb_int(x);
13429   }
13430   else if (m && m->nb_long) {
13431     name = "long";
13432     res = m->nb_long(x);
13433   }
13434   #else
13435   if (likely(m && m->nb_int)) {
13436     name = "int";
13437     res = m->nb_int(x);
13438   }
13439   #endif
13440 #else
13441   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
13442     res = PyNumber_Int(x);
13443   }
13444 #endif
13445   if (likely(res)) {
13446 #if PY_MAJOR_VERSION < 3
13447     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
13448 #else
13449     if (unlikely(!PyLong_CheckExact(res))) {
13450 #endif
13451         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
13452     }
13453   }
13454   else if (!PyErr_Occurred()) {
13455     PyErr_SetString(PyExc_TypeError,
13456                     "an integer is required");
13457   }
13458   return res;
13459 }
13460 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
13461   Py_ssize_t ival;
13462   PyObject *x;
13463 #if PY_MAJOR_VERSION < 3
13464   if (likely(PyInt_CheckExact(b))) {
13465     if (sizeof(Py_ssize_t) >= sizeof(long))
13466         return PyInt_AS_LONG(b);
13467     else
13468         return PyInt_AsSsize_t(b);
13469   }
13470 #endif
13471   if (likely(PyLong_CheckExact(b))) {
13472     #if CYTHON_USE_PYLONG_INTERNALS
13473     const digit* digits = ((PyLongObject*)b)->ob_digit;
13474     const Py_ssize_t size = Py_SIZE(b);
13475     if (likely(__Pyx_sst_abs(size) <= 1)) {
13476         ival = likely(size) ? digits[0] : 0;
13477         if (size == -1) ival = -ival;
13478         return ival;
13479     } else {
13480       switch (size) {
13481          case 2:
13482            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
13483              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13484            }
13485            break;
13486          case -2:
13487            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
13488              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13489            }
13490            break;
13491          case 3:
13492            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
13493              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13494            }
13495            break;
13496          case -3:
13497            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
13498              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13499            }
13500            break;
13501          case 4:
13502            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
13503              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]));
13504            }
13505            break;
13506          case -4:
13507            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
13508              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]));
13509            }
13510            break;
13511       }
13512     }
13513     #endif
13514     return PyLong_AsSsize_t(b);
13515   }
13516   x = PyNumber_Index(b);
13517   if (!x) return -1;
13518   ival = PyInt_AsSsize_t(x);
13519   Py_DECREF(x);
13520   return ival;
13521 }
13522 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
13523   if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
13524     return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
13525 #if PY_MAJOR_VERSION < 3
13526   } else if (likely(PyInt_CheckExact(o))) {
13527     return PyInt_AS_LONG(o);
13528 #endif
13529   } else {
13530     Py_ssize_t ival;
13531     PyObject *x;
13532     x = PyNumber_Index(o);
13533     if (!x) return -1;
13534     ival = PyInt_AsLong(x);
13535     Py_DECREF(x);
13536     return ival;
13537   }
13538 }
13539 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
13540   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
13541 }
13542 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
13543     return PyInt_FromSize_t(ival);
13544 }
13545 
13546 
13547 #endif /* Py_PYTHON_H */
13548