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__bbi_file
677 #define __PYX_HAVE_API__bx__bbi__bbi_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 #include <limits.h>
690 #ifdef _OPENMP
691 #include <omp.h>
692 #endif /* _OPENMP */
693 
694 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
695 #define CYTHON_WITHOUT_ASSERTIONS
696 #endif
697 
698 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
699                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
700 
701 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
702 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
703 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
704 #define __PYX_DEFAULT_STRING_ENCODING ""
705 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
706 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
707 #define __Pyx_uchar_cast(c) ((unsigned char)c)
708 #define __Pyx_long_cast(x) ((long)x)
709 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
710     (sizeof(type) < sizeof(Py_ssize_t))  ||\
711     (sizeof(type) > sizeof(Py_ssize_t) &&\
712           likely(v < (type)PY_SSIZE_T_MAX ||\
713                  v == (type)PY_SSIZE_T_MAX)  &&\
714           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
715                                 v == (type)PY_SSIZE_T_MIN)))  ||\
716     (sizeof(type) == sizeof(Py_ssize_t) &&\
717           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
718                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)719 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
720     return (size_t) i < (size_t) limit;
721 }
722 #if defined (__cplusplus) && __cplusplus >= 201103L
723     #include <cstdlib>
724     #define __Pyx_sst_abs(value) std::abs(value)
725 #elif SIZEOF_INT >= SIZEOF_SIZE_T
726     #define __Pyx_sst_abs(value) abs(value)
727 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
728     #define __Pyx_sst_abs(value) labs(value)
729 #elif defined (_MSC_VER)
730     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
731 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
732     #define __Pyx_sst_abs(value) llabs(value)
733 #elif defined (__GNUC__)
734     #define __Pyx_sst_abs(value) __builtin_llabs(value)
735 #else
736     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
737 #endif
738 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
739 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
740 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
741 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
742 #define __Pyx_PyBytes_FromString        PyBytes_FromString
743 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
744 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
745 #if PY_MAJOR_VERSION < 3
746     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
747     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
748 #else
749     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
750     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
751 #endif
752 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
753 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
754 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
755 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
756 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
757 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
758 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
759 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
760 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
761 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
762 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
763 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
764 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
765 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
766 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
767 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)768 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
769     const Py_UNICODE *u_end = u;
770     while (*u_end++) ;
771     return (size_t)(u_end - u - 1);
772 }
773 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
774 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
775 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
776 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
777 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
778 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
779 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
780 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
781 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
782 #define __Pyx_PySequence_Tuple(obj)\
783     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
784 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
785 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
786 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
787 #if CYTHON_ASSUME_SAFE_MACROS
788 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
789 #else
790 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
791 #endif
792 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
793 #if PY_MAJOR_VERSION >= 3
794 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
795 #else
796 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
797 #endif
798 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
799 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
800 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)801 static int __Pyx_init_sys_getdefaultencoding_params(void) {
802     PyObject* sys;
803     PyObject* default_encoding = NULL;
804     PyObject* ascii_chars_u = NULL;
805     PyObject* ascii_chars_b = NULL;
806     const char* default_encoding_c;
807     sys = PyImport_ImportModule("sys");
808     if (!sys) goto bad;
809     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
810     Py_DECREF(sys);
811     if (!default_encoding) goto bad;
812     default_encoding_c = PyBytes_AsString(default_encoding);
813     if (!default_encoding_c) goto bad;
814     if (strcmp(default_encoding_c, "ascii") == 0) {
815         __Pyx_sys_getdefaultencoding_not_ascii = 0;
816     } else {
817         char ascii_chars[128];
818         int c;
819         for (c = 0; c < 128; c++) {
820             ascii_chars[c] = c;
821         }
822         __Pyx_sys_getdefaultencoding_not_ascii = 1;
823         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
824         if (!ascii_chars_u) goto bad;
825         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
826         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
827             PyErr_Format(
828                 PyExc_ValueError,
829                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
830                 default_encoding_c);
831             goto bad;
832         }
833         Py_DECREF(ascii_chars_u);
834         Py_DECREF(ascii_chars_b);
835     }
836     Py_DECREF(default_encoding);
837     return 0;
838 bad:
839     Py_XDECREF(default_encoding);
840     Py_XDECREF(ascii_chars_u);
841     Py_XDECREF(ascii_chars_b);
842     return -1;
843 }
844 #endif
845 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
846 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
847 #else
848 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
849 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
850 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)851 static int __Pyx_init_sys_getdefaultencoding_params(void) {
852     PyObject* sys;
853     PyObject* default_encoding = NULL;
854     char* default_encoding_c;
855     sys = PyImport_ImportModule("sys");
856     if (!sys) goto bad;
857     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
858     Py_DECREF(sys);
859     if (!default_encoding) goto bad;
860     default_encoding_c = PyBytes_AsString(default_encoding);
861     if (!default_encoding_c) goto bad;
862     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
863     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
864     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
865     Py_DECREF(default_encoding);
866     return 0;
867 bad:
868     Py_XDECREF(default_encoding);
869     return -1;
870 }
871 #endif
872 #endif
873 
874 
875 /* Test for GCC > 2.95 */
876 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
877   #define likely(x)   __builtin_expect(!!(x), 1)
878   #define unlikely(x) __builtin_expect(!!(x), 0)
879 #else /* !__GNUC__ or GCC < 2.95 */
880   #define likely(x)   (x)
881   #define unlikely(x) (x)
882 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)883 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
884 
885 static PyObject *__pyx_m = NULL;
886 static PyObject *__pyx_d;
887 static PyObject *__pyx_b;
888 static PyObject *__pyx_cython_runtime = NULL;
889 static PyObject *__pyx_empty_tuple;
890 static PyObject *__pyx_empty_bytes;
891 static PyObject *__pyx_empty_unicode;
892 static int __pyx_lineno;
893 static int __pyx_clineno = 0;
894 static const char * __pyx_cfilenm= __FILE__;
895 static const char *__pyx_filename;
896 
897 /* Header.proto */
898 #if !defined(CYTHON_CCOMPLEX)
899   #if defined(__cplusplus)
900     #define CYTHON_CCOMPLEX 1
901   #elif defined(_Complex_I)
902     #define CYTHON_CCOMPLEX 1
903   #else
904     #define CYTHON_CCOMPLEX 0
905   #endif
906 #endif
907 #if CYTHON_CCOMPLEX
908   #ifdef __cplusplus
909     #include <complex>
910   #else
911     #include <complex.h>
912   #endif
913 #endif
914 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
915   #undef _Complex_I
916   #define _Complex_I 1.0fj
917 #endif
918 
919 
920 static const char *__pyx_f[] = {
921   "lib/bx/bbi/bbi_file.pyx",
922   "lib/bx/bbi/bbi_file.pxd",
923   "stringsource",
924   "__init__.pxd",
925   "lib/bx/bbi/bpt_file.pxd",
926   "lib/bx/bbi/cirtree_file.pxd",
927   "type.pxd",
928 };
929 /* BufferFormatStructs.proto */
930 #define IS_UNSIGNED(type) (((type) -1) > 0)
931 struct __Pyx_StructField_;
932 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
933 typedef struct {
934   const char* name;
935   struct __Pyx_StructField_* fields;
936   size_t size;
937   size_t arraysize[8];
938   int ndim;
939   char typegroup;
940   char is_unsigned;
941   int flags;
942 } __Pyx_TypeInfo;
943 typedef struct __Pyx_StructField_ {
944   __Pyx_TypeInfo* type;
945   const char* name;
946   size_t offset;
947 } __Pyx_StructField;
948 typedef struct {
949   __Pyx_StructField* field;
950   size_t parent_offset;
951 } __Pyx_BufFmt_StackElem;
952 typedef struct {
953   __Pyx_StructField root;
954   __Pyx_BufFmt_StackElem* head;
955   size_t fmt_offset;
956   size_t new_count, enc_count;
957   size_t struct_alignment;
958   int is_complex;
959   char enc_type;
960   char new_packmode;
961   char enc_packmode;
962   char is_valid_array;
963 } __Pyx_BufFmt_Context;
964 
965 
966 /* "types.pxd":1
967  * ctypedef unsigned char UBYTE             # <<<<<<<<<<<<<<
968  * ctypedef signed char BYTE
969  * ctypedef unsigned short UWORD
970  */
971 typedef unsigned char __pyx_t_2bx_3bbi_5types_UBYTE;
972 
973 /* "types.pxd":2
974  * ctypedef unsigned char UBYTE
975  * ctypedef signed char BYTE             # <<<<<<<<<<<<<<
976  * ctypedef unsigned short UWORD
977  * ctypedef short WORD
978  */
979 typedef signed char __pyx_t_2bx_3bbi_5types_BYTE;
980 
981 /* "types.pxd":3
982  * ctypedef unsigned char UBYTE
983  * ctypedef signed char BYTE
984  * ctypedef unsigned short UWORD             # <<<<<<<<<<<<<<
985  * ctypedef short WORD
986  * ctypedef unsigned long long bits64
987  */
988 typedef unsigned short __pyx_t_2bx_3bbi_5types_UWORD;
989 
990 /* "types.pxd":4
991  * ctypedef signed char BYTE
992  * ctypedef unsigned short UWORD
993  * ctypedef short WORD             # <<<<<<<<<<<<<<
994  * ctypedef unsigned long long bits64
995  * ctypedef unsigned bits32
996  */
997 typedef short __pyx_t_2bx_3bbi_5types_WORD;
998 
999 /* "types.pxd":5
1000  * ctypedef unsigned short UWORD
1001  * ctypedef short WORD
1002  * ctypedef unsigned long long bits64             # <<<<<<<<<<<<<<
1003  * ctypedef unsigned bits32
1004  * ctypedef unsigned short bits16
1005  */
1006 typedef unsigned PY_LONG_LONG __pyx_t_2bx_3bbi_5types_bits64;
1007 
1008 /* "types.pxd":6
1009  * ctypedef short WORD
1010  * ctypedef unsigned long long bits64
1011  * ctypedef unsigned bits32             # <<<<<<<<<<<<<<
1012  * ctypedef unsigned short bits16
1013  * ctypedef unsigned char bits8
1014  */
1015 typedef unsigned int __pyx_t_2bx_3bbi_5types_bits32;
1016 
1017 /* "types.pxd":7
1018  * ctypedef unsigned long long bits64
1019  * ctypedef unsigned bits32
1020  * ctypedef unsigned short bits16             # <<<<<<<<<<<<<<
1021  * ctypedef unsigned char bits8
1022  * ctypedef int signed32
1023  */
1024 typedef unsigned short __pyx_t_2bx_3bbi_5types_bits16;
1025 
1026 /* "types.pxd":8
1027  * ctypedef unsigned bits32
1028  * ctypedef unsigned short bits16
1029  * ctypedef unsigned char bits8             # <<<<<<<<<<<<<<
1030  * ctypedef int signed32
1031  *
1032  */
1033 typedef unsigned char __pyx_t_2bx_3bbi_5types_bits8;
1034 
1035 /* "types.pxd":9
1036  * ctypedef unsigned short bits16
1037  * ctypedef unsigned char bits8
1038  * ctypedef int signed32             # <<<<<<<<<<<<<<
1039  *
1040  * ctypedef bint boolean
1041  */
1042 typedef int __pyx_t_2bx_3bbi_5types_signed32;
1043 
1044 /* "types.pxd":11
1045  * ctypedef int signed32
1046  *
1047  * ctypedef bint boolean             # <<<<<<<<<<<<<<
1048  *
1049  */
1050 typedef int __pyx_t_2bx_3bbi_5types_boolean;
1051 
1052 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":690
1053  * # in Cython to enable them only on the right systems.
1054  *
1055  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
1056  * ctypedef npy_int16      int16_t
1057  * ctypedef npy_int32      int32_t
1058  */
1059 typedef npy_int8 __pyx_t_5numpy_int8_t;
1060 
1061 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":691
1062  *
1063  * ctypedef npy_int8       int8_t
1064  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
1065  * ctypedef npy_int32      int32_t
1066  * ctypedef npy_int64      int64_t
1067  */
1068 typedef npy_int16 __pyx_t_5numpy_int16_t;
1069 
1070 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":692
1071  * ctypedef npy_int8       int8_t
1072  * ctypedef npy_int16      int16_t
1073  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
1074  * ctypedef npy_int64      int64_t
1075  * #ctypedef npy_int96      int96_t
1076  */
1077 typedef npy_int32 __pyx_t_5numpy_int32_t;
1078 
1079 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":693
1080  * ctypedef npy_int16      int16_t
1081  * ctypedef npy_int32      int32_t
1082  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
1083  * #ctypedef npy_int96      int96_t
1084  * #ctypedef npy_int128     int128_t
1085  */
1086 typedef npy_int64 __pyx_t_5numpy_int64_t;
1087 
1088 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":697
1089  * #ctypedef npy_int128     int128_t
1090  *
1091  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
1092  * ctypedef npy_uint16     uint16_t
1093  * ctypedef npy_uint32     uint32_t
1094  */
1095 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1096 
1097 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":698
1098  *
1099  * ctypedef npy_uint8      uint8_t
1100  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
1101  * ctypedef npy_uint32     uint32_t
1102  * ctypedef npy_uint64     uint64_t
1103  */
1104 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1105 
1106 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":699
1107  * ctypedef npy_uint8      uint8_t
1108  * ctypedef npy_uint16     uint16_t
1109  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
1110  * ctypedef npy_uint64     uint64_t
1111  * #ctypedef npy_uint96     uint96_t
1112  */
1113 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1114 
1115 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":700
1116  * ctypedef npy_uint16     uint16_t
1117  * ctypedef npy_uint32     uint32_t
1118  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
1119  * #ctypedef npy_uint96     uint96_t
1120  * #ctypedef npy_uint128    uint128_t
1121  */
1122 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1123 
1124 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":704
1125  * #ctypedef npy_uint128    uint128_t
1126  *
1127  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
1128  * ctypedef npy_float64    float64_t
1129  * #ctypedef npy_float80    float80_t
1130  */
1131 typedef npy_float32 __pyx_t_5numpy_float32_t;
1132 
1133 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":705
1134  *
1135  * ctypedef npy_float32    float32_t
1136  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
1137  * #ctypedef npy_float80    float80_t
1138  * #ctypedef npy_float128   float128_t
1139  */
1140 typedef npy_float64 __pyx_t_5numpy_float64_t;
1141 
1142 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":714
1143  * # The int types are mapped a bit surprising --
1144  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1145  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
1146  * ctypedef npy_longlong   long_t
1147  * ctypedef npy_longlong   longlong_t
1148  */
1149 typedef npy_long __pyx_t_5numpy_int_t;
1150 
1151 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":715
1152  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1153  * ctypedef npy_long       int_t
1154  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
1155  * ctypedef npy_longlong   longlong_t
1156  *
1157  */
1158 typedef npy_longlong __pyx_t_5numpy_long_t;
1159 
1160 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":716
1161  * ctypedef npy_long       int_t
1162  * ctypedef npy_longlong   long_t
1163  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
1164  *
1165  * ctypedef npy_ulong      uint_t
1166  */
1167 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1168 
1169 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":718
1170  * ctypedef npy_longlong   longlong_t
1171  *
1172  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
1173  * ctypedef npy_ulonglong  ulong_t
1174  * ctypedef npy_ulonglong  ulonglong_t
1175  */
1176 typedef npy_ulong __pyx_t_5numpy_uint_t;
1177 
1178 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":719
1179  *
1180  * ctypedef npy_ulong      uint_t
1181  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
1182  * ctypedef npy_ulonglong  ulonglong_t
1183  *
1184  */
1185 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1186 
1187 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":720
1188  * ctypedef npy_ulong      uint_t
1189  * ctypedef npy_ulonglong  ulong_t
1190  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
1191  *
1192  * ctypedef npy_intp       intp_t
1193  */
1194 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1195 
1196 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":722
1197  * ctypedef npy_ulonglong  ulonglong_t
1198  *
1199  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1200  * ctypedef npy_uintp      uintp_t
1201  *
1202  */
1203 typedef npy_intp __pyx_t_5numpy_intp_t;
1204 
1205 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":723
1206  *
1207  * ctypedef npy_intp       intp_t
1208  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1209  *
1210  * ctypedef npy_double     float_t
1211  */
1212 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1213 
1214 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":725
1215  * ctypedef npy_uintp      uintp_t
1216  *
1217  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1218  * ctypedef npy_double     double_t
1219  * ctypedef npy_longdouble longdouble_t
1220  */
1221 typedef npy_double __pyx_t_5numpy_float_t;
1222 
1223 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":726
1224  *
1225  * ctypedef npy_double     float_t
1226  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1227  * ctypedef npy_longdouble longdouble_t
1228  *
1229  */
1230 typedef npy_double __pyx_t_5numpy_double_t;
1231 
1232 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":727
1233  * ctypedef npy_double     float_t
1234  * ctypedef npy_double     double_t
1235  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1236  *
1237  * ctypedef npy_cfloat      cfloat_t
1238  */
1239 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1240 /* Declarations.proto */
1241 #if CYTHON_CCOMPLEX
1242   #ifdef __cplusplus
1243     typedef ::std::complex< float > __pyx_t_float_complex;
1244   #else
1245     typedef float _Complex __pyx_t_float_complex;
1246   #endif
1247 #else
1248     typedef struct { float real, imag; } __pyx_t_float_complex;
1249 #endif
1250 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1251 
1252 /* Declarations.proto */
1253 #if CYTHON_CCOMPLEX
1254   #ifdef __cplusplus
1255     typedef ::std::complex< double > __pyx_t_double_complex;
1256   #else
1257     typedef double _Complex __pyx_t_double_complex;
1258   #endif
1259 #else
1260     typedef struct { double real, imag; } __pyx_t_double_complex;
1261 #endif
1262 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1263 
1264 
1265 /*--- Type declarations ---*/
1266 struct __pyx_obj_2bx_3bbi_8bpt_file_BPTFile;
1267 struct __pyx_obj_2bx_3bbi_12cirtree_file_CIRTreeFile;
1268 struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock;
1269 struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData;
1270 struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler;
1271 struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile;
1272 struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel;
1273 
1274 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":729
1275  * ctypedef npy_longdouble longdouble_t
1276  *
1277  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1278  * ctypedef npy_cdouble     cdouble_t
1279  * ctypedef npy_clongdouble clongdouble_t
1280  */
1281 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1282 
1283 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":730
1284  *
1285  * ctypedef npy_cfloat      cfloat_t
1286  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1287  * ctypedef npy_clongdouble clongdouble_t
1288  *
1289  */
1290 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1291 
1292 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":731
1293  * ctypedef npy_cfloat      cfloat_t
1294  * ctypedef npy_cdouble     cdouble_t
1295  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1296  *
1297  * ctypedef npy_cdouble     complex_t
1298  */
1299 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1300 
1301 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":733
1302  * ctypedef npy_clongdouble clongdouble_t
1303  *
1304  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1305  *
1306  * cdef inline object PyArray_MultiIterNew1(a):
1307  */
1308 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1309 
1310 /* "bx/bbi/bbi_file.pyx":49
1311  * cdef inline int imin(int a, int b): return a if a <= b else b
1312  *
1313  * cdef enum summary_type:             # <<<<<<<<<<<<<<
1314  *     summary_type_mean = 0
1315  *     summary_type_max = 1
1316  */
1317 enum __pyx_t_2bx_3bbi_8bbi_file_summary_type {
1318   __pyx_e_2bx_3bbi_8bbi_file_summary_type_mean = 0,
1319   __pyx_e_2bx_3bbi_8bbi_file_summary_type_max = 1,
1320   __pyx_e_2bx_3bbi_8bbi_file_summary_type_min = 2,
1321   __pyx_e_2bx_3bbi_8bbi_file_summary_type_coverage = 3,
1322   __pyx_e_2bx_3bbi_8bbi_file_summary_type_sd = 4
1323 };
1324 
1325 /* "bpt_file.pxd":5
1326  * from types cimport *
1327  *
1328  * cdef class BPTFile:             # <<<<<<<<<<<<<<
1329  *     """
1330  *     On disk B+ tree compatible with Jim Kent's bPlusTree.c
1331  */
1332 struct __pyx_obj_2bx_3bbi_8bpt_file_BPTFile {
1333   PyObject_HEAD
1334   PyObject *file;
1335   PyObject *reader;
1336   __pyx_t_2bx_3bbi_5types_boolean is_byteswapped;
1337   __pyx_t_2bx_3bbi_5types_bits32 block_size;
1338   __pyx_t_2bx_3bbi_5types_bits32 key_size;
1339   __pyx_t_2bx_3bbi_5types_bits32 value_size;
1340   __pyx_t_2bx_3bbi_5types_bits64 item_count;
1341   __pyx_t_2bx_3bbi_5types_bits64 root_offset;
1342 };
1343 
1344 
1345 /* "cirtree_file.pxd":3
1346  * from types cimport *
1347  *
1348  * cdef class CIRTreeFile:             # <<<<<<<<<<<<<<
1349  *     cdef object file
1350  *     cdef object reader
1351  */
1352 struct __pyx_obj_2bx_3bbi_12cirtree_file_CIRTreeFile {
1353   PyObject_HEAD
1354   PyObject *file;
1355   PyObject *reader;
1356   __pyx_t_2bx_3bbi_5types_boolean is_byteswapped;
1357   __pyx_t_2bx_3bbi_5types_bits64 root_offset;
1358   __pyx_t_2bx_3bbi_5types_bits32 block_size;
1359   __pyx_t_2bx_3bbi_5types_bits64 item_count;
1360   __pyx_t_2bx_3bbi_5types_bits32 start_chrom_ix;
1361   __pyx_t_2bx_3bbi_5types_bits32 start_base;
1362   __pyx_t_2bx_3bbi_5types_bits32 end_chrom_ix;
1363   __pyx_t_2bx_3bbi_5types_bits32 end_base;
1364   __pyx_t_2bx_3bbi_5types_bits64 file_size;
1365   __pyx_t_2bx_3bbi_5types_bits32 items_per_slot;
1366 };
1367 
1368 
1369 /* "bx/bbi/bbi_file.pxd":8
1370  * cimport numpy
1371  *
1372  * cdef class SummaryBlock:             # <<<<<<<<<<<<<<
1373  *     """
1374  *     A block of summary data from disk
1375  */
1376 struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock {
1377   PyObject_HEAD
1378   __pyx_t_2bx_3bbi_5types_bits32 chrom_id;
1379   __pyx_t_2bx_3bbi_5types_bits32 start;
1380   __pyx_t_2bx_3bbi_5types_bits32 end;
1381   __pyx_t_2bx_3bbi_5types_bits32 valid_count;
1382   double min_val;
1383   double max_val;
1384   double sum_data;
1385   double sum_squares;
1386 };
1387 
1388 
1389 /* "bx/bbi/bbi_file.pxd":21
1390  *     cdef public double sum_squares
1391  *
1392  * cdef class SummarizedData:             # <<<<<<<<<<<<<<
1393  *     """
1394  *     The result of using SummaryBlocks read from the file to produce a
1395  */
1396 struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData {
1397   PyObject_HEAD
1398   struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_SummarizedData *__pyx_vtab;
1399   __pyx_t_2bx_3bbi_5types_bits32 start;
1400   __pyx_t_2bx_3bbi_5types_bits32 end;
1401   int size;
1402   PyArrayObject *valid_count;
1403   PyArrayObject *min_val;
1404   PyArrayObject *max_val;
1405   PyArrayObject *sum_data;
1406   PyArrayObject *sum_squares;
1407 };
1408 
1409 
1410 /* "bx/bbi/bbi_file.pxd":39
1411  * cdef class BBIFile
1412  *
1413  * cdef class BlockHandler:             # <<<<<<<<<<<<<<
1414  *     """
1415  *     Callback for `BBIFile.visit_blocks_in_region`
1416  */
1417 struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler {
1418   PyObject_HEAD
1419   struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BlockHandler *__pyx_vtab;
1420 };
1421 
1422 
1423 /* "bx/bbi/bbi_file.pxd":37
1424  *     cdef accumulate_interval_value( self, bits32 s, bits32 e, float val )
1425  *
1426  * cdef class BBIFile             # <<<<<<<<<<<<<<
1427  *
1428  * cdef class BlockHandler:
1429  */
1430 struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile {
1431   PyObject_HEAD
1432   struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BBIFile *__pyx_vtab;
1433   PyObject *file;
1434   PyObject *reader;
1435   __pyx_t_2bx_3bbi_5types_bits32 magic;
1436   __pyx_t_2bx_3bbi_5types_boolean is_byteswapped;
1437   struct __pyx_obj_2bx_3bbi_8bpt_file_BPTFile *chrom_bpt;
1438   __pyx_t_2bx_3bbi_5types_bits16 version;
1439   __pyx_t_2bx_3bbi_5types_bits16 zoom_levels;
1440   __pyx_t_2bx_3bbi_5types_bits64 chrom_tree_offset;
1441   __pyx_t_2bx_3bbi_5types_bits64 unzoomed_data_offset;
1442   __pyx_t_2bx_3bbi_5types_bits64 unzoomed_index_offset;
1443   __pyx_t_2bx_3bbi_5types_bits16 field_count;
1444   __pyx_t_2bx_3bbi_5types_bits16 defined_field_count;
1445   __pyx_t_2bx_3bbi_5types_bits64 as_offset;
1446   __pyx_t_2bx_3bbi_5types_bits64 total_summary_offset;
1447   __pyx_t_2bx_3bbi_5types_bits32 uncompress_buf_size;
1448   PyObject *level_list;
1449 };
1450 
1451 
1452 /* "bx/bbi/bbi_file.pyx":292
1453  *         return closest_level
1454  *
1455  * cdef class ZoomLevel:             # <<<<<<<<<<<<<<
1456  *     cdef BBIFile bbi_file
1457  *     cdef public bits32 reduction_level
1458  */
1459 struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel {
1460   PyObject_HEAD
1461   struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_vtab;
1462   struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *bbi_file;
1463   __pyx_t_2bx_3bbi_5types_bits32 reduction_level;
1464   __pyx_t_2bx_3bbi_5types_bits32 reserved;
1465   __pyx_t_2bx_3bbi_5types_bits64 data_offset;
1466   __pyx_t_2bx_3bbi_5types_bits64 index_offset;
1467   int item_count;
1468 };
1469 
1470 
1471 
1472 /* "bx/bbi/bbi_file.pyx":62
1473  *     pass
1474  *
1475  * cdef class SummarizedData:             # <<<<<<<<<<<<<<
1476  *     """
1477  *     The result of using SummaryBlocks read from the file to produce a
1478  */
1479 
1480 struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_SummarizedData {
1481   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);
1482 };
1483 static struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_SummarizedData *__pyx_vtabptr_2bx_3bbi_8bbi_file_SummarizedData;
1484 
1485 
1486 /* "bx/bbi/bbi_file.pyx":116
1487  *         pass
1488  *
1489  * cdef class BBIFile:             # <<<<<<<<<<<<<<
1490  *     """
1491  *     A "big binary indexed" file. Stores blocks of raw data and numeric
1492  */
1493 
1494 struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BBIFile {
1495   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 *);
1496   PyObject *(*_get_chrom_id_and_size)(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *, char *);
1497   PyObject *(*_best_zoom_level)(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *, int);
1498   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);
1499   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);
1500   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);
1501   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);
1502 };
1503 static struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BBIFile *__pyx_vtabptr_2bx_3bbi_8bbi_file_BBIFile;
1504 
1505 
1506 /* "bx/bbi/bbi_file.pyx":109
1507  *                     min_val[j] = val
1508  *
1509  * cdef class BlockHandler:             # <<<<<<<<<<<<<<
1510  *     """
1511  *     Callback for `BBIFile.visit_blocks_in_region`
1512  */
1513 
1514 struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BlockHandler {
1515   PyObject *(*handle_block)(struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *, PyObject *, struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *);
1516 };
1517 static struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BlockHandler *__pyx_vtabptr_2bx_3bbi_8bbi_file_BlockHandler;
1518 
1519 
1520 /* "bx/bbi/bbi_file.pyx":292
1521  *         return closest_level
1522  *
1523  * cdef class ZoomLevel:             # <<<<<<<<<<<<<<
1524  *     cdef BBIFile bbi_file
1525  *     cdef public bits32 reduction_level
1526  */
1527 
1528 struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_ZoomLevel {
1529   PyObject *(*_get_summary_slice)(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, PyObject *);
1530   PyObject *(*_summarize)(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, int);
1531 };
1532 static struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_vtabptr_2bx_3bbi_8bbi_file_ZoomLevel;
1533 
1534 /* --- Runtime support code (head) --- */
1535 /* Refnanny.proto */
1536 #ifndef CYTHON_REFNANNY
1537   #define CYTHON_REFNANNY 0
1538 #endif
1539 #if CYTHON_REFNANNY
1540   typedef struct {
1541     void (*INCREF)(void*, PyObject*, int);
1542     void (*DECREF)(void*, PyObject*, int);
1543     void (*GOTREF)(void*, PyObject*, int);
1544     void (*GIVEREF)(void*, PyObject*, int);
1545     void* (*SetupContext)(const char*, int, const char*);
1546     void (*FinishContext)(void**);
1547   } __Pyx_RefNannyAPIStruct;
1548   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1549   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1550   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1551 #ifdef WITH_THREAD
1552   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1553           if (acquire_gil) {\
1554               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1555               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1556               PyGILState_Release(__pyx_gilstate_save);\
1557           } else {\
1558               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1559           }
1560 #else
1561   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1562           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1563 #endif
1564   #define __Pyx_RefNannyFinishContext()\
1565           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1566   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1567   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1568   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1569   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1570   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1571   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1572   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1573   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1574 #else
1575   #define __Pyx_RefNannyDeclarations
1576   #define __Pyx_RefNannySetupContext(name, acquire_gil)
1577   #define __Pyx_RefNannyFinishContext()
1578   #define __Pyx_INCREF(r) Py_INCREF(r)
1579   #define __Pyx_DECREF(r) Py_DECREF(r)
1580   #define __Pyx_GOTREF(r)
1581   #define __Pyx_GIVEREF(r)
1582   #define __Pyx_XINCREF(r) Py_XINCREF(r)
1583   #define __Pyx_XDECREF(r) Py_XDECREF(r)
1584   #define __Pyx_XGOTREF(r)
1585   #define __Pyx_XGIVEREF(r)
1586 #endif
1587 #define __Pyx_XDECREF_SET(r, v) do {\
1588         PyObject *tmp = (PyObject *) r;\
1589         r = v; __Pyx_XDECREF(tmp);\
1590     } while (0)
1591 #define __Pyx_DECREF_SET(r, v) do {\
1592         PyObject *tmp = (PyObject *) r;\
1593         r = v; __Pyx_DECREF(tmp);\
1594     } while (0)
1595 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1596 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1597 
1598 /* PyObjectGetAttrStr.proto */
1599 #if CYTHON_USE_TYPE_SLOTS
1600 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1601 #else
1602 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1603 #endif
1604 
1605 /* GetBuiltinName.proto */
1606 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1607 
1608 /* PyErrExceptionMatches.proto */
1609 #if CYTHON_FAST_THREAD_STATE
1610 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1611 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1612 #else
1613 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
1614 #endif
1615 
1616 /* PyThreadStateGet.proto */
1617 #if CYTHON_FAST_THREAD_STATE
1618 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
1619 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
1620 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
1621 #else
1622 #define __Pyx_PyThreadState_declare
1623 #define __Pyx_PyThreadState_assign
1624 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
1625 #endif
1626 
1627 /* PyErrFetchRestore.proto */
1628 #if CYTHON_FAST_THREAD_STATE
1629 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1630 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1631 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1632 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1633 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1634 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1635 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1636 #if CYTHON_COMPILING_IN_CPYTHON
1637 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1638 #else
1639 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1640 #endif
1641 #else
1642 #define __Pyx_PyErr_Clear() PyErr_Clear()
1643 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1644 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
1645 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
1646 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
1647 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
1648 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
1649 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
1650 #endif
1651 
1652 /* GetAttr.proto */
1653 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1654 
1655 /* GetAttr3.proto */
1656 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1657 
1658 /* PyDictVersioning.proto */
1659 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1660 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
1661 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
1662 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1663     (version_var) = __PYX_GET_DICT_VERSION(dict);\
1664     (cache_var) = (value);
1665 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1666     static PY_UINT64_T __pyx_dict_version = 0;\
1667     static PyObject *__pyx_dict_cached_value = NULL;\
1668     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1669         (VAR) = __pyx_dict_cached_value;\
1670     } else {\
1671         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1672         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1673     }\
1674 }
1675 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1676 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1677 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1678 #else
1679 #define __PYX_GET_DICT_VERSION(dict)  (0)
1680 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1681 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
1682 #endif
1683 
1684 /* GetModuleGlobalName.proto */
1685 #if CYTHON_USE_DICT_VERSIONS
1686 #define __Pyx_GetModuleGlobalName(var, name)  {\
1687     static PY_UINT64_T __pyx_dict_version = 0;\
1688     static PyObject *__pyx_dict_cached_value = NULL;\
1689     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1690         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1691         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1692 }
1693 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
1694     PY_UINT64_T __pyx_dict_version;\
1695     PyObject *__pyx_dict_cached_value;\
1696     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1697 }
1698 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1699 #else
1700 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1701 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1702 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1703 #endif
1704 
1705 /* RaiseArgTupleInvalid.proto */
1706 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1707     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1708 
1709 /* RaiseDoubleKeywords.proto */
1710 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1711 
1712 /* ParseKeywords.proto */
1713 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1714     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1715     const char* function_name);
1716 
1717 /* PyObjectCall.proto */
1718 #if CYTHON_COMPILING_IN_CPYTHON
1719 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1720 #else
1721 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1722 #endif
1723 
1724 /* ExtTypeTest.proto */
1725 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1726 
1727 /* IsLittleEndian.proto */
1728 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
1729 
1730 /* BufferFormatCheck.proto */
1731 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
1732 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1733                               __Pyx_BufFmt_StackElem* stack,
1734                               __Pyx_TypeInfo* type);
1735 
1736 /* BufferGetAndValidate.proto */
1737 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
1738     ((obj == Py_None || obj == NULL) ?\
1739     (__Pyx_ZeroBuffer(buf), 0) :\
1740     __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
1741 static int  __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1742     __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
1743 static void __Pyx_ZeroBuffer(Py_buffer* buf);
1744 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1745 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
1746 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
1747 
1748 /* BufferIndexError.proto */
1749 static void __Pyx_RaiseBufferIndexError(int axis);
1750 
1751 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
1752 /* PyFunctionFastCall.proto */
1753 #if CYTHON_FAST_PYCALL
1754 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1755     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1756 #if 1 || PY_VERSION_HEX < 0x030600B1
1757 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1758 #else
1759 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1760 #endif
1761 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1762     (sizeof(char [1 - 2*!(cond)]) - 1)
1763 #ifndef Py_MEMBER_SIZE
1764 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1765 #endif
1766 #if CYTHON_FAST_PYCALL
1767   static size_t __pyx_pyframe_localsplus_offset = 0;
1768   #include "frameobject.h"
1769   #define __Pxy_PyFrame_Initialize_Offsets()\
1770     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1771      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1772   #define __Pyx_PyFrame_GetLocalsplus(frame)\
1773     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1774 #endif // CYTHON_FAST_PYCALL
1775 #endif
1776 
1777 /* PyCFunctionFastCall.proto */
1778 #if CYTHON_FAST_PYCCALL
1779 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1780 #else
1781 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
1782 #endif
1783 
1784 /* PyObjectCallMethO.proto */
1785 #if CYTHON_COMPILING_IN_CPYTHON
1786 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1787 #endif
1788 
1789 /* PyObjectCallNoArg.proto */
1790 #if CYTHON_COMPILING_IN_CPYTHON
1791 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1792 #else
1793 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1794 #endif
1795 
1796 /* PyObjectCallOneArg.proto */
1797 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1798 
1799 /* PyObjectCall2Args.proto */
1800 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1801 
1802 /* ListAppend.proto */
1803 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)1804 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1805     PyListObject* L = (PyListObject*) list;
1806     Py_ssize_t len = Py_SIZE(list);
1807     if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1808         Py_INCREF(x);
1809         PyList_SET_ITEM(list, len, x);
1810         __Pyx_SET_SIZE(list, len + 1);
1811         return 0;
1812     }
1813     return PyList_Append(list, x);
1814 }
1815 #else
1816 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1817 #endif
1818 
1819 /* PyObjectGetMethod.proto */
1820 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
1821 
1822 /* PyObjectCallMethod1.proto */
1823 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
1824 
1825 /* append.proto */
1826 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
1827 
1828 /* RaiseTooManyValuesToUnpack.proto */
1829 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1830 
1831 /* RaiseNeedMoreValuesToUnpack.proto */
1832 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1833 
1834 /* IterFinish.proto */
1835 static CYTHON_INLINE int __Pyx_IterFinish(void);
1836 
1837 /* UnpackItemEndCheck.proto */
1838 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1839 
1840 /* None.proto */
1841 static CYTHON_INLINE long __Pyx_div_long(long, long);
1842 
1843 /* RaiseException.proto */
1844 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1845 
1846 /* GetItemInt.proto */
1847 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1848     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1849     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1850     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1851                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1852 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1853     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1854     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1855     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1856 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1857                                                               int wraparound, int boundscheck);
1858 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1859     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1860     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1861     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1862 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1863                                                               int wraparound, int boundscheck);
1864 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1865 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1866                                                      int is_list, int wraparound, int boundscheck);
1867 
1868 /* PyIntBinop.proto */
1869 #if !CYTHON_COMPILING_IN_PYPY
1870 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1871 #else
1872 #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
1873     (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
1874 #endif
1875 
1876 /* PyIntCompare.proto */
1877 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
1878 
1879 /* PyIntBinop.proto */
1880 #if !CYTHON_COMPILING_IN_PYPY
1881 static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1882 #else
1883 #define __Pyx_PyInt_RemainderObjC(op1, op2, intval, inplace, zerodivision_check)\
1884     (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2))
1885 #endif
1886 
1887 /* BufferFallbackError.proto */
1888 static void __Pyx_RaiseBufferFallbackError(void);
1889 
1890 /* Import.proto */
1891 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1892 
1893 /* ImportFrom.proto */
1894 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1895 
1896 /* HasAttr.proto */
1897 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1898 
1899 /* GetTopmostException.proto */
1900 #if CYTHON_USE_EXC_INFO_STACK
1901 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1902 #endif
1903 
1904 /* SaveResetException.proto */
1905 #if CYTHON_FAST_THREAD_STATE
1906 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1907 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1908 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1909 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1910 #else
1911 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
1912 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
1913 #endif
1914 
1915 /* GetException.proto */
1916 #if CYTHON_FAST_THREAD_STATE
1917 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
1918 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1919 #else
1920 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1921 #endif
1922 
1923 /* PyObject_GenericGetAttrNoDict.proto */
1924 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1925 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1926 #else
1927 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1928 #endif
1929 
1930 /* PyObject_GenericGetAttr.proto */
1931 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1932 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1933 #else
1934 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1935 #endif
1936 
1937 /* PyObjectGetAttrStrNoError.proto */
1938 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1939 
1940 /* SetupReduce.proto */
1941 static int __Pyx_setup_reduce(PyObject* type_obj);
1942 
1943 /* SetVTable.proto */
1944 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1945 
1946 /* TypeImport.proto */
1947 #ifndef __PYX_HAVE_RT_ImportType_proto
1948 #define __PYX_HAVE_RT_ImportType_proto
1949 enum __Pyx_ImportType_CheckSize {
1950    __Pyx_ImportType_CheckSize_Error = 0,
1951    __Pyx_ImportType_CheckSize_Warn = 1,
1952    __Pyx_ImportType_CheckSize_Ignore = 2
1953 };
1954 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1955 #endif
1956 
1957 /* CLineInTraceback.proto */
1958 #ifdef CYTHON_CLINE_IN_TRACEBACK
1959 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1960 #else
1961 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1962 #endif
1963 
1964 /* CodeObjectCache.proto */
1965 typedef struct {
1966     PyCodeObject* code_object;
1967     int code_line;
1968 } __Pyx_CodeObjectCacheEntry;
1969 struct __Pyx_CodeObjectCache {
1970     int count;
1971     int max_count;
1972     __Pyx_CodeObjectCacheEntry* entries;
1973 };
1974 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1975 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1976 static PyCodeObject *__pyx_find_code_object(int code_line);
1977 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1978 
1979 /* AddTraceback.proto */
1980 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1981                                int py_line, const char *filename);
1982 
1983 /* GCCDiagnostics.proto */
1984 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1985 #define __Pyx_HAS_GCC_DIAGNOSTIC
1986 #endif
1987 
1988 /* BufferStructDeclare.proto */
1989 typedef struct {
1990   Py_ssize_t shape, strides, suboffsets;
1991 } __Pyx_Buf_DimInfo;
1992 typedef struct {
1993   size_t refcount;
1994   Py_buffer pybuffer;
1995 } __Pyx_Buffer;
1996 typedef struct {
1997   __Pyx_Buffer *rcbuffer;
1998   char *data;
1999   __Pyx_Buf_DimInfo diminfo[8];
2000 } __Pyx_LocalBuf_ND;
2001 
2002 #if PY_MAJOR_VERSION < 3
2003     static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2004     static void __Pyx_ReleaseBuffer(Py_buffer *view);
2005 #else
2006     #define __Pyx_GetBuffer PyObject_GetBuffer
2007     #define __Pyx_ReleaseBuffer PyBuffer_Release
2008 #endif
2009 
2010 
2011 /* RealImag.proto */
2012 #if CYTHON_CCOMPLEX
2013   #ifdef __cplusplus
2014     #define __Pyx_CREAL(z) ((z).real())
2015     #define __Pyx_CIMAG(z) ((z).imag())
2016   #else
2017     #define __Pyx_CREAL(z) (__real__(z))
2018     #define __Pyx_CIMAG(z) (__imag__(z))
2019   #endif
2020 #else
2021     #define __Pyx_CREAL(z) ((z).real)
2022     #define __Pyx_CIMAG(z) ((z).imag)
2023 #endif
2024 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2025         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2026     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2027     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2028 #else
2029     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2030     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2031 #endif
2032 
2033 /* Arithmetic.proto */
2034 #if CYTHON_CCOMPLEX
2035     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
2036     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
2037     #define __Pyx_c_diff_float(a, b) ((a)-(b))
2038     #define __Pyx_c_prod_float(a, b) ((a)*(b))
2039     #define __Pyx_c_quot_float(a, b) ((a)/(b))
2040     #define __Pyx_c_neg_float(a)     (-(a))
2041   #ifdef __cplusplus
2042     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2043     #define __Pyx_c_conj_float(z)    (::std::conj(z))
2044     #if 1
2045         #define __Pyx_c_abs_float(z)     (::std::abs(z))
2046         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
2047     #endif
2048   #else
2049     #define __Pyx_c_is_zero_float(z) ((z)==0)
2050     #define __Pyx_c_conj_float(z)    (conjf(z))
2051     #if 1
2052         #define __Pyx_c_abs_float(z)     (cabsf(z))
2053         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
2054     #endif
2055  #endif
2056 #else
2057     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2058     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2059     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2060     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2061     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2062     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2063     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2064     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2065     #if 1
2066         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2067         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2068     #endif
2069 #endif
2070 
2071 /* Arithmetic.proto */
2072 #if CYTHON_CCOMPLEX
2073     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
2074     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
2075     #define __Pyx_c_diff_double(a, b) ((a)-(b))
2076     #define __Pyx_c_prod_double(a, b) ((a)*(b))
2077     #define __Pyx_c_quot_double(a, b) ((a)/(b))
2078     #define __Pyx_c_neg_double(a)     (-(a))
2079   #ifdef __cplusplus
2080     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2081     #define __Pyx_c_conj_double(z)    (::std::conj(z))
2082     #if 1
2083         #define __Pyx_c_abs_double(z)     (::std::abs(z))
2084         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
2085     #endif
2086   #else
2087     #define __Pyx_c_is_zero_double(z) ((z)==0)
2088     #define __Pyx_c_conj_double(z)    (conj(z))
2089     #if 1
2090         #define __Pyx_c_abs_double(z)     (cabs(z))
2091         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
2092     #endif
2093  #endif
2094 #else
2095     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2096     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2097     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2098     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2099     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2100     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2101     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2102     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2103     #if 1
2104         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2105         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2106     #endif
2107 #endif
2108 
2109 /* CIntToPy.proto */
2110 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);
2111 
2112 /* CIntFromPy.proto */
2113 static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);
2114 
2115 /* CIntToPy.proto */
2116 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2117 
2118 /* CIntFromPy.proto */
2119 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2120 
2121 /* CIntToPy.proto */
2122 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value);
2123 
2124 /* CIntFromPy.proto */
2125 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject *);
2126 
2127 /* CIntToPy.proto */
2128 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_short(unsigned short value);
2129 
2130 /* CIntFromPy.proto */
2131 static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *);
2132 
2133 /* CIntFromPy.proto */
2134 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2135 
2136 /* CIntToPy.proto */
2137 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2138 
2139 /* FastTypeChecks.proto */
2140 #if CYTHON_COMPILING_IN_CPYTHON
2141 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2142 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2143 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2144 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2145 #else
2146 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2147 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2148 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2149 #endif
2150 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2151 
2152 /* CheckBinaryVersion.proto */
2153 static int __Pyx_check_binary_version(void);
2154 
2155 /* InitStrings.proto */
2156 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2157 
2158 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_14SummarizedData_accumulate_interval_value(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_s, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_e, float __pyx_v_val); /* proto*/
2159 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_12BlockHandler_handle_block(CYTHON_UNUSED struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_block_data, CYTHON_UNUSED struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_bbi_file); /* proto*/
2160 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_7BBIFile_visit_blocks_in_region(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__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, struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *__pyx_v_handler); /* proto*/
2161 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_7BBIFile_summarize(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_chrom, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, int __pyx_v_summary_size, int __pyx_skip_dispatch); /* proto*/
2162 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_7BBIFile_summarize_from_full(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__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_v_summary_size, int __pyx_skip_dispatch); /* proto*/
2163 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_7BBIFile_query(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_chrom, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, int __pyx_v_summary_size, int __pyx_skip_dispatch); /* proto*/
2164 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_7BBIFile__get_chrom_id_and_size(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, char *__pyx_v_chrom); /* proto*/
2165 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_7BBIFile__summarize_from_full(CYTHON_UNUSED struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, CYTHON_UNUSED __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id, CYTHON_UNUSED __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, CYTHON_UNUSED __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, CYTHON_UNUSED int __pyx_v_summary_size); /* proto*/
2166 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_7BBIFile__best_zoom_level(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, int __pyx_v_desired_reduction); /* proto*/
2167 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_9ZoomLevel__get_summary_slice(CYTHON_UNUSED struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_base_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_base_end, PyObject *__pyx_v_summaries); /* proto*/
2168 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_9ZoomLevel__summarize(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__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*/
2169 
2170 /* Module declarations from 'bx.bbi.types' */
2171 
2172 /* Module declarations from 'bx.bbi.bpt_file' */
2173 static PyTypeObject *__pyx_ptype_2bx_3bbi_8bpt_file_BPTFile = 0;
2174 
2175 /* Module declarations from 'bx.bbi.cirtree_file' */
2176 static PyTypeObject *__pyx_ptype_2bx_3bbi_12cirtree_file_CIRTreeFile = 0;
2177 
2178 /* Module declarations from 'cpython.buffer' */
2179 
2180 /* Module declarations from 'libc.string' */
2181 
2182 /* Module declarations from 'libc.stdio' */
2183 
2184 /* Module declarations from '__builtin__' */
2185 
2186 /* Module declarations from 'cpython.type' */
2187 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2188 
2189 /* Module declarations from 'cpython' */
2190 
2191 /* Module declarations from 'cpython.object' */
2192 
2193 /* Module declarations from 'cpython.ref' */
2194 
2195 /* Module declarations from 'cpython.mem' */
2196 
2197 /* Module declarations from 'numpy' */
2198 
2199 /* Module declarations from 'numpy' */
2200 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2201 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2202 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2203 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2204 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2205 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2206 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2207 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2208 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2209 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2210 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2211 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2212 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2213 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2214 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2215 
2216 /* Module declarations from 'cpython.version' */
2217 
2218 /* Module declarations from 'cython' */
2219 
2220 /* Module declarations from 'libc' */
2221 
2222 /* Module declarations from 'libc.limits' */
2223 
2224 /* Module declarations from 'bx.bbi.bbi_file' */
2225 static PyTypeObject *__pyx_ptype_2bx_3bbi_8bbi_file_SummaryBlock = 0;
2226 static PyTypeObject *__pyx_ptype_2bx_3bbi_8bbi_file_SummarizedData = 0;
2227 static PyTypeObject *__pyx_ptype_2bx_3bbi_8bbi_file_BBIFile = 0;
2228 static PyTypeObject *__pyx_ptype_2bx_3bbi_8bbi_file_BlockHandler = 0;
2229 static PyTypeObject *__pyx_ptype_2bx_3bbi_8bbi_file_ZoomLevel = 0;
2230 __PYX_EXTERN_C DL_EXPORT(int) big_wig_sig;
2231 __PYX_EXTERN_C DL_EXPORT(int) big_bed_sig;
2232 static CYTHON_INLINE int __pyx_f_2bx_3bbi_8bbi_file_range_intersection(int, int, int, int); /*proto*/
2233 static PyObject *__pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_SummaryBlock__set_state(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *, PyObject *); /*proto*/
2234 static PyObject *__pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_SummarizedData__set_state(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *, PyObject *); /*proto*/
2235 static PyObject *__pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_BlockHandler__set_state(struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *, PyObject *); /*proto*/
2236 static PyObject *__pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_BBIFile__set_state(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *, PyObject *); /*proto*/
2237 static PyObject *__pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_ZoomLevel__set_state(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *, PyObject *); /*proto*/
2238 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
2239 #define __Pyx_MODULE_NAME "bx.bbi.bbi_file"
2240 extern int __pyx_module_is_main_bx__bbi__bbi_file;
2241 int __pyx_module_is_main_bx__bbi__bbi_file = 0;
2242 
2243 /* Implementation of 'bx.bbi.bbi_file' */
2244 static PyObject *__pyx_builtin_ValueError;
2245 static PyObject *__pyx_builtin_range;
2246 static PyObject *__pyx_builtin_ImportError;
2247 static const char __pyx_k_II[] = "II";
2248 static const char __pyx_k_io[] = "io";
2249 static const char __pyx_k_end[] = "end";
2250 static const char __pyx_k_max[] = "max";
2251 static const char __pyx_k_min[] = "min";
2252 static const char __pyx_k_nan[] = "nan";
2253 static const char __pyx_k_new[] = "__new__";
2254 static const char __pyx_k_sys[] = "sys";
2255 static const char __pyx_k_dict[] = "__dict__";
2256 static const char __pyx_k_file[] = "file";
2257 static const char __pyx_k_find[] = "find";
2258 static const char __pyx_k_main[] = "__main__";
2259 static const char __pyx_k_math[] = "math";
2260 static const char __pyx_k_mean[] = "mean";
2261 static const char __pyx_k_name[] = "__name__";
2262 static const char __pyx_k_open[] = "open";
2263 static const char __pyx_k_read[] = "read";
2264 static const char __pyx_k_seek[] = "seek";
2265 static const char __pyx_k_size[] = "size";
2266 static const char __pyx_k_skip[] = "skip";
2267 static const char __pyx_k_sqrt[] = "sqrt";
2268 static const char __pyx_k_test[] = "__test__";
2269 static const char __pyx_k_zlib[] = "zlib";
2270 static const char __pyx_k_chrom[] = "chrom";
2271 static const char __pyx_k_deque[] = "deque";
2272 static const char __pyx_k_dtype[] = "dtype";
2273 static const char __pyx_k_numpy[] = "numpy";
2274 static const char __pyx_k_query[] = "query";
2275 static const char __pyx_k_range[] = "range";
2276 static const char __pyx_k_start[] = "start";
2277 static const char __pyx_k_zeros[] = "zeros";
2278 static const char __pyx_k_append[] = "append";
2279 static const char __pyx_k_encode[] = "encode";
2280 static const char __pyx_k_import[] = "__import__";
2281 static const char __pyx_k_pickle[] = "pickle";
2282 static const char __pyx_k_reduce[] = "__reduce__";
2283 static const char __pyx_k_unpack[] = "unpack";
2284 static const char __pyx_k_update[] = "update";
2285 static const char __pyx_k_BBIFile[] = "BBIFile";
2286 static const char __pyx_k_BytesIO[] = "BytesIO";
2287 static const char __pyx_k_float64[] = "float64";
2288 static const char __pyx_k_max_val[] = "max_val";
2289 static const char __pyx_k_min_val[] = "min_val";
2290 static const char __pyx_k_popleft[] = "popleft";
2291 static const char __pyx_k_std_dev[] = "std_dev";
2292 static const char __pyx_k_chrom_id[] = "chrom_id";
2293 static const char __pyx_k_coverage[] = "coverage";
2294 static const char __pyx_k_getstate[] = "__getstate__";
2295 static const char __pyx_k_pyx_type[] = "__pyx_type";
2296 static const char __pyx_k_setstate[] = "__setstate__";
2297 static const char __pyx_k_sum_data[] = "sum_data";
2298 static const char __pyx_k_ZoomLevel[] = "ZoomLevel";
2299 static const char __pyx_k_pyx_state[] = "__pyx_state";
2300 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2301 static const char __pyx_k_summarize[] = "summarize";
2302 static const char __pyx_k_type_name[] = "type_name";
2303 static const char __pyx_k_ValueError[] = "ValueError";
2304 static const char __pyx_k_decompress[] = "decompress";
2305 static const char __pyx_k_pyx_result[] = "__pyx_result";
2306 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2307 static const char __pyx_k_read_float[] = "read_float";
2308 static const char __pyx_k_ImportError[] = "ImportError";
2309 static const char __pyx_k_PickleError[] = "PickleError";
2310 static const char __pyx_k_collections[] = "collections";
2311 static const char __pyx_k_read_uint16[] = "read_uint16";
2312 static const char __pyx_k_read_uint32[] = "read_uint32";
2313 static const char __pyx_k_read_uint64[] = "read_uint64";
2314 static const char __pyx_k_sum_squares[] = "sum_squares";
2315 static const char __pyx_k_valid_count[] = "valid_count";
2316 static const char __pyx_k_BlockHandler[] = "BlockHandler";
2317 static const char __pyx_k_SummaryBlock[] = "SummaryBlock";
2318 static const char __pyx_k_expected_sig[] = "expected_sig";
2319 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2320 static const char __pyx_k_stringsource[] = "stringsource";
2321 static const char __pyx_k_summary_size[] = "summary_size";
2322 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2323 static const char __pyx_k_SummarizedData[] = "SummarizedData";
2324 static const char __pyx_k_bx_bbi_bbi_file[] = "bx.bbi.bbi_file";
2325 static const char __pyx_k_byteswap_needed[] = "byteswap_needed";
2326 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2327 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2328 static const char __pyx_k_BinaryFileReader[] = "BinaryFileReader";
2329 static const char __pyx_k_is_little_endian[] = "is_little_endian";
2330 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2331 static const char __pyx_k_bx_misc_binary_file[] = "bx.misc.binary_file";
2332 static const char __pyx_k_summarize_from_full[] = "summarize_from_full";
2333 static const char __pyx_k_pyx_unpickle_BBIFile[] = "__pyx_unpickle_BBIFile";
2334 static const char __pyx_k_pyx_unpickle_ZoomLevel[] = "__pyx_unpickle_ZoomLevel";
2335 static const char __pyx_k_find_overlapping_blocks[] = "find_overlapping_blocks";
2336 static const char __pyx_k_summary_blocks_in_region[] = "_summary_blocks_in_region";
2337 static const char __pyx_k_pyx_unpickle_BlockHandler[] = "__pyx_unpickle_BlockHandler";
2338 static const char __pyx_k_pyx_unpickle_SummaryBlock[] = "__pyx_unpickle_SummaryBlock";
2339 static const char __pyx_k_pyx_unpickle_SummarizedData[] = "__pyx_unpickle_SummarizedData";
2340 static const char __pyx_k_Core_implementation_for_reading[] = "\nCore implementation for reading UCSC \"big binary indexed\" files.\n\nThere isn't really any specification for the format beyond the code, so this\nmirrors Jim Kent's 'bbiRead.c' mostly. \n";
2341 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2342 static const char __pyx_k_Incompatible_checksums_s_vs_0x36[] = "Incompatible checksums (%s vs 0x3665355 = (bbi_file, data_offset, index_offset, item_count, reduction_level, reserved))";
2343 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))";
2344 static const char __pyx_k_Incompatible_checksums_s_vs_0x73[] = "Incompatible checksums (%s vs 0x732cf8a = (chrom_id, end, max_val, min_val, start, sum_data, sum_squares, valid_count))";
2345 static const char __pyx_k_Incompatible_checksums_s_vs_0xd4[] = "Incompatible checksums (%s vs 0xd41d8cd = ())";
2346 static const char __pyx_k_Incompatible_checksums_s_vs_0xf7[] = "Incompatible checksums (%s vs 0xf78375f = (end, max_val, min_val, size, start, sum_data, sum_squares, valid_count))";
2347 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2348 static PyObject *__pyx_n_s_BBIFile;
2349 static PyObject *__pyx_n_s_BinaryFileReader;
2350 static PyObject *__pyx_n_s_BlockHandler;
2351 static PyObject *__pyx_n_s_BytesIO;
2352 static PyObject *__pyx_n_s_II;
2353 static PyObject *__pyx_n_s_ImportError;
2354 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x36;
2355 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x55;
2356 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x73;
2357 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xd4;
2358 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xf7;
2359 static PyObject *__pyx_n_s_PickleError;
2360 static PyObject *__pyx_n_s_SummarizedData;
2361 static PyObject *__pyx_n_s_SummaryBlock;
2362 static PyObject *__pyx_n_s_ValueError;
2363 static PyObject *__pyx_n_s_ZoomLevel;
2364 static PyObject *__pyx_n_s_append;
2365 static PyObject *__pyx_n_s_bx_bbi_bbi_file;
2366 static PyObject *__pyx_n_s_bx_misc_binary_file;
2367 static PyObject *__pyx_n_s_byteswap_needed;
2368 static PyObject *__pyx_n_s_chrom;
2369 static PyObject *__pyx_n_s_chrom_id;
2370 static PyObject *__pyx_n_s_cline_in_traceback;
2371 static PyObject *__pyx_n_s_collections;
2372 static PyObject *__pyx_n_s_coverage;
2373 static PyObject *__pyx_n_s_decompress;
2374 static PyObject *__pyx_n_s_deque;
2375 static PyObject *__pyx_n_s_dict;
2376 static PyObject *__pyx_n_s_dtype;
2377 static PyObject *__pyx_n_s_encode;
2378 static PyObject *__pyx_n_s_end;
2379 static PyObject *__pyx_n_s_expected_sig;
2380 static PyObject *__pyx_n_s_file;
2381 static PyObject *__pyx_n_s_find;
2382 static PyObject *__pyx_n_s_find_overlapping_blocks;
2383 static PyObject *__pyx_n_s_float64;
2384 static PyObject *__pyx_n_s_getstate;
2385 static PyObject *__pyx_n_s_import;
2386 static PyObject *__pyx_n_s_io;
2387 static PyObject *__pyx_n_s_is_little_endian;
2388 static PyObject *__pyx_n_s_main;
2389 static PyObject *__pyx_n_s_math;
2390 static PyObject *__pyx_n_s_max;
2391 static PyObject *__pyx_n_s_max_val;
2392 static PyObject *__pyx_n_s_mean;
2393 static PyObject *__pyx_n_s_min;
2394 static PyObject *__pyx_n_s_min_val;
2395 static PyObject *__pyx_n_s_name;
2396 static PyObject *__pyx_n_s_nan;
2397 static PyObject *__pyx_n_s_new;
2398 static PyObject *__pyx_n_s_numpy;
2399 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2400 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2401 static PyObject *__pyx_n_s_open;
2402 static PyObject *__pyx_n_s_pickle;
2403 static PyObject *__pyx_n_s_popleft;
2404 static PyObject *__pyx_n_s_pyx_PickleError;
2405 static PyObject *__pyx_n_s_pyx_checksum;
2406 static PyObject *__pyx_n_s_pyx_result;
2407 static PyObject *__pyx_n_s_pyx_state;
2408 static PyObject *__pyx_n_s_pyx_type;
2409 static PyObject *__pyx_n_s_pyx_unpickle_BBIFile;
2410 static PyObject *__pyx_n_s_pyx_unpickle_BlockHandler;
2411 static PyObject *__pyx_n_s_pyx_unpickle_SummarizedData;
2412 static PyObject *__pyx_n_s_pyx_unpickle_SummaryBlock;
2413 static PyObject *__pyx_n_s_pyx_unpickle_ZoomLevel;
2414 static PyObject *__pyx_n_s_pyx_vtable;
2415 static PyObject *__pyx_n_s_query;
2416 static PyObject *__pyx_n_s_range;
2417 static PyObject *__pyx_n_s_read;
2418 static PyObject *__pyx_n_s_read_float;
2419 static PyObject *__pyx_n_s_read_uint16;
2420 static PyObject *__pyx_n_s_read_uint32;
2421 static PyObject *__pyx_n_s_read_uint64;
2422 static PyObject *__pyx_n_s_reduce;
2423 static PyObject *__pyx_n_s_reduce_cython;
2424 static PyObject *__pyx_n_s_reduce_ex;
2425 static PyObject *__pyx_n_s_seek;
2426 static PyObject *__pyx_n_s_setstate;
2427 static PyObject *__pyx_n_s_setstate_cython;
2428 static PyObject *__pyx_n_s_size;
2429 static PyObject *__pyx_n_s_skip;
2430 static PyObject *__pyx_n_s_sqrt;
2431 static PyObject *__pyx_n_s_start;
2432 static PyObject *__pyx_n_s_std_dev;
2433 static PyObject *__pyx_kp_s_stringsource;
2434 static PyObject *__pyx_n_s_sum_data;
2435 static PyObject *__pyx_n_s_sum_squares;
2436 static PyObject *__pyx_n_s_summarize;
2437 static PyObject *__pyx_n_s_summarize_from_full;
2438 static PyObject *__pyx_n_s_summary_blocks_in_region;
2439 static PyObject *__pyx_n_s_summary_size;
2440 static PyObject *__pyx_n_s_sys;
2441 static PyObject *__pyx_n_s_test;
2442 static PyObject *__pyx_n_s_type_name;
2443 static PyObject *__pyx_n_s_unpack;
2444 static PyObject *__pyx_n_s_update;
2445 static PyObject *__pyx_n_s_valid_count;
2446 static PyObject *__pyx_n_s_zeros;
2447 static PyObject *__pyx_n_s_zlib;
2448 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_8chrom_id___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self); /* proto */
2449 static int __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_8chrom_id_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2450 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_5start___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self); /* proto */
2451 static int __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_5start_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2452 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_3end___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self); /* proto */
2453 static int __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_3end_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2454 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_11valid_count___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self); /* proto */
2455 static int __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_11valid_count_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2456 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_7min_val___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self); /* proto */
2457 static int __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_7min_val_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2458 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_7max_val___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self); /* proto */
2459 static int __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_7max_val_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2460 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_8sum_data___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self); /* proto */
2461 static int __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_8sum_data_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2462 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_11sum_squares___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self); /* proto */
2463 static int __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_11sum_squares_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2464 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock___reduce_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self); /* proto */
2465 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_2__setstate_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2466 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData___init__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, int __pyx_v_size); /* proto */
2467 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_5start___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self); /* proto */
2468 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_5start_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2469 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_3end___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self); /* proto */
2470 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_3end_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2471 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_4size___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self); /* proto */
2472 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_4size_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2473 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self); /* proto */
2474 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2475 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self); /* proto */
2476 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7min_val___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self); /* proto */
2477 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2478 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self); /* proto */
2479 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7max_val___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self); /* proto */
2480 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2481 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self); /* proto */
2482 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self); /* proto */
2483 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2484 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self); /* proto */
2485 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self); /* proto */
2486 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2487 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self); /* proto */
2488 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_2__reduce_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self); /* proto */
2489 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_4__setstate_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2490 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12BlockHandler___reduce_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *__pyx_v_self); /* proto */
2491 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12BlockHandler_2__setstate_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2492 static int __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile___init__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_file, PyObject *__pyx_v_expected_sig, PyObject *__pyx_v_type_name); /* proto */
2493 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_2open(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_file, PyObject *__pyx_v_expected_sig, CYTHON_UNUSED PyObject *__pyx_v_type_name); /* proto */
2494 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_4summarize(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_chrom, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, int __pyx_v_summary_size); /* proto */
2495 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_6summarize_from_full(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__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_v_summary_size); /* proto */
2496 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_8query(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_chrom, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, int __pyx_v_summary_size); /* proto */
2497 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_5magic___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self); /* proto */
2498 static int __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_5magic_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2499 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_7version___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self); /* proto */
2500 static int __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_7version_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2501 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_11zoom_levels___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self); /* proto */
2502 static int __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_11zoom_levels_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2503 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_10level_list___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self); /* proto */
2504 static int __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_10level_list_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2505 static int __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_10level_list_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self); /* proto */
2506 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_10__reduce_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self); /* proto */
2507 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_12__setstate_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2508 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel__summary_blocks_in_region(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__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 */
2509 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_15reduction_level___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self); /* proto */
2510 static int __pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_15reduction_level_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2511 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_11data_offset___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self); /* proto */
2512 static int __pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_11data_offset_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2513 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_12index_offset___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self); /* proto */
2514 static int __pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_12index_offset_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2515 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_2__reduce_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self); /* proto */
2516 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_4__setstate_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2517 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file___pyx_unpickle_SummaryBlock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2518 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_2__pyx_unpickle_SummarizedData(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2519 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_4__pyx_unpickle_BlockHandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2520 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_6__pyx_unpickle_BBIFile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2521 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_8__pyx_unpickle_ZoomLevel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2522 static PyObject *__pyx_tp_new_2bx_3bbi_8bbi_file_SummaryBlock(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2523 static PyObject *__pyx_tp_new_2bx_3bbi_8bbi_file_SummarizedData(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2524 static PyObject *__pyx_tp_new_2bx_3bbi_8bbi_file_BBIFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2525 static PyObject *__pyx_tp_new_2bx_3bbi_8bbi_file_BlockHandler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2526 static PyObject *__pyx_tp_new_2bx_3bbi_8bbi_file_ZoomLevel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2527 static PyObject *__pyx_int_0;
2528 static PyObject *__pyx_int_1;
2529 static PyObject *__pyx_int_28;
2530 static PyObject *__pyx_int_32;
2531 static PyObject *__pyx_int_64;
2532 static PyObject *__pyx_int_57037653;
2533 static PyObject *__pyx_int_89548920;
2534 static PyObject *__pyx_int_120770442;
2535 static PyObject *__pyx_int_222419149;
2536 static PyObject *__pyx_int_259536735;
2537 static PyObject *__pyx_tuple_;
2538 static PyObject *__pyx_tuple__2;
2539 static PyObject *__pyx_tuple__3;
2540 static PyObject *__pyx_tuple__4;
2541 static PyObject *__pyx_tuple__6;
2542 static PyObject *__pyx_tuple__8;
2543 static PyObject *__pyx_tuple__10;
2544 static PyObject *__pyx_tuple__12;
2545 static PyObject *__pyx_codeobj__5;
2546 static PyObject *__pyx_codeobj__7;
2547 static PyObject *__pyx_codeobj__9;
2548 static PyObject *__pyx_codeobj__11;
2549 static PyObject *__pyx_codeobj__13;
2550 /* Late includes */
2551 int big_wig_sig;
2552 int big_bed_sig;
2553 
2554 /* "bx/bbi/bbi_file.pyx":41
2555  *
2556  * @cython.profile(False)
2557  * cdef inline int range_intersection( int start1, int end1, int start2, int end2 ):             # <<<<<<<<<<<<<<
2558  *     return min( end1, end2 ) - max( start1, start2 )
2559  *
2560  */
2561 
__pyx_f_2bx_3bbi_8bbi_file_range_intersection(int __pyx_v_start1,int __pyx_v_end1,int __pyx_v_start2,int __pyx_v_end2)2562 static CYTHON_INLINE int __pyx_f_2bx_3bbi_8bbi_file_range_intersection(int __pyx_v_start1, int __pyx_v_end1, int __pyx_v_start2, int __pyx_v_end2) {
2563   int __pyx_r;
2564   __Pyx_RefNannyDeclarations
2565   int __pyx_t_1;
2566   int __pyx_t_2;
2567   int __pyx_t_3;
2568   int __pyx_t_4;
2569   __Pyx_RefNannySetupContext("range_intersection", 0);
2570 
2571   /* "bx/bbi/bbi_file.pyx":42
2572  * @cython.profile(False)
2573  * cdef inline int range_intersection( int start1, int end1, int start2, int end2 ):
2574  *     return min( end1, end2 ) - max( start1, start2 )             # <<<<<<<<<<<<<<
2575  *
2576  * @cython.profile(False)
2577  */
2578   __pyx_t_1 = __pyx_v_end2;
2579   __pyx_t_2 = __pyx_v_end1;
2580   if (((__pyx_t_1 < __pyx_t_2) != 0)) {
2581     __pyx_t_3 = __pyx_t_1;
2582   } else {
2583     __pyx_t_3 = __pyx_t_2;
2584   }
2585   __pyx_t_1 = __pyx_v_start2;
2586   __pyx_t_2 = __pyx_v_start1;
2587   if (((__pyx_t_1 > __pyx_t_2) != 0)) {
2588     __pyx_t_4 = __pyx_t_1;
2589   } else {
2590     __pyx_t_4 = __pyx_t_2;
2591   }
2592   __pyx_r = (__pyx_t_3 - __pyx_t_4);
2593   goto __pyx_L0;
2594 
2595   /* "bx/bbi/bbi_file.pyx":41
2596  *
2597  * @cython.profile(False)
2598  * cdef inline int range_intersection( int start1, int end1, int start2, int end2 ):             # <<<<<<<<<<<<<<
2599  *     return min( end1, end2 ) - max( start1, start2 )
2600  *
2601  */
2602 
2603   /* function exit code */
2604   __pyx_L0:;
2605   __Pyx_RefNannyFinishContext();
2606   return __pyx_r;
2607 }
2608 
2609 /* "bx/bbi/bbi_file.pyx":45
2610  *
2611  * @cython.profile(False)
2612  * cdef inline int imax(int a, int b): return a if a >= b else b             # <<<<<<<<<<<<<<
2613  * @cython.profile(False)
2614  * cdef inline int imin(int a, int b): return a if a <= b else b
2615  */
2616 
__pyx_f_2bx_3bbi_8bbi_file_imax(int __pyx_v_a,int __pyx_v_b)2617 static CYTHON_INLINE int __pyx_f_2bx_3bbi_8bbi_file_imax(int __pyx_v_a, int __pyx_v_b) {
2618   int __pyx_r;
2619   __Pyx_RefNannyDeclarations
2620   int __pyx_t_1;
2621   __Pyx_RefNannySetupContext("imax", 0);
2622   if (((__pyx_v_a >= __pyx_v_b) != 0)) {
2623     __pyx_t_1 = __pyx_v_a;
2624   } else {
2625     __pyx_t_1 = __pyx_v_b;
2626   }
2627   __pyx_r = __pyx_t_1;
2628   goto __pyx_L0;
2629 
2630   /* function exit code */
2631   __pyx_L0:;
2632   __Pyx_RefNannyFinishContext();
2633   return __pyx_r;
2634 }
2635 
2636 /* "bx/bbi/bbi_file.pyx":47
2637  * cdef inline int imax(int a, int b): return a if a >= b else b
2638  * @cython.profile(False)
2639  * cdef inline int imin(int a, int b): return a if a <= b else b             # <<<<<<<<<<<<<<
2640  *
2641  * cdef enum summary_type:
2642  */
2643 
__pyx_f_2bx_3bbi_8bbi_file_imin(int __pyx_v_a,int __pyx_v_b)2644 static CYTHON_INLINE int __pyx_f_2bx_3bbi_8bbi_file_imin(int __pyx_v_a, int __pyx_v_b) {
2645   int __pyx_r;
2646   __Pyx_RefNannyDeclarations
2647   int __pyx_t_1;
2648   __Pyx_RefNannySetupContext("imin", 0);
2649   if (((__pyx_v_a <= __pyx_v_b) != 0)) {
2650     __pyx_t_1 = __pyx_v_a;
2651   } else {
2652     __pyx_t_1 = __pyx_v_b;
2653   }
2654   __pyx_r = __pyx_t_1;
2655   goto __pyx_L0;
2656 
2657   /* function exit code */
2658   __pyx_L0:;
2659   __Pyx_RefNannyFinishContext();
2660   return __pyx_r;
2661 }
2662 
2663 /* "bx/bbi/bbi_file.pxd":12
2664  *     A block of summary data from disk
2665  *     """
2666  *     cdef public bits32 chrom_id             # <<<<<<<<<<<<<<
2667  *     cdef public bits32 start
2668  *     cdef public bits32 end
2669  */
2670 
2671 /* Python wrapper */
2672 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_8chrom_id_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_8chrom_id_1__get__(PyObject * __pyx_v_self)2673 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_8chrom_id_1__get__(PyObject *__pyx_v_self) {
2674   PyObject *__pyx_r = 0;
2675   __Pyx_RefNannyDeclarations
2676   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2677   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_8chrom_id___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self));
2678 
2679   /* function exit code */
2680   __Pyx_RefNannyFinishContext();
2681   return __pyx_r;
2682 }
2683 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_8chrom_id___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self)2684 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_8chrom_id___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self) {
2685   PyObject *__pyx_r = NULL;
2686   __Pyx_RefNannyDeclarations
2687   PyObject *__pyx_t_1 = NULL;
2688   int __pyx_lineno = 0;
2689   const char *__pyx_filename = NULL;
2690   int __pyx_clineno = 0;
2691   __Pyx_RefNannySetupContext("__get__", 0);
2692   __Pyx_XDECREF(__pyx_r);
2693   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->chrom_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
2694   __Pyx_GOTREF(__pyx_t_1);
2695   __pyx_r = __pyx_t_1;
2696   __pyx_t_1 = 0;
2697   goto __pyx_L0;
2698 
2699   /* function exit code */
2700   __pyx_L1_error:;
2701   __Pyx_XDECREF(__pyx_t_1);
2702   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.chrom_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2703   __pyx_r = NULL;
2704   __pyx_L0:;
2705   __Pyx_XGIVEREF(__pyx_r);
2706   __Pyx_RefNannyFinishContext();
2707   return __pyx_r;
2708 }
2709 
2710 /* Python wrapper */
2711 static int __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_8chrom_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_8chrom_id_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)2712 static int __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_8chrom_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
2713   int __pyx_r;
2714   __Pyx_RefNannyDeclarations
2715   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
2716   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_8chrom_id_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self), ((PyObject *)__pyx_v_value));
2717 
2718   /* function exit code */
2719   __Pyx_RefNannyFinishContext();
2720   return __pyx_r;
2721 }
2722 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_8chrom_id_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self,PyObject * __pyx_v_value)2723 static int __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_8chrom_id_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v_value) {
2724   int __pyx_r;
2725   __Pyx_RefNannyDeclarations
2726   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_1;
2727   int __pyx_lineno = 0;
2728   const char *__pyx_filename = NULL;
2729   int __pyx_clineno = 0;
2730   __Pyx_RefNannySetupContext("__set__", 0);
2731   __pyx_t_1 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
2732   __pyx_v_self->chrom_id = __pyx_t_1;
2733 
2734   /* function exit code */
2735   __pyx_r = 0;
2736   goto __pyx_L0;
2737   __pyx_L1_error:;
2738   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.chrom_id.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2739   __pyx_r = -1;
2740   __pyx_L0:;
2741   __Pyx_RefNannyFinishContext();
2742   return __pyx_r;
2743 }
2744 
2745 /* "bx/bbi/bbi_file.pxd":13
2746  *     """
2747  *     cdef public bits32 chrom_id
2748  *     cdef public bits32 start             # <<<<<<<<<<<<<<
2749  *     cdef public bits32 end
2750  *     cdef public bits32 valid_count
2751  */
2752 
2753 /* Python wrapper */
2754 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_5start_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_5start_1__get__(PyObject * __pyx_v_self)2755 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_5start_1__get__(PyObject *__pyx_v_self) {
2756   PyObject *__pyx_r = 0;
2757   __Pyx_RefNannyDeclarations
2758   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2759   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_5start___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self));
2760 
2761   /* function exit code */
2762   __Pyx_RefNannyFinishContext();
2763   return __pyx_r;
2764 }
2765 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_5start___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self)2766 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_5start___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self) {
2767   PyObject *__pyx_r = NULL;
2768   __Pyx_RefNannyDeclarations
2769   PyObject *__pyx_t_1 = NULL;
2770   int __pyx_lineno = 0;
2771   const char *__pyx_filename = NULL;
2772   int __pyx_clineno = 0;
2773   __Pyx_RefNannySetupContext("__get__", 0);
2774   __Pyx_XDECREF(__pyx_r);
2775   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->start); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
2776   __Pyx_GOTREF(__pyx_t_1);
2777   __pyx_r = __pyx_t_1;
2778   __pyx_t_1 = 0;
2779   goto __pyx_L0;
2780 
2781   /* function exit code */
2782   __pyx_L1_error:;
2783   __Pyx_XDECREF(__pyx_t_1);
2784   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.start.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2785   __pyx_r = NULL;
2786   __pyx_L0:;
2787   __Pyx_XGIVEREF(__pyx_r);
2788   __Pyx_RefNannyFinishContext();
2789   return __pyx_r;
2790 }
2791 
2792 /* Python wrapper */
2793 static int __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_5start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_5start_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)2794 static int __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_5start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
2795   int __pyx_r;
2796   __Pyx_RefNannyDeclarations
2797   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
2798   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_5start_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self), ((PyObject *)__pyx_v_value));
2799 
2800   /* function exit code */
2801   __Pyx_RefNannyFinishContext();
2802   return __pyx_r;
2803 }
2804 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_5start_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self,PyObject * __pyx_v_value)2805 static int __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_5start_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v_value) {
2806   int __pyx_r;
2807   __Pyx_RefNannyDeclarations
2808   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_1;
2809   int __pyx_lineno = 0;
2810   const char *__pyx_filename = NULL;
2811   int __pyx_clineno = 0;
2812   __Pyx_RefNannySetupContext("__set__", 0);
2813   __pyx_t_1 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 13, __pyx_L1_error)
2814   __pyx_v_self->start = __pyx_t_1;
2815 
2816   /* function exit code */
2817   __pyx_r = 0;
2818   goto __pyx_L0;
2819   __pyx_L1_error:;
2820   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.start.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2821   __pyx_r = -1;
2822   __pyx_L0:;
2823   __Pyx_RefNannyFinishContext();
2824   return __pyx_r;
2825 }
2826 
2827 /* "bx/bbi/bbi_file.pxd":14
2828  *     cdef public bits32 chrom_id
2829  *     cdef public bits32 start
2830  *     cdef public bits32 end             # <<<<<<<<<<<<<<
2831  *     cdef public bits32 valid_count
2832  *     cdef public double min_val
2833  */
2834 
2835 /* Python wrapper */
2836 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_3end_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_3end_1__get__(PyObject * __pyx_v_self)2837 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_3end_1__get__(PyObject *__pyx_v_self) {
2838   PyObject *__pyx_r = 0;
2839   __Pyx_RefNannyDeclarations
2840   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2841   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_3end___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self));
2842 
2843   /* function exit code */
2844   __Pyx_RefNannyFinishContext();
2845   return __pyx_r;
2846 }
2847 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_3end___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self)2848 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_3end___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self) {
2849   PyObject *__pyx_r = NULL;
2850   __Pyx_RefNannyDeclarations
2851   PyObject *__pyx_t_1 = NULL;
2852   int __pyx_lineno = 0;
2853   const char *__pyx_filename = NULL;
2854   int __pyx_clineno = 0;
2855   __Pyx_RefNannySetupContext("__get__", 0);
2856   __Pyx_XDECREF(__pyx_r);
2857   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->end); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
2858   __Pyx_GOTREF(__pyx_t_1);
2859   __pyx_r = __pyx_t_1;
2860   __pyx_t_1 = 0;
2861   goto __pyx_L0;
2862 
2863   /* function exit code */
2864   __pyx_L1_error:;
2865   __Pyx_XDECREF(__pyx_t_1);
2866   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.end.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2867   __pyx_r = NULL;
2868   __pyx_L0:;
2869   __Pyx_XGIVEREF(__pyx_r);
2870   __Pyx_RefNannyFinishContext();
2871   return __pyx_r;
2872 }
2873 
2874 /* Python wrapper */
2875 static int __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_3end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_3end_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)2876 static int __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_3end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
2877   int __pyx_r;
2878   __Pyx_RefNannyDeclarations
2879   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
2880   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_3end_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self), ((PyObject *)__pyx_v_value));
2881 
2882   /* function exit code */
2883   __Pyx_RefNannyFinishContext();
2884   return __pyx_r;
2885 }
2886 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_3end_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self,PyObject * __pyx_v_value)2887 static int __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_3end_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v_value) {
2888   int __pyx_r;
2889   __Pyx_RefNannyDeclarations
2890   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_1;
2891   int __pyx_lineno = 0;
2892   const char *__pyx_filename = NULL;
2893   int __pyx_clineno = 0;
2894   __Pyx_RefNannySetupContext("__set__", 0);
2895   __pyx_t_1 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 14, __pyx_L1_error)
2896   __pyx_v_self->end = __pyx_t_1;
2897 
2898   /* function exit code */
2899   __pyx_r = 0;
2900   goto __pyx_L0;
2901   __pyx_L1_error:;
2902   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.end.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2903   __pyx_r = -1;
2904   __pyx_L0:;
2905   __Pyx_RefNannyFinishContext();
2906   return __pyx_r;
2907 }
2908 
2909 /* "bx/bbi/bbi_file.pxd":15
2910  *     cdef public bits32 start
2911  *     cdef public bits32 end
2912  *     cdef public bits32 valid_count             # <<<<<<<<<<<<<<
2913  *     cdef public double min_val
2914  *     cdef public double max_val
2915  */
2916 
2917 /* Python wrapper */
2918 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_11valid_count_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_11valid_count_1__get__(PyObject * __pyx_v_self)2919 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_11valid_count_1__get__(PyObject *__pyx_v_self) {
2920   PyObject *__pyx_r = 0;
2921   __Pyx_RefNannyDeclarations
2922   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
2923   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_11valid_count___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self));
2924 
2925   /* function exit code */
2926   __Pyx_RefNannyFinishContext();
2927   return __pyx_r;
2928 }
2929 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_11valid_count___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self)2930 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_11valid_count___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self) {
2931   PyObject *__pyx_r = NULL;
2932   __Pyx_RefNannyDeclarations
2933   PyObject *__pyx_t_1 = NULL;
2934   int __pyx_lineno = 0;
2935   const char *__pyx_filename = NULL;
2936   int __pyx_clineno = 0;
2937   __Pyx_RefNannySetupContext("__get__", 0);
2938   __Pyx_XDECREF(__pyx_r);
2939   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->valid_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
2940   __Pyx_GOTREF(__pyx_t_1);
2941   __pyx_r = __pyx_t_1;
2942   __pyx_t_1 = 0;
2943   goto __pyx_L0;
2944 
2945   /* function exit code */
2946   __pyx_L1_error:;
2947   __Pyx_XDECREF(__pyx_t_1);
2948   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.valid_count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2949   __pyx_r = NULL;
2950   __pyx_L0:;
2951   __Pyx_XGIVEREF(__pyx_r);
2952   __Pyx_RefNannyFinishContext();
2953   return __pyx_r;
2954 }
2955 
2956 /* Python wrapper */
2957 static int __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_11valid_count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_11valid_count_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)2958 static int __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_11valid_count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
2959   int __pyx_r;
2960   __Pyx_RefNannyDeclarations
2961   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
2962   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_11valid_count_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self), ((PyObject *)__pyx_v_value));
2963 
2964   /* function exit code */
2965   __Pyx_RefNannyFinishContext();
2966   return __pyx_r;
2967 }
2968 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_11valid_count_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self,PyObject * __pyx_v_value)2969 static int __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_11valid_count_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v_value) {
2970   int __pyx_r;
2971   __Pyx_RefNannyDeclarations
2972   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_1;
2973   int __pyx_lineno = 0;
2974   const char *__pyx_filename = NULL;
2975   int __pyx_clineno = 0;
2976   __Pyx_RefNannySetupContext("__set__", 0);
2977   __pyx_t_1 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 15, __pyx_L1_error)
2978   __pyx_v_self->valid_count = __pyx_t_1;
2979 
2980   /* function exit code */
2981   __pyx_r = 0;
2982   goto __pyx_L0;
2983   __pyx_L1_error:;
2984   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.valid_count.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2985   __pyx_r = -1;
2986   __pyx_L0:;
2987   __Pyx_RefNannyFinishContext();
2988   return __pyx_r;
2989 }
2990 
2991 /* "bx/bbi/bbi_file.pxd":16
2992  *     cdef public bits32 end
2993  *     cdef public bits32 valid_count
2994  *     cdef public double min_val             # <<<<<<<<<<<<<<
2995  *     cdef public double max_val
2996  *     cdef public double sum_data
2997  */
2998 
2999 /* Python wrapper */
3000 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_7min_val_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_7min_val_1__get__(PyObject * __pyx_v_self)3001 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_7min_val_1__get__(PyObject *__pyx_v_self) {
3002   PyObject *__pyx_r = 0;
3003   __Pyx_RefNannyDeclarations
3004   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3005   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_7min_val___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self));
3006 
3007   /* function exit code */
3008   __Pyx_RefNannyFinishContext();
3009   return __pyx_r;
3010 }
3011 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_7min_val___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self)3012 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_7min_val___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self) {
3013   PyObject *__pyx_r = NULL;
3014   __Pyx_RefNannyDeclarations
3015   PyObject *__pyx_t_1 = NULL;
3016   int __pyx_lineno = 0;
3017   const char *__pyx_filename = NULL;
3018   int __pyx_clineno = 0;
3019   __Pyx_RefNannySetupContext("__get__", 0);
3020   __Pyx_XDECREF(__pyx_r);
3021   __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->min_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
3022   __Pyx_GOTREF(__pyx_t_1);
3023   __pyx_r = __pyx_t_1;
3024   __pyx_t_1 = 0;
3025   goto __pyx_L0;
3026 
3027   /* function exit code */
3028   __pyx_L1_error:;
3029   __Pyx_XDECREF(__pyx_t_1);
3030   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.min_val.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3031   __pyx_r = NULL;
3032   __pyx_L0:;
3033   __Pyx_XGIVEREF(__pyx_r);
3034   __Pyx_RefNannyFinishContext();
3035   return __pyx_r;
3036 }
3037 
3038 /* Python wrapper */
3039 static int __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_7min_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_7min_val_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)3040 static int __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_7min_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3041   int __pyx_r;
3042   __Pyx_RefNannyDeclarations
3043   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3044   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_7min_val_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3045 
3046   /* function exit code */
3047   __Pyx_RefNannyFinishContext();
3048   return __pyx_r;
3049 }
3050 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_7min_val_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self,PyObject * __pyx_v_value)3051 static int __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_7min_val_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v_value) {
3052   int __pyx_r;
3053   __Pyx_RefNannyDeclarations
3054   double __pyx_t_1;
3055   int __pyx_lineno = 0;
3056   const char *__pyx_filename = NULL;
3057   int __pyx_clineno = 0;
3058   __Pyx_RefNannySetupContext("__set__", 0);
3059   __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L1_error)
3060   __pyx_v_self->min_val = __pyx_t_1;
3061 
3062   /* function exit code */
3063   __pyx_r = 0;
3064   goto __pyx_L0;
3065   __pyx_L1_error:;
3066   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.min_val.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3067   __pyx_r = -1;
3068   __pyx_L0:;
3069   __Pyx_RefNannyFinishContext();
3070   return __pyx_r;
3071 }
3072 
3073 /* "bx/bbi/bbi_file.pxd":17
3074  *     cdef public bits32 valid_count
3075  *     cdef public double min_val
3076  *     cdef public double max_val             # <<<<<<<<<<<<<<
3077  *     cdef public double sum_data
3078  *     cdef public double sum_squares
3079  */
3080 
3081 /* Python wrapper */
3082 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_7max_val_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_7max_val_1__get__(PyObject * __pyx_v_self)3083 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_7max_val_1__get__(PyObject *__pyx_v_self) {
3084   PyObject *__pyx_r = 0;
3085   __Pyx_RefNannyDeclarations
3086   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3087   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_7max_val___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self));
3088 
3089   /* function exit code */
3090   __Pyx_RefNannyFinishContext();
3091   return __pyx_r;
3092 }
3093 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_7max_val___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self)3094 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_7max_val___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self) {
3095   PyObject *__pyx_r = NULL;
3096   __Pyx_RefNannyDeclarations
3097   PyObject *__pyx_t_1 = NULL;
3098   int __pyx_lineno = 0;
3099   const char *__pyx_filename = NULL;
3100   int __pyx_clineno = 0;
3101   __Pyx_RefNannySetupContext("__get__", 0);
3102   __Pyx_XDECREF(__pyx_r);
3103   __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->max_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
3104   __Pyx_GOTREF(__pyx_t_1);
3105   __pyx_r = __pyx_t_1;
3106   __pyx_t_1 = 0;
3107   goto __pyx_L0;
3108 
3109   /* function exit code */
3110   __pyx_L1_error:;
3111   __Pyx_XDECREF(__pyx_t_1);
3112   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.max_val.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3113   __pyx_r = NULL;
3114   __pyx_L0:;
3115   __Pyx_XGIVEREF(__pyx_r);
3116   __Pyx_RefNannyFinishContext();
3117   return __pyx_r;
3118 }
3119 
3120 /* Python wrapper */
3121 static int __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_7max_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_7max_val_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)3122 static int __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_7max_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3123   int __pyx_r;
3124   __Pyx_RefNannyDeclarations
3125   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3126   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_7max_val_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3127 
3128   /* function exit code */
3129   __Pyx_RefNannyFinishContext();
3130   return __pyx_r;
3131 }
3132 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_7max_val_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self,PyObject * __pyx_v_value)3133 static int __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_7max_val_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v_value) {
3134   int __pyx_r;
3135   __Pyx_RefNannyDeclarations
3136   double __pyx_t_1;
3137   int __pyx_lineno = 0;
3138   const char *__pyx_filename = NULL;
3139   int __pyx_clineno = 0;
3140   __Pyx_RefNannySetupContext("__set__", 0);
3141   __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 17, __pyx_L1_error)
3142   __pyx_v_self->max_val = __pyx_t_1;
3143 
3144   /* function exit code */
3145   __pyx_r = 0;
3146   goto __pyx_L0;
3147   __pyx_L1_error:;
3148   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.max_val.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3149   __pyx_r = -1;
3150   __pyx_L0:;
3151   __Pyx_RefNannyFinishContext();
3152   return __pyx_r;
3153 }
3154 
3155 /* "bx/bbi/bbi_file.pxd":18
3156  *     cdef public double min_val
3157  *     cdef public double max_val
3158  *     cdef public double sum_data             # <<<<<<<<<<<<<<
3159  *     cdef public double sum_squares
3160  *
3161  */
3162 
3163 /* Python wrapper */
3164 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_8sum_data_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_8sum_data_1__get__(PyObject * __pyx_v_self)3165 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_8sum_data_1__get__(PyObject *__pyx_v_self) {
3166   PyObject *__pyx_r = 0;
3167   __Pyx_RefNannyDeclarations
3168   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3169   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_8sum_data___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self));
3170 
3171   /* function exit code */
3172   __Pyx_RefNannyFinishContext();
3173   return __pyx_r;
3174 }
3175 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_8sum_data___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self)3176 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_8sum_data___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self) {
3177   PyObject *__pyx_r = NULL;
3178   __Pyx_RefNannyDeclarations
3179   PyObject *__pyx_t_1 = NULL;
3180   int __pyx_lineno = 0;
3181   const char *__pyx_filename = NULL;
3182   int __pyx_clineno = 0;
3183   __Pyx_RefNannySetupContext("__get__", 0);
3184   __Pyx_XDECREF(__pyx_r);
3185   __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->sum_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 18, __pyx_L1_error)
3186   __Pyx_GOTREF(__pyx_t_1);
3187   __pyx_r = __pyx_t_1;
3188   __pyx_t_1 = 0;
3189   goto __pyx_L0;
3190 
3191   /* function exit code */
3192   __pyx_L1_error:;
3193   __Pyx_XDECREF(__pyx_t_1);
3194   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.sum_data.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3195   __pyx_r = NULL;
3196   __pyx_L0:;
3197   __Pyx_XGIVEREF(__pyx_r);
3198   __Pyx_RefNannyFinishContext();
3199   return __pyx_r;
3200 }
3201 
3202 /* Python wrapper */
3203 static int __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_8sum_data_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_8sum_data_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)3204 static int __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_8sum_data_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3205   int __pyx_r;
3206   __Pyx_RefNannyDeclarations
3207   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3208   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_8sum_data_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3209 
3210   /* function exit code */
3211   __Pyx_RefNannyFinishContext();
3212   return __pyx_r;
3213 }
3214 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_8sum_data_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self,PyObject * __pyx_v_value)3215 static int __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_8sum_data_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v_value) {
3216   int __pyx_r;
3217   __Pyx_RefNannyDeclarations
3218   double __pyx_t_1;
3219   int __pyx_lineno = 0;
3220   const char *__pyx_filename = NULL;
3221   int __pyx_clineno = 0;
3222   __Pyx_RefNannySetupContext("__set__", 0);
3223   __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 18, __pyx_L1_error)
3224   __pyx_v_self->sum_data = __pyx_t_1;
3225 
3226   /* function exit code */
3227   __pyx_r = 0;
3228   goto __pyx_L0;
3229   __pyx_L1_error:;
3230   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.sum_data.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3231   __pyx_r = -1;
3232   __pyx_L0:;
3233   __Pyx_RefNannyFinishContext();
3234   return __pyx_r;
3235 }
3236 
3237 /* "bx/bbi/bbi_file.pxd":19
3238  *     cdef public double max_val
3239  *     cdef public double sum_data
3240  *     cdef public double sum_squares             # <<<<<<<<<<<<<<
3241  *
3242  * cdef class SummarizedData:
3243  */
3244 
3245 /* Python wrapper */
3246 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_11sum_squares_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_11sum_squares_1__get__(PyObject * __pyx_v_self)3247 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_11sum_squares_1__get__(PyObject *__pyx_v_self) {
3248   PyObject *__pyx_r = 0;
3249   __Pyx_RefNannyDeclarations
3250   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3251   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_11sum_squares___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self));
3252 
3253   /* function exit code */
3254   __Pyx_RefNannyFinishContext();
3255   return __pyx_r;
3256 }
3257 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_11sum_squares___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self)3258 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_11sum_squares___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self) {
3259   PyObject *__pyx_r = NULL;
3260   __Pyx_RefNannyDeclarations
3261   PyObject *__pyx_t_1 = NULL;
3262   int __pyx_lineno = 0;
3263   const char *__pyx_filename = NULL;
3264   int __pyx_clineno = 0;
3265   __Pyx_RefNannySetupContext("__get__", 0);
3266   __Pyx_XDECREF(__pyx_r);
3267   __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->sum_squares); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 19, __pyx_L1_error)
3268   __Pyx_GOTREF(__pyx_t_1);
3269   __pyx_r = __pyx_t_1;
3270   __pyx_t_1 = 0;
3271   goto __pyx_L0;
3272 
3273   /* function exit code */
3274   __pyx_L1_error:;
3275   __Pyx_XDECREF(__pyx_t_1);
3276   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.sum_squares.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3277   __pyx_r = NULL;
3278   __pyx_L0:;
3279   __Pyx_XGIVEREF(__pyx_r);
3280   __Pyx_RefNannyFinishContext();
3281   return __pyx_r;
3282 }
3283 
3284 /* Python wrapper */
3285 static int __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_11sum_squares_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_11sum_squares_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)3286 static int __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_11sum_squares_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3287   int __pyx_r;
3288   __Pyx_RefNannyDeclarations
3289   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3290   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_11sum_squares_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3291 
3292   /* function exit code */
3293   __Pyx_RefNannyFinishContext();
3294   return __pyx_r;
3295 }
3296 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_11sum_squares_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self,PyObject * __pyx_v_value)3297 static int __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_11sum_squares_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v_value) {
3298   int __pyx_r;
3299   __Pyx_RefNannyDeclarations
3300   double __pyx_t_1;
3301   int __pyx_lineno = 0;
3302   const char *__pyx_filename = NULL;
3303   int __pyx_clineno = 0;
3304   __Pyx_RefNannySetupContext("__set__", 0);
3305   __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 19, __pyx_L1_error)
3306   __pyx_v_self->sum_squares = __pyx_t_1;
3307 
3308   /* function exit code */
3309   __pyx_r = 0;
3310   goto __pyx_L0;
3311   __pyx_L1_error:;
3312   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.sum_squares.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3313   __pyx_r = -1;
3314   __pyx_L0:;
3315   __Pyx_RefNannyFinishContext();
3316   return __pyx_r;
3317 }
3318 
3319 /* "(tree fragment)":1
3320  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
3321  *     cdef tuple state
3322  *     cdef object _dict
3323  */
3324 
3325 /* Python wrapper */
3326 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)3327 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3328   PyObject *__pyx_r = 0;
3329   __Pyx_RefNannyDeclarations
3330   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3331   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock___reduce_cython__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self));
3332 
3333   /* function exit code */
3334   __Pyx_RefNannyFinishContext();
3335   return __pyx_r;
3336 }
3337 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock___reduce_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self)3338 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock___reduce_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self) {
3339   PyObject *__pyx_v_state = 0;
3340   PyObject *__pyx_v__dict = 0;
3341   int __pyx_v_use_setstate;
3342   PyObject *__pyx_r = NULL;
3343   __Pyx_RefNannyDeclarations
3344   PyObject *__pyx_t_1 = NULL;
3345   PyObject *__pyx_t_2 = NULL;
3346   PyObject *__pyx_t_3 = NULL;
3347   PyObject *__pyx_t_4 = NULL;
3348   PyObject *__pyx_t_5 = NULL;
3349   PyObject *__pyx_t_6 = NULL;
3350   PyObject *__pyx_t_7 = NULL;
3351   PyObject *__pyx_t_8 = NULL;
3352   PyObject *__pyx_t_9 = NULL;
3353   int __pyx_t_10;
3354   int __pyx_t_11;
3355   int __pyx_lineno = 0;
3356   const char *__pyx_filename = NULL;
3357   int __pyx_clineno = 0;
3358   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3359 
3360   /* "(tree fragment)":5
3361  *     cdef object _dict
3362  *     cdef bint use_setstate
3363  *     state = (self.chrom_id, self.end, self.max_val, self.min_val, self.start, self.sum_data, self.sum_squares, self.valid_count)             # <<<<<<<<<<<<<<
3364  *     _dict = getattr(self, '__dict__', None)
3365  *     if _dict is not None:
3366  */
3367   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->chrom_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
3368   __Pyx_GOTREF(__pyx_t_1);
3369   __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->end); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
3370   __Pyx_GOTREF(__pyx_t_2);
3371   __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->max_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
3372   __Pyx_GOTREF(__pyx_t_3);
3373   __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->min_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
3374   __Pyx_GOTREF(__pyx_t_4);
3375   __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->start); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error)
3376   __Pyx_GOTREF(__pyx_t_5);
3377   __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->sum_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error)
3378   __Pyx_GOTREF(__pyx_t_6);
3379   __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->sum_squares); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error)
3380   __Pyx_GOTREF(__pyx_t_7);
3381   __pyx_t_8 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->valid_count); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 5, __pyx_L1_error)
3382   __Pyx_GOTREF(__pyx_t_8);
3383   __pyx_t_9 = PyTuple_New(8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 5, __pyx_L1_error)
3384   __Pyx_GOTREF(__pyx_t_9);
3385   __Pyx_GIVEREF(__pyx_t_1);
3386   PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
3387   __Pyx_GIVEREF(__pyx_t_2);
3388   PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
3389   __Pyx_GIVEREF(__pyx_t_3);
3390   PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
3391   __Pyx_GIVEREF(__pyx_t_4);
3392   PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_4);
3393   __Pyx_GIVEREF(__pyx_t_5);
3394   PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_5);
3395   __Pyx_GIVEREF(__pyx_t_6);
3396   PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_6);
3397   __Pyx_GIVEREF(__pyx_t_7);
3398   PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_7);
3399   __Pyx_GIVEREF(__pyx_t_8);
3400   PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_t_8);
3401   __pyx_t_1 = 0;
3402   __pyx_t_2 = 0;
3403   __pyx_t_3 = 0;
3404   __pyx_t_4 = 0;
3405   __pyx_t_5 = 0;
3406   __pyx_t_6 = 0;
3407   __pyx_t_7 = 0;
3408   __pyx_t_8 = 0;
3409   __pyx_v_state = ((PyObject*)__pyx_t_9);
3410   __pyx_t_9 = 0;
3411 
3412   /* "(tree fragment)":6
3413  *     cdef bint use_setstate
3414  *     state = (self.chrom_id, self.end, self.max_val, self.min_val, self.start, self.sum_data, self.sum_squares, self.valid_count)
3415  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
3416  *     if _dict is not None:
3417  *         state += (_dict,)
3418  */
3419   __pyx_t_9 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 6, __pyx_L1_error)
3420   __Pyx_GOTREF(__pyx_t_9);
3421   __pyx_v__dict = __pyx_t_9;
3422   __pyx_t_9 = 0;
3423 
3424   /* "(tree fragment)":7
3425  *     state = (self.chrom_id, self.end, self.max_val, self.min_val, self.start, self.sum_data, self.sum_squares, self.valid_count)
3426  *     _dict = getattr(self, '__dict__', None)
3427  *     if _dict is not None:             # <<<<<<<<<<<<<<
3428  *         state += (_dict,)
3429  *         use_setstate = True
3430  */
3431   __pyx_t_10 = (__pyx_v__dict != Py_None);
3432   __pyx_t_11 = (__pyx_t_10 != 0);
3433   if (__pyx_t_11) {
3434 
3435     /* "(tree fragment)":8
3436  *     _dict = getattr(self, '__dict__', None)
3437  *     if _dict is not None:
3438  *         state += (_dict,)             # <<<<<<<<<<<<<<
3439  *         use_setstate = True
3440  *     else:
3441  */
3442     __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 8, __pyx_L1_error)
3443     __Pyx_GOTREF(__pyx_t_9);
3444     __Pyx_INCREF(__pyx_v__dict);
3445     __Pyx_GIVEREF(__pyx_v__dict);
3446     PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v__dict);
3447     __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 8, __pyx_L1_error)
3448     __Pyx_GOTREF(__pyx_t_8);
3449     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3450     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_8));
3451     __pyx_t_8 = 0;
3452 
3453     /* "(tree fragment)":9
3454  *     if _dict is not None:
3455  *         state += (_dict,)
3456  *         use_setstate = True             # <<<<<<<<<<<<<<
3457  *     else:
3458  *         use_setstate = False
3459  */
3460     __pyx_v_use_setstate = 1;
3461 
3462     /* "(tree fragment)":7
3463  *     state = (self.chrom_id, self.end, self.max_val, self.min_val, self.start, self.sum_data, self.sum_squares, self.valid_count)
3464  *     _dict = getattr(self, '__dict__', None)
3465  *     if _dict is not None:             # <<<<<<<<<<<<<<
3466  *         state += (_dict,)
3467  *         use_setstate = True
3468  */
3469     goto __pyx_L3;
3470   }
3471 
3472   /* "(tree fragment)":11
3473  *         use_setstate = True
3474  *     else:
3475  *         use_setstate = False             # <<<<<<<<<<<<<<
3476  *     if use_setstate:
3477  *         return __pyx_unpickle_SummaryBlock, (type(self), 0x732cf8a, None), state
3478  */
3479   /*else*/ {
3480     __pyx_v_use_setstate = 0;
3481   }
3482   __pyx_L3:;
3483 
3484   /* "(tree fragment)":12
3485  *     else:
3486  *         use_setstate = False
3487  *     if use_setstate:             # <<<<<<<<<<<<<<
3488  *         return __pyx_unpickle_SummaryBlock, (type(self), 0x732cf8a, None), state
3489  *     else:
3490  */
3491   __pyx_t_11 = (__pyx_v_use_setstate != 0);
3492   if (__pyx_t_11) {
3493 
3494     /* "(tree fragment)":13
3495  *         use_setstate = False
3496  *     if use_setstate:
3497  *         return __pyx_unpickle_SummaryBlock, (type(self), 0x732cf8a, None), state             # <<<<<<<<<<<<<<
3498  *     else:
3499  *         return __pyx_unpickle_SummaryBlock, (type(self), 0x732cf8a, state)
3500  */
3501     __Pyx_XDECREF(__pyx_r);
3502     __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_pyx_unpickle_SummaryBlock); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 13, __pyx_L1_error)
3503     __Pyx_GOTREF(__pyx_t_8);
3504     __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 13, __pyx_L1_error)
3505     __Pyx_GOTREF(__pyx_t_9);
3506     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3507     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3508     PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3509     __Pyx_INCREF(__pyx_int_120770442);
3510     __Pyx_GIVEREF(__pyx_int_120770442);
3511     PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_int_120770442);
3512     __Pyx_INCREF(Py_None);
3513     __Pyx_GIVEREF(Py_None);
3514     PyTuple_SET_ITEM(__pyx_t_9, 2, Py_None);
3515     __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 13, __pyx_L1_error)
3516     __Pyx_GOTREF(__pyx_t_7);
3517     __Pyx_GIVEREF(__pyx_t_8);
3518     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
3519     __Pyx_GIVEREF(__pyx_t_9);
3520     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9);
3521     __Pyx_INCREF(__pyx_v_state);
3522     __Pyx_GIVEREF(__pyx_v_state);
3523     PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state);
3524     __pyx_t_8 = 0;
3525     __pyx_t_9 = 0;
3526     __pyx_r = __pyx_t_7;
3527     __pyx_t_7 = 0;
3528     goto __pyx_L0;
3529 
3530     /* "(tree fragment)":12
3531  *     else:
3532  *         use_setstate = False
3533  *     if use_setstate:             # <<<<<<<<<<<<<<
3534  *         return __pyx_unpickle_SummaryBlock, (type(self), 0x732cf8a, None), state
3535  *     else:
3536  */
3537   }
3538 
3539   /* "(tree fragment)":15
3540  *         return __pyx_unpickle_SummaryBlock, (type(self), 0x732cf8a, None), state
3541  *     else:
3542  *         return __pyx_unpickle_SummaryBlock, (type(self), 0x732cf8a, state)             # <<<<<<<<<<<<<<
3543  * def __setstate_cython__(self, __pyx_state):
3544  *     __pyx_unpickle_SummaryBlock__set_state(self, __pyx_state)
3545  */
3546   /*else*/ {
3547     __Pyx_XDECREF(__pyx_r);
3548     __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pyx_unpickle_SummaryBlock); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 15, __pyx_L1_error)
3549     __Pyx_GOTREF(__pyx_t_7);
3550     __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 15, __pyx_L1_error)
3551     __Pyx_GOTREF(__pyx_t_9);
3552     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3553     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3554     PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3555     __Pyx_INCREF(__pyx_int_120770442);
3556     __Pyx_GIVEREF(__pyx_int_120770442);
3557     PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_int_120770442);
3558     __Pyx_INCREF(__pyx_v_state);
3559     __Pyx_GIVEREF(__pyx_v_state);
3560     PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_state);
3561     __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 15, __pyx_L1_error)
3562     __Pyx_GOTREF(__pyx_t_8);
3563     __Pyx_GIVEREF(__pyx_t_7);
3564     PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
3565     __Pyx_GIVEREF(__pyx_t_9);
3566     PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9);
3567     __pyx_t_7 = 0;
3568     __pyx_t_9 = 0;
3569     __pyx_r = __pyx_t_8;
3570     __pyx_t_8 = 0;
3571     goto __pyx_L0;
3572   }
3573 
3574   /* "(tree fragment)":1
3575  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
3576  *     cdef tuple state
3577  *     cdef object _dict
3578  */
3579 
3580   /* function exit code */
3581   __pyx_L1_error:;
3582   __Pyx_XDECREF(__pyx_t_1);
3583   __Pyx_XDECREF(__pyx_t_2);
3584   __Pyx_XDECREF(__pyx_t_3);
3585   __Pyx_XDECREF(__pyx_t_4);
3586   __Pyx_XDECREF(__pyx_t_5);
3587   __Pyx_XDECREF(__pyx_t_6);
3588   __Pyx_XDECREF(__pyx_t_7);
3589   __Pyx_XDECREF(__pyx_t_8);
3590   __Pyx_XDECREF(__pyx_t_9);
3591   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3592   __pyx_r = NULL;
3593   __pyx_L0:;
3594   __Pyx_XDECREF(__pyx_v_state);
3595   __Pyx_XDECREF(__pyx_v__dict);
3596   __Pyx_XGIVEREF(__pyx_r);
3597   __Pyx_RefNannyFinishContext();
3598   return __pyx_r;
3599 }
3600 
3601 /* "(tree fragment)":16
3602  *     else:
3603  *         return __pyx_unpickle_SummaryBlock, (type(self), 0x732cf8a, state)
3604  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
3605  *     __pyx_unpickle_SummaryBlock__set_state(self, __pyx_state)
3606  */
3607 
3608 /* Python wrapper */
3609 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)3610 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3611   PyObject *__pyx_r = 0;
3612   __Pyx_RefNannyDeclarations
3613   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3614   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_2__setstate_cython__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3615 
3616   /* function exit code */
3617   __Pyx_RefNannyFinishContext();
3618   return __pyx_r;
3619 }
3620 
__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_2__setstate_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v_self,PyObject * __pyx_v___pyx_state)3621 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12SummaryBlock_2__setstate_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3622   PyObject *__pyx_r = NULL;
3623   __Pyx_RefNannyDeclarations
3624   PyObject *__pyx_t_1 = NULL;
3625   int __pyx_lineno = 0;
3626   const char *__pyx_filename = NULL;
3627   int __pyx_clineno = 0;
3628   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3629 
3630   /* "(tree fragment)":17
3631  *         return __pyx_unpickle_SummaryBlock, (type(self), 0x732cf8a, state)
3632  * def __setstate_cython__(self, __pyx_state):
3633  *     __pyx_unpickle_SummaryBlock__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
3634  */
3635   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(2, 17, __pyx_L1_error)
3636   __pyx_t_1 = __pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_SummaryBlock__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
3637   __Pyx_GOTREF(__pyx_t_1);
3638   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3639 
3640   /* "(tree fragment)":16
3641  *     else:
3642  *         return __pyx_unpickle_SummaryBlock, (type(self), 0x732cf8a, state)
3643  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
3644  *     __pyx_unpickle_SummaryBlock__set_state(self, __pyx_state)
3645  */
3646 
3647   /* function exit code */
3648   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3649   goto __pyx_L0;
3650   __pyx_L1_error:;
3651   __Pyx_XDECREF(__pyx_t_1);
3652   __Pyx_AddTraceback("bx.bbi.bbi_file.SummaryBlock.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3653   __pyx_r = NULL;
3654   __pyx_L0:;
3655   __Pyx_XGIVEREF(__pyx_r);
3656   __Pyx_RefNannyFinishContext();
3657   return __pyx_r;
3658 }
3659 
3660 /* "bx/bbi/bbi_file.pyx":67
3661  *     aggregation over a particular range and resolution
3662  *     """
3663  *     def __init__( self, bits32 start, bits32 end, int size ):             # <<<<<<<<<<<<<<
3664  *         self.start = start
3665  *         self.end = end
3666  */
3667 
3668 /* Python wrapper */
3669 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3670 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3671   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start;
3672   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end;
3673   int __pyx_v_size;
3674   int __pyx_lineno = 0;
3675   const char *__pyx_filename = NULL;
3676   int __pyx_clineno = 0;
3677   int __pyx_r;
3678   __Pyx_RefNannyDeclarations
3679   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3680   {
3681     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_size,0};
3682     PyObject* values[3] = {0,0,0};
3683     if (unlikely(__pyx_kwds)) {
3684       Py_ssize_t kw_args;
3685       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3686       switch (pos_args) {
3687         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3688         CYTHON_FALLTHROUGH;
3689         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3690         CYTHON_FALLTHROUGH;
3691         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3692         CYTHON_FALLTHROUGH;
3693         case  0: break;
3694         default: goto __pyx_L5_argtuple_error;
3695       }
3696       kw_args = PyDict_Size(__pyx_kwds);
3697       switch (pos_args) {
3698         case  0:
3699         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
3700         else goto __pyx_L5_argtuple_error;
3701         CYTHON_FALLTHROUGH;
3702         case  1:
3703         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
3704         else {
3705           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 67, __pyx_L3_error)
3706         }
3707         CYTHON_FALLTHROUGH;
3708         case  2:
3709         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
3710         else {
3711           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 67, __pyx_L3_error)
3712         }
3713       }
3714       if (unlikely(kw_args > 0)) {
3715         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 67, __pyx_L3_error)
3716       }
3717     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3718       goto __pyx_L5_argtuple_error;
3719     } else {
3720       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3721       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3722       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3723     }
3724     __pyx_v_start = __Pyx_PyInt_As_unsigned_int(values[0]); if (unlikely((__pyx_v_start == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L3_error)
3725     __pyx_v_end = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_end == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L3_error)
3726     __pyx_v_size = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L3_error)
3727   }
3728   goto __pyx_L4_argument_unpacking_done;
3729   __pyx_L5_argtuple_error:;
3730   __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 67, __pyx_L3_error)
3731   __pyx_L3_error:;
3732   __Pyx_AddTraceback("bx.bbi.bbi_file.SummarizedData.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3733   __Pyx_RefNannyFinishContext();
3734   return -1;
3735   __pyx_L4_argument_unpacking_done:;
3736   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData___init__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self), __pyx_v_start, __pyx_v_end, __pyx_v_size);
3737 
3738   /* function exit code */
3739   __Pyx_RefNannyFinishContext();
3740   return __pyx_r;
3741 }
3742 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData___init__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end,int __pyx_v_size)3743 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData___init__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, int __pyx_v_size) {
3744   int __pyx_r;
3745   __Pyx_RefNannyDeclarations
3746   PyObject *__pyx_t_1 = NULL;
3747   PyObject *__pyx_t_2 = NULL;
3748   PyObject *__pyx_t_3 = NULL;
3749   PyObject *__pyx_t_4 = NULL;
3750   PyObject *__pyx_t_5 = NULL;
3751   int __pyx_lineno = 0;
3752   const char *__pyx_filename = NULL;
3753   int __pyx_clineno = 0;
3754   __Pyx_RefNannySetupContext("__init__", 0);
3755 
3756   /* "bx/bbi/bbi_file.pyx":68
3757  *     """
3758  *     def __init__( self, bits32 start, bits32 end, int size ):
3759  *         self.start = start             # <<<<<<<<<<<<<<
3760  *         self.end = end
3761  *         self.size = size
3762  */
3763   __pyx_v_self->start = __pyx_v_start;
3764 
3765   /* "bx/bbi/bbi_file.pyx":69
3766  *     def __init__( self, bits32 start, bits32 end, int size ):
3767  *         self.start = start
3768  *         self.end = end             # <<<<<<<<<<<<<<
3769  *         self.size = size
3770  *         self.valid_count = numpy.zeros( self.size, dtype=numpy.float64 )
3771  */
3772   __pyx_v_self->end = __pyx_v_end;
3773 
3774   /* "bx/bbi/bbi_file.pyx":70
3775  *         self.start = start
3776  *         self.end = end
3777  *         self.size = size             # <<<<<<<<<<<<<<
3778  *         self.valid_count = numpy.zeros( self.size, dtype=numpy.float64 )
3779  *         self.min_val = numpy.zeros( self.size, dtype=numpy.float64 )
3780  */
3781   __pyx_v_self->size = __pyx_v_size;
3782 
3783   /* "bx/bbi/bbi_file.pyx":71
3784  *         self.end = end
3785  *         self.size = size
3786  *         self.valid_count = numpy.zeros( self.size, dtype=numpy.float64 )             # <<<<<<<<<<<<<<
3787  *         self.min_val = numpy.zeros( self.size, dtype=numpy.float64 )
3788  *         self.max_val = numpy.zeros( self.size, dtype=numpy.float64 )
3789  */
3790   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
3791   __Pyx_GOTREF(__pyx_t_1);
3792   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
3793   __Pyx_GOTREF(__pyx_t_2);
3794   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3795   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
3796   __Pyx_GOTREF(__pyx_t_1);
3797   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error)
3798   __Pyx_GOTREF(__pyx_t_3);
3799   __Pyx_GIVEREF(__pyx_t_1);
3800   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
3801   __pyx_t_1 = 0;
3802   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
3803   __Pyx_GOTREF(__pyx_t_1);
3804   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error)
3805   __Pyx_GOTREF(__pyx_t_4);
3806   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L1_error)
3807   __Pyx_GOTREF(__pyx_t_5);
3808   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3809   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
3810   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3811   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L1_error)
3812   __Pyx_GOTREF(__pyx_t_5);
3813   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3814   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3815   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3816   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 71, __pyx_L1_error)
3817   __Pyx_GIVEREF(__pyx_t_5);
3818   __Pyx_GOTREF(__pyx_v_self->valid_count);
3819   __Pyx_DECREF(((PyObject *)__pyx_v_self->valid_count));
3820   __pyx_v_self->valid_count = ((PyArrayObject *)__pyx_t_5);
3821   __pyx_t_5 = 0;
3822 
3823   /* "bx/bbi/bbi_file.pyx":72
3824  *         self.size = size
3825  *         self.valid_count = numpy.zeros( self.size, dtype=numpy.float64 )
3826  *         self.min_val = numpy.zeros( self.size, dtype=numpy.float64 )             # <<<<<<<<<<<<<<
3827  *         self.max_val = numpy.zeros( self.size, dtype=numpy.float64 )
3828  *         self.sum_data = numpy.zeros( self.size, dtype=numpy.float64 )
3829  */
3830   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error)
3831   __Pyx_GOTREF(__pyx_t_5);
3832   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
3833   __Pyx_GOTREF(__pyx_t_1);
3834   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3835   __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error)
3836   __Pyx_GOTREF(__pyx_t_5);
3837   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
3838   __Pyx_GOTREF(__pyx_t_3);
3839   __Pyx_GIVEREF(__pyx_t_5);
3840   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
3841   __pyx_t_5 = 0;
3842   __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error)
3843   __Pyx_GOTREF(__pyx_t_5);
3844   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error)
3845   __Pyx_GOTREF(__pyx_t_2);
3846   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
3847   __Pyx_GOTREF(__pyx_t_4);
3848   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3849   if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
3850   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3851   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
3852   __Pyx_GOTREF(__pyx_t_4);
3853   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3854   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3855   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3856   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 72, __pyx_L1_error)
3857   __Pyx_GIVEREF(__pyx_t_4);
3858   __Pyx_GOTREF(__pyx_v_self->min_val);
3859   __Pyx_DECREF(((PyObject *)__pyx_v_self->min_val));
3860   __pyx_v_self->min_val = ((PyArrayObject *)__pyx_t_4);
3861   __pyx_t_4 = 0;
3862 
3863   /* "bx/bbi/bbi_file.pyx":73
3864  *         self.valid_count = numpy.zeros( self.size, dtype=numpy.float64 )
3865  *         self.min_val = numpy.zeros( self.size, dtype=numpy.float64 )
3866  *         self.max_val = numpy.zeros( self.size, dtype=numpy.float64 )             # <<<<<<<<<<<<<<
3867  *         self.sum_data = numpy.zeros( self.size, dtype=numpy.float64 )
3868  *         self.sum_squares = numpy.zeros( self.size, dtype=numpy.float64 )
3869  */
3870   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error)
3871   __Pyx_GOTREF(__pyx_t_4);
3872   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error)
3873   __Pyx_GOTREF(__pyx_t_5);
3874   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3875   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error)
3876   __Pyx_GOTREF(__pyx_t_4);
3877   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error)
3878   __Pyx_GOTREF(__pyx_t_3);
3879   __Pyx_GIVEREF(__pyx_t_4);
3880   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
3881   __pyx_t_4 = 0;
3882   __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error)
3883   __Pyx_GOTREF(__pyx_t_4);
3884   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
3885   __Pyx_GOTREF(__pyx_t_1);
3886   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
3887   __Pyx_GOTREF(__pyx_t_2);
3888   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3889   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
3890   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3891   __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
3892   __Pyx_GOTREF(__pyx_t_2);
3893   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3894   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3895   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3896   if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 73, __pyx_L1_error)
3897   __Pyx_GIVEREF(__pyx_t_2);
3898   __Pyx_GOTREF(__pyx_v_self->max_val);
3899   __Pyx_DECREF(((PyObject *)__pyx_v_self->max_val));
3900   __pyx_v_self->max_val = ((PyArrayObject *)__pyx_t_2);
3901   __pyx_t_2 = 0;
3902 
3903   /* "bx/bbi/bbi_file.pyx":74
3904  *         self.min_val = numpy.zeros( self.size, dtype=numpy.float64 )
3905  *         self.max_val = numpy.zeros( self.size, dtype=numpy.float64 )
3906  *         self.sum_data = numpy.zeros( self.size, dtype=numpy.float64 )             # <<<<<<<<<<<<<<
3907  *         self.sum_squares = numpy.zeros( self.size, dtype=numpy.float64 )
3908  *     cdef accumulate_interval_value( self, bits32 s, bits32 e, float val ):
3909  */
3910   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
3911   __Pyx_GOTREF(__pyx_t_2);
3912   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
3913   __Pyx_GOTREF(__pyx_t_4);
3914   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3915   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
3916   __Pyx_GOTREF(__pyx_t_2);
3917   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error)
3918   __Pyx_GOTREF(__pyx_t_3);
3919   __Pyx_GIVEREF(__pyx_t_2);
3920   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3921   __pyx_t_2 = 0;
3922   __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
3923   __Pyx_GOTREF(__pyx_t_2);
3924   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error)
3925   __Pyx_GOTREF(__pyx_t_5);
3926   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
3927   __Pyx_GOTREF(__pyx_t_1);
3928   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3929   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
3930   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3931   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
3932   __Pyx_GOTREF(__pyx_t_1);
3933   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3934   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3935   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3936   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 74, __pyx_L1_error)
3937   __Pyx_GIVEREF(__pyx_t_1);
3938   __Pyx_GOTREF(__pyx_v_self->sum_data);
3939   __Pyx_DECREF(((PyObject *)__pyx_v_self->sum_data));
3940   __pyx_v_self->sum_data = ((PyArrayObject *)__pyx_t_1);
3941   __pyx_t_1 = 0;
3942 
3943   /* "bx/bbi/bbi_file.pyx":75
3944  *         self.max_val = numpy.zeros( self.size, dtype=numpy.float64 )
3945  *         self.sum_data = numpy.zeros( self.size, dtype=numpy.float64 )
3946  *         self.sum_squares = numpy.zeros( self.size, dtype=numpy.float64 )             # <<<<<<<<<<<<<<
3947  *     cdef accumulate_interval_value( self, bits32 s, bits32 e, float val ):
3948  *         cdef int base_start, base_end, base_step, overlap, j, interval_size
3949  */
3950   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
3951   __Pyx_GOTREF(__pyx_t_1);
3952   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
3953   __Pyx_GOTREF(__pyx_t_2);
3954   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3955   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
3956   __Pyx_GOTREF(__pyx_t_1);
3957   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
3958   __Pyx_GOTREF(__pyx_t_3);
3959   __Pyx_GIVEREF(__pyx_t_1);
3960   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
3961   __pyx_t_1 = 0;
3962   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
3963   __Pyx_GOTREF(__pyx_t_1);
3964   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
3965   __Pyx_GOTREF(__pyx_t_4);
3966   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
3967   __Pyx_GOTREF(__pyx_t_5);
3968   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3969   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
3970   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3971   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
3972   __Pyx_GOTREF(__pyx_t_5);
3973   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3974   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3975   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3976   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 75, __pyx_L1_error)
3977   __Pyx_GIVEREF(__pyx_t_5);
3978   __Pyx_GOTREF(__pyx_v_self->sum_squares);
3979   __Pyx_DECREF(((PyObject *)__pyx_v_self->sum_squares));
3980   __pyx_v_self->sum_squares = ((PyArrayObject *)__pyx_t_5);
3981   __pyx_t_5 = 0;
3982 
3983   /* "bx/bbi/bbi_file.pyx":67
3984  *     aggregation over a particular range and resolution
3985  *     """
3986  *     def __init__( self, bits32 start, bits32 end, int size ):             # <<<<<<<<<<<<<<
3987  *         self.start = start
3988  *         self.end = end
3989  */
3990 
3991   /* function exit code */
3992   __pyx_r = 0;
3993   goto __pyx_L0;
3994   __pyx_L1_error:;
3995   __Pyx_XDECREF(__pyx_t_1);
3996   __Pyx_XDECREF(__pyx_t_2);
3997   __Pyx_XDECREF(__pyx_t_3);
3998   __Pyx_XDECREF(__pyx_t_4);
3999   __Pyx_XDECREF(__pyx_t_5);
4000   __Pyx_AddTraceback("bx.bbi.bbi_file.SummarizedData.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4001   __pyx_r = -1;
4002   __pyx_L0:;
4003   __Pyx_RefNannyFinishContext();
4004   return __pyx_r;
4005 }
4006 
4007 /* "bx/bbi/bbi_file.pyx":76
4008  *         self.sum_data = numpy.zeros( self.size, dtype=numpy.float64 )
4009  *         self.sum_squares = numpy.zeros( self.size, dtype=numpy.float64 )
4010  *     cdef accumulate_interval_value( self, bits32 s, bits32 e, float val ):             # <<<<<<<<<<<<<<
4011  *         cdef int base_start, base_end, base_step, overlap, j, interval_size
4012  *         cdef double overlap_factor, interval_weight
4013  */
4014 
__pyx_f_2bx_3bbi_8bbi_file_14SummarizedData_accumulate_interval_value(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_s,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_e,float __pyx_v_val)4015 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_14SummarizedData_accumulate_interval_value(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_s, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_e, float __pyx_v_val) {
4016   int __pyx_v_base_start;
4017   int __pyx_v_base_end;
4018   int __pyx_v_base_step;
4019   int __pyx_v_overlap;
4020   int __pyx_v_j;
4021   int __pyx_v_interval_size;
4022   double __pyx_v_overlap_factor;
4023   double __pyx_v_interval_weight;
4024   PyArrayObject *__pyx_v_valid_count = 0;
4025   PyArrayObject *__pyx_v_min_val = 0;
4026   PyArrayObject *__pyx_v_max_val = 0;
4027   PyArrayObject *__pyx_v_sum_data = 0;
4028   PyArrayObject *__pyx_v_sum_squares = 0;
4029   __Pyx_LocalBuf_ND __pyx_pybuffernd_max_val;
4030   __Pyx_Buffer __pyx_pybuffer_max_val;
4031   __Pyx_LocalBuf_ND __pyx_pybuffernd_min_val;
4032   __Pyx_Buffer __pyx_pybuffer_min_val;
4033   __Pyx_LocalBuf_ND __pyx_pybuffernd_sum_data;
4034   __Pyx_Buffer __pyx_pybuffer_sum_data;
4035   __Pyx_LocalBuf_ND __pyx_pybuffernd_sum_squares;
4036   __Pyx_Buffer __pyx_pybuffer_sum_squares;
4037   __Pyx_LocalBuf_ND __pyx_pybuffernd_valid_count;
4038   __Pyx_Buffer __pyx_pybuffer_valid_count;
4039   PyObject *__pyx_r = NULL;
4040   __Pyx_RefNannyDeclarations
4041   PyObject *__pyx_t_1 = NULL;
4042   int __pyx_t_2;
4043   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_3;
4044   int __pyx_t_4;
4045   Py_ssize_t __pyx_t_5;
4046   int __pyx_t_6;
4047   int __pyx_lineno = 0;
4048   const char *__pyx_filename = NULL;
4049   int __pyx_clineno = 0;
4050   __Pyx_RefNannySetupContext("accumulate_interval_value", 0);
4051   __pyx_pybuffer_valid_count.pybuffer.buf = NULL;
4052   __pyx_pybuffer_valid_count.refcount = 0;
4053   __pyx_pybuffernd_valid_count.data = NULL;
4054   __pyx_pybuffernd_valid_count.rcbuffer = &__pyx_pybuffer_valid_count;
4055   __pyx_pybuffer_min_val.pybuffer.buf = NULL;
4056   __pyx_pybuffer_min_val.refcount = 0;
4057   __pyx_pybuffernd_min_val.data = NULL;
4058   __pyx_pybuffernd_min_val.rcbuffer = &__pyx_pybuffer_min_val;
4059   __pyx_pybuffer_max_val.pybuffer.buf = NULL;
4060   __pyx_pybuffer_max_val.refcount = 0;
4061   __pyx_pybuffernd_max_val.data = NULL;
4062   __pyx_pybuffernd_max_val.rcbuffer = &__pyx_pybuffer_max_val;
4063   __pyx_pybuffer_sum_data.pybuffer.buf = NULL;
4064   __pyx_pybuffer_sum_data.refcount = 0;
4065   __pyx_pybuffernd_sum_data.data = NULL;
4066   __pyx_pybuffernd_sum_data.rcbuffer = &__pyx_pybuffer_sum_data;
4067   __pyx_pybuffer_sum_squares.pybuffer.buf = NULL;
4068   __pyx_pybuffer_sum_squares.refcount = 0;
4069   __pyx_pybuffernd_sum_squares.data = NULL;
4070   __pyx_pybuffernd_sum_squares.rcbuffer = &__pyx_pybuffer_sum_squares;
4071 
4072   /* "bx/bbi/bbi_file.pyx":80
4073  *         cdef double overlap_factor, interval_weight
4074  *         # We locally cdef the arrays so all indexing will be at C speeds
4075  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] valid_count = self.valid_count             # <<<<<<<<<<<<<<
4076  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] min_val = self.min_val
4077  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] max_val = self.max_val
4078  */
4079   __pyx_t_1 = ((PyObject *)__pyx_v_self->valid_count);
4080   __Pyx_INCREF(__pyx_t_1);
4081   {
4082     __Pyx_BufFmt_StackElem __pyx_stack[1];
4083     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_valid_count.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
4084       __pyx_v_valid_count = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_valid_count.rcbuffer->pybuffer.buf = NULL;
4085       __PYX_ERR(0, 80, __pyx_L1_error)
4086     } else {__pyx_pybuffernd_valid_count.diminfo[0].strides = __pyx_pybuffernd_valid_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_valid_count.diminfo[0].shape = __pyx_pybuffernd_valid_count.rcbuffer->pybuffer.shape[0];
4087     }
4088   }
4089   __pyx_v_valid_count = ((PyArrayObject *)__pyx_t_1);
4090   __pyx_t_1 = 0;
4091 
4092   /* "bx/bbi/bbi_file.pyx":81
4093  *         # We locally cdef the arrays so all indexing will be at C speeds
4094  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] valid_count = self.valid_count
4095  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] min_val = self.min_val             # <<<<<<<<<<<<<<
4096  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] max_val = self.max_val
4097  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] sum_data = self.sum_data
4098  */
4099   __pyx_t_1 = ((PyObject *)__pyx_v_self->min_val);
4100   __Pyx_INCREF(__pyx_t_1);
4101   {
4102     __Pyx_BufFmt_StackElem __pyx_stack[1];
4103     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_min_val.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
4104       __pyx_v_min_val = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_min_val.rcbuffer->pybuffer.buf = NULL;
4105       __PYX_ERR(0, 81, __pyx_L1_error)
4106     } else {__pyx_pybuffernd_min_val.diminfo[0].strides = __pyx_pybuffernd_min_val.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_min_val.diminfo[0].shape = __pyx_pybuffernd_min_val.rcbuffer->pybuffer.shape[0];
4107     }
4108   }
4109   __pyx_v_min_val = ((PyArrayObject *)__pyx_t_1);
4110   __pyx_t_1 = 0;
4111 
4112   /* "bx/bbi/bbi_file.pyx":82
4113  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] valid_count = self.valid_count
4114  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] min_val = self.min_val
4115  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] max_val = self.max_val             # <<<<<<<<<<<<<<
4116  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] sum_data = self.sum_data
4117  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] sum_squares = self.sum_squares
4118  */
4119   __pyx_t_1 = ((PyObject *)__pyx_v_self->max_val);
4120   __Pyx_INCREF(__pyx_t_1);
4121   {
4122     __Pyx_BufFmt_StackElem __pyx_stack[1];
4123     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_max_val.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
4124       __pyx_v_max_val = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_max_val.rcbuffer->pybuffer.buf = NULL;
4125       __PYX_ERR(0, 82, __pyx_L1_error)
4126     } else {__pyx_pybuffernd_max_val.diminfo[0].strides = __pyx_pybuffernd_max_val.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_max_val.diminfo[0].shape = __pyx_pybuffernd_max_val.rcbuffer->pybuffer.shape[0];
4127     }
4128   }
4129   __pyx_v_max_val = ((PyArrayObject *)__pyx_t_1);
4130   __pyx_t_1 = 0;
4131 
4132   /* "bx/bbi/bbi_file.pyx":83
4133  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] min_val = self.min_val
4134  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] max_val = self.max_val
4135  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] sum_data = self.sum_data             # <<<<<<<<<<<<<<
4136  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] sum_squares = self.sum_squares
4137  *         # Trim interval down to region of interest
4138  */
4139   __pyx_t_1 = ((PyObject *)__pyx_v_self->sum_data);
4140   __Pyx_INCREF(__pyx_t_1);
4141   {
4142     __Pyx_BufFmt_StackElem __pyx_stack[1];
4143     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sum_data.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
4144       __pyx_v_sum_data = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_sum_data.rcbuffer->pybuffer.buf = NULL;
4145       __PYX_ERR(0, 83, __pyx_L1_error)
4146     } else {__pyx_pybuffernd_sum_data.diminfo[0].strides = __pyx_pybuffernd_sum_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sum_data.diminfo[0].shape = __pyx_pybuffernd_sum_data.rcbuffer->pybuffer.shape[0];
4147     }
4148   }
4149   __pyx_v_sum_data = ((PyArrayObject *)__pyx_t_1);
4150   __pyx_t_1 = 0;
4151 
4152   /* "bx/bbi/bbi_file.pyx":84
4153  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] max_val = self.max_val
4154  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] sum_data = self.sum_data
4155  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] sum_squares = self.sum_squares             # <<<<<<<<<<<<<<
4156  *         # Trim interval down to region of interest
4157  *         if s < self.start:
4158  */
4159   __pyx_t_1 = ((PyObject *)__pyx_v_self->sum_squares);
4160   __Pyx_INCREF(__pyx_t_1);
4161   {
4162     __Pyx_BufFmt_StackElem __pyx_stack[1];
4163     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sum_squares.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
4164       __pyx_v_sum_squares = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_sum_squares.rcbuffer->pybuffer.buf = NULL;
4165       __PYX_ERR(0, 84, __pyx_L1_error)
4166     } else {__pyx_pybuffernd_sum_squares.diminfo[0].strides = __pyx_pybuffernd_sum_squares.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sum_squares.diminfo[0].shape = __pyx_pybuffernd_sum_squares.rcbuffer->pybuffer.shape[0];
4167     }
4168   }
4169   __pyx_v_sum_squares = ((PyArrayObject *)__pyx_t_1);
4170   __pyx_t_1 = 0;
4171 
4172   /* "bx/bbi/bbi_file.pyx":86
4173  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] sum_squares = self.sum_squares
4174  *         # Trim interval down to region of interest
4175  *         if s < self.start:             # <<<<<<<<<<<<<<
4176  *             s = self.start
4177  *         if e > self.end:
4178  */
4179   __pyx_t_2 = ((__pyx_v_s < __pyx_v_self->start) != 0);
4180   if (__pyx_t_2) {
4181 
4182     /* "bx/bbi/bbi_file.pyx":87
4183  *         # Trim interval down to region of interest
4184  *         if s < self.start:
4185  *             s = self.start             # <<<<<<<<<<<<<<
4186  *         if e > self.end:
4187  *             e = self.end
4188  */
4189     __pyx_t_3 = __pyx_v_self->start;
4190     __pyx_v_s = __pyx_t_3;
4191 
4192     /* "bx/bbi/bbi_file.pyx":86
4193  *         cdef numpy.ndarray[numpy.float64_t, ndim=1] sum_squares = self.sum_squares
4194  *         # Trim interval down to region of interest
4195  *         if s < self.start:             # <<<<<<<<<<<<<<
4196  *             s = self.start
4197  *         if e > self.end:
4198  */
4199   }
4200 
4201   /* "bx/bbi/bbi_file.pyx":88
4202  *         if s < self.start:
4203  *             s = self.start
4204  *         if e > self.end:             # <<<<<<<<<<<<<<
4205  *             e = self.end
4206  *         if s >= e:
4207  */
4208   __pyx_t_2 = ((__pyx_v_e > __pyx_v_self->end) != 0);
4209   if (__pyx_t_2) {
4210 
4211     /* "bx/bbi/bbi_file.pyx":89
4212  *             s = self.start
4213  *         if e > self.end:
4214  *             e = self.end             # <<<<<<<<<<<<<<
4215  *         if s >= e:
4216  *             return
4217  */
4218     __pyx_t_3 = __pyx_v_self->end;
4219     __pyx_v_e = __pyx_t_3;
4220 
4221     /* "bx/bbi/bbi_file.pyx":88
4222  *         if s < self.start:
4223  *             s = self.start
4224  *         if e > self.end:             # <<<<<<<<<<<<<<
4225  *             e = self.end
4226  *         if s >= e:
4227  */
4228   }
4229 
4230   /* "bx/bbi/bbi_file.pyx":90
4231  *         if e > self.end:
4232  *             e = self.end
4233  *         if s >= e:             # <<<<<<<<<<<<<<
4234  *             return
4235  *         base_step = ( self.end - self.start ) / self.size
4236  */
4237   __pyx_t_2 = ((__pyx_v_s >= __pyx_v_e) != 0);
4238   if (__pyx_t_2) {
4239 
4240     /* "bx/bbi/bbi_file.pyx":91
4241  *             e = self.end
4242  *         if s >= e:
4243  *             return             # <<<<<<<<<<<<<<
4244  *         base_step = ( self.end - self.start ) / self.size
4245  *         for j from 0 <= j < self.size:
4246  */
4247     __Pyx_XDECREF(__pyx_r);
4248     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4249     goto __pyx_L0;
4250 
4251     /* "bx/bbi/bbi_file.pyx":90
4252  *         if e > self.end:
4253  *             e = self.end
4254  *         if s >= e:             # <<<<<<<<<<<<<<
4255  *             return
4256  *         base_step = ( self.end - self.start ) / self.size
4257  */
4258   }
4259 
4260   /* "bx/bbi/bbi_file.pyx":92
4261  *         if s >= e:
4262  *             return
4263  *         base_step = ( self.end - self.start ) / self.size             # <<<<<<<<<<<<<<
4264  *         for j from 0 <= j < self.size:
4265  *             base_start = self.start + ( base_step * j )
4266  */
4267   __pyx_t_3 = (__pyx_v_self->end - __pyx_v_self->start);
4268   if (unlikely(__pyx_v_self->size == 0)) {
4269     PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
4270     __PYX_ERR(0, 92, __pyx_L1_error)
4271   }
4272   __pyx_v_base_step = (__pyx_t_3 / __pyx_v_self->size);
4273 
4274   /* "bx/bbi/bbi_file.pyx":93
4275  *             return
4276  *         base_step = ( self.end - self.start ) / self.size
4277  *         for j from 0 <= j < self.size:             # <<<<<<<<<<<<<<
4278  *             base_start = self.start + ( base_step * j )
4279  *             base_end = base_start + base_step
4280  */
4281   __pyx_t_4 = __pyx_v_self->size;
4282   for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) {
4283 
4284     /* "bx/bbi/bbi_file.pyx":94
4285  *         base_step = ( self.end - self.start ) / self.size
4286  *         for j from 0 <= j < self.size:
4287  *             base_start = self.start + ( base_step * j )             # <<<<<<<<<<<<<<
4288  *             base_end = base_start + base_step
4289  *             overlap = range_intersection( base_start, base_end, s, e )
4290  */
4291     __pyx_v_base_start = (__pyx_v_self->start + (__pyx_v_base_step * __pyx_v_j));
4292 
4293     /* "bx/bbi/bbi_file.pyx":95
4294  *         for j from 0 <= j < self.size:
4295  *             base_start = self.start + ( base_step * j )
4296  *             base_end = base_start + base_step             # <<<<<<<<<<<<<<
4297  *             overlap = range_intersection( base_start, base_end, s, e )
4298  *             if overlap > 0:
4299  */
4300     __pyx_v_base_end = (__pyx_v_base_start + __pyx_v_base_step);
4301 
4302     /* "bx/bbi/bbi_file.pyx":96
4303  *             base_start = self.start + ( base_step * j )
4304  *             base_end = base_start + base_step
4305  *             overlap = range_intersection( base_start, base_end, s, e )             # <<<<<<<<<<<<<<
4306  *             if overlap > 0:
4307  *                 interval_size = e - s
4308  */
4309     __pyx_v_overlap = __pyx_f_2bx_3bbi_8bbi_file_range_intersection(__pyx_v_base_start, __pyx_v_base_end, __pyx_v_s, __pyx_v_e);
4310 
4311     /* "bx/bbi/bbi_file.pyx":97
4312  *             base_end = base_start + base_step
4313  *             overlap = range_intersection( base_start, base_end, s, e )
4314  *             if overlap > 0:             # <<<<<<<<<<<<<<
4315  *                 interval_size = e - s
4316  *                 overlap_factor = <double> overlap / interval_size
4317  */
4318     __pyx_t_2 = ((__pyx_v_overlap > 0) != 0);
4319     if (__pyx_t_2) {
4320 
4321       /* "bx/bbi/bbi_file.pyx":98
4322  *             overlap = range_intersection( base_start, base_end, s, e )
4323  *             if overlap > 0:
4324  *                 interval_size = e - s             # <<<<<<<<<<<<<<
4325  *                 overlap_factor = <double> overlap / interval_size
4326  *                 interval_weight = interval_size * overlap_factor
4327  */
4328       __pyx_v_interval_size = (__pyx_v_e - __pyx_v_s);
4329 
4330       /* "bx/bbi/bbi_file.pyx":99
4331  *             if overlap > 0:
4332  *                 interval_size = e - s
4333  *                 overlap_factor = <double> overlap / interval_size             # <<<<<<<<<<<<<<
4334  *                 interval_weight = interval_size * overlap_factor
4335  *                 valid_count[j] += interval_weight
4336  */
4337       if (unlikely(__pyx_v_interval_size == 0)) {
4338         PyErr_SetString(PyExc_ZeroDivisionError, "float division");
4339         __PYX_ERR(0, 99, __pyx_L1_error)
4340       }
4341       __pyx_v_overlap_factor = (((double)__pyx_v_overlap) / __pyx_v_interval_size);
4342 
4343       /* "bx/bbi/bbi_file.pyx":100
4344  *                 interval_size = e - s
4345  *                 overlap_factor = <double> overlap / interval_size
4346  *                 interval_weight = interval_size * overlap_factor             # <<<<<<<<<<<<<<
4347  *                 valid_count[j] += interval_weight
4348  *                 sum_data[j] += val * interval_weight
4349  */
4350       __pyx_v_interval_weight = (__pyx_v_interval_size * __pyx_v_overlap_factor);
4351 
4352       /* "bx/bbi/bbi_file.pyx":101
4353  *                 overlap_factor = <double> overlap / interval_size
4354  *                 interval_weight = interval_size * overlap_factor
4355  *                 valid_count[j] += interval_weight             # <<<<<<<<<<<<<<
4356  *                 sum_data[j] += val * interval_weight
4357  *                 sum_squares[j] += val * val * interval_weight
4358  */
4359       __pyx_t_5 = __pyx_v_j;
4360       __pyx_t_6 = -1;
4361       if (__pyx_t_5 < 0) {
4362         __pyx_t_5 += __pyx_pybuffernd_valid_count.diminfo[0].shape;
4363         if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
4364       } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_valid_count.diminfo[0].shape)) __pyx_t_6 = 0;
4365       if (unlikely(__pyx_t_6 != -1)) {
4366         __Pyx_RaiseBufferIndexError(__pyx_t_6);
4367         __PYX_ERR(0, 101, __pyx_L1_error)
4368       }
4369       *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_valid_count.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_valid_count.diminfo[0].strides) += __pyx_v_interval_weight;
4370 
4371       /* "bx/bbi/bbi_file.pyx":102
4372  *                 interval_weight = interval_size * overlap_factor
4373  *                 valid_count[j] += interval_weight
4374  *                 sum_data[j] += val * interval_weight             # <<<<<<<<<<<<<<
4375  *                 sum_squares[j] += val * val * interval_weight
4376  *                 if max_val[j] < val:
4377  */
4378       __pyx_t_5 = __pyx_v_j;
4379       __pyx_t_6 = -1;
4380       if (__pyx_t_5 < 0) {
4381         __pyx_t_5 += __pyx_pybuffernd_sum_data.diminfo[0].shape;
4382         if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
4383       } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_sum_data.diminfo[0].shape)) __pyx_t_6 = 0;
4384       if (unlikely(__pyx_t_6 != -1)) {
4385         __Pyx_RaiseBufferIndexError(__pyx_t_6);
4386         __PYX_ERR(0, 102, __pyx_L1_error)
4387       }
4388       *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sum_data.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_sum_data.diminfo[0].strides) += (__pyx_v_val * __pyx_v_interval_weight);
4389 
4390       /* "bx/bbi/bbi_file.pyx":103
4391  *                 valid_count[j] += interval_weight
4392  *                 sum_data[j] += val * interval_weight
4393  *                 sum_squares[j] += val * val * interval_weight             # <<<<<<<<<<<<<<
4394  *                 if max_val[j] < val:
4395  *                     max_val[j] = val
4396  */
4397       __pyx_t_5 = __pyx_v_j;
4398       __pyx_t_6 = -1;
4399       if (__pyx_t_5 < 0) {
4400         __pyx_t_5 += __pyx_pybuffernd_sum_squares.diminfo[0].shape;
4401         if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
4402       } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_sum_squares.diminfo[0].shape)) __pyx_t_6 = 0;
4403       if (unlikely(__pyx_t_6 != -1)) {
4404         __Pyx_RaiseBufferIndexError(__pyx_t_6);
4405         __PYX_ERR(0, 103, __pyx_L1_error)
4406       }
4407       *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sum_squares.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_sum_squares.diminfo[0].strides) += ((__pyx_v_val * __pyx_v_val) * __pyx_v_interval_weight);
4408 
4409       /* "bx/bbi/bbi_file.pyx":104
4410  *                 sum_data[j] += val * interval_weight
4411  *                 sum_squares[j] += val * val * interval_weight
4412  *                 if max_val[j] < val:             # <<<<<<<<<<<<<<
4413  *                     max_val[j] = val
4414  *                 if min_val[j] > val:
4415  */
4416       __pyx_t_5 = __pyx_v_j;
4417       __pyx_t_6 = -1;
4418       if (__pyx_t_5 < 0) {
4419         __pyx_t_5 += __pyx_pybuffernd_max_val.diminfo[0].shape;
4420         if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
4421       } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_max_val.diminfo[0].shape)) __pyx_t_6 = 0;
4422       if (unlikely(__pyx_t_6 != -1)) {
4423         __Pyx_RaiseBufferIndexError(__pyx_t_6);
4424         __PYX_ERR(0, 104, __pyx_L1_error)
4425       }
4426       __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_max_val.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_max_val.diminfo[0].strides)) < __pyx_v_val) != 0);
4427       if (__pyx_t_2) {
4428 
4429         /* "bx/bbi/bbi_file.pyx":105
4430  *                 sum_squares[j] += val * val * interval_weight
4431  *                 if max_val[j] < val:
4432  *                     max_val[j] = val             # <<<<<<<<<<<<<<
4433  *                 if min_val[j] > val:
4434  *                     min_val[j] = val
4435  */
4436         __pyx_t_5 = __pyx_v_j;
4437         __pyx_t_6 = -1;
4438         if (__pyx_t_5 < 0) {
4439           __pyx_t_5 += __pyx_pybuffernd_max_val.diminfo[0].shape;
4440           if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
4441         } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_max_val.diminfo[0].shape)) __pyx_t_6 = 0;
4442         if (unlikely(__pyx_t_6 != -1)) {
4443           __Pyx_RaiseBufferIndexError(__pyx_t_6);
4444           __PYX_ERR(0, 105, __pyx_L1_error)
4445         }
4446         *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_max_val.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_max_val.diminfo[0].strides) = __pyx_v_val;
4447 
4448         /* "bx/bbi/bbi_file.pyx":104
4449  *                 sum_data[j] += val * interval_weight
4450  *                 sum_squares[j] += val * val * interval_weight
4451  *                 if max_val[j] < val:             # <<<<<<<<<<<<<<
4452  *                     max_val[j] = val
4453  *                 if min_val[j] > val:
4454  */
4455       }
4456 
4457       /* "bx/bbi/bbi_file.pyx":106
4458  *                 if max_val[j] < val:
4459  *                     max_val[j] = val
4460  *                 if min_val[j] > val:             # <<<<<<<<<<<<<<
4461  *                     min_val[j] = val
4462  *
4463  */
4464       __pyx_t_5 = __pyx_v_j;
4465       __pyx_t_6 = -1;
4466       if (__pyx_t_5 < 0) {
4467         __pyx_t_5 += __pyx_pybuffernd_min_val.diminfo[0].shape;
4468         if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
4469       } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_min_val.diminfo[0].shape)) __pyx_t_6 = 0;
4470       if (unlikely(__pyx_t_6 != -1)) {
4471         __Pyx_RaiseBufferIndexError(__pyx_t_6);
4472         __PYX_ERR(0, 106, __pyx_L1_error)
4473       }
4474       __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_min_val.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_min_val.diminfo[0].strides)) > __pyx_v_val) != 0);
4475       if (__pyx_t_2) {
4476 
4477         /* "bx/bbi/bbi_file.pyx":107
4478  *                     max_val[j] = val
4479  *                 if min_val[j] > val:
4480  *                     min_val[j] = val             # <<<<<<<<<<<<<<
4481  *
4482  * cdef class BlockHandler:
4483  */
4484         __pyx_t_5 = __pyx_v_j;
4485         __pyx_t_6 = -1;
4486         if (__pyx_t_5 < 0) {
4487           __pyx_t_5 += __pyx_pybuffernd_min_val.diminfo[0].shape;
4488           if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
4489         } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_min_val.diminfo[0].shape)) __pyx_t_6 = 0;
4490         if (unlikely(__pyx_t_6 != -1)) {
4491           __Pyx_RaiseBufferIndexError(__pyx_t_6);
4492           __PYX_ERR(0, 107, __pyx_L1_error)
4493         }
4494         *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_min_val.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_min_val.diminfo[0].strides) = __pyx_v_val;
4495 
4496         /* "bx/bbi/bbi_file.pyx":106
4497  *                 if max_val[j] < val:
4498  *                     max_val[j] = val
4499  *                 if min_val[j] > val:             # <<<<<<<<<<<<<<
4500  *                     min_val[j] = val
4501  *
4502  */
4503       }
4504 
4505       /* "bx/bbi/bbi_file.pyx":97
4506  *             base_end = base_start + base_step
4507  *             overlap = range_intersection( base_start, base_end, s, e )
4508  *             if overlap > 0:             # <<<<<<<<<<<<<<
4509  *                 interval_size = e - s
4510  *                 overlap_factor = <double> overlap / interval_size
4511  */
4512     }
4513   }
4514 
4515   /* "bx/bbi/bbi_file.pyx":76
4516  *         self.sum_data = numpy.zeros( self.size, dtype=numpy.float64 )
4517  *         self.sum_squares = numpy.zeros( self.size, dtype=numpy.float64 )
4518  *     cdef accumulate_interval_value( self, bits32 s, bits32 e, float val ):             # <<<<<<<<<<<<<<
4519  *         cdef int base_start, base_end, base_step, overlap, j, interval_size
4520  *         cdef double overlap_factor, interval_weight
4521  */
4522 
4523   /* function exit code */
4524   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4525   goto __pyx_L0;
4526   __pyx_L1_error:;
4527   __Pyx_XDECREF(__pyx_t_1);
4528   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4529     __Pyx_PyThreadState_declare
4530     __Pyx_PyThreadState_assign
4531     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4532     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_max_val.rcbuffer->pybuffer);
4533     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_min_val.rcbuffer->pybuffer);
4534     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sum_data.rcbuffer->pybuffer);
4535     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sum_squares.rcbuffer->pybuffer);
4536     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_valid_count.rcbuffer->pybuffer);
4537   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4538   __Pyx_AddTraceback("bx.bbi.bbi_file.SummarizedData.accumulate_interval_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
4539   __pyx_r = 0;
4540   goto __pyx_L2;
4541   __pyx_L0:;
4542   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_max_val.rcbuffer->pybuffer);
4543   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_min_val.rcbuffer->pybuffer);
4544   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sum_data.rcbuffer->pybuffer);
4545   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sum_squares.rcbuffer->pybuffer);
4546   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_valid_count.rcbuffer->pybuffer);
4547   __pyx_L2:;
4548   __Pyx_XDECREF((PyObject *)__pyx_v_valid_count);
4549   __Pyx_XDECREF((PyObject *)__pyx_v_min_val);
4550   __Pyx_XDECREF((PyObject *)__pyx_v_max_val);
4551   __Pyx_XDECREF((PyObject *)__pyx_v_sum_data);
4552   __Pyx_XDECREF((PyObject *)__pyx_v_sum_squares);
4553   __Pyx_XGIVEREF(__pyx_r);
4554   __Pyx_RefNannyFinishContext();
4555   return __pyx_r;
4556 }
4557 
4558 /* "bx/bbi/bbi_file.pxd":26
4559  *     aggregation over a particular range and resolution
4560  *     """
4561  *     cdef public bits32 start             # <<<<<<<<<<<<<<
4562  *     cdef public bits32 end
4563  *     cdef public int size
4564  */
4565 
4566 /* Python wrapper */
4567 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_5start_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_5start_1__get__(PyObject * __pyx_v_self)4568 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_5start_1__get__(PyObject *__pyx_v_self) {
4569   PyObject *__pyx_r = 0;
4570   __Pyx_RefNannyDeclarations
4571   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4572   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_5start___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self));
4573 
4574   /* function exit code */
4575   __Pyx_RefNannyFinishContext();
4576   return __pyx_r;
4577 }
4578 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_5start___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self)4579 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_5start___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self) {
4580   PyObject *__pyx_r = NULL;
4581   __Pyx_RefNannyDeclarations
4582   PyObject *__pyx_t_1 = NULL;
4583   int __pyx_lineno = 0;
4584   const char *__pyx_filename = NULL;
4585   int __pyx_clineno = 0;
4586   __Pyx_RefNannySetupContext("__get__", 0);
4587   __Pyx_XDECREF(__pyx_r);
4588   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->start); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 26, __pyx_L1_error)
4589   __Pyx_GOTREF(__pyx_t_1);
4590   __pyx_r = __pyx_t_1;
4591   __pyx_t_1 = 0;
4592   goto __pyx_L0;
4593 
4594   /* function exit code */
4595   __pyx_L1_error:;
4596   __Pyx_XDECREF(__pyx_t_1);
4597   __Pyx_AddTraceback("bx.bbi.bbi_file.SummarizedData.start.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4598   __pyx_r = NULL;
4599   __pyx_L0:;
4600   __Pyx_XGIVEREF(__pyx_r);
4601   __Pyx_RefNannyFinishContext();
4602   return __pyx_r;
4603 }
4604 
4605 /* Python wrapper */
4606 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_5start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_5start_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)4607 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_5start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4608   int __pyx_r;
4609   __Pyx_RefNannyDeclarations
4610   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4611   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_5start_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4612 
4613   /* function exit code */
4614   __Pyx_RefNannyFinishContext();
4615   return __pyx_r;
4616 }
4617 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_5start_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self,PyObject * __pyx_v_value)4618 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_5start_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v_value) {
4619   int __pyx_r;
4620   __Pyx_RefNannyDeclarations
4621   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_1;
4622   int __pyx_lineno = 0;
4623   const char *__pyx_filename = NULL;
4624   int __pyx_clineno = 0;
4625   __Pyx_RefNannySetupContext("__set__", 0);
4626   __pyx_t_1 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
4627   __pyx_v_self->start = __pyx_t_1;
4628 
4629   /* function exit code */
4630   __pyx_r = 0;
4631   goto __pyx_L0;
4632   __pyx_L1_error:;
4633   __Pyx_AddTraceback("bx.bbi.bbi_file.SummarizedData.start.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4634   __pyx_r = -1;
4635   __pyx_L0:;
4636   __Pyx_RefNannyFinishContext();
4637   return __pyx_r;
4638 }
4639 
4640 /* "bx/bbi/bbi_file.pxd":27
4641  *     """
4642  *     cdef public bits32 start
4643  *     cdef public bits32 end             # <<<<<<<<<<<<<<
4644  *     cdef public int size
4645  *     cdef public numpy.ndarray valid_count
4646  */
4647 
4648 /* Python wrapper */
4649 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_3end_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_3end_1__get__(PyObject * __pyx_v_self)4650 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_3end_1__get__(PyObject *__pyx_v_self) {
4651   PyObject *__pyx_r = 0;
4652   __Pyx_RefNannyDeclarations
4653   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4654   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_3end___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self));
4655 
4656   /* function exit code */
4657   __Pyx_RefNannyFinishContext();
4658   return __pyx_r;
4659 }
4660 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_3end___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self)4661 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_3end___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self) {
4662   PyObject *__pyx_r = NULL;
4663   __Pyx_RefNannyDeclarations
4664   PyObject *__pyx_t_1 = NULL;
4665   int __pyx_lineno = 0;
4666   const char *__pyx_filename = NULL;
4667   int __pyx_clineno = 0;
4668   __Pyx_RefNannySetupContext("__get__", 0);
4669   __Pyx_XDECREF(__pyx_r);
4670   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->end); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 27, __pyx_L1_error)
4671   __Pyx_GOTREF(__pyx_t_1);
4672   __pyx_r = __pyx_t_1;
4673   __pyx_t_1 = 0;
4674   goto __pyx_L0;
4675 
4676   /* function exit code */
4677   __pyx_L1_error:;
4678   __Pyx_XDECREF(__pyx_t_1);
4679   __Pyx_AddTraceback("bx.bbi.bbi_file.SummarizedData.end.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4680   __pyx_r = NULL;
4681   __pyx_L0:;
4682   __Pyx_XGIVEREF(__pyx_r);
4683   __Pyx_RefNannyFinishContext();
4684   return __pyx_r;
4685 }
4686 
4687 /* Python wrapper */
4688 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_3end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_3end_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)4689 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_3end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4690   int __pyx_r;
4691   __Pyx_RefNannyDeclarations
4692   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4693   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_3end_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4694 
4695   /* function exit code */
4696   __Pyx_RefNannyFinishContext();
4697   return __pyx_r;
4698 }
4699 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_3end_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self,PyObject * __pyx_v_value)4700 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_3end_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v_value) {
4701   int __pyx_r;
4702   __Pyx_RefNannyDeclarations
4703   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_1;
4704   int __pyx_lineno = 0;
4705   const char *__pyx_filename = NULL;
4706   int __pyx_clineno = 0;
4707   __Pyx_RefNannySetupContext("__set__", 0);
4708   __pyx_t_1 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 27, __pyx_L1_error)
4709   __pyx_v_self->end = __pyx_t_1;
4710 
4711   /* function exit code */
4712   __pyx_r = 0;
4713   goto __pyx_L0;
4714   __pyx_L1_error:;
4715   __Pyx_AddTraceback("bx.bbi.bbi_file.SummarizedData.end.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4716   __pyx_r = -1;
4717   __pyx_L0:;
4718   __Pyx_RefNannyFinishContext();
4719   return __pyx_r;
4720 }
4721 
4722 /* "bx/bbi/bbi_file.pxd":28
4723  *     cdef public bits32 start
4724  *     cdef public bits32 end
4725  *     cdef public int size             # <<<<<<<<<<<<<<
4726  *     cdef public numpy.ndarray valid_count
4727  *     cdef public numpy.ndarray min_val
4728  */
4729 
4730 /* Python wrapper */
4731 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_4size_1__get__(PyObject * __pyx_v_self)4732 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_4size_1__get__(PyObject *__pyx_v_self) {
4733   PyObject *__pyx_r = 0;
4734   __Pyx_RefNannyDeclarations
4735   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4736   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_4size___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self));
4737 
4738   /* function exit code */
4739   __Pyx_RefNannyFinishContext();
4740   return __pyx_r;
4741 }
4742 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_4size___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self)4743 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_4size___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self) {
4744   PyObject *__pyx_r = NULL;
4745   __Pyx_RefNannyDeclarations
4746   PyObject *__pyx_t_1 = NULL;
4747   int __pyx_lineno = 0;
4748   const char *__pyx_filename = NULL;
4749   int __pyx_clineno = 0;
4750   __Pyx_RefNannySetupContext("__get__", 0);
4751   __Pyx_XDECREF(__pyx_r);
4752   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error)
4753   __Pyx_GOTREF(__pyx_t_1);
4754   __pyx_r = __pyx_t_1;
4755   __pyx_t_1 = 0;
4756   goto __pyx_L0;
4757 
4758   /* function exit code */
4759   __pyx_L1_error:;
4760   __Pyx_XDECREF(__pyx_t_1);
4761   __Pyx_AddTraceback("bx.bbi.bbi_file.SummarizedData.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4762   __pyx_r = NULL;
4763   __pyx_L0:;
4764   __Pyx_XGIVEREF(__pyx_r);
4765   __Pyx_RefNannyFinishContext();
4766   return __pyx_r;
4767 }
4768 
4769 /* Python wrapper */
4770 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_4size_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)4771 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4772   int __pyx_r;
4773   __Pyx_RefNannyDeclarations
4774   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4775   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_4size_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4776 
4777   /* function exit code */
4778   __Pyx_RefNannyFinishContext();
4779   return __pyx_r;
4780 }
4781 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_4size_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self,PyObject * __pyx_v_value)4782 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_4size_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v_value) {
4783   int __pyx_r;
4784   __Pyx_RefNannyDeclarations
4785   int __pyx_t_1;
4786   int __pyx_lineno = 0;
4787   const char *__pyx_filename = NULL;
4788   int __pyx_clineno = 0;
4789   __Pyx_RefNannySetupContext("__set__", 0);
4790   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 28, __pyx_L1_error)
4791   __pyx_v_self->size = __pyx_t_1;
4792 
4793   /* function exit code */
4794   __pyx_r = 0;
4795   goto __pyx_L0;
4796   __pyx_L1_error:;
4797   __Pyx_AddTraceback("bx.bbi.bbi_file.SummarizedData.size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4798   __pyx_r = -1;
4799   __pyx_L0:;
4800   __Pyx_RefNannyFinishContext();
4801   return __pyx_r;
4802 }
4803 
4804 /* "bx/bbi/bbi_file.pxd":29
4805  *     cdef public bits32 end
4806  *     cdef public int size
4807  *     cdef public numpy.ndarray valid_count             # <<<<<<<<<<<<<<
4808  *     cdef public numpy.ndarray min_val
4809  *     cdef public numpy.ndarray max_val
4810  */
4811 
4812 /* Python wrapper */
4813 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_1__get__(PyObject * __pyx_v_self)4814 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_1__get__(PyObject *__pyx_v_self) {
4815   PyObject *__pyx_r = 0;
4816   __Pyx_RefNannyDeclarations
4817   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4818   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self));
4819 
4820   /* function exit code */
4821   __Pyx_RefNannyFinishContext();
4822   return __pyx_r;
4823 }
4824 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self)4825 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self) {
4826   PyObject *__pyx_r = NULL;
4827   __Pyx_RefNannyDeclarations
4828   __Pyx_RefNannySetupContext("__get__", 0);
4829   __Pyx_XDECREF(__pyx_r);
4830   __Pyx_INCREF(((PyObject *)__pyx_v_self->valid_count));
4831   __pyx_r = ((PyObject *)__pyx_v_self->valid_count);
4832   goto __pyx_L0;
4833 
4834   /* function exit code */
4835   __pyx_L0:;
4836   __Pyx_XGIVEREF(__pyx_r);
4837   __Pyx_RefNannyFinishContext();
4838   return __pyx_r;
4839 }
4840 
4841 /* Python wrapper */
4842 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)4843 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4844   int __pyx_r;
4845   __Pyx_RefNannyDeclarations
4846   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4847   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4848 
4849   /* function exit code */
4850   __Pyx_RefNannyFinishContext();
4851   return __pyx_r;
4852 }
4853 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self,PyObject * __pyx_v_value)4854 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v_value) {
4855   int __pyx_r;
4856   __Pyx_RefNannyDeclarations
4857   PyObject *__pyx_t_1 = NULL;
4858   int __pyx_lineno = 0;
4859   const char *__pyx_filename = NULL;
4860   int __pyx_clineno = 0;
4861   __Pyx_RefNannySetupContext("__set__", 0);
4862   if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 29, __pyx_L1_error)
4863   __pyx_t_1 = __pyx_v_value;
4864   __Pyx_INCREF(__pyx_t_1);
4865   __Pyx_GIVEREF(__pyx_t_1);
4866   __Pyx_GOTREF(__pyx_v_self->valid_count);
4867   __Pyx_DECREF(((PyObject *)__pyx_v_self->valid_count));
4868   __pyx_v_self->valid_count = ((PyArrayObject *)__pyx_t_1);
4869   __pyx_t_1 = 0;
4870 
4871   /* function exit code */
4872   __pyx_r = 0;
4873   goto __pyx_L0;
4874   __pyx_L1_error:;
4875   __Pyx_XDECREF(__pyx_t_1);
4876   __Pyx_AddTraceback("bx.bbi.bbi_file.SummarizedData.valid_count.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4877   __pyx_r = -1;
4878   __pyx_L0:;
4879   __Pyx_RefNannyFinishContext();
4880   return __pyx_r;
4881 }
4882 
4883 /* Python wrapper */
4884 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_5__del__(PyObject * __pyx_v_self)4885 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_5__del__(PyObject *__pyx_v_self) {
4886   int __pyx_r;
4887   __Pyx_RefNannyDeclarations
4888   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
4889   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_4__del__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self));
4890 
4891   /* function exit code */
4892   __Pyx_RefNannyFinishContext();
4893   return __pyx_r;
4894 }
4895 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self)4896 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self) {
4897   int __pyx_r;
4898   __Pyx_RefNannyDeclarations
4899   __Pyx_RefNannySetupContext("__del__", 0);
4900   __Pyx_INCREF(Py_None);
4901   __Pyx_GIVEREF(Py_None);
4902   __Pyx_GOTREF(__pyx_v_self->valid_count);
4903   __Pyx_DECREF(((PyObject *)__pyx_v_self->valid_count));
4904   __pyx_v_self->valid_count = ((PyArrayObject *)Py_None);
4905 
4906   /* function exit code */
4907   __pyx_r = 0;
4908   __Pyx_RefNannyFinishContext();
4909   return __pyx_r;
4910 }
4911 
4912 /* "bx/bbi/bbi_file.pxd":30
4913  *     cdef public int size
4914  *     cdef public numpy.ndarray valid_count
4915  *     cdef public numpy.ndarray min_val             # <<<<<<<<<<<<<<
4916  *     cdef public numpy.ndarray max_val
4917  *     cdef public numpy.ndarray sum_data
4918  */
4919 
4920 /* Python wrapper */
4921 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_1__get__(PyObject * __pyx_v_self)4922 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_1__get__(PyObject *__pyx_v_self) {
4923   PyObject *__pyx_r = 0;
4924   __Pyx_RefNannyDeclarations
4925   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4926   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7min_val___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self));
4927 
4928   /* function exit code */
4929   __Pyx_RefNannyFinishContext();
4930   return __pyx_r;
4931 }
4932 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7min_val___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self)4933 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7min_val___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self) {
4934   PyObject *__pyx_r = NULL;
4935   __Pyx_RefNannyDeclarations
4936   __Pyx_RefNannySetupContext("__get__", 0);
4937   __Pyx_XDECREF(__pyx_r);
4938   __Pyx_INCREF(((PyObject *)__pyx_v_self->min_val));
4939   __pyx_r = ((PyObject *)__pyx_v_self->min_val);
4940   goto __pyx_L0;
4941 
4942   /* function exit code */
4943   __pyx_L0:;
4944   __Pyx_XGIVEREF(__pyx_r);
4945   __Pyx_RefNannyFinishContext();
4946   return __pyx_r;
4947 }
4948 
4949 /* Python wrapper */
4950 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)4951 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4952   int __pyx_r;
4953   __Pyx_RefNannyDeclarations
4954   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4955   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4956 
4957   /* function exit code */
4958   __Pyx_RefNannyFinishContext();
4959   return __pyx_r;
4960 }
4961 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self,PyObject * __pyx_v_value)4962 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v_value) {
4963   int __pyx_r;
4964   __Pyx_RefNannyDeclarations
4965   PyObject *__pyx_t_1 = NULL;
4966   int __pyx_lineno = 0;
4967   const char *__pyx_filename = NULL;
4968   int __pyx_clineno = 0;
4969   __Pyx_RefNannySetupContext("__set__", 0);
4970   if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 30, __pyx_L1_error)
4971   __pyx_t_1 = __pyx_v_value;
4972   __Pyx_INCREF(__pyx_t_1);
4973   __Pyx_GIVEREF(__pyx_t_1);
4974   __Pyx_GOTREF(__pyx_v_self->min_val);
4975   __Pyx_DECREF(((PyObject *)__pyx_v_self->min_val));
4976   __pyx_v_self->min_val = ((PyArrayObject *)__pyx_t_1);
4977   __pyx_t_1 = 0;
4978 
4979   /* function exit code */
4980   __pyx_r = 0;
4981   goto __pyx_L0;
4982   __pyx_L1_error:;
4983   __Pyx_XDECREF(__pyx_t_1);
4984   __Pyx_AddTraceback("bx.bbi.bbi_file.SummarizedData.min_val.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4985   __pyx_r = -1;
4986   __pyx_L0:;
4987   __Pyx_RefNannyFinishContext();
4988   return __pyx_r;
4989 }
4990 
4991 /* Python wrapper */
4992 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_5__del__(PyObject * __pyx_v_self)4993 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_5__del__(PyObject *__pyx_v_self) {
4994   int __pyx_r;
4995   __Pyx_RefNannyDeclarations
4996   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
4997   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_4__del__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self));
4998 
4999   /* function exit code */
5000   __Pyx_RefNannyFinishContext();
5001   return __pyx_r;
5002 }
5003 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self)5004 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self) {
5005   int __pyx_r;
5006   __Pyx_RefNannyDeclarations
5007   __Pyx_RefNannySetupContext("__del__", 0);
5008   __Pyx_INCREF(Py_None);
5009   __Pyx_GIVEREF(Py_None);
5010   __Pyx_GOTREF(__pyx_v_self->min_val);
5011   __Pyx_DECREF(((PyObject *)__pyx_v_self->min_val));
5012   __pyx_v_self->min_val = ((PyArrayObject *)Py_None);
5013 
5014   /* function exit code */
5015   __pyx_r = 0;
5016   __Pyx_RefNannyFinishContext();
5017   return __pyx_r;
5018 }
5019 
5020 /* "bx/bbi/bbi_file.pxd":31
5021  *     cdef public numpy.ndarray valid_count
5022  *     cdef public numpy.ndarray min_val
5023  *     cdef public numpy.ndarray max_val             # <<<<<<<<<<<<<<
5024  *     cdef public numpy.ndarray sum_data
5025  *     cdef public numpy.ndarray sum_squares
5026  */
5027 
5028 /* Python wrapper */
5029 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_1__get__(PyObject * __pyx_v_self)5030 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_1__get__(PyObject *__pyx_v_self) {
5031   PyObject *__pyx_r = 0;
5032   __Pyx_RefNannyDeclarations
5033   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5034   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7max_val___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self));
5035 
5036   /* function exit code */
5037   __Pyx_RefNannyFinishContext();
5038   return __pyx_r;
5039 }
5040 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7max_val___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self)5041 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7max_val___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self) {
5042   PyObject *__pyx_r = NULL;
5043   __Pyx_RefNannyDeclarations
5044   __Pyx_RefNannySetupContext("__get__", 0);
5045   __Pyx_XDECREF(__pyx_r);
5046   __Pyx_INCREF(((PyObject *)__pyx_v_self->max_val));
5047   __pyx_r = ((PyObject *)__pyx_v_self->max_val);
5048   goto __pyx_L0;
5049 
5050   /* function exit code */
5051   __pyx_L0:;
5052   __Pyx_XGIVEREF(__pyx_r);
5053   __Pyx_RefNannyFinishContext();
5054   return __pyx_r;
5055 }
5056 
5057 /* Python wrapper */
5058 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)5059 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5060   int __pyx_r;
5061   __Pyx_RefNannyDeclarations
5062   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
5063   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self), ((PyObject *)__pyx_v_value));
5064 
5065   /* function exit code */
5066   __Pyx_RefNannyFinishContext();
5067   return __pyx_r;
5068 }
5069 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self,PyObject * __pyx_v_value)5070 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v_value) {
5071   int __pyx_r;
5072   __Pyx_RefNannyDeclarations
5073   PyObject *__pyx_t_1 = NULL;
5074   int __pyx_lineno = 0;
5075   const char *__pyx_filename = NULL;
5076   int __pyx_clineno = 0;
5077   __Pyx_RefNannySetupContext("__set__", 0);
5078   if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 31, __pyx_L1_error)
5079   __pyx_t_1 = __pyx_v_value;
5080   __Pyx_INCREF(__pyx_t_1);
5081   __Pyx_GIVEREF(__pyx_t_1);
5082   __Pyx_GOTREF(__pyx_v_self->max_val);
5083   __Pyx_DECREF(((PyObject *)__pyx_v_self->max_val));
5084   __pyx_v_self->max_val = ((PyArrayObject *)__pyx_t_1);
5085   __pyx_t_1 = 0;
5086 
5087   /* function exit code */
5088   __pyx_r = 0;
5089   goto __pyx_L0;
5090   __pyx_L1_error:;
5091   __Pyx_XDECREF(__pyx_t_1);
5092   __Pyx_AddTraceback("bx.bbi.bbi_file.SummarizedData.max_val.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5093   __pyx_r = -1;
5094   __pyx_L0:;
5095   __Pyx_RefNannyFinishContext();
5096   return __pyx_r;
5097 }
5098 
5099 /* Python wrapper */
5100 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_5__del__(PyObject * __pyx_v_self)5101 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_5__del__(PyObject *__pyx_v_self) {
5102   int __pyx_r;
5103   __Pyx_RefNannyDeclarations
5104   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
5105   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_4__del__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self));
5106 
5107   /* function exit code */
5108   __Pyx_RefNannyFinishContext();
5109   return __pyx_r;
5110 }
5111 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self)5112 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self) {
5113   int __pyx_r;
5114   __Pyx_RefNannyDeclarations
5115   __Pyx_RefNannySetupContext("__del__", 0);
5116   __Pyx_INCREF(Py_None);
5117   __Pyx_GIVEREF(Py_None);
5118   __Pyx_GOTREF(__pyx_v_self->max_val);
5119   __Pyx_DECREF(((PyObject *)__pyx_v_self->max_val));
5120   __pyx_v_self->max_val = ((PyArrayObject *)Py_None);
5121 
5122   /* function exit code */
5123   __pyx_r = 0;
5124   __Pyx_RefNannyFinishContext();
5125   return __pyx_r;
5126 }
5127 
5128 /* "bx/bbi/bbi_file.pxd":32
5129  *     cdef public numpy.ndarray min_val
5130  *     cdef public numpy.ndarray max_val
5131  *     cdef public numpy.ndarray sum_data             # <<<<<<<<<<<<<<
5132  *     cdef public numpy.ndarray sum_squares
5133  *
5134  */
5135 
5136 /* Python wrapper */
5137 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_1__get__(PyObject * __pyx_v_self)5138 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_1__get__(PyObject *__pyx_v_self) {
5139   PyObject *__pyx_r = 0;
5140   __Pyx_RefNannyDeclarations
5141   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5142   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self));
5143 
5144   /* function exit code */
5145   __Pyx_RefNannyFinishContext();
5146   return __pyx_r;
5147 }
5148 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self)5149 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self) {
5150   PyObject *__pyx_r = NULL;
5151   __Pyx_RefNannyDeclarations
5152   __Pyx_RefNannySetupContext("__get__", 0);
5153   __Pyx_XDECREF(__pyx_r);
5154   __Pyx_INCREF(((PyObject *)__pyx_v_self->sum_data));
5155   __pyx_r = ((PyObject *)__pyx_v_self->sum_data);
5156   goto __pyx_L0;
5157 
5158   /* function exit code */
5159   __pyx_L0:;
5160   __Pyx_XGIVEREF(__pyx_r);
5161   __Pyx_RefNannyFinishContext();
5162   return __pyx_r;
5163 }
5164 
5165 /* Python wrapper */
5166 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)5167 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5168   int __pyx_r;
5169   __Pyx_RefNannyDeclarations
5170   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
5171   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self), ((PyObject *)__pyx_v_value));
5172 
5173   /* function exit code */
5174   __Pyx_RefNannyFinishContext();
5175   return __pyx_r;
5176 }
5177 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self,PyObject * __pyx_v_value)5178 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v_value) {
5179   int __pyx_r;
5180   __Pyx_RefNannyDeclarations
5181   PyObject *__pyx_t_1 = NULL;
5182   int __pyx_lineno = 0;
5183   const char *__pyx_filename = NULL;
5184   int __pyx_clineno = 0;
5185   __Pyx_RefNannySetupContext("__set__", 0);
5186   if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 32, __pyx_L1_error)
5187   __pyx_t_1 = __pyx_v_value;
5188   __Pyx_INCREF(__pyx_t_1);
5189   __Pyx_GIVEREF(__pyx_t_1);
5190   __Pyx_GOTREF(__pyx_v_self->sum_data);
5191   __Pyx_DECREF(((PyObject *)__pyx_v_self->sum_data));
5192   __pyx_v_self->sum_data = ((PyArrayObject *)__pyx_t_1);
5193   __pyx_t_1 = 0;
5194 
5195   /* function exit code */
5196   __pyx_r = 0;
5197   goto __pyx_L0;
5198   __pyx_L1_error:;
5199   __Pyx_XDECREF(__pyx_t_1);
5200   __Pyx_AddTraceback("bx.bbi.bbi_file.SummarizedData.sum_data.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5201   __pyx_r = -1;
5202   __pyx_L0:;
5203   __Pyx_RefNannyFinishContext();
5204   return __pyx_r;
5205 }
5206 
5207 /* Python wrapper */
5208 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_5__del__(PyObject * __pyx_v_self)5209 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_5__del__(PyObject *__pyx_v_self) {
5210   int __pyx_r;
5211   __Pyx_RefNannyDeclarations
5212   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
5213   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_4__del__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self));
5214 
5215   /* function exit code */
5216   __Pyx_RefNannyFinishContext();
5217   return __pyx_r;
5218 }
5219 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self)5220 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self) {
5221   int __pyx_r;
5222   __Pyx_RefNannyDeclarations
5223   __Pyx_RefNannySetupContext("__del__", 0);
5224   __Pyx_INCREF(Py_None);
5225   __Pyx_GIVEREF(Py_None);
5226   __Pyx_GOTREF(__pyx_v_self->sum_data);
5227   __Pyx_DECREF(((PyObject *)__pyx_v_self->sum_data));
5228   __pyx_v_self->sum_data = ((PyArrayObject *)Py_None);
5229 
5230   /* function exit code */
5231   __pyx_r = 0;
5232   __Pyx_RefNannyFinishContext();
5233   return __pyx_r;
5234 }
5235 
5236 /* "bx/bbi/bbi_file.pxd":33
5237  *     cdef public numpy.ndarray max_val
5238  *     cdef public numpy.ndarray sum_data
5239  *     cdef public numpy.ndarray sum_squares             # <<<<<<<<<<<<<<
5240  *
5241  *     cdef accumulate_interval_value( self, bits32 s, bits32 e, float val )
5242  */
5243 
5244 /* Python wrapper */
5245 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_1__get__(PyObject * __pyx_v_self)5246 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_1__get__(PyObject *__pyx_v_self) {
5247   PyObject *__pyx_r = 0;
5248   __Pyx_RefNannyDeclarations
5249   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5250   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self));
5251 
5252   /* function exit code */
5253   __Pyx_RefNannyFinishContext();
5254   return __pyx_r;
5255 }
5256 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self)5257 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self) {
5258   PyObject *__pyx_r = NULL;
5259   __Pyx_RefNannyDeclarations
5260   __Pyx_RefNannySetupContext("__get__", 0);
5261   __Pyx_XDECREF(__pyx_r);
5262   __Pyx_INCREF(((PyObject *)__pyx_v_self->sum_squares));
5263   __pyx_r = ((PyObject *)__pyx_v_self->sum_squares);
5264   goto __pyx_L0;
5265 
5266   /* function exit code */
5267   __pyx_L0:;
5268   __Pyx_XGIVEREF(__pyx_r);
5269   __Pyx_RefNannyFinishContext();
5270   return __pyx_r;
5271 }
5272 
5273 /* Python wrapper */
5274 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)5275 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5276   int __pyx_r;
5277   __Pyx_RefNannyDeclarations
5278   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
5279   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self), ((PyObject *)__pyx_v_value));
5280 
5281   /* function exit code */
5282   __Pyx_RefNannyFinishContext();
5283   return __pyx_r;
5284 }
5285 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self,PyObject * __pyx_v_value)5286 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v_value) {
5287   int __pyx_r;
5288   __Pyx_RefNannyDeclarations
5289   PyObject *__pyx_t_1 = NULL;
5290   int __pyx_lineno = 0;
5291   const char *__pyx_filename = NULL;
5292   int __pyx_clineno = 0;
5293   __Pyx_RefNannySetupContext("__set__", 0);
5294   if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 33, __pyx_L1_error)
5295   __pyx_t_1 = __pyx_v_value;
5296   __Pyx_INCREF(__pyx_t_1);
5297   __Pyx_GIVEREF(__pyx_t_1);
5298   __Pyx_GOTREF(__pyx_v_self->sum_squares);
5299   __Pyx_DECREF(((PyObject *)__pyx_v_self->sum_squares));
5300   __pyx_v_self->sum_squares = ((PyArrayObject *)__pyx_t_1);
5301   __pyx_t_1 = 0;
5302 
5303   /* function exit code */
5304   __pyx_r = 0;
5305   goto __pyx_L0;
5306   __pyx_L1_error:;
5307   __Pyx_XDECREF(__pyx_t_1);
5308   __Pyx_AddTraceback("bx.bbi.bbi_file.SummarizedData.sum_squares.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5309   __pyx_r = -1;
5310   __pyx_L0:;
5311   __Pyx_RefNannyFinishContext();
5312   return __pyx_r;
5313 }
5314 
5315 /* Python wrapper */
5316 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_5__del__(PyObject * __pyx_v_self)5317 static int __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_5__del__(PyObject *__pyx_v_self) {
5318   int __pyx_r;
5319   __Pyx_RefNannyDeclarations
5320   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
5321   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_4__del__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self));
5322 
5323   /* function exit code */
5324   __Pyx_RefNannyFinishContext();
5325   return __pyx_r;
5326 }
5327 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self)5328 static int __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self) {
5329   int __pyx_r;
5330   __Pyx_RefNannyDeclarations
5331   __Pyx_RefNannySetupContext("__del__", 0);
5332   __Pyx_INCREF(Py_None);
5333   __Pyx_GIVEREF(Py_None);
5334   __Pyx_GOTREF(__pyx_v_self->sum_squares);
5335   __Pyx_DECREF(((PyObject *)__pyx_v_self->sum_squares));
5336   __pyx_v_self->sum_squares = ((PyArrayObject *)Py_None);
5337 
5338   /* function exit code */
5339   __pyx_r = 0;
5340   __Pyx_RefNannyFinishContext();
5341   return __pyx_r;
5342 }
5343 
5344 /* "(tree fragment)":1
5345  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
5346  *     cdef tuple state
5347  *     cdef object _dict
5348  */
5349 
5350 /* Python wrapper */
5351 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_3__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)5352 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5353   PyObject *__pyx_r = 0;
5354   __Pyx_RefNannyDeclarations
5355   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5356   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_2__reduce_cython__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self));
5357 
5358   /* function exit code */
5359   __Pyx_RefNannyFinishContext();
5360   return __pyx_r;
5361 }
5362 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_2__reduce_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self)5363 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_2__reduce_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self) {
5364   PyObject *__pyx_v_state = 0;
5365   PyObject *__pyx_v__dict = 0;
5366   int __pyx_v_use_setstate;
5367   PyObject *__pyx_r = NULL;
5368   __Pyx_RefNannyDeclarations
5369   PyObject *__pyx_t_1 = NULL;
5370   PyObject *__pyx_t_2 = NULL;
5371   PyObject *__pyx_t_3 = NULL;
5372   PyObject *__pyx_t_4 = NULL;
5373   int __pyx_t_5;
5374   int __pyx_t_6;
5375   int __pyx_t_7;
5376   int __pyx_lineno = 0;
5377   const char *__pyx_filename = NULL;
5378   int __pyx_clineno = 0;
5379   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5380 
5381   /* "(tree fragment)":5
5382  *     cdef object _dict
5383  *     cdef bint use_setstate
5384  *     state = (self.end, self.max_val, self.min_val, self.size, self.start, self.sum_data, self.sum_squares, self.valid_count)             # <<<<<<<<<<<<<<
5385  *     _dict = getattr(self, '__dict__', None)
5386  *     if _dict is not None:
5387  */
5388   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->end); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
5389   __Pyx_GOTREF(__pyx_t_1);
5390   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->size); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
5391   __Pyx_GOTREF(__pyx_t_2);
5392   __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->start); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
5393   __Pyx_GOTREF(__pyx_t_3);
5394   __pyx_t_4 = PyTuple_New(8); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
5395   __Pyx_GOTREF(__pyx_t_4);
5396   __Pyx_GIVEREF(__pyx_t_1);
5397   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5398   __Pyx_INCREF(((PyObject *)__pyx_v_self->max_val));
5399   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->max_val));
5400   PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self->max_val));
5401   __Pyx_INCREF(((PyObject *)__pyx_v_self->min_val));
5402   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->min_val));
5403   PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_self->min_val));
5404   __Pyx_GIVEREF(__pyx_t_2);
5405   PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_2);
5406   __Pyx_GIVEREF(__pyx_t_3);
5407   PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_3);
5408   __Pyx_INCREF(((PyObject *)__pyx_v_self->sum_data));
5409   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->sum_data));
5410   PyTuple_SET_ITEM(__pyx_t_4, 5, ((PyObject *)__pyx_v_self->sum_data));
5411   __Pyx_INCREF(((PyObject *)__pyx_v_self->sum_squares));
5412   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->sum_squares));
5413   PyTuple_SET_ITEM(__pyx_t_4, 6, ((PyObject *)__pyx_v_self->sum_squares));
5414   __Pyx_INCREF(((PyObject *)__pyx_v_self->valid_count));
5415   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->valid_count));
5416   PyTuple_SET_ITEM(__pyx_t_4, 7, ((PyObject *)__pyx_v_self->valid_count));
5417   __pyx_t_1 = 0;
5418   __pyx_t_2 = 0;
5419   __pyx_t_3 = 0;
5420   __pyx_v_state = ((PyObject*)__pyx_t_4);
5421   __pyx_t_4 = 0;
5422 
5423   /* "(tree fragment)":6
5424  *     cdef bint use_setstate
5425  *     state = (self.end, self.max_val, self.min_val, self.size, self.start, self.sum_data, self.sum_squares, self.valid_count)
5426  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
5427  *     if _dict is not None:
5428  *         state += (_dict,)
5429  */
5430   __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
5431   __Pyx_GOTREF(__pyx_t_4);
5432   __pyx_v__dict = __pyx_t_4;
5433   __pyx_t_4 = 0;
5434 
5435   /* "(tree fragment)":7
5436  *     state = (self.end, self.max_val, self.min_val, self.size, self.start, self.sum_data, self.sum_squares, self.valid_count)
5437  *     _dict = getattr(self, '__dict__', None)
5438  *     if _dict is not None:             # <<<<<<<<<<<<<<
5439  *         state += (_dict,)
5440  *         use_setstate = True
5441  */
5442   __pyx_t_5 = (__pyx_v__dict != Py_None);
5443   __pyx_t_6 = (__pyx_t_5 != 0);
5444   if (__pyx_t_6) {
5445 
5446     /* "(tree fragment)":8
5447  *     _dict = getattr(self, '__dict__', None)
5448  *     if _dict is not None:
5449  *         state += (_dict,)             # <<<<<<<<<<<<<<
5450  *         use_setstate = True
5451  *     else:
5452  */
5453     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
5454     __Pyx_GOTREF(__pyx_t_4);
5455     __Pyx_INCREF(__pyx_v__dict);
5456     __Pyx_GIVEREF(__pyx_v__dict);
5457     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__dict);
5458     __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8, __pyx_L1_error)
5459     __Pyx_GOTREF(__pyx_t_3);
5460     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5461     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
5462     __pyx_t_3 = 0;
5463 
5464     /* "(tree fragment)":9
5465  *     if _dict is not None:
5466  *         state += (_dict,)
5467  *         use_setstate = True             # <<<<<<<<<<<<<<
5468  *     else:
5469  *         use_setstate = self.max_val is not None or self.min_val is not None or self.sum_data is not None or self.sum_squares is not None or self.valid_count is not None
5470  */
5471     __pyx_v_use_setstate = 1;
5472 
5473     /* "(tree fragment)":7
5474  *     state = (self.end, self.max_val, self.min_val, self.size, self.start, self.sum_data, self.sum_squares, self.valid_count)
5475  *     _dict = getattr(self, '__dict__', None)
5476  *     if _dict is not None:             # <<<<<<<<<<<<<<
5477  *         state += (_dict,)
5478  *         use_setstate = True
5479  */
5480     goto __pyx_L3;
5481   }
5482 
5483   /* "(tree fragment)":11
5484  *         use_setstate = True
5485  *     else:
5486  *         use_setstate = self.max_val is not None or self.min_val is not None or self.sum_data is not None or self.sum_squares is not None or self.valid_count is not None             # <<<<<<<<<<<<<<
5487  *     if use_setstate:
5488  *         return __pyx_unpickle_SummarizedData, (type(self), 0xf78375f, None), state
5489  */
5490   /*else*/ {
5491     __pyx_t_5 = (((PyObject *)__pyx_v_self->max_val) != Py_None);
5492     __pyx_t_7 = (__pyx_t_5 != 0);
5493     if (!__pyx_t_7) {
5494     } else {
5495       __pyx_t_6 = __pyx_t_7;
5496       goto __pyx_L4_bool_binop_done;
5497     }
5498     __pyx_t_7 = (((PyObject *)__pyx_v_self->min_val) != Py_None);
5499     __pyx_t_5 = (__pyx_t_7 != 0);
5500     if (!__pyx_t_5) {
5501     } else {
5502       __pyx_t_6 = __pyx_t_5;
5503       goto __pyx_L4_bool_binop_done;
5504     }
5505     __pyx_t_5 = (((PyObject *)__pyx_v_self->sum_data) != Py_None);
5506     __pyx_t_7 = (__pyx_t_5 != 0);
5507     if (!__pyx_t_7) {
5508     } else {
5509       __pyx_t_6 = __pyx_t_7;
5510       goto __pyx_L4_bool_binop_done;
5511     }
5512     __pyx_t_7 = (((PyObject *)__pyx_v_self->sum_squares) != Py_None);
5513     __pyx_t_5 = (__pyx_t_7 != 0);
5514     if (!__pyx_t_5) {
5515     } else {
5516       __pyx_t_6 = __pyx_t_5;
5517       goto __pyx_L4_bool_binop_done;
5518     }
5519     __pyx_t_5 = (((PyObject *)__pyx_v_self->valid_count) != Py_None);
5520     __pyx_t_7 = (__pyx_t_5 != 0);
5521     __pyx_t_6 = __pyx_t_7;
5522     __pyx_L4_bool_binop_done:;
5523     __pyx_v_use_setstate = __pyx_t_6;
5524   }
5525   __pyx_L3:;
5526 
5527   /* "(tree fragment)":12
5528  *     else:
5529  *         use_setstate = self.max_val is not None or self.min_val is not None or self.sum_data is not None or self.sum_squares is not None or self.valid_count is not None
5530  *     if use_setstate:             # <<<<<<<<<<<<<<
5531  *         return __pyx_unpickle_SummarizedData, (type(self), 0xf78375f, None), state
5532  *     else:
5533  */
5534   __pyx_t_6 = (__pyx_v_use_setstate != 0);
5535   if (__pyx_t_6) {
5536 
5537     /* "(tree fragment)":13
5538  *         use_setstate = self.max_val is not None or self.min_val is not None or self.sum_data is not None or self.sum_squares is not None or self.valid_count is not None
5539  *     if use_setstate:
5540  *         return __pyx_unpickle_SummarizedData, (type(self), 0xf78375f, None), state             # <<<<<<<<<<<<<<
5541  *     else:
5542  *         return __pyx_unpickle_SummarizedData, (type(self), 0xf78375f, state)
5543  */
5544     __Pyx_XDECREF(__pyx_r);
5545     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_SummarizedData); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error)
5546     __Pyx_GOTREF(__pyx_t_3);
5547     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
5548     __Pyx_GOTREF(__pyx_t_4);
5549     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5550     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5551     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5552     __Pyx_INCREF(__pyx_int_259536735);
5553     __Pyx_GIVEREF(__pyx_int_259536735);
5554     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_259536735);
5555     __Pyx_INCREF(Py_None);
5556     __Pyx_GIVEREF(Py_None);
5557     PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None);
5558     __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 13, __pyx_L1_error)
5559     __Pyx_GOTREF(__pyx_t_2);
5560     __Pyx_GIVEREF(__pyx_t_3);
5561     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
5562     __Pyx_GIVEREF(__pyx_t_4);
5563     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
5564     __Pyx_INCREF(__pyx_v_state);
5565     __Pyx_GIVEREF(__pyx_v_state);
5566     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);
5567     __pyx_t_3 = 0;
5568     __pyx_t_4 = 0;
5569     __pyx_r = __pyx_t_2;
5570     __pyx_t_2 = 0;
5571     goto __pyx_L0;
5572 
5573     /* "(tree fragment)":12
5574  *     else:
5575  *         use_setstate = self.max_val is not None or self.min_val is not None or self.sum_data is not None or self.sum_squares is not None or self.valid_count is not None
5576  *     if use_setstate:             # <<<<<<<<<<<<<<
5577  *         return __pyx_unpickle_SummarizedData, (type(self), 0xf78375f, None), state
5578  *     else:
5579  */
5580   }
5581 
5582   /* "(tree fragment)":15
5583  *         return __pyx_unpickle_SummarizedData, (type(self), 0xf78375f, None), state
5584  *     else:
5585  *         return __pyx_unpickle_SummarizedData, (type(self), 0xf78375f, state)             # <<<<<<<<<<<<<<
5586  * def __setstate_cython__(self, __pyx_state):
5587  *     __pyx_unpickle_SummarizedData__set_state(self, __pyx_state)
5588  */
5589   /*else*/ {
5590     __Pyx_XDECREF(__pyx_r);
5591     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_SummarizedData); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 15, __pyx_L1_error)
5592     __Pyx_GOTREF(__pyx_t_2);
5593     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
5594     __Pyx_GOTREF(__pyx_t_4);
5595     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5596     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5597     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5598     __Pyx_INCREF(__pyx_int_259536735);
5599     __Pyx_GIVEREF(__pyx_int_259536735);
5600     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_259536735);
5601     __Pyx_INCREF(__pyx_v_state);
5602     __Pyx_GIVEREF(__pyx_v_state);
5603     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state);
5604     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error)
5605     __Pyx_GOTREF(__pyx_t_3);
5606     __Pyx_GIVEREF(__pyx_t_2);
5607     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
5608     __Pyx_GIVEREF(__pyx_t_4);
5609     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
5610     __pyx_t_2 = 0;
5611     __pyx_t_4 = 0;
5612     __pyx_r = __pyx_t_3;
5613     __pyx_t_3 = 0;
5614     goto __pyx_L0;
5615   }
5616 
5617   /* "(tree fragment)":1
5618  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
5619  *     cdef tuple state
5620  *     cdef object _dict
5621  */
5622 
5623   /* function exit code */
5624   __pyx_L1_error:;
5625   __Pyx_XDECREF(__pyx_t_1);
5626   __Pyx_XDECREF(__pyx_t_2);
5627   __Pyx_XDECREF(__pyx_t_3);
5628   __Pyx_XDECREF(__pyx_t_4);
5629   __Pyx_AddTraceback("bx.bbi.bbi_file.SummarizedData.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5630   __pyx_r = NULL;
5631   __pyx_L0:;
5632   __Pyx_XDECREF(__pyx_v_state);
5633   __Pyx_XDECREF(__pyx_v__dict);
5634   __Pyx_XGIVEREF(__pyx_r);
5635   __Pyx_RefNannyFinishContext();
5636   return __pyx_r;
5637 }
5638 
5639 /* "(tree fragment)":16
5640  *     else:
5641  *         return __pyx_unpickle_SummarizedData, (type(self), 0xf78375f, state)
5642  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
5643  *     __pyx_unpickle_SummarizedData__set_state(self, __pyx_state)
5644  */
5645 
5646 /* Python wrapper */
5647 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_5__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)5648 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5649   PyObject *__pyx_r = 0;
5650   __Pyx_RefNannyDeclarations
5651   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5652   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_4__setstate_cython__(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5653 
5654   /* function exit code */
5655   __Pyx_RefNannyFinishContext();
5656   return __pyx_r;
5657 }
5658 
__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_4__setstate_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v_self,PyObject * __pyx_v___pyx_state)5659 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_14SummarizedData_4__setstate_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5660   PyObject *__pyx_r = NULL;
5661   __Pyx_RefNannyDeclarations
5662   PyObject *__pyx_t_1 = NULL;
5663   int __pyx_lineno = 0;
5664   const char *__pyx_filename = NULL;
5665   int __pyx_clineno = 0;
5666   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5667 
5668   /* "(tree fragment)":17
5669  *         return __pyx_unpickle_SummarizedData, (type(self), 0xf78375f, state)
5670  * def __setstate_cython__(self, __pyx_state):
5671  *     __pyx_unpickle_SummarizedData__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
5672  */
5673   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(2, 17, __pyx_L1_error)
5674   __pyx_t_1 = __pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_SummarizedData__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
5675   __Pyx_GOTREF(__pyx_t_1);
5676   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5677 
5678   /* "(tree fragment)":16
5679  *     else:
5680  *         return __pyx_unpickle_SummarizedData, (type(self), 0xf78375f, state)
5681  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
5682  *     __pyx_unpickle_SummarizedData__set_state(self, __pyx_state)
5683  */
5684 
5685   /* function exit code */
5686   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5687   goto __pyx_L0;
5688   __pyx_L1_error:;
5689   __Pyx_XDECREF(__pyx_t_1);
5690   __Pyx_AddTraceback("bx.bbi.bbi_file.SummarizedData.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5691   __pyx_r = NULL;
5692   __pyx_L0:;
5693   __Pyx_XGIVEREF(__pyx_r);
5694   __Pyx_RefNannyFinishContext();
5695   return __pyx_r;
5696 }
5697 
5698 /* "bx/bbi/bbi_file.pyx":113
5699  *     Callback for `BBIFile.visit_blocks_in_region`
5700  *     """
5701  *     cdef handle_block( self, bytes block_data, BBIFile bbi_file ):             # <<<<<<<<<<<<<<
5702  *         pass
5703  *
5704  */
5705 
__pyx_f_2bx_3bbi_8bbi_file_12BlockHandler_handle_block(CYTHON_UNUSED struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v_block_data,CYTHON_UNUSED struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_bbi_file)5706 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_12BlockHandler_handle_block(CYTHON_UNUSED struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_block_data, CYTHON_UNUSED struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_bbi_file) {
5707   PyObject *__pyx_r = NULL;
5708   __Pyx_RefNannyDeclarations
5709   __Pyx_RefNannySetupContext("handle_block", 0);
5710 
5711   /* function exit code */
5712   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5713   __Pyx_XGIVEREF(__pyx_r);
5714   __Pyx_RefNannyFinishContext();
5715   return __pyx_r;
5716 }
5717 
5718 /* "(tree fragment)":1
5719  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
5720  *     cdef tuple state
5721  *     cdef object _dict
5722  */
5723 
5724 /* Python wrapper */
5725 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12BlockHandler_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12BlockHandler_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)5726 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12BlockHandler_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5727   PyObject *__pyx_r = 0;
5728   __Pyx_RefNannyDeclarations
5729   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5730   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12BlockHandler___reduce_cython__(((struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *)__pyx_v_self));
5731 
5732   /* function exit code */
5733   __Pyx_RefNannyFinishContext();
5734   return __pyx_r;
5735 }
5736 
__pyx_pf_2bx_3bbi_8bbi_file_12BlockHandler___reduce_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler * __pyx_v_self)5737 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12BlockHandler___reduce_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *__pyx_v_self) {
5738   PyObject *__pyx_v_state = 0;
5739   PyObject *__pyx_v__dict = 0;
5740   int __pyx_v_use_setstate;
5741   PyObject *__pyx_r = NULL;
5742   __Pyx_RefNannyDeclarations
5743   PyObject *__pyx_t_1 = NULL;
5744   int __pyx_t_2;
5745   int __pyx_t_3;
5746   PyObject *__pyx_t_4 = NULL;
5747   PyObject *__pyx_t_5 = NULL;
5748   int __pyx_lineno = 0;
5749   const char *__pyx_filename = NULL;
5750   int __pyx_clineno = 0;
5751   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5752 
5753   /* "(tree fragment)":5
5754  *     cdef object _dict
5755  *     cdef bint use_setstate
5756  *     state = ()             # <<<<<<<<<<<<<<
5757  *     _dict = getattr(self, '__dict__', None)
5758  *     if _dict is not None:
5759  */
5760   __Pyx_INCREF(__pyx_empty_tuple);
5761   __pyx_v_state = __pyx_empty_tuple;
5762 
5763   /* "(tree fragment)":6
5764  *     cdef bint use_setstate
5765  *     state = ()
5766  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
5767  *     if _dict is not None:
5768  *         state += (_dict,)
5769  */
5770   __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
5771   __Pyx_GOTREF(__pyx_t_1);
5772   __pyx_v__dict = __pyx_t_1;
5773   __pyx_t_1 = 0;
5774 
5775   /* "(tree fragment)":7
5776  *     state = ()
5777  *     _dict = getattr(self, '__dict__', None)
5778  *     if _dict is not None:             # <<<<<<<<<<<<<<
5779  *         state += (_dict,)
5780  *         use_setstate = True
5781  */
5782   __pyx_t_2 = (__pyx_v__dict != Py_None);
5783   __pyx_t_3 = (__pyx_t_2 != 0);
5784   if (__pyx_t_3) {
5785 
5786     /* "(tree fragment)":8
5787  *     _dict = getattr(self, '__dict__', None)
5788  *     if _dict is not None:
5789  *         state += (_dict,)             # <<<<<<<<<<<<<<
5790  *         use_setstate = True
5791  *     else:
5792  */
5793     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
5794     __Pyx_GOTREF(__pyx_t_1);
5795     __Pyx_INCREF(__pyx_v__dict);
5796     __Pyx_GIVEREF(__pyx_v__dict);
5797     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
5798     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
5799     __Pyx_GOTREF(__pyx_t_4);
5800     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5801     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
5802     __pyx_t_4 = 0;
5803 
5804     /* "(tree fragment)":9
5805  *     if _dict is not None:
5806  *         state += (_dict,)
5807  *         use_setstate = True             # <<<<<<<<<<<<<<
5808  *     else:
5809  *         use_setstate = False
5810  */
5811     __pyx_v_use_setstate = 1;
5812 
5813     /* "(tree fragment)":7
5814  *     state = ()
5815  *     _dict = getattr(self, '__dict__', None)
5816  *     if _dict is not None:             # <<<<<<<<<<<<<<
5817  *         state += (_dict,)
5818  *         use_setstate = True
5819  */
5820     goto __pyx_L3;
5821   }
5822 
5823   /* "(tree fragment)":11
5824  *         use_setstate = True
5825  *     else:
5826  *         use_setstate = False             # <<<<<<<<<<<<<<
5827  *     if use_setstate:
5828  *         return __pyx_unpickle_BlockHandler, (type(self), 0xd41d8cd, None), state
5829  */
5830   /*else*/ {
5831     __pyx_v_use_setstate = 0;
5832   }
5833   __pyx_L3:;
5834 
5835   /* "(tree fragment)":12
5836  *     else:
5837  *         use_setstate = False
5838  *     if use_setstate:             # <<<<<<<<<<<<<<
5839  *         return __pyx_unpickle_BlockHandler, (type(self), 0xd41d8cd, None), state
5840  *     else:
5841  */
5842   __pyx_t_3 = (__pyx_v_use_setstate != 0);
5843   if (__pyx_t_3) {
5844 
5845     /* "(tree fragment)":13
5846  *         use_setstate = False
5847  *     if use_setstate:
5848  *         return __pyx_unpickle_BlockHandler, (type(self), 0xd41d8cd, None), state             # <<<<<<<<<<<<<<
5849  *     else:
5850  *         return __pyx_unpickle_BlockHandler, (type(self), 0xd41d8cd, state)
5851  */
5852     __Pyx_XDECREF(__pyx_r);
5853     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_BlockHandler); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
5854     __Pyx_GOTREF(__pyx_t_4);
5855     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
5856     __Pyx_GOTREF(__pyx_t_1);
5857     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5858     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5859     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5860     __Pyx_INCREF(__pyx_int_222419149);
5861     __Pyx_GIVEREF(__pyx_int_222419149);
5862     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149);
5863     __Pyx_INCREF(Py_None);
5864     __Pyx_GIVEREF(Py_None);
5865     PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
5866     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
5867     __Pyx_GOTREF(__pyx_t_5);
5868     __Pyx_GIVEREF(__pyx_t_4);
5869     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
5870     __Pyx_GIVEREF(__pyx_t_1);
5871     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
5872     __Pyx_INCREF(__pyx_v_state);
5873     __Pyx_GIVEREF(__pyx_v_state);
5874     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
5875     __pyx_t_4 = 0;
5876     __pyx_t_1 = 0;
5877     __pyx_r = __pyx_t_5;
5878     __pyx_t_5 = 0;
5879     goto __pyx_L0;
5880 
5881     /* "(tree fragment)":12
5882  *     else:
5883  *         use_setstate = False
5884  *     if use_setstate:             # <<<<<<<<<<<<<<
5885  *         return __pyx_unpickle_BlockHandler, (type(self), 0xd41d8cd, None), state
5886  *     else:
5887  */
5888   }
5889 
5890   /* "(tree fragment)":15
5891  *         return __pyx_unpickle_BlockHandler, (type(self), 0xd41d8cd, None), state
5892  *     else:
5893  *         return __pyx_unpickle_BlockHandler, (type(self), 0xd41d8cd, state)             # <<<<<<<<<<<<<<
5894  * def __setstate_cython__(self, __pyx_state):
5895  *     __pyx_unpickle_BlockHandler__set_state(self, __pyx_state)
5896  */
5897   /*else*/ {
5898     __Pyx_XDECREF(__pyx_r);
5899     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_BlockHandler); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
5900     __Pyx_GOTREF(__pyx_t_5);
5901     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
5902     __Pyx_GOTREF(__pyx_t_1);
5903     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5904     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5905     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
5906     __Pyx_INCREF(__pyx_int_222419149);
5907     __Pyx_GIVEREF(__pyx_int_222419149);
5908     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149);
5909     __Pyx_INCREF(__pyx_v_state);
5910     __Pyx_GIVEREF(__pyx_v_state);
5911     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
5912     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
5913     __Pyx_GOTREF(__pyx_t_4);
5914     __Pyx_GIVEREF(__pyx_t_5);
5915     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5916     __Pyx_GIVEREF(__pyx_t_1);
5917     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
5918     __pyx_t_5 = 0;
5919     __pyx_t_1 = 0;
5920     __pyx_r = __pyx_t_4;
5921     __pyx_t_4 = 0;
5922     goto __pyx_L0;
5923   }
5924 
5925   /* "(tree fragment)":1
5926  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
5927  *     cdef tuple state
5928  *     cdef object _dict
5929  */
5930 
5931   /* function exit code */
5932   __pyx_L1_error:;
5933   __Pyx_XDECREF(__pyx_t_1);
5934   __Pyx_XDECREF(__pyx_t_4);
5935   __Pyx_XDECREF(__pyx_t_5);
5936   __Pyx_AddTraceback("bx.bbi.bbi_file.BlockHandler.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5937   __pyx_r = NULL;
5938   __pyx_L0:;
5939   __Pyx_XDECREF(__pyx_v_state);
5940   __Pyx_XDECREF(__pyx_v__dict);
5941   __Pyx_XGIVEREF(__pyx_r);
5942   __Pyx_RefNannyFinishContext();
5943   return __pyx_r;
5944 }
5945 
5946 /* "(tree fragment)":16
5947  *     else:
5948  *         return __pyx_unpickle_BlockHandler, (type(self), 0xd41d8cd, state)
5949  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
5950  *     __pyx_unpickle_BlockHandler__set_state(self, __pyx_state)
5951  */
5952 
5953 /* Python wrapper */
5954 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12BlockHandler_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_12BlockHandler_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)5955 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_12BlockHandler_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5956   PyObject *__pyx_r = 0;
5957   __Pyx_RefNannyDeclarations
5958   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5959   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_12BlockHandler_2__setstate_cython__(((struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5960 
5961   /* function exit code */
5962   __Pyx_RefNannyFinishContext();
5963   return __pyx_r;
5964 }
5965 
__pyx_pf_2bx_3bbi_8bbi_file_12BlockHandler_2__setstate_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler * __pyx_v_self,PyObject * __pyx_v___pyx_state)5966 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_12BlockHandler_2__setstate_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5967   PyObject *__pyx_r = NULL;
5968   __Pyx_RefNannyDeclarations
5969   PyObject *__pyx_t_1 = NULL;
5970   int __pyx_lineno = 0;
5971   const char *__pyx_filename = NULL;
5972   int __pyx_clineno = 0;
5973   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5974 
5975   /* "(tree fragment)":17
5976  *         return __pyx_unpickle_BlockHandler, (type(self), 0xd41d8cd, state)
5977  * def __setstate_cython__(self, __pyx_state):
5978  *     __pyx_unpickle_BlockHandler__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
5979  */
5980   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(2, 17, __pyx_L1_error)
5981   __pyx_t_1 = __pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_BlockHandler__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
5982   __Pyx_GOTREF(__pyx_t_1);
5983   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5984 
5985   /* "(tree fragment)":16
5986  *     else:
5987  *         return __pyx_unpickle_BlockHandler, (type(self), 0xd41d8cd, state)
5988  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
5989  *     __pyx_unpickle_BlockHandler__set_state(self, __pyx_state)
5990  */
5991 
5992   /* function exit code */
5993   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5994   goto __pyx_L0;
5995   __pyx_L1_error:;
5996   __Pyx_XDECREF(__pyx_t_1);
5997   __Pyx_AddTraceback("bx.bbi.bbi_file.BlockHandler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5998   __pyx_r = NULL;
5999   __pyx_L0:;
6000   __Pyx_XGIVEREF(__pyx_r);
6001   __Pyx_RefNannyFinishContext();
6002   return __pyx_r;
6003 }
6004 
6005 /* "bx/bbi/bbi_file.pyx":123
6006  *     """
6007  *
6008  *     def __init__( self, file=None, expected_sig=None, type_name=None ):             # <<<<<<<<<<<<<<
6009  *         if file is not None:
6010  *             self.open( file, expected_sig, type_name )
6011  */
6012 
6013 /* Python wrapper */
6014 static int __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6015 static int __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6016   PyObject *__pyx_v_file = 0;
6017   PyObject *__pyx_v_expected_sig = 0;
6018   PyObject *__pyx_v_type_name = 0;
6019   int __pyx_lineno = 0;
6020   const char *__pyx_filename = NULL;
6021   int __pyx_clineno = 0;
6022   int __pyx_r;
6023   __Pyx_RefNannyDeclarations
6024   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
6025   {
6026     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file,&__pyx_n_s_expected_sig,&__pyx_n_s_type_name,0};
6027     PyObject* values[3] = {0,0,0};
6028     values[0] = ((PyObject *)Py_None);
6029     values[1] = ((PyObject *)Py_None);
6030     values[2] = ((PyObject *)Py_None);
6031     if (unlikely(__pyx_kwds)) {
6032       Py_ssize_t kw_args;
6033       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6034       switch (pos_args) {
6035         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6036         CYTHON_FALLTHROUGH;
6037         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6038         CYTHON_FALLTHROUGH;
6039         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6040         CYTHON_FALLTHROUGH;
6041         case  0: break;
6042         default: goto __pyx_L5_argtuple_error;
6043       }
6044       kw_args = PyDict_Size(__pyx_kwds);
6045       switch (pos_args) {
6046         case  0:
6047         if (kw_args > 0) {
6048           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_file);
6049           if (value) { values[0] = value; kw_args--; }
6050         }
6051         CYTHON_FALLTHROUGH;
6052         case  1:
6053         if (kw_args > 0) {
6054           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_expected_sig);
6055           if (value) { values[1] = value; kw_args--; }
6056         }
6057         CYTHON_FALLTHROUGH;
6058         case  2:
6059         if (kw_args > 0) {
6060           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_name);
6061           if (value) { values[2] = value; kw_args--; }
6062         }
6063       }
6064       if (unlikely(kw_args > 0)) {
6065         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 123, __pyx_L3_error)
6066       }
6067     } else {
6068       switch (PyTuple_GET_SIZE(__pyx_args)) {
6069         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6070         CYTHON_FALLTHROUGH;
6071         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6072         CYTHON_FALLTHROUGH;
6073         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6074         CYTHON_FALLTHROUGH;
6075         case  0: break;
6076         default: goto __pyx_L5_argtuple_error;
6077       }
6078     }
6079     __pyx_v_file = values[0];
6080     __pyx_v_expected_sig = values[1];
6081     __pyx_v_type_name = values[2];
6082   }
6083   goto __pyx_L4_argument_unpacking_done;
6084   __pyx_L5_argtuple_error:;
6085   __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 123, __pyx_L3_error)
6086   __pyx_L3_error:;
6087   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6088   __Pyx_RefNannyFinishContext();
6089   return -1;
6090   __pyx_L4_argument_unpacking_done:;
6091   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile___init__(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self), __pyx_v_file, __pyx_v_expected_sig, __pyx_v_type_name);
6092 
6093   /* function exit code */
6094   __Pyx_RefNannyFinishContext();
6095   return __pyx_r;
6096 }
6097 
__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile___init__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self,PyObject * __pyx_v_file,PyObject * __pyx_v_expected_sig,PyObject * __pyx_v_type_name)6098 static int __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile___init__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_file, PyObject *__pyx_v_expected_sig, PyObject *__pyx_v_type_name) {
6099   int __pyx_r;
6100   __Pyx_RefNannyDeclarations
6101   int __pyx_t_1;
6102   int __pyx_t_2;
6103   PyObject *__pyx_t_3 = NULL;
6104   PyObject *__pyx_t_4 = NULL;
6105   PyObject *__pyx_t_5 = NULL;
6106   int __pyx_t_6;
6107   PyObject *__pyx_t_7 = NULL;
6108   int __pyx_lineno = 0;
6109   const char *__pyx_filename = NULL;
6110   int __pyx_clineno = 0;
6111   __Pyx_RefNannySetupContext("__init__", 0);
6112 
6113   /* "bx/bbi/bbi_file.pyx":124
6114  *
6115  *     def __init__( self, file=None, expected_sig=None, type_name=None ):
6116  *         if file is not None:             # <<<<<<<<<<<<<<
6117  *             self.open( file, expected_sig, type_name )
6118  *
6119  */
6120   __pyx_t_1 = (__pyx_v_file != Py_None);
6121   __pyx_t_2 = (__pyx_t_1 != 0);
6122   if (__pyx_t_2) {
6123 
6124     /* "bx/bbi/bbi_file.pyx":125
6125  *     def __init__( self, file=None, expected_sig=None, type_name=None ):
6126  *         if file is not None:
6127  *             self.open( file, expected_sig, type_name )             # <<<<<<<<<<<<<<
6128  *
6129  *     def open( self, file, expected_sig, type_name ):
6130  */
6131     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
6132     __Pyx_GOTREF(__pyx_t_4);
6133     __pyx_t_5 = NULL;
6134     __pyx_t_6 = 0;
6135     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
6136       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
6137       if (likely(__pyx_t_5)) {
6138         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
6139         __Pyx_INCREF(__pyx_t_5);
6140         __Pyx_INCREF(function);
6141         __Pyx_DECREF_SET(__pyx_t_4, function);
6142         __pyx_t_6 = 1;
6143       }
6144     }
6145     #if CYTHON_FAST_PYCALL
6146     if (PyFunction_Check(__pyx_t_4)) {
6147       PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_file, __pyx_v_expected_sig, __pyx_v_type_name};
6148       __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
6149       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6150       __Pyx_GOTREF(__pyx_t_3);
6151     } else
6152     #endif
6153     #if CYTHON_FAST_PYCCALL
6154     if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
6155       PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_file, __pyx_v_expected_sig, __pyx_v_type_name};
6156       __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
6157       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6158       __Pyx_GOTREF(__pyx_t_3);
6159     } else
6160     #endif
6161     {
6162       __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error)
6163       __Pyx_GOTREF(__pyx_t_7);
6164       if (__pyx_t_5) {
6165         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
6166       }
6167       __Pyx_INCREF(__pyx_v_file);
6168       __Pyx_GIVEREF(__pyx_v_file);
6169       PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_file);
6170       __Pyx_INCREF(__pyx_v_expected_sig);
6171       __Pyx_GIVEREF(__pyx_v_expected_sig);
6172       PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_expected_sig);
6173       __Pyx_INCREF(__pyx_v_type_name);
6174       __Pyx_GIVEREF(__pyx_v_type_name);
6175       PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_type_name);
6176       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
6177       __Pyx_GOTREF(__pyx_t_3);
6178       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6179     }
6180     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6181     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6182 
6183     /* "bx/bbi/bbi_file.pyx":124
6184  *
6185  *     def __init__( self, file=None, expected_sig=None, type_name=None ):
6186  *         if file is not None:             # <<<<<<<<<<<<<<
6187  *             self.open( file, expected_sig, type_name )
6188  *
6189  */
6190   }
6191 
6192   /* "bx/bbi/bbi_file.pyx":123
6193  *     """
6194  *
6195  *     def __init__( self, file=None, expected_sig=None, type_name=None ):             # <<<<<<<<<<<<<<
6196  *         if file is not None:
6197  *             self.open( file, expected_sig, type_name )
6198  */
6199 
6200   /* function exit code */
6201   __pyx_r = 0;
6202   goto __pyx_L0;
6203   __pyx_L1_error:;
6204   __Pyx_XDECREF(__pyx_t_3);
6205   __Pyx_XDECREF(__pyx_t_4);
6206   __Pyx_XDECREF(__pyx_t_5);
6207   __Pyx_XDECREF(__pyx_t_7);
6208   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6209   __pyx_r = -1;
6210   __pyx_L0:;
6211   __Pyx_RefNannyFinishContext();
6212   return __pyx_r;
6213 }
6214 
6215 /* "bx/bbi/bbi_file.pyx":127
6216  *             self.open( file, expected_sig, type_name )
6217  *
6218  *     def open( self, file, expected_sig, type_name ):             # <<<<<<<<<<<<<<
6219  *         """
6220  *         Initialize from an existing bbi file, signature (magic) must be passed
6221  */
6222 
6223 /* Python wrapper */
6224 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_3open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6225 static char __pyx_doc_2bx_3bbi_8bbi_file_7BBIFile_2open[] = "\n        Initialize from an existing bbi file, signature (magic) must be passed\n        in since this is generic. \n        ";
__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_3open(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6226 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_3open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6227   PyObject *__pyx_v_file = 0;
6228   PyObject *__pyx_v_expected_sig = 0;
6229   CYTHON_UNUSED PyObject *__pyx_v_type_name = 0;
6230   int __pyx_lineno = 0;
6231   const char *__pyx_filename = NULL;
6232   int __pyx_clineno = 0;
6233   PyObject *__pyx_r = 0;
6234   __Pyx_RefNannyDeclarations
6235   __Pyx_RefNannySetupContext("open (wrapper)", 0);
6236   {
6237     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file,&__pyx_n_s_expected_sig,&__pyx_n_s_type_name,0};
6238     PyObject* values[3] = {0,0,0};
6239     if (unlikely(__pyx_kwds)) {
6240       Py_ssize_t kw_args;
6241       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6242       switch (pos_args) {
6243         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6244         CYTHON_FALLTHROUGH;
6245         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6246         CYTHON_FALLTHROUGH;
6247         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6248         CYTHON_FALLTHROUGH;
6249         case  0: break;
6250         default: goto __pyx_L5_argtuple_error;
6251       }
6252       kw_args = PyDict_Size(__pyx_kwds);
6253       switch (pos_args) {
6254         case  0:
6255         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_file)) != 0)) kw_args--;
6256         else goto __pyx_L5_argtuple_error;
6257         CYTHON_FALLTHROUGH;
6258         case  1:
6259         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_expected_sig)) != 0)) kw_args--;
6260         else {
6261           __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, 1); __PYX_ERR(0, 127, __pyx_L3_error)
6262         }
6263         CYTHON_FALLTHROUGH;
6264         case  2:
6265         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_name)) != 0)) kw_args--;
6266         else {
6267           __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, 2); __PYX_ERR(0, 127, __pyx_L3_error)
6268         }
6269       }
6270       if (unlikely(kw_args > 0)) {
6271         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open") < 0)) __PYX_ERR(0, 127, __pyx_L3_error)
6272       }
6273     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6274       goto __pyx_L5_argtuple_error;
6275     } else {
6276       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6277       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6278       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6279     }
6280     __pyx_v_file = values[0];
6281     __pyx_v_expected_sig = values[1];
6282     __pyx_v_type_name = values[2];
6283   }
6284   goto __pyx_L4_argument_unpacking_done;
6285   __pyx_L5_argtuple_error:;
6286   __Pyx_RaiseArgtupleInvalid("open", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 127, __pyx_L3_error)
6287   __pyx_L3_error:;
6288   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
6289   __Pyx_RefNannyFinishContext();
6290   return NULL;
6291   __pyx_L4_argument_unpacking_done:;
6292   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_2open(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self), __pyx_v_file, __pyx_v_expected_sig, __pyx_v_type_name);
6293 
6294   /* function exit code */
6295   __Pyx_RefNannyFinishContext();
6296   return __pyx_r;
6297 }
6298 
__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_2open(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self,PyObject * __pyx_v_file,PyObject * __pyx_v_expected_sig,CYTHON_UNUSED PyObject * __pyx_v_type_name)6299 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_2open(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_file, PyObject *__pyx_v_expected_sig, CYTHON_UNUSED PyObject *__pyx_v_type_name) {
6300   PyObject *__pyx_v_reader = NULL;
6301   CYTHON_UNUSED long __pyx_v_i;
6302   struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_level = NULL;
6303   PyObject *__pyx_r = NULL;
6304   __Pyx_RefNannyDeclarations
6305   int __pyx_t_1;
6306   PyObject *__pyx_t_2 = NULL;
6307   PyObject *__pyx_t_3 = NULL;
6308   PyObject *__pyx_t_4 = NULL;
6309   int __pyx_t_5;
6310   PyObject *__pyx_t_6 = NULL;
6311   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_7;
6312   __pyx_t_2bx_3bbi_5types_boolean __pyx_t_8;
6313   __pyx_t_2bx_3bbi_5types_bits16 __pyx_t_9;
6314   __pyx_t_2bx_3bbi_5types_bits64 __pyx_t_10;
6315   int __pyx_t_11;
6316   int __pyx_lineno = 0;
6317   const char *__pyx_filename = NULL;
6318   int __pyx_clineno = 0;
6319   __Pyx_RefNannySetupContext("open", 0);
6320 
6321   /* "bx/bbi/bbi_file.pyx":132
6322  *         in since this is generic.
6323  *         """
6324  *         assert expected_sig is not None             # <<<<<<<<<<<<<<
6325  *         self.file = file
6326  *         # Open the file in a BinaryFileReader, handles magic and byteswapping
6327  */
6328   #ifndef CYTHON_WITHOUT_ASSERTIONS
6329   if (unlikely(!Py_OptimizeFlag)) {
6330     __pyx_t_1 = (__pyx_v_expected_sig != Py_None);
6331     if (unlikely(!(__pyx_t_1 != 0))) {
6332       PyErr_SetNone(PyExc_AssertionError);
6333       __PYX_ERR(0, 132, __pyx_L1_error)
6334     }
6335   }
6336   #endif
6337 
6338   /* "bx/bbi/bbi_file.pyx":133
6339  *         """
6340  *         assert expected_sig is not None
6341  *         self.file = file             # <<<<<<<<<<<<<<
6342  *         # Open the file in a BinaryFileReader, handles magic and byteswapping
6343  *         self.reader = reader = BinaryFileReader( file, expected_sig )
6344  */
6345   __Pyx_INCREF(__pyx_v_file);
6346   __Pyx_GIVEREF(__pyx_v_file);
6347   __Pyx_GOTREF(__pyx_v_self->file);
6348   __Pyx_DECREF(__pyx_v_self->file);
6349   __pyx_v_self->file = __pyx_v_file;
6350 
6351   /* "bx/bbi/bbi_file.pyx":135
6352  *         self.file = file
6353  *         # Open the file in a BinaryFileReader, handles magic and byteswapping
6354  *         self.reader = reader = BinaryFileReader( file, expected_sig )             # <<<<<<<<<<<<<<
6355  *         self.magic = expected_sig
6356  *         self.is_byteswapped = self.reader.byteswap_needed
6357  */
6358   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_BinaryFileReader); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
6359   __Pyx_GOTREF(__pyx_t_3);
6360   __pyx_t_4 = NULL;
6361   __pyx_t_5 = 0;
6362   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6363     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6364     if (likely(__pyx_t_4)) {
6365       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6366       __Pyx_INCREF(__pyx_t_4);
6367       __Pyx_INCREF(function);
6368       __Pyx_DECREF_SET(__pyx_t_3, function);
6369       __pyx_t_5 = 1;
6370     }
6371   }
6372   #if CYTHON_FAST_PYCALL
6373   if (PyFunction_Check(__pyx_t_3)) {
6374     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_file, __pyx_v_expected_sig};
6375     __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
6376     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6377     __Pyx_GOTREF(__pyx_t_2);
6378   } else
6379   #endif
6380   #if CYTHON_FAST_PYCCALL
6381   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
6382     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_file, __pyx_v_expected_sig};
6383     __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
6384     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6385     __Pyx_GOTREF(__pyx_t_2);
6386   } else
6387   #endif
6388   {
6389     __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 135, __pyx_L1_error)
6390     __Pyx_GOTREF(__pyx_t_6);
6391     if (__pyx_t_4) {
6392       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
6393     }
6394     __Pyx_INCREF(__pyx_v_file);
6395     __Pyx_GIVEREF(__pyx_v_file);
6396     PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_file);
6397     __Pyx_INCREF(__pyx_v_expected_sig);
6398     __Pyx_GIVEREF(__pyx_v_expected_sig);
6399     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_expected_sig);
6400     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
6401     __Pyx_GOTREF(__pyx_t_2);
6402     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6403   }
6404   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6405   __Pyx_INCREF(__pyx_t_2);
6406   __Pyx_GIVEREF(__pyx_t_2);
6407   __Pyx_GOTREF(__pyx_v_self->reader);
6408   __Pyx_DECREF(__pyx_v_self->reader);
6409   __pyx_v_self->reader = __pyx_t_2;
6410   __Pyx_INCREF(__pyx_t_2);
6411   __pyx_v_reader = __pyx_t_2;
6412   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6413 
6414   /* "bx/bbi/bbi_file.pyx":136
6415  *         # Open the file in a BinaryFileReader, handles magic and byteswapping
6416  *         self.reader = reader = BinaryFileReader( file, expected_sig )
6417  *         self.magic = expected_sig             # <<<<<<<<<<<<<<
6418  *         self.is_byteswapped = self.reader.byteswap_needed
6419  *         # Read header stuff
6420  */
6421   __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_v_expected_sig); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
6422   __pyx_v_self->magic = __pyx_t_7;
6423 
6424   /* "bx/bbi/bbi_file.pyx":137
6425  *         self.reader = reader = BinaryFileReader( file, expected_sig )
6426  *         self.magic = expected_sig
6427  *         self.is_byteswapped = self.reader.byteswap_needed             # <<<<<<<<<<<<<<
6428  *         # Read header stuff
6429  *         self.version = reader.read_uint16()
6430  */
6431   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->reader, __pyx_n_s_byteswap_needed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
6432   __Pyx_GOTREF(__pyx_t_2);
6433   __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L1_error)
6434   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6435   __pyx_v_self->is_byteswapped = __pyx_t_8;
6436 
6437   /* "bx/bbi/bbi_file.pyx":139
6438  *         self.is_byteswapped = self.reader.byteswap_needed
6439  *         # Read header stuff
6440  *         self.version = reader.read_uint16()             # <<<<<<<<<<<<<<
6441  *         self.zoom_levels = reader.read_uint16()
6442  *         self.chrom_tree_offset = reader.read_uint64()
6443  */
6444   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_read_uint16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
6445   __Pyx_GOTREF(__pyx_t_3);
6446   __pyx_t_6 = NULL;
6447   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6448     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6449     if (likely(__pyx_t_6)) {
6450       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6451       __Pyx_INCREF(__pyx_t_6);
6452       __Pyx_INCREF(function);
6453       __Pyx_DECREF_SET(__pyx_t_3, function);
6454     }
6455   }
6456   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6457   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6458   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
6459   __Pyx_GOTREF(__pyx_t_2);
6460   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6461   __pyx_t_9 = __Pyx_PyInt_As_unsigned_short(__pyx_t_2); if (unlikely((__pyx_t_9 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error)
6462   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6463   __pyx_v_self->version = __pyx_t_9;
6464 
6465   /* "bx/bbi/bbi_file.pyx":140
6466  *         # Read header stuff
6467  *         self.version = reader.read_uint16()
6468  *         self.zoom_levels = reader.read_uint16()             # <<<<<<<<<<<<<<
6469  *         self.chrom_tree_offset = reader.read_uint64()
6470  *         self.unzoomed_data_offset = reader.read_uint64()
6471  */
6472   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_read_uint16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error)
6473   __Pyx_GOTREF(__pyx_t_3);
6474   __pyx_t_6 = NULL;
6475   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6476     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6477     if (likely(__pyx_t_6)) {
6478       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6479       __Pyx_INCREF(__pyx_t_6);
6480       __Pyx_INCREF(function);
6481       __Pyx_DECREF_SET(__pyx_t_3, function);
6482     }
6483   }
6484   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6485   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6486   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
6487   __Pyx_GOTREF(__pyx_t_2);
6488   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6489   __pyx_t_9 = __Pyx_PyInt_As_unsigned_short(__pyx_t_2); if (unlikely((__pyx_t_9 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error)
6490   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6491   __pyx_v_self->zoom_levels = __pyx_t_9;
6492 
6493   /* "bx/bbi/bbi_file.pyx":141
6494  *         self.version = reader.read_uint16()
6495  *         self.zoom_levels = reader.read_uint16()
6496  *         self.chrom_tree_offset = reader.read_uint64()             # <<<<<<<<<<<<<<
6497  *         self.unzoomed_data_offset = reader.read_uint64()
6498  *         self.unzoomed_index_offset = reader.read_uint64()
6499  */
6500   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_read_uint64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
6501   __Pyx_GOTREF(__pyx_t_3);
6502   __pyx_t_6 = NULL;
6503   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6504     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6505     if (likely(__pyx_t_6)) {
6506       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6507       __Pyx_INCREF(__pyx_t_6);
6508       __Pyx_INCREF(function);
6509       __Pyx_DECREF_SET(__pyx_t_3, function);
6510     }
6511   }
6512   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6513   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6514   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
6515   __Pyx_GOTREF(__pyx_t_2);
6516   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6517   __pyx_t_10 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_10 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error)
6518   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6519   __pyx_v_self->chrom_tree_offset = __pyx_t_10;
6520 
6521   /* "bx/bbi/bbi_file.pyx":142
6522  *         self.zoom_levels = reader.read_uint16()
6523  *         self.chrom_tree_offset = reader.read_uint64()
6524  *         self.unzoomed_data_offset = reader.read_uint64()             # <<<<<<<<<<<<<<
6525  *         self.unzoomed_index_offset = reader.read_uint64()
6526  *         self.field_count = reader.read_uint16()
6527  */
6528   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_read_uint64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
6529   __Pyx_GOTREF(__pyx_t_3);
6530   __pyx_t_6 = NULL;
6531   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6532     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6533     if (likely(__pyx_t_6)) {
6534       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6535       __Pyx_INCREF(__pyx_t_6);
6536       __Pyx_INCREF(function);
6537       __Pyx_DECREF_SET(__pyx_t_3, function);
6538     }
6539   }
6540   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6541   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6542   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
6543   __Pyx_GOTREF(__pyx_t_2);
6544   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6545   __pyx_t_10 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_10 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 142, __pyx_L1_error)
6546   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6547   __pyx_v_self->unzoomed_data_offset = __pyx_t_10;
6548 
6549   /* "bx/bbi/bbi_file.pyx":143
6550  *         self.chrom_tree_offset = reader.read_uint64()
6551  *         self.unzoomed_data_offset = reader.read_uint64()
6552  *         self.unzoomed_index_offset = reader.read_uint64()             # <<<<<<<<<<<<<<
6553  *         self.field_count = reader.read_uint16()
6554  *         self.defined_field_count = reader.read_uint16()
6555  */
6556   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_read_uint64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
6557   __Pyx_GOTREF(__pyx_t_3);
6558   __pyx_t_6 = NULL;
6559   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6560     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6561     if (likely(__pyx_t_6)) {
6562       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6563       __Pyx_INCREF(__pyx_t_6);
6564       __Pyx_INCREF(function);
6565       __Pyx_DECREF_SET(__pyx_t_3, function);
6566     }
6567   }
6568   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6569   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6570   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
6571   __Pyx_GOTREF(__pyx_t_2);
6572   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6573   __pyx_t_10 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_10 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error)
6574   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6575   __pyx_v_self->unzoomed_index_offset = __pyx_t_10;
6576 
6577   /* "bx/bbi/bbi_file.pyx":144
6578  *         self.unzoomed_data_offset = reader.read_uint64()
6579  *         self.unzoomed_index_offset = reader.read_uint64()
6580  *         self.field_count = reader.read_uint16()             # <<<<<<<<<<<<<<
6581  *         self.defined_field_count = reader.read_uint16()
6582  *         self.as_offset = reader.read_uint64()
6583  */
6584   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_read_uint16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
6585   __Pyx_GOTREF(__pyx_t_3);
6586   __pyx_t_6 = NULL;
6587   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6588     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6589     if (likely(__pyx_t_6)) {
6590       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6591       __Pyx_INCREF(__pyx_t_6);
6592       __Pyx_INCREF(function);
6593       __Pyx_DECREF_SET(__pyx_t_3, function);
6594     }
6595   }
6596   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6597   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6598   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
6599   __Pyx_GOTREF(__pyx_t_2);
6600   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6601   __pyx_t_9 = __Pyx_PyInt_As_unsigned_short(__pyx_t_2); if (unlikely((__pyx_t_9 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L1_error)
6602   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6603   __pyx_v_self->field_count = __pyx_t_9;
6604 
6605   /* "bx/bbi/bbi_file.pyx":145
6606  *         self.unzoomed_index_offset = reader.read_uint64()
6607  *         self.field_count = reader.read_uint16()
6608  *         self.defined_field_count = reader.read_uint16()             # <<<<<<<<<<<<<<
6609  *         self.as_offset = reader.read_uint64()
6610  *         self.total_summary_offset = reader.read_uint64()
6611  */
6612   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_read_uint16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
6613   __Pyx_GOTREF(__pyx_t_3);
6614   __pyx_t_6 = NULL;
6615   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6616     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6617     if (likely(__pyx_t_6)) {
6618       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6619       __Pyx_INCREF(__pyx_t_6);
6620       __Pyx_INCREF(function);
6621       __Pyx_DECREF_SET(__pyx_t_3, function);
6622     }
6623   }
6624   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6625   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6626   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
6627   __Pyx_GOTREF(__pyx_t_2);
6628   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6629   __pyx_t_9 = __Pyx_PyInt_As_unsigned_short(__pyx_t_2); if (unlikely((__pyx_t_9 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error)
6630   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6631   __pyx_v_self->defined_field_count = __pyx_t_9;
6632 
6633   /* "bx/bbi/bbi_file.pyx":146
6634  *         self.field_count = reader.read_uint16()
6635  *         self.defined_field_count = reader.read_uint16()
6636  *         self.as_offset = reader.read_uint64()             # <<<<<<<<<<<<<<
6637  *         self.total_summary_offset = reader.read_uint64()
6638  *         self.uncompress_buf_size = reader.read_uint32()
6639  */
6640   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_read_uint64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
6641   __Pyx_GOTREF(__pyx_t_3);
6642   __pyx_t_6 = NULL;
6643   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6644     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6645     if (likely(__pyx_t_6)) {
6646       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6647       __Pyx_INCREF(__pyx_t_6);
6648       __Pyx_INCREF(function);
6649       __Pyx_DECREF_SET(__pyx_t_3, function);
6650     }
6651   }
6652   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6653   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6654   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
6655   __Pyx_GOTREF(__pyx_t_2);
6656   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6657   __pyx_t_10 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_10 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error)
6658   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6659   __pyx_v_self->as_offset = __pyx_t_10;
6660 
6661   /* "bx/bbi/bbi_file.pyx":147
6662  *         self.defined_field_count = reader.read_uint16()
6663  *         self.as_offset = reader.read_uint64()
6664  *         self.total_summary_offset = reader.read_uint64()             # <<<<<<<<<<<<<<
6665  *         self.uncompress_buf_size = reader.read_uint32()
6666  *         # Skip reserved
6667  */
6668   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_read_uint64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
6669   __Pyx_GOTREF(__pyx_t_3);
6670   __pyx_t_6 = NULL;
6671   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6672     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6673     if (likely(__pyx_t_6)) {
6674       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6675       __Pyx_INCREF(__pyx_t_6);
6676       __Pyx_INCREF(function);
6677       __Pyx_DECREF_SET(__pyx_t_3, function);
6678     }
6679   }
6680   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6681   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6682   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
6683   __Pyx_GOTREF(__pyx_t_2);
6684   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6685   __pyx_t_10 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_10 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error)
6686   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6687   __pyx_v_self->total_summary_offset = __pyx_t_10;
6688 
6689   /* "bx/bbi/bbi_file.pyx":148
6690  *         self.as_offset = reader.read_uint64()
6691  *         self.total_summary_offset = reader.read_uint64()
6692  *         self.uncompress_buf_size = reader.read_uint32()             # <<<<<<<<<<<<<<
6693  *         # Skip reserved
6694  *         reader.seek( 64 )
6695  */
6696   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_read_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
6697   __Pyx_GOTREF(__pyx_t_3);
6698   __pyx_t_6 = NULL;
6699   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6700     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6701     if (likely(__pyx_t_6)) {
6702       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6703       __Pyx_INCREF(__pyx_t_6);
6704       __Pyx_INCREF(function);
6705       __Pyx_DECREF_SET(__pyx_t_3, function);
6706     }
6707   }
6708   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6709   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6710   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
6711   __Pyx_GOTREF(__pyx_t_2);
6712   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6713   __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
6714   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6715   __pyx_v_self->uncompress_buf_size = __pyx_t_7;
6716 
6717   /* "bx/bbi/bbi_file.pyx":150
6718  *         self.uncompress_buf_size = reader.read_uint32()
6719  *         # Skip reserved
6720  *         reader.seek( 64 )             # <<<<<<<<<<<<<<
6721  *         # Read zoom headers
6722  *         self.level_list = []
6723  */
6724   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_seek); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
6725   __Pyx_GOTREF(__pyx_t_3);
6726   __pyx_t_6 = NULL;
6727   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6728     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6729     if (likely(__pyx_t_6)) {
6730       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6731       __Pyx_INCREF(__pyx_t_6);
6732       __Pyx_INCREF(function);
6733       __Pyx_DECREF_SET(__pyx_t_3, function);
6734     }
6735   }
6736   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_int_64) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_64);
6737   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6738   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
6739   __Pyx_GOTREF(__pyx_t_2);
6740   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6741   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6742 
6743   /* "bx/bbi/bbi_file.pyx":152
6744  *         reader.seek( 64 )
6745  *         # Read zoom headers
6746  *         self.level_list = []             # <<<<<<<<<<<<<<
6747  *         for i from 0 <= i < self.zoom_levels:
6748  *             level = ZoomLevel()
6749  */
6750   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
6751   __Pyx_GOTREF(__pyx_t_2);
6752   __Pyx_GIVEREF(__pyx_t_2);
6753   __Pyx_GOTREF(__pyx_v_self->level_list);
6754   __Pyx_DECREF(__pyx_v_self->level_list);
6755   __pyx_v_self->level_list = __pyx_t_2;
6756   __pyx_t_2 = 0;
6757 
6758   /* "bx/bbi/bbi_file.pyx":153
6759  *         # Read zoom headers
6760  *         self.level_list = []
6761  *         for i from 0 <= i < self.zoom_levels:             # <<<<<<<<<<<<<<
6762  *             level = ZoomLevel()
6763  *             level.bbi_file = self
6764  */
6765   __pyx_t_9 = __pyx_v_self->zoom_levels;
6766   for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_9; __pyx_v_i++) {
6767 
6768     /* "bx/bbi/bbi_file.pyx":154
6769  *         self.level_list = []
6770  *         for i from 0 <= i < self.zoom_levels:
6771  *             level = ZoomLevel()             # <<<<<<<<<<<<<<
6772  *             level.bbi_file = self
6773  *             level.reduction_level = reader.read_uint32()
6774  */
6775     __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_2bx_3bbi_8bbi_file_ZoomLevel)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error)
6776     __Pyx_GOTREF(__pyx_t_2);
6777     __Pyx_XDECREF_SET(__pyx_v_level, ((struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)__pyx_t_2));
6778     __pyx_t_2 = 0;
6779 
6780     /* "bx/bbi/bbi_file.pyx":155
6781  *         for i from 0 <= i < self.zoom_levels:
6782  *             level = ZoomLevel()
6783  *             level.bbi_file = self             # <<<<<<<<<<<<<<
6784  *             level.reduction_level = reader.read_uint32()
6785  *             level.reserved = reader.read_uint32()
6786  */
6787     __Pyx_INCREF(((PyObject *)__pyx_v_self));
6788     __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6789     __Pyx_GOTREF(__pyx_v_level->bbi_file);
6790     __Pyx_DECREF(((PyObject *)__pyx_v_level->bbi_file));
6791     __pyx_v_level->bbi_file = __pyx_v_self;
6792 
6793     /* "bx/bbi/bbi_file.pyx":156
6794  *             level = ZoomLevel()
6795  *             level.bbi_file = self
6796  *             level.reduction_level = reader.read_uint32()             # <<<<<<<<<<<<<<
6797  *             level.reserved = reader.read_uint32()
6798  *             level.data_offset = reader.read_uint64()
6799  */
6800     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_read_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
6801     __Pyx_GOTREF(__pyx_t_3);
6802     __pyx_t_6 = NULL;
6803     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6804       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6805       if (likely(__pyx_t_6)) {
6806         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6807         __Pyx_INCREF(__pyx_t_6);
6808         __Pyx_INCREF(function);
6809         __Pyx_DECREF_SET(__pyx_t_3, function);
6810       }
6811     }
6812     __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6813     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6814     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
6815     __Pyx_GOTREF(__pyx_t_2);
6816     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6817     __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L1_error)
6818     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6819     __pyx_v_level->reduction_level = __pyx_t_7;
6820 
6821     /* "bx/bbi/bbi_file.pyx":157
6822  *             level.bbi_file = self
6823  *             level.reduction_level = reader.read_uint32()
6824  *             level.reserved = reader.read_uint32()             # <<<<<<<<<<<<<<
6825  *             level.data_offset = reader.read_uint64()
6826  *             level.index_offset = reader.read_uint64()
6827  */
6828     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_read_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
6829     __Pyx_GOTREF(__pyx_t_3);
6830     __pyx_t_6 = NULL;
6831     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6832       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6833       if (likely(__pyx_t_6)) {
6834         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6835         __Pyx_INCREF(__pyx_t_6);
6836         __Pyx_INCREF(function);
6837         __Pyx_DECREF_SET(__pyx_t_3, function);
6838       }
6839     }
6840     __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6841     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6842     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
6843     __Pyx_GOTREF(__pyx_t_2);
6844     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6845     __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L1_error)
6846     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6847     __pyx_v_level->reserved = __pyx_t_7;
6848 
6849     /* "bx/bbi/bbi_file.pyx":158
6850  *             level.reduction_level = reader.read_uint32()
6851  *             level.reserved = reader.read_uint32()
6852  *             level.data_offset = reader.read_uint64()             # <<<<<<<<<<<<<<
6853  *             level.index_offset = reader.read_uint64()
6854  *             self.level_list.append( level )
6855  */
6856     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_read_uint64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
6857     __Pyx_GOTREF(__pyx_t_3);
6858     __pyx_t_6 = NULL;
6859     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6860       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6861       if (likely(__pyx_t_6)) {
6862         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6863         __Pyx_INCREF(__pyx_t_6);
6864         __Pyx_INCREF(function);
6865         __Pyx_DECREF_SET(__pyx_t_3, function);
6866       }
6867     }
6868     __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6869     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6870     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
6871     __Pyx_GOTREF(__pyx_t_2);
6872     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6873     __pyx_t_10 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_10 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L1_error)
6874     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6875     __pyx_v_level->data_offset = __pyx_t_10;
6876 
6877     /* "bx/bbi/bbi_file.pyx":159
6878  *             level.reserved = reader.read_uint32()
6879  *             level.data_offset = reader.read_uint64()
6880  *             level.index_offset = reader.read_uint64()             # <<<<<<<<<<<<<<
6881  *             self.level_list.append( level )
6882  *         # Initialize and attach embedded BPTFile containing chromosome names and ids
6883  */
6884     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_read_uint64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
6885     __Pyx_GOTREF(__pyx_t_3);
6886     __pyx_t_6 = NULL;
6887     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6888       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6889       if (likely(__pyx_t_6)) {
6890         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6891         __Pyx_INCREF(__pyx_t_6);
6892         __Pyx_INCREF(function);
6893         __Pyx_DECREF_SET(__pyx_t_3, function);
6894       }
6895     }
6896     __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6897     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6898     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
6899     __Pyx_GOTREF(__pyx_t_2);
6900     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6901     __pyx_t_10 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_10 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
6902     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6903     __pyx_v_level->index_offset = __pyx_t_10;
6904 
6905     /* "bx/bbi/bbi_file.pyx":160
6906  *             level.data_offset = reader.read_uint64()
6907  *             level.index_offset = reader.read_uint64()
6908  *             self.level_list.append( level )             # <<<<<<<<<<<<<<
6909  *         # Initialize and attach embedded BPTFile containing chromosome names and ids
6910  *         reader.seek( self.chrom_tree_offset )
6911  */
6912     __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_self->level_list, ((PyObject *)__pyx_v_level)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 160, __pyx_L1_error)
6913   }
6914 
6915   /* "bx/bbi/bbi_file.pyx":162
6916  *             self.level_list.append( level )
6917  *         # Initialize and attach embedded BPTFile containing chromosome names and ids
6918  *         reader.seek( self.chrom_tree_offset )             # <<<<<<<<<<<<<<
6919  *         self.chrom_bpt = BPTFile( file=self.file )
6920  *
6921  */
6922   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_seek); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
6923   __Pyx_GOTREF(__pyx_t_3);
6924   __pyx_t_6 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->chrom_tree_offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 162, __pyx_L1_error)
6925   __Pyx_GOTREF(__pyx_t_6);
6926   __pyx_t_4 = NULL;
6927   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6928     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6929     if (likely(__pyx_t_4)) {
6930       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6931       __Pyx_INCREF(__pyx_t_4);
6932       __Pyx_INCREF(function);
6933       __Pyx_DECREF_SET(__pyx_t_3, function);
6934     }
6935   }
6936   __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
6937   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6938   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6939   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
6940   __Pyx_GOTREF(__pyx_t_2);
6941   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6942   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6943 
6944   /* "bx/bbi/bbi_file.pyx":163
6945  *         # Initialize and attach embedded BPTFile containing chromosome names and ids
6946  *         reader.seek( self.chrom_tree_offset )
6947  *         self.chrom_bpt = BPTFile( file=self.file )             # <<<<<<<<<<<<<<
6948  *
6949  *     cdef visit_blocks_in_region( self, bits32 chrom_id, bits32 start, bits32 end, BlockHandler handler ):
6950  */
6951   __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
6952   __Pyx_GOTREF(__pyx_t_2);
6953   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_file, __pyx_v_self->file) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
6954   __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2bx_3bbi_8bpt_file_BPTFile), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
6955   __Pyx_GOTREF(__pyx_t_3);
6956   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6957   __Pyx_GIVEREF(__pyx_t_3);
6958   __Pyx_GOTREF(__pyx_v_self->chrom_bpt);
6959   __Pyx_DECREF(((PyObject *)__pyx_v_self->chrom_bpt));
6960   __pyx_v_self->chrom_bpt = ((struct __pyx_obj_2bx_3bbi_8bpt_file_BPTFile *)__pyx_t_3);
6961   __pyx_t_3 = 0;
6962 
6963   /* "bx/bbi/bbi_file.pyx":127
6964  *             self.open( file, expected_sig, type_name )
6965  *
6966  *     def open( self, file, expected_sig, type_name ):             # <<<<<<<<<<<<<<
6967  *         """
6968  *         Initialize from an existing bbi file, signature (magic) must be passed
6969  */
6970 
6971   /* function exit code */
6972   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6973   goto __pyx_L0;
6974   __pyx_L1_error:;
6975   __Pyx_XDECREF(__pyx_t_2);
6976   __Pyx_XDECREF(__pyx_t_3);
6977   __Pyx_XDECREF(__pyx_t_4);
6978   __Pyx_XDECREF(__pyx_t_6);
6979   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
6980   __pyx_r = NULL;
6981   __pyx_L0:;
6982   __Pyx_XDECREF(__pyx_v_reader);
6983   __Pyx_XDECREF((PyObject *)__pyx_v_level);
6984   __Pyx_XGIVEREF(__pyx_r);
6985   __Pyx_RefNannyFinishContext();
6986   return __pyx_r;
6987 }
6988 
6989 /* "bx/bbi/bbi_file.pyx":165
6990  *         self.chrom_bpt = BPTFile( file=self.file )
6991  *
6992  *     cdef visit_blocks_in_region( self, bits32 chrom_id, bits32 start, bits32 end, BlockHandler handler ):             # <<<<<<<<<<<<<<
6993  *         """
6994  *         Visit each block from the full data that overlaps a specific region
6995  */
6996 
__pyx_f_2bx_3bbi_8bbi_file_7BBIFile_visit_blocks_in_region(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __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,struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler * __pyx_v_handler)6997 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_7BBIFile_visit_blocks_in_region(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__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, struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *__pyx_v_handler) {
6998   struct __pyx_obj_2bx_3bbi_12cirtree_file_CIRTreeFile *__pyx_v_ctf = 0;
6999   PyObject *__pyx_v_reader = NULL;
7000   PyObject *__pyx_v_block_list = NULL;
7001   PyObject *__pyx_v_offset = NULL;
7002   PyObject *__pyx_v_size = NULL;
7003   PyObject *__pyx_v_block_data = NULL;
7004   PyObject *__pyx_r = NULL;
7005   __Pyx_RefNannyDeclarations
7006   PyObject *__pyx_t_1 = NULL;
7007   PyObject *__pyx_t_2 = NULL;
7008   PyObject *__pyx_t_3 = NULL;
7009   PyObject *__pyx_t_4 = NULL;
7010   PyObject *__pyx_t_5 = NULL;
7011   PyObject *__pyx_t_6 = NULL;
7012   int __pyx_t_7;
7013   PyObject *__pyx_t_8 = NULL;
7014   Py_ssize_t __pyx_t_9;
7015   PyObject *(*__pyx_t_10)(PyObject *);
7016   PyObject *(*__pyx_t_11)(PyObject *);
7017   int __pyx_t_12;
7018   int __pyx_lineno = 0;
7019   const char *__pyx_filename = NULL;
7020   int __pyx_clineno = 0;
7021   __Pyx_RefNannySetupContext("visit_blocks_in_region", 0);
7022 
7023   /* "bx/bbi/bbi_file.pyx":170
7024  *         """
7025  *         cdef CIRTreeFile ctf
7026  *         reader = self.reader             # <<<<<<<<<<<<<<
7027  *         reader.seek( self.unzoomed_index_offset )
7028  *         ctf = CIRTreeFile( reader.file )
7029  */
7030   __pyx_t_1 = __pyx_v_self->reader;
7031   __Pyx_INCREF(__pyx_t_1);
7032   __pyx_v_reader = __pyx_t_1;
7033   __pyx_t_1 = 0;
7034 
7035   /* "bx/bbi/bbi_file.pyx":171
7036  *         cdef CIRTreeFile ctf
7037  *         reader = self.reader
7038  *         reader.seek( self.unzoomed_index_offset )             # <<<<<<<<<<<<<<
7039  *         ctf = CIRTreeFile( reader.file )
7040  *         block_list = ctf.find_overlapping_blocks( chrom_id, start, end )
7041  */
7042   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_seek); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
7043   __Pyx_GOTREF(__pyx_t_2);
7044   __pyx_t_3 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->unzoomed_index_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
7045   __Pyx_GOTREF(__pyx_t_3);
7046   __pyx_t_4 = NULL;
7047   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7048     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
7049     if (likely(__pyx_t_4)) {
7050       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7051       __Pyx_INCREF(__pyx_t_4);
7052       __Pyx_INCREF(function);
7053       __Pyx_DECREF_SET(__pyx_t_2, function);
7054     }
7055   }
7056   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
7057   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7058   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7059   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
7060   __Pyx_GOTREF(__pyx_t_1);
7061   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7062   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7063 
7064   /* "bx/bbi/bbi_file.pyx":172
7065  *         reader = self.reader
7066  *         reader.seek( self.unzoomed_index_offset )
7067  *         ctf = CIRTreeFile( reader.file )             # <<<<<<<<<<<<<<
7068  *         block_list = ctf.find_overlapping_blocks( chrom_id, start, end )
7069  *         for offset, size in block_list:
7070  */
7071   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
7072   __Pyx_GOTREF(__pyx_t_1);
7073   __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_2bx_3bbi_12cirtree_file_CIRTreeFile), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
7074   __Pyx_GOTREF(__pyx_t_2);
7075   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7076   __pyx_v_ctf = ((struct __pyx_obj_2bx_3bbi_12cirtree_file_CIRTreeFile *)__pyx_t_2);
7077   __pyx_t_2 = 0;
7078 
7079   /* "bx/bbi/bbi_file.pyx":173
7080  *         reader.seek( self.unzoomed_index_offset )
7081  *         ctf = CIRTreeFile( reader.file )
7082  *         block_list = ctf.find_overlapping_blocks( chrom_id, start, end )             # <<<<<<<<<<<<<<
7083  *         for offset, size in block_list:
7084  *             # Seek to and read all data for the block
7085  */
7086   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ctf), __pyx_n_s_find_overlapping_blocks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
7087   __Pyx_GOTREF(__pyx_t_1);
7088   __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_chrom_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
7089   __Pyx_GOTREF(__pyx_t_3);
7090   __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
7091   __Pyx_GOTREF(__pyx_t_4);
7092   __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 173, __pyx_L1_error)
7093   __Pyx_GOTREF(__pyx_t_5);
7094   __pyx_t_6 = NULL;
7095   __pyx_t_7 = 0;
7096   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
7097     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
7098     if (likely(__pyx_t_6)) {
7099       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
7100       __Pyx_INCREF(__pyx_t_6);
7101       __Pyx_INCREF(function);
7102       __Pyx_DECREF_SET(__pyx_t_1, function);
7103       __pyx_t_7 = 1;
7104     }
7105   }
7106   #if CYTHON_FAST_PYCALL
7107   if (PyFunction_Check(__pyx_t_1)) {
7108     PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5};
7109     __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
7110     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7111     __Pyx_GOTREF(__pyx_t_2);
7112     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7113     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7114     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7115   } else
7116   #endif
7117   #if CYTHON_FAST_PYCCALL
7118   if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
7119     PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5};
7120     __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
7121     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7122     __Pyx_GOTREF(__pyx_t_2);
7123     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7124     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7125     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7126   } else
7127   #endif
7128   {
7129     __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 173, __pyx_L1_error)
7130     __Pyx_GOTREF(__pyx_t_8);
7131     if (__pyx_t_6) {
7132       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
7133     }
7134     __Pyx_GIVEREF(__pyx_t_3);
7135     PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
7136     __Pyx_GIVEREF(__pyx_t_4);
7137     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
7138     __Pyx_GIVEREF(__pyx_t_5);
7139     PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5);
7140     __pyx_t_3 = 0;
7141     __pyx_t_4 = 0;
7142     __pyx_t_5 = 0;
7143     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
7144     __Pyx_GOTREF(__pyx_t_2);
7145     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7146   }
7147   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7148   __pyx_v_block_list = __pyx_t_2;
7149   __pyx_t_2 = 0;
7150 
7151   /* "bx/bbi/bbi_file.pyx":174
7152  *         ctf = CIRTreeFile( reader.file )
7153  *         block_list = ctf.find_overlapping_blocks( chrom_id, start, end )
7154  *         for offset, size in block_list:             # <<<<<<<<<<<<<<
7155  *             # Seek to and read all data for the block
7156  *             reader.seek( offset )
7157  */
7158   if (likely(PyList_CheckExact(__pyx_v_block_list)) || PyTuple_CheckExact(__pyx_v_block_list)) {
7159     __pyx_t_2 = __pyx_v_block_list; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0;
7160     __pyx_t_10 = NULL;
7161   } else {
7162     __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_block_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
7163     __Pyx_GOTREF(__pyx_t_2);
7164     __pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 174, __pyx_L1_error)
7165   }
7166   for (;;) {
7167     if (likely(!__pyx_t_10)) {
7168       if (likely(PyList_CheckExact(__pyx_t_2))) {
7169         if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break;
7170         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7171         __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 174, __pyx_L1_error)
7172         #else
7173         __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
7174         __Pyx_GOTREF(__pyx_t_1);
7175         #endif
7176       } else {
7177         if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
7178         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7179         __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 174, __pyx_L1_error)
7180         #else
7181         __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
7182         __Pyx_GOTREF(__pyx_t_1);
7183         #endif
7184       }
7185     } else {
7186       __pyx_t_1 = __pyx_t_10(__pyx_t_2);
7187       if (unlikely(!__pyx_t_1)) {
7188         PyObject* exc_type = PyErr_Occurred();
7189         if (exc_type) {
7190           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7191           else __PYX_ERR(0, 174, __pyx_L1_error)
7192         }
7193         break;
7194       }
7195       __Pyx_GOTREF(__pyx_t_1);
7196     }
7197     if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
7198       PyObject* sequence = __pyx_t_1;
7199       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7200       if (unlikely(size != 2)) {
7201         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7202         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7203         __PYX_ERR(0, 174, __pyx_L1_error)
7204       }
7205       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7206       if (likely(PyTuple_CheckExact(sequence))) {
7207         __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0);
7208         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
7209       } else {
7210         __pyx_t_8 = PyList_GET_ITEM(sequence, 0);
7211         __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
7212       }
7213       __Pyx_INCREF(__pyx_t_8);
7214       __Pyx_INCREF(__pyx_t_5);
7215       #else
7216       __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 174, __pyx_L1_error)
7217       __Pyx_GOTREF(__pyx_t_8);
7218       __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error)
7219       __Pyx_GOTREF(__pyx_t_5);
7220       #endif
7221       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7222     } else {
7223       Py_ssize_t index = -1;
7224       __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
7225       __Pyx_GOTREF(__pyx_t_4);
7226       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7227       __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext;
7228       index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed;
7229       __Pyx_GOTREF(__pyx_t_8);
7230       index = 1; __pyx_t_5 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
7231       __Pyx_GOTREF(__pyx_t_5);
7232       if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_4), 2) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
7233       __pyx_t_11 = NULL;
7234       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7235       goto __pyx_L6_unpacking_done;
7236       __pyx_L5_unpacking_failed:;
7237       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7238       __pyx_t_11 = NULL;
7239       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7240       __PYX_ERR(0, 174, __pyx_L1_error)
7241       __pyx_L6_unpacking_done:;
7242     }
7243     __Pyx_XDECREF_SET(__pyx_v_offset, __pyx_t_8);
7244     __pyx_t_8 = 0;
7245     __Pyx_XDECREF_SET(__pyx_v_size, __pyx_t_5);
7246     __pyx_t_5 = 0;
7247 
7248     /* "bx/bbi/bbi_file.pyx":176
7249  *         for offset, size in block_list:
7250  *             # Seek to and read all data for the block
7251  *             reader.seek( offset )             # <<<<<<<<<<<<<<
7252  *             block_data = reader.read( size )
7253  *             # Might need to uncompress
7254  */
7255     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_seek); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 176, __pyx_L1_error)
7256     __Pyx_GOTREF(__pyx_t_5);
7257     __pyx_t_8 = NULL;
7258     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
7259       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
7260       if (likely(__pyx_t_8)) {
7261         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7262         __Pyx_INCREF(__pyx_t_8);
7263         __Pyx_INCREF(function);
7264         __Pyx_DECREF_SET(__pyx_t_5, function);
7265       }
7266     }
7267     __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_v_offset) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_offset);
7268     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7269     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
7270     __Pyx_GOTREF(__pyx_t_1);
7271     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7272     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7273 
7274     /* "bx/bbi/bbi_file.pyx":177
7275  *             # Seek to and read all data for the block
7276  *             reader.seek( offset )
7277  *             block_data = reader.read( size )             # <<<<<<<<<<<<<<
7278  *             # Might need to uncompress
7279  *             if self.uncompress_buf_size > 0:
7280  */
7281     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_read); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 177, __pyx_L1_error)
7282     __Pyx_GOTREF(__pyx_t_5);
7283     __pyx_t_8 = NULL;
7284     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
7285       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
7286       if (likely(__pyx_t_8)) {
7287         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7288         __Pyx_INCREF(__pyx_t_8);
7289         __Pyx_INCREF(function);
7290         __Pyx_DECREF_SET(__pyx_t_5, function);
7291       }
7292     }
7293     __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_v_size) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_size);
7294     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7295     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
7296     __Pyx_GOTREF(__pyx_t_1);
7297     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7298     __Pyx_XDECREF_SET(__pyx_v_block_data, __pyx_t_1);
7299     __pyx_t_1 = 0;
7300 
7301     /* "bx/bbi/bbi_file.pyx":179
7302  *             block_data = reader.read( size )
7303  *             # Might need to uncompress
7304  *             if self.uncompress_buf_size > 0:             # <<<<<<<<<<<<<<
7305  *                 block_data = zlib.decompress( block_data )
7306  *             handler.handle_block( block_data, self )
7307  */
7308     __pyx_t_12 = ((__pyx_v_self->uncompress_buf_size > 0) != 0);
7309     if (__pyx_t_12) {
7310 
7311       /* "bx/bbi/bbi_file.pyx":180
7312  *             # Might need to uncompress
7313  *             if self.uncompress_buf_size > 0:
7314  *                 block_data = zlib.decompress( block_data )             # <<<<<<<<<<<<<<
7315  *             handler.handle_block( block_data, self )
7316  *
7317  */
7318       __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_zlib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 180, __pyx_L1_error)
7319       __Pyx_GOTREF(__pyx_t_5);
7320       __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decompress); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 180, __pyx_L1_error)
7321       __Pyx_GOTREF(__pyx_t_8);
7322       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7323       __pyx_t_5 = NULL;
7324       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
7325         __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
7326         if (likely(__pyx_t_5)) {
7327           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
7328           __Pyx_INCREF(__pyx_t_5);
7329           __Pyx_INCREF(function);
7330           __Pyx_DECREF_SET(__pyx_t_8, function);
7331         }
7332       }
7333       __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_5, __pyx_v_block_data) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_block_data);
7334       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7335       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
7336       __Pyx_GOTREF(__pyx_t_1);
7337       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7338       __Pyx_DECREF_SET(__pyx_v_block_data, __pyx_t_1);
7339       __pyx_t_1 = 0;
7340 
7341       /* "bx/bbi/bbi_file.pyx":179
7342  *             block_data = reader.read( size )
7343  *             # Might need to uncompress
7344  *             if self.uncompress_buf_size > 0:             # <<<<<<<<<<<<<<
7345  *                 block_data = zlib.decompress( block_data )
7346  *             handler.handle_block( block_data, self )
7347  */
7348     }
7349 
7350     /* "bx/bbi/bbi_file.pyx":181
7351  *             if self.uncompress_buf_size > 0:
7352  *                 block_data = zlib.decompress( block_data )
7353  *             handler.handle_block( block_data, self )             # <<<<<<<<<<<<<<
7354  *
7355  *     cpdef summarize( self, object chrom, bits32 start, bits32 end, int summary_size ):
7356  */
7357     if (!(likely(PyBytes_CheckExact(__pyx_v_block_data))||((__pyx_v_block_data) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_block_data)->tp_name), 0))) __PYX_ERR(0, 181, __pyx_L1_error)
7358     __pyx_t_1 = ((struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BlockHandler *)__pyx_v_handler->__pyx_vtab)->handle_block(__pyx_v_handler, ((PyObject*)__pyx_v_block_data), __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
7359     __Pyx_GOTREF(__pyx_t_1);
7360     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7361 
7362     /* "bx/bbi/bbi_file.pyx":174
7363  *         ctf = CIRTreeFile( reader.file )
7364  *         block_list = ctf.find_overlapping_blocks( chrom_id, start, end )
7365  *         for offset, size in block_list:             # <<<<<<<<<<<<<<
7366  *             # Seek to and read all data for the block
7367  *             reader.seek( offset )
7368  */
7369   }
7370   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7371 
7372   /* "bx/bbi/bbi_file.pyx":165
7373  *         self.chrom_bpt = BPTFile( file=self.file )
7374  *
7375  *     cdef visit_blocks_in_region( self, bits32 chrom_id, bits32 start, bits32 end, BlockHandler handler ):             # <<<<<<<<<<<<<<
7376  *         """
7377  *         Visit each block from the full data that overlaps a specific region
7378  */
7379 
7380   /* function exit code */
7381   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7382   goto __pyx_L0;
7383   __pyx_L1_error:;
7384   __Pyx_XDECREF(__pyx_t_1);
7385   __Pyx_XDECREF(__pyx_t_2);
7386   __Pyx_XDECREF(__pyx_t_3);
7387   __Pyx_XDECREF(__pyx_t_4);
7388   __Pyx_XDECREF(__pyx_t_5);
7389   __Pyx_XDECREF(__pyx_t_6);
7390   __Pyx_XDECREF(__pyx_t_8);
7391   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.visit_blocks_in_region", __pyx_clineno, __pyx_lineno, __pyx_filename);
7392   __pyx_r = 0;
7393   __pyx_L0:;
7394   __Pyx_XDECREF((PyObject *)__pyx_v_ctf);
7395   __Pyx_XDECREF(__pyx_v_reader);
7396   __Pyx_XDECREF(__pyx_v_block_list);
7397   __Pyx_XDECREF(__pyx_v_offset);
7398   __Pyx_XDECREF(__pyx_v_size);
7399   __Pyx_XDECREF(__pyx_v_block_data);
7400   __Pyx_XGIVEREF(__pyx_r);
7401   __Pyx_RefNannyFinishContext();
7402   return __pyx_r;
7403 }
7404 
7405 /* "bx/bbi/bbi_file.pyx":183
7406  *             handler.handle_block( block_data, self )
7407  *
7408  *     cpdef summarize( self, object chrom, bits32 start, bits32 end, int summary_size ):             # <<<<<<<<<<<<<<
7409  *         """
7410  *         Gets `summary_size` data points over the regions `chrom`:`start`-`end`.
7411  */
7412 
7413 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_5summarize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_2bx_3bbi_8bbi_file_7BBIFile_summarize(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self,PyObject * __pyx_v_chrom,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end,int __pyx_v_summary_size,int __pyx_skip_dispatch)7414 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_7BBIFile_summarize(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_chrom, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, int __pyx_v_summary_size, int __pyx_skip_dispatch) {
7415   char *__pyx_v_cchrom;
7416   PyObject *__pyx_v_bytes_chrom = NULL;
7417   PyObject *__pyx_v_chrom_id = NULL;
7418   CYTHON_UNUSED PyObject *__pyx_v_chrom_size = NULL;
7419   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_base_size;
7420   int __pyx_v_full_reduction;
7421   int __pyx_v_zoom;
7422   struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_zoom_level = 0;
7423   PyObject *__pyx_r = NULL;
7424   __Pyx_RefNannyDeclarations
7425   PyObject *__pyx_t_1 = NULL;
7426   PyObject *__pyx_t_2 = NULL;
7427   PyObject *__pyx_t_3 = NULL;
7428   PyObject *__pyx_t_4 = NULL;
7429   PyObject *__pyx_t_5 = NULL;
7430   PyObject *__pyx_t_6 = NULL;
7431   PyObject *__pyx_t_7 = NULL;
7432   int __pyx_t_8;
7433   PyObject *__pyx_t_9 = NULL;
7434   int __pyx_t_10;
7435   PyObject *(*__pyx_t_11)(PyObject *);
7436   int __pyx_t_12;
7437   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_13;
7438   int __pyx_lineno = 0;
7439   const char *__pyx_filename = NULL;
7440   int __pyx_clineno = 0;
7441   __Pyx_RefNannySetupContext("summarize", 0);
7442   /* Check if called by wrapper */
7443   if (unlikely(__pyx_skip_dispatch)) ;
7444   /* Check if overridden in Python */
7445   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)))) {
7446     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
7447     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
7448     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
7449       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
7450       #endif
7451       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_summarize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
7452       __Pyx_GOTREF(__pyx_t_1);
7453       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_5summarize)) {
7454         __Pyx_XDECREF(__pyx_r);
7455         __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
7456         __Pyx_GOTREF(__pyx_t_3);
7457         __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
7458         __Pyx_GOTREF(__pyx_t_4);
7459         __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_summary_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __pyx_L1_error)
7460         __Pyx_GOTREF(__pyx_t_5);
7461         __Pyx_INCREF(__pyx_t_1);
7462         __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
7463         __pyx_t_8 = 0;
7464         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
7465           __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
7466           if (likely(__pyx_t_7)) {
7467             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
7468             __Pyx_INCREF(__pyx_t_7);
7469             __Pyx_INCREF(function);
7470             __Pyx_DECREF_SET(__pyx_t_6, function);
7471             __pyx_t_8 = 1;
7472           }
7473         }
7474         #if CYTHON_FAST_PYCALL
7475         if (PyFunction_Check(__pyx_t_6)) {
7476           PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_v_chrom, __pyx_t_3, __pyx_t_4, __pyx_t_5};
7477           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
7478           __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7479           __Pyx_GOTREF(__pyx_t_2);
7480           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7481           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7482           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7483         } else
7484         #endif
7485         #if CYTHON_FAST_PYCCALL
7486         if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
7487           PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_v_chrom, __pyx_t_3, __pyx_t_4, __pyx_t_5};
7488           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
7489           __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7490           __Pyx_GOTREF(__pyx_t_2);
7491           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7492           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7493           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7494         } else
7495         #endif
7496         {
7497           __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 183, __pyx_L1_error)
7498           __Pyx_GOTREF(__pyx_t_9);
7499           if (__pyx_t_7) {
7500             __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
7501           }
7502           __Pyx_INCREF(__pyx_v_chrom);
7503           __Pyx_GIVEREF(__pyx_v_chrom);
7504           PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_chrom);
7505           __Pyx_GIVEREF(__pyx_t_3);
7506           PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_3);
7507           __Pyx_GIVEREF(__pyx_t_4);
7508           PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_4);
7509           __Pyx_GIVEREF(__pyx_t_5);
7510           PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_t_5);
7511           __pyx_t_3 = 0;
7512           __pyx_t_4 = 0;
7513           __pyx_t_5 = 0;
7514           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
7515           __Pyx_GOTREF(__pyx_t_2);
7516           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7517         }
7518         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7519         __pyx_r = __pyx_t_2;
7520         __pyx_t_2 = 0;
7521         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7522         goto __pyx_L0;
7523       }
7524       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
7525       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
7526       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
7527       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
7528         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
7529       }
7530       #endif
7531       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7532       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
7533     }
7534     #endif
7535   }
7536 
7537   /* "bx/bbi/bbi_file.pyx":188
7538  *         """
7539  *         cdef char * cchrom
7540  *         if PY_MAJOR_VERSION >= 3:             # <<<<<<<<<<<<<<
7541  *             bytes_chrom = chrom.encode()
7542  *         else:
7543  */
7544   __pyx_t_10 = ((PY_MAJOR_VERSION >= 3) != 0);
7545   if (__pyx_t_10) {
7546 
7547     /* "bx/bbi/bbi_file.pyx":189
7548  *         cdef char * cchrom
7549  *         if PY_MAJOR_VERSION >= 3:
7550  *             bytes_chrom = chrom.encode()             # <<<<<<<<<<<<<<
7551  *         else:
7552  *             bytes_chrom = chrom
7553  */
7554     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_chrom, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
7555     __Pyx_GOTREF(__pyx_t_2);
7556     __pyx_t_6 = NULL;
7557     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7558       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
7559       if (likely(__pyx_t_6)) {
7560         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7561         __Pyx_INCREF(__pyx_t_6);
7562         __Pyx_INCREF(function);
7563         __Pyx_DECREF_SET(__pyx_t_2, function);
7564       }
7565     }
7566     __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
7567     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7568     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
7569     __Pyx_GOTREF(__pyx_t_1);
7570     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7571     __pyx_v_bytes_chrom = __pyx_t_1;
7572     __pyx_t_1 = 0;
7573 
7574     /* "bx/bbi/bbi_file.pyx":188
7575  *         """
7576  *         cdef char * cchrom
7577  *         if PY_MAJOR_VERSION >= 3:             # <<<<<<<<<<<<<<
7578  *             bytes_chrom = chrom.encode()
7579  *         else:
7580  */
7581     goto __pyx_L3;
7582   }
7583 
7584   /* "bx/bbi/bbi_file.pyx":191
7585  *             bytes_chrom = chrom.encode()
7586  *         else:
7587  *             bytes_chrom = chrom             # <<<<<<<<<<<<<<
7588  *         cchrom = PyBytes_AsString(bytes_chrom)
7589  *         if start >= end:
7590  */
7591   /*else*/ {
7592     __Pyx_INCREF(__pyx_v_chrom);
7593     __pyx_v_bytes_chrom = __pyx_v_chrom;
7594   }
7595   __pyx_L3:;
7596 
7597   /* "bx/bbi/bbi_file.pyx":192
7598  *         else:
7599  *             bytes_chrom = chrom
7600  *         cchrom = PyBytes_AsString(bytes_chrom)             # <<<<<<<<<<<<<<
7601  *         if start >= end:
7602  *             return None
7603  */
7604   __pyx_v_cchrom = PyBytes_AsString(__pyx_v_bytes_chrom);
7605 
7606   /* "bx/bbi/bbi_file.pyx":193
7607  *             bytes_chrom = chrom
7608  *         cchrom = PyBytes_AsString(bytes_chrom)
7609  *         if start >= end:             # <<<<<<<<<<<<<<
7610  *             return None
7611  *         chrom_id, chrom_size = self._get_chrom_id_and_size( cchrom )
7612  */
7613   __pyx_t_10 = ((__pyx_v_start >= __pyx_v_end) != 0);
7614   if (__pyx_t_10) {
7615 
7616     /* "bx/bbi/bbi_file.pyx":194
7617  *         cchrom = PyBytes_AsString(bytes_chrom)
7618  *         if start >= end:
7619  *             return None             # <<<<<<<<<<<<<<
7620  *         chrom_id, chrom_size = self._get_chrom_id_and_size( cchrom )
7621  *         if chrom_id is None:
7622  */
7623     __Pyx_XDECREF(__pyx_r);
7624     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7625     goto __pyx_L0;
7626 
7627     /* "bx/bbi/bbi_file.pyx":193
7628  *             bytes_chrom = chrom
7629  *         cchrom = PyBytes_AsString(bytes_chrom)
7630  *         if start >= end:             # <<<<<<<<<<<<<<
7631  *             return None
7632  *         chrom_id, chrom_size = self._get_chrom_id_and_size( cchrom )
7633  */
7634   }
7635 
7636   /* "bx/bbi/bbi_file.pyx":195
7637  *         if start >= end:
7638  *             return None
7639  *         chrom_id, chrom_size = self._get_chrom_id_and_size( cchrom )             # <<<<<<<<<<<<<<
7640  *         if chrom_id is None:
7641  *             return None
7642  */
7643   __pyx_t_1 = ((struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self->__pyx_vtab)->_get_chrom_id_and_size(__pyx_v_self, __pyx_v_cchrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
7644   __Pyx_GOTREF(__pyx_t_1);
7645   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
7646     PyObject* sequence = __pyx_t_1;
7647     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7648     if (unlikely(size != 2)) {
7649       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7650       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7651       __PYX_ERR(0, 195, __pyx_L1_error)
7652     }
7653     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7654     if (likely(PyTuple_CheckExact(sequence))) {
7655       __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
7656       __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
7657     } else {
7658       __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
7659       __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
7660     }
7661     __Pyx_INCREF(__pyx_t_2);
7662     __Pyx_INCREF(__pyx_t_6);
7663     #else
7664     __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error)
7665     __Pyx_GOTREF(__pyx_t_2);
7666     __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 195, __pyx_L1_error)
7667     __Pyx_GOTREF(__pyx_t_6);
7668     #endif
7669     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7670   } else {
7671     Py_ssize_t index = -1;
7672     __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 195, __pyx_L1_error)
7673     __Pyx_GOTREF(__pyx_t_9);
7674     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7675     __pyx_t_11 = Py_TYPE(__pyx_t_9)->tp_iternext;
7676     index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
7677     __Pyx_GOTREF(__pyx_t_2);
7678     index = 1; __pyx_t_6 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
7679     __Pyx_GOTREF(__pyx_t_6);
7680     if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
7681     __pyx_t_11 = NULL;
7682     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7683     goto __pyx_L6_unpacking_done;
7684     __pyx_L5_unpacking_failed:;
7685     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7686     __pyx_t_11 = NULL;
7687     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7688     __PYX_ERR(0, 195, __pyx_L1_error)
7689     __pyx_L6_unpacking_done:;
7690   }
7691   __pyx_v_chrom_id = __pyx_t_2;
7692   __pyx_t_2 = 0;
7693   __pyx_v_chrom_size = __pyx_t_6;
7694   __pyx_t_6 = 0;
7695 
7696   /* "bx/bbi/bbi_file.pyx":196
7697  *             return None
7698  *         chrom_id, chrom_size = self._get_chrom_id_and_size( cchrom )
7699  *         if chrom_id is None:             # <<<<<<<<<<<<<<
7700  *             return None
7701  *         # Return value will be a structured array (rather than an array
7702  */
7703   __pyx_t_10 = (__pyx_v_chrom_id == Py_None);
7704   __pyx_t_12 = (__pyx_t_10 != 0);
7705   if (__pyx_t_12) {
7706 
7707     /* "bx/bbi/bbi_file.pyx":197
7708  *         chrom_id, chrom_size = self._get_chrom_id_and_size( cchrom )
7709  *         if chrom_id is None:
7710  *             return None             # <<<<<<<<<<<<<<
7711  *         # Return value will be a structured array (rather than an array
7712  *         # of summary element structures
7713  */
7714     __Pyx_XDECREF(__pyx_r);
7715     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7716     goto __pyx_L0;
7717 
7718     /* "bx/bbi/bbi_file.pyx":196
7719  *             return None
7720  *         chrom_id, chrom_size = self._get_chrom_id_and_size( cchrom )
7721  *         if chrom_id is None:             # <<<<<<<<<<<<<<
7722  *             return None
7723  *         # Return value will be a structured array (rather than an array
7724  */
7725   }
7726 
7727   /* "bx/bbi/bbi_file.pyx":202
7728  *
7729  *         # Find appropriate zoom level
7730  *         cdef bits32 base_size = end - start             # <<<<<<<<<<<<<<
7731  *         cdef int full_reduction = base_size / summary_size
7732  *         cdef int zoom = full_reduction / 2
7733  */
7734   __pyx_v_base_size = (__pyx_v_end - __pyx_v_start);
7735 
7736   /* "bx/bbi/bbi_file.pyx":203
7737  *         # Find appropriate zoom level
7738  *         cdef bits32 base_size = end - start
7739  *         cdef int full_reduction = base_size / summary_size             # <<<<<<<<<<<<<<
7740  *         cdef int zoom = full_reduction / 2
7741  *         if zoom < 0:
7742  */
7743   if (unlikely(__pyx_v_summary_size == 0)) {
7744     PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
7745     __PYX_ERR(0, 203, __pyx_L1_error)
7746   }
7747   __pyx_v_full_reduction = (__pyx_v_base_size / __pyx_v_summary_size);
7748 
7749   /* "bx/bbi/bbi_file.pyx":204
7750  *         cdef bits32 base_size = end - start
7751  *         cdef int full_reduction = base_size / summary_size
7752  *         cdef int zoom = full_reduction / 2             # <<<<<<<<<<<<<<
7753  *         if zoom < 0:
7754  *             zoom = 0
7755  */
7756   __pyx_v_zoom = __Pyx_div_long(__pyx_v_full_reduction, 2);
7757 
7758   /* "bx/bbi/bbi_file.pyx":205
7759  *         cdef int full_reduction = base_size / summary_size
7760  *         cdef int zoom = full_reduction / 2
7761  *         if zoom < 0:             # <<<<<<<<<<<<<<
7762  *             zoom = 0
7763  *         cdef ZoomLevel zoom_level = self._best_zoom_level( zoom )
7764  */
7765   __pyx_t_12 = ((__pyx_v_zoom < 0) != 0);
7766   if (__pyx_t_12) {
7767 
7768     /* "bx/bbi/bbi_file.pyx":206
7769  *         cdef int zoom = full_reduction / 2
7770  *         if zoom < 0:
7771  *             zoom = 0             # <<<<<<<<<<<<<<
7772  *         cdef ZoomLevel zoom_level = self._best_zoom_level( zoom )
7773  *         if zoom_level is not None:
7774  */
7775     __pyx_v_zoom = 0;
7776 
7777     /* "bx/bbi/bbi_file.pyx":205
7778  *         cdef int full_reduction = base_size / summary_size
7779  *         cdef int zoom = full_reduction / 2
7780  *         if zoom < 0:             # <<<<<<<<<<<<<<
7781  *             zoom = 0
7782  *         cdef ZoomLevel zoom_level = self._best_zoom_level( zoom )
7783  */
7784   }
7785 
7786   /* "bx/bbi/bbi_file.pyx":207
7787  *         if zoom < 0:
7788  *             zoom = 0
7789  *         cdef ZoomLevel zoom_level = self._best_zoom_level( zoom )             # <<<<<<<<<<<<<<
7790  *         if zoom_level is not None:
7791  *             return zoom_level._summarize( chrom_id, start, end, summary_size )
7792  */
7793   __pyx_t_1 = ((struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self->__pyx_vtab)->_best_zoom_level(__pyx_v_self, __pyx_v_zoom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
7794   __Pyx_GOTREF(__pyx_t_1);
7795   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2bx_3bbi_8bbi_file_ZoomLevel))))) __PYX_ERR(0, 207, __pyx_L1_error)
7796   __pyx_v_zoom_level = ((struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)__pyx_t_1);
7797   __pyx_t_1 = 0;
7798 
7799   /* "bx/bbi/bbi_file.pyx":208
7800  *             zoom = 0
7801  *         cdef ZoomLevel zoom_level = self._best_zoom_level( zoom )
7802  *         if zoom_level is not None:             # <<<<<<<<<<<<<<
7803  *             return zoom_level._summarize( chrom_id, start, end, summary_size )
7804  *         else:
7805  */
7806   __pyx_t_12 = (((PyObject *)__pyx_v_zoom_level) != Py_None);
7807   __pyx_t_10 = (__pyx_t_12 != 0);
7808   if (__pyx_t_10) {
7809 
7810     /* "bx/bbi/bbi_file.pyx":209
7811  *         cdef ZoomLevel zoom_level = self._best_zoom_level( zoom )
7812  *         if zoom_level is not None:
7813  *             return zoom_level._summarize( chrom_id, start, end, summary_size )             # <<<<<<<<<<<<<<
7814  *         else:
7815  *             return self._summarize_from_full( chrom_id, start, end, summary_size )
7816  */
7817     __Pyx_XDECREF(__pyx_r);
7818     __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, 209, __pyx_L1_error)
7819     __pyx_t_1 = ((struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_ZoomLevel *)__pyx_v_zoom_level->__pyx_vtab)->_summarize(__pyx_v_zoom_level, __pyx_t_13, __pyx_v_start, __pyx_v_end, __pyx_v_summary_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
7820     __Pyx_GOTREF(__pyx_t_1);
7821     __pyx_r = __pyx_t_1;
7822     __pyx_t_1 = 0;
7823     goto __pyx_L0;
7824 
7825     /* "bx/bbi/bbi_file.pyx":208
7826  *             zoom = 0
7827  *         cdef ZoomLevel zoom_level = self._best_zoom_level( zoom )
7828  *         if zoom_level is not None:             # <<<<<<<<<<<<<<
7829  *             return zoom_level._summarize( chrom_id, start, end, summary_size )
7830  *         else:
7831  */
7832   }
7833 
7834   /* "bx/bbi/bbi_file.pyx":211
7835  *             return zoom_level._summarize( chrom_id, start, end, summary_size )
7836  *         else:
7837  *             return self._summarize_from_full( chrom_id, start, end, summary_size )             # <<<<<<<<<<<<<<
7838  *
7839  *     cpdef summarize_from_full( self, char * chrom, bits32 start, bits32 end, int summary_size ):
7840  */
7841   /*else*/ {
7842     __Pyx_XDECREF(__pyx_r);
7843     __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, 211, __pyx_L1_error)
7844     __pyx_t_1 = ((struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self->__pyx_vtab)->_summarize_from_full(__pyx_v_self, __pyx_t_13, __pyx_v_start, __pyx_v_end, __pyx_v_summary_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
7845     __Pyx_GOTREF(__pyx_t_1);
7846     __pyx_r = __pyx_t_1;
7847     __pyx_t_1 = 0;
7848     goto __pyx_L0;
7849   }
7850 
7851   /* "bx/bbi/bbi_file.pyx":183
7852  *             handler.handle_block( block_data, self )
7853  *
7854  *     cpdef summarize( self, object chrom, bits32 start, bits32 end, int summary_size ):             # <<<<<<<<<<<<<<
7855  *         """
7856  *         Gets `summary_size` data points over the regions `chrom`:`start`-`end`.
7857  */
7858 
7859   /* function exit code */
7860   __pyx_L1_error:;
7861   __Pyx_XDECREF(__pyx_t_1);
7862   __Pyx_XDECREF(__pyx_t_2);
7863   __Pyx_XDECREF(__pyx_t_3);
7864   __Pyx_XDECREF(__pyx_t_4);
7865   __Pyx_XDECREF(__pyx_t_5);
7866   __Pyx_XDECREF(__pyx_t_6);
7867   __Pyx_XDECREF(__pyx_t_7);
7868   __Pyx_XDECREF(__pyx_t_9);
7869   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.summarize", __pyx_clineno, __pyx_lineno, __pyx_filename);
7870   __pyx_r = 0;
7871   __pyx_L0:;
7872   __Pyx_XDECREF(__pyx_v_bytes_chrom);
7873   __Pyx_XDECREF(__pyx_v_chrom_id);
7874   __Pyx_XDECREF(__pyx_v_chrom_size);
7875   __Pyx_XDECREF((PyObject *)__pyx_v_zoom_level);
7876   __Pyx_XGIVEREF(__pyx_r);
7877   __Pyx_RefNannyFinishContext();
7878   return __pyx_r;
7879 }
7880 
7881 /* Python wrapper */
7882 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_5summarize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7883 static char __pyx_doc_2bx_3bbi_8bbi_file_7BBIFile_4summarize[] = "\n        Gets `summary_size` data points over the regions `chrom`:`start`-`end`.\n        ";
__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_5summarize(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)7884 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_5summarize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7885   PyObject *__pyx_v_chrom = 0;
7886   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start;
7887   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end;
7888   int __pyx_v_summary_size;
7889   int __pyx_lineno = 0;
7890   const char *__pyx_filename = NULL;
7891   int __pyx_clineno = 0;
7892   PyObject *__pyx_r = 0;
7893   __Pyx_RefNannyDeclarations
7894   __Pyx_RefNannySetupContext("summarize (wrapper)", 0);
7895   {
7896     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_summary_size,0};
7897     PyObject* values[4] = {0,0,0,0};
7898     if (unlikely(__pyx_kwds)) {
7899       Py_ssize_t kw_args;
7900       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7901       switch (pos_args) {
7902         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7903         CYTHON_FALLTHROUGH;
7904         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7905         CYTHON_FALLTHROUGH;
7906         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7907         CYTHON_FALLTHROUGH;
7908         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7909         CYTHON_FALLTHROUGH;
7910         case  0: break;
7911         default: goto __pyx_L5_argtuple_error;
7912       }
7913       kw_args = PyDict_Size(__pyx_kwds);
7914       switch (pos_args) {
7915         case  0:
7916         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
7917         else goto __pyx_L5_argtuple_error;
7918         CYTHON_FALLTHROUGH;
7919         case  1:
7920         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
7921         else {
7922           __Pyx_RaiseArgtupleInvalid("summarize", 1, 4, 4, 1); __PYX_ERR(0, 183, __pyx_L3_error)
7923         }
7924         CYTHON_FALLTHROUGH;
7925         case  2:
7926         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
7927         else {
7928           __Pyx_RaiseArgtupleInvalid("summarize", 1, 4, 4, 2); __PYX_ERR(0, 183, __pyx_L3_error)
7929         }
7930         CYTHON_FALLTHROUGH;
7931         case  3:
7932         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_summary_size)) != 0)) kw_args--;
7933         else {
7934           __Pyx_RaiseArgtupleInvalid("summarize", 1, 4, 4, 3); __PYX_ERR(0, 183, __pyx_L3_error)
7935         }
7936       }
7937       if (unlikely(kw_args > 0)) {
7938         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "summarize") < 0)) __PYX_ERR(0, 183, __pyx_L3_error)
7939       }
7940     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
7941       goto __pyx_L5_argtuple_error;
7942     } else {
7943       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7944       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7945       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7946       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7947     }
7948     __pyx_v_chrom = values[0];
7949     __pyx_v_start = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_start == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L3_error)
7950     __pyx_v_end = __Pyx_PyInt_As_unsigned_int(values[2]); if (unlikely((__pyx_v_end == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L3_error)
7951     __pyx_v_summary_size = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_summary_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L3_error)
7952   }
7953   goto __pyx_L4_argument_unpacking_done;
7954   __pyx_L5_argtuple_error:;
7955   __Pyx_RaiseArgtupleInvalid("summarize", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 183, __pyx_L3_error)
7956   __pyx_L3_error:;
7957   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.summarize", __pyx_clineno, __pyx_lineno, __pyx_filename);
7958   __Pyx_RefNannyFinishContext();
7959   return NULL;
7960   __pyx_L4_argument_unpacking_done:;
7961   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_4summarize(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self), __pyx_v_chrom, __pyx_v_start, __pyx_v_end, __pyx_v_summary_size);
7962 
7963   /* function exit code */
7964   __Pyx_RefNannyFinishContext();
7965   return __pyx_r;
7966 }
7967 
__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_4summarize(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self,PyObject * __pyx_v_chrom,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end,int __pyx_v_summary_size)7968 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_4summarize(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_chrom, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, int __pyx_v_summary_size) {
7969   PyObject *__pyx_r = NULL;
7970   __Pyx_RefNannyDeclarations
7971   PyObject *__pyx_t_1 = NULL;
7972   int __pyx_lineno = 0;
7973   const char *__pyx_filename = NULL;
7974   int __pyx_clineno = 0;
7975   __Pyx_RefNannySetupContext("summarize", 0);
7976   __Pyx_XDECREF(__pyx_r);
7977   __pyx_t_1 = __pyx_f_2bx_3bbi_8bbi_file_7BBIFile_summarize(__pyx_v_self, __pyx_v_chrom, __pyx_v_start, __pyx_v_end, __pyx_v_summary_size, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
7978   __Pyx_GOTREF(__pyx_t_1);
7979   __pyx_r = __pyx_t_1;
7980   __pyx_t_1 = 0;
7981   goto __pyx_L0;
7982 
7983   /* function exit code */
7984   __pyx_L1_error:;
7985   __Pyx_XDECREF(__pyx_t_1);
7986   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.summarize", __pyx_clineno, __pyx_lineno, __pyx_filename);
7987   __pyx_r = NULL;
7988   __pyx_L0:;
7989   __Pyx_XGIVEREF(__pyx_r);
7990   __Pyx_RefNannyFinishContext();
7991   return __pyx_r;
7992 }
7993 
7994 /* "bx/bbi/bbi_file.pyx":213
7995  *             return self._summarize_from_full( chrom_id, start, end, summary_size )
7996  *
7997  *     cpdef summarize_from_full( self, char * chrom, bits32 start, bits32 end, int summary_size ):             # <<<<<<<<<<<<<<
7998  *         """
7999  *         Gets `summary_size` data points over the regions `chrom`:`start`-`end`,
8000  */
8001 
8002 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_7summarize_from_full(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_2bx_3bbi_8bbi_file_7BBIFile_summarize_from_full(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __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_v_summary_size,int __pyx_skip_dispatch)8003 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_7BBIFile_summarize_from_full(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__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_v_summary_size, int __pyx_skip_dispatch) {
8004   PyObject *__pyx_v_chrom_id = NULL;
8005   CYTHON_UNUSED PyObject *__pyx_v_chrom_size = NULL;
8006   PyObject *__pyx_r = NULL;
8007   __Pyx_RefNannyDeclarations
8008   PyObject *__pyx_t_1 = NULL;
8009   PyObject *__pyx_t_2 = NULL;
8010   PyObject *__pyx_t_3 = NULL;
8011   PyObject *__pyx_t_4 = NULL;
8012   PyObject *__pyx_t_5 = NULL;
8013   PyObject *__pyx_t_6 = NULL;
8014   PyObject *__pyx_t_7 = NULL;
8015   PyObject *__pyx_t_8 = NULL;
8016   int __pyx_t_9;
8017   PyObject *__pyx_t_10 = NULL;
8018   int __pyx_t_11;
8019   PyObject *(*__pyx_t_12)(PyObject *);
8020   int __pyx_t_13;
8021   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_14;
8022   int __pyx_lineno = 0;
8023   const char *__pyx_filename = NULL;
8024   int __pyx_clineno = 0;
8025   __Pyx_RefNannySetupContext("summarize_from_full", 0);
8026   /* Check if called by wrapper */
8027   if (unlikely(__pyx_skip_dispatch)) ;
8028   /* Check if overridden in Python */
8029   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)))) {
8030     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
8031     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
8032     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
8033       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
8034       #endif
8035       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_summarize_from_full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
8036       __Pyx_GOTREF(__pyx_t_1);
8037       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_7summarize_from_full)) {
8038         __Pyx_XDECREF(__pyx_r);
8039         __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_chrom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
8040         __Pyx_GOTREF(__pyx_t_3);
8041         __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error)
8042         __Pyx_GOTREF(__pyx_t_4);
8043         __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error)
8044         __Pyx_GOTREF(__pyx_t_5);
8045         __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_summary_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 213, __pyx_L1_error)
8046         __Pyx_GOTREF(__pyx_t_6);
8047         __Pyx_INCREF(__pyx_t_1);
8048         __pyx_t_7 = __pyx_t_1; __pyx_t_8 = NULL;
8049         __pyx_t_9 = 0;
8050         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
8051           __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
8052           if (likely(__pyx_t_8)) {
8053             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
8054             __Pyx_INCREF(__pyx_t_8);
8055             __Pyx_INCREF(function);
8056             __Pyx_DECREF_SET(__pyx_t_7, function);
8057             __pyx_t_9 = 1;
8058           }
8059         }
8060         #if CYTHON_FAST_PYCALL
8061         if (PyFunction_Check(__pyx_t_7)) {
8062           PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6};
8063           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 4+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
8064           __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8065           __Pyx_GOTREF(__pyx_t_2);
8066           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8067           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8068           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8069           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8070         } else
8071         #endif
8072         #if CYTHON_FAST_PYCCALL
8073         if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
8074           PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6};
8075           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 4+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
8076           __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8077           __Pyx_GOTREF(__pyx_t_2);
8078           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8079           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8080           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8081           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8082         } else
8083         #endif
8084         {
8085           __pyx_t_10 = PyTuple_New(4+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 213, __pyx_L1_error)
8086           __Pyx_GOTREF(__pyx_t_10);
8087           if (__pyx_t_8) {
8088             __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
8089           }
8090           __Pyx_GIVEREF(__pyx_t_3);
8091           PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_3);
8092           __Pyx_GIVEREF(__pyx_t_4);
8093           PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_4);
8094           __Pyx_GIVEREF(__pyx_t_5);
8095           PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_5);
8096           __Pyx_GIVEREF(__pyx_t_6);
8097           PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_9, __pyx_t_6);
8098           __pyx_t_3 = 0;
8099           __pyx_t_4 = 0;
8100           __pyx_t_5 = 0;
8101           __pyx_t_6 = 0;
8102           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
8103           __Pyx_GOTREF(__pyx_t_2);
8104           __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8105         }
8106         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8107         __pyx_r = __pyx_t_2;
8108         __pyx_t_2 = 0;
8109         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8110         goto __pyx_L0;
8111       }
8112       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
8113       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
8114       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
8115       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
8116         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
8117       }
8118       #endif
8119       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8120       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
8121     }
8122     #endif
8123   }
8124 
8125   /* "bx/bbi/bbi_file.pyx":218
8126  *         always using the raw data points
8127  *         """
8128  *         if start >= end:             # <<<<<<<<<<<<<<
8129  *             return None
8130  *         chrom_id, chrom_size = self._get_chrom_id_and_size( chrom )
8131  */
8132   __pyx_t_11 = ((__pyx_v_start >= __pyx_v_end) != 0);
8133   if (__pyx_t_11) {
8134 
8135     /* "bx/bbi/bbi_file.pyx":219
8136  *         """
8137  *         if start >= end:
8138  *             return None             # <<<<<<<<<<<<<<
8139  *         chrom_id, chrom_size = self._get_chrom_id_and_size( chrom )
8140  *         if chrom_id is None:
8141  */
8142     __Pyx_XDECREF(__pyx_r);
8143     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8144     goto __pyx_L0;
8145 
8146     /* "bx/bbi/bbi_file.pyx":218
8147  *         always using the raw data points
8148  *         """
8149  *         if start >= end:             # <<<<<<<<<<<<<<
8150  *             return None
8151  *         chrom_id, chrom_size = self._get_chrom_id_and_size( chrom )
8152  */
8153   }
8154 
8155   /* "bx/bbi/bbi_file.pyx":220
8156  *         if start >= end:
8157  *             return None
8158  *         chrom_id, chrom_size = self._get_chrom_id_and_size( chrom )             # <<<<<<<<<<<<<<
8159  *         if chrom_id is None:
8160  *             return None
8161  */
8162   __pyx_t_1 = ((struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self->__pyx_vtab)->_get_chrom_id_and_size(__pyx_v_self, __pyx_v_chrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
8163   __Pyx_GOTREF(__pyx_t_1);
8164   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
8165     PyObject* sequence = __pyx_t_1;
8166     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8167     if (unlikely(size != 2)) {
8168       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8169       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8170       __PYX_ERR(0, 220, __pyx_L1_error)
8171     }
8172     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8173     if (likely(PyTuple_CheckExact(sequence))) {
8174       __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
8175       __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
8176     } else {
8177       __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
8178       __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
8179     }
8180     __Pyx_INCREF(__pyx_t_2);
8181     __Pyx_INCREF(__pyx_t_7);
8182     #else
8183     __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
8184     __Pyx_GOTREF(__pyx_t_2);
8185     __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 220, __pyx_L1_error)
8186     __Pyx_GOTREF(__pyx_t_7);
8187     #endif
8188     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8189   } else {
8190     Py_ssize_t index = -1;
8191     __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 220, __pyx_L1_error)
8192     __Pyx_GOTREF(__pyx_t_10);
8193     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8194     __pyx_t_12 = Py_TYPE(__pyx_t_10)->tp_iternext;
8195     index = 0; __pyx_t_2 = __pyx_t_12(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
8196     __Pyx_GOTREF(__pyx_t_2);
8197     index = 1; __pyx_t_7 = __pyx_t_12(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L4_unpacking_failed;
8198     __Pyx_GOTREF(__pyx_t_7);
8199     if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_10), 2) < 0) __PYX_ERR(0, 220, __pyx_L1_error)
8200     __pyx_t_12 = NULL;
8201     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8202     goto __pyx_L5_unpacking_done;
8203     __pyx_L4_unpacking_failed:;
8204     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8205     __pyx_t_12 = NULL;
8206     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
8207     __PYX_ERR(0, 220, __pyx_L1_error)
8208     __pyx_L5_unpacking_done:;
8209   }
8210   __pyx_v_chrom_id = __pyx_t_2;
8211   __pyx_t_2 = 0;
8212   __pyx_v_chrom_size = __pyx_t_7;
8213   __pyx_t_7 = 0;
8214 
8215   /* "bx/bbi/bbi_file.pyx":221
8216  *             return None
8217  *         chrom_id, chrom_size = self._get_chrom_id_and_size( chrom )
8218  *         if chrom_id is None:             # <<<<<<<<<<<<<<
8219  *             return None
8220  *         # Return value will be a structured array (rather than an array
8221  */
8222   __pyx_t_11 = (__pyx_v_chrom_id == Py_None);
8223   __pyx_t_13 = (__pyx_t_11 != 0);
8224   if (__pyx_t_13) {
8225 
8226     /* "bx/bbi/bbi_file.pyx":222
8227  *         chrom_id, chrom_size = self._get_chrom_id_and_size( chrom )
8228  *         if chrom_id is None:
8229  *             return None             # <<<<<<<<<<<<<<
8230  *         # Return value will be a structured array (rather than an array
8231  *         # of summary element structures
8232  */
8233     __Pyx_XDECREF(__pyx_r);
8234     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8235     goto __pyx_L0;
8236 
8237     /* "bx/bbi/bbi_file.pyx":221
8238  *             return None
8239  *         chrom_id, chrom_size = self._get_chrom_id_and_size( chrom )
8240  *         if chrom_id is None:             # <<<<<<<<<<<<<<
8241  *             return None
8242  *         # Return value will be a structured array (rather than an array
8243  */
8244   }
8245 
8246   /* "bx/bbi/bbi_file.pyx":225
8247  *         # Return value will be a structured array (rather than an array
8248  *         # of summary element structures
8249  *         return self._summarize_from_full( chrom_id, start, end, summary_size )             # <<<<<<<<<<<<<<
8250  *
8251  *     cpdef query( self, object chrom, bits32 start, bits32 end, int summary_size ):
8252  */
8253   __Pyx_XDECREF(__pyx_r);
8254   __pyx_t_14 = __Pyx_PyInt_As_unsigned_int(__pyx_v_chrom_id); if (unlikely((__pyx_t_14 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error)
8255   __pyx_t_1 = ((struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self->__pyx_vtab)->_summarize_from_full(__pyx_v_self, __pyx_t_14, __pyx_v_start, __pyx_v_end, __pyx_v_summary_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
8256   __Pyx_GOTREF(__pyx_t_1);
8257   __pyx_r = __pyx_t_1;
8258   __pyx_t_1 = 0;
8259   goto __pyx_L0;
8260 
8261   /* "bx/bbi/bbi_file.pyx":213
8262  *             return self._summarize_from_full( chrom_id, start, end, summary_size )
8263  *
8264  *     cpdef summarize_from_full( self, char * chrom, bits32 start, bits32 end, int summary_size ):             # <<<<<<<<<<<<<<
8265  *         """
8266  *         Gets `summary_size` data points over the regions `chrom`:`start`-`end`,
8267  */
8268 
8269   /* function exit code */
8270   __pyx_L1_error:;
8271   __Pyx_XDECREF(__pyx_t_1);
8272   __Pyx_XDECREF(__pyx_t_2);
8273   __Pyx_XDECREF(__pyx_t_3);
8274   __Pyx_XDECREF(__pyx_t_4);
8275   __Pyx_XDECREF(__pyx_t_5);
8276   __Pyx_XDECREF(__pyx_t_6);
8277   __Pyx_XDECREF(__pyx_t_7);
8278   __Pyx_XDECREF(__pyx_t_8);
8279   __Pyx_XDECREF(__pyx_t_10);
8280   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.summarize_from_full", __pyx_clineno, __pyx_lineno, __pyx_filename);
8281   __pyx_r = 0;
8282   __pyx_L0:;
8283   __Pyx_XDECREF(__pyx_v_chrom_id);
8284   __Pyx_XDECREF(__pyx_v_chrom_size);
8285   __Pyx_XGIVEREF(__pyx_r);
8286   __Pyx_RefNannyFinishContext();
8287   return __pyx_r;
8288 }
8289 
8290 /* Python wrapper */
8291 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_7summarize_from_full(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8292 static char __pyx_doc_2bx_3bbi_8bbi_file_7BBIFile_6summarize_from_full[] = "\n        Gets `summary_size` data points over the regions `chrom`:`start`-`end`, \n        always using the raw data points\n        ";
__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_7summarize_from_full(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)8293 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_7summarize_from_full(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8294   char *__pyx_v_chrom;
8295   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start;
8296   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end;
8297   int __pyx_v_summary_size;
8298   int __pyx_lineno = 0;
8299   const char *__pyx_filename = NULL;
8300   int __pyx_clineno = 0;
8301   PyObject *__pyx_r = 0;
8302   __Pyx_RefNannyDeclarations
8303   __Pyx_RefNannySetupContext("summarize_from_full (wrapper)", 0);
8304   {
8305     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_summary_size,0};
8306     PyObject* values[4] = {0,0,0,0};
8307     if (unlikely(__pyx_kwds)) {
8308       Py_ssize_t kw_args;
8309       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8310       switch (pos_args) {
8311         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8312         CYTHON_FALLTHROUGH;
8313         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8314         CYTHON_FALLTHROUGH;
8315         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8316         CYTHON_FALLTHROUGH;
8317         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8318         CYTHON_FALLTHROUGH;
8319         case  0: break;
8320         default: goto __pyx_L5_argtuple_error;
8321       }
8322       kw_args = PyDict_Size(__pyx_kwds);
8323       switch (pos_args) {
8324         case  0:
8325         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
8326         else goto __pyx_L5_argtuple_error;
8327         CYTHON_FALLTHROUGH;
8328         case  1:
8329         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
8330         else {
8331           __Pyx_RaiseArgtupleInvalid("summarize_from_full", 1, 4, 4, 1); __PYX_ERR(0, 213, __pyx_L3_error)
8332         }
8333         CYTHON_FALLTHROUGH;
8334         case  2:
8335         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
8336         else {
8337           __Pyx_RaiseArgtupleInvalid("summarize_from_full", 1, 4, 4, 2); __PYX_ERR(0, 213, __pyx_L3_error)
8338         }
8339         CYTHON_FALLTHROUGH;
8340         case  3:
8341         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_summary_size)) != 0)) kw_args--;
8342         else {
8343           __Pyx_RaiseArgtupleInvalid("summarize_from_full", 1, 4, 4, 3); __PYX_ERR(0, 213, __pyx_L3_error)
8344         }
8345       }
8346       if (unlikely(kw_args > 0)) {
8347         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "summarize_from_full") < 0)) __PYX_ERR(0, 213, __pyx_L3_error)
8348       }
8349     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
8350       goto __pyx_L5_argtuple_error;
8351     } else {
8352       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8353       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8354       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8355       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8356     }
8357     __pyx_v_chrom = __Pyx_PyObject_AsWritableString(values[0]); if (unlikely((!__pyx_v_chrom) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L3_error)
8358     __pyx_v_start = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_start == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L3_error)
8359     __pyx_v_end = __Pyx_PyInt_As_unsigned_int(values[2]); if (unlikely((__pyx_v_end == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L3_error)
8360     __pyx_v_summary_size = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_summary_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L3_error)
8361   }
8362   goto __pyx_L4_argument_unpacking_done;
8363   __pyx_L5_argtuple_error:;
8364   __Pyx_RaiseArgtupleInvalid("summarize_from_full", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 213, __pyx_L3_error)
8365   __pyx_L3_error:;
8366   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.summarize_from_full", __pyx_clineno, __pyx_lineno, __pyx_filename);
8367   __Pyx_RefNannyFinishContext();
8368   return NULL;
8369   __pyx_L4_argument_unpacking_done:;
8370   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_6summarize_from_full(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self), __pyx_v_chrom, __pyx_v_start, __pyx_v_end, __pyx_v_summary_size);
8371 
8372   /* function exit code */
8373   __Pyx_RefNannyFinishContext();
8374   return __pyx_r;
8375 }
8376 
__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_6summarize_from_full(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __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_v_summary_size)8377 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_6summarize_from_full(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__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_v_summary_size) {
8378   PyObject *__pyx_r = NULL;
8379   __Pyx_RefNannyDeclarations
8380   PyObject *__pyx_t_1 = NULL;
8381   int __pyx_lineno = 0;
8382   const char *__pyx_filename = NULL;
8383   int __pyx_clineno = 0;
8384   __Pyx_RefNannySetupContext("summarize_from_full", 0);
8385   __Pyx_XDECREF(__pyx_r);
8386   __pyx_t_1 = __pyx_f_2bx_3bbi_8bbi_file_7BBIFile_summarize_from_full(__pyx_v_self, __pyx_v_chrom, __pyx_v_start, __pyx_v_end, __pyx_v_summary_size, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
8387   __Pyx_GOTREF(__pyx_t_1);
8388   __pyx_r = __pyx_t_1;
8389   __pyx_t_1 = 0;
8390   goto __pyx_L0;
8391 
8392   /* function exit code */
8393   __pyx_L1_error:;
8394   __Pyx_XDECREF(__pyx_t_1);
8395   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.summarize_from_full", __pyx_clineno, __pyx_lineno, __pyx_filename);
8396   __pyx_r = NULL;
8397   __pyx_L0:;
8398   __Pyx_XGIVEREF(__pyx_r);
8399   __Pyx_RefNannyFinishContext();
8400   return __pyx_r;
8401 }
8402 
8403 /* "bx/bbi/bbi_file.pyx":227
8404  *         return self._summarize_from_full( chrom_id, start, end, summary_size )
8405  *
8406  *     cpdef query( self, object chrom, bits32 start, bits32 end, int summary_size ):             # <<<<<<<<<<<<<<
8407  *         """
8408  *         Provides a different view of summary for region, a list of dictionaries
8409  */
8410 
8411 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_9query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_2bx_3bbi_8bbi_file_7BBIFile_query(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self,PyObject * __pyx_v_chrom,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end,int __pyx_v_summary_size,int __pyx_skip_dispatch)8412 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_7BBIFile_query(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_chrom, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, int __pyx_v_summary_size, int __pyx_skip_dispatch) {
8413   PyObject *__pyx_v_results = NULL;
8414   PyObject *__pyx_v_rval = NULL;
8415   int __pyx_v_i;
8416   PyObject *__pyx_v_sum_data = NULL;
8417   PyObject *__pyx_v_valid_count = NULL;
8418   PyObject *__pyx_v_mean = NULL;
8419   PyObject *__pyx_v_coverage = NULL;
8420   PyObject *__pyx_v_variance = NULL;
8421   PyObject *__pyx_v_std_dev = NULL;
8422   PyObject *__pyx_r = NULL;
8423   __Pyx_RefNannyDeclarations
8424   PyObject *__pyx_t_1 = NULL;
8425   PyObject *__pyx_t_2 = NULL;
8426   PyObject *__pyx_t_3 = NULL;
8427   PyObject *__pyx_t_4 = NULL;
8428   PyObject *__pyx_t_5 = NULL;
8429   PyObject *__pyx_t_6 = NULL;
8430   PyObject *__pyx_t_7 = NULL;
8431   int __pyx_t_8;
8432   PyObject *__pyx_t_9 = NULL;
8433   int __pyx_t_10;
8434   int __pyx_t_11;
8435   int __pyx_t_12;
8436   int __pyx_t_13;
8437   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_14;
8438   long __pyx_t_15;
8439   int __pyx_t_16;
8440   int __pyx_lineno = 0;
8441   const char *__pyx_filename = NULL;
8442   int __pyx_clineno = 0;
8443   __Pyx_RefNannySetupContext("query", 0);
8444   /* Check if called by wrapper */
8445   if (unlikely(__pyx_skip_dispatch)) ;
8446   /* Check if overridden in Python */
8447   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)))) {
8448     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
8449     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
8450     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
8451       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
8452       #endif
8453       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
8454       __Pyx_GOTREF(__pyx_t_1);
8455       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_9query)) {
8456         __Pyx_XDECREF(__pyx_r);
8457         __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error)
8458         __Pyx_GOTREF(__pyx_t_3);
8459         __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error)
8460         __Pyx_GOTREF(__pyx_t_4);
8461         __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_summary_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L1_error)
8462         __Pyx_GOTREF(__pyx_t_5);
8463         __Pyx_INCREF(__pyx_t_1);
8464         __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
8465         __pyx_t_8 = 0;
8466         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
8467           __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
8468           if (likely(__pyx_t_7)) {
8469             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
8470             __Pyx_INCREF(__pyx_t_7);
8471             __Pyx_INCREF(function);
8472             __Pyx_DECREF_SET(__pyx_t_6, function);
8473             __pyx_t_8 = 1;
8474           }
8475         }
8476         #if CYTHON_FAST_PYCALL
8477         if (PyFunction_Check(__pyx_t_6)) {
8478           PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_v_chrom, __pyx_t_3, __pyx_t_4, __pyx_t_5};
8479           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
8480           __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8481           __Pyx_GOTREF(__pyx_t_2);
8482           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8483           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8484           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8485         } else
8486         #endif
8487         #if CYTHON_FAST_PYCCALL
8488         if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
8489           PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_v_chrom, __pyx_t_3, __pyx_t_4, __pyx_t_5};
8490           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
8491           __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8492           __Pyx_GOTREF(__pyx_t_2);
8493           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8494           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8495           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8496         } else
8497         #endif
8498         {
8499           __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 227, __pyx_L1_error)
8500           __Pyx_GOTREF(__pyx_t_9);
8501           if (__pyx_t_7) {
8502             __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
8503           }
8504           __Pyx_INCREF(__pyx_v_chrom);
8505           __Pyx_GIVEREF(__pyx_v_chrom);
8506           PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_chrom);
8507           __Pyx_GIVEREF(__pyx_t_3);
8508           PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_3);
8509           __Pyx_GIVEREF(__pyx_t_4);
8510           PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_4);
8511           __Pyx_GIVEREF(__pyx_t_5);
8512           PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_t_5);
8513           __pyx_t_3 = 0;
8514           __pyx_t_4 = 0;
8515           __pyx_t_5 = 0;
8516           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
8517           __Pyx_GOTREF(__pyx_t_2);
8518           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8519         }
8520         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8521         __pyx_r = __pyx_t_2;
8522         __pyx_t_2 = 0;
8523         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8524         goto __pyx_L0;
8525       }
8526       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
8527       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
8528       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
8529       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
8530         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
8531       }
8532       #endif
8533       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8534       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
8535     }
8536     #endif
8537   }
8538 
8539   /* "bx/bbi/bbi_file.pyx":233
8540  *         """
8541  *
8542  *         if end > 2147483647 or start < 0:             # <<<<<<<<<<<<<<
8543  *             raise ValueError
8544  *         results = self.summarize(chrom, start, end, summary_size)
8545  */
8546   __pyx_t_11 = ((__pyx_v_end > 0x7FFFFFFF) != 0);
8547   if (!__pyx_t_11) {
8548   } else {
8549     __pyx_t_10 = __pyx_t_11;
8550     goto __pyx_L4_bool_binop_done;
8551   }
8552   __pyx_t_11 = ((__pyx_v_start < 0) != 0);
8553   __pyx_t_10 = __pyx_t_11;
8554   __pyx_L4_bool_binop_done:;
8555   if (unlikely(__pyx_t_10)) {
8556 
8557     /* "bx/bbi/bbi_file.pyx":234
8558  *
8559  *         if end > 2147483647 or start < 0:
8560  *             raise ValueError             # <<<<<<<<<<<<<<
8561  *         results = self.summarize(chrom, start, end, summary_size)
8562  *
8563  */
8564     __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
8565     __PYX_ERR(0, 234, __pyx_L1_error)
8566 
8567     /* "bx/bbi/bbi_file.pyx":233
8568  *         """
8569  *
8570  *         if end > 2147483647 or start < 0:             # <<<<<<<<<<<<<<
8571  *             raise ValueError
8572  *         results = self.summarize(chrom, start, end, summary_size)
8573  */
8574   }
8575 
8576   /* "bx/bbi/bbi_file.pyx":235
8577  *         if end > 2147483647 or start < 0:
8578  *             raise ValueError
8579  *         results = self.summarize(chrom, start, end, summary_size)             # <<<<<<<<<<<<<<
8580  *
8581  *         if not results:
8582  */
8583   __pyx_t_1 = ((struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self->__pyx_vtab)->summarize(__pyx_v_self, __pyx_v_chrom, __pyx_v_start, __pyx_v_end, __pyx_v_summary_size, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
8584   __Pyx_GOTREF(__pyx_t_1);
8585   __pyx_v_results = __pyx_t_1;
8586   __pyx_t_1 = 0;
8587 
8588   /* "bx/bbi/bbi_file.pyx":237
8589  *         results = self.summarize(chrom, start, end, summary_size)
8590  *
8591  *         if not results:             # <<<<<<<<<<<<<<
8592  *             return None
8593  *
8594  */
8595   __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_results); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 237, __pyx_L1_error)
8596   __pyx_t_11 = ((!__pyx_t_10) != 0);
8597   if (__pyx_t_11) {
8598 
8599     /* "bx/bbi/bbi_file.pyx":238
8600  *
8601  *         if not results:
8602  *             return None             # <<<<<<<<<<<<<<
8603  *
8604  *         rval = []
8605  */
8606     __Pyx_XDECREF(__pyx_r);
8607     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8608     goto __pyx_L0;
8609 
8610     /* "bx/bbi/bbi_file.pyx":237
8611  *         results = self.summarize(chrom, start, end, summary_size)
8612  *
8613  *         if not results:             # <<<<<<<<<<<<<<
8614  *             return None
8615  *
8616  */
8617   }
8618 
8619   /* "bx/bbi/bbi_file.pyx":240
8620  *             return None
8621  *
8622  *         rval = []             # <<<<<<<<<<<<<<
8623  *         for i in range(summary_size):
8624  *             sum_data = results.sum_data[i]
8625  */
8626   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
8627   __Pyx_GOTREF(__pyx_t_1);
8628   __pyx_v_rval = ((PyObject*)__pyx_t_1);
8629   __pyx_t_1 = 0;
8630 
8631   /* "bx/bbi/bbi_file.pyx":241
8632  *
8633  *         rval = []
8634  *         for i in range(summary_size):             # <<<<<<<<<<<<<<
8635  *             sum_data = results.sum_data[i]
8636  *             valid_count = results.valid_count[i]
8637  */
8638   __pyx_t_8 = __pyx_v_summary_size;
8639   __pyx_t_12 = __pyx_t_8;
8640   for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
8641     __pyx_v_i = __pyx_t_13;
8642 
8643     /* "bx/bbi/bbi_file.pyx":242
8644  *         rval = []
8645  *         for i in range(summary_size):
8646  *             sum_data = results.sum_data[i]             # <<<<<<<<<<<<<<
8647  *             valid_count = results.valid_count[i]
8648  *             mean = sum_data / valid_count
8649  */
8650     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_results, __pyx_n_s_sum_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
8651     __Pyx_GOTREF(__pyx_t_1);
8652     __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
8653     __Pyx_GOTREF(__pyx_t_2);
8654     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8655     __Pyx_XDECREF_SET(__pyx_v_sum_data, __pyx_t_2);
8656     __pyx_t_2 = 0;
8657 
8658     /* "bx/bbi/bbi_file.pyx":243
8659  *         for i in range(summary_size):
8660  *             sum_data = results.sum_data[i]
8661  *             valid_count = results.valid_count[i]             # <<<<<<<<<<<<<<
8662  *             mean = sum_data / valid_count
8663  *             coverage = <double> summary_size / (end - start) * valid_count
8664  */
8665     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_results, __pyx_n_s_valid_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
8666     __Pyx_GOTREF(__pyx_t_2);
8667     __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
8668     __Pyx_GOTREF(__pyx_t_1);
8669     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8670     __Pyx_XDECREF_SET(__pyx_v_valid_count, __pyx_t_1);
8671     __pyx_t_1 = 0;
8672 
8673     /* "bx/bbi/bbi_file.pyx":244
8674  *             sum_data = results.sum_data[i]
8675  *             valid_count = results.valid_count[i]
8676  *             mean = sum_data / valid_count             # <<<<<<<<<<<<<<
8677  *             coverage = <double> summary_size / (end - start) * valid_count
8678  *
8679  */
8680     __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_sum_data, __pyx_v_valid_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
8681     __Pyx_GOTREF(__pyx_t_1);
8682     __Pyx_XDECREF_SET(__pyx_v_mean, __pyx_t_1);
8683     __pyx_t_1 = 0;
8684 
8685     /* "bx/bbi/bbi_file.pyx":245
8686  *             valid_count = results.valid_count[i]
8687  *             mean = sum_data / valid_count
8688  *             coverage = <double> summary_size / (end - start) * valid_count             # <<<<<<<<<<<<<<
8689  *
8690  *             # print results.sum_squares[i], sum_data, valid_count
8691  */
8692     __pyx_t_14 = (__pyx_v_end - __pyx_v_start);
8693     if (unlikely(__pyx_t_14 == 0)) {
8694       PyErr_SetString(PyExc_ZeroDivisionError, "float division");
8695       __PYX_ERR(0, 245, __pyx_L1_error)
8696     }
8697     __pyx_t_1 = PyFloat_FromDouble((((double)__pyx_v_summary_size) / __pyx_t_14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
8698     __Pyx_GOTREF(__pyx_t_1);
8699     __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_valid_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error)
8700     __Pyx_GOTREF(__pyx_t_2);
8701     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8702     __Pyx_XDECREF_SET(__pyx_v_coverage, __pyx_t_2);
8703     __pyx_t_2 = 0;
8704 
8705     /* "bx/bbi/bbi_file.pyx":248
8706  *
8707  *             # print results.sum_squares[i], sum_data, valid_count
8708  *             variance = results.sum_squares[i] - sum_data * sum_data / valid_count             # <<<<<<<<<<<<<<
8709  *             if valid_count > 1:
8710  *                 variance /= valid_count - 1
8711  */
8712     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_results, __pyx_n_s_sum_squares); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
8713     __Pyx_GOTREF(__pyx_t_2);
8714     __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
8715     __Pyx_GOTREF(__pyx_t_1);
8716     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8717     __pyx_t_2 = PyNumber_Multiply(__pyx_v_sum_data, __pyx_v_sum_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
8718     __Pyx_GOTREF(__pyx_t_2);
8719     __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_valid_count); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error)
8720     __Pyx_GOTREF(__pyx_t_6);
8721     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8722     __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
8723     __Pyx_GOTREF(__pyx_t_2);
8724     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8725     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8726     __Pyx_XDECREF_SET(__pyx_v_variance, __pyx_t_2);
8727     __pyx_t_2 = 0;
8728 
8729     /* "bx/bbi/bbi_file.pyx":249
8730  *             # print results.sum_squares[i], sum_data, valid_count
8731  *             variance = results.sum_squares[i] - sum_data * sum_data / valid_count
8732  *             if valid_count > 1:             # <<<<<<<<<<<<<<
8733  *                 variance /= valid_count - 1
8734  *             std_dev = math.sqrt(max(variance, 0))
8735  */
8736     __pyx_t_2 = PyObject_RichCompare(__pyx_v_valid_count, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
8737     __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 249, __pyx_L1_error)
8738     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8739     if (__pyx_t_11) {
8740 
8741       /* "bx/bbi/bbi_file.pyx":250
8742  *             variance = results.sum_squares[i] - sum_data * sum_data / valid_count
8743  *             if valid_count > 1:
8744  *                 variance /= valid_count - 1             # <<<<<<<<<<<<<<
8745  *             std_dev = math.sqrt(max(variance, 0))
8746  *
8747  */
8748       __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_valid_count, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
8749       __Pyx_GOTREF(__pyx_t_2);
8750       __pyx_t_6 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_variance, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error)
8751       __Pyx_GOTREF(__pyx_t_6);
8752       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8753       __Pyx_DECREF_SET(__pyx_v_variance, __pyx_t_6);
8754       __pyx_t_6 = 0;
8755 
8756       /* "bx/bbi/bbi_file.pyx":249
8757  *             # print results.sum_squares[i], sum_data, valid_count
8758  *             variance = results.sum_squares[i] - sum_data * sum_data / valid_count
8759  *             if valid_count > 1:             # <<<<<<<<<<<<<<
8760  *                 variance /= valid_count - 1
8761  *             std_dev = math.sqrt(max(variance, 0))
8762  */
8763     }
8764 
8765     /* "bx/bbi/bbi_file.pyx":251
8766  *             if valid_count > 1:
8767  *                 variance /= valid_count - 1
8768  *             std_dev = math.sqrt(max(variance, 0))             # <<<<<<<<<<<<<<
8769  *
8770  *             rval.append( { "mean": mean, "max": results.max_val[i], "min": results.min_val[i], \
8771  */
8772     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
8773     __Pyx_GOTREF(__pyx_t_2);
8774     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
8775     __Pyx_GOTREF(__pyx_t_1);
8776     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8777     __pyx_t_15 = 0;
8778     __Pyx_INCREF(__pyx_v_variance);
8779     __pyx_t_2 = __pyx_v_variance;
8780     __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_15); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error)
8781     __Pyx_GOTREF(__pyx_t_5);
8782     __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
8783     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8784     __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 251, __pyx_L1_error)
8785     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8786     if (__pyx_t_11) {
8787       __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
8788       __Pyx_GOTREF(__pyx_t_4);
8789       __pyx_t_9 = __pyx_t_4;
8790       __pyx_t_4 = 0;
8791     } else {
8792       __Pyx_INCREF(__pyx_t_2);
8793       __pyx_t_9 = __pyx_t_2;
8794     }
8795     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8796     __pyx_t_2 = NULL;
8797     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
8798       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
8799       if (likely(__pyx_t_2)) {
8800         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
8801         __Pyx_INCREF(__pyx_t_2);
8802         __Pyx_INCREF(function);
8803         __Pyx_DECREF_SET(__pyx_t_1, function);
8804       }
8805     }
8806     __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9);
8807     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8808     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8809     if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error)
8810     __Pyx_GOTREF(__pyx_t_6);
8811     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8812     __Pyx_XDECREF_SET(__pyx_v_std_dev, __pyx_t_6);
8813     __pyx_t_6 = 0;
8814 
8815     /* "bx/bbi/bbi_file.pyx":253
8816  *             std_dev = math.sqrt(max(variance, 0))
8817  *
8818  *             rval.append( { "mean": mean, "max": results.max_val[i], "min": results.min_val[i], \             # <<<<<<<<<<<<<<
8819  *                         "coverage": coverage, "std_dev": std_dev } )
8820  *
8821  */
8822     __pyx_t_6 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error)
8823     __Pyx_GOTREF(__pyx_t_6);
8824     if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mean, __pyx_v_mean) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
8825     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_results, __pyx_n_s_max_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
8826     __Pyx_GOTREF(__pyx_t_1);
8827     __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 253, __pyx_L1_error)
8828     __Pyx_GOTREF(__pyx_t_9);
8829     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8830     if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_max, __pyx_t_9) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
8831     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8832     __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_results, __pyx_n_s_min_val); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 253, __pyx_L1_error)
8833     __Pyx_GOTREF(__pyx_t_9);
8834     __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_9, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
8835     __Pyx_GOTREF(__pyx_t_1);
8836     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8837     if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_min, __pyx_t_1) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
8838     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8839 
8840     /* "bx/bbi/bbi_file.pyx":254
8841  *
8842  *             rval.append( { "mean": mean, "max": results.max_val[i], "min": results.min_val[i], \
8843  *                         "coverage": coverage, "std_dev": std_dev } )             # <<<<<<<<<<<<<<
8844  *
8845  *         return rval
8846  */
8847     if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_coverage, __pyx_v_coverage) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
8848     if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_std_dev, __pyx_v_std_dev) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
8849 
8850     /* "bx/bbi/bbi_file.pyx":253
8851  *             std_dev = math.sqrt(max(variance, 0))
8852  *
8853  *             rval.append( { "mean": mean, "max": results.max_val[i], "min": results.min_val[i], \             # <<<<<<<<<<<<<<
8854  *                         "coverage": coverage, "std_dev": std_dev } )
8855  *
8856  */
8857     __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_rval, __pyx_t_6); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 253, __pyx_L1_error)
8858     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8859   }
8860 
8861   /* "bx/bbi/bbi_file.pyx":256
8862  *                         "coverage": coverage, "std_dev": std_dev } )
8863  *
8864  *         return rval             # <<<<<<<<<<<<<<
8865  *
8866  *     cdef _get_chrom_id_and_size( self, char * chrom ):
8867  */
8868   __Pyx_XDECREF(__pyx_r);
8869   __Pyx_INCREF(__pyx_v_rval);
8870   __pyx_r = __pyx_v_rval;
8871   goto __pyx_L0;
8872 
8873   /* "bx/bbi/bbi_file.pyx":227
8874  *         return self._summarize_from_full( chrom_id, start, end, summary_size )
8875  *
8876  *     cpdef query( self, object chrom, bits32 start, bits32 end, int summary_size ):             # <<<<<<<<<<<<<<
8877  *         """
8878  *         Provides a different view of summary for region, a list of dictionaries
8879  */
8880 
8881   /* function exit code */
8882   __pyx_L1_error:;
8883   __Pyx_XDECREF(__pyx_t_1);
8884   __Pyx_XDECREF(__pyx_t_2);
8885   __Pyx_XDECREF(__pyx_t_3);
8886   __Pyx_XDECREF(__pyx_t_4);
8887   __Pyx_XDECREF(__pyx_t_5);
8888   __Pyx_XDECREF(__pyx_t_6);
8889   __Pyx_XDECREF(__pyx_t_7);
8890   __Pyx_XDECREF(__pyx_t_9);
8891   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
8892   __pyx_r = 0;
8893   __pyx_L0:;
8894   __Pyx_XDECREF(__pyx_v_results);
8895   __Pyx_XDECREF(__pyx_v_rval);
8896   __Pyx_XDECREF(__pyx_v_sum_data);
8897   __Pyx_XDECREF(__pyx_v_valid_count);
8898   __Pyx_XDECREF(__pyx_v_mean);
8899   __Pyx_XDECREF(__pyx_v_coverage);
8900   __Pyx_XDECREF(__pyx_v_variance);
8901   __Pyx_XDECREF(__pyx_v_std_dev);
8902   __Pyx_XGIVEREF(__pyx_r);
8903   __Pyx_RefNannyFinishContext();
8904   return __pyx_r;
8905 }
8906 
8907 /* Python wrapper */
8908 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_9query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8909 static char __pyx_doc_2bx_3bbi_8bbi_file_7BBIFile_8query[] = "\n        Provides a different view of summary for region, a list of dictionaries\n        with keys: mean, max, min, coverage, std_dev\n        ";
__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_9query(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)8910 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_9query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8911   PyObject *__pyx_v_chrom = 0;
8912   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start;
8913   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end;
8914   int __pyx_v_summary_size;
8915   int __pyx_lineno = 0;
8916   const char *__pyx_filename = NULL;
8917   int __pyx_clineno = 0;
8918   PyObject *__pyx_r = 0;
8919   __Pyx_RefNannyDeclarations
8920   __Pyx_RefNannySetupContext("query (wrapper)", 0);
8921   {
8922     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_summary_size,0};
8923     PyObject* values[4] = {0,0,0,0};
8924     if (unlikely(__pyx_kwds)) {
8925       Py_ssize_t kw_args;
8926       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8927       switch (pos_args) {
8928         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8929         CYTHON_FALLTHROUGH;
8930         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8931         CYTHON_FALLTHROUGH;
8932         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8933         CYTHON_FALLTHROUGH;
8934         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8935         CYTHON_FALLTHROUGH;
8936         case  0: break;
8937         default: goto __pyx_L5_argtuple_error;
8938       }
8939       kw_args = PyDict_Size(__pyx_kwds);
8940       switch (pos_args) {
8941         case  0:
8942         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
8943         else goto __pyx_L5_argtuple_error;
8944         CYTHON_FALLTHROUGH;
8945         case  1:
8946         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
8947         else {
8948           __Pyx_RaiseArgtupleInvalid("query", 1, 4, 4, 1); __PYX_ERR(0, 227, __pyx_L3_error)
8949         }
8950         CYTHON_FALLTHROUGH;
8951         case  2:
8952         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
8953         else {
8954           __Pyx_RaiseArgtupleInvalid("query", 1, 4, 4, 2); __PYX_ERR(0, 227, __pyx_L3_error)
8955         }
8956         CYTHON_FALLTHROUGH;
8957         case  3:
8958         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_summary_size)) != 0)) kw_args--;
8959         else {
8960           __Pyx_RaiseArgtupleInvalid("query", 1, 4, 4, 3); __PYX_ERR(0, 227, __pyx_L3_error)
8961         }
8962       }
8963       if (unlikely(kw_args > 0)) {
8964         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "query") < 0)) __PYX_ERR(0, 227, __pyx_L3_error)
8965       }
8966     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
8967       goto __pyx_L5_argtuple_error;
8968     } else {
8969       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8970       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8971       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8972       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8973     }
8974     __pyx_v_chrom = values[0];
8975     __pyx_v_start = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_start == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L3_error)
8976     __pyx_v_end = __Pyx_PyInt_As_unsigned_int(values[2]); if (unlikely((__pyx_v_end == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L3_error)
8977     __pyx_v_summary_size = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_summary_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L3_error)
8978   }
8979   goto __pyx_L4_argument_unpacking_done;
8980   __pyx_L5_argtuple_error:;
8981   __Pyx_RaiseArgtupleInvalid("query", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 227, __pyx_L3_error)
8982   __pyx_L3_error:;
8983   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
8984   __Pyx_RefNannyFinishContext();
8985   return NULL;
8986   __pyx_L4_argument_unpacking_done:;
8987   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_8query(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self), __pyx_v_chrom, __pyx_v_start, __pyx_v_end, __pyx_v_summary_size);
8988 
8989   /* function exit code */
8990   __Pyx_RefNannyFinishContext();
8991   return __pyx_r;
8992 }
8993 
__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_8query(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self,PyObject * __pyx_v_chrom,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end,int __pyx_v_summary_size)8994 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_8query(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_chrom, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, int __pyx_v_summary_size) {
8995   PyObject *__pyx_r = NULL;
8996   __Pyx_RefNannyDeclarations
8997   PyObject *__pyx_t_1 = NULL;
8998   int __pyx_lineno = 0;
8999   const char *__pyx_filename = NULL;
9000   int __pyx_clineno = 0;
9001   __Pyx_RefNannySetupContext("query", 0);
9002   __Pyx_XDECREF(__pyx_r);
9003   __pyx_t_1 = __pyx_f_2bx_3bbi_8bbi_file_7BBIFile_query(__pyx_v_self, __pyx_v_chrom, __pyx_v_start, __pyx_v_end, __pyx_v_summary_size, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
9004   __Pyx_GOTREF(__pyx_t_1);
9005   __pyx_r = __pyx_t_1;
9006   __pyx_t_1 = 0;
9007   goto __pyx_L0;
9008 
9009   /* function exit code */
9010   __pyx_L1_error:;
9011   __Pyx_XDECREF(__pyx_t_1);
9012   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
9013   __pyx_r = NULL;
9014   __pyx_L0:;
9015   __Pyx_XGIVEREF(__pyx_r);
9016   __Pyx_RefNannyFinishContext();
9017   return __pyx_r;
9018 }
9019 
9020 /* "bx/bbi/bbi_file.pyx":258
9021  *         return rval
9022  *
9023  *     cdef _get_chrom_id_and_size( self, char * chrom ):             # <<<<<<<<<<<<<<
9024  *         """
9025  *         Lookup id and size from the chromosome named `chrom`
9026  */
9027 
__pyx_f_2bx_3bbi_8bbi_file_7BBIFile__get_chrom_id_and_size(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self,char * __pyx_v_chrom)9028 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_7BBIFile__get_chrom_id_and_size(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, char *__pyx_v_chrom) {
9029   PyObject *__pyx_v_bytes = NULL;
9030   PyObject *__pyx_v_chrom_id = NULL;
9031   PyObject *__pyx_v_chrom_size = NULL;
9032   PyObject *__pyx_r = NULL;
9033   __Pyx_RefNannyDeclarations
9034   PyObject *__pyx_t_1 = NULL;
9035   PyObject *__pyx_t_2 = NULL;
9036   PyObject *__pyx_t_3 = NULL;
9037   PyObject *__pyx_t_4 = NULL;
9038   int __pyx_t_5;
9039   int __pyx_t_6;
9040   Py_ssize_t __pyx_t_7;
9041   int __pyx_t_8;
9042   PyObject *(*__pyx_t_9)(PyObject *);
9043   int __pyx_lineno = 0;
9044   const char *__pyx_filename = NULL;
9045   int __pyx_clineno = 0;
9046   __Pyx_RefNannySetupContext("_get_chrom_id_and_size", 0);
9047 
9048   /* "bx/bbi/bbi_file.pyx":262
9049  *         Lookup id and size from the chromosome named `chrom`
9050  *         """
9051  *         bytes = self.chrom_bpt.find( chrom )             # <<<<<<<<<<<<<<
9052  *         if bytes is not None:
9053  *             # The value is two 32 bit uints, use the BPT's reader for checking byteswapping
9054  */
9055   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->chrom_bpt), __pyx_n_s_find); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
9056   __Pyx_GOTREF(__pyx_t_2);
9057   __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_chrom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
9058   __Pyx_GOTREF(__pyx_t_3);
9059   __pyx_t_4 = NULL;
9060   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
9061     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
9062     if (likely(__pyx_t_4)) {
9063       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
9064       __Pyx_INCREF(__pyx_t_4);
9065       __Pyx_INCREF(function);
9066       __Pyx_DECREF_SET(__pyx_t_2, function);
9067     }
9068   }
9069   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
9070   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9071   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9072   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
9073   __Pyx_GOTREF(__pyx_t_1);
9074   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9075   __pyx_v_bytes = __pyx_t_1;
9076   __pyx_t_1 = 0;
9077 
9078   /* "bx/bbi/bbi_file.pyx":263
9079  *         """
9080  *         bytes = self.chrom_bpt.find( chrom )
9081  *         if bytes is not None:             # <<<<<<<<<<<<<<
9082  *             # The value is two 32 bit uints, use the BPT's reader for checking byteswapping
9083  *             assert len( bytes ) == 8
9084  */
9085   __pyx_t_5 = (__pyx_v_bytes != Py_None);
9086   __pyx_t_6 = (__pyx_t_5 != 0);
9087   if (__pyx_t_6) {
9088 
9089     /* "bx/bbi/bbi_file.pyx":265
9090  *         if bytes is not None:
9091  *             # The value is two 32 bit uints, use the BPT's reader for checking byteswapping
9092  *             assert len( bytes ) == 8             # <<<<<<<<<<<<<<
9093  *             chrom_id, chrom_size = self.chrom_bpt.reader.unpack( "II", bytes )
9094  *             return chrom_id, chrom_size
9095  */
9096     #ifndef CYTHON_WITHOUT_ASSERTIONS
9097     if (unlikely(!Py_OptimizeFlag)) {
9098       __pyx_t_7 = PyObject_Length(__pyx_v_bytes); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 265, __pyx_L1_error)
9099       if (unlikely(!((__pyx_t_7 == 8) != 0))) {
9100         PyErr_SetNone(PyExc_AssertionError);
9101         __PYX_ERR(0, 265, __pyx_L1_error)
9102       }
9103     }
9104     #endif
9105 
9106     /* "bx/bbi/bbi_file.pyx":266
9107  *             # The value is two 32 bit uints, use the BPT's reader for checking byteswapping
9108  *             assert len( bytes ) == 8
9109  *             chrom_id, chrom_size = self.chrom_bpt.reader.unpack( "II", bytes )             # <<<<<<<<<<<<<<
9110  *             return chrom_id, chrom_size
9111  *         else:
9112  */
9113     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->chrom_bpt->reader, __pyx_n_s_unpack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
9114     __Pyx_GOTREF(__pyx_t_2);
9115     __pyx_t_3 = NULL;
9116     __pyx_t_8 = 0;
9117     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
9118       __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
9119       if (likely(__pyx_t_3)) {
9120         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
9121         __Pyx_INCREF(__pyx_t_3);
9122         __Pyx_INCREF(function);
9123         __Pyx_DECREF_SET(__pyx_t_2, function);
9124         __pyx_t_8 = 1;
9125       }
9126     }
9127     #if CYTHON_FAST_PYCALL
9128     if (PyFunction_Check(__pyx_t_2)) {
9129       PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_n_s_II, __pyx_v_bytes};
9130       __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
9131       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9132       __Pyx_GOTREF(__pyx_t_1);
9133     } else
9134     #endif
9135     #if CYTHON_FAST_PYCCALL
9136     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
9137       PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_n_s_II, __pyx_v_bytes};
9138       __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
9139       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9140       __Pyx_GOTREF(__pyx_t_1);
9141     } else
9142     #endif
9143     {
9144       __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
9145       __Pyx_GOTREF(__pyx_t_4);
9146       if (__pyx_t_3) {
9147         __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
9148       }
9149       __Pyx_INCREF(__pyx_n_s_II);
9150       __Pyx_GIVEREF(__pyx_n_s_II);
9151       PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_n_s_II);
9152       __Pyx_INCREF(__pyx_v_bytes);
9153       __Pyx_GIVEREF(__pyx_v_bytes);
9154       PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_v_bytes);
9155       __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
9156       __Pyx_GOTREF(__pyx_t_1);
9157       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9158     }
9159     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9160     if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
9161       PyObject* sequence = __pyx_t_1;
9162       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9163       if (unlikely(size != 2)) {
9164         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9165         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9166         __PYX_ERR(0, 266, __pyx_L1_error)
9167       }
9168       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9169       if (likely(PyTuple_CheckExact(sequence))) {
9170         __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
9171         __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
9172       } else {
9173         __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
9174         __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
9175       }
9176       __Pyx_INCREF(__pyx_t_2);
9177       __Pyx_INCREF(__pyx_t_4);
9178       #else
9179       __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
9180       __Pyx_GOTREF(__pyx_t_2);
9181       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
9182       __Pyx_GOTREF(__pyx_t_4);
9183       #endif
9184       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9185     } else {
9186       Py_ssize_t index = -1;
9187       __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
9188       __Pyx_GOTREF(__pyx_t_3);
9189       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9190       __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext;
9191       index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
9192       __Pyx_GOTREF(__pyx_t_2);
9193       index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
9194       __Pyx_GOTREF(__pyx_t_4);
9195       if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_3), 2) < 0) __PYX_ERR(0, 266, __pyx_L1_error)
9196       __pyx_t_9 = NULL;
9197       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9198       goto __pyx_L5_unpacking_done;
9199       __pyx_L4_unpacking_failed:;
9200       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9201       __pyx_t_9 = NULL;
9202       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
9203       __PYX_ERR(0, 266, __pyx_L1_error)
9204       __pyx_L5_unpacking_done:;
9205     }
9206     __pyx_v_chrom_id = __pyx_t_2;
9207     __pyx_t_2 = 0;
9208     __pyx_v_chrom_size = __pyx_t_4;
9209     __pyx_t_4 = 0;
9210 
9211     /* "bx/bbi/bbi_file.pyx":267
9212  *             assert len( bytes ) == 8
9213  *             chrom_id, chrom_size = self.chrom_bpt.reader.unpack( "II", bytes )
9214  *             return chrom_id, chrom_size             # <<<<<<<<<<<<<<
9215  *         else:
9216  *             return None, None
9217  */
9218     __Pyx_XDECREF(__pyx_r);
9219     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
9220     __Pyx_GOTREF(__pyx_t_1);
9221     __Pyx_INCREF(__pyx_v_chrom_id);
9222     __Pyx_GIVEREF(__pyx_v_chrom_id);
9223     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_chrom_id);
9224     __Pyx_INCREF(__pyx_v_chrom_size);
9225     __Pyx_GIVEREF(__pyx_v_chrom_size);
9226     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_chrom_size);
9227     __pyx_r = __pyx_t_1;
9228     __pyx_t_1 = 0;
9229     goto __pyx_L0;
9230 
9231     /* "bx/bbi/bbi_file.pyx":263
9232  *         """
9233  *         bytes = self.chrom_bpt.find( chrom )
9234  *         if bytes is not None:             # <<<<<<<<<<<<<<
9235  *             # The value is two 32 bit uints, use the BPT's reader for checking byteswapping
9236  *             assert len( bytes ) == 8
9237  */
9238   }
9239 
9240   /* "bx/bbi/bbi_file.pyx":269
9241  *             return chrom_id, chrom_size
9242  *         else:
9243  *             return None, None             # <<<<<<<<<<<<<<
9244  *
9245  *     cdef _summarize_from_full( self, bits32 chrom_id, bits32 start, bits32 end, int summary_size ):
9246  */
9247   /*else*/ {
9248     __Pyx_XDECREF(__pyx_r);
9249     __Pyx_INCREF(__pyx_tuple_);
9250     __pyx_r = __pyx_tuple_;
9251     goto __pyx_L0;
9252   }
9253 
9254   /* "bx/bbi/bbi_file.pyx":258
9255  *         return rval
9256  *
9257  *     cdef _get_chrom_id_and_size( self, char * chrom ):             # <<<<<<<<<<<<<<
9258  *         """
9259  *         Lookup id and size from the chromosome named `chrom`
9260  */
9261 
9262   /* function exit code */
9263   __pyx_L1_error:;
9264   __Pyx_XDECREF(__pyx_t_1);
9265   __Pyx_XDECREF(__pyx_t_2);
9266   __Pyx_XDECREF(__pyx_t_3);
9267   __Pyx_XDECREF(__pyx_t_4);
9268   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile._get_chrom_id_and_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
9269   __pyx_r = 0;
9270   __pyx_L0:;
9271   __Pyx_XDECREF(__pyx_v_bytes);
9272   __Pyx_XDECREF(__pyx_v_chrom_id);
9273   __Pyx_XDECREF(__pyx_v_chrom_size);
9274   __Pyx_XGIVEREF(__pyx_r);
9275   __Pyx_RefNannyFinishContext();
9276   return __pyx_r;
9277 }
9278 
9279 /* "bx/bbi/bbi_file.pyx":271
9280  *             return None, None
9281  *
9282  *     cdef _summarize_from_full( self, bits32 chrom_id, bits32 start, bits32 end, int summary_size ):             # <<<<<<<<<<<<<<
9283  *         """
9284  *         Create summary from full data. This is data specific so must be overridden.
9285  */
9286 
__pyx_f_2bx_3bbi_8bbi_file_7BBIFile__summarize_from_full(CYTHON_UNUSED struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self,CYTHON_UNUSED __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id,CYTHON_UNUSED __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start,CYTHON_UNUSED __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end,CYTHON_UNUSED int __pyx_v_summary_size)9287 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_7BBIFile__summarize_from_full(CYTHON_UNUSED struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, CYTHON_UNUSED __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id, CYTHON_UNUSED __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start, CYTHON_UNUSED __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end, CYTHON_UNUSED int __pyx_v_summary_size) {
9288   PyObject *__pyx_r = NULL;
9289   __Pyx_RefNannyDeclarations
9290   __Pyx_RefNannySetupContext("_summarize_from_full", 0);
9291 
9292   /* function exit code */
9293   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9294   __Pyx_XGIVEREF(__pyx_r);
9295   __Pyx_RefNannyFinishContext();
9296   return __pyx_r;
9297 }
9298 
9299 /* "bx/bbi/bbi_file.pyx":277
9300  *         pass
9301  *
9302  *     cdef _best_zoom_level( self, int desired_reduction ):             # <<<<<<<<<<<<<<
9303  *         if desired_reduction <= 1:
9304  *             return None
9305  */
9306 
__pyx_f_2bx_3bbi_8bbi_file_7BBIFile__best_zoom_level(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self,int __pyx_v_desired_reduction)9307 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_7BBIFile__best_zoom_level(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, int __pyx_v_desired_reduction) {
9308   struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_level = 0;
9309   struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_closest_level = 0;
9310   int __pyx_v_diff;
9311   int __pyx_v_closest_diff;
9312   PyObject *__pyx_r = NULL;
9313   __Pyx_RefNannyDeclarations
9314   int __pyx_t_1;
9315   PyObject *__pyx_t_2 = NULL;
9316   Py_ssize_t __pyx_t_3;
9317   PyObject *(*__pyx_t_4)(PyObject *);
9318   PyObject *__pyx_t_5 = NULL;
9319   int __pyx_t_6;
9320   int __pyx_lineno = 0;
9321   const char *__pyx_filename = NULL;
9322   int __pyx_clineno = 0;
9323   __Pyx_RefNannySetupContext("_best_zoom_level", 0);
9324 
9325   /* "bx/bbi/bbi_file.pyx":278
9326  *
9327  *     cdef _best_zoom_level( self, int desired_reduction ):
9328  *         if desired_reduction <= 1:             # <<<<<<<<<<<<<<
9329  *             return None
9330  *
9331  */
9332   __pyx_t_1 = ((__pyx_v_desired_reduction <= 1) != 0);
9333   if (__pyx_t_1) {
9334 
9335     /* "bx/bbi/bbi_file.pyx":279
9336  *     cdef _best_zoom_level( self, int desired_reduction ):
9337  *         if desired_reduction <= 1:
9338  *             return None             # <<<<<<<<<<<<<<
9339  *
9340  *         cdef ZoomLevel level, closest_level
9341  */
9342     __Pyx_XDECREF(__pyx_r);
9343     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9344     goto __pyx_L0;
9345 
9346     /* "bx/bbi/bbi_file.pyx":278
9347  *
9348  *     cdef _best_zoom_level( self, int desired_reduction ):
9349  *         if desired_reduction <= 1:             # <<<<<<<<<<<<<<
9350  *             return None
9351  *
9352  */
9353   }
9354 
9355   /* "bx/bbi/bbi_file.pyx":282
9356  *
9357  *         cdef ZoomLevel level, closest_level
9358  *         cdef int diff, closest_diff = limits.INT_MAX             # <<<<<<<<<<<<<<
9359  *
9360  *         closest_level = None
9361  */
9362   __pyx_v_closest_diff = INT_MAX;
9363 
9364   /* "bx/bbi/bbi_file.pyx":284
9365  *         cdef int diff, closest_diff = limits.INT_MAX
9366  *
9367  *         closest_level = None             # <<<<<<<<<<<<<<
9368  *         for level in self.level_list:
9369  *             diff = desired_reduction - level.reduction_level
9370  */
9371   __Pyx_INCREF(Py_None);
9372   __pyx_v_closest_level = ((struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)Py_None);
9373 
9374   /* "bx/bbi/bbi_file.pyx":285
9375  *
9376  *         closest_level = None
9377  *         for level in self.level_list:             # <<<<<<<<<<<<<<
9378  *             diff = desired_reduction - level.reduction_level
9379  *             if diff >= 0 and diff < closest_diff:
9380  */
9381   if (likely(PyList_CheckExact(__pyx_v_self->level_list)) || PyTuple_CheckExact(__pyx_v_self->level_list)) {
9382     __pyx_t_2 = __pyx_v_self->level_list; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
9383     __pyx_t_4 = NULL;
9384   } else {
9385     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self->level_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
9386     __Pyx_GOTREF(__pyx_t_2);
9387     __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error)
9388   }
9389   for (;;) {
9390     if (likely(!__pyx_t_4)) {
9391       if (likely(PyList_CheckExact(__pyx_t_2))) {
9392         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
9393         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9394         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 285, __pyx_L1_error)
9395         #else
9396         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error)
9397         __Pyx_GOTREF(__pyx_t_5);
9398         #endif
9399       } else {
9400         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
9401         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9402         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 285, __pyx_L1_error)
9403         #else
9404         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error)
9405         __Pyx_GOTREF(__pyx_t_5);
9406         #endif
9407       }
9408     } else {
9409       __pyx_t_5 = __pyx_t_4(__pyx_t_2);
9410       if (unlikely(!__pyx_t_5)) {
9411         PyObject* exc_type = PyErr_Occurred();
9412         if (exc_type) {
9413           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9414           else __PYX_ERR(0, 285, __pyx_L1_error)
9415         }
9416         break;
9417       }
9418       __Pyx_GOTREF(__pyx_t_5);
9419     }
9420     if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_2bx_3bbi_8bbi_file_ZoomLevel))))) __PYX_ERR(0, 285, __pyx_L1_error)
9421     __Pyx_XDECREF_SET(__pyx_v_level, ((struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)__pyx_t_5));
9422     __pyx_t_5 = 0;
9423 
9424     /* "bx/bbi/bbi_file.pyx":286
9425  *         closest_level = None
9426  *         for level in self.level_list:
9427  *             diff = desired_reduction - level.reduction_level             # <<<<<<<<<<<<<<
9428  *             if diff >= 0 and diff < closest_diff:
9429  *                 closest_diff = diff
9430  */
9431     __pyx_v_diff = (__pyx_v_desired_reduction - __pyx_v_level->reduction_level);
9432 
9433     /* "bx/bbi/bbi_file.pyx":287
9434  *         for level in self.level_list:
9435  *             diff = desired_reduction - level.reduction_level
9436  *             if diff >= 0 and diff < closest_diff:             # <<<<<<<<<<<<<<
9437  *                 closest_diff = diff
9438  *                 closest_level = level
9439  */
9440     __pyx_t_6 = ((__pyx_v_diff >= 0) != 0);
9441     if (__pyx_t_6) {
9442     } else {
9443       __pyx_t_1 = __pyx_t_6;
9444       goto __pyx_L7_bool_binop_done;
9445     }
9446     __pyx_t_6 = ((__pyx_v_diff < __pyx_v_closest_diff) != 0);
9447     __pyx_t_1 = __pyx_t_6;
9448     __pyx_L7_bool_binop_done:;
9449     if (__pyx_t_1) {
9450 
9451       /* "bx/bbi/bbi_file.pyx":288
9452  *             diff = desired_reduction - level.reduction_level
9453  *             if diff >= 0 and diff < closest_diff:
9454  *                 closest_diff = diff             # <<<<<<<<<<<<<<
9455  *                 closest_level = level
9456  *         return closest_level
9457  */
9458       __pyx_v_closest_diff = __pyx_v_diff;
9459 
9460       /* "bx/bbi/bbi_file.pyx":289
9461  *             if diff >= 0 and diff < closest_diff:
9462  *                 closest_diff = diff
9463  *                 closest_level = level             # <<<<<<<<<<<<<<
9464  *         return closest_level
9465  *
9466  */
9467       __Pyx_INCREF(((PyObject *)__pyx_v_level));
9468       __Pyx_DECREF_SET(__pyx_v_closest_level, __pyx_v_level);
9469 
9470       /* "bx/bbi/bbi_file.pyx":287
9471  *         for level in self.level_list:
9472  *             diff = desired_reduction - level.reduction_level
9473  *             if diff >= 0 and diff < closest_diff:             # <<<<<<<<<<<<<<
9474  *                 closest_diff = diff
9475  *                 closest_level = level
9476  */
9477     }
9478 
9479     /* "bx/bbi/bbi_file.pyx":285
9480  *
9481  *         closest_level = None
9482  *         for level in self.level_list:             # <<<<<<<<<<<<<<
9483  *             diff = desired_reduction - level.reduction_level
9484  *             if diff >= 0 and diff < closest_diff:
9485  */
9486   }
9487   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9488 
9489   /* "bx/bbi/bbi_file.pyx":290
9490  *                 closest_diff = diff
9491  *                 closest_level = level
9492  *         return closest_level             # <<<<<<<<<<<<<<
9493  *
9494  * cdef class ZoomLevel:
9495  */
9496   __Pyx_XDECREF(__pyx_r);
9497   __Pyx_INCREF(((PyObject *)__pyx_v_closest_level));
9498   __pyx_r = ((PyObject *)__pyx_v_closest_level);
9499   goto __pyx_L0;
9500 
9501   /* "bx/bbi/bbi_file.pyx":277
9502  *         pass
9503  *
9504  *     cdef _best_zoom_level( self, int desired_reduction ):             # <<<<<<<<<<<<<<
9505  *         if desired_reduction <= 1:
9506  *             return None
9507  */
9508 
9509   /* function exit code */
9510   __pyx_L1_error:;
9511   __Pyx_XDECREF(__pyx_t_2);
9512   __Pyx_XDECREF(__pyx_t_5);
9513   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile._best_zoom_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
9514   __pyx_r = 0;
9515   __pyx_L0:;
9516   __Pyx_XDECREF((PyObject *)__pyx_v_level);
9517   __Pyx_XDECREF((PyObject *)__pyx_v_closest_level);
9518   __Pyx_XGIVEREF(__pyx_r);
9519   __Pyx_RefNannyFinishContext();
9520   return __pyx_r;
9521 }
9522 
9523 /* "bx/bbi/bbi_file.pxd":56
9524  *     cdef object reader
9525  *     # The magic number or type signature (whether the file is bigWig or bigBed or...)
9526  *     cdef public bits32 magic             # <<<<<<<<<<<<<<
9527  *     # Is the file byteswapped relative to our native byte order?
9528  *     cdef boolean is_byteswapped
9529  */
9530 
9531 /* Python wrapper */
9532 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_5magic_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_5magic_1__get__(PyObject * __pyx_v_self)9533 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_5magic_1__get__(PyObject *__pyx_v_self) {
9534   PyObject *__pyx_r = 0;
9535   __Pyx_RefNannyDeclarations
9536   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9537   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_5magic___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self));
9538 
9539   /* function exit code */
9540   __Pyx_RefNannyFinishContext();
9541   return __pyx_r;
9542 }
9543 
__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_5magic___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self)9544 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_5magic___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self) {
9545   PyObject *__pyx_r = NULL;
9546   __Pyx_RefNannyDeclarations
9547   PyObject *__pyx_t_1 = NULL;
9548   int __pyx_lineno = 0;
9549   const char *__pyx_filename = NULL;
9550   int __pyx_clineno = 0;
9551   __Pyx_RefNannySetupContext("__get__", 0);
9552   __Pyx_XDECREF(__pyx_r);
9553   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->magic); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error)
9554   __Pyx_GOTREF(__pyx_t_1);
9555   __pyx_r = __pyx_t_1;
9556   __pyx_t_1 = 0;
9557   goto __pyx_L0;
9558 
9559   /* function exit code */
9560   __pyx_L1_error:;
9561   __Pyx_XDECREF(__pyx_t_1);
9562   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.magic.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9563   __pyx_r = NULL;
9564   __pyx_L0:;
9565   __Pyx_XGIVEREF(__pyx_r);
9566   __Pyx_RefNannyFinishContext();
9567   return __pyx_r;
9568 }
9569 
9570 /* Python wrapper */
9571 static int __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_5magic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_5magic_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)9572 static int __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_5magic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
9573   int __pyx_r;
9574   __Pyx_RefNannyDeclarations
9575   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
9576   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_5magic_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self), ((PyObject *)__pyx_v_value));
9577 
9578   /* function exit code */
9579   __Pyx_RefNannyFinishContext();
9580   return __pyx_r;
9581 }
9582 
__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_5magic_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self,PyObject * __pyx_v_value)9583 static int __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_5magic_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_value) {
9584   int __pyx_r;
9585   __Pyx_RefNannyDeclarations
9586   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_1;
9587   int __pyx_lineno = 0;
9588   const char *__pyx_filename = NULL;
9589   int __pyx_clineno = 0;
9590   __Pyx_RefNannySetupContext("__set__", 0);
9591   __pyx_t_1 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 56, __pyx_L1_error)
9592   __pyx_v_self->magic = __pyx_t_1;
9593 
9594   /* function exit code */
9595   __pyx_r = 0;
9596   goto __pyx_L0;
9597   __pyx_L1_error:;
9598   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.magic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9599   __pyx_r = -1;
9600   __pyx_L0:;
9601   __Pyx_RefNannyFinishContext();
9602   return __pyx_r;
9603 }
9604 
9605 /* "bx/bbi/bbi_file.pxd":62
9606  *     cdef BPTFile chrom_bpt
9607  *     # Version number
9608  *     cdef public bits16 version             # <<<<<<<<<<<<<<
9609  *     # Number of zoom levels
9610  *     cdef public bits16 zoom_levels
9611  */
9612 
9613 /* Python wrapper */
9614 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_7version_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_7version_1__get__(PyObject * __pyx_v_self)9615 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_7version_1__get__(PyObject *__pyx_v_self) {
9616   PyObject *__pyx_r = 0;
9617   __Pyx_RefNannyDeclarations
9618   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9619   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_7version___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self));
9620 
9621   /* function exit code */
9622   __Pyx_RefNannyFinishContext();
9623   return __pyx_r;
9624 }
9625 
__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_7version___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self)9626 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_7version___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self) {
9627   PyObject *__pyx_r = NULL;
9628   __Pyx_RefNannyDeclarations
9629   PyObject *__pyx_t_1 = NULL;
9630   int __pyx_lineno = 0;
9631   const char *__pyx_filename = NULL;
9632   int __pyx_clineno = 0;
9633   __Pyx_RefNannySetupContext("__get__", 0);
9634   __Pyx_XDECREF(__pyx_r);
9635   __pyx_t_1 = __Pyx_PyInt_From_unsigned_short(__pyx_v_self->version); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 62, __pyx_L1_error)
9636   __Pyx_GOTREF(__pyx_t_1);
9637   __pyx_r = __pyx_t_1;
9638   __pyx_t_1 = 0;
9639   goto __pyx_L0;
9640 
9641   /* function exit code */
9642   __pyx_L1_error:;
9643   __Pyx_XDECREF(__pyx_t_1);
9644   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9645   __pyx_r = NULL;
9646   __pyx_L0:;
9647   __Pyx_XGIVEREF(__pyx_r);
9648   __Pyx_RefNannyFinishContext();
9649   return __pyx_r;
9650 }
9651 
9652 /* Python wrapper */
9653 static int __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_7version_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_7version_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)9654 static int __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_7version_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
9655   int __pyx_r;
9656   __Pyx_RefNannyDeclarations
9657   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
9658   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_7version_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self), ((PyObject *)__pyx_v_value));
9659 
9660   /* function exit code */
9661   __Pyx_RefNannyFinishContext();
9662   return __pyx_r;
9663 }
9664 
__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_7version_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self,PyObject * __pyx_v_value)9665 static int __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_7version_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_value) {
9666   int __pyx_r;
9667   __Pyx_RefNannyDeclarations
9668   __pyx_t_2bx_3bbi_5types_bits16 __pyx_t_1;
9669   int __pyx_lineno = 0;
9670   const char *__pyx_filename = NULL;
9671   int __pyx_clineno = 0;
9672   __Pyx_RefNannySetupContext("__set__", 0);
9673   __pyx_t_1 = __Pyx_PyInt_As_unsigned_short(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(1, 62, __pyx_L1_error)
9674   __pyx_v_self->version = __pyx_t_1;
9675 
9676   /* function exit code */
9677   __pyx_r = 0;
9678   goto __pyx_L0;
9679   __pyx_L1_error:;
9680   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.version.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9681   __pyx_r = -1;
9682   __pyx_L0:;
9683   __Pyx_RefNannyFinishContext();
9684   return __pyx_r;
9685 }
9686 
9687 /* "bx/bbi/bbi_file.pxd":64
9688  *     cdef public bits16 version
9689  *     # Number of zoom levels
9690  *     cdef public bits16 zoom_levels             # <<<<<<<<<<<<<<
9691  *     # Offset to chromosome index
9692  *     cdef bits64 chrom_tree_offset
9693  */
9694 
9695 /* Python wrapper */
9696 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_11zoom_levels_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_11zoom_levels_1__get__(PyObject * __pyx_v_self)9697 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_11zoom_levels_1__get__(PyObject *__pyx_v_self) {
9698   PyObject *__pyx_r = 0;
9699   __Pyx_RefNannyDeclarations
9700   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9701   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_11zoom_levels___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self));
9702 
9703   /* function exit code */
9704   __Pyx_RefNannyFinishContext();
9705   return __pyx_r;
9706 }
9707 
__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_11zoom_levels___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self)9708 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_11zoom_levels___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self) {
9709   PyObject *__pyx_r = NULL;
9710   __Pyx_RefNannyDeclarations
9711   PyObject *__pyx_t_1 = NULL;
9712   int __pyx_lineno = 0;
9713   const char *__pyx_filename = NULL;
9714   int __pyx_clineno = 0;
9715   __Pyx_RefNannySetupContext("__get__", 0);
9716   __Pyx_XDECREF(__pyx_r);
9717   __pyx_t_1 = __Pyx_PyInt_From_unsigned_short(__pyx_v_self->zoom_levels); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 64, __pyx_L1_error)
9718   __Pyx_GOTREF(__pyx_t_1);
9719   __pyx_r = __pyx_t_1;
9720   __pyx_t_1 = 0;
9721   goto __pyx_L0;
9722 
9723   /* function exit code */
9724   __pyx_L1_error:;
9725   __Pyx_XDECREF(__pyx_t_1);
9726   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.zoom_levels.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9727   __pyx_r = NULL;
9728   __pyx_L0:;
9729   __Pyx_XGIVEREF(__pyx_r);
9730   __Pyx_RefNannyFinishContext();
9731   return __pyx_r;
9732 }
9733 
9734 /* Python wrapper */
9735 static int __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_11zoom_levels_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_11zoom_levels_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)9736 static int __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_11zoom_levels_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
9737   int __pyx_r;
9738   __Pyx_RefNannyDeclarations
9739   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
9740   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_11zoom_levels_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self), ((PyObject *)__pyx_v_value));
9741 
9742   /* function exit code */
9743   __Pyx_RefNannyFinishContext();
9744   return __pyx_r;
9745 }
9746 
__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_11zoom_levels_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self,PyObject * __pyx_v_value)9747 static int __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_11zoom_levels_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_value) {
9748   int __pyx_r;
9749   __Pyx_RefNannyDeclarations
9750   __pyx_t_2bx_3bbi_5types_bits16 __pyx_t_1;
9751   int __pyx_lineno = 0;
9752   const char *__pyx_filename = NULL;
9753   int __pyx_clineno = 0;
9754   __Pyx_RefNannySetupContext("__set__", 0);
9755   __pyx_t_1 = __Pyx_PyInt_As_unsigned_short(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(1, 64, __pyx_L1_error)
9756   __pyx_v_self->zoom_levels = __pyx_t_1;
9757 
9758   /* function exit code */
9759   __pyx_r = 0;
9760   goto __pyx_L0;
9761   __pyx_L1_error:;
9762   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.zoom_levels.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9763   __pyx_r = -1;
9764   __pyx_L0:;
9765   __Pyx_RefNannyFinishContext();
9766   return __pyx_r;
9767 }
9768 
9769 /* "bx/bbi/bbi_file.pxd":81
9770  *     cdef bits32 uncompress_buf_size
9771  *     # Zoom levels list
9772  *     cdef public object level_list             # <<<<<<<<<<<<<<
9773  *
9774  *     cdef visit_blocks_in_region( self, bits32 chrom_id, bits32 start, bits32 end, BlockHandler handler )
9775  */
9776 
9777 /* Python wrapper */
9778 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_10level_list_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_10level_list_1__get__(PyObject * __pyx_v_self)9779 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_10level_list_1__get__(PyObject *__pyx_v_self) {
9780   PyObject *__pyx_r = 0;
9781   __Pyx_RefNannyDeclarations
9782   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9783   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_10level_list___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self));
9784 
9785   /* function exit code */
9786   __Pyx_RefNannyFinishContext();
9787   return __pyx_r;
9788 }
9789 
__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_10level_list___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self)9790 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_10level_list___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self) {
9791   PyObject *__pyx_r = NULL;
9792   __Pyx_RefNannyDeclarations
9793   __Pyx_RefNannySetupContext("__get__", 0);
9794   __Pyx_XDECREF(__pyx_r);
9795   __Pyx_INCREF(__pyx_v_self->level_list);
9796   __pyx_r = __pyx_v_self->level_list;
9797   goto __pyx_L0;
9798 
9799   /* function exit code */
9800   __pyx_L0:;
9801   __Pyx_XGIVEREF(__pyx_r);
9802   __Pyx_RefNannyFinishContext();
9803   return __pyx_r;
9804 }
9805 
9806 /* Python wrapper */
9807 static int __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_10level_list_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_10level_list_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)9808 static int __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_10level_list_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
9809   int __pyx_r;
9810   __Pyx_RefNannyDeclarations
9811   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
9812   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_10level_list_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self), ((PyObject *)__pyx_v_value));
9813 
9814   /* function exit code */
9815   __Pyx_RefNannyFinishContext();
9816   return __pyx_r;
9817 }
9818 
__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_10level_list_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self,PyObject * __pyx_v_value)9819 static int __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_10level_list_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v_value) {
9820   int __pyx_r;
9821   __Pyx_RefNannyDeclarations
9822   __Pyx_RefNannySetupContext("__set__", 0);
9823   __Pyx_INCREF(__pyx_v_value);
9824   __Pyx_GIVEREF(__pyx_v_value);
9825   __Pyx_GOTREF(__pyx_v_self->level_list);
9826   __Pyx_DECREF(__pyx_v_self->level_list);
9827   __pyx_v_self->level_list = __pyx_v_value;
9828 
9829   /* function exit code */
9830   __pyx_r = 0;
9831   __Pyx_RefNannyFinishContext();
9832   return __pyx_r;
9833 }
9834 
9835 /* Python wrapper */
9836 static int __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_10level_list_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_10level_list_5__del__(PyObject * __pyx_v_self)9837 static int __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_10level_list_5__del__(PyObject *__pyx_v_self) {
9838   int __pyx_r;
9839   __Pyx_RefNannyDeclarations
9840   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
9841   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_10level_list_4__del__(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self));
9842 
9843   /* function exit code */
9844   __Pyx_RefNannyFinishContext();
9845   return __pyx_r;
9846 }
9847 
__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_10level_list_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self)9848 static int __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_10level_list_4__del__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self) {
9849   int __pyx_r;
9850   __Pyx_RefNannyDeclarations
9851   __Pyx_RefNannySetupContext("__del__", 0);
9852   __Pyx_INCREF(Py_None);
9853   __Pyx_GIVEREF(Py_None);
9854   __Pyx_GOTREF(__pyx_v_self->level_list);
9855   __Pyx_DECREF(__pyx_v_self->level_list);
9856   __pyx_v_self->level_list = Py_None;
9857 
9858   /* function exit code */
9859   __pyx_r = 0;
9860   __Pyx_RefNannyFinishContext();
9861   return __pyx_r;
9862 }
9863 
9864 /* "(tree fragment)":1
9865  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
9866  *     cdef tuple state
9867  *     cdef object _dict
9868  */
9869 
9870 /* Python wrapper */
9871 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_11__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)9872 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9873   PyObject *__pyx_r = 0;
9874   __Pyx_RefNannyDeclarations
9875   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9876   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_10__reduce_cython__(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self));
9877 
9878   /* function exit code */
9879   __Pyx_RefNannyFinishContext();
9880   return __pyx_r;
9881 }
9882 
__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_10__reduce_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self)9883 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_10__reduce_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self) {
9884   PyObject *__pyx_v_state = 0;
9885   PyObject *__pyx_v__dict = 0;
9886   int __pyx_v_use_setstate;
9887   PyObject *__pyx_r = NULL;
9888   __Pyx_RefNannyDeclarations
9889   PyObject *__pyx_t_1 = NULL;
9890   PyObject *__pyx_t_2 = NULL;
9891   PyObject *__pyx_t_3 = NULL;
9892   PyObject *__pyx_t_4 = NULL;
9893   PyObject *__pyx_t_5 = NULL;
9894   PyObject *__pyx_t_6 = NULL;
9895   PyObject *__pyx_t_7 = NULL;
9896   PyObject *__pyx_t_8 = NULL;
9897   PyObject *__pyx_t_9 = NULL;
9898   PyObject *__pyx_t_10 = NULL;
9899   PyObject *__pyx_t_11 = NULL;
9900   PyObject *__pyx_t_12 = NULL;
9901   PyObject *__pyx_t_13 = NULL;
9902   int __pyx_t_14;
9903   int __pyx_t_15;
9904   int __pyx_t_16;
9905   int __pyx_lineno = 0;
9906   const char *__pyx_filename = NULL;
9907   int __pyx_clineno = 0;
9908   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9909 
9910   /* "(tree fragment)":5
9911  *     cdef object _dict
9912  *     cdef bint use_setstate
9913  *     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)             # <<<<<<<<<<<<<<
9914  *     _dict = getattr(self, '__dict__', None)
9915  *     if _dict is not None:
9916  */
9917   __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->as_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
9918   __Pyx_GOTREF(__pyx_t_1);
9919   __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->chrom_tree_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
9920   __Pyx_GOTREF(__pyx_t_2);
9921   __pyx_t_3 = __Pyx_PyInt_From_unsigned_short(__pyx_v_self->defined_field_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
9922   __Pyx_GOTREF(__pyx_t_3);
9923   __pyx_t_4 = __Pyx_PyInt_From_unsigned_short(__pyx_v_self->field_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
9924   __Pyx_GOTREF(__pyx_t_4);
9925   __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_self->is_byteswapped); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error)
9926   __Pyx_GOTREF(__pyx_t_5);
9927   __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->magic); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error)
9928   __Pyx_GOTREF(__pyx_t_6);
9929   __pyx_t_7 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->total_summary_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error)
9930   __Pyx_GOTREF(__pyx_t_7);
9931   __pyx_t_8 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->uncompress_buf_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 5, __pyx_L1_error)
9932   __Pyx_GOTREF(__pyx_t_8);
9933   __pyx_t_9 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->unzoomed_data_offset); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 5, __pyx_L1_error)
9934   __Pyx_GOTREF(__pyx_t_9);
9935   __pyx_t_10 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->unzoomed_index_offset); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 5, __pyx_L1_error)
9936   __Pyx_GOTREF(__pyx_t_10);
9937   __pyx_t_11 = __Pyx_PyInt_From_unsigned_short(__pyx_v_self->version); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 5, __pyx_L1_error)
9938   __Pyx_GOTREF(__pyx_t_11);
9939   __pyx_t_12 = __Pyx_PyInt_From_unsigned_short(__pyx_v_self->zoom_levels); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 5, __pyx_L1_error)
9940   __Pyx_GOTREF(__pyx_t_12);
9941   __pyx_t_13 = PyTuple_New(16); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 5, __pyx_L1_error)
9942   __Pyx_GOTREF(__pyx_t_13);
9943   __Pyx_GIVEREF(__pyx_t_1);
9944   PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
9945   __Pyx_INCREF(((PyObject *)__pyx_v_self->chrom_bpt));
9946   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->chrom_bpt));
9947   PyTuple_SET_ITEM(__pyx_t_13, 1, ((PyObject *)__pyx_v_self->chrom_bpt));
9948   __Pyx_GIVEREF(__pyx_t_2);
9949   PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_2);
9950   __Pyx_GIVEREF(__pyx_t_3);
9951   PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_3);
9952   __Pyx_GIVEREF(__pyx_t_4);
9953   PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_4);
9954   __Pyx_INCREF(__pyx_v_self->file);
9955   __Pyx_GIVEREF(__pyx_v_self->file);
9956   PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_v_self->file);
9957   __Pyx_GIVEREF(__pyx_t_5);
9958   PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_5);
9959   __Pyx_INCREF(__pyx_v_self->level_list);
9960   __Pyx_GIVEREF(__pyx_v_self->level_list);
9961   PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_v_self->level_list);
9962   __Pyx_GIVEREF(__pyx_t_6);
9963   PyTuple_SET_ITEM(__pyx_t_13, 8, __pyx_t_6);
9964   __Pyx_INCREF(__pyx_v_self->reader);
9965   __Pyx_GIVEREF(__pyx_v_self->reader);
9966   PyTuple_SET_ITEM(__pyx_t_13, 9, __pyx_v_self->reader);
9967   __Pyx_GIVEREF(__pyx_t_7);
9968   PyTuple_SET_ITEM(__pyx_t_13, 10, __pyx_t_7);
9969   __Pyx_GIVEREF(__pyx_t_8);
9970   PyTuple_SET_ITEM(__pyx_t_13, 11, __pyx_t_8);
9971   __Pyx_GIVEREF(__pyx_t_9);
9972   PyTuple_SET_ITEM(__pyx_t_13, 12, __pyx_t_9);
9973   __Pyx_GIVEREF(__pyx_t_10);
9974   PyTuple_SET_ITEM(__pyx_t_13, 13, __pyx_t_10);
9975   __Pyx_GIVEREF(__pyx_t_11);
9976   PyTuple_SET_ITEM(__pyx_t_13, 14, __pyx_t_11);
9977   __Pyx_GIVEREF(__pyx_t_12);
9978   PyTuple_SET_ITEM(__pyx_t_13, 15, __pyx_t_12);
9979   __pyx_t_1 = 0;
9980   __pyx_t_2 = 0;
9981   __pyx_t_3 = 0;
9982   __pyx_t_4 = 0;
9983   __pyx_t_5 = 0;
9984   __pyx_t_6 = 0;
9985   __pyx_t_7 = 0;
9986   __pyx_t_8 = 0;
9987   __pyx_t_9 = 0;
9988   __pyx_t_10 = 0;
9989   __pyx_t_11 = 0;
9990   __pyx_t_12 = 0;
9991   __pyx_v_state = ((PyObject*)__pyx_t_13);
9992   __pyx_t_13 = 0;
9993 
9994   /* "(tree fragment)":6
9995  *     cdef bint use_setstate
9996  *     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)
9997  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
9998  *     if _dict is not None:
9999  *         state += (_dict,)
10000  */
10001   __pyx_t_13 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 6, __pyx_L1_error)
10002   __Pyx_GOTREF(__pyx_t_13);
10003   __pyx_v__dict = __pyx_t_13;
10004   __pyx_t_13 = 0;
10005 
10006   /* "(tree fragment)":7
10007  *     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)
10008  *     _dict = getattr(self, '__dict__', None)
10009  *     if _dict is not None:             # <<<<<<<<<<<<<<
10010  *         state += (_dict,)
10011  *         use_setstate = True
10012  */
10013   __pyx_t_14 = (__pyx_v__dict != Py_None);
10014   __pyx_t_15 = (__pyx_t_14 != 0);
10015   if (__pyx_t_15) {
10016 
10017     /* "(tree fragment)":8
10018  *     _dict = getattr(self, '__dict__', None)
10019  *     if _dict is not None:
10020  *         state += (_dict,)             # <<<<<<<<<<<<<<
10021  *         use_setstate = True
10022  *     else:
10023  */
10024     __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 8, __pyx_L1_error)
10025     __Pyx_GOTREF(__pyx_t_13);
10026     __Pyx_INCREF(__pyx_v__dict);
10027     __Pyx_GIVEREF(__pyx_v__dict);
10028     PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v__dict);
10029     __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 8, __pyx_L1_error)
10030     __Pyx_GOTREF(__pyx_t_12);
10031     __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
10032     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_12));
10033     __pyx_t_12 = 0;
10034 
10035     /* "(tree fragment)":9
10036  *     if _dict is not None:
10037  *         state += (_dict,)
10038  *         use_setstate = True             # <<<<<<<<<<<<<<
10039  *     else:
10040  *         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
10041  */
10042     __pyx_v_use_setstate = 1;
10043 
10044     /* "(tree fragment)":7
10045  *     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)
10046  *     _dict = getattr(self, '__dict__', None)
10047  *     if _dict is not None:             # <<<<<<<<<<<<<<
10048  *         state += (_dict,)
10049  *         use_setstate = True
10050  */
10051     goto __pyx_L3;
10052   }
10053 
10054   /* "(tree fragment)":11
10055  *         use_setstate = True
10056  *     else:
10057  *         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             # <<<<<<<<<<<<<<
10058  *     if use_setstate:
10059  *         return __pyx_unpickle_BBIFile, (type(self), 0x5566878, None), state
10060  */
10061   /*else*/ {
10062     __pyx_t_14 = (((PyObject *)__pyx_v_self->chrom_bpt) != Py_None);
10063     __pyx_t_16 = (__pyx_t_14 != 0);
10064     if (!__pyx_t_16) {
10065     } else {
10066       __pyx_t_15 = __pyx_t_16;
10067       goto __pyx_L4_bool_binop_done;
10068     }
10069     __pyx_t_16 = (__pyx_v_self->file != Py_None);
10070     __pyx_t_14 = (__pyx_t_16 != 0);
10071     if (!__pyx_t_14) {
10072     } else {
10073       __pyx_t_15 = __pyx_t_14;
10074       goto __pyx_L4_bool_binop_done;
10075     }
10076     __pyx_t_14 = (__pyx_v_self->level_list != Py_None);
10077     __pyx_t_16 = (__pyx_t_14 != 0);
10078     if (!__pyx_t_16) {
10079     } else {
10080       __pyx_t_15 = __pyx_t_16;
10081       goto __pyx_L4_bool_binop_done;
10082     }
10083     __pyx_t_16 = (__pyx_v_self->reader != Py_None);
10084     __pyx_t_14 = (__pyx_t_16 != 0);
10085     __pyx_t_15 = __pyx_t_14;
10086     __pyx_L4_bool_binop_done:;
10087     __pyx_v_use_setstate = __pyx_t_15;
10088   }
10089   __pyx_L3:;
10090 
10091   /* "(tree fragment)":12
10092  *     else:
10093  *         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
10094  *     if use_setstate:             # <<<<<<<<<<<<<<
10095  *         return __pyx_unpickle_BBIFile, (type(self), 0x5566878, None), state
10096  *     else:
10097  */
10098   __pyx_t_15 = (__pyx_v_use_setstate != 0);
10099   if (__pyx_t_15) {
10100 
10101     /* "(tree fragment)":13
10102  *         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
10103  *     if use_setstate:
10104  *         return __pyx_unpickle_BBIFile, (type(self), 0x5566878, None), state             # <<<<<<<<<<<<<<
10105  *     else:
10106  *         return __pyx_unpickle_BBIFile, (type(self), 0x5566878, state)
10107  */
10108     __Pyx_XDECREF(__pyx_r);
10109     __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_pyx_unpickle_BBIFile); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 13, __pyx_L1_error)
10110     __Pyx_GOTREF(__pyx_t_12);
10111     __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 13, __pyx_L1_error)
10112     __Pyx_GOTREF(__pyx_t_13);
10113     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10114     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10115     PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10116     __Pyx_INCREF(__pyx_int_89548920);
10117     __Pyx_GIVEREF(__pyx_int_89548920);
10118     PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_int_89548920);
10119     __Pyx_INCREF(Py_None);
10120     __Pyx_GIVEREF(Py_None);
10121     PyTuple_SET_ITEM(__pyx_t_13, 2, Py_None);
10122     __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 13, __pyx_L1_error)
10123     __Pyx_GOTREF(__pyx_t_11);
10124     __Pyx_GIVEREF(__pyx_t_12);
10125     PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12);
10126     __Pyx_GIVEREF(__pyx_t_13);
10127     PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13);
10128     __Pyx_INCREF(__pyx_v_state);
10129     __Pyx_GIVEREF(__pyx_v_state);
10130     PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_state);
10131     __pyx_t_12 = 0;
10132     __pyx_t_13 = 0;
10133     __pyx_r = __pyx_t_11;
10134     __pyx_t_11 = 0;
10135     goto __pyx_L0;
10136 
10137     /* "(tree fragment)":12
10138  *     else:
10139  *         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
10140  *     if use_setstate:             # <<<<<<<<<<<<<<
10141  *         return __pyx_unpickle_BBIFile, (type(self), 0x5566878, None), state
10142  *     else:
10143  */
10144   }
10145 
10146   /* "(tree fragment)":15
10147  *         return __pyx_unpickle_BBIFile, (type(self), 0x5566878, None), state
10148  *     else:
10149  *         return __pyx_unpickle_BBIFile, (type(self), 0x5566878, state)             # <<<<<<<<<<<<<<
10150  * def __setstate_cython__(self, __pyx_state):
10151  *     __pyx_unpickle_BBIFile__set_state(self, __pyx_state)
10152  */
10153   /*else*/ {
10154     __Pyx_XDECREF(__pyx_r);
10155     __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_pyx_unpickle_BBIFile); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 15, __pyx_L1_error)
10156     __Pyx_GOTREF(__pyx_t_11);
10157     __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 15, __pyx_L1_error)
10158     __Pyx_GOTREF(__pyx_t_13);
10159     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10160     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10161     PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10162     __Pyx_INCREF(__pyx_int_89548920);
10163     __Pyx_GIVEREF(__pyx_int_89548920);
10164     PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_int_89548920);
10165     __Pyx_INCREF(__pyx_v_state);
10166     __Pyx_GIVEREF(__pyx_v_state);
10167     PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_state);
10168     __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 15, __pyx_L1_error)
10169     __Pyx_GOTREF(__pyx_t_12);
10170     __Pyx_GIVEREF(__pyx_t_11);
10171     PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11);
10172     __Pyx_GIVEREF(__pyx_t_13);
10173     PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13);
10174     __pyx_t_11 = 0;
10175     __pyx_t_13 = 0;
10176     __pyx_r = __pyx_t_12;
10177     __pyx_t_12 = 0;
10178     goto __pyx_L0;
10179   }
10180 
10181   /* "(tree fragment)":1
10182  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
10183  *     cdef tuple state
10184  *     cdef object _dict
10185  */
10186 
10187   /* function exit code */
10188   __pyx_L1_error:;
10189   __Pyx_XDECREF(__pyx_t_1);
10190   __Pyx_XDECREF(__pyx_t_2);
10191   __Pyx_XDECREF(__pyx_t_3);
10192   __Pyx_XDECREF(__pyx_t_4);
10193   __Pyx_XDECREF(__pyx_t_5);
10194   __Pyx_XDECREF(__pyx_t_6);
10195   __Pyx_XDECREF(__pyx_t_7);
10196   __Pyx_XDECREF(__pyx_t_8);
10197   __Pyx_XDECREF(__pyx_t_9);
10198   __Pyx_XDECREF(__pyx_t_10);
10199   __Pyx_XDECREF(__pyx_t_11);
10200   __Pyx_XDECREF(__pyx_t_12);
10201   __Pyx_XDECREF(__pyx_t_13);
10202   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10203   __pyx_r = NULL;
10204   __pyx_L0:;
10205   __Pyx_XDECREF(__pyx_v_state);
10206   __Pyx_XDECREF(__pyx_v__dict);
10207   __Pyx_XGIVEREF(__pyx_r);
10208   __Pyx_RefNannyFinishContext();
10209   return __pyx_r;
10210 }
10211 
10212 /* "(tree fragment)":16
10213  *     else:
10214  *         return __pyx_unpickle_BBIFile, (type(self), 0x5566878, state)
10215  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
10216  *     __pyx_unpickle_BBIFile__set_state(self, __pyx_state)
10217  */
10218 
10219 /* Python wrapper */
10220 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_13__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)10221 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10222   PyObject *__pyx_r = 0;
10223   __Pyx_RefNannyDeclarations
10224   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10225   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_12__setstate_cython__(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10226 
10227   /* function exit code */
10228   __Pyx_RefNannyFinishContext();
10229   return __pyx_r;
10230 }
10231 
__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_12__setstate_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v_self,PyObject * __pyx_v___pyx_state)10232 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_7BBIFile_12__setstate_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10233   PyObject *__pyx_r = NULL;
10234   __Pyx_RefNannyDeclarations
10235   PyObject *__pyx_t_1 = NULL;
10236   int __pyx_lineno = 0;
10237   const char *__pyx_filename = NULL;
10238   int __pyx_clineno = 0;
10239   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10240 
10241   /* "(tree fragment)":17
10242  *         return __pyx_unpickle_BBIFile, (type(self), 0x5566878, state)
10243  * def __setstate_cython__(self, __pyx_state):
10244  *     __pyx_unpickle_BBIFile__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
10245  */
10246   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(2, 17, __pyx_L1_error)
10247   __pyx_t_1 = __pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_BBIFile__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
10248   __Pyx_GOTREF(__pyx_t_1);
10249   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10250 
10251   /* "(tree fragment)":16
10252  *     else:
10253  *         return __pyx_unpickle_BBIFile, (type(self), 0x5566878, state)
10254  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
10255  *     __pyx_unpickle_BBIFile__set_state(self, __pyx_state)
10256  */
10257 
10258   /* function exit code */
10259   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10260   goto __pyx_L0;
10261   __pyx_L1_error:;
10262   __Pyx_XDECREF(__pyx_t_1);
10263   __Pyx_AddTraceback("bx.bbi.bbi_file.BBIFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10264   __pyx_r = NULL;
10265   __pyx_L0:;
10266   __Pyx_XGIVEREF(__pyx_r);
10267   __Pyx_RefNannyFinishContext();
10268   return __pyx_r;
10269 }
10270 
10271 /* "bx/bbi/bbi_file.pyx":300
10272  *     cdef int item_count
10273  *
10274  *     def _summary_blocks_in_region( self, bits32 chrom_id, bits32 start, bits32 end ):             # <<<<<<<<<<<<<<
10275  *         """
10276  *         Return a list of all SummaryBlocks that overlap the region
10277  */
10278 
10279 /* Python wrapper */
10280 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_1_summary_blocks_in_region(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10281 static char __pyx_doc_2bx_3bbi_8bbi_file_9ZoomLevel__summary_blocks_in_region[] = "\n        Return a list of all SummaryBlocks that overlap the region \n        `chrom_id`:`start`-`end`\n        ";
__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_1_summary_blocks_in_region(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)10282 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_1_summary_blocks_in_region(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10283   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_chrom_id;
10284   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_start;
10285   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_end;
10286   int __pyx_lineno = 0;
10287   const char *__pyx_filename = NULL;
10288   int __pyx_clineno = 0;
10289   PyObject *__pyx_r = 0;
10290   __Pyx_RefNannyDeclarations
10291   __Pyx_RefNannySetupContext("_summary_blocks_in_region (wrapper)", 0);
10292   {
10293     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom_id,&__pyx_n_s_start,&__pyx_n_s_end,0};
10294     PyObject* values[3] = {0,0,0};
10295     if (unlikely(__pyx_kwds)) {
10296       Py_ssize_t kw_args;
10297       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10298       switch (pos_args) {
10299         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10300         CYTHON_FALLTHROUGH;
10301         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10302         CYTHON_FALLTHROUGH;
10303         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10304         CYTHON_FALLTHROUGH;
10305         case  0: break;
10306         default: goto __pyx_L5_argtuple_error;
10307       }
10308       kw_args = PyDict_Size(__pyx_kwds);
10309       switch (pos_args) {
10310         case  0:
10311         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chrom_id)) != 0)) kw_args--;
10312         else goto __pyx_L5_argtuple_error;
10313         CYTHON_FALLTHROUGH;
10314         case  1:
10315         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
10316         else {
10317           __Pyx_RaiseArgtupleInvalid("_summary_blocks_in_region", 1, 3, 3, 1); __PYX_ERR(0, 300, __pyx_L3_error)
10318         }
10319         CYTHON_FALLTHROUGH;
10320         case  2:
10321         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
10322         else {
10323           __Pyx_RaiseArgtupleInvalid("_summary_blocks_in_region", 1, 3, 3, 2); __PYX_ERR(0, 300, __pyx_L3_error)
10324         }
10325       }
10326       if (unlikely(kw_args > 0)) {
10327         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_summary_blocks_in_region") < 0)) __PYX_ERR(0, 300, __pyx_L3_error)
10328       }
10329     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
10330       goto __pyx_L5_argtuple_error;
10331     } else {
10332       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10333       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10334       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10335     }
10336     __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, 300, __pyx_L3_error)
10337     __pyx_v_start = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_start == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L3_error)
10338     __pyx_v_end = __Pyx_PyInt_As_unsigned_int(values[2]); if (unlikely((__pyx_v_end == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L3_error)
10339   }
10340   goto __pyx_L4_argument_unpacking_done;
10341   __pyx_L5_argtuple_error:;
10342   __Pyx_RaiseArgtupleInvalid("_summary_blocks_in_region", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 300, __pyx_L3_error)
10343   __pyx_L3_error:;
10344   __Pyx_AddTraceback("bx.bbi.bbi_file.ZoomLevel._summary_blocks_in_region", __pyx_clineno, __pyx_lineno, __pyx_filename);
10345   __Pyx_RefNannyFinishContext();
10346   return NULL;
10347   __pyx_L4_argument_unpacking_done:;
10348   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel__summary_blocks_in_region(((struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)__pyx_v_self), __pyx_v_chrom_id, __pyx_v_start, __pyx_v_end);
10349 
10350   /* function exit code */
10351   __Pyx_RefNannyFinishContext();
10352   return __pyx_r;
10353 }
10354 
__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel__summary_blocks_in_region(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel * __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)10355 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel__summary_blocks_in_region(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__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) {
10356   struct __pyx_obj_2bx_3bbi_12cirtree_file_CIRTreeFile *__pyx_v_ctf = 0;
10357   struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v_summary = 0;
10358   PyObject *__pyx_v_rval = NULL;
10359   PyObject *__pyx_v_reader = NULL;
10360   PyObject *__pyx_v_block_list = NULL;
10361   PyObject *__pyx_v_offset = NULL;
10362   PyObject *__pyx_v_size = NULL;
10363   PyObject *__pyx_v_block_data = NULL;
10364   PyObject *__pyx_v_block_size = NULL;
10365   PyObject *__pyx_v_item_count = NULL;
10366   PyObject *__pyx_v_block_reader = NULL;
10367   CYTHON_UNUSED long __pyx_v_i;
10368   PyObject *__pyx_v_sum_chrom_id = NULL;
10369   PyObject *__pyx_r = NULL;
10370   __Pyx_RefNannyDeclarations
10371   PyObject *__pyx_t_1 = NULL;
10372   PyObject *__pyx_t_2 = NULL;
10373   PyObject *__pyx_t_3 = NULL;
10374   PyObject *__pyx_t_4 = NULL;
10375   PyObject *__pyx_t_5 = NULL;
10376   PyObject *__pyx_t_6 = NULL;
10377   int __pyx_t_7;
10378   PyObject *__pyx_t_8 = NULL;
10379   Py_ssize_t __pyx_t_9;
10380   PyObject *(*__pyx_t_10)(PyObject *);
10381   PyObject *(*__pyx_t_11)(PyObject *);
10382   int __pyx_t_12;
10383   Py_ssize_t __pyx_t_13;
10384   long __pyx_t_14;
10385   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_15;
10386   double __pyx_t_16;
10387   int __pyx_t_17;
10388   int __pyx_lineno = 0;
10389   const char *__pyx_filename = NULL;
10390   int __pyx_clineno = 0;
10391   __Pyx_RefNannySetupContext("_summary_blocks_in_region", 0);
10392 
10393   /* "bx/bbi/bbi_file.pyx":307
10394  *         cdef CIRTreeFile ctf
10395  *         cdef SummaryBlock summary
10396  *         rval = deque()             # <<<<<<<<<<<<<<
10397  *         reader = self.bbi_file.reader
10398  *         reader.seek( self.index_offset )
10399  */
10400   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_deque); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error)
10401   __Pyx_GOTREF(__pyx_t_2);
10402   __pyx_t_3 = NULL;
10403   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
10404     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
10405     if (likely(__pyx_t_3)) {
10406       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
10407       __Pyx_INCREF(__pyx_t_3);
10408       __Pyx_INCREF(function);
10409       __Pyx_DECREF_SET(__pyx_t_2, function);
10410     }
10411   }
10412   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
10413   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10414   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
10415   __Pyx_GOTREF(__pyx_t_1);
10416   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10417   __pyx_v_rval = __pyx_t_1;
10418   __pyx_t_1 = 0;
10419 
10420   /* "bx/bbi/bbi_file.pyx":308
10421  *         cdef SummaryBlock summary
10422  *         rval = deque()
10423  *         reader = self.bbi_file.reader             # <<<<<<<<<<<<<<
10424  *         reader.seek( self.index_offset )
10425  *         ctf = CIRTreeFile( reader.file )
10426  */
10427   __pyx_t_1 = __pyx_v_self->bbi_file->reader;
10428   __Pyx_INCREF(__pyx_t_1);
10429   __pyx_v_reader = __pyx_t_1;
10430   __pyx_t_1 = 0;
10431 
10432   /* "bx/bbi/bbi_file.pyx":309
10433  *         rval = deque()
10434  *         reader = self.bbi_file.reader
10435  *         reader.seek( self.index_offset )             # <<<<<<<<<<<<<<
10436  *         ctf = CIRTreeFile( reader.file )
10437  *         block_list = ctf.find_overlapping_blocks( chrom_id, start, end )
10438  */
10439   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_seek); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error)
10440   __Pyx_GOTREF(__pyx_t_2);
10441   __pyx_t_3 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->index_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error)
10442   __Pyx_GOTREF(__pyx_t_3);
10443   __pyx_t_4 = NULL;
10444   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
10445     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
10446     if (likely(__pyx_t_4)) {
10447       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
10448       __Pyx_INCREF(__pyx_t_4);
10449       __Pyx_INCREF(function);
10450       __Pyx_DECREF_SET(__pyx_t_2, function);
10451     }
10452   }
10453   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
10454   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10455   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10456   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
10457   __Pyx_GOTREF(__pyx_t_1);
10458   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10459   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10460 
10461   /* "bx/bbi/bbi_file.pyx":310
10462  *         reader = self.bbi_file.reader
10463  *         reader.seek( self.index_offset )
10464  *         ctf = CIRTreeFile( reader.file )             # <<<<<<<<<<<<<<
10465  *         block_list = ctf.find_overlapping_blocks( chrom_id, start, end )
10466  *         for offset, size in block_list:
10467  */
10468   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
10469   __Pyx_GOTREF(__pyx_t_1);
10470   __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_2bx_3bbi_12cirtree_file_CIRTreeFile), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
10471   __Pyx_GOTREF(__pyx_t_2);
10472   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10473   __pyx_v_ctf = ((struct __pyx_obj_2bx_3bbi_12cirtree_file_CIRTreeFile *)__pyx_t_2);
10474   __pyx_t_2 = 0;
10475 
10476   /* "bx/bbi/bbi_file.pyx":311
10477  *         reader.seek( self.index_offset )
10478  *         ctf = CIRTreeFile( reader.file )
10479  *         block_list = ctf.find_overlapping_blocks( chrom_id, start, end )             # <<<<<<<<<<<<<<
10480  *         for offset, size in block_list:
10481  *             # Seek to and read all data for the block
10482  */
10483   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ctf), __pyx_n_s_find_overlapping_blocks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
10484   __Pyx_GOTREF(__pyx_t_1);
10485   __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_chrom_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
10486   __Pyx_GOTREF(__pyx_t_3);
10487   __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
10488   __Pyx_GOTREF(__pyx_t_4);
10489   __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L1_error)
10490   __Pyx_GOTREF(__pyx_t_5);
10491   __pyx_t_6 = NULL;
10492   __pyx_t_7 = 0;
10493   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
10494     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
10495     if (likely(__pyx_t_6)) {
10496       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
10497       __Pyx_INCREF(__pyx_t_6);
10498       __Pyx_INCREF(function);
10499       __Pyx_DECREF_SET(__pyx_t_1, function);
10500       __pyx_t_7 = 1;
10501     }
10502   }
10503   #if CYTHON_FAST_PYCALL
10504   if (PyFunction_Check(__pyx_t_1)) {
10505     PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5};
10506     __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error)
10507     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10508     __Pyx_GOTREF(__pyx_t_2);
10509     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10510     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10511     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10512   } else
10513   #endif
10514   #if CYTHON_FAST_PYCCALL
10515   if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
10516     PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5};
10517     __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error)
10518     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10519     __Pyx_GOTREF(__pyx_t_2);
10520     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10521     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10522     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10523   } else
10524   #endif
10525   {
10526     __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 311, __pyx_L1_error)
10527     __Pyx_GOTREF(__pyx_t_8);
10528     if (__pyx_t_6) {
10529       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
10530     }
10531     __Pyx_GIVEREF(__pyx_t_3);
10532     PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
10533     __Pyx_GIVEREF(__pyx_t_4);
10534     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
10535     __Pyx_GIVEREF(__pyx_t_5);
10536     PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5);
10537     __pyx_t_3 = 0;
10538     __pyx_t_4 = 0;
10539     __pyx_t_5 = 0;
10540     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error)
10541     __Pyx_GOTREF(__pyx_t_2);
10542     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10543   }
10544   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10545   __pyx_v_block_list = __pyx_t_2;
10546   __pyx_t_2 = 0;
10547 
10548   /* "bx/bbi/bbi_file.pyx":312
10549  *         ctf = CIRTreeFile( reader.file )
10550  *         block_list = ctf.find_overlapping_blocks( chrom_id, start, end )
10551  *         for offset, size in block_list:             # <<<<<<<<<<<<<<
10552  *             # Seek to and read all data for the block
10553  *             reader.seek( offset )
10554  */
10555   if (likely(PyList_CheckExact(__pyx_v_block_list)) || PyTuple_CheckExact(__pyx_v_block_list)) {
10556     __pyx_t_2 = __pyx_v_block_list; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0;
10557     __pyx_t_10 = NULL;
10558   } else {
10559     __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_block_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
10560     __Pyx_GOTREF(__pyx_t_2);
10561     __pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 312, __pyx_L1_error)
10562   }
10563   for (;;) {
10564     if (likely(!__pyx_t_10)) {
10565       if (likely(PyList_CheckExact(__pyx_t_2))) {
10566         if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break;
10567         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10568         __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 312, __pyx_L1_error)
10569         #else
10570         __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
10571         __Pyx_GOTREF(__pyx_t_1);
10572         #endif
10573       } else {
10574         if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
10575         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10576         __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 312, __pyx_L1_error)
10577         #else
10578         __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
10579         __Pyx_GOTREF(__pyx_t_1);
10580         #endif
10581       }
10582     } else {
10583       __pyx_t_1 = __pyx_t_10(__pyx_t_2);
10584       if (unlikely(!__pyx_t_1)) {
10585         PyObject* exc_type = PyErr_Occurred();
10586         if (exc_type) {
10587           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10588           else __PYX_ERR(0, 312, __pyx_L1_error)
10589         }
10590         break;
10591       }
10592       __Pyx_GOTREF(__pyx_t_1);
10593     }
10594     if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
10595       PyObject* sequence = __pyx_t_1;
10596       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10597       if (unlikely(size != 2)) {
10598         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10599         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10600         __PYX_ERR(0, 312, __pyx_L1_error)
10601       }
10602       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10603       if (likely(PyTuple_CheckExact(sequence))) {
10604         __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0);
10605         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
10606       } else {
10607         __pyx_t_8 = PyList_GET_ITEM(sequence, 0);
10608         __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
10609       }
10610       __Pyx_INCREF(__pyx_t_8);
10611       __Pyx_INCREF(__pyx_t_5);
10612       #else
10613       __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L1_error)
10614       __Pyx_GOTREF(__pyx_t_8);
10615       __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L1_error)
10616       __Pyx_GOTREF(__pyx_t_5);
10617       #endif
10618       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10619     } else {
10620       Py_ssize_t index = -1;
10621       __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error)
10622       __Pyx_GOTREF(__pyx_t_4);
10623       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10624       __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext;
10625       index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed;
10626       __Pyx_GOTREF(__pyx_t_8);
10627       index = 1; __pyx_t_5 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
10628       __Pyx_GOTREF(__pyx_t_5);
10629       if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_4), 2) < 0) __PYX_ERR(0, 312, __pyx_L1_error)
10630       __pyx_t_11 = NULL;
10631       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10632       goto __pyx_L6_unpacking_done;
10633       __pyx_L5_unpacking_failed:;
10634       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10635       __pyx_t_11 = NULL;
10636       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
10637       __PYX_ERR(0, 312, __pyx_L1_error)
10638       __pyx_L6_unpacking_done:;
10639     }
10640     __Pyx_XDECREF_SET(__pyx_v_offset, __pyx_t_8);
10641     __pyx_t_8 = 0;
10642     __Pyx_XDECREF_SET(__pyx_v_size, __pyx_t_5);
10643     __pyx_t_5 = 0;
10644 
10645     /* "bx/bbi/bbi_file.pyx":314
10646  *         for offset, size in block_list:
10647  *             # Seek to and read all data for the block
10648  *             reader.seek( offset )             # <<<<<<<<<<<<<<
10649  *             block_data = reader.read( size )
10650  *             # Might need to uncompress
10651  */
10652     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_seek); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error)
10653     __Pyx_GOTREF(__pyx_t_5);
10654     __pyx_t_8 = NULL;
10655     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
10656       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
10657       if (likely(__pyx_t_8)) {
10658         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10659         __Pyx_INCREF(__pyx_t_8);
10660         __Pyx_INCREF(function);
10661         __Pyx_DECREF_SET(__pyx_t_5, function);
10662       }
10663     }
10664     __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_v_offset) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_offset);
10665     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10666     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error)
10667     __Pyx_GOTREF(__pyx_t_1);
10668     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10669     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10670 
10671     /* "bx/bbi/bbi_file.pyx":315
10672  *             # Seek to and read all data for the block
10673  *             reader.seek( offset )
10674  *             block_data = reader.read( size )             # <<<<<<<<<<<<<<
10675  *             # Might need to uncompress
10676  *             if self.bbi_file.uncompress_buf_size > 0:
10677  */
10678     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_read); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error)
10679     __Pyx_GOTREF(__pyx_t_5);
10680     __pyx_t_8 = NULL;
10681     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
10682       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
10683       if (likely(__pyx_t_8)) {
10684         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10685         __Pyx_INCREF(__pyx_t_8);
10686         __Pyx_INCREF(function);
10687         __Pyx_DECREF_SET(__pyx_t_5, function);
10688       }
10689     }
10690     __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_v_size) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_size);
10691     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10692     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
10693     __Pyx_GOTREF(__pyx_t_1);
10694     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10695     __Pyx_XDECREF_SET(__pyx_v_block_data, __pyx_t_1);
10696     __pyx_t_1 = 0;
10697 
10698     /* "bx/bbi/bbi_file.pyx":317
10699  *             block_data = reader.read( size )
10700  *             # Might need to uncompress
10701  *             if self.bbi_file.uncompress_buf_size > 0:             # <<<<<<<<<<<<<<
10702  *                 ## block_data = zlib.decompress( block_data, buf_size = self.bbi_file.uncompress_buf_size )
10703  *                 block_data = zlib.decompress( block_data )
10704  */
10705     __pyx_t_12 = ((__pyx_v_self->bbi_file->uncompress_buf_size > 0) != 0);
10706     if (__pyx_t_12) {
10707 
10708       /* "bx/bbi/bbi_file.pyx":319
10709  *             if self.bbi_file.uncompress_buf_size > 0:
10710  *                 ## block_data = zlib.decompress( block_data, buf_size = self.bbi_file.uncompress_buf_size )
10711  *                 block_data = zlib.decompress( block_data )             # <<<<<<<<<<<<<<
10712  *             block_size = len( block_data )
10713  *             # The block should be a bunch of summaries.
10714  */
10715       __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_zlib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error)
10716       __Pyx_GOTREF(__pyx_t_5);
10717       __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decompress); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 319, __pyx_L1_error)
10718       __Pyx_GOTREF(__pyx_t_8);
10719       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10720       __pyx_t_5 = NULL;
10721       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
10722         __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
10723         if (likely(__pyx_t_5)) {
10724           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
10725           __Pyx_INCREF(__pyx_t_5);
10726           __Pyx_INCREF(function);
10727           __Pyx_DECREF_SET(__pyx_t_8, function);
10728         }
10729       }
10730       __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_5, __pyx_v_block_data) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_block_data);
10731       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10732       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
10733       __Pyx_GOTREF(__pyx_t_1);
10734       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10735       __Pyx_DECREF_SET(__pyx_v_block_data, __pyx_t_1);
10736       __pyx_t_1 = 0;
10737 
10738       /* "bx/bbi/bbi_file.pyx":317
10739  *             block_data = reader.read( size )
10740  *             # Might need to uncompress
10741  *             if self.bbi_file.uncompress_buf_size > 0:             # <<<<<<<<<<<<<<
10742  *                 ## block_data = zlib.decompress( block_data, buf_size = self.bbi_file.uncompress_buf_size )
10743  *                 block_data = zlib.decompress( block_data )
10744  */
10745     }
10746 
10747     /* "bx/bbi/bbi_file.pyx":320
10748  *                 ## block_data = zlib.decompress( block_data, buf_size = self.bbi_file.uncompress_buf_size )
10749  *                 block_data = zlib.decompress( block_data )
10750  *             block_size = len( block_data )             # <<<<<<<<<<<<<<
10751  *             # The block should be a bunch of summaries.
10752  *             assert block_size % summary_on_disk_size == 0
10753  */
10754     __pyx_t_13 = PyObject_Length(__pyx_v_block_data); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 320, __pyx_L1_error)
10755     __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
10756     __Pyx_GOTREF(__pyx_t_1);
10757     __Pyx_XDECREF_SET(__pyx_v_block_size, __pyx_t_1);
10758     __pyx_t_1 = 0;
10759 
10760     /* "bx/bbi/bbi_file.pyx":322
10761  *             block_size = len( block_data )
10762  *             # The block should be a bunch of summaries.
10763  *             assert block_size % summary_on_disk_size == 0             # <<<<<<<<<<<<<<
10764  *             item_count = block_size / summary_on_disk_size
10765  *             # Create another reader just for the block, shouldn't be too expensive
10766  */
10767     #ifndef CYTHON_WITHOUT_ASSERTIONS
10768     if (unlikely(!Py_OptimizeFlag)) {
10769       __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_block_size, __pyx_int_32, 32, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
10770       __Pyx_GOTREF(__pyx_t_1);
10771       __pyx_t_8 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 322, __pyx_L1_error)
10772       __Pyx_GOTREF(__pyx_t_8);
10773       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10774       __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 322, __pyx_L1_error)
10775       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10776       if (unlikely(!__pyx_t_12)) {
10777         PyErr_SetNone(PyExc_AssertionError);
10778         __PYX_ERR(0, 322, __pyx_L1_error)
10779       }
10780     }
10781     #endif
10782 
10783     /* "bx/bbi/bbi_file.pyx":323
10784  *             # The block should be a bunch of summaries.
10785  *             assert block_size % summary_on_disk_size == 0
10786  *             item_count = block_size / summary_on_disk_size             # <<<<<<<<<<<<<<
10787  *             # Create another reader just for the block, shouldn't be too expensive
10788  *             block_reader = BinaryFileReader( BytesIO( block_data ), is_little_endian=reader.is_little_endian )
10789  */
10790     __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_block_size, __pyx_int_32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 323, __pyx_L1_error)
10791     __Pyx_GOTREF(__pyx_t_8);
10792     __Pyx_XDECREF_SET(__pyx_v_item_count, __pyx_t_8);
10793     __pyx_t_8 = 0;
10794 
10795     /* "bx/bbi/bbi_file.pyx":325
10796  *             item_count = block_size / summary_on_disk_size
10797  *             # Create another reader just for the block, shouldn't be too expensive
10798  *             block_reader = BinaryFileReader( BytesIO( block_data ), is_little_endian=reader.is_little_endian )             # <<<<<<<<<<<<<<
10799  *             for i from 0 <= i < item_count:
10800  *                 ## NOTE: Look carefully at bbiRead again to be sure the endian
10801  */
10802     __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BinaryFileReader); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 325, __pyx_L1_error)
10803     __Pyx_GOTREF(__pyx_t_8);
10804     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_BytesIO); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 325, __pyx_L1_error)
10805     __Pyx_GOTREF(__pyx_t_5);
10806     __pyx_t_4 = NULL;
10807     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
10808       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
10809       if (likely(__pyx_t_4)) {
10810         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10811         __Pyx_INCREF(__pyx_t_4);
10812         __Pyx_INCREF(function);
10813         __Pyx_DECREF_SET(__pyx_t_5, function);
10814       }
10815     }
10816     __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_block_data) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_block_data);
10817     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10818     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
10819     __Pyx_GOTREF(__pyx_t_1);
10820     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10821     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 325, __pyx_L1_error)
10822     __Pyx_GOTREF(__pyx_t_5);
10823     __Pyx_GIVEREF(__pyx_t_1);
10824     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
10825     __pyx_t_1 = 0;
10826     __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
10827     __Pyx_GOTREF(__pyx_t_1);
10828     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_is_little_endian); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
10829     __Pyx_GOTREF(__pyx_t_4);
10830     if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_is_little_endian, __pyx_t_4) < 0) __PYX_ERR(0, 325, __pyx_L1_error)
10831     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10832     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
10833     __Pyx_GOTREF(__pyx_t_4);
10834     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10835     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10836     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10837     __Pyx_XDECREF_SET(__pyx_v_block_reader, __pyx_t_4);
10838     __pyx_t_4 = 0;
10839 
10840     /* "bx/bbi/bbi_file.pyx":326
10841  *             # Create another reader just for the block, shouldn't be too expensive
10842  *             block_reader = BinaryFileReader( BytesIO( block_data ), is_little_endian=reader.is_little_endian )
10843  *             for i from 0 <= i < item_count:             # <<<<<<<<<<<<<<
10844  *                 ## NOTE: Look carefully at bbiRead again to be sure the endian
10845  *                 ##       conversion here is all correct. It looks like it is
10846  */
10847     __pyx_t_14 = __Pyx_PyInt_As_long(__pyx_v_item_count); if (unlikely((__pyx_t_14 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 326, __pyx_L1_error)
10848     for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_14; __pyx_v_i++) {
10849 
10850       /* "bx/bbi/bbi_file.pyx":331
10851  *                 ##       just pushing raw data into memory and not swapping
10852  *
10853  *                 sum_chrom_id = block_reader.read_uint32()             # <<<<<<<<<<<<<<
10854  *                 # A block can contain summaries from more that one chrom_id
10855  *                 if sum_chrom_id != chrom_id:
10856  */
10857       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_block_reader, __pyx_n_s_read_uint32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
10858       __Pyx_GOTREF(__pyx_t_1);
10859       __pyx_t_5 = NULL;
10860       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
10861         __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
10862         if (likely(__pyx_t_5)) {
10863           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
10864           __Pyx_INCREF(__pyx_t_5);
10865           __Pyx_INCREF(function);
10866           __Pyx_DECREF_SET(__pyx_t_1, function);
10867         }
10868       }
10869       __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
10870       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10871       if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
10872       __Pyx_GOTREF(__pyx_t_4);
10873       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10874       __Pyx_XDECREF_SET(__pyx_v_sum_chrom_id, __pyx_t_4);
10875       __pyx_t_4 = 0;
10876 
10877       /* "bx/bbi/bbi_file.pyx":333
10878  *                 sum_chrom_id = block_reader.read_uint32()
10879  *                 # A block can contain summaries from more that one chrom_id
10880  *                 if sum_chrom_id != chrom_id:             # <<<<<<<<<<<<<<
10881  *                     block_reader.skip(7*4)
10882  *                     continue
10883  */
10884       __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_chrom_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
10885       __Pyx_GOTREF(__pyx_t_4);
10886       __pyx_t_1 = PyObject_RichCompare(__pyx_v_sum_chrom_id, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error)
10887       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10888       __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 333, __pyx_L1_error)
10889       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10890       if (__pyx_t_12) {
10891 
10892         /* "bx/bbi/bbi_file.pyx":334
10893  *                 # A block can contain summaries from more that one chrom_id
10894  *                 if sum_chrom_id != chrom_id:
10895  *                     block_reader.skip(7*4)             # <<<<<<<<<<<<<<
10896  *                     continue
10897  *
10898  */
10899         __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_block_reader, __pyx_n_s_skip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error)
10900         __Pyx_GOTREF(__pyx_t_4);
10901         __pyx_t_5 = NULL;
10902         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
10903           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
10904           if (likely(__pyx_t_5)) {
10905             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
10906             __Pyx_INCREF(__pyx_t_5);
10907             __Pyx_INCREF(function);
10908             __Pyx_DECREF_SET(__pyx_t_4, function);
10909           }
10910         }
10911         __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_int_28) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_28);
10912         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10913         if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error)
10914         __Pyx_GOTREF(__pyx_t_1);
10915         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10916         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10917 
10918         /* "bx/bbi/bbi_file.pyx":335
10919  *                 if sum_chrom_id != chrom_id:
10920  *                     block_reader.skip(7*4)
10921  *                     continue             # <<<<<<<<<<<<<<
10922  *
10923  *                 summary = SummaryBlock()
10924  */
10925         goto __pyx_L8_continue;
10926 
10927         /* "bx/bbi/bbi_file.pyx":333
10928  *                 sum_chrom_id = block_reader.read_uint32()
10929  *                 # A block can contain summaries from more that one chrom_id
10930  *                 if sum_chrom_id != chrom_id:             # <<<<<<<<<<<<<<
10931  *                     block_reader.skip(7*4)
10932  *                     continue
10933  */
10934       }
10935 
10936       /* "bx/bbi/bbi_file.pyx":337
10937  *                     continue
10938  *
10939  *                 summary = SummaryBlock()             # <<<<<<<<<<<<<<
10940  *                 summary.chrom_id = sum_chrom_id
10941  *                 summary.start = block_reader.read_uint32()
10942  */
10943       __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_2bx_3bbi_8bbi_file_SummaryBlock)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
10944       __Pyx_GOTREF(__pyx_t_1);
10945       __Pyx_XDECREF_SET(__pyx_v_summary, ((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_t_1));
10946       __pyx_t_1 = 0;
10947 
10948       /* "bx/bbi/bbi_file.pyx":338
10949  *
10950  *                 summary = SummaryBlock()
10951  *                 summary.chrom_id = sum_chrom_id             # <<<<<<<<<<<<<<
10952  *                 summary.start = block_reader.read_uint32()
10953  *                 summary.end = block_reader.read_uint32()
10954  */
10955       __pyx_t_15 = __Pyx_PyInt_As_unsigned_int(__pyx_v_sum_chrom_id); if (unlikely((__pyx_t_15 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
10956       __pyx_v_summary->chrom_id = __pyx_t_15;
10957 
10958       /* "bx/bbi/bbi_file.pyx":339
10959  *                 summary = SummaryBlock()
10960  *                 summary.chrom_id = sum_chrom_id
10961  *                 summary.start = block_reader.read_uint32()             # <<<<<<<<<<<<<<
10962  *                 summary.end = block_reader.read_uint32()
10963  *                 summary.valid_count = block_reader.read_uint32()
10964  */
10965       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_block_reader, __pyx_n_s_read_uint32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 339, __pyx_L1_error)
10966       __Pyx_GOTREF(__pyx_t_4);
10967       __pyx_t_5 = NULL;
10968       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
10969         __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
10970         if (likely(__pyx_t_5)) {
10971           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
10972           __Pyx_INCREF(__pyx_t_5);
10973           __Pyx_INCREF(function);
10974           __Pyx_DECREF_SET(__pyx_t_4, function);
10975         }
10976       }
10977       __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
10978       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10979       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
10980       __Pyx_GOTREF(__pyx_t_1);
10981       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10982       __pyx_t_15 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_15 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L1_error)
10983       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10984       __pyx_v_summary->start = __pyx_t_15;
10985 
10986       /* "bx/bbi/bbi_file.pyx":340
10987  *                 summary.chrom_id = sum_chrom_id
10988  *                 summary.start = block_reader.read_uint32()
10989  *                 summary.end = block_reader.read_uint32()             # <<<<<<<<<<<<<<
10990  *                 summary.valid_count = block_reader.read_uint32()
10991  *                 summary.min_val = block_reader.read_float()
10992  */
10993       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_block_reader, __pyx_n_s_read_uint32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
10994       __Pyx_GOTREF(__pyx_t_4);
10995       __pyx_t_5 = NULL;
10996       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
10997         __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
10998         if (likely(__pyx_t_5)) {
10999           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
11000           __Pyx_INCREF(__pyx_t_5);
11001           __Pyx_INCREF(function);
11002           __Pyx_DECREF_SET(__pyx_t_4, function);
11003         }
11004       }
11005       __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
11006       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11007       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error)
11008       __Pyx_GOTREF(__pyx_t_1);
11009       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11010       __pyx_t_15 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_15 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error)
11011       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11012       __pyx_v_summary->end = __pyx_t_15;
11013 
11014       /* "bx/bbi/bbi_file.pyx":341
11015  *                 summary.start = block_reader.read_uint32()
11016  *                 summary.end = block_reader.read_uint32()
11017  *                 summary.valid_count = block_reader.read_uint32()             # <<<<<<<<<<<<<<
11018  *                 summary.min_val = block_reader.read_float()
11019  *                 summary.max_val = block_reader.read_float()
11020  */
11021       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_block_reader, __pyx_n_s_read_uint32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error)
11022       __Pyx_GOTREF(__pyx_t_4);
11023       __pyx_t_5 = NULL;
11024       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
11025         __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
11026         if (likely(__pyx_t_5)) {
11027           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
11028           __Pyx_INCREF(__pyx_t_5);
11029           __Pyx_INCREF(function);
11030           __Pyx_DECREF_SET(__pyx_t_4, function);
11031         }
11032       }
11033       __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
11034       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11035       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error)
11036       __Pyx_GOTREF(__pyx_t_1);
11037       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11038       __pyx_t_15 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_15 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 341, __pyx_L1_error)
11039       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11040       __pyx_v_summary->valid_count = __pyx_t_15;
11041 
11042       /* "bx/bbi/bbi_file.pyx":342
11043  *                 summary.end = block_reader.read_uint32()
11044  *                 summary.valid_count = block_reader.read_uint32()
11045  *                 summary.min_val = block_reader.read_float()             # <<<<<<<<<<<<<<
11046  *                 summary.max_val = block_reader.read_float()
11047  *                 summary.sum_data = block_reader.read_float()
11048  */
11049       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_block_reader, __pyx_n_s_read_float); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error)
11050       __Pyx_GOTREF(__pyx_t_4);
11051       __pyx_t_5 = NULL;
11052       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
11053         __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
11054         if (likely(__pyx_t_5)) {
11055           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
11056           __Pyx_INCREF(__pyx_t_5);
11057           __Pyx_INCREF(function);
11058           __Pyx_DECREF_SET(__pyx_t_4, function);
11059         }
11060       }
11061       __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
11062       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11063       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
11064       __Pyx_GOTREF(__pyx_t_1);
11065       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11066       __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L1_error)
11067       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11068       __pyx_v_summary->min_val = __pyx_t_16;
11069 
11070       /* "bx/bbi/bbi_file.pyx":343
11071  *                 summary.valid_count = block_reader.read_uint32()
11072  *                 summary.min_val = block_reader.read_float()
11073  *                 summary.max_val = block_reader.read_float()             # <<<<<<<<<<<<<<
11074  *                 summary.sum_data = block_reader.read_float()
11075  *                 summary.sum_squares = block_reader.read_float()
11076  */
11077       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_block_reader, __pyx_n_s_read_float); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error)
11078       __Pyx_GOTREF(__pyx_t_4);
11079       __pyx_t_5 = NULL;
11080       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
11081         __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
11082         if (likely(__pyx_t_5)) {
11083           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
11084           __Pyx_INCREF(__pyx_t_5);
11085           __Pyx_INCREF(function);
11086           __Pyx_DECREF_SET(__pyx_t_4, function);
11087         }
11088       }
11089       __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
11090       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11091       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error)
11092       __Pyx_GOTREF(__pyx_t_1);
11093       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11094       __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L1_error)
11095       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11096       __pyx_v_summary->max_val = __pyx_t_16;
11097 
11098       /* "bx/bbi/bbi_file.pyx":344
11099  *                 summary.min_val = block_reader.read_float()
11100  *                 summary.max_val = block_reader.read_float()
11101  *                 summary.sum_data = block_reader.read_float()             # <<<<<<<<<<<<<<
11102  *                 summary.sum_squares = block_reader.read_float()
11103  *                 rval.append( summary )
11104  */
11105       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_block_reader, __pyx_n_s_read_float); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error)
11106       __Pyx_GOTREF(__pyx_t_4);
11107       __pyx_t_5 = NULL;
11108       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
11109         __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
11110         if (likely(__pyx_t_5)) {
11111           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
11112           __Pyx_INCREF(__pyx_t_5);
11113           __Pyx_INCREF(function);
11114           __Pyx_DECREF_SET(__pyx_t_4, function);
11115         }
11116       }
11117       __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
11118       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11119       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
11120       __Pyx_GOTREF(__pyx_t_1);
11121       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11122       __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 344, __pyx_L1_error)
11123       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11124       __pyx_v_summary->sum_data = __pyx_t_16;
11125 
11126       /* "bx/bbi/bbi_file.pyx":345
11127  *                 summary.max_val = block_reader.read_float()
11128  *                 summary.sum_data = block_reader.read_float()
11129  *                 summary.sum_squares = block_reader.read_float()             # <<<<<<<<<<<<<<
11130  *                 rval.append( summary )
11131  *
11132  */
11133       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_block_reader, __pyx_n_s_read_float); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __pyx_L1_error)
11134       __Pyx_GOTREF(__pyx_t_4);
11135       __pyx_t_5 = NULL;
11136       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
11137         __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
11138         if (likely(__pyx_t_5)) {
11139           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
11140           __Pyx_INCREF(__pyx_t_5);
11141           __Pyx_INCREF(function);
11142           __Pyx_DECREF_SET(__pyx_t_4, function);
11143         }
11144       }
11145       __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
11146       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11147       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error)
11148       __Pyx_GOTREF(__pyx_t_1);
11149       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11150       __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L1_error)
11151       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11152       __pyx_v_summary->sum_squares = __pyx_t_16;
11153 
11154       /* "bx/bbi/bbi_file.pyx":346
11155  *                 summary.sum_data = block_reader.read_float()
11156  *                 summary.sum_squares = block_reader.read_float()
11157  *                 rval.append( summary )             # <<<<<<<<<<<<<<
11158  *
11159  *
11160  */
11161       __pyx_t_17 = __Pyx_PyObject_Append(__pyx_v_rval, ((PyObject *)__pyx_v_summary)); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 346, __pyx_L1_error)
11162       __pyx_L8_continue:;
11163     }
11164 
11165     /* "bx/bbi/bbi_file.pyx":312
11166  *         ctf = CIRTreeFile( reader.file )
11167  *         block_list = ctf.find_overlapping_blocks( chrom_id, start, end )
11168  *         for offset, size in block_list:             # <<<<<<<<<<<<<<
11169  *             # Seek to and read all data for the block
11170  *             reader.seek( offset )
11171  */
11172   }
11173   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11174 
11175   /* "bx/bbi/bbi_file.pyx":349
11176  *
11177  *
11178  *         return rval             # <<<<<<<<<<<<<<
11179  *
11180  *     cdef _get_summary_slice( self, bits32 base_start, bits32 base_end, summaries ):
11181  */
11182   __Pyx_XDECREF(__pyx_r);
11183   __Pyx_INCREF(__pyx_v_rval);
11184   __pyx_r = __pyx_v_rval;
11185   goto __pyx_L0;
11186 
11187   /* "bx/bbi/bbi_file.pyx":300
11188  *     cdef int item_count
11189  *
11190  *     def _summary_blocks_in_region( self, bits32 chrom_id, bits32 start, bits32 end ):             # <<<<<<<<<<<<<<
11191  *         """
11192  *         Return a list of all SummaryBlocks that overlap the region
11193  */
11194 
11195   /* function exit code */
11196   __pyx_L1_error:;
11197   __Pyx_XDECREF(__pyx_t_1);
11198   __Pyx_XDECREF(__pyx_t_2);
11199   __Pyx_XDECREF(__pyx_t_3);
11200   __Pyx_XDECREF(__pyx_t_4);
11201   __Pyx_XDECREF(__pyx_t_5);
11202   __Pyx_XDECREF(__pyx_t_6);
11203   __Pyx_XDECREF(__pyx_t_8);
11204   __Pyx_AddTraceback("bx.bbi.bbi_file.ZoomLevel._summary_blocks_in_region", __pyx_clineno, __pyx_lineno, __pyx_filename);
11205   __pyx_r = NULL;
11206   __pyx_L0:;
11207   __Pyx_XDECREF((PyObject *)__pyx_v_ctf);
11208   __Pyx_XDECREF((PyObject *)__pyx_v_summary);
11209   __Pyx_XDECREF(__pyx_v_rval);
11210   __Pyx_XDECREF(__pyx_v_reader);
11211   __Pyx_XDECREF(__pyx_v_block_list);
11212   __Pyx_XDECREF(__pyx_v_offset);
11213   __Pyx_XDECREF(__pyx_v_size);
11214   __Pyx_XDECREF(__pyx_v_block_data);
11215   __Pyx_XDECREF(__pyx_v_block_size);
11216   __Pyx_XDECREF(__pyx_v_item_count);
11217   __Pyx_XDECREF(__pyx_v_block_reader);
11218   __Pyx_XDECREF(__pyx_v_sum_chrom_id);
11219   __Pyx_XGIVEREF(__pyx_r);
11220   __Pyx_RefNannyFinishContext();
11221   return __pyx_r;
11222 }
11223 
11224 /* "bx/bbi/bbi_file.pyx":351
11225  *         return rval
11226  *
11227  *     cdef _get_summary_slice( self, bits32 base_start, bits32 base_end, summaries ):             # <<<<<<<<<<<<<<
11228  *         cdef float valid_count = 0.0
11229  *         cdef float sum_data = 0.0
11230  */
11231 
__pyx_f_2bx_3bbi_8bbi_file_9ZoomLevel__get_summary_slice(CYTHON_UNUSED struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel * __pyx_v_self,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_base_start,__pyx_t_2bx_3bbi_5types_bits32 __pyx_v_base_end,PyObject * __pyx_v_summaries)11232 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_9ZoomLevel__get_summary_slice(CYTHON_UNUSED struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_base_start, __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_base_end, PyObject *__pyx_v_summaries) {
11233   float __pyx_v_valid_count;
11234   float __pyx_v_sum_data;
11235   float __pyx_v_sum_squares;
11236   float __pyx_v_min_val;
11237   float __pyx_v_max_val;
11238   float __pyx_v_overlap_factor;
11239   int __pyx_v_overlap;
11240   PyObject *__pyx_v_summary = NULL;
11241   PyObject *__pyx_r = NULL;
11242   __Pyx_RefNannyDeclarations
11243   PyObject *__pyx_t_1 = NULL;
11244   PyObject *__pyx_t_2 = NULL;
11245   float __pyx_t_3;
11246   int __pyx_t_4;
11247   Py_ssize_t __pyx_t_5;
11248   PyObject *(*__pyx_t_6)(PyObject *);
11249   PyObject *__pyx_t_7 = NULL;
11250   PyObject *__pyx_t_8 = NULL;
11251   int __pyx_t_9;
11252   int __pyx_t_10;
11253   PyObject *__pyx_t_11 = NULL;
11254   PyObject *__pyx_t_12 = NULL;
11255   int __pyx_lineno = 0;
11256   const char *__pyx_filename = NULL;
11257   int __pyx_clineno = 0;
11258   __Pyx_RefNannySetupContext("_get_summary_slice", 0);
11259 
11260   /* "bx/bbi/bbi_file.pyx":352
11261  *
11262  *     cdef _get_summary_slice( self, bits32 base_start, bits32 base_end, summaries ):
11263  *         cdef float valid_count = 0.0             # <<<<<<<<<<<<<<
11264  *         cdef float sum_data = 0.0
11265  *         cdef float sum_squares = 0.0
11266  */
11267   __pyx_v_valid_count = 0.0;
11268 
11269   /* "bx/bbi/bbi_file.pyx":353
11270  *     cdef _get_summary_slice( self, bits32 base_start, bits32 base_end, summaries ):
11271  *         cdef float valid_count = 0.0
11272  *         cdef float sum_data = 0.0             # <<<<<<<<<<<<<<
11273  *         cdef float sum_squares = 0.0
11274  *         cdef float min_val = numpy.nan
11275  */
11276   __pyx_v_sum_data = 0.0;
11277 
11278   /* "bx/bbi/bbi_file.pyx":354
11279  *         cdef float valid_count = 0.0
11280  *         cdef float sum_data = 0.0
11281  *         cdef float sum_squares = 0.0             # <<<<<<<<<<<<<<
11282  *         cdef float min_val = numpy.nan
11283  *         cdef float max_val = numpy.nan
11284  */
11285   __pyx_v_sum_squares = 0.0;
11286 
11287   /* "bx/bbi/bbi_file.pyx":355
11288  *         cdef float sum_data = 0.0
11289  *         cdef float sum_squares = 0.0
11290  *         cdef float min_val = numpy.nan             # <<<<<<<<<<<<<<
11291  *         cdef float max_val = numpy.nan
11292  *         cdef float overlap_factor
11293  */
11294   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
11295   __Pyx_GOTREF(__pyx_t_1);
11296   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error)
11297   __Pyx_GOTREF(__pyx_t_2);
11298   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11299   __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 355, __pyx_L1_error)
11300   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11301   __pyx_v_min_val = __pyx_t_3;
11302 
11303   /* "bx/bbi/bbi_file.pyx":356
11304  *         cdef float sum_squares = 0.0
11305  *         cdef float min_val = numpy.nan
11306  *         cdef float max_val = numpy.nan             # <<<<<<<<<<<<<<
11307  *         cdef float overlap_factor
11308  *         cdef int overlap
11309  */
11310   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
11311   __Pyx_GOTREF(__pyx_t_2);
11312   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
11313   __Pyx_GOTREF(__pyx_t_1);
11314   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11315   __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 356, __pyx_L1_error)
11316   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11317   __pyx_v_max_val = __pyx_t_3;
11318 
11319   /* "bx/bbi/bbi_file.pyx":360
11320  *         cdef int overlap
11321  *
11322  *         if summaries:             # <<<<<<<<<<<<<<
11323  *
11324  *             min_val = summaries[0].min_val
11325  */
11326   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_summaries); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 360, __pyx_L1_error)
11327   if (__pyx_t_4) {
11328 
11329     /* "bx/bbi/bbi_file.pyx":362
11330  *         if summaries:
11331  *
11332  *             min_val = summaries[0].min_val             # <<<<<<<<<<<<<<
11333  *             max_val = summaries[0].max_val
11334  *
11335  */
11336     __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_summaries, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
11337     __Pyx_GOTREF(__pyx_t_1);
11338     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_min_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
11339     __Pyx_GOTREF(__pyx_t_2);
11340     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11341     __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L1_error)
11342     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11343     __pyx_v_min_val = __pyx_t_3;
11344 
11345     /* "bx/bbi/bbi_file.pyx":363
11346  *
11347  *             min_val = summaries[0].min_val
11348  *             max_val = summaries[0].max_val             # <<<<<<<<<<<<<<
11349  *
11350  *             for summary in summaries:
11351  */
11352     __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_summaries, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
11353     __Pyx_GOTREF(__pyx_t_2);
11354     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
11355     __Pyx_GOTREF(__pyx_t_1);
11356     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11357     __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
11358     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11359     __pyx_v_max_val = __pyx_t_3;
11360 
11361     /* "bx/bbi/bbi_file.pyx":365
11362  *             max_val = summaries[0].max_val
11363  *
11364  *             for summary in summaries:             # <<<<<<<<<<<<<<
11365  *                 if summary.start >= base_end:
11366  *                     break
11367  */
11368     if (likely(PyList_CheckExact(__pyx_v_summaries)) || PyTuple_CheckExact(__pyx_v_summaries)) {
11369       __pyx_t_1 = __pyx_v_summaries; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
11370       __pyx_t_6 = NULL;
11371     } else {
11372       __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_summaries); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
11373       __Pyx_GOTREF(__pyx_t_1);
11374       __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L1_error)
11375     }
11376     for (;;) {
11377       if (likely(!__pyx_t_6)) {
11378         if (likely(PyList_CheckExact(__pyx_t_1))) {
11379           if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
11380           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11381           __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
11382           #else
11383           __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
11384           __Pyx_GOTREF(__pyx_t_2);
11385           #endif
11386         } else {
11387           if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
11388           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11389           __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
11390           #else
11391           __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
11392           __Pyx_GOTREF(__pyx_t_2);
11393           #endif
11394         }
11395       } else {
11396         __pyx_t_2 = __pyx_t_6(__pyx_t_1);
11397         if (unlikely(!__pyx_t_2)) {
11398           PyObject* exc_type = PyErr_Occurred();
11399           if (exc_type) {
11400             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11401             else __PYX_ERR(0, 365, __pyx_L1_error)
11402           }
11403           break;
11404         }
11405         __Pyx_GOTREF(__pyx_t_2);
11406       }
11407       __Pyx_XDECREF_SET(__pyx_v_summary, __pyx_t_2);
11408       __pyx_t_2 = 0;
11409 
11410       /* "bx/bbi/bbi_file.pyx":366
11411  *
11412  *             for summary in summaries:
11413  *                 if summary.start >= base_end:             # <<<<<<<<<<<<<<
11414  *                     break
11415  *
11416  */
11417       __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_summary, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error)
11418       __Pyx_GOTREF(__pyx_t_2);
11419       __pyx_t_7 = __Pyx_PyInt_From_unsigned_int(__pyx_v_base_end); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 366, __pyx_L1_error)
11420       __Pyx_GOTREF(__pyx_t_7);
11421       __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 366, __pyx_L1_error)
11422       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11423       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11424       __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 366, __pyx_L1_error)
11425       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11426       if (__pyx_t_4) {
11427 
11428         /* "bx/bbi/bbi_file.pyx":367
11429  *             for summary in summaries:
11430  *                 if summary.start >= base_end:
11431  *                     break             # <<<<<<<<<<<<<<
11432  *
11433  *                 overlap = range_intersection( base_start, base_end, summary.start, summary.end )
11434  */
11435         goto __pyx_L5_break;
11436 
11437         /* "bx/bbi/bbi_file.pyx":366
11438  *
11439  *             for summary in summaries:
11440  *                 if summary.start >= base_end:             # <<<<<<<<<<<<<<
11441  *                     break
11442  *
11443  */
11444       }
11445 
11446       /* "bx/bbi/bbi_file.pyx":369
11447  *                     break
11448  *
11449  *                 overlap = range_intersection( base_start, base_end, summary.start, summary.end )             # <<<<<<<<<<<<<<
11450  *                 if overlap > 0:
11451  *                     overlap_factor = <double> overlap / (summary.end - summary.start)
11452  */
11453       __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_summary, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 369, __pyx_L1_error)
11454       __Pyx_GOTREF(__pyx_t_8);
11455       __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error)
11456       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11457       __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_summary, __pyx_n_s_end); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 369, __pyx_L1_error)
11458       __Pyx_GOTREF(__pyx_t_8);
11459       __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error)
11460       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11461       __pyx_v_overlap = __pyx_f_2bx_3bbi_8bbi_file_range_intersection(__pyx_v_base_start, __pyx_v_base_end, __pyx_t_9, __pyx_t_10);
11462 
11463       /* "bx/bbi/bbi_file.pyx":370
11464  *
11465  *                 overlap = range_intersection( base_start, base_end, summary.start, summary.end )
11466  *                 if overlap > 0:             # <<<<<<<<<<<<<<
11467  *                     overlap_factor = <double> overlap / (summary.end - summary.start)
11468  *
11469  */
11470       __pyx_t_4 = ((__pyx_v_overlap > 0) != 0);
11471       if (__pyx_t_4) {
11472 
11473         /* "bx/bbi/bbi_file.pyx":371
11474  *                 overlap = range_intersection( base_start, base_end, summary.start, summary.end )
11475  *                 if overlap > 0:
11476  *                     overlap_factor = <double> overlap / (summary.end - summary.start)             # <<<<<<<<<<<<<<
11477  *
11478  *                     valid_count += summary.valid_count * overlap_factor
11479  */
11480         __pyx_t_8 = PyFloat_FromDouble(((double)__pyx_v_overlap)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 371, __pyx_L1_error)
11481         __Pyx_GOTREF(__pyx_t_8);
11482         __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_summary, __pyx_n_s_end); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L1_error)
11483         __Pyx_GOTREF(__pyx_t_7);
11484         __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_summary, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error)
11485         __Pyx_GOTREF(__pyx_t_2);
11486         __pyx_t_11 = PyNumber_Subtract(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 371, __pyx_L1_error)
11487         __Pyx_GOTREF(__pyx_t_11);
11488         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11489         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11490         __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error)
11491         __Pyx_GOTREF(__pyx_t_2);
11492         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11493         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
11494         __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 371, __pyx_L1_error)
11495         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11496         __pyx_v_overlap_factor = __pyx_t_3;
11497 
11498         /* "bx/bbi/bbi_file.pyx":373
11499  *                     overlap_factor = <double> overlap / (summary.end - summary.start)
11500  *
11501  *                     valid_count += summary.valid_count * overlap_factor             # <<<<<<<<<<<<<<
11502  *                     sum_data += summary.sum_data * overlap_factor
11503  *                     sum_squares += summary.sum_squares * overlap_factor
11504  */
11505         __pyx_t_2 = PyFloat_FromDouble(__pyx_v_valid_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error)
11506         __Pyx_GOTREF(__pyx_t_2);
11507         __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_summary, __pyx_n_s_valid_count); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 373, __pyx_L1_error)
11508         __Pyx_GOTREF(__pyx_t_11);
11509         __pyx_t_8 = PyFloat_FromDouble(__pyx_v_overlap_factor); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 373, __pyx_L1_error)
11510         __Pyx_GOTREF(__pyx_t_8);
11511         __pyx_t_7 = PyNumber_Multiply(__pyx_t_11, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __pyx_L1_error)
11512         __Pyx_GOTREF(__pyx_t_7);
11513         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
11514         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11515         __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 373, __pyx_L1_error)
11516         __Pyx_GOTREF(__pyx_t_8);
11517         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11518         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11519         __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_8); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 373, __pyx_L1_error)
11520         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11521         __pyx_v_valid_count = __pyx_t_3;
11522 
11523         /* "bx/bbi/bbi_file.pyx":374
11524  *
11525  *                     valid_count += summary.valid_count * overlap_factor
11526  *                     sum_data += summary.sum_data * overlap_factor             # <<<<<<<<<<<<<<
11527  *                     sum_squares += summary.sum_squares * overlap_factor
11528  *
11529  */
11530         __pyx_t_8 = PyFloat_FromDouble(__pyx_v_sum_data); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 374, __pyx_L1_error)
11531         __Pyx_GOTREF(__pyx_t_8);
11532         __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_summary, __pyx_n_s_sum_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 374, __pyx_L1_error)
11533         __Pyx_GOTREF(__pyx_t_7);
11534         __pyx_t_2 = PyFloat_FromDouble(__pyx_v_overlap_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error)
11535         __Pyx_GOTREF(__pyx_t_2);
11536         __pyx_t_11 = PyNumber_Multiply(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 374, __pyx_L1_error)
11537         __Pyx_GOTREF(__pyx_t_11);
11538         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11539         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11540         __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_8, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error)
11541         __Pyx_GOTREF(__pyx_t_2);
11542         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11543         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
11544         __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 374, __pyx_L1_error)
11545         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11546         __pyx_v_sum_data = __pyx_t_3;
11547 
11548         /* "bx/bbi/bbi_file.pyx":375
11549  *                     valid_count += summary.valid_count * overlap_factor
11550  *                     sum_data += summary.sum_data * overlap_factor
11551  *                     sum_squares += summary.sum_squares * overlap_factor             # <<<<<<<<<<<<<<
11552  *
11553  *                     if max_val < summary.max_val:
11554  */
11555         __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sum_squares); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error)
11556         __Pyx_GOTREF(__pyx_t_2);
11557         __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_summary, __pyx_n_s_sum_squares); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 375, __pyx_L1_error)
11558         __Pyx_GOTREF(__pyx_t_11);
11559         __pyx_t_8 = PyFloat_FromDouble(__pyx_v_overlap_factor); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error)
11560         __Pyx_GOTREF(__pyx_t_8);
11561         __pyx_t_7 = PyNumber_Multiply(__pyx_t_11, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 375, __pyx_L1_error)
11562         __Pyx_GOTREF(__pyx_t_7);
11563         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
11564         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11565         __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error)
11566         __Pyx_GOTREF(__pyx_t_8);
11567         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11568         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11569         __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_8); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 375, __pyx_L1_error)
11570         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11571         __pyx_v_sum_squares = __pyx_t_3;
11572 
11573         /* "bx/bbi/bbi_file.pyx":377
11574  *                     sum_squares += summary.sum_squares * overlap_factor
11575  *
11576  *                     if max_val < summary.max_val:             # <<<<<<<<<<<<<<
11577  *                         max_val = summary.max_val
11578  *                     if min_val > summary.min_val:
11579  */
11580         __pyx_t_8 = PyFloat_FromDouble(__pyx_v_max_val); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 377, __pyx_L1_error)
11581         __Pyx_GOTREF(__pyx_t_8);
11582         __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_summary, __pyx_n_s_max_val); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 377, __pyx_L1_error)
11583         __Pyx_GOTREF(__pyx_t_7);
11584         __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error)
11585         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11586         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11587         __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 377, __pyx_L1_error)
11588         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11589         if (__pyx_t_4) {
11590 
11591           /* "bx/bbi/bbi_file.pyx":378
11592  *
11593  *                     if max_val < summary.max_val:
11594  *                         max_val = summary.max_val             # <<<<<<<<<<<<<<
11595  *                     if min_val > summary.min_val:
11596  *                         min_val = summary.min_val
11597  */
11598           __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_summary, __pyx_n_s_max_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error)
11599           __Pyx_GOTREF(__pyx_t_2);
11600           __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 378, __pyx_L1_error)
11601           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11602           __pyx_v_max_val = __pyx_t_3;
11603 
11604           /* "bx/bbi/bbi_file.pyx":377
11605  *                     sum_squares += summary.sum_squares * overlap_factor
11606  *
11607  *                     if max_val < summary.max_val:             # <<<<<<<<<<<<<<
11608  *                         max_val = summary.max_val
11609  *                     if min_val > summary.min_val:
11610  */
11611         }
11612 
11613         /* "bx/bbi/bbi_file.pyx":379
11614  *                     if max_val < summary.max_val:
11615  *                         max_val = summary.max_val
11616  *                     if min_val > summary.min_val:             # <<<<<<<<<<<<<<
11617  *                         min_val = summary.min_val
11618  *
11619  */
11620         __pyx_t_2 = PyFloat_FromDouble(__pyx_v_min_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error)
11621         __Pyx_GOTREF(__pyx_t_2);
11622         __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_summary, __pyx_n_s_min_val); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 379, __pyx_L1_error)
11623         __Pyx_GOTREF(__pyx_t_7);
11624         __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 379, __pyx_L1_error)
11625         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11626         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11627         __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 379, __pyx_L1_error)
11628         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11629         if (__pyx_t_4) {
11630 
11631           /* "bx/bbi/bbi_file.pyx":380
11632  *                         max_val = summary.max_val
11633  *                     if min_val > summary.min_val:
11634  *                         min_val = summary.min_val             # <<<<<<<<<<<<<<
11635  *
11636  *         return valid_count, sum_data, sum_squares, min_val, max_val
11637  */
11638           __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_summary, __pyx_n_s_min_val); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 380, __pyx_L1_error)
11639           __Pyx_GOTREF(__pyx_t_8);
11640           __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_8); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error)
11641           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11642           __pyx_v_min_val = __pyx_t_3;
11643 
11644           /* "bx/bbi/bbi_file.pyx":379
11645  *                     if max_val < summary.max_val:
11646  *                         max_val = summary.max_val
11647  *                     if min_val > summary.min_val:             # <<<<<<<<<<<<<<
11648  *                         min_val = summary.min_val
11649  *
11650  */
11651         }
11652 
11653         /* "bx/bbi/bbi_file.pyx":370
11654  *
11655  *                 overlap = range_intersection( base_start, base_end, summary.start, summary.end )
11656  *                 if overlap > 0:             # <<<<<<<<<<<<<<
11657  *                     overlap_factor = <double> overlap / (summary.end - summary.start)
11658  *
11659  */
11660       }
11661 
11662       /* "bx/bbi/bbi_file.pyx":365
11663  *             max_val = summaries[0].max_val
11664  *
11665  *             for summary in summaries:             # <<<<<<<<<<<<<<
11666  *                 if summary.start >= base_end:
11667  *                     break
11668  */
11669     }
11670     __pyx_L5_break:;
11671     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11672 
11673     /* "bx/bbi/bbi_file.pyx":360
11674  *         cdef int overlap
11675  *
11676  *         if summaries:             # <<<<<<<<<<<<<<
11677  *
11678  *             min_val = summaries[0].min_val
11679  */
11680   }
11681 
11682   /* "bx/bbi/bbi_file.pyx":382
11683  *                         min_val = summary.min_val
11684  *
11685  *         return valid_count, sum_data, sum_squares, min_val, max_val             # <<<<<<<<<<<<<<
11686  *
11687  *     cdef _summarize( self, bits32 chrom_id, bits32 start, bits32 end, int summary_size ):
11688  */
11689   __Pyx_XDECREF(__pyx_r);
11690   __pyx_t_1 = PyFloat_FromDouble(__pyx_v_valid_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
11691   __Pyx_GOTREF(__pyx_t_1);
11692   __pyx_t_8 = PyFloat_FromDouble(__pyx_v_sum_data); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 382, __pyx_L1_error)
11693   __Pyx_GOTREF(__pyx_t_8);
11694   __pyx_t_7 = PyFloat_FromDouble(__pyx_v_sum_squares); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 382, __pyx_L1_error)
11695   __Pyx_GOTREF(__pyx_t_7);
11696   __pyx_t_2 = PyFloat_FromDouble(__pyx_v_min_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
11697   __Pyx_GOTREF(__pyx_t_2);
11698   __pyx_t_11 = PyFloat_FromDouble(__pyx_v_max_val); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 382, __pyx_L1_error)
11699   __Pyx_GOTREF(__pyx_t_11);
11700   __pyx_t_12 = PyTuple_New(5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 382, __pyx_L1_error)
11701   __Pyx_GOTREF(__pyx_t_12);
11702   __Pyx_GIVEREF(__pyx_t_1);
11703   PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1);
11704   __Pyx_GIVEREF(__pyx_t_8);
11705   PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_8);
11706   __Pyx_GIVEREF(__pyx_t_7);
11707   PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_7);
11708   __Pyx_GIVEREF(__pyx_t_2);
11709   PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_2);
11710   __Pyx_GIVEREF(__pyx_t_11);
11711   PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_11);
11712   __pyx_t_1 = 0;
11713   __pyx_t_8 = 0;
11714   __pyx_t_7 = 0;
11715   __pyx_t_2 = 0;
11716   __pyx_t_11 = 0;
11717   __pyx_r = __pyx_t_12;
11718   __pyx_t_12 = 0;
11719   goto __pyx_L0;
11720 
11721   /* "bx/bbi/bbi_file.pyx":351
11722  *         return rval
11723  *
11724  *     cdef _get_summary_slice( self, bits32 base_start, bits32 base_end, summaries ):             # <<<<<<<<<<<<<<
11725  *         cdef float valid_count = 0.0
11726  *         cdef float sum_data = 0.0
11727  */
11728 
11729   /* function exit code */
11730   __pyx_L1_error:;
11731   __Pyx_XDECREF(__pyx_t_1);
11732   __Pyx_XDECREF(__pyx_t_2);
11733   __Pyx_XDECREF(__pyx_t_7);
11734   __Pyx_XDECREF(__pyx_t_8);
11735   __Pyx_XDECREF(__pyx_t_11);
11736   __Pyx_XDECREF(__pyx_t_12);
11737   __Pyx_AddTraceback("bx.bbi.bbi_file.ZoomLevel._get_summary_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11738   __pyx_r = 0;
11739   __pyx_L0:;
11740   __Pyx_XDECREF(__pyx_v_summary);
11741   __Pyx_XGIVEREF(__pyx_r);
11742   __Pyx_RefNannyFinishContext();
11743   return __pyx_r;
11744 }
11745 
11746 /* "bx/bbi/bbi_file.pyx":384
11747  *         return valid_count, sum_data, sum_squares, min_val, max_val
11748  *
11749  *     cdef _summarize( self, bits32 chrom_id, bits32 start, bits32 end, int summary_size ):             # <<<<<<<<<<<<<<
11750  *         """
11751  *         Summarize directly from file.
11752  */
11753 
__pyx_f_2bx_3bbi_8bbi_file_9ZoomLevel__summarize(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel * __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)11754 static PyObject *__pyx_f_2bx_3bbi_8bbi_file_9ZoomLevel__summarize(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__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) {
11755   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_base_start;
11756   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_base_end;
11757   __pyx_t_2bx_3bbi_5types_bits32 __pyx_v_base_step;
11758   PyArrayObject *__pyx_v_valid_count = 0;
11759   PyArrayObject *__pyx_v_min_val = 0;
11760   PyArrayObject *__pyx_v_max_val = 0;
11761   PyArrayObject *__pyx_v_sum_data = 0;
11762   PyArrayObject *__pyx_v_sum_squares = 0;
11763   struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v_rval = NULL;
11764   PyObject *__pyx_v_reader = NULL;
11765   PyObject *__pyx_v_summaries = NULL;
11766   int __pyx_v_i;
11767   __Pyx_LocalBuf_ND __pyx_pybuffernd_max_val;
11768   __Pyx_Buffer __pyx_pybuffer_max_val;
11769   __Pyx_LocalBuf_ND __pyx_pybuffernd_min_val;
11770   __Pyx_Buffer __pyx_pybuffer_min_val;
11771   __Pyx_LocalBuf_ND __pyx_pybuffernd_sum_data;
11772   __Pyx_Buffer __pyx_pybuffer_sum_data;
11773   __Pyx_LocalBuf_ND __pyx_pybuffernd_sum_squares;
11774   __Pyx_Buffer __pyx_pybuffer_sum_squares;
11775   __Pyx_LocalBuf_ND __pyx_pybuffernd_valid_count;
11776   __Pyx_Buffer __pyx_pybuffer_valid_count;
11777   PyObject *__pyx_r = NULL;
11778   __Pyx_RefNannyDeclarations
11779   PyObject *__pyx_t_1 = NULL;
11780   PyObject *__pyx_t_2 = NULL;
11781   PyObject *__pyx_t_3 = NULL;
11782   PyObject *__pyx_t_4 = NULL;
11783   int __pyx_t_5;
11784   PyObject *__pyx_t_6 = NULL;
11785   PyObject *__pyx_t_7 = NULL;
11786   PyObject *__pyx_t_8 = NULL;
11787   PyObject *__pyx_t_9 = NULL;
11788   PyObject *__pyx_t_10 = NULL;
11789   PyObject *__pyx_t_11 = NULL;
11790   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_12;
11791   int __pyx_t_13;
11792   int __pyx_t_14;
11793   int __pyx_t_15;
11794   int __pyx_t_16;
11795   PyObject *(*__pyx_t_17)(PyObject *);
11796   __pyx_t_5numpy_float64_t __pyx_t_18;
11797   __pyx_t_5numpy_float64_t __pyx_t_19;
11798   __pyx_t_5numpy_float64_t __pyx_t_20;
11799   __pyx_t_5numpy_float64_t __pyx_t_21;
11800   __pyx_t_5numpy_float64_t __pyx_t_22;
11801   Py_ssize_t __pyx_t_23;
11802   int __pyx_t_24;
11803   int __pyx_lineno = 0;
11804   const char *__pyx_filename = NULL;
11805   int __pyx_clineno = 0;
11806   __Pyx_RefNannySetupContext("_summarize", 0);
11807   __pyx_pybuffer_valid_count.pybuffer.buf = NULL;
11808   __pyx_pybuffer_valid_count.refcount = 0;
11809   __pyx_pybuffernd_valid_count.data = NULL;
11810   __pyx_pybuffernd_valid_count.rcbuffer = &__pyx_pybuffer_valid_count;
11811   __pyx_pybuffer_min_val.pybuffer.buf = NULL;
11812   __pyx_pybuffer_min_val.refcount = 0;
11813   __pyx_pybuffernd_min_val.data = NULL;
11814   __pyx_pybuffernd_min_val.rcbuffer = &__pyx_pybuffer_min_val;
11815   __pyx_pybuffer_max_val.pybuffer.buf = NULL;
11816   __pyx_pybuffer_max_val.refcount = 0;
11817   __pyx_pybuffernd_max_val.data = NULL;
11818   __pyx_pybuffernd_max_val.rcbuffer = &__pyx_pybuffer_max_val;
11819   __pyx_pybuffer_sum_data.pybuffer.buf = NULL;
11820   __pyx_pybuffer_sum_data.refcount = 0;
11821   __pyx_pybuffernd_sum_data.data = NULL;
11822   __pyx_pybuffernd_sum_data.rcbuffer = &__pyx_pybuffer_sum_data;
11823   __pyx_pybuffer_sum_squares.pybuffer.buf = NULL;
11824   __pyx_pybuffer_sum_squares.refcount = 0;
11825   __pyx_pybuffernd_sum_squares.data = NULL;
11826   __pyx_pybuffernd_sum_squares.rcbuffer = &__pyx_pybuffer_sum_squares;
11827 
11828   /* "bx/bbi/bbi_file.pyx":404
11829  *
11830  *         # What we will load into
11831  *         rval = SummarizedData( start, end, summary_size )             # <<<<<<<<<<<<<<
11832  *         valid_count = rval.valid_count
11833  *         min_val = rval.min_val
11834  */
11835   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error)
11836   __Pyx_GOTREF(__pyx_t_1);
11837   __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error)
11838   __Pyx_GOTREF(__pyx_t_2);
11839   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_summary_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
11840   __Pyx_GOTREF(__pyx_t_3);
11841   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 404, __pyx_L1_error)
11842   __Pyx_GOTREF(__pyx_t_4);
11843   __Pyx_GIVEREF(__pyx_t_1);
11844   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
11845   __Pyx_GIVEREF(__pyx_t_2);
11846   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
11847   __Pyx_GIVEREF(__pyx_t_3);
11848   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
11849   __pyx_t_1 = 0;
11850   __pyx_t_2 = 0;
11851   __pyx_t_3 = 0;
11852   __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2bx_3bbi_8bbi_file_SummarizedData), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
11853   __Pyx_GOTREF(__pyx_t_3);
11854   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11855   __pyx_v_rval = ((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_t_3);
11856   __pyx_t_3 = 0;
11857 
11858   /* "bx/bbi/bbi_file.pyx":405
11859  *         # What we will load into
11860  *         rval = SummarizedData( start, end, summary_size )
11861  *         valid_count = rval.valid_count             # <<<<<<<<<<<<<<
11862  *         min_val = rval.min_val
11863  *         max_val = rval.max_val
11864  */
11865   __pyx_t_3 = ((PyObject *)__pyx_v_rval->valid_count);
11866   __Pyx_INCREF(__pyx_t_3);
11867   {
11868     __Pyx_BufFmt_StackElem __pyx_stack[1];
11869     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_valid_count.rcbuffer->pybuffer);
11870     __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_valid_count.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
11871     if (unlikely(__pyx_t_5 < 0)) {
11872       PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
11873       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_valid_count.rcbuffer->pybuffer, (PyObject*)__pyx_v_valid_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
11874         Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
11875         __Pyx_RaiseBufferFallbackError();
11876       } else {
11877         PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
11878       }
11879       __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
11880     }
11881     __pyx_pybuffernd_valid_count.diminfo[0].strides = __pyx_pybuffernd_valid_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_valid_count.diminfo[0].shape = __pyx_pybuffernd_valid_count.rcbuffer->pybuffer.shape[0];
11882     if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 405, __pyx_L1_error)
11883   }
11884   __pyx_v_valid_count = ((PyArrayObject *)__pyx_t_3);
11885   __pyx_t_3 = 0;
11886 
11887   /* "bx/bbi/bbi_file.pyx":406
11888  *         rval = SummarizedData( start, end, summary_size )
11889  *         valid_count = rval.valid_count
11890  *         min_val = rval.min_val             # <<<<<<<<<<<<<<
11891  *         max_val = rval.max_val
11892  *         sum_data = rval.sum_data
11893  */
11894   __pyx_t_3 = ((PyObject *)__pyx_v_rval->min_val);
11895   __Pyx_INCREF(__pyx_t_3);
11896   {
11897     __Pyx_BufFmt_StackElem __pyx_stack[1];
11898     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_min_val.rcbuffer->pybuffer);
11899     __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_min_val.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
11900     if (unlikely(__pyx_t_5 < 0)) {
11901       PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
11902       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_min_val.rcbuffer->pybuffer, (PyObject*)__pyx_v_min_val, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
11903         Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
11904         __Pyx_RaiseBufferFallbackError();
11905       } else {
11906         PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
11907       }
11908       __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
11909     }
11910     __pyx_pybuffernd_min_val.diminfo[0].strides = __pyx_pybuffernd_min_val.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_min_val.diminfo[0].shape = __pyx_pybuffernd_min_val.rcbuffer->pybuffer.shape[0];
11911     if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 406, __pyx_L1_error)
11912   }
11913   __pyx_v_min_val = ((PyArrayObject *)__pyx_t_3);
11914   __pyx_t_3 = 0;
11915 
11916   /* "bx/bbi/bbi_file.pyx":407
11917  *         valid_count = rval.valid_count
11918  *         min_val = rval.min_val
11919  *         max_val = rval.max_val             # <<<<<<<<<<<<<<
11920  *         sum_data = rval.sum_data
11921  *         sum_squares = rval.sum_squares
11922  */
11923   __pyx_t_3 = ((PyObject *)__pyx_v_rval->max_val);
11924   __Pyx_INCREF(__pyx_t_3);
11925   {
11926     __Pyx_BufFmt_StackElem __pyx_stack[1];
11927     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_max_val.rcbuffer->pybuffer);
11928     __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_max_val.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
11929     if (unlikely(__pyx_t_5 < 0)) {
11930       PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
11931       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_max_val.rcbuffer->pybuffer, (PyObject*)__pyx_v_max_val, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
11932         Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
11933         __Pyx_RaiseBufferFallbackError();
11934       } else {
11935         PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
11936       }
11937       __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
11938     }
11939     __pyx_pybuffernd_max_val.diminfo[0].strides = __pyx_pybuffernd_max_val.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_max_val.diminfo[0].shape = __pyx_pybuffernd_max_val.rcbuffer->pybuffer.shape[0];
11940     if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 407, __pyx_L1_error)
11941   }
11942   __pyx_v_max_val = ((PyArrayObject *)__pyx_t_3);
11943   __pyx_t_3 = 0;
11944 
11945   /* "bx/bbi/bbi_file.pyx":408
11946  *         min_val = rval.min_val
11947  *         max_val = rval.max_val
11948  *         sum_data = rval.sum_data             # <<<<<<<<<<<<<<
11949  *         sum_squares = rval.sum_squares
11950  *         # First, load up summaries
11951  */
11952   __pyx_t_3 = ((PyObject *)__pyx_v_rval->sum_data);
11953   __Pyx_INCREF(__pyx_t_3);
11954   {
11955     __Pyx_BufFmt_StackElem __pyx_stack[1];
11956     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sum_data.rcbuffer->pybuffer);
11957     __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sum_data.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
11958     if (unlikely(__pyx_t_5 < 0)) {
11959       PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
11960       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sum_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_sum_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
11961         Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
11962         __Pyx_RaiseBufferFallbackError();
11963       } else {
11964         PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
11965       }
11966       __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
11967     }
11968     __pyx_pybuffernd_sum_data.diminfo[0].strides = __pyx_pybuffernd_sum_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sum_data.diminfo[0].shape = __pyx_pybuffernd_sum_data.rcbuffer->pybuffer.shape[0];
11969     if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 408, __pyx_L1_error)
11970   }
11971   __pyx_v_sum_data = ((PyArrayObject *)__pyx_t_3);
11972   __pyx_t_3 = 0;
11973 
11974   /* "bx/bbi/bbi_file.pyx":409
11975  *         max_val = rval.max_val
11976  *         sum_data = rval.sum_data
11977  *         sum_squares = rval.sum_squares             # <<<<<<<<<<<<<<
11978  *         # First, load up summaries
11979  *         reader = self.bbi_file.reader
11980  */
11981   __pyx_t_3 = ((PyObject *)__pyx_v_rval->sum_squares);
11982   __Pyx_INCREF(__pyx_t_3);
11983   {
11984     __Pyx_BufFmt_StackElem __pyx_stack[1];
11985     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sum_squares.rcbuffer->pybuffer);
11986     __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sum_squares.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
11987     if (unlikely(__pyx_t_5 < 0)) {
11988       PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
11989       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sum_squares.rcbuffer->pybuffer, (PyObject*)__pyx_v_sum_squares, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
11990         Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
11991         __Pyx_RaiseBufferFallbackError();
11992       } else {
11993         PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
11994       }
11995       __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
11996     }
11997     __pyx_pybuffernd_sum_squares.diminfo[0].strides = __pyx_pybuffernd_sum_squares.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sum_squares.diminfo[0].shape = __pyx_pybuffernd_sum_squares.rcbuffer->pybuffer.shape[0];
11998     if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 409, __pyx_L1_error)
11999   }
12000   __pyx_v_sum_squares = ((PyArrayObject *)__pyx_t_3);
12001   __pyx_t_3 = 0;
12002 
12003   /* "bx/bbi/bbi_file.pyx":411
12004  *         sum_squares = rval.sum_squares
12005  *         # First, load up summaries
12006  *         reader = self.bbi_file.reader             # <<<<<<<<<<<<<<
12007  *         reader.seek( self.index_offset )
12008  *         summaries = self._summary_blocks_in_region(chrom_id, start, end)
12009  */
12010   __pyx_t_3 = __pyx_v_self->bbi_file->reader;
12011   __Pyx_INCREF(__pyx_t_3);
12012   __pyx_v_reader = __pyx_t_3;
12013   __pyx_t_3 = 0;
12014 
12015   /* "bx/bbi/bbi_file.pyx":412
12016  *         # First, load up summaries
12017  *         reader = self.bbi_file.reader
12018  *         reader.seek( self.index_offset )             # <<<<<<<<<<<<<<
12019  *         summaries = self._summary_blocks_in_region(chrom_id, start, end)
12020  *
12021  */
12022   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader, __pyx_n_s_seek); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L1_error)
12023   __Pyx_GOTREF(__pyx_t_4);
12024   __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->index_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
12025   __Pyx_GOTREF(__pyx_t_2);
12026   __pyx_t_1 = NULL;
12027   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
12028     __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
12029     if (likely(__pyx_t_1)) {
12030       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
12031       __Pyx_INCREF(__pyx_t_1);
12032       __Pyx_INCREF(function);
12033       __Pyx_DECREF_SET(__pyx_t_4, function);
12034     }
12035   }
12036   __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2);
12037   __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12038   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12039   if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error)
12040   __Pyx_GOTREF(__pyx_t_3);
12041   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12042   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12043 
12044   /* "bx/bbi/bbi_file.pyx":413
12045  *         reader = self.bbi_file.reader
12046  *         reader.seek( self.index_offset )
12047  *         summaries = self._summary_blocks_in_region(chrom_id, start, end)             # <<<<<<<<<<<<<<
12048  *
12049  *         base_step = (end - start) / summary_size
12050  */
12051   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_summary_blocks_in_region); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error)
12052   __Pyx_GOTREF(__pyx_t_4);
12053   __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_chrom_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error)
12054   __Pyx_GOTREF(__pyx_t_2);
12055   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error)
12056   __Pyx_GOTREF(__pyx_t_1);
12057   __pyx_t_9 = __Pyx_PyInt_From_unsigned_int(__pyx_v_end); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 413, __pyx_L1_error)
12058   __Pyx_GOTREF(__pyx_t_9);
12059   __pyx_t_10 = NULL;
12060   __pyx_t_5 = 0;
12061   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
12062     __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
12063     if (likely(__pyx_t_10)) {
12064       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
12065       __Pyx_INCREF(__pyx_t_10);
12066       __Pyx_INCREF(function);
12067       __Pyx_DECREF_SET(__pyx_t_4, function);
12068       __pyx_t_5 = 1;
12069     }
12070   }
12071   #if CYTHON_FAST_PYCALL
12072   if (PyFunction_Check(__pyx_t_4)) {
12073     PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_t_2, __pyx_t_1, __pyx_t_9};
12074     __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error)
12075     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
12076     __Pyx_GOTREF(__pyx_t_3);
12077     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12078     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12079     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12080   } else
12081   #endif
12082   #if CYTHON_FAST_PYCCALL
12083   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
12084     PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_t_2, __pyx_t_1, __pyx_t_9};
12085     __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error)
12086     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
12087     __Pyx_GOTREF(__pyx_t_3);
12088     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12089     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12090     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12091   } else
12092   #endif
12093   {
12094     __pyx_t_11 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 413, __pyx_L1_error)
12095     __Pyx_GOTREF(__pyx_t_11);
12096     if (__pyx_t_10) {
12097       __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
12098     }
12099     __Pyx_GIVEREF(__pyx_t_2);
12100     PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_5, __pyx_t_2);
12101     __Pyx_GIVEREF(__pyx_t_1);
12102     PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_t_1);
12103     __Pyx_GIVEREF(__pyx_t_9);
12104     PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_5, __pyx_t_9);
12105     __pyx_t_2 = 0;
12106     __pyx_t_1 = 0;
12107     __pyx_t_9 = 0;
12108     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error)
12109     __Pyx_GOTREF(__pyx_t_3);
12110     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12111   }
12112   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12113   __pyx_v_summaries = __pyx_t_3;
12114   __pyx_t_3 = 0;
12115 
12116   /* "bx/bbi/bbi_file.pyx":415
12117  *         summaries = self._summary_blocks_in_region(chrom_id, start, end)
12118  *
12119  *         base_step = (end - start) / summary_size             # <<<<<<<<<<<<<<
12120  *         base_start = start
12121  *         base_end = start
12122  */
12123   __pyx_t_12 = (__pyx_v_end - __pyx_v_start);
12124   if (unlikely(__pyx_v_summary_size == 0)) {
12125     PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
12126     __PYX_ERR(0, 415, __pyx_L1_error)
12127   }
12128   __pyx_v_base_step = (__pyx_t_12 / __pyx_v_summary_size);
12129 
12130   /* "bx/bbi/bbi_file.pyx":416
12131  *
12132  *         base_step = (end - start) / summary_size
12133  *         base_start = start             # <<<<<<<<<<<<<<
12134  *         base_end = start
12135  *
12136  */
12137   __pyx_v_base_start = __pyx_v_start;
12138 
12139   /* "bx/bbi/bbi_file.pyx":417
12140  *         base_step = (end - start) / summary_size
12141  *         base_start = start
12142  *         base_end = start             # <<<<<<<<<<<<<<
12143  *
12144  *         for i in range(summary_size):
12145  */
12146   __pyx_v_base_end = __pyx_v_start;
12147 
12148   /* "bx/bbi/bbi_file.pyx":419
12149  *         base_end = start
12150  *
12151  *         for i in range(summary_size):             # <<<<<<<<<<<<<<
12152  *             base_end += base_step
12153  *
12154  */
12155   __pyx_t_5 = __pyx_v_summary_size;
12156   __pyx_t_13 = __pyx_t_5;
12157   for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
12158     __pyx_v_i = __pyx_t_14;
12159 
12160     /* "bx/bbi/bbi_file.pyx":420
12161  *
12162  *         for i in range(summary_size):
12163  *             base_end += base_step             # <<<<<<<<<<<<<<
12164  *
12165  *             while summaries and summaries[0].end <= base_start:
12166  */
12167     __pyx_v_base_end = (__pyx_v_base_end + __pyx_v_base_step);
12168 
12169     /* "bx/bbi/bbi_file.pyx":422
12170  *             base_end += base_step
12171  *
12172  *             while summaries and summaries[0].end <= base_start:             # <<<<<<<<<<<<<<
12173  *                 summaries.popleft()
12174  *
12175  */
12176     while (1) {
12177       __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_v_summaries); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 422, __pyx_L1_error)
12178       if (__pyx_t_16) {
12179       } else {
12180         __pyx_t_15 = __pyx_t_16;
12181         goto __pyx_L7_bool_binop_done;
12182       }
12183       __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_summaries, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error)
12184       __Pyx_GOTREF(__pyx_t_3);
12185       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error)
12186       __Pyx_GOTREF(__pyx_t_4);
12187       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12188       __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_base_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error)
12189       __Pyx_GOTREF(__pyx_t_3);
12190       __pyx_t_11 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 422, __pyx_L1_error)
12191       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12192       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12193       __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 422, __pyx_L1_error)
12194       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12195       __pyx_t_15 = __pyx_t_16;
12196       __pyx_L7_bool_binop_done:;
12197       if (!__pyx_t_15) break;
12198 
12199       /* "bx/bbi/bbi_file.pyx":423
12200  *
12201  *             while summaries and summaries[0].end <= base_start:
12202  *                 summaries.popleft()             # <<<<<<<<<<<<<<
12203  *
12204  *             valid_count[i], sum_data[i], sum_squares[i], min_val[i], max_val[i] = self._get_summary_slice(base_start, base_end, summaries)
12205  */
12206       __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_summaries, __pyx_n_s_popleft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 423, __pyx_L1_error)
12207       __Pyx_GOTREF(__pyx_t_3);
12208       __pyx_t_4 = NULL;
12209       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12210         __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
12211         if (likely(__pyx_t_4)) {
12212           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
12213           __Pyx_INCREF(__pyx_t_4);
12214           __Pyx_INCREF(function);
12215           __Pyx_DECREF_SET(__pyx_t_3, function);
12216         }
12217       }
12218       __pyx_t_11 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
12219       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12220       if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 423, __pyx_L1_error)
12221       __Pyx_GOTREF(__pyx_t_11);
12222       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12223       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12224     }
12225 
12226     /* "bx/bbi/bbi_file.pyx":425
12227  *                 summaries.popleft()
12228  *
12229  *             valid_count[i], sum_data[i], sum_squares[i], min_val[i], max_val[i] = self._get_summary_slice(base_start, base_end, summaries)             # <<<<<<<<<<<<<<
12230  *             base_start = base_end
12231  *
12232  */
12233     __pyx_t_11 = ((struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_ZoomLevel *)__pyx_v_self->__pyx_vtab)->_get_summary_slice(__pyx_v_self, __pyx_v_base_start, __pyx_v_base_end, __pyx_v_summaries); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 425, __pyx_L1_error)
12234     __Pyx_GOTREF(__pyx_t_11);
12235     if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) {
12236       PyObject* sequence = __pyx_t_11;
12237       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12238       if (unlikely(size != 5)) {
12239         if (size > 5) __Pyx_RaiseTooManyValuesError(5);
12240         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12241         __PYX_ERR(0, 425, __pyx_L1_error)
12242       }
12243       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12244       if (likely(PyTuple_CheckExact(sequence))) {
12245         __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
12246         __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
12247         __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
12248         __pyx_t_1 = PyTuple_GET_ITEM(sequence, 3);
12249         __pyx_t_2 = PyTuple_GET_ITEM(sequence, 4);
12250       } else {
12251         __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
12252         __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
12253         __pyx_t_9 = PyList_GET_ITEM(sequence, 2);
12254         __pyx_t_1 = PyList_GET_ITEM(sequence, 3);
12255         __pyx_t_2 = PyList_GET_ITEM(sequence, 4);
12256       }
12257       __Pyx_INCREF(__pyx_t_3);
12258       __Pyx_INCREF(__pyx_t_4);
12259       __Pyx_INCREF(__pyx_t_9);
12260       __Pyx_INCREF(__pyx_t_1);
12261       __Pyx_INCREF(__pyx_t_2);
12262       #else
12263       {
12264         Py_ssize_t i;
12265         PyObject** temps[5] = {&__pyx_t_3,&__pyx_t_4,&__pyx_t_9,&__pyx_t_1,&__pyx_t_2};
12266         for (i=0; i < 5; i++) {
12267           PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 425, __pyx_L1_error)
12268           __Pyx_GOTREF(item);
12269           *(temps[i]) = item;
12270         }
12271       }
12272       #endif
12273       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12274     } else {
12275       Py_ssize_t index = -1;
12276       PyObject** temps[5] = {&__pyx_t_3,&__pyx_t_4,&__pyx_t_9,&__pyx_t_1,&__pyx_t_2};
12277       __pyx_t_10 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 425, __pyx_L1_error)
12278       __Pyx_GOTREF(__pyx_t_10);
12279       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12280       __pyx_t_17 = Py_TYPE(__pyx_t_10)->tp_iternext;
12281       for (index=0; index < 5; index++) {
12282         PyObject* item = __pyx_t_17(__pyx_t_10); if (unlikely(!item)) goto __pyx_L9_unpacking_failed;
12283         __Pyx_GOTREF(item);
12284         *(temps[index]) = item;
12285       }
12286       if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 5) < 0) __PYX_ERR(0, 425, __pyx_L1_error)
12287       __pyx_t_17 = NULL;
12288       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12289       goto __pyx_L10_unpacking_done;
12290       __pyx_L9_unpacking_failed:;
12291       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12292       __pyx_t_17 = NULL;
12293       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
12294       __PYX_ERR(0, 425, __pyx_L1_error)
12295       __pyx_L10_unpacking_done:;
12296     }
12297     __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_18 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error)
12298     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12299     __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error)
12300     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12301     __pyx_t_20 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_20 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error)
12302     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12303     __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_21 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error)
12304     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12305     __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_22 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error)
12306     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12307     __pyx_t_23 = __pyx_v_i;
12308     __pyx_t_24 = -1;
12309     if (__pyx_t_23 < 0) {
12310       __pyx_t_23 += __pyx_pybuffernd_valid_count.diminfo[0].shape;
12311       if (unlikely(__pyx_t_23 < 0)) __pyx_t_24 = 0;
12312     } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_valid_count.diminfo[0].shape)) __pyx_t_24 = 0;
12313     if (unlikely(__pyx_t_24 != -1)) {
12314       __Pyx_RaiseBufferIndexError(__pyx_t_24);
12315       __PYX_ERR(0, 425, __pyx_L1_error)
12316     }
12317     *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_valid_count.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_valid_count.diminfo[0].strides) = __pyx_t_18;
12318     __pyx_t_23 = __pyx_v_i;
12319     __pyx_t_24 = -1;
12320     if (__pyx_t_23 < 0) {
12321       __pyx_t_23 += __pyx_pybuffernd_sum_data.diminfo[0].shape;
12322       if (unlikely(__pyx_t_23 < 0)) __pyx_t_24 = 0;
12323     } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_sum_data.diminfo[0].shape)) __pyx_t_24 = 0;
12324     if (unlikely(__pyx_t_24 != -1)) {
12325       __Pyx_RaiseBufferIndexError(__pyx_t_24);
12326       __PYX_ERR(0, 425, __pyx_L1_error)
12327     }
12328     *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sum_data.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_sum_data.diminfo[0].strides) = __pyx_t_19;
12329     __pyx_t_23 = __pyx_v_i;
12330     __pyx_t_24 = -1;
12331     if (__pyx_t_23 < 0) {
12332       __pyx_t_23 += __pyx_pybuffernd_sum_squares.diminfo[0].shape;
12333       if (unlikely(__pyx_t_23 < 0)) __pyx_t_24 = 0;
12334     } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_sum_squares.diminfo[0].shape)) __pyx_t_24 = 0;
12335     if (unlikely(__pyx_t_24 != -1)) {
12336       __Pyx_RaiseBufferIndexError(__pyx_t_24);
12337       __PYX_ERR(0, 425, __pyx_L1_error)
12338     }
12339     *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_sum_squares.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_sum_squares.diminfo[0].strides) = __pyx_t_20;
12340     __pyx_t_23 = __pyx_v_i;
12341     __pyx_t_24 = -1;
12342     if (__pyx_t_23 < 0) {
12343       __pyx_t_23 += __pyx_pybuffernd_min_val.diminfo[0].shape;
12344       if (unlikely(__pyx_t_23 < 0)) __pyx_t_24 = 0;
12345     } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_min_val.diminfo[0].shape)) __pyx_t_24 = 0;
12346     if (unlikely(__pyx_t_24 != -1)) {
12347       __Pyx_RaiseBufferIndexError(__pyx_t_24);
12348       __PYX_ERR(0, 425, __pyx_L1_error)
12349     }
12350     *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_min_val.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_min_val.diminfo[0].strides) = __pyx_t_21;
12351     __pyx_t_23 = __pyx_v_i;
12352     __pyx_t_24 = -1;
12353     if (__pyx_t_23 < 0) {
12354       __pyx_t_23 += __pyx_pybuffernd_max_val.diminfo[0].shape;
12355       if (unlikely(__pyx_t_23 < 0)) __pyx_t_24 = 0;
12356     } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_max_val.diminfo[0].shape)) __pyx_t_24 = 0;
12357     if (unlikely(__pyx_t_24 != -1)) {
12358       __Pyx_RaiseBufferIndexError(__pyx_t_24);
12359       __PYX_ERR(0, 425, __pyx_L1_error)
12360     }
12361     *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_max_val.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_max_val.diminfo[0].strides) = __pyx_t_22;
12362 
12363     /* "bx/bbi/bbi_file.pyx":426
12364  *
12365  *             valid_count[i], sum_data[i], sum_squares[i], min_val[i], max_val[i] = self._get_summary_slice(base_start, base_end, summaries)
12366  *             base_start = base_end             # <<<<<<<<<<<<<<
12367  *
12368  *         return rval
12369  */
12370     __pyx_v_base_start = __pyx_v_base_end;
12371   }
12372 
12373   /* "bx/bbi/bbi_file.pyx":428
12374  *             base_start = base_end
12375  *
12376  *         return rval             # <<<<<<<<<<<<<<
12377  */
12378   __Pyx_XDECREF(__pyx_r);
12379   __Pyx_INCREF(((PyObject *)__pyx_v_rval));
12380   __pyx_r = ((PyObject *)__pyx_v_rval);
12381   goto __pyx_L0;
12382 
12383   /* "bx/bbi/bbi_file.pyx":384
12384  *         return valid_count, sum_data, sum_squares, min_val, max_val
12385  *
12386  *     cdef _summarize( self, bits32 chrom_id, bits32 start, bits32 end, int summary_size ):             # <<<<<<<<<<<<<<
12387  *         """
12388  *         Summarize directly from file.
12389  */
12390 
12391   /* function exit code */
12392   __pyx_L1_error:;
12393   __Pyx_XDECREF(__pyx_t_1);
12394   __Pyx_XDECREF(__pyx_t_2);
12395   __Pyx_XDECREF(__pyx_t_3);
12396   __Pyx_XDECREF(__pyx_t_4);
12397   __Pyx_XDECREF(__pyx_t_9);
12398   __Pyx_XDECREF(__pyx_t_10);
12399   __Pyx_XDECREF(__pyx_t_11);
12400   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
12401     __Pyx_PyThreadState_declare
12402     __Pyx_PyThreadState_assign
12403     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
12404     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_max_val.rcbuffer->pybuffer);
12405     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_min_val.rcbuffer->pybuffer);
12406     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sum_data.rcbuffer->pybuffer);
12407     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sum_squares.rcbuffer->pybuffer);
12408     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_valid_count.rcbuffer->pybuffer);
12409   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
12410   __Pyx_AddTraceback("bx.bbi.bbi_file.ZoomLevel._summarize", __pyx_clineno, __pyx_lineno, __pyx_filename);
12411   __pyx_r = 0;
12412   goto __pyx_L2;
12413   __pyx_L0:;
12414   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_max_val.rcbuffer->pybuffer);
12415   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_min_val.rcbuffer->pybuffer);
12416   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sum_data.rcbuffer->pybuffer);
12417   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sum_squares.rcbuffer->pybuffer);
12418   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_valid_count.rcbuffer->pybuffer);
12419   __pyx_L2:;
12420   __Pyx_XDECREF((PyObject *)__pyx_v_valid_count);
12421   __Pyx_XDECREF((PyObject *)__pyx_v_min_val);
12422   __Pyx_XDECREF((PyObject *)__pyx_v_max_val);
12423   __Pyx_XDECREF((PyObject *)__pyx_v_sum_data);
12424   __Pyx_XDECREF((PyObject *)__pyx_v_sum_squares);
12425   __Pyx_XDECREF((PyObject *)__pyx_v_rval);
12426   __Pyx_XDECREF(__pyx_v_reader);
12427   __Pyx_XDECREF(__pyx_v_summaries);
12428   __Pyx_XGIVEREF(__pyx_r);
12429   __Pyx_RefNannyFinishContext();
12430   return __pyx_r;
12431 }
12432 
12433 /* "bx/bbi/bbi_file.pyx":294
12434  * cdef class ZoomLevel:
12435  *     cdef BBIFile bbi_file
12436  *     cdef public bits32 reduction_level             # <<<<<<<<<<<<<<
12437  *     cdef bits32 reserved
12438  *     cdef public bits64 data_offset
12439  */
12440 
12441 /* Python wrapper */
12442 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_15reduction_level_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_15reduction_level_1__get__(PyObject * __pyx_v_self)12443 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_15reduction_level_1__get__(PyObject *__pyx_v_self) {
12444   PyObject *__pyx_r = 0;
12445   __Pyx_RefNannyDeclarations
12446   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12447   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_15reduction_level___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)__pyx_v_self));
12448 
12449   /* function exit code */
12450   __Pyx_RefNannyFinishContext();
12451   return __pyx_r;
12452 }
12453 
__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_15reduction_level___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel * __pyx_v_self)12454 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_15reduction_level___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self) {
12455   PyObject *__pyx_r = NULL;
12456   __Pyx_RefNannyDeclarations
12457   PyObject *__pyx_t_1 = NULL;
12458   int __pyx_lineno = 0;
12459   const char *__pyx_filename = NULL;
12460   int __pyx_clineno = 0;
12461   __Pyx_RefNannySetupContext("__get__", 0);
12462   __Pyx_XDECREF(__pyx_r);
12463   __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->reduction_level); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error)
12464   __Pyx_GOTREF(__pyx_t_1);
12465   __pyx_r = __pyx_t_1;
12466   __pyx_t_1 = 0;
12467   goto __pyx_L0;
12468 
12469   /* function exit code */
12470   __pyx_L1_error:;
12471   __Pyx_XDECREF(__pyx_t_1);
12472   __Pyx_AddTraceback("bx.bbi.bbi_file.ZoomLevel.reduction_level.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12473   __pyx_r = NULL;
12474   __pyx_L0:;
12475   __Pyx_XGIVEREF(__pyx_r);
12476   __Pyx_RefNannyFinishContext();
12477   return __pyx_r;
12478 }
12479 
12480 /* Python wrapper */
12481 static int __pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_15reduction_level_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_15reduction_level_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)12482 static int __pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_15reduction_level_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
12483   int __pyx_r;
12484   __Pyx_RefNannyDeclarations
12485   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
12486   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_15reduction_level_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)__pyx_v_self), ((PyObject *)__pyx_v_value));
12487 
12488   /* function exit code */
12489   __Pyx_RefNannyFinishContext();
12490   return __pyx_r;
12491 }
12492 
__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_15reduction_level_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel * __pyx_v_self,PyObject * __pyx_v_value)12493 static int __pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_15reduction_level_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self, PyObject *__pyx_v_value) {
12494   int __pyx_r;
12495   __Pyx_RefNannyDeclarations
12496   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_1;
12497   int __pyx_lineno = 0;
12498   const char *__pyx_filename = NULL;
12499   int __pyx_clineno = 0;
12500   __Pyx_RefNannySetupContext("__set__", 0);
12501   __pyx_t_1 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L1_error)
12502   __pyx_v_self->reduction_level = __pyx_t_1;
12503 
12504   /* function exit code */
12505   __pyx_r = 0;
12506   goto __pyx_L0;
12507   __pyx_L1_error:;
12508   __Pyx_AddTraceback("bx.bbi.bbi_file.ZoomLevel.reduction_level.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12509   __pyx_r = -1;
12510   __pyx_L0:;
12511   __Pyx_RefNannyFinishContext();
12512   return __pyx_r;
12513 }
12514 
12515 /* "bx/bbi/bbi_file.pyx":296
12516  *     cdef public bits32 reduction_level
12517  *     cdef bits32 reserved
12518  *     cdef public bits64 data_offset             # <<<<<<<<<<<<<<
12519  *     cdef public bits64 index_offset
12520  *     cdef int item_count
12521  */
12522 
12523 /* Python wrapper */
12524 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_11data_offset_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_11data_offset_1__get__(PyObject * __pyx_v_self)12525 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_11data_offset_1__get__(PyObject *__pyx_v_self) {
12526   PyObject *__pyx_r = 0;
12527   __Pyx_RefNannyDeclarations
12528   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12529   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_11data_offset___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)__pyx_v_self));
12530 
12531   /* function exit code */
12532   __Pyx_RefNannyFinishContext();
12533   return __pyx_r;
12534 }
12535 
__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_11data_offset___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel * __pyx_v_self)12536 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_11data_offset___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self) {
12537   PyObject *__pyx_r = NULL;
12538   __Pyx_RefNannyDeclarations
12539   PyObject *__pyx_t_1 = NULL;
12540   int __pyx_lineno = 0;
12541   const char *__pyx_filename = NULL;
12542   int __pyx_clineno = 0;
12543   __Pyx_RefNannySetupContext("__get__", 0);
12544   __Pyx_XDECREF(__pyx_r);
12545   __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->data_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
12546   __Pyx_GOTREF(__pyx_t_1);
12547   __pyx_r = __pyx_t_1;
12548   __pyx_t_1 = 0;
12549   goto __pyx_L0;
12550 
12551   /* function exit code */
12552   __pyx_L1_error:;
12553   __Pyx_XDECREF(__pyx_t_1);
12554   __Pyx_AddTraceback("bx.bbi.bbi_file.ZoomLevel.data_offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12555   __pyx_r = NULL;
12556   __pyx_L0:;
12557   __Pyx_XGIVEREF(__pyx_r);
12558   __Pyx_RefNannyFinishContext();
12559   return __pyx_r;
12560 }
12561 
12562 /* Python wrapper */
12563 static int __pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_11data_offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_11data_offset_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)12564 static int __pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_11data_offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
12565   int __pyx_r;
12566   __Pyx_RefNannyDeclarations
12567   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
12568   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_11data_offset_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)__pyx_v_self), ((PyObject *)__pyx_v_value));
12569 
12570   /* function exit code */
12571   __Pyx_RefNannyFinishContext();
12572   return __pyx_r;
12573 }
12574 
__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_11data_offset_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel * __pyx_v_self,PyObject * __pyx_v_value)12575 static int __pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_11data_offset_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self, PyObject *__pyx_v_value) {
12576   int __pyx_r;
12577   __Pyx_RefNannyDeclarations
12578   __pyx_t_2bx_3bbi_5types_bits64 __pyx_t_1;
12579   int __pyx_lineno = 0;
12580   const char *__pyx_filename = NULL;
12581   int __pyx_clineno = 0;
12582   __Pyx_RefNannySetupContext("__set__", 0);
12583   __pyx_t_1 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 296, __pyx_L1_error)
12584   __pyx_v_self->data_offset = __pyx_t_1;
12585 
12586   /* function exit code */
12587   __pyx_r = 0;
12588   goto __pyx_L0;
12589   __pyx_L1_error:;
12590   __Pyx_AddTraceback("bx.bbi.bbi_file.ZoomLevel.data_offset.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12591   __pyx_r = -1;
12592   __pyx_L0:;
12593   __Pyx_RefNannyFinishContext();
12594   return __pyx_r;
12595 }
12596 
12597 /* "bx/bbi/bbi_file.pyx":297
12598  *     cdef bits32 reserved
12599  *     cdef public bits64 data_offset
12600  *     cdef public bits64 index_offset             # <<<<<<<<<<<<<<
12601  *     cdef int item_count
12602  *
12603  */
12604 
12605 /* Python wrapper */
12606 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_12index_offset_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_12index_offset_1__get__(PyObject * __pyx_v_self)12607 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_12index_offset_1__get__(PyObject *__pyx_v_self) {
12608   PyObject *__pyx_r = 0;
12609   __Pyx_RefNannyDeclarations
12610   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12611   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_12index_offset___get__(((struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)__pyx_v_self));
12612 
12613   /* function exit code */
12614   __Pyx_RefNannyFinishContext();
12615   return __pyx_r;
12616 }
12617 
__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_12index_offset___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel * __pyx_v_self)12618 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_12index_offset___get__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self) {
12619   PyObject *__pyx_r = NULL;
12620   __Pyx_RefNannyDeclarations
12621   PyObject *__pyx_t_1 = NULL;
12622   int __pyx_lineno = 0;
12623   const char *__pyx_filename = NULL;
12624   int __pyx_clineno = 0;
12625   __Pyx_RefNannySetupContext("__get__", 0);
12626   __Pyx_XDECREF(__pyx_r);
12627   __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->index_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
12628   __Pyx_GOTREF(__pyx_t_1);
12629   __pyx_r = __pyx_t_1;
12630   __pyx_t_1 = 0;
12631   goto __pyx_L0;
12632 
12633   /* function exit code */
12634   __pyx_L1_error:;
12635   __Pyx_XDECREF(__pyx_t_1);
12636   __Pyx_AddTraceback("bx.bbi.bbi_file.ZoomLevel.index_offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12637   __pyx_r = NULL;
12638   __pyx_L0:;
12639   __Pyx_XGIVEREF(__pyx_r);
12640   __Pyx_RefNannyFinishContext();
12641   return __pyx_r;
12642 }
12643 
12644 /* Python wrapper */
12645 static int __pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_12index_offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_12index_offset_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)12646 static int __pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_12index_offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
12647   int __pyx_r;
12648   __Pyx_RefNannyDeclarations
12649   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
12650   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_12index_offset_2__set__(((struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)__pyx_v_self), ((PyObject *)__pyx_v_value));
12651 
12652   /* function exit code */
12653   __Pyx_RefNannyFinishContext();
12654   return __pyx_r;
12655 }
12656 
__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_12index_offset_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel * __pyx_v_self,PyObject * __pyx_v_value)12657 static int __pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_12index_offset_2__set__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self, PyObject *__pyx_v_value) {
12658   int __pyx_r;
12659   __Pyx_RefNannyDeclarations
12660   __pyx_t_2bx_3bbi_5types_bits64 __pyx_t_1;
12661   int __pyx_lineno = 0;
12662   const char *__pyx_filename = NULL;
12663   int __pyx_clineno = 0;
12664   __Pyx_RefNannySetupContext("__set__", 0);
12665   __pyx_t_1 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L1_error)
12666   __pyx_v_self->index_offset = __pyx_t_1;
12667 
12668   /* function exit code */
12669   __pyx_r = 0;
12670   goto __pyx_L0;
12671   __pyx_L1_error:;
12672   __Pyx_AddTraceback("bx.bbi.bbi_file.ZoomLevel.index_offset.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12673   __pyx_r = -1;
12674   __pyx_L0:;
12675   __Pyx_RefNannyFinishContext();
12676   return __pyx_r;
12677 }
12678 
12679 /* "(tree fragment)":1
12680  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
12681  *     cdef tuple state
12682  *     cdef object _dict
12683  */
12684 
12685 /* Python wrapper */
12686 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_3__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)12687 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12688   PyObject *__pyx_r = 0;
12689   __Pyx_RefNannyDeclarations
12690   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12691   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_2__reduce_cython__(((struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)__pyx_v_self));
12692 
12693   /* function exit code */
12694   __Pyx_RefNannyFinishContext();
12695   return __pyx_r;
12696 }
12697 
__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_2__reduce_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel * __pyx_v_self)12698 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_2__reduce_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self) {
12699   PyObject *__pyx_v_state = 0;
12700   PyObject *__pyx_v__dict = 0;
12701   int __pyx_v_use_setstate;
12702   PyObject *__pyx_r = NULL;
12703   __Pyx_RefNannyDeclarations
12704   PyObject *__pyx_t_1 = NULL;
12705   PyObject *__pyx_t_2 = NULL;
12706   PyObject *__pyx_t_3 = NULL;
12707   PyObject *__pyx_t_4 = NULL;
12708   PyObject *__pyx_t_5 = NULL;
12709   PyObject *__pyx_t_6 = NULL;
12710   int __pyx_t_7;
12711   int __pyx_t_8;
12712   int __pyx_lineno = 0;
12713   const char *__pyx_filename = NULL;
12714   int __pyx_clineno = 0;
12715   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
12716 
12717   /* "(tree fragment)":5
12718  *     cdef object _dict
12719  *     cdef bint use_setstate
12720  *     state = (self.bbi_file, self.data_offset, self.index_offset, self.item_count, self.reduction_level, self.reserved)             # <<<<<<<<<<<<<<
12721  *     _dict = getattr(self, '__dict__', None)
12722  *     if _dict is not None:
12723  */
12724   __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->data_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
12725   __Pyx_GOTREF(__pyx_t_1);
12726   __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->index_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
12727   __Pyx_GOTREF(__pyx_t_2);
12728   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->item_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
12729   __Pyx_GOTREF(__pyx_t_3);
12730   __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->reduction_level); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
12731   __Pyx_GOTREF(__pyx_t_4);
12732   __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->reserved); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error)
12733   __Pyx_GOTREF(__pyx_t_5);
12734   __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error)
12735   __Pyx_GOTREF(__pyx_t_6);
12736   __Pyx_INCREF(((PyObject *)__pyx_v_self->bbi_file));
12737   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->bbi_file));
12738   PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_self->bbi_file));
12739   __Pyx_GIVEREF(__pyx_t_1);
12740   PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
12741   __Pyx_GIVEREF(__pyx_t_2);
12742   PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2);
12743   __Pyx_GIVEREF(__pyx_t_3);
12744   PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_3);
12745   __Pyx_GIVEREF(__pyx_t_4);
12746   PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_4);
12747   __Pyx_GIVEREF(__pyx_t_5);
12748   PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_5);
12749   __pyx_t_1 = 0;
12750   __pyx_t_2 = 0;
12751   __pyx_t_3 = 0;
12752   __pyx_t_4 = 0;
12753   __pyx_t_5 = 0;
12754   __pyx_v_state = ((PyObject*)__pyx_t_6);
12755   __pyx_t_6 = 0;
12756 
12757   /* "(tree fragment)":6
12758  *     cdef bint use_setstate
12759  *     state = (self.bbi_file, self.data_offset, self.index_offset, self.item_count, self.reduction_level, self.reserved)
12760  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
12761  *     if _dict is not None:
12762  *         state += (_dict,)
12763  */
12764   __pyx_t_6 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 6, __pyx_L1_error)
12765   __Pyx_GOTREF(__pyx_t_6);
12766   __pyx_v__dict = __pyx_t_6;
12767   __pyx_t_6 = 0;
12768 
12769   /* "(tree fragment)":7
12770  *     state = (self.bbi_file, self.data_offset, self.index_offset, self.item_count, self.reduction_level, self.reserved)
12771  *     _dict = getattr(self, '__dict__', None)
12772  *     if _dict is not None:             # <<<<<<<<<<<<<<
12773  *         state += (_dict,)
12774  *         use_setstate = True
12775  */
12776   __pyx_t_7 = (__pyx_v__dict != Py_None);
12777   __pyx_t_8 = (__pyx_t_7 != 0);
12778   if (__pyx_t_8) {
12779 
12780     /* "(tree fragment)":8
12781  *     _dict = getattr(self, '__dict__', None)
12782  *     if _dict is not None:
12783  *         state += (_dict,)             # <<<<<<<<<<<<<<
12784  *         use_setstate = True
12785  *     else:
12786  */
12787     __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 8, __pyx_L1_error)
12788     __Pyx_GOTREF(__pyx_t_6);
12789     __Pyx_INCREF(__pyx_v__dict);
12790     __Pyx_GIVEREF(__pyx_v__dict);
12791     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v__dict);
12792     __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 8, __pyx_L1_error)
12793     __Pyx_GOTREF(__pyx_t_5);
12794     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12795     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_5));
12796     __pyx_t_5 = 0;
12797 
12798     /* "(tree fragment)":9
12799  *     if _dict is not None:
12800  *         state += (_dict,)
12801  *         use_setstate = True             # <<<<<<<<<<<<<<
12802  *     else:
12803  *         use_setstate = self.bbi_file is not None
12804  */
12805     __pyx_v_use_setstate = 1;
12806 
12807     /* "(tree fragment)":7
12808  *     state = (self.bbi_file, self.data_offset, self.index_offset, self.item_count, self.reduction_level, self.reserved)
12809  *     _dict = getattr(self, '__dict__', None)
12810  *     if _dict is not None:             # <<<<<<<<<<<<<<
12811  *         state += (_dict,)
12812  *         use_setstate = True
12813  */
12814     goto __pyx_L3;
12815   }
12816 
12817   /* "(tree fragment)":11
12818  *         use_setstate = True
12819  *     else:
12820  *         use_setstate = self.bbi_file is not None             # <<<<<<<<<<<<<<
12821  *     if use_setstate:
12822  *         return __pyx_unpickle_ZoomLevel, (type(self), 0x3665355, None), state
12823  */
12824   /*else*/ {
12825     __pyx_t_8 = (((PyObject *)__pyx_v_self->bbi_file) != Py_None);
12826     __pyx_v_use_setstate = __pyx_t_8;
12827   }
12828   __pyx_L3:;
12829 
12830   /* "(tree fragment)":12
12831  *     else:
12832  *         use_setstate = self.bbi_file is not None
12833  *     if use_setstate:             # <<<<<<<<<<<<<<
12834  *         return __pyx_unpickle_ZoomLevel, (type(self), 0x3665355, None), state
12835  *     else:
12836  */
12837   __pyx_t_8 = (__pyx_v_use_setstate != 0);
12838   if (__pyx_t_8) {
12839 
12840     /* "(tree fragment)":13
12841  *         use_setstate = self.bbi_file is not None
12842  *     if use_setstate:
12843  *         return __pyx_unpickle_ZoomLevel, (type(self), 0x3665355, None), state             # <<<<<<<<<<<<<<
12844  *     else:
12845  *         return __pyx_unpickle_ZoomLevel, (type(self), 0x3665355, state)
12846  */
12847     __Pyx_XDECREF(__pyx_r);
12848     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_ZoomLevel); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
12849     __Pyx_GOTREF(__pyx_t_5);
12850     __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error)
12851     __Pyx_GOTREF(__pyx_t_6);
12852     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12853     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12854     PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12855     __Pyx_INCREF(__pyx_int_57037653);
12856     __Pyx_GIVEREF(__pyx_int_57037653);
12857     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_57037653);
12858     __Pyx_INCREF(Py_None);
12859     __Pyx_GIVEREF(Py_None);
12860     PyTuple_SET_ITEM(__pyx_t_6, 2, Py_None);
12861     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
12862     __Pyx_GOTREF(__pyx_t_4);
12863     __Pyx_GIVEREF(__pyx_t_5);
12864     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
12865     __Pyx_GIVEREF(__pyx_t_6);
12866     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
12867     __Pyx_INCREF(__pyx_v_state);
12868     __Pyx_GIVEREF(__pyx_v_state);
12869     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state);
12870     __pyx_t_5 = 0;
12871     __pyx_t_6 = 0;
12872     __pyx_r = __pyx_t_4;
12873     __pyx_t_4 = 0;
12874     goto __pyx_L0;
12875 
12876     /* "(tree fragment)":12
12877  *     else:
12878  *         use_setstate = self.bbi_file is not None
12879  *     if use_setstate:             # <<<<<<<<<<<<<<
12880  *         return __pyx_unpickle_ZoomLevel, (type(self), 0x3665355, None), state
12881  *     else:
12882  */
12883   }
12884 
12885   /* "(tree fragment)":15
12886  *         return __pyx_unpickle_ZoomLevel, (type(self), 0x3665355, None), state
12887  *     else:
12888  *         return __pyx_unpickle_ZoomLevel, (type(self), 0x3665355, state)             # <<<<<<<<<<<<<<
12889  * def __setstate_cython__(self, __pyx_state):
12890  *     __pyx_unpickle_ZoomLevel__set_state(self, __pyx_state)
12891  */
12892   /*else*/ {
12893     __Pyx_XDECREF(__pyx_r);
12894     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_ZoomLevel); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
12895     __Pyx_GOTREF(__pyx_t_4);
12896     __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 15, __pyx_L1_error)
12897     __Pyx_GOTREF(__pyx_t_6);
12898     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12899     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12900     PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12901     __Pyx_INCREF(__pyx_int_57037653);
12902     __Pyx_GIVEREF(__pyx_int_57037653);
12903     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_57037653);
12904     __Pyx_INCREF(__pyx_v_state);
12905     __Pyx_GIVEREF(__pyx_v_state);
12906     PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
12907     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
12908     __Pyx_GOTREF(__pyx_t_5);
12909     __Pyx_GIVEREF(__pyx_t_4);
12910     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12911     __Pyx_GIVEREF(__pyx_t_6);
12912     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
12913     __pyx_t_4 = 0;
12914     __pyx_t_6 = 0;
12915     __pyx_r = __pyx_t_5;
12916     __pyx_t_5 = 0;
12917     goto __pyx_L0;
12918   }
12919 
12920   /* "(tree fragment)":1
12921  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
12922  *     cdef tuple state
12923  *     cdef object _dict
12924  */
12925 
12926   /* function exit code */
12927   __pyx_L1_error:;
12928   __Pyx_XDECREF(__pyx_t_1);
12929   __Pyx_XDECREF(__pyx_t_2);
12930   __Pyx_XDECREF(__pyx_t_3);
12931   __Pyx_XDECREF(__pyx_t_4);
12932   __Pyx_XDECREF(__pyx_t_5);
12933   __Pyx_XDECREF(__pyx_t_6);
12934   __Pyx_AddTraceback("bx.bbi.bbi_file.ZoomLevel.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12935   __pyx_r = NULL;
12936   __pyx_L0:;
12937   __Pyx_XDECREF(__pyx_v_state);
12938   __Pyx_XDECREF(__pyx_v__dict);
12939   __Pyx_XGIVEREF(__pyx_r);
12940   __Pyx_RefNannyFinishContext();
12941   return __pyx_r;
12942 }
12943 
12944 /* "(tree fragment)":16
12945  *     else:
12946  *         return __pyx_unpickle_ZoomLevel, (type(self), 0x3665355, state)
12947  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
12948  *     __pyx_unpickle_ZoomLevel__set_state(self, __pyx_state)
12949  */
12950 
12951 /* Python wrapper */
12952 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_5__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)12953 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12954   PyObject *__pyx_r = 0;
12955   __Pyx_RefNannyDeclarations
12956   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12957   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_4__setstate_cython__(((struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
12958 
12959   /* function exit code */
12960   __Pyx_RefNannyFinishContext();
12961   return __pyx_r;
12962 }
12963 
__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_4__setstate_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel * __pyx_v_self,PyObject * __pyx_v___pyx_state)12964 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_9ZoomLevel_4__setstate_cython__(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12965   PyObject *__pyx_r = NULL;
12966   __Pyx_RefNannyDeclarations
12967   PyObject *__pyx_t_1 = NULL;
12968   int __pyx_lineno = 0;
12969   const char *__pyx_filename = NULL;
12970   int __pyx_clineno = 0;
12971   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
12972 
12973   /* "(tree fragment)":17
12974  *         return __pyx_unpickle_ZoomLevel, (type(self), 0x3665355, state)
12975  * def __setstate_cython__(self, __pyx_state):
12976  *     __pyx_unpickle_ZoomLevel__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
12977  */
12978   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(2, 17, __pyx_L1_error)
12979   __pyx_t_1 = __pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_ZoomLevel__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
12980   __Pyx_GOTREF(__pyx_t_1);
12981   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12982 
12983   /* "(tree fragment)":16
12984  *     else:
12985  *         return __pyx_unpickle_ZoomLevel, (type(self), 0x3665355, state)
12986  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
12987  *     __pyx_unpickle_ZoomLevel__set_state(self, __pyx_state)
12988  */
12989 
12990   /* function exit code */
12991   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12992   goto __pyx_L0;
12993   __pyx_L1_error:;
12994   __Pyx_XDECREF(__pyx_t_1);
12995   __Pyx_AddTraceback("bx.bbi.bbi_file.ZoomLevel.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12996   __pyx_r = NULL;
12997   __pyx_L0:;
12998   __Pyx_XGIVEREF(__pyx_r);
12999   __Pyx_RefNannyFinishContext();
13000   return __pyx_r;
13001 }
13002 
13003 /* "(tree fragment)":1
13004  * def __pyx_unpickle_SummaryBlock(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
13005  *     cdef object __pyx_PickleError
13006  *     cdef object __pyx_result
13007  */
13008 
13009 /* Python wrapper */
13010 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_1__pyx_unpickle_SummaryBlock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13011 static PyMethodDef __pyx_mdef_2bx_3bbi_8bbi_file_1__pyx_unpickle_SummaryBlock = {"__pyx_unpickle_SummaryBlock", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_3bbi_8bbi_file_1__pyx_unpickle_SummaryBlock, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2bx_3bbi_8bbi_file_1__pyx_unpickle_SummaryBlock(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)13012 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_1__pyx_unpickle_SummaryBlock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13013   PyObject *__pyx_v___pyx_type = 0;
13014   long __pyx_v___pyx_checksum;
13015   PyObject *__pyx_v___pyx_state = 0;
13016   int __pyx_lineno = 0;
13017   const char *__pyx_filename = NULL;
13018   int __pyx_clineno = 0;
13019   PyObject *__pyx_r = 0;
13020   __Pyx_RefNannyDeclarations
13021   __Pyx_RefNannySetupContext("__pyx_unpickle_SummaryBlock (wrapper)", 0);
13022   {
13023     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
13024     PyObject* values[3] = {0,0,0};
13025     if (unlikely(__pyx_kwds)) {
13026       Py_ssize_t kw_args;
13027       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13028       switch (pos_args) {
13029         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13030         CYTHON_FALLTHROUGH;
13031         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13032         CYTHON_FALLTHROUGH;
13033         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13034         CYTHON_FALLTHROUGH;
13035         case  0: break;
13036         default: goto __pyx_L5_argtuple_error;
13037       }
13038       kw_args = PyDict_Size(__pyx_kwds);
13039       switch (pos_args) {
13040         case  0:
13041         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
13042         else goto __pyx_L5_argtuple_error;
13043         CYTHON_FALLTHROUGH;
13044         case  1:
13045         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
13046         else {
13047           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SummaryBlock", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
13048         }
13049         CYTHON_FALLTHROUGH;
13050         case  2:
13051         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
13052         else {
13053           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SummaryBlock", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
13054         }
13055       }
13056       if (unlikely(kw_args > 0)) {
13057         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_SummaryBlock") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
13058       }
13059     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
13060       goto __pyx_L5_argtuple_error;
13061     } else {
13062       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13063       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13064       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13065     }
13066     __pyx_v___pyx_type = values[0];
13067     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
13068     __pyx_v___pyx_state = values[2];
13069   }
13070   goto __pyx_L4_argument_unpacking_done;
13071   __pyx_L5_argtuple_error:;
13072   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SummaryBlock", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
13073   __pyx_L3_error:;
13074   __Pyx_AddTraceback("bx.bbi.bbi_file.__pyx_unpickle_SummaryBlock", __pyx_clineno, __pyx_lineno, __pyx_filename);
13075   __Pyx_RefNannyFinishContext();
13076   return NULL;
13077   __pyx_L4_argument_unpacking_done:;
13078   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file___pyx_unpickle_SummaryBlock(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
13079 
13080   /* function exit code */
13081   __Pyx_RefNannyFinishContext();
13082   return __pyx_r;
13083 }
13084 
__pyx_pf_2bx_3bbi_8bbi_file___pyx_unpickle_SummaryBlock(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)13085 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file___pyx_unpickle_SummaryBlock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
13086   PyObject *__pyx_v___pyx_PickleError = 0;
13087   PyObject *__pyx_v___pyx_result = 0;
13088   PyObject *__pyx_r = NULL;
13089   __Pyx_RefNannyDeclarations
13090   int __pyx_t_1;
13091   PyObject *__pyx_t_2 = NULL;
13092   PyObject *__pyx_t_3 = NULL;
13093   PyObject *__pyx_t_4 = NULL;
13094   PyObject *__pyx_t_5 = NULL;
13095   int __pyx_t_6;
13096   int __pyx_lineno = 0;
13097   const char *__pyx_filename = NULL;
13098   int __pyx_clineno = 0;
13099   __Pyx_RefNannySetupContext("__pyx_unpickle_SummaryBlock", 0);
13100 
13101   /* "(tree fragment)":4
13102  *     cdef object __pyx_PickleError
13103  *     cdef object __pyx_result
13104  *     if __pyx_checksum != 0x732cf8a:             # <<<<<<<<<<<<<<
13105  *         from pickle import PickleError as __pyx_PickleError
13106  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x732cf8a = (chrom_id, end, max_val, min_val, start, sum_data, sum_squares, valid_count))" % __pyx_checksum)
13107  */
13108   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x732cf8a) != 0);
13109   if (__pyx_t_1) {
13110 
13111     /* "(tree fragment)":5
13112  *     cdef object __pyx_result
13113  *     if __pyx_checksum != 0x732cf8a:
13114  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
13115  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x732cf8a = (chrom_id, end, max_val, min_val, start, sum_data, sum_squares, valid_count))" % __pyx_checksum)
13116  *     __pyx_result = SummaryBlock.__new__(__pyx_type)
13117  */
13118     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
13119     __Pyx_GOTREF(__pyx_t_2);
13120     __Pyx_INCREF(__pyx_n_s_PickleError);
13121     __Pyx_GIVEREF(__pyx_n_s_PickleError);
13122     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
13123     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
13124     __Pyx_GOTREF(__pyx_t_3);
13125     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13126     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
13127     __Pyx_GOTREF(__pyx_t_2);
13128     __Pyx_INCREF(__pyx_t_2);
13129     __pyx_v___pyx_PickleError = __pyx_t_2;
13130     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13131     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13132 
13133     /* "(tree fragment)":6
13134  *     if __pyx_checksum != 0x732cf8a:
13135  *         from pickle import PickleError as __pyx_PickleError
13136  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x732cf8a = (chrom_id, end, max_val, min_val, start, sum_data, sum_squares, valid_count))" % __pyx_checksum)             # <<<<<<<<<<<<<<
13137  *     __pyx_result = SummaryBlock.__new__(__pyx_type)
13138  *     if __pyx_state is not None:
13139  */
13140     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
13141     __Pyx_GOTREF(__pyx_t_2);
13142     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x73, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
13143     __Pyx_GOTREF(__pyx_t_4);
13144     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13145     __Pyx_INCREF(__pyx_v___pyx_PickleError);
13146     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
13147     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
13148       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
13149       if (likely(__pyx_t_5)) {
13150         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
13151         __Pyx_INCREF(__pyx_t_5);
13152         __Pyx_INCREF(function);
13153         __Pyx_DECREF_SET(__pyx_t_2, function);
13154       }
13155     }
13156     __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);
13157     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13158     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13159     if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
13160     __Pyx_GOTREF(__pyx_t_3);
13161     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13162     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13163     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13164     __PYX_ERR(2, 6, __pyx_L1_error)
13165 
13166     /* "(tree fragment)":4
13167  *     cdef object __pyx_PickleError
13168  *     cdef object __pyx_result
13169  *     if __pyx_checksum != 0x732cf8a:             # <<<<<<<<<<<<<<
13170  *         from pickle import PickleError as __pyx_PickleError
13171  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x732cf8a = (chrom_id, end, max_val, min_val, start, sum_data, sum_squares, valid_count))" % __pyx_checksum)
13172  */
13173   }
13174 
13175   /* "(tree fragment)":7
13176  *         from pickle import PickleError as __pyx_PickleError
13177  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x732cf8a = (chrom_id, end, max_val, min_val, start, sum_data, sum_squares, valid_count))" % __pyx_checksum)
13178  *     __pyx_result = SummaryBlock.__new__(__pyx_type)             # <<<<<<<<<<<<<<
13179  *     if __pyx_state is not None:
13180  *         __pyx_unpickle_SummaryBlock__set_state(<SummaryBlock> __pyx_result, __pyx_state)
13181  */
13182   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_3bbi_8bbi_file_SummaryBlock), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
13183   __Pyx_GOTREF(__pyx_t_2);
13184   __pyx_t_4 = NULL;
13185   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
13186     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
13187     if (likely(__pyx_t_4)) {
13188       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
13189       __Pyx_INCREF(__pyx_t_4);
13190       __Pyx_INCREF(function);
13191       __Pyx_DECREF_SET(__pyx_t_2, function);
13192     }
13193   }
13194   __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);
13195   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13196   if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
13197   __Pyx_GOTREF(__pyx_t_3);
13198   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13199   __pyx_v___pyx_result = __pyx_t_3;
13200   __pyx_t_3 = 0;
13201 
13202   /* "(tree fragment)":8
13203  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x732cf8a = (chrom_id, end, max_val, min_val, start, sum_data, sum_squares, valid_count))" % __pyx_checksum)
13204  *     __pyx_result = SummaryBlock.__new__(__pyx_type)
13205  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
13206  *         __pyx_unpickle_SummaryBlock__set_state(<SummaryBlock> __pyx_result, __pyx_state)
13207  *     return __pyx_result
13208  */
13209   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
13210   __pyx_t_6 = (__pyx_t_1 != 0);
13211   if (__pyx_t_6) {
13212 
13213     /* "(tree fragment)":9
13214  *     __pyx_result = SummaryBlock.__new__(__pyx_type)
13215  *     if __pyx_state is not None:
13216  *         __pyx_unpickle_SummaryBlock__set_state(<SummaryBlock> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
13217  *     return __pyx_result
13218  * cdef __pyx_unpickle_SummaryBlock__set_state(SummaryBlock __pyx_result, tuple __pyx_state):
13219  */
13220     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(2, 9, __pyx_L1_error)
13221     __pyx_t_3 = __pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_SummaryBlock__set_state(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
13222     __Pyx_GOTREF(__pyx_t_3);
13223     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13224 
13225     /* "(tree fragment)":8
13226  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x732cf8a = (chrom_id, end, max_val, min_val, start, sum_data, sum_squares, valid_count))" % __pyx_checksum)
13227  *     __pyx_result = SummaryBlock.__new__(__pyx_type)
13228  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
13229  *         __pyx_unpickle_SummaryBlock__set_state(<SummaryBlock> __pyx_result, __pyx_state)
13230  *     return __pyx_result
13231  */
13232   }
13233 
13234   /* "(tree fragment)":10
13235  *     if __pyx_state is not None:
13236  *         __pyx_unpickle_SummaryBlock__set_state(<SummaryBlock> __pyx_result, __pyx_state)
13237  *     return __pyx_result             # <<<<<<<<<<<<<<
13238  * cdef __pyx_unpickle_SummaryBlock__set_state(SummaryBlock __pyx_result, tuple __pyx_state):
13239  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.max_val = __pyx_state[2]; __pyx_result.min_val = __pyx_state[3]; __pyx_result.start = __pyx_state[4]; __pyx_result.sum_data = __pyx_state[5]; __pyx_result.sum_squares = __pyx_state[6]; __pyx_result.valid_count = __pyx_state[7]
13240  */
13241   __Pyx_XDECREF(__pyx_r);
13242   __Pyx_INCREF(__pyx_v___pyx_result);
13243   __pyx_r = __pyx_v___pyx_result;
13244   goto __pyx_L0;
13245 
13246   /* "(tree fragment)":1
13247  * def __pyx_unpickle_SummaryBlock(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
13248  *     cdef object __pyx_PickleError
13249  *     cdef object __pyx_result
13250  */
13251 
13252   /* function exit code */
13253   __pyx_L1_error:;
13254   __Pyx_XDECREF(__pyx_t_2);
13255   __Pyx_XDECREF(__pyx_t_3);
13256   __Pyx_XDECREF(__pyx_t_4);
13257   __Pyx_XDECREF(__pyx_t_5);
13258   __Pyx_AddTraceback("bx.bbi.bbi_file.__pyx_unpickle_SummaryBlock", __pyx_clineno, __pyx_lineno, __pyx_filename);
13259   __pyx_r = NULL;
13260   __pyx_L0:;
13261   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
13262   __Pyx_XDECREF(__pyx_v___pyx_result);
13263   __Pyx_XGIVEREF(__pyx_r);
13264   __Pyx_RefNannyFinishContext();
13265   return __pyx_r;
13266 }
13267 
13268 /* "(tree fragment)":11
13269  *         __pyx_unpickle_SummaryBlock__set_state(<SummaryBlock> __pyx_result, __pyx_state)
13270  *     return __pyx_result
13271  * cdef __pyx_unpickle_SummaryBlock__set_state(SummaryBlock __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
13272  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.max_val = __pyx_state[2]; __pyx_result.min_val = __pyx_state[3]; __pyx_result.start = __pyx_state[4]; __pyx_result.sum_data = __pyx_state[5]; __pyx_result.sum_squares = __pyx_state[6]; __pyx_result.valid_count = __pyx_state[7]
13273  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
13274  */
13275 
__pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_SummaryBlock__set_state(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)13276 static PyObject *__pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_SummaryBlock__set_state(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
13277   PyObject *__pyx_r = NULL;
13278   __Pyx_RefNannyDeclarations
13279   PyObject *__pyx_t_1 = NULL;
13280   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_2;
13281   double __pyx_t_3;
13282   int __pyx_t_4;
13283   Py_ssize_t __pyx_t_5;
13284   int __pyx_t_6;
13285   int __pyx_t_7;
13286   PyObject *__pyx_t_8 = NULL;
13287   PyObject *__pyx_t_9 = NULL;
13288   PyObject *__pyx_t_10 = NULL;
13289   int __pyx_lineno = 0;
13290   const char *__pyx_filename = NULL;
13291   int __pyx_clineno = 0;
13292   __Pyx_RefNannySetupContext("__pyx_unpickle_SummaryBlock__set_state", 0);
13293 
13294   /* "(tree fragment)":12
13295  *     return __pyx_result
13296  * cdef __pyx_unpickle_SummaryBlock__set_state(SummaryBlock __pyx_result, tuple __pyx_state):
13297  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.max_val = __pyx_state[2]; __pyx_result.min_val = __pyx_state[3]; __pyx_result.start = __pyx_state[4]; __pyx_result.sum_data = __pyx_state[5]; __pyx_result.sum_squares = __pyx_state[6]; __pyx_result.valid_count = __pyx_state[7]             # <<<<<<<<<<<<<<
13298  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
13299  *         __pyx_result.__dict__.update(__pyx_state[8])
13300  */
13301   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13302     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13303     __PYX_ERR(2, 12, __pyx_L1_error)
13304   }
13305   __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(2, 12, __pyx_L1_error)
13306   __Pyx_GOTREF(__pyx_t_1);
13307   __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
13308   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13309   __pyx_v___pyx_result->chrom_id = __pyx_t_2;
13310   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13311     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13312     __PYX_ERR(2, 12, __pyx_L1_error)
13313   }
13314   __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(2, 12, __pyx_L1_error)
13315   __Pyx_GOTREF(__pyx_t_1);
13316   __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
13317   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13318   __pyx_v___pyx_result->end = __pyx_t_2;
13319   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13320     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13321     __PYX_ERR(2, 12, __pyx_L1_error)
13322   }
13323   __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(2, 12, __pyx_L1_error)
13324   __Pyx_GOTREF(__pyx_t_1);
13325   __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
13326   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13327   __pyx_v___pyx_result->max_val = __pyx_t_3;
13328   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13329     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13330     __PYX_ERR(2, 12, __pyx_L1_error)
13331   }
13332   __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(2, 12, __pyx_L1_error)
13333   __Pyx_GOTREF(__pyx_t_1);
13334   __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
13335   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13336   __pyx_v___pyx_result->min_val = __pyx_t_3;
13337   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13338     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13339     __PYX_ERR(2, 12, __pyx_L1_error)
13340   }
13341   __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(2, 12, __pyx_L1_error)
13342   __Pyx_GOTREF(__pyx_t_1);
13343   __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
13344   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13345   __pyx_v___pyx_result->start = __pyx_t_2;
13346   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13347     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13348     __PYX_ERR(2, 12, __pyx_L1_error)
13349   }
13350   __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(2, 12, __pyx_L1_error)
13351   __Pyx_GOTREF(__pyx_t_1);
13352   __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
13353   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13354   __pyx_v___pyx_result->sum_data = __pyx_t_3;
13355   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13356     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13357     __PYX_ERR(2, 12, __pyx_L1_error)
13358   }
13359   __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(2, 12, __pyx_L1_error)
13360   __Pyx_GOTREF(__pyx_t_1);
13361   __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
13362   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13363   __pyx_v___pyx_result->sum_squares = __pyx_t_3;
13364   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13365     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13366     __PYX_ERR(2, 12, __pyx_L1_error)
13367   }
13368   __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(2, 12, __pyx_L1_error)
13369   __Pyx_GOTREF(__pyx_t_1);
13370   __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
13371   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13372   __pyx_v___pyx_result->valid_count = __pyx_t_2;
13373 
13374   /* "(tree fragment)":13
13375  * cdef __pyx_unpickle_SummaryBlock__set_state(SummaryBlock __pyx_result, tuple __pyx_state):
13376  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.max_val = __pyx_state[2]; __pyx_result.min_val = __pyx_state[3]; __pyx_result.start = __pyx_state[4]; __pyx_result.sum_data = __pyx_state[5]; __pyx_result.sum_squares = __pyx_state[6]; __pyx_result.valid_count = __pyx_state[7]
13377  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
13378  *         __pyx_result.__dict__.update(__pyx_state[8])
13379  */
13380   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13381     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
13382     __PYX_ERR(2, 13, __pyx_L1_error)
13383   }
13384   __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
13385   __pyx_t_6 = ((__pyx_t_5 > 8) != 0);
13386   if (__pyx_t_6) {
13387   } else {
13388     __pyx_t_4 = __pyx_t_6;
13389     goto __pyx_L4_bool_binop_done;
13390   }
13391   __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
13392   __pyx_t_7 = (__pyx_t_6 != 0);
13393   __pyx_t_4 = __pyx_t_7;
13394   __pyx_L4_bool_binop_done:;
13395   if (__pyx_t_4) {
13396 
13397     /* "(tree fragment)":14
13398  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.max_val = __pyx_state[2]; __pyx_result.min_val = __pyx_state[3]; __pyx_result.start = __pyx_state[4]; __pyx_result.sum_data = __pyx_state[5]; __pyx_result.sum_squares = __pyx_state[6]; __pyx_result.valid_count = __pyx_state[7]
13399  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
13400  *         __pyx_result.__dict__.update(__pyx_state[8])             # <<<<<<<<<<<<<<
13401  */
13402     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error)
13403     __Pyx_GOTREF(__pyx_t_8);
13404     __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 14, __pyx_L1_error)
13405     __Pyx_GOTREF(__pyx_t_9);
13406     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13407     if (unlikely(__pyx_v___pyx_state == Py_None)) {
13408       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13409       __PYX_ERR(2, 14, __pyx_L1_error)
13410     }
13411     __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error)
13412     __Pyx_GOTREF(__pyx_t_8);
13413     __pyx_t_10 = NULL;
13414     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
13415       __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
13416       if (likely(__pyx_t_10)) {
13417         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
13418         __Pyx_INCREF(__pyx_t_10);
13419         __Pyx_INCREF(function);
13420         __Pyx_DECREF_SET(__pyx_t_9, function);
13421       }
13422     }
13423     __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8);
13424     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13425     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13426     if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
13427     __Pyx_GOTREF(__pyx_t_1);
13428     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13429     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13430 
13431     /* "(tree fragment)":13
13432  * cdef __pyx_unpickle_SummaryBlock__set_state(SummaryBlock __pyx_result, tuple __pyx_state):
13433  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.max_val = __pyx_state[2]; __pyx_result.min_val = __pyx_state[3]; __pyx_result.start = __pyx_state[4]; __pyx_result.sum_data = __pyx_state[5]; __pyx_result.sum_squares = __pyx_state[6]; __pyx_result.valid_count = __pyx_state[7]
13434  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
13435  *         __pyx_result.__dict__.update(__pyx_state[8])
13436  */
13437   }
13438 
13439   /* "(tree fragment)":11
13440  *         __pyx_unpickle_SummaryBlock__set_state(<SummaryBlock> __pyx_result, __pyx_state)
13441  *     return __pyx_result
13442  * cdef __pyx_unpickle_SummaryBlock__set_state(SummaryBlock __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
13443  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.max_val = __pyx_state[2]; __pyx_result.min_val = __pyx_state[3]; __pyx_result.start = __pyx_state[4]; __pyx_result.sum_data = __pyx_state[5]; __pyx_result.sum_squares = __pyx_state[6]; __pyx_result.valid_count = __pyx_state[7]
13444  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
13445  */
13446 
13447   /* function exit code */
13448   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13449   goto __pyx_L0;
13450   __pyx_L1_error:;
13451   __Pyx_XDECREF(__pyx_t_1);
13452   __Pyx_XDECREF(__pyx_t_8);
13453   __Pyx_XDECREF(__pyx_t_9);
13454   __Pyx_XDECREF(__pyx_t_10);
13455   __Pyx_AddTraceback("bx.bbi.bbi_file.__pyx_unpickle_SummaryBlock__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
13456   __pyx_r = 0;
13457   __pyx_L0:;
13458   __Pyx_XGIVEREF(__pyx_r);
13459   __Pyx_RefNannyFinishContext();
13460   return __pyx_r;
13461 }
13462 
13463 /* "(tree fragment)":1
13464  * def __pyx_unpickle_SummarizedData(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
13465  *     cdef object __pyx_PickleError
13466  *     cdef object __pyx_result
13467  */
13468 
13469 /* Python wrapper */
13470 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_3__pyx_unpickle_SummarizedData(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13471 static PyMethodDef __pyx_mdef_2bx_3bbi_8bbi_file_3__pyx_unpickle_SummarizedData = {"__pyx_unpickle_SummarizedData", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_3bbi_8bbi_file_3__pyx_unpickle_SummarizedData, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2bx_3bbi_8bbi_file_3__pyx_unpickle_SummarizedData(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)13472 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_3__pyx_unpickle_SummarizedData(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13473   PyObject *__pyx_v___pyx_type = 0;
13474   long __pyx_v___pyx_checksum;
13475   PyObject *__pyx_v___pyx_state = 0;
13476   int __pyx_lineno = 0;
13477   const char *__pyx_filename = NULL;
13478   int __pyx_clineno = 0;
13479   PyObject *__pyx_r = 0;
13480   __Pyx_RefNannyDeclarations
13481   __Pyx_RefNannySetupContext("__pyx_unpickle_SummarizedData (wrapper)", 0);
13482   {
13483     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
13484     PyObject* values[3] = {0,0,0};
13485     if (unlikely(__pyx_kwds)) {
13486       Py_ssize_t kw_args;
13487       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13488       switch (pos_args) {
13489         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13490         CYTHON_FALLTHROUGH;
13491         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13492         CYTHON_FALLTHROUGH;
13493         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13494         CYTHON_FALLTHROUGH;
13495         case  0: break;
13496         default: goto __pyx_L5_argtuple_error;
13497       }
13498       kw_args = PyDict_Size(__pyx_kwds);
13499       switch (pos_args) {
13500         case  0:
13501         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
13502         else goto __pyx_L5_argtuple_error;
13503         CYTHON_FALLTHROUGH;
13504         case  1:
13505         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
13506         else {
13507           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SummarizedData", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
13508         }
13509         CYTHON_FALLTHROUGH;
13510         case  2:
13511         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
13512         else {
13513           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SummarizedData", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
13514         }
13515       }
13516       if (unlikely(kw_args > 0)) {
13517         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_SummarizedData") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
13518       }
13519     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
13520       goto __pyx_L5_argtuple_error;
13521     } else {
13522       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13523       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13524       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13525     }
13526     __pyx_v___pyx_type = values[0];
13527     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
13528     __pyx_v___pyx_state = values[2];
13529   }
13530   goto __pyx_L4_argument_unpacking_done;
13531   __pyx_L5_argtuple_error:;
13532   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SummarizedData", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
13533   __pyx_L3_error:;
13534   __Pyx_AddTraceback("bx.bbi.bbi_file.__pyx_unpickle_SummarizedData", __pyx_clineno, __pyx_lineno, __pyx_filename);
13535   __Pyx_RefNannyFinishContext();
13536   return NULL;
13537   __pyx_L4_argument_unpacking_done:;
13538   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_2__pyx_unpickle_SummarizedData(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
13539 
13540   /* function exit code */
13541   __Pyx_RefNannyFinishContext();
13542   return __pyx_r;
13543 }
13544 
__pyx_pf_2bx_3bbi_8bbi_file_2__pyx_unpickle_SummarizedData(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)13545 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_2__pyx_unpickle_SummarizedData(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
13546   PyObject *__pyx_v___pyx_PickleError = 0;
13547   PyObject *__pyx_v___pyx_result = 0;
13548   PyObject *__pyx_r = NULL;
13549   __Pyx_RefNannyDeclarations
13550   int __pyx_t_1;
13551   PyObject *__pyx_t_2 = NULL;
13552   PyObject *__pyx_t_3 = NULL;
13553   PyObject *__pyx_t_4 = NULL;
13554   PyObject *__pyx_t_5 = NULL;
13555   int __pyx_t_6;
13556   int __pyx_lineno = 0;
13557   const char *__pyx_filename = NULL;
13558   int __pyx_clineno = 0;
13559   __Pyx_RefNannySetupContext("__pyx_unpickle_SummarizedData", 0);
13560 
13561   /* "(tree fragment)":4
13562  *     cdef object __pyx_PickleError
13563  *     cdef object __pyx_result
13564  *     if __pyx_checksum != 0xf78375f:             # <<<<<<<<<<<<<<
13565  *         from pickle import PickleError as __pyx_PickleError
13566  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf78375f = (end, max_val, min_val, size, start, sum_data, sum_squares, valid_count))" % __pyx_checksum)
13567  */
13568   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xf78375f) != 0);
13569   if (__pyx_t_1) {
13570 
13571     /* "(tree fragment)":5
13572  *     cdef object __pyx_result
13573  *     if __pyx_checksum != 0xf78375f:
13574  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
13575  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf78375f = (end, max_val, min_val, size, start, sum_data, sum_squares, valid_count))" % __pyx_checksum)
13576  *     __pyx_result = SummarizedData.__new__(__pyx_type)
13577  */
13578     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
13579     __Pyx_GOTREF(__pyx_t_2);
13580     __Pyx_INCREF(__pyx_n_s_PickleError);
13581     __Pyx_GIVEREF(__pyx_n_s_PickleError);
13582     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
13583     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
13584     __Pyx_GOTREF(__pyx_t_3);
13585     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13586     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
13587     __Pyx_GOTREF(__pyx_t_2);
13588     __Pyx_INCREF(__pyx_t_2);
13589     __pyx_v___pyx_PickleError = __pyx_t_2;
13590     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13591     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13592 
13593     /* "(tree fragment)":6
13594  *     if __pyx_checksum != 0xf78375f:
13595  *         from pickle import PickleError as __pyx_PickleError
13596  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf78375f = (end, max_val, min_val, size, start, sum_data, sum_squares, valid_count))" % __pyx_checksum)             # <<<<<<<<<<<<<<
13597  *     __pyx_result = SummarizedData.__new__(__pyx_type)
13598  *     if __pyx_state is not None:
13599  */
13600     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
13601     __Pyx_GOTREF(__pyx_t_2);
13602     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xf7, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
13603     __Pyx_GOTREF(__pyx_t_4);
13604     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13605     __Pyx_INCREF(__pyx_v___pyx_PickleError);
13606     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
13607     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
13608       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
13609       if (likely(__pyx_t_5)) {
13610         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
13611         __Pyx_INCREF(__pyx_t_5);
13612         __Pyx_INCREF(function);
13613         __Pyx_DECREF_SET(__pyx_t_2, function);
13614       }
13615     }
13616     __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);
13617     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13618     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13619     if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
13620     __Pyx_GOTREF(__pyx_t_3);
13621     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13622     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13623     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13624     __PYX_ERR(2, 6, __pyx_L1_error)
13625 
13626     /* "(tree fragment)":4
13627  *     cdef object __pyx_PickleError
13628  *     cdef object __pyx_result
13629  *     if __pyx_checksum != 0xf78375f:             # <<<<<<<<<<<<<<
13630  *         from pickle import PickleError as __pyx_PickleError
13631  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf78375f = (end, max_val, min_val, size, start, sum_data, sum_squares, valid_count))" % __pyx_checksum)
13632  */
13633   }
13634 
13635   /* "(tree fragment)":7
13636  *         from pickle import PickleError as __pyx_PickleError
13637  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf78375f = (end, max_val, min_val, size, start, sum_data, sum_squares, valid_count))" % __pyx_checksum)
13638  *     __pyx_result = SummarizedData.__new__(__pyx_type)             # <<<<<<<<<<<<<<
13639  *     if __pyx_state is not None:
13640  *         __pyx_unpickle_SummarizedData__set_state(<SummarizedData> __pyx_result, __pyx_state)
13641  */
13642   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_3bbi_8bbi_file_SummarizedData), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
13643   __Pyx_GOTREF(__pyx_t_2);
13644   __pyx_t_4 = NULL;
13645   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
13646     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
13647     if (likely(__pyx_t_4)) {
13648       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
13649       __Pyx_INCREF(__pyx_t_4);
13650       __Pyx_INCREF(function);
13651       __Pyx_DECREF_SET(__pyx_t_2, function);
13652     }
13653   }
13654   __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);
13655   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13656   if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
13657   __Pyx_GOTREF(__pyx_t_3);
13658   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13659   __pyx_v___pyx_result = __pyx_t_3;
13660   __pyx_t_3 = 0;
13661 
13662   /* "(tree fragment)":8
13663  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf78375f = (end, max_val, min_val, size, start, sum_data, sum_squares, valid_count))" % __pyx_checksum)
13664  *     __pyx_result = SummarizedData.__new__(__pyx_type)
13665  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
13666  *         __pyx_unpickle_SummarizedData__set_state(<SummarizedData> __pyx_result, __pyx_state)
13667  *     return __pyx_result
13668  */
13669   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
13670   __pyx_t_6 = (__pyx_t_1 != 0);
13671   if (__pyx_t_6) {
13672 
13673     /* "(tree fragment)":9
13674  *     __pyx_result = SummarizedData.__new__(__pyx_type)
13675  *     if __pyx_state is not None:
13676  *         __pyx_unpickle_SummarizedData__set_state(<SummarizedData> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
13677  *     return __pyx_result
13678  * cdef __pyx_unpickle_SummarizedData__set_state(SummarizedData __pyx_result, tuple __pyx_state):
13679  */
13680     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(2, 9, __pyx_L1_error)
13681     __pyx_t_3 = __pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_SummarizedData__set_state(((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
13682     __Pyx_GOTREF(__pyx_t_3);
13683     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13684 
13685     /* "(tree fragment)":8
13686  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xf78375f = (end, max_val, min_val, size, start, sum_data, sum_squares, valid_count))" % __pyx_checksum)
13687  *     __pyx_result = SummarizedData.__new__(__pyx_type)
13688  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
13689  *         __pyx_unpickle_SummarizedData__set_state(<SummarizedData> __pyx_result, __pyx_state)
13690  *     return __pyx_result
13691  */
13692   }
13693 
13694   /* "(tree fragment)":10
13695  *     if __pyx_state is not None:
13696  *         __pyx_unpickle_SummarizedData__set_state(<SummarizedData> __pyx_result, __pyx_state)
13697  *     return __pyx_result             # <<<<<<<<<<<<<<
13698  * cdef __pyx_unpickle_SummarizedData__set_state(SummarizedData __pyx_result, tuple __pyx_state):
13699  *     __pyx_result.end = __pyx_state[0]; __pyx_result.max_val = __pyx_state[1]; __pyx_result.min_val = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.start = __pyx_state[4]; __pyx_result.sum_data = __pyx_state[5]; __pyx_result.sum_squares = __pyx_state[6]; __pyx_result.valid_count = __pyx_state[7]
13700  */
13701   __Pyx_XDECREF(__pyx_r);
13702   __Pyx_INCREF(__pyx_v___pyx_result);
13703   __pyx_r = __pyx_v___pyx_result;
13704   goto __pyx_L0;
13705 
13706   /* "(tree fragment)":1
13707  * def __pyx_unpickle_SummarizedData(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
13708  *     cdef object __pyx_PickleError
13709  *     cdef object __pyx_result
13710  */
13711 
13712   /* function exit code */
13713   __pyx_L1_error:;
13714   __Pyx_XDECREF(__pyx_t_2);
13715   __Pyx_XDECREF(__pyx_t_3);
13716   __Pyx_XDECREF(__pyx_t_4);
13717   __Pyx_XDECREF(__pyx_t_5);
13718   __Pyx_AddTraceback("bx.bbi.bbi_file.__pyx_unpickle_SummarizedData", __pyx_clineno, __pyx_lineno, __pyx_filename);
13719   __pyx_r = NULL;
13720   __pyx_L0:;
13721   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
13722   __Pyx_XDECREF(__pyx_v___pyx_result);
13723   __Pyx_XGIVEREF(__pyx_r);
13724   __Pyx_RefNannyFinishContext();
13725   return __pyx_r;
13726 }
13727 
13728 /* "(tree fragment)":11
13729  *         __pyx_unpickle_SummarizedData__set_state(<SummarizedData> __pyx_result, __pyx_state)
13730  *     return __pyx_result
13731  * cdef __pyx_unpickle_SummarizedData__set_state(SummarizedData __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
13732  *     __pyx_result.end = __pyx_state[0]; __pyx_result.max_val = __pyx_state[1]; __pyx_result.min_val = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.start = __pyx_state[4]; __pyx_result.sum_data = __pyx_state[5]; __pyx_result.sum_squares = __pyx_state[6]; __pyx_result.valid_count = __pyx_state[7]
13733  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
13734  */
13735 
__pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_SummarizedData__set_state(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)13736 static PyObject *__pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_SummarizedData__set_state(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
13737   PyObject *__pyx_r = NULL;
13738   __Pyx_RefNannyDeclarations
13739   PyObject *__pyx_t_1 = NULL;
13740   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_2;
13741   int __pyx_t_3;
13742   int __pyx_t_4;
13743   Py_ssize_t __pyx_t_5;
13744   int __pyx_t_6;
13745   int __pyx_t_7;
13746   PyObject *__pyx_t_8 = NULL;
13747   PyObject *__pyx_t_9 = NULL;
13748   PyObject *__pyx_t_10 = NULL;
13749   int __pyx_lineno = 0;
13750   const char *__pyx_filename = NULL;
13751   int __pyx_clineno = 0;
13752   __Pyx_RefNannySetupContext("__pyx_unpickle_SummarizedData__set_state", 0);
13753 
13754   /* "(tree fragment)":12
13755  *     return __pyx_result
13756  * cdef __pyx_unpickle_SummarizedData__set_state(SummarizedData __pyx_result, tuple __pyx_state):
13757  *     __pyx_result.end = __pyx_state[0]; __pyx_result.max_val = __pyx_state[1]; __pyx_result.min_val = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.start = __pyx_state[4]; __pyx_result.sum_data = __pyx_state[5]; __pyx_result.sum_squares = __pyx_state[6]; __pyx_result.valid_count = __pyx_state[7]             # <<<<<<<<<<<<<<
13758  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
13759  *         __pyx_result.__dict__.update(__pyx_state[8])
13760  */
13761   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13762     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13763     __PYX_ERR(2, 12, __pyx_L1_error)
13764   }
13765   __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(2, 12, __pyx_L1_error)
13766   __Pyx_GOTREF(__pyx_t_1);
13767   __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
13768   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13769   __pyx_v___pyx_result->end = __pyx_t_2;
13770   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13771     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13772     __PYX_ERR(2, 12, __pyx_L1_error)
13773   }
13774   __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(2, 12, __pyx_L1_error)
13775   __Pyx_GOTREF(__pyx_t_1);
13776   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 12, __pyx_L1_error)
13777   __Pyx_GIVEREF(__pyx_t_1);
13778   __Pyx_GOTREF(__pyx_v___pyx_result->max_val);
13779   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->max_val));
13780   __pyx_v___pyx_result->max_val = ((PyArrayObject *)__pyx_t_1);
13781   __pyx_t_1 = 0;
13782   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13783     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13784     __PYX_ERR(2, 12, __pyx_L1_error)
13785   }
13786   __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(2, 12, __pyx_L1_error)
13787   __Pyx_GOTREF(__pyx_t_1);
13788   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 12, __pyx_L1_error)
13789   __Pyx_GIVEREF(__pyx_t_1);
13790   __Pyx_GOTREF(__pyx_v___pyx_result->min_val);
13791   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->min_val));
13792   __pyx_v___pyx_result->min_val = ((PyArrayObject *)__pyx_t_1);
13793   __pyx_t_1 = 0;
13794   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13795     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13796     __PYX_ERR(2, 12, __pyx_L1_error)
13797   }
13798   __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(2, 12, __pyx_L1_error)
13799   __Pyx_GOTREF(__pyx_t_1);
13800   __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
13801   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13802   __pyx_v___pyx_result->size = __pyx_t_3;
13803   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13804     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13805     __PYX_ERR(2, 12, __pyx_L1_error)
13806   }
13807   __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(2, 12, __pyx_L1_error)
13808   __Pyx_GOTREF(__pyx_t_1);
13809   __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
13810   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13811   __pyx_v___pyx_result->start = __pyx_t_2;
13812   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13813     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13814     __PYX_ERR(2, 12, __pyx_L1_error)
13815   }
13816   __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(2, 12, __pyx_L1_error)
13817   __Pyx_GOTREF(__pyx_t_1);
13818   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 12, __pyx_L1_error)
13819   __Pyx_GIVEREF(__pyx_t_1);
13820   __Pyx_GOTREF(__pyx_v___pyx_result->sum_data);
13821   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->sum_data));
13822   __pyx_v___pyx_result->sum_data = ((PyArrayObject *)__pyx_t_1);
13823   __pyx_t_1 = 0;
13824   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13825     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13826     __PYX_ERR(2, 12, __pyx_L1_error)
13827   }
13828   __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(2, 12, __pyx_L1_error)
13829   __Pyx_GOTREF(__pyx_t_1);
13830   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 12, __pyx_L1_error)
13831   __Pyx_GIVEREF(__pyx_t_1);
13832   __Pyx_GOTREF(__pyx_v___pyx_result->sum_squares);
13833   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->sum_squares));
13834   __pyx_v___pyx_result->sum_squares = ((PyArrayObject *)__pyx_t_1);
13835   __pyx_t_1 = 0;
13836   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13837     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13838     __PYX_ERR(2, 12, __pyx_L1_error)
13839   }
13840   __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(2, 12, __pyx_L1_error)
13841   __Pyx_GOTREF(__pyx_t_1);
13842   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 12, __pyx_L1_error)
13843   __Pyx_GIVEREF(__pyx_t_1);
13844   __Pyx_GOTREF(__pyx_v___pyx_result->valid_count);
13845   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->valid_count));
13846   __pyx_v___pyx_result->valid_count = ((PyArrayObject *)__pyx_t_1);
13847   __pyx_t_1 = 0;
13848 
13849   /* "(tree fragment)":13
13850  * cdef __pyx_unpickle_SummarizedData__set_state(SummarizedData __pyx_result, tuple __pyx_state):
13851  *     __pyx_result.end = __pyx_state[0]; __pyx_result.max_val = __pyx_state[1]; __pyx_result.min_val = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.start = __pyx_state[4]; __pyx_result.sum_data = __pyx_state[5]; __pyx_result.sum_squares = __pyx_state[6]; __pyx_result.valid_count = __pyx_state[7]
13852  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
13853  *         __pyx_result.__dict__.update(__pyx_state[8])
13854  */
13855   if (unlikely(__pyx_v___pyx_state == Py_None)) {
13856     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
13857     __PYX_ERR(2, 13, __pyx_L1_error)
13858   }
13859   __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
13860   __pyx_t_6 = ((__pyx_t_5 > 8) != 0);
13861   if (__pyx_t_6) {
13862   } else {
13863     __pyx_t_4 = __pyx_t_6;
13864     goto __pyx_L4_bool_binop_done;
13865   }
13866   __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
13867   __pyx_t_7 = (__pyx_t_6 != 0);
13868   __pyx_t_4 = __pyx_t_7;
13869   __pyx_L4_bool_binop_done:;
13870   if (__pyx_t_4) {
13871 
13872     /* "(tree fragment)":14
13873  *     __pyx_result.end = __pyx_state[0]; __pyx_result.max_val = __pyx_state[1]; __pyx_result.min_val = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.start = __pyx_state[4]; __pyx_result.sum_data = __pyx_state[5]; __pyx_result.sum_squares = __pyx_state[6]; __pyx_result.valid_count = __pyx_state[7]
13874  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
13875  *         __pyx_result.__dict__.update(__pyx_state[8])             # <<<<<<<<<<<<<<
13876  */
13877     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error)
13878     __Pyx_GOTREF(__pyx_t_8);
13879     __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 14, __pyx_L1_error)
13880     __Pyx_GOTREF(__pyx_t_9);
13881     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13882     if (unlikely(__pyx_v___pyx_state == Py_None)) {
13883       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
13884       __PYX_ERR(2, 14, __pyx_L1_error)
13885     }
13886     __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error)
13887     __Pyx_GOTREF(__pyx_t_8);
13888     __pyx_t_10 = NULL;
13889     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
13890       __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
13891       if (likely(__pyx_t_10)) {
13892         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
13893         __Pyx_INCREF(__pyx_t_10);
13894         __Pyx_INCREF(function);
13895         __Pyx_DECREF_SET(__pyx_t_9, function);
13896       }
13897     }
13898     __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8);
13899     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13900     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13901     if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
13902     __Pyx_GOTREF(__pyx_t_1);
13903     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13904     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13905 
13906     /* "(tree fragment)":13
13907  * cdef __pyx_unpickle_SummarizedData__set_state(SummarizedData __pyx_result, tuple __pyx_state):
13908  *     __pyx_result.end = __pyx_state[0]; __pyx_result.max_val = __pyx_state[1]; __pyx_result.min_val = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.start = __pyx_state[4]; __pyx_result.sum_data = __pyx_state[5]; __pyx_result.sum_squares = __pyx_state[6]; __pyx_result.valid_count = __pyx_state[7]
13909  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
13910  *         __pyx_result.__dict__.update(__pyx_state[8])
13911  */
13912   }
13913 
13914   /* "(tree fragment)":11
13915  *         __pyx_unpickle_SummarizedData__set_state(<SummarizedData> __pyx_result, __pyx_state)
13916  *     return __pyx_result
13917  * cdef __pyx_unpickle_SummarizedData__set_state(SummarizedData __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
13918  *     __pyx_result.end = __pyx_state[0]; __pyx_result.max_val = __pyx_state[1]; __pyx_result.min_val = __pyx_state[2]; __pyx_result.size = __pyx_state[3]; __pyx_result.start = __pyx_state[4]; __pyx_result.sum_data = __pyx_state[5]; __pyx_result.sum_squares = __pyx_state[6]; __pyx_result.valid_count = __pyx_state[7]
13919  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
13920  */
13921 
13922   /* function exit code */
13923   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13924   goto __pyx_L0;
13925   __pyx_L1_error:;
13926   __Pyx_XDECREF(__pyx_t_1);
13927   __Pyx_XDECREF(__pyx_t_8);
13928   __Pyx_XDECREF(__pyx_t_9);
13929   __Pyx_XDECREF(__pyx_t_10);
13930   __Pyx_AddTraceback("bx.bbi.bbi_file.__pyx_unpickle_SummarizedData__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
13931   __pyx_r = 0;
13932   __pyx_L0:;
13933   __Pyx_XGIVEREF(__pyx_r);
13934   __Pyx_RefNannyFinishContext();
13935   return __pyx_r;
13936 }
13937 
13938 /* "(tree fragment)":1
13939  * def __pyx_unpickle_BlockHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
13940  *     cdef object __pyx_PickleError
13941  *     cdef object __pyx_result
13942  */
13943 
13944 /* Python wrapper */
13945 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_5__pyx_unpickle_BlockHandler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13946 static PyMethodDef __pyx_mdef_2bx_3bbi_8bbi_file_5__pyx_unpickle_BlockHandler = {"__pyx_unpickle_BlockHandler", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_3bbi_8bbi_file_5__pyx_unpickle_BlockHandler, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2bx_3bbi_8bbi_file_5__pyx_unpickle_BlockHandler(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)13947 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_5__pyx_unpickle_BlockHandler(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13948   PyObject *__pyx_v___pyx_type = 0;
13949   long __pyx_v___pyx_checksum;
13950   PyObject *__pyx_v___pyx_state = 0;
13951   int __pyx_lineno = 0;
13952   const char *__pyx_filename = NULL;
13953   int __pyx_clineno = 0;
13954   PyObject *__pyx_r = 0;
13955   __Pyx_RefNannyDeclarations
13956   __Pyx_RefNannySetupContext("__pyx_unpickle_BlockHandler (wrapper)", 0);
13957   {
13958     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
13959     PyObject* values[3] = {0,0,0};
13960     if (unlikely(__pyx_kwds)) {
13961       Py_ssize_t kw_args;
13962       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13963       switch (pos_args) {
13964         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13965         CYTHON_FALLTHROUGH;
13966         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13967         CYTHON_FALLTHROUGH;
13968         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13969         CYTHON_FALLTHROUGH;
13970         case  0: break;
13971         default: goto __pyx_L5_argtuple_error;
13972       }
13973       kw_args = PyDict_Size(__pyx_kwds);
13974       switch (pos_args) {
13975         case  0:
13976         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
13977         else goto __pyx_L5_argtuple_error;
13978         CYTHON_FALLTHROUGH;
13979         case  1:
13980         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
13981         else {
13982           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BlockHandler", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
13983         }
13984         CYTHON_FALLTHROUGH;
13985         case  2:
13986         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
13987         else {
13988           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BlockHandler", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
13989         }
13990       }
13991       if (unlikely(kw_args > 0)) {
13992         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_BlockHandler") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
13993       }
13994     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
13995       goto __pyx_L5_argtuple_error;
13996     } else {
13997       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13998       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13999       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14000     }
14001     __pyx_v___pyx_type = values[0];
14002     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
14003     __pyx_v___pyx_state = values[2];
14004   }
14005   goto __pyx_L4_argument_unpacking_done;
14006   __pyx_L5_argtuple_error:;
14007   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BlockHandler", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
14008   __pyx_L3_error:;
14009   __Pyx_AddTraceback("bx.bbi.bbi_file.__pyx_unpickle_BlockHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
14010   __Pyx_RefNannyFinishContext();
14011   return NULL;
14012   __pyx_L4_argument_unpacking_done:;
14013   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_4__pyx_unpickle_BlockHandler(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
14014 
14015   /* function exit code */
14016   __Pyx_RefNannyFinishContext();
14017   return __pyx_r;
14018 }
14019 
__pyx_pf_2bx_3bbi_8bbi_file_4__pyx_unpickle_BlockHandler(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)14020 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_4__pyx_unpickle_BlockHandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
14021   PyObject *__pyx_v___pyx_PickleError = 0;
14022   PyObject *__pyx_v___pyx_result = 0;
14023   PyObject *__pyx_r = NULL;
14024   __Pyx_RefNannyDeclarations
14025   int __pyx_t_1;
14026   PyObject *__pyx_t_2 = NULL;
14027   PyObject *__pyx_t_3 = NULL;
14028   PyObject *__pyx_t_4 = NULL;
14029   PyObject *__pyx_t_5 = NULL;
14030   int __pyx_t_6;
14031   int __pyx_lineno = 0;
14032   const char *__pyx_filename = NULL;
14033   int __pyx_clineno = 0;
14034   __Pyx_RefNannySetupContext("__pyx_unpickle_BlockHandler", 0);
14035 
14036   /* "(tree fragment)":4
14037  *     cdef object __pyx_PickleError
14038  *     cdef object __pyx_result
14039  *     if __pyx_checksum != 0xd41d8cd:             # <<<<<<<<<<<<<<
14040  *         from pickle import PickleError as __pyx_PickleError
14041  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
14042  */
14043   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xd41d8cd) != 0);
14044   if (__pyx_t_1) {
14045 
14046     /* "(tree fragment)":5
14047  *     cdef object __pyx_result
14048  *     if __pyx_checksum != 0xd41d8cd:
14049  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
14050  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
14051  *     __pyx_result = BlockHandler.__new__(__pyx_type)
14052  */
14053     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
14054     __Pyx_GOTREF(__pyx_t_2);
14055     __Pyx_INCREF(__pyx_n_s_PickleError);
14056     __Pyx_GIVEREF(__pyx_n_s_PickleError);
14057     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
14058     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
14059     __Pyx_GOTREF(__pyx_t_3);
14060     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14061     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
14062     __Pyx_GOTREF(__pyx_t_2);
14063     __Pyx_INCREF(__pyx_t_2);
14064     __pyx_v___pyx_PickleError = __pyx_t_2;
14065     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14066     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14067 
14068     /* "(tree fragment)":6
14069  *     if __pyx_checksum != 0xd41d8cd:
14070  *         from pickle import PickleError as __pyx_PickleError
14071  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)             # <<<<<<<<<<<<<<
14072  *     __pyx_result = BlockHandler.__new__(__pyx_type)
14073  *     if __pyx_state is not None:
14074  */
14075     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
14076     __Pyx_GOTREF(__pyx_t_2);
14077     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
14078     __Pyx_GOTREF(__pyx_t_4);
14079     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14080     __Pyx_INCREF(__pyx_v___pyx_PickleError);
14081     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
14082     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
14083       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
14084       if (likely(__pyx_t_5)) {
14085         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
14086         __Pyx_INCREF(__pyx_t_5);
14087         __Pyx_INCREF(function);
14088         __Pyx_DECREF_SET(__pyx_t_2, function);
14089       }
14090     }
14091     __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);
14092     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14093     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14094     if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
14095     __Pyx_GOTREF(__pyx_t_3);
14096     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14097     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
14098     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14099     __PYX_ERR(2, 6, __pyx_L1_error)
14100 
14101     /* "(tree fragment)":4
14102  *     cdef object __pyx_PickleError
14103  *     cdef object __pyx_result
14104  *     if __pyx_checksum != 0xd41d8cd:             # <<<<<<<<<<<<<<
14105  *         from pickle import PickleError as __pyx_PickleError
14106  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
14107  */
14108   }
14109 
14110   /* "(tree fragment)":7
14111  *         from pickle import PickleError as __pyx_PickleError
14112  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
14113  *     __pyx_result = BlockHandler.__new__(__pyx_type)             # <<<<<<<<<<<<<<
14114  *     if __pyx_state is not None:
14115  *         __pyx_unpickle_BlockHandler__set_state(<BlockHandler> __pyx_result, __pyx_state)
14116  */
14117   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_3bbi_8bbi_file_BlockHandler), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
14118   __Pyx_GOTREF(__pyx_t_2);
14119   __pyx_t_4 = NULL;
14120   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
14121     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
14122     if (likely(__pyx_t_4)) {
14123       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
14124       __Pyx_INCREF(__pyx_t_4);
14125       __Pyx_INCREF(function);
14126       __Pyx_DECREF_SET(__pyx_t_2, function);
14127     }
14128   }
14129   __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);
14130   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14131   if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
14132   __Pyx_GOTREF(__pyx_t_3);
14133   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14134   __pyx_v___pyx_result = __pyx_t_3;
14135   __pyx_t_3 = 0;
14136 
14137   /* "(tree fragment)":8
14138  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
14139  *     __pyx_result = BlockHandler.__new__(__pyx_type)
14140  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
14141  *         __pyx_unpickle_BlockHandler__set_state(<BlockHandler> __pyx_result, __pyx_state)
14142  *     return __pyx_result
14143  */
14144   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
14145   __pyx_t_6 = (__pyx_t_1 != 0);
14146   if (__pyx_t_6) {
14147 
14148     /* "(tree fragment)":9
14149  *     __pyx_result = BlockHandler.__new__(__pyx_type)
14150  *     if __pyx_state is not None:
14151  *         __pyx_unpickle_BlockHandler__set_state(<BlockHandler> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
14152  *     return __pyx_result
14153  * cdef __pyx_unpickle_BlockHandler__set_state(BlockHandler __pyx_result, tuple __pyx_state):
14154  */
14155     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(2, 9, __pyx_L1_error)
14156     __pyx_t_3 = __pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_BlockHandler__set_state(((struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
14157     __Pyx_GOTREF(__pyx_t_3);
14158     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14159 
14160     /* "(tree fragment)":8
14161  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
14162  *     __pyx_result = BlockHandler.__new__(__pyx_type)
14163  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
14164  *         __pyx_unpickle_BlockHandler__set_state(<BlockHandler> __pyx_result, __pyx_state)
14165  *     return __pyx_result
14166  */
14167   }
14168 
14169   /* "(tree fragment)":10
14170  *     if __pyx_state is not None:
14171  *         __pyx_unpickle_BlockHandler__set_state(<BlockHandler> __pyx_result, __pyx_state)
14172  *     return __pyx_result             # <<<<<<<<<<<<<<
14173  * cdef __pyx_unpickle_BlockHandler__set_state(BlockHandler __pyx_result, tuple __pyx_state):
14174  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
14175  */
14176   __Pyx_XDECREF(__pyx_r);
14177   __Pyx_INCREF(__pyx_v___pyx_result);
14178   __pyx_r = __pyx_v___pyx_result;
14179   goto __pyx_L0;
14180 
14181   /* "(tree fragment)":1
14182  * def __pyx_unpickle_BlockHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
14183  *     cdef object __pyx_PickleError
14184  *     cdef object __pyx_result
14185  */
14186 
14187   /* function exit code */
14188   __pyx_L1_error:;
14189   __Pyx_XDECREF(__pyx_t_2);
14190   __Pyx_XDECREF(__pyx_t_3);
14191   __Pyx_XDECREF(__pyx_t_4);
14192   __Pyx_XDECREF(__pyx_t_5);
14193   __Pyx_AddTraceback("bx.bbi.bbi_file.__pyx_unpickle_BlockHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
14194   __pyx_r = NULL;
14195   __pyx_L0:;
14196   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
14197   __Pyx_XDECREF(__pyx_v___pyx_result);
14198   __Pyx_XGIVEREF(__pyx_r);
14199   __Pyx_RefNannyFinishContext();
14200   return __pyx_r;
14201 }
14202 
14203 /* "(tree fragment)":11
14204  *         __pyx_unpickle_BlockHandler__set_state(<BlockHandler> __pyx_result, __pyx_state)
14205  *     return __pyx_result
14206  * cdef __pyx_unpickle_BlockHandler__set_state(BlockHandler __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
14207  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
14208  *         __pyx_result.__dict__.update(__pyx_state[0])
14209  */
14210 
__pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_BlockHandler__set_state(struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)14211 static PyObject *__pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_BlockHandler__set_state(struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
14212   PyObject *__pyx_r = NULL;
14213   __Pyx_RefNannyDeclarations
14214   int __pyx_t_1;
14215   Py_ssize_t __pyx_t_2;
14216   int __pyx_t_3;
14217   int __pyx_t_4;
14218   PyObject *__pyx_t_5 = NULL;
14219   PyObject *__pyx_t_6 = NULL;
14220   PyObject *__pyx_t_7 = NULL;
14221   PyObject *__pyx_t_8 = NULL;
14222   int __pyx_lineno = 0;
14223   const char *__pyx_filename = NULL;
14224   int __pyx_clineno = 0;
14225   __Pyx_RefNannySetupContext("__pyx_unpickle_BlockHandler__set_state", 0);
14226 
14227   /* "(tree fragment)":12
14228  *     return __pyx_result
14229  * cdef __pyx_unpickle_BlockHandler__set_state(BlockHandler __pyx_result, tuple __pyx_state):
14230  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
14231  *         __pyx_result.__dict__.update(__pyx_state[0])
14232  */
14233   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14234     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
14235     __PYX_ERR(2, 12, __pyx_L1_error)
14236   }
14237   __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(2, 12, __pyx_L1_error)
14238   __pyx_t_3 = ((__pyx_t_2 > 0) != 0);
14239   if (__pyx_t_3) {
14240   } else {
14241     __pyx_t_1 = __pyx_t_3;
14242     goto __pyx_L4_bool_binop_done;
14243   }
14244   __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 12, __pyx_L1_error)
14245   __pyx_t_4 = (__pyx_t_3 != 0);
14246   __pyx_t_1 = __pyx_t_4;
14247   __pyx_L4_bool_binop_done:;
14248   if (__pyx_t_1) {
14249 
14250     /* "(tree fragment)":13
14251  * cdef __pyx_unpickle_BlockHandler__set_state(BlockHandler __pyx_result, tuple __pyx_state):
14252  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
14253  *         __pyx_result.__dict__.update(__pyx_state[0])             # <<<<<<<<<<<<<<
14254  */
14255     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error)
14256     __Pyx_GOTREF(__pyx_t_6);
14257     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 13, __pyx_L1_error)
14258     __Pyx_GOTREF(__pyx_t_7);
14259     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14260     if (unlikely(__pyx_v___pyx_state == Py_None)) {
14261       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14262       __PYX_ERR(2, 13, __pyx_L1_error)
14263     }
14264     __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error)
14265     __Pyx_GOTREF(__pyx_t_6);
14266     __pyx_t_8 = NULL;
14267     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
14268       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
14269       if (likely(__pyx_t_8)) {
14270         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
14271         __Pyx_INCREF(__pyx_t_8);
14272         __Pyx_INCREF(function);
14273         __Pyx_DECREF_SET(__pyx_t_7, function);
14274       }
14275     }
14276     __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
14277     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
14278     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14279     if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
14280     __Pyx_GOTREF(__pyx_t_5);
14281     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14282     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14283 
14284     /* "(tree fragment)":12
14285  *     return __pyx_result
14286  * cdef __pyx_unpickle_BlockHandler__set_state(BlockHandler __pyx_result, tuple __pyx_state):
14287  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
14288  *         __pyx_result.__dict__.update(__pyx_state[0])
14289  */
14290   }
14291 
14292   /* "(tree fragment)":11
14293  *         __pyx_unpickle_BlockHandler__set_state(<BlockHandler> __pyx_result, __pyx_state)
14294  *     return __pyx_result
14295  * cdef __pyx_unpickle_BlockHandler__set_state(BlockHandler __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
14296  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
14297  *         __pyx_result.__dict__.update(__pyx_state[0])
14298  */
14299 
14300   /* function exit code */
14301   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14302   goto __pyx_L0;
14303   __pyx_L1_error:;
14304   __Pyx_XDECREF(__pyx_t_5);
14305   __Pyx_XDECREF(__pyx_t_6);
14306   __Pyx_XDECREF(__pyx_t_7);
14307   __Pyx_XDECREF(__pyx_t_8);
14308   __Pyx_AddTraceback("bx.bbi.bbi_file.__pyx_unpickle_BlockHandler__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
14309   __pyx_r = 0;
14310   __pyx_L0:;
14311   __Pyx_XGIVEREF(__pyx_r);
14312   __Pyx_RefNannyFinishContext();
14313   return __pyx_r;
14314 }
14315 
14316 /* "(tree fragment)":1
14317  * def __pyx_unpickle_BBIFile(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
14318  *     cdef object __pyx_PickleError
14319  *     cdef object __pyx_result
14320  */
14321 
14322 /* Python wrapper */
14323 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7__pyx_unpickle_BBIFile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14324 static PyMethodDef __pyx_mdef_2bx_3bbi_8bbi_file_7__pyx_unpickle_BBIFile = {"__pyx_unpickle_BBIFile", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_3bbi_8bbi_file_7__pyx_unpickle_BBIFile, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2bx_3bbi_8bbi_file_7__pyx_unpickle_BBIFile(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)14325 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_7__pyx_unpickle_BBIFile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14326   PyObject *__pyx_v___pyx_type = 0;
14327   long __pyx_v___pyx_checksum;
14328   PyObject *__pyx_v___pyx_state = 0;
14329   int __pyx_lineno = 0;
14330   const char *__pyx_filename = NULL;
14331   int __pyx_clineno = 0;
14332   PyObject *__pyx_r = 0;
14333   __Pyx_RefNannyDeclarations
14334   __Pyx_RefNannySetupContext("__pyx_unpickle_BBIFile (wrapper)", 0);
14335   {
14336     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
14337     PyObject* values[3] = {0,0,0};
14338     if (unlikely(__pyx_kwds)) {
14339       Py_ssize_t kw_args;
14340       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14341       switch (pos_args) {
14342         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14343         CYTHON_FALLTHROUGH;
14344         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14345         CYTHON_FALLTHROUGH;
14346         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14347         CYTHON_FALLTHROUGH;
14348         case  0: break;
14349         default: goto __pyx_L5_argtuple_error;
14350       }
14351       kw_args = PyDict_Size(__pyx_kwds);
14352       switch (pos_args) {
14353         case  0:
14354         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
14355         else goto __pyx_L5_argtuple_error;
14356         CYTHON_FALLTHROUGH;
14357         case  1:
14358         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
14359         else {
14360           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BBIFile", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
14361         }
14362         CYTHON_FALLTHROUGH;
14363         case  2:
14364         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
14365         else {
14366           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BBIFile", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
14367         }
14368       }
14369       if (unlikely(kw_args > 0)) {
14370         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_BBIFile") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
14371       }
14372     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
14373       goto __pyx_L5_argtuple_error;
14374     } else {
14375       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14376       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14377       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14378     }
14379     __pyx_v___pyx_type = values[0];
14380     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
14381     __pyx_v___pyx_state = values[2];
14382   }
14383   goto __pyx_L4_argument_unpacking_done;
14384   __pyx_L5_argtuple_error:;
14385   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BBIFile", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
14386   __pyx_L3_error:;
14387   __Pyx_AddTraceback("bx.bbi.bbi_file.__pyx_unpickle_BBIFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
14388   __Pyx_RefNannyFinishContext();
14389   return NULL;
14390   __pyx_L4_argument_unpacking_done:;
14391   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_6__pyx_unpickle_BBIFile(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
14392 
14393   /* function exit code */
14394   __Pyx_RefNannyFinishContext();
14395   return __pyx_r;
14396 }
14397 
__pyx_pf_2bx_3bbi_8bbi_file_6__pyx_unpickle_BBIFile(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)14398 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_6__pyx_unpickle_BBIFile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
14399   PyObject *__pyx_v___pyx_PickleError = 0;
14400   PyObject *__pyx_v___pyx_result = 0;
14401   PyObject *__pyx_r = NULL;
14402   __Pyx_RefNannyDeclarations
14403   int __pyx_t_1;
14404   PyObject *__pyx_t_2 = NULL;
14405   PyObject *__pyx_t_3 = NULL;
14406   PyObject *__pyx_t_4 = NULL;
14407   PyObject *__pyx_t_5 = NULL;
14408   int __pyx_t_6;
14409   int __pyx_lineno = 0;
14410   const char *__pyx_filename = NULL;
14411   int __pyx_clineno = 0;
14412   __Pyx_RefNannySetupContext("__pyx_unpickle_BBIFile", 0);
14413 
14414   /* "(tree fragment)":4
14415  *     cdef object __pyx_PickleError
14416  *     cdef object __pyx_result
14417  *     if __pyx_checksum != 0x5566878:             # <<<<<<<<<<<<<<
14418  *         from pickle import PickleError as __pyx_PickleError
14419  *         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)
14420  */
14421   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x5566878) != 0);
14422   if (__pyx_t_1) {
14423 
14424     /* "(tree fragment)":5
14425  *     cdef object __pyx_result
14426  *     if __pyx_checksum != 0x5566878:
14427  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
14428  *         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)
14429  *     __pyx_result = BBIFile.__new__(__pyx_type)
14430  */
14431     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
14432     __Pyx_GOTREF(__pyx_t_2);
14433     __Pyx_INCREF(__pyx_n_s_PickleError);
14434     __Pyx_GIVEREF(__pyx_n_s_PickleError);
14435     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
14436     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
14437     __Pyx_GOTREF(__pyx_t_3);
14438     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14439     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
14440     __Pyx_GOTREF(__pyx_t_2);
14441     __Pyx_INCREF(__pyx_t_2);
14442     __pyx_v___pyx_PickleError = __pyx_t_2;
14443     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14444     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14445 
14446     /* "(tree fragment)":6
14447  *     if __pyx_checksum != 0x5566878:
14448  *         from pickle import PickleError as __pyx_PickleError
14449  *         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)             # <<<<<<<<<<<<<<
14450  *     __pyx_result = BBIFile.__new__(__pyx_type)
14451  *     if __pyx_state is not None:
14452  */
14453     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
14454     __Pyx_GOTREF(__pyx_t_2);
14455     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x55, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
14456     __Pyx_GOTREF(__pyx_t_4);
14457     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14458     __Pyx_INCREF(__pyx_v___pyx_PickleError);
14459     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
14460     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
14461       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
14462       if (likely(__pyx_t_5)) {
14463         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
14464         __Pyx_INCREF(__pyx_t_5);
14465         __Pyx_INCREF(function);
14466         __Pyx_DECREF_SET(__pyx_t_2, function);
14467       }
14468     }
14469     __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);
14470     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14471     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14472     if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
14473     __Pyx_GOTREF(__pyx_t_3);
14474     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14475     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
14476     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14477     __PYX_ERR(2, 6, __pyx_L1_error)
14478 
14479     /* "(tree fragment)":4
14480  *     cdef object __pyx_PickleError
14481  *     cdef object __pyx_result
14482  *     if __pyx_checksum != 0x5566878:             # <<<<<<<<<<<<<<
14483  *         from pickle import PickleError as __pyx_PickleError
14484  *         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)
14485  */
14486   }
14487 
14488   /* "(tree fragment)":7
14489  *         from pickle import PickleError as __pyx_PickleError
14490  *         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)
14491  *     __pyx_result = BBIFile.__new__(__pyx_type)             # <<<<<<<<<<<<<<
14492  *     if __pyx_state is not None:
14493  *         __pyx_unpickle_BBIFile__set_state(<BBIFile> __pyx_result, __pyx_state)
14494  */
14495   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_3bbi_8bbi_file_BBIFile), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
14496   __Pyx_GOTREF(__pyx_t_2);
14497   __pyx_t_4 = NULL;
14498   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
14499     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
14500     if (likely(__pyx_t_4)) {
14501       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
14502       __Pyx_INCREF(__pyx_t_4);
14503       __Pyx_INCREF(function);
14504       __Pyx_DECREF_SET(__pyx_t_2, function);
14505     }
14506   }
14507   __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);
14508   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14509   if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
14510   __Pyx_GOTREF(__pyx_t_3);
14511   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14512   __pyx_v___pyx_result = __pyx_t_3;
14513   __pyx_t_3 = 0;
14514 
14515   /* "(tree fragment)":8
14516  *         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)
14517  *     __pyx_result = BBIFile.__new__(__pyx_type)
14518  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
14519  *         __pyx_unpickle_BBIFile__set_state(<BBIFile> __pyx_result, __pyx_state)
14520  *     return __pyx_result
14521  */
14522   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
14523   __pyx_t_6 = (__pyx_t_1 != 0);
14524   if (__pyx_t_6) {
14525 
14526     /* "(tree fragment)":9
14527  *     __pyx_result = BBIFile.__new__(__pyx_type)
14528  *     if __pyx_state is not None:
14529  *         __pyx_unpickle_BBIFile__set_state(<BBIFile> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
14530  *     return __pyx_result
14531  * cdef __pyx_unpickle_BBIFile__set_state(BBIFile __pyx_result, tuple __pyx_state):
14532  */
14533     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(2, 9, __pyx_L1_error)
14534     __pyx_t_3 = __pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_BBIFile__set_state(((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
14535     __Pyx_GOTREF(__pyx_t_3);
14536     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14537 
14538     /* "(tree fragment)":8
14539  *         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)
14540  *     __pyx_result = BBIFile.__new__(__pyx_type)
14541  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
14542  *         __pyx_unpickle_BBIFile__set_state(<BBIFile> __pyx_result, __pyx_state)
14543  *     return __pyx_result
14544  */
14545   }
14546 
14547   /* "(tree fragment)":10
14548  *     if __pyx_state is not None:
14549  *         __pyx_unpickle_BBIFile__set_state(<BBIFile> __pyx_result, __pyx_state)
14550  *     return __pyx_result             # <<<<<<<<<<<<<<
14551  * cdef __pyx_unpickle_BBIFile__set_state(BBIFile __pyx_result, tuple __pyx_state):
14552  *     __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]
14553  */
14554   __Pyx_XDECREF(__pyx_r);
14555   __Pyx_INCREF(__pyx_v___pyx_result);
14556   __pyx_r = __pyx_v___pyx_result;
14557   goto __pyx_L0;
14558 
14559   /* "(tree fragment)":1
14560  * def __pyx_unpickle_BBIFile(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
14561  *     cdef object __pyx_PickleError
14562  *     cdef object __pyx_result
14563  */
14564 
14565   /* function exit code */
14566   __pyx_L1_error:;
14567   __Pyx_XDECREF(__pyx_t_2);
14568   __Pyx_XDECREF(__pyx_t_3);
14569   __Pyx_XDECREF(__pyx_t_4);
14570   __Pyx_XDECREF(__pyx_t_5);
14571   __Pyx_AddTraceback("bx.bbi.bbi_file.__pyx_unpickle_BBIFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
14572   __pyx_r = NULL;
14573   __pyx_L0:;
14574   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
14575   __Pyx_XDECREF(__pyx_v___pyx_result);
14576   __Pyx_XGIVEREF(__pyx_r);
14577   __Pyx_RefNannyFinishContext();
14578   return __pyx_r;
14579 }
14580 
14581 /* "(tree fragment)":11
14582  *         __pyx_unpickle_BBIFile__set_state(<BBIFile> __pyx_result, __pyx_state)
14583  *     return __pyx_result
14584  * cdef __pyx_unpickle_BBIFile__set_state(BBIFile __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
14585  *     __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]
14586  *     if len(__pyx_state) > 16 and hasattr(__pyx_result, '__dict__'):
14587  */
14588 
__pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_BBIFile__set_state(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)14589 static PyObject *__pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_BBIFile__set_state(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
14590   PyObject *__pyx_r = NULL;
14591   __Pyx_RefNannyDeclarations
14592   PyObject *__pyx_t_1 = NULL;
14593   __pyx_t_2bx_3bbi_5types_bits64 __pyx_t_2;
14594   __pyx_t_2bx_3bbi_5types_bits16 __pyx_t_3;
14595   __pyx_t_2bx_3bbi_5types_boolean __pyx_t_4;
14596   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_5;
14597   int __pyx_t_6;
14598   Py_ssize_t __pyx_t_7;
14599   int __pyx_t_8;
14600   int __pyx_t_9;
14601   PyObject *__pyx_t_10 = NULL;
14602   PyObject *__pyx_t_11 = NULL;
14603   PyObject *__pyx_t_12 = NULL;
14604   int __pyx_lineno = 0;
14605   const char *__pyx_filename = NULL;
14606   int __pyx_clineno = 0;
14607   __Pyx_RefNannySetupContext("__pyx_unpickle_BBIFile__set_state", 0);
14608 
14609   /* "(tree fragment)":12
14610  *     return __pyx_result
14611  * cdef __pyx_unpickle_BBIFile__set_state(BBIFile __pyx_result, tuple __pyx_state):
14612  *     __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]             # <<<<<<<<<<<<<<
14613  *     if len(__pyx_state) > 16 and hasattr(__pyx_result, '__dict__'):
14614  *         __pyx_result.__dict__.update(__pyx_state[16])
14615  */
14616   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14617     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14618     __PYX_ERR(2, 12, __pyx_L1_error)
14619   }
14620   __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(2, 12, __pyx_L1_error)
14621   __Pyx_GOTREF(__pyx_t_1);
14622   __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(2, 12, __pyx_L1_error)
14623   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14624   __pyx_v___pyx_result->as_offset = __pyx_t_2;
14625   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14626     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14627     __PYX_ERR(2, 12, __pyx_L1_error)
14628   }
14629   __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(2, 12, __pyx_L1_error)
14630   __Pyx_GOTREF(__pyx_t_1);
14631   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2bx_3bbi_8bpt_file_BPTFile))))) __PYX_ERR(2, 12, __pyx_L1_error)
14632   __Pyx_GIVEREF(__pyx_t_1);
14633   __Pyx_GOTREF(__pyx_v___pyx_result->chrom_bpt);
14634   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->chrom_bpt));
14635   __pyx_v___pyx_result->chrom_bpt = ((struct __pyx_obj_2bx_3bbi_8bpt_file_BPTFile *)__pyx_t_1);
14636   __pyx_t_1 = 0;
14637   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14638     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14639     __PYX_ERR(2, 12, __pyx_L1_error)
14640   }
14641   __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(2, 12, __pyx_L1_error)
14642   __Pyx_GOTREF(__pyx_t_1);
14643   __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(2, 12, __pyx_L1_error)
14644   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14645   __pyx_v___pyx_result->chrom_tree_offset = __pyx_t_2;
14646   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14647     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14648     __PYX_ERR(2, 12, __pyx_L1_error)
14649   }
14650   __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(2, 12, __pyx_L1_error)
14651   __Pyx_GOTREF(__pyx_t_1);
14652   __pyx_t_3 = __Pyx_PyInt_As_unsigned_short(__pyx_t_1); if (unlikely((__pyx_t_3 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
14653   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14654   __pyx_v___pyx_result->defined_field_count = __pyx_t_3;
14655   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14656     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14657     __PYX_ERR(2, 12, __pyx_L1_error)
14658   }
14659   __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(2, 12, __pyx_L1_error)
14660   __Pyx_GOTREF(__pyx_t_1);
14661   __pyx_t_3 = __Pyx_PyInt_As_unsigned_short(__pyx_t_1); if (unlikely((__pyx_t_3 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
14662   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14663   __pyx_v___pyx_result->field_count = __pyx_t_3;
14664   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14665     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14666     __PYX_ERR(2, 12, __pyx_L1_error)
14667   }
14668   __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(2, 12, __pyx_L1_error)
14669   __Pyx_GOTREF(__pyx_t_1);
14670   __Pyx_GIVEREF(__pyx_t_1);
14671   __Pyx_GOTREF(__pyx_v___pyx_result->file);
14672   __Pyx_DECREF(__pyx_v___pyx_result->file);
14673   __pyx_v___pyx_result->file = __pyx_t_1;
14674   __pyx_t_1 = 0;
14675   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14676     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14677     __PYX_ERR(2, 12, __pyx_L1_error)
14678   }
14679   __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(2, 12, __pyx_L1_error)
14680   __Pyx_GOTREF(__pyx_t_1);
14681   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
14682   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14683   __pyx_v___pyx_result->is_byteswapped = __pyx_t_4;
14684   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14685     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14686     __PYX_ERR(2, 12, __pyx_L1_error)
14687   }
14688   __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(2, 12, __pyx_L1_error)
14689   __Pyx_GOTREF(__pyx_t_1);
14690   __Pyx_GIVEREF(__pyx_t_1);
14691   __Pyx_GOTREF(__pyx_v___pyx_result->level_list);
14692   __Pyx_DECREF(__pyx_v___pyx_result->level_list);
14693   __pyx_v___pyx_result->level_list = __pyx_t_1;
14694   __pyx_t_1 = 0;
14695   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14696     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14697     __PYX_ERR(2, 12, __pyx_L1_error)
14698   }
14699   __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(2, 12, __pyx_L1_error)
14700   __Pyx_GOTREF(__pyx_t_1);
14701   __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
14702   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14703   __pyx_v___pyx_result->magic = __pyx_t_5;
14704   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14705     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14706     __PYX_ERR(2, 12, __pyx_L1_error)
14707   }
14708   __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(2, 12, __pyx_L1_error)
14709   __Pyx_GOTREF(__pyx_t_1);
14710   __Pyx_GIVEREF(__pyx_t_1);
14711   __Pyx_GOTREF(__pyx_v___pyx_result->reader);
14712   __Pyx_DECREF(__pyx_v___pyx_result->reader);
14713   __pyx_v___pyx_result->reader = __pyx_t_1;
14714   __pyx_t_1 = 0;
14715   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14716     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14717     __PYX_ERR(2, 12, __pyx_L1_error)
14718   }
14719   __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(2, 12, __pyx_L1_error)
14720   __Pyx_GOTREF(__pyx_t_1);
14721   __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(2, 12, __pyx_L1_error)
14722   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14723   __pyx_v___pyx_result->total_summary_offset = __pyx_t_2;
14724   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14725     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14726     __PYX_ERR(2, 12, __pyx_L1_error)
14727   }
14728   __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(2, 12, __pyx_L1_error)
14729   __Pyx_GOTREF(__pyx_t_1);
14730   __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
14731   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14732   __pyx_v___pyx_result->uncompress_buf_size = __pyx_t_5;
14733   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14734     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14735     __PYX_ERR(2, 12, __pyx_L1_error)
14736   }
14737   __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(2, 12, __pyx_L1_error)
14738   __Pyx_GOTREF(__pyx_t_1);
14739   __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(2, 12, __pyx_L1_error)
14740   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14741   __pyx_v___pyx_result->unzoomed_data_offset = __pyx_t_2;
14742   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14743     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14744     __PYX_ERR(2, 12, __pyx_L1_error)
14745   }
14746   __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(2, 12, __pyx_L1_error)
14747   __Pyx_GOTREF(__pyx_t_1);
14748   __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(2, 12, __pyx_L1_error)
14749   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14750   __pyx_v___pyx_result->unzoomed_index_offset = __pyx_t_2;
14751   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14752     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14753     __PYX_ERR(2, 12, __pyx_L1_error)
14754   }
14755   __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(2, 12, __pyx_L1_error)
14756   __Pyx_GOTREF(__pyx_t_1);
14757   __pyx_t_3 = __Pyx_PyInt_As_unsigned_short(__pyx_t_1); if (unlikely((__pyx_t_3 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
14758   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14759   __pyx_v___pyx_result->version = __pyx_t_3;
14760   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14761     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14762     __PYX_ERR(2, 12, __pyx_L1_error)
14763   }
14764   __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(2, 12, __pyx_L1_error)
14765   __Pyx_GOTREF(__pyx_t_1);
14766   __pyx_t_3 = __Pyx_PyInt_As_unsigned_short(__pyx_t_1); if (unlikely((__pyx_t_3 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
14767   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14768   __pyx_v___pyx_result->zoom_levels = __pyx_t_3;
14769 
14770   /* "(tree fragment)":13
14771  * cdef __pyx_unpickle_BBIFile__set_state(BBIFile __pyx_result, tuple __pyx_state):
14772  *     __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]
14773  *     if len(__pyx_state) > 16 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
14774  *         __pyx_result.__dict__.update(__pyx_state[16])
14775  */
14776   if (unlikely(__pyx_v___pyx_state == Py_None)) {
14777     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
14778     __PYX_ERR(2, 13, __pyx_L1_error)
14779   }
14780   __pyx_t_7 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
14781   __pyx_t_8 = ((__pyx_t_7 > 16) != 0);
14782   if (__pyx_t_8) {
14783   } else {
14784     __pyx_t_6 = __pyx_t_8;
14785     goto __pyx_L4_bool_binop_done;
14786   }
14787   __pyx_t_8 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
14788   __pyx_t_9 = (__pyx_t_8 != 0);
14789   __pyx_t_6 = __pyx_t_9;
14790   __pyx_L4_bool_binop_done:;
14791   if (__pyx_t_6) {
14792 
14793     /* "(tree fragment)":14
14794  *     __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]
14795  *     if len(__pyx_state) > 16 and hasattr(__pyx_result, '__dict__'):
14796  *         __pyx_result.__dict__.update(__pyx_state[16])             # <<<<<<<<<<<<<<
14797  */
14798     __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 14, __pyx_L1_error)
14799     __Pyx_GOTREF(__pyx_t_10);
14800     __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_update); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 14, __pyx_L1_error)
14801     __Pyx_GOTREF(__pyx_t_11);
14802     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14803     if (unlikely(__pyx_v___pyx_state == Py_None)) {
14804       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
14805       __PYX_ERR(2, 14, __pyx_L1_error)
14806     }
14807     __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(2, 14, __pyx_L1_error)
14808     __Pyx_GOTREF(__pyx_t_10);
14809     __pyx_t_12 = NULL;
14810     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
14811       __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
14812       if (likely(__pyx_t_12)) {
14813         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
14814         __Pyx_INCREF(__pyx_t_12);
14815         __Pyx_INCREF(function);
14816         __Pyx_DECREF_SET(__pyx_t_11, function);
14817       }
14818     }
14819     __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);
14820     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
14821     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14822     if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
14823     __Pyx_GOTREF(__pyx_t_1);
14824     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14825     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14826 
14827     /* "(tree fragment)":13
14828  * cdef __pyx_unpickle_BBIFile__set_state(BBIFile __pyx_result, tuple __pyx_state):
14829  *     __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]
14830  *     if len(__pyx_state) > 16 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
14831  *         __pyx_result.__dict__.update(__pyx_state[16])
14832  */
14833   }
14834 
14835   /* "(tree fragment)":11
14836  *         __pyx_unpickle_BBIFile__set_state(<BBIFile> __pyx_result, __pyx_state)
14837  *     return __pyx_result
14838  * cdef __pyx_unpickle_BBIFile__set_state(BBIFile __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
14839  *     __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]
14840  *     if len(__pyx_state) > 16 and hasattr(__pyx_result, '__dict__'):
14841  */
14842 
14843   /* function exit code */
14844   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14845   goto __pyx_L0;
14846   __pyx_L1_error:;
14847   __Pyx_XDECREF(__pyx_t_1);
14848   __Pyx_XDECREF(__pyx_t_10);
14849   __Pyx_XDECREF(__pyx_t_11);
14850   __Pyx_XDECREF(__pyx_t_12);
14851   __Pyx_AddTraceback("bx.bbi.bbi_file.__pyx_unpickle_BBIFile__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
14852   __pyx_r = 0;
14853   __pyx_L0:;
14854   __Pyx_XGIVEREF(__pyx_r);
14855   __Pyx_RefNannyFinishContext();
14856   return __pyx_r;
14857 }
14858 
14859 /* "(tree fragment)":1
14860  * def __pyx_unpickle_ZoomLevel(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
14861  *     cdef object __pyx_PickleError
14862  *     cdef object __pyx_result
14863  */
14864 
14865 /* Python wrapper */
14866 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_9__pyx_unpickle_ZoomLevel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14867 static PyMethodDef __pyx_mdef_2bx_3bbi_8bbi_file_9__pyx_unpickle_ZoomLevel = {"__pyx_unpickle_ZoomLevel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_3bbi_8bbi_file_9__pyx_unpickle_ZoomLevel, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2bx_3bbi_8bbi_file_9__pyx_unpickle_ZoomLevel(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)14868 static PyObject *__pyx_pw_2bx_3bbi_8bbi_file_9__pyx_unpickle_ZoomLevel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14869   PyObject *__pyx_v___pyx_type = 0;
14870   long __pyx_v___pyx_checksum;
14871   PyObject *__pyx_v___pyx_state = 0;
14872   int __pyx_lineno = 0;
14873   const char *__pyx_filename = NULL;
14874   int __pyx_clineno = 0;
14875   PyObject *__pyx_r = 0;
14876   __Pyx_RefNannyDeclarations
14877   __Pyx_RefNannySetupContext("__pyx_unpickle_ZoomLevel (wrapper)", 0);
14878   {
14879     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
14880     PyObject* values[3] = {0,0,0};
14881     if (unlikely(__pyx_kwds)) {
14882       Py_ssize_t kw_args;
14883       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14884       switch (pos_args) {
14885         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14886         CYTHON_FALLTHROUGH;
14887         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14888         CYTHON_FALLTHROUGH;
14889         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14890         CYTHON_FALLTHROUGH;
14891         case  0: break;
14892         default: goto __pyx_L5_argtuple_error;
14893       }
14894       kw_args = PyDict_Size(__pyx_kwds);
14895       switch (pos_args) {
14896         case  0:
14897         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
14898         else goto __pyx_L5_argtuple_error;
14899         CYTHON_FALLTHROUGH;
14900         case  1:
14901         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
14902         else {
14903           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ZoomLevel", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
14904         }
14905         CYTHON_FALLTHROUGH;
14906         case  2:
14907         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
14908         else {
14909           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ZoomLevel", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
14910         }
14911       }
14912       if (unlikely(kw_args > 0)) {
14913         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_ZoomLevel") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
14914       }
14915     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
14916       goto __pyx_L5_argtuple_error;
14917     } else {
14918       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14919       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14920       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14921     }
14922     __pyx_v___pyx_type = values[0];
14923     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
14924     __pyx_v___pyx_state = values[2];
14925   }
14926   goto __pyx_L4_argument_unpacking_done;
14927   __pyx_L5_argtuple_error:;
14928   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ZoomLevel", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
14929   __pyx_L3_error:;
14930   __Pyx_AddTraceback("bx.bbi.bbi_file.__pyx_unpickle_ZoomLevel", __pyx_clineno, __pyx_lineno, __pyx_filename);
14931   __Pyx_RefNannyFinishContext();
14932   return NULL;
14933   __pyx_L4_argument_unpacking_done:;
14934   __pyx_r = __pyx_pf_2bx_3bbi_8bbi_file_8__pyx_unpickle_ZoomLevel(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
14935 
14936   /* function exit code */
14937   __Pyx_RefNannyFinishContext();
14938   return __pyx_r;
14939 }
14940 
__pyx_pf_2bx_3bbi_8bbi_file_8__pyx_unpickle_ZoomLevel(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)14941 static PyObject *__pyx_pf_2bx_3bbi_8bbi_file_8__pyx_unpickle_ZoomLevel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
14942   PyObject *__pyx_v___pyx_PickleError = 0;
14943   PyObject *__pyx_v___pyx_result = 0;
14944   PyObject *__pyx_r = NULL;
14945   __Pyx_RefNannyDeclarations
14946   int __pyx_t_1;
14947   PyObject *__pyx_t_2 = NULL;
14948   PyObject *__pyx_t_3 = NULL;
14949   PyObject *__pyx_t_4 = NULL;
14950   PyObject *__pyx_t_5 = NULL;
14951   int __pyx_t_6;
14952   int __pyx_lineno = 0;
14953   const char *__pyx_filename = NULL;
14954   int __pyx_clineno = 0;
14955   __Pyx_RefNannySetupContext("__pyx_unpickle_ZoomLevel", 0);
14956 
14957   /* "(tree fragment)":4
14958  *     cdef object __pyx_PickleError
14959  *     cdef object __pyx_result
14960  *     if __pyx_checksum != 0x3665355:             # <<<<<<<<<<<<<<
14961  *         from pickle import PickleError as __pyx_PickleError
14962  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3665355 = (bbi_file, data_offset, index_offset, item_count, reduction_level, reserved))" % __pyx_checksum)
14963  */
14964   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x3665355) != 0);
14965   if (__pyx_t_1) {
14966 
14967     /* "(tree fragment)":5
14968  *     cdef object __pyx_result
14969  *     if __pyx_checksum != 0x3665355:
14970  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
14971  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3665355 = (bbi_file, data_offset, index_offset, item_count, reduction_level, reserved))" % __pyx_checksum)
14972  *     __pyx_result = ZoomLevel.__new__(__pyx_type)
14973  */
14974     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
14975     __Pyx_GOTREF(__pyx_t_2);
14976     __Pyx_INCREF(__pyx_n_s_PickleError);
14977     __Pyx_GIVEREF(__pyx_n_s_PickleError);
14978     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
14979     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
14980     __Pyx_GOTREF(__pyx_t_3);
14981     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14982     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
14983     __Pyx_GOTREF(__pyx_t_2);
14984     __Pyx_INCREF(__pyx_t_2);
14985     __pyx_v___pyx_PickleError = __pyx_t_2;
14986     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14987     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14988 
14989     /* "(tree fragment)":6
14990  *     if __pyx_checksum != 0x3665355:
14991  *         from pickle import PickleError as __pyx_PickleError
14992  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3665355 = (bbi_file, data_offset, index_offset, item_count, reduction_level, reserved))" % __pyx_checksum)             # <<<<<<<<<<<<<<
14993  *     __pyx_result = ZoomLevel.__new__(__pyx_type)
14994  *     if __pyx_state is not None:
14995  */
14996     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
14997     __Pyx_GOTREF(__pyx_t_2);
14998     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x36, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
14999     __Pyx_GOTREF(__pyx_t_4);
15000     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15001     __Pyx_INCREF(__pyx_v___pyx_PickleError);
15002     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
15003     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
15004       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
15005       if (likely(__pyx_t_5)) {
15006         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
15007         __Pyx_INCREF(__pyx_t_5);
15008         __Pyx_INCREF(function);
15009         __Pyx_DECREF_SET(__pyx_t_2, function);
15010       }
15011     }
15012     __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);
15013     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15014     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15015     if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
15016     __Pyx_GOTREF(__pyx_t_3);
15017     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15018     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15019     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15020     __PYX_ERR(2, 6, __pyx_L1_error)
15021 
15022     /* "(tree fragment)":4
15023  *     cdef object __pyx_PickleError
15024  *     cdef object __pyx_result
15025  *     if __pyx_checksum != 0x3665355:             # <<<<<<<<<<<<<<
15026  *         from pickle import PickleError as __pyx_PickleError
15027  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3665355 = (bbi_file, data_offset, index_offset, item_count, reduction_level, reserved))" % __pyx_checksum)
15028  */
15029   }
15030 
15031   /* "(tree fragment)":7
15032  *         from pickle import PickleError as __pyx_PickleError
15033  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3665355 = (bbi_file, data_offset, index_offset, item_count, reduction_level, reserved))" % __pyx_checksum)
15034  *     __pyx_result = ZoomLevel.__new__(__pyx_type)             # <<<<<<<<<<<<<<
15035  *     if __pyx_state is not None:
15036  *         __pyx_unpickle_ZoomLevel__set_state(<ZoomLevel> __pyx_result, __pyx_state)
15037  */
15038   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_3bbi_8bbi_file_ZoomLevel), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
15039   __Pyx_GOTREF(__pyx_t_2);
15040   __pyx_t_4 = NULL;
15041   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
15042     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
15043     if (likely(__pyx_t_4)) {
15044       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
15045       __Pyx_INCREF(__pyx_t_4);
15046       __Pyx_INCREF(function);
15047       __Pyx_DECREF_SET(__pyx_t_2, function);
15048     }
15049   }
15050   __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);
15051   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15052   if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
15053   __Pyx_GOTREF(__pyx_t_3);
15054   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15055   __pyx_v___pyx_result = __pyx_t_3;
15056   __pyx_t_3 = 0;
15057 
15058   /* "(tree fragment)":8
15059  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3665355 = (bbi_file, data_offset, index_offset, item_count, reduction_level, reserved))" % __pyx_checksum)
15060  *     __pyx_result = ZoomLevel.__new__(__pyx_type)
15061  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
15062  *         __pyx_unpickle_ZoomLevel__set_state(<ZoomLevel> __pyx_result, __pyx_state)
15063  *     return __pyx_result
15064  */
15065   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
15066   __pyx_t_6 = (__pyx_t_1 != 0);
15067   if (__pyx_t_6) {
15068 
15069     /* "(tree fragment)":9
15070  *     __pyx_result = ZoomLevel.__new__(__pyx_type)
15071  *     if __pyx_state is not None:
15072  *         __pyx_unpickle_ZoomLevel__set_state(<ZoomLevel> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
15073  *     return __pyx_result
15074  * cdef __pyx_unpickle_ZoomLevel__set_state(ZoomLevel __pyx_result, tuple __pyx_state):
15075  */
15076     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(2, 9, __pyx_L1_error)
15077     __pyx_t_3 = __pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_ZoomLevel__set_state(((struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
15078     __Pyx_GOTREF(__pyx_t_3);
15079     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15080 
15081     /* "(tree fragment)":8
15082  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x3665355 = (bbi_file, data_offset, index_offset, item_count, reduction_level, reserved))" % __pyx_checksum)
15083  *     __pyx_result = ZoomLevel.__new__(__pyx_type)
15084  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
15085  *         __pyx_unpickle_ZoomLevel__set_state(<ZoomLevel> __pyx_result, __pyx_state)
15086  *     return __pyx_result
15087  */
15088   }
15089 
15090   /* "(tree fragment)":10
15091  *     if __pyx_state is not None:
15092  *         __pyx_unpickle_ZoomLevel__set_state(<ZoomLevel> __pyx_result, __pyx_state)
15093  *     return __pyx_result             # <<<<<<<<<<<<<<
15094  * cdef __pyx_unpickle_ZoomLevel__set_state(ZoomLevel __pyx_result, tuple __pyx_state):
15095  *     __pyx_result.bbi_file = __pyx_state[0]; __pyx_result.data_offset = __pyx_state[1]; __pyx_result.index_offset = __pyx_state[2]; __pyx_result.item_count = __pyx_state[3]; __pyx_result.reduction_level = __pyx_state[4]; __pyx_result.reserved = __pyx_state[5]
15096  */
15097   __Pyx_XDECREF(__pyx_r);
15098   __Pyx_INCREF(__pyx_v___pyx_result);
15099   __pyx_r = __pyx_v___pyx_result;
15100   goto __pyx_L0;
15101 
15102   /* "(tree fragment)":1
15103  * def __pyx_unpickle_ZoomLevel(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
15104  *     cdef object __pyx_PickleError
15105  *     cdef object __pyx_result
15106  */
15107 
15108   /* function exit code */
15109   __pyx_L1_error:;
15110   __Pyx_XDECREF(__pyx_t_2);
15111   __Pyx_XDECREF(__pyx_t_3);
15112   __Pyx_XDECREF(__pyx_t_4);
15113   __Pyx_XDECREF(__pyx_t_5);
15114   __Pyx_AddTraceback("bx.bbi.bbi_file.__pyx_unpickle_ZoomLevel", __pyx_clineno, __pyx_lineno, __pyx_filename);
15115   __pyx_r = NULL;
15116   __pyx_L0:;
15117   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
15118   __Pyx_XDECREF(__pyx_v___pyx_result);
15119   __Pyx_XGIVEREF(__pyx_r);
15120   __Pyx_RefNannyFinishContext();
15121   return __pyx_r;
15122 }
15123 
15124 /* "(tree fragment)":11
15125  *         __pyx_unpickle_ZoomLevel__set_state(<ZoomLevel> __pyx_result, __pyx_state)
15126  *     return __pyx_result
15127  * cdef __pyx_unpickle_ZoomLevel__set_state(ZoomLevel __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
15128  *     __pyx_result.bbi_file = __pyx_state[0]; __pyx_result.data_offset = __pyx_state[1]; __pyx_result.index_offset = __pyx_state[2]; __pyx_result.item_count = __pyx_state[3]; __pyx_result.reduction_level = __pyx_state[4]; __pyx_result.reserved = __pyx_state[5]
15129  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
15130  */
15131 
__pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_ZoomLevel__set_state(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)15132 static PyObject *__pyx_f_2bx_3bbi_8bbi_file___pyx_unpickle_ZoomLevel__set_state(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
15133   PyObject *__pyx_r = NULL;
15134   __Pyx_RefNannyDeclarations
15135   PyObject *__pyx_t_1 = NULL;
15136   __pyx_t_2bx_3bbi_5types_bits64 __pyx_t_2;
15137   int __pyx_t_3;
15138   __pyx_t_2bx_3bbi_5types_bits32 __pyx_t_4;
15139   int __pyx_t_5;
15140   Py_ssize_t __pyx_t_6;
15141   int __pyx_t_7;
15142   int __pyx_t_8;
15143   PyObject *__pyx_t_9 = NULL;
15144   PyObject *__pyx_t_10 = NULL;
15145   PyObject *__pyx_t_11 = NULL;
15146   int __pyx_lineno = 0;
15147   const char *__pyx_filename = NULL;
15148   int __pyx_clineno = 0;
15149   __Pyx_RefNannySetupContext("__pyx_unpickle_ZoomLevel__set_state", 0);
15150 
15151   /* "(tree fragment)":12
15152  *     return __pyx_result
15153  * cdef __pyx_unpickle_ZoomLevel__set_state(ZoomLevel __pyx_result, tuple __pyx_state):
15154  *     __pyx_result.bbi_file = __pyx_state[0]; __pyx_result.data_offset = __pyx_state[1]; __pyx_result.index_offset = __pyx_state[2]; __pyx_result.item_count = __pyx_state[3]; __pyx_result.reduction_level = __pyx_state[4]; __pyx_result.reserved = __pyx_state[5]             # <<<<<<<<<<<<<<
15155  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
15156  *         __pyx_result.__dict__.update(__pyx_state[6])
15157  */
15158   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15159     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15160     __PYX_ERR(2, 12, __pyx_L1_error)
15161   }
15162   __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(2, 12, __pyx_L1_error)
15163   __Pyx_GOTREF(__pyx_t_1);
15164   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2bx_3bbi_8bbi_file_BBIFile))))) __PYX_ERR(2, 12, __pyx_L1_error)
15165   __Pyx_GIVEREF(__pyx_t_1);
15166   __Pyx_GOTREF(__pyx_v___pyx_result->bbi_file);
15167   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->bbi_file));
15168   __pyx_v___pyx_result->bbi_file = ((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)__pyx_t_1);
15169   __pyx_t_1 = 0;
15170   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15171     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15172     __PYX_ERR(2, 12, __pyx_L1_error)
15173   }
15174   __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(2, 12, __pyx_L1_error)
15175   __Pyx_GOTREF(__pyx_t_1);
15176   __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(2, 12, __pyx_L1_error)
15177   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15178   __pyx_v___pyx_result->data_offset = __pyx_t_2;
15179   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15180     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15181     __PYX_ERR(2, 12, __pyx_L1_error)
15182   }
15183   __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(2, 12, __pyx_L1_error)
15184   __Pyx_GOTREF(__pyx_t_1);
15185   __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(2, 12, __pyx_L1_error)
15186   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15187   __pyx_v___pyx_result->index_offset = __pyx_t_2;
15188   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15189     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15190     __PYX_ERR(2, 12, __pyx_L1_error)
15191   }
15192   __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(2, 12, __pyx_L1_error)
15193   __Pyx_GOTREF(__pyx_t_1);
15194   __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
15195   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15196   __pyx_v___pyx_result->item_count = __pyx_t_3;
15197   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15198     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15199     __PYX_ERR(2, 12, __pyx_L1_error)
15200   }
15201   __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(2, 12, __pyx_L1_error)
15202   __Pyx_GOTREF(__pyx_t_1);
15203   __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
15204   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15205   __pyx_v___pyx_result->reduction_level = __pyx_t_4;
15206   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15207     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15208     __PYX_ERR(2, 12, __pyx_L1_error)
15209   }
15210   __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(2, 12, __pyx_L1_error)
15211   __Pyx_GOTREF(__pyx_t_1);
15212   __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
15213   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15214   __pyx_v___pyx_result->reserved = __pyx_t_4;
15215 
15216   /* "(tree fragment)":13
15217  * cdef __pyx_unpickle_ZoomLevel__set_state(ZoomLevel __pyx_result, tuple __pyx_state):
15218  *     __pyx_result.bbi_file = __pyx_state[0]; __pyx_result.data_offset = __pyx_state[1]; __pyx_result.index_offset = __pyx_state[2]; __pyx_result.item_count = __pyx_state[3]; __pyx_result.reduction_level = __pyx_state[4]; __pyx_result.reserved = __pyx_state[5]
15219  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
15220  *         __pyx_result.__dict__.update(__pyx_state[6])
15221  */
15222   if (unlikely(__pyx_v___pyx_state == Py_None)) {
15223     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
15224     __PYX_ERR(2, 13, __pyx_L1_error)
15225   }
15226   __pyx_t_6 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
15227   __pyx_t_7 = ((__pyx_t_6 > 6) != 0);
15228   if (__pyx_t_7) {
15229   } else {
15230     __pyx_t_5 = __pyx_t_7;
15231     goto __pyx_L4_bool_binop_done;
15232   }
15233   __pyx_t_7 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
15234   __pyx_t_8 = (__pyx_t_7 != 0);
15235   __pyx_t_5 = __pyx_t_8;
15236   __pyx_L4_bool_binop_done:;
15237   if (__pyx_t_5) {
15238 
15239     /* "(tree fragment)":14
15240  *     __pyx_result.bbi_file = __pyx_state[0]; __pyx_result.data_offset = __pyx_state[1]; __pyx_result.index_offset = __pyx_state[2]; __pyx_result.item_count = __pyx_state[3]; __pyx_result.reduction_level = __pyx_state[4]; __pyx_result.reserved = __pyx_state[5]
15241  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
15242  *         __pyx_result.__dict__.update(__pyx_state[6])             # <<<<<<<<<<<<<<
15243  */
15244     __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 14, __pyx_L1_error)
15245     __Pyx_GOTREF(__pyx_t_9);
15246     __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_update); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 14, __pyx_L1_error)
15247     __Pyx_GOTREF(__pyx_t_10);
15248     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15249     if (unlikely(__pyx_v___pyx_state == Py_None)) {
15250       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15251       __PYX_ERR(2, 14, __pyx_L1_error)
15252     }
15253     __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 14, __pyx_L1_error)
15254     __Pyx_GOTREF(__pyx_t_9);
15255     __pyx_t_11 = NULL;
15256     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
15257       __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
15258       if (likely(__pyx_t_11)) {
15259         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
15260         __Pyx_INCREF(__pyx_t_11);
15261         __Pyx_INCREF(function);
15262         __Pyx_DECREF_SET(__pyx_t_10, function);
15263       }
15264     }
15265     __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9);
15266     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
15267     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15268     if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
15269     __Pyx_GOTREF(__pyx_t_1);
15270     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15271     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15272 
15273     /* "(tree fragment)":13
15274  * cdef __pyx_unpickle_ZoomLevel__set_state(ZoomLevel __pyx_result, tuple __pyx_state):
15275  *     __pyx_result.bbi_file = __pyx_state[0]; __pyx_result.data_offset = __pyx_state[1]; __pyx_result.index_offset = __pyx_state[2]; __pyx_result.item_count = __pyx_state[3]; __pyx_result.reduction_level = __pyx_state[4]; __pyx_result.reserved = __pyx_state[5]
15276  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
15277  *         __pyx_result.__dict__.update(__pyx_state[6])
15278  */
15279   }
15280 
15281   /* "(tree fragment)":11
15282  *         __pyx_unpickle_ZoomLevel__set_state(<ZoomLevel> __pyx_result, __pyx_state)
15283  *     return __pyx_result
15284  * cdef __pyx_unpickle_ZoomLevel__set_state(ZoomLevel __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
15285  *     __pyx_result.bbi_file = __pyx_state[0]; __pyx_result.data_offset = __pyx_state[1]; __pyx_result.index_offset = __pyx_state[2]; __pyx_result.item_count = __pyx_state[3]; __pyx_result.reduction_level = __pyx_state[4]; __pyx_result.reserved = __pyx_state[5]
15286  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
15287  */
15288 
15289   /* function exit code */
15290   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15291   goto __pyx_L0;
15292   __pyx_L1_error:;
15293   __Pyx_XDECREF(__pyx_t_1);
15294   __Pyx_XDECREF(__pyx_t_9);
15295   __Pyx_XDECREF(__pyx_t_10);
15296   __Pyx_XDECREF(__pyx_t_11);
15297   __Pyx_AddTraceback("bx.bbi.bbi_file.__pyx_unpickle_ZoomLevel__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
15298   __pyx_r = 0;
15299   __pyx_L0:;
15300   __Pyx_XGIVEREF(__pyx_r);
15301   __Pyx_RefNannyFinishContext();
15302   return __pyx_r;
15303 }
15304 
15305 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":735
15306  * ctypedef npy_cdouble     complex_t
15307  *
15308  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
15309  *     return PyArray_MultiIterNew(1, <void*>a)
15310  *
15311  */
15312 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)15313 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
15314   PyObject *__pyx_r = NULL;
15315   __Pyx_RefNannyDeclarations
15316   PyObject *__pyx_t_1 = NULL;
15317   int __pyx_lineno = 0;
15318   const char *__pyx_filename = NULL;
15319   int __pyx_clineno = 0;
15320   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
15321 
15322   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":736
15323  *
15324  * cdef inline object PyArray_MultiIterNew1(a):
15325  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
15326  *
15327  * cdef inline object PyArray_MultiIterNew2(a, b):
15328  */
15329   __Pyx_XDECREF(__pyx_r);
15330   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 736, __pyx_L1_error)
15331   __Pyx_GOTREF(__pyx_t_1);
15332   __pyx_r = __pyx_t_1;
15333   __pyx_t_1 = 0;
15334   goto __pyx_L0;
15335 
15336   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":735
15337  * ctypedef npy_cdouble     complex_t
15338  *
15339  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
15340  *     return PyArray_MultiIterNew(1, <void*>a)
15341  *
15342  */
15343 
15344   /* function exit code */
15345   __pyx_L1_error:;
15346   __Pyx_XDECREF(__pyx_t_1);
15347   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
15348   __pyx_r = 0;
15349   __pyx_L0:;
15350   __Pyx_XGIVEREF(__pyx_r);
15351   __Pyx_RefNannyFinishContext();
15352   return __pyx_r;
15353 }
15354 
15355 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":738
15356  *     return PyArray_MultiIterNew(1, <void*>a)
15357  *
15358  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
15359  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
15360  *
15361  */
15362 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)15363 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
15364   PyObject *__pyx_r = NULL;
15365   __Pyx_RefNannyDeclarations
15366   PyObject *__pyx_t_1 = NULL;
15367   int __pyx_lineno = 0;
15368   const char *__pyx_filename = NULL;
15369   int __pyx_clineno = 0;
15370   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
15371 
15372   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":739
15373  *
15374  * cdef inline object PyArray_MultiIterNew2(a, b):
15375  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
15376  *
15377  * cdef inline object PyArray_MultiIterNew3(a, b, c):
15378  */
15379   __Pyx_XDECREF(__pyx_r);
15380   __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 739, __pyx_L1_error)
15381   __Pyx_GOTREF(__pyx_t_1);
15382   __pyx_r = __pyx_t_1;
15383   __pyx_t_1 = 0;
15384   goto __pyx_L0;
15385 
15386   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":738
15387  *     return PyArray_MultiIterNew(1, <void*>a)
15388  *
15389  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
15390  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
15391  *
15392  */
15393 
15394   /* function exit code */
15395   __pyx_L1_error:;
15396   __Pyx_XDECREF(__pyx_t_1);
15397   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
15398   __pyx_r = 0;
15399   __pyx_L0:;
15400   __Pyx_XGIVEREF(__pyx_r);
15401   __Pyx_RefNannyFinishContext();
15402   return __pyx_r;
15403 }
15404 
15405 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":741
15406  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
15407  *
15408  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
15409  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
15410  *
15411  */
15412 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)15413 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
15414   PyObject *__pyx_r = NULL;
15415   __Pyx_RefNannyDeclarations
15416   PyObject *__pyx_t_1 = NULL;
15417   int __pyx_lineno = 0;
15418   const char *__pyx_filename = NULL;
15419   int __pyx_clineno = 0;
15420   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
15421 
15422   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":742
15423  *
15424  * cdef inline object PyArray_MultiIterNew3(a, b, c):
15425  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
15426  *
15427  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
15428  */
15429   __Pyx_XDECREF(__pyx_r);
15430   __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(3, 742, __pyx_L1_error)
15431   __Pyx_GOTREF(__pyx_t_1);
15432   __pyx_r = __pyx_t_1;
15433   __pyx_t_1 = 0;
15434   goto __pyx_L0;
15435 
15436   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":741
15437  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
15438  *
15439  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
15440  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
15441  *
15442  */
15443 
15444   /* function exit code */
15445   __pyx_L1_error:;
15446   __Pyx_XDECREF(__pyx_t_1);
15447   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
15448   __pyx_r = 0;
15449   __pyx_L0:;
15450   __Pyx_XGIVEREF(__pyx_r);
15451   __Pyx_RefNannyFinishContext();
15452   return __pyx_r;
15453 }
15454 
15455 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":744
15456  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
15457  *
15458  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
15459  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
15460  *
15461  */
15462 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)15463 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) {
15464   PyObject *__pyx_r = NULL;
15465   __Pyx_RefNannyDeclarations
15466   PyObject *__pyx_t_1 = NULL;
15467   int __pyx_lineno = 0;
15468   const char *__pyx_filename = NULL;
15469   int __pyx_clineno = 0;
15470   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
15471 
15472   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":745
15473  *
15474  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
15475  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
15476  *
15477  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
15478  */
15479   __Pyx_XDECREF(__pyx_r);
15480   __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(3, 745, __pyx_L1_error)
15481   __Pyx_GOTREF(__pyx_t_1);
15482   __pyx_r = __pyx_t_1;
15483   __pyx_t_1 = 0;
15484   goto __pyx_L0;
15485 
15486   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":744
15487  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
15488  *
15489  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
15490  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
15491  *
15492  */
15493 
15494   /* function exit code */
15495   __pyx_L1_error:;
15496   __Pyx_XDECREF(__pyx_t_1);
15497   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
15498   __pyx_r = 0;
15499   __pyx_L0:;
15500   __Pyx_XGIVEREF(__pyx_r);
15501   __Pyx_RefNannyFinishContext();
15502   return __pyx_r;
15503 }
15504 
15505 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":747
15506  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
15507  *
15508  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
15509  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
15510  *
15511  */
15512 
__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)15513 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) {
15514   PyObject *__pyx_r = NULL;
15515   __Pyx_RefNannyDeclarations
15516   PyObject *__pyx_t_1 = NULL;
15517   int __pyx_lineno = 0;
15518   const char *__pyx_filename = NULL;
15519   int __pyx_clineno = 0;
15520   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
15521 
15522   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":748
15523  *
15524  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
15525  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
15526  *
15527  * cdef inline tuple PyDataType_SHAPE(dtype d):
15528  */
15529   __Pyx_XDECREF(__pyx_r);
15530   __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(3, 748, __pyx_L1_error)
15531   __Pyx_GOTREF(__pyx_t_1);
15532   __pyx_r = __pyx_t_1;
15533   __pyx_t_1 = 0;
15534   goto __pyx_L0;
15535 
15536   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":747
15537  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
15538  *
15539  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
15540  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
15541  *
15542  */
15543 
15544   /* function exit code */
15545   __pyx_L1_error:;
15546   __Pyx_XDECREF(__pyx_t_1);
15547   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
15548   __pyx_r = 0;
15549   __pyx_L0:;
15550   __Pyx_XGIVEREF(__pyx_r);
15551   __Pyx_RefNannyFinishContext();
15552   return __pyx_r;
15553 }
15554 
15555 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":750
15556  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
15557  *
15558  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
15559  *     if PyDataType_HASSUBARRAY(d):
15560  *         return <tuple>d.subarray.shape
15561  */
15562 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)15563 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
15564   PyObject *__pyx_r = NULL;
15565   __Pyx_RefNannyDeclarations
15566   int __pyx_t_1;
15567   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
15568 
15569   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":751
15570  *
15571  * cdef inline tuple PyDataType_SHAPE(dtype d):
15572  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
15573  *         return <tuple>d.subarray.shape
15574  *     else:
15575  */
15576   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
15577   if (__pyx_t_1) {
15578 
15579     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":752
15580  * cdef inline tuple PyDataType_SHAPE(dtype d):
15581  *     if PyDataType_HASSUBARRAY(d):
15582  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
15583  *     else:
15584  *         return ()
15585  */
15586     __Pyx_XDECREF(__pyx_r);
15587     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
15588     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
15589     goto __pyx_L0;
15590 
15591     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":751
15592  *
15593  * cdef inline tuple PyDataType_SHAPE(dtype d):
15594  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
15595  *         return <tuple>d.subarray.shape
15596  *     else:
15597  */
15598   }
15599 
15600   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":754
15601  *         return <tuple>d.subarray.shape
15602  *     else:
15603  *         return ()             # <<<<<<<<<<<<<<
15604  *
15605  *
15606  */
15607   /*else*/ {
15608     __Pyx_XDECREF(__pyx_r);
15609     __Pyx_INCREF(__pyx_empty_tuple);
15610     __pyx_r = __pyx_empty_tuple;
15611     goto __pyx_L0;
15612   }
15613 
15614   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":750
15615  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
15616  *
15617  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
15618  *     if PyDataType_HASSUBARRAY(d):
15619  *         return <tuple>d.subarray.shape
15620  */
15621 
15622   /* function exit code */
15623   __pyx_L0:;
15624   __Pyx_XGIVEREF(__pyx_r);
15625   __Pyx_RefNannyFinishContext();
15626   return __pyx_r;
15627 }
15628 
15629 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":929
15630  *     int _import_umath() except -1
15631  *
15632  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
15633  *     Py_INCREF(base) # important to do this before stealing the reference below!
15634  *     PyArray_SetBaseObject(arr, base)
15635  */
15636 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)15637 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
15638   __Pyx_RefNannyDeclarations
15639   __Pyx_RefNannySetupContext("set_array_base", 0);
15640 
15641   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":930
15642  *
15643  * cdef inline void set_array_base(ndarray arr, object base):
15644  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
15645  *     PyArray_SetBaseObject(arr, base)
15646  *
15647  */
15648   Py_INCREF(__pyx_v_base);
15649 
15650   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":931
15651  * cdef inline void set_array_base(ndarray arr, object base):
15652  *     Py_INCREF(base) # important to do this before stealing the reference below!
15653  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
15654  *
15655  * cdef inline object get_array_base(ndarray arr):
15656  */
15657   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
15658 
15659   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":929
15660  *     int _import_umath() except -1
15661  *
15662  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
15663  *     Py_INCREF(base) # important to do this before stealing the reference below!
15664  *     PyArray_SetBaseObject(arr, base)
15665  */
15666 
15667   /* function exit code */
15668   __Pyx_RefNannyFinishContext();
15669 }
15670 
15671 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":933
15672  *     PyArray_SetBaseObject(arr, base)
15673  *
15674  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
15675  *     base = PyArray_BASE(arr)
15676  *     if base is NULL:
15677  */
15678 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)15679 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
15680   PyObject *__pyx_v_base;
15681   PyObject *__pyx_r = NULL;
15682   __Pyx_RefNannyDeclarations
15683   int __pyx_t_1;
15684   __Pyx_RefNannySetupContext("get_array_base", 0);
15685 
15686   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":934
15687  *
15688  * cdef inline object get_array_base(ndarray arr):
15689  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
15690  *     if base is NULL:
15691  *         return None
15692  */
15693   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
15694 
15695   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":935
15696  * cdef inline object get_array_base(ndarray arr):
15697  *     base = PyArray_BASE(arr)
15698  *     if base is NULL:             # <<<<<<<<<<<<<<
15699  *         return None
15700  *     return <object>base
15701  */
15702   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
15703   if (__pyx_t_1) {
15704 
15705     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":936
15706  *     base = PyArray_BASE(arr)
15707  *     if base is NULL:
15708  *         return None             # <<<<<<<<<<<<<<
15709  *     return <object>base
15710  *
15711  */
15712     __Pyx_XDECREF(__pyx_r);
15713     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15714     goto __pyx_L0;
15715 
15716     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":935
15717  * cdef inline object get_array_base(ndarray arr):
15718  *     base = PyArray_BASE(arr)
15719  *     if base is NULL:             # <<<<<<<<<<<<<<
15720  *         return None
15721  *     return <object>base
15722  */
15723   }
15724 
15725   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":937
15726  *     if base is NULL:
15727  *         return None
15728  *     return <object>base             # <<<<<<<<<<<<<<
15729  *
15730  * # Versions of the import_* functions which are more suitable for
15731  */
15732   __Pyx_XDECREF(__pyx_r);
15733   __Pyx_INCREF(((PyObject *)__pyx_v_base));
15734   __pyx_r = ((PyObject *)__pyx_v_base);
15735   goto __pyx_L0;
15736 
15737   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":933
15738  *     PyArray_SetBaseObject(arr, base)
15739  *
15740  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
15741  *     base = PyArray_BASE(arr)
15742  *     if base is NULL:
15743  */
15744 
15745   /* function exit code */
15746   __pyx_L0:;
15747   __Pyx_XGIVEREF(__pyx_r);
15748   __Pyx_RefNannyFinishContext();
15749   return __pyx_r;
15750 }
15751 
15752 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":941
15753  * # Versions of the import_* functions which are more suitable for
15754  * # Cython code.
15755  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
15756  *     try:
15757  *         __pyx_import_array()
15758  */
15759 
__pyx_f_5numpy_import_array(void)15760 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
15761   int __pyx_r;
15762   __Pyx_RefNannyDeclarations
15763   PyObject *__pyx_t_1 = NULL;
15764   PyObject *__pyx_t_2 = NULL;
15765   PyObject *__pyx_t_3 = NULL;
15766   int __pyx_t_4;
15767   PyObject *__pyx_t_5 = NULL;
15768   PyObject *__pyx_t_6 = NULL;
15769   PyObject *__pyx_t_7 = NULL;
15770   PyObject *__pyx_t_8 = NULL;
15771   int __pyx_lineno = 0;
15772   const char *__pyx_filename = NULL;
15773   int __pyx_clineno = 0;
15774   __Pyx_RefNannySetupContext("import_array", 0);
15775 
15776   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":942
15777  * # Cython code.
15778  * cdef inline int import_array() except -1:
15779  *     try:             # <<<<<<<<<<<<<<
15780  *         __pyx_import_array()
15781  *     except Exception:
15782  */
15783   {
15784     __Pyx_PyThreadState_declare
15785     __Pyx_PyThreadState_assign
15786     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
15787     __Pyx_XGOTREF(__pyx_t_1);
15788     __Pyx_XGOTREF(__pyx_t_2);
15789     __Pyx_XGOTREF(__pyx_t_3);
15790     /*try:*/ {
15791 
15792       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":943
15793  * cdef inline int import_array() except -1:
15794  *     try:
15795  *         __pyx_import_array()             # <<<<<<<<<<<<<<
15796  *     except Exception:
15797  *         raise ImportError("numpy.core.multiarray failed to import")
15798  */
15799       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 943, __pyx_L3_error)
15800 
15801       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":942
15802  * # Cython code.
15803  * cdef inline int import_array() except -1:
15804  *     try:             # <<<<<<<<<<<<<<
15805  *         __pyx_import_array()
15806  *     except Exception:
15807  */
15808     }
15809     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
15810     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15811     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15812     goto __pyx_L8_try_end;
15813     __pyx_L3_error:;
15814 
15815     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":944
15816  *     try:
15817  *         __pyx_import_array()
15818  *     except Exception:             # <<<<<<<<<<<<<<
15819  *         raise ImportError("numpy.core.multiarray failed to import")
15820  *
15821  */
15822     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
15823     if (__pyx_t_4) {
15824       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
15825       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 944, __pyx_L5_except_error)
15826       __Pyx_GOTREF(__pyx_t_5);
15827       __Pyx_GOTREF(__pyx_t_6);
15828       __Pyx_GOTREF(__pyx_t_7);
15829 
15830       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":945
15831  *         __pyx_import_array()
15832  *     except Exception:
15833  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
15834  *
15835  * cdef inline int import_umath() except -1:
15836  */
15837       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 945, __pyx_L5_except_error)
15838       __Pyx_GOTREF(__pyx_t_8);
15839       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
15840       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15841       __PYX_ERR(3, 945, __pyx_L5_except_error)
15842     }
15843     goto __pyx_L5_except_error;
15844     __pyx_L5_except_error:;
15845 
15846     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":942
15847  * # Cython code.
15848  * cdef inline int import_array() except -1:
15849  *     try:             # <<<<<<<<<<<<<<
15850  *         __pyx_import_array()
15851  *     except Exception:
15852  */
15853     __Pyx_XGIVEREF(__pyx_t_1);
15854     __Pyx_XGIVEREF(__pyx_t_2);
15855     __Pyx_XGIVEREF(__pyx_t_3);
15856     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15857     goto __pyx_L1_error;
15858     __pyx_L8_try_end:;
15859   }
15860 
15861   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":941
15862  * # Versions of the import_* functions which are more suitable for
15863  * # Cython code.
15864  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
15865  *     try:
15866  *         __pyx_import_array()
15867  */
15868 
15869   /* function exit code */
15870   __pyx_r = 0;
15871   goto __pyx_L0;
15872   __pyx_L1_error:;
15873   __Pyx_XDECREF(__pyx_t_5);
15874   __Pyx_XDECREF(__pyx_t_6);
15875   __Pyx_XDECREF(__pyx_t_7);
15876   __Pyx_XDECREF(__pyx_t_8);
15877   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
15878   __pyx_r = -1;
15879   __pyx_L0:;
15880   __Pyx_RefNannyFinishContext();
15881   return __pyx_r;
15882 }
15883 
15884 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":947
15885  *         raise ImportError("numpy.core.multiarray failed to import")
15886  *
15887  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
15888  *     try:
15889  *         _import_umath()
15890  */
15891 
__pyx_f_5numpy_import_umath(void)15892 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
15893   int __pyx_r;
15894   __Pyx_RefNannyDeclarations
15895   PyObject *__pyx_t_1 = NULL;
15896   PyObject *__pyx_t_2 = NULL;
15897   PyObject *__pyx_t_3 = NULL;
15898   int __pyx_t_4;
15899   PyObject *__pyx_t_5 = NULL;
15900   PyObject *__pyx_t_6 = NULL;
15901   PyObject *__pyx_t_7 = NULL;
15902   PyObject *__pyx_t_8 = NULL;
15903   int __pyx_lineno = 0;
15904   const char *__pyx_filename = NULL;
15905   int __pyx_clineno = 0;
15906   __Pyx_RefNannySetupContext("import_umath", 0);
15907 
15908   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":948
15909  *
15910  * cdef inline int import_umath() except -1:
15911  *     try:             # <<<<<<<<<<<<<<
15912  *         _import_umath()
15913  *     except Exception:
15914  */
15915   {
15916     __Pyx_PyThreadState_declare
15917     __Pyx_PyThreadState_assign
15918     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
15919     __Pyx_XGOTREF(__pyx_t_1);
15920     __Pyx_XGOTREF(__pyx_t_2);
15921     __Pyx_XGOTREF(__pyx_t_3);
15922     /*try:*/ {
15923 
15924       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":949
15925  * cdef inline int import_umath() except -1:
15926  *     try:
15927  *         _import_umath()             # <<<<<<<<<<<<<<
15928  *     except Exception:
15929  *         raise ImportError("numpy.core.umath failed to import")
15930  */
15931       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 949, __pyx_L3_error)
15932 
15933       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":948
15934  *
15935  * cdef inline int import_umath() except -1:
15936  *     try:             # <<<<<<<<<<<<<<
15937  *         _import_umath()
15938  *     except Exception:
15939  */
15940     }
15941     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
15942     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15943     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15944     goto __pyx_L8_try_end;
15945     __pyx_L3_error:;
15946 
15947     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":950
15948  *     try:
15949  *         _import_umath()
15950  *     except Exception:             # <<<<<<<<<<<<<<
15951  *         raise ImportError("numpy.core.umath failed to import")
15952  *
15953  */
15954     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
15955     if (__pyx_t_4) {
15956       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
15957       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 950, __pyx_L5_except_error)
15958       __Pyx_GOTREF(__pyx_t_5);
15959       __Pyx_GOTREF(__pyx_t_6);
15960       __Pyx_GOTREF(__pyx_t_7);
15961 
15962       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":951
15963  *         _import_umath()
15964  *     except Exception:
15965  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
15966  *
15967  * cdef inline int import_ufunc() except -1:
15968  */
15969       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 951, __pyx_L5_except_error)
15970       __Pyx_GOTREF(__pyx_t_8);
15971       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
15972       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15973       __PYX_ERR(3, 951, __pyx_L5_except_error)
15974     }
15975     goto __pyx_L5_except_error;
15976     __pyx_L5_except_error:;
15977 
15978     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":948
15979  *
15980  * cdef inline int import_umath() except -1:
15981  *     try:             # <<<<<<<<<<<<<<
15982  *         _import_umath()
15983  *     except Exception:
15984  */
15985     __Pyx_XGIVEREF(__pyx_t_1);
15986     __Pyx_XGIVEREF(__pyx_t_2);
15987     __Pyx_XGIVEREF(__pyx_t_3);
15988     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15989     goto __pyx_L1_error;
15990     __pyx_L8_try_end:;
15991   }
15992 
15993   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":947
15994  *         raise ImportError("numpy.core.multiarray failed to import")
15995  *
15996  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
15997  *     try:
15998  *         _import_umath()
15999  */
16000 
16001   /* function exit code */
16002   __pyx_r = 0;
16003   goto __pyx_L0;
16004   __pyx_L1_error:;
16005   __Pyx_XDECREF(__pyx_t_5);
16006   __Pyx_XDECREF(__pyx_t_6);
16007   __Pyx_XDECREF(__pyx_t_7);
16008   __Pyx_XDECREF(__pyx_t_8);
16009   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
16010   __pyx_r = -1;
16011   __pyx_L0:;
16012   __Pyx_RefNannyFinishContext();
16013   return __pyx_r;
16014 }
16015 
16016 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":953
16017  *         raise ImportError("numpy.core.umath failed to import")
16018  *
16019  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
16020  *     try:
16021  *         _import_umath()
16022  */
16023 
__pyx_f_5numpy_import_ufunc(void)16024 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
16025   int __pyx_r;
16026   __Pyx_RefNannyDeclarations
16027   PyObject *__pyx_t_1 = NULL;
16028   PyObject *__pyx_t_2 = NULL;
16029   PyObject *__pyx_t_3 = NULL;
16030   int __pyx_t_4;
16031   PyObject *__pyx_t_5 = NULL;
16032   PyObject *__pyx_t_6 = NULL;
16033   PyObject *__pyx_t_7 = NULL;
16034   PyObject *__pyx_t_8 = NULL;
16035   int __pyx_lineno = 0;
16036   const char *__pyx_filename = NULL;
16037   int __pyx_clineno = 0;
16038   __Pyx_RefNannySetupContext("import_ufunc", 0);
16039 
16040   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":954
16041  *
16042  * cdef inline int import_ufunc() except -1:
16043  *     try:             # <<<<<<<<<<<<<<
16044  *         _import_umath()
16045  *     except Exception:
16046  */
16047   {
16048     __Pyx_PyThreadState_declare
16049     __Pyx_PyThreadState_assign
16050     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
16051     __Pyx_XGOTREF(__pyx_t_1);
16052     __Pyx_XGOTREF(__pyx_t_2);
16053     __Pyx_XGOTREF(__pyx_t_3);
16054     /*try:*/ {
16055 
16056       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":955
16057  * cdef inline int import_ufunc() except -1:
16058  *     try:
16059  *         _import_umath()             # <<<<<<<<<<<<<<
16060  *     except Exception:
16061  *         raise ImportError("numpy.core.umath failed to import")
16062  */
16063       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 955, __pyx_L3_error)
16064 
16065       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":954
16066  *
16067  * cdef inline int import_ufunc() except -1:
16068  *     try:             # <<<<<<<<<<<<<<
16069  *         _import_umath()
16070  *     except Exception:
16071  */
16072     }
16073     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16074     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16075     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16076     goto __pyx_L8_try_end;
16077     __pyx_L3_error:;
16078 
16079     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":956
16080  *     try:
16081  *         _import_umath()
16082  *     except Exception:             # <<<<<<<<<<<<<<
16083  *         raise ImportError("numpy.core.umath failed to import")
16084  *
16085  */
16086     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
16087     if (__pyx_t_4) {
16088       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
16089       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 956, __pyx_L5_except_error)
16090       __Pyx_GOTREF(__pyx_t_5);
16091       __Pyx_GOTREF(__pyx_t_6);
16092       __Pyx_GOTREF(__pyx_t_7);
16093 
16094       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":957
16095  *         _import_umath()
16096  *     except Exception:
16097  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
16098  *
16099  * cdef extern from *:
16100  */
16101       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 957, __pyx_L5_except_error)
16102       __Pyx_GOTREF(__pyx_t_8);
16103       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
16104       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16105       __PYX_ERR(3, 957, __pyx_L5_except_error)
16106     }
16107     goto __pyx_L5_except_error;
16108     __pyx_L5_except_error:;
16109 
16110     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":954
16111  *
16112  * cdef inline int import_ufunc() except -1:
16113  *     try:             # <<<<<<<<<<<<<<
16114  *         _import_umath()
16115  *     except Exception:
16116  */
16117     __Pyx_XGIVEREF(__pyx_t_1);
16118     __Pyx_XGIVEREF(__pyx_t_2);
16119     __Pyx_XGIVEREF(__pyx_t_3);
16120     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
16121     goto __pyx_L1_error;
16122     __pyx_L8_try_end:;
16123   }
16124 
16125   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":953
16126  *         raise ImportError("numpy.core.umath failed to import")
16127  *
16128  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
16129  *     try:
16130  *         _import_umath()
16131  */
16132 
16133   /* function exit code */
16134   __pyx_r = 0;
16135   goto __pyx_L0;
16136   __pyx_L1_error:;
16137   __Pyx_XDECREF(__pyx_t_5);
16138   __Pyx_XDECREF(__pyx_t_6);
16139   __Pyx_XDECREF(__pyx_t_7);
16140   __Pyx_XDECREF(__pyx_t_8);
16141   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
16142   __pyx_r = -1;
16143   __pyx_L0:;
16144   __Pyx_RefNannyFinishContext();
16145   return __pyx_r;
16146 }
16147 
16148 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":967
16149  *
16150  *
16151  * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
16152  *     """
16153  *     Cython equivalent of `isinstance(obj, np.timedelta64)`
16154  */
16155 
__pyx_f_5numpy_is_timedelta64_object(PyObject * __pyx_v_obj)16156 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
16157   int __pyx_r;
16158   __Pyx_RefNannyDeclarations
16159   __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
16160 
16161   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":979
16162  *     bool
16163  *     """
16164  *     return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type)             # <<<<<<<<<<<<<<
16165  *
16166  *
16167  */
16168   __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
16169   goto __pyx_L0;
16170 
16171   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":967
16172  *
16173  *
16174  * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
16175  *     """
16176  *     Cython equivalent of `isinstance(obj, np.timedelta64)`
16177  */
16178 
16179   /* function exit code */
16180   __pyx_L0:;
16181   __Pyx_RefNannyFinishContext();
16182   return __pyx_r;
16183 }
16184 
16185 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":982
16186  *
16187  *
16188  * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
16189  *     """
16190  *     Cython equivalent of `isinstance(obj, np.datetime64)`
16191  */
16192 
__pyx_f_5numpy_is_datetime64_object(PyObject * __pyx_v_obj)16193 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
16194   int __pyx_r;
16195   __Pyx_RefNannyDeclarations
16196   __Pyx_RefNannySetupContext("is_datetime64_object", 0);
16197 
16198   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":994
16199  *     bool
16200  *     """
16201  *     return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type)             # <<<<<<<<<<<<<<
16202  *
16203  *
16204  */
16205   __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
16206   goto __pyx_L0;
16207 
16208   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":982
16209  *
16210  *
16211  * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
16212  *     """
16213  *     Cython equivalent of `isinstance(obj, np.datetime64)`
16214  */
16215 
16216   /* function exit code */
16217   __pyx_L0:;
16218   __Pyx_RefNannyFinishContext();
16219   return __pyx_r;
16220 }
16221 
16222 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":997
16223  *
16224  *
16225  * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
16226  *     """
16227  *     returns the int64 value underlying scalar numpy datetime64 object
16228  */
16229 
__pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_v_obj)16230 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
16231   npy_datetime __pyx_r;
16232 
16233   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1004
16234  *     also needed.  That can be found using `get_datetime64_unit`.
16235  *     """
16236  *     return (<PyDatetimeScalarObject*>obj).obval             # <<<<<<<<<<<<<<
16237  *
16238  *
16239  */
16240   __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
16241   goto __pyx_L0;
16242 
16243   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":997
16244  *
16245  *
16246  * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
16247  *     """
16248  *     returns the int64 value underlying scalar numpy datetime64 object
16249  */
16250 
16251   /* function exit code */
16252   __pyx_L0:;
16253   return __pyx_r;
16254 }
16255 
16256 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1007
16257  *
16258  *
16259  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
16260  *     """
16261  *     returns the int64 value underlying scalar numpy timedelta64 object
16262  */
16263 
__pyx_f_5numpy_get_timedelta64_value(PyObject * __pyx_v_obj)16264 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
16265   npy_timedelta __pyx_r;
16266 
16267   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1011
16268  *     returns the int64 value underlying scalar numpy timedelta64 object
16269  *     """
16270  *     return (<PyTimedeltaScalarObject*>obj).obval             # <<<<<<<<<<<<<<
16271  *
16272  *
16273  */
16274   __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
16275   goto __pyx_L0;
16276 
16277   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1007
16278  *
16279  *
16280  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
16281  *     """
16282  *     returns the int64 value underlying scalar numpy timedelta64 object
16283  */
16284 
16285   /* function exit code */
16286   __pyx_L0:;
16287   return __pyx_r;
16288 }
16289 
16290 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1014
16291  *
16292  *
16293  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
16294  *     """
16295  *     returns the unit part of the dtype for a numpy datetime64 object.
16296  */
16297 
__pyx_f_5numpy_get_datetime64_unit(PyObject * __pyx_v_obj)16298 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
16299   NPY_DATETIMEUNIT __pyx_r;
16300 
16301   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1018
16302  *     returns the unit part of the dtype for a numpy datetime64 object.
16303  *     """
16304  *     return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base             # <<<<<<<<<<<<<<
16305  */
16306   __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
16307   goto __pyx_L0;
16308 
16309   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1014
16310  *
16311  *
16312  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
16313  *     """
16314  *     returns the unit part of the dtype for a numpy datetime64 object.
16315  */
16316 
16317   /* function exit code */
16318   __pyx_L0:;
16319   return __pyx_r;
16320 }
16321 
__pyx_tp_new_2bx_3bbi_8bbi_file_SummaryBlock(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)16322 static PyObject *__pyx_tp_new_2bx_3bbi_8bbi_file_SummaryBlock(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
16323   PyObject *o;
16324   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
16325     o = (*t->tp_alloc)(t, 0);
16326   } else {
16327     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
16328   }
16329   if (unlikely(!o)) return 0;
16330   return o;
16331 }
16332 
__pyx_tp_dealloc_2bx_3bbi_8bbi_file_SummaryBlock(PyObject * o)16333 static void __pyx_tp_dealloc_2bx_3bbi_8bbi_file_SummaryBlock(PyObject *o) {
16334   #if CYTHON_USE_TP_FINALIZE
16335   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))) {
16336     if (PyObject_CallFinalizerFromDealloc(o)) return;
16337   }
16338   #endif
16339   (*Py_TYPE(o)->tp_free)(o);
16340 }
16341 
__pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_chrom_id(PyObject * o,CYTHON_UNUSED void * x)16342 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_chrom_id(PyObject *o, CYTHON_UNUSED void *x) {
16343   return __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_8chrom_id_1__get__(o);
16344 }
16345 
__pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_chrom_id(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16346 static int __pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_chrom_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16347   if (v) {
16348     return __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_8chrom_id_3__set__(o, v);
16349   }
16350   else {
16351     PyErr_SetString(PyExc_NotImplementedError, "__del__");
16352     return -1;
16353   }
16354 }
16355 
__pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_start(PyObject * o,CYTHON_UNUSED void * x)16356 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_start(PyObject *o, CYTHON_UNUSED void *x) {
16357   return __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_5start_1__get__(o);
16358 }
16359 
__pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_start(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16360 static int __pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_start(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16361   if (v) {
16362     return __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_5start_3__set__(o, v);
16363   }
16364   else {
16365     PyErr_SetString(PyExc_NotImplementedError, "__del__");
16366     return -1;
16367   }
16368 }
16369 
__pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_end(PyObject * o,CYTHON_UNUSED void * x)16370 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_end(PyObject *o, CYTHON_UNUSED void *x) {
16371   return __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_3end_1__get__(o);
16372 }
16373 
__pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_end(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16374 static int __pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_end(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16375   if (v) {
16376     return __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_3end_3__set__(o, v);
16377   }
16378   else {
16379     PyErr_SetString(PyExc_NotImplementedError, "__del__");
16380     return -1;
16381   }
16382 }
16383 
__pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_valid_count(PyObject * o,CYTHON_UNUSED void * x)16384 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_valid_count(PyObject *o, CYTHON_UNUSED void *x) {
16385   return __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_11valid_count_1__get__(o);
16386 }
16387 
__pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_valid_count(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16388 static int __pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_valid_count(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16389   if (v) {
16390     return __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_11valid_count_3__set__(o, v);
16391   }
16392   else {
16393     PyErr_SetString(PyExc_NotImplementedError, "__del__");
16394     return -1;
16395   }
16396 }
16397 
__pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_min_val(PyObject * o,CYTHON_UNUSED void * x)16398 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_min_val(PyObject *o, CYTHON_UNUSED void *x) {
16399   return __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_7min_val_1__get__(o);
16400 }
16401 
__pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_min_val(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16402 static int __pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_min_val(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16403   if (v) {
16404     return __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_7min_val_3__set__(o, v);
16405   }
16406   else {
16407     PyErr_SetString(PyExc_NotImplementedError, "__del__");
16408     return -1;
16409   }
16410 }
16411 
__pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_max_val(PyObject * o,CYTHON_UNUSED void * x)16412 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_max_val(PyObject *o, CYTHON_UNUSED void *x) {
16413   return __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_7max_val_1__get__(o);
16414 }
16415 
__pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_max_val(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16416 static int __pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_max_val(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16417   if (v) {
16418     return __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_7max_val_3__set__(o, v);
16419   }
16420   else {
16421     PyErr_SetString(PyExc_NotImplementedError, "__del__");
16422     return -1;
16423   }
16424 }
16425 
__pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_sum_data(PyObject * o,CYTHON_UNUSED void * x)16426 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_sum_data(PyObject *o, CYTHON_UNUSED void *x) {
16427   return __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_8sum_data_1__get__(o);
16428 }
16429 
__pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_sum_data(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16430 static int __pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_sum_data(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16431   if (v) {
16432     return __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_8sum_data_3__set__(o, v);
16433   }
16434   else {
16435     PyErr_SetString(PyExc_NotImplementedError, "__del__");
16436     return -1;
16437   }
16438 }
16439 
__pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_sum_squares(PyObject * o,CYTHON_UNUSED void * x)16440 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_sum_squares(PyObject *o, CYTHON_UNUSED void *x) {
16441   return __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_11sum_squares_1__get__(o);
16442 }
16443 
__pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_sum_squares(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16444 static int __pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_sum_squares(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16445   if (v) {
16446     return __pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_11sum_squares_3__set__(o, v);
16447   }
16448   else {
16449     PyErr_SetString(PyExc_NotImplementedError, "__del__");
16450     return -1;
16451   }
16452 }
16453 
16454 static PyMethodDef __pyx_methods_2bx_3bbi_8bbi_file_SummaryBlock[] = {
16455   {"__reduce_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_1__reduce_cython__, METH_NOARGS, 0},
16456   {"__setstate_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_8bbi_file_12SummaryBlock_3__setstate_cython__, METH_O, 0},
16457   {0, 0, 0, 0}
16458 };
16459 
16460 static struct PyGetSetDef __pyx_getsets_2bx_3bbi_8bbi_file_SummaryBlock[] = {
16461   {(char *)"chrom_id", __pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_chrom_id, __pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_chrom_id, (char *)0, 0},
16462   {(char *)"start", __pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_start, __pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_start, (char *)0, 0},
16463   {(char *)"end", __pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_end, __pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_end, (char *)0, 0},
16464   {(char *)"valid_count", __pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_valid_count, __pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_valid_count, (char *)0, 0},
16465   {(char *)"min_val", __pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_min_val, __pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_min_val, (char *)0, 0},
16466   {(char *)"max_val", __pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_max_val, __pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_max_val, (char *)0, 0},
16467   {(char *)"sum_data", __pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_sum_data, __pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_sum_data, (char *)0, 0},
16468   {(char *)"sum_squares", __pyx_getprop_2bx_3bbi_8bbi_file_12SummaryBlock_sum_squares, __pyx_setprop_2bx_3bbi_8bbi_file_12SummaryBlock_sum_squares, (char *)0, 0},
16469   {0, 0, 0, 0, 0}
16470 };
16471 
16472 static PyTypeObject __pyx_type_2bx_3bbi_8bbi_file_SummaryBlock = {
16473   PyVarObject_HEAD_INIT(0, 0)
16474   "bx.bbi.bbi_file.SummaryBlock", /*tp_name*/
16475   sizeof(struct __pyx_obj_2bx_3bbi_8bbi_file_SummaryBlock), /*tp_basicsize*/
16476   0, /*tp_itemsize*/
16477   __pyx_tp_dealloc_2bx_3bbi_8bbi_file_SummaryBlock, /*tp_dealloc*/
16478   #if PY_VERSION_HEX < 0x030800b4
16479   0, /*tp_print*/
16480   #endif
16481   #if PY_VERSION_HEX >= 0x030800b4
16482   0, /*tp_vectorcall_offset*/
16483   #endif
16484   0, /*tp_getattr*/
16485   0, /*tp_setattr*/
16486   #if PY_MAJOR_VERSION < 3
16487   0, /*tp_compare*/
16488   #endif
16489   #if PY_MAJOR_VERSION >= 3
16490   0, /*tp_as_async*/
16491   #endif
16492   0, /*tp_repr*/
16493   0, /*tp_as_number*/
16494   0, /*tp_as_sequence*/
16495   0, /*tp_as_mapping*/
16496   0, /*tp_hash*/
16497   0, /*tp_call*/
16498   0, /*tp_str*/
16499   0, /*tp_getattro*/
16500   0, /*tp_setattro*/
16501   0, /*tp_as_buffer*/
16502   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
16503   "\n    A block of summary data from disk\n    ", /*tp_doc*/
16504   0, /*tp_traverse*/
16505   0, /*tp_clear*/
16506   0, /*tp_richcompare*/
16507   0, /*tp_weaklistoffset*/
16508   0, /*tp_iter*/
16509   0, /*tp_iternext*/
16510   __pyx_methods_2bx_3bbi_8bbi_file_SummaryBlock, /*tp_methods*/
16511   0, /*tp_members*/
16512   __pyx_getsets_2bx_3bbi_8bbi_file_SummaryBlock, /*tp_getset*/
16513   0, /*tp_base*/
16514   0, /*tp_dict*/
16515   0, /*tp_descr_get*/
16516   0, /*tp_descr_set*/
16517   0, /*tp_dictoffset*/
16518   0, /*tp_init*/
16519   0, /*tp_alloc*/
16520   __pyx_tp_new_2bx_3bbi_8bbi_file_SummaryBlock, /*tp_new*/
16521   0, /*tp_free*/
16522   0, /*tp_is_gc*/
16523   0, /*tp_bases*/
16524   0, /*tp_mro*/
16525   0, /*tp_cache*/
16526   0, /*tp_subclasses*/
16527   0, /*tp_weaklist*/
16528   0, /*tp_del*/
16529   0, /*tp_version_tag*/
16530   #if PY_VERSION_HEX >= 0x030400a1
16531   0, /*tp_finalize*/
16532   #endif
16533   #if PY_VERSION_HEX >= 0x030800b1
16534   0, /*tp_vectorcall*/
16535   #endif
16536   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
16537   0, /*tp_print*/
16538   #endif
16539   #if PY_VERSION_HEX >= 0x030B00A2
16540   0, /*tp_inline_values_offset*/
16541   #endif
16542 };
16543 static struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_SummarizedData __pyx_vtable_2bx_3bbi_8bbi_file_SummarizedData;
16544 
__pyx_tp_new_2bx_3bbi_8bbi_file_SummarizedData(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)16545 static PyObject *__pyx_tp_new_2bx_3bbi_8bbi_file_SummarizedData(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
16546   struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *p;
16547   PyObject *o;
16548   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
16549     o = (*t->tp_alloc)(t, 0);
16550   } else {
16551     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
16552   }
16553   if (unlikely(!o)) return 0;
16554   p = ((struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)o);
16555   p->__pyx_vtab = __pyx_vtabptr_2bx_3bbi_8bbi_file_SummarizedData;
16556   p->valid_count = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
16557   p->min_val = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
16558   p->max_val = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
16559   p->sum_data = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
16560   p->sum_squares = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
16561   return o;
16562 }
16563 
__pyx_tp_dealloc_2bx_3bbi_8bbi_file_SummarizedData(PyObject * o)16564 static void __pyx_tp_dealloc_2bx_3bbi_8bbi_file_SummarizedData(PyObject *o) {
16565   struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *p = (struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)o;
16566   #if CYTHON_USE_TP_FINALIZE
16567   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
16568     if (PyObject_CallFinalizerFromDealloc(o)) return;
16569   }
16570   #endif
16571   PyObject_GC_UnTrack(o);
16572   Py_CLEAR(p->valid_count);
16573   Py_CLEAR(p->min_val);
16574   Py_CLEAR(p->max_val);
16575   Py_CLEAR(p->sum_data);
16576   Py_CLEAR(p->sum_squares);
16577   (*Py_TYPE(o)->tp_free)(o);
16578 }
16579 
__pyx_tp_traverse_2bx_3bbi_8bbi_file_SummarizedData(PyObject * o,visitproc v,void * a)16580 static int __pyx_tp_traverse_2bx_3bbi_8bbi_file_SummarizedData(PyObject *o, visitproc v, void *a) {
16581   int e;
16582   struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *p = (struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)o;
16583   if (p->valid_count) {
16584     e = (*v)(((PyObject *)p->valid_count), a); if (e) return e;
16585   }
16586   if (p->min_val) {
16587     e = (*v)(((PyObject *)p->min_val), a); if (e) return e;
16588   }
16589   if (p->max_val) {
16590     e = (*v)(((PyObject *)p->max_val), a); if (e) return e;
16591   }
16592   if (p->sum_data) {
16593     e = (*v)(((PyObject *)p->sum_data), a); if (e) return e;
16594   }
16595   if (p->sum_squares) {
16596     e = (*v)(((PyObject *)p->sum_squares), a); if (e) return e;
16597   }
16598   return 0;
16599 }
16600 
__pyx_tp_clear_2bx_3bbi_8bbi_file_SummarizedData(PyObject * o)16601 static int __pyx_tp_clear_2bx_3bbi_8bbi_file_SummarizedData(PyObject *o) {
16602   PyObject* tmp;
16603   struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *p = (struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *)o;
16604   tmp = ((PyObject*)p->valid_count);
16605   p->valid_count = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
16606   Py_XDECREF(tmp);
16607   tmp = ((PyObject*)p->min_val);
16608   p->min_val = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
16609   Py_XDECREF(tmp);
16610   tmp = ((PyObject*)p->max_val);
16611   p->max_val = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
16612   Py_XDECREF(tmp);
16613   tmp = ((PyObject*)p->sum_data);
16614   p->sum_data = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
16615   Py_XDECREF(tmp);
16616   tmp = ((PyObject*)p->sum_squares);
16617   p->sum_squares = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
16618   Py_XDECREF(tmp);
16619   return 0;
16620 }
16621 
__pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_start(PyObject * o,CYTHON_UNUSED void * x)16622 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_start(PyObject *o, CYTHON_UNUSED void *x) {
16623   return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_5start_1__get__(o);
16624 }
16625 
__pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_start(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16626 static int __pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_start(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16627   if (v) {
16628     return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_5start_3__set__(o, v);
16629   }
16630   else {
16631     PyErr_SetString(PyExc_NotImplementedError, "__del__");
16632     return -1;
16633   }
16634 }
16635 
__pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_end(PyObject * o,CYTHON_UNUSED void * x)16636 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_end(PyObject *o, CYTHON_UNUSED void *x) {
16637   return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_3end_1__get__(o);
16638 }
16639 
__pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_end(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16640 static int __pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_end(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16641   if (v) {
16642     return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_3end_3__set__(o, v);
16643   }
16644   else {
16645     PyErr_SetString(PyExc_NotImplementedError, "__del__");
16646     return -1;
16647   }
16648 }
16649 
__pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_size(PyObject * o,CYTHON_UNUSED void * x)16650 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_size(PyObject *o, CYTHON_UNUSED void *x) {
16651   return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_4size_1__get__(o);
16652 }
16653 
__pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_size(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16654 static int __pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16655   if (v) {
16656     return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_4size_3__set__(o, v);
16657   }
16658   else {
16659     PyErr_SetString(PyExc_NotImplementedError, "__del__");
16660     return -1;
16661   }
16662 }
16663 
__pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_valid_count(PyObject * o,CYTHON_UNUSED void * x)16664 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_valid_count(PyObject *o, CYTHON_UNUSED void *x) {
16665   return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_1__get__(o);
16666 }
16667 
__pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_valid_count(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16668 static int __pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_valid_count(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16669   if (v) {
16670     return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_3__set__(o, v);
16671   }
16672   else {
16673     return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11valid_count_5__del__(o);
16674   }
16675 }
16676 
__pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_min_val(PyObject * o,CYTHON_UNUSED void * x)16677 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_min_val(PyObject *o, CYTHON_UNUSED void *x) {
16678   return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_1__get__(o);
16679 }
16680 
__pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_min_val(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16681 static int __pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_min_val(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16682   if (v) {
16683     return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_3__set__(o, v);
16684   }
16685   else {
16686     return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7min_val_5__del__(o);
16687   }
16688 }
16689 
__pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_max_val(PyObject * o,CYTHON_UNUSED void * x)16690 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_max_val(PyObject *o, CYTHON_UNUSED void *x) {
16691   return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_1__get__(o);
16692 }
16693 
__pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_max_val(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16694 static int __pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_max_val(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16695   if (v) {
16696     return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_3__set__(o, v);
16697   }
16698   else {
16699     return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_7max_val_5__del__(o);
16700   }
16701 }
16702 
__pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_sum_data(PyObject * o,CYTHON_UNUSED void * x)16703 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_sum_data(PyObject *o, CYTHON_UNUSED void *x) {
16704   return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_1__get__(o);
16705 }
16706 
__pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_sum_data(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16707 static int __pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_sum_data(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16708   if (v) {
16709     return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_3__set__(o, v);
16710   }
16711   else {
16712     return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_8sum_data_5__del__(o);
16713   }
16714 }
16715 
__pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_sum_squares(PyObject * o,CYTHON_UNUSED void * x)16716 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_sum_squares(PyObject *o, CYTHON_UNUSED void *x) {
16717   return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_1__get__(o);
16718 }
16719 
__pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_sum_squares(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16720 static int __pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_sum_squares(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16721   if (v) {
16722     return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_3__set__(o, v);
16723   }
16724   else {
16725     return __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_11sum_squares_5__del__(o);
16726   }
16727 }
16728 
16729 static PyMethodDef __pyx_methods_2bx_3bbi_8bbi_file_SummarizedData[] = {
16730   {"__reduce_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_3__reduce_cython__, METH_NOARGS, 0},
16731   {"__setstate_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_5__setstate_cython__, METH_O, 0},
16732   {0, 0, 0, 0}
16733 };
16734 
16735 static struct PyGetSetDef __pyx_getsets_2bx_3bbi_8bbi_file_SummarizedData[] = {
16736   {(char *)"start", __pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_start, __pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_start, (char *)0, 0},
16737   {(char *)"end", __pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_end, __pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_end, (char *)0, 0},
16738   {(char *)"size", __pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_size, __pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_size, (char *)0, 0},
16739   {(char *)"valid_count", __pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_valid_count, __pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_valid_count, (char *)0, 0},
16740   {(char *)"min_val", __pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_min_val, __pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_min_val, (char *)0, 0},
16741   {(char *)"max_val", __pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_max_val, __pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_max_val, (char *)0, 0},
16742   {(char *)"sum_data", __pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_sum_data, __pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_sum_data, (char *)0, 0},
16743   {(char *)"sum_squares", __pyx_getprop_2bx_3bbi_8bbi_file_14SummarizedData_sum_squares, __pyx_setprop_2bx_3bbi_8bbi_file_14SummarizedData_sum_squares, (char *)0, 0},
16744   {0, 0, 0, 0, 0}
16745 };
16746 
16747 static PyTypeObject __pyx_type_2bx_3bbi_8bbi_file_SummarizedData = {
16748   PyVarObject_HEAD_INIT(0, 0)
16749   "bx.bbi.bbi_file.SummarizedData", /*tp_name*/
16750   sizeof(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData), /*tp_basicsize*/
16751   0, /*tp_itemsize*/
16752   __pyx_tp_dealloc_2bx_3bbi_8bbi_file_SummarizedData, /*tp_dealloc*/
16753   #if PY_VERSION_HEX < 0x030800b4
16754   0, /*tp_print*/
16755   #endif
16756   #if PY_VERSION_HEX >= 0x030800b4
16757   0, /*tp_vectorcall_offset*/
16758   #endif
16759   0, /*tp_getattr*/
16760   0, /*tp_setattr*/
16761   #if PY_MAJOR_VERSION < 3
16762   0, /*tp_compare*/
16763   #endif
16764   #if PY_MAJOR_VERSION >= 3
16765   0, /*tp_as_async*/
16766   #endif
16767   0, /*tp_repr*/
16768   0, /*tp_as_number*/
16769   0, /*tp_as_sequence*/
16770   0, /*tp_as_mapping*/
16771   0, /*tp_hash*/
16772   0, /*tp_call*/
16773   0, /*tp_str*/
16774   0, /*tp_getattro*/
16775   0, /*tp_setattro*/
16776   0, /*tp_as_buffer*/
16777   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
16778   "\n    The result of using SummaryBlocks read from the file to produce a \n    aggregation over a particular range and resolution\n    ", /*tp_doc*/
16779   __pyx_tp_traverse_2bx_3bbi_8bbi_file_SummarizedData, /*tp_traverse*/
16780   __pyx_tp_clear_2bx_3bbi_8bbi_file_SummarizedData, /*tp_clear*/
16781   0, /*tp_richcompare*/
16782   0, /*tp_weaklistoffset*/
16783   0, /*tp_iter*/
16784   0, /*tp_iternext*/
16785   __pyx_methods_2bx_3bbi_8bbi_file_SummarizedData, /*tp_methods*/
16786   0, /*tp_members*/
16787   __pyx_getsets_2bx_3bbi_8bbi_file_SummarizedData, /*tp_getset*/
16788   0, /*tp_base*/
16789   0, /*tp_dict*/
16790   0, /*tp_descr_get*/
16791   0, /*tp_descr_set*/
16792   0, /*tp_dictoffset*/
16793   __pyx_pw_2bx_3bbi_8bbi_file_14SummarizedData_1__init__, /*tp_init*/
16794   0, /*tp_alloc*/
16795   __pyx_tp_new_2bx_3bbi_8bbi_file_SummarizedData, /*tp_new*/
16796   0, /*tp_free*/
16797   0, /*tp_is_gc*/
16798   0, /*tp_bases*/
16799   0, /*tp_mro*/
16800   0, /*tp_cache*/
16801   0, /*tp_subclasses*/
16802   0, /*tp_weaklist*/
16803   0, /*tp_del*/
16804   0, /*tp_version_tag*/
16805   #if PY_VERSION_HEX >= 0x030400a1
16806   0, /*tp_finalize*/
16807   #endif
16808   #if PY_VERSION_HEX >= 0x030800b1
16809   0, /*tp_vectorcall*/
16810   #endif
16811   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
16812   0, /*tp_print*/
16813   #endif
16814   #if PY_VERSION_HEX >= 0x030B00A2
16815   0, /*tp_inline_values_offset*/
16816   #endif
16817 };
16818 static struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BBIFile __pyx_vtable_2bx_3bbi_8bbi_file_BBIFile;
16819 
__pyx_tp_new_2bx_3bbi_8bbi_file_BBIFile(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)16820 static PyObject *__pyx_tp_new_2bx_3bbi_8bbi_file_BBIFile(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
16821   struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *p;
16822   PyObject *o;
16823   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
16824     o = (*t->tp_alloc)(t, 0);
16825   } else {
16826     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
16827   }
16828   if (unlikely(!o)) return 0;
16829   p = ((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)o);
16830   p->__pyx_vtab = __pyx_vtabptr_2bx_3bbi_8bbi_file_BBIFile;
16831   p->file = Py_None; Py_INCREF(Py_None);
16832   p->reader = Py_None; Py_INCREF(Py_None);
16833   p->chrom_bpt = ((struct __pyx_obj_2bx_3bbi_8bpt_file_BPTFile *)Py_None); Py_INCREF(Py_None);
16834   p->level_list = Py_None; Py_INCREF(Py_None);
16835   return o;
16836 }
16837 
__pyx_tp_dealloc_2bx_3bbi_8bbi_file_BBIFile(PyObject * o)16838 static void __pyx_tp_dealloc_2bx_3bbi_8bbi_file_BBIFile(PyObject *o) {
16839   struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *p = (struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)o;
16840   #if CYTHON_USE_TP_FINALIZE
16841   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
16842     if (PyObject_CallFinalizerFromDealloc(o)) return;
16843   }
16844   #endif
16845   PyObject_GC_UnTrack(o);
16846   Py_CLEAR(p->file);
16847   Py_CLEAR(p->reader);
16848   Py_CLEAR(p->chrom_bpt);
16849   Py_CLEAR(p->level_list);
16850   (*Py_TYPE(o)->tp_free)(o);
16851 }
16852 
__pyx_tp_traverse_2bx_3bbi_8bbi_file_BBIFile(PyObject * o,visitproc v,void * a)16853 static int __pyx_tp_traverse_2bx_3bbi_8bbi_file_BBIFile(PyObject *o, visitproc v, void *a) {
16854   int e;
16855   struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *p = (struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)o;
16856   if (p->file) {
16857     e = (*v)(p->file, a); if (e) return e;
16858   }
16859   if (p->reader) {
16860     e = (*v)(p->reader, a); if (e) return e;
16861   }
16862   if (p->chrom_bpt) {
16863     e = (*v)(((PyObject *)p->chrom_bpt), a); if (e) return e;
16864   }
16865   if (p->level_list) {
16866     e = (*v)(p->level_list, a); if (e) return e;
16867   }
16868   return 0;
16869 }
16870 
__pyx_tp_clear_2bx_3bbi_8bbi_file_BBIFile(PyObject * o)16871 static int __pyx_tp_clear_2bx_3bbi_8bbi_file_BBIFile(PyObject *o) {
16872   PyObject* tmp;
16873   struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *p = (struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)o;
16874   tmp = ((PyObject*)p->file);
16875   p->file = Py_None; Py_INCREF(Py_None);
16876   Py_XDECREF(tmp);
16877   tmp = ((PyObject*)p->reader);
16878   p->reader = Py_None; Py_INCREF(Py_None);
16879   Py_XDECREF(tmp);
16880   tmp = ((PyObject*)p->chrom_bpt);
16881   p->chrom_bpt = ((struct __pyx_obj_2bx_3bbi_8bpt_file_BPTFile *)Py_None); Py_INCREF(Py_None);
16882   Py_XDECREF(tmp);
16883   tmp = ((PyObject*)p->level_list);
16884   p->level_list = Py_None; Py_INCREF(Py_None);
16885   Py_XDECREF(tmp);
16886   return 0;
16887 }
16888 
__pyx_getprop_2bx_3bbi_8bbi_file_7BBIFile_magic(PyObject * o,CYTHON_UNUSED void * x)16889 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_7BBIFile_magic(PyObject *o, CYTHON_UNUSED void *x) {
16890   return __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_5magic_1__get__(o);
16891 }
16892 
__pyx_setprop_2bx_3bbi_8bbi_file_7BBIFile_magic(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16893 static int __pyx_setprop_2bx_3bbi_8bbi_file_7BBIFile_magic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16894   if (v) {
16895     return __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_5magic_3__set__(o, v);
16896   }
16897   else {
16898     PyErr_SetString(PyExc_NotImplementedError, "__del__");
16899     return -1;
16900   }
16901 }
16902 
__pyx_getprop_2bx_3bbi_8bbi_file_7BBIFile_version(PyObject * o,CYTHON_UNUSED void * x)16903 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_7BBIFile_version(PyObject *o, CYTHON_UNUSED void *x) {
16904   return __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_7version_1__get__(o);
16905 }
16906 
__pyx_setprop_2bx_3bbi_8bbi_file_7BBIFile_version(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16907 static int __pyx_setprop_2bx_3bbi_8bbi_file_7BBIFile_version(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16908   if (v) {
16909     return __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_7version_3__set__(o, v);
16910   }
16911   else {
16912     PyErr_SetString(PyExc_NotImplementedError, "__del__");
16913     return -1;
16914   }
16915 }
16916 
__pyx_getprop_2bx_3bbi_8bbi_file_7BBIFile_zoom_levels(PyObject * o,CYTHON_UNUSED void * x)16917 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_7BBIFile_zoom_levels(PyObject *o, CYTHON_UNUSED void *x) {
16918   return __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_11zoom_levels_1__get__(o);
16919 }
16920 
__pyx_setprop_2bx_3bbi_8bbi_file_7BBIFile_zoom_levels(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16921 static int __pyx_setprop_2bx_3bbi_8bbi_file_7BBIFile_zoom_levels(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16922   if (v) {
16923     return __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_11zoom_levels_3__set__(o, v);
16924   }
16925   else {
16926     PyErr_SetString(PyExc_NotImplementedError, "__del__");
16927     return -1;
16928   }
16929 }
16930 
__pyx_getprop_2bx_3bbi_8bbi_file_7BBIFile_level_list(PyObject * o,CYTHON_UNUSED void * x)16931 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_7BBIFile_level_list(PyObject *o, CYTHON_UNUSED void *x) {
16932   return __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_10level_list_1__get__(o);
16933 }
16934 
__pyx_setprop_2bx_3bbi_8bbi_file_7BBIFile_level_list(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)16935 static int __pyx_setprop_2bx_3bbi_8bbi_file_7BBIFile_level_list(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
16936   if (v) {
16937     return __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_10level_list_3__set__(o, v);
16938   }
16939   else {
16940     return __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_10level_list_5__del__(o);
16941   }
16942 }
16943 
16944 static PyMethodDef __pyx_methods_2bx_3bbi_8bbi_file_BBIFile[] = {
16945   {"open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_3open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2bx_3bbi_8bbi_file_7BBIFile_2open},
16946   {"summarize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_5summarize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2bx_3bbi_8bbi_file_7BBIFile_4summarize},
16947   {"summarize_from_full", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_7summarize_from_full, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2bx_3bbi_8bbi_file_7BBIFile_6summarize_from_full},
16948   {"query", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_9query, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2bx_3bbi_8bbi_file_7BBIFile_8query},
16949   {"__reduce_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_11__reduce_cython__, METH_NOARGS, 0},
16950   {"__setstate_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_13__setstate_cython__, METH_O, 0},
16951   {0, 0, 0, 0}
16952 };
16953 
16954 static struct PyGetSetDef __pyx_getsets_2bx_3bbi_8bbi_file_BBIFile[] = {
16955   {(char *)"magic", __pyx_getprop_2bx_3bbi_8bbi_file_7BBIFile_magic, __pyx_setprop_2bx_3bbi_8bbi_file_7BBIFile_magic, (char *)0, 0},
16956   {(char *)"version", __pyx_getprop_2bx_3bbi_8bbi_file_7BBIFile_version, __pyx_setprop_2bx_3bbi_8bbi_file_7BBIFile_version, (char *)0, 0},
16957   {(char *)"zoom_levels", __pyx_getprop_2bx_3bbi_8bbi_file_7BBIFile_zoom_levels, __pyx_setprop_2bx_3bbi_8bbi_file_7BBIFile_zoom_levels, (char *)0, 0},
16958   {(char *)"level_list", __pyx_getprop_2bx_3bbi_8bbi_file_7BBIFile_level_list, __pyx_setprop_2bx_3bbi_8bbi_file_7BBIFile_level_list, (char *)0, 0},
16959   {0, 0, 0, 0, 0}
16960 };
16961 
16962 static PyTypeObject __pyx_type_2bx_3bbi_8bbi_file_BBIFile = {
16963   PyVarObject_HEAD_INIT(0, 0)
16964   "bx.bbi.bbi_file.BBIFile", /*tp_name*/
16965   sizeof(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile), /*tp_basicsize*/
16966   0, /*tp_itemsize*/
16967   __pyx_tp_dealloc_2bx_3bbi_8bbi_file_BBIFile, /*tp_dealloc*/
16968   #if PY_VERSION_HEX < 0x030800b4
16969   0, /*tp_print*/
16970   #endif
16971   #if PY_VERSION_HEX >= 0x030800b4
16972   0, /*tp_vectorcall_offset*/
16973   #endif
16974   0, /*tp_getattr*/
16975   0, /*tp_setattr*/
16976   #if PY_MAJOR_VERSION < 3
16977   0, /*tp_compare*/
16978   #endif
16979   #if PY_MAJOR_VERSION >= 3
16980   0, /*tp_as_async*/
16981   #endif
16982   0, /*tp_repr*/
16983   0, /*tp_as_number*/
16984   0, /*tp_as_sequence*/
16985   0, /*tp_as_mapping*/
16986   0, /*tp_hash*/
16987   0, /*tp_call*/
16988   0, /*tp_str*/
16989   0, /*tp_getattro*/
16990   0, /*tp_setattro*/
16991   0, /*tp_as_buffer*/
16992   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
16993   "\n    A \"big binary indexed\" file. Stores blocks of raw data and numeric \n    summaries of that data at different levels of aggregation (\"zoom levels\").\n    Generic enough to accommodate both wiggle and bed data. \n    ", /*tp_doc*/
16994   __pyx_tp_traverse_2bx_3bbi_8bbi_file_BBIFile, /*tp_traverse*/
16995   __pyx_tp_clear_2bx_3bbi_8bbi_file_BBIFile, /*tp_clear*/
16996   0, /*tp_richcompare*/
16997   0, /*tp_weaklistoffset*/
16998   0, /*tp_iter*/
16999   0, /*tp_iternext*/
17000   __pyx_methods_2bx_3bbi_8bbi_file_BBIFile, /*tp_methods*/
17001   0, /*tp_members*/
17002   __pyx_getsets_2bx_3bbi_8bbi_file_BBIFile, /*tp_getset*/
17003   0, /*tp_base*/
17004   0, /*tp_dict*/
17005   0, /*tp_descr_get*/
17006   0, /*tp_descr_set*/
17007   0, /*tp_dictoffset*/
17008   __pyx_pw_2bx_3bbi_8bbi_file_7BBIFile_1__init__, /*tp_init*/
17009   0, /*tp_alloc*/
17010   __pyx_tp_new_2bx_3bbi_8bbi_file_BBIFile, /*tp_new*/
17011   0, /*tp_free*/
17012   0, /*tp_is_gc*/
17013   0, /*tp_bases*/
17014   0, /*tp_mro*/
17015   0, /*tp_cache*/
17016   0, /*tp_subclasses*/
17017   0, /*tp_weaklist*/
17018   0, /*tp_del*/
17019   0, /*tp_version_tag*/
17020   #if PY_VERSION_HEX >= 0x030400a1
17021   0, /*tp_finalize*/
17022   #endif
17023   #if PY_VERSION_HEX >= 0x030800b1
17024   0, /*tp_vectorcall*/
17025   #endif
17026   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
17027   0, /*tp_print*/
17028   #endif
17029   #if PY_VERSION_HEX >= 0x030B00A2
17030   0, /*tp_inline_values_offset*/
17031   #endif
17032 };
17033 static struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_BlockHandler __pyx_vtable_2bx_3bbi_8bbi_file_BlockHandler;
17034 
__pyx_tp_new_2bx_3bbi_8bbi_file_BlockHandler(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)17035 static PyObject *__pyx_tp_new_2bx_3bbi_8bbi_file_BlockHandler(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
17036   struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *p;
17037   PyObject *o;
17038   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
17039     o = (*t->tp_alloc)(t, 0);
17040   } else {
17041     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
17042   }
17043   if (unlikely(!o)) return 0;
17044   p = ((struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *)o);
17045   p->__pyx_vtab = __pyx_vtabptr_2bx_3bbi_8bbi_file_BlockHandler;
17046   return o;
17047 }
17048 
__pyx_tp_dealloc_2bx_3bbi_8bbi_file_BlockHandler(PyObject * o)17049 static void __pyx_tp_dealloc_2bx_3bbi_8bbi_file_BlockHandler(PyObject *o) {
17050   #if CYTHON_USE_TP_FINALIZE
17051   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))) {
17052     if (PyObject_CallFinalizerFromDealloc(o)) return;
17053   }
17054   #endif
17055   (*Py_TYPE(o)->tp_free)(o);
17056 }
17057 
17058 static PyMethodDef __pyx_methods_2bx_3bbi_8bbi_file_BlockHandler[] = {
17059   {"__reduce_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_8bbi_file_12BlockHandler_1__reduce_cython__, METH_NOARGS, 0},
17060   {"__setstate_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_8bbi_file_12BlockHandler_3__setstate_cython__, METH_O, 0},
17061   {0, 0, 0, 0}
17062 };
17063 
17064 static PyTypeObject __pyx_type_2bx_3bbi_8bbi_file_BlockHandler = {
17065   PyVarObject_HEAD_INIT(0, 0)
17066   "bx.bbi.bbi_file.BlockHandler", /*tp_name*/
17067   sizeof(struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler), /*tp_basicsize*/
17068   0, /*tp_itemsize*/
17069   __pyx_tp_dealloc_2bx_3bbi_8bbi_file_BlockHandler, /*tp_dealloc*/
17070   #if PY_VERSION_HEX < 0x030800b4
17071   0, /*tp_print*/
17072   #endif
17073   #if PY_VERSION_HEX >= 0x030800b4
17074   0, /*tp_vectorcall_offset*/
17075   #endif
17076   0, /*tp_getattr*/
17077   0, /*tp_setattr*/
17078   #if PY_MAJOR_VERSION < 3
17079   0, /*tp_compare*/
17080   #endif
17081   #if PY_MAJOR_VERSION >= 3
17082   0, /*tp_as_async*/
17083   #endif
17084   0, /*tp_repr*/
17085   0, /*tp_as_number*/
17086   0, /*tp_as_sequence*/
17087   0, /*tp_as_mapping*/
17088   0, /*tp_hash*/
17089   0, /*tp_call*/
17090   0, /*tp_str*/
17091   0, /*tp_getattro*/
17092   0, /*tp_setattro*/
17093   0, /*tp_as_buffer*/
17094   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
17095   "\n    Callback for `BBIFile.visit_blocks_in_region`\n    ", /*tp_doc*/
17096   0, /*tp_traverse*/
17097   0, /*tp_clear*/
17098   0, /*tp_richcompare*/
17099   0, /*tp_weaklistoffset*/
17100   0, /*tp_iter*/
17101   0, /*tp_iternext*/
17102   __pyx_methods_2bx_3bbi_8bbi_file_BlockHandler, /*tp_methods*/
17103   0, /*tp_members*/
17104   0, /*tp_getset*/
17105   0, /*tp_base*/
17106   0, /*tp_dict*/
17107   0, /*tp_descr_get*/
17108   0, /*tp_descr_set*/
17109   0, /*tp_dictoffset*/
17110   0, /*tp_init*/
17111   0, /*tp_alloc*/
17112   __pyx_tp_new_2bx_3bbi_8bbi_file_BlockHandler, /*tp_new*/
17113   0, /*tp_free*/
17114   0, /*tp_is_gc*/
17115   0, /*tp_bases*/
17116   0, /*tp_mro*/
17117   0, /*tp_cache*/
17118   0, /*tp_subclasses*/
17119   0, /*tp_weaklist*/
17120   0, /*tp_del*/
17121   0, /*tp_version_tag*/
17122   #if PY_VERSION_HEX >= 0x030400a1
17123   0, /*tp_finalize*/
17124   #endif
17125   #if PY_VERSION_HEX >= 0x030800b1
17126   0, /*tp_vectorcall*/
17127   #endif
17128   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
17129   0, /*tp_print*/
17130   #endif
17131   #if PY_VERSION_HEX >= 0x030B00A2
17132   0, /*tp_inline_values_offset*/
17133   #endif
17134 };
17135 static struct __pyx_vtabstruct_2bx_3bbi_8bbi_file_ZoomLevel __pyx_vtable_2bx_3bbi_8bbi_file_ZoomLevel;
17136 
__pyx_tp_new_2bx_3bbi_8bbi_file_ZoomLevel(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)17137 static PyObject *__pyx_tp_new_2bx_3bbi_8bbi_file_ZoomLevel(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
17138   struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *p;
17139   PyObject *o;
17140   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
17141     o = (*t->tp_alloc)(t, 0);
17142   } else {
17143     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
17144   }
17145   if (unlikely(!o)) return 0;
17146   p = ((struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)o);
17147   p->__pyx_vtab = __pyx_vtabptr_2bx_3bbi_8bbi_file_ZoomLevel;
17148   p->bbi_file = ((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)Py_None); Py_INCREF(Py_None);
17149   return o;
17150 }
17151 
__pyx_tp_dealloc_2bx_3bbi_8bbi_file_ZoomLevel(PyObject * o)17152 static void __pyx_tp_dealloc_2bx_3bbi_8bbi_file_ZoomLevel(PyObject *o) {
17153   struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *p = (struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)o;
17154   #if CYTHON_USE_TP_FINALIZE
17155   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
17156     if (PyObject_CallFinalizerFromDealloc(o)) return;
17157   }
17158   #endif
17159   PyObject_GC_UnTrack(o);
17160   Py_CLEAR(p->bbi_file);
17161   (*Py_TYPE(o)->tp_free)(o);
17162 }
17163 
__pyx_tp_traverse_2bx_3bbi_8bbi_file_ZoomLevel(PyObject * o,visitproc v,void * a)17164 static int __pyx_tp_traverse_2bx_3bbi_8bbi_file_ZoomLevel(PyObject *o, visitproc v, void *a) {
17165   int e;
17166   struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *p = (struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)o;
17167   if (p->bbi_file) {
17168     e = (*v)(((PyObject *)p->bbi_file), a); if (e) return e;
17169   }
17170   return 0;
17171 }
17172 
__pyx_tp_clear_2bx_3bbi_8bbi_file_ZoomLevel(PyObject * o)17173 static int __pyx_tp_clear_2bx_3bbi_8bbi_file_ZoomLevel(PyObject *o) {
17174   PyObject* tmp;
17175   struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *p = (struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *)o;
17176   tmp = ((PyObject*)p->bbi_file);
17177   p->bbi_file = ((struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *)Py_None); Py_INCREF(Py_None);
17178   Py_XDECREF(tmp);
17179   return 0;
17180 }
17181 
__pyx_getprop_2bx_3bbi_8bbi_file_9ZoomLevel_reduction_level(PyObject * o,CYTHON_UNUSED void * x)17182 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_9ZoomLevel_reduction_level(PyObject *o, CYTHON_UNUSED void *x) {
17183   return __pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_15reduction_level_1__get__(o);
17184 }
17185 
__pyx_setprop_2bx_3bbi_8bbi_file_9ZoomLevel_reduction_level(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)17186 static int __pyx_setprop_2bx_3bbi_8bbi_file_9ZoomLevel_reduction_level(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
17187   if (v) {
17188     return __pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_15reduction_level_3__set__(o, v);
17189   }
17190   else {
17191     PyErr_SetString(PyExc_NotImplementedError, "__del__");
17192     return -1;
17193   }
17194 }
17195 
__pyx_getprop_2bx_3bbi_8bbi_file_9ZoomLevel_data_offset(PyObject * o,CYTHON_UNUSED void * x)17196 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_9ZoomLevel_data_offset(PyObject *o, CYTHON_UNUSED void *x) {
17197   return __pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_11data_offset_1__get__(o);
17198 }
17199 
__pyx_setprop_2bx_3bbi_8bbi_file_9ZoomLevel_data_offset(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)17200 static int __pyx_setprop_2bx_3bbi_8bbi_file_9ZoomLevel_data_offset(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
17201   if (v) {
17202     return __pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_11data_offset_3__set__(o, v);
17203   }
17204   else {
17205     PyErr_SetString(PyExc_NotImplementedError, "__del__");
17206     return -1;
17207   }
17208 }
17209 
__pyx_getprop_2bx_3bbi_8bbi_file_9ZoomLevel_index_offset(PyObject * o,CYTHON_UNUSED void * x)17210 static PyObject *__pyx_getprop_2bx_3bbi_8bbi_file_9ZoomLevel_index_offset(PyObject *o, CYTHON_UNUSED void *x) {
17211   return __pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_12index_offset_1__get__(o);
17212 }
17213 
__pyx_setprop_2bx_3bbi_8bbi_file_9ZoomLevel_index_offset(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)17214 static int __pyx_setprop_2bx_3bbi_8bbi_file_9ZoomLevel_index_offset(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
17215   if (v) {
17216     return __pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_12index_offset_3__set__(o, v);
17217   }
17218   else {
17219     PyErr_SetString(PyExc_NotImplementedError, "__del__");
17220     return -1;
17221   }
17222 }
17223 
17224 static PyMethodDef __pyx_methods_2bx_3bbi_8bbi_file_ZoomLevel[] = {
17225   {"_summary_blocks_in_region", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_1_summary_blocks_in_region, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2bx_3bbi_8bbi_file_9ZoomLevel__summary_blocks_in_region},
17226   {"__reduce_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_3__reduce_cython__, METH_NOARGS, 0},
17227   {"__setstate_cython__", (PyCFunction)__pyx_pw_2bx_3bbi_8bbi_file_9ZoomLevel_5__setstate_cython__, METH_O, 0},
17228   {0, 0, 0, 0}
17229 };
17230 
17231 static struct PyGetSetDef __pyx_getsets_2bx_3bbi_8bbi_file_ZoomLevel[] = {
17232   {(char *)"reduction_level", __pyx_getprop_2bx_3bbi_8bbi_file_9ZoomLevel_reduction_level, __pyx_setprop_2bx_3bbi_8bbi_file_9ZoomLevel_reduction_level, (char *)0, 0},
17233   {(char *)"data_offset", __pyx_getprop_2bx_3bbi_8bbi_file_9ZoomLevel_data_offset, __pyx_setprop_2bx_3bbi_8bbi_file_9ZoomLevel_data_offset, (char *)0, 0},
17234   {(char *)"index_offset", __pyx_getprop_2bx_3bbi_8bbi_file_9ZoomLevel_index_offset, __pyx_setprop_2bx_3bbi_8bbi_file_9ZoomLevel_index_offset, (char *)0, 0},
17235   {0, 0, 0, 0, 0}
17236 };
17237 
17238 static PyTypeObject __pyx_type_2bx_3bbi_8bbi_file_ZoomLevel = {
17239   PyVarObject_HEAD_INIT(0, 0)
17240   "bx.bbi.bbi_file.ZoomLevel", /*tp_name*/
17241   sizeof(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel), /*tp_basicsize*/
17242   0, /*tp_itemsize*/
17243   __pyx_tp_dealloc_2bx_3bbi_8bbi_file_ZoomLevel, /*tp_dealloc*/
17244   #if PY_VERSION_HEX < 0x030800b4
17245   0, /*tp_print*/
17246   #endif
17247   #if PY_VERSION_HEX >= 0x030800b4
17248   0, /*tp_vectorcall_offset*/
17249   #endif
17250   0, /*tp_getattr*/
17251   0, /*tp_setattr*/
17252   #if PY_MAJOR_VERSION < 3
17253   0, /*tp_compare*/
17254   #endif
17255   #if PY_MAJOR_VERSION >= 3
17256   0, /*tp_as_async*/
17257   #endif
17258   0, /*tp_repr*/
17259   0, /*tp_as_number*/
17260   0, /*tp_as_sequence*/
17261   0, /*tp_as_mapping*/
17262   0, /*tp_hash*/
17263   0, /*tp_call*/
17264   0, /*tp_str*/
17265   0, /*tp_getattro*/
17266   0, /*tp_setattro*/
17267   0, /*tp_as_buffer*/
17268   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
17269   0, /*tp_doc*/
17270   __pyx_tp_traverse_2bx_3bbi_8bbi_file_ZoomLevel, /*tp_traverse*/
17271   __pyx_tp_clear_2bx_3bbi_8bbi_file_ZoomLevel, /*tp_clear*/
17272   0, /*tp_richcompare*/
17273   0, /*tp_weaklistoffset*/
17274   0, /*tp_iter*/
17275   0, /*tp_iternext*/
17276   __pyx_methods_2bx_3bbi_8bbi_file_ZoomLevel, /*tp_methods*/
17277   0, /*tp_members*/
17278   __pyx_getsets_2bx_3bbi_8bbi_file_ZoomLevel, /*tp_getset*/
17279   0, /*tp_base*/
17280   0, /*tp_dict*/
17281   0, /*tp_descr_get*/
17282   0, /*tp_descr_set*/
17283   0, /*tp_dictoffset*/
17284   0, /*tp_init*/
17285   0, /*tp_alloc*/
17286   __pyx_tp_new_2bx_3bbi_8bbi_file_ZoomLevel, /*tp_new*/
17287   0, /*tp_free*/
17288   0, /*tp_is_gc*/
17289   0, /*tp_bases*/
17290   0, /*tp_mro*/
17291   0, /*tp_cache*/
17292   0, /*tp_subclasses*/
17293   0, /*tp_weaklist*/
17294   0, /*tp_del*/
17295   0, /*tp_version_tag*/
17296   #if PY_VERSION_HEX >= 0x030400a1
17297   0, /*tp_finalize*/
17298   #endif
17299   #if PY_VERSION_HEX >= 0x030800b1
17300   0, /*tp_vectorcall*/
17301   #endif
17302   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
17303   0, /*tp_print*/
17304   #endif
17305   #if PY_VERSION_HEX >= 0x030B00A2
17306   0, /*tp_inline_values_offset*/
17307   #endif
17308 };
17309 
17310 static PyMethodDef __pyx_methods[] = {
17311   {0, 0, 0, 0}
17312 };
17313 
17314 #if PY_MAJOR_VERSION >= 3
17315 #if CYTHON_PEP489_MULTI_PHASE_INIT
17316 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
17317 static int __pyx_pymod_exec_bbi_file(PyObject* module); /*proto*/
17318 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
17319   {Py_mod_create, (void*)__pyx_pymod_create},
17320   {Py_mod_exec, (void*)__pyx_pymod_exec_bbi_file},
17321   {0, NULL}
17322 };
17323 #endif
17324 
17325 static struct PyModuleDef __pyx_moduledef = {
17326     PyModuleDef_HEAD_INIT,
17327     "bbi_file",
17328     __pyx_k_Core_implementation_for_reading, /* m_doc */
17329   #if CYTHON_PEP489_MULTI_PHASE_INIT
17330     0, /* m_size */
17331   #else
17332     -1, /* m_size */
17333   #endif
17334     __pyx_methods /* m_methods */,
17335   #if CYTHON_PEP489_MULTI_PHASE_INIT
17336     __pyx_moduledef_slots, /* m_slots */
17337   #else
17338     NULL, /* m_reload */
17339   #endif
17340     NULL, /* m_traverse */
17341     NULL, /* m_clear */
17342     NULL /* m_free */
17343 };
17344 #endif
17345 #ifndef CYTHON_SMALL_CODE
17346 #if defined(__clang__)
17347     #define CYTHON_SMALL_CODE
17348 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
17349     #define CYTHON_SMALL_CODE __attribute__((cold))
17350 #else
17351     #define CYTHON_SMALL_CODE
17352 #endif
17353 #endif
17354 
17355 static __Pyx_StringTabEntry __pyx_string_tab[] = {
17356   {&__pyx_n_s_BBIFile, __pyx_k_BBIFile, sizeof(__pyx_k_BBIFile), 0, 0, 1, 1},
17357   {&__pyx_n_s_BinaryFileReader, __pyx_k_BinaryFileReader, sizeof(__pyx_k_BinaryFileReader), 0, 0, 1, 1},
17358   {&__pyx_n_s_BlockHandler, __pyx_k_BlockHandler, sizeof(__pyx_k_BlockHandler), 0, 0, 1, 1},
17359   {&__pyx_n_s_BytesIO, __pyx_k_BytesIO, sizeof(__pyx_k_BytesIO), 0, 0, 1, 1},
17360   {&__pyx_n_s_II, __pyx_k_II, sizeof(__pyx_k_II), 0, 0, 1, 1},
17361   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
17362   {&__pyx_kp_s_Incompatible_checksums_s_vs_0x36, __pyx_k_Incompatible_checksums_s_vs_0x36, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x36), 0, 0, 1, 0},
17363   {&__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},
17364   {&__pyx_kp_s_Incompatible_checksums_s_vs_0x73, __pyx_k_Incompatible_checksums_s_vs_0x73, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x73), 0, 0, 1, 0},
17365   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_k_Incompatible_checksums_s_vs_0xd4, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xd4), 0, 0, 1, 0},
17366   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xf7, __pyx_k_Incompatible_checksums_s_vs_0xf7, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xf7), 0, 0, 1, 0},
17367   {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
17368   {&__pyx_n_s_SummarizedData, __pyx_k_SummarizedData, sizeof(__pyx_k_SummarizedData), 0, 0, 1, 1},
17369   {&__pyx_n_s_SummaryBlock, __pyx_k_SummaryBlock, sizeof(__pyx_k_SummaryBlock), 0, 0, 1, 1},
17370   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
17371   {&__pyx_n_s_ZoomLevel, __pyx_k_ZoomLevel, sizeof(__pyx_k_ZoomLevel), 0, 0, 1, 1},
17372   {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
17373   {&__pyx_n_s_bx_bbi_bbi_file, __pyx_k_bx_bbi_bbi_file, sizeof(__pyx_k_bx_bbi_bbi_file), 0, 0, 1, 1},
17374   {&__pyx_n_s_bx_misc_binary_file, __pyx_k_bx_misc_binary_file, sizeof(__pyx_k_bx_misc_binary_file), 0, 0, 1, 1},
17375   {&__pyx_n_s_byteswap_needed, __pyx_k_byteswap_needed, sizeof(__pyx_k_byteswap_needed), 0, 0, 1, 1},
17376   {&__pyx_n_s_chrom, __pyx_k_chrom, sizeof(__pyx_k_chrom), 0, 0, 1, 1},
17377   {&__pyx_n_s_chrom_id, __pyx_k_chrom_id, sizeof(__pyx_k_chrom_id), 0, 0, 1, 1},
17378   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
17379   {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
17380   {&__pyx_n_s_coverage, __pyx_k_coverage, sizeof(__pyx_k_coverage), 0, 0, 1, 1},
17381   {&__pyx_n_s_decompress, __pyx_k_decompress, sizeof(__pyx_k_decompress), 0, 0, 1, 1},
17382   {&__pyx_n_s_deque, __pyx_k_deque, sizeof(__pyx_k_deque), 0, 0, 1, 1},
17383   {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
17384   {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
17385   {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
17386   {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
17387   {&__pyx_n_s_expected_sig, __pyx_k_expected_sig, sizeof(__pyx_k_expected_sig), 0, 0, 1, 1},
17388   {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
17389   {&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1},
17390   {&__pyx_n_s_find_overlapping_blocks, __pyx_k_find_overlapping_blocks, sizeof(__pyx_k_find_overlapping_blocks), 0, 0, 1, 1},
17391   {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
17392   {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
17393   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
17394   {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1},
17395   {&__pyx_n_s_is_little_endian, __pyx_k_is_little_endian, sizeof(__pyx_k_is_little_endian), 0, 0, 1, 1},
17396   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
17397   {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1},
17398   {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
17399   {&__pyx_n_s_max_val, __pyx_k_max_val, sizeof(__pyx_k_max_val), 0, 0, 1, 1},
17400   {&__pyx_n_s_mean, __pyx_k_mean, sizeof(__pyx_k_mean), 0, 0, 1, 1},
17401   {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1},
17402   {&__pyx_n_s_min_val, __pyx_k_min_val, sizeof(__pyx_k_min_val), 0, 0, 1, 1},
17403   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
17404   {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1},
17405   {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
17406   {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
17407   {&__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},
17408   {&__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},
17409   {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
17410   {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
17411   {&__pyx_n_s_popleft, __pyx_k_popleft, sizeof(__pyx_k_popleft), 0, 0, 1, 1},
17412   {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
17413   {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
17414   {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
17415   {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
17416   {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
17417   {&__pyx_n_s_pyx_unpickle_BBIFile, __pyx_k_pyx_unpickle_BBIFile, sizeof(__pyx_k_pyx_unpickle_BBIFile), 0, 0, 1, 1},
17418   {&__pyx_n_s_pyx_unpickle_BlockHandler, __pyx_k_pyx_unpickle_BlockHandler, sizeof(__pyx_k_pyx_unpickle_BlockHandler), 0, 0, 1, 1},
17419   {&__pyx_n_s_pyx_unpickle_SummarizedData, __pyx_k_pyx_unpickle_SummarizedData, sizeof(__pyx_k_pyx_unpickle_SummarizedData), 0, 0, 1, 1},
17420   {&__pyx_n_s_pyx_unpickle_SummaryBlock, __pyx_k_pyx_unpickle_SummaryBlock, sizeof(__pyx_k_pyx_unpickle_SummaryBlock), 0, 0, 1, 1},
17421   {&__pyx_n_s_pyx_unpickle_ZoomLevel, __pyx_k_pyx_unpickle_ZoomLevel, sizeof(__pyx_k_pyx_unpickle_ZoomLevel), 0, 0, 1, 1},
17422   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
17423   {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1},
17424   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
17425   {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
17426   {&__pyx_n_s_read_float, __pyx_k_read_float, sizeof(__pyx_k_read_float), 0, 0, 1, 1},
17427   {&__pyx_n_s_read_uint16, __pyx_k_read_uint16, sizeof(__pyx_k_read_uint16), 0, 0, 1, 1},
17428   {&__pyx_n_s_read_uint32, __pyx_k_read_uint32, sizeof(__pyx_k_read_uint32), 0, 0, 1, 1},
17429   {&__pyx_n_s_read_uint64, __pyx_k_read_uint64, sizeof(__pyx_k_read_uint64), 0, 0, 1, 1},
17430   {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
17431   {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
17432   {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
17433   {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1},
17434   {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
17435   {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
17436   {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
17437   {&__pyx_n_s_skip, __pyx_k_skip, sizeof(__pyx_k_skip), 0, 0, 1, 1},
17438   {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
17439   {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
17440   {&__pyx_n_s_std_dev, __pyx_k_std_dev, sizeof(__pyx_k_std_dev), 0, 0, 1, 1},
17441   {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
17442   {&__pyx_n_s_sum_data, __pyx_k_sum_data, sizeof(__pyx_k_sum_data), 0, 0, 1, 1},
17443   {&__pyx_n_s_sum_squares, __pyx_k_sum_squares, sizeof(__pyx_k_sum_squares), 0, 0, 1, 1},
17444   {&__pyx_n_s_summarize, __pyx_k_summarize, sizeof(__pyx_k_summarize), 0, 0, 1, 1},
17445   {&__pyx_n_s_summarize_from_full, __pyx_k_summarize_from_full, sizeof(__pyx_k_summarize_from_full), 0, 0, 1, 1},
17446   {&__pyx_n_s_summary_blocks_in_region, __pyx_k_summary_blocks_in_region, sizeof(__pyx_k_summary_blocks_in_region), 0, 0, 1, 1},
17447   {&__pyx_n_s_summary_size, __pyx_k_summary_size, sizeof(__pyx_k_summary_size), 0, 0, 1, 1},
17448   {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
17449   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
17450   {&__pyx_n_s_type_name, __pyx_k_type_name, sizeof(__pyx_k_type_name), 0, 0, 1, 1},
17451   {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
17452   {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
17453   {&__pyx_n_s_valid_count, __pyx_k_valid_count, sizeof(__pyx_k_valid_count), 0, 0, 1, 1},
17454   {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
17455   {&__pyx_n_s_zlib, __pyx_k_zlib, sizeof(__pyx_k_zlib), 0, 0, 1, 1},
17456   {0, 0, 0, 0, 0, 0, 0}
17457 };
__Pyx_InitCachedBuiltins(void)17458 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
17459   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 234, __pyx_L1_error)
17460   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 241, __pyx_L1_error)
17461   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 945, __pyx_L1_error)
17462   return 0;
17463   __pyx_L1_error:;
17464   return -1;
17465 }
17466 
__Pyx_InitCachedConstants(void)17467 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
17468   __Pyx_RefNannyDeclarations
17469   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
17470 
17471   /* "bx/bbi/bbi_file.pyx":269
17472  *             return chrom_id, chrom_size
17473  *         else:
17474  *             return None, None             # <<<<<<<<<<<<<<
17475  *
17476  *     cdef _summarize_from_full( self, bits32 chrom_id, bits32 start, bits32 end, int summary_size ):
17477  */
17478   __pyx_tuple_ = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 269, __pyx_L1_error)
17479   __Pyx_GOTREF(__pyx_tuple_);
17480   __Pyx_GIVEREF(__pyx_tuple_);
17481 
17482   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":945
17483  *         __pyx_import_array()
17484  *     except Exception:
17485  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
17486  *
17487  * cdef inline int import_umath() except -1:
17488  */
17489   __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(3, 945, __pyx_L1_error)
17490   __Pyx_GOTREF(__pyx_tuple__2);
17491   __Pyx_GIVEREF(__pyx_tuple__2);
17492 
17493   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":951
17494  *         _import_umath()
17495  *     except Exception:
17496  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
17497  *
17498  * cdef inline int import_ufunc() except -1:
17499  */
17500   __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(3, 951, __pyx_L1_error)
17501   __Pyx_GOTREF(__pyx_tuple__3);
17502   __Pyx_GIVEREF(__pyx_tuple__3);
17503 
17504   /* "(tree fragment)":1
17505  * def __pyx_unpickle_SummaryBlock(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
17506  *     cdef object __pyx_PickleError
17507  *     cdef object __pyx_result
17508  */
17509   __pyx_tuple__4 = 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__4)) __PYX_ERR(2, 1, __pyx_L1_error)
17510   __Pyx_GOTREF(__pyx_tuple__4);
17511   __Pyx_GIVEREF(__pyx_tuple__4);
17512   __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_SummaryBlock, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(2, 1, __pyx_L1_error)
17513   __pyx_tuple__6 = 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__6)) __PYX_ERR(2, 1, __pyx_L1_error)
17514   __Pyx_GOTREF(__pyx_tuple__6);
17515   __Pyx_GIVEREF(__pyx_tuple__6);
17516   __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_SummarizedData, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(2, 1, __pyx_L1_error)
17517   __pyx_tuple__8 = 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__8)) __PYX_ERR(2, 1, __pyx_L1_error)
17518   __Pyx_GOTREF(__pyx_tuple__8);
17519   __Pyx_GIVEREF(__pyx_tuple__8);
17520   __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BlockHandler, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(2, 1, __pyx_L1_error)
17521   __pyx_tuple__10 = 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__10)) __PYX_ERR(2, 1, __pyx_L1_error)
17522   __Pyx_GOTREF(__pyx_tuple__10);
17523   __Pyx_GIVEREF(__pyx_tuple__10);
17524   __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BBIFile, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(2, 1, __pyx_L1_error)
17525   __pyx_tuple__12 = 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__12)) __PYX_ERR(2, 1, __pyx_L1_error)
17526   __Pyx_GOTREF(__pyx_tuple__12);
17527   __Pyx_GIVEREF(__pyx_tuple__12);
17528   __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_ZoomLevel, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(2, 1, __pyx_L1_error)
17529   __Pyx_RefNannyFinishContext();
17530   return 0;
17531   __pyx_L1_error:;
17532   __Pyx_RefNannyFinishContext();
17533   return -1;
17534 }
17535 
__Pyx_InitGlobals(void)17536 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
17537   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
17538   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
17539   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
17540   __pyx_int_28 = PyInt_FromLong(28); if (unlikely(!__pyx_int_28)) __PYX_ERR(0, 1, __pyx_L1_error)
17541   __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 1, __pyx_L1_error)
17542   __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) __PYX_ERR(0, 1, __pyx_L1_error)
17543   __pyx_int_57037653 = PyInt_FromLong(57037653L); if (unlikely(!__pyx_int_57037653)) __PYX_ERR(0, 1, __pyx_L1_error)
17544   __pyx_int_89548920 = PyInt_FromLong(89548920L); if (unlikely(!__pyx_int_89548920)) __PYX_ERR(0, 1, __pyx_L1_error)
17545   __pyx_int_120770442 = PyInt_FromLong(120770442L); if (unlikely(!__pyx_int_120770442)) __PYX_ERR(0, 1, __pyx_L1_error)
17546   __pyx_int_222419149 = PyInt_FromLong(222419149L); if (unlikely(!__pyx_int_222419149)) __PYX_ERR(0, 1, __pyx_L1_error)
17547   __pyx_int_259536735 = PyInt_FromLong(259536735L); if (unlikely(!__pyx_int_259536735)) __PYX_ERR(0, 1, __pyx_L1_error)
17548   return 0;
17549   __pyx_L1_error:;
17550   return -1;
17551 }
17552 
17553 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
17554 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
17555 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
17556 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
17557 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
17558 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
17559 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
17560 
__Pyx_modinit_global_init_code(void)17561 static int __Pyx_modinit_global_init_code(void) {
17562   __Pyx_RefNannyDeclarations
17563   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
17564   /*--- Global init code ---*/
17565   __Pyx_RefNannyFinishContext();
17566   return 0;
17567 }
17568 
__Pyx_modinit_variable_export_code(void)17569 static int __Pyx_modinit_variable_export_code(void) {
17570   __Pyx_RefNannyDeclarations
17571   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
17572   /*--- Variable export code ---*/
17573   __Pyx_RefNannyFinishContext();
17574   return 0;
17575 }
17576 
__Pyx_modinit_function_export_code(void)17577 static int __Pyx_modinit_function_export_code(void) {
17578   __Pyx_RefNannyDeclarations
17579   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
17580   /*--- Function export code ---*/
17581   __Pyx_RefNannyFinishContext();
17582   return 0;
17583 }
17584 
__Pyx_modinit_type_init_code(void)17585 static int __Pyx_modinit_type_init_code(void) {
17586   __Pyx_RefNannyDeclarations
17587   int __pyx_lineno = 0;
17588   const char *__pyx_filename = NULL;
17589   int __pyx_clineno = 0;
17590   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
17591   /*--- Type init code ---*/
17592   if (PyType_Ready(&__pyx_type_2bx_3bbi_8bbi_file_SummaryBlock) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
17593   #if PY_VERSION_HEX < 0x030800B1
17594   __pyx_type_2bx_3bbi_8bbi_file_SummaryBlock.tp_print = 0;
17595   #endif
17596   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2bx_3bbi_8bbi_file_SummaryBlock.tp_dictoffset && __pyx_type_2bx_3bbi_8bbi_file_SummaryBlock.tp_getattro == PyObject_GenericGetAttr)) {
17597     __pyx_type_2bx_3bbi_8bbi_file_SummaryBlock.tp_getattro = __Pyx_PyObject_GenericGetAttr;
17598   }
17599   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SummaryBlock, (PyObject *)&__pyx_type_2bx_3bbi_8bbi_file_SummaryBlock) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
17600   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2bx_3bbi_8bbi_file_SummaryBlock) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
17601   __pyx_ptype_2bx_3bbi_8bbi_file_SummaryBlock = &__pyx_type_2bx_3bbi_8bbi_file_SummaryBlock;
17602   __pyx_vtabptr_2bx_3bbi_8bbi_file_SummarizedData = &__pyx_vtable_2bx_3bbi_8bbi_file_SummarizedData;
17603   __pyx_vtable_2bx_3bbi_8bbi_file_SummarizedData.accumulate_interval_value = (PyObject *(*)(struct __pyx_obj_2bx_3bbi_8bbi_file_SummarizedData *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, float))__pyx_f_2bx_3bbi_8bbi_file_14SummarizedData_accumulate_interval_value;
17604   if (PyType_Ready(&__pyx_type_2bx_3bbi_8bbi_file_SummarizedData) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
17605   #if PY_VERSION_HEX < 0x030800B1
17606   __pyx_type_2bx_3bbi_8bbi_file_SummarizedData.tp_print = 0;
17607   #endif
17608   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2bx_3bbi_8bbi_file_SummarizedData.tp_dictoffset && __pyx_type_2bx_3bbi_8bbi_file_SummarizedData.tp_getattro == PyObject_GenericGetAttr)) {
17609     __pyx_type_2bx_3bbi_8bbi_file_SummarizedData.tp_getattro = __Pyx_PyObject_GenericGetAttr;
17610   }
17611   if (__Pyx_SetVtable(__pyx_type_2bx_3bbi_8bbi_file_SummarizedData.tp_dict, __pyx_vtabptr_2bx_3bbi_8bbi_file_SummarizedData) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
17612   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SummarizedData, (PyObject *)&__pyx_type_2bx_3bbi_8bbi_file_SummarizedData) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
17613   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2bx_3bbi_8bbi_file_SummarizedData) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
17614   __pyx_ptype_2bx_3bbi_8bbi_file_SummarizedData = &__pyx_type_2bx_3bbi_8bbi_file_SummarizedData;
17615   __pyx_vtabptr_2bx_3bbi_8bbi_file_BBIFile = &__pyx_vtable_2bx_3bbi_8bbi_file_BBIFile;
17616   __pyx_vtable_2bx_3bbi_8bbi_file_BBIFile.visit_blocks_in_region = (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, struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *))__pyx_f_2bx_3bbi_8bbi_file_7BBIFile_visit_blocks_in_region;
17617   __pyx_vtable_2bx_3bbi_8bbi_file_BBIFile._get_chrom_id_and_size = (PyObject *(*)(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *, char *))__pyx_f_2bx_3bbi_8bbi_file_7BBIFile__get_chrom_id_and_size;
17618   __pyx_vtable_2bx_3bbi_8bbi_file_BBIFile._best_zoom_level = (PyObject *(*)(struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *, int))__pyx_f_2bx_3bbi_8bbi_file_7BBIFile__best_zoom_level;
17619   __pyx_vtable_2bx_3bbi_8bbi_file_BBIFile.summarize = (PyObject *(*)(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))__pyx_f_2bx_3bbi_8bbi_file_7BBIFile_summarize;
17620   __pyx_vtable_2bx_3bbi_8bbi_file_BBIFile.summarize_from_full = (PyObject *(*)(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))__pyx_f_2bx_3bbi_8bbi_file_7BBIFile_summarize_from_full;
17621   __pyx_vtable_2bx_3bbi_8bbi_file_BBIFile.query = (PyObject *(*)(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))__pyx_f_2bx_3bbi_8bbi_file_7BBIFile_query;
17622   __pyx_vtable_2bx_3bbi_8bbi_file_BBIFile._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_8bbi_file_7BBIFile__summarize_from_full;
17623   if (PyType_Ready(&__pyx_type_2bx_3bbi_8bbi_file_BBIFile) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
17624   #if PY_VERSION_HEX < 0x030800B1
17625   __pyx_type_2bx_3bbi_8bbi_file_BBIFile.tp_print = 0;
17626   #endif
17627   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2bx_3bbi_8bbi_file_BBIFile.tp_dictoffset && __pyx_type_2bx_3bbi_8bbi_file_BBIFile.tp_getattro == PyObject_GenericGetAttr)) {
17628     __pyx_type_2bx_3bbi_8bbi_file_BBIFile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
17629   }
17630   if (__Pyx_SetVtable(__pyx_type_2bx_3bbi_8bbi_file_BBIFile.tp_dict, __pyx_vtabptr_2bx_3bbi_8bbi_file_BBIFile) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
17631   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BBIFile, (PyObject *)&__pyx_type_2bx_3bbi_8bbi_file_BBIFile) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
17632   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2bx_3bbi_8bbi_file_BBIFile) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
17633   __pyx_ptype_2bx_3bbi_8bbi_file_BBIFile = &__pyx_type_2bx_3bbi_8bbi_file_BBIFile;
17634   __pyx_vtabptr_2bx_3bbi_8bbi_file_BlockHandler = &__pyx_vtable_2bx_3bbi_8bbi_file_BlockHandler;
17635   __pyx_vtable_2bx_3bbi_8bbi_file_BlockHandler.handle_block = (PyObject *(*)(struct __pyx_obj_2bx_3bbi_8bbi_file_BlockHandler *, PyObject *, struct __pyx_obj_2bx_3bbi_8bbi_file_BBIFile *))__pyx_f_2bx_3bbi_8bbi_file_12BlockHandler_handle_block;
17636   if (PyType_Ready(&__pyx_type_2bx_3bbi_8bbi_file_BlockHandler) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
17637   #if PY_VERSION_HEX < 0x030800B1
17638   __pyx_type_2bx_3bbi_8bbi_file_BlockHandler.tp_print = 0;
17639   #endif
17640   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2bx_3bbi_8bbi_file_BlockHandler.tp_dictoffset && __pyx_type_2bx_3bbi_8bbi_file_BlockHandler.tp_getattro == PyObject_GenericGetAttr)) {
17641     __pyx_type_2bx_3bbi_8bbi_file_BlockHandler.tp_getattro = __Pyx_PyObject_GenericGetAttr;
17642   }
17643   if (__Pyx_SetVtable(__pyx_type_2bx_3bbi_8bbi_file_BlockHandler.tp_dict, __pyx_vtabptr_2bx_3bbi_8bbi_file_BlockHandler) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
17644   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BlockHandler, (PyObject *)&__pyx_type_2bx_3bbi_8bbi_file_BlockHandler) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
17645   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2bx_3bbi_8bbi_file_BlockHandler) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
17646   __pyx_ptype_2bx_3bbi_8bbi_file_BlockHandler = &__pyx_type_2bx_3bbi_8bbi_file_BlockHandler;
17647   __pyx_vtabptr_2bx_3bbi_8bbi_file_ZoomLevel = &__pyx_vtable_2bx_3bbi_8bbi_file_ZoomLevel;
17648   __pyx_vtable_2bx_3bbi_8bbi_file_ZoomLevel._get_summary_slice = (PyObject *(*)(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, PyObject *))__pyx_f_2bx_3bbi_8bbi_file_9ZoomLevel__get_summary_slice;
17649   __pyx_vtable_2bx_3bbi_8bbi_file_ZoomLevel._summarize = (PyObject *(*)(struct __pyx_obj_2bx_3bbi_8bbi_file_ZoomLevel *, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, __pyx_t_2bx_3bbi_5types_bits32, int))__pyx_f_2bx_3bbi_8bbi_file_9ZoomLevel__summarize;
17650   if (PyType_Ready(&__pyx_type_2bx_3bbi_8bbi_file_ZoomLevel) < 0) __PYX_ERR(0, 292, __pyx_L1_error)
17651   #if PY_VERSION_HEX < 0x030800B1
17652   __pyx_type_2bx_3bbi_8bbi_file_ZoomLevel.tp_print = 0;
17653   #endif
17654   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2bx_3bbi_8bbi_file_ZoomLevel.tp_dictoffset && __pyx_type_2bx_3bbi_8bbi_file_ZoomLevel.tp_getattro == PyObject_GenericGetAttr)) {
17655     __pyx_type_2bx_3bbi_8bbi_file_ZoomLevel.tp_getattro = __Pyx_PyObject_GenericGetAttr;
17656   }
17657   if (__Pyx_SetVtable(__pyx_type_2bx_3bbi_8bbi_file_ZoomLevel.tp_dict, __pyx_vtabptr_2bx_3bbi_8bbi_file_ZoomLevel) < 0) __PYX_ERR(0, 292, __pyx_L1_error)
17658   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ZoomLevel, (PyObject *)&__pyx_type_2bx_3bbi_8bbi_file_ZoomLevel) < 0) __PYX_ERR(0, 292, __pyx_L1_error)
17659   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2bx_3bbi_8bbi_file_ZoomLevel) < 0) __PYX_ERR(0, 292, __pyx_L1_error)
17660   __pyx_ptype_2bx_3bbi_8bbi_file_ZoomLevel = &__pyx_type_2bx_3bbi_8bbi_file_ZoomLevel;
17661   __Pyx_RefNannyFinishContext();
17662   return 0;
17663   __pyx_L1_error:;
17664   __Pyx_RefNannyFinishContext();
17665   return -1;
17666 }
17667 
__Pyx_modinit_type_import_code(void)17668 static int __Pyx_modinit_type_import_code(void) {
17669   __Pyx_RefNannyDeclarations
17670   PyObject *__pyx_t_1 = NULL;
17671   int __pyx_lineno = 0;
17672   const char *__pyx_filename = NULL;
17673   int __pyx_clineno = 0;
17674   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
17675   /*--- Type import code ---*/
17676   __pyx_t_1 = PyImport_ImportModule("bx.bbi.bpt_file"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
17677   __Pyx_GOTREF(__pyx_t_1);
17678   __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);
17679    if (!__pyx_ptype_2bx_3bbi_8bpt_file_BPTFile) __PYX_ERR(4, 5, __pyx_L1_error)
17680   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17681   __pyx_t_1 = PyImport_ImportModule("bx.bbi.cirtree_file"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3, __pyx_L1_error)
17682   __Pyx_GOTREF(__pyx_t_1);
17683   __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);
17684    if (!__pyx_ptype_2bx_3bbi_12cirtree_file_CIRTreeFile) __PYX_ERR(5, 3, __pyx_L1_error)
17685   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17686   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 9, __pyx_L1_error)
17687   __Pyx_GOTREF(__pyx_t_1);
17688   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
17689   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
17690   sizeof(PyTypeObject),
17691   #else
17692   sizeof(PyHeapTypeObject),
17693   #endif
17694   __Pyx_ImportType_CheckSize_Warn);
17695    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(6, 9, __pyx_L1_error)
17696   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17697   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 200, __pyx_L1_error)
17698   __Pyx_GOTREF(__pyx_t_1);
17699   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
17700    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(3, 200, __pyx_L1_error)
17701   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
17702    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(3, 223, __pyx_L1_error)
17703   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
17704    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(3, 227, __pyx_L1_error)
17705   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
17706    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(3, 239, __pyx_L1_error)
17707   __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17708    if (!__pyx_ptype_5numpy_generic) __PYX_ERR(3, 771, __pyx_L1_error)
17709   __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17710    if (!__pyx_ptype_5numpy_number) __PYX_ERR(3, 773, __pyx_L1_error)
17711   __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17712    if (!__pyx_ptype_5numpy_integer) __PYX_ERR(3, 775, __pyx_L1_error)
17713   __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17714    if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(3, 777, __pyx_L1_error)
17715   __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17716    if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(3, 779, __pyx_L1_error)
17717   __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17718    if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(3, 781, __pyx_L1_error)
17719   __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17720    if (!__pyx_ptype_5numpy_floating) __PYX_ERR(3, 783, __pyx_L1_error)
17721   __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17722    if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(3, 785, __pyx_L1_error)
17723   __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17724    if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(3, 787, __pyx_L1_error)
17725   __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17726    if (!__pyx_ptype_5numpy_character) __PYX_ERR(3, 789, __pyx_L1_error)
17727   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
17728    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(3, 827, __pyx_L1_error)
17729   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17730   __Pyx_RefNannyFinishContext();
17731   return 0;
17732   __pyx_L1_error:;
17733   __Pyx_XDECREF(__pyx_t_1);
17734   __Pyx_RefNannyFinishContext();
17735   return -1;
17736 }
17737 
__Pyx_modinit_variable_import_code(void)17738 static int __Pyx_modinit_variable_import_code(void) {
17739   __Pyx_RefNannyDeclarations
17740   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
17741   /*--- Variable import code ---*/
17742   __Pyx_RefNannyFinishContext();
17743   return 0;
17744 }
17745 
__Pyx_modinit_function_import_code(void)17746 static int __Pyx_modinit_function_import_code(void) {
17747   __Pyx_RefNannyDeclarations
17748   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
17749   /*--- Function import code ---*/
17750   __Pyx_RefNannyFinishContext();
17751   return 0;
17752 }
17753 
17754 
17755 #ifndef CYTHON_NO_PYINIT_EXPORT
17756 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
17757 #elif PY_MAJOR_VERSION < 3
17758 #ifdef __cplusplus
17759 #define __Pyx_PyMODINIT_FUNC extern "C" void
17760 #else
17761 #define __Pyx_PyMODINIT_FUNC void
17762 #endif
17763 #else
17764 #ifdef __cplusplus
17765 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
17766 #else
17767 #define __Pyx_PyMODINIT_FUNC PyObject *
17768 #endif
17769 #endif
17770 
17771 
17772 #if PY_MAJOR_VERSION < 3
17773 __Pyx_PyMODINIT_FUNC initbbi_file(void) CYTHON_SMALL_CODE; /*proto*/
initbbi_file(void)17774 __Pyx_PyMODINIT_FUNC initbbi_file(void)
17775 #else
17776 __Pyx_PyMODINIT_FUNC PyInit_bbi_file(void) CYTHON_SMALL_CODE; /*proto*/
17777 __Pyx_PyMODINIT_FUNC PyInit_bbi_file(void)
17778 #if CYTHON_PEP489_MULTI_PHASE_INIT
17779 {
17780   return PyModuleDef_Init(&__pyx_moduledef);
17781 }
17782 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
17783     #if PY_VERSION_HEX >= 0x030700A1
17784     static PY_INT64_T main_interpreter_id = -1;
17785     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
17786     if (main_interpreter_id == -1) {
17787         main_interpreter_id = current_id;
17788         return (unlikely(current_id == -1)) ? -1 : 0;
17789     } else if (unlikely(main_interpreter_id != current_id))
17790     #else
17791     static PyInterpreterState *main_interpreter = NULL;
17792     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
17793     if (!main_interpreter) {
17794         main_interpreter = current_interpreter;
17795     } else if (unlikely(main_interpreter != current_interpreter))
17796     #endif
17797     {
17798         PyErr_SetString(
17799             PyExc_ImportError,
17800             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
17801         return -1;
17802     }
17803     return 0;
17804 }
17805 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) {
17806     PyObject *value = PyObject_GetAttrString(spec, from_name);
17807     int result = 0;
17808     if (likely(value)) {
17809         if (allow_none || value != Py_None) {
17810             result = PyDict_SetItemString(moddict, to_name, value);
17811         }
17812         Py_DECREF(value);
17813     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
17814         PyErr_Clear();
17815     } else {
17816         result = -1;
17817     }
17818     return result;
17819 }
17820 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
17821     PyObject *module = NULL, *moddict, *modname;
17822     if (__Pyx_check_single_interpreter())
17823         return NULL;
17824     if (__pyx_m)
17825         return __Pyx_NewRef(__pyx_m);
17826     modname = PyObject_GetAttrString(spec, "name");
17827     if (unlikely(!modname)) goto bad;
17828     module = PyModule_NewObject(modname);
17829     Py_DECREF(modname);
17830     if (unlikely(!module)) goto bad;
17831     moddict = PyModule_GetDict(module);
17832     if (unlikely(!moddict)) goto bad;
17833     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
17834     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
17835     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
17836     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
17837     return module;
17838 bad:
17839     Py_XDECREF(module);
17840     return NULL;
17841 }
17842 
17843 
17844 static CYTHON_SMALL_CODE int __pyx_pymod_exec_bbi_file(PyObject *__pyx_pyinit_module)
17845 #endif
17846 #endif
17847 {
17848   PyObject *__pyx_t_1 = NULL;
17849   PyObject *__pyx_t_2 = NULL;
17850   int __pyx_lineno = 0;
17851   const char *__pyx_filename = NULL;
17852   int __pyx_clineno = 0;
17853   __Pyx_RefNannyDeclarations
17854   #if CYTHON_PEP489_MULTI_PHASE_INIT
17855   if (__pyx_m) {
17856     if (__pyx_m == __pyx_pyinit_module) return 0;
17857     PyErr_SetString(PyExc_RuntimeError, "Module 'bbi_file' has already been imported. Re-initialisation is not supported.");
17858     return -1;
17859   }
17860   #elif PY_MAJOR_VERSION >= 3
17861   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
17862   #endif
17863   #if CYTHON_REFNANNY
17864 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
17865 if (!__Pyx_RefNanny) {
17866   PyErr_Clear();
17867   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
17868   if (!__Pyx_RefNanny)
17869       Py_FatalError("failed to import 'refnanny' module");
17870 }
17871 #endif
17872   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_bbi_file(void)", 0);
17873   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17874   #ifdef __Pxy_PyFrame_Initialize_Offsets
17875   __Pxy_PyFrame_Initialize_Offsets();
17876   #endif
17877   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
17878   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
17879   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
17880   #ifdef __Pyx_CyFunction_USED
17881   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17882   #endif
17883   #ifdef __Pyx_FusedFunction_USED
17884   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17885   #endif
17886   #ifdef __Pyx_Coroutine_USED
17887   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17888   #endif
17889   #ifdef __Pyx_Generator_USED
17890   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17891   #endif
17892   #ifdef __Pyx_AsyncGen_USED
17893   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17894   #endif
17895   #ifdef __Pyx_StopAsyncIteration_USED
17896   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17897   #endif
17898   /*--- Library function declarations ---*/
17899   /*--- Threads initialization code ---*/
17900   #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
17901   PyEval_InitThreads();
17902   #endif
17903   /*--- Module creation code ---*/
17904   #if CYTHON_PEP489_MULTI_PHASE_INIT
17905   __pyx_m = __pyx_pyinit_module;
17906   Py_INCREF(__pyx_m);
17907   #else
17908   #if PY_MAJOR_VERSION < 3
17909   __pyx_m = Py_InitModule4("bbi_file", __pyx_methods, __pyx_k_Core_implementation_for_reading, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
17910   #else
17911   __pyx_m = PyModule_Create(&__pyx_moduledef);
17912   #endif
17913   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
17914   #endif
17915   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
17916   Py_INCREF(__pyx_d);
17917   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
17918   Py_INCREF(__pyx_b);
17919   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
17920   Py_INCREF(__pyx_cython_runtime);
17921   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
17922   /*--- Initialize various global constants etc. ---*/
17923   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17924   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
17925   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17926   #endif
17927   if (__pyx_module_is_main_bx__bbi__bbi_file) {
17928     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17929   }
17930   #if PY_MAJOR_VERSION >= 3
17931   {
17932     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
17933     if (!PyDict_GetItemString(modules, "bx.bbi.bbi_file")) {
17934       if (unlikely(PyDict_SetItemString(modules, "bx.bbi.bbi_file", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
17935     }
17936   }
17937   #endif
17938   /*--- Builtin init code ---*/
17939   if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17940   /*--- Constants init code ---*/
17941   if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17942   /*--- Global type/function init code ---*/
17943   (void)__Pyx_modinit_global_init_code();
17944   (void)__Pyx_modinit_variable_export_code();
17945   (void)__Pyx_modinit_function_export_code();
17946   if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
17947   if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
17948   (void)__Pyx_modinit_variable_import_code();
17949   (void)__Pyx_modinit_function_import_code();
17950   /*--- Execution code ---*/
17951   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
17952   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17953   #endif
17954 
17955   /* "bx/bbi/bbi_file.pyx":11
17956  *
17957  * from cpython.version cimport PY_MAJOR_VERSION
17958  * import sys             # <<<<<<<<<<<<<<
17959  *
17960  * cimport cython
17961  */
17962   __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
17963   __Pyx_GOTREF(__pyx_t_1);
17964   if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
17965   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17966 
17967   /* "bx/bbi/bbi_file.pyx":15
17968  * cimport cython
17969  *
17970  * from collections import deque             # <<<<<<<<<<<<<<
17971  * from bpt_file cimport BPTFile
17972  * from cirtree_file cimport CIRTreeFile
17973  */
17974   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
17975   __Pyx_GOTREF(__pyx_t_1);
17976   __Pyx_INCREF(__pyx_n_s_deque);
17977   __Pyx_GIVEREF(__pyx_n_s_deque);
17978   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_deque);
17979   __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
17980   __Pyx_GOTREF(__pyx_t_2);
17981   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17982   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_deque); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
17983   __Pyx_GOTREF(__pyx_t_1);
17984   if (PyDict_SetItem(__pyx_d, __pyx_n_s_deque, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
17985   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17986   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17987 
17988   /* "bx/bbi/bbi_file.pyx":22
17989  * from libc cimport limits
17990  *
17991  * import numpy             # <<<<<<<<<<<<<<
17992  * cimport numpy
17993  *
17994  */
17995   __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
17996   __Pyx_GOTREF(__pyx_t_2);
17997   if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
17998   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17999 
18000   /* "bx/bbi/bbi_file.pyx":25
18001  * cimport numpy
18002  *
18003  * from bx.misc.binary_file import BinaryFileReader             # <<<<<<<<<<<<<<
18004  * from io import BytesIO
18005  * import zlib, math
18006  */
18007   __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
18008   __Pyx_GOTREF(__pyx_t_2);
18009   __Pyx_INCREF(__pyx_n_s_BinaryFileReader);
18010   __Pyx_GIVEREF(__pyx_n_s_BinaryFileReader);
18011   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BinaryFileReader);
18012   __pyx_t_1 = __Pyx_Import(__pyx_n_s_bx_misc_binary_file, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
18013   __Pyx_GOTREF(__pyx_t_1);
18014   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18015   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_BinaryFileReader); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
18016   __Pyx_GOTREF(__pyx_t_2);
18017   if (PyDict_SetItem(__pyx_d, __pyx_n_s_BinaryFileReader, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
18018   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18019   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18020 
18021   /* "bx/bbi/bbi_file.pyx":26
18022  *
18023  * from bx.misc.binary_file import BinaryFileReader
18024  * from io import BytesIO             # <<<<<<<<<<<<<<
18025  * import zlib, math
18026  *
18027  */
18028   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
18029   __Pyx_GOTREF(__pyx_t_1);
18030   __Pyx_INCREF(__pyx_n_s_BytesIO);
18031   __Pyx_GIVEREF(__pyx_n_s_BytesIO);
18032   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_BytesIO);
18033   __pyx_t_2 = __Pyx_Import(__pyx_n_s_io, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
18034   __Pyx_GOTREF(__pyx_t_2);
18035   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18036   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_BytesIO); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
18037   __Pyx_GOTREF(__pyx_t_1);
18038   if (PyDict_SetItem(__pyx_d, __pyx_n_s_BytesIO, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
18039   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18040   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18041 
18042   /* "bx/bbi/bbi_file.pyx":27
18043  * from bx.misc.binary_file import BinaryFileReader
18044  * from io import BytesIO
18045  * import zlib, math             # <<<<<<<<<<<<<<
18046  *
18047  * cdef extern from "Python.h":
18048  */
18049   __pyx_t_2 = __Pyx_Import(__pyx_n_s_zlib, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
18050   __Pyx_GOTREF(__pyx_t_2);
18051   if (PyDict_SetItem(__pyx_d, __pyx_n_s_zlib, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
18052   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18053   __pyx_t_2 = __Pyx_Import(__pyx_n_s_math, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
18054   __Pyx_GOTREF(__pyx_t_2);
18055   if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
18056   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18057 
18058   /* "bx/bbi/bbi_file.pyx":34
18059  * # Signatures for bbi related file types
18060  *
18061  * cdef public int big_wig_sig = 0x888FFC26             # <<<<<<<<<<<<<<
18062  * cdef public int big_bed_sig = 0x8789F2EB
18063  *
18064  */
18065   big_wig_sig = 0x888FFC26;
18066 
18067   /* "bx/bbi/bbi_file.pyx":35
18068  *
18069  * cdef public int big_wig_sig = 0x888FFC26
18070  * cdef public int big_bed_sig = 0x8789F2EB             # <<<<<<<<<<<<<<
18071  *
18072  * # Some record sizes for parsing
18073  */
18074   big_bed_sig = 0x8789F2EB;
18075 
18076   /* "(tree fragment)":1
18077  * def __pyx_unpickle_SummaryBlock(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
18078  *     cdef object __pyx_PickleError
18079  *     cdef object __pyx_result
18080  */
18081   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2bx_3bbi_8bbi_file_1__pyx_unpickle_SummaryBlock, NULL, __pyx_n_s_bx_bbi_bbi_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
18082   __Pyx_GOTREF(__pyx_t_2);
18083   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_SummaryBlock, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
18084   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18085 
18086   /* "(tree fragment)":11
18087  *         __pyx_unpickle_SummaryBlock__set_state(<SummaryBlock> __pyx_result, __pyx_state)
18088  *     return __pyx_result
18089  * cdef __pyx_unpickle_SummaryBlock__set_state(SummaryBlock __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
18090  *     __pyx_result.chrom_id = __pyx_state[0]; __pyx_result.end = __pyx_state[1]; __pyx_result.max_val = __pyx_state[2]; __pyx_result.min_val = __pyx_state[3]; __pyx_result.start = __pyx_state[4]; __pyx_result.sum_data = __pyx_state[5]; __pyx_result.sum_squares = __pyx_state[6]; __pyx_result.valid_count = __pyx_state[7]
18091  *     if len(__pyx_state) > 8 and hasattr(__pyx_result, '__dict__'):
18092  */
18093   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2bx_3bbi_8bbi_file_3__pyx_unpickle_SummarizedData, NULL, __pyx_n_s_bx_bbi_bbi_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
18094   __Pyx_GOTREF(__pyx_t_2);
18095   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_SummarizedData, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
18096   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18097 
18098   /* "(tree fragment)":1
18099  * def __pyx_unpickle_BlockHandler(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
18100  *     cdef object __pyx_PickleError
18101  *     cdef object __pyx_result
18102  */
18103   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2bx_3bbi_8bbi_file_5__pyx_unpickle_BlockHandler, NULL, __pyx_n_s_bx_bbi_bbi_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
18104   __Pyx_GOTREF(__pyx_t_2);
18105   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BlockHandler, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
18106   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18107 
18108   /* "(tree fragment)":11
18109  *         __pyx_unpickle_BlockHandler__set_state(<BlockHandler> __pyx_result, __pyx_state)
18110  *     return __pyx_result
18111  * cdef __pyx_unpickle_BlockHandler__set_state(BlockHandler __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
18112  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
18113  *         __pyx_result.__dict__.update(__pyx_state[0])
18114  */
18115   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2bx_3bbi_8bbi_file_7__pyx_unpickle_BBIFile, NULL, __pyx_n_s_bx_bbi_bbi_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
18116   __Pyx_GOTREF(__pyx_t_2);
18117   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BBIFile, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
18118   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18119 
18120   /* "(tree fragment)":1
18121  * def __pyx_unpickle_ZoomLevel(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
18122  *     cdef object __pyx_PickleError
18123  *     cdef object __pyx_result
18124  */
18125   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2bx_3bbi_8bbi_file_9__pyx_unpickle_ZoomLevel, NULL, __pyx_n_s_bx_bbi_bbi_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
18126   __Pyx_GOTREF(__pyx_t_2);
18127   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_ZoomLevel, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
18128   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18129 
18130   /* "bx/bbi/bbi_file.pyx":1
18131  * # cython: profile=False             # <<<<<<<<<<<<<<
18132  *
18133  * """
18134  */
18135   __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
18136   __Pyx_GOTREF(__pyx_t_2);
18137   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
18138   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18139 
18140   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1014
18141  *
18142  *
18143  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
18144  *     """
18145  *     returns the unit part of the dtype for a numpy datetime64 object.
18146  */
18147 
18148   /*--- Wrapped vars code ---*/
18149 
18150   goto __pyx_L0;
18151   __pyx_L1_error:;
18152   __Pyx_XDECREF(__pyx_t_1);
18153   __Pyx_XDECREF(__pyx_t_2);
18154   if (__pyx_m) {
18155     if (__pyx_d) {
18156       __Pyx_AddTraceback("init bx.bbi.bbi_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
18157     }
18158     Py_CLEAR(__pyx_m);
18159   } else if (!PyErr_Occurred()) {
18160     PyErr_SetString(PyExc_ImportError, "init bx.bbi.bbi_file");
18161   }
18162   __pyx_L0:;
18163   __Pyx_RefNannyFinishContext();
18164   #if CYTHON_PEP489_MULTI_PHASE_INIT
18165   return (__pyx_m != NULL) ? 0 : -1;
18166   #elif PY_MAJOR_VERSION >= 3
18167   return __pyx_m;
18168   #else
18169   return;
18170   #endif
18171 }
18172 
18173 /* --- Runtime support code --- */
18174 /* Refnanny */
18175 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)18176 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
18177     PyObject *m = NULL, *p = NULL;
18178     void *r = NULL;
18179     m = PyImport_ImportModule(modname);
18180     if (!m) goto end;
18181     p = PyObject_GetAttrString(m, "RefNannyAPI");
18182     if (!p) goto end;
18183     r = PyLong_AsVoidPtr(p);
18184 end:
18185     Py_XDECREF(p);
18186     Py_XDECREF(m);
18187     return (__Pyx_RefNannyAPIStruct *)r;
18188 }
18189 #endif
18190 
18191 /* PyObjectGetAttrStr */
18192 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)18193 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
18194     PyTypeObject* tp = Py_TYPE(obj);
18195     if (likely(tp->tp_getattro))
18196         return tp->tp_getattro(obj, attr_name);
18197 #if PY_MAJOR_VERSION < 3
18198     if (likely(tp->tp_getattr))
18199         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
18200 #endif
18201     return PyObject_GetAttr(obj, attr_name);
18202 }
18203 #endif
18204 
18205 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)18206 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
18207     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
18208     if (unlikely(!result)) {
18209         PyErr_Format(PyExc_NameError,
18210 #if PY_MAJOR_VERSION >= 3
18211             "name '%U' is not defined", name);
18212 #else
18213             "name '%.200s' is not defined", PyString_AS_STRING(name));
18214 #endif
18215     }
18216     return result;
18217 }
18218 
18219 /* PyErrExceptionMatches */
18220 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)18221 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
18222     Py_ssize_t i, n;
18223     n = PyTuple_GET_SIZE(tuple);
18224 #if PY_MAJOR_VERSION >= 3
18225     for (i=0; i<n; i++) {
18226         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
18227     }
18228 #endif
18229     for (i=0; i<n; i++) {
18230         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
18231     }
18232     return 0;
18233 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)18234 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
18235     PyObject *exc_type = tstate->curexc_type;
18236     if (exc_type == err) return 1;
18237     if (unlikely(!exc_type)) return 0;
18238     if (unlikely(PyTuple_Check(err)))
18239         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
18240     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
18241 }
18242 #endif
18243 
18244 /* PyErrFetchRestore */
18245 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)18246 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
18247     PyObject *tmp_type, *tmp_value, *tmp_tb;
18248     tmp_type = tstate->curexc_type;
18249     tmp_value = tstate->curexc_value;
18250     tmp_tb = tstate->curexc_traceback;
18251     tstate->curexc_type = type;
18252     tstate->curexc_value = value;
18253     tstate->curexc_traceback = tb;
18254     Py_XDECREF(tmp_type);
18255     Py_XDECREF(tmp_value);
18256     Py_XDECREF(tmp_tb);
18257 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)18258 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
18259     *type = tstate->curexc_type;
18260     *value = tstate->curexc_value;
18261     *tb = tstate->curexc_traceback;
18262     tstate->curexc_type = 0;
18263     tstate->curexc_value = 0;
18264     tstate->curexc_traceback = 0;
18265 }
18266 #endif
18267 
18268 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)18269 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
18270 #if CYTHON_USE_TYPE_SLOTS
18271 #if PY_MAJOR_VERSION >= 3
18272     if (likely(PyUnicode_Check(n)))
18273 #else
18274     if (likely(PyString_Check(n)))
18275 #endif
18276         return __Pyx_PyObject_GetAttrStr(o, n);
18277 #endif
18278     return PyObject_GetAttr(o, n);
18279 }
18280 
18281 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)18282 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
18283     __Pyx_PyThreadState_declare
18284     __Pyx_PyThreadState_assign
18285     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
18286         return NULL;
18287     __Pyx_PyErr_Clear();
18288     Py_INCREF(d);
18289     return d;
18290 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)18291 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
18292     PyObject *r = __Pyx_GetAttr(o, n);
18293     return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
18294 }
18295 
18296 /* PyDictVersioning */
18297 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)18298 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
18299     PyObject *dict = Py_TYPE(obj)->tp_dict;
18300     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
18301 }
__Pyx_get_object_dict_version(PyObject * obj)18302 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
18303     PyObject **dictptr = NULL;
18304     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
18305     if (offset) {
18306 #if CYTHON_COMPILING_IN_CPYTHON
18307         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
18308 #else
18309         dictptr = _PyObject_GetDictPtr(obj);
18310 #endif
18311     }
18312     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
18313 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)18314 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
18315     PyObject *dict = Py_TYPE(obj)->tp_dict;
18316     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
18317         return 0;
18318     return obj_dict_version == __Pyx_get_object_dict_version(obj);
18319 }
18320 #endif
18321 
18322 /* GetModuleGlobalName */
18323 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)18324 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
18325 #else
18326 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
18327 #endif
18328 {
18329     PyObject *result;
18330 #if !CYTHON_AVOID_BORROWED_REFS
18331 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
18332     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
18333     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
18334     if (likely(result)) {
18335         return __Pyx_NewRef(result);
18336     } else if (unlikely(PyErr_Occurred())) {
18337         return NULL;
18338     }
18339 #else
18340     result = PyDict_GetItem(__pyx_d, name);
18341     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
18342     if (likely(result)) {
18343         return __Pyx_NewRef(result);
18344     }
18345 #endif
18346 #else
18347     result = PyObject_GetItem(__pyx_d, name);
18348     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
18349     if (likely(result)) {
18350         return __Pyx_NewRef(result);
18351     }
18352     PyErr_Clear();
18353 #endif
18354     return __Pyx_GetBuiltinName(name);
18355 }
18356 
18357 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)18358 static void __Pyx_RaiseArgtupleInvalid(
18359     const char* func_name,
18360     int exact,
18361     Py_ssize_t num_min,
18362     Py_ssize_t num_max,
18363     Py_ssize_t num_found)
18364 {
18365     Py_ssize_t num_expected;
18366     const char *more_or_less;
18367     if (num_found < num_min) {
18368         num_expected = num_min;
18369         more_or_less = "at least";
18370     } else {
18371         num_expected = num_max;
18372         more_or_less = "at most";
18373     }
18374     if (exact) {
18375         more_or_less = "exactly";
18376     }
18377     PyErr_Format(PyExc_TypeError,
18378                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
18379                  func_name, more_or_less, num_expected,
18380                  (num_expected == 1) ? "" : "s", num_found);
18381 }
18382 
18383 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)18384 static void __Pyx_RaiseDoubleKeywordsError(
18385     const char* func_name,
18386     PyObject* kw_name)
18387 {
18388     PyErr_Format(PyExc_TypeError,
18389         #if PY_MAJOR_VERSION >= 3
18390         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
18391         #else
18392         "%s() got multiple values for keyword argument '%s'", func_name,
18393         PyString_AsString(kw_name));
18394         #endif
18395 }
18396 
18397 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)18398 static int __Pyx_ParseOptionalKeywords(
18399     PyObject *kwds,
18400     PyObject **argnames[],
18401     PyObject *kwds2,
18402     PyObject *values[],
18403     Py_ssize_t num_pos_args,
18404     const char* function_name)
18405 {
18406     PyObject *key = 0, *value = 0;
18407     Py_ssize_t pos = 0;
18408     PyObject*** name;
18409     PyObject*** first_kw_arg = argnames + num_pos_args;
18410     while (PyDict_Next(kwds, &pos, &key, &value)) {
18411         name = first_kw_arg;
18412         while (*name && (**name != key)) name++;
18413         if (*name) {
18414             values[name-argnames] = value;
18415             continue;
18416         }
18417         name = first_kw_arg;
18418         #if PY_MAJOR_VERSION < 3
18419         if (likely(PyString_Check(key))) {
18420             while (*name) {
18421                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
18422                         && _PyString_Eq(**name, key)) {
18423                     values[name-argnames] = value;
18424                     break;
18425                 }
18426                 name++;
18427             }
18428             if (*name) continue;
18429             else {
18430                 PyObject*** argname = argnames;
18431                 while (argname != first_kw_arg) {
18432                     if ((**argname == key) || (
18433                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
18434                              && _PyString_Eq(**argname, key))) {
18435                         goto arg_passed_twice;
18436                     }
18437                     argname++;
18438                 }
18439             }
18440         } else
18441         #endif
18442         if (likely(PyUnicode_Check(key))) {
18443             while (*name) {
18444                 int cmp = (**name == key) ? 0 :
18445                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
18446                     (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
18447                 #endif
18448                     PyUnicode_Compare(**name, key);
18449                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
18450                 if (cmp == 0) {
18451                     values[name-argnames] = value;
18452                     break;
18453                 }
18454                 name++;
18455             }
18456             if (*name) continue;
18457             else {
18458                 PyObject*** argname = argnames;
18459                 while (argname != first_kw_arg) {
18460                     int cmp = (**argname == key) ? 0 :
18461                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
18462                         (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
18463                     #endif
18464                         PyUnicode_Compare(**argname, key);
18465                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
18466                     if (cmp == 0) goto arg_passed_twice;
18467                     argname++;
18468                 }
18469             }
18470         } else
18471             goto invalid_keyword_type;
18472         if (kwds2) {
18473             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
18474         } else {
18475             goto invalid_keyword;
18476         }
18477     }
18478     return 0;
18479 arg_passed_twice:
18480     __Pyx_RaiseDoubleKeywordsError(function_name, key);
18481     goto bad;
18482 invalid_keyword_type:
18483     PyErr_Format(PyExc_TypeError,
18484         "%.200s() keywords must be strings", function_name);
18485     goto bad;
18486 invalid_keyword:
18487     PyErr_Format(PyExc_TypeError,
18488     #if PY_MAJOR_VERSION < 3
18489         "%.200s() got an unexpected keyword argument '%.200s'",
18490         function_name, PyString_AsString(key));
18491     #else
18492         "%s() got an unexpected keyword argument '%U'",
18493         function_name, key);
18494     #endif
18495 bad:
18496     return -1;
18497 }
18498 
18499 /* PyObjectCall */
18500 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)18501 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
18502     PyObject *result;
18503     ternaryfunc call = Py_TYPE(func)->tp_call;
18504     if (unlikely(!call))
18505         return PyObject_Call(func, arg, kw);
18506     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
18507         return NULL;
18508     result = (*call)(func, arg, kw);
18509     Py_LeaveRecursiveCall();
18510     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
18511         PyErr_SetString(
18512             PyExc_SystemError,
18513             "NULL result without error in PyObject_Call");
18514     }
18515     return result;
18516 }
18517 #endif
18518 
18519 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)18520 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
18521     if (unlikely(!type)) {
18522         PyErr_SetString(PyExc_SystemError, "Missing type object");
18523         return 0;
18524     }
18525     if (likely(__Pyx_TypeCheck(obj, type)))
18526         return 1;
18527     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
18528                  Py_TYPE(obj)->tp_name, type->tp_name);
18529     return 0;
18530 }
18531 
18532 /* IsLittleEndian */
__Pyx_Is_Little_Endian(void)18533 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
18534 {
18535   union {
18536     uint32_t u32;
18537     uint8_t u8[4];
18538   } S;
18539   S.u32 = 0x01020304;
18540   return S.u8[0] == 4;
18541 }
18542 
18543 /* BufferFormatCheck */
__Pyx_BufFmt_Init(__Pyx_BufFmt_Context * ctx,__Pyx_BufFmt_StackElem * stack,__Pyx_TypeInfo * type)18544 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
18545                               __Pyx_BufFmt_StackElem* stack,
18546                               __Pyx_TypeInfo* type) {
18547   stack[0].field = &ctx->root;
18548   stack[0].parent_offset = 0;
18549   ctx->root.type = type;
18550   ctx->root.name = "buffer dtype";
18551   ctx->root.offset = 0;
18552   ctx->head = stack;
18553   ctx->head->field = &ctx->root;
18554   ctx->fmt_offset = 0;
18555   ctx->head->parent_offset = 0;
18556   ctx->new_packmode = '@';
18557   ctx->enc_packmode = '@';
18558   ctx->new_count = 1;
18559   ctx->enc_count = 0;
18560   ctx->enc_type = 0;
18561   ctx->is_complex = 0;
18562   ctx->is_valid_array = 0;
18563   ctx->struct_alignment = 0;
18564   while (type->typegroup == 'S') {
18565     ++ctx->head;
18566     ctx->head->field = type->fields;
18567     ctx->head->parent_offset = 0;
18568     type = type->fields->type;
18569   }
18570 }
__Pyx_BufFmt_ParseNumber(const char ** ts)18571 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
18572     int count;
18573     const char* t = *ts;
18574     if (*t < '0' || *t > '9') {
18575       return -1;
18576     } else {
18577         count = *t++ - '0';
18578         while (*t >= '0' && *t <= '9') {
18579             count *= 10;
18580             count += *t++ - '0';
18581         }
18582     }
18583     *ts = t;
18584     return count;
18585 }
__Pyx_BufFmt_ExpectNumber(const char ** ts)18586 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
18587     int number = __Pyx_BufFmt_ParseNumber(ts);
18588     if (number == -1)
18589         PyErr_Format(PyExc_ValueError,\
18590                      "Does not understand character buffer dtype format string ('%c')", **ts);
18591     return number;
18592 }
__Pyx_BufFmt_RaiseUnexpectedChar(char ch)18593 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
18594   PyErr_Format(PyExc_ValueError,
18595                "Unexpected format string character: '%c'", ch);
18596 }
__Pyx_BufFmt_DescribeTypeChar(char ch,int is_complex)18597 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
18598   switch (ch) {
18599     case '?': return "'bool'";
18600     case 'c': return "'char'";
18601     case 'b': return "'signed char'";
18602     case 'B': return "'unsigned char'";
18603     case 'h': return "'short'";
18604     case 'H': return "'unsigned short'";
18605     case 'i': return "'int'";
18606     case 'I': return "'unsigned int'";
18607     case 'l': return "'long'";
18608     case 'L': return "'unsigned long'";
18609     case 'q': return "'long long'";
18610     case 'Q': return "'unsigned long long'";
18611     case 'f': return (is_complex ? "'complex float'" : "'float'");
18612     case 'd': return (is_complex ? "'complex double'" : "'double'");
18613     case 'g': return (is_complex ? "'complex long double'" : "'long double'");
18614     case 'T': return "a struct";
18615     case 'O': return "Python object";
18616     case 'P': return "a pointer";
18617     case 's': case 'p': return "a string";
18618     case 0: return "end";
18619     default: return "unparseable format string";
18620   }
18621 }
__Pyx_BufFmt_TypeCharToStandardSize(char ch,int is_complex)18622 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
18623   switch (ch) {
18624     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
18625     case 'h': case 'H': return 2;
18626     case 'i': case 'I': case 'l': case 'L': return 4;
18627     case 'q': case 'Q': return 8;
18628     case 'f': return (is_complex ? 8 : 4);
18629     case 'd': return (is_complex ? 16 : 8);
18630     case 'g': {
18631       PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
18632       return 0;
18633     }
18634     case 'O': case 'P': return sizeof(void*);
18635     default:
18636       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
18637       return 0;
18638     }
18639 }
__Pyx_BufFmt_TypeCharToNativeSize(char ch,int is_complex)18640 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
18641   switch (ch) {
18642     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
18643     case 'h': case 'H': return sizeof(short);
18644     case 'i': case 'I': return sizeof(int);
18645     case 'l': case 'L': return sizeof(long);
18646     #ifdef HAVE_LONG_LONG
18647     case 'q': case 'Q': return sizeof(PY_LONG_LONG);
18648     #endif
18649     case 'f': return sizeof(float) * (is_complex ? 2 : 1);
18650     case 'd': return sizeof(double) * (is_complex ? 2 : 1);
18651     case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
18652     case 'O': case 'P': return sizeof(void*);
18653     default: {
18654       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
18655       return 0;
18656     }
18657   }
18658 }
18659 typedef struct { char c; short x; } __Pyx_st_short;
18660 typedef struct { char c; int x; } __Pyx_st_int;
18661 typedef struct { char c; long x; } __Pyx_st_long;
18662 typedef struct { char c; float x; } __Pyx_st_float;
18663 typedef struct { char c; double x; } __Pyx_st_double;
18664 typedef struct { char c; long double x; } __Pyx_st_longdouble;
18665 typedef struct { char c; void *x; } __Pyx_st_void_p;
18666 #ifdef HAVE_LONG_LONG
18667 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
18668 #endif
__Pyx_BufFmt_TypeCharToAlignment(char ch,CYTHON_UNUSED int is_complex)18669 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
18670   switch (ch) {
18671     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
18672     case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
18673     case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
18674     case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
18675 #ifdef HAVE_LONG_LONG
18676     case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
18677 #endif
18678     case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
18679     case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
18680     case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
18681     case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
18682     default:
18683       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
18684       return 0;
18685     }
18686 }
18687 /* These are for computing the padding at the end of the struct to align
18688    on the first member of the struct. This will probably the same as above,
18689    but we don't have any guarantees.
18690  */
18691 typedef struct { short x; char c; } __Pyx_pad_short;
18692 typedef struct { int x; char c; } __Pyx_pad_int;
18693 typedef struct { long x; char c; } __Pyx_pad_long;
18694 typedef struct { float x; char c; } __Pyx_pad_float;
18695 typedef struct { double x; char c; } __Pyx_pad_double;
18696 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
18697 typedef struct { void *x; char c; } __Pyx_pad_void_p;
18698 #ifdef HAVE_LONG_LONG
18699 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
18700 #endif
__Pyx_BufFmt_TypeCharToPadding(char ch,CYTHON_UNUSED int is_complex)18701 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
18702   switch (ch) {
18703     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
18704     case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
18705     case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
18706     case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
18707 #ifdef HAVE_LONG_LONG
18708     case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
18709 #endif
18710     case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
18711     case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
18712     case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
18713     case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
18714     default:
18715       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
18716       return 0;
18717     }
18718 }
__Pyx_BufFmt_TypeCharToGroup(char ch,int is_complex)18719 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
18720   switch (ch) {
18721     case 'c':
18722         return 'H';
18723     case 'b': case 'h': case 'i':
18724     case 'l': case 'q': case 's': case 'p':
18725         return 'I';
18726     case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
18727         return 'U';
18728     case 'f': case 'd': case 'g':
18729         return (is_complex ? 'C' : 'R');
18730     case 'O':
18731         return 'O';
18732     case 'P':
18733         return 'P';
18734     default: {
18735       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
18736       return 0;
18737     }
18738   }
18739 }
__Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context * ctx)18740 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
18741   if (ctx->head == NULL || ctx->head->field == &ctx->root) {
18742     const char* expected;
18743     const char* quote;
18744     if (ctx->head == NULL) {
18745       expected = "end";
18746       quote = "";
18747     } else {
18748       expected = ctx->head->field->type->name;
18749       quote = "'";
18750     }
18751     PyErr_Format(PyExc_ValueError,
18752                  "Buffer dtype mismatch, expected %s%s%s but got %s",
18753                  quote, expected, quote,
18754                  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
18755   } else {
18756     __Pyx_StructField* field = ctx->head->field;
18757     __Pyx_StructField* parent = (ctx->head - 1)->field;
18758     PyErr_Format(PyExc_ValueError,
18759                  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
18760                  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
18761                  parent->type->name, field->name);
18762   }
18763 }
__Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context * ctx)18764 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
18765   char group;
18766   size_t size, offset, arraysize = 1;
18767   if (ctx->enc_type == 0) return 0;
18768   if (ctx->head->field->type->arraysize[0]) {
18769     int i, ndim = 0;
18770     if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
18771         ctx->is_valid_array = ctx->head->field->type->ndim == 1;
18772         ndim = 1;
18773         if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
18774             PyErr_Format(PyExc_ValueError,
18775                          "Expected a dimension of size %zu, got %zu",
18776                          ctx->head->field->type->arraysize[0], ctx->enc_count);
18777             return -1;
18778         }
18779     }
18780     if (!ctx->is_valid_array) {
18781       PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
18782                    ctx->head->field->type->ndim, ndim);
18783       return -1;
18784     }
18785     for (i = 0; i < ctx->head->field->type->ndim; i++) {
18786       arraysize *= ctx->head->field->type->arraysize[i];
18787     }
18788     ctx->is_valid_array = 0;
18789     ctx->enc_count = 1;
18790   }
18791   group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
18792   do {
18793     __Pyx_StructField* field = ctx->head->field;
18794     __Pyx_TypeInfo* type = field->type;
18795     if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
18796       size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
18797     } else {
18798       size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
18799     }
18800     if (ctx->enc_packmode == '@') {
18801       size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
18802       size_t align_mod_offset;
18803       if (align_at == 0) return -1;
18804       align_mod_offset = ctx->fmt_offset % align_at;
18805       if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
18806       if (ctx->struct_alignment == 0)
18807           ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
18808                                                                  ctx->is_complex);
18809     }
18810     if (type->size != size || type->typegroup != group) {
18811       if (type->typegroup == 'C' && type->fields != NULL) {
18812         size_t parent_offset = ctx->head->parent_offset + field->offset;
18813         ++ctx->head;
18814         ctx->head->field = type->fields;
18815         ctx->head->parent_offset = parent_offset;
18816         continue;
18817       }
18818       if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
18819       } else {
18820           __Pyx_BufFmt_RaiseExpected(ctx);
18821           return -1;
18822       }
18823     }
18824     offset = ctx->head->parent_offset + field->offset;
18825     if (ctx->fmt_offset != offset) {
18826       PyErr_Format(PyExc_ValueError,
18827                    "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
18828                    (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
18829       return -1;
18830     }
18831     ctx->fmt_offset += size;
18832     if (arraysize)
18833       ctx->fmt_offset += (arraysize - 1) * size;
18834     --ctx->enc_count;
18835     while (1) {
18836       if (field == &ctx->root) {
18837         ctx->head = NULL;
18838         if (ctx->enc_count != 0) {
18839           __Pyx_BufFmt_RaiseExpected(ctx);
18840           return -1;
18841         }
18842         break;
18843       }
18844       ctx->head->field = ++field;
18845       if (field->type == NULL) {
18846         --ctx->head;
18847         field = ctx->head->field;
18848         continue;
18849       } else if (field->type->typegroup == 'S') {
18850         size_t parent_offset = ctx->head->parent_offset + field->offset;
18851         if (field->type->fields->type == NULL) continue;
18852         field = field->type->fields;
18853         ++ctx->head;
18854         ctx->head->field = field;
18855         ctx->head->parent_offset = parent_offset;
18856         break;
18857       } else {
18858         break;
18859       }
18860     }
18861   } while (ctx->enc_count);
18862   ctx->enc_type = 0;
18863   ctx->is_complex = 0;
18864   return 0;
18865 }
18866 static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context * ctx,const char ** tsp)18867 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
18868 {
18869     const char *ts = *tsp;
18870     int i = 0, number, ndim;
18871     ++ts;
18872     if (ctx->new_count != 1) {
18873         PyErr_SetString(PyExc_ValueError,
18874                         "Cannot handle repeated arrays in format string");
18875         return NULL;
18876     }
18877     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
18878     ndim = ctx->head->field->type->ndim;
18879     while (*ts && *ts != ')') {
18880         switch (*ts) {
18881             case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
18882             default:  break;
18883         }
18884         number = __Pyx_BufFmt_ExpectNumber(&ts);
18885         if (number == -1) return NULL;
18886         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
18887             return PyErr_Format(PyExc_ValueError,
18888                         "Expected a dimension of size %zu, got %d",
18889                         ctx->head->field->type->arraysize[i], number);
18890         if (*ts != ',' && *ts != ')')
18891             return PyErr_Format(PyExc_ValueError,
18892                                 "Expected a comma in format string, got '%c'", *ts);
18893         if (*ts == ',') ts++;
18894         i++;
18895     }
18896     if (i != ndim)
18897         return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
18898                             ctx->head->field->type->ndim, i);
18899     if (!*ts) {
18900         PyErr_SetString(PyExc_ValueError,
18901                         "Unexpected end of format string, expected ')'");
18902         return NULL;
18903     }
18904     ctx->is_valid_array = 1;
18905     ctx->new_count = 1;
18906     *tsp = ++ts;
18907     return Py_None;
18908 }
__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context * ctx,const char * ts)18909 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
18910   int got_Z = 0;
18911   while (1) {
18912     switch(*ts) {
18913       case 0:
18914         if (ctx->enc_type != 0 && ctx->head == NULL) {
18915           __Pyx_BufFmt_RaiseExpected(ctx);
18916           return NULL;
18917         }
18918         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
18919         if (ctx->head != NULL) {
18920           __Pyx_BufFmt_RaiseExpected(ctx);
18921           return NULL;
18922         }
18923         return ts;
18924       case ' ':
18925       case '\r':
18926       case '\n':
18927         ++ts;
18928         break;
18929       case '<':
18930         if (!__Pyx_Is_Little_Endian()) {
18931           PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
18932           return NULL;
18933         }
18934         ctx->new_packmode = '=';
18935         ++ts;
18936         break;
18937       case '>':
18938       case '!':
18939         if (__Pyx_Is_Little_Endian()) {
18940           PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
18941           return NULL;
18942         }
18943         ctx->new_packmode = '=';
18944         ++ts;
18945         break;
18946       case '=':
18947       case '@':
18948       case '^':
18949         ctx->new_packmode = *ts++;
18950         break;
18951       case 'T':
18952         {
18953           const char* ts_after_sub;
18954           size_t i, struct_count = ctx->new_count;
18955           size_t struct_alignment = ctx->struct_alignment;
18956           ctx->new_count = 1;
18957           ++ts;
18958           if (*ts != '{') {
18959             PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
18960             return NULL;
18961           }
18962           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
18963           ctx->enc_type = 0;
18964           ctx->enc_count = 0;
18965           ctx->struct_alignment = 0;
18966           ++ts;
18967           ts_after_sub = ts;
18968           for (i = 0; i != struct_count; ++i) {
18969             ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
18970             if (!ts_after_sub) return NULL;
18971           }
18972           ts = ts_after_sub;
18973           if (struct_alignment) ctx->struct_alignment = struct_alignment;
18974         }
18975         break;
18976       case '}':
18977         {
18978           size_t alignment = ctx->struct_alignment;
18979           ++ts;
18980           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
18981           ctx->enc_type = 0;
18982           if (alignment && ctx->fmt_offset % alignment) {
18983             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
18984           }
18985         }
18986         return ts;
18987       case 'x':
18988         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
18989         ctx->fmt_offset += ctx->new_count;
18990         ctx->new_count = 1;
18991         ctx->enc_count = 0;
18992         ctx->enc_type = 0;
18993         ctx->enc_packmode = ctx->new_packmode;
18994         ++ts;
18995         break;
18996       case 'Z':
18997         got_Z = 1;
18998         ++ts;
18999         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
19000           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
19001           return NULL;
19002         }
19003         CYTHON_FALLTHROUGH;
19004       case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
19005       case 'l': case 'L': case 'q': case 'Q':
19006       case 'f': case 'd': case 'g':
19007       case 'O': case 'p':
19008         if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
19009             (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
19010           ctx->enc_count += ctx->new_count;
19011           ctx->new_count = 1;
19012           got_Z = 0;
19013           ++ts;
19014           break;
19015         }
19016         CYTHON_FALLTHROUGH;
19017       case 's':
19018         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
19019         ctx->enc_count = ctx->new_count;
19020         ctx->enc_packmode = ctx->new_packmode;
19021         ctx->enc_type = *ts;
19022         ctx->is_complex = got_Z;
19023         ++ts;
19024         ctx->new_count = 1;
19025         got_Z = 0;
19026         break;
19027       case ':':
19028         ++ts;
19029         while(*ts != ':') ++ts;
19030         ++ts;
19031         break;
19032       case '(':
19033         if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
19034         break;
19035       default:
19036         {
19037           int number = __Pyx_BufFmt_ExpectNumber(&ts);
19038           if (number == -1) return NULL;
19039           ctx->new_count = (size_t)number;
19040         }
19041     }
19042   }
19043 }
19044 
19045 /* BufferGetAndValidate */
__Pyx_SafeReleaseBuffer(Py_buffer * info)19046   static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
19047   if (unlikely(info->buf == NULL)) return;
19048   if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
19049   __Pyx_ReleaseBuffer(info);
19050 }
__Pyx_ZeroBuffer(Py_buffer * buf)19051 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
19052   buf->buf = NULL;
19053   buf->obj = NULL;
19054   buf->strides = __Pyx_zeros;
19055   buf->shape = __Pyx_zeros;
19056   buf->suboffsets = __Pyx_minusones;
19057 }
__Pyx__GetBufferAndValidate(Py_buffer * buf,PyObject * obj,__Pyx_TypeInfo * dtype,int flags,int nd,int cast,__Pyx_BufFmt_StackElem * stack)19058 static int __Pyx__GetBufferAndValidate(
19059         Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
19060         int nd, int cast, __Pyx_BufFmt_StackElem* stack)
19061 {
19062   buf->buf = NULL;
19063   if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
19064     __Pyx_ZeroBuffer(buf);
19065     return -1;
19066   }
19067   if (unlikely(buf->ndim != nd)) {
19068     PyErr_Format(PyExc_ValueError,
19069                  "Buffer has wrong number of dimensions (expected %d, got %d)",
19070                  nd, buf->ndim);
19071     goto fail;
19072   }
19073   if (!cast) {
19074     __Pyx_BufFmt_Context ctx;
19075     __Pyx_BufFmt_Init(&ctx, stack, dtype);
19076     if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
19077   }
19078   if (unlikely((size_t)buf->itemsize != dtype->size)) {
19079     PyErr_Format(PyExc_ValueError,
19080       "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
19081       buf->itemsize, (buf->itemsize > 1) ? "s" : "",
19082       dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
19083     goto fail;
19084   }
19085   if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
19086   return 0;
19087 fail:;
19088   __Pyx_SafeReleaseBuffer(buf);
19089   return -1;
19090 }
19091 
19092 /* BufferIndexError */
__Pyx_RaiseBufferIndexError(int axis)19093   static void __Pyx_RaiseBufferIndexError(int axis) {
19094   PyErr_Format(PyExc_IndexError,
19095      "Out of bounds on buffer access (axis %d)", axis);
19096 }
19097 
19098 /* PyFunctionFastCall */
19099   #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)19100 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
19101                                                PyObject *globals) {
19102     PyFrameObject *f;
19103     PyThreadState *tstate = __Pyx_PyThreadState_Current;
19104     PyObject **fastlocals;
19105     Py_ssize_t i;
19106     PyObject *result;
19107     assert(globals != NULL);
19108     /* XXX Perhaps we should create a specialized
19109        PyFrame_New() that doesn't take locals, but does
19110        take builtins without sanity checking them.
19111        */
19112     assert(tstate != NULL);
19113     f = PyFrame_New(tstate, co, globals, NULL);
19114     if (f == NULL) {
19115         return NULL;
19116     }
19117     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
19118     for (i = 0; i < na; i++) {
19119         Py_INCREF(*args);
19120         fastlocals[i] = *args++;
19121     }
19122     result = PyEval_EvalFrameEx(f,0);
19123     ++tstate->recursion_depth;
19124     Py_DECREF(f);
19125     --tstate->recursion_depth;
19126     return result;
19127 }
19128 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)19129 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
19130     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
19131     PyObject *globals = PyFunction_GET_GLOBALS(func);
19132     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
19133     PyObject *closure;
19134 #if PY_MAJOR_VERSION >= 3
19135     PyObject *kwdefs;
19136 #endif
19137     PyObject *kwtuple, **k;
19138     PyObject **d;
19139     Py_ssize_t nd;
19140     Py_ssize_t nk;
19141     PyObject *result;
19142     assert(kwargs == NULL || PyDict_Check(kwargs));
19143     nk = kwargs ? PyDict_Size(kwargs) : 0;
19144     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
19145         return NULL;
19146     }
19147     if (
19148 #if PY_MAJOR_VERSION >= 3
19149             co->co_kwonlyargcount == 0 &&
19150 #endif
19151             likely(kwargs == NULL || nk == 0) &&
19152             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
19153         if (argdefs == NULL && co->co_argcount == nargs) {
19154             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
19155             goto done;
19156         }
19157         else if (nargs == 0 && argdefs != NULL
19158                  && co->co_argcount == Py_SIZE(argdefs)) {
19159             /* function called with no arguments, but all parameters have
19160                a default value: use default values as arguments .*/
19161             args = &PyTuple_GET_ITEM(argdefs, 0);
19162             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
19163             goto done;
19164         }
19165     }
19166     if (kwargs != NULL) {
19167         Py_ssize_t pos, i;
19168         kwtuple = PyTuple_New(2 * nk);
19169         if (kwtuple == NULL) {
19170             result = NULL;
19171             goto done;
19172         }
19173         k = &PyTuple_GET_ITEM(kwtuple, 0);
19174         pos = i = 0;
19175         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
19176             Py_INCREF(k[i]);
19177             Py_INCREF(k[i+1]);
19178             i += 2;
19179         }
19180         nk = i / 2;
19181     }
19182     else {
19183         kwtuple = NULL;
19184         k = NULL;
19185     }
19186     closure = PyFunction_GET_CLOSURE(func);
19187 #if PY_MAJOR_VERSION >= 3
19188     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
19189 #endif
19190     if (argdefs != NULL) {
19191         d = &PyTuple_GET_ITEM(argdefs, 0);
19192         nd = Py_SIZE(argdefs);
19193     }
19194     else {
19195         d = NULL;
19196         nd = 0;
19197     }
19198 #if PY_MAJOR_VERSION >= 3
19199     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
19200                                args, (int)nargs,
19201                                k, (int)nk,
19202                                d, (int)nd, kwdefs, closure);
19203 #else
19204     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
19205                                args, (int)nargs,
19206                                k, (int)nk,
19207                                d, (int)nd, closure);
19208 #endif
19209     Py_XDECREF(kwtuple);
19210 done:
19211     Py_LeaveRecursiveCall();
19212     return result;
19213 }
19214 #endif
19215 #endif
19216 
19217 /* PyCFunctionFastCall */
19218   #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)19219 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
19220     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
19221     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
19222     PyObject *self = PyCFunction_GET_SELF(func);
19223     int flags = PyCFunction_GET_FLAGS(func);
19224     assert(PyCFunction_Check(func));
19225     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
19226     assert(nargs >= 0);
19227     assert(nargs == 0 || args != NULL);
19228     /* _PyCFunction_FastCallDict() must not be called with an exception set,
19229        because it may clear it (directly or indirectly) and so the
19230        caller loses its exception */
19231     assert(!PyErr_Occurred());
19232     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
19233         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
19234     } else {
19235         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
19236     }
19237 }
19238 #endif
19239 
19240 /* PyObjectCallMethO */
19241   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)19242 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
19243     PyObject *self, *result;
19244     PyCFunction cfunc;
19245     cfunc = PyCFunction_GET_FUNCTION(func);
19246     self = PyCFunction_GET_SELF(func);
19247     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
19248         return NULL;
19249     result = cfunc(self, arg);
19250     Py_LeaveRecursiveCall();
19251     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
19252         PyErr_SetString(
19253             PyExc_SystemError,
19254             "NULL result without error in PyObject_Call");
19255     }
19256     return result;
19257 }
19258 #endif
19259 
19260 /* PyObjectCallNoArg */
19261   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallNoArg(PyObject * func)19262 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
19263 #if CYTHON_FAST_PYCALL
19264     if (PyFunction_Check(func)) {
19265         return __Pyx_PyFunction_FastCall(func, NULL, 0);
19266     }
19267 #endif
19268 #ifdef __Pyx_CyFunction_USED
19269     if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
19270 #else
19271     if (likely(PyCFunction_Check(func)))
19272 #endif
19273     {
19274         if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
19275             return __Pyx_PyObject_CallMethO(func, NULL);
19276         }
19277     }
19278     return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
19279 }
19280 #endif
19281 
19282 /* PyObjectCallOneArg */
19283   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)19284 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
19285     PyObject *result;
19286     PyObject *args = PyTuple_New(1);
19287     if (unlikely(!args)) return NULL;
19288     Py_INCREF(arg);
19289     PyTuple_SET_ITEM(args, 0, arg);
19290     result = __Pyx_PyObject_Call(func, args, NULL);
19291     Py_DECREF(args);
19292     return result;
19293 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)19294 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
19295 #if CYTHON_FAST_PYCALL
19296     if (PyFunction_Check(func)) {
19297         return __Pyx_PyFunction_FastCall(func, &arg, 1);
19298     }
19299 #endif
19300     if (likely(PyCFunction_Check(func))) {
19301         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
19302             return __Pyx_PyObject_CallMethO(func, arg);
19303 #if CYTHON_FAST_PYCCALL
19304         } else if (__Pyx_PyFastCFunction_Check(func)) {
19305             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
19306 #endif
19307         }
19308     }
19309     return __Pyx__PyObject_CallOneArg(func, arg);
19310 }
19311 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)19312 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
19313     PyObject *result;
19314     PyObject *args = PyTuple_Pack(1, arg);
19315     if (unlikely(!args)) return NULL;
19316     result = __Pyx_PyObject_Call(func, args, NULL);
19317     Py_DECREF(args);
19318     return result;
19319 }
19320 #endif
19321 
19322 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)19323   static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
19324     PyObject *args, *result = NULL;
19325     #if CYTHON_FAST_PYCALL
19326     if (PyFunction_Check(function)) {
19327         PyObject *args[2] = {arg1, arg2};
19328         return __Pyx_PyFunction_FastCall(function, args, 2);
19329     }
19330     #endif
19331     #if CYTHON_FAST_PYCCALL
19332     if (__Pyx_PyFastCFunction_Check(function)) {
19333         PyObject *args[2] = {arg1, arg2};
19334         return __Pyx_PyCFunction_FastCall(function, args, 2);
19335     }
19336     #endif
19337     args = PyTuple_New(2);
19338     if (unlikely(!args)) goto done;
19339     Py_INCREF(arg1);
19340     PyTuple_SET_ITEM(args, 0, arg1);
19341     Py_INCREF(arg2);
19342     PyTuple_SET_ITEM(args, 1, arg2);
19343     Py_INCREF(function);
19344     result = __Pyx_PyObject_Call(function, args, NULL);
19345     Py_DECREF(args);
19346     Py_DECREF(function);
19347 done:
19348     return result;
19349 }
19350 
19351 /* PyObjectGetMethod */
__Pyx_PyObject_GetMethod(PyObject * obj,PyObject * name,PyObject ** method)19352   static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
19353     PyObject *attr;
19354 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
19355     PyTypeObject *tp = Py_TYPE(obj);
19356     PyObject *descr;
19357     descrgetfunc f = NULL;
19358     PyObject **dictptr, *dict;
19359     int meth_found = 0;
19360     assert (*method == NULL);
19361     if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
19362         attr = __Pyx_PyObject_GetAttrStr(obj, name);
19363         goto try_unpack;
19364     }
19365     if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
19366         return 0;
19367     }
19368     descr = _PyType_Lookup(tp, name);
19369     if (likely(descr != NULL)) {
19370         Py_INCREF(descr);
19371 #if PY_MAJOR_VERSION >= 3
19372         #ifdef __Pyx_CyFunction_USED
19373         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
19374         #else
19375         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
19376         #endif
19377 #else
19378         #ifdef __Pyx_CyFunction_USED
19379         if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
19380         #else
19381         if (likely(PyFunction_Check(descr)))
19382         #endif
19383 #endif
19384         {
19385             meth_found = 1;
19386         } else {
19387             f = Py_TYPE(descr)->tp_descr_get;
19388             if (f != NULL && PyDescr_IsData(descr)) {
19389                 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
19390                 Py_DECREF(descr);
19391                 goto try_unpack;
19392             }
19393         }
19394     }
19395     dictptr = _PyObject_GetDictPtr(obj);
19396     if (dictptr != NULL && (dict = *dictptr) != NULL) {
19397         Py_INCREF(dict);
19398         attr = __Pyx_PyDict_GetItemStr(dict, name);
19399         if (attr != NULL) {
19400             Py_INCREF(attr);
19401             Py_DECREF(dict);
19402             Py_XDECREF(descr);
19403             goto try_unpack;
19404         }
19405         Py_DECREF(dict);
19406     }
19407     if (meth_found) {
19408         *method = descr;
19409         return 1;
19410     }
19411     if (f != NULL) {
19412         attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
19413         Py_DECREF(descr);
19414         goto try_unpack;
19415     }
19416     if (descr != NULL) {
19417         *method = descr;
19418         return 0;
19419     }
19420     PyErr_Format(PyExc_AttributeError,
19421 #if PY_MAJOR_VERSION >= 3
19422                  "'%.50s' object has no attribute '%U'",
19423                  tp->tp_name, name);
19424 #else
19425                  "'%.50s' object has no attribute '%.400s'",
19426                  tp->tp_name, PyString_AS_STRING(name));
19427 #endif
19428     return 0;
19429 #else
19430     attr = __Pyx_PyObject_GetAttrStr(obj, name);
19431     goto try_unpack;
19432 #endif
19433 try_unpack:
19434 #if CYTHON_UNPACK_METHODS
19435     if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
19436         PyObject *function = PyMethod_GET_FUNCTION(attr);
19437         Py_INCREF(function);
19438         Py_DECREF(attr);
19439         *method = function;
19440         return 1;
19441     }
19442 #endif
19443     *method = attr;
19444     return 0;
19445 }
19446 
19447 /* PyObjectCallMethod1 */
__Pyx__PyObject_CallMethod1(PyObject * method,PyObject * arg)19448   static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
19449     PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
19450     Py_DECREF(method);
19451     return result;
19452 }
__Pyx_PyObject_CallMethod1(PyObject * obj,PyObject * method_name,PyObject * arg)19453 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
19454     PyObject *method = NULL, *result;
19455     int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
19456     if (likely(is_method)) {
19457         result = __Pyx_PyObject_Call2Args(method, obj, arg);
19458         Py_DECREF(method);
19459         return result;
19460     }
19461     if (unlikely(!method)) return NULL;
19462     return __Pyx__PyObject_CallMethod1(method, arg);
19463 }
19464 
19465 /* append */
__Pyx_PyObject_Append(PyObject * L,PyObject * x)19466   static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
19467     if (likely(PyList_CheckExact(L))) {
19468         if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
19469     } else {
19470         PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
19471         if (unlikely(!retval))
19472             return -1;
19473         Py_DECREF(retval);
19474     }
19475     return 0;
19476 }
19477 
19478 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)19479   static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
19480     PyErr_Format(PyExc_ValueError,
19481                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
19482 }
19483 
19484 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)19485   static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
19486     PyErr_Format(PyExc_ValueError,
19487                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
19488                  index, (index == 1) ? "" : "s");
19489 }
19490 
19491 /* IterFinish */
__Pyx_IterFinish(void)19492   static CYTHON_INLINE int __Pyx_IterFinish(void) {
19493 #if CYTHON_FAST_THREAD_STATE
19494     PyThreadState *tstate = __Pyx_PyThreadState_Current;
19495     PyObject* exc_type = tstate->curexc_type;
19496     if (unlikely(exc_type)) {
19497         if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
19498             PyObject *exc_value, *exc_tb;
19499             exc_value = tstate->curexc_value;
19500             exc_tb = tstate->curexc_traceback;
19501             tstate->curexc_type = 0;
19502             tstate->curexc_value = 0;
19503             tstate->curexc_traceback = 0;
19504             Py_DECREF(exc_type);
19505             Py_XDECREF(exc_value);
19506             Py_XDECREF(exc_tb);
19507             return 0;
19508         } else {
19509             return -1;
19510         }
19511     }
19512     return 0;
19513 #else
19514     if (unlikely(PyErr_Occurred())) {
19515         if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
19516             PyErr_Clear();
19517             return 0;
19518         } else {
19519             return -1;
19520         }
19521     }
19522     return 0;
19523 #endif
19524 }
19525 
19526 /* UnpackItemEndCheck */
__Pyx_IternextUnpackEndCheck(PyObject * retval,Py_ssize_t expected)19527   static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
19528     if (unlikely(retval)) {
19529         Py_DECREF(retval);
19530         __Pyx_RaiseTooManyValuesError(expected);
19531         return -1;
19532     } else {
19533         return __Pyx_IterFinish();
19534     }
19535     return 0;
19536 }
19537 
19538 /* None */
__Pyx_div_long(long a,long b)19539   static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
19540     long q = a / b;
19541     long r = a - q*b;
19542     q -= ((r != 0) & ((r ^ b) < 0));
19543     return q;
19544 }
19545 
19546 /* RaiseException */
19547   #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)19548 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
19549                         CYTHON_UNUSED PyObject *cause) {
19550     __Pyx_PyThreadState_declare
19551     Py_XINCREF(type);
19552     if (!value || value == Py_None)
19553         value = NULL;
19554     else
19555         Py_INCREF(value);
19556     if (!tb || tb == Py_None)
19557         tb = NULL;
19558     else {
19559         Py_INCREF(tb);
19560         if (!PyTraceBack_Check(tb)) {
19561             PyErr_SetString(PyExc_TypeError,
19562                 "raise: arg 3 must be a traceback or None");
19563             goto raise_error;
19564         }
19565     }
19566     if (PyType_Check(type)) {
19567 #if CYTHON_COMPILING_IN_PYPY
19568         if (!value) {
19569             Py_INCREF(Py_None);
19570             value = Py_None;
19571         }
19572 #endif
19573         PyErr_NormalizeException(&type, &value, &tb);
19574     } else {
19575         if (value) {
19576             PyErr_SetString(PyExc_TypeError,
19577                 "instance exception may not have a separate value");
19578             goto raise_error;
19579         }
19580         value = type;
19581         type = (PyObject*) Py_TYPE(type);
19582         Py_INCREF(type);
19583         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
19584             PyErr_SetString(PyExc_TypeError,
19585                 "raise: exception class must be a subclass of BaseException");
19586             goto raise_error;
19587         }
19588     }
19589     __Pyx_PyThreadState_assign
19590     __Pyx_ErrRestore(type, value, tb);
19591     return;
19592 raise_error:
19593     Py_XDECREF(value);
19594     Py_XDECREF(type);
19595     Py_XDECREF(tb);
19596     return;
19597 }
19598 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)19599 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
19600     PyObject* owned_instance = NULL;
19601     if (tb == Py_None) {
19602         tb = 0;
19603     } else if (tb && !PyTraceBack_Check(tb)) {
19604         PyErr_SetString(PyExc_TypeError,
19605             "raise: arg 3 must be a traceback or None");
19606         goto bad;
19607     }
19608     if (value == Py_None)
19609         value = 0;
19610     if (PyExceptionInstance_Check(type)) {
19611         if (value) {
19612             PyErr_SetString(PyExc_TypeError,
19613                 "instance exception may not have a separate value");
19614             goto bad;
19615         }
19616         value = type;
19617         type = (PyObject*) Py_TYPE(value);
19618     } else if (PyExceptionClass_Check(type)) {
19619         PyObject *instance_class = NULL;
19620         if (value && PyExceptionInstance_Check(value)) {
19621             instance_class = (PyObject*) Py_TYPE(value);
19622             if (instance_class != type) {
19623                 int is_subclass = PyObject_IsSubclass(instance_class, type);
19624                 if (!is_subclass) {
19625                     instance_class = NULL;
19626                 } else if (unlikely(is_subclass == -1)) {
19627                     goto bad;
19628                 } else {
19629                     type = instance_class;
19630                 }
19631             }
19632         }
19633         if (!instance_class) {
19634             PyObject *args;
19635             if (!value)
19636                 args = PyTuple_New(0);
19637             else if (PyTuple_Check(value)) {
19638                 Py_INCREF(value);
19639                 args = value;
19640             } else
19641                 args = PyTuple_Pack(1, value);
19642             if (!args)
19643                 goto bad;
19644             owned_instance = PyObject_Call(type, args, NULL);
19645             Py_DECREF(args);
19646             if (!owned_instance)
19647                 goto bad;
19648             value = owned_instance;
19649             if (!PyExceptionInstance_Check(value)) {
19650                 PyErr_Format(PyExc_TypeError,
19651                              "calling %R should have returned an instance of "
19652                              "BaseException, not %R",
19653                              type, Py_TYPE(value));
19654                 goto bad;
19655             }
19656         }
19657     } else {
19658         PyErr_SetString(PyExc_TypeError,
19659             "raise: exception class must be a subclass of BaseException");
19660         goto bad;
19661     }
19662     if (cause) {
19663         PyObject *fixed_cause;
19664         if (cause == Py_None) {
19665             fixed_cause = NULL;
19666         } else if (PyExceptionClass_Check(cause)) {
19667             fixed_cause = PyObject_CallObject(cause, NULL);
19668             if (fixed_cause == NULL)
19669                 goto bad;
19670         } else if (PyExceptionInstance_Check(cause)) {
19671             fixed_cause = cause;
19672             Py_INCREF(fixed_cause);
19673         } else {
19674             PyErr_SetString(PyExc_TypeError,
19675                             "exception causes must derive from "
19676                             "BaseException");
19677             goto bad;
19678         }
19679         PyException_SetCause(value, fixed_cause);
19680     }
19681     PyErr_SetObject(type, value);
19682     if (tb) {
19683 #if CYTHON_COMPILING_IN_PYPY
19684         PyObject *tmp_type, *tmp_value, *tmp_tb;
19685         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
19686         Py_INCREF(tb);
19687         PyErr_Restore(tmp_type, tmp_value, tb);
19688         Py_XDECREF(tmp_tb);
19689 #else
19690         PyThreadState *tstate = __Pyx_PyThreadState_Current;
19691         PyObject* tmp_tb = tstate->curexc_traceback;
19692         if (tb != tmp_tb) {
19693             Py_INCREF(tb);
19694             tstate->curexc_traceback = tb;
19695             Py_XDECREF(tmp_tb);
19696         }
19697 #endif
19698     }
19699 bad:
19700     Py_XDECREF(owned_instance);
19701     return;
19702 }
19703 #endif
19704 
19705 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)19706   static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
19707     PyObject *r;
19708     if (!j) return NULL;
19709     r = PyObject_GetItem(o, j);
19710     Py_DECREF(j);
19711     return r;
19712 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)19713 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
19714                                                               CYTHON_NCP_UNUSED int wraparound,
19715                                                               CYTHON_NCP_UNUSED int boundscheck) {
19716 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19717     Py_ssize_t wrapped_i = i;
19718     if (wraparound & unlikely(i < 0)) {
19719         wrapped_i += PyList_GET_SIZE(o);
19720     }
19721     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
19722         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
19723         Py_INCREF(r);
19724         return r;
19725     }
19726     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
19727 #else
19728     return PySequence_GetItem(o, i);
19729 #endif
19730 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)19731 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
19732                                                               CYTHON_NCP_UNUSED int wraparound,
19733                                                               CYTHON_NCP_UNUSED int boundscheck) {
19734 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19735     Py_ssize_t wrapped_i = i;
19736     if (wraparound & unlikely(i < 0)) {
19737         wrapped_i += PyTuple_GET_SIZE(o);
19738     }
19739     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
19740         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
19741         Py_INCREF(r);
19742         return r;
19743     }
19744     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
19745 #else
19746     return PySequence_GetItem(o, i);
19747 #endif
19748 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)19749 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
19750                                                      CYTHON_NCP_UNUSED int wraparound,
19751                                                      CYTHON_NCP_UNUSED int boundscheck) {
19752 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
19753     if (is_list || PyList_CheckExact(o)) {
19754         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
19755         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
19756             PyObject *r = PyList_GET_ITEM(o, n);
19757             Py_INCREF(r);
19758             return r;
19759         }
19760     }
19761     else if (PyTuple_CheckExact(o)) {
19762         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
19763         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
19764             PyObject *r = PyTuple_GET_ITEM(o, n);
19765             Py_INCREF(r);
19766             return r;
19767         }
19768     } else {
19769         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
19770         if (likely(m && m->sq_item)) {
19771             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
19772                 Py_ssize_t l = m->sq_length(o);
19773                 if (likely(l >= 0)) {
19774                     i += l;
19775                 } else {
19776                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
19777                         return NULL;
19778                     PyErr_Clear();
19779                 }
19780             }
19781             return m->sq_item(o, i);
19782         }
19783     }
19784 #else
19785     if (is_list || PySequence_Check(o)) {
19786         return PySequence_GetItem(o, i);
19787     }
19788 #endif
19789     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
19790 }
19791 
19792 /* PyIntBinop */
19793   #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_SubtractObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)19794 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
19795     (void)inplace;
19796     (void)zerodivision_check;
19797     #if PY_MAJOR_VERSION < 3
19798     if (likely(PyInt_CheckExact(op1))) {
19799         const long b = intval;
19800         long x;
19801         long a = PyInt_AS_LONG(op1);
19802             x = (long)((unsigned long)a - b);
19803             if (likely((x^a) >= 0 || (x^~b) >= 0))
19804                 return PyInt_FromLong(x);
19805             return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
19806     }
19807     #endif
19808     #if CYTHON_USE_PYLONG_INTERNALS
19809     if (likely(PyLong_CheckExact(op1))) {
19810         const long b = intval;
19811         long a, x;
19812 #ifdef HAVE_LONG_LONG
19813         const PY_LONG_LONG llb = intval;
19814         PY_LONG_LONG lla, llx;
19815 #endif
19816         const digit* digits = ((PyLongObject*)op1)->ob_digit;
19817         const Py_ssize_t size = Py_SIZE(op1);
19818         if (likely(__Pyx_sst_abs(size) <= 1)) {
19819             a = likely(size) ? digits[0] : 0;
19820             if (size == -1) a = -a;
19821         } else {
19822             switch (size) {
19823                 case -2:
19824                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
19825                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
19826                         break;
19827 #ifdef HAVE_LONG_LONG
19828                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
19829                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
19830                         goto long_long;
19831 #endif
19832                     }
19833                     CYTHON_FALLTHROUGH;
19834                 case 2:
19835                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
19836                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
19837                         break;
19838 #ifdef HAVE_LONG_LONG
19839                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
19840                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
19841                         goto long_long;
19842 #endif
19843                     }
19844                     CYTHON_FALLTHROUGH;
19845                 case -3:
19846                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
19847                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
19848                         break;
19849 #ifdef HAVE_LONG_LONG
19850                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
19851                         lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
19852                         goto long_long;
19853 #endif
19854                     }
19855                     CYTHON_FALLTHROUGH;
19856                 case 3:
19857                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
19858                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
19859                         break;
19860 #ifdef HAVE_LONG_LONG
19861                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
19862                         lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
19863                         goto long_long;
19864 #endif
19865                     }
19866                     CYTHON_FALLTHROUGH;
19867                 case -4:
19868                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
19869                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
19870                         break;
19871 #ifdef HAVE_LONG_LONG
19872                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
19873                         lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
19874                         goto long_long;
19875 #endif
19876                     }
19877                     CYTHON_FALLTHROUGH;
19878                 case 4:
19879                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
19880                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
19881                         break;
19882 #ifdef HAVE_LONG_LONG
19883                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
19884                         lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
19885                         goto long_long;
19886 #endif
19887                     }
19888                     CYTHON_FALLTHROUGH;
19889                 default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
19890             }
19891         }
19892                 x = a - b;
19893             return PyLong_FromLong(x);
19894 #ifdef HAVE_LONG_LONG
19895         long_long:
19896                 llx = lla - llb;
19897             return PyLong_FromLongLong(llx);
19898 #endif
19899 
19900 
19901     }
19902     #endif
19903     if (PyFloat_CheckExact(op1)) {
19904         const long b = intval;
19905         double a = PyFloat_AS_DOUBLE(op1);
19906             double result;
19907             PyFPE_START_PROTECT("subtract", return NULL)
19908             result = ((double)a) - (double)b;
19909             PyFPE_END_PROTECT(result)
19910             return PyFloat_FromDouble(result);
19911     }
19912     return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
19913 }
19914 #endif
19915 
19916 /* PyIntCompare */
__Pyx_PyInt_EqObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,CYTHON_UNUSED long inplace)19917   static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
19918     if (op1 == op2) {
19919         Py_RETURN_TRUE;
19920     }
19921     #if PY_MAJOR_VERSION < 3
19922     if (likely(PyInt_CheckExact(op1))) {
19923         const long b = intval;
19924         long a = PyInt_AS_LONG(op1);
19925         if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
19926     }
19927     #endif
19928     #if CYTHON_USE_PYLONG_INTERNALS
19929     if (likely(PyLong_CheckExact(op1))) {
19930         int unequal;
19931         unsigned long uintval;
19932         Py_ssize_t size = Py_SIZE(op1);
19933         const digit* digits = ((PyLongObject*)op1)->ob_digit;
19934         if (intval == 0) {
19935             if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
19936         } else if (intval < 0) {
19937             if (size >= 0)
19938                 Py_RETURN_FALSE;
19939             intval = -intval;
19940             size = -size;
19941         } else {
19942             if (size <= 0)
19943                 Py_RETURN_FALSE;
19944         }
19945         uintval = (unsigned long) intval;
19946 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
19947         if (uintval >> (PyLong_SHIFT * 4)) {
19948             unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
19949                  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
19950         } else
19951 #endif
19952 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
19953         if (uintval >> (PyLong_SHIFT * 3)) {
19954             unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
19955                  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
19956         } else
19957 #endif
19958 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
19959         if (uintval >> (PyLong_SHIFT * 2)) {
19960             unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
19961                  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
19962         } else
19963 #endif
19964 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
19965         if (uintval >> (PyLong_SHIFT * 1)) {
19966             unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
19967                  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
19968         } else
19969 #endif
19970             unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
19971         if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
19972     }
19973     #endif
19974     if (PyFloat_CheckExact(op1)) {
19975         const long b = intval;
19976         double a = PyFloat_AS_DOUBLE(op1);
19977         if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
19978     }
19979     return (
19980         PyObject_RichCompare(op1, op2, Py_EQ));
19981 }
19982 
19983 /* PyIntBinop */
19984   #if !CYTHON_COMPILING_IN_PYPY
19985 #if PY_MAJOR_VERSION < 3 || CYTHON_USE_PYLONG_INTERNALS
19986 #define __Pyx_PyInt_RemainderObjC_ZeroDivisionError(operand)\
19987     if (unlikely(zerodivision_check && ((operand) == 0))) {\
19988         PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");\
19989         return NULL;\
19990     }
19991 #endif
__Pyx_PyInt_RemainderObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)19992 static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
19993     (void)inplace;
19994     (void)zerodivision_check;
19995     #if PY_MAJOR_VERSION < 3
19996     if (likely(PyInt_CheckExact(op1))) {
19997         const long b = intval;
19998         long x;
19999         long a = PyInt_AS_LONG(op1);
20000             __Pyx_PyInt_RemainderObjC_ZeroDivisionError(b)
20001             x = a % b;
20002             x += ((x != 0) & ((x ^ b) < 0)) * b;
20003             return PyInt_FromLong(x);
20004     }
20005     #endif
20006     #if CYTHON_USE_PYLONG_INTERNALS
20007     if (likely(PyLong_CheckExact(op1))) {
20008         const long b = intval;
20009         long a, x;
20010 #ifdef HAVE_LONG_LONG
20011         const PY_LONG_LONG llb = intval;
20012         PY_LONG_LONG lla, llx;
20013 #endif
20014         const digit* digits = ((PyLongObject*)op1)->ob_digit;
20015         const Py_ssize_t size = Py_SIZE(op1);
20016         if (likely(__Pyx_sst_abs(size) <= 1)) {
20017             a = likely(size) ? digits[0] : 0;
20018             if (size == -1) a = -a;
20019         } else {
20020             switch (size) {
20021                 case -2:
20022                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
20023                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
20024                         break;
20025 #ifdef HAVE_LONG_LONG
20026                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
20027                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
20028                         goto long_long;
20029 #endif
20030                     }
20031                     CYTHON_FALLTHROUGH;
20032                 case 2:
20033                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
20034                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
20035                         break;
20036 #ifdef HAVE_LONG_LONG
20037                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
20038                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
20039                         goto long_long;
20040 #endif
20041                     }
20042                     CYTHON_FALLTHROUGH;
20043                 case -3:
20044                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
20045                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
20046                         break;
20047 #ifdef HAVE_LONG_LONG
20048                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
20049                         lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
20050                         goto long_long;
20051 #endif
20052                     }
20053                     CYTHON_FALLTHROUGH;
20054                 case 3:
20055                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
20056                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
20057                         break;
20058 #ifdef HAVE_LONG_LONG
20059                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
20060                         lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
20061                         goto long_long;
20062 #endif
20063                     }
20064                     CYTHON_FALLTHROUGH;
20065                 case -4:
20066                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
20067                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
20068                         break;
20069 #ifdef HAVE_LONG_LONG
20070                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
20071                         lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
20072                         goto long_long;
20073 #endif
20074                     }
20075                     CYTHON_FALLTHROUGH;
20076                 case 4:
20077                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
20078                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
20079                         break;
20080 #ifdef HAVE_LONG_LONG
20081                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
20082                         lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
20083                         goto long_long;
20084 #endif
20085                     }
20086                     CYTHON_FALLTHROUGH;
20087                 default: return PyLong_Type.tp_as_number->nb_remainder(op1, op2);
20088             }
20089         }
20090                 __Pyx_PyInt_RemainderObjC_ZeroDivisionError(b)
20091                 x = a % b;
20092                 x += ((x != 0) & ((x ^ b) < 0)) * b;
20093             return PyLong_FromLong(x);
20094 #ifdef HAVE_LONG_LONG
20095         long_long:
20096                 llx = lla % llb;
20097                 llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb;
20098             return PyLong_FromLongLong(llx);
20099 #endif
20100 
20101 
20102     }
20103     #endif
20104     return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2);
20105 }
20106 #endif
20107 
20108 /* BufferFallbackError */
__Pyx_RaiseBufferFallbackError(void)20109   static void __Pyx_RaiseBufferFallbackError(void) {
20110   PyErr_SetString(PyExc_ValueError,
20111      "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
20112 }
20113 
20114 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)20115   static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
20116     PyObject *empty_list = 0;
20117     PyObject *module = 0;
20118     PyObject *global_dict = 0;
20119     PyObject *empty_dict = 0;
20120     PyObject *list;
20121     #if PY_MAJOR_VERSION < 3
20122     PyObject *py_import;
20123     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
20124     if (!py_import)
20125         goto bad;
20126     #endif
20127     if (from_list)
20128         list = from_list;
20129     else {
20130         empty_list = PyList_New(0);
20131         if (!empty_list)
20132             goto bad;
20133         list = empty_list;
20134     }
20135     global_dict = PyModule_GetDict(__pyx_m);
20136     if (!global_dict)
20137         goto bad;
20138     empty_dict = PyDict_New();
20139     if (!empty_dict)
20140         goto bad;
20141     {
20142         #if PY_MAJOR_VERSION >= 3
20143         if (level == -1) {
20144             if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
20145                 module = PyImport_ImportModuleLevelObject(
20146                     name, global_dict, empty_dict, list, 1);
20147                 if (!module) {
20148                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
20149                         goto bad;
20150                     PyErr_Clear();
20151                 }
20152             }
20153             level = 0;
20154         }
20155         #endif
20156         if (!module) {
20157             #if PY_MAJOR_VERSION < 3
20158             PyObject *py_level = PyInt_FromLong(level);
20159             if (!py_level)
20160                 goto bad;
20161             module = PyObject_CallFunctionObjArgs(py_import,
20162                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
20163             Py_DECREF(py_level);
20164             #else
20165             module = PyImport_ImportModuleLevelObject(
20166                 name, global_dict, empty_dict, list, level);
20167             #endif
20168         }
20169     }
20170 bad:
20171     #if PY_MAJOR_VERSION < 3
20172     Py_XDECREF(py_import);
20173     #endif
20174     Py_XDECREF(empty_list);
20175     Py_XDECREF(empty_dict);
20176     return module;
20177 }
20178 
20179 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)20180   static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
20181     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
20182     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
20183         PyErr_Format(PyExc_ImportError,
20184         #if PY_MAJOR_VERSION < 3
20185             "cannot import name %.230s", PyString_AS_STRING(name));
20186         #else
20187             "cannot import name %S", name);
20188         #endif
20189     }
20190     return value;
20191 }
20192 
20193 /* HasAttr */
__Pyx_HasAttr(PyObject * o,PyObject * n)20194   static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
20195     PyObject *r;
20196     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
20197         PyErr_SetString(PyExc_TypeError,
20198                         "hasattr(): attribute name must be string");
20199         return -1;
20200     }
20201     r = __Pyx_GetAttr(o, n);
20202     if (unlikely(!r)) {
20203         PyErr_Clear();
20204         return 0;
20205     } else {
20206         Py_DECREF(r);
20207         return 1;
20208     }
20209 }
20210 
20211 /* GetTopmostException */
20212   #if CYTHON_USE_EXC_INFO_STACK
20213 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)20214 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
20215 {
20216     _PyErr_StackItem *exc_info = tstate->exc_info;
20217     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
20218            exc_info->previous_item != NULL)
20219     {
20220         exc_info = exc_info->previous_item;
20221     }
20222     return exc_info;
20223 }
20224 #endif
20225 
20226 /* SaveResetException */
20227   #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)20228 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
20229     #if CYTHON_USE_EXC_INFO_STACK
20230     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
20231     *type = exc_info->exc_type;
20232     *value = exc_info->exc_value;
20233     *tb = exc_info->exc_traceback;
20234     #else
20235     *type = tstate->exc_type;
20236     *value = tstate->exc_value;
20237     *tb = tstate->exc_traceback;
20238     #endif
20239     Py_XINCREF(*type);
20240     Py_XINCREF(*value);
20241     Py_XINCREF(*tb);
20242 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)20243 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
20244     PyObject *tmp_type, *tmp_value, *tmp_tb;
20245     #if CYTHON_USE_EXC_INFO_STACK
20246     _PyErr_StackItem *exc_info = tstate->exc_info;
20247     tmp_type = exc_info->exc_type;
20248     tmp_value = exc_info->exc_value;
20249     tmp_tb = exc_info->exc_traceback;
20250     exc_info->exc_type = type;
20251     exc_info->exc_value = value;
20252     exc_info->exc_traceback = tb;
20253     #else
20254     tmp_type = tstate->exc_type;
20255     tmp_value = tstate->exc_value;
20256     tmp_tb = tstate->exc_traceback;
20257     tstate->exc_type = type;
20258     tstate->exc_value = value;
20259     tstate->exc_traceback = tb;
20260     #endif
20261     Py_XDECREF(tmp_type);
20262     Py_XDECREF(tmp_value);
20263     Py_XDECREF(tmp_tb);
20264 }
20265 #endif
20266 
20267 /* GetException */
20268   #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)20269 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
20270 #else
20271 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
20272 #endif
20273 {
20274     PyObject *local_type, *local_value, *local_tb;
20275 #if CYTHON_FAST_THREAD_STATE
20276     PyObject *tmp_type, *tmp_value, *tmp_tb;
20277     local_type = tstate->curexc_type;
20278     local_value = tstate->curexc_value;
20279     local_tb = tstate->curexc_traceback;
20280     tstate->curexc_type = 0;
20281     tstate->curexc_value = 0;
20282     tstate->curexc_traceback = 0;
20283 #else
20284     PyErr_Fetch(&local_type, &local_value, &local_tb);
20285 #endif
20286     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
20287 #if CYTHON_FAST_THREAD_STATE
20288     if (unlikely(tstate->curexc_type))
20289 #else
20290     if (unlikely(PyErr_Occurred()))
20291 #endif
20292         goto bad;
20293     #if PY_MAJOR_VERSION >= 3
20294     if (local_tb) {
20295         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
20296             goto bad;
20297     }
20298     #endif
20299     Py_XINCREF(local_tb);
20300     Py_XINCREF(local_type);
20301     Py_XINCREF(local_value);
20302     *type = local_type;
20303     *value = local_value;
20304     *tb = local_tb;
20305 #if CYTHON_FAST_THREAD_STATE
20306     #if CYTHON_USE_EXC_INFO_STACK
20307     {
20308         _PyErr_StackItem *exc_info = tstate->exc_info;
20309         tmp_type = exc_info->exc_type;
20310         tmp_value = exc_info->exc_value;
20311         tmp_tb = exc_info->exc_traceback;
20312         exc_info->exc_type = local_type;
20313         exc_info->exc_value = local_value;
20314         exc_info->exc_traceback = local_tb;
20315     }
20316     #else
20317     tmp_type = tstate->exc_type;
20318     tmp_value = tstate->exc_value;
20319     tmp_tb = tstate->exc_traceback;
20320     tstate->exc_type = local_type;
20321     tstate->exc_value = local_value;
20322     tstate->exc_traceback = local_tb;
20323     #endif
20324     Py_XDECREF(tmp_type);
20325     Py_XDECREF(tmp_value);
20326     Py_XDECREF(tmp_tb);
20327 #else
20328     PyErr_SetExcInfo(local_type, local_value, local_tb);
20329 #endif
20330     return 0;
20331 bad:
20332     *type = 0;
20333     *value = 0;
20334     *tb = 0;
20335     Py_XDECREF(local_type);
20336     Py_XDECREF(local_value);
20337     Py_XDECREF(local_tb);
20338     return -1;
20339 }
20340 
20341 /* PyObject_GenericGetAttrNoDict */
20342   #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)20343 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
20344     PyErr_Format(PyExc_AttributeError,
20345 #if PY_MAJOR_VERSION >= 3
20346                  "'%.50s' object has no attribute '%U'",
20347                  tp->tp_name, attr_name);
20348 #else
20349                  "'%.50s' object has no attribute '%.400s'",
20350                  tp->tp_name, PyString_AS_STRING(attr_name));
20351 #endif
20352     return NULL;
20353 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)20354 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
20355     PyObject *descr;
20356     PyTypeObject *tp = Py_TYPE(obj);
20357     if (unlikely(!PyString_Check(attr_name))) {
20358         return PyObject_GenericGetAttr(obj, attr_name);
20359     }
20360     assert(!tp->tp_dictoffset);
20361     descr = _PyType_Lookup(tp, attr_name);
20362     if (unlikely(!descr)) {
20363         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
20364     }
20365     Py_INCREF(descr);
20366     #if PY_MAJOR_VERSION < 3
20367     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
20368     #endif
20369     {
20370         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
20371         if (unlikely(f)) {
20372             PyObject *res = f(descr, obj, (PyObject *)tp);
20373             Py_DECREF(descr);
20374             return res;
20375         }
20376     }
20377     return descr;
20378 }
20379 #endif
20380 
20381 /* PyObject_GenericGetAttr */
20382   #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)20383 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
20384     if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
20385         return PyObject_GenericGetAttr(obj, attr_name);
20386     }
20387     return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
20388 }
20389 #endif
20390 
20391 /* PyObjectGetAttrStrNoError */
__Pyx_PyObject_GetAttrStr_ClearAttributeError(void)20392   static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
20393     __Pyx_PyThreadState_declare
20394     __Pyx_PyThreadState_assign
20395     if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
20396         __Pyx_PyErr_Clear();
20397 }
__Pyx_PyObject_GetAttrStrNoError(PyObject * obj,PyObject * attr_name)20398 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
20399     PyObject *result;
20400 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
20401     PyTypeObject* tp = Py_TYPE(obj);
20402     if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
20403         return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
20404     }
20405 #endif
20406     result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
20407     if (unlikely(!result)) {
20408         __Pyx_PyObject_GetAttrStr_ClearAttributeError();
20409     }
20410     return result;
20411 }
20412 
20413 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)20414   static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
20415   int ret;
20416   PyObject *name_attr;
20417   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
20418   if (likely(name_attr)) {
20419       ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
20420   } else {
20421       ret = -1;
20422   }
20423   if (unlikely(ret < 0)) {
20424       PyErr_Clear();
20425       ret = 0;
20426   }
20427   Py_XDECREF(name_attr);
20428   return ret;
20429 }
__Pyx_setup_reduce(PyObject * type_obj)20430 static int __Pyx_setup_reduce(PyObject* type_obj) {
20431     int ret = 0;
20432     PyObject *object_reduce = NULL;
20433     PyObject *object_reduce_ex = NULL;
20434     PyObject *reduce = NULL;
20435     PyObject *reduce_ex = NULL;
20436     PyObject *reduce_cython = NULL;
20437     PyObject *setstate = NULL;
20438     PyObject *setstate_cython = NULL;
20439 #if CYTHON_USE_PYTYPE_LOOKUP
20440     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
20441 #else
20442     if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
20443 #endif
20444 #if CYTHON_USE_PYTYPE_LOOKUP
20445     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
20446 #else
20447     object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
20448 #endif
20449     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
20450     if (reduce_ex == object_reduce_ex) {
20451 #if CYTHON_USE_PYTYPE_LOOKUP
20452         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
20453 #else
20454         object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
20455 #endif
20456         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
20457         if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
20458             reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
20459             if (likely(reduce_cython)) {
20460                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
20461                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
20462             } else if (reduce == object_reduce || PyErr_Occurred()) {
20463                 goto __PYX_BAD;
20464             }
20465             setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
20466             if (!setstate) PyErr_Clear();
20467             if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
20468                 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
20469                 if (likely(setstate_cython)) {
20470                     ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
20471                     ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
20472                 } else if (!setstate || PyErr_Occurred()) {
20473                     goto __PYX_BAD;
20474                 }
20475             }
20476             PyType_Modified((PyTypeObject*)type_obj);
20477         }
20478     }
20479     goto __PYX_GOOD;
20480 __PYX_BAD:
20481     if (!PyErr_Occurred())
20482         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
20483     ret = -1;
20484 __PYX_GOOD:
20485 #if !CYTHON_USE_PYTYPE_LOOKUP
20486     Py_XDECREF(object_reduce);
20487     Py_XDECREF(object_reduce_ex);
20488 #endif
20489     Py_XDECREF(reduce);
20490     Py_XDECREF(reduce_ex);
20491     Py_XDECREF(reduce_cython);
20492     Py_XDECREF(setstate);
20493     Py_XDECREF(setstate_cython);
20494     return ret;
20495 }
20496 
20497 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)20498   static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
20499 #if PY_VERSION_HEX >= 0x02070000
20500     PyObject *ob = PyCapsule_New(vtable, 0, 0);
20501 #else
20502     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
20503 #endif
20504     if (!ob)
20505         goto bad;
20506     if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
20507         goto bad;
20508     Py_DECREF(ob);
20509     return 0;
20510 bad:
20511     Py_XDECREF(ob);
20512     return -1;
20513 }
20514 
20515 /* TypeImport */
20516   #ifndef __PYX_HAVE_RT_ImportType
20517 #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)20518 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
20519     size_t size, enum __Pyx_ImportType_CheckSize check_size)
20520 {
20521     PyObject *result = 0;
20522     char warning[200];
20523     Py_ssize_t basicsize;
20524 #ifdef Py_LIMITED_API
20525     PyObject *py_basicsize;
20526 #endif
20527     result = PyObject_GetAttrString(module, class_name);
20528     if (!result)
20529         goto bad;
20530     if (!PyType_Check(result)) {
20531         PyErr_Format(PyExc_TypeError,
20532             "%.200s.%.200s is not a type object",
20533             module_name, class_name);
20534         goto bad;
20535     }
20536 #ifndef Py_LIMITED_API
20537     basicsize = ((PyTypeObject *)result)->tp_basicsize;
20538 #else
20539     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
20540     if (!py_basicsize)
20541         goto bad;
20542     basicsize = PyLong_AsSsize_t(py_basicsize);
20543     Py_DECREF(py_basicsize);
20544     py_basicsize = 0;
20545     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
20546         goto bad;
20547 #endif
20548     if ((size_t)basicsize < size) {
20549         PyErr_Format(PyExc_ValueError,
20550             "%.200s.%.200s size changed, may indicate binary incompatibility. "
20551             "Expected %zd from C header, got %zd from PyObject",
20552             module_name, class_name, size, basicsize);
20553         goto bad;
20554     }
20555     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
20556         PyErr_Format(PyExc_ValueError,
20557             "%.200s.%.200s size changed, may indicate binary incompatibility. "
20558             "Expected %zd from C header, got %zd from PyObject",
20559             module_name, class_name, size, basicsize);
20560         goto bad;
20561     }
20562     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
20563         PyOS_snprintf(warning, sizeof(warning),
20564             "%s.%s size changed, may indicate binary incompatibility. "
20565             "Expected %zd from C header, got %zd from PyObject",
20566             module_name, class_name, size, basicsize);
20567         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
20568     }
20569     return (PyTypeObject *)result;
20570 bad:
20571     Py_XDECREF(result);
20572     return NULL;
20573 }
20574 #endif
20575 
20576 /* CLineInTraceback */
20577   #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)20578 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
20579     PyObject *use_cline;
20580     PyObject *ptype, *pvalue, *ptraceback;
20581 #if CYTHON_COMPILING_IN_CPYTHON
20582     PyObject **cython_runtime_dict;
20583 #endif
20584     if (unlikely(!__pyx_cython_runtime)) {
20585         return c_line;
20586     }
20587     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
20588 #if CYTHON_COMPILING_IN_CPYTHON
20589     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
20590     if (likely(cython_runtime_dict)) {
20591         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
20592             use_cline, *cython_runtime_dict,
20593             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
20594     } else
20595 #endif
20596     {
20597       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
20598       if (use_cline_obj) {
20599         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
20600         Py_DECREF(use_cline_obj);
20601       } else {
20602         PyErr_Clear();
20603         use_cline = NULL;
20604       }
20605     }
20606     if (!use_cline) {
20607         c_line = 0;
20608         (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
20609     }
20610     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
20611         c_line = 0;
20612     }
20613     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
20614     return c_line;
20615 }
20616 #endif
20617 
20618 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)20619   static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
20620     int start = 0, mid = 0, end = count - 1;
20621     if (end >= 0 && code_line > entries[end].code_line) {
20622         return count;
20623     }
20624     while (start < end) {
20625         mid = start + (end - start) / 2;
20626         if (code_line < entries[mid].code_line) {
20627             end = mid;
20628         } else if (code_line > entries[mid].code_line) {
20629              start = mid + 1;
20630         } else {
20631             return mid;
20632         }
20633     }
20634     if (code_line <= entries[mid].code_line) {
20635         return mid;
20636     } else {
20637         return mid + 1;
20638     }
20639 }
__pyx_find_code_object(int code_line)20640 static PyCodeObject *__pyx_find_code_object(int code_line) {
20641     PyCodeObject* code_object;
20642     int pos;
20643     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
20644         return NULL;
20645     }
20646     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
20647     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
20648         return NULL;
20649     }
20650     code_object = __pyx_code_cache.entries[pos].code_object;
20651     Py_INCREF(code_object);
20652     return code_object;
20653 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)20654 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
20655     int pos, i;
20656     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
20657     if (unlikely(!code_line)) {
20658         return;
20659     }
20660     if (unlikely(!entries)) {
20661         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
20662         if (likely(entries)) {
20663             __pyx_code_cache.entries = entries;
20664             __pyx_code_cache.max_count = 64;
20665             __pyx_code_cache.count = 1;
20666             entries[0].code_line = code_line;
20667             entries[0].code_object = code_object;
20668             Py_INCREF(code_object);
20669         }
20670         return;
20671     }
20672     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
20673     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
20674         PyCodeObject* tmp = entries[pos].code_object;
20675         entries[pos].code_object = code_object;
20676         Py_DECREF(tmp);
20677         return;
20678     }
20679     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
20680         int new_max = __pyx_code_cache.max_count + 64;
20681         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
20682             __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
20683         if (unlikely(!entries)) {
20684             return;
20685         }
20686         __pyx_code_cache.entries = entries;
20687         __pyx_code_cache.max_count = new_max;
20688     }
20689     for (i=__pyx_code_cache.count; i>pos; i--) {
20690         entries[i] = entries[i-1];
20691     }
20692     entries[pos].code_line = code_line;
20693     entries[pos].code_object = code_object;
20694     __pyx_code_cache.count++;
20695     Py_INCREF(code_object);
20696 }
20697 
20698 /* AddTraceback */
20699   #include "compile.h"
20700 #include "frameobject.h"
20701 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)20702 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
20703             const char *funcname, int c_line,
20704             int py_line, const char *filename) {
20705     PyCodeObject *py_code = NULL;
20706     PyObject *py_funcname = NULL;
20707     #if PY_MAJOR_VERSION < 3
20708     PyObject *py_srcfile = NULL;
20709     py_srcfile = PyString_FromString(filename);
20710     if (!py_srcfile) goto bad;
20711     #endif
20712     if (c_line) {
20713         #if PY_MAJOR_VERSION < 3
20714         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
20715         if (!py_funcname) goto bad;
20716         #else
20717         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
20718         if (!py_funcname) goto bad;
20719         funcname = PyUnicode_AsUTF8(py_funcname);
20720         if (!funcname) goto bad;
20721         #endif
20722     }
20723     else {
20724         #if PY_MAJOR_VERSION < 3
20725         py_funcname = PyString_FromString(funcname);
20726         if (!py_funcname) goto bad;
20727         #endif
20728     }
20729     #if PY_MAJOR_VERSION < 3
20730     py_code = __Pyx_PyCode_New(
20731         0,
20732         0,
20733         0,
20734         0,
20735         0,
20736         __pyx_empty_bytes, /*PyObject *code,*/
20737         __pyx_empty_tuple, /*PyObject *consts,*/
20738         __pyx_empty_tuple, /*PyObject *names,*/
20739         __pyx_empty_tuple, /*PyObject *varnames,*/
20740         __pyx_empty_tuple, /*PyObject *freevars,*/
20741         __pyx_empty_tuple, /*PyObject *cellvars,*/
20742         py_srcfile,   /*PyObject *filename,*/
20743         py_funcname,  /*PyObject *name,*/
20744         py_line,
20745         __pyx_empty_bytes  /*PyObject *lnotab*/
20746     );
20747     Py_DECREF(py_srcfile);
20748     #else
20749     py_code = PyCode_NewEmpty(filename, funcname, py_line);
20750     #endif
20751     Py_XDECREF(py_funcname);  // XDECREF since it's only set on Py3 if cline
20752     return py_code;
20753 bad:
20754     Py_XDECREF(py_funcname);
20755     #if PY_MAJOR_VERSION < 3
20756     Py_XDECREF(py_srcfile);
20757     #endif
20758     return NULL;
20759 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)20760 static void __Pyx_AddTraceback(const char *funcname, int c_line,
20761                                int py_line, const char *filename) {
20762     PyCodeObject *py_code = 0;
20763     PyFrameObject *py_frame = 0;
20764     PyThreadState *tstate = __Pyx_PyThreadState_Current;
20765     if (c_line) {
20766         c_line = __Pyx_CLineForTraceback(tstate, c_line);
20767     }
20768     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
20769     if (!py_code) {
20770         py_code = __Pyx_CreateCodeObjectForTraceback(
20771             funcname, c_line, py_line, filename);
20772         if (!py_code) goto bad;
20773         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
20774     }
20775     py_frame = PyFrame_New(
20776         tstate,            /*PyThreadState *tstate,*/
20777         py_code,           /*PyCodeObject *code,*/
20778         __pyx_d,    /*PyObject *globals,*/
20779         0                  /*PyObject *locals*/
20780     );
20781     if (!py_frame) goto bad;
20782     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
20783     PyTraceBack_Here(py_frame);
20784 bad:
20785     Py_XDECREF(py_code);
20786     Py_XDECREF(py_frame);
20787 }
20788 
20789 /* CIntFromPyVerify */
20790   #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
20791     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
20792 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
20793     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
20794 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
20795     {\
20796         func_type value = func_value;\
20797         if (sizeof(target_type) < sizeof(func_type)) {\
20798             if (unlikely(value != (func_type) (target_type) value)) {\
20799                 func_type zero = 0;\
20800                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
20801                     return (target_type) -1;\
20802                 if (is_unsigned && unlikely(value < zero))\
20803                     goto raise_neg_overflow;\
20804                 else\
20805                     goto raise_overflow;\
20806             }\
20807         }\
20808         return (target_type) value;\
20809     }
20810 
20811 #if PY_MAJOR_VERSION < 3
__Pyx_GetBuffer(PyObject * obj,Py_buffer * view,int flags)20812 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
20813     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
20814     PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
20815     return -1;
20816 }
__Pyx_ReleaseBuffer(Py_buffer * view)20817 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
20818     PyObject *obj = view->obj;
20819     if (!obj) return;
20820     if (PyObject_CheckBuffer(obj)) {
20821         PyBuffer_Release(view);
20822         return;
20823     }
20824     if ((0)) {}
20825     view->obj = NULL;
20826     Py_DECREF(obj);
20827 }
20828 #endif
20829 
20830 
20831   /* Declarations */
20832   #if CYTHON_CCOMPLEX
20833   #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)20834     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
20835       return ::std::complex< float >(x, y);
20836     }
20837   #else
__pyx_t_float_complex_from_parts(float x,float y)20838     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
20839       return x + y*(__pyx_t_float_complex)_Complex_I;
20840     }
20841   #endif
20842 #else
__pyx_t_float_complex_from_parts(float x,float y)20843     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
20844       __pyx_t_float_complex z;
20845       z.real = x;
20846       z.imag = y;
20847       return z;
20848     }
20849 #endif
20850 
20851 /* Arithmetic */
20852   #if CYTHON_CCOMPLEX
20853 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)20854     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
20855        return (a.real == b.real) && (a.imag == b.imag);
20856     }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)20857     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
20858         __pyx_t_float_complex z;
20859         z.real = a.real + b.real;
20860         z.imag = a.imag + b.imag;
20861         return z;
20862     }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)20863     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
20864         __pyx_t_float_complex z;
20865         z.real = a.real - b.real;
20866         z.imag = a.imag - b.imag;
20867         return z;
20868     }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)20869     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
20870         __pyx_t_float_complex z;
20871         z.real = a.real * b.real - a.imag * b.imag;
20872         z.imag = a.real * b.imag + a.imag * b.real;
20873         return z;
20874     }
20875     #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)20876     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
20877         if (b.imag == 0) {
20878             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
20879         } else if (fabsf(b.real) >= fabsf(b.imag)) {
20880             if (b.real == 0 && b.imag == 0) {
20881                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
20882             } else {
20883                 float r = b.imag / b.real;
20884                 float s = (float)(1.0) / (b.real + b.imag * r);
20885                 return __pyx_t_float_complex_from_parts(
20886                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
20887             }
20888         } else {
20889             float r = b.real / b.imag;
20890             float s = (float)(1.0) / (b.imag + b.real * r);
20891             return __pyx_t_float_complex_from_parts(
20892                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
20893         }
20894     }
20895     #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)20896     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
20897         if (b.imag == 0) {
20898             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
20899         } else {
20900             float denom = b.real * b.real + b.imag * b.imag;
20901             return __pyx_t_float_complex_from_parts(
20902                 (a.real * b.real + a.imag * b.imag) / denom,
20903                 (a.imag * b.real - a.real * b.imag) / denom);
20904         }
20905     }
20906     #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)20907     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
20908         __pyx_t_float_complex z;
20909         z.real = -a.real;
20910         z.imag = -a.imag;
20911         return z;
20912     }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)20913     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
20914        return (a.real == 0) && (a.imag == 0);
20915     }
__Pyx_c_conj_float(__pyx_t_float_complex a)20916     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
20917         __pyx_t_float_complex z;
20918         z.real =  a.real;
20919         z.imag = -a.imag;
20920         return z;
20921     }
20922     #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)20923         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
20924           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
20925             return sqrtf(z.real*z.real + z.imag*z.imag);
20926           #else
20927             return hypotf(z.real, z.imag);
20928           #endif
20929         }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)20930         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
20931             __pyx_t_float_complex z;
20932             float r, lnr, theta, z_r, z_theta;
20933             if (b.imag == 0 && b.real == (int)b.real) {
20934                 if (b.real < 0) {
20935                     float denom = a.real * a.real + a.imag * a.imag;
20936                     a.real = a.real / denom;
20937                     a.imag = -a.imag / denom;
20938                     b.real = -b.real;
20939                 }
20940                 switch ((int)b.real) {
20941                     case 0:
20942                         z.real = 1;
20943                         z.imag = 0;
20944                         return z;
20945                     case 1:
20946                         return a;
20947                     case 2:
20948                         return __Pyx_c_prod_float(a, a);
20949                     case 3:
20950                         z = __Pyx_c_prod_float(a, a);
20951                         return __Pyx_c_prod_float(z, a);
20952                     case 4:
20953                         z = __Pyx_c_prod_float(a, a);
20954                         return __Pyx_c_prod_float(z, z);
20955                 }
20956             }
20957             if (a.imag == 0) {
20958                 if (a.real == 0) {
20959                     return a;
20960                 } else if (b.imag == 0) {
20961                     z.real = powf(a.real, b.real);
20962                     z.imag = 0;
20963                     return z;
20964                 } else if (a.real > 0) {
20965                     r = a.real;
20966                     theta = 0;
20967                 } else {
20968                     r = -a.real;
20969                     theta = atan2f(0.0, -1.0);
20970                 }
20971             } else {
20972                 r = __Pyx_c_abs_float(a);
20973                 theta = atan2f(a.imag, a.real);
20974             }
20975             lnr = logf(r);
20976             z_r = expf(lnr * b.real - theta * b.imag);
20977             z_theta = theta * b.real + lnr * b.imag;
20978             z.real = z_r * cosf(z_theta);
20979             z.imag = z_r * sinf(z_theta);
20980             return z;
20981         }
20982     #endif
20983 #endif
20984 
20985 /* Declarations */
20986   #if CYTHON_CCOMPLEX
20987   #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)20988     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
20989       return ::std::complex< double >(x, y);
20990     }
20991   #else
__pyx_t_double_complex_from_parts(double x,double y)20992     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
20993       return x + y*(__pyx_t_double_complex)_Complex_I;
20994     }
20995   #endif
20996 #else
__pyx_t_double_complex_from_parts(double x,double y)20997     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
20998       __pyx_t_double_complex z;
20999       z.real = x;
21000       z.imag = y;
21001       return z;
21002     }
21003 #endif
21004 
21005 /* Arithmetic */
21006   #if CYTHON_CCOMPLEX
21007 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)21008     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
21009        return (a.real == b.real) && (a.imag == b.imag);
21010     }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)21011     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
21012         __pyx_t_double_complex z;
21013         z.real = a.real + b.real;
21014         z.imag = a.imag + b.imag;
21015         return z;
21016     }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)21017     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
21018         __pyx_t_double_complex z;
21019         z.real = a.real - b.real;
21020         z.imag = a.imag - b.imag;
21021         return z;
21022     }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)21023     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
21024         __pyx_t_double_complex z;
21025         z.real = a.real * b.real - a.imag * b.imag;
21026         z.imag = a.real * b.imag + a.imag * b.real;
21027         return z;
21028     }
21029     #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)21030     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
21031         if (b.imag == 0) {
21032             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
21033         } else if (fabs(b.real) >= fabs(b.imag)) {
21034             if (b.real == 0 && b.imag == 0) {
21035                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
21036             } else {
21037                 double r = b.imag / b.real;
21038                 double s = (double)(1.0) / (b.real + b.imag * r);
21039                 return __pyx_t_double_complex_from_parts(
21040                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
21041             }
21042         } else {
21043             double r = b.real / b.imag;
21044             double s = (double)(1.0) / (b.imag + b.real * r);
21045             return __pyx_t_double_complex_from_parts(
21046                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
21047         }
21048     }
21049     #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)21050     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
21051         if (b.imag == 0) {
21052             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
21053         } else {
21054             double denom = b.real * b.real + b.imag * b.imag;
21055             return __pyx_t_double_complex_from_parts(
21056                 (a.real * b.real + a.imag * b.imag) / denom,
21057                 (a.imag * b.real - a.real * b.imag) / denom);
21058         }
21059     }
21060     #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)21061     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
21062         __pyx_t_double_complex z;
21063         z.real = -a.real;
21064         z.imag = -a.imag;
21065         return z;
21066     }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)21067     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
21068        return (a.real == 0) && (a.imag == 0);
21069     }
__Pyx_c_conj_double(__pyx_t_double_complex a)21070     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
21071         __pyx_t_double_complex z;
21072         z.real =  a.real;
21073         z.imag = -a.imag;
21074         return z;
21075     }
21076     #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)21077         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
21078           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
21079             return sqrt(z.real*z.real + z.imag*z.imag);
21080           #else
21081             return hypot(z.real, z.imag);
21082           #endif
21083         }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)21084         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
21085             __pyx_t_double_complex z;
21086             double r, lnr, theta, z_r, z_theta;
21087             if (b.imag == 0 && b.real == (int)b.real) {
21088                 if (b.real < 0) {
21089                     double denom = a.real * a.real + a.imag * a.imag;
21090                     a.real = a.real / denom;
21091                     a.imag = -a.imag / denom;
21092                     b.real = -b.real;
21093                 }
21094                 switch ((int)b.real) {
21095                     case 0:
21096                         z.real = 1;
21097                         z.imag = 0;
21098                         return z;
21099                     case 1:
21100                         return a;
21101                     case 2:
21102                         return __Pyx_c_prod_double(a, a);
21103                     case 3:
21104                         z = __Pyx_c_prod_double(a, a);
21105                         return __Pyx_c_prod_double(z, a);
21106                     case 4:
21107                         z = __Pyx_c_prod_double(a, a);
21108                         return __Pyx_c_prod_double(z, z);
21109                 }
21110             }
21111             if (a.imag == 0) {
21112                 if (a.real == 0) {
21113                     return a;
21114                 } else if (b.imag == 0) {
21115                     z.real = pow(a.real, b.real);
21116                     z.imag = 0;
21117                     return z;
21118                 } else if (a.real > 0) {
21119                     r = a.real;
21120                     theta = 0;
21121                 } else {
21122                     r = -a.real;
21123                     theta = atan2(0.0, -1.0);
21124                 }
21125             } else {
21126                 r = __Pyx_c_abs_double(a);
21127                 theta = atan2(a.imag, a.real);
21128             }
21129             lnr = log(r);
21130             z_r = exp(lnr * b.real - theta * b.imag);
21131             z_theta = theta * b.real + lnr * b.imag;
21132             z.real = z_r * cos(z_theta);
21133             z.imag = z_r * sin(z_theta);
21134             return z;
21135         }
21136     #endif
21137 #endif
21138 
21139 /* CIntToPy */
__Pyx_PyInt_From_unsigned_int(unsigned int value)21140   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
21141 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21142 #pragma GCC diagnostic push
21143 #pragma GCC diagnostic ignored "-Wconversion"
21144 #endif
21145     const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
21146 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21147 #pragma GCC diagnostic pop
21148 #endif
21149     const int is_unsigned = neg_one > const_zero;
21150     if (is_unsigned) {
21151         if (sizeof(unsigned int) < sizeof(long)) {
21152             return PyInt_FromLong((long) value);
21153         } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
21154             return PyLong_FromUnsignedLong((unsigned long) value);
21155 #ifdef HAVE_LONG_LONG
21156         } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
21157             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
21158 #endif
21159         }
21160     } else {
21161         if (sizeof(unsigned int) <= sizeof(long)) {
21162             return PyInt_FromLong((long) value);
21163 #ifdef HAVE_LONG_LONG
21164         } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
21165             return PyLong_FromLongLong((PY_LONG_LONG) value);
21166 #endif
21167         }
21168     }
21169     {
21170         int one = 1; int little = (int)*(unsigned char *)&one;
21171         unsigned char *bytes = (unsigned char *)&value;
21172         return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
21173                                      little, !is_unsigned);
21174     }
21175 }
21176 
21177 /* CIntFromPy */
__Pyx_PyInt_As_unsigned_int(PyObject * x)21178   static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
21179 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21180 #pragma GCC diagnostic push
21181 #pragma GCC diagnostic ignored "-Wconversion"
21182 #endif
21183     const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
21184 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21185 #pragma GCC diagnostic pop
21186 #endif
21187     const int is_unsigned = neg_one > const_zero;
21188 #if PY_MAJOR_VERSION < 3
21189     if (likely(PyInt_Check(x))) {
21190         if (sizeof(unsigned int) < sizeof(long)) {
21191             __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
21192         } else {
21193             long val = PyInt_AS_LONG(x);
21194             if (is_unsigned && unlikely(val < 0)) {
21195                 goto raise_neg_overflow;
21196             }
21197             return (unsigned int) val;
21198         }
21199     } else
21200 #endif
21201     if (likely(PyLong_Check(x))) {
21202         if (is_unsigned) {
21203 #if CYTHON_USE_PYLONG_INTERNALS
21204             const digit* digits = ((PyLongObject*)x)->ob_digit;
21205             switch (Py_SIZE(x)) {
21206                 case  0: return (unsigned int) 0;
21207                 case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0])
21208                 case 2:
21209                     if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
21210                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
21211                             __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21212                         } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) {
21213                             return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
21214                         }
21215                     }
21216                     break;
21217                 case 3:
21218                     if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
21219                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
21220                             __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21221                         } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) {
21222                             return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
21223                         }
21224                     }
21225                     break;
21226                 case 4:
21227                     if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
21228                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
21229                             __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])))
21230                         } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) {
21231                             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]));
21232                         }
21233                     }
21234                     break;
21235             }
21236 #endif
21237 #if CYTHON_COMPILING_IN_CPYTHON
21238             if (unlikely(Py_SIZE(x) < 0)) {
21239                 goto raise_neg_overflow;
21240             }
21241 #else
21242             {
21243                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
21244                 if (unlikely(result < 0))
21245                     return (unsigned int) -1;
21246                 if (unlikely(result == 1))
21247                     goto raise_neg_overflow;
21248             }
21249 #endif
21250             if (sizeof(unsigned int) <= sizeof(unsigned long)) {
21251                 __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
21252 #ifdef HAVE_LONG_LONG
21253             } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
21254                 __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
21255 #endif
21256             }
21257         } else {
21258 #if CYTHON_USE_PYLONG_INTERNALS
21259             const digit* digits = ((PyLongObject*)x)->ob_digit;
21260             switch (Py_SIZE(x)) {
21261                 case  0: return (unsigned int) 0;
21262                 case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0]))
21263                 case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +digits[0])
21264                 case -2:
21265                     if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) {
21266                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
21267                             __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21268                         } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
21269                             return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
21270                         }
21271                     }
21272                     break;
21273                 case 2:
21274                     if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
21275                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
21276                             __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21277                         } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
21278                             return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
21279                         }
21280                     }
21281                     break;
21282                 case -3:
21283                     if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
21284                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
21285                             __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21286                         } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
21287                             return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
21288                         }
21289                     }
21290                     break;
21291                 case 3:
21292                     if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
21293                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
21294                             __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21295                         } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
21296                             return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
21297                         }
21298                     }
21299                     break;
21300                 case -4:
21301                     if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
21302                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
21303                             __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])))
21304                         } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
21305                             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])));
21306                         }
21307                     }
21308                     break;
21309                 case 4:
21310                     if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
21311                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
21312                             __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])))
21313                         } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
21314                             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])));
21315                         }
21316                     }
21317                     break;
21318             }
21319 #endif
21320             if (sizeof(unsigned int) <= sizeof(long)) {
21321                 __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
21322 #ifdef HAVE_LONG_LONG
21323             } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
21324                 __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
21325 #endif
21326             }
21327         }
21328         {
21329 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
21330             PyErr_SetString(PyExc_RuntimeError,
21331                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
21332 #else
21333             unsigned int val;
21334             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
21335  #if PY_MAJOR_VERSION < 3
21336             if (likely(v) && !PyLong_Check(v)) {
21337                 PyObject *tmp = v;
21338                 v = PyNumber_Long(tmp);
21339                 Py_DECREF(tmp);
21340             }
21341  #endif
21342             if (likely(v)) {
21343                 int one = 1; int is_little = (int)*(unsigned char *)&one;
21344                 unsigned char *bytes = (unsigned char *)&val;
21345                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
21346                                               bytes, sizeof(val),
21347                                               is_little, !is_unsigned);
21348                 Py_DECREF(v);
21349                 if (likely(!ret))
21350                     return val;
21351             }
21352 #endif
21353             return (unsigned int) -1;
21354         }
21355     } else {
21356         unsigned int val;
21357         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
21358         if (!tmp) return (unsigned int) -1;
21359         val = __Pyx_PyInt_As_unsigned_int(tmp);
21360         Py_DECREF(tmp);
21361         return val;
21362     }
21363 raise_overflow:
21364     PyErr_SetString(PyExc_OverflowError,
21365         "value too large to convert to unsigned int");
21366     return (unsigned int) -1;
21367 raise_neg_overflow:
21368     PyErr_SetString(PyExc_OverflowError,
21369         "can't convert negative value to unsigned int");
21370     return (unsigned int) -1;
21371 }
21372 
21373 /* CIntToPy */
__Pyx_PyInt_From_int(int value)21374   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
21375 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21376 #pragma GCC diagnostic push
21377 #pragma GCC diagnostic ignored "-Wconversion"
21378 #endif
21379     const int neg_one = (int) -1, const_zero = (int) 0;
21380 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21381 #pragma GCC diagnostic pop
21382 #endif
21383     const int is_unsigned = neg_one > const_zero;
21384     if (is_unsigned) {
21385         if (sizeof(int) < sizeof(long)) {
21386             return PyInt_FromLong((long) value);
21387         } else if (sizeof(int) <= sizeof(unsigned long)) {
21388             return PyLong_FromUnsignedLong((unsigned long) value);
21389 #ifdef HAVE_LONG_LONG
21390         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
21391             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
21392 #endif
21393         }
21394     } else {
21395         if (sizeof(int) <= sizeof(long)) {
21396             return PyInt_FromLong((long) value);
21397 #ifdef HAVE_LONG_LONG
21398         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
21399             return PyLong_FromLongLong((PY_LONG_LONG) value);
21400 #endif
21401         }
21402     }
21403     {
21404         int one = 1; int little = (int)*(unsigned char *)&one;
21405         unsigned char *bytes = (unsigned char *)&value;
21406         return _PyLong_FromByteArray(bytes, sizeof(int),
21407                                      little, !is_unsigned);
21408     }
21409 }
21410 
21411 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)21412   static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
21413 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21414 #pragma GCC diagnostic push
21415 #pragma GCC diagnostic ignored "-Wconversion"
21416 #endif
21417     const int neg_one = (int) -1, const_zero = (int) 0;
21418 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21419 #pragma GCC diagnostic pop
21420 #endif
21421     const int is_unsigned = neg_one > const_zero;
21422 #if PY_MAJOR_VERSION < 3
21423     if (likely(PyInt_Check(x))) {
21424         if (sizeof(int) < sizeof(long)) {
21425             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
21426         } else {
21427             long val = PyInt_AS_LONG(x);
21428             if (is_unsigned && unlikely(val < 0)) {
21429                 goto raise_neg_overflow;
21430             }
21431             return (int) val;
21432         }
21433     } else
21434 #endif
21435     if (likely(PyLong_Check(x))) {
21436         if (is_unsigned) {
21437 #if CYTHON_USE_PYLONG_INTERNALS
21438             const digit* digits = ((PyLongObject*)x)->ob_digit;
21439             switch (Py_SIZE(x)) {
21440                 case  0: return (int) 0;
21441                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
21442                 case 2:
21443                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
21444                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
21445                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21446                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
21447                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
21448                         }
21449                     }
21450                     break;
21451                 case 3:
21452                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
21453                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
21454                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21455                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
21456                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
21457                         }
21458                     }
21459                     break;
21460                 case 4:
21461                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
21462                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
21463                             __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])))
21464                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
21465                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
21466                         }
21467                     }
21468                     break;
21469             }
21470 #endif
21471 #if CYTHON_COMPILING_IN_CPYTHON
21472             if (unlikely(Py_SIZE(x) < 0)) {
21473                 goto raise_neg_overflow;
21474             }
21475 #else
21476             {
21477                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
21478                 if (unlikely(result < 0))
21479                     return (int) -1;
21480                 if (unlikely(result == 1))
21481                     goto raise_neg_overflow;
21482             }
21483 #endif
21484             if (sizeof(int) <= sizeof(unsigned long)) {
21485                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
21486 #ifdef HAVE_LONG_LONG
21487             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
21488                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
21489 #endif
21490             }
21491         } else {
21492 #if CYTHON_USE_PYLONG_INTERNALS
21493             const digit* digits = ((PyLongObject*)x)->ob_digit;
21494             switch (Py_SIZE(x)) {
21495                 case  0: return (int) 0;
21496                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
21497                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
21498                 case -2:
21499                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
21500                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
21501                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21502                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
21503                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
21504                         }
21505                     }
21506                     break;
21507                 case 2:
21508                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
21509                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
21510                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21511                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
21512                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
21513                         }
21514                     }
21515                     break;
21516                 case -3:
21517                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
21518                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
21519                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21520                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
21521                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
21522                         }
21523                     }
21524                     break;
21525                 case 3:
21526                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
21527                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
21528                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21529                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
21530                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
21531                         }
21532                     }
21533                     break;
21534                 case -4:
21535                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
21536                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
21537                             __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])))
21538                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
21539                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
21540                         }
21541                     }
21542                     break;
21543                 case 4:
21544                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
21545                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
21546                             __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])))
21547                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
21548                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
21549                         }
21550                     }
21551                     break;
21552             }
21553 #endif
21554             if (sizeof(int) <= sizeof(long)) {
21555                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
21556 #ifdef HAVE_LONG_LONG
21557             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
21558                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
21559 #endif
21560             }
21561         }
21562         {
21563 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
21564             PyErr_SetString(PyExc_RuntimeError,
21565                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
21566 #else
21567             int val;
21568             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
21569  #if PY_MAJOR_VERSION < 3
21570             if (likely(v) && !PyLong_Check(v)) {
21571                 PyObject *tmp = v;
21572                 v = PyNumber_Long(tmp);
21573                 Py_DECREF(tmp);
21574             }
21575  #endif
21576             if (likely(v)) {
21577                 int one = 1; int is_little = (int)*(unsigned char *)&one;
21578                 unsigned char *bytes = (unsigned char *)&val;
21579                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
21580                                               bytes, sizeof(val),
21581                                               is_little, !is_unsigned);
21582                 Py_DECREF(v);
21583                 if (likely(!ret))
21584                     return val;
21585             }
21586 #endif
21587             return (int) -1;
21588         }
21589     } else {
21590         int val;
21591         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
21592         if (!tmp) return (int) -1;
21593         val = __Pyx_PyInt_As_int(tmp);
21594         Py_DECREF(tmp);
21595         return val;
21596     }
21597 raise_overflow:
21598     PyErr_SetString(PyExc_OverflowError,
21599         "value too large to convert to int");
21600     return (int) -1;
21601 raise_neg_overflow:
21602     PyErr_SetString(PyExc_OverflowError,
21603         "can't convert negative value to int");
21604     return (int) -1;
21605 }
21606 
21607 /* CIntToPy */
__Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value)21608   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value) {
21609 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21610 #pragma GCC diagnostic push
21611 #pragma GCC diagnostic ignored "-Wconversion"
21612 #endif
21613     const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG) -1, const_zero = (unsigned PY_LONG_LONG) 0;
21614 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21615 #pragma GCC diagnostic pop
21616 #endif
21617     const int is_unsigned = neg_one > const_zero;
21618     if (is_unsigned) {
21619         if (sizeof(unsigned PY_LONG_LONG) < sizeof(long)) {
21620             return PyInt_FromLong((long) value);
21621         } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long)) {
21622             return PyLong_FromUnsignedLong((unsigned long) value);
21623 #ifdef HAVE_LONG_LONG
21624         } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
21625             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
21626 #endif
21627         }
21628     } else {
21629         if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long)) {
21630             return PyInt_FromLong((long) value);
21631 #ifdef HAVE_LONG_LONG
21632         } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
21633             return PyLong_FromLongLong((PY_LONG_LONG) value);
21634 #endif
21635         }
21636     }
21637     {
21638         int one = 1; int little = (int)*(unsigned char *)&one;
21639         unsigned char *bytes = (unsigned char *)&value;
21640         return _PyLong_FromByteArray(bytes, sizeof(unsigned PY_LONG_LONG),
21641                                      little, !is_unsigned);
21642     }
21643 }
21644 
21645 /* CIntFromPy */
__Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject * x)21646   static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject *x) {
21647 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21648 #pragma GCC diagnostic push
21649 #pragma GCC diagnostic ignored "-Wconversion"
21650 #endif
21651     const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG) -1, const_zero = (unsigned PY_LONG_LONG) 0;
21652 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21653 #pragma GCC diagnostic pop
21654 #endif
21655     const int is_unsigned = neg_one > const_zero;
21656 #if PY_MAJOR_VERSION < 3
21657     if (likely(PyInt_Check(x))) {
21658         if (sizeof(unsigned PY_LONG_LONG) < sizeof(long)) {
21659             __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, PyInt_AS_LONG(x))
21660         } else {
21661             long val = PyInt_AS_LONG(x);
21662             if (is_unsigned && unlikely(val < 0)) {
21663                 goto raise_neg_overflow;
21664             }
21665             return (unsigned PY_LONG_LONG) val;
21666         }
21667     } else
21668 #endif
21669     if (likely(PyLong_Check(x))) {
21670         if (is_unsigned) {
21671 #if CYTHON_USE_PYLONG_INTERNALS
21672             const digit* digits = ((PyLongObject*)x)->ob_digit;
21673             switch (Py_SIZE(x)) {
21674                 case  0: return (unsigned PY_LONG_LONG) 0;
21675                 case  1: __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, digit, digits[0])
21676                 case 2:
21677                     if (8 * sizeof(unsigned PY_LONG_LONG) > 1 * PyLong_SHIFT) {
21678                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
21679                             __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21680                         } else if (8 * sizeof(unsigned PY_LONG_LONG) >= 2 * PyLong_SHIFT) {
21681                             return (unsigned PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
21682                         }
21683                     }
21684                     break;
21685                 case 3:
21686                     if (8 * sizeof(unsigned PY_LONG_LONG) > 2 * PyLong_SHIFT) {
21687                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
21688                             __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])))
21689                         } else if (8 * sizeof(unsigned PY_LONG_LONG) >= 3 * PyLong_SHIFT) {
21690                             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]));
21691                         }
21692                     }
21693                     break;
21694                 case 4:
21695                     if (8 * sizeof(unsigned PY_LONG_LONG) > 3 * PyLong_SHIFT) {
21696                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
21697                             __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])))
21698                         } else if (8 * sizeof(unsigned PY_LONG_LONG) >= 4 * PyLong_SHIFT) {
21699                             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]));
21700                         }
21701                     }
21702                     break;
21703             }
21704 #endif
21705 #if CYTHON_COMPILING_IN_CPYTHON
21706             if (unlikely(Py_SIZE(x) < 0)) {
21707                 goto raise_neg_overflow;
21708             }
21709 #else
21710             {
21711                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
21712                 if (unlikely(result < 0))
21713                     return (unsigned PY_LONG_LONG) -1;
21714                 if (unlikely(result == 1))
21715                     goto raise_neg_overflow;
21716             }
21717 #endif
21718             if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long)) {
21719                 __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x))
21720 #ifdef HAVE_LONG_LONG
21721             } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
21722                 __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
21723 #endif
21724             }
21725         } else {
21726 #if CYTHON_USE_PYLONG_INTERNALS
21727             const digit* digits = ((PyLongObject*)x)->ob_digit;
21728             switch (Py_SIZE(x)) {
21729                 case  0: return (unsigned PY_LONG_LONG) 0;
21730                 case -1: __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, sdigit, (sdigit) (-(sdigit)digits[0]))
21731                 case  1: __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG,  digit, +digits[0])
21732                 case -2:
21733                     if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT) {
21734                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
21735                             __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21736                         } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21737                             return (unsigned PY_LONG_LONG) (((unsigned PY_LONG_LONG)-1)*(((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
21738                         }
21739                     }
21740                     break;
21741                 case 2:
21742                     if (8 * sizeof(unsigned PY_LONG_LONG) > 1 * PyLong_SHIFT) {
21743                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
21744                             __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21745                         } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21746                             return (unsigned PY_LONG_LONG) ((((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
21747                         }
21748                     }
21749                     break;
21750                 case -3:
21751                     if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21752                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
21753                             __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])))
21754                         } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21755                             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])));
21756                         }
21757                     }
21758                     break;
21759                 case 3:
21760                     if (8 * sizeof(unsigned PY_LONG_LONG) > 2 * PyLong_SHIFT) {
21761                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
21762                             __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])))
21763                         } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21764                             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])));
21765                         }
21766                     }
21767                     break;
21768                 case -4:
21769                     if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21770                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
21771                             __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])))
21772                         } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21773                             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])));
21774                         }
21775                     }
21776                     break;
21777                 case 4:
21778                     if (8 * sizeof(unsigned PY_LONG_LONG) > 3 * PyLong_SHIFT) {
21779                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
21780                             __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])))
21781                         } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21782                             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])));
21783                         }
21784                     }
21785                     break;
21786             }
21787 #endif
21788             if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long)) {
21789                 __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, long, PyLong_AsLong(x))
21790 #ifdef HAVE_LONG_LONG
21791             } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
21792                 __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x))
21793 #endif
21794             }
21795         }
21796         {
21797 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
21798             PyErr_SetString(PyExc_RuntimeError,
21799                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
21800 #else
21801             unsigned PY_LONG_LONG val;
21802             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
21803  #if PY_MAJOR_VERSION < 3
21804             if (likely(v) && !PyLong_Check(v)) {
21805                 PyObject *tmp = v;
21806                 v = PyNumber_Long(tmp);
21807                 Py_DECREF(tmp);
21808             }
21809  #endif
21810             if (likely(v)) {
21811                 int one = 1; int is_little = (int)*(unsigned char *)&one;
21812                 unsigned char *bytes = (unsigned char *)&val;
21813                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
21814                                               bytes, sizeof(val),
21815                                               is_little, !is_unsigned);
21816                 Py_DECREF(v);
21817                 if (likely(!ret))
21818                     return val;
21819             }
21820 #endif
21821             return (unsigned PY_LONG_LONG) -1;
21822         }
21823     } else {
21824         unsigned PY_LONG_LONG val;
21825         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
21826         if (!tmp) return (unsigned PY_LONG_LONG) -1;
21827         val = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(tmp);
21828         Py_DECREF(tmp);
21829         return val;
21830     }
21831 raise_overflow:
21832     PyErr_SetString(PyExc_OverflowError,
21833         "value too large to convert to unsigned PY_LONG_LONG");
21834     return (unsigned PY_LONG_LONG) -1;
21835 raise_neg_overflow:
21836     PyErr_SetString(PyExc_OverflowError,
21837         "can't convert negative value to unsigned PY_LONG_LONG");
21838     return (unsigned PY_LONG_LONG) -1;
21839 }
21840 
21841 /* CIntToPy */
__Pyx_PyInt_From_unsigned_short(unsigned short value)21842   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_short(unsigned short value) {
21843 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21844 #pragma GCC diagnostic push
21845 #pragma GCC diagnostic ignored "-Wconversion"
21846 #endif
21847     const unsigned short neg_one = (unsigned short) -1, const_zero = (unsigned short) 0;
21848 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21849 #pragma GCC diagnostic pop
21850 #endif
21851     const int is_unsigned = neg_one > const_zero;
21852     if (is_unsigned) {
21853         if (sizeof(unsigned short) < sizeof(long)) {
21854             return PyInt_FromLong((long) value);
21855         } else if (sizeof(unsigned short) <= sizeof(unsigned long)) {
21856             return PyLong_FromUnsignedLong((unsigned long) value);
21857 #ifdef HAVE_LONG_LONG
21858         } else if (sizeof(unsigned short) <= sizeof(unsigned PY_LONG_LONG)) {
21859             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
21860 #endif
21861         }
21862     } else {
21863         if (sizeof(unsigned short) <= sizeof(long)) {
21864             return PyInt_FromLong((long) value);
21865 #ifdef HAVE_LONG_LONG
21866         } else if (sizeof(unsigned short) <= sizeof(PY_LONG_LONG)) {
21867             return PyLong_FromLongLong((PY_LONG_LONG) value);
21868 #endif
21869         }
21870     }
21871     {
21872         int one = 1; int little = (int)*(unsigned char *)&one;
21873         unsigned char *bytes = (unsigned char *)&value;
21874         return _PyLong_FromByteArray(bytes, sizeof(unsigned short),
21875                                      little, !is_unsigned);
21876     }
21877 }
21878 
21879 /* CIntFromPy */
__Pyx_PyInt_As_unsigned_short(PyObject * x)21880   static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *x) {
21881 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21882 #pragma GCC diagnostic push
21883 #pragma GCC diagnostic ignored "-Wconversion"
21884 #endif
21885     const unsigned short neg_one = (unsigned short) -1, const_zero = (unsigned short) 0;
21886 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21887 #pragma GCC diagnostic pop
21888 #endif
21889     const int is_unsigned = neg_one > const_zero;
21890 #if PY_MAJOR_VERSION < 3
21891     if (likely(PyInt_Check(x))) {
21892         if (sizeof(unsigned short) < sizeof(long)) {
21893             __PYX_VERIFY_RETURN_INT(unsigned short, long, PyInt_AS_LONG(x))
21894         } else {
21895             long val = PyInt_AS_LONG(x);
21896             if (is_unsigned && unlikely(val < 0)) {
21897                 goto raise_neg_overflow;
21898             }
21899             return (unsigned short) val;
21900         }
21901     } else
21902 #endif
21903     if (likely(PyLong_Check(x))) {
21904         if (is_unsigned) {
21905 #if CYTHON_USE_PYLONG_INTERNALS
21906             const digit* digits = ((PyLongObject*)x)->ob_digit;
21907             switch (Py_SIZE(x)) {
21908                 case  0: return (unsigned short) 0;
21909                 case  1: __PYX_VERIFY_RETURN_INT(unsigned short, digit, digits[0])
21910                 case 2:
21911                     if (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT) {
21912                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
21913                             __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21914                         } else if (8 * sizeof(unsigned short) >= 2 * PyLong_SHIFT) {
21915                             return (unsigned short) (((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
21916                         }
21917                     }
21918                     break;
21919                 case 3:
21920                     if (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT) {
21921                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
21922                             __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21923                         } else if (8 * sizeof(unsigned short) >= 3 * PyLong_SHIFT) {
21924                             return (unsigned short) (((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
21925                         }
21926                     }
21927                     break;
21928                 case 4:
21929                     if (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT) {
21930                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
21931                             __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])))
21932                         } else if (8 * sizeof(unsigned short) >= 4 * PyLong_SHIFT) {
21933                             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]));
21934                         }
21935                     }
21936                     break;
21937             }
21938 #endif
21939 #if CYTHON_COMPILING_IN_CPYTHON
21940             if (unlikely(Py_SIZE(x) < 0)) {
21941                 goto raise_neg_overflow;
21942             }
21943 #else
21944             {
21945                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
21946                 if (unlikely(result < 0))
21947                     return (unsigned short) -1;
21948                 if (unlikely(result == 1))
21949                     goto raise_neg_overflow;
21950             }
21951 #endif
21952             if (sizeof(unsigned short) <= sizeof(unsigned long)) {
21953                 __PYX_VERIFY_RETURN_INT_EXC(unsigned short, unsigned long, PyLong_AsUnsignedLong(x))
21954 #ifdef HAVE_LONG_LONG
21955             } else if (sizeof(unsigned short) <= sizeof(unsigned PY_LONG_LONG)) {
21956                 __PYX_VERIFY_RETURN_INT_EXC(unsigned short, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
21957 #endif
21958             }
21959         } else {
21960 #if CYTHON_USE_PYLONG_INTERNALS
21961             const digit* digits = ((PyLongObject*)x)->ob_digit;
21962             switch (Py_SIZE(x)) {
21963                 case  0: return (unsigned short) 0;
21964                 case -1: __PYX_VERIFY_RETURN_INT(unsigned short, sdigit, (sdigit) (-(sdigit)digits[0]))
21965                 case  1: __PYX_VERIFY_RETURN_INT(unsigned short,  digit, +digits[0])
21966                 case -2:
21967                     if (8 * sizeof(unsigned short) - 1 > 1 * PyLong_SHIFT) {
21968                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
21969                             __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21970                         } else if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) {
21971                             return (unsigned short) (((unsigned short)-1)*(((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
21972                         }
21973                     }
21974                     break;
21975                 case 2:
21976                     if (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT) {
21977                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
21978                             __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21979                         } else if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) {
21980                             return (unsigned short) ((((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
21981                         }
21982                     }
21983                     break;
21984                 case -3:
21985                     if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) {
21986                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
21987                             __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21988                         } else if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) {
21989                             return (unsigned short) (((unsigned short)-1)*(((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
21990                         }
21991                     }
21992                     break;
21993                 case 3:
21994                     if (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT) {
21995                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
21996                             __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21997                         } else if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) {
21998                             return (unsigned short) ((((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
21999                         }
22000                     }
22001                     break;
22002                 case -4:
22003                     if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) {
22004                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22005                             __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])))
22006                         } else if (8 * sizeof(unsigned short) - 1 > 4 * PyLong_SHIFT) {
22007                             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])));
22008                         }
22009                     }
22010                     break;
22011                 case 4:
22012                     if (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT) {
22013                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22014                             __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])))
22015                         } else if (8 * sizeof(unsigned short) - 1 > 4 * PyLong_SHIFT) {
22016                             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])));
22017                         }
22018                     }
22019                     break;
22020             }
22021 #endif
22022             if (sizeof(unsigned short) <= sizeof(long)) {
22023                 __PYX_VERIFY_RETURN_INT_EXC(unsigned short, long, PyLong_AsLong(x))
22024 #ifdef HAVE_LONG_LONG
22025             } else if (sizeof(unsigned short) <= sizeof(PY_LONG_LONG)) {
22026                 __PYX_VERIFY_RETURN_INT_EXC(unsigned short, PY_LONG_LONG, PyLong_AsLongLong(x))
22027 #endif
22028             }
22029         }
22030         {
22031 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
22032             PyErr_SetString(PyExc_RuntimeError,
22033                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22034 #else
22035             unsigned short val;
22036             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22037  #if PY_MAJOR_VERSION < 3
22038             if (likely(v) && !PyLong_Check(v)) {
22039                 PyObject *tmp = v;
22040                 v = PyNumber_Long(tmp);
22041                 Py_DECREF(tmp);
22042             }
22043  #endif
22044             if (likely(v)) {
22045                 int one = 1; int is_little = (int)*(unsigned char *)&one;
22046                 unsigned char *bytes = (unsigned char *)&val;
22047                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22048                                               bytes, sizeof(val),
22049                                               is_little, !is_unsigned);
22050                 Py_DECREF(v);
22051                 if (likely(!ret))
22052                     return val;
22053             }
22054 #endif
22055             return (unsigned short) -1;
22056         }
22057     } else {
22058         unsigned short val;
22059         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22060         if (!tmp) return (unsigned short) -1;
22061         val = __Pyx_PyInt_As_unsigned_short(tmp);
22062         Py_DECREF(tmp);
22063         return val;
22064     }
22065 raise_overflow:
22066     PyErr_SetString(PyExc_OverflowError,
22067         "value too large to convert to unsigned short");
22068     return (unsigned short) -1;
22069 raise_neg_overflow:
22070     PyErr_SetString(PyExc_OverflowError,
22071         "can't convert negative value to unsigned short");
22072     return (unsigned short) -1;
22073 }
22074 
22075 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)22076   static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
22077 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
22078 #pragma GCC diagnostic push
22079 #pragma GCC diagnostic ignored "-Wconversion"
22080 #endif
22081     const long neg_one = (long) -1, const_zero = (long) 0;
22082 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
22083 #pragma GCC diagnostic pop
22084 #endif
22085     const int is_unsigned = neg_one > const_zero;
22086 #if PY_MAJOR_VERSION < 3
22087     if (likely(PyInt_Check(x))) {
22088         if (sizeof(long) < sizeof(long)) {
22089             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
22090         } else {
22091             long val = PyInt_AS_LONG(x);
22092             if (is_unsigned && unlikely(val < 0)) {
22093                 goto raise_neg_overflow;
22094             }
22095             return (long) val;
22096         }
22097     } else
22098 #endif
22099     if (likely(PyLong_Check(x))) {
22100         if (is_unsigned) {
22101 #if CYTHON_USE_PYLONG_INTERNALS
22102             const digit* digits = ((PyLongObject*)x)->ob_digit;
22103             switch (Py_SIZE(x)) {
22104                 case  0: return (long) 0;
22105                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
22106                 case 2:
22107                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
22108                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
22109                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22110                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
22111                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
22112                         }
22113                     }
22114                     break;
22115                 case 3:
22116                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
22117                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
22118                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22119                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
22120                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
22121                         }
22122                     }
22123                     break;
22124                 case 4:
22125                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
22126                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22127                             __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])))
22128                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
22129                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
22130                         }
22131                     }
22132                     break;
22133             }
22134 #endif
22135 #if CYTHON_COMPILING_IN_CPYTHON
22136             if (unlikely(Py_SIZE(x) < 0)) {
22137                 goto raise_neg_overflow;
22138             }
22139 #else
22140             {
22141                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22142                 if (unlikely(result < 0))
22143                     return (long) -1;
22144                 if (unlikely(result == 1))
22145                     goto raise_neg_overflow;
22146             }
22147 #endif
22148             if (sizeof(long) <= sizeof(unsigned long)) {
22149                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
22150 #ifdef HAVE_LONG_LONG
22151             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
22152                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22153 #endif
22154             }
22155         } else {
22156 #if CYTHON_USE_PYLONG_INTERNALS
22157             const digit* digits = ((PyLongObject*)x)->ob_digit;
22158             switch (Py_SIZE(x)) {
22159                 case  0: return (long) 0;
22160                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
22161                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
22162                 case -2:
22163                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
22164                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
22165                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22166                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
22167                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22168                         }
22169                     }
22170                     break;
22171                 case 2:
22172                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
22173                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
22174                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22175                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
22176                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22177                         }
22178                     }
22179                     break;
22180                 case -3:
22181                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
22182                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
22183                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22184                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
22185                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22186                         }
22187                     }
22188                     break;
22189                 case 3:
22190                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
22191                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
22192                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22193                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
22194                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22195                         }
22196                     }
22197                     break;
22198                 case -4:
22199                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
22200                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22201                             __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])))
22202                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
22203                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22204                         }
22205                     }
22206                     break;
22207                 case 4:
22208                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
22209                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22210                             __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])))
22211                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
22212                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22213                         }
22214                     }
22215                     break;
22216             }
22217 #endif
22218             if (sizeof(long) <= sizeof(long)) {
22219                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
22220 #ifdef HAVE_LONG_LONG
22221             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
22222                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
22223 #endif
22224             }
22225         }
22226         {
22227 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
22228             PyErr_SetString(PyExc_RuntimeError,
22229                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22230 #else
22231             long val;
22232             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22233  #if PY_MAJOR_VERSION < 3
22234             if (likely(v) && !PyLong_Check(v)) {
22235                 PyObject *tmp = v;
22236                 v = PyNumber_Long(tmp);
22237                 Py_DECREF(tmp);
22238             }
22239  #endif
22240             if (likely(v)) {
22241                 int one = 1; int is_little = (int)*(unsigned char *)&one;
22242                 unsigned char *bytes = (unsigned char *)&val;
22243                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22244                                               bytes, sizeof(val),
22245                                               is_little, !is_unsigned);
22246                 Py_DECREF(v);
22247                 if (likely(!ret))
22248                     return val;
22249             }
22250 #endif
22251             return (long) -1;
22252         }
22253     } else {
22254         long val;
22255         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22256         if (!tmp) return (long) -1;
22257         val = __Pyx_PyInt_As_long(tmp);
22258         Py_DECREF(tmp);
22259         return val;
22260     }
22261 raise_overflow:
22262     PyErr_SetString(PyExc_OverflowError,
22263         "value too large to convert to long");
22264     return (long) -1;
22265 raise_neg_overflow:
22266     PyErr_SetString(PyExc_OverflowError,
22267         "can't convert negative value to long");
22268     return (long) -1;
22269 }
22270 
22271 /* CIntToPy */
__Pyx_PyInt_From_long(long value)22272   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
22273 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
22274 #pragma GCC diagnostic push
22275 #pragma GCC diagnostic ignored "-Wconversion"
22276 #endif
22277     const long neg_one = (long) -1, const_zero = (long) 0;
22278 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
22279 #pragma GCC diagnostic pop
22280 #endif
22281     const int is_unsigned = neg_one > const_zero;
22282     if (is_unsigned) {
22283         if (sizeof(long) < sizeof(long)) {
22284             return PyInt_FromLong((long) value);
22285         } else if (sizeof(long) <= sizeof(unsigned long)) {
22286             return PyLong_FromUnsignedLong((unsigned long) value);
22287 #ifdef HAVE_LONG_LONG
22288         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
22289             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
22290 #endif
22291         }
22292     } else {
22293         if (sizeof(long) <= sizeof(long)) {
22294             return PyInt_FromLong((long) value);
22295 #ifdef HAVE_LONG_LONG
22296         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
22297             return PyLong_FromLongLong((PY_LONG_LONG) value);
22298 #endif
22299         }
22300     }
22301     {
22302         int one = 1; int little = (int)*(unsigned char *)&one;
22303         unsigned char *bytes = (unsigned char *)&value;
22304         return _PyLong_FromByteArray(bytes, sizeof(long),
22305                                      little, !is_unsigned);
22306     }
22307 }
22308 
22309 /* FastTypeChecks */
22310   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)22311 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
22312     while (a) {
22313         a = a->tp_base;
22314         if (a == b)
22315             return 1;
22316     }
22317     return b == &PyBaseObject_Type;
22318 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)22319 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
22320     PyObject *mro;
22321     if (a == b) return 1;
22322     mro = a->tp_mro;
22323     if (likely(mro)) {
22324         Py_ssize_t i, n;
22325         n = PyTuple_GET_SIZE(mro);
22326         for (i = 0; i < n; i++) {
22327             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
22328                 return 1;
22329         }
22330         return 0;
22331     }
22332     return __Pyx_InBases(a, b);
22333 }
22334 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)22335 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
22336     PyObject *exception, *value, *tb;
22337     int res;
22338     __Pyx_PyThreadState_declare
22339     __Pyx_PyThreadState_assign
22340     __Pyx_ErrFetch(&exception, &value, &tb);
22341     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
22342     if (unlikely(res == -1)) {
22343         PyErr_WriteUnraisable(err);
22344         res = 0;
22345     }
22346     if (!res) {
22347         res = PyObject_IsSubclass(err, exc_type2);
22348         if (unlikely(res == -1)) {
22349             PyErr_WriteUnraisable(err);
22350             res = 0;
22351         }
22352     }
22353     __Pyx_ErrRestore(exception, value, tb);
22354     return res;
22355 }
22356 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)22357 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
22358     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
22359     if (!res) {
22360         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
22361     }
22362     return res;
22363 }
22364 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)22365 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
22366     Py_ssize_t i, n;
22367     assert(PyExceptionClass_Check(exc_type));
22368     n = PyTuple_GET_SIZE(tuple);
22369 #if PY_MAJOR_VERSION >= 3
22370     for (i=0; i<n; i++) {
22371         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
22372     }
22373 #endif
22374     for (i=0; i<n; i++) {
22375         PyObject *t = PyTuple_GET_ITEM(tuple, i);
22376         #if PY_MAJOR_VERSION < 3
22377         if (likely(exc_type == t)) return 1;
22378         #endif
22379         if (likely(PyExceptionClass_Check(t))) {
22380             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
22381         } else {
22382         }
22383     }
22384     return 0;
22385 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)22386 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
22387     if (likely(err == exc_type)) return 1;
22388     if (likely(PyExceptionClass_Check(err))) {
22389         if (likely(PyExceptionClass_Check(exc_type))) {
22390             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
22391         } else if (likely(PyTuple_Check(exc_type))) {
22392             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
22393         } else {
22394         }
22395     }
22396     return PyErr_GivenExceptionMatches(err, exc_type);
22397 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)22398 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
22399     assert(PyExceptionClass_Check(exc_type1));
22400     assert(PyExceptionClass_Check(exc_type2));
22401     if (likely(err == exc_type1 || err == exc_type2)) return 1;
22402     if (likely(PyExceptionClass_Check(err))) {
22403         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
22404     }
22405     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
22406 }
22407 #endif
22408 
22409 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)22410   static int __Pyx_check_binary_version(void) {
22411     char ctversion[4], rtversion[4];
22412     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
22413     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
22414     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
22415         char message[200];
22416         PyOS_snprintf(message, sizeof(message),
22417                       "compiletime version %s of module '%.100s' "
22418                       "does not match runtime version %s",
22419                       ctversion, __Pyx_MODULE_NAME, rtversion);
22420         return PyErr_WarnEx(NULL, message, 1);
22421     }
22422     return 0;
22423 }
22424 
22425 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)22426   static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
22427     while (t->p) {
22428         #if PY_MAJOR_VERSION < 3
22429         if (t->is_unicode) {
22430             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
22431         } else if (t->intern) {
22432             *t->p = PyString_InternFromString(t->s);
22433         } else {
22434             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
22435         }
22436         #else
22437         if (t->is_unicode | t->is_str) {
22438             if (t->intern) {
22439                 *t->p = PyUnicode_InternFromString(t->s);
22440             } else if (t->encoding) {
22441                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
22442             } else {
22443                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
22444             }
22445         } else {
22446             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
22447         }
22448         #endif
22449         if (!*t->p)
22450             return -1;
22451         if (PyObject_Hash(*t->p) == -1)
22452             return -1;
22453         ++t;
22454     }
22455     return 0;
22456 }
22457 
__Pyx_PyUnicode_FromString(const char * c_str)22458 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
22459     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
22460 }
__Pyx_PyObject_AsString(PyObject * o)22461 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
22462     Py_ssize_t ignore;
22463     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
22464 }
22465 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
22466 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)22467 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
22468     char* defenc_c;
22469     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
22470     if (!defenc) return NULL;
22471     defenc_c = PyBytes_AS_STRING(defenc);
22472 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
22473     {
22474         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
22475         char* c;
22476         for (c = defenc_c; c < end; c++) {
22477             if ((unsigned char) (*c) >= 128) {
22478                 PyUnicode_AsASCIIString(o);
22479                 return NULL;
22480             }
22481         }
22482     }
22483 #endif
22484     *length = PyBytes_GET_SIZE(defenc);
22485     return defenc_c;
22486 }
22487 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)22488 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
22489     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
22490 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
22491     if (likely(PyUnicode_IS_ASCII(o))) {
22492         *length = PyUnicode_GET_LENGTH(o);
22493         return PyUnicode_AsUTF8(o);
22494     } else {
22495         PyUnicode_AsASCIIString(o);
22496         return NULL;
22497     }
22498 #else
22499     return PyUnicode_AsUTF8AndSize(o, length);
22500 #endif
22501 }
22502 #endif
22503 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)22504 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
22505 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
22506     if (
22507 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
22508             __Pyx_sys_getdefaultencoding_not_ascii &&
22509 #endif
22510             PyUnicode_Check(o)) {
22511         return __Pyx_PyUnicode_AsStringAndSize(o, length);
22512     } else
22513 #endif
22514 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
22515     if (PyByteArray_Check(o)) {
22516         *length = PyByteArray_GET_SIZE(o);
22517         return PyByteArray_AS_STRING(o);
22518     } else
22519 #endif
22520     {
22521         char* result;
22522         int r = PyBytes_AsStringAndSize(o, &result, length);
22523         if (unlikely(r < 0)) {
22524             return NULL;
22525         } else {
22526             return result;
22527         }
22528     }
22529 }
__Pyx_PyObject_IsTrue(PyObject * x)22530 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
22531    int is_true = x == Py_True;
22532    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
22533    else return PyObject_IsTrue(x);
22534 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)22535 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
22536     int retval;
22537     if (unlikely(!x)) return -1;
22538     retval = __Pyx_PyObject_IsTrue(x);
22539     Py_DECREF(x);
22540     return retval;
22541 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)22542 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
22543 #if PY_MAJOR_VERSION >= 3
22544     if (PyLong_Check(result)) {
22545         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
22546                 "__int__ returned non-int (type %.200s).  "
22547                 "The ability to return an instance of a strict subclass of int "
22548                 "is deprecated, and may be removed in a future version of Python.",
22549                 Py_TYPE(result)->tp_name)) {
22550             Py_DECREF(result);
22551             return NULL;
22552         }
22553         return result;
22554     }
22555 #endif
22556     PyErr_Format(PyExc_TypeError,
22557                  "__%.4s__ returned non-%.4s (type %.200s)",
22558                  type_name, type_name, Py_TYPE(result)->tp_name);
22559     Py_DECREF(result);
22560     return NULL;
22561 }
__Pyx_PyNumber_IntOrLong(PyObject * x)22562 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
22563 #if CYTHON_USE_TYPE_SLOTS
22564   PyNumberMethods *m;
22565 #endif
22566   const char *name = NULL;
22567   PyObject *res = NULL;
22568 #if PY_MAJOR_VERSION < 3
22569   if (likely(PyInt_Check(x) || PyLong_Check(x)))
22570 #else
22571   if (likely(PyLong_Check(x)))
22572 #endif
22573     return __Pyx_NewRef(x);
22574 #if CYTHON_USE_TYPE_SLOTS
22575   m = Py_TYPE(x)->tp_as_number;
22576   #if PY_MAJOR_VERSION < 3
22577   if (m && m->nb_int) {
22578     name = "int";
22579     res = m->nb_int(x);
22580   }
22581   else if (m && m->nb_long) {
22582     name = "long";
22583     res = m->nb_long(x);
22584   }
22585   #else
22586   if (likely(m && m->nb_int)) {
22587     name = "int";
22588     res = m->nb_int(x);
22589   }
22590   #endif
22591 #else
22592   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
22593     res = PyNumber_Int(x);
22594   }
22595 #endif
22596   if (likely(res)) {
22597 #if PY_MAJOR_VERSION < 3
22598     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
22599 #else
22600     if (unlikely(!PyLong_CheckExact(res))) {
22601 #endif
22602         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
22603     }
22604   }
22605   else if (!PyErr_Occurred()) {
22606     PyErr_SetString(PyExc_TypeError,
22607                     "an integer is required");
22608   }
22609   return res;
22610 }
22611 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
22612   Py_ssize_t ival;
22613   PyObject *x;
22614 #if PY_MAJOR_VERSION < 3
22615   if (likely(PyInt_CheckExact(b))) {
22616     if (sizeof(Py_ssize_t) >= sizeof(long))
22617         return PyInt_AS_LONG(b);
22618     else
22619         return PyInt_AsSsize_t(b);
22620   }
22621 #endif
22622   if (likely(PyLong_CheckExact(b))) {
22623     #if CYTHON_USE_PYLONG_INTERNALS
22624     const digit* digits = ((PyLongObject*)b)->ob_digit;
22625     const Py_ssize_t size = Py_SIZE(b);
22626     if (likely(__Pyx_sst_abs(size) <= 1)) {
22627         ival = likely(size) ? digits[0] : 0;
22628         if (size == -1) ival = -ival;
22629         return ival;
22630     } else {
22631       switch (size) {
22632          case 2:
22633            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
22634              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
22635            }
22636            break;
22637          case -2:
22638            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
22639              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
22640            }
22641            break;
22642          case 3:
22643            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
22644              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
22645            }
22646            break;
22647          case -3:
22648            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
22649              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
22650            }
22651            break;
22652          case 4:
22653            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
22654              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]));
22655            }
22656            break;
22657          case -4:
22658            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
22659              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]));
22660            }
22661            break;
22662       }
22663     }
22664     #endif
22665     return PyLong_AsSsize_t(b);
22666   }
22667   x = PyNumber_Index(b);
22668   if (!x) return -1;
22669   ival = PyInt_AsSsize_t(x);
22670   Py_DECREF(x);
22671   return ival;
22672 }
22673 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
22674   if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
22675     return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
22676 #if PY_MAJOR_VERSION < 3
22677   } else if (likely(PyInt_CheckExact(o))) {
22678     return PyInt_AS_LONG(o);
22679 #endif
22680   } else {
22681     Py_ssize_t ival;
22682     PyObject *x;
22683     x = PyNumber_Index(o);
22684     if (!x) return -1;
22685     ival = PyInt_AsLong(x);
22686     Py_DECREF(x);
22687     return ival;
22688   }
22689 }
22690 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
22691   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
22692 }
22693 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
22694     return PyInt_FromSize_t(ival);
22695 }
22696 
22697 
22698 #endif /* Py_PYTHON_H */
22699