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 1
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__arrays__array_tree
677 #define __PYX_HAVE_API__bx__arrays__array_tree
678 /* Early includes */
679 #include <string.h>
680 #include <stdio.h>
681 #include "numpy/arrayobject.h"
682 #include "numpy/ndarrayobject.h"
683 #include "numpy/ndarraytypes.h"
684 #include "numpy/arrayscalars.h"
685 #include "numpy/ufuncobject.h"
686 
687     /* NumPy API declarations from "numpy/__init__.pxd" */
688 
689 #ifdef _OPENMP
690 #include <omp.h>
691 #endif /* _OPENMP */
692 
693 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
694 #define CYTHON_WITHOUT_ASSERTIONS
695 #endif
696 
697 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
698                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
699 
700 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
701 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
702 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
703 #define __PYX_DEFAULT_STRING_ENCODING ""
704 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
705 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
706 #define __Pyx_uchar_cast(c) ((unsigned char)c)
707 #define __Pyx_long_cast(x) ((long)x)
708 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
709     (sizeof(type) < sizeof(Py_ssize_t))  ||\
710     (sizeof(type) > sizeof(Py_ssize_t) &&\
711           likely(v < (type)PY_SSIZE_T_MAX ||\
712                  v == (type)PY_SSIZE_T_MAX)  &&\
713           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
714                                 v == (type)PY_SSIZE_T_MIN)))  ||\
715     (sizeof(type) == sizeof(Py_ssize_t) &&\
716           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
717                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)718 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
719     return (size_t) i < (size_t) limit;
720 }
721 #if defined (__cplusplus) && __cplusplus >= 201103L
722     #include <cstdlib>
723     #define __Pyx_sst_abs(value) std::abs(value)
724 #elif SIZEOF_INT >= SIZEOF_SIZE_T
725     #define __Pyx_sst_abs(value) abs(value)
726 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
727     #define __Pyx_sst_abs(value) labs(value)
728 #elif defined (_MSC_VER)
729     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
730 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
731     #define __Pyx_sst_abs(value) llabs(value)
732 #elif defined (__GNUC__)
733     #define __Pyx_sst_abs(value) __builtin_llabs(value)
734 #else
735     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
736 #endif
737 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
738 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
739 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
740 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
741 #define __Pyx_PyBytes_FromString        PyBytes_FromString
742 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
743 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
744 #if PY_MAJOR_VERSION < 3
745     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
746     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
747 #else
748     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
749     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
750 #endif
751 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
752 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
753 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
754 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
755 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
756 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
757 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
758 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
759 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
760 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
761 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
762 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
763 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
764 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
765 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
766 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)767 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
768     const Py_UNICODE *u_end = u;
769     while (*u_end++) ;
770     return (size_t)(u_end - u - 1);
771 }
772 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
773 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
774 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
775 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
776 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
777 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
778 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
779 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
780 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
781 #define __Pyx_PySequence_Tuple(obj)\
782     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
783 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
784 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
785 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
786 #if CYTHON_ASSUME_SAFE_MACROS
787 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
788 #else
789 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
790 #endif
791 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
792 #if PY_MAJOR_VERSION >= 3
793 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
794 #else
795 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
796 #endif
797 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
798 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
799 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)800 static int __Pyx_init_sys_getdefaultencoding_params(void) {
801     PyObject* sys;
802     PyObject* default_encoding = NULL;
803     PyObject* ascii_chars_u = NULL;
804     PyObject* ascii_chars_b = NULL;
805     const char* default_encoding_c;
806     sys = PyImport_ImportModule("sys");
807     if (!sys) goto bad;
808     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
809     Py_DECREF(sys);
810     if (!default_encoding) goto bad;
811     default_encoding_c = PyBytes_AsString(default_encoding);
812     if (!default_encoding_c) goto bad;
813     if (strcmp(default_encoding_c, "ascii") == 0) {
814         __Pyx_sys_getdefaultencoding_not_ascii = 0;
815     } else {
816         char ascii_chars[128];
817         int c;
818         for (c = 0; c < 128; c++) {
819             ascii_chars[c] = c;
820         }
821         __Pyx_sys_getdefaultencoding_not_ascii = 1;
822         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
823         if (!ascii_chars_u) goto bad;
824         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
825         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
826             PyErr_Format(
827                 PyExc_ValueError,
828                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
829                 default_encoding_c);
830             goto bad;
831         }
832         Py_DECREF(ascii_chars_u);
833         Py_DECREF(ascii_chars_b);
834     }
835     Py_DECREF(default_encoding);
836     return 0;
837 bad:
838     Py_XDECREF(default_encoding);
839     Py_XDECREF(ascii_chars_u);
840     Py_XDECREF(ascii_chars_b);
841     return -1;
842 }
843 #endif
844 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
845 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
846 #else
847 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
848 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
849 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)850 static int __Pyx_init_sys_getdefaultencoding_params(void) {
851     PyObject* sys;
852     PyObject* default_encoding = NULL;
853     char* default_encoding_c;
854     sys = PyImport_ImportModule("sys");
855     if (!sys) goto bad;
856     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
857     Py_DECREF(sys);
858     if (!default_encoding) goto bad;
859     default_encoding_c = PyBytes_AsString(default_encoding);
860     if (!default_encoding_c) goto bad;
861     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
862     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
863     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
864     Py_DECREF(default_encoding);
865     return 0;
866 bad:
867     Py_XDECREF(default_encoding);
868     return -1;
869 }
870 #endif
871 #endif
872 
873 
874 /* Test for GCC > 2.95 */
875 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
876   #define likely(x)   __builtin_expect(!!(x), 1)
877   #define unlikely(x) __builtin_expect(!!(x), 0)
878 #else /* !__GNUC__ or GCC < 2.95 */
879   #define likely(x)   (x)
880   #define unlikely(x) (x)
881 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)882 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
883 
884 static PyObject *__pyx_m = NULL;
885 static PyObject *__pyx_d;
886 static PyObject *__pyx_b;
887 static PyObject *__pyx_cython_runtime = NULL;
888 static PyObject *__pyx_empty_tuple;
889 static PyObject *__pyx_empty_bytes;
890 static PyObject *__pyx_empty_unicode;
891 static int __pyx_lineno;
892 static int __pyx_clineno = 0;
893 static const char * __pyx_cfilenm= __FILE__;
894 static const char *__pyx_filename;
895 
896 /* Header.proto */
897 #if !defined(CYTHON_CCOMPLEX)
898   #if defined(__cplusplus)
899     #define CYTHON_CCOMPLEX 1
900   #elif defined(_Complex_I)
901     #define CYTHON_CCOMPLEX 1
902   #else
903     #define CYTHON_CCOMPLEX 0
904   #endif
905 #endif
906 #if CYTHON_CCOMPLEX
907   #ifdef __cplusplus
908     #include <complex>
909   #else
910     #include <complex.h>
911   #endif
912 #endif
913 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
914   #undef _Complex_I
915   #define _Complex_I 1.0fj
916 #endif
917 
918 
919 static const char *__pyx_f[] = {
920   "lib/bx/arrays/array_tree.pyx",
921   "stringsource",
922   "__init__.pxd",
923   "type.pxd",
924   "lib/bx/arrays/wiggle.pxd",
925 };
926 
927 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":690
928  * # in Cython to enable them only on the right systems.
929  *
930  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
931  * ctypedef npy_int16      int16_t
932  * ctypedef npy_int32      int32_t
933  */
934 typedef npy_int8 __pyx_t_5numpy_int8_t;
935 
936 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":691
937  *
938  * ctypedef npy_int8       int8_t
939  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
940  * ctypedef npy_int32      int32_t
941  * ctypedef npy_int64      int64_t
942  */
943 typedef npy_int16 __pyx_t_5numpy_int16_t;
944 
945 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":692
946  * ctypedef npy_int8       int8_t
947  * ctypedef npy_int16      int16_t
948  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
949  * ctypedef npy_int64      int64_t
950  * #ctypedef npy_int96      int96_t
951  */
952 typedef npy_int32 __pyx_t_5numpy_int32_t;
953 
954 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":693
955  * ctypedef npy_int16      int16_t
956  * ctypedef npy_int32      int32_t
957  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
958  * #ctypedef npy_int96      int96_t
959  * #ctypedef npy_int128     int128_t
960  */
961 typedef npy_int64 __pyx_t_5numpy_int64_t;
962 
963 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":697
964  * #ctypedef npy_int128     int128_t
965  *
966  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
967  * ctypedef npy_uint16     uint16_t
968  * ctypedef npy_uint32     uint32_t
969  */
970 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
971 
972 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":698
973  *
974  * ctypedef npy_uint8      uint8_t
975  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
976  * ctypedef npy_uint32     uint32_t
977  * ctypedef npy_uint64     uint64_t
978  */
979 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
980 
981 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":699
982  * ctypedef npy_uint8      uint8_t
983  * ctypedef npy_uint16     uint16_t
984  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
985  * ctypedef npy_uint64     uint64_t
986  * #ctypedef npy_uint96     uint96_t
987  */
988 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
989 
990 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":700
991  * ctypedef npy_uint16     uint16_t
992  * ctypedef npy_uint32     uint32_t
993  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
994  * #ctypedef npy_uint96     uint96_t
995  * #ctypedef npy_uint128    uint128_t
996  */
997 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
998 
999 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":704
1000  * #ctypedef npy_uint128    uint128_t
1001  *
1002  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
1003  * ctypedef npy_float64    float64_t
1004  * #ctypedef npy_float80    float80_t
1005  */
1006 typedef npy_float32 __pyx_t_5numpy_float32_t;
1007 
1008 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":705
1009  *
1010  * ctypedef npy_float32    float32_t
1011  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
1012  * #ctypedef npy_float80    float80_t
1013  * #ctypedef npy_float128   float128_t
1014  */
1015 typedef npy_float64 __pyx_t_5numpy_float64_t;
1016 
1017 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":714
1018  * # The int types are mapped a bit surprising --
1019  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1020  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
1021  * ctypedef npy_longlong   long_t
1022  * ctypedef npy_longlong   longlong_t
1023  */
1024 typedef npy_long __pyx_t_5numpy_int_t;
1025 
1026 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":715
1027  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1028  * ctypedef npy_long       int_t
1029  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
1030  * ctypedef npy_longlong   longlong_t
1031  *
1032  */
1033 typedef npy_longlong __pyx_t_5numpy_long_t;
1034 
1035 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":716
1036  * ctypedef npy_long       int_t
1037  * ctypedef npy_longlong   long_t
1038  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
1039  *
1040  * ctypedef npy_ulong      uint_t
1041  */
1042 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1043 
1044 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":718
1045  * ctypedef npy_longlong   longlong_t
1046  *
1047  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
1048  * ctypedef npy_ulonglong  ulong_t
1049  * ctypedef npy_ulonglong  ulonglong_t
1050  */
1051 typedef npy_ulong __pyx_t_5numpy_uint_t;
1052 
1053 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":719
1054  *
1055  * ctypedef npy_ulong      uint_t
1056  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
1057  * ctypedef npy_ulonglong  ulonglong_t
1058  *
1059  */
1060 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1061 
1062 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":720
1063  * ctypedef npy_ulong      uint_t
1064  * ctypedef npy_ulonglong  ulong_t
1065  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
1066  *
1067  * ctypedef npy_intp       intp_t
1068  */
1069 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1070 
1071 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":722
1072  * ctypedef npy_ulonglong  ulonglong_t
1073  *
1074  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1075  * ctypedef npy_uintp      uintp_t
1076  *
1077  */
1078 typedef npy_intp __pyx_t_5numpy_intp_t;
1079 
1080 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":723
1081  *
1082  * ctypedef npy_intp       intp_t
1083  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1084  *
1085  * ctypedef npy_double     float_t
1086  */
1087 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1088 
1089 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":725
1090  * ctypedef npy_uintp      uintp_t
1091  *
1092  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1093  * ctypedef npy_double     double_t
1094  * ctypedef npy_longdouble longdouble_t
1095  */
1096 typedef npy_double __pyx_t_5numpy_float_t;
1097 
1098 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":726
1099  *
1100  * ctypedef npy_double     float_t
1101  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1102  * ctypedef npy_longdouble longdouble_t
1103  *
1104  */
1105 typedef npy_double __pyx_t_5numpy_double_t;
1106 
1107 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":727
1108  * ctypedef npy_double     float_t
1109  * ctypedef npy_double     double_t
1110  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1111  *
1112  * ctypedef npy_cfloat      cfloat_t
1113  */
1114 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1115 /* Declarations.proto */
1116 #if CYTHON_CCOMPLEX
1117   #ifdef __cplusplus
1118     typedef ::std::complex< float > __pyx_t_float_complex;
1119   #else
1120     typedef float _Complex __pyx_t_float_complex;
1121   #endif
1122 #else
1123     typedef struct { float real, imag; } __pyx_t_float_complex;
1124 #endif
1125 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1126 
1127 /* Declarations.proto */
1128 #if CYTHON_CCOMPLEX
1129   #ifdef __cplusplus
1130     typedef ::std::complex< double > __pyx_t_double_complex;
1131   #else
1132     typedef double _Complex __pyx_t_double_complex;
1133   #endif
1134 #else
1135     typedef struct { double real, imag; } __pyx_t_double_complex;
1136 #endif
1137 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1138 
1139 
1140 /*--- Type declarations ---*/
1141 struct __pyx_obj_2bx_6arrays_6wiggle_WiggleReader;
1142 struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict;
1143 struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree;
1144 struct __pyx_obj_2bx_6arrays_10array_tree_Summary;
1145 struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree;
1146 struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode;
1147 struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf;
1148 
1149 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":729
1150  * ctypedef npy_longdouble longdouble_t
1151  *
1152  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1153  * ctypedef npy_cdouble     cdouble_t
1154  * ctypedef npy_clongdouble clongdouble_t
1155  */
1156 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1157 
1158 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":730
1159  *
1160  * ctypedef npy_cfloat      cfloat_t
1161  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1162  * ctypedef npy_clongdouble clongdouble_t
1163  *
1164  */
1165 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1166 
1167 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":731
1168  * ctypedef npy_cfloat      cfloat_t
1169  * ctypedef npy_cdouble     cdouble_t
1170  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1171  *
1172  * ctypedef npy_cdouble     complex_t
1173  */
1174 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1175 
1176 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":733
1177  * ctypedef npy_clongdouble clongdouble_t
1178  *
1179  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1180  *
1181  * cdef inline object PyArray_MultiIterNew1(a):
1182  */
1183 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1184 
1185 /* "bx/arrays/wiggle.pxd":1
1186  * cdef enum linemode:             # <<<<<<<<<<<<<<
1187  *     MODE_BED
1188  *     MODE_FIXED
1189  */
1190 enum __pyx_t_2bx_6arrays_6wiggle_linemode {
1191   __pyx_e_2bx_6arrays_6wiggle_MODE_BED,
1192   __pyx_e_2bx_6arrays_6wiggle_MODE_FIXED,
1193   __pyx_e_2bx_6arrays_6wiggle_MODE_VARIABLE
1194 };
1195 
1196 /* "bx/arrays/wiggle.pxd":6
1197  *     MODE_VARIABLE
1198  *
1199  * cdef class WiggleReader:             # <<<<<<<<<<<<<<
1200  *     cdef object file
1201  *     cdef object current_chrom
1202  */
1203 struct __pyx_obj_2bx_6arrays_6wiggle_WiggleReader {
1204   PyObject_HEAD
1205   PyObject *file;
1206   PyObject *current_chrom;
1207   long current_pos;
1208   long current_step;
1209   long current_span;
1210   enum __pyx_t_2bx_6arrays_6wiggle_linemode mode;
1211 };
1212 
1213 
1214 /* "bx/arrays/array_tree.pyx":79
1215  *
1216  *
1217  * cdef class FileArrayTreeDict:             # <<<<<<<<<<<<<<
1218  *     """
1219  *     Access to a file containing multiple array trees indexed by a string key.
1220  */
1221 struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict {
1222   PyObject_HEAD
1223   PyObject *io;
1224   PyObject *cdb_dict;
1225 };
1226 
1227 
1228 /* "bx/arrays/array_tree.pyx":120
1229  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )
1230  *
1231  * cdef class FileArrayTree:             # <<<<<<<<<<<<<<
1232  *     """
1233  *     Wrapper for ArrayTree stored in file that reads as little as possible
1234  */
1235 struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree {
1236   PyObject_HEAD
1237   struct __pyx_vtabstruct_2bx_6arrays_10array_tree_FileArrayTree *__pyx_vtab;
1238   int max;
1239   int block_size;
1240   PyObject *dtype;
1241   int levels;
1242   int offset;
1243   int root_offset;
1244   PyObject *io;
1245 };
1246 
1247 
1248 /* "bx/arrays/array_tree.pyx":203
1249  *             return min
1250  *
1251  * cdef class Summary:             # <<<<<<<<<<<<<<
1252  *     """
1253  *     Summary for a non-leaf level of the tree, contains arrays of the min, max,
1254  */
1255 struct __pyx_obj_2bx_6arrays_10array_tree_Summary {
1256   PyObject_HEAD
1257   PyObject *counts;
1258   PyObject *frequencies;
1259   PyObject *mins;
1260   PyObject *maxs;
1261   PyObject *sums;
1262   PyObject *sumsquares;
1263 };
1264 
1265 
1266 /* "bx/arrays/array_tree.pyx":218
1267  * cdef class ArrayTreeLeaf
1268  *
1269  * cdef class ArrayTree:             # <<<<<<<<<<<<<<
1270  *     """
1271  *     Stores a sparse array of data as a tree.
1272  */
1273 struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree {
1274   PyObject_HEAD
1275   int max;
1276   int block_size;
1277   PyObject *dtype;
1278   int levels;
1279   int no_leaves;
1280   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *root;
1281 };
1282 
1283 
1284 /* "bx/arrays/array_tree.pyx":215
1285  *     cdef public object sumsquares
1286  *
1287  * cdef class ArrayTreeNode             # <<<<<<<<<<<<<<
1288  * cdef class ArrayTreeLeaf
1289  *
1290  */
1291 struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode {
1292   PyObject_HEAD
1293   struct __pyx_vtabstruct_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_vtab;
1294   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *tree;
1295   int min;
1296   int max;
1297   int block_size;
1298   int level;
1299   int child_size;
1300   PyObject *children;
1301   struct __pyx_obj_2bx_6arrays_10array_tree_Summary *summary;
1302   long start_offset;
1303 };
1304 
1305 
1306 /* "bx/arrays/array_tree.pyx":216
1307  *
1308  * cdef class ArrayTreeNode
1309  * cdef class ArrayTreeLeaf             # <<<<<<<<<<<<<<
1310  *
1311  * cdef class ArrayTree:
1312  */
1313 struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf {
1314   PyObject_HEAD
1315   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *tree;
1316   int min;
1317   int max;
1318   int frequency;
1319   PyArrayObject *values;
1320   long start_offset;
1321 };
1322 
1323 
1324 
1325 /* "bx/arrays/array_tree.pyx":120
1326  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )
1327  *
1328  * cdef class FileArrayTree:             # <<<<<<<<<<<<<<
1329  *     """
1330  *     Wrapper for ArrayTree stored in file that reads as little as possible
1331  */
1332 
1333 struct __pyx_vtabstruct_2bx_6arrays_10array_tree_FileArrayTree {
1334   int (*r_seek_to_node)(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *, int, int, PY_LONG_LONG, int, int);
1335 };
1336 static struct __pyx_vtabstruct_2bx_6arrays_10array_tree_FileArrayTree *__pyx_vtabptr_2bx_6arrays_10array_tree_FileArrayTree;
1337 
1338 
1339 /* "bx/arrays/array_tree.pyx":309
1340  *         return tree
1341  *
1342  * cdef class ArrayTreeNode:             # <<<<<<<<<<<<<<
1343  *     """
1344  *     Internal node of an ArrayTree. Contains summary data and pointers to
1345  */
1346 
1347 struct __pyx_vtabstruct_2bx_6arrays_10array_tree_ArrayTreeNode {
1348   PyObject *(*init_bin)(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *, int);
1349   PyObject *(*build_summary)(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *, int __pyx_skip_dispatch);
1350 };
1351 static struct __pyx_vtabstruct_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_vtabptr_2bx_6arrays_10array_tree_ArrayTreeNode;
1352 static CYTHON_INLINE PyObject *__pyx_f_2bx_6arrays_10array_tree_13ArrayTreeNode_init_bin(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *, int);
1353 
1354 /* --- Runtime support code (head) --- */
1355 /* Refnanny.proto */
1356 #ifndef CYTHON_REFNANNY
1357   #define CYTHON_REFNANNY 0
1358 #endif
1359 #if CYTHON_REFNANNY
1360   typedef struct {
1361     void (*INCREF)(void*, PyObject*, int);
1362     void (*DECREF)(void*, PyObject*, int);
1363     void (*GOTREF)(void*, PyObject*, int);
1364     void (*GIVEREF)(void*, PyObject*, int);
1365     void* (*SetupContext)(const char*, int, const char*);
1366     void (*FinishContext)(void**);
1367   } __Pyx_RefNannyAPIStruct;
1368   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1369   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1370   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1371 #ifdef WITH_THREAD
1372   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1373           if (acquire_gil) {\
1374               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1375               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1376               PyGILState_Release(__pyx_gilstate_save);\
1377           } else {\
1378               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1379           }
1380 #else
1381   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1382           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1383 #endif
1384   #define __Pyx_RefNannyFinishContext()\
1385           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1386   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1387   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1388   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1389   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1390   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1391   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1392   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1393   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1394 #else
1395   #define __Pyx_RefNannyDeclarations
1396   #define __Pyx_RefNannySetupContext(name, acquire_gil)
1397   #define __Pyx_RefNannyFinishContext()
1398   #define __Pyx_INCREF(r) Py_INCREF(r)
1399   #define __Pyx_DECREF(r) Py_DECREF(r)
1400   #define __Pyx_GOTREF(r)
1401   #define __Pyx_GIVEREF(r)
1402   #define __Pyx_XINCREF(r) Py_XINCREF(r)
1403   #define __Pyx_XDECREF(r) Py_XDECREF(r)
1404   #define __Pyx_XGOTREF(r)
1405   #define __Pyx_XGIVEREF(r)
1406 #endif
1407 #define __Pyx_XDECREF_SET(r, v) do {\
1408         PyObject *tmp = (PyObject *) r;\
1409         r = v; __Pyx_XDECREF(tmp);\
1410     } while (0)
1411 #define __Pyx_DECREF_SET(r, v) do {\
1412         PyObject *tmp = (PyObject *) r;\
1413         r = v; __Pyx_DECREF(tmp);\
1414     } while (0)
1415 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1416 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1417 
1418 /* PyObjectGetAttrStr.proto */
1419 #if CYTHON_USE_TYPE_SLOTS
1420 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1421 #else
1422 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1423 #endif
1424 
1425 /* GetBuiltinName.proto */
1426 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1427 
1428 /* RaiseArgTupleInvalid.proto */
1429 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1430     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1431 
1432 /* RaiseDoubleKeywords.proto */
1433 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1434 
1435 /* ParseKeywords.proto */
1436 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1437     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1438     const char* function_name);
1439 
1440 /* RaiseTooManyValuesToUnpack.proto */
1441 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1442 
1443 /* RaiseNeedMoreValuesToUnpack.proto */
1444 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1445 
1446 /* IterFinish.proto */
1447 static CYTHON_INLINE int __Pyx_IterFinish(void);
1448 
1449 /* UnpackItemEndCheck.proto */
1450 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1451 
1452 /* PyDictContains.proto */
__Pyx_PyDict_ContainsTF(PyObject * item,PyObject * dict,int eq)1453 static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
1454     int result = PyDict_Contains(dict, item);
1455     return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1456 }
1457 
1458 /* PyFunctionFastCall.proto */
1459 #if CYTHON_FAST_PYCALL
1460 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1461     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1462 #if 1 || PY_VERSION_HEX < 0x030600B1
1463 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1464 #else
1465 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1466 #endif
1467 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1468     (sizeof(char [1 - 2*!(cond)]) - 1)
1469 #ifndef Py_MEMBER_SIZE
1470 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1471 #endif
1472 #if CYTHON_FAST_PYCALL
1473   static size_t __pyx_pyframe_localsplus_offset = 0;
1474   #include "frameobject.h"
1475   #define __Pxy_PyFrame_Initialize_Offsets()\
1476     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1477      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1478   #define __Pyx_PyFrame_GetLocalsplus(frame)\
1479     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1480 #endif // CYTHON_FAST_PYCALL
1481 #endif
1482 
1483 /* PyCFunctionFastCall.proto */
1484 #if CYTHON_FAST_PYCCALL
1485 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1486 #else
1487 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
1488 #endif
1489 
1490 /* PyObjectCall.proto */
1491 #if CYTHON_COMPILING_IN_CPYTHON
1492 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1493 #else
1494 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1495 #endif
1496 
1497 /* DictGetItem.proto */
1498 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1499 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1500 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1501     (likely(PyDict_CheckExact(obj)) ?\
1502      __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1503 #else
1504 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1505 #define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
1506 #endif
1507 
1508 /* PyDictVersioning.proto */
1509 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1510 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
1511 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
1512 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1513     (version_var) = __PYX_GET_DICT_VERSION(dict);\
1514     (cache_var) = (value);
1515 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1516     static PY_UINT64_T __pyx_dict_version = 0;\
1517     static PyObject *__pyx_dict_cached_value = NULL;\
1518     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1519         (VAR) = __pyx_dict_cached_value;\
1520     } else {\
1521         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1522         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1523     }\
1524 }
1525 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1526 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1527 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1528 #else
1529 #define __PYX_GET_DICT_VERSION(dict)  (0)
1530 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1531 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
1532 #endif
1533 
1534 /* GetModuleGlobalName.proto */
1535 #if CYTHON_USE_DICT_VERSIONS
1536 #define __Pyx_GetModuleGlobalName(var, name)  {\
1537     static PY_UINT64_T __pyx_dict_version = 0;\
1538     static PyObject *__pyx_dict_cached_value = NULL;\
1539     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1540         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1541         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1542 }
1543 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
1544     PY_UINT64_T __pyx_dict_version;\
1545     PyObject *__pyx_dict_cached_value;\
1546     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1547 }
1548 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1549 #else
1550 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1551 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1552 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1553 #endif
1554 
1555 /* PyObjectCallMethO.proto */
1556 #if CYTHON_COMPILING_IN_CPYTHON
1557 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1558 #endif
1559 
1560 /* PyObjectCallNoArg.proto */
1561 #if CYTHON_COMPILING_IN_CPYTHON
1562 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1563 #else
1564 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1565 #endif
1566 
1567 /* PyObjectCallOneArg.proto */
1568 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1569 
1570 /* GetItemInt.proto */
1571 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1572     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1573     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1574     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1575                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1576 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1577     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1578     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1579     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1580 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1581                                                               int wraparound, int boundscheck);
1582 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1583     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1584     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1585     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1586 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1587                                                               int wraparound, int boundscheck);
1588 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1589 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1590                                                      int is_list, int wraparound, int boundscheck);
1591 
1592 /* ObjectGetItem.proto */
1593 #if CYTHON_USE_TYPE_SLOTS
1594 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1595 #else
1596 #define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
1597 #endif
1598 
1599 /* PyObjectCall2Args.proto */
1600 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1601 
1602 /* PyObjectGetMethod.proto */
1603 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
1604 
1605 /* PyObjectCallMethod0.proto */
1606 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
1607 
1608 /* RaiseNoneIterError.proto */
1609 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1610 
1611 /* UnpackTupleError.proto */
1612 static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
1613 
1614 /* UnpackTuple2.proto */
1615 #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
1616     (likely(is_tuple || PyTuple_Check(tuple)) ?\
1617         (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
1618             __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
1619             (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
1620         __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
1621 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
1622     PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
1623 static int __Pyx_unpack_tuple2_generic(
1624     PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
1625 
1626 /* dict_iter.proto */
1627 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
1628                                                    Py_ssize_t* p_orig_length, int* p_is_dict);
1629 static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
1630                                               PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
1631 
1632 /* PyErrExceptionMatches.proto */
1633 #if CYTHON_FAST_THREAD_STATE
1634 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1635 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1636 #else
1637 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
1638 #endif
1639 
1640 /* PyThreadStateGet.proto */
1641 #if CYTHON_FAST_THREAD_STATE
1642 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
1643 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
1644 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
1645 #else
1646 #define __Pyx_PyThreadState_declare
1647 #define __Pyx_PyThreadState_assign
1648 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
1649 #endif
1650 
1651 /* PyErrFetchRestore.proto */
1652 #if CYTHON_FAST_THREAD_STATE
1653 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1654 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1655 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1656 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1657 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1658 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1659 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1660 #if CYTHON_COMPILING_IN_CPYTHON
1661 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1662 #else
1663 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1664 #endif
1665 #else
1666 #define __Pyx_PyErr_Clear() PyErr_Clear()
1667 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1668 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
1669 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
1670 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
1671 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
1672 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
1673 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
1674 #endif
1675 
1676 /* GetAttr.proto */
1677 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1678 
1679 /* GetAttr3.proto */
1680 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1681 
1682 /* RaiseException.proto */
1683 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1684 
1685 /* None.proto */
1686 static CYTHON_INLINE int __Pyx_div_int(int, int);
1687 
1688 /* UnaryNegOverflows.proto */
1689 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1690         (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1691 
1692 /* PyIntCompare.proto */
1693 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
1694 
1695 /* WriteUnraisableException.proto */
1696 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1697                                   int lineno, const char *filename,
1698                                   int full_traceback, int nogil);
1699 
1700 /* SetItemInt.proto */
1701 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1702     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1703     __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
1704     (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
1705                __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
1706 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1707 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
1708                                                int is_list, int wraparound, int boundscheck);
1709 
1710 /* ExtTypeTest.proto */
1711 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1712 
1713 /* ArgTypeTest.proto */
1714 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1715     ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1716         __Pyx__ArgTypeTest(obj, type, name, exact))
1717 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1718 
1719 /* ListCompAppend.proto */
1720 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_ListComp_Append(PyObject * list,PyObject * x)1721 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1722     PyListObject* L = (PyListObject*) list;
1723     Py_ssize_t len = Py_SIZE(list);
1724     if (likely(L->allocated > len)) {
1725         Py_INCREF(x);
1726         PyList_SET_ITEM(list, len, x);
1727         __Pyx_SET_SIZE(list, len + 1);
1728         return 0;
1729     }
1730     return PyList_Append(list, x);
1731 }
1732 #else
1733 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1734 #endif
1735 
1736 /* SliceObject.proto */
1737 #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
1738     __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
1739 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
1740         PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
1741         PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1742         int has_cstart, int has_cstop, int wraparound);
1743 
1744 /* Import.proto */
1745 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1746 
1747 /* ImportFrom.proto */
1748 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1749 
1750 /* HasAttr.proto */
1751 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1752 
1753 /* GetTopmostException.proto */
1754 #if CYTHON_USE_EXC_INFO_STACK
1755 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1756 #endif
1757 
1758 /* SaveResetException.proto */
1759 #if CYTHON_FAST_THREAD_STATE
1760 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1761 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1762 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1763 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1764 #else
1765 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
1766 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
1767 #endif
1768 
1769 /* GetException.proto */
1770 #if CYTHON_FAST_THREAD_STATE
1771 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
1772 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1773 #else
1774 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1775 #endif
1776 
1777 /* PyObject_GenericGetAttrNoDict.proto */
1778 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1779 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1780 #else
1781 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1782 #endif
1783 
1784 /* PyObject_GenericGetAttr.proto */
1785 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1786 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1787 #else
1788 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1789 #endif
1790 
1791 /* PyObjectGetAttrStrNoError.proto */
1792 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1793 
1794 /* SetupReduce.proto */
1795 static int __Pyx_setup_reduce(PyObject* type_obj);
1796 
1797 /* SetVTable.proto */
1798 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1799 
1800 /* TypeImport.proto */
1801 #ifndef __PYX_HAVE_RT_ImportType_proto
1802 #define __PYX_HAVE_RT_ImportType_proto
1803 enum __Pyx_ImportType_CheckSize {
1804    __Pyx_ImportType_CheckSize_Error = 0,
1805    __Pyx_ImportType_CheckSize_Warn = 1,
1806    __Pyx_ImportType_CheckSize_Ignore = 2
1807 };
1808 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1809 #endif
1810 
1811 /* ClassMethod.proto */
1812 #include "descrobject.h"
1813 static CYTHON_UNUSED PyObject* __Pyx_Method_ClassMethod(PyObject *method);
1814 
1815 /* GetNameInClass.proto */
1816 #define __Pyx_GetNameInClass(var, nmspace, name)  (var) = __Pyx__GetNameInClass(nmspace, name)
1817 static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);
1818 
1819 /* CLineInTraceback.proto */
1820 #ifdef CYTHON_CLINE_IN_TRACEBACK
1821 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1822 #else
1823 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1824 #endif
1825 
1826 /* CodeObjectCache.proto */
1827 typedef struct {
1828     PyCodeObject* code_object;
1829     int code_line;
1830 } __Pyx_CodeObjectCacheEntry;
1831 struct __Pyx_CodeObjectCache {
1832     int count;
1833     int max_count;
1834     __Pyx_CodeObjectCacheEntry* entries;
1835 };
1836 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1837 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1838 static PyCodeObject *__pyx_find_code_object(int code_line);
1839 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1840 
1841 /* AddTraceback.proto */
1842 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1843                                int py_line, const char *filename);
1844 
1845 /* GCCDiagnostics.proto */
1846 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1847 #define __Pyx_HAS_GCC_DIAGNOSTIC
1848 #endif
1849 
1850 /* None.proto */
1851 static CYTHON_INLINE PY_LONG_LONG __Pyx_pow_PY_LONG_LONG(PY_LONG_LONG, PY_LONG_LONG);
1852 
1853 /* None.proto */
1854 static CYTHON_INLINE int __Pyx_pow_int(int, int);
1855 
1856 /* RealImag.proto */
1857 #if CYTHON_CCOMPLEX
1858   #ifdef __cplusplus
1859     #define __Pyx_CREAL(z) ((z).real())
1860     #define __Pyx_CIMAG(z) ((z).imag())
1861   #else
1862     #define __Pyx_CREAL(z) (__real__(z))
1863     #define __Pyx_CIMAG(z) (__imag__(z))
1864   #endif
1865 #else
1866     #define __Pyx_CREAL(z) ((z).real)
1867     #define __Pyx_CIMAG(z) ((z).imag)
1868 #endif
1869 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1870         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1871     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1872     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1873 #else
1874     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1875     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1876 #endif
1877 
1878 /* Arithmetic.proto */
1879 #if CYTHON_CCOMPLEX
1880     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
1881     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
1882     #define __Pyx_c_diff_float(a, b) ((a)-(b))
1883     #define __Pyx_c_prod_float(a, b) ((a)*(b))
1884     #define __Pyx_c_quot_float(a, b) ((a)/(b))
1885     #define __Pyx_c_neg_float(a)     (-(a))
1886   #ifdef __cplusplus
1887     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1888     #define __Pyx_c_conj_float(z)    (::std::conj(z))
1889     #if 1
1890         #define __Pyx_c_abs_float(z)     (::std::abs(z))
1891         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
1892     #endif
1893   #else
1894     #define __Pyx_c_is_zero_float(z) ((z)==0)
1895     #define __Pyx_c_conj_float(z)    (conjf(z))
1896     #if 1
1897         #define __Pyx_c_abs_float(z)     (cabsf(z))
1898         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
1899     #endif
1900  #endif
1901 #else
1902     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1903     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1904     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1905     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1906     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1907     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1908     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1909     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1910     #if 1
1911         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
1912         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1913     #endif
1914 #endif
1915 
1916 /* Arithmetic.proto */
1917 #if CYTHON_CCOMPLEX
1918     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
1919     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
1920     #define __Pyx_c_diff_double(a, b) ((a)-(b))
1921     #define __Pyx_c_prod_double(a, b) ((a)*(b))
1922     #define __Pyx_c_quot_double(a, b) ((a)/(b))
1923     #define __Pyx_c_neg_double(a)     (-(a))
1924   #ifdef __cplusplus
1925     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1926     #define __Pyx_c_conj_double(z)    (::std::conj(z))
1927     #if 1
1928         #define __Pyx_c_abs_double(z)     (::std::abs(z))
1929         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
1930     #endif
1931   #else
1932     #define __Pyx_c_is_zero_double(z) ((z)==0)
1933     #define __Pyx_c_conj_double(z)    (conj(z))
1934     #if 1
1935         #define __Pyx_c_abs_double(z)     (cabs(z))
1936         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
1937     #endif
1938  #endif
1939 #else
1940     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1941     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1942     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1943     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1944     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1945     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1946     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1947     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1948     #if 1
1949         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
1950         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1951     #endif
1952 #endif
1953 
1954 /* CIntToPy.proto */
1955 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1956 
1957 /* CIntFromPy.proto */
1958 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1959 
1960 /* CIntToPy.proto */
1961 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1962 
1963 /* CIntFromPy.proto */
1964 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1965 
1966 /* CIntToPy.proto */
1967 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value);
1968 
1969 /* CIntFromPy.proto */
1970 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *);
1971 
1972 /* FastTypeChecks.proto */
1973 #if CYTHON_COMPILING_IN_CPYTHON
1974 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1975 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1976 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1977 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1978 #else
1979 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1980 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1981 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1982 #endif
1983 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1984 
1985 /* CStringEquals.proto */
1986 static CYTHON_INLINE int __Pyx_StrEq(const char *, const char *);
1987 
1988 /* CheckBinaryVersion.proto */
1989 static int __Pyx_check_binary_version(void);
1990 
1991 /* InitStrings.proto */
1992 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1993 
1994 static int __pyx_f_2bx_6arrays_10array_tree_13FileArrayTree_r_seek_to_node(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, int __pyx_v_index, int __pyx_v_min, PY_LONG_LONG __pyx_v_offset, int __pyx_v_level, int __pyx_v_desired_level); /* proto*/
1995 static CYTHON_INLINE PyObject *__pyx_f_2bx_6arrays_10array_tree_13ArrayTreeNode_init_bin(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, int __pyx_v_index); /* proto*/
1996 static PyObject *__pyx_f_2bx_6arrays_10array_tree_13ArrayTreeNode_build_summary(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
1997 
1998 /* Module declarations from 'cpython.buffer' */
1999 
2000 /* Module declarations from 'libc.string' */
2001 
2002 /* Module declarations from 'libc.stdio' */
2003 
2004 /* Module declarations from '__builtin__' */
2005 
2006 /* Module declarations from 'cpython.type' */
2007 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2008 
2009 /* Module declarations from 'cpython' */
2010 
2011 /* Module declarations from 'cpython.object' */
2012 
2013 /* Module declarations from 'cpython.ref' */
2014 
2015 /* Module declarations from 'cpython.mem' */
2016 
2017 /* Module declarations from 'numpy' */
2018 
2019 /* Module declarations from 'numpy' */
2020 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2021 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2022 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2023 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2024 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2025 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2026 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2027 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2028 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2029 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2030 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2031 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2032 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2033 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2034 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2035 
2036 /* Module declarations from 'bx.arrays.wiggle' */
2037 static PyTypeObject *__pyx_ptype_2bx_6arrays_6wiggle_WiggleReader = 0;
2038 
2039 /* Module declarations from 'bx.arrays' */
2040 
2041 /* Module declarations from 'bx' */
2042 
2043 /* Module declarations from 'bx.arrays.array_tree' */
2044 static PyTypeObject *__pyx_ptype_2bx_6arrays_10array_tree_FileArrayTreeDict = 0;
2045 static PyTypeObject *__pyx_ptype_2bx_6arrays_10array_tree_FileArrayTree = 0;
2046 static PyTypeObject *__pyx_ptype_2bx_6arrays_10array_tree_Summary = 0;
2047 static PyTypeObject *__pyx_ptype_2bx_6arrays_10array_tree_ArrayTreeNode = 0;
2048 static PyTypeObject *__pyx_ptype_2bx_6arrays_10array_tree_ArrayTreeLeaf = 0;
2049 static PyTypeObject *__pyx_ptype_2bx_6arrays_10array_tree_ArrayTree = 0;
2050 static PyObject *__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_FileArrayTreeDict__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *, PyObject *); /*proto*/
2051 static PyObject *__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_FileArrayTree__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *, PyObject *); /*proto*/
2052 static PyObject *__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_Summary__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *, PyObject *); /*proto*/
2053 static PyObject *__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_ArrayTree__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *, PyObject *); /*proto*/
2054 static PyObject *__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_ArrayTreeNode__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *, PyObject *); /*proto*/
2055 static PyObject *__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_ArrayTreeLeaf__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *, PyObject *); /*proto*/
2056 #define __Pyx_MODULE_NAME "bx.arrays.array_tree"
2057 extern int __pyx_module_is_main_bx__arrays__array_tree;
2058 int __pyx_module_is_main_bx__arrays__array_tree = 0;
2059 
2060 /* Implementation of 'bx.arrays.array_tree' */
2061 static PyObject *__pyx_builtin_ValueError;
2062 static PyObject *__pyx_builtin_range;
2063 static PyObject *__pyx_builtin_sum;
2064 static PyObject *__pyx_builtin_ImportError;
2065 static const char __pyx_k_L[] = "L";
2066 static const char __pyx_k_f[] = "f";
2067 static const char __pyx_k_s[] = "s";
2068 static const char __pyx_k__3[] = "\000\000\000";
2069 static const char __pyx_k__7[] = "*";
2070 static const char __pyx_k__8[] = "_";
2071 static const char __pyx_k_io[] = "io";
2072 static const char __pyx_k_all[] = "__all__";
2073 static const char __pyx_k_end[] = "end";
2074 static const char __pyx_k_get[] = "get";
2075 static const char __pyx_k_max[] = "max";
2076 static const char __pyx_k_min[] = "min";
2077 static const char __pyx_k_nan[] = "nan";
2078 static const char __pyx_k_new[] = "__new__";
2079 static const char __pyx_k_set[] = "set";
2080 static const char __pyx_k_sum[] = "sum";
2081 static const char __pyx_k_val[] = "val";
2082 static const char __pyx_k_char[] = "char";
2083 static const char __pyx_k_dict[] = "dict";
2084 static const char __pyx_k_file[] = "file";
2085 static const char __pyx_k_main[] = "__main__";
2086 static const char __pyx_k_maxs[] = "maxs";
2087 static const char __pyx_k_mins[] = "mins";
2088 static const char __pyx_k_name[] = "__name__";
2089 static const char __pyx_k_pack[] = "pack";
2090 static const char __pyx_k_read[] = "read";
2091 static const char __pyx_k_root[] = "root";
2092 static const char __pyx_k_rval[] = "rval";
2093 static const char __pyx_k_seek[] = "seek";
2094 static const char __pyx_k_skip[] = "skip";
2095 static const char __pyx_k_sums[] = "sums";
2096 static const char __pyx_k_tell[] = "tell";
2097 static const char __pyx_k_test[] = "__test__";
2098 static const char __pyx_k_tree[] = "tree";
2099 static const char __pyx_k_MAGIC[] = "MAGIC";
2100 static const char __pyx_k_chrom[] = "chrom";
2101 static const char __pyx_k_dtype[] = "dtype";
2102 static const char __pyx_k_empty[] = "empty";
2103 static const char __pyx_k_index[] = "index";
2104 static const char __pyx_k_int32[] = "int32";
2105 static const char __pyx_k_isnan[] = "isnan";
2106 static const char __pyx_k_level[] = "level";
2107 static const char __pyx_k_numpy[] = "numpy";
2108 static const char __pyx_k_range[] = "range";
2109 static const char __pyx_k_sizes[] = "sizes";
2110 static const char __pyx_k_start[] = "start";
2111 static const char __pyx_k_value[] = "value";
2112 static const char __pyx_k_write[] = "write";
2113 static const char __pyx_k_counts[] = "counts";
2114 static const char __pyx_k_dict_2[] = "__dict__";
2115 static const char __pyx_k_encode[] = "encode";
2116 static const char __pyx_k_import[] = "__import__";
2117 static const char __pyx_k_nanmax[] = "nanmax";
2118 static const char __pyx_k_nanmin[] = "nanmin";
2119 static const char __pyx_k_nansum[] = "nansum";
2120 static const char __pyx_k_pickle[] = "pickle";
2121 static const char __pyx_k_reader[] = "reader";
2122 static const char __pyx_k_reduce[] = "__reduce__";
2123 static const char __pyx_k_unpack[] = "unpack";
2124 static const char __pyx_k_update[] = "update";
2125 static const char __pyx_k_values[] = "values";
2126 static const char __pyx_k_Summary[] = "Summary";
2127 static const char __pyx_k_VERSION[] = "VERSION";
2128 static const char __pyx_k_float32[] = "float32";
2129 static const char __pyx_k_summary[] = "summary";
2130 static const char __pyx_k_to_file[] = "to_file";
2131 static const char __pyx_k_getstate[] = "__getstate__";
2132 static const char __pyx_k_itemsize[] = "itemsize";
2133 static const char __pyx_k_iterkeys[] = "iterkeys";
2134 static const char __pyx_k_pyx_type[] = "__pyx_type";
2135 static const char __pyx_k_setstate[] = "__setstate__";
2136 static const char __pyx_k_ArrayTree[] = "ArrayTree";
2137 static const char __pyx_k_frequency[] = "frequency";
2138 static const char __pyx_k_from_file[] = "from_file";
2139 static const char __pyx_k_iteritems[] = "iteritems";
2140 static const char __pyx_k_no_leaves[] = "no_leaves";
2141 static const char __pyx_k_pyx_state[] = "__pyx_state";
2142 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2143 static const char __pyx_k_set_range[] = "set_range";
2144 static const char __pyx_k_ValueError[] = "ValueError";
2145 static const char __pyx_k_block_size[] = "block_size";
2146 static const char __pyx_k_last_chrom[] = "last_chrom";
2147 static const char __pyx_k_pyx_result[] = "__pyx_result";
2148 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2149 static const char __pyx_k_sumsquares[] = "sumsquares";
2150 static const char __pyx_k_FileCDBDict[] = "FileCDBDict";
2151 static const char __pyx_k_ImportError[] = "ImportError";
2152 static const char __pyx_k_PickleError[] = "PickleError";
2153 static const char __pyx_k_bx_misc_cdb[] = "bx.misc.cdb";
2154 static const char __pyx_k_frequencies[] = "frequencies";
2155 static const char __pyx_k_read_uint32[] = "read_uint32";
2156 static const char __pyx_k_read_uint64[] = "read_uint64";
2157 static const char __pyx_k_default_size[] = "default_size";
2158 static const char __pyx_k_dict_to_file[] = "dict_to_file";
2159 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2160 static const char __pyx_k_start_offset[] = "start_offset";
2161 static const char __pyx_k_stringsource[] = "stringsource";
2162 static const char __pyx_k_write_uint32[] = "write_uint32";
2163 static const char __pyx_k_write_uint64[] = "write_uint64";
2164 static const char __pyx_k_ArrayTreeLeaf[] = "ArrayTreeLeaf";
2165 static const char __pyx_k_ArrayTreeNode[] = "ArrayTreeNode";
2166 static const char __pyx_k_FileArrayTree[] = "FileArrayTree";
2167 static const char __pyx_k_build_summary[] = "build_summary";
2168 static const char __pyx_k_from_sequence[] = "from_sequence";
2169 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2170 static const char __pyx_k_read_raw_array[] = "read_raw_array";
2171 static const char __pyx_k_last_array_tree[] = "last_array_tree";
2172 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2173 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2174 static const char __pyx_k_write_raw_array[] = "write_raw_array";
2175 static const char __pyx_k_BinaryFileReader[] = "BinaryFileReader";
2176 static const char __pyx_k_BinaryFileWriter[] = "BinaryFileWriter";
2177 static const char __pyx_k_is_little_endian[] = "is_little_endian";
2178 static const char __pyx_k_FileArrayTreeDict[] = "FileArrayTreeDict";
2179 static const char __pyx_k_to_file_data_pass[] = "to_file_data_pass";
2180 static const char __pyx_k_NUM_SUMMARY_ARRAYS[] = "NUM_SUMMARY_ARRAYS";
2181 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2182 static const char __pyx_k_bx_misc_binary_file[] = "bx.misc.binary_file";
2183 static const char __pyx_k_to_file_offset_pass[] = "to_file_offset_pass";
2184 static const char __pyx_k_bx_arrays_array_tree[] = "bx.arrays.array_tree";
2185 static const char __pyx_k_pyx_unpickle_Summary[] = "__pyx_unpickle_Summary";
2186 static const char __pyx_k_pyx_unpickle_ArrayTree[] = "__pyx_unpickle_ArrayTree";
2187 static const char __pyx_k_level_must_be_self_levels[] = "level must be <= self.levels";
2188 static const char __pyx_k_pyx_unpickle_ArrayTreeLeaf[] = "__pyx_unpickle_ArrayTreeLeaf";
2189 static const char __pyx_k_pyx_unpickle_ArrayTreeNode[] = "__pyx_unpickle_ArrayTreeNode";
2190 static const char __pyx_k_pyx_unpickle_FileArrayTree[] = "__pyx_unpickle_FileArrayTree";
2191 static const char __pyx_k_array_tree_dict_from_reader[] = "array_tree_dict_from_reader";
2192 static const char __pyx_k_lib_bx_arrays_array_tree_pyx[] = "lib/bx/arrays/array_tree.pyx";
2193 static const char __pyx_k_max_block_size_not_yet_handled[] = "max < block_size not yet handled";
2194 static const char __pyx_k_pyx_unpickle_FileArrayTreeDict[] = "__pyx_unpickle_FileArrayTreeDict";
2195 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2196 static const char __pyx_k_Incompatible_checksums_s_vs_0x0f[] = "Incompatible checksums (%s vs 0x0f4bfc5 = (counts, frequencies, maxs, mins, sums, sumsquares))";
2197 static const char __pyx_k_Incompatible_checksums_s_vs_0x69[] = "Incompatible checksums (%s vs 0x69195cf = (block_size, dtype, levels, max, no_leaves, root))";
2198 static const char __pyx_k_Incompatible_checksums_s_vs_0xc1[] = "Incompatible checksums (%s vs 0xc1230b0 = (frequency, max, min, start_offset, tree, values))";
2199 static const char __pyx_k_Incompatible_checksums_s_vs_0xcf[] = "Incompatible checksums (%s vs 0xcf117d0 = (cdb_dict, io))";
2200 static const char __pyx_k_Incompatible_checksums_s_vs_0xea[] = "Incompatible checksums (%s vs 0xeabeaf7 = (block_size, dtype, io, levels, max, offset, root_offset))";
2201 static const char __pyx_k_Incompatible_checksums_s_vs_0xeb[] = "Incompatible checksums (%s vs 0xebb9478 = (block_size, child_size, children, level, max, min, start_offset, summary, tree))";
2202 static const char __pyx_k_Writing_without_summaries_is_cur[] = "Writing without summaries is currently not supported";
2203 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2204 static PyObject *__pyx_n_s_ArrayTree;
2205 static PyObject *__pyx_n_s_ArrayTreeLeaf;
2206 static PyObject *__pyx_n_s_ArrayTreeNode;
2207 static PyObject *__pyx_n_s_BinaryFileReader;
2208 static PyObject *__pyx_n_s_BinaryFileWriter;
2209 static PyObject *__pyx_n_s_FileArrayTree;
2210 static PyObject *__pyx_n_s_FileArrayTreeDict;
2211 static PyObject *__pyx_n_s_FileCDBDict;
2212 static PyObject *__pyx_n_s_ImportError;
2213 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x0f;
2214 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x69;
2215 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xc1;
2216 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xcf;
2217 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xea;
2218 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xeb;
2219 static PyObject *__pyx_n_s_L;
2220 static PyObject *__pyx_n_s_MAGIC;
2221 static PyObject *__pyx_n_s_NUM_SUMMARY_ARRAYS;
2222 static PyObject *__pyx_n_s_PickleError;
2223 static PyObject *__pyx_n_s_Summary;
2224 static PyObject *__pyx_n_s_VERSION;
2225 static PyObject *__pyx_n_s_ValueError;
2226 static PyObject *__pyx_kp_s_Writing_without_summaries_is_cur;
2227 static PyObject *__pyx_kp_s__3;
2228 static PyObject *__pyx_n_s__7;
2229 static PyObject *__pyx_n_s__8;
2230 static PyObject *__pyx_n_s_all;
2231 static PyObject *__pyx_n_s_array_tree_dict_from_reader;
2232 static PyObject *__pyx_n_s_block_size;
2233 static PyObject *__pyx_n_s_build_summary;
2234 static PyObject *__pyx_n_s_bx_arrays_array_tree;
2235 static PyObject *__pyx_n_s_bx_misc_binary_file;
2236 static PyObject *__pyx_n_s_bx_misc_cdb;
2237 static PyObject *__pyx_n_s_char;
2238 static PyObject *__pyx_n_s_chrom;
2239 static PyObject *__pyx_n_s_cline_in_traceback;
2240 static PyObject *__pyx_n_s_counts;
2241 static PyObject *__pyx_n_s_default_size;
2242 static PyObject *__pyx_n_s_dict;
2243 static PyObject *__pyx_n_s_dict_2;
2244 static PyObject *__pyx_n_s_dict_to_file;
2245 static PyObject *__pyx_n_s_dtype;
2246 static PyObject *__pyx_n_s_empty;
2247 static PyObject *__pyx_n_s_encode;
2248 static PyObject *__pyx_n_s_end;
2249 static PyObject *__pyx_n_s_f;
2250 static PyObject *__pyx_n_s_file;
2251 static PyObject *__pyx_n_s_float32;
2252 static PyObject *__pyx_n_s_frequencies;
2253 static PyObject *__pyx_n_s_frequency;
2254 static PyObject *__pyx_n_s_from_file;
2255 static PyObject *__pyx_n_s_from_sequence;
2256 static PyObject *__pyx_n_s_get;
2257 static PyObject *__pyx_n_s_getstate;
2258 static PyObject *__pyx_n_s_import;
2259 static PyObject *__pyx_n_s_index;
2260 static PyObject *__pyx_n_s_int32;
2261 static PyObject *__pyx_n_s_io;
2262 static PyObject *__pyx_n_s_is_little_endian;
2263 static PyObject *__pyx_n_s_isnan;
2264 static PyObject *__pyx_n_s_itemsize;
2265 static PyObject *__pyx_n_s_iteritems;
2266 static PyObject *__pyx_n_s_iterkeys;
2267 static PyObject *__pyx_n_s_last_array_tree;
2268 static PyObject *__pyx_n_s_last_chrom;
2269 static PyObject *__pyx_n_s_level;
2270 static PyObject *__pyx_kp_s_level_must_be_self_levels;
2271 static PyObject *__pyx_kp_s_lib_bx_arrays_array_tree_pyx;
2272 static PyObject *__pyx_n_s_main;
2273 static PyObject *__pyx_n_s_max;
2274 static PyObject *__pyx_kp_s_max_block_size_not_yet_handled;
2275 static PyObject *__pyx_n_s_maxs;
2276 static PyObject *__pyx_n_s_min;
2277 static PyObject *__pyx_n_s_mins;
2278 static PyObject *__pyx_n_s_name;
2279 static PyObject *__pyx_n_s_nan;
2280 static PyObject *__pyx_n_s_nanmax;
2281 static PyObject *__pyx_n_s_nanmin;
2282 static PyObject *__pyx_n_s_nansum;
2283 static PyObject *__pyx_n_s_new;
2284 static PyObject *__pyx_n_s_no_leaves;
2285 static PyObject *__pyx_n_s_numpy;
2286 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2287 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2288 static PyObject *__pyx_n_s_pack;
2289 static PyObject *__pyx_n_s_pickle;
2290 static PyObject *__pyx_n_s_pyx_PickleError;
2291 static PyObject *__pyx_n_s_pyx_checksum;
2292 static PyObject *__pyx_n_s_pyx_result;
2293 static PyObject *__pyx_n_s_pyx_state;
2294 static PyObject *__pyx_n_s_pyx_type;
2295 static PyObject *__pyx_n_s_pyx_unpickle_ArrayTree;
2296 static PyObject *__pyx_n_s_pyx_unpickle_ArrayTreeLeaf;
2297 static PyObject *__pyx_n_s_pyx_unpickle_ArrayTreeNode;
2298 static PyObject *__pyx_n_s_pyx_unpickle_FileArrayTree;
2299 static PyObject *__pyx_n_s_pyx_unpickle_FileArrayTreeDict;
2300 static PyObject *__pyx_n_s_pyx_unpickle_Summary;
2301 static PyObject *__pyx_n_s_pyx_vtable;
2302 static PyObject *__pyx_n_s_range;
2303 static PyObject *__pyx_n_s_read;
2304 static PyObject *__pyx_n_s_read_raw_array;
2305 static PyObject *__pyx_n_s_read_uint32;
2306 static PyObject *__pyx_n_s_read_uint64;
2307 static PyObject *__pyx_n_s_reader;
2308 static PyObject *__pyx_n_s_reduce;
2309 static PyObject *__pyx_n_s_reduce_cython;
2310 static PyObject *__pyx_n_s_reduce_ex;
2311 static PyObject *__pyx_n_s_root;
2312 static PyObject *__pyx_n_s_rval;
2313 static PyObject *__pyx_n_s_s;
2314 static PyObject *__pyx_n_s_seek;
2315 static PyObject *__pyx_n_s_set;
2316 static PyObject *__pyx_n_s_set_range;
2317 static PyObject *__pyx_n_s_setstate;
2318 static PyObject *__pyx_n_s_setstate_cython;
2319 static PyObject *__pyx_n_s_sizes;
2320 static PyObject *__pyx_n_s_skip;
2321 static PyObject *__pyx_n_s_start;
2322 static PyObject *__pyx_n_s_start_offset;
2323 static PyObject *__pyx_kp_s_stringsource;
2324 static PyObject *__pyx_n_s_sum;
2325 static PyObject *__pyx_n_s_summary;
2326 static PyObject *__pyx_n_s_sums;
2327 static PyObject *__pyx_n_s_sumsquares;
2328 static PyObject *__pyx_n_s_tell;
2329 static PyObject *__pyx_n_s_test;
2330 static PyObject *__pyx_n_s_to_file;
2331 static PyObject *__pyx_n_s_to_file_data_pass;
2332 static PyObject *__pyx_n_s_to_file_offset_pass;
2333 static PyObject *__pyx_n_s_tree;
2334 static PyObject *__pyx_n_s_unpack;
2335 static PyObject *__pyx_n_s_update;
2336 static PyObject *__pyx_n_s_val;
2337 static PyObject *__pyx_n_s_value;
2338 static PyObject *__pyx_n_s_values;
2339 static PyObject *__pyx_n_s_write;
2340 static PyObject *__pyx_n_s_write_raw_array;
2341 static PyObject *__pyx_n_s_write_uint32;
2342 static PyObject *__pyx_n_s_write_uint64;
2343 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_array_tree_dict_from_reader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_reader, PyObject *__pyx_v_sizes, PyObject *__pyx_v_default_size, PyObject *__pyx_v_block_size, PyObject *__pyx_v_no_leaves); /* proto */
2344 static int __pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict___init__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *__pyx_v_self, PyObject *__pyx_v_file); /* proto */
2345 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict_2__getitem__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
2346 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict_4dict_to_file(CYTHON_UNUSED PyTypeObject *__pyx_v_Class, PyObject *__pyx_v_dict, PyObject *__pyx_v_file, PyObject *__pyx_v_is_little_endian, PyObject *__pyx_v_no_leaves); /* proto */
2347 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict_6__reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *__pyx_v_self); /* proto */
2348 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict_8__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2349 static int __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree___init__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_file, PyObject *__pyx_v_is_little_endian); /* proto */
2350 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_2__getitem__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2351 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_4get_summary(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_level); /* proto */
2352 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6get_leaf(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2353 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_3max___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self); /* proto */
2354 static int __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_3max_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2355 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_10block_size___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self); /* proto */
2356 static int __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_10block_size_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2357 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_5dtype___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self); /* proto */
2358 static int __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2359 static int __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self); /* proto */
2360 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6levels___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self); /* proto */
2361 static int __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6levels_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2362 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6offset___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self); /* proto */
2363 static int __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6offset_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2364 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_11root_offset___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self); /* proto */
2365 static int __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_11root_offset_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2366 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_8__reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self); /* proto */
2367 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_10__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2368 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_7Summary_6counts___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self); /* proto */
2369 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_6counts_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2370 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_6counts_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self); /* proto */
2371 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_7Summary_11frequencies___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self); /* proto */
2372 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_11frequencies_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2373 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_11frequencies_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self); /* proto */
2374 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_7Summary_4mins___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self); /* proto */
2375 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_4mins_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2376 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_4mins_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self); /* proto */
2377 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_7Summary_4maxs___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self); /* proto */
2378 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_4maxs_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2379 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_4maxs_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self); /* proto */
2380 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_7Summary_4sums___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self); /* proto */
2381 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_4sums_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2382 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_4sums_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self); /* proto */
2383 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_7Summary_10sumsquares___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self); /* proto */
2384 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_10sumsquares_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2385 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_10sumsquares_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self); /* proto */
2386 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_7Summary___reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self); /* proto */
2387 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_7Summary_2__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2388 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree___init__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, int __pyx_v_max, int __pyx_v_block_size, PyObject *__pyx_v_dtype, PyObject *__pyx_v_no_leaves); /* proto */
2389 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_2__setitem__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, int __pyx_v_index, PyObject *__pyx_v_value); /* proto */
2390 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_4set_range(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, int __pyx_v_start, int __pyx_v_end, PyObject *__pyx_v_value); /* proto */
2391 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_6__getitem__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, int __pyx_v_index); /* proto */
2392 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_8to_file(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, PyObject *__pyx_v_f, PyObject *__pyx_v_is_little_endian, PyObject *__pyx_v_no_leaves); /* proto */
2393 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_10from_file(PyTypeObject *__pyx_v_Class, PyObject *__pyx_v_f, PyObject *__pyx_v_is_little_endian); /* proto */
2394 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_12from_sequence(PyTypeObject *__pyx_v_Class, PyObject *__pyx_v_s, PyObject *__pyx_v_block_size); /* proto */
2395 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_3max___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self); /* proto */
2396 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_3max_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2397 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_10block_size___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self); /* proto */
2398 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_10block_size_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2399 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_5dtype___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self); /* proto */
2400 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_5dtype_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2401 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_5dtype_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self); /* proto */
2402 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_6levels___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self); /* proto */
2403 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_6levels_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2404 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_9no_leaves___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self); /* proto */
2405 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_9no_leaves_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2406 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_4root___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self); /* proto */
2407 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_4root_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2408 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_4root_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self); /* proto */
2409 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_14__reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self); /* proto */
2410 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_16__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2411 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode___init__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_tree, int __pyx_v_min, int __pyx_v_max, int __pyx_v_block_size, int __pyx_v_level); /* proto */
2412 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_2set(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, int __pyx_v_index, PyObject *__pyx_v_value); /* proto */
2413 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_4get(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, int __pyx_v_index); /* proto */
2414 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_6build_summary(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self); /* proto */
2415 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_8to_file_data_pass(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, PyObject *__pyx_v_io, PyObject *__pyx_v_level); /* proto */
2416 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_10to_file_offset_pass(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, PyObject *__pyx_v_io); /* proto */
2417 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_12from_file(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, PyObject *__pyx_v_io); /* proto */
2418 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_14get_from_file(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_io, PyObject *__pyx_v_index); /* proto */
2419 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self); /* proto */
2420 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2421 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self); /* proto */
2422 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_12start_offset___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self); /* proto */
2423 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_12start_offset_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2424 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_16__reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self); /* proto */
2425 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_18__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2426 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf___init__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_tree, int __pyx_v_min, int __pyx_v_max); /* proto */
2427 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_2set(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2428 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_4get(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2429 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6to_file_data_pass(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, PyObject *__pyx_v_io, PyObject *__pyx_v_level); /* proto */
2430 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_8to_file_offset_pass(CYTHON_UNUSED struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_io); /* proto */
2431 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_10from_file(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, PyObject *__pyx_v_io); /* proto */
2432 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9frequency___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self); /* proto */
2433 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9frequency_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2434 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self); /* proto */
2435 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2436 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self); /* proto */
2437 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12start_offset___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self); /* proto */
2438 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12start_offset_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2439 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12__reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self); /* proto */
2440 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_14__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2441 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_2__pyx_unpickle_FileArrayTreeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2442 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_4__pyx_unpickle_FileArrayTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2443 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_6__pyx_unpickle_Summary(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2444 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_8__pyx_unpickle_ArrayTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2445 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_10__pyx_unpickle_ArrayTreeNode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2446 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_12__pyx_unpickle_ArrayTreeLeaf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2447 static PyObject *__pyx_tp_new_2bx_6arrays_10array_tree_FileArrayTreeDict(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2448 static PyObject *__pyx_tp_new_2bx_6arrays_10array_tree_FileArrayTree(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2449 static PyObject *__pyx_tp_new_2bx_6arrays_10array_tree_Summary(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2450 static PyObject *__pyx_tp_new_2bx_6arrays_10array_tree_ArrayTreeNode(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2451 static PyObject *__pyx_tp_new_2bx_6arrays_10array_tree_ArrayTreeLeaf(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2452 static PyObject *__pyx_tp_new_2bx_6arrays_10array_tree_ArrayTree(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2453 static PyObject *__pyx_int_0;
2454 static PyObject *__pyx_int_1;
2455 static PyObject *__pyx_int_2;
2456 static PyObject *__pyx_int_3;
2457 static PyObject *__pyx_int_6;
2458 static PyObject *__pyx_int_1000;
2459 static PyObject *__pyx_int_16039877;
2460 static PyObject *__pyx_int_110204367;
2461 static PyObject *__pyx_int_202518704;
2462 static PyObject *__pyx_int_217126864;
2463 static PyObject *__pyx_int_246147831;
2464 static PyObject *__pyx_int_247174264;
2465 static PyObject *__pyx_int_823052252;
2466 static PyObject *__pyx_int_2147483647;
2467 static PyObject *__pyx_k__2;
2468 static PyObject *__pyx_tuple_;
2469 static PyObject *__pyx_slice__4;
2470 static PyObject *__pyx_tuple__5;
2471 static PyObject *__pyx_tuple__6;
2472 static PyObject *__pyx_tuple__9;
2473 static PyObject *__pyx_tuple__11;
2474 static PyObject *__pyx_tuple__13;
2475 static PyObject *__pyx_tuple__15;
2476 static PyObject *__pyx_tuple__17;
2477 static PyObject *__pyx_tuple__19;
2478 static PyObject *__pyx_tuple__21;
2479 static PyObject *__pyx_codeobj__10;
2480 static PyObject *__pyx_codeobj__12;
2481 static PyObject *__pyx_codeobj__14;
2482 static PyObject *__pyx_codeobj__16;
2483 static PyObject *__pyx_codeobj__18;
2484 static PyObject *__pyx_codeobj__20;
2485 static PyObject *__pyx_codeobj__22;
2486 /* Late includes */
2487 
2488 /* "bx/arrays/array_tree.pyx":62
2489  * NUM_SUMMARY_ARRAYS = 6
2490  *
2491  * def array_tree_dict_from_reader( reader, sizes, default_size=2147483647, block_size=1000, no_leaves=False ):             # <<<<<<<<<<<<<<
2492  *     # Create empty array trees
2493  *     rval = {}
2494  */
2495 
2496 /* Python wrapper */
2497 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_1array_tree_dict_from_reader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2498 static PyMethodDef __pyx_mdef_2bx_6arrays_10array_tree_1array_tree_dict_from_reader = {"array_tree_dict_from_reader", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_1array_tree_dict_from_reader, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2bx_6arrays_10array_tree_1array_tree_dict_from_reader(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2499 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_1array_tree_dict_from_reader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2500   PyObject *__pyx_v_reader = 0;
2501   PyObject *__pyx_v_sizes = 0;
2502   PyObject *__pyx_v_default_size = 0;
2503   PyObject *__pyx_v_block_size = 0;
2504   PyObject *__pyx_v_no_leaves = 0;
2505   int __pyx_lineno = 0;
2506   const char *__pyx_filename = NULL;
2507   int __pyx_clineno = 0;
2508   PyObject *__pyx_r = 0;
2509   __Pyx_RefNannyDeclarations
2510   __Pyx_RefNannySetupContext("array_tree_dict_from_reader (wrapper)", 0);
2511   {
2512     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reader,&__pyx_n_s_sizes,&__pyx_n_s_default_size,&__pyx_n_s_block_size,&__pyx_n_s_no_leaves,0};
2513     PyObject* values[5] = {0,0,0,0,0};
2514     values[2] = ((PyObject *)__pyx_int_2147483647);
2515     values[3] = ((PyObject *)__pyx_int_1000);
2516     values[4] = ((PyObject *)Py_False);
2517     if (unlikely(__pyx_kwds)) {
2518       Py_ssize_t kw_args;
2519       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2520       switch (pos_args) {
2521         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2522         CYTHON_FALLTHROUGH;
2523         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2524         CYTHON_FALLTHROUGH;
2525         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2526         CYTHON_FALLTHROUGH;
2527         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2528         CYTHON_FALLTHROUGH;
2529         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2530         CYTHON_FALLTHROUGH;
2531         case  0: break;
2532         default: goto __pyx_L5_argtuple_error;
2533       }
2534       kw_args = PyDict_Size(__pyx_kwds);
2535       switch (pos_args) {
2536         case  0:
2537         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader)) != 0)) kw_args--;
2538         else goto __pyx_L5_argtuple_error;
2539         CYTHON_FALLTHROUGH;
2540         case  1:
2541         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sizes)) != 0)) kw_args--;
2542         else {
2543           __Pyx_RaiseArgtupleInvalid("array_tree_dict_from_reader", 0, 2, 5, 1); __PYX_ERR(0, 62, __pyx_L3_error)
2544         }
2545         CYTHON_FALLTHROUGH;
2546         case  2:
2547         if (kw_args > 0) {
2548           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default_size);
2549           if (value) { values[2] = value; kw_args--; }
2550         }
2551         CYTHON_FALLTHROUGH;
2552         case  3:
2553         if (kw_args > 0) {
2554           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block_size);
2555           if (value) { values[3] = value; kw_args--; }
2556         }
2557         CYTHON_FALLTHROUGH;
2558         case  4:
2559         if (kw_args > 0) {
2560           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_no_leaves);
2561           if (value) { values[4] = value; kw_args--; }
2562         }
2563       }
2564       if (unlikely(kw_args > 0)) {
2565         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "array_tree_dict_from_reader") < 0)) __PYX_ERR(0, 62, __pyx_L3_error)
2566       }
2567     } else {
2568       switch (PyTuple_GET_SIZE(__pyx_args)) {
2569         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2570         CYTHON_FALLTHROUGH;
2571         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2572         CYTHON_FALLTHROUGH;
2573         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2574         CYTHON_FALLTHROUGH;
2575         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2576         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2577         break;
2578         default: goto __pyx_L5_argtuple_error;
2579       }
2580     }
2581     __pyx_v_reader = values[0];
2582     __pyx_v_sizes = values[1];
2583     __pyx_v_default_size = values[2];
2584     __pyx_v_block_size = values[3];
2585     __pyx_v_no_leaves = values[4];
2586   }
2587   goto __pyx_L4_argument_unpacking_done;
2588   __pyx_L5_argtuple_error:;
2589   __Pyx_RaiseArgtupleInvalid("array_tree_dict_from_reader", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 62, __pyx_L3_error)
2590   __pyx_L3_error:;
2591   __Pyx_AddTraceback("bx.arrays.array_tree.array_tree_dict_from_reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
2592   __Pyx_RefNannyFinishContext();
2593   return NULL;
2594   __pyx_L4_argument_unpacking_done:;
2595   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_array_tree_dict_from_reader(__pyx_self, __pyx_v_reader, __pyx_v_sizes, __pyx_v_default_size, __pyx_v_block_size, __pyx_v_no_leaves);
2596 
2597   /* function exit code */
2598   __Pyx_RefNannyFinishContext();
2599   return __pyx_r;
2600 }
2601 
__pyx_pf_2bx_6arrays_10array_tree_array_tree_dict_from_reader(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_reader,PyObject * __pyx_v_sizes,PyObject * __pyx_v_default_size,PyObject * __pyx_v_block_size,PyObject * __pyx_v_no_leaves)2602 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_array_tree_dict_from_reader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_reader, PyObject *__pyx_v_sizes, PyObject *__pyx_v_default_size, PyObject *__pyx_v_block_size, PyObject *__pyx_v_no_leaves) {
2603   PyObject *__pyx_v_rval = NULL;
2604   PyObject *__pyx_v_last_chrom = NULL;
2605   PyObject *__pyx_v_last_array_tree = NULL;
2606   PyObject *__pyx_v_chrom = NULL;
2607   PyObject *__pyx_v_start = NULL;
2608   PyObject *__pyx_v_end = NULL;
2609   CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
2610   PyObject *__pyx_v_val = NULL;
2611   PyObject *__pyx_r = NULL;
2612   __Pyx_RefNannyDeclarations
2613   PyObject *__pyx_t_1 = NULL;
2614   Py_ssize_t __pyx_t_2;
2615   PyObject *(*__pyx_t_3)(PyObject *);
2616   PyObject *__pyx_t_4 = NULL;
2617   PyObject *__pyx_t_5 = NULL;
2618   PyObject *__pyx_t_6 = NULL;
2619   PyObject *__pyx_t_7 = NULL;
2620   PyObject *__pyx_t_8 = NULL;
2621   PyObject *__pyx_t_9 = NULL;
2622   PyObject *__pyx_t_10 = NULL;
2623   PyObject *(*__pyx_t_11)(PyObject *);
2624   int __pyx_t_12;
2625   int __pyx_t_13;
2626   int __pyx_t_14;
2627   int __pyx_lineno = 0;
2628   const char *__pyx_filename = NULL;
2629   int __pyx_clineno = 0;
2630   __Pyx_RefNannySetupContext("array_tree_dict_from_reader", 0);
2631 
2632   /* "bx/arrays/array_tree.pyx":64
2633  * def array_tree_dict_from_reader( reader, sizes, default_size=2147483647, block_size=1000, no_leaves=False ):
2634  *     # Create empty array trees
2635  *     rval = {}             # <<<<<<<<<<<<<<
2636  *     ## for key, size in sizes.iteritems():
2637  *     ##    rval[ key ] = ArrayTree( size, 1000 )
2638  */
2639   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
2640   __Pyx_GOTREF(__pyx_t_1);
2641   __pyx_v_rval = ((PyObject*)__pyx_t_1);
2642   __pyx_t_1 = 0;
2643 
2644   /* "bx/arrays/array_tree.pyx":68
2645  *     ##    rval[ key ] = ArrayTree( size, 1000 )
2646  *     # Fill
2647  *     last_chrom = None             # <<<<<<<<<<<<<<
2648  *     last_array_tree = None
2649  *     for chrom, start, end, _, val in reader:
2650  */
2651   __Pyx_INCREF(Py_None);
2652   __pyx_v_last_chrom = Py_None;
2653 
2654   /* "bx/arrays/array_tree.pyx":69
2655  *     # Fill
2656  *     last_chrom = None
2657  *     last_array_tree = None             # <<<<<<<<<<<<<<
2658  *     for chrom, start, end, _, val in reader:
2659  *         if chrom != last_chrom:
2660  */
2661   __Pyx_INCREF(Py_None);
2662   __pyx_v_last_array_tree = Py_None;
2663 
2664   /* "bx/arrays/array_tree.pyx":70
2665  *     last_chrom = None
2666  *     last_array_tree = None
2667  *     for chrom, start, end, _, val in reader:             # <<<<<<<<<<<<<<
2668  *         if chrom != last_chrom:
2669  *             if chrom not in rval:
2670  */
2671   if (likely(PyList_CheckExact(__pyx_v_reader)) || PyTuple_CheckExact(__pyx_v_reader)) {
2672     __pyx_t_1 = __pyx_v_reader; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
2673     __pyx_t_3 = NULL;
2674   } else {
2675     __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
2676     __Pyx_GOTREF(__pyx_t_1);
2677     __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
2678   }
2679   for (;;) {
2680     if (likely(!__pyx_t_3)) {
2681       if (likely(PyList_CheckExact(__pyx_t_1))) {
2682         if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
2683         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2684         __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 70, __pyx_L1_error)
2685         #else
2686         __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)
2687         __Pyx_GOTREF(__pyx_t_4);
2688         #endif
2689       } else {
2690         if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
2691         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2692         __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 70, __pyx_L1_error)
2693         #else
2694         __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)
2695         __Pyx_GOTREF(__pyx_t_4);
2696         #endif
2697       }
2698     } else {
2699       __pyx_t_4 = __pyx_t_3(__pyx_t_1);
2700       if (unlikely(!__pyx_t_4)) {
2701         PyObject* exc_type = PyErr_Occurred();
2702         if (exc_type) {
2703           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
2704           else __PYX_ERR(0, 70, __pyx_L1_error)
2705         }
2706         break;
2707       }
2708       __Pyx_GOTREF(__pyx_t_4);
2709     }
2710     if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
2711       PyObject* sequence = __pyx_t_4;
2712       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
2713       if (unlikely(size != 5)) {
2714         if (size > 5) __Pyx_RaiseTooManyValuesError(5);
2715         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
2716         __PYX_ERR(0, 70, __pyx_L1_error)
2717       }
2718       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2719       if (likely(PyTuple_CheckExact(sequence))) {
2720         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
2721         __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
2722         __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2);
2723         __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3);
2724         __pyx_t_9 = PyTuple_GET_ITEM(sequence, 4);
2725       } else {
2726         __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
2727         __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
2728         __pyx_t_7 = PyList_GET_ITEM(sequence, 2);
2729         __pyx_t_8 = PyList_GET_ITEM(sequence, 3);
2730         __pyx_t_9 = PyList_GET_ITEM(sequence, 4);
2731       }
2732       __Pyx_INCREF(__pyx_t_5);
2733       __Pyx_INCREF(__pyx_t_6);
2734       __Pyx_INCREF(__pyx_t_7);
2735       __Pyx_INCREF(__pyx_t_8);
2736       __Pyx_INCREF(__pyx_t_9);
2737       #else
2738       {
2739         Py_ssize_t i;
2740         PyObject** temps[5] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
2741         for (i=0; i < 5; i++) {
2742           PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 70, __pyx_L1_error)
2743           __Pyx_GOTREF(item);
2744           *(temps[i]) = item;
2745         }
2746       }
2747       #endif
2748       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2749     } else {
2750       Py_ssize_t index = -1;
2751       PyObject** temps[5] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
2752       __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 70, __pyx_L1_error)
2753       __Pyx_GOTREF(__pyx_t_10);
2754       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2755       __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
2756       for (index=0; index < 5; index++) {
2757         PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L5_unpacking_failed;
2758         __Pyx_GOTREF(item);
2759         *(temps[index]) = item;
2760       }
2761       if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 5) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
2762       __pyx_t_11 = NULL;
2763       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
2764       goto __pyx_L6_unpacking_done;
2765       __pyx_L5_unpacking_failed:;
2766       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
2767       __pyx_t_11 = NULL;
2768       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
2769       __PYX_ERR(0, 70, __pyx_L1_error)
2770       __pyx_L6_unpacking_done:;
2771     }
2772     __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_5);
2773     __pyx_t_5 = 0;
2774     __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_6);
2775     __pyx_t_6 = 0;
2776     __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_7);
2777     __pyx_t_7 = 0;
2778     __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_8);
2779     __pyx_t_8 = 0;
2780     __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_9);
2781     __pyx_t_9 = 0;
2782 
2783     /* "bx/arrays/array_tree.pyx":71
2784  *     last_array_tree = None
2785  *     for chrom, start, end, _, val in reader:
2786  *         if chrom != last_chrom:             # <<<<<<<<<<<<<<
2787  *             if chrom not in rval:
2788  *                 rval[chrom] = ArrayTree( sizes.get( chrom, default_size ), block_size, no_leaves=no_leaves )
2789  */
2790     __pyx_t_4 = PyObject_RichCompare(__pyx_v_chrom, __pyx_v_last_chrom, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error)
2791     __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 71, __pyx_L1_error)
2792     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2793     if (__pyx_t_12) {
2794 
2795       /* "bx/arrays/array_tree.pyx":72
2796  *     for chrom, start, end, _, val in reader:
2797  *         if chrom != last_chrom:
2798  *             if chrom not in rval:             # <<<<<<<<<<<<<<
2799  *                 rval[chrom] = ArrayTree( sizes.get( chrom, default_size ), block_size, no_leaves=no_leaves )
2800  *             last_array_tree = rval[chrom]
2801  */
2802       __pyx_t_12 = (__Pyx_PyDict_ContainsTF(__pyx_v_chrom, __pyx_v_rval, Py_NE)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 72, __pyx_L1_error)
2803       __pyx_t_13 = (__pyx_t_12 != 0);
2804       if (__pyx_t_13) {
2805 
2806         /* "bx/arrays/array_tree.pyx":73
2807  *         if chrom != last_chrom:
2808  *             if chrom not in rval:
2809  *                 rval[chrom] = ArrayTree( sizes.get( chrom, default_size ), block_size, no_leaves=no_leaves )             # <<<<<<<<<<<<<<
2810  *             last_array_tree = rval[chrom]
2811  *         last_array_tree.set_range( start, end, val )
2812  */
2813         __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sizes, __pyx_n_s_get); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 73, __pyx_L1_error)
2814         __Pyx_GOTREF(__pyx_t_9);
2815         __pyx_t_8 = NULL;
2816         __pyx_t_14 = 0;
2817         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
2818           __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
2819           if (likely(__pyx_t_8)) {
2820             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
2821             __Pyx_INCREF(__pyx_t_8);
2822             __Pyx_INCREF(function);
2823             __Pyx_DECREF_SET(__pyx_t_9, function);
2824             __pyx_t_14 = 1;
2825           }
2826         }
2827         #if CYTHON_FAST_PYCALL
2828         if (PyFunction_Check(__pyx_t_9)) {
2829           PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_chrom, __pyx_v_default_size};
2830           __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error)
2831           __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2832           __Pyx_GOTREF(__pyx_t_4);
2833         } else
2834         #endif
2835         #if CYTHON_FAST_PYCCALL
2836         if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
2837           PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_chrom, __pyx_v_default_size};
2838           __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error)
2839           __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2840           __Pyx_GOTREF(__pyx_t_4);
2841         } else
2842         #endif
2843         {
2844           __pyx_t_7 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 73, __pyx_L1_error)
2845           __Pyx_GOTREF(__pyx_t_7);
2846           if (__pyx_t_8) {
2847             __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL;
2848           }
2849           __Pyx_INCREF(__pyx_v_chrom);
2850           __Pyx_GIVEREF(__pyx_v_chrom);
2851           PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_14, __pyx_v_chrom);
2852           __Pyx_INCREF(__pyx_v_default_size);
2853           __Pyx_GIVEREF(__pyx_v_default_size);
2854           PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_14, __pyx_v_default_size);
2855           __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error)
2856           __Pyx_GOTREF(__pyx_t_4);
2857           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2858         }
2859         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
2860         __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 73, __pyx_L1_error)
2861         __Pyx_GOTREF(__pyx_t_9);
2862         __Pyx_GIVEREF(__pyx_t_4);
2863         PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4);
2864         __Pyx_INCREF(__pyx_v_block_size);
2865         __Pyx_GIVEREF(__pyx_v_block_size);
2866         PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_block_size);
2867         __pyx_t_4 = 0;
2868         __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error)
2869         __Pyx_GOTREF(__pyx_t_4);
2870         if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_no_leaves, __pyx_v_no_leaves) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
2871         __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_ArrayTree), __pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 73, __pyx_L1_error)
2872         __Pyx_GOTREF(__pyx_t_7);
2873         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
2874         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2875         if (unlikely(PyDict_SetItem(__pyx_v_rval, __pyx_v_chrom, __pyx_t_7) < 0)) __PYX_ERR(0, 73, __pyx_L1_error)
2876         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2877 
2878         /* "bx/arrays/array_tree.pyx":72
2879  *     for chrom, start, end, _, val in reader:
2880  *         if chrom != last_chrom:
2881  *             if chrom not in rval:             # <<<<<<<<<<<<<<
2882  *                 rval[chrom] = ArrayTree( sizes.get( chrom, default_size ), block_size, no_leaves=no_leaves )
2883  *             last_array_tree = rval[chrom]
2884  */
2885       }
2886 
2887       /* "bx/arrays/array_tree.pyx":74
2888  *             if chrom not in rval:
2889  *                 rval[chrom] = ArrayTree( sizes.get( chrom, default_size ), block_size, no_leaves=no_leaves )
2890  *             last_array_tree = rval[chrom]             # <<<<<<<<<<<<<<
2891  *         last_array_tree.set_range( start, end, val )
2892  *     return rval
2893  */
2894       __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_rval, __pyx_v_chrom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L1_error)
2895       __Pyx_GOTREF(__pyx_t_7);
2896       __Pyx_DECREF_SET(__pyx_v_last_array_tree, __pyx_t_7);
2897       __pyx_t_7 = 0;
2898 
2899       /* "bx/arrays/array_tree.pyx":71
2900  *     last_array_tree = None
2901  *     for chrom, start, end, _, val in reader:
2902  *         if chrom != last_chrom:             # <<<<<<<<<<<<<<
2903  *             if chrom not in rval:
2904  *                 rval[chrom] = ArrayTree( sizes.get( chrom, default_size ), block_size, no_leaves=no_leaves )
2905  */
2906     }
2907 
2908     /* "bx/arrays/array_tree.pyx":75
2909  *                 rval[chrom] = ArrayTree( sizes.get( chrom, default_size ), block_size, no_leaves=no_leaves )
2910  *             last_array_tree = rval[chrom]
2911  *         last_array_tree.set_range( start, end, val )             # <<<<<<<<<<<<<<
2912  *     return rval
2913  *
2914  */
2915     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_last_array_tree, __pyx_n_s_set_range); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
2916     __Pyx_GOTREF(__pyx_t_4);
2917     __pyx_t_9 = NULL;
2918     __pyx_t_14 = 0;
2919     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
2920       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
2921       if (likely(__pyx_t_9)) {
2922         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
2923         __Pyx_INCREF(__pyx_t_9);
2924         __Pyx_INCREF(function);
2925         __Pyx_DECREF_SET(__pyx_t_4, function);
2926         __pyx_t_14 = 1;
2927       }
2928     }
2929     #if CYTHON_FAST_PYCALL
2930     if (PyFunction_Check(__pyx_t_4)) {
2931       PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_start, __pyx_v_end, __pyx_v_val};
2932       __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_14, 3+__pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 75, __pyx_L1_error)
2933       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
2934       __Pyx_GOTREF(__pyx_t_7);
2935     } else
2936     #endif
2937     #if CYTHON_FAST_PYCCALL
2938     if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
2939       PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_start, __pyx_v_end, __pyx_v_val};
2940       __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_14, 3+__pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 75, __pyx_L1_error)
2941       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
2942       __Pyx_GOTREF(__pyx_t_7);
2943     } else
2944     #endif
2945     {
2946       __pyx_t_8 = PyTuple_New(3+__pyx_t_14); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 75, __pyx_L1_error)
2947       __Pyx_GOTREF(__pyx_t_8);
2948       if (__pyx_t_9) {
2949         __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
2950       }
2951       __Pyx_INCREF(__pyx_v_start);
2952       __Pyx_GIVEREF(__pyx_v_start);
2953       PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_14, __pyx_v_start);
2954       __Pyx_INCREF(__pyx_v_end);
2955       __Pyx_GIVEREF(__pyx_v_end);
2956       PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_14, __pyx_v_end);
2957       __Pyx_INCREF(__pyx_v_val);
2958       __Pyx_GIVEREF(__pyx_v_val);
2959       PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_14, __pyx_v_val);
2960       __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 75, __pyx_L1_error)
2961       __Pyx_GOTREF(__pyx_t_7);
2962       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2963     }
2964     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2965     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2966 
2967     /* "bx/arrays/array_tree.pyx":70
2968  *     last_chrom = None
2969  *     last_array_tree = None
2970  *     for chrom, start, end, _, val in reader:             # <<<<<<<<<<<<<<
2971  *         if chrom != last_chrom:
2972  *             if chrom not in rval:
2973  */
2974   }
2975   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2976 
2977   /* "bx/arrays/array_tree.pyx":76
2978  *             last_array_tree = rval[chrom]
2979  *         last_array_tree.set_range( start, end, val )
2980  *     return rval             # <<<<<<<<<<<<<<
2981  *
2982  *
2983  */
2984   __Pyx_XDECREF(__pyx_r);
2985   __Pyx_INCREF(__pyx_v_rval);
2986   __pyx_r = __pyx_v_rval;
2987   goto __pyx_L0;
2988 
2989   /* "bx/arrays/array_tree.pyx":62
2990  * NUM_SUMMARY_ARRAYS = 6
2991  *
2992  * def array_tree_dict_from_reader( reader, sizes, default_size=2147483647, block_size=1000, no_leaves=False ):             # <<<<<<<<<<<<<<
2993  *     # Create empty array trees
2994  *     rval = {}
2995  */
2996 
2997   /* function exit code */
2998   __pyx_L1_error:;
2999   __Pyx_XDECREF(__pyx_t_1);
3000   __Pyx_XDECREF(__pyx_t_4);
3001   __Pyx_XDECREF(__pyx_t_5);
3002   __Pyx_XDECREF(__pyx_t_6);
3003   __Pyx_XDECREF(__pyx_t_7);
3004   __Pyx_XDECREF(__pyx_t_8);
3005   __Pyx_XDECREF(__pyx_t_9);
3006   __Pyx_XDECREF(__pyx_t_10);
3007   __Pyx_AddTraceback("bx.arrays.array_tree.array_tree_dict_from_reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
3008   __pyx_r = NULL;
3009   __pyx_L0:;
3010   __Pyx_XDECREF(__pyx_v_rval);
3011   __Pyx_XDECREF(__pyx_v_last_chrom);
3012   __Pyx_XDECREF(__pyx_v_last_array_tree);
3013   __Pyx_XDECREF(__pyx_v_chrom);
3014   __Pyx_XDECREF(__pyx_v_start);
3015   __Pyx_XDECREF(__pyx_v_end);
3016   __Pyx_XDECREF(__pyx_v__);
3017   __Pyx_XDECREF(__pyx_v_val);
3018   __Pyx_XGIVEREF(__pyx_r);
3019   __Pyx_RefNannyFinishContext();
3020   return __pyx_r;
3021 }
3022 
3023 /* "bx/arrays/array_tree.pyx":85
3024  *     cdef object io
3025  *     cdef object cdb_dict
3026  *     def __init__( self, file ):             # <<<<<<<<<<<<<<
3027  *         self.io = io = BinaryFileReader( file, MAGIC )
3028  *         assert (0 <= io.read_uint32() <= 1) # Check for version 0 or 1
3029  */
3030 
3031 /* Python wrapper */
3032 static int __pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3033 static int __pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3034   PyObject *__pyx_v_file = 0;
3035   int __pyx_lineno = 0;
3036   const char *__pyx_filename = NULL;
3037   int __pyx_clineno = 0;
3038   int __pyx_r;
3039   __Pyx_RefNannyDeclarations
3040   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3041   {
3042     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file,0};
3043     PyObject* values[1] = {0};
3044     if (unlikely(__pyx_kwds)) {
3045       Py_ssize_t kw_args;
3046       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3047       switch (pos_args) {
3048         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3049         CYTHON_FALLTHROUGH;
3050         case  0: break;
3051         default: goto __pyx_L5_argtuple_error;
3052       }
3053       kw_args = PyDict_Size(__pyx_kwds);
3054       switch (pos_args) {
3055         case  0:
3056         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_file)) != 0)) kw_args--;
3057         else goto __pyx_L5_argtuple_error;
3058       }
3059       if (unlikely(kw_args > 0)) {
3060         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 85, __pyx_L3_error)
3061       }
3062     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
3063       goto __pyx_L5_argtuple_error;
3064     } else {
3065       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3066     }
3067     __pyx_v_file = values[0];
3068   }
3069   goto __pyx_L4_argument_unpacking_done;
3070   __pyx_L5_argtuple_error:;
3071   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 85, __pyx_L3_error)
3072   __pyx_L3_error:;
3073   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTreeDict.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3074   __Pyx_RefNannyFinishContext();
3075   return -1;
3076   __pyx_L4_argument_unpacking_done:;
3077   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict___init__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)__pyx_v_self), __pyx_v_file);
3078 
3079   /* function exit code */
3080   __Pyx_RefNannyFinishContext();
3081   return __pyx_r;
3082 }
3083 
__pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict___init__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict * __pyx_v_self,PyObject * __pyx_v_file)3084 static int __pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict___init__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *__pyx_v_self, PyObject *__pyx_v_file) {
3085   PyObject *__pyx_v_io = NULL;
3086   int __pyx_r;
3087   __Pyx_RefNannyDeclarations
3088   PyObject *__pyx_t_1 = NULL;
3089   PyObject *__pyx_t_2 = NULL;
3090   PyObject *__pyx_t_3 = NULL;
3091   PyObject *__pyx_t_4 = NULL;
3092   int __pyx_t_5;
3093   PyObject *__pyx_t_6 = NULL;
3094   int __pyx_t_7;
3095   int __pyx_lineno = 0;
3096   const char *__pyx_filename = NULL;
3097   int __pyx_clineno = 0;
3098   __Pyx_RefNannySetupContext("__init__", 0);
3099 
3100   /* "bx/arrays/array_tree.pyx":86
3101  *     cdef object cdb_dict
3102  *     def __init__( self, file ):
3103  *         self.io = io = BinaryFileReader( file, MAGIC )             # <<<<<<<<<<<<<<
3104  *         assert (0 <= io.read_uint32() <= 1) # Check for version 0 or 1
3105  *         self.cdb_dict = FileCDBDict( file, is_little_endian=io.is_little_endian )
3106  */
3107   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BinaryFileReader); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
3108   __Pyx_GOTREF(__pyx_t_2);
3109   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MAGIC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
3110   __Pyx_GOTREF(__pyx_t_3);
3111   __pyx_t_4 = NULL;
3112   __pyx_t_5 = 0;
3113   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3114     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3115     if (likely(__pyx_t_4)) {
3116       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3117       __Pyx_INCREF(__pyx_t_4);
3118       __Pyx_INCREF(function);
3119       __Pyx_DECREF_SET(__pyx_t_2, function);
3120       __pyx_t_5 = 1;
3121     }
3122   }
3123   #if CYTHON_FAST_PYCALL
3124   if (PyFunction_Check(__pyx_t_2)) {
3125     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_file, __pyx_t_3};
3126     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
3127     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3128     __Pyx_GOTREF(__pyx_t_1);
3129     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3130   } else
3131   #endif
3132   #if CYTHON_FAST_PYCCALL
3133   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
3134     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_file, __pyx_t_3};
3135     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
3136     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3137     __Pyx_GOTREF(__pyx_t_1);
3138     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3139   } else
3140   #endif
3141   {
3142     __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 86, __pyx_L1_error)
3143     __Pyx_GOTREF(__pyx_t_6);
3144     if (__pyx_t_4) {
3145       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
3146     }
3147     __Pyx_INCREF(__pyx_v_file);
3148     __Pyx_GIVEREF(__pyx_v_file);
3149     PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_file);
3150     __Pyx_GIVEREF(__pyx_t_3);
3151     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
3152     __pyx_t_3 = 0;
3153     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
3154     __Pyx_GOTREF(__pyx_t_1);
3155     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3156   }
3157   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3158   __Pyx_INCREF(__pyx_t_1);
3159   __Pyx_GIVEREF(__pyx_t_1);
3160   __Pyx_GOTREF(__pyx_v_self->io);
3161   __Pyx_DECREF(__pyx_v_self->io);
3162   __pyx_v_self->io = __pyx_t_1;
3163   __Pyx_INCREF(__pyx_t_1);
3164   __pyx_v_io = __pyx_t_1;
3165   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3166 
3167   /* "bx/arrays/array_tree.pyx":87
3168  *     def __init__( self, file ):
3169  *         self.io = io = BinaryFileReader( file, MAGIC )
3170  *         assert (0 <= io.read_uint32() <= 1) # Check for version 0 or 1             # <<<<<<<<<<<<<<
3171  *         self.cdb_dict = FileCDBDict( file, is_little_endian=io.is_little_endian )
3172  *     def __getitem__( self, key ):
3173  */
3174   #ifndef CYTHON_WITHOUT_ASSERTIONS
3175   if (unlikely(!Py_OptimizeFlag)) {
3176     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_read_uint32); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
3177     __Pyx_GOTREF(__pyx_t_2);
3178     __pyx_t_6 = NULL;
3179     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3180       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
3181       if (likely(__pyx_t_6)) {
3182         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3183         __Pyx_INCREF(__pyx_t_6);
3184         __Pyx_INCREF(function);
3185         __Pyx_DECREF_SET(__pyx_t_2, function);
3186       }
3187     }
3188     __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
3189     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3190     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
3191     __Pyx_GOTREF(__pyx_t_1);
3192     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3193     __pyx_t_2 = PyObject_RichCompare(__pyx_int_0, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
3194     if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
3195       __Pyx_DECREF(__pyx_t_2);
3196       __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
3197     }
3198     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3199     __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 87, __pyx_L1_error)
3200     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3201     if (unlikely(!__pyx_t_7)) {
3202       PyErr_SetNone(PyExc_AssertionError);
3203       __PYX_ERR(0, 87, __pyx_L1_error)
3204     }
3205   }
3206   #endif
3207 
3208   /* "bx/arrays/array_tree.pyx":88
3209  *         self.io = io = BinaryFileReader( file, MAGIC )
3210  *         assert (0 <= io.read_uint32() <= 1) # Check for version 0 or 1
3211  *         self.cdb_dict = FileCDBDict( file, is_little_endian=io.is_little_endian )             # <<<<<<<<<<<<<<
3212  *     def __getitem__( self, key ):
3213  *         offset = self.cdb_dict[key]
3214  */
3215   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FileCDBDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
3216   __Pyx_GOTREF(__pyx_t_2);
3217   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
3218   __Pyx_GOTREF(__pyx_t_1);
3219   __Pyx_INCREF(__pyx_v_file);
3220   __Pyx_GIVEREF(__pyx_v_file);
3221   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_file);
3222   __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 88, __pyx_L1_error)
3223   __Pyx_GOTREF(__pyx_t_6);
3224   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_is_little_endian); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
3225   __Pyx_GOTREF(__pyx_t_3);
3226   if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_is_little_endian, __pyx_t_3) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
3227   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3228   __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
3229   __Pyx_GOTREF(__pyx_t_3);
3230   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3231   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3232   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3233   __Pyx_GIVEREF(__pyx_t_3);
3234   __Pyx_GOTREF(__pyx_v_self->cdb_dict);
3235   __Pyx_DECREF(__pyx_v_self->cdb_dict);
3236   __pyx_v_self->cdb_dict = __pyx_t_3;
3237   __pyx_t_3 = 0;
3238 
3239   /* "bx/arrays/array_tree.pyx":85
3240  *     cdef object io
3241  *     cdef object cdb_dict
3242  *     def __init__( self, file ):             # <<<<<<<<<<<<<<
3243  *         self.io = io = BinaryFileReader( file, MAGIC )
3244  *         assert (0 <= io.read_uint32() <= 1) # Check for version 0 or 1
3245  */
3246 
3247   /* function exit code */
3248   __pyx_r = 0;
3249   goto __pyx_L0;
3250   __pyx_L1_error:;
3251   __Pyx_XDECREF(__pyx_t_1);
3252   __Pyx_XDECREF(__pyx_t_2);
3253   __Pyx_XDECREF(__pyx_t_3);
3254   __Pyx_XDECREF(__pyx_t_4);
3255   __Pyx_XDECREF(__pyx_t_6);
3256   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTreeDict.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3257   __pyx_r = -1;
3258   __pyx_L0:;
3259   __Pyx_XDECREF(__pyx_v_io);
3260   __Pyx_RefNannyFinishContext();
3261   return __pyx_r;
3262 }
3263 
3264 /* "bx/arrays/array_tree.pyx":89
3265  *         assert (0 <= io.read_uint32() <= 1) # Check for version 0 or 1
3266  *         self.cdb_dict = FileCDBDict( file, is_little_endian=io.is_little_endian )
3267  *     def __getitem__( self, key ):             # <<<<<<<<<<<<<<
3268  *         offset = self.cdb_dict[key]
3269  *         offset = self.io.unpack( "L", offset.encode() )[0]
3270  */
3271 
3272 /* Python wrapper */
3273 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_3__getitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_key)3274 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
3275   PyObject *__pyx_r = 0;
3276   __Pyx_RefNannyDeclarations
3277   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
3278   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict_2__getitem__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)__pyx_v_self), ((PyObject *)__pyx_v_key));
3279 
3280   /* function exit code */
3281   __Pyx_RefNannyFinishContext();
3282   return __pyx_r;
3283 }
3284 
__pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict_2__getitem__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict * __pyx_v_self,PyObject * __pyx_v_key)3285 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict_2__getitem__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *__pyx_v_self, PyObject *__pyx_v_key) {
3286   PyObject *__pyx_v_offset = NULL;
3287   PyObject *__pyx_r = NULL;
3288   __Pyx_RefNannyDeclarations
3289   PyObject *__pyx_t_1 = NULL;
3290   PyObject *__pyx_t_2 = NULL;
3291   PyObject *__pyx_t_3 = NULL;
3292   PyObject *__pyx_t_4 = NULL;
3293   PyObject *__pyx_t_5 = NULL;
3294   int __pyx_t_6;
3295   int __pyx_lineno = 0;
3296   const char *__pyx_filename = NULL;
3297   int __pyx_clineno = 0;
3298   __Pyx_RefNannySetupContext("__getitem__", 0);
3299 
3300   /* "bx/arrays/array_tree.pyx":90
3301  *         self.cdb_dict = FileCDBDict( file, is_little_endian=io.is_little_endian )
3302  *     def __getitem__( self, key ):
3303  *         offset = self.cdb_dict[key]             # <<<<<<<<<<<<<<
3304  *         offset = self.io.unpack( "L", offset.encode() )[0]
3305  *         self.io.seek( offset )
3306  */
3307   __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->cdb_dict, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
3308   __Pyx_GOTREF(__pyx_t_1);
3309   __pyx_v_offset = __pyx_t_1;
3310   __pyx_t_1 = 0;
3311 
3312   /* "bx/arrays/array_tree.pyx":91
3313  *     def __getitem__( self, key ):
3314  *         offset = self.cdb_dict[key]
3315  *         offset = self.io.unpack( "L", offset.encode() )[0]             # <<<<<<<<<<<<<<
3316  *         self.io.seek( offset )
3317  *         return FileArrayTree( self.io.file, self.io.is_little_endian )
3318  */
3319   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_unpack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
3320   __Pyx_GOTREF(__pyx_t_2);
3321   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_offset, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
3322   __Pyx_GOTREF(__pyx_t_4);
3323   __pyx_t_5 = NULL;
3324   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3325     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3326     if (likely(__pyx_t_5)) {
3327       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3328       __Pyx_INCREF(__pyx_t_5);
3329       __Pyx_INCREF(function);
3330       __Pyx_DECREF_SET(__pyx_t_4, function);
3331     }
3332   }
3333   __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
3334   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3335   if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error)
3336   __Pyx_GOTREF(__pyx_t_3);
3337   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3338   __pyx_t_4 = NULL;
3339   __pyx_t_6 = 0;
3340   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3341     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3342     if (likely(__pyx_t_4)) {
3343       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3344       __Pyx_INCREF(__pyx_t_4);
3345       __Pyx_INCREF(function);
3346       __Pyx_DECREF_SET(__pyx_t_2, function);
3347       __pyx_t_6 = 1;
3348     }
3349   }
3350   #if CYTHON_FAST_PYCALL
3351   if (PyFunction_Check(__pyx_t_2)) {
3352     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_s_L, __pyx_t_3};
3353     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
3354     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3355     __Pyx_GOTREF(__pyx_t_1);
3356     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3357   } else
3358   #endif
3359   #if CYTHON_FAST_PYCCALL
3360   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
3361     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_s_L, __pyx_t_3};
3362     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
3363     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3364     __Pyx_GOTREF(__pyx_t_1);
3365     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3366   } else
3367   #endif
3368   {
3369     __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error)
3370     __Pyx_GOTREF(__pyx_t_5);
3371     if (__pyx_t_4) {
3372       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
3373     }
3374     __Pyx_INCREF(__pyx_n_s_L);
3375     __Pyx_GIVEREF(__pyx_n_s_L);
3376     PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_n_s_L);
3377     __Pyx_GIVEREF(__pyx_t_3);
3378     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_3);
3379     __pyx_t_3 = 0;
3380     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
3381     __Pyx_GOTREF(__pyx_t_1);
3382     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3383   }
3384   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3385   __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
3386   __Pyx_GOTREF(__pyx_t_2);
3387   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3388   __Pyx_DECREF_SET(__pyx_v_offset, __pyx_t_2);
3389   __pyx_t_2 = 0;
3390 
3391   /* "bx/arrays/array_tree.pyx":92
3392  *         offset = self.cdb_dict[key]
3393  *         offset = self.io.unpack( "L", offset.encode() )[0]
3394  *         self.io.seek( offset )             # <<<<<<<<<<<<<<
3395  *         return FileArrayTree( self.io.file, self.io.is_little_endian )
3396  *
3397  */
3398   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
3399   __Pyx_GOTREF(__pyx_t_1);
3400   __pyx_t_5 = NULL;
3401   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
3402     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
3403     if (likely(__pyx_t_5)) {
3404       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
3405       __Pyx_INCREF(__pyx_t_5);
3406       __Pyx_INCREF(function);
3407       __Pyx_DECREF_SET(__pyx_t_1, function);
3408     }
3409   }
3410   __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_offset) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_offset);
3411   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3412   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
3413   __Pyx_GOTREF(__pyx_t_2);
3414   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3415   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3416 
3417   /* "bx/arrays/array_tree.pyx":93
3418  *         offset = self.io.unpack( "L", offset.encode() )[0]
3419  *         self.io.seek( offset )
3420  *         return FileArrayTree( self.io.file, self.io.is_little_endian )             # <<<<<<<<<<<<<<
3421  *
3422  *     @classmethod
3423  */
3424   __Pyx_XDECREF(__pyx_r);
3425   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
3426   __Pyx_GOTREF(__pyx_t_2);
3427   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_is_little_endian); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
3428   __Pyx_GOTREF(__pyx_t_1);
3429   __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error)
3430   __Pyx_GOTREF(__pyx_t_5);
3431   __Pyx_GIVEREF(__pyx_t_2);
3432   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
3433   __Pyx_GIVEREF(__pyx_t_1);
3434   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
3435   __pyx_t_2 = 0;
3436   __pyx_t_1 = 0;
3437   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_FileArrayTree), __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
3438   __Pyx_GOTREF(__pyx_t_1);
3439   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3440   __pyx_r = __pyx_t_1;
3441   __pyx_t_1 = 0;
3442   goto __pyx_L0;
3443 
3444   /* "bx/arrays/array_tree.pyx":89
3445  *         assert (0 <= io.read_uint32() <= 1) # Check for version 0 or 1
3446  *         self.cdb_dict = FileCDBDict( file, is_little_endian=io.is_little_endian )
3447  *     def __getitem__( self, key ):             # <<<<<<<<<<<<<<
3448  *         offset = self.cdb_dict[key]
3449  *         offset = self.io.unpack( "L", offset.encode() )[0]
3450  */
3451 
3452   /* function exit code */
3453   __pyx_L1_error:;
3454   __Pyx_XDECREF(__pyx_t_1);
3455   __Pyx_XDECREF(__pyx_t_2);
3456   __Pyx_XDECREF(__pyx_t_3);
3457   __Pyx_XDECREF(__pyx_t_4);
3458   __Pyx_XDECREF(__pyx_t_5);
3459   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTreeDict.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3460   __pyx_r = NULL;
3461   __pyx_L0:;
3462   __Pyx_XDECREF(__pyx_v_offset);
3463   __Pyx_XGIVEREF(__pyx_r);
3464   __Pyx_RefNannyFinishContext();
3465   return __pyx_r;
3466 }
3467 
3468 /* "bx/arrays/array_tree.pyx":96
3469  *
3470  *     @classmethod
3471  *     def dict_to_file( Class, dict, file, is_little_endian=True, no_leaves=False ):             # <<<<<<<<<<<<<<
3472  *         """
3473  *         Writes a dictionary of array trees to a file that can then be
3474  */
3475 
3476 /* Python wrapper */
3477 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_5dict_to_file(PyObject *__pyx_v_Class, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3478 static char __pyx_doc_2bx_6arrays_10array_tree_17FileArrayTreeDict_4dict_to_file[] = "\n        Writes a dictionary of array trees to a file that can then be\n        read efficiently using this class.\n        ";
__pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_5dict_to_file(PyObject * __pyx_v_Class,PyObject * __pyx_args,PyObject * __pyx_kwds)3479 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_5dict_to_file(PyObject *__pyx_v_Class, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3480   PyObject *__pyx_v_dict = 0;
3481   PyObject *__pyx_v_file = 0;
3482   PyObject *__pyx_v_is_little_endian = 0;
3483   PyObject *__pyx_v_no_leaves = 0;
3484   int __pyx_lineno = 0;
3485   const char *__pyx_filename = NULL;
3486   int __pyx_clineno = 0;
3487   PyObject *__pyx_r = 0;
3488   __Pyx_RefNannyDeclarations
3489   __Pyx_RefNannySetupContext("dict_to_file (wrapper)", 0);
3490   {
3491     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dict,&__pyx_n_s_file,&__pyx_n_s_is_little_endian,&__pyx_n_s_no_leaves,0};
3492     PyObject* values[4] = {0,0,0,0};
3493     values[2] = ((PyObject *)Py_True);
3494     values[3] = ((PyObject *)Py_False);
3495     if (unlikely(__pyx_kwds)) {
3496       Py_ssize_t kw_args;
3497       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3498       switch (pos_args) {
3499         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3500         CYTHON_FALLTHROUGH;
3501         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3502         CYTHON_FALLTHROUGH;
3503         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3504         CYTHON_FALLTHROUGH;
3505         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3506         CYTHON_FALLTHROUGH;
3507         case  0: break;
3508         default: goto __pyx_L5_argtuple_error;
3509       }
3510       kw_args = PyDict_Size(__pyx_kwds);
3511       switch (pos_args) {
3512         case  0:
3513         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dict)) != 0)) kw_args--;
3514         else goto __pyx_L5_argtuple_error;
3515         CYTHON_FALLTHROUGH;
3516         case  1:
3517         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_file)) != 0)) kw_args--;
3518         else {
3519           __Pyx_RaiseArgtupleInvalid("dict_to_file", 0, 2, 4, 1); __PYX_ERR(0, 96, __pyx_L3_error)
3520         }
3521         CYTHON_FALLTHROUGH;
3522         case  2:
3523         if (kw_args > 0) {
3524           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_little_endian);
3525           if (value) { values[2] = value; kw_args--; }
3526         }
3527         CYTHON_FALLTHROUGH;
3528         case  3:
3529         if (kw_args > 0) {
3530           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_no_leaves);
3531           if (value) { values[3] = value; kw_args--; }
3532         }
3533       }
3534       if (unlikely(kw_args > 0)) {
3535         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dict_to_file") < 0)) __PYX_ERR(0, 96, __pyx_L3_error)
3536       }
3537     } else {
3538       switch (PyTuple_GET_SIZE(__pyx_args)) {
3539         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3540         CYTHON_FALLTHROUGH;
3541         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3542         CYTHON_FALLTHROUGH;
3543         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3544         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3545         break;
3546         default: goto __pyx_L5_argtuple_error;
3547       }
3548     }
3549     __pyx_v_dict = values[0];
3550     __pyx_v_file = values[1];
3551     __pyx_v_is_little_endian = values[2];
3552     __pyx_v_no_leaves = values[3];
3553   }
3554   goto __pyx_L4_argument_unpacking_done;
3555   __pyx_L5_argtuple_error:;
3556   __Pyx_RaiseArgtupleInvalid("dict_to_file", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 96, __pyx_L3_error)
3557   __pyx_L3_error:;
3558   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTreeDict.dict_to_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
3559   __Pyx_RefNannyFinishContext();
3560   return NULL;
3561   __pyx_L4_argument_unpacking_done:;
3562   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict_4dict_to_file(((PyTypeObject*)__pyx_v_Class), __pyx_v_dict, __pyx_v_file, __pyx_v_is_little_endian, __pyx_v_no_leaves);
3563 
3564   /* function exit code */
3565   __Pyx_RefNannyFinishContext();
3566   return __pyx_r;
3567 }
3568 
__pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict_4dict_to_file(CYTHON_UNUSED PyTypeObject * __pyx_v_Class,PyObject * __pyx_v_dict,PyObject * __pyx_v_file,PyObject * __pyx_v_is_little_endian,PyObject * __pyx_v_no_leaves)3569 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict_4dict_to_file(CYTHON_UNUSED PyTypeObject *__pyx_v_Class, PyObject *__pyx_v_dict, PyObject *__pyx_v_file, PyObject *__pyx_v_is_little_endian, PyObject *__pyx_v_no_leaves) {
3570   PyObject *__pyx_v_io = NULL;
3571   PyObject *__pyx_v_cdb_dict = NULL;
3572   PyObject *__pyx_v_key = NULL;
3573   PyObject *__pyx_v_cdb_offset = NULL;
3574   PyObject *__pyx_v_value = NULL;
3575   PyObject *__pyx_v_offset = NULL;
3576   PyObject *__pyx_r = NULL;
3577   __Pyx_RefNannyDeclarations
3578   PyObject *__pyx_t_1 = NULL;
3579   PyObject *__pyx_t_2 = NULL;
3580   PyObject *__pyx_t_3 = NULL;
3581   PyObject *__pyx_t_4 = NULL;
3582   Py_ssize_t __pyx_t_5;
3583   Py_ssize_t __pyx_t_6;
3584   int __pyx_t_7;
3585   int __pyx_t_8;
3586   PyObject *__pyx_t_9 = NULL;
3587   int __pyx_lineno = 0;
3588   const char *__pyx_filename = NULL;
3589   int __pyx_clineno = 0;
3590   __Pyx_RefNannySetupContext("dict_to_file", 0);
3591 
3592   /* "bx/arrays/array_tree.pyx":101
3593  *         read efficiently using this class.
3594  *         """
3595  *         io = BinaryFileWriter( file, is_little_endian=is_little_endian )             # <<<<<<<<<<<<<<
3596  *         # Write magic number and version
3597  *         io.write_uint32( MAGIC )
3598  */
3599   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BinaryFileWriter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
3600   __Pyx_GOTREF(__pyx_t_1);
3601   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
3602   __Pyx_GOTREF(__pyx_t_2);
3603   __Pyx_INCREF(__pyx_v_file);
3604   __Pyx_GIVEREF(__pyx_v_file);
3605   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_file);
3606   __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error)
3607   __Pyx_GOTREF(__pyx_t_3);
3608   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_little_endian, __pyx_v_is_little_endian) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
3609   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L1_error)
3610   __Pyx_GOTREF(__pyx_t_4);
3611   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3612   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3613   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3614   __pyx_v_io = __pyx_t_4;
3615   __pyx_t_4 = 0;
3616 
3617   /* "bx/arrays/array_tree.pyx":103
3618  *         io = BinaryFileWriter( file, is_little_endian=is_little_endian )
3619  *         # Write magic number and version
3620  *         io.write_uint32( MAGIC )             # <<<<<<<<<<<<<<
3621  *         io.write_uint32( VERSION )
3622  *         # Write cdb index with fake values just to fill space
3623  */
3624   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_write_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error)
3625   __Pyx_GOTREF(__pyx_t_3);
3626   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MAGIC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
3627   __Pyx_GOTREF(__pyx_t_2);
3628   __pyx_t_1 = NULL;
3629   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3630     __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
3631     if (likely(__pyx_t_1)) {
3632       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3633       __Pyx_INCREF(__pyx_t_1);
3634       __Pyx_INCREF(function);
3635       __Pyx_DECREF_SET(__pyx_t_3, function);
3636     }
3637   }
3638   __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
3639   __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3640   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3641   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error)
3642   __Pyx_GOTREF(__pyx_t_4);
3643   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3644   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3645 
3646   /* "bx/arrays/array_tree.pyx":104
3647  *         # Write magic number and version
3648  *         io.write_uint32( MAGIC )
3649  *         io.write_uint32( VERSION )             # <<<<<<<<<<<<<<
3650  *         # Write cdb index with fake values just to fill space
3651  *         cdb_dict = {}
3652  */
3653   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_write_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)
3654   __Pyx_GOTREF(__pyx_t_3);
3655   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_VERSION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
3656   __Pyx_GOTREF(__pyx_t_2);
3657   __pyx_t_1 = NULL;
3658   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3659     __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
3660     if (likely(__pyx_t_1)) {
3661       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3662       __Pyx_INCREF(__pyx_t_1);
3663       __Pyx_INCREF(function);
3664       __Pyx_DECREF_SET(__pyx_t_3, function);
3665     }
3666   }
3667   __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
3668   __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3669   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3670   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error)
3671   __Pyx_GOTREF(__pyx_t_4);
3672   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3673   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3674 
3675   /* "bx/arrays/array_tree.pyx":106
3676  *         io.write_uint32( VERSION )
3677  *         # Write cdb index with fake values just to fill space
3678  *         cdb_dict = {}             # <<<<<<<<<<<<<<
3679  *         for key in dict.iterkeys():
3680  *             cdb_dict[ key ] = io.pack( "L", 0 )
3681  */
3682   __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
3683   __Pyx_GOTREF(__pyx_t_4);
3684   __pyx_v_cdb_dict = ((PyObject*)__pyx_t_4);
3685   __pyx_t_4 = 0;
3686 
3687   /* "bx/arrays/array_tree.pyx":107
3688  *         # Write cdb index with fake values just to fill space
3689  *         cdb_dict = {}
3690  *         for key in dict.iterkeys():             # <<<<<<<<<<<<<<
3691  *             cdb_dict[ key ] = io.pack( "L", 0 )
3692  *         cdb_offset = io.tell()
3693  */
3694   __pyx_t_5 = 0;
3695   if (unlikely(__pyx_v_dict == Py_None)) {
3696     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iterkeys");
3697     __PYX_ERR(0, 107, __pyx_L1_error)
3698   }
3699   __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_dict, 0, __pyx_n_s_iterkeys, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error)
3700   __Pyx_GOTREF(__pyx_t_3);
3701   __Pyx_XDECREF(__pyx_t_4);
3702   __pyx_t_4 = __pyx_t_3;
3703   __pyx_t_3 = 0;
3704   while (1) {
3705     __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_6, &__pyx_t_5, &__pyx_t_3, NULL, NULL, __pyx_t_7);
3706     if (unlikely(__pyx_t_8 == 0)) break;
3707     if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 107, __pyx_L1_error)
3708     __Pyx_GOTREF(__pyx_t_3);
3709     __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
3710     __pyx_t_3 = 0;
3711 
3712     /* "bx/arrays/array_tree.pyx":108
3713  *         cdb_dict = {}
3714  *         for key in dict.iterkeys():
3715  *             cdb_dict[ key ] = io.pack( "L", 0 )             # <<<<<<<<<<<<<<
3716  *         cdb_offset = io.tell()
3717  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )
3718  */
3719     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_pack); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error)
3720     __Pyx_GOTREF(__pyx_t_3);
3721     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error)
3722     __Pyx_GOTREF(__pyx_t_2);
3723     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3724     if (unlikely(PyDict_SetItem(__pyx_v_cdb_dict, __pyx_v_key, __pyx_t_2) < 0)) __PYX_ERR(0, 108, __pyx_L1_error)
3725     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3726   }
3727   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3728 
3729   /* "bx/arrays/array_tree.pyx":109
3730  *         for key in dict.iterkeys():
3731  *             cdb_dict[ key ] = io.pack( "L", 0 )
3732  *         cdb_offset = io.tell()             # <<<<<<<<<<<<<<
3733  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )
3734  *         # Write each tree and save offset
3735  */
3736   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_tell); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
3737   __Pyx_GOTREF(__pyx_t_2);
3738   __pyx_t_3 = NULL;
3739   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3740     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3741     if (likely(__pyx_t_3)) {
3742       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3743       __Pyx_INCREF(__pyx_t_3);
3744       __Pyx_INCREF(function);
3745       __Pyx_DECREF_SET(__pyx_t_2, function);
3746     }
3747   }
3748   __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
3749   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3750   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error)
3751   __Pyx_GOTREF(__pyx_t_4);
3752   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3753   __pyx_v_cdb_offset = __pyx_t_4;
3754   __pyx_t_4 = 0;
3755 
3756   /* "bx/arrays/array_tree.pyx":110
3757  *             cdb_dict[ key ] = io.pack( "L", 0 )
3758  *         cdb_offset = io.tell()
3759  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )             # <<<<<<<<<<<<<<
3760  *         # Write each tree and save offset
3761  *         for key, value in dict.iteritems():
3762  */
3763   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FileCDBDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error)
3764   __Pyx_GOTREF(__pyx_t_4);
3765   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_to_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
3766   __Pyx_GOTREF(__pyx_t_2);
3767   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3768   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error)
3769   __Pyx_GOTREF(__pyx_t_4);
3770   __Pyx_INCREF(__pyx_v_cdb_dict);
3771   __Pyx_GIVEREF(__pyx_v_cdb_dict);
3772   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_cdb_dict);
3773   __Pyx_INCREF(__pyx_v_file);
3774   __Pyx_GIVEREF(__pyx_v_file);
3775   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_file);
3776   __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error)
3777   __Pyx_GOTREF(__pyx_t_3);
3778   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_little_endian, __pyx_v_is_little_endian) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
3779   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
3780   __Pyx_GOTREF(__pyx_t_1);
3781   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3782   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3783   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3784   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3785 
3786   /* "bx/arrays/array_tree.pyx":112
3787  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )
3788  *         # Write each tree and save offset
3789  *         for key, value in dict.iteritems():             # <<<<<<<<<<<<<<
3790  *             offset = io.tell()
3791  *             cdb_dict[ key ] = io.pack( "L", offset )
3792  */
3793   __pyx_t_6 = 0;
3794   if (unlikely(__pyx_v_dict == Py_None)) {
3795     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
3796     __PYX_ERR(0, 112, __pyx_L1_error)
3797   }
3798   __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_dict, 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error)
3799   __Pyx_GOTREF(__pyx_t_3);
3800   __Pyx_XDECREF(__pyx_t_1);
3801   __pyx_t_1 = __pyx_t_3;
3802   __pyx_t_3 = 0;
3803   while (1) {
3804     __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_5, &__pyx_t_6, &__pyx_t_3, &__pyx_t_4, NULL, __pyx_t_7);
3805     if (unlikely(__pyx_t_8 == 0)) break;
3806     if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 112, __pyx_L1_error)
3807     __Pyx_GOTREF(__pyx_t_3);
3808     __Pyx_GOTREF(__pyx_t_4);
3809     __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
3810     __pyx_t_3 = 0;
3811     __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4);
3812     __pyx_t_4 = 0;
3813 
3814     /* "bx/arrays/array_tree.pyx":113
3815  *         # Write each tree and save offset
3816  *         for key, value in dict.iteritems():
3817  *             offset = io.tell()             # <<<<<<<<<<<<<<
3818  *             cdb_dict[ key ] = io.pack( "L", offset )
3819  *             value.to_file( file, is_little_endian=is_little_endian, no_leaves=no_leaves )
3820  */
3821     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_tell); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
3822     __Pyx_GOTREF(__pyx_t_3);
3823     __pyx_t_2 = NULL;
3824     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3825       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3826       if (likely(__pyx_t_2)) {
3827         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3828         __Pyx_INCREF(__pyx_t_2);
3829         __Pyx_INCREF(function);
3830         __Pyx_DECREF_SET(__pyx_t_3, function);
3831       }
3832     }
3833     __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3834     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3835     if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
3836     __Pyx_GOTREF(__pyx_t_4);
3837     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3838     __Pyx_XDECREF_SET(__pyx_v_offset, __pyx_t_4);
3839     __pyx_t_4 = 0;
3840 
3841     /* "bx/arrays/array_tree.pyx":114
3842  *         for key, value in dict.iteritems():
3843  *             offset = io.tell()
3844  *             cdb_dict[ key ] = io.pack( "L", offset )             # <<<<<<<<<<<<<<
3845  *             value.to_file( file, is_little_endian=is_little_endian, no_leaves=no_leaves )
3846  *         # Go back and write the index again
3847  */
3848     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_pack); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error)
3849     __Pyx_GOTREF(__pyx_t_3);
3850     __pyx_t_2 = NULL;
3851     __pyx_t_8 = 0;
3852     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3853       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3854       if (likely(__pyx_t_2)) {
3855         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3856         __Pyx_INCREF(__pyx_t_2);
3857         __Pyx_INCREF(function);
3858         __Pyx_DECREF_SET(__pyx_t_3, function);
3859         __pyx_t_8 = 1;
3860       }
3861     }
3862     #if CYTHON_FAST_PYCALL
3863     if (PyFunction_Check(__pyx_t_3)) {
3864       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_n_s_L, __pyx_v_offset};
3865       __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
3866       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3867       __Pyx_GOTREF(__pyx_t_4);
3868     } else
3869     #endif
3870     #if CYTHON_FAST_PYCCALL
3871     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3872       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_n_s_L, __pyx_v_offset};
3873       __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
3874       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3875       __Pyx_GOTREF(__pyx_t_4);
3876     } else
3877     #endif
3878     {
3879       __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 114, __pyx_L1_error)
3880       __Pyx_GOTREF(__pyx_t_9);
3881       if (__pyx_t_2) {
3882         __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
3883       }
3884       __Pyx_INCREF(__pyx_n_s_L);
3885       __Pyx_GIVEREF(__pyx_n_s_L);
3886       PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_s_L);
3887       __Pyx_INCREF(__pyx_v_offset);
3888       __Pyx_GIVEREF(__pyx_v_offset);
3889       PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_offset);
3890       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
3891       __Pyx_GOTREF(__pyx_t_4);
3892       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3893     }
3894     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3895     if (unlikely(PyDict_SetItem(__pyx_v_cdb_dict, __pyx_v_key, __pyx_t_4) < 0)) __PYX_ERR(0, 114, __pyx_L1_error)
3896     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3897 
3898     /* "bx/arrays/array_tree.pyx":115
3899  *             offset = io.tell()
3900  *             cdb_dict[ key ] = io.pack( "L", offset )
3901  *             value.to_file( file, is_little_endian=is_little_endian, no_leaves=no_leaves )             # <<<<<<<<<<<<<<
3902  *         # Go back and write the index again
3903  *         io.seek( cdb_offset )
3904  */
3905     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_to_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error)
3906     __Pyx_GOTREF(__pyx_t_4);
3907     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error)
3908     __Pyx_GOTREF(__pyx_t_3);
3909     __Pyx_INCREF(__pyx_v_file);
3910     __Pyx_GIVEREF(__pyx_v_file);
3911     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_file);
3912     __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 115, __pyx_L1_error)
3913     __Pyx_GOTREF(__pyx_t_9);
3914     if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_is_little_endian, __pyx_v_is_little_endian) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
3915     if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_no_leaves, __pyx_v_no_leaves) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
3916     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
3917     __Pyx_GOTREF(__pyx_t_2);
3918     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3919     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3920     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3921     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3922   }
3923   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3924 
3925   /* "bx/arrays/array_tree.pyx":117
3926  *             value.to_file( file, is_little_endian=is_little_endian, no_leaves=no_leaves )
3927  *         # Go back and write the index again
3928  *         io.seek( cdb_offset )             # <<<<<<<<<<<<<<
3929  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )
3930  *
3931  */
3932   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_seek); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
3933   __Pyx_GOTREF(__pyx_t_2);
3934   __pyx_t_9 = NULL;
3935   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3936     __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
3937     if (likely(__pyx_t_9)) {
3938       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3939       __Pyx_INCREF(__pyx_t_9);
3940       __Pyx_INCREF(function);
3941       __Pyx_DECREF_SET(__pyx_t_2, function);
3942     }
3943   }
3944   __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_v_cdb_offset) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_cdb_offset);
3945   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3946   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
3947   __Pyx_GOTREF(__pyx_t_1);
3948   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3949   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3950 
3951   /* "bx/arrays/array_tree.pyx":118
3952  *         # Go back and write the index again
3953  *         io.seek( cdb_offset )
3954  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )             # <<<<<<<<<<<<<<
3955  *
3956  * cdef class FileArrayTree:
3957  */
3958   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FileCDBDict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
3959   __Pyx_GOTREF(__pyx_t_1);
3960   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
3961   __Pyx_GOTREF(__pyx_t_2);
3962   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3963   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
3964   __Pyx_GOTREF(__pyx_t_1);
3965   __Pyx_INCREF(__pyx_v_cdb_dict);
3966   __Pyx_GIVEREF(__pyx_v_cdb_dict);
3967   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cdb_dict);
3968   __Pyx_INCREF(__pyx_v_file);
3969   __Pyx_GIVEREF(__pyx_v_file);
3970   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_file);
3971   __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 118, __pyx_L1_error)
3972   __Pyx_GOTREF(__pyx_t_9);
3973   if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_is_little_endian, __pyx_v_is_little_endian) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
3974   __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error)
3975   __Pyx_GOTREF(__pyx_t_3);
3976   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3977   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3978   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3979   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3980 
3981   /* "bx/arrays/array_tree.pyx":96
3982  *
3983  *     @classmethod
3984  *     def dict_to_file( Class, dict, file, is_little_endian=True, no_leaves=False ):             # <<<<<<<<<<<<<<
3985  *         """
3986  *         Writes a dictionary of array trees to a file that can then be
3987  */
3988 
3989   /* function exit code */
3990   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3991   goto __pyx_L0;
3992   __pyx_L1_error:;
3993   __Pyx_XDECREF(__pyx_t_1);
3994   __Pyx_XDECREF(__pyx_t_2);
3995   __Pyx_XDECREF(__pyx_t_3);
3996   __Pyx_XDECREF(__pyx_t_4);
3997   __Pyx_XDECREF(__pyx_t_9);
3998   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTreeDict.dict_to_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
3999   __pyx_r = NULL;
4000   __pyx_L0:;
4001   __Pyx_XDECREF(__pyx_v_io);
4002   __Pyx_XDECREF(__pyx_v_cdb_dict);
4003   __Pyx_XDECREF(__pyx_v_key);
4004   __Pyx_XDECREF(__pyx_v_cdb_offset);
4005   __Pyx_XDECREF(__pyx_v_value);
4006   __Pyx_XDECREF(__pyx_v_offset);
4007   __Pyx_XGIVEREF(__pyx_r);
4008   __Pyx_RefNannyFinishContext();
4009   return __pyx_r;
4010 }
4011 
4012 /* "(tree fragment)":1
4013  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
4014  *     cdef tuple state
4015  *     cdef object _dict
4016  */
4017 
4018 /* Python wrapper */
4019 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_7__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)4020 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4021   PyObject *__pyx_r = 0;
4022   __Pyx_RefNannyDeclarations
4023   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4024   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict_6__reduce_cython__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)__pyx_v_self));
4025 
4026   /* function exit code */
4027   __Pyx_RefNannyFinishContext();
4028   return __pyx_r;
4029 }
4030 
__pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict_6__reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict * __pyx_v_self)4031 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict_6__reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *__pyx_v_self) {
4032   PyObject *__pyx_v_state = 0;
4033   PyObject *__pyx_v__dict = 0;
4034   int __pyx_v_use_setstate;
4035   PyObject *__pyx_r = NULL;
4036   __Pyx_RefNannyDeclarations
4037   PyObject *__pyx_t_1 = NULL;
4038   int __pyx_t_2;
4039   int __pyx_t_3;
4040   PyObject *__pyx_t_4 = NULL;
4041   int __pyx_t_5;
4042   PyObject *__pyx_t_6 = NULL;
4043   int __pyx_lineno = 0;
4044   const char *__pyx_filename = NULL;
4045   int __pyx_clineno = 0;
4046   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4047 
4048   /* "(tree fragment)":5
4049  *     cdef object _dict
4050  *     cdef bint use_setstate
4051  *     state = (self.cdb_dict, self.io)             # <<<<<<<<<<<<<<
4052  *     _dict = getattr(self, '__dict__', None)
4053  *     if _dict is not None:
4054  */
4055   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
4056   __Pyx_GOTREF(__pyx_t_1);
4057   __Pyx_INCREF(__pyx_v_self->cdb_dict);
4058   __Pyx_GIVEREF(__pyx_v_self->cdb_dict);
4059   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->cdb_dict);
4060   __Pyx_INCREF(__pyx_v_self->io);
4061   __Pyx_GIVEREF(__pyx_v_self->io);
4062   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->io);
4063   __pyx_v_state = ((PyObject*)__pyx_t_1);
4064   __pyx_t_1 = 0;
4065 
4066   /* "(tree fragment)":6
4067  *     cdef bint use_setstate
4068  *     state = (self.cdb_dict, self.io)
4069  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
4070  *     if _dict is not None:
4071  *         state += (_dict,)
4072  */
4073   __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
4074   __Pyx_GOTREF(__pyx_t_1);
4075   __pyx_v__dict = __pyx_t_1;
4076   __pyx_t_1 = 0;
4077 
4078   /* "(tree fragment)":7
4079  *     state = (self.cdb_dict, self.io)
4080  *     _dict = getattr(self, '__dict__', None)
4081  *     if _dict is not None:             # <<<<<<<<<<<<<<
4082  *         state += (_dict,)
4083  *         use_setstate = True
4084  */
4085   __pyx_t_2 = (__pyx_v__dict != Py_None);
4086   __pyx_t_3 = (__pyx_t_2 != 0);
4087   if (__pyx_t_3) {
4088 
4089     /* "(tree fragment)":8
4090  *     _dict = getattr(self, '__dict__', None)
4091  *     if _dict is not None:
4092  *         state += (_dict,)             # <<<<<<<<<<<<<<
4093  *         use_setstate = True
4094  *     else:
4095  */
4096     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
4097     __Pyx_GOTREF(__pyx_t_1);
4098     __Pyx_INCREF(__pyx_v__dict);
4099     __Pyx_GIVEREF(__pyx_v__dict);
4100     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
4101     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
4102     __Pyx_GOTREF(__pyx_t_4);
4103     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4104     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
4105     __pyx_t_4 = 0;
4106 
4107     /* "(tree fragment)":9
4108  *     if _dict is not None:
4109  *         state += (_dict,)
4110  *         use_setstate = True             # <<<<<<<<<<<<<<
4111  *     else:
4112  *         use_setstate = self.cdb_dict is not None or self.io is not None
4113  */
4114     __pyx_v_use_setstate = 1;
4115 
4116     /* "(tree fragment)":7
4117  *     state = (self.cdb_dict, self.io)
4118  *     _dict = getattr(self, '__dict__', None)
4119  *     if _dict is not None:             # <<<<<<<<<<<<<<
4120  *         state += (_dict,)
4121  *         use_setstate = True
4122  */
4123     goto __pyx_L3;
4124   }
4125 
4126   /* "(tree fragment)":11
4127  *         use_setstate = True
4128  *     else:
4129  *         use_setstate = self.cdb_dict is not None or self.io is not None             # <<<<<<<<<<<<<<
4130  *     if use_setstate:
4131  *         return __pyx_unpickle_FileArrayTreeDict, (type(self), 0xcf117d0, None), state
4132  */
4133   /*else*/ {
4134     __pyx_t_2 = (__pyx_v_self->cdb_dict != Py_None);
4135     __pyx_t_5 = (__pyx_t_2 != 0);
4136     if (!__pyx_t_5) {
4137     } else {
4138       __pyx_t_3 = __pyx_t_5;
4139       goto __pyx_L4_bool_binop_done;
4140     }
4141     __pyx_t_5 = (__pyx_v_self->io != Py_None);
4142     __pyx_t_2 = (__pyx_t_5 != 0);
4143     __pyx_t_3 = __pyx_t_2;
4144     __pyx_L4_bool_binop_done:;
4145     __pyx_v_use_setstate = __pyx_t_3;
4146   }
4147   __pyx_L3:;
4148 
4149   /* "(tree fragment)":12
4150  *     else:
4151  *         use_setstate = self.cdb_dict is not None or self.io is not None
4152  *     if use_setstate:             # <<<<<<<<<<<<<<
4153  *         return __pyx_unpickle_FileArrayTreeDict, (type(self), 0xcf117d0, None), state
4154  *     else:
4155  */
4156   __pyx_t_3 = (__pyx_v_use_setstate != 0);
4157   if (__pyx_t_3) {
4158 
4159     /* "(tree fragment)":13
4160  *         use_setstate = self.cdb_dict is not None or self.io is not None
4161  *     if use_setstate:
4162  *         return __pyx_unpickle_FileArrayTreeDict, (type(self), 0xcf117d0, None), state             # <<<<<<<<<<<<<<
4163  *     else:
4164  *         return __pyx_unpickle_FileArrayTreeDict, (type(self), 0xcf117d0, state)
4165  */
4166     __Pyx_XDECREF(__pyx_r);
4167     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_FileArrayTreeDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
4168     __Pyx_GOTREF(__pyx_t_4);
4169     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
4170     __Pyx_GOTREF(__pyx_t_1);
4171     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4172     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4173     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4174     __Pyx_INCREF(__pyx_int_217126864);
4175     __Pyx_GIVEREF(__pyx_int_217126864);
4176     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_217126864);
4177     __Pyx_INCREF(Py_None);
4178     __Pyx_GIVEREF(Py_None);
4179     PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
4180     __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
4181     __Pyx_GOTREF(__pyx_t_6);
4182     __Pyx_GIVEREF(__pyx_t_4);
4183     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
4184     __Pyx_GIVEREF(__pyx_t_1);
4185     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
4186     __Pyx_INCREF(__pyx_v_state);
4187     __Pyx_GIVEREF(__pyx_v_state);
4188     PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
4189     __pyx_t_4 = 0;
4190     __pyx_t_1 = 0;
4191     __pyx_r = __pyx_t_6;
4192     __pyx_t_6 = 0;
4193     goto __pyx_L0;
4194 
4195     /* "(tree fragment)":12
4196  *     else:
4197  *         use_setstate = self.cdb_dict is not None or self.io is not None
4198  *     if use_setstate:             # <<<<<<<<<<<<<<
4199  *         return __pyx_unpickle_FileArrayTreeDict, (type(self), 0xcf117d0, None), state
4200  *     else:
4201  */
4202   }
4203 
4204   /* "(tree fragment)":15
4205  *         return __pyx_unpickle_FileArrayTreeDict, (type(self), 0xcf117d0, None), state
4206  *     else:
4207  *         return __pyx_unpickle_FileArrayTreeDict, (type(self), 0xcf117d0, state)             # <<<<<<<<<<<<<<
4208  * def __setstate_cython__(self, __pyx_state):
4209  *     __pyx_unpickle_FileArrayTreeDict__set_state(self, __pyx_state)
4210  */
4211   /*else*/ {
4212     __Pyx_XDECREF(__pyx_r);
4213     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_FileArrayTreeDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
4214     __Pyx_GOTREF(__pyx_t_6);
4215     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
4216     __Pyx_GOTREF(__pyx_t_1);
4217     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4218     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4219     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4220     __Pyx_INCREF(__pyx_int_217126864);
4221     __Pyx_GIVEREF(__pyx_int_217126864);
4222     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_217126864);
4223     __Pyx_INCREF(__pyx_v_state);
4224     __Pyx_GIVEREF(__pyx_v_state);
4225     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
4226     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
4227     __Pyx_GOTREF(__pyx_t_4);
4228     __Pyx_GIVEREF(__pyx_t_6);
4229     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
4230     __Pyx_GIVEREF(__pyx_t_1);
4231     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
4232     __pyx_t_6 = 0;
4233     __pyx_t_1 = 0;
4234     __pyx_r = __pyx_t_4;
4235     __pyx_t_4 = 0;
4236     goto __pyx_L0;
4237   }
4238 
4239   /* "(tree fragment)":1
4240  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
4241  *     cdef tuple state
4242  *     cdef object _dict
4243  */
4244 
4245   /* function exit code */
4246   __pyx_L1_error:;
4247   __Pyx_XDECREF(__pyx_t_1);
4248   __Pyx_XDECREF(__pyx_t_4);
4249   __Pyx_XDECREF(__pyx_t_6);
4250   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTreeDict.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4251   __pyx_r = NULL;
4252   __pyx_L0:;
4253   __Pyx_XDECREF(__pyx_v_state);
4254   __Pyx_XDECREF(__pyx_v__dict);
4255   __Pyx_XGIVEREF(__pyx_r);
4256   __Pyx_RefNannyFinishContext();
4257   return __pyx_r;
4258 }
4259 
4260 /* "(tree fragment)":16
4261  *     else:
4262  *         return __pyx_unpickle_FileArrayTreeDict, (type(self), 0xcf117d0, state)
4263  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
4264  *     __pyx_unpickle_FileArrayTreeDict__set_state(self, __pyx_state)
4265  */
4266 
4267 /* Python wrapper */
4268 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_9__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)4269 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4270   PyObject *__pyx_r = 0;
4271   __Pyx_RefNannyDeclarations
4272   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4273   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict_8__setstate_cython__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4274 
4275   /* function exit code */
4276   __Pyx_RefNannyFinishContext();
4277   return __pyx_r;
4278 }
4279 
__pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict_8__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict * __pyx_v_self,PyObject * __pyx_v___pyx_state)4280 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_17FileArrayTreeDict_8__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4281   PyObject *__pyx_r = NULL;
4282   __Pyx_RefNannyDeclarations
4283   PyObject *__pyx_t_1 = NULL;
4284   int __pyx_lineno = 0;
4285   const char *__pyx_filename = NULL;
4286   int __pyx_clineno = 0;
4287   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4288 
4289   /* "(tree fragment)":17
4290  *         return __pyx_unpickle_FileArrayTreeDict, (type(self), 0xcf117d0, state)
4291  * def __setstate_cython__(self, __pyx_state):
4292  *     __pyx_unpickle_FileArrayTreeDict__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
4293  */
4294   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
4295   __pyx_t_1 = __pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_FileArrayTreeDict__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
4296   __Pyx_GOTREF(__pyx_t_1);
4297   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4298 
4299   /* "(tree fragment)":16
4300  *     else:
4301  *         return __pyx_unpickle_FileArrayTreeDict, (type(self), 0xcf117d0, state)
4302  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
4303  *     __pyx_unpickle_FileArrayTreeDict__set_state(self, __pyx_state)
4304  */
4305 
4306   /* function exit code */
4307   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4308   goto __pyx_L0;
4309   __pyx_L1_error:;
4310   __Pyx_XDECREF(__pyx_t_1);
4311   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTreeDict.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4312   __pyx_r = NULL;
4313   __pyx_L0:;
4314   __Pyx_XGIVEREF(__pyx_r);
4315   __Pyx_RefNannyFinishContext();
4316   return __pyx_r;
4317 }
4318 
4319 /* "bx/arrays/array_tree.pyx":132
4320  *     cdef object io
4321  *
4322  *     def __init__( self, file, is_little_endian=True ):             # <<<<<<<<<<<<<<
4323  *         self.io = BinaryFileReader( file, is_little_endian=is_little_endian )
4324  *         self.offset = self.io.tell()
4325  */
4326 
4327 /* Python wrapper */
4328 static int __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4329 static int __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4330   PyObject *__pyx_v_file = 0;
4331   PyObject *__pyx_v_is_little_endian = 0;
4332   int __pyx_lineno = 0;
4333   const char *__pyx_filename = NULL;
4334   int __pyx_clineno = 0;
4335   int __pyx_r;
4336   __Pyx_RefNannyDeclarations
4337   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4338   {
4339     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file,&__pyx_n_s_is_little_endian,0};
4340     PyObject* values[2] = {0,0};
4341     values[1] = ((PyObject *)Py_True);
4342     if (unlikely(__pyx_kwds)) {
4343       Py_ssize_t kw_args;
4344       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4345       switch (pos_args) {
4346         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4347         CYTHON_FALLTHROUGH;
4348         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4349         CYTHON_FALLTHROUGH;
4350         case  0: break;
4351         default: goto __pyx_L5_argtuple_error;
4352       }
4353       kw_args = PyDict_Size(__pyx_kwds);
4354       switch (pos_args) {
4355         case  0:
4356         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_file)) != 0)) kw_args--;
4357         else goto __pyx_L5_argtuple_error;
4358         CYTHON_FALLTHROUGH;
4359         case  1:
4360         if (kw_args > 0) {
4361           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_little_endian);
4362           if (value) { values[1] = value; kw_args--; }
4363         }
4364       }
4365       if (unlikely(kw_args > 0)) {
4366         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 132, __pyx_L3_error)
4367       }
4368     } else {
4369       switch (PyTuple_GET_SIZE(__pyx_args)) {
4370         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4371         CYTHON_FALLTHROUGH;
4372         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4373         break;
4374         default: goto __pyx_L5_argtuple_error;
4375       }
4376     }
4377     __pyx_v_file = values[0];
4378     __pyx_v_is_little_endian = values[1];
4379   }
4380   goto __pyx_L4_argument_unpacking_done;
4381   __pyx_L5_argtuple_error:;
4382   __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 132, __pyx_L3_error)
4383   __pyx_L3_error:;
4384   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4385   __Pyx_RefNannyFinishContext();
4386   return -1;
4387   __pyx_L4_argument_unpacking_done:;
4388   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree___init__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self), __pyx_v_file, __pyx_v_is_little_endian);
4389 
4390   /* function exit code */
4391   __Pyx_RefNannyFinishContext();
4392   return __pyx_r;
4393 }
4394 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree___init__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self,PyObject * __pyx_v_file,PyObject * __pyx_v_is_little_endian)4395 static int __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree___init__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_file, PyObject *__pyx_v_is_little_endian) {
4396   PyObject *__pyx_v_dt = NULL;
4397   int __pyx_r;
4398   __Pyx_RefNannyDeclarations
4399   PyObject *__pyx_t_1 = NULL;
4400   PyObject *__pyx_t_2 = NULL;
4401   PyObject *__pyx_t_3 = NULL;
4402   PyObject *__pyx_t_4 = NULL;
4403   int __pyx_t_5;
4404   int __pyx_t_6;
4405   int __pyx_lineno = 0;
4406   const char *__pyx_filename = NULL;
4407   int __pyx_clineno = 0;
4408   __Pyx_RefNannySetupContext("__init__", 0);
4409 
4410   /* "bx/arrays/array_tree.pyx":133
4411  *
4412  *     def __init__( self, file, is_little_endian=True ):
4413  *         self.io = BinaryFileReader( file, is_little_endian=is_little_endian )             # <<<<<<<<<<<<<<
4414  *         self.offset = self.io.tell()
4415  *         # Read basic info about the tree
4416  */
4417   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BinaryFileReader); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
4418   __Pyx_GOTREF(__pyx_t_1);
4419   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
4420   __Pyx_GOTREF(__pyx_t_2);
4421   __Pyx_INCREF(__pyx_v_file);
4422   __Pyx_GIVEREF(__pyx_v_file);
4423   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_file);
4424   __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
4425   __Pyx_GOTREF(__pyx_t_3);
4426   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_little_endian, __pyx_v_is_little_endian) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
4427   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
4428   __Pyx_GOTREF(__pyx_t_4);
4429   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4430   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4431   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4432   __Pyx_GIVEREF(__pyx_t_4);
4433   __Pyx_GOTREF(__pyx_v_self->io);
4434   __Pyx_DECREF(__pyx_v_self->io);
4435   __pyx_v_self->io = __pyx_t_4;
4436   __pyx_t_4 = 0;
4437 
4438   /* "bx/arrays/array_tree.pyx":134
4439  *     def __init__( self, file, is_little_endian=True ):
4440  *         self.io = BinaryFileReader( file, is_little_endian=is_little_endian )
4441  *         self.offset = self.io.tell()             # <<<<<<<<<<<<<<
4442  *         # Read basic info about the tree
4443  *         self.max = self.io.read_uint32()
4444  */
4445   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_tell); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error)
4446   __Pyx_GOTREF(__pyx_t_3);
4447   __pyx_t_2 = NULL;
4448   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4449     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4450     if (likely(__pyx_t_2)) {
4451       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4452       __Pyx_INCREF(__pyx_t_2);
4453       __Pyx_INCREF(function);
4454       __Pyx_DECREF_SET(__pyx_t_3, function);
4455     }
4456   }
4457   __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4458   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4459   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
4460   __Pyx_GOTREF(__pyx_t_4);
4461   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4462   __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error)
4463   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4464   __pyx_v_self->offset = __pyx_t_5;
4465 
4466   /* "bx/arrays/array_tree.pyx":136
4467  *         self.offset = self.io.tell()
4468  *         # Read basic info about the tree
4469  *         self.max = self.io.read_uint32()             # <<<<<<<<<<<<<<
4470  *         self.block_size = self.io.read_uint32()
4471  *         # Read dtype and canonicalize
4472  */
4473   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_read_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
4474   __Pyx_GOTREF(__pyx_t_3);
4475   __pyx_t_2 = NULL;
4476   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4477     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4478     if (likely(__pyx_t_2)) {
4479       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4480       __Pyx_INCREF(__pyx_t_2);
4481       __Pyx_INCREF(function);
4482       __Pyx_DECREF_SET(__pyx_t_3, function);
4483     }
4484   }
4485   __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4486   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4487   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
4488   __Pyx_GOTREF(__pyx_t_4);
4489   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4490   __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
4491   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4492   __pyx_v_self->max = __pyx_t_5;
4493 
4494   /* "bx/arrays/array_tree.pyx":137
4495  *         # Read basic info about the tree
4496  *         self.max = self.io.read_uint32()
4497  *         self.block_size = self.io.read_uint32()             # <<<<<<<<<<<<<<
4498  *         # Read dtype and canonicalize
4499  *         dt = self.io.read( 1 )
4500  */
4501   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_read_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error)
4502   __Pyx_GOTREF(__pyx_t_3);
4503   __pyx_t_2 = NULL;
4504   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4505     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4506     if (likely(__pyx_t_2)) {
4507       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4508       __Pyx_INCREF(__pyx_t_2);
4509       __Pyx_INCREF(function);
4510       __Pyx_DECREF_SET(__pyx_t_3, function);
4511     }
4512   }
4513   __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4514   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4515   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error)
4516   __Pyx_GOTREF(__pyx_t_4);
4517   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4518   __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L1_error)
4519   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4520   __pyx_v_self->block_size = __pyx_t_5;
4521 
4522   /* "bx/arrays/array_tree.pyx":139
4523  *         self.block_size = self.io.read_uint32()
4524  *         # Read dtype and canonicalize
4525  *         dt = self.io.read( 1 )             # <<<<<<<<<<<<<<
4526  *         self.dtype = numpy.dtype( dt )
4527  *         self.io.skip( 3 )
4528  */
4529   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
4530   __Pyx_GOTREF(__pyx_t_3);
4531   __pyx_t_2 = NULL;
4532   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4533     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4534     if (likely(__pyx_t_2)) {
4535       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4536       __Pyx_INCREF(__pyx_t_2);
4537       __Pyx_INCREF(function);
4538       __Pyx_DECREF_SET(__pyx_t_3, function);
4539     }
4540   }
4541   __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_1);
4542   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4543   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
4544   __Pyx_GOTREF(__pyx_t_4);
4545   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4546   __pyx_v_dt = __pyx_t_4;
4547   __pyx_t_4 = 0;
4548 
4549   /* "bx/arrays/array_tree.pyx":140
4550  *         # Read dtype and canonicalize
4551  *         dt = self.io.read( 1 )
4552  *         self.dtype = numpy.dtype( dt )             # <<<<<<<<<<<<<<
4553  *         self.io.skip( 3 )
4554  *         # How many levels are needed to cover the entire range?
4555  */
4556   __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_v_dt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error)
4557   __Pyx_GOTREF(__pyx_t_4);
4558   __Pyx_GIVEREF(__pyx_t_4);
4559   __Pyx_GOTREF(__pyx_v_self->dtype);
4560   __Pyx_DECREF(__pyx_v_self->dtype);
4561   __pyx_v_self->dtype = __pyx_t_4;
4562   __pyx_t_4 = 0;
4563 
4564   /* "bx/arrays/array_tree.pyx":141
4565  *         dt = self.io.read( 1 )
4566  *         self.dtype = numpy.dtype( dt )
4567  *         self.io.skip( 3 )             # <<<<<<<<<<<<<<
4568  *         # How many levels are needed to cover the entire range?
4569  *         self.levels = 0
4570  */
4571   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_skip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
4572   __Pyx_GOTREF(__pyx_t_3);
4573   __pyx_t_2 = NULL;
4574   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4575     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4576     if (likely(__pyx_t_2)) {
4577       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4578       __Pyx_INCREF(__pyx_t_2);
4579       __Pyx_INCREF(function);
4580       __Pyx_DECREF_SET(__pyx_t_3, function);
4581     }
4582   }
4583   __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
4584   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4585   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error)
4586   __Pyx_GOTREF(__pyx_t_4);
4587   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4588   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4589 
4590   /* "bx/arrays/array_tree.pyx":143
4591  *         self.io.skip( 3 )
4592  *         # How many levels are needed to cover the entire range?
4593  *         self.levels = 0             # <<<<<<<<<<<<<<
4594  *         while ( <long long> self.block_size ) ** ( self.levels + 1 ) < self.max:
4595  *             self.levels += 1
4596  */
4597   __pyx_v_self->levels = 0;
4598 
4599   /* "bx/arrays/array_tree.pyx":144
4600  *         # How many levels are needed to cover the entire range?
4601  *         self.levels = 0
4602  *         while ( <long long> self.block_size ) ** ( self.levels + 1 ) < self.max:             # <<<<<<<<<<<<<<
4603  *             self.levels += 1
4604  *         # Not yet dealing with the case where the root is a Leaf
4605  */
4606   while (1) {
4607     __pyx_t_6 = ((__Pyx_pow_PY_LONG_LONG(((PY_LONG_LONG)__pyx_v_self->block_size), ((PY_LONG_LONG)(__pyx_v_self->levels + 1))) < __pyx_v_self->max) != 0);
4608     if (!__pyx_t_6) break;
4609 
4610     /* "bx/arrays/array_tree.pyx":145
4611  *         self.levels = 0
4612  *         while ( <long long> self.block_size ) ** ( self.levels + 1 ) < self.max:
4613  *             self.levels += 1             # <<<<<<<<<<<<<<
4614  *         # Not yet dealing with the case where the root is a Leaf
4615  *         assert self.levels > 0, "max < block_size not yet handled"
4616  */
4617     __pyx_v_self->levels = (__pyx_v_self->levels + 1);
4618   }
4619 
4620   /* "bx/arrays/array_tree.pyx":147
4621  *             self.levels += 1
4622  *         # Not yet dealing with the case where the root is a Leaf
4623  *         assert self.levels > 0, "max < block_size not yet handled"             # <<<<<<<<<<<<<<
4624  *         # Save offset of root
4625  *         self.root_offset = self.io.tell()
4626  */
4627   #ifndef CYTHON_WITHOUT_ASSERTIONS
4628   if (unlikely(!Py_OptimizeFlag)) {
4629     if (unlikely(!((__pyx_v_self->levels > 0) != 0))) {
4630       PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_max_block_size_not_yet_handled);
4631       __PYX_ERR(0, 147, __pyx_L1_error)
4632     }
4633   }
4634   #endif
4635 
4636   /* "bx/arrays/array_tree.pyx":149
4637  *         assert self.levels > 0, "max < block_size not yet handled"
4638  *         # Save offset of root
4639  *         self.root_offset = self.io.tell()             # <<<<<<<<<<<<<<
4640  *
4641  *     def __getitem__( self, index ):
4642  */
4643   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_tell); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
4644   __Pyx_GOTREF(__pyx_t_3);
4645   __pyx_t_2 = NULL;
4646   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4647     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4648     if (likely(__pyx_t_2)) {
4649       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4650       __Pyx_INCREF(__pyx_t_2);
4651       __Pyx_INCREF(function);
4652       __Pyx_DECREF_SET(__pyx_t_3, function);
4653     }
4654   }
4655   __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4656   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4657   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
4658   __Pyx_GOTREF(__pyx_t_4);
4659   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4660   __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L1_error)
4661   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4662   __pyx_v_self->root_offset = __pyx_t_5;
4663 
4664   /* "bx/arrays/array_tree.pyx":132
4665  *     cdef object io
4666  *
4667  *     def __init__( self, file, is_little_endian=True ):             # <<<<<<<<<<<<<<
4668  *         self.io = BinaryFileReader( file, is_little_endian=is_little_endian )
4669  *         self.offset = self.io.tell()
4670  */
4671 
4672   /* function exit code */
4673   __pyx_r = 0;
4674   goto __pyx_L0;
4675   __pyx_L1_error:;
4676   __Pyx_XDECREF(__pyx_t_1);
4677   __Pyx_XDECREF(__pyx_t_2);
4678   __Pyx_XDECREF(__pyx_t_3);
4679   __Pyx_XDECREF(__pyx_t_4);
4680   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4681   __pyx_r = -1;
4682   __pyx_L0:;
4683   __Pyx_XDECREF(__pyx_v_dt);
4684   __Pyx_RefNannyFinishContext();
4685   return __pyx_r;
4686 }
4687 
4688 /* "bx/arrays/array_tree.pyx":151
4689  *         self.root_offset = self.io.tell()
4690  *
4691  *     def __getitem__( self, index ):             # <<<<<<<<<<<<<<
4692  *         min = self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 )
4693  *         if min < 0:
4694  */
4695 
4696 /* Python wrapper */
4697 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_3__getitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_index)4698 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
4699   PyObject *__pyx_r = 0;
4700   __Pyx_RefNannyDeclarations
4701   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
4702   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_2__getitem__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self), ((PyObject *)__pyx_v_index));
4703 
4704   /* function exit code */
4705   __Pyx_RefNannyFinishContext();
4706   return __pyx_r;
4707 }
4708 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_2__getitem__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self,PyObject * __pyx_v_index)4709 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_2__getitem__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_index) {
4710   PyObject *__pyx_v_min = NULL;
4711   PyObject *__pyx_r = NULL;
4712   __Pyx_RefNannyDeclarations
4713   int __pyx_t_1;
4714   PyObject *__pyx_t_2 = NULL;
4715   int __pyx_t_3;
4716   PyObject *__pyx_t_4 = NULL;
4717   PyObject *__pyx_t_5 = NULL;
4718   PyObject *__pyx_t_6 = NULL;
4719   PyObject *__pyx_t_7 = NULL;
4720   int __pyx_lineno = 0;
4721   const char *__pyx_filename = NULL;
4722   int __pyx_clineno = 0;
4723   __Pyx_RefNannySetupContext("__getitem__", 0);
4724 
4725   /* "bx/arrays/array_tree.pyx":152
4726  *
4727  *     def __getitem__( self, index ):
4728  *         min = self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 )             # <<<<<<<<<<<<<<
4729  *         if min < 0:
4730  *             return nan
4731  */
4732   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error)
4733   __pyx_t_2 = __Pyx_PyInt_From_int(((struct __pyx_vtabstruct_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self->__pyx_vtab)->r_seek_to_node(__pyx_v_self, __pyx_t_1, 0, __pyx_v_self->root_offset, __pyx_v_self->levels, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
4734   __Pyx_GOTREF(__pyx_t_2);
4735   __pyx_v_min = __pyx_t_2;
4736   __pyx_t_2 = 0;
4737 
4738   /* "bx/arrays/array_tree.pyx":153
4739  *     def __getitem__( self, index ):
4740  *         min = self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 )
4741  *         if min < 0:             # <<<<<<<<<<<<<<
4742  *             return nan
4743  *         self.io.skip( self.dtype.itemsize * ( index - min ) )
4744  */
4745   __pyx_t_2 = PyObject_RichCompare(__pyx_v_min, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
4746   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 153, __pyx_L1_error)
4747   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4748   if (__pyx_t_3) {
4749 
4750     /* "bx/arrays/array_tree.pyx":154
4751  *         min = self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 )
4752  *         if min < 0:
4753  *             return nan             # <<<<<<<<<<<<<<
4754  *         self.io.skip( self.dtype.itemsize * ( index - min ) )
4755  *         return self.io.read_raw_array( self.dtype, 1 )[0]
4756  */
4757     __Pyx_XDECREF(__pyx_r);
4758     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error)
4759     __Pyx_GOTREF(__pyx_t_2);
4760     __pyx_r = __pyx_t_2;
4761     __pyx_t_2 = 0;
4762     goto __pyx_L0;
4763 
4764     /* "bx/arrays/array_tree.pyx":153
4765  *     def __getitem__( self, index ):
4766  *         min = self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 )
4767  *         if min < 0:             # <<<<<<<<<<<<<<
4768  *             return nan
4769  *         self.io.skip( self.dtype.itemsize * ( index - min ) )
4770  */
4771   }
4772 
4773   /* "bx/arrays/array_tree.pyx":155
4774  *         if min < 0:
4775  *             return nan
4776  *         self.io.skip( self.dtype.itemsize * ( index - min ) )             # <<<<<<<<<<<<<<
4777  *         return self.io.read_raw_array( self.dtype, 1 )[0]
4778  *
4779  */
4780   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_skip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
4781   __Pyx_GOTREF(__pyx_t_4);
4782   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error)
4783   __Pyx_GOTREF(__pyx_t_5);
4784   __pyx_t_6 = PyNumber_Subtract(__pyx_v_index, __pyx_v_min); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 155, __pyx_L1_error)
4785   __Pyx_GOTREF(__pyx_t_6);
4786   __pyx_t_7 = PyNumber_Multiply(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 155, __pyx_L1_error)
4787   __Pyx_GOTREF(__pyx_t_7);
4788   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4789   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4790   __pyx_t_6 = NULL;
4791   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
4792     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
4793     if (likely(__pyx_t_6)) {
4794       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4795       __Pyx_INCREF(__pyx_t_6);
4796       __Pyx_INCREF(function);
4797       __Pyx_DECREF_SET(__pyx_t_4, function);
4798     }
4799   }
4800   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7);
4801   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4802   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4803   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
4804   __Pyx_GOTREF(__pyx_t_2);
4805   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4806   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4807 
4808   /* "bx/arrays/array_tree.pyx":156
4809  *             return nan
4810  *         self.io.skip( self.dtype.itemsize * ( index - min ) )
4811  *         return self.io.read_raw_array( self.dtype, 1 )[0]             # <<<<<<<<<<<<<<
4812  *
4813  *     def get_summary( self, index, level ):
4814  */
4815   __Pyx_XDECREF(__pyx_r);
4816   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_read_raw_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
4817   __Pyx_GOTREF(__pyx_t_4);
4818   __pyx_t_7 = NULL;
4819   __pyx_t_1 = 0;
4820   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
4821     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
4822     if (likely(__pyx_t_7)) {
4823       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4824       __Pyx_INCREF(__pyx_t_7);
4825       __Pyx_INCREF(function);
4826       __Pyx_DECREF_SET(__pyx_t_4, function);
4827       __pyx_t_1 = 1;
4828     }
4829   }
4830   #if CYTHON_FAST_PYCALL
4831   if (PyFunction_Check(__pyx_t_4)) {
4832     PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_self->dtype, __pyx_int_1};
4833     __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
4834     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4835     __Pyx_GOTREF(__pyx_t_2);
4836   } else
4837   #endif
4838   #if CYTHON_FAST_PYCCALL
4839   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
4840     PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_self->dtype, __pyx_int_1};
4841     __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
4842     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4843     __Pyx_GOTREF(__pyx_t_2);
4844   } else
4845   #endif
4846   {
4847     __pyx_t_6 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 156, __pyx_L1_error)
4848     __Pyx_GOTREF(__pyx_t_6);
4849     if (__pyx_t_7) {
4850       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
4851     }
4852     __Pyx_INCREF(__pyx_v_self->dtype);
4853     __Pyx_GIVEREF(__pyx_v_self->dtype);
4854     PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_1, __pyx_v_self->dtype);
4855     __Pyx_INCREF(__pyx_int_1);
4856     __Pyx_GIVEREF(__pyx_int_1);
4857     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_1, __pyx_int_1);
4858     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
4859     __Pyx_GOTREF(__pyx_t_2);
4860     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4861   }
4862   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4863   __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
4864   __Pyx_GOTREF(__pyx_t_4);
4865   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4866   __pyx_r = __pyx_t_4;
4867   __pyx_t_4 = 0;
4868   goto __pyx_L0;
4869 
4870   /* "bx/arrays/array_tree.pyx":151
4871  *         self.root_offset = self.io.tell()
4872  *
4873  *     def __getitem__( self, index ):             # <<<<<<<<<<<<<<
4874  *         min = self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 )
4875  *         if min < 0:
4876  */
4877 
4878   /* function exit code */
4879   __pyx_L1_error:;
4880   __Pyx_XDECREF(__pyx_t_2);
4881   __Pyx_XDECREF(__pyx_t_4);
4882   __Pyx_XDECREF(__pyx_t_5);
4883   __Pyx_XDECREF(__pyx_t_6);
4884   __Pyx_XDECREF(__pyx_t_7);
4885   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4886   __pyx_r = NULL;
4887   __pyx_L0:;
4888   __Pyx_XDECREF(__pyx_v_min);
4889   __Pyx_XGIVEREF(__pyx_r);
4890   __Pyx_RefNannyFinishContext();
4891   return __pyx_r;
4892 }
4893 
4894 /* "bx/arrays/array_tree.pyx":158
4895  *         return self.io.read_raw_array( self.dtype, 1 )[0]
4896  *
4897  *     def get_summary( self, index, level ):             # <<<<<<<<<<<<<<
4898  *         if level <= 0 or level > self.levels:
4899  *             raise ValueError, "level must be <= self.levels"
4900  */
4901 
4902 /* Python wrapper */
4903 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_5get_summary(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_5get_summary(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4904 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_5get_summary(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4905   PyObject *__pyx_v_index = 0;
4906   PyObject *__pyx_v_level = 0;
4907   int __pyx_lineno = 0;
4908   const char *__pyx_filename = NULL;
4909   int __pyx_clineno = 0;
4910   PyObject *__pyx_r = 0;
4911   __Pyx_RefNannyDeclarations
4912   __Pyx_RefNannySetupContext("get_summary (wrapper)", 0);
4913   {
4914     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_level,0};
4915     PyObject* values[2] = {0,0};
4916     if (unlikely(__pyx_kwds)) {
4917       Py_ssize_t kw_args;
4918       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4919       switch (pos_args) {
4920         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4921         CYTHON_FALLTHROUGH;
4922         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4923         CYTHON_FALLTHROUGH;
4924         case  0: break;
4925         default: goto __pyx_L5_argtuple_error;
4926       }
4927       kw_args = PyDict_Size(__pyx_kwds);
4928       switch (pos_args) {
4929         case  0:
4930         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
4931         else goto __pyx_L5_argtuple_error;
4932         CYTHON_FALLTHROUGH;
4933         case  1:
4934         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
4935         else {
4936           __Pyx_RaiseArgtupleInvalid("get_summary", 1, 2, 2, 1); __PYX_ERR(0, 158, __pyx_L3_error)
4937         }
4938       }
4939       if (unlikely(kw_args > 0)) {
4940         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_summary") < 0)) __PYX_ERR(0, 158, __pyx_L3_error)
4941       }
4942     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4943       goto __pyx_L5_argtuple_error;
4944     } else {
4945       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4946       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4947     }
4948     __pyx_v_index = values[0];
4949     __pyx_v_level = values[1];
4950   }
4951   goto __pyx_L4_argument_unpacking_done;
4952   __pyx_L5_argtuple_error:;
4953   __Pyx_RaiseArgtupleInvalid("get_summary", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 158, __pyx_L3_error)
4954   __pyx_L3_error:;
4955   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.get_summary", __pyx_clineno, __pyx_lineno, __pyx_filename);
4956   __Pyx_RefNannyFinishContext();
4957   return NULL;
4958   __pyx_L4_argument_unpacking_done:;
4959   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_4get_summary(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self), __pyx_v_index, __pyx_v_level);
4960 
4961   /* function exit code */
4962   __Pyx_RefNannyFinishContext();
4963   return __pyx_r;
4964 }
4965 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_4get_summary(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_level)4966 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_4get_summary(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_level) {
4967   struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_s = NULL;
4968   PyObject *__pyx_r = NULL;
4969   __Pyx_RefNannyDeclarations
4970   int __pyx_t_1;
4971   PyObject *__pyx_t_2 = NULL;
4972   int __pyx_t_3;
4973   PyObject *__pyx_t_4 = NULL;
4974   int __pyx_t_5;
4975   int __pyx_t_6;
4976   PyObject *__pyx_t_7 = NULL;
4977   PyObject *__pyx_t_8 = NULL;
4978   PyObject *__pyx_t_9 = NULL;
4979   int __pyx_lineno = 0;
4980   const char *__pyx_filename = NULL;
4981   int __pyx_clineno = 0;
4982   __Pyx_RefNannySetupContext("get_summary", 0);
4983 
4984   /* "bx/arrays/array_tree.pyx":159
4985  *
4986  *     def get_summary( self, index, level ):
4987  *         if level <= 0 or level > self.levels:             # <<<<<<<<<<<<<<
4988  *             raise ValueError, "level must be <= self.levels"
4989  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, level ) < 0:
4990  */
4991   __pyx_t_2 = PyObject_RichCompare(__pyx_v_level, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
4992   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
4993   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4994   if (!__pyx_t_3) {
4995   } else {
4996     __pyx_t_1 = __pyx_t_3;
4997     goto __pyx_L4_bool_binop_done;
4998   }
4999   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->levels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
5000   __Pyx_GOTREF(__pyx_t_2);
5001   __pyx_t_4 = PyObject_RichCompare(__pyx_v_level, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
5002   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5003   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
5004   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5005   __pyx_t_1 = __pyx_t_3;
5006   __pyx_L4_bool_binop_done:;
5007   if (unlikely(__pyx_t_1)) {
5008 
5009     /* "bx/arrays/array_tree.pyx":160
5010  *     def get_summary( self, index, level ):
5011  *         if level <= 0 or level > self.levels:
5012  *             raise ValueError, "level must be <= self.levels"             # <<<<<<<<<<<<<<
5013  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, level ) < 0:
5014  *             return None
5015  */
5016     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_level_must_be_self_levels, 0, 0);
5017     __PYX_ERR(0, 160, __pyx_L1_error)
5018 
5019     /* "bx/arrays/array_tree.pyx":159
5020  *
5021  *     def get_summary( self, index, level ):
5022  *         if level <= 0 or level > self.levels:             # <<<<<<<<<<<<<<
5023  *             raise ValueError, "level must be <= self.levels"
5024  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, level ) < 0:
5025  */
5026   }
5027 
5028   /* "bx/arrays/array_tree.pyx":161
5029  *         if level <= 0 or level > self.levels:
5030  *             raise ValueError, "level must be <= self.levels"
5031  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, level ) < 0:             # <<<<<<<<<<<<<<
5032  *             return None
5033  *         # Read summary arrays
5034  */
5035   __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
5036   __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_level); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
5037   __pyx_t_1 = ((((struct __pyx_vtabstruct_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self->__pyx_vtab)->r_seek_to_node(__pyx_v_self, __pyx_t_5, 0, __pyx_v_self->root_offset, __pyx_v_self->levels, __pyx_t_6) < 0) != 0);
5038   if (__pyx_t_1) {
5039 
5040     /* "bx/arrays/array_tree.pyx":162
5041  *             raise ValueError, "level must be <= self.levels"
5042  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, level ) < 0:
5043  *             return None             # <<<<<<<<<<<<<<
5044  *         # Read summary arrays
5045  *         s = Summary()
5046  */
5047     __Pyx_XDECREF(__pyx_r);
5048     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5049     goto __pyx_L0;
5050 
5051     /* "bx/arrays/array_tree.pyx":161
5052  *         if level <= 0 or level > self.levels:
5053  *             raise ValueError, "level must be <= self.levels"
5054  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, level ) < 0:             # <<<<<<<<<<<<<<
5055  *             return None
5056  *         # Read summary arrays
5057  */
5058   }
5059 
5060   /* "bx/arrays/array_tree.pyx":164
5061  *             return None
5062  *         # Read summary arrays
5063  *         s = Summary()             # <<<<<<<<<<<<<<
5064  *         s.counts = self.io.read_raw_array( self.dtype, self.block_size )
5065  *         s.frequencies = self.io.read_raw_array( self.dtype, self.block_size )
5066  */
5067   __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_Summary)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error)
5068   __Pyx_GOTREF(__pyx_t_4);
5069   __pyx_v_s = ((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_t_4);
5070   __pyx_t_4 = 0;
5071 
5072   /* "bx/arrays/array_tree.pyx":165
5073  *         # Read summary arrays
5074  *         s = Summary()
5075  *         s.counts = self.io.read_raw_array( self.dtype, self.block_size )             # <<<<<<<<<<<<<<
5076  *         s.frequencies = self.io.read_raw_array( self.dtype, self.block_size )
5077  *         s.sums = self.io.read_raw_array( self.dtype, self.block_size )
5078  */
5079   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_read_raw_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
5080   __Pyx_GOTREF(__pyx_t_2);
5081   __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->block_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 165, __pyx_L1_error)
5082   __Pyx_GOTREF(__pyx_t_7);
5083   __pyx_t_8 = NULL;
5084   __pyx_t_6 = 0;
5085   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5086     __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
5087     if (likely(__pyx_t_8)) {
5088       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5089       __Pyx_INCREF(__pyx_t_8);
5090       __Pyx_INCREF(function);
5091       __Pyx_DECREF_SET(__pyx_t_2, function);
5092       __pyx_t_6 = 1;
5093     }
5094   }
5095   #if CYTHON_FAST_PYCALL
5096   if (PyFunction_Check(__pyx_t_2)) {
5097     PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_self->dtype, __pyx_t_7};
5098     __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
5099     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
5100     __Pyx_GOTREF(__pyx_t_4);
5101     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5102   } else
5103   #endif
5104   #if CYTHON_FAST_PYCCALL
5105   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
5106     PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_self->dtype, __pyx_t_7};
5107     __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
5108     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
5109     __Pyx_GOTREF(__pyx_t_4);
5110     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5111   } else
5112   #endif
5113   {
5114     __pyx_t_9 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 165, __pyx_L1_error)
5115     __Pyx_GOTREF(__pyx_t_9);
5116     if (__pyx_t_8) {
5117       __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
5118     }
5119     __Pyx_INCREF(__pyx_v_self->dtype);
5120     __Pyx_GIVEREF(__pyx_v_self->dtype);
5121     PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_6, __pyx_v_self->dtype);
5122     __Pyx_GIVEREF(__pyx_t_7);
5123     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_6, __pyx_t_7);
5124     __pyx_t_7 = 0;
5125     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
5126     __Pyx_GOTREF(__pyx_t_4);
5127     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5128   }
5129   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5130   __Pyx_GIVEREF(__pyx_t_4);
5131   __Pyx_GOTREF(__pyx_v_s->counts);
5132   __Pyx_DECREF(__pyx_v_s->counts);
5133   __pyx_v_s->counts = __pyx_t_4;
5134   __pyx_t_4 = 0;
5135 
5136   /* "bx/arrays/array_tree.pyx":166
5137  *         s = Summary()
5138  *         s.counts = self.io.read_raw_array( self.dtype, self.block_size )
5139  *         s.frequencies = self.io.read_raw_array( self.dtype, self.block_size )             # <<<<<<<<<<<<<<
5140  *         s.sums = self.io.read_raw_array( self.dtype, self.block_size )
5141  *         s.mins = self.io.read_raw_array( self.dtype, self.block_size)
5142  */
5143   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_read_raw_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
5144   __Pyx_GOTREF(__pyx_t_2);
5145   __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_self->block_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 166, __pyx_L1_error)
5146   __Pyx_GOTREF(__pyx_t_9);
5147   __pyx_t_7 = NULL;
5148   __pyx_t_6 = 0;
5149   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5150     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
5151     if (likely(__pyx_t_7)) {
5152       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5153       __Pyx_INCREF(__pyx_t_7);
5154       __Pyx_INCREF(function);
5155       __Pyx_DECREF_SET(__pyx_t_2, function);
5156       __pyx_t_6 = 1;
5157     }
5158   }
5159   #if CYTHON_FAST_PYCALL
5160   if (PyFunction_Check(__pyx_t_2)) {
5161     PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_self->dtype, __pyx_t_9};
5162     __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
5163     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5164     __Pyx_GOTREF(__pyx_t_4);
5165     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5166   } else
5167   #endif
5168   #if CYTHON_FAST_PYCCALL
5169   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
5170     PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_self->dtype, __pyx_t_9};
5171     __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
5172     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5173     __Pyx_GOTREF(__pyx_t_4);
5174     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5175   } else
5176   #endif
5177   {
5178     __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 166, __pyx_L1_error)
5179     __Pyx_GOTREF(__pyx_t_8);
5180     if (__pyx_t_7) {
5181       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
5182     }
5183     __Pyx_INCREF(__pyx_v_self->dtype);
5184     __Pyx_GIVEREF(__pyx_v_self->dtype);
5185     PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_v_self->dtype);
5186     __Pyx_GIVEREF(__pyx_t_9);
5187     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_t_9);
5188     __pyx_t_9 = 0;
5189     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
5190     __Pyx_GOTREF(__pyx_t_4);
5191     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5192   }
5193   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5194   __Pyx_GIVEREF(__pyx_t_4);
5195   __Pyx_GOTREF(__pyx_v_s->frequencies);
5196   __Pyx_DECREF(__pyx_v_s->frequencies);
5197   __pyx_v_s->frequencies = __pyx_t_4;
5198   __pyx_t_4 = 0;
5199 
5200   /* "bx/arrays/array_tree.pyx":167
5201  *         s.counts = self.io.read_raw_array( self.dtype, self.block_size )
5202  *         s.frequencies = self.io.read_raw_array( self.dtype, self.block_size )
5203  *         s.sums = self.io.read_raw_array( self.dtype, self.block_size )             # <<<<<<<<<<<<<<
5204  *         s.mins = self.io.read_raw_array( self.dtype, self.block_size)
5205  *         s.maxs = self.io.read_raw_array( self.dtype, self.block_size )
5206  */
5207   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_read_raw_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error)
5208   __Pyx_GOTREF(__pyx_t_2);
5209   __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->block_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 167, __pyx_L1_error)
5210   __Pyx_GOTREF(__pyx_t_8);
5211   __pyx_t_9 = NULL;
5212   __pyx_t_6 = 0;
5213   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5214     __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
5215     if (likely(__pyx_t_9)) {
5216       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5217       __Pyx_INCREF(__pyx_t_9);
5218       __Pyx_INCREF(function);
5219       __Pyx_DECREF_SET(__pyx_t_2, function);
5220       __pyx_t_6 = 1;
5221     }
5222   }
5223   #if CYTHON_FAST_PYCALL
5224   if (PyFunction_Check(__pyx_t_2)) {
5225     PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_self->dtype, __pyx_t_8};
5226     __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
5227     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5228     __Pyx_GOTREF(__pyx_t_4);
5229     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5230   } else
5231   #endif
5232   #if CYTHON_FAST_PYCCALL
5233   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
5234     PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_self->dtype, __pyx_t_8};
5235     __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
5236     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5237     __Pyx_GOTREF(__pyx_t_4);
5238     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5239   } else
5240   #endif
5241   {
5242     __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 167, __pyx_L1_error)
5243     __Pyx_GOTREF(__pyx_t_7);
5244     if (__pyx_t_9) {
5245       __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
5246     }
5247     __Pyx_INCREF(__pyx_v_self->dtype);
5248     __Pyx_GIVEREF(__pyx_v_self->dtype);
5249     PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self->dtype);
5250     __Pyx_GIVEREF(__pyx_t_8);
5251     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_8);
5252     __pyx_t_8 = 0;
5253     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
5254     __Pyx_GOTREF(__pyx_t_4);
5255     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5256   }
5257   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5258   __Pyx_GIVEREF(__pyx_t_4);
5259   __Pyx_GOTREF(__pyx_v_s->sums);
5260   __Pyx_DECREF(__pyx_v_s->sums);
5261   __pyx_v_s->sums = __pyx_t_4;
5262   __pyx_t_4 = 0;
5263 
5264   /* "bx/arrays/array_tree.pyx":168
5265  *         s.frequencies = self.io.read_raw_array( self.dtype, self.block_size )
5266  *         s.sums = self.io.read_raw_array( self.dtype, self.block_size )
5267  *         s.mins = self.io.read_raw_array( self.dtype, self.block_size)             # <<<<<<<<<<<<<<
5268  *         s.maxs = self.io.read_raw_array( self.dtype, self.block_size )
5269  *         s.sumsquares = self.io.read_raw_array( self.dtype, self.block_size )
5270  */
5271   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_read_raw_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
5272   __Pyx_GOTREF(__pyx_t_2);
5273   __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->block_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 168, __pyx_L1_error)
5274   __Pyx_GOTREF(__pyx_t_7);
5275   __pyx_t_8 = NULL;
5276   __pyx_t_6 = 0;
5277   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5278     __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
5279     if (likely(__pyx_t_8)) {
5280       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5281       __Pyx_INCREF(__pyx_t_8);
5282       __Pyx_INCREF(function);
5283       __Pyx_DECREF_SET(__pyx_t_2, function);
5284       __pyx_t_6 = 1;
5285     }
5286   }
5287   #if CYTHON_FAST_PYCALL
5288   if (PyFunction_Check(__pyx_t_2)) {
5289     PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_self->dtype, __pyx_t_7};
5290     __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
5291     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
5292     __Pyx_GOTREF(__pyx_t_4);
5293     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5294   } else
5295   #endif
5296   #if CYTHON_FAST_PYCCALL
5297   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
5298     PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_self->dtype, __pyx_t_7};
5299     __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
5300     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
5301     __Pyx_GOTREF(__pyx_t_4);
5302     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5303   } else
5304   #endif
5305   {
5306     __pyx_t_9 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 168, __pyx_L1_error)
5307     __Pyx_GOTREF(__pyx_t_9);
5308     if (__pyx_t_8) {
5309       __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
5310     }
5311     __Pyx_INCREF(__pyx_v_self->dtype);
5312     __Pyx_GIVEREF(__pyx_v_self->dtype);
5313     PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_6, __pyx_v_self->dtype);
5314     __Pyx_GIVEREF(__pyx_t_7);
5315     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_6, __pyx_t_7);
5316     __pyx_t_7 = 0;
5317     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
5318     __Pyx_GOTREF(__pyx_t_4);
5319     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5320   }
5321   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5322   __Pyx_GIVEREF(__pyx_t_4);
5323   __Pyx_GOTREF(__pyx_v_s->mins);
5324   __Pyx_DECREF(__pyx_v_s->mins);
5325   __pyx_v_s->mins = __pyx_t_4;
5326   __pyx_t_4 = 0;
5327 
5328   /* "bx/arrays/array_tree.pyx":169
5329  *         s.sums = self.io.read_raw_array( self.dtype, self.block_size )
5330  *         s.mins = self.io.read_raw_array( self.dtype, self.block_size)
5331  *         s.maxs = self.io.read_raw_array( self.dtype, self.block_size )             # <<<<<<<<<<<<<<
5332  *         s.sumsquares = self.io.read_raw_array( self.dtype, self.block_size )
5333  *         return s
5334  */
5335   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_read_raw_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
5336   __Pyx_GOTREF(__pyx_t_2);
5337   __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_self->block_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 169, __pyx_L1_error)
5338   __Pyx_GOTREF(__pyx_t_9);
5339   __pyx_t_7 = NULL;
5340   __pyx_t_6 = 0;
5341   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5342     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
5343     if (likely(__pyx_t_7)) {
5344       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5345       __Pyx_INCREF(__pyx_t_7);
5346       __Pyx_INCREF(function);
5347       __Pyx_DECREF_SET(__pyx_t_2, function);
5348       __pyx_t_6 = 1;
5349     }
5350   }
5351   #if CYTHON_FAST_PYCALL
5352   if (PyFunction_Check(__pyx_t_2)) {
5353     PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_self->dtype, __pyx_t_9};
5354     __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
5355     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5356     __Pyx_GOTREF(__pyx_t_4);
5357     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5358   } else
5359   #endif
5360   #if CYTHON_FAST_PYCCALL
5361   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
5362     PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_self->dtype, __pyx_t_9};
5363     __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
5364     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5365     __Pyx_GOTREF(__pyx_t_4);
5366     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5367   } else
5368   #endif
5369   {
5370     __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 169, __pyx_L1_error)
5371     __Pyx_GOTREF(__pyx_t_8);
5372     if (__pyx_t_7) {
5373       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
5374     }
5375     __Pyx_INCREF(__pyx_v_self->dtype);
5376     __Pyx_GIVEREF(__pyx_v_self->dtype);
5377     PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_v_self->dtype);
5378     __Pyx_GIVEREF(__pyx_t_9);
5379     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_t_9);
5380     __pyx_t_9 = 0;
5381     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
5382     __Pyx_GOTREF(__pyx_t_4);
5383     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5384   }
5385   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5386   __Pyx_GIVEREF(__pyx_t_4);
5387   __Pyx_GOTREF(__pyx_v_s->maxs);
5388   __Pyx_DECREF(__pyx_v_s->maxs);
5389   __pyx_v_s->maxs = __pyx_t_4;
5390   __pyx_t_4 = 0;
5391 
5392   /* "bx/arrays/array_tree.pyx":170
5393  *         s.mins = self.io.read_raw_array( self.dtype, self.block_size)
5394  *         s.maxs = self.io.read_raw_array( self.dtype, self.block_size )
5395  *         s.sumsquares = self.io.read_raw_array( self.dtype, self.block_size )             # <<<<<<<<<<<<<<
5396  *         return s
5397  *
5398  */
5399   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_read_raw_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error)
5400   __Pyx_GOTREF(__pyx_t_2);
5401   __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->block_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 170, __pyx_L1_error)
5402   __Pyx_GOTREF(__pyx_t_8);
5403   __pyx_t_9 = NULL;
5404   __pyx_t_6 = 0;
5405   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5406     __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
5407     if (likely(__pyx_t_9)) {
5408       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5409       __Pyx_INCREF(__pyx_t_9);
5410       __Pyx_INCREF(function);
5411       __Pyx_DECREF_SET(__pyx_t_2, function);
5412       __pyx_t_6 = 1;
5413     }
5414   }
5415   #if CYTHON_FAST_PYCALL
5416   if (PyFunction_Check(__pyx_t_2)) {
5417     PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_self->dtype, __pyx_t_8};
5418     __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
5419     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5420     __Pyx_GOTREF(__pyx_t_4);
5421     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5422   } else
5423   #endif
5424   #if CYTHON_FAST_PYCCALL
5425   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
5426     PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_self->dtype, __pyx_t_8};
5427     __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
5428     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5429     __Pyx_GOTREF(__pyx_t_4);
5430     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5431   } else
5432   #endif
5433   {
5434     __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 170, __pyx_L1_error)
5435     __Pyx_GOTREF(__pyx_t_7);
5436     if (__pyx_t_9) {
5437       __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
5438     }
5439     __Pyx_INCREF(__pyx_v_self->dtype);
5440     __Pyx_GIVEREF(__pyx_v_self->dtype);
5441     PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self->dtype);
5442     __Pyx_GIVEREF(__pyx_t_8);
5443     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_8);
5444     __pyx_t_8 = 0;
5445     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
5446     __Pyx_GOTREF(__pyx_t_4);
5447     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5448   }
5449   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5450   __Pyx_GIVEREF(__pyx_t_4);
5451   __Pyx_GOTREF(__pyx_v_s->sumsquares);
5452   __Pyx_DECREF(__pyx_v_s->sumsquares);
5453   __pyx_v_s->sumsquares = __pyx_t_4;
5454   __pyx_t_4 = 0;
5455 
5456   /* "bx/arrays/array_tree.pyx":171
5457  *         s.maxs = self.io.read_raw_array( self.dtype, self.block_size )
5458  *         s.sumsquares = self.io.read_raw_array( self.dtype, self.block_size )
5459  *         return s             # <<<<<<<<<<<<<<
5460  *
5461  *     def get_leaf( self, index ):
5462  */
5463   __Pyx_XDECREF(__pyx_r);
5464   __Pyx_INCREF(((PyObject *)__pyx_v_s));
5465   __pyx_r = ((PyObject *)__pyx_v_s);
5466   goto __pyx_L0;
5467 
5468   /* "bx/arrays/array_tree.pyx":158
5469  *         return self.io.read_raw_array( self.dtype, 1 )[0]
5470  *
5471  *     def get_summary( self, index, level ):             # <<<<<<<<<<<<<<
5472  *         if level <= 0 or level > self.levels:
5473  *             raise ValueError, "level must be <= self.levels"
5474  */
5475 
5476   /* function exit code */
5477   __pyx_L1_error:;
5478   __Pyx_XDECREF(__pyx_t_2);
5479   __Pyx_XDECREF(__pyx_t_4);
5480   __Pyx_XDECREF(__pyx_t_7);
5481   __Pyx_XDECREF(__pyx_t_8);
5482   __Pyx_XDECREF(__pyx_t_9);
5483   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.get_summary", __pyx_clineno, __pyx_lineno, __pyx_filename);
5484   __pyx_r = NULL;
5485   __pyx_L0:;
5486   __Pyx_XDECREF((PyObject *)__pyx_v_s);
5487   __Pyx_XGIVEREF(__pyx_r);
5488   __Pyx_RefNannyFinishContext();
5489   return __pyx_r;
5490 }
5491 
5492 /* "bx/arrays/array_tree.pyx":173
5493  *         return s
5494  *
5495  *     def get_leaf( self, index ):             # <<<<<<<<<<<<<<
5496  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 ) < 0:
5497  *             return []
5498  */
5499 
5500 /* Python wrapper */
5501 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_7get_leaf(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_7get_leaf(PyObject * __pyx_v_self,PyObject * __pyx_v_index)5502 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_7get_leaf(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
5503   PyObject *__pyx_r = 0;
5504   __Pyx_RefNannyDeclarations
5505   __Pyx_RefNannySetupContext("get_leaf (wrapper)", 0);
5506   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6get_leaf(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self), ((PyObject *)__pyx_v_index));
5507 
5508   /* function exit code */
5509   __Pyx_RefNannyFinishContext();
5510   return __pyx_r;
5511 }
5512 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6get_leaf(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self,PyObject * __pyx_v_index)5513 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6get_leaf(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_index) {
5514   PyObject *__pyx_r = NULL;
5515   __Pyx_RefNannyDeclarations
5516   int __pyx_t_1;
5517   int __pyx_t_2;
5518   PyObject *__pyx_t_3 = NULL;
5519   PyObject *__pyx_t_4 = NULL;
5520   PyObject *__pyx_t_5 = NULL;
5521   PyObject *__pyx_t_6 = NULL;
5522   PyObject *__pyx_t_7 = NULL;
5523   int __pyx_lineno = 0;
5524   const char *__pyx_filename = NULL;
5525   int __pyx_clineno = 0;
5526   __Pyx_RefNannySetupContext("get_leaf", 0);
5527 
5528   /* "bx/arrays/array_tree.pyx":174
5529  *
5530  *     def get_leaf( self, index ):
5531  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 ) < 0:             # <<<<<<<<<<<<<<
5532  *             return []
5533  *         return self.io.read_raw_array( self.dtype, self.block_size )
5534  */
5535   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L1_error)
5536   __pyx_t_2 = ((((struct __pyx_vtabstruct_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self->__pyx_vtab)->r_seek_to_node(__pyx_v_self, __pyx_t_1, 0, __pyx_v_self->root_offset, __pyx_v_self->levels, 0) < 0) != 0);
5537   if (__pyx_t_2) {
5538 
5539     /* "bx/arrays/array_tree.pyx":175
5540  *     def get_leaf( self, index ):
5541  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 ) < 0:
5542  *             return []             # <<<<<<<<<<<<<<
5543  *         return self.io.read_raw_array( self.dtype, self.block_size )
5544  *
5545  */
5546     __Pyx_XDECREF(__pyx_r);
5547     __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
5548     __Pyx_GOTREF(__pyx_t_3);
5549     __pyx_r = __pyx_t_3;
5550     __pyx_t_3 = 0;
5551     goto __pyx_L0;
5552 
5553     /* "bx/arrays/array_tree.pyx":174
5554  *
5555  *     def get_leaf( self, index ):
5556  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 ) < 0:             # <<<<<<<<<<<<<<
5557  *             return []
5558  *         return self.io.read_raw_array( self.dtype, self.block_size )
5559  */
5560   }
5561 
5562   /* "bx/arrays/array_tree.pyx":176
5563  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 ) < 0:
5564  *             return []
5565  *         return self.io.read_raw_array( self.dtype, self.block_size )             # <<<<<<<<<<<<<<
5566  *
5567  *     cdef int r_seek_to_node( self, int index, int min, long long offset, int level, int desired_level ):
5568  */
5569   __Pyx_XDECREF(__pyx_r);
5570   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_read_raw_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error)
5571   __Pyx_GOTREF(__pyx_t_4);
5572   __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->block_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 176, __pyx_L1_error)
5573   __Pyx_GOTREF(__pyx_t_5);
5574   __pyx_t_6 = NULL;
5575   __pyx_t_1 = 0;
5576   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
5577     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
5578     if (likely(__pyx_t_6)) {
5579       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5580       __Pyx_INCREF(__pyx_t_6);
5581       __Pyx_INCREF(function);
5582       __Pyx_DECREF_SET(__pyx_t_4, function);
5583       __pyx_t_1 = 1;
5584     }
5585   }
5586   #if CYTHON_FAST_PYCALL
5587   if (PyFunction_Check(__pyx_t_4)) {
5588     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_self->dtype, __pyx_t_5};
5589     __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
5590     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5591     __Pyx_GOTREF(__pyx_t_3);
5592     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5593   } else
5594   #endif
5595   #if CYTHON_FAST_PYCCALL
5596   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
5597     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_self->dtype, __pyx_t_5};
5598     __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
5599     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5600     __Pyx_GOTREF(__pyx_t_3);
5601     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5602   } else
5603   #endif
5604   {
5605     __pyx_t_7 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __pyx_L1_error)
5606     __Pyx_GOTREF(__pyx_t_7);
5607     if (__pyx_t_6) {
5608       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
5609     }
5610     __Pyx_INCREF(__pyx_v_self->dtype);
5611     __Pyx_GIVEREF(__pyx_v_self->dtype);
5612     PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_1, __pyx_v_self->dtype);
5613     __Pyx_GIVEREF(__pyx_t_5);
5614     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_1, __pyx_t_5);
5615     __pyx_t_5 = 0;
5616     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
5617     __Pyx_GOTREF(__pyx_t_3);
5618     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5619   }
5620   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5621   __pyx_r = __pyx_t_3;
5622   __pyx_t_3 = 0;
5623   goto __pyx_L0;
5624 
5625   /* "bx/arrays/array_tree.pyx":173
5626  *         return s
5627  *
5628  *     def get_leaf( self, index ):             # <<<<<<<<<<<<<<
5629  *         if self.r_seek_to_node( index, 0, self.root_offset, self.levels, 0 ) < 0:
5630  *             return []
5631  */
5632 
5633   /* function exit code */
5634   __pyx_L1_error:;
5635   __Pyx_XDECREF(__pyx_t_3);
5636   __Pyx_XDECREF(__pyx_t_4);
5637   __Pyx_XDECREF(__pyx_t_5);
5638   __Pyx_XDECREF(__pyx_t_6);
5639   __Pyx_XDECREF(__pyx_t_7);
5640   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.get_leaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
5641   __pyx_r = NULL;
5642   __pyx_L0:;
5643   __Pyx_XGIVEREF(__pyx_r);
5644   __Pyx_RefNannyFinishContext();
5645   return __pyx_r;
5646 }
5647 
5648 /* "bx/arrays/array_tree.pyx":178
5649  *         return self.io.read_raw_array( self.dtype, self.block_size )
5650  *
5651  *     cdef int r_seek_to_node( self, int index, int min, long long offset, int level, int desired_level ):             # <<<<<<<<<<<<<<
5652  *         """
5653  *         Seek to the start of the node at `desired_level` that contains `index`.
5654  */
5655 
__pyx_f_2bx_6arrays_10array_tree_13FileArrayTree_r_seek_to_node(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self,int __pyx_v_index,int __pyx_v_min,PY_LONG_LONG __pyx_v_offset,int __pyx_v_level,int __pyx_v_desired_level)5656 static int __pyx_f_2bx_6arrays_10array_tree_13FileArrayTree_r_seek_to_node(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, int __pyx_v_index, int __pyx_v_min, PY_LONG_LONG __pyx_v_offset, int __pyx_v_level, int __pyx_v_desired_level) {
5657   int __pyx_v_child_size;
5658   int __pyx_v_bin_index;
5659   int __pyx_v_child_min;
5660   PyObject *__pyx_v_child_offset = NULL;
5661   int __pyx_r;
5662   __Pyx_RefNannyDeclarations
5663   PyObject *__pyx_t_1 = NULL;
5664   PyObject *__pyx_t_2 = NULL;
5665   PyObject *__pyx_t_3 = NULL;
5666   PyObject *__pyx_t_4 = NULL;
5667   int __pyx_t_5;
5668   int __pyx_t_6;
5669   PyObject *__pyx_t_7 = NULL;
5670   PY_LONG_LONG __pyx_t_8;
5671   int __pyx_lineno = 0;
5672   const char *__pyx_filename = NULL;
5673   int __pyx_clineno = 0;
5674   __Pyx_RefNannySetupContext("r_seek_to_node", 0);
5675 
5676   /* "bx/arrays/array_tree.pyx":184
5677  *         """
5678  *         cdef int child_size, bin_index, child_min
5679  *         self.io.seek( offset )             # <<<<<<<<<<<<<<
5680  *         if level > desired_level:
5681  *             child_size = self.block_size ** level
5682  */
5683   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_seek); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
5684   __Pyx_GOTREF(__pyx_t_2);
5685   __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
5686   __Pyx_GOTREF(__pyx_t_3);
5687   __pyx_t_4 = NULL;
5688   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5689     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
5690     if (likely(__pyx_t_4)) {
5691       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5692       __Pyx_INCREF(__pyx_t_4);
5693       __Pyx_INCREF(function);
5694       __Pyx_DECREF_SET(__pyx_t_2, function);
5695     }
5696   }
5697   __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);
5698   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5699   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5700   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
5701   __Pyx_GOTREF(__pyx_t_1);
5702   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5703   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5704 
5705   /* "bx/arrays/array_tree.pyx":185
5706  *         cdef int child_size, bin_index, child_min
5707  *         self.io.seek( offset )
5708  *         if level > desired_level:             # <<<<<<<<<<<<<<
5709  *             child_size = self.block_size ** level
5710  *             bin_index = ( index - min ) // ( child_size )
5711  */
5712   __pyx_t_5 = ((__pyx_v_level > __pyx_v_desired_level) != 0);
5713   if (__pyx_t_5) {
5714 
5715     /* "bx/arrays/array_tree.pyx":186
5716  *         self.io.seek( offset )
5717  *         if level > desired_level:
5718  *             child_size = self.block_size ** level             # <<<<<<<<<<<<<<
5719  *             bin_index = ( index - min ) // ( child_size )
5720  *             child_min = min + ( bin_index * child_size )
5721  */
5722     __pyx_v_child_size = __Pyx_pow_int(__pyx_v_self->block_size, __pyx_v_level);
5723 
5724     /* "bx/arrays/array_tree.pyx":187
5725  *         if level > desired_level:
5726  *             child_size = self.block_size ** level
5727  *             bin_index = ( index - min ) // ( child_size )             # <<<<<<<<<<<<<<
5728  *             child_min = min + ( bin_index * child_size )
5729  *             # Skip summary arrays -- # arrays * itemsize * block_size
5730  */
5731     __pyx_t_6 = (__pyx_v_index - __pyx_v_min);
5732     if (unlikely(__pyx_v_child_size == 0)) {
5733       PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
5734       __PYX_ERR(0, 187, __pyx_L1_error)
5735     }
5736     else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_child_size == (int)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_6))) {
5737       PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
5738       __PYX_ERR(0, 187, __pyx_L1_error)
5739     }
5740     __pyx_v_bin_index = __Pyx_div_int(__pyx_t_6, __pyx_v_child_size);
5741 
5742     /* "bx/arrays/array_tree.pyx":188
5743  *             child_size = self.block_size ** level
5744  *             bin_index = ( index - min ) // ( child_size )
5745  *             child_min = min + ( bin_index * child_size )             # <<<<<<<<<<<<<<
5746  *             # Skip summary arrays -- # arrays * itemsize * block_size
5747  *             self.io.skip( NUM_SUMMARY_ARRAYS * self.dtype.itemsize * self.block_size )
5748  */
5749     __pyx_v_child_min = (__pyx_v_min + (__pyx_v_bin_index * __pyx_v_child_size));
5750 
5751     /* "bx/arrays/array_tree.pyx":190
5752  *             child_min = min + ( bin_index * child_size )
5753  *             # Skip summary arrays -- # arrays * itemsize * block_size
5754  *             self.io.skip( NUM_SUMMARY_ARRAYS * self.dtype.itemsize * self.block_size )             # <<<<<<<<<<<<<<
5755  *             # Skip to offset of correct child -- offsets are 8 bytes
5756  *             self.io.skip( 8 * bin_index )
5757  */
5758     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_skip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
5759     __Pyx_GOTREF(__pyx_t_2);
5760     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NUM_SUMMARY_ARRAYS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error)
5761     __Pyx_GOTREF(__pyx_t_3);
5762     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
5763     __Pyx_GOTREF(__pyx_t_4);
5764     __pyx_t_7 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 190, __pyx_L1_error)
5765     __Pyx_GOTREF(__pyx_t_7);
5766     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5767     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5768     __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->block_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
5769     __Pyx_GOTREF(__pyx_t_4);
5770     __pyx_t_3 = PyNumber_Multiply(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error)
5771     __Pyx_GOTREF(__pyx_t_3);
5772     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5773     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5774     __pyx_t_4 = NULL;
5775     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5776       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
5777       if (likely(__pyx_t_4)) {
5778         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5779         __Pyx_INCREF(__pyx_t_4);
5780         __Pyx_INCREF(function);
5781         __Pyx_DECREF_SET(__pyx_t_2, function);
5782       }
5783     }
5784     __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);
5785     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5786     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5787     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
5788     __Pyx_GOTREF(__pyx_t_1);
5789     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5790     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5791 
5792     /* "bx/arrays/array_tree.pyx":192
5793  *             self.io.skip( NUM_SUMMARY_ARRAYS * self.dtype.itemsize * self.block_size )
5794  *             # Skip to offset of correct child -- offsets are 8 bytes
5795  *             self.io.skip( 8 * bin_index )             # <<<<<<<<<<<<<<
5796  *             # Read offset of child
5797  *             child_offset = self.io.read_uint64()
5798  */
5799     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_skip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
5800     __Pyx_GOTREF(__pyx_t_2);
5801     __pyx_t_3 = __Pyx_PyInt_From_long((8 * __pyx_v_bin_index)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
5802     __Pyx_GOTREF(__pyx_t_3);
5803     __pyx_t_4 = NULL;
5804     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5805       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
5806       if (likely(__pyx_t_4)) {
5807         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5808         __Pyx_INCREF(__pyx_t_4);
5809         __Pyx_INCREF(function);
5810         __Pyx_DECREF_SET(__pyx_t_2, function);
5811       }
5812     }
5813     __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);
5814     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5815     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5816     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
5817     __Pyx_GOTREF(__pyx_t_1);
5818     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5819     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5820 
5821     /* "bx/arrays/array_tree.pyx":194
5822  *             self.io.skip( 8 * bin_index )
5823  *             # Read offset of child
5824  *             child_offset = self.io.read_uint64()             # <<<<<<<<<<<<<<
5825  *             # print "co: %s\tbi: %s\tcm: %s\n" % (child_offset, bin_index, child_min)
5826  *             if child_offset == 0:
5827  */
5828     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->io, __pyx_n_s_read_uint64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
5829     __Pyx_GOTREF(__pyx_t_2);
5830     __pyx_t_3 = NULL;
5831     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5832       __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
5833       if (likely(__pyx_t_3)) {
5834         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5835         __Pyx_INCREF(__pyx_t_3);
5836         __Pyx_INCREF(function);
5837         __Pyx_DECREF_SET(__pyx_t_2, function);
5838       }
5839     }
5840     __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
5841     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5842     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error)
5843     __Pyx_GOTREF(__pyx_t_1);
5844     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5845     __pyx_v_child_offset = __pyx_t_1;
5846     __pyx_t_1 = 0;
5847 
5848     /* "bx/arrays/array_tree.pyx":196
5849  *             child_offset = self.io.read_uint64()
5850  *             # print "co: %s\tbi: %s\tcm: %s\n" % (child_offset, bin_index, child_min)
5851  *             if child_offset == 0:             # <<<<<<<<<<<<<<
5852  *                 return -1
5853  *             return self.r_seek_to_node( index, child_min, child_offset, level - 1, desired_level )
5854  */
5855     __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_child_offset, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
5856     __Pyx_GOTREF(__pyx_t_1);
5857     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 196, __pyx_L1_error)
5858     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5859     if (__pyx_t_5) {
5860 
5861       /* "bx/arrays/array_tree.pyx":197
5862  *             # print "co: %s\tbi: %s\tcm: %s\n" % (child_offset, bin_index, child_min)
5863  *             if child_offset == 0:
5864  *                 return -1             # <<<<<<<<<<<<<<
5865  *             return self.r_seek_to_node( index, child_min, child_offset, level - 1, desired_level )
5866  *         else:
5867  */
5868       __pyx_r = -1;
5869       goto __pyx_L0;
5870 
5871       /* "bx/arrays/array_tree.pyx":196
5872  *             child_offset = self.io.read_uint64()
5873  *             # print "co: %s\tbi: %s\tcm: %s\n" % (child_offset, bin_index, child_min)
5874  *             if child_offset == 0:             # <<<<<<<<<<<<<<
5875  *                 return -1
5876  *             return self.r_seek_to_node( index, child_min, child_offset, level - 1, desired_level )
5877  */
5878     }
5879 
5880     /* "bx/arrays/array_tree.pyx":198
5881  *             if child_offset == 0:
5882  *                 return -1
5883  *             return self.r_seek_to_node( index, child_min, child_offset, level - 1, desired_level )             # <<<<<<<<<<<<<<
5884  *         else:
5885  *             # The file pointer is at the start of the desired node, do nothing
5886  */
5887     __pyx_t_8 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_v_child_offset); if (unlikely((__pyx_t_8 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 198, __pyx_L1_error)
5888     __pyx_r = ((struct __pyx_vtabstruct_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self->__pyx_vtab)->r_seek_to_node(__pyx_v_self, __pyx_v_index, __pyx_v_child_min, __pyx_t_8, (__pyx_v_level - 1), __pyx_v_desired_level);
5889     goto __pyx_L0;
5890 
5891     /* "bx/arrays/array_tree.pyx":185
5892  *         cdef int child_size, bin_index, child_min
5893  *         self.io.seek( offset )
5894  *         if level > desired_level:             # <<<<<<<<<<<<<<
5895  *             child_size = self.block_size ** level
5896  *             bin_index = ( index - min ) // ( child_size )
5897  */
5898   }
5899 
5900   /* "bx/arrays/array_tree.pyx":201
5901  *         else:
5902  *             # The file pointer is at the start of the desired node, do nothing
5903  *             return min             # <<<<<<<<<<<<<<
5904  *
5905  * cdef class Summary:
5906  */
5907   /*else*/ {
5908     __pyx_r = __pyx_v_min;
5909     goto __pyx_L0;
5910   }
5911 
5912   /* "bx/arrays/array_tree.pyx":178
5913  *         return self.io.read_raw_array( self.dtype, self.block_size )
5914  *
5915  *     cdef int r_seek_to_node( self, int index, int min, long long offset, int level, int desired_level ):             # <<<<<<<<<<<<<<
5916  *         """
5917  *         Seek to the start of the node at `desired_level` that contains `index`.
5918  */
5919 
5920   /* function exit code */
5921   __pyx_L1_error:;
5922   __Pyx_XDECREF(__pyx_t_1);
5923   __Pyx_XDECREF(__pyx_t_2);
5924   __Pyx_XDECREF(__pyx_t_3);
5925   __Pyx_XDECREF(__pyx_t_4);
5926   __Pyx_XDECREF(__pyx_t_7);
5927   __Pyx_WriteUnraisable("bx.arrays.array_tree.FileArrayTree.r_seek_to_node", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5928   __pyx_r = 0;
5929   __pyx_L0:;
5930   __Pyx_XDECREF(__pyx_v_child_offset);
5931   __Pyx_RefNannyFinishContext();
5932   return __pyx_r;
5933 }
5934 
5935 /* "bx/arrays/array_tree.pyx":124
5936  *     Wrapper for ArrayTree stored in file that reads as little as possible
5937  *     """
5938  *     cdef public int max             # <<<<<<<<<<<<<<
5939  *     cdef public int block_size
5940  *     cdef public object dtype
5941  */
5942 
5943 /* Python wrapper */
5944 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_3max_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_3max_1__get__(PyObject * __pyx_v_self)5945 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_3max_1__get__(PyObject *__pyx_v_self) {
5946   PyObject *__pyx_r = 0;
5947   __Pyx_RefNannyDeclarations
5948   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5949   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_3max___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self));
5950 
5951   /* function exit code */
5952   __Pyx_RefNannyFinishContext();
5953   return __pyx_r;
5954 }
5955 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_3max___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self)5956 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_3max___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self) {
5957   PyObject *__pyx_r = NULL;
5958   __Pyx_RefNannyDeclarations
5959   PyObject *__pyx_t_1 = NULL;
5960   int __pyx_lineno = 0;
5961   const char *__pyx_filename = NULL;
5962   int __pyx_clineno = 0;
5963   __Pyx_RefNannySetupContext("__get__", 0);
5964   __Pyx_XDECREF(__pyx_r);
5965   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
5966   __Pyx_GOTREF(__pyx_t_1);
5967   __pyx_r = __pyx_t_1;
5968   __pyx_t_1 = 0;
5969   goto __pyx_L0;
5970 
5971   /* function exit code */
5972   __pyx_L1_error:;
5973   __Pyx_XDECREF(__pyx_t_1);
5974   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.max.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5975   __pyx_r = NULL;
5976   __pyx_L0:;
5977   __Pyx_XGIVEREF(__pyx_r);
5978   __Pyx_RefNannyFinishContext();
5979   return __pyx_r;
5980 }
5981 
5982 /* Python wrapper */
5983 static int __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_3max_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_3max_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)5984 static int __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_3max_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5985   int __pyx_r;
5986   __Pyx_RefNannyDeclarations
5987   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
5988   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_3max_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self), ((PyObject *)__pyx_v_value));
5989 
5990   /* function exit code */
5991   __Pyx_RefNannyFinishContext();
5992   return __pyx_r;
5993 }
5994 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_3max_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self,PyObject * __pyx_v_value)5995 static int __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_3max_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_value) {
5996   int __pyx_r;
5997   __Pyx_RefNannyDeclarations
5998   int __pyx_t_1;
5999   int __pyx_lineno = 0;
6000   const char *__pyx_filename = NULL;
6001   int __pyx_clineno = 0;
6002   __Pyx_RefNannySetupContext("__set__", 0);
6003   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
6004   __pyx_v_self->max = __pyx_t_1;
6005 
6006   /* function exit code */
6007   __pyx_r = 0;
6008   goto __pyx_L0;
6009   __pyx_L1_error:;
6010   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.max.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6011   __pyx_r = -1;
6012   __pyx_L0:;
6013   __Pyx_RefNannyFinishContext();
6014   return __pyx_r;
6015 }
6016 
6017 /* "bx/arrays/array_tree.pyx":125
6018  *     """
6019  *     cdef public int max
6020  *     cdef public int block_size             # <<<<<<<<<<<<<<
6021  *     cdef public object dtype
6022  *     cdef public int levels
6023  */
6024 
6025 /* Python wrapper */
6026 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_10block_size_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_10block_size_1__get__(PyObject * __pyx_v_self)6027 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_10block_size_1__get__(PyObject *__pyx_v_self) {
6028   PyObject *__pyx_r = 0;
6029   __Pyx_RefNannyDeclarations
6030   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6031   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_10block_size___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self));
6032 
6033   /* function exit code */
6034   __Pyx_RefNannyFinishContext();
6035   return __pyx_r;
6036 }
6037 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_10block_size___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self)6038 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_10block_size___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self) {
6039   PyObject *__pyx_r = NULL;
6040   __Pyx_RefNannyDeclarations
6041   PyObject *__pyx_t_1 = NULL;
6042   int __pyx_lineno = 0;
6043   const char *__pyx_filename = NULL;
6044   int __pyx_clineno = 0;
6045   __Pyx_RefNannySetupContext("__get__", 0);
6046   __Pyx_XDECREF(__pyx_r);
6047   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->block_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
6048   __Pyx_GOTREF(__pyx_t_1);
6049   __pyx_r = __pyx_t_1;
6050   __pyx_t_1 = 0;
6051   goto __pyx_L0;
6052 
6053   /* function exit code */
6054   __pyx_L1_error:;
6055   __Pyx_XDECREF(__pyx_t_1);
6056   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.block_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6057   __pyx_r = NULL;
6058   __pyx_L0:;
6059   __Pyx_XGIVEREF(__pyx_r);
6060   __Pyx_RefNannyFinishContext();
6061   return __pyx_r;
6062 }
6063 
6064 /* Python wrapper */
6065 static int __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_10block_size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_10block_size_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)6066 static int __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_10block_size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
6067   int __pyx_r;
6068   __Pyx_RefNannyDeclarations
6069   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
6070   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_10block_size_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self), ((PyObject *)__pyx_v_value));
6071 
6072   /* function exit code */
6073   __Pyx_RefNannyFinishContext();
6074   return __pyx_r;
6075 }
6076 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_10block_size_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self,PyObject * __pyx_v_value)6077 static int __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_10block_size_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_value) {
6078   int __pyx_r;
6079   __Pyx_RefNannyDeclarations
6080   int __pyx_t_1;
6081   int __pyx_lineno = 0;
6082   const char *__pyx_filename = NULL;
6083   int __pyx_clineno = 0;
6084   __Pyx_RefNannySetupContext("__set__", 0);
6085   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L1_error)
6086   __pyx_v_self->block_size = __pyx_t_1;
6087 
6088   /* function exit code */
6089   __pyx_r = 0;
6090   goto __pyx_L0;
6091   __pyx_L1_error:;
6092   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.block_size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6093   __pyx_r = -1;
6094   __pyx_L0:;
6095   __Pyx_RefNannyFinishContext();
6096   return __pyx_r;
6097 }
6098 
6099 /* "bx/arrays/array_tree.pyx":126
6100  *     cdef public int max
6101  *     cdef public int block_size
6102  *     cdef public object dtype             # <<<<<<<<<<<<<<
6103  *     cdef public int levels
6104  *     cdef public int offset
6105  */
6106 
6107 /* Python wrapper */
6108 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_1__get__(PyObject * __pyx_v_self)6109 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_1__get__(PyObject *__pyx_v_self) {
6110   PyObject *__pyx_r = 0;
6111   __Pyx_RefNannyDeclarations
6112   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6113   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_5dtype___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self));
6114 
6115   /* function exit code */
6116   __Pyx_RefNannyFinishContext();
6117   return __pyx_r;
6118 }
6119 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_5dtype___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self)6120 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_5dtype___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self) {
6121   PyObject *__pyx_r = NULL;
6122   __Pyx_RefNannyDeclarations
6123   __Pyx_RefNannySetupContext("__get__", 0);
6124   __Pyx_XDECREF(__pyx_r);
6125   __Pyx_INCREF(__pyx_v_self->dtype);
6126   __pyx_r = __pyx_v_self->dtype;
6127   goto __pyx_L0;
6128 
6129   /* function exit code */
6130   __pyx_L0:;
6131   __Pyx_XGIVEREF(__pyx_r);
6132   __Pyx_RefNannyFinishContext();
6133   return __pyx_r;
6134 }
6135 
6136 /* Python wrapper */
6137 static int __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)6138 static int __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
6139   int __pyx_r;
6140   __Pyx_RefNannyDeclarations
6141   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
6142   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self), ((PyObject *)__pyx_v_value));
6143 
6144   /* function exit code */
6145   __Pyx_RefNannyFinishContext();
6146   return __pyx_r;
6147 }
6148 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self,PyObject * __pyx_v_value)6149 static int __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_value) {
6150   int __pyx_r;
6151   __Pyx_RefNannyDeclarations
6152   __Pyx_RefNannySetupContext("__set__", 0);
6153   __Pyx_INCREF(__pyx_v_value);
6154   __Pyx_GIVEREF(__pyx_v_value);
6155   __Pyx_GOTREF(__pyx_v_self->dtype);
6156   __Pyx_DECREF(__pyx_v_self->dtype);
6157   __pyx_v_self->dtype = __pyx_v_value;
6158 
6159   /* function exit code */
6160   __pyx_r = 0;
6161   __Pyx_RefNannyFinishContext();
6162   return __pyx_r;
6163 }
6164 
6165 /* Python wrapper */
6166 static int __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_5__del__(PyObject * __pyx_v_self)6167 static int __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_5__del__(PyObject *__pyx_v_self) {
6168   int __pyx_r;
6169   __Pyx_RefNannyDeclarations
6170   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
6171   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_4__del__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self));
6172 
6173   /* function exit code */
6174   __Pyx_RefNannyFinishContext();
6175   return __pyx_r;
6176 }
6177 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self)6178 static int __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self) {
6179   int __pyx_r;
6180   __Pyx_RefNannyDeclarations
6181   __Pyx_RefNannySetupContext("__del__", 0);
6182   __Pyx_INCREF(Py_None);
6183   __Pyx_GIVEREF(Py_None);
6184   __Pyx_GOTREF(__pyx_v_self->dtype);
6185   __Pyx_DECREF(__pyx_v_self->dtype);
6186   __pyx_v_self->dtype = Py_None;
6187 
6188   /* function exit code */
6189   __pyx_r = 0;
6190   __Pyx_RefNannyFinishContext();
6191   return __pyx_r;
6192 }
6193 
6194 /* "bx/arrays/array_tree.pyx":127
6195  *     cdef public int block_size
6196  *     cdef public object dtype
6197  *     cdef public int levels             # <<<<<<<<<<<<<<
6198  *     cdef public int offset
6199  *     cdef public int root_offset
6200  */
6201 
6202 /* Python wrapper */
6203 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_6levels_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_6levels_1__get__(PyObject * __pyx_v_self)6204 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_6levels_1__get__(PyObject *__pyx_v_self) {
6205   PyObject *__pyx_r = 0;
6206   __Pyx_RefNannyDeclarations
6207   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6208   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6levels___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self));
6209 
6210   /* function exit code */
6211   __Pyx_RefNannyFinishContext();
6212   return __pyx_r;
6213 }
6214 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6levels___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self)6215 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6levels___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self) {
6216   PyObject *__pyx_r = NULL;
6217   __Pyx_RefNannyDeclarations
6218   PyObject *__pyx_t_1 = NULL;
6219   int __pyx_lineno = 0;
6220   const char *__pyx_filename = NULL;
6221   int __pyx_clineno = 0;
6222   __Pyx_RefNannySetupContext("__get__", 0);
6223   __Pyx_XDECREF(__pyx_r);
6224   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->levels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
6225   __Pyx_GOTREF(__pyx_t_1);
6226   __pyx_r = __pyx_t_1;
6227   __pyx_t_1 = 0;
6228   goto __pyx_L0;
6229 
6230   /* function exit code */
6231   __pyx_L1_error:;
6232   __Pyx_XDECREF(__pyx_t_1);
6233   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.levels.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6234   __pyx_r = NULL;
6235   __pyx_L0:;
6236   __Pyx_XGIVEREF(__pyx_r);
6237   __Pyx_RefNannyFinishContext();
6238   return __pyx_r;
6239 }
6240 
6241 /* Python wrapper */
6242 static int __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_6levels_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_6levels_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)6243 static int __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_6levels_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
6244   int __pyx_r;
6245   __Pyx_RefNannyDeclarations
6246   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
6247   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6levels_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self), ((PyObject *)__pyx_v_value));
6248 
6249   /* function exit code */
6250   __Pyx_RefNannyFinishContext();
6251   return __pyx_r;
6252 }
6253 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6levels_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self,PyObject * __pyx_v_value)6254 static int __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6levels_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_value) {
6255   int __pyx_r;
6256   __Pyx_RefNannyDeclarations
6257   int __pyx_t_1;
6258   int __pyx_lineno = 0;
6259   const char *__pyx_filename = NULL;
6260   int __pyx_clineno = 0;
6261   __Pyx_RefNannySetupContext("__set__", 0);
6262   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L1_error)
6263   __pyx_v_self->levels = __pyx_t_1;
6264 
6265   /* function exit code */
6266   __pyx_r = 0;
6267   goto __pyx_L0;
6268   __pyx_L1_error:;
6269   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.levels.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6270   __pyx_r = -1;
6271   __pyx_L0:;
6272   __Pyx_RefNannyFinishContext();
6273   return __pyx_r;
6274 }
6275 
6276 /* "bx/arrays/array_tree.pyx":128
6277  *     cdef public object dtype
6278  *     cdef public int levels
6279  *     cdef public int offset             # <<<<<<<<<<<<<<
6280  *     cdef public int root_offset
6281  *     cdef object io
6282  */
6283 
6284 /* Python wrapper */
6285 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_6offset_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_6offset_1__get__(PyObject * __pyx_v_self)6286 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_6offset_1__get__(PyObject *__pyx_v_self) {
6287   PyObject *__pyx_r = 0;
6288   __Pyx_RefNannyDeclarations
6289   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6290   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6offset___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self));
6291 
6292   /* function exit code */
6293   __Pyx_RefNannyFinishContext();
6294   return __pyx_r;
6295 }
6296 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6offset___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self)6297 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6offset___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self) {
6298   PyObject *__pyx_r = NULL;
6299   __Pyx_RefNannyDeclarations
6300   PyObject *__pyx_t_1 = NULL;
6301   int __pyx_lineno = 0;
6302   const char *__pyx_filename = NULL;
6303   int __pyx_clineno = 0;
6304   __Pyx_RefNannySetupContext("__get__", 0);
6305   __Pyx_XDECREF(__pyx_r);
6306   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
6307   __Pyx_GOTREF(__pyx_t_1);
6308   __pyx_r = __pyx_t_1;
6309   __pyx_t_1 = 0;
6310   goto __pyx_L0;
6311 
6312   /* function exit code */
6313   __pyx_L1_error:;
6314   __Pyx_XDECREF(__pyx_t_1);
6315   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6316   __pyx_r = NULL;
6317   __pyx_L0:;
6318   __Pyx_XGIVEREF(__pyx_r);
6319   __Pyx_RefNannyFinishContext();
6320   return __pyx_r;
6321 }
6322 
6323 /* Python wrapper */
6324 static int __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_6offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_6offset_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)6325 static int __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_6offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
6326   int __pyx_r;
6327   __Pyx_RefNannyDeclarations
6328   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
6329   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6offset_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self), ((PyObject *)__pyx_v_value));
6330 
6331   /* function exit code */
6332   __Pyx_RefNannyFinishContext();
6333   return __pyx_r;
6334 }
6335 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6offset_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self,PyObject * __pyx_v_value)6336 static int __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_6offset_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_value) {
6337   int __pyx_r;
6338   __Pyx_RefNannyDeclarations
6339   int __pyx_t_1;
6340   int __pyx_lineno = 0;
6341   const char *__pyx_filename = NULL;
6342   int __pyx_clineno = 0;
6343   __Pyx_RefNannySetupContext("__set__", 0);
6344   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
6345   __pyx_v_self->offset = __pyx_t_1;
6346 
6347   /* function exit code */
6348   __pyx_r = 0;
6349   goto __pyx_L0;
6350   __pyx_L1_error:;
6351   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.offset.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6352   __pyx_r = -1;
6353   __pyx_L0:;
6354   __Pyx_RefNannyFinishContext();
6355   return __pyx_r;
6356 }
6357 
6358 /* "bx/arrays/array_tree.pyx":129
6359  *     cdef public int levels
6360  *     cdef public int offset
6361  *     cdef public int root_offset             # <<<<<<<<<<<<<<
6362  *     cdef object io
6363  *
6364  */
6365 
6366 /* Python wrapper */
6367 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_11root_offset_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_11root_offset_1__get__(PyObject * __pyx_v_self)6368 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_11root_offset_1__get__(PyObject *__pyx_v_self) {
6369   PyObject *__pyx_r = 0;
6370   __Pyx_RefNannyDeclarations
6371   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6372   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_11root_offset___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self));
6373 
6374   /* function exit code */
6375   __Pyx_RefNannyFinishContext();
6376   return __pyx_r;
6377 }
6378 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_11root_offset___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self)6379 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_11root_offset___get__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self) {
6380   PyObject *__pyx_r = NULL;
6381   __Pyx_RefNannyDeclarations
6382   PyObject *__pyx_t_1 = NULL;
6383   int __pyx_lineno = 0;
6384   const char *__pyx_filename = NULL;
6385   int __pyx_clineno = 0;
6386   __Pyx_RefNannySetupContext("__get__", 0);
6387   __Pyx_XDECREF(__pyx_r);
6388   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->root_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
6389   __Pyx_GOTREF(__pyx_t_1);
6390   __pyx_r = __pyx_t_1;
6391   __pyx_t_1 = 0;
6392   goto __pyx_L0;
6393 
6394   /* function exit code */
6395   __pyx_L1_error:;
6396   __Pyx_XDECREF(__pyx_t_1);
6397   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.root_offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6398   __pyx_r = NULL;
6399   __pyx_L0:;
6400   __Pyx_XGIVEREF(__pyx_r);
6401   __Pyx_RefNannyFinishContext();
6402   return __pyx_r;
6403 }
6404 
6405 /* Python wrapper */
6406 static int __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_11root_offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_11root_offset_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)6407 static int __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_11root_offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
6408   int __pyx_r;
6409   __Pyx_RefNannyDeclarations
6410   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
6411   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_11root_offset_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self), ((PyObject *)__pyx_v_value));
6412 
6413   /* function exit code */
6414   __Pyx_RefNannyFinishContext();
6415   return __pyx_r;
6416 }
6417 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_11root_offset_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self,PyObject * __pyx_v_value)6418 static int __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_11root_offset_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v_value) {
6419   int __pyx_r;
6420   __Pyx_RefNannyDeclarations
6421   int __pyx_t_1;
6422   int __pyx_lineno = 0;
6423   const char *__pyx_filename = NULL;
6424   int __pyx_clineno = 0;
6425   __Pyx_RefNannySetupContext("__set__", 0);
6426   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L1_error)
6427   __pyx_v_self->root_offset = __pyx_t_1;
6428 
6429   /* function exit code */
6430   __pyx_r = 0;
6431   goto __pyx_L0;
6432   __pyx_L1_error:;
6433   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.root_offset.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6434   __pyx_r = -1;
6435   __pyx_L0:;
6436   __Pyx_RefNannyFinishContext();
6437   return __pyx_r;
6438 }
6439 
6440 /* "(tree fragment)":1
6441  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
6442  *     cdef tuple state
6443  *     cdef object _dict
6444  */
6445 
6446 /* Python wrapper */
6447 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_9__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)6448 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6449   PyObject *__pyx_r = 0;
6450   __Pyx_RefNannyDeclarations
6451   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6452   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_8__reduce_cython__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self));
6453 
6454   /* function exit code */
6455   __Pyx_RefNannyFinishContext();
6456   return __pyx_r;
6457 }
6458 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_8__reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self)6459 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_8__reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self) {
6460   PyObject *__pyx_v_state = 0;
6461   PyObject *__pyx_v__dict = 0;
6462   int __pyx_v_use_setstate;
6463   PyObject *__pyx_r = NULL;
6464   __Pyx_RefNannyDeclarations
6465   PyObject *__pyx_t_1 = NULL;
6466   PyObject *__pyx_t_2 = NULL;
6467   PyObject *__pyx_t_3 = NULL;
6468   PyObject *__pyx_t_4 = NULL;
6469   PyObject *__pyx_t_5 = NULL;
6470   PyObject *__pyx_t_6 = NULL;
6471   int __pyx_t_7;
6472   int __pyx_t_8;
6473   int __pyx_t_9;
6474   int __pyx_lineno = 0;
6475   const char *__pyx_filename = NULL;
6476   int __pyx_clineno = 0;
6477   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6478 
6479   /* "(tree fragment)":5
6480  *     cdef object _dict
6481  *     cdef bint use_setstate
6482  *     state = (self.block_size, self.dtype, self.io, self.levels, self.max, self.offset, self.root_offset)             # <<<<<<<<<<<<<<
6483  *     _dict = getattr(self, '__dict__', None)
6484  *     if _dict is not None:
6485  */
6486   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->block_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
6487   __Pyx_GOTREF(__pyx_t_1);
6488   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->levels); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6489   __Pyx_GOTREF(__pyx_t_2);
6490   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->max); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
6491   __Pyx_GOTREF(__pyx_t_3);
6492   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->offset); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
6493   __Pyx_GOTREF(__pyx_t_4);
6494   __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->root_offset); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
6495   __Pyx_GOTREF(__pyx_t_5);
6496   __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error)
6497   __Pyx_GOTREF(__pyx_t_6);
6498   __Pyx_GIVEREF(__pyx_t_1);
6499   PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
6500   __Pyx_INCREF(__pyx_v_self->dtype);
6501   __Pyx_GIVEREF(__pyx_v_self->dtype);
6502   PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_self->dtype);
6503   __Pyx_INCREF(__pyx_v_self->io);
6504   __Pyx_GIVEREF(__pyx_v_self->io);
6505   PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_self->io);
6506   __Pyx_GIVEREF(__pyx_t_2);
6507   PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_2);
6508   __Pyx_GIVEREF(__pyx_t_3);
6509   PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_3);
6510   __Pyx_GIVEREF(__pyx_t_4);
6511   PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_4);
6512   __Pyx_GIVEREF(__pyx_t_5);
6513   PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_t_5);
6514   __pyx_t_1 = 0;
6515   __pyx_t_2 = 0;
6516   __pyx_t_3 = 0;
6517   __pyx_t_4 = 0;
6518   __pyx_t_5 = 0;
6519   __pyx_v_state = ((PyObject*)__pyx_t_6);
6520   __pyx_t_6 = 0;
6521 
6522   /* "(tree fragment)":6
6523  *     cdef bint use_setstate
6524  *     state = (self.block_size, self.dtype, self.io, self.levels, self.max, self.offset, self.root_offset)
6525  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
6526  *     if _dict is not None:
6527  *         state += (_dict,)
6528  */
6529   __pyx_t_6 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 6, __pyx_L1_error)
6530   __Pyx_GOTREF(__pyx_t_6);
6531   __pyx_v__dict = __pyx_t_6;
6532   __pyx_t_6 = 0;
6533 
6534   /* "(tree fragment)":7
6535  *     state = (self.block_size, self.dtype, self.io, self.levels, self.max, self.offset, self.root_offset)
6536  *     _dict = getattr(self, '__dict__', None)
6537  *     if _dict is not None:             # <<<<<<<<<<<<<<
6538  *         state += (_dict,)
6539  *         use_setstate = True
6540  */
6541   __pyx_t_7 = (__pyx_v__dict != Py_None);
6542   __pyx_t_8 = (__pyx_t_7 != 0);
6543   if (__pyx_t_8) {
6544 
6545     /* "(tree fragment)":8
6546  *     _dict = getattr(self, '__dict__', None)
6547  *     if _dict is not None:
6548  *         state += (_dict,)             # <<<<<<<<<<<<<<
6549  *         use_setstate = True
6550  *     else:
6551  */
6552     __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 8, __pyx_L1_error)
6553     __Pyx_GOTREF(__pyx_t_6);
6554     __Pyx_INCREF(__pyx_v__dict);
6555     __Pyx_GIVEREF(__pyx_v__dict);
6556     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v__dict);
6557     __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 8, __pyx_L1_error)
6558     __Pyx_GOTREF(__pyx_t_5);
6559     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6560     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_5));
6561     __pyx_t_5 = 0;
6562 
6563     /* "(tree fragment)":9
6564  *     if _dict is not None:
6565  *         state += (_dict,)
6566  *         use_setstate = True             # <<<<<<<<<<<<<<
6567  *     else:
6568  *         use_setstate = self.dtype is not None or self.io is not None
6569  */
6570     __pyx_v_use_setstate = 1;
6571 
6572     /* "(tree fragment)":7
6573  *     state = (self.block_size, self.dtype, self.io, self.levels, self.max, self.offset, self.root_offset)
6574  *     _dict = getattr(self, '__dict__', None)
6575  *     if _dict is not None:             # <<<<<<<<<<<<<<
6576  *         state += (_dict,)
6577  *         use_setstate = True
6578  */
6579     goto __pyx_L3;
6580   }
6581 
6582   /* "(tree fragment)":11
6583  *         use_setstate = True
6584  *     else:
6585  *         use_setstate = self.dtype is not None or self.io is not None             # <<<<<<<<<<<<<<
6586  *     if use_setstate:
6587  *         return __pyx_unpickle_FileArrayTree, (type(self), 0xeabeaf7, None), state
6588  */
6589   /*else*/ {
6590     __pyx_t_7 = (__pyx_v_self->dtype != Py_None);
6591     __pyx_t_9 = (__pyx_t_7 != 0);
6592     if (!__pyx_t_9) {
6593     } else {
6594       __pyx_t_8 = __pyx_t_9;
6595       goto __pyx_L4_bool_binop_done;
6596     }
6597     __pyx_t_9 = (__pyx_v_self->io != Py_None);
6598     __pyx_t_7 = (__pyx_t_9 != 0);
6599     __pyx_t_8 = __pyx_t_7;
6600     __pyx_L4_bool_binop_done:;
6601     __pyx_v_use_setstate = __pyx_t_8;
6602   }
6603   __pyx_L3:;
6604 
6605   /* "(tree fragment)":12
6606  *     else:
6607  *         use_setstate = self.dtype is not None or self.io is not None
6608  *     if use_setstate:             # <<<<<<<<<<<<<<
6609  *         return __pyx_unpickle_FileArrayTree, (type(self), 0xeabeaf7, None), state
6610  *     else:
6611  */
6612   __pyx_t_8 = (__pyx_v_use_setstate != 0);
6613   if (__pyx_t_8) {
6614 
6615     /* "(tree fragment)":13
6616  *         use_setstate = self.dtype is not None or self.io is not None
6617  *     if use_setstate:
6618  *         return __pyx_unpickle_FileArrayTree, (type(self), 0xeabeaf7, None), state             # <<<<<<<<<<<<<<
6619  *     else:
6620  *         return __pyx_unpickle_FileArrayTree, (type(self), 0xeabeaf7, state)
6621  */
6622     __Pyx_XDECREF(__pyx_r);
6623     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_FileArrayTree); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
6624     __Pyx_GOTREF(__pyx_t_5);
6625     __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
6626     __Pyx_GOTREF(__pyx_t_6);
6627     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6628     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6629     PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6630     __Pyx_INCREF(__pyx_int_246147831);
6631     __Pyx_GIVEREF(__pyx_int_246147831);
6632     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_246147831);
6633     __Pyx_INCREF(Py_None);
6634     __Pyx_GIVEREF(Py_None);
6635     PyTuple_SET_ITEM(__pyx_t_6, 2, Py_None);
6636     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
6637     __Pyx_GOTREF(__pyx_t_4);
6638     __Pyx_GIVEREF(__pyx_t_5);
6639     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6640     __Pyx_GIVEREF(__pyx_t_6);
6641     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
6642     __Pyx_INCREF(__pyx_v_state);
6643     __Pyx_GIVEREF(__pyx_v_state);
6644     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state);
6645     __pyx_t_5 = 0;
6646     __pyx_t_6 = 0;
6647     __pyx_r = __pyx_t_4;
6648     __pyx_t_4 = 0;
6649     goto __pyx_L0;
6650 
6651     /* "(tree fragment)":12
6652  *     else:
6653  *         use_setstate = self.dtype is not None or self.io is not None
6654  *     if use_setstate:             # <<<<<<<<<<<<<<
6655  *         return __pyx_unpickle_FileArrayTree, (type(self), 0xeabeaf7, None), state
6656  *     else:
6657  */
6658   }
6659 
6660   /* "(tree fragment)":15
6661  *         return __pyx_unpickle_FileArrayTree, (type(self), 0xeabeaf7, None), state
6662  *     else:
6663  *         return __pyx_unpickle_FileArrayTree, (type(self), 0xeabeaf7, state)             # <<<<<<<<<<<<<<
6664  * def __setstate_cython__(self, __pyx_state):
6665  *     __pyx_unpickle_FileArrayTree__set_state(self, __pyx_state)
6666  */
6667   /*else*/ {
6668     __Pyx_XDECREF(__pyx_r);
6669     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_FileArrayTree); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
6670     __Pyx_GOTREF(__pyx_t_4);
6671     __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
6672     __Pyx_GOTREF(__pyx_t_6);
6673     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6674     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6675     PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6676     __Pyx_INCREF(__pyx_int_246147831);
6677     __Pyx_GIVEREF(__pyx_int_246147831);
6678     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_246147831);
6679     __Pyx_INCREF(__pyx_v_state);
6680     __Pyx_GIVEREF(__pyx_v_state);
6681     PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
6682     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
6683     __Pyx_GOTREF(__pyx_t_5);
6684     __Pyx_GIVEREF(__pyx_t_4);
6685     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
6686     __Pyx_GIVEREF(__pyx_t_6);
6687     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
6688     __pyx_t_4 = 0;
6689     __pyx_t_6 = 0;
6690     __pyx_r = __pyx_t_5;
6691     __pyx_t_5 = 0;
6692     goto __pyx_L0;
6693   }
6694 
6695   /* "(tree fragment)":1
6696  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
6697  *     cdef tuple state
6698  *     cdef object _dict
6699  */
6700 
6701   /* function exit code */
6702   __pyx_L1_error:;
6703   __Pyx_XDECREF(__pyx_t_1);
6704   __Pyx_XDECREF(__pyx_t_2);
6705   __Pyx_XDECREF(__pyx_t_3);
6706   __Pyx_XDECREF(__pyx_t_4);
6707   __Pyx_XDECREF(__pyx_t_5);
6708   __Pyx_XDECREF(__pyx_t_6);
6709   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6710   __pyx_r = NULL;
6711   __pyx_L0:;
6712   __Pyx_XDECREF(__pyx_v_state);
6713   __Pyx_XDECREF(__pyx_v__dict);
6714   __Pyx_XGIVEREF(__pyx_r);
6715   __Pyx_RefNannyFinishContext();
6716   return __pyx_r;
6717 }
6718 
6719 /* "(tree fragment)":16
6720  *     else:
6721  *         return __pyx_unpickle_FileArrayTree, (type(self), 0xeabeaf7, state)
6722  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
6723  *     __pyx_unpickle_FileArrayTree__set_state(self, __pyx_state)
6724  */
6725 
6726 /* Python wrapper */
6727 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_11__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)6728 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6729   PyObject *__pyx_r = 0;
6730   __Pyx_RefNannyDeclarations
6731   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6732   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_10__setstate_cython__(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6733 
6734   /* function exit code */
6735   __Pyx_RefNannyFinishContext();
6736   return __pyx_r;
6737 }
6738 
__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_10__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v_self,PyObject * __pyx_v___pyx_state)6739 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13FileArrayTree_10__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6740   PyObject *__pyx_r = NULL;
6741   __Pyx_RefNannyDeclarations
6742   PyObject *__pyx_t_1 = NULL;
6743   int __pyx_lineno = 0;
6744   const char *__pyx_filename = NULL;
6745   int __pyx_clineno = 0;
6746   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6747 
6748   /* "(tree fragment)":17
6749  *         return __pyx_unpickle_FileArrayTree, (type(self), 0xeabeaf7, state)
6750  * def __setstate_cython__(self, __pyx_state):
6751  *     __pyx_unpickle_FileArrayTree__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
6752  */
6753   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
6754   __pyx_t_1 = __pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_FileArrayTree__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
6755   __Pyx_GOTREF(__pyx_t_1);
6756   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6757 
6758   /* "(tree fragment)":16
6759  *     else:
6760  *         return __pyx_unpickle_FileArrayTree, (type(self), 0xeabeaf7, state)
6761  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
6762  *     __pyx_unpickle_FileArrayTree__set_state(self, __pyx_state)
6763  */
6764 
6765   /* function exit code */
6766   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6767   goto __pyx_L0;
6768   __pyx_L1_error:;
6769   __Pyx_XDECREF(__pyx_t_1);
6770   __Pyx_AddTraceback("bx.arrays.array_tree.FileArrayTree.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6771   __pyx_r = NULL;
6772   __pyx_L0:;
6773   __Pyx_XGIVEREF(__pyx_r);
6774   __Pyx_RefNannyFinishContext();
6775   return __pyx_r;
6776 }
6777 
6778 /* "bx/arrays/array_tree.pyx":208
6779  *     valid count, sum, and sum-of-squares for each child.
6780  *     """
6781  *     cdef public object counts             # <<<<<<<<<<<<<<
6782  *     cdef public object frequencies
6783  *     cdef public object mins
6784  */
6785 
6786 /* Python wrapper */
6787 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7Summary_6counts_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_6counts_1__get__(PyObject * __pyx_v_self)6788 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7Summary_6counts_1__get__(PyObject *__pyx_v_self) {
6789   PyObject *__pyx_r = 0;
6790   __Pyx_RefNannyDeclarations
6791   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6792   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_6counts___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self));
6793 
6794   /* function exit code */
6795   __Pyx_RefNannyFinishContext();
6796   return __pyx_r;
6797 }
6798 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_6counts___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self)6799 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_7Summary_6counts___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self) {
6800   PyObject *__pyx_r = NULL;
6801   __Pyx_RefNannyDeclarations
6802   __Pyx_RefNannySetupContext("__get__", 0);
6803   __Pyx_XDECREF(__pyx_r);
6804   __Pyx_INCREF(__pyx_v_self->counts);
6805   __pyx_r = __pyx_v_self->counts;
6806   goto __pyx_L0;
6807 
6808   /* function exit code */
6809   __pyx_L0:;
6810   __Pyx_XGIVEREF(__pyx_r);
6811   __Pyx_RefNannyFinishContext();
6812   return __pyx_r;
6813 }
6814 
6815 /* Python wrapper */
6816 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_6counts_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_6counts_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)6817 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_6counts_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
6818   int __pyx_r;
6819   __Pyx_RefNannyDeclarations
6820   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
6821   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_6counts_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self), ((PyObject *)__pyx_v_value));
6822 
6823   /* function exit code */
6824   __Pyx_RefNannyFinishContext();
6825   return __pyx_r;
6826 }
6827 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_6counts_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self,PyObject * __pyx_v_value)6828 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_6counts_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self, PyObject *__pyx_v_value) {
6829   int __pyx_r;
6830   __Pyx_RefNannyDeclarations
6831   __Pyx_RefNannySetupContext("__set__", 0);
6832   __Pyx_INCREF(__pyx_v_value);
6833   __Pyx_GIVEREF(__pyx_v_value);
6834   __Pyx_GOTREF(__pyx_v_self->counts);
6835   __Pyx_DECREF(__pyx_v_self->counts);
6836   __pyx_v_self->counts = __pyx_v_value;
6837 
6838   /* function exit code */
6839   __pyx_r = 0;
6840   __Pyx_RefNannyFinishContext();
6841   return __pyx_r;
6842 }
6843 
6844 /* Python wrapper */
6845 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_6counts_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_6counts_5__del__(PyObject * __pyx_v_self)6846 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_6counts_5__del__(PyObject *__pyx_v_self) {
6847   int __pyx_r;
6848   __Pyx_RefNannyDeclarations
6849   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
6850   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_6counts_4__del__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self));
6851 
6852   /* function exit code */
6853   __Pyx_RefNannyFinishContext();
6854   return __pyx_r;
6855 }
6856 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_6counts_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self)6857 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_6counts_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self) {
6858   int __pyx_r;
6859   __Pyx_RefNannyDeclarations
6860   __Pyx_RefNannySetupContext("__del__", 0);
6861   __Pyx_INCREF(Py_None);
6862   __Pyx_GIVEREF(Py_None);
6863   __Pyx_GOTREF(__pyx_v_self->counts);
6864   __Pyx_DECREF(__pyx_v_self->counts);
6865   __pyx_v_self->counts = Py_None;
6866 
6867   /* function exit code */
6868   __pyx_r = 0;
6869   __Pyx_RefNannyFinishContext();
6870   return __pyx_r;
6871 }
6872 
6873 /* "bx/arrays/array_tree.pyx":209
6874  *     """
6875  *     cdef public object counts
6876  *     cdef public object frequencies             # <<<<<<<<<<<<<<
6877  *     cdef public object mins
6878  *     cdef public object maxs
6879  */
6880 
6881 /* Python wrapper */
6882 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7Summary_11frequencies_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_11frequencies_1__get__(PyObject * __pyx_v_self)6883 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7Summary_11frequencies_1__get__(PyObject *__pyx_v_self) {
6884   PyObject *__pyx_r = 0;
6885   __Pyx_RefNannyDeclarations
6886   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6887   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_11frequencies___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self));
6888 
6889   /* function exit code */
6890   __Pyx_RefNannyFinishContext();
6891   return __pyx_r;
6892 }
6893 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_11frequencies___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self)6894 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_7Summary_11frequencies___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self) {
6895   PyObject *__pyx_r = NULL;
6896   __Pyx_RefNannyDeclarations
6897   __Pyx_RefNannySetupContext("__get__", 0);
6898   __Pyx_XDECREF(__pyx_r);
6899   __Pyx_INCREF(__pyx_v_self->frequencies);
6900   __pyx_r = __pyx_v_self->frequencies;
6901   goto __pyx_L0;
6902 
6903   /* function exit code */
6904   __pyx_L0:;
6905   __Pyx_XGIVEREF(__pyx_r);
6906   __Pyx_RefNannyFinishContext();
6907   return __pyx_r;
6908 }
6909 
6910 /* Python wrapper */
6911 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_11frequencies_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_11frequencies_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)6912 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_11frequencies_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
6913   int __pyx_r;
6914   __Pyx_RefNannyDeclarations
6915   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
6916   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_11frequencies_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self), ((PyObject *)__pyx_v_value));
6917 
6918   /* function exit code */
6919   __Pyx_RefNannyFinishContext();
6920   return __pyx_r;
6921 }
6922 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_11frequencies_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self,PyObject * __pyx_v_value)6923 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_11frequencies_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self, PyObject *__pyx_v_value) {
6924   int __pyx_r;
6925   __Pyx_RefNannyDeclarations
6926   __Pyx_RefNannySetupContext("__set__", 0);
6927   __Pyx_INCREF(__pyx_v_value);
6928   __Pyx_GIVEREF(__pyx_v_value);
6929   __Pyx_GOTREF(__pyx_v_self->frequencies);
6930   __Pyx_DECREF(__pyx_v_self->frequencies);
6931   __pyx_v_self->frequencies = __pyx_v_value;
6932 
6933   /* function exit code */
6934   __pyx_r = 0;
6935   __Pyx_RefNannyFinishContext();
6936   return __pyx_r;
6937 }
6938 
6939 /* Python wrapper */
6940 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_11frequencies_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_11frequencies_5__del__(PyObject * __pyx_v_self)6941 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_11frequencies_5__del__(PyObject *__pyx_v_self) {
6942   int __pyx_r;
6943   __Pyx_RefNannyDeclarations
6944   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
6945   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_11frequencies_4__del__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self));
6946 
6947   /* function exit code */
6948   __Pyx_RefNannyFinishContext();
6949   return __pyx_r;
6950 }
6951 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_11frequencies_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self)6952 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_11frequencies_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self) {
6953   int __pyx_r;
6954   __Pyx_RefNannyDeclarations
6955   __Pyx_RefNannySetupContext("__del__", 0);
6956   __Pyx_INCREF(Py_None);
6957   __Pyx_GIVEREF(Py_None);
6958   __Pyx_GOTREF(__pyx_v_self->frequencies);
6959   __Pyx_DECREF(__pyx_v_self->frequencies);
6960   __pyx_v_self->frequencies = Py_None;
6961 
6962   /* function exit code */
6963   __pyx_r = 0;
6964   __Pyx_RefNannyFinishContext();
6965   return __pyx_r;
6966 }
6967 
6968 /* "bx/arrays/array_tree.pyx":210
6969  *     cdef public object counts
6970  *     cdef public object frequencies
6971  *     cdef public object mins             # <<<<<<<<<<<<<<
6972  *     cdef public object maxs
6973  *     cdef public object sums
6974  */
6975 
6976 /* Python wrapper */
6977 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7Summary_4mins_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_4mins_1__get__(PyObject * __pyx_v_self)6978 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7Summary_4mins_1__get__(PyObject *__pyx_v_self) {
6979   PyObject *__pyx_r = 0;
6980   __Pyx_RefNannyDeclarations
6981   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6982   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_4mins___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self));
6983 
6984   /* function exit code */
6985   __Pyx_RefNannyFinishContext();
6986   return __pyx_r;
6987 }
6988 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_4mins___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self)6989 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_7Summary_4mins___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self) {
6990   PyObject *__pyx_r = NULL;
6991   __Pyx_RefNannyDeclarations
6992   __Pyx_RefNannySetupContext("__get__", 0);
6993   __Pyx_XDECREF(__pyx_r);
6994   __Pyx_INCREF(__pyx_v_self->mins);
6995   __pyx_r = __pyx_v_self->mins;
6996   goto __pyx_L0;
6997 
6998   /* function exit code */
6999   __pyx_L0:;
7000   __Pyx_XGIVEREF(__pyx_r);
7001   __Pyx_RefNannyFinishContext();
7002   return __pyx_r;
7003 }
7004 
7005 /* Python wrapper */
7006 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_4mins_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_4mins_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)7007 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_4mins_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
7008   int __pyx_r;
7009   __Pyx_RefNannyDeclarations
7010   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
7011   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_4mins_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self), ((PyObject *)__pyx_v_value));
7012 
7013   /* function exit code */
7014   __Pyx_RefNannyFinishContext();
7015   return __pyx_r;
7016 }
7017 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_4mins_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self,PyObject * __pyx_v_value)7018 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_4mins_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self, PyObject *__pyx_v_value) {
7019   int __pyx_r;
7020   __Pyx_RefNannyDeclarations
7021   __Pyx_RefNannySetupContext("__set__", 0);
7022   __Pyx_INCREF(__pyx_v_value);
7023   __Pyx_GIVEREF(__pyx_v_value);
7024   __Pyx_GOTREF(__pyx_v_self->mins);
7025   __Pyx_DECREF(__pyx_v_self->mins);
7026   __pyx_v_self->mins = __pyx_v_value;
7027 
7028   /* function exit code */
7029   __pyx_r = 0;
7030   __Pyx_RefNannyFinishContext();
7031   return __pyx_r;
7032 }
7033 
7034 /* Python wrapper */
7035 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_4mins_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_4mins_5__del__(PyObject * __pyx_v_self)7036 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_4mins_5__del__(PyObject *__pyx_v_self) {
7037   int __pyx_r;
7038   __Pyx_RefNannyDeclarations
7039   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
7040   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_4mins_4__del__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self));
7041 
7042   /* function exit code */
7043   __Pyx_RefNannyFinishContext();
7044   return __pyx_r;
7045 }
7046 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_4mins_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self)7047 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_4mins_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self) {
7048   int __pyx_r;
7049   __Pyx_RefNannyDeclarations
7050   __Pyx_RefNannySetupContext("__del__", 0);
7051   __Pyx_INCREF(Py_None);
7052   __Pyx_GIVEREF(Py_None);
7053   __Pyx_GOTREF(__pyx_v_self->mins);
7054   __Pyx_DECREF(__pyx_v_self->mins);
7055   __pyx_v_self->mins = Py_None;
7056 
7057   /* function exit code */
7058   __pyx_r = 0;
7059   __Pyx_RefNannyFinishContext();
7060   return __pyx_r;
7061 }
7062 
7063 /* "bx/arrays/array_tree.pyx":211
7064  *     cdef public object frequencies
7065  *     cdef public object mins
7066  *     cdef public object maxs             # <<<<<<<<<<<<<<
7067  *     cdef public object sums
7068  *     cdef public object sumsquares
7069  */
7070 
7071 /* Python wrapper */
7072 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7Summary_4maxs_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_4maxs_1__get__(PyObject * __pyx_v_self)7073 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7Summary_4maxs_1__get__(PyObject *__pyx_v_self) {
7074   PyObject *__pyx_r = 0;
7075   __Pyx_RefNannyDeclarations
7076   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
7077   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_4maxs___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self));
7078 
7079   /* function exit code */
7080   __Pyx_RefNannyFinishContext();
7081   return __pyx_r;
7082 }
7083 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_4maxs___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self)7084 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_7Summary_4maxs___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self) {
7085   PyObject *__pyx_r = NULL;
7086   __Pyx_RefNannyDeclarations
7087   __Pyx_RefNannySetupContext("__get__", 0);
7088   __Pyx_XDECREF(__pyx_r);
7089   __Pyx_INCREF(__pyx_v_self->maxs);
7090   __pyx_r = __pyx_v_self->maxs;
7091   goto __pyx_L0;
7092 
7093   /* function exit code */
7094   __pyx_L0:;
7095   __Pyx_XGIVEREF(__pyx_r);
7096   __Pyx_RefNannyFinishContext();
7097   return __pyx_r;
7098 }
7099 
7100 /* Python wrapper */
7101 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_4maxs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_4maxs_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)7102 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_4maxs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
7103   int __pyx_r;
7104   __Pyx_RefNannyDeclarations
7105   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
7106   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_4maxs_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self), ((PyObject *)__pyx_v_value));
7107 
7108   /* function exit code */
7109   __Pyx_RefNannyFinishContext();
7110   return __pyx_r;
7111 }
7112 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_4maxs_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self,PyObject * __pyx_v_value)7113 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_4maxs_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self, PyObject *__pyx_v_value) {
7114   int __pyx_r;
7115   __Pyx_RefNannyDeclarations
7116   __Pyx_RefNannySetupContext("__set__", 0);
7117   __Pyx_INCREF(__pyx_v_value);
7118   __Pyx_GIVEREF(__pyx_v_value);
7119   __Pyx_GOTREF(__pyx_v_self->maxs);
7120   __Pyx_DECREF(__pyx_v_self->maxs);
7121   __pyx_v_self->maxs = __pyx_v_value;
7122 
7123   /* function exit code */
7124   __pyx_r = 0;
7125   __Pyx_RefNannyFinishContext();
7126   return __pyx_r;
7127 }
7128 
7129 /* Python wrapper */
7130 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_4maxs_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_4maxs_5__del__(PyObject * __pyx_v_self)7131 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_4maxs_5__del__(PyObject *__pyx_v_self) {
7132   int __pyx_r;
7133   __Pyx_RefNannyDeclarations
7134   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
7135   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_4maxs_4__del__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self));
7136 
7137   /* function exit code */
7138   __Pyx_RefNannyFinishContext();
7139   return __pyx_r;
7140 }
7141 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_4maxs_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self)7142 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_4maxs_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self) {
7143   int __pyx_r;
7144   __Pyx_RefNannyDeclarations
7145   __Pyx_RefNannySetupContext("__del__", 0);
7146   __Pyx_INCREF(Py_None);
7147   __Pyx_GIVEREF(Py_None);
7148   __Pyx_GOTREF(__pyx_v_self->maxs);
7149   __Pyx_DECREF(__pyx_v_self->maxs);
7150   __pyx_v_self->maxs = Py_None;
7151 
7152   /* function exit code */
7153   __pyx_r = 0;
7154   __Pyx_RefNannyFinishContext();
7155   return __pyx_r;
7156 }
7157 
7158 /* "bx/arrays/array_tree.pyx":212
7159  *     cdef public object mins
7160  *     cdef public object maxs
7161  *     cdef public object sums             # <<<<<<<<<<<<<<
7162  *     cdef public object sumsquares
7163  *
7164  */
7165 
7166 /* Python wrapper */
7167 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7Summary_4sums_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_4sums_1__get__(PyObject * __pyx_v_self)7168 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7Summary_4sums_1__get__(PyObject *__pyx_v_self) {
7169   PyObject *__pyx_r = 0;
7170   __Pyx_RefNannyDeclarations
7171   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
7172   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_4sums___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self));
7173 
7174   /* function exit code */
7175   __Pyx_RefNannyFinishContext();
7176   return __pyx_r;
7177 }
7178 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_4sums___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self)7179 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_7Summary_4sums___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self) {
7180   PyObject *__pyx_r = NULL;
7181   __Pyx_RefNannyDeclarations
7182   __Pyx_RefNannySetupContext("__get__", 0);
7183   __Pyx_XDECREF(__pyx_r);
7184   __Pyx_INCREF(__pyx_v_self->sums);
7185   __pyx_r = __pyx_v_self->sums;
7186   goto __pyx_L0;
7187 
7188   /* function exit code */
7189   __pyx_L0:;
7190   __Pyx_XGIVEREF(__pyx_r);
7191   __Pyx_RefNannyFinishContext();
7192   return __pyx_r;
7193 }
7194 
7195 /* Python wrapper */
7196 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_4sums_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_4sums_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)7197 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_4sums_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
7198   int __pyx_r;
7199   __Pyx_RefNannyDeclarations
7200   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
7201   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_4sums_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self), ((PyObject *)__pyx_v_value));
7202 
7203   /* function exit code */
7204   __Pyx_RefNannyFinishContext();
7205   return __pyx_r;
7206 }
7207 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_4sums_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self,PyObject * __pyx_v_value)7208 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_4sums_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self, PyObject *__pyx_v_value) {
7209   int __pyx_r;
7210   __Pyx_RefNannyDeclarations
7211   __Pyx_RefNannySetupContext("__set__", 0);
7212   __Pyx_INCREF(__pyx_v_value);
7213   __Pyx_GIVEREF(__pyx_v_value);
7214   __Pyx_GOTREF(__pyx_v_self->sums);
7215   __Pyx_DECREF(__pyx_v_self->sums);
7216   __pyx_v_self->sums = __pyx_v_value;
7217 
7218   /* function exit code */
7219   __pyx_r = 0;
7220   __Pyx_RefNannyFinishContext();
7221   return __pyx_r;
7222 }
7223 
7224 /* Python wrapper */
7225 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_4sums_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_4sums_5__del__(PyObject * __pyx_v_self)7226 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_4sums_5__del__(PyObject *__pyx_v_self) {
7227   int __pyx_r;
7228   __Pyx_RefNannyDeclarations
7229   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
7230   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_4sums_4__del__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self));
7231 
7232   /* function exit code */
7233   __Pyx_RefNannyFinishContext();
7234   return __pyx_r;
7235 }
7236 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_4sums_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self)7237 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_4sums_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self) {
7238   int __pyx_r;
7239   __Pyx_RefNannyDeclarations
7240   __Pyx_RefNannySetupContext("__del__", 0);
7241   __Pyx_INCREF(Py_None);
7242   __Pyx_GIVEREF(Py_None);
7243   __Pyx_GOTREF(__pyx_v_self->sums);
7244   __Pyx_DECREF(__pyx_v_self->sums);
7245   __pyx_v_self->sums = Py_None;
7246 
7247   /* function exit code */
7248   __pyx_r = 0;
7249   __Pyx_RefNannyFinishContext();
7250   return __pyx_r;
7251 }
7252 
7253 /* "bx/arrays/array_tree.pyx":213
7254  *     cdef public object maxs
7255  *     cdef public object sums
7256  *     cdef public object sumsquares             # <<<<<<<<<<<<<<
7257  *
7258  * cdef class ArrayTreeNode
7259  */
7260 
7261 /* Python wrapper */
7262 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7Summary_10sumsquares_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_10sumsquares_1__get__(PyObject * __pyx_v_self)7263 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7Summary_10sumsquares_1__get__(PyObject *__pyx_v_self) {
7264   PyObject *__pyx_r = 0;
7265   __Pyx_RefNannyDeclarations
7266   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
7267   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_10sumsquares___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self));
7268 
7269   /* function exit code */
7270   __Pyx_RefNannyFinishContext();
7271   return __pyx_r;
7272 }
7273 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_10sumsquares___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self)7274 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_7Summary_10sumsquares___get__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self) {
7275   PyObject *__pyx_r = NULL;
7276   __Pyx_RefNannyDeclarations
7277   __Pyx_RefNannySetupContext("__get__", 0);
7278   __Pyx_XDECREF(__pyx_r);
7279   __Pyx_INCREF(__pyx_v_self->sumsquares);
7280   __pyx_r = __pyx_v_self->sumsquares;
7281   goto __pyx_L0;
7282 
7283   /* function exit code */
7284   __pyx_L0:;
7285   __Pyx_XGIVEREF(__pyx_r);
7286   __Pyx_RefNannyFinishContext();
7287   return __pyx_r;
7288 }
7289 
7290 /* Python wrapper */
7291 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_10sumsquares_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_10sumsquares_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)7292 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_10sumsquares_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
7293   int __pyx_r;
7294   __Pyx_RefNannyDeclarations
7295   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
7296   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_10sumsquares_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self), ((PyObject *)__pyx_v_value));
7297 
7298   /* function exit code */
7299   __Pyx_RefNannyFinishContext();
7300   return __pyx_r;
7301 }
7302 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_10sumsquares_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self,PyObject * __pyx_v_value)7303 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_10sumsquares_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self, PyObject *__pyx_v_value) {
7304   int __pyx_r;
7305   __Pyx_RefNannyDeclarations
7306   __Pyx_RefNannySetupContext("__set__", 0);
7307   __Pyx_INCREF(__pyx_v_value);
7308   __Pyx_GIVEREF(__pyx_v_value);
7309   __Pyx_GOTREF(__pyx_v_self->sumsquares);
7310   __Pyx_DECREF(__pyx_v_self->sumsquares);
7311   __pyx_v_self->sumsquares = __pyx_v_value;
7312 
7313   /* function exit code */
7314   __pyx_r = 0;
7315   __Pyx_RefNannyFinishContext();
7316   return __pyx_r;
7317 }
7318 
7319 /* Python wrapper */
7320 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_10sumsquares_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_10sumsquares_5__del__(PyObject * __pyx_v_self)7321 static int __pyx_pw_2bx_6arrays_10array_tree_7Summary_10sumsquares_5__del__(PyObject *__pyx_v_self) {
7322   int __pyx_r;
7323   __Pyx_RefNannyDeclarations
7324   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
7325   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_10sumsquares_4__del__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self));
7326 
7327   /* function exit code */
7328   __Pyx_RefNannyFinishContext();
7329   return __pyx_r;
7330 }
7331 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_10sumsquares_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self)7332 static int __pyx_pf_2bx_6arrays_10array_tree_7Summary_10sumsquares_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self) {
7333   int __pyx_r;
7334   __Pyx_RefNannyDeclarations
7335   __Pyx_RefNannySetupContext("__del__", 0);
7336   __Pyx_INCREF(Py_None);
7337   __Pyx_GIVEREF(Py_None);
7338   __Pyx_GOTREF(__pyx_v_self->sumsquares);
7339   __Pyx_DECREF(__pyx_v_self->sumsquares);
7340   __pyx_v_self->sumsquares = Py_None;
7341 
7342   /* function exit code */
7343   __pyx_r = 0;
7344   __Pyx_RefNannyFinishContext();
7345   return __pyx_r;
7346 }
7347 
7348 /* "(tree fragment)":1
7349  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
7350  *     cdef tuple state
7351  *     cdef object _dict
7352  */
7353 
7354 /* Python wrapper */
7355 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7Summary_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)7356 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7Summary_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7357   PyObject *__pyx_r = 0;
7358   __Pyx_RefNannyDeclarations
7359   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7360   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary___reduce_cython__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self));
7361 
7362   /* function exit code */
7363   __Pyx_RefNannyFinishContext();
7364   return __pyx_r;
7365 }
7366 
__pyx_pf_2bx_6arrays_10array_tree_7Summary___reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self)7367 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_7Summary___reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self) {
7368   PyObject *__pyx_v_state = 0;
7369   PyObject *__pyx_v__dict = 0;
7370   int __pyx_v_use_setstate;
7371   PyObject *__pyx_r = NULL;
7372   __Pyx_RefNannyDeclarations
7373   PyObject *__pyx_t_1 = NULL;
7374   int __pyx_t_2;
7375   int __pyx_t_3;
7376   PyObject *__pyx_t_4 = NULL;
7377   int __pyx_t_5;
7378   PyObject *__pyx_t_6 = NULL;
7379   int __pyx_lineno = 0;
7380   const char *__pyx_filename = NULL;
7381   int __pyx_clineno = 0;
7382   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
7383 
7384   /* "(tree fragment)":5
7385  *     cdef object _dict
7386  *     cdef bint use_setstate
7387  *     state = (self.counts, self.frequencies, self.maxs, self.mins, self.sums, self.sumsquares)             # <<<<<<<<<<<<<<
7388  *     _dict = getattr(self, '__dict__', None)
7389  *     if _dict is not None:
7390  */
7391   __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
7392   __Pyx_GOTREF(__pyx_t_1);
7393   __Pyx_INCREF(__pyx_v_self->counts);
7394   __Pyx_GIVEREF(__pyx_v_self->counts);
7395   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->counts);
7396   __Pyx_INCREF(__pyx_v_self->frequencies);
7397   __Pyx_GIVEREF(__pyx_v_self->frequencies);
7398   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->frequencies);
7399   __Pyx_INCREF(__pyx_v_self->maxs);
7400   __Pyx_GIVEREF(__pyx_v_self->maxs);
7401   PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_self->maxs);
7402   __Pyx_INCREF(__pyx_v_self->mins);
7403   __Pyx_GIVEREF(__pyx_v_self->mins);
7404   PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_self->mins);
7405   __Pyx_INCREF(__pyx_v_self->sums);
7406   __Pyx_GIVEREF(__pyx_v_self->sums);
7407   PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_self->sums);
7408   __Pyx_INCREF(__pyx_v_self->sumsquares);
7409   __Pyx_GIVEREF(__pyx_v_self->sumsquares);
7410   PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_self->sumsquares);
7411   __pyx_v_state = ((PyObject*)__pyx_t_1);
7412   __pyx_t_1 = 0;
7413 
7414   /* "(tree fragment)":6
7415  *     cdef bint use_setstate
7416  *     state = (self.counts, self.frequencies, self.maxs, self.mins, self.sums, self.sumsquares)
7417  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
7418  *     if _dict is not None:
7419  *         state += (_dict,)
7420  */
7421   __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
7422   __Pyx_GOTREF(__pyx_t_1);
7423   __pyx_v__dict = __pyx_t_1;
7424   __pyx_t_1 = 0;
7425 
7426   /* "(tree fragment)":7
7427  *     state = (self.counts, self.frequencies, self.maxs, self.mins, self.sums, self.sumsquares)
7428  *     _dict = getattr(self, '__dict__', None)
7429  *     if _dict is not None:             # <<<<<<<<<<<<<<
7430  *         state += (_dict,)
7431  *         use_setstate = True
7432  */
7433   __pyx_t_2 = (__pyx_v__dict != Py_None);
7434   __pyx_t_3 = (__pyx_t_2 != 0);
7435   if (__pyx_t_3) {
7436 
7437     /* "(tree fragment)":8
7438  *     _dict = getattr(self, '__dict__', None)
7439  *     if _dict is not None:
7440  *         state += (_dict,)             # <<<<<<<<<<<<<<
7441  *         use_setstate = True
7442  *     else:
7443  */
7444     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
7445     __Pyx_GOTREF(__pyx_t_1);
7446     __Pyx_INCREF(__pyx_v__dict);
7447     __Pyx_GIVEREF(__pyx_v__dict);
7448     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
7449     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
7450     __Pyx_GOTREF(__pyx_t_4);
7451     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7452     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
7453     __pyx_t_4 = 0;
7454 
7455     /* "(tree fragment)":9
7456  *     if _dict is not None:
7457  *         state += (_dict,)
7458  *         use_setstate = True             # <<<<<<<<<<<<<<
7459  *     else:
7460  *         use_setstate = self.counts is not None or self.frequencies is not None or self.maxs is not None or self.mins is not None or self.sums is not None or self.sumsquares is not None
7461  */
7462     __pyx_v_use_setstate = 1;
7463 
7464     /* "(tree fragment)":7
7465  *     state = (self.counts, self.frequencies, self.maxs, self.mins, self.sums, self.sumsquares)
7466  *     _dict = getattr(self, '__dict__', None)
7467  *     if _dict is not None:             # <<<<<<<<<<<<<<
7468  *         state += (_dict,)
7469  *         use_setstate = True
7470  */
7471     goto __pyx_L3;
7472   }
7473 
7474   /* "(tree fragment)":11
7475  *         use_setstate = True
7476  *     else:
7477  *         use_setstate = self.counts is not None or self.frequencies is not None or self.maxs is not None or self.mins is not None or self.sums is not None or self.sumsquares is not None             # <<<<<<<<<<<<<<
7478  *     if use_setstate:
7479  *         return __pyx_unpickle_Summary, (type(self), 0x0f4bfc5, None), state
7480  */
7481   /*else*/ {
7482     __pyx_t_2 = (__pyx_v_self->counts != Py_None);
7483     __pyx_t_5 = (__pyx_t_2 != 0);
7484     if (!__pyx_t_5) {
7485     } else {
7486       __pyx_t_3 = __pyx_t_5;
7487       goto __pyx_L4_bool_binop_done;
7488     }
7489     __pyx_t_5 = (__pyx_v_self->frequencies != Py_None);
7490     __pyx_t_2 = (__pyx_t_5 != 0);
7491     if (!__pyx_t_2) {
7492     } else {
7493       __pyx_t_3 = __pyx_t_2;
7494       goto __pyx_L4_bool_binop_done;
7495     }
7496     __pyx_t_2 = (__pyx_v_self->maxs != Py_None);
7497     __pyx_t_5 = (__pyx_t_2 != 0);
7498     if (!__pyx_t_5) {
7499     } else {
7500       __pyx_t_3 = __pyx_t_5;
7501       goto __pyx_L4_bool_binop_done;
7502     }
7503     __pyx_t_5 = (__pyx_v_self->mins != Py_None);
7504     __pyx_t_2 = (__pyx_t_5 != 0);
7505     if (!__pyx_t_2) {
7506     } else {
7507       __pyx_t_3 = __pyx_t_2;
7508       goto __pyx_L4_bool_binop_done;
7509     }
7510     __pyx_t_2 = (__pyx_v_self->sums != Py_None);
7511     __pyx_t_5 = (__pyx_t_2 != 0);
7512     if (!__pyx_t_5) {
7513     } else {
7514       __pyx_t_3 = __pyx_t_5;
7515       goto __pyx_L4_bool_binop_done;
7516     }
7517     __pyx_t_5 = (__pyx_v_self->sumsquares != Py_None);
7518     __pyx_t_2 = (__pyx_t_5 != 0);
7519     __pyx_t_3 = __pyx_t_2;
7520     __pyx_L4_bool_binop_done:;
7521     __pyx_v_use_setstate = __pyx_t_3;
7522   }
7523   __pyx_L3:;
7524 
7525   /* "(tree fragment)":12
7526  *     else:
7527  *         use_setstate = self.counts is not None or self.frequencies is not None or self.maxs is not None or self.mins is not None or self.sums is not None or self.sumsquares is not None
7528  *     if use_setstate:             # <<<<<<<<<<<<<<
7529  *         return __pyx_unpickle_Summary, (type(self), 0x0f4bfc5, None), state
7530  *     else:
7531  */
7532   __pyx_t_3 = (__pyx_v_use_setstate != 0);
7533   if (__pyx_t_3) {
7534 
7535     /* "(tree fragment)":13
7536  *         use_setstate = self.counts is not None or self.frequencies is not None or self.maxs is not None or self.mins is not None or self.sums is not None or self.sumsquares is not None
7537  *     if use_setstate:
7538  *         return __pyx_unpickle_Summary, (type(self), 0x0f4bfc5, None), state             # <<<<<<<<<<<<<<
7539  *     else:
7540  *         return __pyx_unpickle_Summary, (type(self), 0x0f4bfc5, state)
7541  */
7542     __Pyx_XDECREF(__pyx_r);
7543     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Summary); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
7544     __Pyx_GOTREF(__pyx_t_4);
7545     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
7546     __Pyx_GOTREF(__pyx_t_1);
7547     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7548     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7549     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7550     __Pyx_INCREF(__pyx_int_16039877);
7551     __Pyx_GIVEREF(__pyx_int_16039877);
7552     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_16039877);
7553     __Pyx_INCREF(Py_None);
7554     __Pyx_GIVEREF(Py_None);
7555     PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
7556     __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
7557     __Pyx_GOTREF(__pyx_t_6);
7558     __Pyx_GIVEREF(__pyx_t_4);
7559     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
7560     __Pyx_GIVEREF(__pyx_t_1);
7561     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
7562     __Pyx_INCREF(__pyx_v_state);
7563     __Pyx_GIVEREF(__pyx_v_state);
7564     PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
7565     __pyx_t_4 = 0;
7566     __pyx_t_1 = 0;
7567     __pyx_r = __pyx_t_6;
7568     __pyx_t_6 = 0;
7569     goto __pyx_L0;
7570 
7571     /* "(tree fragment)":12
7572  *     else:
7573  *         use_setstate = self.counts is not None or self.frequencies is not None or self.maxs is not None or self.mins is not None or self.sums is not None or self.sumsquares is not None
7574  *     if use_setstate:             # <<<<<<<<<<<<<<
7575  *         return __pyx_unpickle_Summary, (type(self), 0x0f4bfc5, None), state
7576  *     else:
7577  */
7578   }
7579 
7580   /* "(tree fragment)":15
7581  *         return __pyx_unpickle_Summary, (type(self), 0x0f4bfc5, None), state
7582  *     else:
7583  *         return __pyx_unpickle_Summary, (type(self), 0x0f4bfc5, state)             # <<<<<<<<<<<<<<
7584  * def __setstate_cython__(self, __pyx_state):
7585  *     __pyx_unpickle_Summary__set_state(self, __pyx_state)
7586  */
7587   /*else*/ {
7588     __Pyx_XDECREF(__pyx_r);
7589     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_Summary); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
7590     __Pyx_GOTREF(__pyx_t_6);
7591     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
7592     __Pyx_GOTREF(__pyx_t_1);
7593     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7594     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7595     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7596     __Pyx_INCREF(__pyx_int_16039877);
7597     __Pyx_GIVEREF(__pyx_int_16039877);
7598     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_16039877);
7599     __Pyx_INCREF(__pyx_v_state);
7600     __Pyx_GIVEREF(__pyx_v_state);
7601     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
7602     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
7603     __Pyx_GOTREF(__pyx_t_4);
7604     __Pyx_GIVEREF(__pyx_t_6);
7605     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
7606     __Pyx_GIVEREF(__pyx_t_1);
7607     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
7608     __pyx_t_6 = 0;
7609     __pyx_t_1 = 0;
7610     __pyx_r = __pyx_t_4;
7611     __pyx_t_4 = 0;
7612     goto __pyx_L0;
7613   }
7614 
7615   /* "(tree fragment)":1
7616  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
7617  *     cdef tuple state
7618  *     cdef object _dict
7619  */
7620 
7621   /* function exit code */
7622   __pyx_L1_error:;
7623   __Pyx_XDECREF(__pyx_t_1);
7624   __Pyx_XDECREF(__pyx_t_4);
7625   __Pyx_XDECREF(__pyx_t_6);
7626   __Pyx_AddTraceback("bx.arrays.array_tree.Summary.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7627   __pyx_r = NULL;
7628   __pyx_L0:;
7629   __Pyx_XDECREF(__pyx_v_state);
7630   __Pyx_XDECREF(__pyx_v__dict);
7631   __Pyx_XGIVEREF(__pyx_r);
7632   __Pyx_RefNannyFinishContext();
7633   return __pyx_r;
7634 }
7635 
7636 /* "(tree fragment)":16
7637  *     else:
7638  *         return __pyx_unpickle_Summary, (type(self), 0x0f4bfc5, state)
7639  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
7640  *     __pyx_unpickle_Summary__set_state(self, __pyx_state)
7641  */
7642 
7643 /* Python wrapper */
7644 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7Summary_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_7Summary_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)7645 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7Summary_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7646   PyObject *__pyx_r = 0;
7647   __Pyx_RefNannyDeclarations
7648   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7649   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_7Summary_2__setstate_cython__(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7650 
7651   /* function exit code */
7652   __Pyx_RefNannyFinishContext();
7653   return __pyx_r;
7654 }
7655 
__pyx_pf_2bx_6arrays_10array_tree_7Summary_2__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v_self,PyObject * __pyx_v___pyx_state)7656 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_7Summary_2__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7657   PyObject *__pyx_r = NULL;
7658   __Pyx_RefNannyDeclarations
7659   PyObject *__pyx_t_1 = NULL;
7660   int __pyx_lineno = 0;
7661   const char *__pyx_filename = NULL;
7662   int __pyx_clineno = 0;
7663   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
7664 
7665   /* "(tree fragment)":17
7666  *         return __pyx_unpickle_Summary, (type(self), 0x0f4bfc5, state)
7667  * def __setstate_cython__(self, __pyx_state):
7668  *     __pyx_unpickle_Summary__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
7669  */
7670   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
7671   __pyx_t_1 = __pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_Summary__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
7672   __Pyx_GOTREF(__pyx_t_1);
7673   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7674 
7675   /* "(tree fragment)":16
7676  *     else:
7677  *         return __pyx_unpickle_Summary, (type(self), 0x0f4bfc5, state)
7678  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
7679  *     __pyx_unpickle_Summary__set_state(self, __pyx_state)
7680  */
7681 
7682   /* function exit code */
7683   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7684   goto __pyx_L0;
7685   __pyx_L1_error:;
7686   __Pyx_XDECREF(__pyx_t_1);
7687   __Pyx_AddTraceback("bx.arrays.array_tree.Summary.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7688   __pyx_r = NULL;
7689   __pyx_L0:;
7690   __Pyx_XGIVEREF(__pyx_r);
7691   __Pyx_RefNannyFinishContext();
7692   return __pyx_r;
7693 }
7694 
7695 /* "bx/arrays/array_tree.pyx":241
7696  *     cdef public ArrayTreeNode root
7697  *
7698  *     def __init__( self, int max, int block_size, dtype=float32, no_leaves=False ):             # <<<<<<<<<<<<<<
7699  *         """
7700  *         Create a new array tree of size `max`
7701  */
7702 
7703 /* Python wrapper */
7704 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7705 static char __pyx_doc_2bx_6arrays_10array_tree_9ArrayTree___init__[] = "\n        Create a new array tree of size `max` \n        ";
7706 #if CYTHON_COMPILING_IN_CPYTHON
7707 struct wrapperbase __pyx_wrapperbase_2bx_6arrays_10array_tree_9ArrayTree___init__;
7708 #endif
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)7709 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7710   int __pyx_v_max;
7711   int __pyx_v_block_size;
7712   PyObject *__pyx_v_dtype = 0;
7713   PyObject *__pyx_v_no_leaves = 0;
7714   int __pyx_lineno = 0;
7715   const char *__pyx_filename = NULL;
7716   int __pyx_clineno = 0;
7717   int __pyx_r;
7718   __Pyx_RefNannyDeclarations
7719   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
7720   {
7721     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max,&__pyx_n_s_block_size,&__pyx_n_s_dtype,&__pyx_n_s_no_leaves,0};
7722     PyObject* values[4] = {0,0,0,0};
7723     values[2] = __pyx_k__2;
7724     values[3] = ((PyObject *)Py_False);
7725     if (unlikely(__pyx_kwds)) {
7726       Py_ssize_t kw_args;
7727       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7728       switch (pos_args) {
7729         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7730         CYTHON_FALLTHROUGH;
7731         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7732         CYTHON_FALLTHROUGH;
7733         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7734         CYTHON_FALLTHROUGH;
7735         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7736         CYTHON_FALLTHROUGH;
7737         case  0: break;
7738         default: goto __pyx_L5_argtuple_error;
7739       }
7740       kw_args = PyDict_Size(__pyx_kwds);
7741       switch (pos_args) {
7742         case  0:
7743         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max)) != 0)) kw_args--;
7744         else goto __pyx_L5_argtuple_error;
7745         CYTHON_FALLTHROUGH;
7746         case  1:
7747         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block_size)) != 0)) kw_args--;
7748         else {
7749           __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 241, __pyx_L3_error)
7750         }
7751         CYTHON_FALLTHROUGH;
7752         case  2:
7753         if (kw_args > 0) {
7754           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype);
7755           if (value) { values[2] = value; kw_args--; }
7756         }
7757         CYTHON_FALLTHROUGH;
7758         case  3:
7759         if (kw_args > 0) {
7760           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_no_leaves);
7761           if (value) { values[3] = value; kw_args--; }
7762         }
7763       }
7764       if (unlikely(kw_args > 0)) {
7765         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 241, __pyx_L3_error)
7766       }
7767     } else {
7768       switch (PyTuple_GET_SIZE(__pyx_args)) {
7769         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7770         CYTHON_FALLTHROUGH;
7771         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7772         CYTHON_FALLTHROUGH;
7773         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7774         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7775         break;
7776         default: goto __pyx_L5_argtuple_error;
7777       }
7778     }
7779     __pyx_v_max = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_max == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L3_error)
7780     __pyx_v_block_size = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_block_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L3_error)
7781     __pyx_v_dtype = values[2];
7782     __pyx_v_no_leaves = values[3];
7783   }
7784   goto __pyx_L4_argument_unpacking_done;
7785   __pyx_L5_argtuple_error:;
7786   __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 241, __pyx_L3_error)
7787   __pyx_L3_error:;
7788   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7789   __Pyx_RefNannyFinishContext();
7790   return -1;
7791   __pyx_L4_argument_unpacking_done:;
7792   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree___init__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self), __pyx_v_max, __pyx_v_block_size, __pyx_v_dtype, __pyx_v_no_leaves);
7793 
7794   /* function exit code */
7795   __Pyx_RefNannyFinishContext();
7796   return __pyx_r;
7797 }
7798 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree___init__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self,int __pyx_v_max,int __pyx_v_block_size,PyObject * __pyx_v_dtype,PyObject * __pyx_v_no_leaves)7799 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree___init__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, int __pyx_v_max, int __pyx_v_block_size, PyObject *__pyx_v_dtype, PyObject *__pyx_v_no_leaves) {
7800   int __pyx_r;
7801   __Pyx_RefNannyDeclarations
7802   int __pyx_t_1;
7803   PyObject *__pyx_t_2 = NULL;
7804   int __pyx_t_3;
7805   PyObject *__pyx_t_4 = NULL;
7806   PyObject *__pyx_t_5 = NULL;
7807   PyObject *__pyx_t_6 = NULL;
7808   int __pyx_lineno = 0;
7809   const char *__pyx_filename = NULL;
7810   int __pyx_clineno = 0;
7811   __Pyx_RefNannySetupContext("__init__", 0);
7812 
7813   /* "bx/arrays/array_tree.pyx":245
7814  *         Create a new array tree of size `max`
7815  *         """
7816  *         self.max = max             # <<<<<<<<<<<<<<
7817  *         self.block_size = block_size
7818  *         self.no_leaves = no_leaves
7819  */
7820   __pyx_v_self->max = __pyx_v_max;
7821 
7822   /* "bx/arrays/array_tree.pyx":246
7823  *         """
7824  *         self.max = max
7825  *         self.block_size = block_size             # <<<<<<<<<<<<<<
7826  *         self.no_leaves = no_leaves
7827  *         # Force the dtype argument to its canonical dtype object
7828  */
7829   __pyx_v_self->block_size = __pyx_v_block_size;
7830 
7831   /* "bx/arrays/array_tree.pyx":247
7832  *         self.max = max
7833  *         self.block_size = block_size
7834  *         self.no_leaves = no_leaves             # <<<<<<<<<<<<<<
7835  *         # Force the dtype argument to its canonical dtype object
7836  *         self.dtype = numpy.dtype( dtype )
7837  */
7838   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_no_leaves); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error)
7839   __pyx_v_self->no_leaves = __pyx_t_1;
7840 
7841   /* "bx/arrays/array_tree.pyx":249
7842  *         self.no_leaves = no_leaves
7843  *         # Force the dtype argument to its canonical dtype object
7844  *         self.dtype = numpy.dtype( dtype )             # <<<<<<<<<<<<<<
7845  *         # How many levels are needed to cover the entire range?
7846  *         self.levels = 0
7847  */
7848   __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_v_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
7849   __Pyx_GOTREF(__pyx_t_2);
7850   __Pyx_GIVEREF(__pyx_t_2);
7851   __Pyx_GOTREF(__pyx_v_self->dtype);
7852   __Pyx_DECREF(__pyx_v_self->dtype);
7853   __pyx_v_self->dtype = __pyx_t_2;
7854   __pyx_t_2 = 0;
7855 
7856   /* "bx/arrays/array_tree.pyx":251
7857  *         self.dtype = numpy.dtype( dtype )
7858  *         # How many levels are needed to cover the entire range?
7859  *         self.levels = 0             # <<<<<<<<<<<<<<
7860  *         while ( <long long> self.block_size ) ** ( self.levels + 1 ) < self.max:
7861  *             self.levels += 1
7862  */
7863   __pyx_v_self->levels = 0;
7864 
7865   /* "bx/arrays/array_tree.pyx":252
7866  *         # How many levels are needed to cover the entire range?
7867  *         self.levels = 0
7868  *         while ( <long long> self.block_size ) ** ( self.levels + 1 ) < self.max:             # <<<<<<<<<<<<<<
7869  *             self.levels += 1
7870  *         # Not yet dealing with the case where the root is a Leaf
7871  */
7872   while (1) {
7873     __pyx_t_3 = ((__Pyx_pow_PY_LONG_LONG(((PY_LONG_LONG)__pyx_v_self->block_size), ((PY_LONG_LONG)(__pyx_v_self->levels + 1))) < __pyx_v_self->max) != 0);
7874     if (!__pyx_t_3) break;
7875 
7876     /* "bx/arrays/array_tree.pyx":253
7877  *         self.levels = 0
7878  *         while ( <long long> self.block_size ) ** ( self.levels + 1 ) < self.max:
7879  *             self.levels += 1             # <<<<<<<<<<<<<<
7880  *         # Not yet dealing with the case where the root is a Leaf
7881  *         assert self.levels > 0, "max < block_size not yet handled"
7882  */
7883     __pyx_v_self->levels = (__pyx_v_self->levels + 1);
7884   }
7885 
7886   /* "bx/arrays/array_tree.pyx":255
7887  *             self.levels += 1
7888  *         # Not yet dealing with the case where the root is a Leaf
7889  *         assert self.levels > 0, "max < block_size not yet handled"             # <<<<<<<<<<<<<<
7890  *         # Create the root node`
7891  *         self.root = ArrayTreeNode( self, 0, max, block_size, self.levels )
7892  */
7893   #ifndef CYTHON_WITHOUT_ASSERTIONS
7894   if (unlikely(!Py_OptimizeFlag)) {
7895     if (unlikely(!((__pyx_v_self->levels > 0) != 0))) {
7896       PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_max_block_size_not_yet_handled);
7897       __PYX_ERR(0, 255, __pyx_L1_error)
7898     }
7899   }
7900   #endif
7901 
7902   /* "bx/arrays/array_tree.pyx":257
7903  *         assert self.levels > 0, "max < block_size not yet handled"
7904  *         # Create the root node`
7905  *         self.root = ArrayTreeNode( self, 0, max, block_size, self.levels )             # <<<<<<<<<<<<<<
7906  *
7907  *     def __setitem__( self, int index, value ):
7908  */
7909   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
7910   __Pyx_GOTREF(__pyx_t_2);
7911   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_block_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
7912   __Pyx_GOTREF(__pyx_t_4);
7913   __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->levels); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error)
7914   __Pyx_GOTREF(__pyx_t_5);
7915   __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error)
7916   __Pyx_GOTREF(__pyx_t_6);
7917   __Pyx_INCREF(((PyObject *)__pyx_v_self));
7918   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7919   PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_self));
7920   __Pyx_INCREF(__pyx_int_0);
7921   __Pyx_GIVEREF(__pyx_int_0);
7922   PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_0);
7923   __Pyx_GIVEREF(__pyx_t_2);
7924   PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2);
7925   __Pyx_GIVEREF(__pyx_t_4);
7926   PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4);
7927   __Pyx_GIVEREF(__pyx_t_5);
7928   PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_5);
7929   __pyx_t_2 = 0;
7930   __pyx_t_4 = 0;
7931   __pyx_t_5 = 0;
7932   __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_ArrayTreeNode), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error)
7933   __Pyx_GOTREF(__pyx_t_5);
7934   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7935   __Pyx_GIVEREF(__pyx_t_5);
7936   __Pyx_GOTREF(__pyx_v_self->root);
7937   __Pyx_DECREF(((PyObject *)__pyx_v_self->root));
7938   __pyx_v_self->root = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_t_5);
7939   __pyx_t_5 = 0;
7940 
7941   /* "bx/arrays/array_tree.pyx":241
7942  *     cdef public ArrayTreeNode root
7943  *
7944  *     def __init__( self, int max, int block_size, dtype=float32, no_leaves=False ):             # <<<<<<<<<<<<<<
7945  *         """
7946  *         Create a new array tree of size `max`
7947  */
7948 
7949   /* function exit code */
7950   __pyx_r = 0;
7951   goto __pyx_L0;
7952   __pyx_L1_error:;
7953   __Pyx_XDECREF(__pyx_t_2);
7954   __Pyx_XDECREF(__pyx_t_4);
7955   __Pyx_XDECREF(__pyx_t_5);
7956   __Pyx_XDECREF(__pyx_t_6);
7957   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7958   __pyx_r = -1;
7959   __pyx_L0:;
7960   __Pyx_RefNannyFinishContext();
7961   return __pyx_r;
7962 }
7963 
7964 /* "bx/arrays/array_tree.pyx":259
7965  *         self.root = ArrayTreeNode( self, 0, max, block_size, self.levels )
7966  *
7967  *     def __setitem__( self, int index, value ):             # <<<<<<<<<<<<<<
7968  *         self.root.set( index, value )
7969  *
7970  */
7971 
7972 /* Python wrapper */
7973 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_3__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_index, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_3__setitem__(PyObject * __pyx_v_self,PyObject * __pyx_arg_index,PyObject * __pyx_v_value)7974 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_3__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_index, PyObject *__pyx_v_value) {
7975   int __pyx_v_index;
7976   int __pyx_lineno = 0;
7977   const char *__pyx_filename = NULL;
7978   int __pyx_clineno = 0;
7979   int __pyx_r;
7980   __Pyx_RefNannyDeclarations
7981   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
7982   assert(__pyx_arg_index); {
7983     __pyx_v_index = __Pyx_PyInt_As_int(__pyx_arg_index); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 259, __pyx_L3_error)
7984   }
7985   goto __pyx_L4_argument_unpacking_done;
7986   __pyx_L3_error:;
7987   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7988   __Pyx_RefNannyFinishContext();
7989   return -1;
7990   __pyx_L4_argument_unpacking_done:;
7991   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_2__setitem__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self), ((int)__pyx_v_index), ((PyObject *)__pyx_v_value));
7992 
7993   /* function exit code */
7994   __Pyx_RefNannyFinishContext();
7995   return __pyx_r;
7996 }
7997 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_2__setitem__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self,int __pyx_v_index,PyObject * __pyx_v_value)7998 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_2__setitem__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, int __pyx_v_index, PyObject *__pyx_v_value) {
7999   int __pyx_r;
8000   __Pyx_RefNannyDeclarations
8001   PyObject *__pyx_t_1 = NULL;
8002   PyObject *__pyx_t_2 = NULL;
8003   PyObject *__pyx_t_3 = NULL;
8004   PyObject *__pyx_t_4 = NULL;
8005   int __pyx_t_5;
8006   PyObject *__pyx_t_6 = NULL;
8007   int __pyx_lineno = 0;
8008   const char *__pyx_filename = NULL;
8009   int __pyx_clineno = 0;
8010   __Pyx_RefNannySetupContext("__setitem__", 0);
8011 
8012   /* "bx/arrays/array_tree.pyx":260
8013  *
8014  *     def __setitem__( self, int index, value ):
8015  *         self.root.set( index, value )             # <<<<<<<<<<<<<<
8016  *
8017  *     def set_range( self, int start, int end, value ):
8018  */
8019   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->root), __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
8020   __Pyx_GOTREF(__pyx_t_2);
8021   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
8022   __Pyx_GOTREF(__pyx_t_3);
8023   __pyx_t_4 = NULL;
8024   __pyx_t_5 = 0;
8025   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
8026     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
8027     if (likely(__pyx_t_4)) {
8028       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
8029       __Pyx_INCREF(__pyx_t_4);
8030       __Pyx_INCREF(function);
8031       __Pyx_DECREF_SET(__pyx_t_2, function);
8032       __pyx_t_5 = 1;
8033     }
8034   }
8035   #if CYTHON_FAST_PYCALL
8036   if (PyFunction_Check(__pyx_t_2)) {
8037     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_value};
8038     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
8039     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8040     __Pyx_GOTREF(__pyx_t_1);
8041     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8042   } else
8043   #endif
8044   #if CYTHON_FAST_PYCCALL
8045   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
8046     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_value};
8047     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
8048     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8049     __Pyx_GOTREF(__pyx_t_1);
8050     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8051   } else
8052   #endif
8053   {
8054     __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error)
8055     __Pyx_GOTREF(__pyx_t_6);
8056     if (__pyx_t_4) {
8057       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
8058     }
8059     __Pyx_GIVEREF(__pyx_t_3);
8060     PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
8061     __Pyx_INCREF(__pyx_v_value);
8062     __Pyx_GIVEREF(__pyx_v_value);
8063     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value);
8064     __pyx_t_3 = 0;
8065     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
8066     __Pyx_GOTREF(__pyx_t_1);
8067     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8068   }
8069   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8070   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8071 
8072   /* "bx/arrays/array_tree.pyx":259
8073  *         self.root = ArrayTreeNode( self, 0, max, block_size, self.levels )
8074  *
8075  *     def __setitem__( self, int index, value ):             # <<<<<<<<<<<<<<
8076  *         self.root.set( index, value )
8077  *
8078  */
8079 
8080   /* function exit code */
8081   __pyx_r = 0;
8082   goto __pyx_L0;
8083   __pyx_L1_error:;
8084   __Pyx_XDECREF(__pyx_t_1);
8085   __Pyx_XDECREF(__pyx_t_2);
8086   __Pyx_XDECREF(__pyx_t_3);
8087   __Pyx_XDECREF(__pyx_t_4);
8088   __Pyx_XDECREF(__pyx_t_6);
8089   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8090   __pyx_r = -1;
8091   __pyx_L0:;
8092   __Pyx_RefNannyFinishContext();
8093   return __pyx_r;
8094 }
8095 
8096 /* "bx/arrays/array_tree.pyx":262
8097  *         self.root.set( index, value )
8098  *
8099  *     def set_range( self, int start, int end, value ):             # <<<<<<<<<<<<<<
8100  *         for i from start <= i < end:
8101  *             self.root.set( i, value )
8102  */
8103 
8104 /* Python wrapper */
8105 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_5set_range(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_5set_range(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)8106 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_5set_range(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8107   int __pyx_v_start;
8108   int __pyx_v_end;
8109   PyObject *__pyx_v_value = 0;
8110   int __pyx_lineno = 0;
8111   const char *__pyx_filename = NULL;
8112   int __pyx_clineno = 0;
8113   PyObject *__pyx_r = 0;
8114   __Pyx_RefNannyDeclarations
8115   __Pyx_RefNannySetupContext("set_range (wrapper)", 0);
8116   {
8117     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_value,0};
8118     PyObject* values[3] = {0,0,0};
8119     if (unlikely(__pyx_kwds)) {
8120       Py_ssize_t kw_args;
8121       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8122       switch (pos_args) {
8123         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8124         CYTHON_FALLTHROUGH;
8125         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8126         CYTHON_FALLTHROUGH;
8127         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8128         CYTHON_FALLTHROUGH;
8129         case  0: break;
8130         default: goto __pyx_L5_argtuple_error;
8131       }
8132       kw_args = PyDict_Size(__pyx_kwds);
8133       switch (pos_args) {
8134         case  0:
8135         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
8136         else goto __pyx_L5_argtuple_error;
8137         CYTHON_FALLTHROUGH;
8138         case  1:
8139         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
8140         else {
8141           __Pyx_RaiseArgtupleInvalid("set_range", 1, 3, 3, 1); __PYX_ERR(0, 262, __pyx_L3_error)
8142         }
8143         CYTHON_FALLTHROUGH;
8144         case  2:
8145         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
8146         else {
8147           __Pyx_RaiseArgtupleInvalid("set_range", 1, 3, 3, 2); __PYX_ERR(0, 262, __pyx_L3_error)
8148         }
8149       }
8150       if (unlikely(kw_args > 0)) {
8151         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_range") < 0)) __PYX_ERR(0, 262, __pyx_L3_error)
8152       }
8153     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
8154       goto __pyx_L5_argtuple_error;
8155     } else {
8156       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8157       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8158       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8159     }
8160     __pyx_v_start = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L3_error)
8161     __pyx_v_end = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L3_error)
8162     __pyx_v_value = values[2];
8163   }
8164   goto __pyx_L4_argument_unpacking_done;
8165   __pyx_L5_argtuple_error:;
8166   __Pyx_RaiseArgtupleInvalid("set_range", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 262, __pyx_L3_error)
8167   __pyx_L3_error:;
8168   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.set_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
8169   __Pyx_RefNannyFinishContext();
8170   return NULL;
8171   __pyx_L4_argument_unpacking_done:;
8172   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_4set_range(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self), __pyx_v_start, __pyx_v_end, __pyx_v_value);
8173 
8174   /* function exit code */
8175   __Pyx_RefNannyFinishContext();
8176   return __pyx_r;
8177 }
8178 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_4set_range(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self,int __pyx_v_start,int __pyx_v_end,PyObject * __pyx_v_value)8179 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_4set_range(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, int __pyx_v_start, int __pyx_v_end, PyObject *__pyx_v_value) {
8180   int __pyx_v_i;
8181   PyObject *__pyx_r = NULL;
8182   __Pyx_RefNannyDeclarations
8183   int __pyx_t_1;
8184   PyObject *__pyx_t_2 = NULL;
8185   PyObject *__pyx_t_3 = NULL;
8186   PyObject *__pyx_t_4 = NULL;
8187   PyObject *__pyx_t_5 = NULL;
8188   int __pyx_t_6;
8189   PyObject *__pyx_t_7 = NULL;
8190   int __pyx_lineno = 0;
8191   const char *__pyx_filename = NULL;
8192   int __pyx_clineno = 0;
8193   __Pyx_RefNannySetupContext("set_range", 0);
8194 
8195   /* "bx/arrays/array_tree.pyx":263
8196  *
8197  *     def set_range( self, int start, int end, value ):
8198  *         for i from start <= i < end:             # <<<<<<<<<<<<<<
8199  *             self.root.set( i, value )
8200  *
8201  */
8202   __pyx_t_1 = __pyx_v_end;
8203   for (__pyx_v_i = __pyx_v_start; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
8204 
8205     /* "bx/arrays/array_tree.pyx":264
8206  *     def set_range( self, int start, int end, value ):
8207  *         for i from start <= i < end:
8208  *             self.root.set( i, value )             # <<<<<<<<<<<<<<
8209  *
8210  *     def __getitem__( self, int index ):
8211  */
8212     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->root), __pyx_n_s_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
8213     __Pyx_GOTREF(__pyx_t_3);
8214     __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
8215     __Pyx_GOTREF(__pyx_t_4);
8216     __pyx_t_5 = NULL;
8217     __pyx_t_6 = 0;
8218     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
8219       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
8220       if (likely(__pyx_t_5)) {
8221         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8222         __Pyx_INCREF(__pyx_t_5);
8223         __Pyx_INCREF(function);
8224         __Pyx_DECREF_SET(__pyx_t_3, function);
8225         __pyx_t_6 = 1;
8226       }
8227     }
8228     #if CYTHON_FAST_PYCALL
8229     if (PyFunction_Check(__pyx_t_3)) {
8230       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_v_value};
8231       __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
8232       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8233       __Pyx_GOTREF(__pyx_t_2);
8234       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8235     } else
8236     #endif
8237     #if CYTHON_FAST_PYCCALL
8238     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
8239       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_v_value};
8240       __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
8241       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8242       __Pyx_GOTREF(__pyx_t_2);
8243       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8244     } else
8245     #endif
8246     {
8247       __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error)
8248       __Pyx_GOTREF(__pyx_t_7);
8249       if (__pyx_t_5) {
8250         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
8251       }
8252       __Pyx_GIVEREF(__pyx_t_4);
8253       PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
8254       __Pyx_INCREF(__pyx_v_value);
8255       __Pyx_GIVEREF(__pyx_v_value);
8256       PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_value);
8257       __pyx_t_4 = 0;
8258       __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
8259       __Pyx_GOTREF(__pyx_t_2);
8260       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8261     }
8262     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8263     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8264   }
8265 
8266   /* "bx/arrays/array_tree.pyx":262
8267  *         self.root.set( index, value )
8268  *
8269  *     def set_range( self, int start, int end, value ):             # <<<<<<<<<<<<<<
8270  *         for i from start <= i < end:
8271  *             self.root.set( i, value )
8272  */
8273 
8274   /* function exit code */
8275   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8276   goto __pyx_L0;
8277   __pyx_L1_error:;
8278   __Pyx_XDECREF(__pyx_t_2);
8279   __Pyx_XDECREF(__pyx_t_3);
8280   __Pyx_XDECREF(__pyx_t_4);
8281   __Pyx_XDECREF(__pyx_t_5);
8282   __Pyx_XDECREF(__pyx_t_7);
8283   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.set_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
8284   __pyx_r = NULL;
8285   __pyx_L0:;
8286   __Pyx_XGIVEREF(__pyx_r);
8287   __Pyx_RefNannyFinishContext();
8288   return __pyx_r;
8289 }
8290 
8291 /* "bx/arrays/array_tree.pyx":266
8292  *             self.root.set( i, value )
8293  *
8294  *     def __getitem__( self, int index ):             # <<<<<<<<<<<<<<
8295  *         return self.root.get( index )
8296  *
8297  */
8298 
8299 /* Python wrapper */
8300 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_7__getitem__(PyObject * __pyx_v_self,PyObject * __pyx_arg_index)8301 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
8302   int __pyx_v_index;
8303   int __pyx_lineno = 0;
8304   const char *__pyx_filename = NULL;
8305   int __pyx_clineno = 0;
8306   PyObject *__pyx_r = 0;
8307   __Pyx_RefNannyDeclarations
8308   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
8309   assert(__pyx_arg_index); {
8310     __pyx_v_index = __Pyx_PyInt_As_int(__pyx_arg_index); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L3_error)
8311   }
8312   goto __pyx_L4_argument_unpacking_done;
8313   __pyx_L3_error:;
8314   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8315   __Pyx_RefNannyFinishContext();
8316   return NULL;
8317   __pyx_L4_argument_unpacking_done:;
8318   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_6__getitem__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self), ((int)__pyx_v_index));
8319 
8320   /* function exit code */
8321   __Pyx_RefNannyFinishContext();
8322   return __pyx_r;
8323 }
8324 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_6__getitem__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self,int __pyx_v_index)8325 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_6__getitem__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, int __pyx_v_index) {
8326   PyObject *__pyx_r = NULL;
8327   __Pyx_RefNannyDeclarations
8328   PyObject *__pyx_t_1 = NULL;
8329   PyObject *__pyx_t_2 = NULL;
8330   PyObject *__pyx_t_3 = NULL;
8331   PyObject *__pyx_t_4 = NULL;
8332   int __pyx_lineno = 0;
8333   const char *__pyx_filename = NULL;
8334   int __pyx_clineno = 0;
8335   __Pyx_RefNannySetupContext("__getitem__", 0);
8336 
8337   /* "bx/arrays/array_tree.pyx":267
8338  *
8339  *     def __getitem__( self, int index ):
8340  *         return self.root.get( index )             # <<<<<<<<<<<<<<
8341  *
8342  *     def to_file( self, f, is_little_endian=True, no_leaves=False ):
8343  */
8344   __Pyx_XDECREF(__pyx_r);
8345   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->root), __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error)
8346   __Pyx_GOTREF(__pyx_t_2);
8347   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error)
8348   __Pyx_GOTREF(__pyx_t_3);
8349   __pyx_t_4 = NULL;
8350   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
8351     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
8352     if (likely(__pyx_t_4)) {
8353       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
8354       __Pyx_INCREF(__pyx_t_4);
8355       __Pyx_INCREF(function);
8356       __Pyx_DECREF_SET(__pyx_t_2, function);
8357     }
8358   }
8359   __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);
8360   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8361   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8362   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
8363   __Pyx_GOTREF(__pyx_t_1);
8364   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8365   __pyx_r = __pyx_t_1;
8366   __pyx_t_1 = 0;
8367   goto __pyx_L0;
8368 
8369   /* "bx/arrays/array_tree.pyx":266
8370  *             self.root.set( i, value )
8371  *
8372  *     def __getitem__( self, int index ):             # <<<<<<<<<<<<<<
8373  *         return self.root.get( index )
8374  *
8375  */
8376 
8377   /* function exit code */
8378   __pyx_L1_error:;
8379   __Pyx_XDECREF(__pyx_t_1);
8380   __Pyx_XDECREF(__pyx_t_2);
8381   __Pyx_XDECREF(__pyx_t_3);
8382   __Pyx_XDECREF(__pyx_t_4);
8383   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8384   __pyx_r = NULL;
8385   __pyx_L0:;
8386   __Pyx_XGIVEREF(__pyx_r);
8387   __Pyx_RefNannyFinishContext();
8388   return __pyx_r;
8389 }
8390 
8391 /* "bx/arrays/array_tree.pyx":269
8392  *         return self.root.get( index )
8393  *
8394  *     def to_file( self, f, is_little_endian=True, no_leaves=False ):             # <<<<<<<<<<<<<<
8395  *         io = BinaryFileWriter( f, is_little_endian=is_little_endian )
8396  *         ## io.write_uint32( VERSION )
8397  */
8398 
8399 /* Python wrapper */
8400 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_9to_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_9to_file(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)8401 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_9to_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8402   PyObject *__pyx_v_f = 0;
8403   PyObject *__pyx_v_is_little_endian = 0;
8404   PyObject *__pyx_v_no_leaves = 0;
8405   int __pyx_lineno = 0;
8406   const char *__pyx_filename = NULL;
8407   int __pyx_clineno = 0;
8408   PyObject *__pyx_r = 0;
8409   __Pyx_RefNannyDeclarations
8410   __Pyx_RefNannySetupContext("to_file (wrapper)", 0);
8411   {
8412     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_is_little_endian,&__pyx_n_s_no_leaves,0};
8413     PyObject* values[3] = {0,0,0};
8414     values[1] = ((PyObject *)Py_True);
8415     values[2] = ((PyObject *)Py_False);
8416     if (unlikely(__pyx_kwds)) {
8417       Py_ssize_t kw_args;
8418       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8419       switch (pos_args) {
8420         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8421         CYTHON_FALLTHROUGH;
8422         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8423         CYTHON_FALLTHROUGH;
8424         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8425         CYTHON_FALLTHROUGH;
8426         case  0: break;
8427         default: goto __pyx_L5_argtuple_error;
8428       }
8429       kw_args = PyDict_Size(__pyx_kwds);
8430       switch (pos_args) {
8431         case  0:
8432         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
8433         else goto __pyx_L5_argtuple_error;
8434         CYTHON_FALLTHROUGH;
8435         case  1:
8436         if (kw_args > 0) {
8437           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_little_endian);
8438           if (value) { values[1] = value; kw_args--; }
8439         }
8440         CYTHON_FALLTHROUGH;
8441         case  2:
8442         if (kw_args > 0) {
8443           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_no_leaves);
8444           if (value) { values[2] = value; kw_args--; }
8445         }
8446       }
8447       if (unlikely(kw_args > 0)) {
8448         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_file") < 0)) __PYX_ERR(0, 269, __pyx_L3_error)
8449       }
8450     } else {
8451       switch (PyTuple_GET_SIZE(__pyx_args)) {
8452         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8453         CYTHON_FALLTHROUGH;
8454         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8455         CYTHON_FALLTHROUGH;
8456         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8457         break;
8458         default: goto __pyx_L5_argtuple_error;
8459       }
8460     }
8461     __pyx_v_f = values[0];
8462     __pyx_v_is_little_endian = values[1];
8463     __pyx_v_no_leaves = values[2];
8464   }
8465   goto __pyx_L4_argument_unpacking_done;
8466   __pyx_L5_argtuple_error:;
8467   __Pyx_RaiseArgtupleInvalid("to_file", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 269, __pyx_L3_error)
8468   __pyx_L3_error:;
8469   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.to_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
8470   __Pyx_RefNannyFinishContext();
8471   return NULL;
8472   __pyx_L4_argument_unpacking_done:;
8473   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_8to_file(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self), __pyx_v_f, __pyx_v_is_little_endian, __pyx_v_no_leaves);
8474 
8475   /* function exit code */
8476   __Pyx_RefNannyFinishContext();
8477   return __pyx_r;
8478 }
8479 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_8to_file(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self,PyObject * __pyx_v_f,PyObject * __pyx_v_is_little_endian,PyObject * __pyx_v_no_leaves)8480 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_8to_file(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, PyObject *__pyx_v_f, PyObject *__pyx_v_is_little_endian, PyObject *__pyx_v_no_leaves) {
8481   PyObject *__pyx_v_io = NULL;
8482   long __pyx_v_bottom_level;
8483   long __pyx_v_level;
8484   PyObject *__pyx_r = NULL;
8485   __Pyx_RefNannyDeclarations
8486   PyObject *__pyx_t_1 = NULL;
8487   PyObject *__pyx_t_2 = NULL;
8488   PyObject *__pyx_t_3 = NULL;
8489   PyObject *__pyx_t_4 = NULL;
8490   int __pyx_t_5;
8491   long __pyx_t_6;
8492   long __pyx_t_7;
8493   long __pyx_t_8;
8494   int __pyx_t_9;
8495   PyObject *__pyx_t_10 = NULL;
8496   int __pyx_lineno = 0;
8497   const char *__pyx_filename = NULL;
8498   int __pyx_clineno = 0;
8499   __Pyx_RefNannySetupContext("to_file", 0);
8500 
8501   /* "bx/arrays/array_tree.pyx":270
8502  *
8503  *     def to_file( self, f, is_little_endian=True, no_leaves=False ):
8504  *         io = BinaryFileWriter( f, is_little_endian=is_little_endian )             # <<<<<<<<<<<<<<
8505  *         ## io.write_uint32( VERSION )
8506  *         io.write_uint32( self.max )
8507  */
8508   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BinaryFileWriter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
8509   __Pyx_GOTREF(__pyx_t_1);
8510   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error)
8511   __Pyx_GOTREF(__pyx_t_2);
8512   __Pyx_INCREF(__pyx_v_f);
8513   __Pyx_GIVEREF(__pyx_v_f);
8514   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f);
8515   __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
8516   __Pyx_GOTREF(__pyx_t_3);
8517   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_little_endian, __pyx_v_is_little_endian) < 0) __PYX_ERR(0, 270, __pyx_L1_error)
8518   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error)
8519   __Pyx_GOTREF(__pyx_t_4);
8520   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8521   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8522   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8523   __pyx_v_io = __pyx_t_4;
8524   __pyx_t_4 = 0;
8525 
8526   /* "bx/arrays/array_tree.pyx":272
8527  *         io = BinaryFileWriter( f, is_little_endian=is_little_endian )
8528  *         ## io.write_uint32( VERSION )
8529  *         io.write_uint32( self.max )             # <<<<<<<<<<<<<<
8530  *         io.write_uint32( self.block_size )
8531  *         io.write( self.dtype.char )
8532  */
8533   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_write_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
8534   __Pyx_GOTREF(__pyx_t_3);
8535   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
8536   __Pyx_GOTREF(__pyx_t_2);
8537   __pyx_t_1 = NULL;
8538   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
8539     __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
8540     if (likely(__pyx_t_1)) {
8541       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8542       __Pyx_INCREF(__pyx_t_1);
8543       __Pyx_INCREF(function);
8544       __Pyx_DECREF_SET(__pyx_t_3, function);
8545     }
8546   }
8547   __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
8548   __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8549   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8550   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
8551   __Pyx_GOTREF(__pyx_t_4);
8552   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8553   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8554 
8555   /* "bx/arrays/array_tree.pyx":273
8556  *         ## io.write_uint32( VERSION )
8557  *         io.write_uint32( self.max )
8558  *         io.write_uint32( self.block_size )             # <<<<<<<<<<<<<<
8559  *         io.write( self.dtype.char )
8560  *         io.write( "\0\0\0" )
8561  */
8562   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_write_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
8563   __Pyx_GOTREF(__pyx_t_3);
8564   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->block_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
8565   __Pyx_GOTREF(__pyx_t_2);
8566   __pyx_t_1 = NULL;
8567   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
8568     __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
8569     if (likely(__pyx_t_1)) {
8570       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8571       __Pyx_INCREF(__pyx_t_1);
8572       __Pyx_INCREF(function);
8573       __Pyx_DECREF_SET(__pyx_t_3, function);
8574     }
8575   }
8576   __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
8577   __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8578   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8579   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
8580   __Pyx_GOTREF(__pyx_t_4);
8581   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8582   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8583 
8584   /* "bx/arrays/array_tree.pyx":274
8585  *         io.write_uint32( self.max )
8586  *         io.write_uint32( self.block_size )
8587  *         io.write( self.dtype.char )             # <<<<<<<<<<<<<<
8588  *         io.write( "\0\0\0" )
8589  *         # Data pass, level order
8590  */
8591   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
8592   __Pyx_GOTREF(__pyx_t_3);
8593   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_char); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
8594   __Pyx_GOTREF(__pyx_t_2);
8595   __pyx_t_1 = NULL;
8596   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
8597     __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
8598     if (likely(__pyx_t_1)) {
8599       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8600       __Pyx_INCREF(__pyx_t_1);
8601       __Pyx_INCREF(function);
8602       __Pyx_DECREF_SET(__pyx_t_3, function);
8603     }
8604   }
8605   __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
8606   __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8607   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8608   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
8609   __Pyx_GOTREF(__pyx_t_4);
8610   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8611   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8612 
8613   /* "bx/arrays/array_tree.pyx":275
8614  *         io.write_uint32( self.block_size )
8615  *         io.write( self.dtype.char )
8616  *         io.write( "\0\0\0" )             # <<<<<<<<<<<<<<
8617  *         # Data pass, level order
8618  *         if no_leaves:
8619  */
8620   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
8621   __Pyx_GOTREF(__pyx_t_3);
8622   __pyx_t_2 = NULL;
8623   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
8624     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
8625     if (likely(__pyx_t_2)) {
8626       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8627       __Pyx_INCREF(__pyx_t_2);
8628       __Pyx_INCREF(function);
8629       __Pyx_DECREF_SET(__pyx_t_3, function);
8630     }
8631   }
8632   __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_s__3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s__3);
8633   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8634   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error)
8635   __Pyx_GOTREF(__pyx_t_4);
8636   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8637   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8638 
8639   /* "bx/arrays/array_tree.pyx":277
8640  *         io.write( "\0\0\0" )
8641  *         # Data pass, level order
8642  *         if no_leaves:             # <<<<<<<<<<<<<<
8643  *             bottom_level = 0
8644  *         else:
8645  */
8646   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_no_leaves); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 277, __pyx_L1_error)
8647   if (__pyx_t_5) {
8648 
8649     /* "bx/arrays/array_tree.pyx":278
8650  *         # Data pass, level order
8651  *         if no_leaves:
8652  *             bottom_level = 0             # <<<<<<<<<<<<<<
8653  *         else:
8654  *             bottom_level = -1
8655  */
8656     __pyx_v_bottom_level = 0;
8657 
8658     /* "bx/arrays/array_tree.pyx":277
8659  *         io.write( "\0\0\0" )
8660  *         # Data pass, level order
8661  *         if no_leaves:             # <<<<<<<<<<<<<<
8662  *             bottom_level = 0
8663  *         else:
8664  */
8665     goto __pyx_L3;
8666   }
8667 
8668   /* "bx/arrays/array_tree.pyx":280
8669  *             bottom_level = 0
8670  *         else:
8671  *             bottom_level = -1             # <<<<<<<<<<<<<<
8672  *         for level in range( self.levels, bottom_level, -1 ):
8673  *             self.root.to_file_data_pass( io, level )
8674  */
8675   /*else*/ {
8676     __pyx_v_bottom_level = -1L;
8677   }
8678   __pyx_L3:;
8679 
8680   /* "bx/arrays/array_tree.pyx":281
8681  *         else:
8682  *             bottom_level = -1
8683  *         for level in range( self.levels, bottom_level, -1 ):             # <<<<<<<<<<<<<<
8684  *             self.root.to_file_data_pass( io, level )
8685  *         # Offset pass to fix up indexes
8686  */
8687   __pyx_t_6 = __pyx_v_bottom_level;
8688   __pyx_t_7 = __pyx_t_6;
8689   for (__pyx_t_8 = __pyx_v_self->levels; __pyx_t_8 > __pyx_t_7; __pyx_t_8-=1) {
8690     __pyx_v_level = __pyx_t_8;
8691 
8692     /* "bx/arrays/array_tree.pyx":282
8693  *             bottom_level = -1
8694  *         for level in range( self.levels, bottom_level, -1 ):
8695  *             self.root.to_file_data_pass( io, level )             # <<<<<<<<<<<<<<
8696  *         # Offset pass to fix up indexes
8697  *         self.root.to_file_offset_pass( io )
8698  */
8699     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->root), __pyx_n_s_to_file_data_pass); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
8700     __Pyx_GOTREF(__pyx_t_3);
8701     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_level); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
8702     __Pyx_GOTREF(__pyx_t_2);
8703     __pyx_t_1 = NULL;
8704     __pyx_t_9 = 0;
8705     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
8706       __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
8707       if (likely(__pyx_t_1)) {
8708         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8709         __Pyx_INCREF(__pyx_t_1);
8710         __Pyx_INCREF(function);
8711         __Pyx_DECREF_SET(__pyx_t_3, function);
8712         __pyx_t_9 = 1;
8713       }
8714     }
8715     #if CYTHON_FAST_PYCALL
8716     if (PyFunction_Check(__pyx_t_3)) {
8717       PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_io, __pyx_t_2};
8718       __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
8719       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8720       __Pyx_GOTREF(__pyx_t_4);
8721       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8722     } else
8723     #endif
8724     #if CYTHON_FAST_PYCCALL
8725     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
8726       PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_io, __pyx_t_2};
8727       __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
8728       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8729       __Pyx_GOTREF(__pyx_t_4);
8730       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8731     } else
8732     #endif
8733     {
8734       __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 282, __pyx_L1_error)
8735       __Pyx_GOTREF(__pyx_t_10);
8736       if (__pyx_t_1) {
8737         __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL;
8738       }
8739       __Pyx_INCREF(__pyx_v_io);
8740       __Pyx_GIVEREF(__pyx_v_io);
8741       PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_v_io);
8742       __Pyx_GIVEREF(__pyx_t_2);
8743       PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_2);
8744       __pyx_t_2 = 0;
8745       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
8746       __Pyx_GOTREF(__pyx_t_4);
8747       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8748     }
8749     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8750     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8751   }
8752 
8753   /* "bx/arrays/array_tree.pyx":284
8754  *             self.root.to_file_data_pass( io, level )
8755  *         # Offset pass to fix up indexes
8756  *         self.root.to_file_offset_pass( io )             # <<<<<<<<<<<<<<
8757  *
8758  *     @classmethod
8759  */
8760   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->root), __pyx_n_s_to_file_offset_pass); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error)
8761   __Pyx_GOTREF(__pyx_t_3);
8762   __pyx_t_10 = NULL;
8763   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
8764     __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
8765     if (likely(__pyx_t_10)) {
8766       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8767       __Pyx_INCREF(__pyx_t_10);
8768       __Pyx_INCREF(function);
8769       __Pyx_DECREF_SET(__pyx_t_3, function);
8770     }
8771   }
8772   __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_10, __pyx_v_io) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_io);
8773   __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
8774   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
8775   __Pyx_GOTREF(__pyx_t_4);
8776   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8777   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8778 
8779   /* "bx/arrays/array_tree.pyx":269
8780  *         return self.root.get( index )
8781  *
8782  *     def to_file( self, f, is_little_endian=True, no_leaves=False ):             # <<<<<<<<<<<<<<
8783  *         io = BinaryFileWriter( f, is_little_endian=is_little_endian )
8784  *         ## io.write_uint32( VERSION )
8785  */
8786 
8787   /* function exit code */
8788   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8789   goto __pyx_L0;
8790   __pyx_L1_error:;
8791   __Pyx_XDECREF(__pyx_t_1);
8792   __Pyx_XDECREF(__pyx_t_2);
8793   __Pyx_XDECREF(__pyx_t_3);
8794   __Pyx_XDECREF(__pyx_t_4);
8795   __Pyx_XDECREF(__pyx_t_10);
8796   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.to_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
8797   __pyx_r = NULL;
8798   __pyx_L0:;
8799   __Pyx_XDECREF(__pyx_v_io);
8800   __Pyx_XGIVEREF(__pyx_r);
8801   __Pyx_RefNannyFinishContext();
8802   return __pyx_r;
8803 }
8804 
8805 /* "bx/arrays/array_tree.pyx":287
8806  *
8807  *     @classmethod
8808  *     def from_file( Class, f, is_little_endian=True ):             # <<<<<<<<<<<<<<
8809  *         io = BinaryFileReader( f, is_little_endian=is_little_endian )
8810  *         ## assert io.read_uint32() == VERSION
8811  */
8812 
8813 /* Python wrapper */
8814 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_11from_file(PyObject *__pyx_v_Class, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_11from_file(PyObject * __pyx_v_Class,PyObject * __pyx_args,PyObject * __pyx_kwds)8815 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_11from_file(PyObject *__pyx_v_Class, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8816   PyObject *__pyx_v_f = 0;
8817   PyObject *__pyx_v_is_little_endian = 0;
8818   int __pyx_lineno = 0;
8819   const char *__pyx_filename = NULL;
8820   int __pyx_clineno = 0;
8821   PyObject *__pyx_r = 0;
8822   __Pyx_RefNannyDeclarations
8823   __Pyx_RefNannySetupContext("from_file (wrapper)", 0);
8824   {
8825     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_is_little_endian,0};
8826     PyObject* values[2] = {0,0};
8827     values[1] = ((PyObject *)Py_True);
8828     if (unlikely(__pyx_kwds)) {
8829       Py_ssize_t kw_args;
8830       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8831       switch (pos_args) {
8832         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8833         CYTHON_FALLTHROUGH;
8834         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8835         CYTHON_FALLTHROUGH;
8836         case  0: break;
8837         default: goto __pyx_L5_argtuple_error;
8838       }
8839       kw_args = PyDict_Size(__pyx_kwds);
8840       switch (pos_args) {
8841         case  0:
8842         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
8843         else goto __pyx_L5_argtuple_error;
8844         CYTHON_FALLTHROUGH;
8845         case  1:
8846         if (kw_args > 0) {
8847           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_little_endian);
8848           if (value) { values[1] = value; kw_args--; }
8849         }
8850       }
8851       if (unlikely(kw_args > 0)) {
8852         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_file") < 0)) __PYX_ERR(0, 287, __pyx_L3_error)
8853       }
8854     } else {
8855       switch (PyTuple_GET_SIZE(__pyx_args)) {
8856         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8857         CYTHON_FALLTHROUGH;
8858         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8859         break;
8860         default: goto __pyx_L5_argtuple_error;
8861       }
8862     }
8863     __pyx_v_f = values[0];
8864     __pyx_v_is_little_endian = values[1];
8865   }
8866   goto __pyx_L4_argument_unpacking_done;
8867   __pyx_L5_argtuple_error:;
8868   __Pyx_RaiseArgtupleInvalid("from_file", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 287, __pyx_L3_error)
8869   __pyx_L3_error:;
8870   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
8871   __Pyx_RefNannyFinishContext();
8872   return NULL;
8873   __pyx_L4_argument_unpacking_done:;
8874   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_10from_file(((PyTypeObject*)__pyx_v_Class), __pyx_v_f, __pyx_v_is_little_endian);
8875 
8876   /* function exit code */
8877   __Pyx_RefNannyFinishContext();
8878   return __pyx_r;
8879 }
8880 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_10from_file(PyTypeObject * __pyx_v_Class,PyObject * __pyx_v_f,PyObject * __pyx_v_is_little_endian)8881 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_10from_file(PyTypeObject *__pyx_v_Class, PyObject *__pyx_v_f, PyObject *__pyx_v_is_little_endian) {
8882   PyObject *__pyx_v_io = NULL;
8883   PyObject *__pyx_v_max = NULL;
8884   PyObject *__pyx_v_block_size = NULL;
8885   PyObject *__pyx_v_dt = NULL;
8886   PyObject *__pyx_v_tree = NULL;
8887   PyObject *__pyx_r = NULL;
8888   __Pyx_RefNannyDeclarations
8889   PyObject *__pyx_t_1 = NULL;
8890   PyObject *__pyx_t_2 = NULL;
8891   PyObject *__pyx_t_3 = NULL;
8892   PyObject *__pyx_t_4 = NULL;
8893   int __pyx_lineno = 0;
8894   const char *__pyx_filename = NULL;
8895   int __pyx_clineno = 0;
8896   __Pyx_RefNannySetupContext("from_file", 0);
8897 
8898   /* "bx/arrays/array_tree.pyx":288
8899  *     @classmethod
8900  *     def from_file( Class, f, is_little_endian=True ):
8901  *         io = BinaryFileReader( f, is_little_endian=is_little_endian )             # <<<<<<<<<<<<<<
8902  *         ## assert io.read_uint32() == VERSION
8903  *         max = io.read_uint32()
8904  */
8905   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BinaryFileReader); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
8906   __Pyx_GOTREF(__pyx_t_1);
8907   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
8908   __Pyx_GOTREF(__pyx_t_2);
8909   __Pyx_INCREF(__pyx_v_f);
8910   __Pyx_GIVEREF(__pyx_v_f);
8911   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f);
8912   __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
8913   __Pyx_GOTREF(__pyx_t_3);
8914   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_little_endian, __pyx_v_is_little_endian) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
8915   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
8916   __Pyx_GOTREF(__pyx_t_4);
8917   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8918   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8919   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8920   __pyx_v_io = __pyx_t_4;
8921   __pyx_t_4 = 0;
8922 
8923   /* "bx/arrays/array_tree.pyx":290
8924  *         io = BinaryFileReader( f, is_little_endian=is_little_endian )
8925  *         ## assert io.read_uint32() == VERSION
8926  *         max = io.read_uint32()             # <<<<<<<<<<<<<<
8927  *         block_size = io.read_uint32()
8928  *         dt = io.read( 1 )
8929  */
8930   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_read_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error)
8931   __Pyx_GOTREF(__pyx_t_3);
8932   __pyx_t_2 = NULL;
8933   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
8934     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
8935     if (likely(__pyx_t_2)) {
8936       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8937       __Pyx_INCREF(__pyx_t_2);
8938       __Pyx_INCREF(function);
8939       __Pyx_DECREF_SET(__pyx_t_3, function);
8940     }
8941   }
8942   __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
8943   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8944   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error)
8945   __Pyx_GOTREF(__pyx_t_4);
8946   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8947   __pyx_v_max = __pyx_t_4;
8948   __pyx_t_4 = 0;
8949 
8950   /* "bx/arrays/array_tree.pyx":291
8951  *         ## assert io.read_uint32() == VERSION
8952  *         max = io.read_uint32()
8953  *         block_size = io.read_uint32()             # <<<<<<<<<<<<<<
8954  *         dt = io.read( 1 )
8955  *         io.read( 3 )
8956  */
8957   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_read_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
8958   __Pyx_GOTREF(__pyx_t_3);
8959   __pyx_t_2 = NULL;
8960   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
8961     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
8962     if (likely(__pyx_t_2)) {
8963       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8964       __Pyx_INCREF(__pyx_t_2);
8965       __Pyx_INCREF(function);
8966       __Pyx_DECREF_SET(__pyx_t_3, function);
8967     }
8968   }
8969   __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
8970   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8971   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
8972   __Pyx_GOTREF(__pyx_t_4);
8973   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8974   __pyx_v_block_size = __pyx_t_4;
8975   __pyx_t_4 = 0;
8976 
8977   /* "bx/arrays/array_tree.pyx":292
8978  *         max = io.read_uint32()
8979  *         block_size = io.read_uint32()
8980  *         dt = io.read( 1 )             # <<<<<<<<<<<<<<
8981  *         io.read( 3 )
8982  *         tree = Class( max, block_size, dt )
8983  */
8984   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
8985   __Pyx_GOTREF(__pyx_t_3);
8986   __pyx_t_2 = NULL;
8987   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
8988     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
8989     if (likely(__pyx_t_2)) {
8990       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8991       __Pyx_INCREF(__pyx_t_2);
8992       __Pyx_INCREF(function);
8993       __Pyx_DECREF_SET(__pyx_t_3, function);
8994     }
8995   }
8996   __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_1);
8997   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8998   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 292, __pyx_L1_error)
8999   __Pyx_GOTREF(__pyx_t_4);
9000   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9001   __pyx_v_dt = __pyx_t_4;
9002   __pyx_t_4 = 0;
9003 
9004   /* "bx/arrays/array_tree.pyx":293
9005  *         block_size = io.read_uint32()
9006  *         dt = io.read( 1 )
9007  *         io.read( 3 )             # <<<<<<<<<<<<<<
9008  *         tree = Class( max, block_size, dt )
9009  *         tree.root.from_file( io )
9010  */
9011   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
9012   __Pyx_GOTREF(__pyx_t_3);
9013   __pyx_t_2 = NULL;
9014   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
9015     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
9016     if (likely(__pyx_t_2)) {
9017       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
9018       __Pyx_INCREF(__pyx_t_2);
9019       __Pyx_INCREF(function);
9020       __Pyx_DECREF_SET(__pyx_t_3, function);
9021     }
9022   }
9023   __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
9024   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9025   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error)
9026   __Pyx_GOTREF(__pyx_t_4);
9027   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9028   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9029 
9030   /* "bx/arrays/array_tree.pyx":294
9031  *         dt = io.read( 1 )
9032  *         io.read( 3 )
9033  *         tree = Class( max, block_size, dt )             # <<<<<<<<<<<<<<
9034  *         tree.root.from_file( io )
9035  *         return tree
9036  */
9037   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
9038   __Pyx_GOTREF(__pyx_t_4);
9039   __Pyx_INCREF(__pyx_v_max);
9040   __Pyx_GIVEREF(__pyx_v_max);
9041   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_max);
9042   __Pyx_INCREF(__pyx_v_block_size);
9043   __Pyx_GIVEREF(__pyx_v_block_size);
9044   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_block_size);
9045   __Pyx_INCREF(__pyx_v_dt);
9046   __Pyx_GIVEREF(__pyx_v_dt);
9047   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_dt);
9048   __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_Class), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error)
9049   __Pyx_GOTREF(__pyx_t_3);
9050   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9051   __pyx_v_tree = __pyx_t_3;
9052   __pyx_t_3 = 0;
9053 
9054   /* "bx/arrays/array_tree.pyx":295
9055  *         io.read( 3 )
9056  *         tree = Class( max, block_size, dt )
9057  *         tree.root.from_file( io )             # <<<<<<<<<<<<<<
9058  *         return tree
9059  *
9060  */
9061   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tree, __pyx_n_s_root); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L1_error)
9062   __Pyx_GOTREF(__pyx_t_4);
9063   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_from_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error)
9064   __Pyx_GOTREF(__pyx_t_2);
9065   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9066   __pyx_t_4 = NULL;
9067   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
9068     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
9069     if (likely(__pyx_t_4)) {
9070       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
9071       __Pyx_INCREF(__pyx_t_4);
9072       __Pyx_INCREF(function);
9073       __Pyx_DECREF_SET(__pyx_t_2, function);
9074     }
9075   }
9076   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_io) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_io);
9077   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9078   if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
9079   __Pyx_GOTREF(__pyx_t_3);
9080   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9081   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9082 
9083   /* "bx/arrays/array_tree.pyx":296
9084  *         tree = Class( max, block_size, dt )
9085  *         tree.root.from_file( io )
9086  *         return tree             # <<<<<<<<<<<<<<
9087  *
9088  *     @classmethod
9089  */
9090   __Pyx_XDECREF(__pyx_r);
9091   __Pyx_INCREF(__pyx_v_tree);
9092   __pyx_r = __pyx_v_tree;
9093   goto __pyx_L0;
9094 
9095   /* "bx/arrays/array_tree.pyx":287
9096  *
9097  *     @classmethod
9098  *     def from_file( Class, f, is_little_endian=True ):             # <<<<<<<<<<<<<<
9099  *         io = BinaryFileReader( f, is_little_endian=is_little_endian )
9100  *         ## assert io.read_uint32() == VERSION
9101  */
9102 
9103   /* function exit code */
9104   __pyx_L1_error:;
9105   __Pyx_XDECREF(__pyx_t_1);
9106   __Pyx_XDECREF(__pyx_t_2);
9107   __Pyx_XDECREF(__pyx_t_3);
9108   __Pyx_XDECREF(__pyx_t_4);
9109   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
9110   __pyx_r = NULL;
9111   __pyx_L0:;
9112   __Pyx_XDECREF(__pyx_v_io);
9113   __Pyx_XDECREF(__pyx_v_max);
9114   __Pyx_XDECREF(__pyx_v_block_size);
9115   __Pyx_XDECREF(__pyx_v_dt);
9116   __Pyx_XDECREF(__pyx_v_tree);
9117   __Pyx_XGIVEREF(__pyx_r);
9118   __Pyx_RefNannyFinishContext();
9119   return __pyx_r;
9120 }
9121 
9122 /* "bx/arrays/array_tree.pyx":299
9123  *
9124  *     @classmethod
9125  *     def from_sequence( Class, s, block_size=1000 ):             # <<<<<<<<<<<<<<
9126  *         """
9127  *         Build an ArrayTree from a sequence like object (must have at least
9128  */
9129 
9130 /* Python wrapper */
9131 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_13from_sequence(PyObject *__pyx_v_Class, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9132 static char __pyx_doc_2bx_6arrays_10array_tree_9ArrayTree_12from_sequence[] = "\n        Build an ArrayTree from a sequence like object (must have at least\n        length and getitem).\n        ";
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_13from_sequence(PyObject * __pyx_v_Class,PyObject * __pyx_args,PyObject * __pyx_kwds)9133 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_13from_sequence(PyObject *__pyx_v_Class, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9134   PyObject *__pyx_v_s = 0;
9135   PyObject *__pyx_v_block_size = 0;
9136   int __pyx_lineno = 0;
9137   const char *__pyx_filename = NULL;
9138   int __pyx_clineno = 0;
9139   PyObject *__pyx_r = 0;
9140   __Pyx_RefNannyDeclarations
9141   __Pyx_RefNannySetupContext("from_sequence (wrapper)", 0);
9142   {
9143     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,&__pyx_n_s_block_size,0};
9144     PyObject* values[2] = {0,0};
9145     values[1] = ((PyObject *)__pyx_int_1000);
9146     if (unlikely(__pyx_kwds)) {
9147       Py_ssize_t kw_args;
9148       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9149       switch (pos_args) {
9150         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9151         CYTHON_FALLTHROUGH;
9152         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9153         CYTHON_FALLTHROUGH;
9154         case  0: break;
9155         default: goto __pyx_L5_argtuple_error;
9156       }
9157       kw_args = PyDict_Size(__pyx_kwds);
9158       switch (pos_args) {
9159         case  0:
9160         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
9161         else goto __pyx_L5_argtuple_error;
9162         CYTHON_FALLTHROUGH;
9163         case  1:
9164         if (kw_args > 0) {
9165           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block_size);
9166           if (value) { values[1] = value; kw_args--; }
9167         }
9168       }
9169       if (unlikely(kw_args > 0)) {
9170         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_sequence") < 0)) __PYX_ERR(0, 299, __pyx_L3_error)
9171       }
9172     } else {
9173       switch (PyTuple_GET_SIZE(__pyx_args)) {
9174         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9175         CYTHON_FALLTHROUGH;
9176         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9177         break;
9178         default: goto __pyx_L5_argtuple_error;
9179       }
9180     }
9181     __pyx_v_s = values[0];
9182     __pyx_v_block_size = values[1];
9183   }
9184   goto __pyx_L4_argument_unpacking_done;
9185   __pyx_L5_argtuple_error:;
9186   __Pyx_RaiseArgtupleInvalid("from_sequence", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 299, __pyx_L3_error)
9187   __pyx_L3_error:;
9188   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.from_sequence", __pyx_clineno, __pyx_lineno, __pyx_filename);
9189   __Pyx_RefNannyFinishContext();
9190   return NULL;
9191   __pyx_L4_argument_unpacking_done:;
9192   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_12from_sequence(((PyTypeObject*)__pyx_v_Class), __pyx_v_s, __pyx_v_block_size);
9193 
9194   /* function exit code */
9195   __Pyx_RefNannyFinishContext();
9196   return __pyx_r;
9197 }
9198 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_12from_sequence(PyTypeObject * __pyx_v_Class,PyObject * __pyx_v_s,PyObject * __pyx_v_block_size)9199 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_12from_sequence(PyTypeObject *__pyx_v_Class, PyObject *__pyx_v_s, PyObject *__pyx_v_block_size) {
9200   PyObject *__pyx_v_tree = NULL;
9201   Py_ssize_t __pyx_v_i;
9202   PyObject *__pyx_r = NULL;
9203   __Pyx_RefNannyDeclarations
9204   Py_ssize_t __pyx_t_1;
9205   PyObject *__pyx_t_2 = NULL;
9206   PyObject *__pyx_t_3 = NULL;
9207   Py_ssize_t __pyx_t_4;
9208   Py_ssize_t __pyx_t_5;
9209   int __pyx_lineno = 0;
9210   const char *__pyx_filename = NULL;
9211   int __pyx_clineno = 0;
9212   __Pyx_RefNannySetupContext("from_sequence", 0);
9213 
9214   /* "bx/arrays/array_tree.pyx":304
9215  *         length and getitem).
9216  *         """
9217  *         tree = Class( len( s ), block_size )             # <<<<<<<<<<<<<<
9218  *         for i in range( len( s ) ):
9219  *             tree[i] = s[i]
9220  */
9221   __pyx_t_1 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 304, __pyx_L1_error)
9222   __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
9223   __Pyx_GOTREF(__pyx_t_2);
9224   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
9225   __Pyx_GOTREF(__pyx_t_3);
9226   __Pyx_GIVEREF(__pyx_t_2);
9227   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
9228   __Pyx_INCREF(__pyx_v_block_size);
9229   __Pyx_GIVEREF(__pyx_v_block_size);
9230   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_block_size);
9231   __pyx_t_2 = 0;
9232   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_Class), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
9233   __Pyx_GOTREF(__pyx_t_2);
9234   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9235   __pyx_v_tree = __pyx_t_2;
9236   __pyx_t_2 = 0;
9237 
9238   /* "bx/arrays/array_tree.pyx":305
9239  *         """
9240  *         tree = Class( len( s ), block_size )
9241  *         for i in range( len( s ) ):             # <<<<<<<<<<<<<<
9242  *             tree[i] = s[i]
9243  *         return tree
9244  */
9245   __pyx_t_1 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 305, __pyx_L1_error)
9246   __pyx_t_4 = __pyx_t_1;
9247   for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
9248     __pyx_v_i = __pyx_t_5;
9249 
9250     /* "bx/arrays/array_tree.pyx":306
9251  *         tree = Class( len( s ), block_size )
9252  *         for i in range( len( s ) ):
9253  *             tree[i] = s[i]             # <<<<<<<<<<<<<<
9254  *         return tree
9255  *
9256  */
9257     __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_s, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
9258     __Pyx_GOTREF(__pyx_t_2);
9259     if (unlikely(__Pyx_SetItemInt(__pyx_v_tree, __pyx_v_i, __pyx_t_2, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 306, __pyx_L1_error)
9260     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9261   }
9262 
9263   /* "bx/arrays/array_tree.pyx":307
9264  *         for i in range( len( s ) ):
9265  *             tree[i] = s[i]
9266  *         return tree             # <<<<<<<<<<<<<<
9267  *
9268  * cdef class ArrayTreeNode:
9269  */
9270   __Pyx_XDECREF(__pyx_r);
9271   __Pyx_INCREF(__pyx_v_tree);
9272   __pyx_r = __pyx_v_tree;
9273   goto __pyx_L0;
9274 
9275   /* "bx/arrays/array_tree.pyx":299
9276  *
9277  *     @classmethod
9278  *     def from_sequence( Class, s, block_size=1000 ):             # <<<<<<<<<<<<<<
9279  *         """
9280  *         Build an ArrayTree from a sequence like object (must have at least
9281  */
9282 
9283   /* function exit code */
9284   __pyx_L1_error:;
9285   __Pyx_XDECREF(__pyx_t_2);
9286   __Pyx_XDECREF(__pyx_t_3);
9287   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.from_sequence", __pyx_clineno, __pyx_lineno, __pyx_filename);
9288   __pyx_r = NULL;
9289   __pyx_L0:;
9290   __Pyx_XDECREF(__pyx_v_tree);
9291   __Pyx_XGIVEREF(__pyx_r);
9292   __Pyx_RefNannyFinishContext();
9293   return __pyx_r;
9294 }
9295 
9296 /* "bx/arrays/array_tree.pyx":234
9297  *     """
9298  *
9299  *     cdef public int max             # <<<<<<<<<<<<<<
9300  *     cdef public int block_size
9301  *     cdef public object dtype
9302  */
9303 
9304 /* Python wrapper */
9305 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_3max_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_3max_1__get__(PyObject * __pyx_v_self)9306 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_3max_1__get__(PyObject *__pyx_v_self) {
9307   PyObject *__pyx_r = 0;
9308   __Pyx_RefNannyDeclarations
9309   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9310   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_3max___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self));
9311 
9312   /* function exit code */
9313   __Pyx_RefNannyFinishContext();
9314   return __pyx_r;
9315 }
9316 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_3max___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self)9317 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_3max___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self) {
9318   PyObject *__pyx_r = NULL;
9319   __Pyx_RefNannyDeclarations
9320   PyObject *__pyx_t_1 = NULL;
9321   int __pyx_lineno = 0;
9322   const char *__pyx_filename = NULL;
9323   int __pyx_clineno = 0;
9324   __Pyx_RefNannySetupContext("__get__", 0);
9325   __Pyx_XDECREF(__pyx_r);
9326   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
9327   __Pyx_GOTREF(__pyx_t_1);
9328   __pyx_r = __pyx_t_1;
9329   __pyx_t_1 = 0;
9330   goto __pyx_L0;
9331 
9332   /* function exit code */
9333   __pyx_L1_error:;
9334   __Pyx_XDECREF(__pyx_t_1);
9335   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.max.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9336   __pyx_r = NULL;
9337   __pyx_L0:;
9338   __Pyx_XGIVEREF(__pyx_r);
9339   __Pyx_RefNannyFinishContext();
9340   return __pyx_r;
9341 }
9342 
9343 /* Python wrapper */
9344 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_3max_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_3max_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)9345 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_3max_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
9346   int __pyx_r;
9347   __Pyx_RefNannyDeclarations
9348   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
9349   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_3max_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self), ((PyObject *)__pyx_v_value));
9350 
9351   /* function exit code */
9352   __Pyx_RefNannyFinishContext();
9353   return __pyx_r;
9354 }
9355 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_3max_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self,PyObject * __pyx_v_value)9356 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_3max_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, PyObject *__pyx_v_value) {
9357   int __pyx_r;
9358   __Pyx_RefNannyDeclarations
9359   int __pyx_t_1;
9360   int __pyx_lineno = 0;
9361   const char *__pyx_filename = NULL;
9362   int __pyx_clineno = 0;
9363   __Pyx_RefNannySetupContext("__set__", 0);
9364   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 234, __pyx_L1_error)
9365   __pyx_v_self->max = __pyx_t_1;
9366 
9367   /* function exit code */
9368   __pyx_r = 0;
9369   goto __pyx_L0;
9370   __pyx_L1_error:;
9371   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.max.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9372   __pyx_r = -1;
9373   __pyx_L0:;
9374   __Pyx_RefNannyFinishContext();
9375   return __pyx_r;
9376 }
9377 
9378 /* "bx/arrays/array_tree.pyx":235
9379  *
9380  *     cdef public int max
9381  *     cdef public int block_size             # <<<<<<<<<<<<<<
9382  *     cdef public object dtype
9383  *     cdef public int levels
9384  */
9385 
9386 /* Python wrapper */
9387 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_10block_size_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_10block_size_1__get__(PyObject * __pyx_v_self)9388 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_10block_size_1__get__(PyObject *__pyx_v_self) {
9389   PyObject *__pyx_r = 0;
9390   __Pyx_RefNannyDeclarations
9391   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9392   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_10block_size___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self));
9393 
9394   /* function exit code */
9395   __Pyx_RefNannyFinishContext();
9396   return __pyx_r;
9397 }
9398 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_10block_size___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self)9399 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_10block_size___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self) {
9400   PyObject *__pyx_r = NULL;
9401   __Pyx_RefNannyDeclarations
9402   PyObject *__pyx_t_1 = NULL;
9403   int __pyx_lineno = 0;
9404   const char *__pyx_filename = NULL;
9405   int __pyx_clineno = 0;
9406   __Pyx_RefNannySetupContext("__get__", 0);
9407   __Pyx_XDECREF(__pyx_r);
9408   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->block_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
9409   __Pyx_GOTREF(__pyx_t_1);
9410   __pyx_r = __pyx_t_1;
9411   __pyx_t_1 = 0;
9412   goto __pyx_L0;
9413 
9414   /* function exit code */
9415   __pyx_L1_error:;
9416   __Pyx_XDECREF(__pyx_t_1);
9417   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.block_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9418   __pyx_r = NULL;
9419   __pyx_L0:;
9420   __Pyx_XGIVEREF(__pyx_r);
9421   __Pyx_RefNannyFinishContext();
9422   return __pyx_r;
9423 }
9424 
9425 /* Python wrapper */
9426 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_10block_size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_10block_size_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)9427 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_10block_size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
9428   int __pyx_r;
9429   __Pyx_RefNannyDeclarations
9430   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
9431   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_10block_size_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self), ((PyObject *)__pyx_v_value));
9432 
9433   /* function exit code */
9434   __Pyx_RefNannyFinishContext();
9435   return __pyx_r;
9436 }
9437 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_10block_size_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self,PyObject * __pyx_v_value)9438 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_10block_size_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, PyObject *__pyx_v_value) {
9439   int __pyx_r;
9440   __Pyx_RefNannyDeclarations
9441   int __pyx_t_1;
9442   int __pyx_lineno = 0;
9443   const char *__pyx_filename = NULL;
9444   int __pyx_clineno = 0;
9445   __Pyx_RefNannySetupContext("__set__", 0);
9446   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 235, __pyx_L1_error)
9447   __pyx_v_self->block_size = __pyx_t_1;
9448 
9449   /* function exit code */
9450   __pyx_r = 0;
9451   goto __pyx_L0;
9452   __pyx_L1_error:;
9453   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.block_size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9454   __pyx_r = -1;
9455   __pyx_L0:;
9456   __Pyx_RefNannyFinishContext();
9457   return __pyx_r;
9458 }
9459 
9460 /* "bx/arrays/array_tree.pyx":236
9461  *     cdef public int max
9462  *     cdef public int block_size
9463  *     cdef public object dtype             # <<<<<<<<<<<<<<
9464  *     cdef public int levels
9465  *     cdef public int no_leaves
9466  */
9467 
9468 /* Python wrapper */
9469 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_5dtype_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_5dtype_1__get__(PyObject * __pyx_v_self)9470 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_5dtype_1__get__(PyObject *__pyx_v_self) {
9471   PyObject *__pyx_r = 0;
9472   __Pyx_RefNannyDeclarations
9473   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9474   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_5dtype___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self));
9475 
9476   /* function exit code */
9477   __Pyx_RefNannyFinishContext();
9478   return __pyx_r;
9479 }
9480 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_5dtype___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self)9481 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_5dtype___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self) {
9482   PyObject *__pyx_r = NULL;
9483   __Pyx_RefNannyDeclarations
9484   __Pyx_RefNannySetupContext("__get__", 0);
9485   __Pyx_XDECREF(__pyx_r);
9486   __Pyx_INCREF(__pyx_v_self->dtype);
9487   __pyx_r = __pyx_v_self->dtype;
9488   goto __pyx_L0;
9489 
9490   /* function exit code */
9491   __pyx_L0:;
9492   __Pyx_XGIVEREF(__pyx_r);
9493   __Pyx_RefNannyFinishContext();
9494   return __pyx_r;
9495 }
9496 
9497 /* Python wrapper */
9498 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_5dtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_5dtype_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)9499 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_5dtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
9500   int __pyx_r;
9501   __Pyx_RefNannyDeclarations
9502   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
9503   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_5dtype_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self), ((PyObject *)__pyx_v_value));
9504 
9505   /* function exit code */
9506   __Pyx_RefNannyFinishContext();
9507   return __pyx_r;
9508 }
9509 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_5dtype_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self,PyObject * __pyx_v_value)9510 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_5dtype_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, PyObject *__pyx_v_value) {
9511   int __pyx_r;
9512   __Pyx_RefNannyDeclarations
9513   __Pyx_RefNannySetupContext("__set__", 0);
9514   __Pyx_INCREF(__pyx_v_value);
9515   __Pyx_GIVEREF(__pyx_v_value);
9516   __Pyx_GOTREF(__pyx_v_self->dtype);
9517   __Pyx_DECREF(__pyx_v_self->dtype);
9518   __pyx_v_self->dtype = __pyx_v_value;
9519 
9520   /* function exit code */
9521   __pyx_r = 0;
9522   __Pyx_RefNannyFinishContext();
9523   return __pyx_r;
9524 }
9525 
9526 /* Python wrapper */
9527 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_5dtype_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_5dtype_5__del__(PyObject * __pyx_v_self)9528 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_5dtype_5__del__(PyObject *__pyx_v_self) {
9529   int __pyx_r;
9530   __Pyx_RefNannyDeclarations
9531   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
9532   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_5dtype_4__del__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self));
9533 
9534   /* function exit code */
9535   __Pyx_RefNannyFinishContext();
9536   return __pyx_r;
9537 }
9538 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_5dtype_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self)9539 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_5dtype_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self) {
9540   int __pyx_r;
9541   __Pyx_RefNannyDeclarations
9542   __Pyx_RefNannySetupContext("__del__", 0);
9543   __Pyx_INCREF(Py_None);
9544   __Pyx_GIVEREF(Py_None);
9545   __Pyx_GOTREF(__pyx_v_self->dtype);
9546   __Pyx_DECREF(__pyx_v_self->dtype);
9547   __pyx_v_self->dtype = Py_None;
9548 
9549   /* function exit code */
9550   __pyx_r = 0;
9551   __Pyx_RefNannyFinishContext();
9552   return __pyx_r;
9553 }
9554 
9555 /* "bx/arrays/array_tree.pyx":237
9556  *     cdef public int block_size
9557  *     cdef public object dtype
9558  *     cdef public int levels             # <<<<<<<<<<<<<<
9559  *     cdef public int no_leaves
9560  *     cdef public ArrayTreeNode root
9561  */
9562 
9563 /* Python wrapper */
9564 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_6levels_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_6levels_1__get__(PyObject * __pyx_v_self)9565 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_6levels_1__get__(PyObject *__pyx_v_self) {
9566   PyObject *__pyx_r = 0;
9567   __Pyx_RefNannyDeclarations
9568   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9569   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_6levels___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self));
9570 
9571   /* function exit code */
9572   __Pyx_RefNannyFinishContext();
9573   return __pyx_r;
9574 }
9575 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_6levels___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self)9576 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_6levels___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self) {
9577   PyObject *__pyx_r = NULL;
9578   __Pyx_RefNannyDeclarations
9579   PyObject *__pyx_t_1 = NULL;
9580   int __pyx_lineno = 0;
9581   const char *__pyx_filename = NULL;
9582   int __pyx_clineno = 0;
9583   __Pyx_RefNannySetupContext("__get__", 0);
9584   __Pyx_XDECREF(__pyx_r);
9585   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->levels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
9586   __Pyx_GOTREF(__pyx_t_1);
9587   __pyx_r = __pyx_t_1;
9588   __pyx_t_1 = 0;
9589   goto __pyx_L0;
9590 
9591   /* function exit code */
9592   __pyx_L1_error:;
9593   __Pyx_XDECREF(__pyx_t_1);
9594   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.levels.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9595   __pyx_r = NULL;
9596   __pyx_L0:;
9597   __Pyx_XGIVEREF(__pyx_r);
9598   __Pyx_RefNannyFinishContext();
9599   return __pyx_r;
9600 }
9601 
9602 /* Python wrapper */
9603 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_6levels_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_6levels_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)9604 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_6levels_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
9605   int __pyx_r;
9606   __Pyx_RefNannyDeclarations
9607   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
9608   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_6levels_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self), ((PyObject *)__pyx_v_value));
9609 
9610   /* function exit code */
9611   __Pyx_RefNannyFinishContext();
9612   return __pyx_r;
9613 }
9614 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_6levels_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self,PyObject * __pyx_v_value)9615 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_6levels_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, PyObject *__pyx_v_value) {
9616   int __pyx_r;
9617   __Pyx_RefNannyDeclarations
9618   int __pyx_t_1;
9619   int __pyx_lineno = 0;
9620   const char *__pyx_filename = NULL;
9621   int __pyx_clineno = 0;
9622   __Pyx_RefNannySetupContext("__set__", 0);
9623   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L1_error)
9624   __pyx_v_self->levels = __pyx_t_1;
9625 
9626   /* function exit code */
9627   __pyx_r = 0;
9628   goto __pyx_L0;
9629   __pyx_L1_error:;
9630   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.levels.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9631   __pyx_r = -1;
9632   __pyx_L0:;
9633   __Pyx_RefNannyFinishContext();
9634   return __pyx_r;
9635 }
9636 
9637 /* "bx/arrays/array_tree.pyx":238
9638  *     cdef public object dtype
9639  *     cdef public int levels
9640  *     cdef public int no_leaves             # <<<<<<<<<<<<<<
9641  *     cdef public ArrayTreeNode root
9642  *
9643  */
9644 
9645 /* Python wrapper */
9646 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_9no_leaves_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_9no_leaves_1__get__(PyObject * __pyx_v_self)9647 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_9no_leaves_1__get__(PyObject *__pyx_v_self) {
9648   PyObject *__pyx_r = 0;
9649   __Pyx_RefNannyDeclarations
9650   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9651   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_9no_leaves___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self));
9652 
9653   /* function exit code */
9654   __Pyx_RefNannyFinishContext();
9655   return __pyx_r;
9656 }
9657 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_9no_leaves___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self)9658 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_9no_leaves___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self) {
9659   PyObject *__pyx_r = NULL;
9660   __Pyx_RefNannyDeclarations
9661   PyObject *__pyx_t_1 = NULL;
9662   int __pyx_lineno = 0;
9663   const char *__pyx_filename = NULL;
9664   int __pyx_clineno = 0;
9665   __Pyx_RefNannySetupContext("__get__", 0);
9666   __Pyx_XDECREF(__pyx_r);
9667   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->no_leaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
9668   __Pyx_GOTREF(__pyx_t_1);
9669   __pyx_r = __pyx_t_1;
9670   __pyx_t_1 = 0;
9671   goto __pyx_L0;
9672 
9673   /* function exit code */
9674   __pyx_L1_error:;
9675   __Pyx_XDECREF(__pyx_t_1);
9676   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.no_leaves.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9677   __pyx_r = NULL;
9678   __pyx_L0:;
9679   __Pyx_XGIVEREF(__pyx_r);
9680   __Pyx_RefNannyFinishContext();
9681   return __pyx_r;
9682 }
9683 
9684 /* Python wrapper */
9685 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_9no_leaves_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_9no_leaves_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)9686 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_9no_leaves_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
9687   int __pyx_r;
9688   __Pyx_RefNannyDeclarations
9689   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
9690   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_9no_leaves_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self), ((PyObject *)__pyx_v_value));
9691 
9692   /* function exit code */
9693   __Pyx_RefNannyFinishContext();
9694   return __pyx_r;
9695 }
9696 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_9no_leaves_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self,PyObject * __pyx_v_value)9697 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_9no_leaves_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, PyObject *__pyx_v_value) {
9698   int __pyx_r;
9699   __Pyx_RefNannyDeclarations
9700   int __pyx_t_1;
9701   int __pyx_lineno = 0;
9702   const char *__pyx_filename = NULL;
9703   int __pyx_clineno = 0;
9704   __Pyx_RefNannySetupContext("__set__", 0);
9705   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L1_error)
9706   __pyx_v_self->no_leaves = __pyx_t_1;
9707 
9708   /* function exit code */
9709   __pyx_r = 0;
9710   goto __pyx_L0;
9711   __pyx_L1_error:;
9712   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.no_leaves.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9713   __pyx_r = -1;
9714   __pyx_L0:;
9715   __Pyx_RefNannyFinishContext();
9716   return __pyx_r;
9717 }
9718 
9719 /* "bx/arrays/array_tree.pyx":239
9720  *     cdef public int levels
9721  *     cdef public int no_leaves
9722  *     cdef public ArrayTreeNode root             # <<<<<<<<<<<<<<
9723  *
9724  *     def __init__( self, int max, int block_size, dtype=float32, no_leaves=False ):
9725  */
9726 
9727 /* Python wrapper */
9728 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_4root_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_4root_1__get__(PyObject * __pyx_v_self)9729 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_4root_1__get__(PyObject *__pyx_v_self) {
9730   PyObject *__pyx_r = 0;
9731   __Pyx_RefNannyDeclarations
9732   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9733   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_4root___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self));
9734 
9735   /* function exit code */
9736   __Pyx_RefNannyFinishContext();
9737   return __pyx_r;
9738 }
9739 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_4root___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self)9740 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_4root___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self) {
9741   PyObject *__pyx_r = NULL;
9742   __Pyx_RefNannyDeclarations
9743   __Pyx_RefNannySetupContext("__get__", 0);
9744   __Pyx_XDECREF(__pyx_r);
9745   __Pyx_INCREF(((PyObject *)__pyx_v_self->root));
9746   __pyx_r = ((PyObject *)__pyx_v_self->root);
9747   goto __pyx_L0;
9748 
9749   /* function exit code */
9750   __pyx_L0:;
9751   __Pyx_XGIVEREF(__pyx_r);
9752   __Pyx_RefNannyFinishContext();
9753   return __pyx_r;
9754 }
9755 
9756 /* Python wrapper */
9757 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_4root_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_4root_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)9758 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_4root_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
9759   int __pyx_r;
9760   __Pyx_RefNannyDeclarations
9761   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
9762   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_4root_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self), ((PyObject *)__pyx_v_value));
9763 
9764   /* function exit code */
9765   __Pyx_RefNannyFinishContext();
9766   return __pyx_r;
9767 }
9768 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_4root_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self,PyObject * __pyx_v_value)9769 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_4root_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, PyObject *__pyx_v_value) {
9770   int __pyx_r;
9771   __Pyx_RefNannyDeclarations
9772   PyObject *__pyx_t_1 = NULL;
9773   int __pyx_lineno = 0;
9774   const char *__pyx_filename = NULL;
9775   int __pyx_clineno = 0;
9776   __Pyx_RefNannySetupContext("__set__", 0);
9777   if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2bx_6arrays_10array_tree_ArrayTreeNode))))) __PYX_ERR(0, 239, __pyx_L1_error)
9778   __pyx_t_1 = __pyx_v_value;
9779   __Pyx_INCREF(__pyx_t_1);
9780   __Pyx_GIVEREF(__pyx_t_1);
9781   __Pyx_GOTREF(__pyx_v_self->root);
9782   __Pyx_DECREF(((PyObject *)__pyx_v_self->root));
9783   __pyx_v_self->root = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_t_1);
9784   __pyx_t_1 = 0;
9785 
9786   /* function exit code */
9787   __pyx_r = 0;
9788   goto __pyx_L0;
9789   __pyx_L1_error:;
9790   __Pyx_XDECREF(__pyx_t_1);
9791   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.root.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9792   __pyx_r = -1;
9793   __pyx_L0:;
9794   __Pyx_RefNannyFinishContext();
9795   return __pyx_r;
9796 }
9797 
9798 /* Python wrapper */
9799 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_4root_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_4root_5__del__(PyObject * __pyx_v_self)9800 static int __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_4root_5__del__(PyObject *__pyx_v_self) {
9801   int __pyx_r;
9802   __Pyx_RefNannyDeclarations
9803   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
9804   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_4root_4__del__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self));
9805 
9806   /* function exit code */
9807   __Pyx_RefNannyFinishContext();
9808   return __pyx_r;
9809 }
9810 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_4root_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self)9811 static int __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_4root_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self) {
9812   int __pyx_r;
9813   __Pyx_RefNannyDeclarations
9814   __Pyx_RefNannySetupContext("__del__", 0);
9815   __Pyx_INCREF(Py_None);
9816   __Pyx_GIVEREF(Py_None);
9817   __Pyx_GOTREF(__pyx_v_self->root);
9818   __Pyx_DECREF(((PyObject *)__pyx_v_self->root));
9819   __pyx_v_self->root = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)Py_None);
9820 
9821   /* function exit code */
9822   __pyx_r = 0;
9823   __Pyx_RefNannyFinishContext();
9824   return __pyx_r;
9825 }
9826 
9827 /* "(tree fragment)":1
9828  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
9829  *     cdef tuple state
9830  *     cdef object _dict
9831  */
9832 
9833 /* Python wrapper */
9834 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_15__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)9835 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9836   PyObject *__pyx_r = 0;
9837   __Pyx_RefNannyDeclarations
9838   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9839   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_14__reduce_cython__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self));
9840 
9841   /* function exit code */
9842   __Pyx_RefNannyFinishContext();
9843   return __pyx_r;
9844 }
9845 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_14__reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self)9846 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_14__reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self) {
9847   PyObject *__pyx_v_state = 0;
9848   PyObject *__pyx_v__dict = 0;
9849   int __pyx_v_use_setstate;
9850   PyObject *__pyx_r = NULL;
9851   __Pyx_RefNannyDeclarations
9852   PyObject *__pyx_t_1 = NULL;
9853   PyObject *__pyx_t_2 = NULL;
9854   PyObject *__pyx_t_3 = NULL;
9855   PyObject *__pyx_t_4 = NULL;
9856   PyObject *__pyx_t_5 = NULL;
9857   int __pyx_t_6;
9858   int __pyx_t_7;
9859   int __pyx_t_8;
9860   int __pyx_lineno = 0;
9861   const char *__pyx_filename = NULL;
9862   int __pyx_clineno = 0;
9863   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9864 
9865   /* "(tree fragment)":5
9866  *     cdef object _dict
9867  *     cdef bint use_setstate
9868  *     state = (self.block_size, self.dtype, self.levels, self.max, self.no_leaves, self.root)             # <<<<<<<<<<<<<<
9869  *     _dict = getattr(self, '__dict__', None)
9870  *     if _dict is not None:
9871  */
9872   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->block_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9873   __Pyx_GOTREF(__pyx_t_1);
9874   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->levels); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
9875   __Pyx_GOTREF(__pyx_t_2);
9876   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->max); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
9877   __Pyx_GOTREF(__pyx_t_3);
9878   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->no_leaves); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
9879   __Pyx_GOTREF(__pyx_t_4);
9880   __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
9881   __Pyx_GOTREF(__pyx_t_5);
9882   __Pyx_GIVEREF(__pyx_t_1);
9883   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
9884   __Pyx_INCREF(__pyx_v_self->dtype);
9885   __Pyx_GIVEREF(__pyx_v_self->dtype);
9886   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->dtype);
9887   __Pyx_GIVEREF(__pyx_t_2);
9888   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
9889   __Pyx_GIVEREF(__pyx_t_3);
9890   PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3);
9891   __Pyx_GIVEREF(__pyx_t_4);
9892   PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_4);
9893   __Pyx_INCREF(((PyObject *)__pyx_v_self->root));
9894   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->root));
9895   PyTuple_SET_ITEM(__pyx_t_5, 5, ((PyObject *)__pyx_v_self->root));
9896   __pyx_t_1 = 0;
9897   __pyx_t_2 = 0;
9898   __pyx_t_3 = 0;
9899   __pyx_t_4 = 0;
9900   __pyx_v_state = ((PyObject*)__pyx_t_5);
9901   __pyx_t_5 = 0;
9902 
9903   /* "(tree fragment)":6
9904  *     cdef bint use_setstate
9905  *     state = (self.block_size, self.dtype, self.levels, self.max, self.no_leaves, self.root)
9906  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
9907  *     if _dict is not None:
9908  *         state += (_dict,)
9909  */
9910   __pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
9911   __Pyx_GOTREF(__pyx_t_5);
9912   __pyx_v__dict = __pyx_t_5;
9913   __pyx_t_5 = 0;
9914 
9915   /* "(tree fragment)":7
9916  *     state = (self.block_size, self.dtype, self.levels, self.max, self.no_leaves, self.root)
9917  *     _dict = getattr(self, '__dict__', None)
9918  *     if _dict is not None:             # <<<<<<<<<<<<<<
9919  *         state += (_dict,)
9920  *         use_setstate = True
9921  */
9922   __pyx_t_6 = (__pyx_v__dict != Py_None);
9923   __pyx_t_7 = (__pyx_t_6 != 0);
9924   if (__pyx_t_7) {
9925 
9926     /* "(tree fragment)":8
9927  *     _dict = getattr(self, '__dict__', None)
9928  *     if _dict is not None:
9929  *         state += (_dict,)             # <<<<<<<<<<<<<<
9930  *         use_setstate = True
9931  *     else:
9932  */
9933     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 8, __pyx_L1_error)
9934     __Pyx_GOTREF(__pyx_t_5);
9935     __Pyx_INCREF(__pyx_v__dict);
9936     __Pyx_GIVEREF(__pyx_v__dict);
9937     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict);
9938     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9939     __Pyx_GOTREF(__pyx_t_4);
9940     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9941     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9942     __pyx_t_4 = 0;
9943 
9944     /* "(tree fragment)":9
9945  *     if _dict is not None:
9946  *         state += (_dict,)
9947  *         use_setstate = True             # <<<<<<<<<<<<<<
9948  *     else:
9949  *         use_setstate = self.dtype is not None or self.root is not None
9950  */
9951     __pyx_v_use_setstate = 1;
9952 
9953     /* "(tree fragment)":7
9954  *     state = (self.block_size, self.dtype, self.levels, self.max, self.no_leaves, self.root)
9955  *     _dict = getattr(self, '__dict__', None)
9956  *     if _dict is not None:             # <<<<<<<<<<<<<<
9957  *         state += (_dict,)
9958  *         use_setstate = True
9959  */
9960     goto __pyx_L3;
9961   }
9962 
9963   /* "(tree fragment)":11
9964  *         use_setstate = True
9965  *     else:
9966  *         use_setstate = self.dtype is not None or self.root is not None             # <<<<<<<<<<<<<<
9967  *     if use_setstate:
9968  *         return __pyx_unpickle_ArrayTree, (type(self), 0x69195cf, None), state
9969  */
9970   /*else*/ {
9971     __pyx_t_6 = (__pyx_v_self->dtype != Py_None);
9972     __pyx_t_8 = (__pyx_t_6 != 0);
9973     if (!__pyx_t_8) {
9974     } else {
9975       __pyx_t_7 = __pyx_t_8;
9976       goto __pyx_L4_bool_binop_done;
9977     }
9978     __pyx_t_8 = (((PyObject *)__pyx_v_self->root) != Py_None);
9979     __pyx_t_6 = (__pyx_t_8 != 0);
9980     __pyx_t_7 = __pyx_t_6;
9981     __pyx_L4_bool_binop_done:;
9982     __pyx_v_use_setstate = __pyx_t_7;
9983   }
9984   __pyx_L3:;
9985 
9986   /* "(tree fragment)":12
9987  *     else:
9988  *         use_setstate = self.dtype is not None or self.root is not None
9989  *     if use_setstate:             # <<<<<<<<<<<<<<
9990  *         return __pyx_unpickle_ArrayTree, (type(self), 0x69195cf, None), state
9991  *     else:
9992  */
9993   __pyx_t_7 = (__pyx_v_use_setstate != 0);
9994   if (__pyx_t_7) {
9995 
9996     /* "(tree fragment)":13
9997  *         use_setstate = self.dtype is not None or self.root is not None
9998  *     if use_setstate:
9999  *         return __pyx_unpickle_ArrayTree, (type(self), 0x69195cf, None), state             # <<<<<<<<<<<<<<
10000  *     else:
10001  *         return __pyx_unpickle_ArrayTree, (type(self), 0x69195cf, state)
10002  */
10003     __Pyx_XDECREF(__pyx_r);
10004     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_ArrayTree); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
10005     __Pyx_GOTREF(__pyx_t_4);
10006     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
10007     __Pyx_GOTREF(__pyx_t_5);
10008     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10009     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10010     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10011     __Pyx_INCREF(__pyx_int_110204367);
10012     __Pyx_GIVEREF(__pyx_int_110204367);
10013     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_110204367);
10014     __Pyx_INCREF(Py_None);
10015     __Pyx_GIVEREF(Py_None);
10016     PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None);
10017     __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
10018     __Pyx_GOTREF(__pyx_t_3);
10019     __Pyx_GIVEREF(__pyx_t_4);
10020     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
10021     __Pyx_GIVEREF(__pyx_t_5);
10022     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
10023     __Pyx_INCREF(__pyx_v_state);
10024     __Pyx_GIVEREF(__pyx_v_state);
10025     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
10026     __pyx_t_4 = 0;
10027     __pyx_t_5 = 0;
10028     __pyx_r = __pyx_t_3;
10029     __pyx_t_3 = 0;
10030     goto __pyx_L0;
10031 
10032     /* "(tree fragment)":12
10033  *     else:
10034  *         use_setstate = self.dtype is not None or self.root is not None
10035  *     if use_setstate:             # <<<<<<<<<<<<<<
10036  *         return __pyx_unpickle_ArrayTree, (type(self), 0x69195cf, None), state
10037  *     else:
10038  */
10039   }
10040 
10041   /* "(tree fragment)":15
10042  *         return __pyx_unpickle_ArrayTree, (type(self), 0x69195cf, None), state
10043  *     else:
10044  *         return __pyx_unpickle_ArrayTree, (type(self), 0x69195cf, state)             # <<<<<<<<<<<<<<
10045  * def __setstate_cython__(self, __pyx_state):
10046  *     __pyx_unpickle_ArrayTree__set_state(self, __pyx_state)
10047  */
10048   /*else*/ {
10049     __Pyx_XDECREF(__pyx_r);
10050     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_ArrayTree); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
10051     __Pyx_GOTREF(__pyx_t_3);
10052     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
10053     __Pyx_GOTREF(__pyx_t_5);
10054     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10055     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10056     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10057     __Pyx_INCREF(__pyx_int_110204367);
10058     __Pyx_GIVEREF(__pyx_int_110204367);
10059     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_110204367);
10060     __Pyx_INCREF(__pyx_v_state);
10061     __Pyx_GIVEREF(__pyx_v_state);
10062     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10063     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
10064     __Pyx_GOTREF(__pyx_t_4);
10065     __Pyx_GIVEREF(__pyx_t_3);
10066     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
10067     __Pyx_GIVEREF(__pyx_t_5);
10068     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
10069     __pyx_t_3 = 0;
10070     __pyx_t_5 = 0;
10071     __pyx_r = __pyx_t_4;
10072     __pyx_t_4 = 0;
10073     goto __pyx_L0;
10074   }
10075 
10076   /* "(tree fragment)":1
10077  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
10078  *     cdef tuple state
10079  *     cdef object _dict
10080  */
10081 
10082   /* function exit code */
10083   __pyx_L1_error:;
10084   __Pyx_XDECREF(__pyx_t_1);
10085   __Pyx_XDECREF(__pyx_t_2);
10086   __Pyx_XDECREF(__pyx_t_3);
10087   __Pyx_XDECREF(__pyx_t_4);
10088   __Pyx_XDECREF(__pyx_t_5);
10089   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10090   __pyx_r = NULL;
10091   __pyx_L0:;
10092   __Pyx_XDECREF(__pyx_v_state);
10093   __Pyx_XDECREF(__pyx_v__dict);
10094   __Pyx_XGIVEREF(__pyx_r);
10095   __Pyx_RefNannyFinishContext();
10096   return __pyx_r;
10097 }
10098 
10099 /* "(tree fragment)":16
10100  *     else:
10101  *         return __pyx_unpickle_ArrayTree, (type(self), 0x69195cf, state)
10102  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
10103  *     __pyx_unpickle_ArrayTree__set_state(self, __pyx_state)
10104  */
10105 
10106 /* Python wrapper */
10107 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_17__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)10108 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10109   PyObject *__pyx_r = 0;
10110   __Pyx_RefNannyDeclarations
10111   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10112   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_16__setstate_cython__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10113 
10114   /* function exit code */
10115   __Pyx_RefNannyFinishContext();
10116   return __pyx_r;
10117 }
10118 
__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_16__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_self,PyObject * __pyx_v___pyx_state)10119 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_9ArrayTree_16__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10120   PyObject *__pyx_r = NULL;
10121   __Pyx_RefNannyDeclarations
10122   PyObject *__pyx_t_1 = NULL;
10123   int __pyx_lineno = 0;
10124   const char *__pyx_filename = NULL;
10125   int __pyx_clineno = 0;
10126   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10127 
10128   /* "(tree fragment)":17
10129  *         return __pyx_unpickle_ArrayTree, (type(self), 0x69195cf, state)
10130  * def __setstate_cython__(self, __pyx_state):
10131  *     __pyx_unpickle_ArrayTree__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
10132  */
10133   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
10134   __pyx_t_1 = __pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_ArrayTree__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
10135   __Pyx_GOTREF(__pyx_t_1);
10136   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10137 
10138   /* "(tree fragment)":16
10139  *     else:
10140  *         return __pyx_unpickle_ArrayTree, (type(self), 0x69195cf, state)
10141  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
10142  *     __pyx_unpickle_ArrayTree__set_state(self, __pyx_state)
10143  */
10144 
10145   /* function exit code */
10146   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10147   goto __pyx_L0;
10148   __pyx_L1_error:;
10149   __Pyx_XDECREF(__pyx_t_1);
10150   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTree.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10151   __pyx_r = NULL;
10152   __pyx_L0:;
10153   __Pyx_XGIVEREF(__pyx_r);
10154   __Pyx_RefNannyFinishContext();
10155   return __pyx_r;
10156 }
10157 
10158 /* "bx/arrays/array_tree.pyx":325
10159  *     cdef public long start_offset
10160  *
10161  *     def __init__( self, ArrayTree tree, int min, int max, int block_size, int level ):             # <<<<<<<<<<<<<<
10162  *         self.tree = tree
10163  *         self.min = min
10164  */
10165 
10166 /* Python wrapper */
10167 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)10168 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10169   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_tree = 0;
10170   int __pyx_v_min;
10171   int __pyx_v_max;
10172   int __pyx_v_block_size;
10173   int __pyx_v_level;
10174   int __pyx_lineno = 0;
10175   const char *__pyx_filename = NULL;
10176   int __pyx_clineno = 0;
10177   int __pyx_r;
10178   __Pyx_RefNannyDeclarations
10179   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
10180   {
10181     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tree,&__pyx_n_s_min,&__pyx_n_s_max,&__pyx_n_s_block_size,&__pyx_n_s_level,0};
10182     PyObject* values[5] = {0,0,0,0,0};
10183     if (unlikely(__pyx_kwds)) {
10184       Py_ssize_t kw_args;
10185       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10186       switch (pos_args) {
10187         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10188         CYTHON_FALLTHROUGH;
10189         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10190         CYTHON_FALLTHROUGH;
10191         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10192         CYTHON_FALLTHROUGH;
10193         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10194         CYTHON_FALLTHROUGH;
10195         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10196         CYTHON_FALLTHROUGH;
10197         case  0: break;
10198         default: goto __pyx_L5_argtuple_error;
10199       }
10200       kw_args = PyDict_Size(__pyx_kwds);
10201       switch (pos_args) {
10202         case  0:
10203         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tree)) != 0)) kw_args--;
10204         else goto __pyx_L5_argtuple_error;
10205         CYTHON_FALLTHROUGH;
10206         case  1:
10207         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min)) != 0)) kw_args--;
10208         else {
10209           __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 1); __PYX_ERR(0, 325, __pyx_L3_error)
10210         }
10211         CYTHON_FALLTHROUGH;
10212         case  2:
10213         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max)) != 0)) kw_args--;
10214         else {
10215           __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 2); __PYX_ERR(0, 325, __pyx_L3_error)
10216         }
10217         CYTHON_FALLTHROUGH;
10218         case  3:
10219         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block_size)) != 0)) kw_args--;
10220         else {
10221           __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 3); __PYX_ERR(0, 325, __pyx_L3_error)
10222         }
10223         CYTHON_FALLTHROUGH;
10224         case  4:
10225         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
10226         else {
10227           __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 4); __PYX_ERR(0, 325, __pyx_L3_error)
10228         }
10229       }
10230       if (unlikely(kw_args > 0)) {
10231         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 325, __pyx_L3_error)
10232       }
10233     } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
10234       goto __pyx_L5_argtuple_error;
10235     } else {
10236       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10237       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10238       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10239       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10240       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10241     }
10242     __pyx_v_tree = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)values[0]);
10243     __pyx_v_min = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_min == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 325, __pyx_L3_error)
10244     __pyx_v_max = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_max == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 325, __pyx_L3_error)
10245     __pyx_v_block_size = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_block_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 325, __pyx_L3_error)
10246     __pyx_v_level = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 325, __pyx_L3_error)
10247   }
10248   goto __pyx_L4_argument_unpacking_done;
10249   __pyx_L5_argtuple_error:;
10250   __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 325, __pyx_L3_error)
10251   __pyx_L3_error:;
10252   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10253   __Pyx_RefNannyFinishContext();
10254   return -1;
10255   __pyx_L4_argument_unpacking_done:;
10256   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_2bx_6arrays_10array_tree_ArrayTree, 1, "tree", 0))) __PYX_ERR(0, 325, __pyx_L1_error)
10257   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode___init__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_v_self), __pyx_v_tree, __pyx_v_min, __pyx_v_max, __pyx_v_block_size, __pyx_v_level);
10258 
10259   /* function exit code */
10260   goto __pyx_L0;
10261   __pyx_L1_error:;
10262   __pyx_r = -1;
10263   __pyx_L0:;
10264   __Pyx_RefNannyFinishContext();
10265   return __pyx_r;
10266 }
10267 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode___init__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self,struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_tree,int __pyx_v_min,int __pyx_v_max,int __pyx_v_block_size,int __pyx_v_level)10268 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode___init__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_tree, int __pyx_v_min, int __pyx_v_max, int __pyx_v_block_size, int __pyx_v_level) {
10269   int __pyx_r;
10270   __Pyx_RefNannyDeclarations
10271   PyObject *__pyx_t_1 = NULL;
10272   int __pyx_lineno = 0;
10273   const char *__pyx_filename = NULL;
10274   int __pyx_clineno = 0;
10275   __Pyx_RefNannySetupContext("__init__", 0);
10276 
10277   /* "bx/arrays/array_tree.pyx":326
10278  *
10279  *     def __init__( self, ArrayTree tree, int min, int max, int block_size, int level ):
10280  *         self.tree = tree             # <<<<<<<<<<<<<<
10281  *         self.min = min
10282  *         self.max = max
10283  */
10284   __Pyx_INCREF(((PyObject *)__pyx_v_tree));
10285   __Pyx_GIVEREF(((PyObject *)__pyx_v_tree));
10286   __Pyx_GOTREF(__pyx_v_self->tree);
10287   __Pyx_DECREF(((PyObject *)__pyx_v_self->tree));
10288   __pyx_v_self->tree = __pyx_v_tree;
10289 
10290   /* "bx/arrays/array_tree.pyx":327
10291  *     def __init__( self, ArrayTree tree, int min, int max, int block_size, int level ):
10292  *         self.tree = tree
10293  *         self.min = min             # <<<<<<<<<<<<<<
10294  *         self.max = max
10295  *         self.block_size = block_size
10296  */
10297   __pyx_v_self->min = __pyx_v_min;
10298 
10299   /* "bx/arrays/array_tree.pyx":328
10300  *         self.tree = tree
10301  *         self.min = min
10302  *         self.max = max             # <<<<<<<<<<<<<<
10303  *         self.block_size = block_size
10304  *         self.level = level
10305  */
10306   __pyx_v_self->max = __pyx_v_max;
10307 
10308   /* "bx/arrays/array_tree.pyx":329
10309  *         self.min = min
10310  *         self.max = max
10311  *         self.block_size = block_size             # <<<<<<<<<<<<<<
10312  *         self.level = level
10313  *         # Each of my children represents block_size ** level values
10314  */
10315   __pyx_v_self->block_size = __pyx_v_block_size;
10316 
10317   /* "bx/arrays/array_tree.pyx":330
10318  *         self.max = max
10319  *         self.block_size = block_size
10320  *         self.level = level             # <<<<<<<<<<<<<<
10321  *         # Each of my children represents block_size ** level values
10322  *         self.child_size = self.block_size ** self.level
10323  */
10324   __pyx_v_self->level = __pyx_v_level;
10325 
10326   /* "bx/arrays/array_tree.pyx":332
10327  *         self.level = level
10328  *         # Each of my children represents block_size ** level values
10329  *         self.child_size = self.block_size ** self.level             # <<<<<<<<<<<<<<
10330  *         self.children = [None] * self.block_size
10331  *         self.summary = None
10332  */
10333   __pyx_v_self->child_size = __Pyx_pow_int(__pyx_v_self->block_size, __pyx_v_self->level);
10334 
10335   /* "bx/arrays/array_tree.pyx":333
10336  *         # Each of my children represents block_size ** level values
10337  *         self.child_size = self.block_size ** self.level
10338  *         self.children = [None] * self.block_size             # <<<<<<<<<<<<<<
10339  *         self.summary = None
10340  *         self.start_offset = 0
10341  */
10342   __pyx_t_1 = PyList_New(1 * ((__pyx_v_self->block_size<0) ? 0:__pyx_v_self->block_size)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error)
10343   __Pyx_GOTREF(__pyx_t_1);
10344   { Py_ssize_t __pyx_temp;
10345     for (__pyx_temp=0; __pyx_temp < __pyx_v_self->block_size; __pyx_temp++) {
10346       __Pyx_INCREF(Py_None);
10347       __Pyx_GIVEREF(Py_None);
10348       PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None);
10349     }
10350   }
10351   __Pyx_GIVEREF(__pyx_t_1);
10352   __Pyx_GOTREF(__pyx_v_self->children);
10353   __Pyx_DECREF(__pyx_v_self->children);
10354   __pyx_v_self->children = __pyx_t_1;
10355   __pyx_t_1 = 0;
10356 
10357   /* "bx/arrays/array_tree.pyx":334
10358  *         self.child_size = self.block_size ** self.level
10359  *         self.children = [None] * self.block_size
10360  *         self.summary = None             # <<<<<<<<<<<<<<
10361  *         self.start_offset = 0
10362  *
10363  */
10364   __Pyx_INCREF(Py_None);
10365   __Pyx_GIVEREF(Py_None);
10366   __Pyx_GOTREF(__pyx_v_self->summary);
10367   __Pyx_DECREF(((PyObject *)__pyx_v_self->summary));
10368   __pyx_v_self->summary = ((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)Py_None);
10369 
10370   /* "bx/arrays/array_tree.pyx":335
10371  *         self.children = [None] * self.block_size
10372  *         self.summary = None
10373  *         self.start_offset = 0             # <<<<<<<<<<<<<<
10374  *
10375  *     cdef inline init_bin( self, int index ):
10376  */
10377   __pyx_v_self->start_offset = 0;
10378 
10379   /* "bx/arrays/array_tree.pyx":325
10380  *     cdef public long start_offset
10381  *
10382  *     def __init__( self, ArrayTree tree, int min, int max, int block_size, int level ):             # <<<<<<<<<<<<<<
10383  *         self.tree = tree
10384  *         self.min = min
10385  */
10386 
10387   /* function exit code */
10388   __pyx_r = 0;
10389   goto __pyx_L0;
10390   __pyx_L1_error:;
10391   __Pyx_XDECREF(__pyx_t_1);
10392   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10393   __pyx_r = -1;
10394   __pyx_L0:;
10395   __Pyx_RefNannyFinishContext();
10396   return __pyx_r;
10397 }
10398 
10399 /* "bx/arrays/array_tree.pyx":337
10400  *         self.start_offset = 0
10401  *
10402  *     cdef inline init_bin( self, int index ):             # <<<<<<<<<<<<<<
10403  *         cdef int min = self.min + ( index * self.child_size )
10404  *         cdef int max = min + self.child_size
10405  */
10406 
__pyx_f_2bx_6arrays_10array_tree_13ArrayTreeNode_init_bin(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self,int __pyx_v_index)10407 static CYTHON_INLINE PyObject *__pyx_f_2bx_6arrays_10array_tree_13ArrayTreeNode_init_bin(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, int __pyx_v_index) {
10408   int __pyx_v_min;
10409   int __pyx_v_max;
10410   PyObject *__pyx_r = NULL;
10411   __Pyx_RefNannyDeclarations
10412   int __pyx_t_1;
10413   PyObject *__pyx_t_2 = NULL;
10414   PyObject *__pyx_t_3 = NULL;
10415   PyObject *__pyx_t_4 = NULL;
10416   PyObject *__pyx_t_5 = NULL;
10417   PyObject *__pyx_t_6 = NULL;
10418   int __pyx_lineno = 0;
10419   const char *__pyx_filename = NULL;
10420   int __pyx_clineno = 0;
10421   __Pyx_RefNannySetupContext("init_bin", 0);
10422 
10423   /* "bx/arrays/array_tree.pyx":338
10424  *
10425  *     cdef inline init_bin( self, int index ):
10426  *         cdef int min = self.min + ( index * self.child_size )             # <<<<<<<<<<<<<<
10427  *         cdef int max = min + self.child_size
10428  *         if self.level == 1:
10429  */
10430   __pyx_v_min = (__pyx_v_self->min + (__pyx_v_index * __pyx_v_self->child_size));
10431 
10432   /* "bx/arrays/array_tree.pyx":339
10433  *     cdef inline init_bin( self, int index ):
10434  *         cdef int min = self.min + ( index * self.child_size )
10435  *         cdef int max = min + self.child_size             # <<<<<<<<<<<<<<
10436  *         if self.level == 1:
10437  *             self.children[ index ] = ArrayTreeLeaf( self.tree, min, max )
10438  */
10439   __pyx_v_max = (__pyx_v_min + __pyx_v_self->child_size);
10440 
10441   /* "bx/arrays/array_tree.pyx":340
10442  *         cdef int min = self.min + ( index * self.child_size )
10443  *         cdef int max = min + self.child_size
10444  *         if self.level == 1:             # <<<<<<<<<<<<<<
10445  *             self.children[ index ] = ArrayTreeLeaf( self.tree, min, max )
10446  *         else:
10447  */
10448   __pyx_t_1 = ((__pyx_v_self->level == 1) != 0);
10449   if (__pyx_t_1) {
10450 
10451     /* "bx/arrays/array_tree.pyx":341
10452  *         cdef int max = min + self.child_size
10453  *         if self.level == 1:
10454  *             self.children[ index ] = ArrayTreeLeaf( self.tree, min, max )             # <<<<<<<<<<<<<<
10455  *         else:
10456  *             self.children[ index ] = ArrayTreeNode( self.tree, min, max, self.block_size, self.level - 1 )
10457  */
10458     __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_min); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error)
10459     __Pyx_GOTREF(__pyx_t_2);
10460     __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error)
10461     __Pyx_GOTREF(__pyx_t_3);
10462     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error)
10463     __Pyx_GOTREF(__pyx_t_4);
10464     __Pyx_INCREF(((PyObject *)__pyx_v_self->tree));
10465     __Pyx_GIVEREF(((PyObject *)__pyx_v_self->tree));
10466     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->tree));
10467     __Pyx_GIVEREF(__pyx_t_2);
10468     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
10469     __Pyx_GIVEREF(__pyx_t_3);
10470     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
10471     __pyx_t_2 = 0;
10472     __pyx_t_3 = 0;
10473     __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_ArrayTreeLeaf), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error)
10474     __Pyx_GOTREF(__pyx_t_3);
10475     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10476     if (unlikely(__Pyx_SetItemInt(__pyx_v_self->children, __pyx_v_index, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 341, __pyx_L1_error)
10477     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10478 
10479     /* "bx/arrays/array_tree.pyx":340
10480  *         cdef int min = self.min + ( index * self.child_size )
10481  *         cdef int max = min + self.child_size
10482  *         if self.level == 1:             # <<<<<<<<<<<<<<
10483  *             self.children[ index ] = ArrayTreeLeaf( self.tree, min, max )
10484  *         else:
10485  */
10486     goto __pyx_L3;
10487   }
10488 
10489   /* "bx/arrays/array_tree.pyx":343
10490  *             self.children[ index ] = ArrayTreeLeaf( self.tree, min, max )
10491  *         else:
10492  *             self.children[ index ] = ArrayTreeNode( self.tree, min, max, self.block_size, self.level - 1 )             # <<<<<<<<<<<<<<
10493  *
10494  *     def set( self, int index, value ):
10495  */
10496   /*else*/ {
10497     __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
10498     __Pyx_GOTREF(__pyx_t_3);
10499     __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_max); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error)
10500     __Pyx_GOTREF(__pyx_t_4);
10501     __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->block_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
10502     __Pyx_GOTREF(__pyx_t_2);
10503     __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_self->level - 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error)
10504     __Pyx_GOTREF(__pyx_t_5);
10505     __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error)
10506     __Pyx_GOTREF(__pyx_t_6);
10507     __Pyx_INCREF(((PyObject *)__pyx_v_self->tree));
10508     __Pyx_GIVEREF(((PyObject *)__pyx_v_self->tree));
10509     PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_self->tree));
10510     __Pyx_GIVEREF(__pyx_t_3);
10511     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
10512     __Pyx_GIVEREF(__pyx_t_4);
10513     PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
10514     __Pyx_GIVEREF(__pyx_t_2);
10515     PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_2);
10516     __Pyx_GIVEREF(__pyx_t_5);
10517     PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_5);
10518     __pyx_t_3 = 0;
10519     __pyx_t_4 = 0;
10520     __pyx_t_2 = 0;
10521     __pyx_t_5 = 0;
10522     __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_ArrayTreeNode), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error)
10523     __Pyx_GOTREF(__pyx_t_5);
10524     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10525     if (unlikely(__Pyx_SetItemInt(__pyx_v_self->children, __pyx_v_index, __pyx_t_5, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 343, __pyx_L1_error)
10526     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10527   }
10528   __pyx_L3:;
10529 
10530   /* "bx/arrays/array_tree.pyx":337
10531  *         self.start_offset = 0
10532  *
10533  *     cdef inline init_bin( self, int index ):             # <<<<<<<<<<<<<<
10534  *         cdef int min = self.min + ( index * self.child_size )
10535  *         cdef int max = min + self.child_size
10536  */
10537 
10538   /* function exit code */
10539   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10540   goto __pyx_L0;
10541   __pyx_L1_error:;
10542   __Pyx_XDECREF(__pyx_t_2);
10543   __Pyx_XDECREF(__pyx_t_3);
10544   __Pyx_XDECREF(__pyx_t_4);
10545   __Pyx_XDECREF(__pyx_t_5);
10546   __Pyx_XDECREF(__pyx_t_6);
10547   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.init_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
10548   __pyx_r = 0;
10549   __pyx_L0:;
10550   __Pyx_XGIVEREF(__pyx_r);
10551   __Pyx_RefNannyFinishContext();
10552   return __pyx_r;
10553 }
10554 
10555 /* "bx/arrays/array_tree.pyx":345
10556  *             self.children[ index ] = ArrayTreeNode( self.tree, min, max, self.block_size, self.level - 1 )
10557  *
10558  *     def set( self, int index, value ):             # <<<<<<<<<<<<<<
10559  *         cdef int bin_index = ( index - self.min ) // ( self.child_size )
10560  *         if self.children[ bin_index ] is None:
10561  */
10562 
10563 /* Python wrapper */
10564 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_3set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_3set(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)10565 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_3set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10566   int __pyx_v_index;
10567   PyObject *__pyx_v_value = 0;
10568   int __pyx_lineno = 0;
10569   const char *__pyx_filename = NULL;
10570   int __pyx_clineno = 0;
10571   PyObject *__pyx_r = 0;
10572   __Pyx_RefNannyDeclarations
10573   __Pyx_RefNannySetupContext("set (wrapper)", 0);
10574   {
10575     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_value,0};
10576     PyObject* values[2] = {0,0};
10577     if (unlikely(__pyx_kwds)) {
10578       Py_ssize_t kw_args;
10579       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10580       switch (pos_args) {
10581         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10582         CYTHON_FALLTHROUGH;
10583         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10584         CYTHON_FALLTHROUGH;
10585         case  0: break;
10586         default: goto __pyx_L5_argtuple_error;
10587       }
10588       kw_args = PyDict_Size(__pyx_kwds);
10589       switch (pos_args) {
10590         case  0:
10591         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
10592         else goto __pyx_L5_argtuple_error;
10593         CYTHON_FALLTHROUGH;
10594         case  1:
10595         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
10596         else {
10597           __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); __PYX_ERR(0, 345, __pyx_L3_error)
10598         }
10599       }
10600       if (unlikely(kw_args > 0)) {
10601         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(0, 345, __pyx_L3_error)
10602       }
10603     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
10604       goto __pyx_L5_argtuple_error;
10605     } else {
10606       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10607       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10608     }
10609     __pyx_v_index = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error)
10610     __pyx_v_value = values[1];
10611   }
10612   goto __pyx_L4_argument_unpacking_done;
10613   __pyx_L5_argtuple_error:;
10614   __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 345, __pyx_L3_error)
10615   __pyx_L3_error:;
10616   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
10617   __Pyx_RefNannyFinishContext();
10618   return NULL;
10619   __pyx_L4_argument_unpacking_done:;
10620   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_2set(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_v_self), __pyx_v_index, __pyx_v_value);
10621 
10622   /* function exit code */
10623   __Pyx_RefNannyFinishContext();
10624   return __pyx_r;
10625 }
10626 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_2set(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self,int __pyx_v_index,PyObject * __pyx_v_value)10627 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_2set(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, int __pyx_v_index, PyObject *__pyx_v_value) {
10628   int __pyx_v_bin_index;
10629   PyObject *__pyx_r = NULL;
10630   __Pyx_RefNannyDeclarations
10631   int __pyx_t_1;
10632   PyObject *__pyx_t_2 = NULL;
10633   int __pyx_t_3;
10634   int __pyx_t_4;
10635   PyObject *__pyx_t_5 = NULL;
10636   PyObject *__pyx_t_6 = NULL;
10637   PyObject *__pyx_t_7 = NULL;
10638   PyObject *__pyx_t_8 = NULL;
10639   int __pyx_lineno = 0;
10640   const char *__pyx_filename = NULL;
10641   int __pyx_clineno = 0;
10642   __Pyx_RefNannySetupContext("set", 0);
10643 
10644   /* "bx/arrays/array_tree.pyx":346
10645  *
10646  *     def set( self, int index, value ):
10647  *         cdef int bin_index = ( index - self.min ) // ( self.child_size )             # <<<<<<<<<<<<<<
10648  *         if self.children[ bin_index ] is None:
10649  *             self.init_bin( bin_index )
10650  */
10651   __pyx_t_1 = (__pyx_v_index - __pyx_v_self->min);
10652   if (unlikely(__pyx_v_self->child_size == 0)) {
10653     PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
10654     __PYX_ERR(0, 346, __pyx_L1_error)
10655   }
10656   else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_self->child_size == (int)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_1))) {
10657     PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
10658     __PYX_ERR(0, 346, __pyx_L1_error)
10659   }
10660   __pyx_v_bin_index = __Pyx_div_int(__pyx_t_1, __pyx_v_self->child_size);
10661 
10662   /* "bx/arrays/array_tree.pyx":347
10663  *     def set( self, int index, value ):
10664  *         cdef int bin_index = ( index - self.min ) // ( self.child_size )
10665  *         if self.children[ bin_index ] is None:             # <<<<<<<<<<<<<<
10666  *             self.init_bin( bin_index )
10667  *         self.children[ bin_index ].set( index, value )
10668  */
10669   __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->children, __pyx_v_bin_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error)
10670   __Pyx_GOTREF(__pyx_t_2);
10671   __pyx_t_3 = (__pyx_t_2 == Py_None);
10672   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10673   __pyx_t_4 = (__pyx_t_3 != 0);
10674   if (__pyx_t_4) {
10675 
10676     /* "bx/arrays/array_tree.pyx":348
10677  *         cdef int bin_index = ( index - self.min ) // ( self.child_size )
10678  *         if self.children[ bin_index ] is None:
10679  *             self.init_bin( bin_index )             # <<<<<<<<<<<<<<
10680  *         self.children[ bin_index ].set( index, value )
10681  *
10682  */
10683     __pyx_t_2 = __pyx_f_2bx_6arrays_10array_tree_13ArrayTreeNode_init_bin(__pyx_v_self, __pyx_v_bin_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error)
10684     __Pyx_GOTREF(__pyx_t_2);
10685     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10686 
10687     /* "bx/arrays/array_tree.pyx":347
10688  *     def set( self, int index, value ):
10689  *         cdef int bin_index = ( index - self.min ) // ( self.child_size )
10690  *         if self.children[ bin_index ] is None:             # <<<<<<<<<<<<<<
10691  *             self.init_bin( bin_index )
10692  *         self.children[ bin_index ].set( index, value )
10693  */
10694   }
10695 
10696   /* "bx/arrays/array_tree.pyx":349
10697  *         if self.children[ bin_index ] is None:
10698  *             self.init_bin( bin_index )
10699  *         self.children[ bin_index ].set( index, value )             # <<<<<<<<<<<<<<
10700  *
10701  *     def get( self, int index ):
10702  */
10703   __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->children, __pyx_v_bin_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 349, __pyx_L1_error)
10704   __Pyx_GOTREF(__pyx_t_5);
10705   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_set); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error)
10706   __Pyx_GOTREF(__pyx_t_6);
10707   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10708   __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 349, __pyx_L1_error)
10709   __Pyx_GOTREF(__pyx_t_5);
10710   __pyx_t_7 = NULL;
10711   __pyx_t_1 = 0;
10712   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
10713     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
10714     if (likely(__pyx_t_7)) {
10715       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
10716       __Pyx_INCREF(__pyx_t_7);
10717       __Pyx_INCREF(function);
10718       __Pyx_DECREF_SET(__pyx_t_6, function);
10719       __pyx_t_1 = 1;
10720     }
10721   }
10722   #if CYTHON_FAST_PYCALL
10723   if (PyFunction_Check(__pyx_t_6)) {
10724     PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_v_value};
10725     __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error)
10726     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10727     __Pyx_GOTREF(__pyx_t_2);
10728     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10729   } else
10730   #endif
10731   #if CYTHON_FAST_PYCCALL
10732   if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
10733     PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_v_value};
10734     __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error)
10735     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10736     __Pyx_GOTREF(__pyx_t_2);
10737     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10738   } else
10739   #endif
10740   {
10741     __pyx_t_8 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 349, __pyx_L1_error)
10742     __Pyx_GOTREF(__pyx_t_8);
10743     if (__pyx_t_7) {
10744       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
10745     }
10746     __Pyx_GIVEREF(__pyx_t_5);
10747     PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_1, __pyx_t_5);
10748     __Pyx_INCREF(__pyx_v_value);
10749     __Pyx_GIVEREF(__pyx_v_value);
10750     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_1, __pyx_v_value);
10751     __pyx_t_5 = 0;
10752     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error)
10753     __Pyx_GOTREF(__pyx_t_2);
10754     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10755   }
10756   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10757   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10758 
10759   /* "bx/arrays/array_tree.pyx":345
10760  *             self.children[ index ] = ArrayTreeNode( self.tree, min, max, self.block_size, self.level - 1 )
10761  *
10762  *     def set( self, int index, value ):             # <<<<<<<<<<<<<<
10763  *         cdef int bin_index = ( index - self.min ) // ( self.child_size )
10764  *         if self.children[ bin_index ] is None:
10765  */
10766 
10767   /* function exit code */
10768   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10769   goto __pyx_L0;
10770   __pyx_L1_error:;
10771   __Pyx_XDECREF(__pyx_t_2);
10772   __Pyx_XDECREF(__pyx_t_5);
10773   __Pyx_XDECREF(__pyx_t_6);
10774   __Pyx_XDECREF(__pyx_t_7);
10775   __Pyx_XDECREF(__pyx_t_8);
10776   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
10777   __pyx_r = NULL;
10778   __pyx_L0:;
10779   __Pyx_XGIVEREF(__pyx_r);
10780   __Pyx_RefNannyFinishContext();
10781   return __pyx_r;
10782 }
10783 
10784 /* "bx/arrays/array_tree.pyx":351
10785  *         self.children[ bin_index ].set( index, value )
10786  *
10787  *     def get( self, int index ):             # <<<<<<<<<<<<<<
10788  *         cdef int bin_index = ( index - self.min ) // ( self.child_size )
10789  *         if self.children[ bin_index ] is None:
10790  */
10791 
10792 /* Python wrapper */
10793 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_5get(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_5get(PyObject * __pyx_v_self,PyObject * __pyx_arg_index)10794 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_5get(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
10795   int __pyx_v_index;
10796   int __pyx_lineno = 0;
10797   const char *__pyx_filename = NULL;
10798   int __pyx_clineno = 0;
10799   PyObject *__pyx_r = 0;
10800   __Pyx_RefNannyDeclarations
10801   __Pyx_RefNannySetupContext("get (wrapper)", 0);
10802   assert(__pyx_arg_index); {
10803     __pyx_v_index = __Pyx_PyInt_As_int(__pyx_arg_index); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L3_error)
10804   }
10805   goto __pyx_L4_argument_unpacking_done;
10806   __pyx_L3_error:;
10807   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
10808   __Pyx_RefNannyFinishContext();
10809   return NULL;
10810   __pyx_L4_argument_unpacking_done:;
10811   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_4get(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_v_self), ((int)__pyx_v_index));
10812 
10813   /* function exit code */
10814   __Pyx_RefNannyFinishContext();
10815   return __pyx_r;
10816 }
10817 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_4get(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self,int __pyx_v_index)10818 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_4get(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, int __pyx_v_index) {
10819   int __pyx_v_bin_index;
10820   PyObject *__pyx_r = NULL;
10821   __Pyx_RefNannyDeclarations
10822   int __pyx_t_1;
10823   PyObject *__pyx_t_2 = NULL;
10824   int __pyx_t_3;
10825   int __pyx_t_4;
10826   PyObject *__pyx_t_5 = NULL;
10827   PyObject *__pyx_t_6 = NULL;
10828   PyObject *__pyx_t_7 = NULL;
10829   int __pyx_lineno = 0;
10830   const char *__pyx_filename = NULL;
10831   int __pyx_clineno = 0;
10832   __Pyx_RefNannySetupContext("get", 0);
10833 
10834   /* "bx/arrays/array_tree.pyx":352
10835  *
10836  *     def get( self, int index ):
10837  *         cdef int bin_index = ( index - self.min ) // ( self.child_size )             # <<<<<<<<<<<<<<
10838  *         if self.children[ bin_index ] is None:
10839  *             return nan
10840  */
10841   __pyx_t_1 = (__pyx_v_index - __pyx_v_self->min);
10842   if (unlikely(__pyx_v_self->child_size == 0)) {
10843     PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
10844     __PYX_ERR(0, 352, __pyx_L1_error)
10845   }
10846   else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_self->child_size == (int)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_1))) {
10847     PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
10848     __PYX_ERR(0, 352, __pyx_L1_error)
10849   }
10850   __pyx_v_bin_index = __Pyx_div_int(__pyx_t_1, __pyx_v_self->child_size);
10851 
10852   /* "bx/arrays/array_tree.pyx":353
10853  *     def get( self, int index ):
10854  *         cdef int bin_index = ( index - self.min ) // ( self.child_size )
10855  *         if self.children[ bin_index ] is None:             # <<<<<<<<<<<<<<
10856  *             return nan
10857  *         else:
10858  */
10859   __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->children, __pyx_v_bin_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error)
10860   __Pyx_GOTREF(__pyx_t_2);
10861   __pyx_t_3 = (__pyx_t_2 == Py_None);
10862   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10863   __pyx_t_4 = (__pyx_t_3 != 0);
10864   if (__pyx_t_4) {
10865 
10866     /* "bx/arrays/array_tree.pyx":354
10867  *         cdef int bin_index = ( index - self.min ) // ( self.child_size )
10868  *         if self.children[ bin_index ] is None:
10869  *             return nan             # <<<<<<<<<<<<<<
10870  *         else:
10871  *             return self.children[ bin_index ].get( index )
10872  */
10873     __Pyx_XDECREF(__pyx_r);
10874     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
10875     __Pyx_GOTREF(__pyx_t_2);
10876     __pyx_r = __pyx_t_2;
10877     __pyx_t_2 = 0;
10878     goto __pyx_L0;
10879 
10880     /* "bx/arrays/array_tree.pyx":353
10881  *     def get( self, int index ):
10882  *         cdef int bin_index = ( index - self.min ) // ( self.child_size )
10883  *         if self.children[ bin_index ] is None:             # <<<<<<<<<<<<<<
10884  *             return nan
10885  *         else:
10886  */
10887   }
10888 
10889   /* "bx/arrays/array_tree.pyx":356
10890  *             return nan
10891  *         else:
10892  *             return self.children[ bin_index ].get( index )             # <<<<<<<<<<<<<<
10893  *
10894  *     cpdef build_summary( self ):
10895  */
10896   /*else*/ {
10897     __Pyx_XDECREF(__pyx_r);
10898     __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->children, __pyx_v_bin_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L1_error)
10899     __Pyx_GOTREF(__pyx_t_5);
10900     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 356, __pyx_L1_error)
10901     __Pyx_GOTREF(__pyx_t_6);
10902     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10903     __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L1_error)
10904     __Pyx_GOTREF(__pyx_t_5);
10905     __pyx_t_7 = NULL;
10906     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
10907       __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
10908       if (likely(__pyx_t_7)) {
10909         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
10910         __Pyx_INCREF(__pyx_t_7);
10911         __Pyx_INCREF(function);
10912         __Pyx_DECREF_SET(__pyx_t_6, function);
10913       }
10914     }
10915     __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5);
10916     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10917     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10918     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
10919     __Pyx_GOTREF(__pyx_t_2);
10920     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10921     __pyx_r = __pyx_t_2;
10922     __pyx_t_2 = 0;
10923     goto __pyx_L0;
10924   }
10925 
10926   /* "bx/arrays/array_tree.pyx":351
10927  *         self.children[ bin_index ].set( index, value )
10928  *
10929  *     def get( self, int index ):             # <<<<<<<<<<<<<<
10930  *         cdef int bin_index = ( index - self.min ) // ( self.child_size )
10931  *         if self.children[ bin_index ] is None:
10932  */
10933 
10934   /* function exit code */
10935   __pyx_L1_error:;
10936   __Pyx_XDECREF(__pyx_t_2);
10937   __Pyx_XDECREF(__pyx_t_5);
10938   __Pyx_XDECREF(__pyx_t_6);
10939   __Pyx_XDECREF(__pyx_t_7);
10940   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
10941   __pyx_r = NULL;
10942   __pyx_L0:;
10943   __Pyx_XGIVEREF(__pyx_r);
10944   __Pyx_RefNannyFinishContext();
10945   return __pyx_r;
10946 }
10947 
10948 /* "bx/arrays/array_tree.pyx":358
10949  *             return self.children[ bin_index ].get( index )
10950  *
10951  *     cpdef build_summary( self ):             # <<<<<<<<<<<<<<
10952  *         """
10953  *         Build summary of children.
10954  */
10955 
10956 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7build_summary(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_f_2bx_6arrays_10array_tree_13ArrayTreeNode_build_summary(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self,int __pyx_skip_dispatch)10957 static PyObject *__pyx_f_2bx_6arrays_10array_tree_13ArrayTreeNode_build_summary(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, int __pyx_skip_dispatch) {
10958   PyObject *__pyx_v_counts = NULL;
10959   PyObject *__pyx_v_frequencies = NULL;
10960   PyObject *__pyx_v_mins = NULL;
10961   PyObject *__pyx_v_maxs = NULL;
10962   PyObject *__pyx_v_sums = NULL;
10963   PyObject *__pyx_v_sumsquares = NULL;
10964   Py_ssize_t __pyx_v_i;
10965   PyObject *__pyx_v_v = NULL;
10966   PyObject *__pyx_v_c = NULL;
10967   struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_s = NULL;
10968   PyObject *__pyx_r = NULL;
10969   __Pyx_RefNannyDeclarations
10970   PyObject *__pyx_t_1 = NULL;
10971   PyObject *__pyx_t_2 = NULL;
10972   PyObject *__pyx_t_3 = NULL;
10973   PyObject *__pyx_t_4 = NULL;
10974   int __pyx_t_5;
10975   PyObject *__pyx_t_6 = NULL;
10976   Py_ssize_t __pyx_t_7;
10977   Py_ssize_t __pyx_t_8;
10978   Py_ssize_t __pyx_t_9;
10979   int __pyx_t_10;
10980   int __pyx_lineno = 0;
10981   const char *__pyx_filename = NULL;
10982   int __pyx_clineno = 0;
10983   __Pyx_RefNannySetupContext("build_summary", 0);
10984   /* Check if called by wrapper */
10985   if (unlikely(__pyx_skip_dispatch)) ;
10986   /* Check if overridden in Python */
10987   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)))) {
10988     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10989     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
10990     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
10991       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
10992       #endif
10993       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build_summary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error)
10994       __Pyx_GOTREF(__pyx_t_1);
10995       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7build_summary)) {
10996         __Pyx_XDECREF(__pyx_r);
10997         __Pyx_INCREF(__pyx_t_1);
10998         __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
10999         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
11000           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
11001           if (likely(__pyx_t_4)) {
11002             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11003             __Pyx_INCREF(__pyx_t_4);
11004             __Pyx_INCREF(function);
11005             __Pyx_DECREF_SET(__pyx_t_3, function);
11006           }
11007         }
11008         __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
11009         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11010         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error)
11011         __Pyx_GOTREF(__pyx_t_2);
11012         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11013         __pyx_r = __pyx_t_2;
11014         __pyx_t_2 = 0;
11015         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11016         goto __pyx_L0;
11017       }
11018       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
11019       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
11020       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
11021       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
11022         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
11023       }
11024       #endif
11025       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11026       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
11027     }
11028     #endif
11029   }
11030 
11031   /* "bx/arrays/array_tree.pyx":362
11032  *         Build summary of children.
11033  *         """
11034  *         counts = empty( self.tree.block_size, self.tree.dtype )             # <<<<<<<<<<<<<<
11035  *         frequencies = empty( self.tree.block_size, self.tree.dtype )
11036  *         mins = empty( self.tree.block_size, self.tree.dtype )
11037  */
11038   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
11039   __Pyx_GOTREF(__pyx_t_2);
11040   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->tree->block_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error)
11041   __Pyx_GOTREF(__pyx_t_3);
11042   __pyx_t_4 = NULL;
11043   __pyx_t_5 = 0;
11044   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11045     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
11046     if (likely(__pyx_t_4)) {
11047       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11048       __Pyx_INCREF(__pyx_t_4);
11049       __Pyx_INCREF(function);
11050       __Pyx_DECREF_SET(__pyx_t_2, function);
11051       __pyx_t_5 = 1;
11052     }
11053   }
11054   #if CYTHON_FAST_PYCALL
11055   if (PyFunction_Check(__pyx_t_2)) {
11056     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_self->tree->dtype};
11057     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
11058     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11059     __Pyx_GOTREF(__pyx_t_1);
11060     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11061   } else
11062   #endif
11063   #if CYTHON_FAST_PYCCALL
11064   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
11065     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_self->tree->dtype};
11066     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
11067     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11068     __Pyx_GOTREF(__pyx_t_1);
11069     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11070   } else
11071   #endif
11072   {
11073     __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L1_error)
11074     __Pyx_GOTREF(__pyx_t_6);
11075     if (__pyx_t_4) {
11076       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
11077     }
11078     __Pyx_GIVEREF(__pyx_t_3);
11079     PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
11080     __Pyx_INCREF(__pyx_v_self->tree->dtype);
11081     __Pyx_GIVEREF(__pyx_v_self->tree->dtype);
11082     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_self->tree->dtype);
11083     __pyx_t_3 = 0;
11084     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
11085     __Pyx_GOTREF(__pyx_t_1);
11086     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11087   }
11088   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11089   __pyx_v_counts = __pyx_t_1;
11090   __pyx_t_1 = 0;
11091 
11092   /* "bx/arrays/array_tree.pyx":363
11093  *         """
11094  *         counts = empty( self.tree.block_size, self.tree.dtype )
11095  *         frequencies = empty( self.tree.block_size, self.tree.dtype )             # <<<<<<<<<<<<<<
11096  *         mins = empty( self.tree.block_size, self.tree.dtype )
11097  *         maxs = empty( self.tree.block_size, self.tree.dtype )
11098  */
11099   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
11100   __Pyx_GOTREF(__pyx_t_2);
11101   __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->tree->block_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 363, __pyx_L1_error)
11102   __Pyx_GOTREF(__pyx_t_6);
11103   __pyx_t_3 = NULL;
11104   __pyx_t_5 = 0;
11105   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11106     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11107     if (likely(__pyx_t_3)) {
11108       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11109       __Pyx_INCREF(__pyx_t_3);
11110       __Pyx_INCREF(function);
11111       __Pyx_DECREF_SET(__pyx_t_2, function);
11112       __pyx_t_5 = 1;
11113     }
11114   }
11115   #if CYTHON_FAST_PYCALL
11116   if (PyFunction_Check(__pyx_t_2)) {
11117     PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_6, __pyx_v_self->tree->dtype};
11118     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
11119     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11120     __Pyx_GOTREF(__pyx_t_1);
11121     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11122   } else
11123   #endif
11124   #if CYTHON_FAST_PYCCALL
11125   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
11126     PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_6, __pyx_v_self->tree->dtype};
11127     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
11128     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11129     __Pyx_GOTREF(__pyx_t_1);
11130     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11131   } else
11132   #endif
11133   {
11134     __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 363, __pyx_L1_error)
11135     __Pyx_GOTREF(__pyx_t_4);
11136     if (__pyx_t_3) {
11137       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
11138     }
11139     __Pyx_GIVEREF(__pyx_t_6);
11140     PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_t_6);
11141     __Pyx_INCREF(__pyx_v_self->tree->dtype);
11142     __Pyx_GIVEREF(__pyx_v_self->tree->dtype);
11143     PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_self->tree->dtype);
11144     __pyx_t_6 = 0;
11145     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
11146     __Pyx_GOTREF(__pyx_t_1);
11147     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11148   }
11149   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11150   __pyx_v_frequencies = __pyx_t_1;
11151   __pyx_t_1 = 0;
11152 
11153   /* "bx/arrays/array_tree.pyx":364
11154  *         counts = empty( self.tree.block_size, self.tree.dtype )
11155  *         frequencies = empty( self.tree.block_size, self.tree.dtype )
11156  *         mins = empty( self.tree.block_size, self.tree.dtype )             # <<<<<<<<<<<<<<
11157  *         maxs = empty( self.tree.block_size, self.tree.dtype )
11158  *         sums = empty( self.tree.block_size, self.tree.dtype )
11159  */
11160   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error)
11161   __Pyx_GOTREF(__pyx_t_2);
11162   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->tree->block_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error)
11163   __Pyx_GOTREF(__pyx_t_4);
11164   __pyx_t_6 = NULL;
11165   __pyx_t_5 = 0;
11166   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11167     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
11168     if (likely(__pyx_t_6)) {
11169       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11170       __Pyx_INCREF(__pyx_t_6);
11171       __Pyx_INCREF(function);
11172       __Pyx_DECREF_SET(__pyx_t_2, function);
11173       __pyx_t_5 = 1;
11174     }
11175   }
11176   #if CYTHON_FAST_PYCALL
11177   if (PyFunction_Check(__pyx_t_2)) {
11178     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_v_self->tree->dtype};
11179     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error)
11180     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11181     __Pyx_GOTREF(__pyx_t_1);
11182     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11183   } else
11184   #endif
11185   #if CYTHON_FAST_PYCCALL
11186   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
11187     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_v_self->tree->dtype};
11188     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error)
11189     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11190     __Pyx_GOTREF(__pyx_t_1);
11191     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11192   } else
11193   #endif
11194   {
11195     __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error)
11196     __Pyx_GOTREF(__pyx_t_3);
11197     if (__pyx_t_6) {
11198       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
11199     }
11200     __Pyx_GIVEREF(__pyx_t_4);
11201     PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_t_4);
11202     __Pyx_INCREF(__pyx_v_self->tree->dtype);
11203     __Pyx_GIVEREF(__pyx_v_self->tree->dtype);
11204     PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_self->tree->dtype);
11205     __pyx_t_4 = 0;
11206     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error)
11207     __Pyx_GOTREF(__pyx_t_1);
11208     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11209   }
11210   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11211   __pyx_v_mins = __pyx_t_1;
11212   __pyx_t_1 = 0;
11213 
11214   /* "bx/arrays/array_tree.pyx":365
11215  *         frequencies = empty( self.tree.block_size, self.tree.dtype )
11216  *         mins = empty( self.tree.block_size, self.tree.dtype )
11217  *         maxs = empty( self.tree.block_size, self.tree.dtype )             # <<<<<<<<<<<<<<
11218  *         sums = empty( self.tree.block_size, self.tree.dtype )
11219  *         sumsquares = empty( self.tree.block_size, self.tree.dtype )
11220  */
11221   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
11222   __Pyx_GOTREF(__pyx_t_2);
11223   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->tree->block_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
11224   __Pyx_GOTREF(__pyx_t_3);
11225   __pyx_t_4 = NULL;
11226   __pyx_t_5 = 0;
11227   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11228     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
11229     if (likely(__pyx_t_4)) {
11230       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11231       __Pyx_INCREF(__pyx_t_4);
11232       __Pyx_INCREF(function);
11233       __Pyx_DECREF_SET(__pyx_t_2, function);
11234       __pyx_t_5 = 1;
11235     }
11236   }
11237   #if CYTHON_FAST_PYCALL
11238   if (PyFunction_Check(__pyx_t_2)) {
11239     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_self->tree->dtype};
11240     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
11241     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11242     __Pyx_GOTREF(__pyx_t_1);
11243     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11244   } else
11245   #endif
11246   #if CYTHON_FAST_PYCCALL
11247   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
11248     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_self->tree->dtype};
11249     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
11250     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11251     __Pyx_GOTREF(__pyx_t_1);
11252     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11253   } else
11254   #endif
11255   {
11256     __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L1_error)
11257     __Pyx_GOTREF(__pyx_t_6);
11258     if (__pyx_t_4) {
11259       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
11260     }
11261     __Pyx_GIVEREF(__pyx_t_3);
11262     PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
11263     __Pyx_INCREF(__pyx_v_self->tree->dtype);
11264     __Pyx_GIVEREF(__pyx_v_self->tree->dtype);
11265     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_self->tree->dtype);
11266     __pyx_t_3 = 0;
11267     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
11268     __Pyx_GOTREF(__pyx_t_1);
11269     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11270   }
11271   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11272   __pyx_v_maxs = __pyx_t_1;
11273   __pyx_t_1 = 0;
11274 
11275   /* "bx/arrays/array_tree.pyx":366
11276  *         mins = empty( self.tree.block_size, self.tree.dtype )
11277  *         maxs = empty( self.tree.block_size, self.tree.dtype )
11278  *         sums = empty( self.tree.block_size, self.tree.dtype )             # <<<<<<<<<<<<<<
11279  *         sumsquares = empty( self.tree.block_size, self.tree.dtype )
11280  *         for i in range( len( self.children ) ):
11281  */
11282   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error)
11283   __Pyx_GOTREF(__pyx_t_2);
11284   __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->tree->block_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 366, __pyx_L1_error)
11285   __Pyx_GOTREF(__pyx_t_6);
11286   __pyx_t_3 = NULL;
11287   __pyx_t_5 = 0;
11288   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11289     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11290     if (likely(__pyx_t_3)) {
11291       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11292       __Pyx_INCREF(__pyx_t_3);
11293       __Pyx_INCREF(function);
11294       __Pyx_DECREF_SET(__pyx_t_2, function);
11295       __pyx_t_5 = 1;
11296     }
11297   }
11298   #if CYTHON_FAST_PYCALL
11299   if (PyFunction_Check(__pyx_t_2)) {
11300     PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_6, __pyx_v_self->tree->dtype};
11301     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
11302     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11303     __Pyx_GOTREF(__pyx_t_1);
11304     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11305   } else
11306   #endif
11307   #if CYTHON_FAST_PYCCALL
11308   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
11309     PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_6, __pyx_v_self->tree->dtype};
11310     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
11311     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11312     __Pyx_GOTREF(__pyx_t_1);
11313     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11314   } else
11315   #endif
11316   {
11317     __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __pyx_L1_error)
11318     __Pyx_GOTREF(__pyx_t_4);
11319     if (__pyx_t_3) {
11320       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
11321     }
11322     __Pyx_GIVEREF(__pyx_t_6);
11323     PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_t_6);
11324     __Pyx_INCREF(__pyx_v_self->tree->dtype);
11325     __Pyx_GIVEREF(__pyx_v_self->tree->dtype);
11326     PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_self->tree->dtype);
11327     __pyx_t_6 = 0;
11328     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
11329     __Pyx_GOTREF(__pyx_t_1);
11330     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11331   }
11332   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11333   __pyx_v_sums = __pyx_t_1;
11334   __pyx_t_1 = 0;
11335 
11336   /* "bx/arrays/array_tree.pyx":367
11337  *         maxs = empty( self.tree.block_size, self.tree.dtype )
11338  *         sums = empty( self.tree.block_size, self.tree.dtype )
11339  *         sumsquares = empty( self.tree.block_size, self.tree.dtype )             # <<<<<<<<<<<<<<
11340  *         for i in range( len( self.children ) ):
11341  *             if self.children[i]:
11342  */
11343   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error)
11344   __Pyx_GOTREF(__pyx_t_2);
11345   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->tree->block_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 367, __pyx_L1_error)
11346   __Pyx_GOTREF(__pyx_t_4);
11347   __pyx_t_6 = NULL;
11348   __pyx_t_5 = 0;
11349   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11350     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
11351     if (likely(__pyx_t_6)) {
11352       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11353       __Pyx_INCREF(__pyx_t_6);
11354       __Pyx_INCREF(function);
11355       __Pyx_DECREF_SET(__pyx_t_2, function);
11356       __pyx_t_5 = 1;
11357     }
11358   }
11359   #if CYTHON_FAST_PYCALL
11360   if (PyFunction_Check(__pyx_t_2)) {
11361     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_v_self->tree->dtype};
11362     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error)
11363     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11364     __Pyx_GOTREF(__pyx_t_1);
11365     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11366   } else
11367   #endif
11368   #if CYTHON_FAST_PYCCALL
11369   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
11370     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_v_self->tree->dtype};
11371     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error)
11372     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11373     __Pyx_GOTREF(__pyx_t_1);
11374     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11375   } else
11376   #endif
11377   {
11378     __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __pyx_L1_error)
11379     __Pyx_GOTREF(__pyx_t_3);
11380     if (__pyx_t_6) {
11381       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
11382     }
11383     __Pyx_GIVEREF(__pyx_t_4);
11384     PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_t_4);
11385     __Pyx_INCREF(__pyx_v_self->tree->dtype);
11386     __Pyx_GIVEREF(__pyx_v_self->tree->dtype);
11387     PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_self->tree->dtype);
11388     __pyx_t_4 = 0;
11389     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error)
11390     __Pyx_GOTREF(__pyx_t_1);
11391     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11392   }
11393   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11394   __pyx_v_sumsquares = __pyx_t_1;
11395   __pyx_t_1 = 0;
11396 
11397   /* "bx/arrays/array_tree.pyx":368
11398  *         sums = empty( self.tree.block_size, self.tree.dtype )
11399  *         sumsquares = empty( self.tree.block_size, self.tree.dtype )
11400  *         for i in range( len( self.children ) ):             # <<<<<<<<<<<<<<
11401  *             if self.children[i]:
11402  *                 if self.level == 1:
11403  */
11404   __pyx_t_1 = __pyx_v_self->children;
11405   __Pyx_INCREF(__pyx_t_1);
11406   __pyx_t_7 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 368, __pyx_L1_error)
11407   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11408   __pyx_t_8 = __pyx_t_7;
11409   for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
11410     __pyx_v_i = __pyx_t_9;
11411 
11412     /* "bx/arrays/array_tree.pyx":369
11413  *         sumsquares = empty( self.tree.block_size, self.tree.dtype )
11414  *         for i in range( len( self.children ) ):
11415  *             if self.children[i]:             # <<<<<<<<<<<<<<
11416  *                 if self.level == 1:
11417  *                     v = self.children[i].values
11418  */
11419     __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->children, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
11420     __Pyx_GOTREF(__pyx_t_1);
11421     __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 369, __pyx_L1_error)
11422     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11423     if (__pyx_t_10) {
11424 
11425       /* "bx/arrays/array_tree.pyx":370
11426  *         for i in range( len( self.children ) ):
11427  *             if self.children[i]:
11428  *                 if self.level == 1:             # <<<<<<<<<<<<<<
11429  *                     v = self.children[i].values
11430  *                     counts[i] = sum( ~isnan( v ) )
11431  */
11432       __pyx_t_10 = ((__pyx_v_self->level == 1) != 0);
11433       if (__pyx_t_10) {
11434 
11435         /* "bx/arrays/array_tree.pyx":371
11436  *             if self.children[i]:
11437  *                 if self.level == 1:
11438  *                     v = self.children[i].values             # <<<<<<<<<<<<<<
11439  *                     counts[i] = sum( ~isnan( v ) )
11440  *                     frequencies[i] = self.children[i].frequency
11441  */
11442         __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->children, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
11443         __Pyx_GOTREF(__pyx_t_1);
11444         __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error)
11445         __Pyx_GOTREF(__pyx_t_2);
11446         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11447         __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_2);
11448         __pyx_t_2 = 0;
11449 
11450         /* "bx/arrays/array_tree.pyx":372
11451  *                 if self.level == 1:
11452  *                     v = self.children[i].values
11453  *                     counts[i] = sum( ~isnan( v ) )             # <<<<<<<<<<<<<<
11454  *                     frequencies[i] = self.children[i].frequency
11455  *                     mins[i] = nanmin( v )
11456  */
11457         __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_isnan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
11458         __Pyx_GOTREF(__pyx_t_1);
11459         __pyx_t_3 = NULL;
11460         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11461           __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
11462           if (likely(__pyx_t_3)) {
11463             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
11464             __Pyx_INCREF(__pyx_t_3);
11465             __Pyx_INCREF(function);
11466             __Pyx_DECREF_SET(__pyx_t_1, function);
11467           }
11468         }
11469         __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_v);
11470         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11471         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error)
11472         __Pyx_GOTREF(__pyx_t_2);
11473         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11474         __pyx_t_1 = PyNumber_Invert(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
11475         __Pyx_GOTREF(__pyx_t_1);
11476         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11477         __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error)
11478         __Pyx_GOTREF(__pyx_t_2);
11479         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11480         if (unlikely(__Pyx_SetItemInt(__pyx_v_counts, __pyx_v_i, __pyx_t_2, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 372, __pyx_L1_error)
11481         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11482 
11483         /* "bx/arrays/array_tree.pyx":373
11484  *                     v = self.children[i].values
11485  *                     counts[i] = sum( ~isnan( v ) )
11486  *                     frequencies[i] = self.children[i].frequency             # <<<<<<<<<<<<<<
11487  *                     mins[i] = nanmin( v )
11488  *                     maxs[i] = nanmax( v )
11489  */
11490         __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->children, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error)
11491         __Pyx_GOTREF(__pyx_t_2);
11492         __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_frequency); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
11493         __Pyx_GOTREF(__pyx_t_1);
11494         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11495         if (unlikely(__Pyx_SetItemInt(__pyx_v_frequencies, __pyx_v_i, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 373, __pyx_L1_error)
11496         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11497 
11498         /* "bx/arrays/array_tree.pyx":374
11499  *                     counts[i] = sum( ~isnan( v ) )
11500  *                     frequencies[i] = self.children[i].frequency
11501  *                     mins[i] = nanmin( v )             # <<<<<<<<<<<<<<
11502  *                     maxs[i] = nanmax( v )
11503  *                     sums[i] = nansum( v )
11504  */
11505         __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nanmin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error)
11506         __Pyx_GOTREF(__pyx_t_2);
11507         __pyx_t_3 = NULL;
11508         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11509           __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11510           if (likely(__pyx_t_3)) {
11511             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11512             __Pyx_INCREF(__pyx_t_3);
11513             __Pyx_INCREF(function);
11514             __Pyx_DECREF_SET(__pyx_t_2, function);
11515           }
11516         }
11517         __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_v);
11518         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11519         if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
11520         __Pyx_GOTREF(__pyx_t_1);
11521         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11522         if (unlikely(__Pyx_SetItemInt(__pyx_v_mins, __pyx_v_i, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 374, __pyx_L1_error)
11523         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11524 
11525         /* "bx/arrays/array_tree.pyx":375
11526  *                     frequencies[i] = self.children[i].frequency
11527  *                     mins[i] = nanmin( v )
11528  *                     maxs[i] = nanmax( v )             # <<<<<<<<<<<<<<
11529  *                     sums[i] = nansum( v )
11530  *                     sumsquares[i] = nansum( v ** 2 )
11531  */
11532         __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nanmax); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error)
11533         __Pyx_GOTREF(__pyx_t_2);
11534         __pyx_t_3 = NULL;
11535         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11536           __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11537           if (likely(__pyx_t_3)) {
11538             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11539             __Pyx_INCREF(__pyx_t_3);
11540             __Pyx_INCREF(function);
11541             __Pyx_DECREF_SET(__pyx_t_2, function);
11542           }
11543         }
11544         __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_v);
11545         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11546         if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error)
11547         __Pyx_GOTREF(__pyx_t_1);
11548         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11549         if (unlikely(__Pyx_SetItemInt(__pyx_v_maxs, __pyx_v_i, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 375, __pyx_L1_error)
11550         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11551 
11552         /* "bx/arrays/array_tree.pyx":376
11553  *                     mins[i] = nanmin( v )
11554  *                     maxs[i] = nanmax( v )
11555  *                     sums[i] = nansum( v )             # <<<<<<<<<<<<<<
11556  *                     sumsquares[i] = nansum( v ** 2 )
11557  *                 else:
11558  */
11559         __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nansum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error)
11560         __Pyx_GOTREF(__pyx_t_2);
11561         __pyx_t_3 = NULL;
11562         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11563           __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11564           if (likely(__pyx_t_3)) {
11565             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11566             __Pyx_INCREF(__pyx_t_3);
11567             __Pyx_INCREF(function);
11568             __Pyx_DECREF_SET(__pyx_t_2, function);
11569           }
11570         }
11571         __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_v);
11572         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11573         if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
11574         __Pyx_GOTREF(__pyx_t_1);
11575         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11576         if (unlikely(__Pyx_SetItemInt(__pyx_v_sums, __pyx_v_i, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 376, __pyx_L1_error)
11577         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11578 
11579         /* "bx/arrays/array_tree.pyx":377
11580  *                     maxs[i] = nanmax( v )
11581  *                     sums[i] = nansum( v )
11582  *                     sumsquares[i] = nansum( v ** 2 )             # <<<<<<<<<<<<<<
11583  *                 else:
11584  *                     c = self.children[i]
11585  */
11586         __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nansum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error)
11587         __Pyx_GOTREF(__pyx_t_2);
11588         __pyx_t_3 = PyNumber_Power(__pyx_v_v, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error)
11589         __Pyx_GOTREF(__pyx_t_3);
11590         __pyx_t_4 = NULL;
11591         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11592           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
11593           if (likely(__pyx_t_4)) {
11594             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11595             __Pyx_INCREF(__pyx_t_4);
11596             __Pyx_INCREF(function);
11597             __Pyx_DECREF_SET(__pyx_t_2, function);
11598           }
11599         }
11600         __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);
11601         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11602         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11603         if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
11604         __Pyx_GOTREF(__pyx_t_1);
11605         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11606         if (unlikely(__Pyx_SetItemInt(__pyx_v_sumsquares, __pyx_v_i, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 377, __pyx_L1_error)
11607         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11608 
11609         /* "bx/arrays/array_tree.pyx":370
11610  *         for i in range( len( self.children ) ):
11611  *             if self.children[i]:
11612  *                 if self.level == 1:             # <<<<<<<<<<<<<<
11613  *                     v = self.children[i].values
11614  *                     counts[i] = sum( ~isnan( v ) )
11615  */
11616         goto __pyx_L6;
11617       }
11618 
11619       /* "bx/arrays/array_tree.pyx":379
11620  *                     sumsquares[i] = nansum( v ** 2 )
11621  *                 else:
11622  *                     c = self.children[i]             # <<<<<<<<<<<<<<
11623  *                     c.build_summary()
11624  *                     counts[i] = sum( c.summary.counts )
11625  */
11626       /*else*/ {
11627         __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->children, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
11628         __Pyx_GOTREF(__pyx_t_1);
11629         __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_1);
11630         __pyx_t_1 = 0;
11631 
11632         /* "bx/arrays/array_tree.pyx":380
11633  *                 else:
11634  *                     c = self.children[i]
11635  *                     c.build_summary()             # <<<<<<<<<<<<<<
11636  *                     counts[i] = sum( c.summary.counts )
11637  *                     frequencies[i] = sum( c.summary.frequencies )
11638  */
11639         __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_build_summary); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
11640         __Pyx_GOTREF(__pyx_t_2);
11641         __pyx_t_3 = NULL;
11642         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11643           __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11644           if (likely(__pyx_t_3)) {
11645             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11646             __Pyx_INCREF(__pyx_t_3);
11647             __Pyx_INCREF(function);
11648             __Pyx_DECREF_SET(__pyx_t_2, function);
11649           }
11650         }
11651         __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
11652         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11653         if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
11654         __Pyx_GOTREF(__pyx_t_1);
11655         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11656         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11657 
11658         /* "bx/arrays/array_tree.pyx":381
11659  *                     c = self.children[i]
11660  *                     c.build_summary()
11661  *                     counts[i] = sum( c.summary.counts )             # <<<<<<<<<<<<<<
11662  *                     frequencies[i] = sum( c.summary.frequencies )
11663  *                     mins[i] = nanmin( c.summary.mins )
11664  */
11665         __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_summary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
11666         __Pyx_GOTREF(__pyx_t_1);
11667         __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_counts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error)
11668         __Pyx_GOTREF(__pyx_t_2);
11669         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11670         __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
11671         __Pyx_GOTREF(__pyx_t_1);
11672         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11673         if (unlikely(__Pyx_SetItemInt(__pyx_v_counts, __pyx_v_i, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 381, __pyx_L1_error)
11674         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11675 
11676         /* "bx/arrays/array_tree.pyx":382
11677  *                     c.build_summary()
11678  *                     counts[i] = sum( c.summary.counts )
11679  *                     frequencies[i] = sum( c.summary.frequencies )             # <<<<<<<<<<<<<<
11680  *                     mins[i] = nanmin( c.summary.mins )
11681  *                     maxs[i] = nanmax( c.summary.maxs )
11682  */
11683         __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_summary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
11684         __Pyx_GOTREF(__pyx_t_1);
11685         __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_frequencies); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
11686         __Pyx_GOTREF(__pyx_t_2);
11687         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11688         __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
11689         __Pyx_GOTREF(__pyx_t_1);
11690         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11691         if (unlikely(__Pyx_SetItemInt(__pyx_v_frequencies, __pyx_v_i, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 382, __pyx_L1_error)
11692         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11693 
11694         /* "bx/arrays/array_tree.pyx":383
11695  *                     counts[i] = sum( c.summary.counts )
11696  *                     frequencies[i] = sum( c.summary.frequencies )
11697  *                     mins[i] = nanmin( c.summary.mins )             # <<<<<<<<<<<<<<
11698  *                     maxs[i] = nanmax( c.summary.maxs )
11699  *                     sums[i] = nansum( c.summary.sums )
11700  */
11701         __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nanmin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error)
11702         __Pyx_GOTREF(__pyx_t_2);
11703         __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_summary); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __pyx_L1_error)
11704         __Pyx_GOTREF(__pyx_t_3);
11705         __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_mins); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error)
11706         __Pyx_GOTREF(__pyx_t_4);
11707         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11708         __pyx_t_3 = NULL;
11709         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11710           __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11711           if (likely(__pyx_t_3)) {
11712             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11713             __Pyx_INCREF(__pyx_t_3);
11714             __Pyx_INCREF(function);
11715             __Pyx_DECREF_SET(__pyx_t_2, function);
11716           }
11717         }
11718         __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
11719         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11720         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11721         if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
11722         __Pyx_GOTREF(__pyx_t_1);
11723         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11724         if (unlikely(__Pyx_SetItemInt(__pyx_v_mins, __pyx_v_i, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 383, __pyx_L1_error)
11725         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11726 
11727         /* "bx/arrays/array_tree.pyx":384
11728  *                     frequencies[i] = sum( c.summary.frequencies )
11729  *                     mins[i] = nanmin( c.summary.mins )
11730  *                     maxs[i] = nanmax( c.summary.maxs )             # <<<<<<<<<<<<<<
11731  *                     sums[i] = nansum( c.summary.sums )
11732  *                     sumsquares[i] = nansum( c.summary.sumsquares )
11733  */
11734         __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nanmax); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
11735         __Pyx_GOTREF(__pyx_t_2);
11736         __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_summary); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error)
11737         __Pyx_GOTREF(__pyx_t_4);
11738         __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_maxs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error)
11739         __Pyx_GOTREF(__pyx_t_3);
11740         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11741         __pyx_t_4 = NULL;
11742         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11743           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
11744           if (likely(__pyx_t_4)) {
11745             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11746             __Pyx_INCREF(__pyx_t_4);
11747             __Pyx_INCREF(function);
11748             __Pyx_DECREF_SET(__pyx_t_2, function);
11749           }
11750         }
11751         __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);
11752         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11753         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11754         if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error)
11755         __Pyx_GOTREF(__pyx_t_1);
11756         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11757         if (unlikely(__Pyx_SetItemInt(__pyx_v_maxs, __pyx_v_i, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 384, __pyx_L1_error)
11758         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11759 
11760         /* "bx/arrays/array_tree.pyx":385
11761  *                     mins[i] = nanmin( c.summary.mins )
11762  *                     maxs[i] = nanmax( c.summary.maxs )
11763  *                     sums[i] = nansum( c.summary.sums )             # <<<<<<<<<<<<<<
11764  *                     sumsquares[i] = nansum( c.summary.sumsquares )
11765  *             else:
11766  */
11767         __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nansum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error)
11768         __Pyx_GOTREF(__pyx_t_2);
11769         __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_summary); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error)
11770         __Pyx_GOTREF(__pyx_t_3);
11771         __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sums); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L1_error)
11772         __Pyx_GOTREF(__pyx_t_4);
11773         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11774         __pyx_t_3 = NULL;
11775         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11776           __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11777           if (likely(__pyx_t_3)) {
11778             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11779             __Pyx_INCREF(__pyx_t_3);
11780             __Pyx_INCREF(function);
11781             __Pyx_DECREF_SET(__pyx_t_2, function);
11782           }
11783         }
11784         __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
11785         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11786         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11787         if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
11788         __Pyx_GOTREF(__pyx_t_1);
11789         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11790         if (unlikely(__Pyx_SetItemInt(__pyx_v_sums, __pyx_v_i, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 385, __pyx_L1_error)
11791         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11792 
11793         /* "bx/arrays/array_tree.pyx":386
11794  *                     maxs[i] = nanmax( c.summary.maxs )
11795  *                     sums[i] = nansum( c.summary.sums )
11796  *                     sumsquares[i] = nansum( c.summary.sumsquares )             # <<<<<<<<<<<<<<
11797  *             else:
11798  *                 counts[i] = 0
11799  */
11800         __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nansum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
11801         __Pyx_GOTREF(__pyx_t_2);
11802         __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_c, __pyx_n_s_summary); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error)
11803         __Pyx_GOTREF(__pyx_t_4);
11804         __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sumsquares); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error)
11805         __Pyx_GOTREF(__pyx_t_3);
11806         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11807         __pyx_t_4 = NULL;
11808         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11809           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
11810           if (likely(__pyx_t_4)) {
11811             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11812             __Pyx_INCREF(__pyx_t_4);
11813             __Pyx_INCREF(function);
11814             __Pyx_DECREF_SET(__pyx_t_2, function);
11815           }
11816         }
11817         __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);
11818         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11819         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11820         if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
11821         __Pyx_GOTREF(__pyx_t_1);
11822         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11823         if (unlikely(__Pyx_SetItemInt(__pyx_v_sumsquares, __pyx_v_i, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 386, __pyx_L1_error)
11824         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11825       }
11826       __pyx_L6:;
11827 
11828       /* "bx/arrays/array_tree.pyx":369
11829  *         sumsquares = empty( self.tree.block_size, self.tree.dtype )
11830  *         for i in range( len( self.children ) ):
11831  *             if self.children[i]:             # <<<<<<<<<<<<<<
11832  *                 if self.level == 1:
11833  *                     v = self.children[i].values
11834  */
11835       goto __pyx_L5;
11836     }
11837 
11838     /* "bx/arrays/array_tree.pyx":388
11839  *                     sumsquares[i] = nansum( c.summary.sumsquares )
11840  *             else:
11841  *                 counts[i] = 0             # <<<<<<<<<<<<<<
11842  *                 frequencies[i] = 0
11843  *                 mins[i] = nan
11844  */
11845     /*else*/ {
11846       if (unlikely(__Pyx_SetItemInt(__pyx_v_counts, __pyx_v_i, __pyx_int_0, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 388, __pyx_L1_error)
11847 
11848       /* "bx/arrays/array_tree.pyx":389
11849  *             else:
11850  *                 counts[i] = 0
11851  *                 frequencies[i] = 0             # <<<<<<<<<<<<<<
11852  *                 mins[i] = nan
11853  *                 maxs[i] = nan
11854  */
11855       if (unlikely(__Pyx_SetItemInt(__pyx_v_frequencies, __pyx_v_i, __pyx_int_0, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 389, __pyx_L1_error)
11856 
11857       /* "bx/arrays/array_tree.pyx":390
11858  *                 counts[i] = 0
11859  *                 frequencies[i] = 0
11860  *                 mins[i] = nan             # <<<<<<<<<<<<<<
11861  *                 maxs[i] = nan
11862  *                 sums[i] = nan
11863  */
11864       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error)
11865       __Pyx_GOTREF(__pyx_t_1);
11866       if (unlikely(__Pyx_SetItemInt(__pyx_v_mins, __pyx_v_i, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 390, __pyx_L1_error)
11867       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11868 
11869       /* "bx/arrays/array_tree.pyx":391
11870  *                 frequencies[i] = 0
11871  *                 mins[i] = nan
11872  *                 maxs[i] = nan             # <<<<<<<<<<<<<<
11873  *                 sums[i] = nan
11874  *                 sumsquares[i] = nan
11875  */
11876       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
11877       __Pyx_GOTREF(__pyx_t_1);
11878       if (unlikely(__Pyx_SetItemInt(__pyx_v_maxs, __pyx_v_i, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 391, __pyx_L1_error)
11879       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11880 
11881       /* "bx/arrays/array_tree.pyx":392
11882  *                 mins[i] = nan
11883  *                 maxs[i] = nan
11884  *                 sums[i] = nan             # <<<<<<<<<<<<<<
11885  *                 sumsquares[i] = nan
11886  *         s = Summary()
11887  */
11888       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error)
11889       __Pyx_GOTREF(__pyx_t_1);
11890       if (unlikely(__Pyx_SetItemInt(__pyx_v_sums, __pyx_v_i, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 392, __pyx_L1_error)
11891       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11892 
11893       /* "bx/arrays/array_tree.pyx":393
11894  *                 maxs[i] = nan
11895  *                 sums[i] = nan
11896  *                 sumsquares[i] = nan             # <<<<<<<<<<<<<<
11897  *         s = Summary()
11898  *         s.counts = counts
11899  */
11900       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error)
11901       __Pyx_GOTREF(__pyx_t_1);
11902       if (unlikely(__Pyx_SetItemInt(__pyx_v_sumsquares, __pyx_v_i, __pyx_t_1, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(0, 393, __pyx_L1_error)
11903       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11904     }
11905     __pyx_L5:;
11906   }
11907 
11908   /* "bx/arrays/array_tree.pyx":394
11909  *                 sums[i] = nan
11910  *                 sumsquares[i] = nan
11911  *         s = Summary()             # <<<<<<<<<<<<<<
11912  *         s.counts = counts
11913  *         s.frequencies = frequencies
11914  */
11915   __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_Summary)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error)
11916   __Pyx_GOTREF(__pyx_t_1);
11917   __pyx_v_s = ((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_t_1);
11918   __pyx_t_1 = 0;
11919 
11920   /* "bx/arrays/array_tree.pyx":395
11921  *                 sumsquares[i] = nan
11922  *         s = Summary()
11923  *         s.counts = counts             # <<<<<<<<<<<<<<
11924  *         s.frequencies = frequencies
11925  *         s.mins = mins
11926  */
11927   __Pyx_INCREF(__pyx_v_counts);
11928   __Pyx_GIVEREF(__pyx_v_counts);
11929   __Pyx_GOTREF(__pyx_v_s->counts);
11930   __Pyx_DECREF(__pyx_v_s->counts);
11931   __pyx_v_s->counts = __pyx_v_counts;
11932 
11933   /* "bx/arrays/array_tree.pyx":396
11934  *         s = Summary()
11935  *         s.counts = counts
11936  *         s.frequencies = frequencies             # <<<<<<<<<<<<<<
11937  *         s.mins = mins
11938  *         s.maxs = maxs
11939  */
11940   __Pyx_INCREF(__pyx_v_frequencies);
11941   __Pyx_GIVEREF(__pyx_v_frequencies);
11942   __Pyx_GOTREF(__pyx_v_s->frequencies);
11943   __Pyx_DECREF(__pyx_v_s->frequencies);
11944   __pyx_v_s->frequencies = __pyx_v_frequencies;
11945 
11946   /* "bx/arrays/array_tree.pyx":397
11947  *         s.counts = counts
11948  *         s.frequencies = frequencies
11949  *         s.mins = mins             # <<<<<<<<<<<<<<
11950  *         s.maxs = maxs
11951  *         s.sums = sums
11952  */
11953   __Pyx_INCREF(__pyx_v_mins);
11954   __Pyx_GIVEREF(__pyx_v_mins);
11955   __Pyx_GOTREF(__pyx_v_s->mins);
11956   __Pyx_DECREF(__pyx_v_s->mins);
11957   __pyx_v_s->mins = __pyx_v_mins;
11958 
11959   /* "bx/arrays/array_tree.pyx":398
11960  *         s.frequencies = frequencies
11961  *         s.mins = mins
11962  *         s.maxs = maxs             # <<<<<<<<<<<<<<
11963  *         s.sums = sums
11964  *         s.sumsquares = sumsquares
11965  */
11966   __Pyx_INCREF(__pyx_v_maxs);
11967   __Pyx_GIVEREF(__pyx_v_maxs);
11968   __Pyx_GOTREF(__pyx_v_s->maxs);
11969   __Pyx_DECREF(__pyx_v_s->maxs);
11970   __pyx_v_s->maxs = __pyx_v_maxs;
11971 
11972   /* "bx/arrays/array_tree.pyx":399
11973  *         s.mins = mins
11974  *         s.maxs = maxs
11975  *         s.sums = sums             # <<<<<<<<<<<<<<
11976  *         s.sumsquares = sumsquares
11977  *         self.summary = s
11978  */
11979   __Pyx_INCREF(__pyx_v_sums);
11980   __Pyx_GIVEREF(__pyx_v_sums);
11981   __Pyx_GOTREF(__pyx_v_s->sums);
11982   __Pyx_DECREF(__pyx_v_s->sums);
11983   __pyx_v_s->sums = __pyx_v_sums;
11984 
11985   /* "bx/arrays/array_tree.pyx":400
11986  *         s.maxs = maxs
11987  *         s.sums = sums
11988  *         s.sumsquares = sumsquares             # <<<<<<<<<<<<<<
11989  *         self.summary = s
11990  *
11991  */
11992   __Pyx_INCREF(__pyx_v_sumsquares);
11993   __Pyx_GIVEREF(__pyx_v_sumsquares);
11994   __Pyx_GOTREF(__pyx_v_s->sumsquares);
11995   __Pyx_DECREF(__pyx_v_s->sumsquares);
11996   __pyx_v_s->sumsquares = __pyx_v_sumsquares;
11997 
11998   /* "bx/arrays/array_tree.pyx":401
11999  *         s.sums = sums
12000  *         s.sumsquares = sumsquares
12001  *         self.summary = s             # <<<<<<<<<<<<<<
12002  *
12003  *     def to_file_data_pass( self, io, level ):
12004  */
12005   __Pyx_INCREF(((PyObject *)__pyx_v_s));
12006   __Pyx_GIVEREF(((PyObject *)__pyx_v_s));
12007   __Pyx_GOTREF(__pyx_v_self->summary);
12008   __Pyx_DECREF(((PyObject *)__pyx_v_self->summary));
12009   __pyx_v_self->summary = __pyx_v_s;
12010 
12011   /* "bx/arrays/array_tree.pyx":358
12012  *             return self.children[ bin_index ].get( index )
12013  *
12014  *     cpdef build_summary( self ):             # <<<<<<<<<<<<<<
12015  *         """
12016  *         Build summary of children.
12017  */
12018 
12019   /* function exit code */
12020   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12021   goto __pyx_L0;
12022   __pyx_L1_error:;
12023   __Pyx_XDECREF(__pyx_t_1);
12024   __Pyx_XDECREF(__pyx_t_2);
12025   __Pyx_XDECREF(__pyx_t_3);
12026   __Pyx_XDECREF(__pyx_t_4);
12027   __Pyx_XDECREF(__pyx_t_6);
12028   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.build_summary", __pyx_clineno, __pyx_lineno, __pyx_filename);
12029   __pyx_r = 0;
12030   __pyx_L0:;
12031   __Pyx_XDECREF(__pyx_v_counts);
12032   __Pyx_XDECREF(__pyx_v_frequencies);
12033   __Pyx_XDECREF(__pyx_v_mins);
12034   __Pyx_XDECREF(__pyx_v_maxs);
12035   __Pyx_XDECREF(__pyx_v_sums);
12036   __Pyx_XDECREF(__pyx_v_sumsquares);
12037   __Pyx_XDECREF(__pyx_v_v);
12038   __Pyx_XDECREF(__pyx_v_c);
12039   __Pyx_XDECREF((PyObject *)__pyx_v_s);
12040   __Pyx_XGIVEREF(__pyx_r);
12041   __Pyx_RefNannyFinishContext();
12042   return __pyx_r;
12043 }
12044 
12045 /* Python wrapper */
12046 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7build_summary(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12047 static char __pyx_doc_2bx_6arrays_10array_tree_13ArrayTreeNode_6build_summary[] = "\n        Build summary of children. \n        ";
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7build_summary(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)12048 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7build_summary(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12049   PyObject *__pyx_r = 0;
12050   __Pyx_RefNannyDeclarations
12051   __Pyx_RefNannySetupContext("build_summary (wrapper)", 0);
12052   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_6build_summary(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_v_self));
12053 
12054   /* function exit code */
12055   __Pyx_RefNannyFinishContext();
12056   return __pyx_r;
12057 }
12058 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_6build_summary(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self)12059 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_6build_summary(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self) {
12060   PyObject *__pyx_r = NULL;
12061   __Pyx_RefNannyDeclarations
12062   PyObject *__pyx_t_1 = NULL;
12063   int __pyx_lineno = 0;
12064   const char *__pyx_filename = NULL;
12065   int __pyx_clineno = 0;
12066   __Pyx_RefNannySetupContext("build_summary", 0);
12067   __Pyx_XDECREF(__pyx_r);
12068   __pyx_t_1 = __pyx_f_2bx_6arrays_10array_tree_13ArrayTreeNode_build_summary(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error)
12069   __Pyx_GOTREF(__pyx_t_1);
12070   __pyx_r = __pyx_t_1;
12071   __pyx_t_1 = 0;
12072   goto __pyx_L0;
12073 
12074   /* function exit code */
12075   __pyx_L1_error:;
12076   __Pyx_XDECREF(__pyx_t_1);
12077   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.build_summary", __pyx_clineno, __pyx_lineno, __pyx_filename);
12078   __pyx_r = NULL;
12079   __pyx_L0:;
12080   __Pyx_XGIVEREF(__pyx_r);
12081   __Pyx_RefNannyFinishContext();
12082   return __pyx_r;
12083 }
12084 
12085 /* "bx/arrays/array_tree.pyx":403
12086  *         self.summary = s
12087  *
12088  *     def to_file_data_pass( self, io, level ):             # <<<<<<<<<<<<<<
12089  *         """
12090  *         First pass of writing to file, writes data and saves position of block.
12091  */
12092 
12093 /* Python wrapper */
12094 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_9to_file_data_pass(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12095 static char __pyx_doc_2bx_6arrays_10array_tree_13ArrayTreeNode_8to_file_data_pass[] = "\n        First pass of writing to file, writes data and saves position of block.\n        ";
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_9to_file_data_pass(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)12096 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_9to_file_data_pass(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12097   PyObject *__pyx_v_io = 0;
12098   PyObject *__pyx_v_level = 0;
12099   int __pyx_lineno = 0;
12100   const char *__pyx_filename = NULL;
12101   int __pyx_clineno = 0;
12102   PyObject *__pyx_r = 0;
12103   __Pyx_RefNannyDeclarations
12104   __Pyx_RefNannySetupContext("to_file_data_pass (wrapper)", 0);
12105   {
12106     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_io,&__pyx_n_s_level,0};
12107     PyObject* values[2] = {0,0};
12108     if (unlikely(__pyx_kwds)) {
12109       Py_ssize_t kw_args;
12110       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12111       switch (pos_args) {
12112         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12113         CYTHON_FALLTHROUGH;
12114         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12115         CYTHON_FALLTHROUGH;
12116         case  0: break;
12117         default: goto __pyx_L5_argtuple_error;
12118       }
12119       kw_args = PyDict_Size(__pyx_kwds);
12120       switch (pos_args) {
12121         case  0:
12122         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_io)) != 0)) kw_args--;
12123         else goto __pyx_L5_argtuple_error;
12124         CYTHON_FALLTHROUGH;
12125         case  1:
12126         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
12127         else {
12128           __Pyx_RaiseArgtupleInvalid("to_file_data_pass", 1, 2, 2, 1); __PYX_ERR(0, 403, __pyx_L3_error)
12129         }
12130       }
12131       if (unlikely(kw_args > 0)) {
12132         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_file_data_pass") < 0)) __PYX_ERR(0, 403, __pyx_L3_error)
12133       }
12134     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
12135       goto __pyx_L5_argtuple_error;
12136     } else {
12137       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12138       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12139     }
12140     __pyx_v_io = values[0];
12141     __pyx_v_level = values[1];
12142   }
12143   goto __pyx_L4_argument_unpacking_done;
12144   __pyx_L5_argtuple_error:;
12145   __Pyx_RaiseArgtupleInvalid("to_file_data_pass", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 403, __pyx_L3_error)
12146   __pyx_L3_error:;
12147   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.to_file_data_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
12148   __Pyx_RefNannyFinishContext();
12149   return NULL;
12150   __pyx_L4_argument_unpacking_done:;
12151   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_8to_file_data_pass(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_v_self), __pyx_v_io, __pyx_v_level);
12152 
12153   /* function exit code */
12154   __Pyx_RefNannyFinishContext();
12155   return __pyx_r;
12156 }
12157 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_8to_file_data_pass(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self,PyObject * __pyx_v_io,PyObject * __pyx_v_level)12158 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_8to_file_data_pass(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, PyObject *__pyx_v_io, PyObject *__pyx_v_level) {
12159   Py_ssize_t __pyx_v_i;
12160   PyObject *__pyx_r = NULL;
12161   __Pyx_RefNannyDeclarations
12162   int __pyx_t_1;
12163   PyObject *__pyx_t_2 = NULL;
12164   PyObject *__pyx_t_3 = NULL;
12165   PyObject *__pyx_t_4 = NULL;
12166   long __pyx_t_5;
12167   PyObject *__pyx_t_6 = NULL;
12168   Py_ssize_t __pyx_t_7;
12169   Py_ssize_t __pyx_t_8;
12170   Py_ssize_t __pyx_t_9;
12171   int __pyx_t_10;
12172   int __pyx_t_11;
12173   int __pyx_lineno = 0;
12174   const char *__pyx_filename = NULL;
12175   int __pyx_clineno = 0;
12176   __Pyx_RefNannySetupContext("to_file_data_pass", 0);
12177 
12178   /* "bx/arrays/array_tree.pyx":407
12179  *         First pass of writing to file, writes data and saves position of block.
12180  *         """
12181  *         assert self.summary, "Writing without summaries is currently not supported"             # <<<<<<<<<<<<<<
12182  *         # If we are at the current level being written, write a block
12183  *         if self.level == level:
12184  */
12185   #ifndef CYTHON_WITHOUT_ASSERTIONS
12186   if (unlikely(!Py_OptimizeFlag)) {
12187     __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->summary)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 407, __pyx_L1_error)
12188     if (unlikely(!__pyx_t_1)) {
12189       PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Writing_without_summaries_is_cur);
12190       __PYX_ERR(0, 407, __pyx_L1_error)
12191     }
12192   }
12193   #endif
12194 
12195   /* "bx/arrays/array_tree.pyx":409
12196  *         assert self.summary, "Writing without summaries is currently not supported"
12197  *         # If we are at the current level being written, write a block
12198  *         if self.level == level:             # <<<<<<<<<<<<<<
12199  *             # Save file offset where this block starts
12200  *             self.start_offset = io.tell()
12201  */
12202   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->level); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error)
12203   __Pyx_GOTREF(__pyx_t_2);
12204   __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_level, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error)
12205   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12206   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 409, __pyx_L1_error)
12207   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12208   if (__pyx_t_1) {
12209 
12210     /* "bx/arrays/array_tree.pyx":411
12211  *         if self.level == level:
12212  *             # Save file offset where this block starts
12213  *             self.start_offset = io.tell()             # <<<<<<<<<<<<<<
12214  *             # Write out summary data
12215  *             io.write_raw_array( self.summary.counts )
12216  */
12217     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_tell); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
12218     __Pyx_GOTREF(__pyx_t_2);
12219     __pyx_t_4 = NULL;
12220     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12221       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
12222       if (likely(__pyx_t_4)) {
12223         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12224         __Pyx_INCREF(__pyx_t_4);
12225         __Pyx_INCREF(function);
12226         __Pyx_DECREF_SET(__pyx_t_2, function);
12227       }
12228     }
12229     __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
12230     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12231     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error)
12232     __Pyx_GOTREF(__pyx_t_3);
12233     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12234     __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error)
12235     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12236     __pyx_v_self->start_offset = __pyx_t_5;
12237 
12238     /* "bx/arrays/array_tree.pyx":413
12239  *             self.start_offset = io.tell()
12240  *             # Write out summary data
12241  *             io.write_raw_array( self.summary.counts )             # <<<<<<<<<<<<<<
12242  *             io.write_raw_array( self.summary.frequencies )
12243  *             io.write_raw_array( self.summary.sums )
12244  */
12245     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_write_raw_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error)
12246     __Pyx_GOTREF(__pyx_t_2);
12247     __pyx_t_4 = NULL;
12248     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12249       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
12250       if (likely(__pyx_t_4)) {
12251         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12252         __Pyx_INCREF(__pyx_t_4);
12253         __Pyx_INCREF(function);
12254         __Pyx_DECREF_SET(__pyx_t_2, function);
12255       }
12256     }
12257     __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_self->summary->counts) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->summary->counts);
12258     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12259     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error)
12260     __Pyx_GOTREF(__pyx_t_3);
12261     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12262     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12263 
12264     /* "bx/arrays/array_tree.pyx":414
12265  *             # Write out summary data
12266  *             io.write_raw_array( self.summary.counts )
12267  *             io.write_raw_array( self.summary.frequencies )             # <<<<<<<<<<<<<<
12268  *             io.write_raw_array( self.summary.sums )
12269  *             io.write_raw_array( self.summary.mins )
12270  */
12271     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_write_raw_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
12272     __Pyx_GOTREF(__pyx_t_2);
12273     __pyx_t_4 = NULL;
12274     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12275       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
12276       if (likely(__pyx_t_4)) {
12277         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12278         __Pyx_INCREF(__pyx_t_4);
12279         __Pyx_INCREF(function);
12280         __Pyx_DECREF_SET(__pyx_t_2, function);
12281       }
12282     }
12283     __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_self->summary->frequencies) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->summary->frequencies);
12284     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12285     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error)
12286     __Pyx_GOTREF(__pyx_t_3);
12287     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12288     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12289 
12290     /* "bx/arrays/array_tree.pyx":415
12291  *             io.write_raw_array( self.summary.counts )
12292  *             io.write_raw_array( self.summary.frequencies )
12293  *             io.write_raw_array( self.summary.sums )             # <<<<<<<<<<<<<<
12294  *             io.write_raw_array( self.summary.mins )
12295  *             io.write_raw_array( self.summary.maxs )
12296  */
12297     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_write_raw_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error)
12298     __Pyx_GOTREF(__pyx_t_2);
12299     __pyx_t_4 = NULL;
12300     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12301       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
12302       if (likely(__pyx_t_4)) {
12303         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12304         __Pyx_INCREF(__pyx_t_4);
12305         __Pyx_INCREF(function);
12306         __Pyx_DECREF_SET(__pyx_t_2, function);
12307       }
12308     }
12309     __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_self->summary->sums) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->summary->sums);
12310     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12311     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error)
12312     __Pyx_GOTREF(__pyx_t_3);
12313     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12314     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12315 
12316     /* "bx/arrays/array_tree.pyx":416
12317  *             io.write_raw_array( self.summary.frequencies )
12318  *             io.write_raw_array( self.summary.sums )
12319  *             io.write_raw_array( self.summary.mins )             # <<<<<<<<<<<<<<
12320  *             io.write_raw_array( self.summary.maxs )
12321  *             io.write_raw_array( self.summary.sumsquares )
12322  */
12323     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_write_raw_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error)
12324     __Pyx_GOTREF(__pyx_t_2);
12325     __pyx_t_4 = NULL;
12326     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12327       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
12328       if (likely(__pyx_t_4)) {
12329         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12330         __Pyx_INCREF(__pyx_t_4);
12331         __Pyx_INCREF(function);
12332         __Pyx_DECREF_SET(__pyx_t_2, function);
12333       }
12334     }
12335     __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_self->summary->mins) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->summary->mins);
12336     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12337     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error)
12338     __Pyx_GOTREF(__pyx_t_3);
12339     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12340     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12341 
12342     /* "bx/arrays/array_tree.pyx":417
12343  *             io.write_raw_array( self.summary.sums )
12344  *             io.write_raw_array( self.summary.mins )
12345  *             io.write_raw_array( self.summary.maxs )             # <<<<<<<<<<<<<<
12346  *             io.write_raw_array( self.summary.sumsquares )
12347  *             # Skip enough room for child offsets (block_size children * 64bits)
12348  */
12349     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_write_raw_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error)
12350     __Pyx_GOTREF(__pyx_t_2);
12351     __pyx_t_4 = NULL;
12352     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12353       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
12354       if (likely(__pyx_t_4)) {
12355         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12356         __Pyx_INCREF(__pyx_t_4);
12357         __Pyx_INCREF(function);
12358         __Pyx_DECREF_SET(__pyx_t_2, function);
12359       }
12360     }
12361     __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_self->summary->maxs) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->summary->maxs);
12362     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12363     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error)
12364     __Pyx_GOTREF(__pyx_t_3);
12365     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12366     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12367 
12368     /* "bx/arrays/array_tree.pyx":418
12369  *             io.write_raw_array( self.summary.mins )
12370  *             io.write_raw_array( self.summary.maxs )
12371  *             io.write_raw_array( self.summary.sumsquares )             # <<<<<<<<<<<<<<
12372  *             # Skip enough room for child offsets (block_size children * 64bits)
12373  *             io.skip( self.tree.block_size * 8 )
12374  */
12375     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_write_raw_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
12376     __Pyx_GOTREF(__pyx_t_2);
12377     __pyx_t_4 = NULL;
12378     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12379       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
12380       if (likely(__pyx_t_4)) {
12381         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12382         __Pyx_INCREF(__pyx_t_4);
12383         __Pyx_INCREF(function);
12384         __Pyx_DECREF_SET(__pyx_t_2, function);
12385       }
12386     }
12387     __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_self->summary->sumsquares) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->summary->sumsquares);
12388     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12389     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error)
12390     __Pyx_GOTREF(__pyx_t_3);
12391     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12392     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12393 
12394     /* "bx/arrays/array_tree.pyx":420
12395  *             io.write_raw_array( self.summary.sumsquares )
12396  *             # Skip enough room for child offsets (block_size children * 64bits)
12397  *             io.skip( self.tree.block_size * 8 )             # <<<<<<<<<<<<<<
12398  *         # Must be writing a lower level, so recurse
12399  *         else:
12400  */
12401     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_skip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
12402     __Pyx_GOTREF(__pyx_t_2);
12403     __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_self->tree->block_size * 8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
12404     __Pyx_GOTREF(__pyx_t_4);
12405     __pyx_t_6 = NULL;
12406     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12407       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
12408       if (likely(__pyx_t_6)) {
12409         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12410         __Pyx_INCREF(__pyx_t_6);
12411         __Pyx_INCREF(function);
12412         __Pyx_DECREF_SET(__pyx_t_2, function);
12413       }
12414     }
12415     __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
12416     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12417     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12418     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
12419     __Pyx_GOTREF(__pyx_t_3);
12420     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12421     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12422 
12423     /* "bx/arrays/array_tree.pyx":409
12424  *         assert self.summary, "Writing without summaries is currently not supported"
12425  *         # If we are at the current level being written, write a block
12426  *         if self.level == level:             # <<<<<<<<<<<<<<
12427  *             # Save file offset where this block starts
12428  *             self.start_offset = io.tell()
12429  */
12430     goto __pyx_L3;
12431   }
12432 
12433   /* "bx/arrays/array_tree.pyx":424
12434  *         else:
12435  *             # Write all non-empty children
12436  *             for i in range( len( self.children ) ):             # <<<<<<<<<<<<<<
12437  *                 if self.children[i] is not None:
12438  *                     self.children[i].to_file_data_pass( io, level )
12439  */
12440   /*else*/ {
12441     __pyx_t_3 = __pyx_v_self->children;
12442     __Pyx_INCREF(__pyx_t_3);
12443     __pyx_t_7 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 424, __pyx_L1_error)
12444     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12445     __pyx_t_8 = __pyx_t_7;
12446     for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
12447       __pyx_v_i = __pyx_t_9;
12448 
12449       /* "bx/arrays/array_tree.pyx":425
12450  *             # Write all non-empty children
12451  *             for i in range( len( self.children ) ):
12452  *                 if self.children[i] is not None:             # <<<<<<<<<<<<<<
12453  *                     self.children[i].to_file_data_pass( io, level )
12454  *
12455  */
12456       __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->children, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error)
12457       __Pyx_GOTREF(__pyx_t_3);
12458       __pyx_t_1 = (__pyx_t_3 != Py_None);
12459       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12460       __pyx_t_10 = (__pyx_t_1 != 0);
12461       if (__pyx_t_10) {
12462 
12463         /* "bx/arrays/array_tree.pyx":426
12464  *             for i in range( len( self.children ) ):
12465  *                 if self.children[i] is not None:
12466  *                     self.children[i].to_file_data_pass( io, level )             # <<<<<<<<<<<<<<
12467  *
12468  *     def to_file_offset_pass( self, io ):
12469  */
12470         __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->children, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error)
12471         __Pyx_GOTREF(__pyx_t_2);
12472         __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_to_file_data_pass); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 426, __pyx_L1_error)
12473         __Pyx_GOTREF(__pyx_t_4);
12474         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12475         __pyx_t_2 = NULL;
12476         __pyx_t_11 = 0;
12477         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
12478           __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
12479           if (likely(__pyx_t_2)) {
12480             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
12481             __Pyx_INCREF(__pyx_t_2);
12482             __Pyx_INCREF(function);
12483             __Pyx_DECREF_SET(__pyx_t_4, function);
12484             __pyx_t_11 = 1;
12485           }
12486         }
12487         #if CYTHON_FAST_PYCALL
12488         if (PyFunction_Check(__pyx_t_4)) {
12489           PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_io, __pyx_v_level};
12490           __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error)
12491           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12492           __Pyx_GOTREF(__pyx_t_3);
12493         } else
12494         #endif
12495         #if CYTHON_FAST_PYCCALL
12496         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
12497           PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_io, __pyx_v_level};
12498           __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error)
12499           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12500           __Pyx_GOTREF(__pyx_t_3);
12501         } else
12502         #endif
12503         {
12504           __pyx_t_6 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L1_error)
12505           __Pyx_GOTREF(__pyx_t_6);
12506           if (__pyx_t_2) {
12507             __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
12508           }
12509           __Pyx_INCREF(__pyx_v_io);
12510           __Pyx_GIVEREF(__pyx_v_io);
12511           PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_11, __pyx_v_io);
12512           __Pyx_INCREF(__pyx_v_level);
12513           __Pyx_GIVEREF(__pyx_v_level);
12514           PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_11, __pyx_v_level);
12515           __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error)
12516           __Pyx_GOTREF(__pyx_t_3);
12517           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12518         }
12519         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12520         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12521 
12522         /* "bx/arrays/array_tree.pyx":425
12523  *             # Write all non-empty children
12524  *             for i in range( len( self.children ) ):
12525  *                 if self.children[i] is not None:             # <<<<<<<<<<<<<<
12526  *                     self.children[i].to_file_data_pass( io, level )
12527  *
12528  */
12529       }
12530     }
12531   }
12532   __pyx_L3:;
12533 
12534   /* "bx/arrays/array_tree.pyx":403
12535  *         self.summary = s
12536  *
12537  *     def to_file_data_pass( self, io, level ):             # <<<<<<<<<<<<<<
12538  *         """
12539  *         First pass of writing to file, writes data and saves position of block.
12540  */
12541 
12542   /* function exit code */
12543   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12544   goto __pyx_L0;
12545   __pyx_L1_error:;
12546   __Pyx_XDECREF(__pyx_t_2);
12547   __Pyx_XDECREF(__pyx_t_3);
12548   __Pyx_XDECREF(__pyx_t_4);
12549   __Pyx_XDECREF(__pyx_t_6);
12550   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.to_file_data_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
12551   __pyx_r = NULL;
12552   __pyx_L0:;
12553   __Pyx_XGIVEREF(__pyx_r);
12554   __Pyx_RefNannyFinishContext();
12555   return __pyx_r;
12556 }
12557 
12558 /* "bx/arrays/array_tree.pyx":428
12559  *                     self.children[i].to_file_data_pass( io, level )
12560  *
12561  *     def to_file_offset_pass( self, io ):             # <<<<<<<<<<<<<<
12562  *         """
12563  *         Second pass of writing to file, seek to appropriate position and write
12564  */
12565 
12566 /* Python wrapper */
12567 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_11to_file_offset_pass(PyObject *__pyx_v_self, PyObject *__pyx_v_io); /*proto*/
12568 static char __pyx_doc_2bx_6arrays_10array_tree_13ArrayTreeNode_10to_file_offset_pass[] = "\n        Second pass of writing to file, seek to appropriate position and write\n        offsets of children.\n        ";
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_11to_file_offset_pass(PyObject * __pyx_v_self,PyObject * __pyx_v_io)12569 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_11to_file_offset_pass(PyObject *__pyx_v_self, PyObject *__pyx_v_io) {
12570   PyObject *__pyx_r = 0;
12571   __Pyx_RefNannyDeclarations
12572   __Pyx_RefNannySetupContext("to_file_offset_pass (wrapper)", 0);
12573   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_10to_file_offset_pass(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_v_self), ((PyObject *)__pyx_v_io));
12574 
12575   /* function exit code */
12576   __Pyx_RefNannyFinishContext();
12577   return __pyx_r;
12578 }
12579 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_10to_file_offset_pass(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self,PyObject * __pyx_v_io)12580 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_10to_file_offset_pass(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, PyObject *__pyx_v_io) {
12581   PyObject *__pyx_v_skip_amount = NULL;
12582   PyObject *__pyx_v_child = NULL;
12583   PyObject *__pyx_r = NULL;
12584   __Pyx_RefNannyDeclarations
12585   PyObject *__pyx_t_1 = NULL;
12586   PyObject *__pyx_t_2 = NULL;
12587   PyObject *__pyx_t_3 = NULL;
12588   PyObject *__pyx_t_4 = NULL;
12589   Py_ssize_t __pyx_t_5;
12590   PyObject *(*__pyx_t_6)(PyObject *);
12591   int __pyx_t_7;
12592   int __pyx_t_8;
12593   PyObject *__pyx_t_9 = NULL;
12594   int __pyx_lineno = 0;
12595   const char *__pyx_filename = NULL;
12596   int __pyx_clineno = 0;
12597   __Pyx_RefNannySetupContext("to_file_offset_pass", 0);
12598 
12599   /* "bx/arrays/array_tree.pyx":434
12600  *         """
12601  *         # Seek to location of child offfsets (skip over # summary arrays)
12602  *         skip_amount = NUM_SUMMARY_ARRAYS * self.tree.dtype.itemsize * self.block_size             # <<<<<<<<<<<<<<
12603  *         io.seek( self.start_offset + skip_amount )
12604  *         # Write the file offset of each child into the index
12605  */
12606   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NUM_SUMMARY_ARRAYS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error)
12607   __Pyx_GOTREF(__pyx_t_1);
12608   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->tree->dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error)
12609   __Pyx_GOTREF(__pyx_t_2);
12610   __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error)
12611   __Pyx_GOTREF(__pyx_t_3);
12612   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12613   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12614   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->block_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error)
12615   __Pyx_GOTREF(__pyx_t_2);
12616   __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error)
12617   __Pyx_GOTREF(__pyx_t_1);
12618   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12619   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12620   __pyx_v_skip_amount = __pyx_t_1;
12621   __pyx_t_1 = 0;
12622 
12623   /* "bx/arrays/array_tree.pyx":435
12624  *         # Seek to location of child offfsets (skip over # summary arrays)
12625  *         skip_amount = NUM_SUMMARY_ARRAYS * self.tree.dtype.itemsize * self.block_size
12626  *         io.seek( self.start_offset + skip_amount )             # <<<<<<<<<<<<<<
12627  *         # Write the file offset of each child into the index
12628  *         for child in self.children:
12629  */
12630   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_seek); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error)
12631   __Pyx_GOTREF(__pyx_t_2);
12632   __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_self->start_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __pyx_L1_error)
12633   __Pyx_GOTREF(__pyx_t_3);
12634   __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_v_skip_amount); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error)
12635   __Pyx_GOTREF(__pyx_t_4);
12636   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12637   __pyx_t_3 = NULL;
12638   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12639     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12640     if (likely(__pyx_t_3)) {
12641       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12642       __Pyx_INCREF(__pyx_t_3);
12643       __Pyx_INCREF(function);
12644       __Pyx_DECREF_SET(__pyx_t_2, function);
12645     }
12646   }
12647   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
12648   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12649   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12650   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
12651   __Pyx_GOTREF(__pyx_t_1);
12652   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12653   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12654 
12655   /* "bx/arrays/array_tree.pyx":437
12656  *         io.seek( self.start_offset + skip_amount )
12657  *         # Write the file offset of each child into the index
12658  *         for child in self.children:             # <<<<<<<<<<<<<<
12659  *             if child is None:
12660  *                 io.write_uint64( 0 )
12661  */
12662   if (likely(PyList_CheckExact(__pyx_v_self->children)) || PyTuple_CheckExact(__pyx_v_self->children)) {
12663     __pyx_t_1 = __pyx_v_self->children; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
12664     __pyx_t_6 = NULL;
12665   } else {
12666     __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
12667     __Pyx_GOTREF(__pyx_t_1);
12668     __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 437, __pyx_L1_error)
12669   }
12670   for (;;) {
12671     if (likely(!__pyx_t_6)) {
12672       if (likely(PyList_CheckExact(__pyx_t_1))) {
12673         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
12674         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12675         __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, 437, __pyx_L1_error)
12676         #else
12677         __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
12678         __Pyx_GOTREF(__pyx_t_2);
12679         #endif
12680       } else {
12681         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
12682         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12683         __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, 437, __pyx_L1_error)
12684         #else
12685         __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
12686         __Pyx_GOTREF(__pyx_t_2);
12687         #endif
12688       }
12689     } else {
12690       __pyx_t_2 = __pyx_t_6(__pyx_t_1);
12691       if (unlikely(!__pyx_t_2)) {
12692         PyObject* exc_type = PyErr_Occurred();
12693         if (exc_type) {
12694           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12695           else __PYX_ERR(0, 437, __pyx_L1_error)
12696         }
12697         break;
12698       }
12699       __Pyx_GOTREF(__pyx_t_2);
12700     }
12701     __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_2);
12702     __pyx_t_2 = 0;
12703 
12704     /* "bx/arrays/array_tree.pyx":438
12705  *         # Write the file offset of each child into the index
12706  *         for child in self.children:
12707  *             if child is None:             # <<<<<<<<<<<<<<
12708  *                 io.write_uint64( 0 )
12709  *             else:
12710  */
12711     __pyx_t_7 = (__pyx_v_child == Py_None);
12712     __pyx_t_8 = (__pyx_t_7 != 0);
12713     if (__pyx_t_8) {
12714 
12715       /* "bx/arrays/array_tree.pyx":439
12716  *         for child in self.children:
12717  *             if child is None:
12718  *                 io.write_uint64( 0 )             # <<<<<<<<<<<<<<
12719  *             else:
12720  *                 io.write_uint64( child.start_offset )
12721  */
12722       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_write_uint64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error)
12723       __Pyx_GOTREF(__pyx_t_4);
12724       __pyx_t_3 = NULL;
12725       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
12726         __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
12727         if (likely(__pyx_t_3)) {
12728           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
12729           __Pyx_INCREF(__pyx_t_3);
12730           __Pyx_INCREF(function);
12731           __Pyx_DECREF_SET(__pyx_t_4, function);
12732         }
12733       }
12734       __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_0);
12735       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12736       if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error)
12737       __Pyx_GOTREF(__pyx_t_2);
12738       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12739       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12740 
12741       /* "bx/arrays/array_tree.pyx":438
12742  *         # Write the file offset of each child into the index
12743  *         for child in self.children:
12744  *             if child is None:             # <<<<<<<<<<<<<<
12745  *                 io.write_uint64( 0 )
12746  *             else:
12747  */
12748       goto __pyx_L5;
12749     }
12750 
12751     /* "bx/arrays/array_tree.pyx":441
12752  *                 io.write_uint64( 0 )
12753  *             else:
12754  *                 io.write_uint64( child.start_offset )             # <<<<<<<<<<<<<<
12755  *         # Recursively write offsets in child nodes
12756  *         for child in self.children:
12757  */
12758     /*else*/ {
12759       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_write_uint64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 441, __pyx_L1_error)
12760       __Pyx_GOTREF(__pyx_t_4);
12761       __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_start_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error)
12762       __Pyx_GOTREF(__pyx_t_3);
12763       __pyx_t_9 = NULL;
12764       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
12765         __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
12766         if (likely(__pyx_t_9)) {
12767           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
12768           __Pyx_INCREF(__pyx_t_9);
12769           __Pyx_INCREF(function);
12770           __Pyx_DECREF_SET(__pyx_t_4, function);
12771         }
12772       }
12773       __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
12774       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12775       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12776       if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error)
12777       __Pyx_GOTREF(__pyx_t_2);
12778       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12779       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12780     }
12781     __pyx_L5:;
12782 
12783     /* "bx/arrays/array_tree.pyx":437
12784  *         io.seek( self.start_offset + skip_amount )
12785  *         # Write the file offset of each child into the index
12786  *         for child in self.children:             # <<<<<<<<<<<<<<
12787  *             if child is None:
12788  *                 io.write_uint64( 0 )
12789  */
12790   }
12791   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12792 
12793   /* "bx/arrays/array_tree.pyx":443
12794  *                 io.write_uint64( child.start_offset )
12795  *         # Recursively write offsets in child nodes
12796  *         for child in self.children:             # <<<<<<<<<<<<<<
12797  *             if child is not None:
12798  *                 child.to_file_offset_pass( io )
12799  */
12800   if (likely(PyList_CheckExact(__pyx_v_self->children)) || PyTuple_CheckExact(__pyx_v_self->children)) {
12801     __pyx_t_1 = __pyx_v_self->children; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
12802     __pyx_t_6 = NULL;
12803   } else {
12804     __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error)
12805     __Pyx_GOTREF(__pyx_t_1);
12806     __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L1_error)
12807   }
12808   for (;;) {
12809     if (likely(!__pyx_t_6)) {
12810       if (likely(PyList_CheckExact(__pyx_t_1))) {
12811         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
12812         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12813         __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, 443, __pyx_L1_error)
12814         #else
12815         __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error)
12816         __Pyx_GOTREF(__pyx_t_2);
12817         #endif
12818       } else {
12819         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
12820         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12821         __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, 443, __pyx_L1_error)
12822         #else
12823         __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error)
12824         __Pyx_GOTREF(__pyx_t_2);
12825         #endif
12826       }
12827     } else {
12828       __pyx_t_2 = __pyx_t_6(__pyx_t_1);
12829       if (unlikely(!__pyx_t_2)) {
12830         PyObject* exc_type = PyErr_Occurred();
12831         if (exc_type) {
12832           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12833           else __PYX_ERR(0, 443, __pyx_L1_error)
12834         }
12835         break;
12836       }
12837       __Pyx_GOTREF(__pyx_t_2);
12838     }
12839     __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_2);
12840     __pyx_t_2 = 0;
12841 
12842     /* "bx/arrays/array_tree.pyx":444
12843  *         # Recursively write offsets in child nodes
12844  *         for child in self.children:
12845  *             if child is not None:             # <<<<<<<<<<<<<<
12846  *                 child.to_file_offset_pass( io )
12847  *
12848  */
12849     __pyx_t_8 = (__pyx_v_child != Py_None);
12850     __pyx_t_7 = (__pyx_t_8 != 0);
12851     if (__pyx_t_7) {
12852 
12853       /* "bx/arrays/array_tree.pyx":445
12854  *         for child in self.children:
12855  *             if child is not None:
12856  *                 child.to_file_offset_pass( io )             # <<<<<<<<<<<<<<
12857  *
12858  *     def from_file( self, io ):
12859  */
12860       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_to_file_offset_pass); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 445, __pyx_L1_error)
12861       __Pyx_GOTREF(__pyx_t_4);
12862       __pyx_t_3 = NULL;
12863       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
12864         __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
12865         if (likely(__pyx_t_3)) {
12866           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
12867           __Pyx_INCREF(__pyx_t_3);
12868           __Pyx_INCREF(function);
12869           __Pyx_DECREF_SET(__pyx_t_4, function);
12870         }
12871       }
12872       __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_io) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_io);
12873       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12874       if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error)
12875       __Pyx_GOTREF(__pyx_t_2);
12876       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12877       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12878 
12879       /* "bx/arrays/array_tree.pyx":444
12880  *         # Recursively write offsets in child nodes
12881  *         for child in self.children:
12882  *             if child is not None:             # <<<<<<<<<<<<<<
12883  *                 child.to_file_offset_pass( io )
12884  *
12885  */
12886     }
12887 
12888     /* "bx/arrays/array_tree.pyx":443
12889  *                 io.write_uint64( child.start_offset )
12890  *         # Recursively write offsets in child nodes
12891  *         for child in self.children:             # <<<<<<<<<<<<<<
12892  *             if child is not None:
12893  *                 child.to_file_offset_pass( io )
12894  */
12895   }
12896   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12897 
12898   /* "bx/arrays/array_tree.pyx":428
12899  *                     self.children[i].to_file_data_pass( io, level )
12900  *
12901  *     def to_file_offset_pass( self, io ):             # <<<<<<<<<<<<<<
12902  *         """
12903  *         Second pass of writing to file, seek to appropriate position and write
12904  */
12905 
12906   /* function exit code */
12907   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12908   goto __pyx_L0;
12909   __pyx_L1_error:;
12910   __Pyx_XDECREF(__pyx_t_1);
12911   __Pyx_XDECREF(__pyx_t_2);
12912   __Pyx_XDECREF(__pyx_t_3);
12913   __Pyx_XDECREF(__pyx_t_4);
12914   __Pyx_XDECREF(__pyx_t_9);
12915   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.to_file_offset_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
12916   __pyx_r = NULL;
12917   __pyx_L0:;
12918   __Pyx_XDECREF(__pyx_v_skip_amount);
12919   __Pyx_XDECREF(__pyx_v_child);
12920   __Pyx_XGIVEREF(__pyx_r);
12921   __Pyx_RefNannyFinishContext();
12922   return __pyx_r;
12923 }
12924 
12925 /* "bx/arrays/array_tree.pyx":447
12926  *                 child.to_file_offset_pass( io )
12927  *
12928  *     def from_file( self, io ):             # <<<<<<<<<<<<<<
12929  *         """
12930  *         Load entire summary and all children into memory.
12931  */
12932 
12933 /* Python wrapper */
12934 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_13from_file(PyObject *__pyx_v_self, PyObject *__pyx_v_io); /*proto*/
12935 static char __pyx_doc_2bx_6arrays_10array_tree_13ArrayTreeNode_12from_file[] = "\n        Load entire summary and all children into memory.\n        ";
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_13from_file(PyObject * __pyx_v_self,PyObject * __pyx_v_io)12936 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_13from_file(PyObject *__pyx_v_self, PyObject *__pyx_v_io) {
12937   PyObject *__pyx_r = 0;
12938   __Pyx_RefNannyDeclarations
12939   __Pyx_RefNannySetupContext("from_file (wrapper)", 0);
12940   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_12from_file(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_v_self), ((PyObject *)__pyx_v_io));
12941 
12942   /* function exit code */
12943   __Pyx_RefNannyFinishContext();
12944   return __pyx_r;
12945 }
12946 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_12from_file(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self,PyObject * __pyx_v_io)12947 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_12from_file(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, PyObject *__pyx_v_io) {
12948   PyObject *__pyx_v_dtype = NULL;
12949   int __pyx_v_block_size;
12950   struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v_s = NULL;
12951   PyObject *__pyx_v_child_offsets = NULL;
12952   int __pyx_v_i;
12953   PyObject *__pyx_r = NULL;
12954   __Pyx_RefNannyDeclarations
12955   PyObject *__pyx_t_1 = NULL;
12956   int __pyx_t_2;
12957   PyObject *__pyx_t_3 = NULL;
12958   PyObject *__pyx_t_4 = NULL;
12959   PyObject *__pyx_t_5 = NULL;
12960   PyObject *__pyx_t_6 = NULL;
12961   PyObject *__pyx_t_7 = NULL;
12962   int __pyx_t_8;
12963   int __pyx_t_9;
12964   int __pyx_t_10;
12965   int __pyx_lineno = 0;
12966   const char *__pyx_filename = NULL;
12967   int __pyx_clineno = 0;
12968   __Pyx_RefNannySetupContext("from_file", 0);
12969 
12970   /* "bx/arrays/array_tree.pyx":451
12971  *         Load entire summary and all children into memory.
12972  *         """
12973  *         dtype = self.tree.dtype             # <<<<<<<<<<<<<<
12974  *         block_size = self.tree.block_size
12975  *         # Read summary arrays
12976  */
12977   __pyx_t_1 = __pyx_v_self->tree->dtype;
12978   __Pyx_INCREF(__pyx_t_1);
12979   __pyx_v_dtype = __pyx_t_1;
12980   __pyx_t_1 = 0;
12981 
12982   /* "bx/arrays/array_tree.pyx":452
12983  *         """
12984  *         dtype = self.tree.dtype
12985  *         block_size = self.tree.block_size             # <<<<<<<<<<<<<<
12986  *         # Read summary arrays
12987  *         s = Summary()
12988  */
12989   __pyx_t_2 = __pyx_v_self->tree->block_size;
12990   __pyx_v_block_size = __pyx_t_2;
12991 
12992   /* "bx/arrays/array_tree.pyx":454
12993  *         block_size = self.tree.block_size
12994  *         # Read summary arrays
12995  *         s = Summary()             # <<<<<<<<<<<<<<
12996  *         s.counts = io.read_raw_array( dtype, block_size )
12997  *         s.frequencies = io.read_raw_array( int32, block_size )
12998  */
12999   __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_Summary)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error)
13000   __Pyx_GOTREF(__pyx_t_1);
13001   __pyx_v_s = ((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_t_1);
13002   __pyx_t_1 = 0;
13003 
13004   /* "bx/arrays/array_tree.pyx":455
13005  *         # Read summary arrays
13006  *         s = Summary()
13007  *         s.counts = io.read_raw_array( dtype, block_size )             # <<<<<<<<<<<<<<
13008  *         s.frequencies = io.read_raw_array( int32, block_size )
13009  *         s.sums = io.read_raw_array( dtype, block_size )
13010  */
13011   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_read_raw_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error)
13012   __Pyx_GOTREF(__pyx_t_3);
13013   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_block_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 455, __pyx_L1_error)
13014   __Pyx_GOTREF(__pyx_t_4);
13015   __pyx_t_5 = NULL;
13016   __pyx_t_2 = 0;
13017   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
13018     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
13019     if (likely(__pyx_t_5)) {
13020       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
13021       __Pyx_INCREF(__pyx_t_5);
13022       __Pyx_INCREF(function);
13023       __Pyx_DECREF_SET(__pyx_t_3, function);
13024       __pyx_t_2 = 1;
13025     }
13026   }
13027   #if CYTHON_FAST_PYCALL
13028   if (PyFunction_Check(__pyx_t_3)) {
13029     PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_dtype, __pyx_t_4};
13030     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
13031     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13032     __Pyx_GOTREF(__pyx_t_1);
13033     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13034   } else
13035   #endif
13036   #if CYTHON_FAST_PYCCALL
13037   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
13038     PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_dtype, __pyx_t_4};
13039     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
13040     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13041     __Pyx_GOTREF(__pyx_t_1);
13042     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13043   } else
13044   #endif
13045   {
13046     __pyx_t_6 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 455, __pyx_L1_error)
13047     __Pyx_GOTREF(__pyx_t_6);
13048     if (__pyx_t_5) {
13049       __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
13050     }
13051     __Pyx_INCREF(__pyx_v_dtype);
13052     __Pyx_GIVEREF(__pyx_v_dtype);
13053     PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_2, __pyx_v_dtype);
13054     __Pyx_GIVEREF(__pyx_t_4);
13055     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_2, __pyx_t_4);
13056     __pyx_t_4 = 0;
13057     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
13058     __Pyx_GOTREF(__pyx_t_1);
13059     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13060   }
13061   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13062   __Pyx_GIVEREF(__pyx_t_1);
13063   __Pyx_GOTREF(__pyx_v_s->counts);
13064   __Pyx_DECREF(__pyx_v_s->counts);
13065   __pyx_v_s->counts = __pyx_t_1;
13066   __pyx_t_1 = 0;
13067 
13068   /* "bx/arrays/array_tree.pyx":456
13069  *         s = Summary()
13070  *         s.counts = io.read_raw_array( dtype, block_size )
13071  *         s.frequencies = io.read_raw_array( int32, block_size )             # <<<<<<<<<<<<<<
13072  *         s.sums = io.read_raw_array( dtype, block_size )
13073  *         s.mins = io.read_raw_array( dtype, block_size)
13074  */
13075   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_read_raw_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
13076   __Pyx_GOTREF(__pyx_t_3);
13077   __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error)
13078   __Pyx_GOTREF(__pyx_t_6);
13079   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_block_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L1_error)
13080   __Pyx_GOTREF(__pyx_t_4);
13081   __pyx_t_5 = NULL;
13082   __pyx_t_2 = 0;
13083   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
13084     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
13085     if (likely(__pyx_t_5)) {
13086       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
13087       __Pyx_INCREF(__pyx_t_5);
13088       __Pyx_INCREF(function);
13089       __Pyx_DECREF_SET(__pyx_t_3, function);
13090       __pyx_t_2 = 1;
13091     }
13092   }
13093   #if CYTHON_FAST_PYCALL
13094   if (PyFunction_Check(__pyx_t_3)) {
13095     PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_6, __pyx_t_4};
13096     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
13097     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13098     __Pyx_GOTREF(__pyx_t_1);
13099     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13100     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13101   } else
13102   #endif
13103   #if CYTHON_FAST_PYCCALL
13104   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
13105     PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_6, __pyx_t_4};
13106     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
13107     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13108     __Pyx_GOTREF(__pyx_t_1);
13109     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13110     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13111   } else
13112   #endif
13113   {
13114     __pyx_t_7 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 456, __pyx_L1_error)
13115     __Pyx_GOTREF(__pyx_t_7);
13116     if (__pyx_t_5) {
13117       __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
13118     }
13119     __Pyx_GIVEREF(__pyx_t_6);
13120     PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_2, __pyx_t_6);
13121     __Pyx_GIVEREF(__pyx_t_4);
13122     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_2, __pyx_t_4);
13123     __pyx_t_6 = 0;
13124     __pyx_t_4 = 0;
13125     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
13126     __Pyx_GOTREF(__pyx_t_1);
13127     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13128   }
13129   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13130   __Pyx_GIVEREF(__pyx_t_1);
13131   __Pyx_GOTREF(__pyx_v_s->frequencies);
13132   __Pyx_DECREF(__pyx_v_s->frequencies);
13133   __pyx_v_s->frequencies = __pyx_t_1;
13134   __pyx_t_1 = 0;
13135 
13136   /* "bx/arrays/array_tree.pyx":457
13137  *         s.counts = io.read_raw_array( dtype, block_size )
13138  *         s.frequencies = io.read_raw_array( int32, block_size )
13139  *         s.sums = io.read_raw_array( dtype, block_size )             # <<<<<<<<<<<<<<
13140  *         s.mins = io.read_raw_array( dtype, block_size)
13141  *         s.maxs = io.read_raw_array( dtype, block_size )
13142  */
13143   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_read_raw_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error)
13144   __Pyx_GOTREF(__pyx_t_3);
13145   __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_block_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 457, __pyx_L1_error)
13146   __Pyx_GOTREF(__pyx_t_7);
13147   __pyx_t_4 = NULL;
13148   __pyx_t_2 = 0;
13149   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
13150     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
13151     if (likely(__pyx_t_4)) {
13152       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
13153       __Pyx_INCREF(__pyx_t_4);
13154       __Pyx_INCREF(function);
13155       __Pyx_DECREF_SET(__pyx_t_3, function);
13156       __pyx_t_2 = 1;
13157     }
13158   }
13159   #if CYTHON_FAST_PYCALL
13160   if (PyFunction_Check(__pyx_t_3)) {
13161     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_dtype, __pyx_t_7};
13162     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
13163     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13164     __Pyx_GOTREF(__pyx_t_1);
13165     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13166   } else
13167   #endif
13168   #if CYTHON_FAST_PYCCALL
13169   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
13170     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_dtype, __pyx_t_7};
13171     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
13172     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13173     __Pyx_GOTREF(__pyx_t_1);
13174     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13175   } else
13176   #endif
13177   {
13178     __pyx_t_6 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 457, __pyx_L1_error)
13179     __Pyx_GOTREF(__pyx_t_6);
13180     if (__pyx_t_4) {
13181       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
13182     }
13183     __Pyx_INCREF(__pyx_v_dtype);
13184     __Pyx_GIVEREF(__pyx_v_dtype);
13185     PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_2, __pyx_v_dtype);
13186     __Pyx_GIVEREF(__pyx_t_7);
13187     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_2, __pyx_t_7);
13188     __pyx_t_7 = 0;
13189     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
13190     __Pyx_GOTREF(__pyx_t_1);
13191     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13192   }
13193   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13194   __Pyx_GIVEREF(__pyx_t_1);
13195   __Pyx_GOTREF(__pyx_v_s->sums);
13196   __Pyx_DECREF(__pyx_v_s->sums);
13197   __pyx_v_s->sums = __pyx_t_1;
13198   __pyx_t_1 = 0;
13199 
13200   /* "bx/arrays/array_tree.pyx":458
13201  *         s.frequencies = io.read_raw_array( int32, block_size )
13202  *         s.sums = io.read_raw_array( dtype, block_size )
13203  *         s.mins = io.read_raw_array( dtype, block_size)             # <<<<<<<<<<<<<<
13204  *         s.maxs = io.read_raw_array( dtype, block_size )
13205  *         s.sumsquares = io.read_raw_array( dtype, block_size )
13206  */
13207   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_read_raw_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error)
13208   __Pyx_GOTREF(__pyx_t_3);
13209   __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_block_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error)
13210   __Pyx_GOTREF(__pyx_t_6);
13211   __pyx_t_7 = NULL;
13212   __pyx_t_2 = 0;
13213   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
13214     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
13215     if (likely(__pyx_t_7)) {
13216       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
13217       __Pyx_INCREF(__pyx_t_7);
13218       __Pyx_INCREF(function);
13219       __Pyx_DECREF_SET(__pyx_t_3, function);
13220       __pyx_t_2 = 1;
13221     }
13222   }
13223   #if CYTHON_FAST_PYCALL
13224   if (PyFunction_Check(__pyx_t_3)) {
13225     PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_dtype, __pyx_t_6};
13226     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
13227     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13228     __Pyx_GOTREF(__pyx_t_1);
13229     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13230   } else
13231   #endif
13232   #if CYTHON_FAST_PYCCALL
13233   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
13234     PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_dtype, __pyx_t_6};
13235     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
13236     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13237     __Pyx_GOTREF(__pyx_t_1);
13238     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13239   } else
13240   #endif
13241   {
13242     __pyx_t_4 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L1_error)
13243     __Pyx_GOTREF(__pyx_t_4);
13244     if (__pyx_t_7) {
13245       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
13246     }
13247     __Pyx_INCREF(__pyx_v_dtype);
13248     __Pyx_GIVEREF(__pyx_v_dtype);
13249     PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_2, __pyx_v_dtype);
13250     __Pyx_GIVEREF(__pyx_t_6);
13251     PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_2, __pyx_t_6);
13252     __pyx_t_6 = 0;
13253     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
13254     __Pyx_GOTREF(__pyx_t_1);
13255     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13256   }
13257   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13258   __Pyx_GIVEREF(__pyx_t_1);
13259   __Pyx_GOTREF(__pyx_v_s->mins);
13260   __Pyx_DECREF(__pyx_v_s->mins);
13261   __pyx_v_s->mins = __pyx_t_1;
13262   __pyx_t_1 = 0;
13263 
13264   /* "bx/arrays/array_tree.pyx":459
13265  *         s.sums = io.read_raw_array( dtype, block_size )
13266  *         s.mins = io.read_raw_array( dtype, block_size)
13267  *         s.maxs = io.read_raw_array( dtype, block_size )             # <<<<<<<<<<<<<<
13268  *         s.sumsquares = io.read_raw_array( dtype, block_size )
13269  *         self.summary = s
13270  */
13271   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_read_raw_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error)
13272   __Pyx_GOTREF(__pyx_t_3);
13273   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_block_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 459, __pyx_L1_error)
13274   __Pyx_GOTREF(__pyx_t_4);
13275   __pyx_t_6 = NULL;
13276   __pyx_t_2 = 0;
13277   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
13278     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
13279     if (likely(__pyx_t_6)) {
13280       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
13281       __Pyx_INCREF(__pyx_t_6);
13282       __Pyx_INCREF(function);
13283       __Pyx_DECREF_SET(__pyx_t_3, function);
13284       __pyx_t_2 = 1;
13285     }
13286   }
13287   #if CYTHON_FAST_PYCALL
13288   if (PyFunction_Check(__pyx_t_3)) {
13289     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_dtype, __pyx_t_4};
13290     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
13291     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13292     __Pyx_GOTREF(__pyx_t_1);
13293     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13294   } else
13295   #endif
13296   #if CYTHON_FAST_PYCCALL
13297   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
13298     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_dtype, __pyx_t_4};
13299     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
13300     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13301     __Pyx_GOTREF(__pyx_t_1);
13302     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13303   } else
13304   #endif
13305   {
13306     __pyx_t_7 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 459, __pyx_L1_error)
13307     __Pyx_GOTREF(__pyx_t_7);
13308     if (__pyx_t_6) {
13309       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
13310     }
13311     __Pyx_INCREF(__pyx_v_dtype);
13312     __Pyx_GIVEREF(__pyx_v_dtype);
13313     PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_2, __pyx_v_dtype);
13314     __Pyx_GIVEREF(__pyx_t_4);
13315     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_2, __pyx_t_4);
13316     __pyx_t_4 = 0;
13317     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
13318     __Pyx_GOTREF(__pyx_t_1);
13319     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13320   }
13321   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13322   __Pyx_GIVEREF(__pyx_t_1);
13323   __Pyx_GOTREF(__pyx_v_s->maxs);
13324   __Pyx_DECREF(__pyx_v_s->maxs);
13325   __pyx_v_s->maxs = __pyx_t_1;
13326   __pyx_t_1 = 0;
13327 
13328   /* "bx/arrays/array_tree.pyx":460
13329  *         s.mins = io.read_raw_array( dtype, block_size)
13330  *         s.maxs = io.read_raw_array( dtype, block_size )
13331  *         s.sumsquares = io.read_raw_array( dtype, block_size )             # <<<<<<<<<<<<<<
13332  *         self.summary = s
13333  *         # Read offset of all children
13334  */
13335   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_read_raw_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error)
13336   __Pyx_GOTREF(__pyx_t_3);
13337   __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_block_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 460, __pyx_L1_error)
13338   __Pyx_GOTREF(__pyx_t_7);
13339   __pyx_t_4 = NULL;
13340   __pyx_t_2 = 0;
13341   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
13342     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
13343     if (likely(__pyx_t_4)) {
13344       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
13345       __Pyx_INCREF(__pyx_t_4);
13346       __Pyx_INCREF(function);
13347       __Pyx_DECREF_SET(__pyx_t_3, function);
13348       __pyx_t_2 = 1;
13349     }
13350   }
13351   #if CYTHON_FAST_PYCALL
13352   if (PyFunction_Check(__pyx_t_3)) {
13353     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_dtype, __pyx_t_7};
13354     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
13355     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13356     __Pyx_GOTREF(__pyx_t_1);
13357     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13358   } else
13359   #endif
13360   #if CYTHON_FAST_PYCCALL
13361   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
13362     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_dtype, __pyx_t_7};
13363     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
13364     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13365     __Pyx_GOTREF(__pyx_t_1);
13366     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13367   } else
13368   #endif
13369   {
13370     __pyx_t_6 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 460, __pyx_L1_error)
13371     __Pyx_GOTREF(__pyx_t_6);
13372     if (__pyx_t_4) {
13373       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
13374     }
13375     __Pyx_INCREF(__pyx_v_dtype);
13376     __Pyx_GIVEREF(__pyx_v_dtype);
13377     PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_2, __pyx_v_dtype);
13378     __Pyx_GIVEREF(__pyx_t_7);
13379     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_2, __pyx_t_7);
13380     __pyx_t_7 = 0;
13381     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
13382     __Pyx_GOTREF(__pyx_t_1);
13383     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13384   }
13385   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13386   __Pyx_GIVEREF(__pyx_t_1);
13387   __Pyx_GOTREF(__pyx_v_s->sumsquares);
13388   __Pyx_DECREF(__pyx_v_s->sumsquares);
13389   __pyx_v_s->sumsquares = __pyx_t_1;
13390   __pyx_t_1 = 0;
13391 
13392   /* "bx/arrays/array_tree.pyx":461
13393  *         s.maxs = io.read_raw_array( dtype, block_size )
13394  *         s.sumsquares = io.read_raw_array( dtype, block_size )
13395  *         self.summary = s             # <<<<<<<<<<<<<<
13396  *         # Read offset of all children
13397  *         child_offsets = [ io.read_uint64() for i in range( block_size ) ]
13398  */
13399   __Pyx_INCREF(((PyObject *)__pyx_v_s));
13400   __Pyx_GIVEREF(((PyObject *)__pyx_v_s));
13401   __Pyx_GOTREF(__pyx_v_self->summary);
13402   __Pyx_DECREF(((PyObject *)__pyx_v_self->summary));
13403   __pyx_v_self->summary = __pyx_v_s;
13404 
13405   /* "bx/arrays/array_tree.pyx":463
13406  *         self.summary = s
13407  *         # Read offset of all children
13408  *         child_offsets = [ io.read_uint64() for i in range( block_size ) ]             # <<<<<<<<<<<<<<
13409  *         for i in range( block_size ):
13410  *             if child_offsets[i] > 0:
13411  */
13412   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
13413   __Pyx_GOTREF(__pyx_t_1);
13414   __pyx_t_2 = __pyx_v_block_size;
13415   __pyx_t_8 = __pyx_t_2;
13416   for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
13417     __pyx_v_i = __pyx_t_9;
13418     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_read_uint64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 463, __pyx_L1_error)
13419     __Pyx_GOTREF(__pyx_t_6);
13420     __pyx_t_7 = NULL;
13421     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
13422       __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
13423       if (likely(__pyx_t_7)) {
13424         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
13425         __Pyx_INCREF(__pyx_t_7);
13426         __Pyx_INCREF(function);
13427         __Pyx_DECREF_SET(__pyx_t_6, function);
13428       }
13429     }
13430     __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
13431     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13432     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error)
13433     __Pyx_GOTREF(__pyx_t_3);
13434     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13435     if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 463, __pyx_L1_error)
13436     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13437   }
13438   __pyx_v_child_offsets = ((PyObject*)__pyx_t_1);
13439   __pyx_t_1 = 0;
13440 
13441   /* "bx/arrays/array_tree.pyx":464
13442  *         # Read offset of all children
13443  *         child_offsets = [ io.read_uint64() for i in range( block_size ) ]
13444  *         for i in range( block_size ):             # <<<<<<<<<<<<<<
13445  *             if child_offsets[i] > 0:
13446  *                 self.init_bin( i )
13447  */
13448   __pyx_t_2 = __pyx_v_block_size;
13449   __pyx_t_8 = __pyx_t_2;
13450   for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
13451     __pyx_v_i = __pyx_t_9;
13452 
13453     /* "bx/arrays/array_tree.pyx":465
13454  *         child_offsets = [ io.read_uint64() for i in range( block_size ) ]
13455  *         for i in range( block_size ):
13456  *             if child_offsets[i] > 0:             # <<<<<<<<<<<<<<
13457  *                 self.init_bin( i )
13458  *                 io.seek( child_offsets[i] )
13459  */
13460     __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_child_offsets, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
13461     __Pyx_GOTREF(__pyx_t_1);
13462     __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
13463     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13464     __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 465, __pyx_L1_error)
13465     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13466     if (__pyx_t_10) {
13467 
13468       /* "bx/arrays/array_tree.pyx":466
13469  *         for i in range( block_size ):
13470  *             if child_offsets[i] > 0:
13471  *                 self.init_bin( i )             # <<<<<<<<<<<<<<
13472  *                 io.seek( child_offsets[i] )
13473  *                 self.children[i].from_file( io )
13474  */
13475       __pyx_t_3 = __pyx_f_2bx_6arrays_10array_tree_13ArrayTreeNode_init_bin(__pyx_v_self, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
13476       __Pyx_GOTREF(__pyx_t_3);
13477       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13478 
13479       /* "bx/arrays/array_tree.pyx":467
13480  *             if child_offsets[i] > 0:
13481  *                 self.init_bin( i )
13482  *                 io.seek( child_offsets[i] )             # <<<<<<<<<<<<<<
13483  *                 self.children[i].from_file( io )
13484  *
13485  */
13486       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
13487       __Pyx_GOTREF(__pyx_t_1);
13488       __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_child_offsets, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 467, __pyx_L1_error)
13489       __Pyx_GOTREF(__pyx_t_6);
13490       __pyx_t_7 = NULL;
13491       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
13492         __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
13493         if (likely(__pyx_t_7)) {
13494           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
13495           __Pyx_INCREF(__pyx_t_7);
13496           __Pyx_INCREF(function);
13497           __Pyx_DECREF_SET(__pyx_t_1, function);
13498         }
13499       }
13500       __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6);
13501       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13502       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13503       if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L1_error)
13504       __Pyx_GOTREF(__pyx_t_3);
13505       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13506       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13507 
13508       /* "bx/arrays/array_tree.pyx":468
13509  *                 self.init_bin( i )
13510  *                 io.seek( child_offsets[i] )
13511  *                 self.children[i].from_file( io )             # <<<<<<<<<<<<<<
13512  *
13513  *     def get_from_file( self, io, index ):
13514  */
13515       __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->children, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
13516       __Pyx_GOTREF(__pyx_t_1);
13517       __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_from_file); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 468, __pyx_L1_error)
13518       __Pyx_GOTREF(__pyx_t_6);
13519       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13520       __pyx_t_1 = NULL;
13521       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
13522         __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
13523         if (likely(__pyx_t_1)) {
13524           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
13525           __Pyx_INCREF(__pyx_t_1);
13526           __Pyx_INCREF(function);
13527           __Pyx_DECREF_SET(__pyx_t_6, function);
13528         }
13529       }
13530       __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_v_io) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_io);
13531       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13532       if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __pyx_L1_error)
13533       __Pyx_GOTREF(__pyx_t_3);
13534       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13535       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13536 
13537       /* "bx/arrays/array_tree.pyx":465
13538  *         child_offsets = [ io.read_uint64() for i in range( block_size ) ]
13539  *         for i in range( block_size ):
13540  *             if child_offsets[i] > 0:             # <<<<<<<<<<<<<<
13541  *                 self.init_bin( i )
13542  *                 io.seek( child_offsets[i] )
13543  */
13544     }
13545   }
13546 
13547   /* "bx/arrays/array_tree.pyx":447
13548  *                 child.to_file_offset_pass( io )
13549  *
13550  *     def from_file( self, io ):             # <<<<<<<<<<<<<<
13551  *         """
13552  *         Load entire summary and all children into memory.
13553  */
13554 
13555   /* function exit code */
13556   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13557   goto __pyx_L0;
13558   __pyx_L1_error:;
13559   __Pyx_XDECREF(__pyx_t_1);
13560   __Pyx_XDECREF(__pyx_t_3);
13561   __Pyx_XDECREF(__pyx_t_4);
13562   __Pyx_XDECREF(__pyx_t_5);
13563   __Pyx_XDECREF(__pyx_t_6);
13564   __Pyx_XDECREF(__pyx_t_7);
13565   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
13566   __pyx_r = NULL;
13567   __pyx_L0:;
13568   __Pyx_XDECREF(__pyx_v_dtype);
13569   __Pyx_XDECREF((PyObject *)__pyx_v_s);
13570   __Pyx_XDECREF(__pyx_v_child_offsets);
13571   __Pyx_XGIVEREF(__pyx_r);
13572   __Pyx_RefNannyFinishContext();
13573   return __pyx_r;
13574 }
13575 
13576 /* "bx/arrays/array_tree.pyx":470
13577  *                 self.children[i].from_file( io )
13578  *
13579  *     def get_from_file( self, io, index ):             # <<<<<<<<<<<<<<
13580  *         cdef int bin_index = ( index - self.min ) //( self.child_size )
13581  *         if self.children[ bin_index ] is None:
13582  */
13583 
13584 /* Python wrapper */
13585 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_15get_from_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_15get_from_file(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)13586 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_15get_from_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13587   CYTHON_UNUSED PyObject *__pyx_v_io = 0;
13588   PyObject *__pyx_v_index = 0;
13589   int __pyx_lineno = 0;
13590   const char *__pyx_filename = NULL;
13591   int __pyx_clineno = 0;
13592   PyObject *__pyx_r = 0;
13593   __Pyx_RefNannyDeclarations
13594   __Pyx_RefNannySetupContext("get_from_file (wrapper)", 0);
13595   {
13596     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_io,&__pyx_n_s_index,0};
13597     PyObject* values[2] = {0,0};
13598     if (unlikely(__pyx_kwds)) {
13599       Py_ssize_t kw_args;
13600       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13601       switch (pos_args) {
13602         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13603         CYTHON_FALLTHROUGH;
13604         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13605         CYTHON_FALLTHROUGH;
13606         case  0: break;
13607         default: goto __pyx_L5_argtuple_error;
13608       }
13609       kw_args = PyDict_Size(__pyx_kwds);
13610       switch (pos_args) {
13611         case  0:
13612         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_io)) != 0)) kw_args--;
13613         else goto __pyx_L5_argtuple_error;
13614         CYTHON_FALLTHROUGH;
13615         case  1:
13616         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
13617         else {
13618           __Pyx_RaiseArgtupleInvalid("get_from_file", 1, 2, 2, 1); __PYX_ERR(0, 470, __pyx_L3_error)
13619         }
13620       }
13621       if (unlikely(kw_args > 0)) {
13622         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_from_file") < 0)) __PYX_ERR(0, 470, __pyx_L3_error)
13623       }
13624     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
13625       goto __pyx_L5_argtuple_error;
13626     } else {
13627       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13628       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13629     }
13630     __pyx_v_io = values[0];
13631     __pyx_v_index = values[1];
13632   }
13633   goto __pyx_L4_argument_unpacking_done;
13634   __pyx_L5_argtuple_error:;
13635   __Pyx_RaiseArgtupleInvalid("get_from_file", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 470, __pyx_L3_error)
13636   __pyx_L3_error:;
13637   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.get_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
13638   __Pyx_RefNannyFinishContext();
13639   return NULL;
13640   __pyx_L4_argument_unpacking_done:;
13641   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_14get_from_file(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_v_self), __pyx_v_io, __pyx_v_index);
13642 
13643   /* function exit code */
13644   __Pyx_RefNannyFinishContext();
13645   return __pyx_r;
13646 }
13647 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_14get_from_file(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v_io,PyObject * __pyx_v_index)13648 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_14get_from_file(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_io, PyObject *__pyx_v_index) {
13649   int __pyx_v_bin_index;
13650   PyObject *__pyx_r = NULL;
13651   __Pyx_RefNannyDeclarations
13652   PyObject *__pyx_t_1 = NULL;
13653   PyObject *__pyx_t_2 = NULL;
13654   PyObject *__pyx_t_3 = NULL;
13655   int __pyx_t_4;
13656   int __pyx_t_5;
13657   int __pyx_t_6;
13658   int __pyx_lineno = 0;
13659   const char *__pyx_filename = NULL;
13660   int __pyx_clineno = 0;
13661   __Pyx_RefNannySetupContext("get_from_file", 0);
13662 
13663   /* "bx/arrays/array_tree.pyx":471
13664  *
13665  *     def get_from_file( self, io, index ):
13666  *         cdef int bin_index = ( index - self.min ) //( self.child_size )             # <<<<<<<<<<<<<<
13667  *         if self.children[ bin_index ] is None:
13668  *             return nan
13669  */
13670   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->min); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
13671   __Pyx_GOTREF(__pyx_t_1);
13672   __pyx_t_2 = PyNumber_Subtract(__pyx_v_index, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error)
13673   __Pyx_GOTREF(__pyx_t_2);
13674   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13675   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->child_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
13676   __Pyx_GOTREF(__pyx_t_1);
13677   __pyx_t_3 = PyNumber_FloorDivide(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error)
13678   __Pyx_GOTREF(__pyx_t_3);
13679   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13680   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13681   __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 471, __pyx_L1_error)
13682   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13683   __pyx_v_bin_index = __pyx_t_4;
13684 
13685   /* "bx/arrays/array_tree.pyx":472
13686  *     def get_from_file( self, io, index ):
13687  *         cdef int bin_index = ( index - self.min ) //( self.child_size )
13688  *         if self.children[ bin_index ] is None:             # <<<<<<<<<<<<<<
13689  *             return nan
13690  *         else:
13691  */
13692   __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->children, __pyx_v_bin_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L1_error)
13693   __Pyx_GOTREF(__pyx_t_3);
13694   __pyx_t_5 = (__pyx_t_3 == Py_None);
13695   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13696   __pyx_t_6 = (__pyx_t_5 != 0);
13697   if (__pyx_t_6) {
13698 
13699     /* "bx/arrays/array_tree.pyx":473
13700  *         cdef int bin_index = ( index - self.min ) //( self.child_size )
13701  *         if self.children[ bin_index ] is None:
13702  *             return nan             # <<<<<<<<<<<<<<
13703  *         else:
13704  *             return self.children[ bin_index ].get( index )
13705  */
13706     __Pyx_XDECREF(__pyx_r);
13707     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_nan); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error)
13708     __Pyx_GOTREF(__pyx_t_3);
13709     __pyx_r = __pyx_t_3;
13710     __pyx_t_3 = 0;
13711     goto __pyx_L0;
13712 
13713     /* "bx/arrays/array_tree.pyx":472
13714  *     def get_from_file( self, io, index ):
13715  *         cdef int bin_index = ( index - self.min ) //( self.child_size )
13716  *         if self.children[ bin_index ] is None:             # <<<<<<<<<<<<<<
13717  *             return nan
13718  *         else:
13719  */
13720   }
13721 
13722   /* "bx/arrays/array_tree.pyx":475
13723  *             return nan
13724  *         else:
13725  *             return self.children[ bin_index ].get( index )             # <<<<<<<<<<<<<<
13726  *
13727  * cdef class ArrayTreeLeaf:
13728  */
13729   /*else*/ {
13730     __Pyx_XDECREF(__pyx_r);
13731     __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->children, __pyx_v_bin_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
13732     __Pyx_GOTREF(__pyx_t_1);
13733     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
13734     __Pyx_GOTREF(__pyx_t_2);
13735     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13736     __pyx_t_1 = NULL;
13737     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
13738       __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
13739       if (likely(__pyx_t_1)) {
13740         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
13741         __Pyx_INCREF(__pyx_t_1);
13742         __Pyx_INCREF(function);
13743         __Pyx_DECREF_SET(__pyx_t_2, function);
13744       }
13745     }
13746     __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_index) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_index);
13747     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13748     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error)
13749     __Pyx_GOTREF(__pyx_t_3);
13750     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13751     __pyx_r = __pyx_t_3;
13752     __pyx_t_3 = 0;
13753     goto __pyx_L0;
13754   }
13755 
13756   /* "bx/arrays/array_tree.pyx":470
13757  *                 self.children[i].from_file( io )
13758  *
13759  *     def get_from_file( self, io, index ):             # <<<<<<<<<<<<<<
13760  *         cdef int bin_index = ( index - self.min ) //( self.child_size )
13761  *         if self.children[ bin_index ] is None:
13762  */
13763 
13764   /* function exit code */
13765   __pyx_L1_error:;
13766   __Pyx_XDECREF(__pyx_t_1);
13767   __Pyx_XDECREF(__pyx_t_2);
13768   __Pyx_XDECREF(__pyx_t_3);
13769   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.get_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
13770   __pyx_r = NULL;
13771   __pyx_L0:;
13772   __Pyx_XGIVEREF(__pyx_r);
13773   __Pyx_RefNannyFinishContext();
13774   return __pyx_r;
13775 }
13776 
13777 /* "bx/arrays/array_tree.pyx":322
13778  *     cdef int child_size
13779  *     cdef object children
13780  *     cdef public Summary summary             # <<<<<<<<<<<<<<
13781  *     cdef public long start_offset
13782  *
13783  */
13784 
13785 /* Python wrapper */
13786 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_1__get__(PyObject * __pyx_v_self)13787 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_1__get__(PyObject *__pyx_v_self) {
13788   PyObject *__pyx_r = 0;
13789   __Pyx_RefNannyDeclarations
13790   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13791   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_v_self));
13792 
13793   /* function exit code */
13794   __Pyx_RefNannyFinishContext();
13795   return __pyx_r;
13796 }
13797 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self)13798 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self) {
13799   PyObject *__pyx_r = NULL;
13800   __Pyx_RefNannyDeclarations
13801   __Pyx_RefNannySetupContext("__get__", 0);
13802   __Pyx_XDECREF(__pyx_r);
13803   __Pyx_INCREF(((PyObject *)__pyx_v_self->summary));
13804   __pyx_r = ((PyObject *)__pyx_v_self->summary);
13805   goto __pyx_L0;
13806 
13807   /* function exit code */
13808   __pyx_L0:;
13809   __Pyx_XGIVEREF(__pyx_r);
13810   __Pyx_RefNannyFinishContext();
13811   return __pyx_r;
13812 }
13813 
13814 /* Python wrapper */
13815 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)13816 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
13817   int __pyx_r;
13818   __Pyx_RefNannyDeclarations
13819   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
13820   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_v_self), ((PyObject *)__pyx_v_value));
13821 
13822   /* function exit code */
13823   __Pyx_RefNannyFinishContext();
13824   return __pyx_r;
13825 }
13826 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self,PyObject * __pyx_v_value)13827 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, PyObject *__pyx_v_value) {
13828   int __pyx_r;
13829   __Pyx_RefNannyDeclarations
13830   PyObject *__pyx_t_1 = NULL;
13831   int __pyx_lineno = 0;
13832   const char *__pyx_filename = NULL;
13833   int __pyx_clineno = 0;
13834   __Pyx_RefNannySetupContext("__set__", 0);
13835   if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2bx_6arrays_10array_tree_Summary))))) __PYX_ERR(0, 322, __pyx_L1_error)
13836   __pyx_t_1 = __pyx_v_value;
13837   __Pyx_INCREF(__pyx_t_1);
13838   __Pyx_GIVEREF(__pyx_t_1);
13839   __Pyx_GOTREF(__pyx_v_self->summary);
13840   __Pyx_DECREF(((PyObject *)__pyx_v_self->summary));
13841   __pyx_v_self->summary = ((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_t_1);
13842   __pyx_t_1 = 0;
13843 
13844   /* function exit code */
13845   __pyx_r = 0;
13846   goto __pyx_L0;
13847   __pyx_L1_error:;
13848   __Pyx_XDECREF(__pyx_t_1);
13849   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.summary.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13850   __pyx_r = -1;
13851   __pyx_L0:;
13852   __Pyx_RefNannyFinishContext();
13853   return __pyx_r;
13854 }
13855 
13856 /* Python wrapper */
13857 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_5__del__(PyObject * __pyx_v_self)13858 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_5__del__(PyObject *__pyx_v_self) {
13859   int __pyx_r;
13860   __Pyx_RefNannyDeclarations
13861   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
13862   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_4__del__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_v_self));
13863 
13864   /* function exit code */
13865   __Pyx_RefNannyFinishContext();
13866   return __pyx_r;
13867 }
13868 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self)13869 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self) {
13870   int __pyx_r;
13871   __Pyx_RefNannyDeclarations
13872   __Pyx_RefNannySetupContext("__del__", 0);
13873   __Pyx_INCREF(Py_None);
13874   __Pyx_GIVEREF(Py_None);
13875   __Pyx_GOTREF(__pyx_v_self->summary);
13876   __Pyx_DECREF(((PyObject *)__pyx_v_self->summary));
13877   __pyx_v_self->summary = ((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)Py_None);
13878 
13879   /* function exit code */
13880   __pyx_r = 0;
13881   __Pyx_RefNannyFinishContext();
13882   return __pyx_r;
13883 }
13884 
13885 /* "bx/arrays/array_tree.pyx":323
13886  *     cdef object children
13887  *     cdef public Summary summary
13888  *     cdef public long start_offset             # <<<<<<<<<<<<<<
13889  *
13890  *     def __init__( self, ArrayTree tree, int min, int max, int block_size, int level ):
13891  */
13892 
13893 /* Python wrapper */
13894 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_12start_offset_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_12start_offset_1__get__(PyObject * __pyx_v_self)13895 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_12start_offset_1__get__(PyObject *__pyx_v_self) {
13896   PyObject *__pyx_r = 0;
13897   __Pyx_RefNannyDeclarations
13898   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13899   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_12start_offset___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_v_self));
13900 
13901   /* function exit code */
13902   __Pyx_RefNannyFinishContext();
13903   return __pyx_r;
13904 }
13905 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_12start_offset___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self)13906 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_12start_offset___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self) {
13907   PyObject *__pyx_r = NULL;
13908   __Pyx_RefNannyDeclarations
13909   PyObject *__pyx_t_1 = NULL;
13910   int __pyx_lineno = 0;
13911   const char *__pyx_filename = NULL;
13912   int __pyx_clineno = 0;
13913   __Pyx_RefNannySetupContext("__get__", 0);
13914   __Pyx_XDECREF(__pyx_r);
13915   __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->start_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
13916   __Pyx_GOTREF(__pyx_t_1);
13917   __pyx_r = __pyx_t_1;
13918   __pyx_t_1 = 0;
13919   goto __pyx_L0;
13920 
13921   /* function exit code */
13922   __pyx_L1_error:;
13923   __Pyx_XDECREF(__pyx_t_1);
13924   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.start_offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13925   __pyx_r = NULL;
13926   __pyx_L0:;
13927   __Pyx_XGIVEREF(__pyx_r);
13928   __Pyx_RefNannyFinishContext();
13929   return __pyx_r;
13930 }
13931 
13932 /* Python wrapper */
13933 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_12start_offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_12start_offset_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)13934 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_12start_offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
13935   int __pyx_r;
13936   __Pyx_RefNannyDeclarations
13937   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
13938   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_12start_offset_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_v_self), ((PyObject *)__pyx_v_value));
13939 
13940   /* function exit code */
13941   __Pyx_RefNannyFinishContext();
13942   return __pyx_r;
13943 }
13944 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_12start_offset_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self,PyObject * __pyx_v_value)13945 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_12start_offset_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, PyObject *__pyx_v_value) {
13946   int __pyx_r;
13947   __Pyx_RefNannyDeclarations
13948   long __pyx_t_1;
13949   int __pyx_lineno = 0;
13950   const char *__pyx_filename = NULL;
13951   int __pyx_clineno = 0;
13952   __Pyx_RefNannySetupContext("__set__", 0);
13953   __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_value); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L1_error)
13954   __pyx_v_self->start_offset = __pyx_t_1;
13955 
13956   /* function exit code */
13957   __pyx_r = 0;
13958   goto __pyx_L0;
13959   __pyx_L1_error:;
13960   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.start_offset.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13961   __pyx_r = -1;
13962   __pyx_L0:;
13963   __Pyx_RefNannyFinishContext();
13964   return __pyx_r;
13965 }
13966 
13967 /* "(tree fragment)":1
13968  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
13969  *     cdef tuple state
13970  *     cdef object _dict
13971  */
13972 
13973 /* Python wrapper */
13974 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_17__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)13975 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13976   PyObject *__pyx_r = 0;
13977   __Pyx_RefNannyDeclarations
13978   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
13979   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_16__reduce_cython__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_v_self));
13980 
13981   /* function exit code */
13982   __Pyx_RefNannyFinishContext();
13983   return __pyx_r;
13984 }
13985 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_16__reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self)13986 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_16__reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self) {
13987   PyObject *__pyx_v_state = 0;
13988   PyObject *__pyx_v__dict = 0;
13989   int __pyx_v_use_setstate;
13990   PyObject *__pyx_r = NULL;
13991   __Pyx_RefNannyDeclarations
13992   PyObject *__pyx_t_1 = NULL;
13993   PyObject *__pyx_t_2 = NULL;
13994   PyObject *__pyx_t_3 = NULL;
13995   PyObject *__pyx_t_4 = NULL;
13996   PyObject *__pyx_t_5 = NULL;
13997   PyObject *__pyx_t_6 = NULL;
13998   PyObject *__pyx_t_7 = NULL;
13999   int __pyx_t_8;
14000   int __pyx_t_9;
14001   int __pyx_t_10;
14002   int __pyx_lineno = 0;
14003   const char *__pyx_filename = NULL;
14004   int __pyx_clineno = 0;
14005   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14006 
14007   /* "(tree fragment)":5
14008  *     cdef object _dict
14009  *     cdef bint use_setstate
14010  *     state = (self.block_size, self.child_size, self.children, self.level, self.max, self.min, self.start_offset, self.summary, self.tree)             # <<<<<<<<<<<<<<
14011  *     _dict = getattr(self, '__dict__', None)
14012  *     if _dict is not None:
14013  */
14014   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->block_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
14015   __Pyx_GOTREF(__pyx_t_1);
14016   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->child_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
14017   __Pyx_GOTREF(__pyx_t_2);
14018   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->level); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
14019   __Pyx_GOTREF(__pyx_t_3);
14020   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->max); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
14021   __Pyx_GOTREF(__pyx_t_4);
14022   __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->min); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
14023   __Pyx_GOTREF(__pyx_t_5);
14024   __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->start_offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error)
14025   __Pyx_GOTREF(__pyx_t_6);
14026   __pyx_t_7 = PyTuple_New(9); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5, __pyx_L1_error)
14027   __Pyx_GOTREF(__pyx_t_7);
14028   __Pyx_GIVEREF(__pyx_t_1);
14029   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
14030   __Pyx_GIVEREF(__pyx_t_2);
14031   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
14032   __Pyx_INCREF(__pyx_v_self->children);
14033   __Pyx_GIVEREF(__pyx_v_self->children);
14034   PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_self->children);
14035   __Pyx_GIVEREF(__pyx_t_3);
14036   PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_3);
14037   __Pyx_GIVEREF(__pyx_t_4);
14038   PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_4);
14039   __Pyx_GIVEREF(__pyx_t_5);
14040   PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_5);
14041   __Pyx_GIVEREF(__pyx_t_6);
14042   PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_6);
14043   __Pyx_INCREF(((PyObject *)__pyx_v_self->summary));
14044   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->summary));
14045   PyTuple_SET_ITEM(__pyx_t_7, 7, ((PyObject *)__pyx_v_self->summary));
14046   __Pyx_INCREF(((PyObject *)__pyx_v_self->tree));
14047   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->tree));
14048   PyTuple_SET_ITEM(__pyx_t_7, 8, ((PyObject *)__pyx_v_self->tree));
14049   __pyx_t_1 = 0;
14050   __pyx_t_2 = 0;
14051   __pyx_t_3 = 0;
14052   __pyx_t_4 = 0;
14053   __pyx_t_5 = 0;
14054   __pyx_t_6 = 0;
14055   __pyx_v_state = ((PyObject*)__pyx_t_7);
14056   __pyx_t_7 = 0;
14057 
14058   /* "(tree fragment)":6
14059  *     cdef bint use_setstate
14060  *     state = (self.block_size, self.child_size, self.children, self.level, self.max, self.min, self.start_offset, self.summary, self.tree)
14061  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
14062  *     if _dict is not None:
14063  *         state += (_dict,)
14064  */
14065   __pyx_t_7 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict_2, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 6, __pyx_L1_error)
14066   __Pyx_GOTREF(__pyx_t_7);
14067   __pyx_v__dict = __pyx_t_7;
14068   __pyx_t_7 = 0;
14069 
14070   /* "(tree fragment)":7
14071  *     state = (self.block_size, self.child_size, self.children, self.level, self.max, self.min, self.start_offset, self.summary, self.tree)
14072  *     _dict = getattr(self, '__dict__', None)
14073  *     if _dict is not None:             # <<<<<<<<<<<<<<
14074  *         state += (_dict,)
14075  *         use_setstate = True
14076  */
14077   __pyx_t_8 = (__pyx_v__dict != Py_None);
14078   __pyx_t_9 = (__pyx_t_8 != 0);
14079   if (__pyx_t_9) {
14080 
14081     /* "(tree fragment)":8
14082  *     _dict = getattr(self, '__dict__', None)
14083  *     if _dict is not None:
14084  *         state += (_dict,)             # <<<<<<<<<<<<<<
14085  *         use_setstate = True
14086  *     else:
14087  */
14088     __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 8, __pyx_L1_error)
14089     __Pyx_GOTREF(__pyx_t_7);
14090     __Pyx_INCREF(__pyx_v__dict);
14091     __Pyx_GIVEREF(__pyx_v__dict);
14092     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v__dict);
14093     __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 8, __pyx_L1_error)
14094     __Pyx_GOTREF(__pyx_t_6);
14095     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14096     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_6));
14097     __pyx_t_6 = 0;
14098 
14099     /* "(tree fragment)":9
14100  *     if _dict is not None:
14101  *         state += (_dict,)
14102  *         use_setstate = True             # <<<<<<<<<<<<<<
14103  *     else:
14104  *         use_setstate = self.children is not None or self.summary is not None or self.tree is not None
14105  */
14106     __pyx_v_use_setstate = 1;
14107 
14108     /* "(tree fragment)":7
14109  *     state = (self.block_size, self.child_size, self.children, self.level, self.max, self.min, self.start_offset, self.summary, self.tree)
14110  *     _dict = getattr(self, '__dict__', None)
14111  *     if _dict is not None:             # <<<<<<<<<<<<<<
14112  *         state += (_dict,)
14113  *         use_setstate = True
14114  */
14115     goto __pyx_L3;
14116   }
14117 
14118   /* "(tree fragment)":11
14119  *         use_setstate = True
14120  *     else:
14121  *         use_setstate = self.children is not None or self.summary is not None or self.tree is not None             # <<<<<<<<<<<<<<
14122  *     if use_setstate:
14123  *         return __pyx_unpickle_ArrayTreeNode, (type(self), 0xebb9478, None), state
14124  */
14125   /*else*/ {
14126     __pyx_t_8 = (__pyx_v_self->children != Py_None);
14127     __pyx_t_10 = (__pyx_t_8 != 0);
14128     if (!__pyx_t_10) {
14129     } else {
14130       __pyx_t_9 = __pyx_t_10;
14131       goto __pyx_L4_bool_binop_done;
14132     }
14133     __pyx_t_10 = (((PyObject *)__pyx_v_self->summary) != Py_None);
14134     __pyx_t_8 = (__pyx_t_10 != 0);
14135     if (!__pyx_t_8) {
14136     } else {
14137       __pyx_t_9 = __pyx_t_8;
14138       goto __pyx_L4_bool_binop_done;
14139     }
14140     __pyx_t_8 = (((PyObject *)__pyx_v_self->tree) != Py_None);
14141     __pyx_t_10 = (__pyx_t_8 != 0);
14142     __pyx_t_9 = __pyx_t_10;
14143     __pyx_L4_bool_binop_done:;
14144     __pyx_v_use_setstate = __pyx_t_9;
14145   }
14146   __pyx_L3:;
14147 
14148   /* "(tree fragment)":12
14149  *     else:
14150  *         use_setstate = self.children is not None or self.summary is not None or self.tree is not None
14151  *     if use_setstate:             # <<<<<<<<<<<<<<
14152  *         return __pyx_unpickle_ArrayTreeNode, (type(self), 0xebb9478, None), state
14153  *     else:
14154  */
14155   __pyx_t_9 = (__pyx_v_use_setstate != 0);
14156   if (__pyx_t_9) {
14157 
14158     /* "(tree fragment)":13
14159  *         use_setstate = self.children is not None or self.summary is not None or self.tree is not None
14160  *     if use_setstate:
14161  *         return __pyx_unpickle_ArrayTreeNode, (type(self), 0xebb9478, None), state             # <<<<<<<<<<<<<<
14162  *     else:
14163  *         return __pyx_unpickle_ArrayTreeNode, (type(self), 0xebb9478, state)
14164  */
14165     __Pyx_XDECREF(__pyx_r);
14166     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_ArrayTreeNode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
14167     __Pyx_GOTREF(__pyx_t_6);
14168     __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 13, __pyx_L1_error)
14169     __Pyx_GOTREF(__pyx_t_7);
14170     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
14171     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
14172     PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
14173     __Pyx_INCREF(__pyx_int_247174264);
14174     __Pyx_GIVEREF(__pyx_int_247174264);
14175     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_247174264);
14176     __Pyx_INCREF(Py_None);
14177     __Pyx_GIVEREF(Py_None);
14178     PyTuple_SET_ITEM(__pyx_t_7, 2, Py_None);
14179     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
14180     __Pyx_GOTREF(__pyx_t_5);
14181     __Pyx_GIVEREF(__pyx_t_6);
14182     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
14183     __Pyx_GIVEREF(__pyx_t_7);
14184     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
14185     __Pyx_INCREF(__pyx_v_state);
14186     __Pyx_GIVEREF(__pyx_v_state);
14187     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
14188     __pyx_t_6 = 0;
14189     __pyx_t_7 = 0;
14190     __pyx_r = __pyx_t_5;
14191     __pyx_t_5 = 0;
14192     goto __pyx_L0;
14193 
14194     /* "(tree fragment)":12
14195  *     else:
14196  *         use_setstate = self.children is not None or self.summary is not None or self.tree is not None
14197  *     if use_setstate:             # <<<<<<<<<<<<<<
14198  *         return __pyx_unpickle_ArrayTreeNode, (type(self), 0xebb9478, None), state
14199  *     else:
14200  */
14201   }
14202 
14203   /* "(tree fragment)":15
14204  *         return __pyx_unpickle_ArrayTreeNode, (type(self), 0xebb9478, None), state
14205  *     else:
14206  *         return __pyx_unpickle_ArrayTreeNode, (type(self), 0xebb9478, state)             # <<<<<<<<<<<<<<
14207  * def __setstate_cython__(self, __pyx_state):
14208  *     __pyx_unpickle_ArrayTreeNode__set_state(self, __pyx_state)
14209  */
14210   /*else*/ {
14211     __Pyx_XDECREF(__pyx_r);
14212     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_ArrayTreeNode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
14213     __Pyx_GOTREF(__pyx_t_5);
14214     __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 15, __pyx_L1_error)
14215     __Pyx_GOTREF(__pyx_t_7);
14216     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
14217     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
14218     PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
14219     __Pyx_INCREF(__pyx_int_247174264);
14220     __Pyx_GIVEREF(__pyx_int_247174264);
14221     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_247174264);
14222     __Pyx_INCREF(__pyx_v_state);
14223     __Pyx_GIVEREF(__pyx_v_state);
14224     PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_state);
14225     __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
14226     __Pyx_GOTREF(__pyx_t_6);
14227     __Pyx_GIVEREF(__pyx_t_5);
14228     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
14229     __Pyx_GIVEREF(__pyx_t_7);
14230     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
14231     __pyx_t_5 = 0;
14232     __pyx_t_7 = 0;
14233     __pyx_r = __pyx_t_6;
14234     __pyx_t_6 = 0;
14235     goto __pyx_L0;
14236   }
14237 
14238   /* "(tree fragment)":1
14239  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
14240  *     cdef tuple state
14241  *     cdef object _dict
14242  */
14243 
14244   /* function exit code */
14245   __pyx_L1_error:;
14246   __Pyx_XDECREF(__pyx_t_1);
14247   __Pyx_XDECREF(__pyx_t_2);
14248   __Pyx_XDECREF(__pyx_t_3);
14249   __Pyx_XDECREF(__pyx_t_4);
14250   __Pyx_XDECREF(__pyx_t_5);
14251   __Pyx_XDECREF(__pyx_t_6);
14252   __Pyx_XDECREF(__pyx_t_7);
14253   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14254   __pyx_r = NULL;
14255   __pyx_L0:;
14256   __Pyx_XDECREF(__pyx_v_state);
14257   __Pyx_XDECREF(__pyx_v__dict);
14258   __Pyx_XGIVEREF(__pyx_r);
14259   __Pyx_RefNannyFinishContext();
14260   return __pyx_r;
14261 }
14262 
14263 /* "(tree fragment)":16
14264  *     else:
14265  *         return __pyx_unpickle_ArrayTreeNode, (type(self), 0xebb9478, state)
14266  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
14267  *     __pyx_unpickle_ArrayTreeNode__set_state(self, __pyx_state)
14268  */
14269 
14270 /* Python wrapper */
14271 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_19__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)14272 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14273   PyObject *__pyx_r = 0;
14274   __Pyx_RefNannyDeclarations
14275   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14276   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_18__setstate_cython__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14277 
14278   /* function exit code */
14279   __Pyx_RefNannyFinishContext();
14280   return __pyx_r;
14281 }
14282 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_18__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v_self,PyObject * __pyx_v___pyx_state)14283 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeNode_18__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14284   PyObject *__pyx_r = NULL;
14285   __Pyx_RefNannyDeclarations
14286   PyObject *__pyx_t_1 = NULL;
14287   int __pyx_lineno = 0;
14288   const char *__pyx_filename = NULL;
14289   int __pyx_clineno = 0;
14290   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14291 
14292   /* "(tree fragment)":17
14293  *         return __pyx_unpickle_ArrayTreeNode, (type(self), 0xebb9478, state)
14294  * def __setstate_cython__(self, __pyx_state):
14295  *     __pyx_unpickle_ArrayTreeNode__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
14296  */
14297   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
14298   __pyx_t_1 = __pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_ArrayTreeNode__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
14299   __Pyx_GOTREF(__pyx_t_1);
14300   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14301 
14302   /* "(tree fragment)":16
14303  *     else:
14304  *         return __pyx_unpickle_ArrayTreeNode, (type(self), 0xebb9478, state)
14305  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
14306  *     __pyx_unpickle_ArrayTreeNode__set_state(self, __pyx_state)
14307  */
14308 
14309   /* function exit code */
14310   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14311   goto __pyx_L0;
14312   __pyx_L1_error:;
14313   __Pyx_XDECREF(__pyx_t_1);
14314   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeNode.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14315   __pyx_r = NULL;
14316   __pyx_L0:;
14317   __Pyx_XGIVEREF(__pyx_r);
14318   __Pyx_RefNannyFinishContext();
14319   return __pyx_r;
14320 }
14321 
14322 /* "bx/arrays/array_tree.pyx":489
14323  *     cdef public long start_offset
14324  *
14325  *     def __init__( self, ArrayTree tree, int min, int max ):             # <<<<<<<<<<<<<<
14326  *         self.tree = tree
14327  *         self.min = min
14328  */
14329 
14330 /* Python wrapper */
14331 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)14332 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14333   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_tree = 0;
14334   int __pyx_v_min;
14335   int __pyx_v_max;
14336   int __pyx_lineno = 0;
14337   const char *__pyx_filename = NULL;
14338   int __pyx_clineno = 0;
14339   int __pyx_r;
14340   __Pyx_RefNannyDeclarations
14341   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
14342   {
14343     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tree,&__pyx_n_s_min,&__pyx_n_s_max,0};
14344     PyObject* values[3] = {0,0,0};
14345     if (unlikely(__pyx_kwds)) {
14346       Py_ssize_t kw_args;
14347       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14348       switch (pos_args) {
14349         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14350         CYTHON_FALLTHROUGH;
14351         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14352         CYTHON_FALLTHROUGH;
14353         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14354         CYTHON_FALLTHROUGH;
14355         case  0: break;
14356         default: goto __pyx_L5_argtuple_error;
14357       }
14358       kw_args = PyDict_Size(__pyx_kwds);
14359       switch (pos_args) {
14360         case  0:
14361         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tree)) != 0)) kw_args--;
14362         else goto __pyx_L5_argtuple_error;
14363         CYTHON_FALLTHROUGH;
14364         case  1:
14365         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min)) != 0)) kw_args--;
14366         else {
14367           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 489, __pyx_L3_error)
14368         }
14369         CYTHON_FALLTHROUGH;
14370         case  2:
14371         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max)) != 0)) kw_args--;
14372         else {
14373           __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 489, __pyx_L3_error)
14374         }
14375       }
14376       if (unlikely(kw_args > 0)) {
14377         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 489, __pyx_L3_error)
14378       }
14379     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
14380       goto __pyx_L5_argtuple_error;
14381     } else {
14382       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14383       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14384       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14385     }
14386     __pyx_v_tree = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)values[0]);
14387     __pyx_v_min = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_min == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 489, __pyx_L3_error)
14388     __pyx_v_max = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_max == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 489, __pyx_L3_error)
14389   }
14390   goto __pyx_L4_argument_unpacking_done;
14391   __pyx_L5_argtuple_error:;
14392   __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 489, __pyx_L3_error)
14393   __pyx_L3_error:;
14394   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeLeaf.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14395   __Pyx_RefNannyFinishContext();
14396   return -1;
14397   __pyx_L4_argument_unpacking_done:;
14398   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_2bx_6arrays_10array_tree_ArrayTree, 1, "tree", 0))) __PYX_ERR(0, 489, __pyx_L1_error)
14399   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf___init__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)__pyx_v_self), __pyx_v_tree, __pyx_v_min, __pyx_v_max);
14400 
14401   /* function exit code */
14402   goto __pyx_L0;
14403   __pyx_L1_error:;
14404   __pyx_r = -1;
14405   __pyx_L0:;
14406   __Pyx_RefNannyFinishContext();
14407   return __pyx_r;
14408 }
14409 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf___init__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf * __pyx_v_self,struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v_tree,int __pyx_v_min,int __pyx_v_max)14410 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf___init__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v_tree, int __pyx_v_min, int __pyx_v_max) {
14411   int __pyx_r;
14412   __Pyx_RefNannyDeclarations
14413   PyObject *__pyx_t_1 = NULL;
14414   PyObject *__pyx_t_2 = NULL;
14415   PyObject *__pyx_t_3 = NULL;
14416   PyObject *__pyx_t_4 = NULL;
14417   int __pyx_t_5;
14418   PyObject *__pyx_t_6 = NULL;
14419   int __pyx_lineno = 0;
14420   const char *__pyx_filename = NULL;
14421   int __pyx_clineno = 0;
14422   __Pyx_RefNannySetupContext("__init__", 0);
14423 
14424   /* "bx/arrays/array_tree.pyx":490
14425  *
14426  *     def __init__( self, ArrayTree tree, int min, int max ):
14427  *         self.tree = tree             # <<<<<<<<<<<<<<
14428  *         self.min = min
14429  *         self.max = max
14430  */
14431   __Pyx_INCREF(((PyObject *)__pyx_v_tree));
14432   __Pyx_GIVEREF(((PyObject *)__pyx_v_tree));
14433   __Pyx_GOTREF(__pyx_v_self->tree);
14434   __Pyx_DECREF(((PyObject *)__pyx_v_self->tree));
14435   __pyx_v_self->tree = __pyx_v_tree;
14436 
14437   /* "bx/arrays/array_tree.pyx":491
14438  *     def __init__( self, ArrayTree tree, int min, int max ):
14439  *         self.tree = tree
14440  *         self.min = min             # <<<<<<<<<<<<<<
14441  *         self.max = max
14442  *         self.frequency = 0
14443  */
14444   __pyx_v_self->min = __pyx_v_min;
14445 
14446   /* "bx/arrays/array_tree.pyx":492
14447  *         self.tree = tree
14448  *         self.min = min
14449  *         self.max = max             # <<<<<<<<<<<<<<
14450  *         self.frequency = 0
14451  *         self.values = empty( max - min, self.tree.dtype )
14452  */
14453   __pyx_v_self->max = __pyx_v_max;
14454 
14455   /* "bx/arrays/array_tree.pyx":493
14456  *         self.min = min
14457  *         self.max = max
14458  *         self.frequency = 0             # <<<<<<<<<<<<<<
14459  *         self.values = empty( max - min, self.tree.dtype )
14460  *         self.values[:] = nan
14461  */
14462   __pyx_v_self->frequency = 0;
14463 
14464   /* "bx/arrays/array_tree.pyx":494
14465  *         self.max = max
14466  *         self.frequency = 0
14467  *         self.values = empty( max - min, self.tree.dtype )             # <<<<<<<<<<<<<<
14468  *         self.values[:] = nan
14469  *         self.start_offset = 0
14470  */
14471   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
14472   __Pyx_GOTREF(__pyx_t_2);
14473   __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_max - __pyx_v_min)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error)
14474   __Pyx_GOTREF(__pyx_t_3);
14475   __pyx_t_4 = NULL;
14476   __pyx_t_5 = 0;
14477   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
14478     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
14479     if (likely(__pyx_t_4)) {
14480       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
14481       __Pyx_INCREF(__pyx_t_4);
14482       __Pyx_INCREF(function);
14483       __Pyx_DECREF_SET(__pyx_t_2, function);
14484       __pyx_t_5 = 1;
14485     }
14486   }
14487   #if CYTHON_FAST_PYCALL
14488   if (PyFunction_Check(__pyx_t_2)) {
14489     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_self->tree->dtype};
14490     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
14491     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14492     __Pyx_GOTREF(__pyx_t_1);
14493     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14494   } else
14495   #endif
14496   #if CYTHON_FAST_PYCCALL
14497   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
14498     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_self->tree->dtype};
14499     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
14500     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14501     __Pyx_GOTREF(__pyx_t_1);
14502     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14503   } else
14504   #endif
14505   {
14506     __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error)
14507     __Pyx_GOTREF(__pyx_t_6);
14508     if (__pyx_t_4) {
14509       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
14510     }
14511     __Pyx_GIVEREF(__pyx_t_3);
14512     PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
14513     __Pyx_INCREF(__pyx_v_self->tree->dtype);
14514     __Pyx_GIVEREF(__pyx_v_self->tree->dtype);
14515     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_self->tree->dtype);
14516     __pyx_t_3 = 0;
14517     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
14518     __Pyx_GOTREF(__pyx_t_1);
14519     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14520   }
14521   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14522   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 494, __pyx_L1_error)
14523   __Pyx_GIVEREF(__pyx_t_1);
14524   __Pyx_GOTREF(__pyx_v_self->values);
14525   __Pyx_DECREF(((PyObject *)__pyx_v_self->values));
14526   __pyx_v_self->values = ((PyArrayObject *)__pyx_t_1);
14527   __pyx_t_1 = 0;
14528 
14529   /* "bx/arrays/array_tree.pyx":495
14530  *         self.frequency = 0
14531  *         self.values = empty( max - min, self.tree.dtype )
14532  *         self.values[:] = nan             # <<<<<<<<<<<<<<
14533  *         self.start_offset = 0
14534  *
14535  */
14536   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error)
14537   __Pyx_GOTREF(__pyx_t_1);
14538   if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_self->values), __pyx_t_1, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1) < 0) __PYX_ERR(0, 495, __pyx_L1_error)
14539   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14540 
14541   /* "bx/arrays/array_tree.pyx":496
14542  *         self.values = empty( max - min, self.tree.dtype )
14543  *         self.values[:] = nan
14544  *         self.start_offset = 0             # <<<<<<<<<<<<<<
14545  *
14546  *     def set( self, index, value ):
14547  */
14548   __pyx_v_self->start_offset = 0;
14549 
14550   /* "bx/arrays/array_tree.pyx":489
14551  *     cdef public long start_offset
14552  *
14553  *     def __init__( self, ArrayTree tree, int min, int max ):             # <<<<<<<<<<<<<<
14554  *         self.tree = tree
14555  *         self.min = min
14556  */
14557 
14558   /* function exit code */
14559   __pyx_r = 0;
14560   goto __pyx_L0;
14561   __pyx_L1_error:;
14562   __Pyx_XDECREF(__pyx_t_1);
14563   __Pyx_XDECREF(__pyx_t_2);
14564   __Pyx_XDECREF(__pyx_t_3);
14565   __Pyx_XDECREF(__pyx_t_4);
14566   __Pyx_XDECREF(__pyx_t_6);
14567   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeLeaf.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14568   __pyx_r = -1;
14569   __pyx_L0:;
14570   __Pyx_RefNannyFinishContext();
14571   return __pyx_r;
14572 }
14573 
14574 /* "bx/arrays/array_tree.pyx":498
14575  *         self.start_offset = 0
14576  *
14577  *     def set( self, index, value ):             # <<<<<<<<<<<<<<
14578  *         self.frequency += 1
14579  *         self.values[ index - self.min ] = value
14580  */
14581 
14582 /* Python wrapper */
14583 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_3set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_3set(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)14584 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_3set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14585   PyObject *__pyx_v_index = 0;
14586   PyObject *__pyx_v_value = 0;
14587   int __pyx_lineno = 0;
14588   const char *__pyx_filename = NULL;
14589   int __pyx_clineno = 0;
14590   PyObject *__pyx_r = 0;
14591   __Pyx_RefNannyDeclarations
14592   __Pyx_RefNannySetupContext("set (wrapper)", 0);
14593   {
14594     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_value,0};
14595     PyObject* values[2] = {0,0};
14596     if (unlikely(__pyx_kwds)) {
14597       Py_ssize_t kw_args;
14598       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14599       switch (pos_args) {
14600         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14601         CYTHON_FALLTHROUGH;
14602         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14603         CYTHON_FALLTHROUGH;
14604         case  0: break;
14605         default: goto __pyx_L5_argtuple_error;
14606       }
14607       kw_args = PyDict_Size(__pyx_kwds);
14608       switch (pos_args) {
14609         case  0:
14610         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
14611         else goto __pyx_L5_argtuple_error;
14612         CYTHON_FALLTHROUGH;
14613         case  1:
14614         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
14615         else {
14616           __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); __PYX_ERR(0, 498, __pyx_L3_error)
14617         }
14618       }
14619       if (unlikely(kw_args > 0)) {
14620         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(0, 498, __pyx_L3_error)
14621       }
14622     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
14623       goto __pyx_L5_argtuple_error;
14624     } else {
14625       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14626       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14627     }
14628     __pyx_v_index = values[0];
14629     __pyx_v_value = values[1];
14630   }
14631   goto __pyx_L4_argument_unpacking_done;
14632   __pyx_L5_argtuple_error:;
14633   __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 498, __pyx_L3_error)
14634   __pyx_L3_error:;
14635   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeLeaf.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
14636   __Pyx_RefNannyFinishContext();
14637   return NULL;
14638   __pyx_L4_argument_unpacking_done:;
14639   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_2set(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)__pyx_v_self), __pyx_v_index, __pyx_v_value);
14640 
14641   /* function exit code */
14642   __Pyx_RefNannyFinishContext();
14643   return __pyx_r;
14644 }
14645 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_2set(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)14646 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_2set(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
14647   PyObject *__pyx_r = NULL;
14648   __Pyx_RefNannyDeclarations
14649   PyObject *__pyx_t_1 = NULL;
14650   PyObject *__pyx_t_2 = NULL;
14651   int __pyx_lineno = 0;
14652   const char *__pyx_filename = NULL;
14653   int __pyx_clineno = 0;
14654   __Pyx_RefNannySetupContext("set", 0);
14655 
14656   /* "bx/arrays/array_tree.pyx":499
14657  *
14658  *     def set( self, index, value ):
14659  *         self.frequency += 1             # <<<<<<<<<<<<<<
14660  *         self.values[ index - self.min ] = value
14661  *
14662  */
14663   __pyx_v_self->frequency = (__pyx_v_self->frequency + 1);
14664 
14665   /* "bx/arrays/array_tree.pyx":500
14666  *     def set( self, index, value ):
14667  *         self.frequency += 1
14668  *         self.values[ index - self.min ] = value             # <<<<<<<<<<<<<<
14669  *
14670  *     def get( self, index ):
14671  */
14672   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->min); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error)
14673   __Pyx_GOTREF(__pyx_t_1);
14674   __pyx_t_2 = PyNumber_Subtract(__pyx_v_index, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error)
14675   __Pyx_GOTREF(__pyx_t_2);
14676   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14677   if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->values), __pyx_t_2, __pyx_v_value) < 0)) __PYX_ERR(0, 500, __pyx_L1_error)
14678   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14679 
14680   /* "bx/arrays/array_tree.pyx":498
14681  *         self.start_offset = 0
14682  *
14683  *     def set( self, index, value ):             # <<<<<<<<<<<<<<
14684  *         self.frequency += 1
14685  *         self.values[ index - self.min ] = value
14686  */
14687 
14688   /* function exit code */
14689   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14690   goto __pyx_L0;
14691   __pyx_L1_error:;
14692   __Pyx_XDECREF(__pyx_t_1);
14693   __Pyx_XDECREF(__pyx_t_2);
14694   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeLeaf.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
14695   __pyx_r = NULL;
14696   __pyx_L0:;
14697   __Pyx_XGIVEREF(__pyx_r);
14698   __Pyx_RefNannyFinishContext();
14699   return __pyx_r;
14700 }
14701 
14702 /* "bx/arrays/array_tree.pyx":502
14703  *         self.values[ index - self.min ] = value
14704  *
14705  *     def get( self, index ):             # <<<<<<<<<<<<<<
14706  *         return self.values[ index - self.min ]
14707  *
14708  */
14709 
14710 /* Python wrapper */
14711 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_5get(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_5get(PyObject * __pyx_v_self,PyObject * __pyx_v_index)14712 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_5get(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
14713   PyObject *__pyx_r = 0;
14714   __Pyx_RefNannyDeclarations
14715   __Pyx_RefNannySetupContext("get (wrapper)", 0);
14716   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_4get(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)__pyx_v_self), ((PyObject *)__pyx_v_index));
14717 
14718   /* function exit code */
14719   __Pyx_RefNannyFinishContext();
14720   return __pyx_r;
14721 }
14722 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_4get(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf * __pyx_v_self,PyObject * __pyx_v_index)14723 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_4get(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, PyObject *__pyx_v_index) {
14724   PyObject *__pyx_r = NULL;
14725   __Pyx_RefNannyDeclarations
14726   PyObject *__pyx_t_1 = NULL;
14727   PyObject *__pyx_t_2 = NULL;
14728   int __pyx_lineno = 0;
14729   const char *__pyx_filename = NULL;
14730   int __pyx_clineno = 0;
14731   __Pyx_RefNannySetupContext("get", 0);
14732 
14733   /* "bx/arrays/array_tree.pyx":503
14734  *
14735  *     def get( self, index ):
14736  *         return self.values[ index - self.min ]             # <<<<<<<<<<<<<<
14737  *
14738  *     def to_file_data_pass( self, io, level ):
14739  */
14740   __Pyx_XDECREF(__pyx_r);
14741   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->min); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
14742   __Pyx_GOTREF(__pyx_t_1);
14743   __pyx_t_2 = PyNumber_Subtract(__pyx_v_index, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
14744   __Pyx_GOTREF(__pyx_t_2);
14745   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14746   __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->values), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
14747   __Pyx_GOTREF(__pyx_t_1);
14748   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14749   __pyx_r = __pyx_t_1;
14750   __pyx_t_1 = 0;
14751   goto __pyx_L0;
14752 
14753   /* "bx/arrays/array_tree.pyx":502
14754  *         self.values[ index - self.min ] = value
14755  *
14756  *     def get( self, index ):             # <<<<<<<<<<<<<<
14757  *         return self.values[ index - self.min ]
14758  *
14759  */
14760 
14761   /* function exit code */
14762   __pyx_L1_error:;
14763   __Pyx_XDECREF(__pyx_t_1);
14764   __Pyx_XDECREF(__pyx_t_2);
14765   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeLeaf.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
14766   __pyx_r = NULL;
14767   __pyx_L0:;
14768   __Pyx_XGIVEREF(__pyx_r);
14769   __Pyx_RefNannyFinishContext();
14770   return __pyx_r;
14771 }
14772 
14773 /* "bx/arrays/array_tree.pyx":505
14774  *         return self.values[ index - self.min ]
14775  *
14776  *     def to_file_data_pass( self, io, level ):             # <<<<<<<<<<<<<<
14777  *         assert level == 0
14778  *         self.start_offset = io.tell()
14779  */
14780 
14781 /* Python wrapper */
14782 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_7to_file_data_pass(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_7to_file_data_pass(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)14783 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_7to_file_data_pass(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14784   PyObject *__pyx_v_io = 0;
14785   PyObject *__pyx_v_level = 0;
14786   int __pyx_lineno = 0;
14787   const char *__pyx_filename = NULL;
14788   int __pyx_clineno = 0;
14789   PyObject *__pyx_r = 0;
14790   __Pyx_RefNannyDeclarations
14791   __Pyx_RefNannySetupContext("to_file_data_pass (wrapper)", 0);
14792   {
14793     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_io,&__pyx_n_s_level,0};
14794     PyObject* values[2] = {0,0};
14795     if (unlikely(__pyx_kwds)) {
14796       Py_ssize_t kw_args;
14797       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14798       switch (pos_args) {
14799         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14800         CYTHON_FALLTHROUGH;
14801         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14802         CYTHON_FALLTHROUGH;
14803         case  0: break;
14804         default: goto __pyx_L5_argtuple_error;
14805       }
14806       kw_args = PyDict_Size(__pyx_kwds);
14807       switch (pos_args) {
14808         case  0:
14809         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_io)) != 0)) kw_args--;
14810         else goto __pyx_L5_argtuple_error;
14811         CYTHON_FALLTHROUGH;
14812         case  1:
14813         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
14814         else {
14815           __Pyx_RaiseArgtupleInvalid("to_file_data_pass", 1, 2, 2, 1); __PYX_ERR(0, 505, __pyx_L3_error)
14816         }
14817       }
14818       if (unlikely(kw_args > 0)) {
14819         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_file_data_pass") < 0)) __PYX_ERR(0, 505, __pyx_L3_error)
14820       }
14821     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
14822       goto __pyx_L5_argtuple_error;
14823     } else {
14824       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14825       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14826     }
14827     __pyx_v_io = values[0];
14828     __pyx_v_level = values[1];
14829   }
14830   goto __pyx_L4_argument_unpacking_done;
14831   __pyx_L5_argtuple_error:;
14832   __Pyx_RaiseArgtupleInvalid("to_file_data_pass", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 505, __pyx_L3_error)
14833   __pyx_L3_error:;
14834   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeLeaf.to_file_data_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
14835   __Pyx_RefNannyFinishContext();
14836   return NULL;
14837   __pyx_L4_argument_unpacking_done:;
14838   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6to_file_data_pass(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)__pyx_v_self), __pyx_v_io, __pyx_v_level);
14839 
14840   /* function exit code */
14841   __Pyx_RefNannyFinishContext();
14842   return __pyx_r;
14843 }
14844 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6to_file_data_pass(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf * __pyx_v_self,PyObject * __pyx_v_io,PyObject * __pyx_v_level)14845 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6to_file_data_pass(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, PyObject *__pyx_v_io, PyObject *__pyx_v_level) {
14846   PyObject *__pyx_r = NULL;
14847   __Pyx_RefNannyDeclarations
14848   PyObject *__pyx_t_1 = NULL;
14849   int __pyx_t_2;
14850   PyObject *__pyx_t_3 = NULL;
14851   PyObject *__pyx_t_4 = NULL;
14852   long __pyx_t_5;
14853   int __pyx_lineno = 0;
14854   const char *__pyx_filename = NULL;
14855   int __pyx_clineno = 0;
14856   __Pyx_RefNannySetupContext("to_file_data_pass", 0);
14857 
14858   /* "bx/arrays/array_tree.pyx":506
14859  *
14860  *     def to_file_data_pass( self, io, level ):
14861  *         assert level == 0             # <<<<<<<<<<<<<<
14862  *         self.start_offset = io.tell()
14863  *         io.write_raw_array( self.values )
14864  */
14865   #ifndef CYTHON_WITHOUT_ASSERTIONS
14866   if (unlikely(!Py_OptimizeFlag)) {
14867     __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_level, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error)
14868     __Pyx_GOTREF(__pyx_t_1);
14869     __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 506, __pyx_L1_error)
14870     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14871     if (unlikely(!__pyx_t_2)) {
14872       PyErr_SetNone(PyExc_AssertionError);
14873       __PYX_ERR(0, 506, __pyx_L1_error)
14874     }
14875   }
14876   #endif
14877 
14878   /* "bx/arrays/array_tree.pyx":507
14879  *     def to_file_data_pass( self, io, level ):
14880  *         assert level == 0
14881  *         self.start_offset = io.tell()             # <<<<<<<<<<<<<<
14882  *         io.write_raw_array( self.values )
14883  *
14884  */
14885   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_tell); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
14886   __Pyx_GOTREF(__pyx_t_3);
14887   __pyx_t_4 = NULL;
14888   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
14889     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
14890     if (likely(__pyx_t_4)) {
14891       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
14892       __Pyx_INCREF(__pyx_t_4);
14893       __Pyx_INCREF(function);
14894       __Pyx_DECREF_SET(__pyx_t_3, function);
14895     }
14896   }
14897   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
14898   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14899   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
14900   __Pyx_GOTREF(__pyx_t_1);
14901   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14902   __pyx_t_5 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 507, __pyx_L1_error)
14903   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14904   __pyx_v_self->start_offset = __pyx_t_5;
14905 
14906   /* "bx/arrays/array_tree.pyx":508
14907  *         assert level == 0
14908  *         self.start_offset = io.tell()
14909  *         io.write_raw_array( self.values )             # <<<<<<<<<<<<<<
14910  *
14911  *     def to_file_offset_pass( self, io ):
14912  */
14913   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_write_raw_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
14914   __Pyx_GOTREF(__pyx_t_3);
14915   __pyx_t_4 = NULL;
14916   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
14917     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
14918     if (likely(__pyx_t_4)) {
14919       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
14920       __Pyx_INCREF(__pyx_t_4);
14921       __Pyx_INCREF(function);
14922       __Pyx_DECREF_SET(__pyx_t_3, function);
14923     }
14924   }
14925   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_self->values)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self->values));
14926   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14927   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
14928   __Pyx_GOTREF(__pyx_t_1);
14929   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14930   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14931 
14932   /* "bx/arrays/array_tree.pyx":505
14933  *         return self.values[ index - self.min ]
14934  *
14935  *     def to_file_data_pass( self, io, level ):             # <<<<<<<<<<<<<<
14936  *         assert level == 0
14937  *         self.start_offset = io.tell()
14938  */
14939 
14940   /* function exit code */
14941   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14942   goto __pyx_L0;
14943   __pyx_L1_error:;
14944   __Pyx_XDECREF(__pyx_t_1);
14945   __Pyx_XDECREF(__pyx_t_3);
14946   __Pyx_XDECREF(__pyx_t_4);
14947   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeLeaf.to_file_data_pass", __pyx_clineno, __pyx_lineno, __pyx_filename);
14948   __pyx_r = NULL;
14949   __pyx_L0:;
14950   __Pyx_XGIVEREF(__pyx_r);
14951   __Pyx_RefNannyFinishContext();
14952   return __pyx_r;
14953 }
14954 
14955 /* "bx/arrays/array_tree.pyx":510
14956  *         io.write_raw_array( self.values )
14957  *
14958  *     def to_file_offset_pass( self, io ):             # <<<<<<<<<<<<<<
14959  *         pass
14960  *
14961  */
14962 
14963 /* Python wrapper */
14964 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9to_file_offset_pass(PyObject *__pyx_v_self, PyObject *__pyx_v_io); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9to_file_offset_pass(PyObject * __pyx_v_self,PyObject * __pyx_v_io)14965 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9to_file_offset_pass(PyObject *__pyx_v_self, PyObject *__pyx_v_io) {
14966   PyObject *__pyx_r = 0;
14967   __Pyx_RefNannyDeclarations
14968   __Pyx_RefNannySetupContext("to_file_offset_pass (wrapper)", 0);
14969   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_8to_file_offset_pass(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)__pyx_v_self), ((PyObject *)__pyx_v_io));
14970 
14971   /* function exit code */
14972   __Pyx_RefNannyFinishContext();
14973   return __pyx_r;
14974 }
14975 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_8to_file_offset_pass(CYTHON_UNUSED struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v_io)14976 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_8to_file_offset_pass(CYTHON_UNUSED struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_io) {
14977   PyObject *__pyx_r = NULL;
14978   __Pyx_RefNannyDeclarations
14979   __Pyx_RefNannySetupContext("to_file_offset_pass", 0);
14980 
14981   /* function exit code */
14982   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14983   __Pyx_XGIVEREF(__pyx_r);
14984   __Pyx_RefNannyFinishContext();
14985   return __pyx_r;
14986 }
14987 
14988 /* "bx/arrays/array_tree.pyx":513
14989  *         pass
14990  *
14991  *     def from_file( self, io ):             # <<<<<<<<<<<<<<
14992  *         self.values = io.read_raw_array( self.tree.dtype, self.tree.block_size )
14993  */
14994 
14995 /* Python wrapper */
14996 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_11from_file(PyObject *__pyx_v_self, PyObject *__pyx_v_io); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_11from_file(PyObject * __pyx_v_self,PyObject * __pyx_v_io)14997 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_11from_file(PyObject *__pyx_v_self, PyObject *__pyx_v_io) {
14998   PyObject *__pyx_r = 0;
14999   __Pyx_RefNannyDeclarations
15000   __Pyx_RefNannySetupContext("from_file (wrapper)", 0);
15001   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_10from_file(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)__pyx_v_self), ((PyObject *)__pyx_v_io));
15002 
15003   /* function exit code */
15004   __Pyx_RefNannyFinishContext();
15005   return __pyx_r;
15006 }
15007 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_10from_file(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf * __pyx_v_self,PyObject * __pyx_v_io)15008 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_10from_file(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, PyObject *__pyx_v_io) {
15009   PyObject *__pyx_r = NULL;
15010   __Pyx_RefNannyDeclarations
15011   PyObject *__pyx_t_1 = NULL;
15012   PyObject *__pyx_t_2 = NULL;
15013   PyObject *__pyx_t_3 = NULL;
15014   PyObject *__pyx_t_4 = NULL;
15015   int __pyx_t_5;
15016   PyObject *__pyx_t_6 = NULL;
15017   int __pyx_lineno = 0;
15018   const char *__pyx_filename = NULL;
15019   int __pyx_clineno = 0;
15020   __Pyx_RefNannySetupContext("from_file", 0);
15021 
15022   /* "bx/arrays/array_tree.pyx":514
15023  *
15024  *     def from_file( self, io ):
15025  *         self.values = io.read_raw_array( self.tree.dtype, self.tree.block_size )             # <<<<<<<<<<<<<<
15026  */
15027   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_read_raw_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
15028   __Pyx_GOTREF(__pyx_t_2);
15029   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->tree->block_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error)
15030   __Pyx_GOTREF(__pyx_t_3);
15031   __pyx_t_4 = NULL;
15032   __pyx_t_5 = 0;
15033   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
15034     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
15035     if (likely(__pyx_t_4)) {
15036       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
15037       __Pyx_INCREF(__pyx_t_4);
15038       __Pyx_INCREF(function);
15039       __Pyx_DECREF_SET(__pyx_t_2, function);
15040       __pyx_t_5 = 1;
15041     }
15042   }
15043   #if CYTHON_FAST_PYCALL
15044   if (PyFunction_Check(__pyx_t_2)) {
15045     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_self->tree->dtype, __pyx_t_3};
15046     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
15047     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15048     __Pyx_GOTREF(__pyx_t_1);
15049     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15050   } else
15051   #endif
15052   #if CYTHON_FAST_PYCCALL
15053   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
15054     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_self->tree->dtype, __pyx_t_3};
15055     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
15056     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15057     __Pyx_GOTREF(__pyx_t_1);
15058     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15059   } else
15060   #endif
15061   {
15062     __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error)
15063     __Pyx_GOTREF(__pyx_t_6);
15064     if (__pyx_t_4) {
15065       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
15066     }
15067     __Pyx_INCREF(__pyx_v_self->tree->dtype);
15068     __Pyx_GIVEREF(__pyx_v_self->tree->dtype);
15069     PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_self->tree->dtype);
15070     __Pyx_GIVEREF(__pyx_t_3);
15071     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
15072     __pyx_t_3 = 0;
15073     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
15074     __Pyx_GOTREF(__pyx_t_1);
15075     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15076   }
15077   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15078   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 514, __pyx_L1_error)
15079   __Pyx_GIVEREF(__pyx_t_1);
15080   __Pyx_GOTREF(__pyx_v_self->values);
15081   __Pyx_DECREF(((PyObject *)__pyx_v_self->values));
15082   __pyx_v_self->values = ((PyArrayObject *)__pyx_t_1);
15083   __pyx_t_1 = 0;
15084 
15085   /* "bx/arrays/array_tree.pyx":513
15086  *         pass
15087  *
15088  *     def from_file( self, io ):             # <<<<<<<<<<<<<<
15089  *         self.values = io.read_raw_array( self.tree.dtype, self.tree.block_size )
15090  */
15091 
15092   /* function exit code */
15093   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15094   goto __pyx_L0;
15095   __pyx_L1_error:;
15096   __Pyx_XDECREF(__pyx_t_1);
15097   __Pyx_XDECREF(__pyx_t_2);
15098   __Pyx_XDECREF(__pyx_t_3);
15099   __Pyx_XDECREF(__pyx_t_4);
15100   __Pyx_XDECREF(__pyx_t_6);
15101   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeLeaf.from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
15102   __pyx_r = NULL;
15103   __pyx_L0:;
15104   __Pyx_XGIVEREF(__pyx_r);
15105   __Pyx_RefNannyFinishContext();
15106   return __pyx_r;
15107 }
15108 
15109 /* "bx/arrays/array_tree.pyx":485
15110  *     cdef int min
15111  *     cdef int max
15112  *     cdef public int frequency             # <<<<<<<<<<<<<<
15113  *     cdef public numpy.ndarray values
15114  *     cdef public long start_offset
15115  */
15116 
15117 /* Python wrapper */
15118 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9frequency_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9frequency_1__get__(PyObject * __pyx_v_self)15119 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9frequency_1__get__(PyObject *__pyx_v_self) {
15120   PyObject *__pyx_r = 0;
15121   __Pyx_RefNannyDeclarations
15122   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15123   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9frequency___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)__pyx_v_self));
15124 
15125   /* function exit code */
15126   __Pyx_RefNannyFinishContext();
15127   return __pyx_r;
15128 }
15129 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9frequency___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf * __pyx_v_self)15130 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9frequency___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self) {
15131   PyObject *__pyx_r = NULL;
15132   __Pyx_RefNannyDeclarations
15133   PyObject *__pyx_t_1 = NULL;
15134   int __pyx_lineno = 0;
15135   const char *__pyx_filename = NULL;
15136   int __pyx_clineno = 0;
15137   __Pyx_RefNannySetupContext("__get__", 0);
15138   __Pyx_XDECREF(__pyx_r);
15139   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->frequency); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error)
15140   __Pyx_GOTREF(__pyx_t_1);
15141   __pyx_r = __pyx_t_1;
15142   __pyx_t_1 = 0;
15143   goto __pyx_L0;
15144 
15145   /* function exit code */
15146   __pyx_L1_error:;
15147   __Pyx_XDECREF(__pyx_t_1);
15148   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeLeaf.frequency.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15149   __pyx_r = NULL;
15150   __pyx_L0:;
15151   __Pyx_XGIVEREF(__pyx_r);
15152   __Pyx_RefNannyFinishContext();
15153   return __pyx_r;
15154 }
15155 
15156 /* Python wrapper */
15157 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9frequency_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9frequency_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)15158 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9frequency_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
15159   int __pyx_r;
15160   __Pyx_RefNannyDeclarations
15161   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
15162   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9frequency_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)__pyx_v_self), ((PyObject *)__pyx_v_value));
15163 
15164   /* function exit code */
15165   __Pyx_RefNannyFinishContext();
15166   return __pyx_r;
15167 }
15168 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9frequency_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf * __pyx_v_self,PyObject * __pyx_v_value)15169 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9frequency_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, PyObject *__pyx_v_value) {
15170   int __pyx_r;
15171   __Pyx_RefNannyDeclarations
15172   int __pyx_t_1;
15173   int __pyx_lineno = 0;
15174   const char *__pyx_filename = NULL;
15175   int __pyx_clineno = 0;
15176   __Pyx_RefNannySetupContext("__set__", 0);
15177   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 485, __pyx_L1_error)
15178   __pyx_v_self->frequency = __pyx_t_1;
15179 
15180   /* function exit code */
15181   __pyx_r = 0;
15182   goto __pyx_L0;
15183   __pyx_L1_error:;
15184   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeLeaf.frequency.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15185   __pyx_r = -1;
15186   __pyx_L0:;
15187   __Pyx_RefNannyFinishContext();
15188   return __pyx_r;
15189 }
15190 
15191 /* "bx/arrays/array_tree.pyx":486
15192  *     cdef int max
15193  *     cdef public int frequency
15194  *     cdef public numpy.ndarray values             # <<<<<<<<<<<<<<
15195  *     cdef public long start_offset
15196  *
15197  */
15198 
15199 /* Python wrapper */
15200 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_1__get__(PyObject * __pyx_v_self)15201 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_1__get__(PyObject *__pyx_v_self) {
15202   PyObject *__pyx_r = 0;
15203   __Pyx_RefNannyDeclarations
15204   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15205   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)__pyx_v_self));
15206 
15207   /* function exit code */
15208   __Pyx_RefNannyFinishContext();
15209   return __pyx_r;
15210 }
15211 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf * __pyx_v_self)15212 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self) {
15213   PyObject *__pyx_r = NULL;
15214   __Pyx_RefNannyDeclarations
15215   __Pyx_RefNannySetupContext("__get__", 0);
15216   __Pyx_XDECREF(__pyx_r);
15217   __Pyx_INCREF(((PyObject *)__pyx_v_self->values));
15218   __pyx_r = ((PyObject *)__pyx_v_self->values);
15219   goto __pyx_L0;
15220 
15221   /* function exit code */
15222   __pyx_L0:;
15223   __Pyx_XGIVEREF(__pyx_r);
15224   __Pyx_RefNannyFinishContext();
15225   return __pyx_r;
15226 }
15227 
15228 /* Python wrapper */
15229 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)15230 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
15231   int __pyx_r;
15232   __Pyx_RefNannyDeclarations
15233   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
15234   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)__pyx_v_self), ((PyObject *)__pyx_v_value));
15235 
15236   /* function exit code */
15237   __Pyx_RefNannyFinishContext();
15238   return __pyx_r;
15239 }
15240 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf * __pyx_v_self,PyObject * __pyx_v_value)15241 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, PyObject *__pyx_v_value) {
15242   int __pyx_r;
15243   __Pyx_RefNannyDeclarations
15244   PyObject *__pyx_t_1 = NULL;
15245   int __pyx_lineno = 0;
15246   const char *__pyx_filename = NULL;
15247   int __pyx_clineno = 0;
15248   __Pyx_RefNannySetupContext("__set__", 0);
15249   if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 486, __pyx_L1_error)
15250   __pyx_t_1 = __pyx_v_value;
15251   __Pyx_INCREF(__pyx_t_1);
15252   __Pyx_GIVEREF(__pyx_t_1);
15253   __Pyx_GOTREF(__pyx_v_self->values);
15254   __Pyx_DECREF(((PyObject *)__pyx_v_self->values));
15255   __pyx_v_self->values = ((PyArrayObject *)__pyx_t_1);
15256   __pyx_t_1 = 0;
15257 
15258   /* function exit code */
15259   __pyx_r = 0;
15260   goto __pyx_L0;
15261   __pyx_L1_error:;
15262   __Pyx_XDECREF(__pyx_t_1);
15263   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeLeaf.values.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15264   __pyx_r = -1;
15265   __pyx_L0:;
15266   __Pyx_RefNannyFinishContext();
15267   return __pyx_r;
15268 }
15269 
15270 /* Python wrapper */
15271 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_5__del__(PyObject * __pyx_v_self)15272 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_5__del__(PyObject *__pyx_v_self) {
15273   int __pyx_r;
15274   __Pyx_RefNannyDeclarations
15275   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
15276   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_4__del__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)__pyx_v_self));
15277 
15278   /* function exit code */
15279   __Pyx_RefNannyFinishContext();
15280   return __pyx_r;
15281 }
15282 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf * __pyx_v_self)15283 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_4__del__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self) {
15284   int __pyx_r;
15285   __Pyx_RefNannyDeclarations
15286   __Pyx_RefNannySetupContext("__del__", 0);
15287   __Pyx_INCREF(Py_None);
15288   __Pyx_GIVEREF(Py_None);
15289   __Pyx_GOTREF(__pyx_v_self->values);
15290   __Pyx_DECREF(((PyObject *)__pyx_v_self->values));
15291   __pyx_v_self->values = ((PyArrayObject *)Py_None);
15292 
15293   /* function exit code */
15294   __pyx_r = 0;
15295   __Pyx_RefNannyFinishContext();
15296   return __pyx_r;
15297 }
15298 
15299 /* "bx/arrays/array_tree.pyx":487
15300  *     cdef public int frequency
15301  *     cdef public numpy.ndarray values
15302  *     cdef public long start_offset             # <<<<<<<<<<<<<<
15303  *
15304  *     def __init__( self, ArrayTree tree, int min, int max ):
15305  */
15306 
15307 /* Python wrapper */
15308 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12start_offset_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12start_offset_1__get__(PyObject * __pyx_v_self)15309 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12start_offset_1__get__(PyObject *__pyx_v_self) {
15310   PyObject *__pyx_r = 0;
15311   __Pyx_RefNannyDeclarations
15312   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15313   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12start_offset___get__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)__pyx_v_self));
15314 
15315   /* function exit code */
15316   __Pyx_RefNannyFinishContext();
15317   return __pyx_r;
15318 }
15319 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12start_offset___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf * __pyx_v_self)15320 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12start_offset___get__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self) {
15321   PyObject *__pyx_r = NULL;
15322   __Pyx_RefNannyDeclarations
15323   PyObject *__pyx_t_1 = NULL;
15324   int __pyx_lineno = 0;
15325   const char *__pyx_filename = NULL;
15326   int __pyx_clineno = 0;
15327   __Pyx_RefNannySetupContext("__get__", 0);
15328   __Pyx_XDECREF(__pyx_r);
15329   __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->start_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error)
15330   __Pyx_GOTREF(__pyx_t_1);
15331   __pyx_r = __pyx_t_1;
15332   __pyx_t_1 = 0;
15333   goto __pyx_L0;
15334 
15335   /* function exit code */
15336   __pyx_L1_error:;
15337   __Pyx_XDECREF(__pyx_t_1);
15338   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeLeaf.start_offset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15339   __pyx_r = NULL;
15340   __pyx_L0:;
15341   __Pyx_XGIVEREF(__pyx_r);
15342   __Pyx_RefNannyFinishContext();
15343   return __pyx_r;
15344 }
15345 
15346 /* Python wrapper */
15347 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12start_offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12start_offset_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)15348 static int __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12start_offset_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
15349   int __pyx_r;
15350   __Pyx_RefNannyDeclarations
15351   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
15352   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12start_offset_2__set__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)__pyx_v_self), ((PyObject *)__pyx_v_value));
15353 
15354   /* function exit code */
15355   __Pyx_RefNannyFinishContext();
15356   return __pyx_r;
15357 }
15358 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12start_offset_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf * __pyx_v_self,PyObject * __pyx_v_value)15359 static int __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12start_offset_2__set__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, PyObject *__pyx_v_value) {
15360   int __pyx_r;
15361   __Pyx_RefNannyDeclarations
15362   long __pyx_t_1;
15363   int __pyx_lineno = 0;
15364   const char *__pyx_filename = NULL;
15365   int __pyx_clineno = 0;
15366   __Pyx_RefNannySetupContext("__set__", 0);
15367   __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_value); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 487, __pyx_L1_error)
15368   __pyx_v_self->start_offset = __pyx_t_1;
15369 
15370   /* function exit code */
15371   __pyx_r = 0;
15372   goto __pyx_L0;
15373   __pyx_L1_error:;
15374   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeLeaf.start_offset.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15375   __pyx_r = -1;
15376   __pyx_L0:;
15377   __Pyx_RefNannyFinishContext();
15378   return __pyx_r;
15379 }
15380 
15381 /* "(tree fragment)":1
15382  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
15383  *     cdef tuple state
15384  *     cdef object _dict
15385  */
15386 
15387 /* Python wrapper */
15388 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_13__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)15389 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15390   PyObject *__pyx_r = 0;
15391   __Pyx_RefNannyDeclarations
15392   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
15393   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12__reduce_cython__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)__pyx_v_self));
15394 
15395   /* function exit code */
15396   __Pyx_RefNannyFinishContext();
15397   return __pyx_r;
15398 }
15399 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12__reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf * __pyx_v_self)15400 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12__reduce_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self) {
15401   PyObject *__pyx_v_state = 0;
15402   PyObject *__pyx_v__dict = 0;
15403   int __pyx_v_use_setstate;
15404   PyObject *__pyx_r = NULL;
15405   __Pyx_RefNannyDeclarations
15406   PyObject *__pyx_t_1 = NULL;
15407   PyObject *__pyx_t_2 = NULL;
15408   PyObject *__pyx_t_3 = NULL;
15409   PyObject *__pyx_t_4 = NULL;
15410   PyObject *__pyx_t_5 = NULL;
15411   int __pyx_t_6;
15412   int __pyx_t_7;
15413   int __pyx_t_8;
15414   int __pyx_lineno = 0;
15415   const char *__pyx_filename = NULL;
15416   int __pyx_clineno = 0;
15417   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
15418 
15419   /* "(tree fragment)":5
15420  *     cdef object _dict
15421  *     cdef bint use_setstate
15422  *     state = (self.frequency, self.max, self.min, self.start_offset, self.tree, self.values)             # <<<<<<<<<<<<<<
15423  *     _dict = getattr(self, '__dict__', None)
15424  *     if _dict is not None:
15425  */
15426   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->frequency); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
15427   __Pyx_GOTREF(__pyx_t_1);
15428   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->max); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
15429   __Pyx_GOTREF(__pyx_t_2);
15430   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->min); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
15431   __Pyx_GOTREF(__pyx_t_3);
15432   __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_self->start_offset); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
15433   __Pyx_GOTREF(__pyx_t_4);
15434   __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
15435   __Pyx_GOTREF(__pyx_t_5);
15436   __Pyx_GIVEREF(__pyx_t_1);
15437   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
15438   __Pyx_GIVEREF(__pyx_t_2);
15439   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
15440   __Pyx_GIVEREF(__pyx_t_3);
15441   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
15442   __Pyx_GIVEREF(__pyx_t_4);
15443   PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
15444   __Pyx_INCREF(((PyObject *)__pyx_v_self->tree));
15445   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->tree));
15446   PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_self->tree));
15447   __Pyx_INCREF(((PyObject *)__pyx_v_self->values));
15448   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->values));
15449   PyTuple_SET_ITEM(__pyx_t_5, 5, ((PyObject *)__pyx_v_self->values));
15450   __pyx_t_1 = 0;
15451   __pyx_t_2 = 0;
15452   __pyx_t_3 = 0;
15453   __pyx_t_4 = 0;
15454   __pyx_v_state = ((PyObject*)__pyx_t_5);
15455   __pyx_t_5 = 0;
15456 
15457   /* "(tree fragment)":6
15458  *     cdef bint use_setstate
15459  *     state = (self.frequency, self.max, self.min, self.start_offset, self.tree, self.values)
15460  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
15461  *     if _dict is not None:
15462  *         state += (_dict,)
15463  */
15464   __pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
15465   __Pyx_GOTREF(__pyx_t_5);
15466   __pyx_v__dict = __pyx_t_5;
15467   __pyx_t_5 = 0;
15468 
15469   /* "(tree fragment)":7
15470  *     state = (self.frequency, self.max, self.min, self.start_offset, self.tree, self.values)
15471  *     _dict = getattr(self, '__dict__', None)
15472  *     if _dict is not None:             # <<<<<<<<<<<<<<
15473  *         state += (_dict,)
15474  *         use_setstate = True
15475  */
15476   __pyx_t_6 = (__pyx_v__dict != Py_None);
15477   __pyx_t_7 = (__pyx_t_6 != 0);
15478   if (__pyx_t_7) {
15479 
15480     /* "(tree fragment)":8
15481  *     _dict = getattr(self, '__dict__', None)
15482  *     if _dict is not None:
15483  *         state += (_dict,)             # <<<<<<<<<<<<<<
15484  *         use_setstate = True
15485  *     else:
15486  */
15487     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 8, __pyx_L1_error)
15488     __Pyx_GOTREF(__pyx_t_5);
15489     __Pyx_INCREF(__pyx_v__dict);
15490     __Pyx_GIVEREF(__pyx_v__dict);
15491     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict);
15492     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
15493     __Pyx_GOTREF(__pyx_t_4);
15494     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15495     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
15496     __pyx_t_4 = 0;
15497 
15498     /* "(tree fragment)":9
15499  *     if _dict is not None:
15500  *         state += (_dict,)
15501  *         use_setstate = True             # <<<<<<<<<<<<<<
15502  *     else:
15503  *         use_setstate = self.tree is not None or self.values is not None
15504  */
15505     __pyx_v_use_setstate = 1;
15506 
15507     /* "(tree fragment)":7
15508  *     state = (self.frequency, self.max, self.min, self.start_offset, self.tree, self.values)
15509  *     _dict = getattr(self, '__dict__', None)
15510  *     if _dict is not None:             # <<<<<<<<<<<<<<
15511  *         state += (_dict,)
15512  *         use_setstate = True
15513  */
15514     goto __pyx_L3;
15515   }
15516 
15517   /* "(tree fragment)":11
15518  *         use_setstate = True
15519  *     else:
15520  *         use_setstate = self.tree is not None or self.values is not None             # <<<<<<<<<<<<<<
15521  *     if use_setstate:
15522  *         return __pyx_unpickle_ArrayTreeLeaf, (type(self), 0xc1230b0, None), state
15523  */
15524   /*else*/ {
15525     __pyx_t_6 = (((PyObject *)__pyx_v_self->tree) != Py_None);
15526     __pyx_t_8 = (__pyx_t_6 != 0);
15527     if (!__pyx_t_8) {
15528     } else {
15529       __pyx_t_7 = __pyx_t_8;
15530       goto __pyx_L4_bool_binop_done;
15531     }
15532     __pyx_t_8 = (((PyObject *)__pyx_v_self->values) != Py_None);
15533     __pyx_t_6 = (__pyx_t_8 != 0);
15534     __pyx_t_7 = __pyx_t_6;
15535     __pyx_L4_bool_binop_done:;
15536     __pyx_v_use_setstate = __pyx_t_7;
15537   }
15538   __pyx_L3:;
15539 
15540   /* "(tree fragment)":12
15541  *     else:
15542  *         use_setstate = self.tree is not None or self.values is not None
15543  *     if use_setstate:             # <<<<<<<<<<<<<<
15544  *         return __pyx_unpickle_ArrayTreeLeaf, (type(self), 0xc1230b0, None), state
15545  *     else:
15546  */
15547   __pyx_t_7 = (__pyx_v_use_setstate != 0);
15548   if (__pyx_t_7) {
15549 
15550     /* "(tree fragment)":13
15551  *         use_setstate = self.tree is not None or self.values is not None
15552  *     if use_setstate:
15553  *         return __pyx_unpickle_ArrayTreeLeaf, (type(self), 0xc1230b0, None), state             # <<<<<<<<<<<<<<
15554  *     else:
15555  *         return __pyx_unpickle_ArrayTreeLeaf, (type(self), 0xc1230b0, state)
15556  */
15557     __Pyx_XDECREF(__pyx_r);
15558     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_ArrayTreeLeaf); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
15559     __Pyx_GOTREF(__pyx_t_4);
15560     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
15561     __Pyx_GOTREF(__pyx_t_5);
15562     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15563     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15564     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15565     __Pyx_INCREF(__pyx_int_202518704);
15566     __Pyx_GIVEREF(__pyx_int_202518704);
15567     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_202518704);
15568     __Pyx_INCREF(Py_None);
15569     __Pyx_GIVEREF(Py_None);
15570     PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None);
15571     __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
15572     __Pyx_GOTREF(__pyx_t_3);
15573     __Pyx_GIVEREF(__pyx_t_4);
15574     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
15575     __Pyx_GIVEREF(__pyx_t_5);
15576     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
15577     __Pyx_INCREF(__pyx_v_state);
15578     __Pyx_GIVEREF(__pyx_v_state);
15579     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
15580     __pyx_t_4 = 0;
15581     __pyx_t_5 = 0;
15582     __pyx_r = __pyx_t_3;
15583     __pyx_t_3 = 0;
15584     goto __pyx_L0;
15585 
15586     /* "(tree fragment)":12
15587  *     else:
15588  *         use_setstate = self.tree is not None or self.values is not None
15589  *     if use_setstate:             # <<<<<<<<<<<<<<
15590  *         return __pyx_unpickle_ArrayTreeLeaf, (type(self), 0xc1230b0, None), state
15591  *     else:
15592  */
15593   }
15594 
15595   /* "(tree fragment)":15
15596  *         return __pyx_unpickle_ArrayTreeLeaf, (type(self), 0xc1230b0, None), state
15597  *     else:
15598  *         return __pyx_unpickle_ArrayTreeLeaf, (type(self), 0xc1230b0, state)             # <<<<<<<<<<<<<<
15599  * def __setstate_cython__(self, __pyx_state):
15600  *     __pyx_unpickle_ArrayTreeLeaf__set_state(self, __pyx_state)
15601  */
15602   /*else*/ {
15603     __Pyx_XDECREF(__pyx_r);
15604     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_ArrayTreeLeaf); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
15605     __Pyx_GOTREF(__pyx_t_3);
15606     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
15607     __Pyx_GOTREF(__pyx_t_5);
15608     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15609     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15610     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15611     __Pyx_INCREF(__pyx_int_202518704);
15612     __Pyx_GIVEREF(__pyx_int_202518704);
15613     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_202518704);
15614     __Pyx_INCREF(__pyx_v_state);
15615     __Pyx_GIVEREF(__pyx_v_state);
15616     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
15617     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
15618     __Pyx_GOTREF(__pyx_t_4);
15619     __Pyx_GIVEREF(__pyx_t_3);
15620     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
15621     __Pyx_GIVEREF(__pyx_t_5);
15622     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
15623     __pyx_t_3 = 0;
15624     __pyx_t_5 = 0;
15625     __pyx_r = __pyx_t_4;
15626     __pyx_t_4 = 0;
15627     goto __pyx_L0;
15628   }
15629 
15630   /* "(tree fragment)":1
15631  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
15632  *     cdef tuple state
15633  *     cdef object _dict
15634  */
15635 
15636   /* function exit code */
15637   __pyx_L1_error:;
15638   __Pyx_XDECREF(__pyx_t_1);
15639   __Pyx_XDECREF(__pyx_t_2);
15640   __Pyx_XDECREF(__pyx_t_3);
15641   __Pyx_XDECREF(__pyx_t_4);
15642   __Pyx_XDECREF(__pyx_t_5);
15643   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeLeaf.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15644   __pyx_r = NULL;
15645   __pyx_L0:;
15646   __Pyx_XDECREF(__pyx_v_state);
15647   __Pyx_XDECREF(__pyx_v__dict);
15648   __Pyx_XGIVEREF(__pyx_r);
15649   __Pyx_RefNannyFinishContext();
15650   return __pyx_r;
15651 }
15652 
15653 /* "(tree fragment)":16
15654  *     else:
15655  *         return __pyx_unpickle_ArrayTreeLeaf, (type(self), 0xc1230b0, state)
15656  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
15657  *     __pyx_unpickle_ArrayTreeLeaf__set_state(self, __pyx_state)
15658  */
15659 
15660 /* Python wrapper */
15661 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_15__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)15662 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15663   PyObject *__pyx_r = 0;
15664   __Pyx_RefNannyDeclarations
15665   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15666   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_14__setstate_cython__(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15667 
15668   /* function exit code */
15669   __Pyx_RefNannyFinishContext();
15670   return __pyx_r;
15671 }
15672 
__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_14__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf * __pyx_v_self,PyObject * __pyx_v___pyx_state)15673 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_13ArrayTreeLeaf_14__setstate_cython__(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15674   PyObject *__pyx_r = NULL;
15675   __Pyx_RefNannyDeclarations
15676   PyObject *__pyx_t_1 = NULL;
15677   int __pyx_lineno = 0;
15678   const char *__pyx_filename = NULL;
15679   int __pyx_clineno = 0;
15680   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
15681 
15682   /* "(tree fragment)":17
15683  *         return __pyx_unpickle_ArrayTreeLeaf, (type(self), 0xc1230b0, state)
15684  * def __setstate_cython__(self, __pyx_state):
15685  *     __pyx_unpickle_ArrayTreeLeaf__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
15686  */
15687   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
15688   __pyx_t_1 = __pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_ArrayTreeLeaf__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
15689   __Pyx_GOTREF(__pyx_t_1);
15690   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15691 
15692   /* "(tree fragment)":16
15693  *     else:
15694  *         return __pyx_unpickle_ArrayTreeLeaf, (type(self), 0xc1230b0, state)
15695  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
15696  *     __pyx_unpickle_ArrayTreeLeaf__set_state(self, __pyx_state)
15697  */
15698 
15699   /* function exit code */
15700   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15701   goto __pyx_L0;
15702   __pyx_L1_error:;
15703   __Pyx_XDECREF(__pyx_t_1);
15704   __Pyx_AddTraceback("bx.arrays.array_tree.ArrayTreeLeaf.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15705   __pyx_r = NULL;
15706   __pyx_L0:;
15707   __Pyx_XGIVEREF(__pyx_r);
15708   __Pyx_RefNannyFinishContext();
15709   return __pyx_r;
15710 }
15711 
15712 /* "(tree fragment)":1
15713  * def __pyx_unpickle_FileArrayTreeDict(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
15714  *     cdef object __pyx_PickleError
15715  *     cdef object __pyx_result
15716  */
15717 
15718 /* Python wrapper */
15719 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_3__pyx_unpickle_FileArrayTreeDict(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
15720 static PyMethodDef __pyx_mdef_2bx_6arrays_10array_tree_3__pyx_unpickle_FileArrayTreeDict = {"__pyx_unpickle_FileArrayTreeDict", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_3__pyx_unpickle_FileArrayTreeDict, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2bx_6arrays_10array_tree_3__pyx_unpickle_FileArrayTreeDict(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)15721 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_3__pyx_unpickle_FileArrayTreeDict(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15722   PyObject *__pyx_v___pyx_type = 0;
15723   long __pyx_v___pyx_checksum;
15724   PyObject *__pyx_v___pyx_state = 0;
15725   int __pyx_lineno = 0;
15726   const char *__pyx_filename = NULL;
15727   int __pyx_clineno = 0;
15728   PyObject *__pyx_r = 0;
15729   __Pyx_RefNannyDeclarations
15730   __Pyx_RefNannySetupContext("__pyx_unpickle_FileArrayTreeDict (wrapper)", 0);
15731   {
15732     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
15733     PyObject* values[3] = {0,0,0};
15734     if (unlikely(__pyx_kwds)) {
15735       Py_ssize_t kw_args;
15736       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15737       switch (pos_args) {
15738         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15739         CYTHON_FALLTHROUGH;
15740         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15741         CYTHON_FALLTHROUGH;
15742         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15743         CYTHON_FALLTHROUGH;
15744         case  0: break;
15745         default: goto __pyx_L5_argtuple_error;
15746       }
15747       kw_args = PyDict_Size(__pyx_kwds);
15748       switch (pos_args) {
15749         case  0:
15750         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
15751         else goto __pyx_L5_argtuple_error;
15752         CYTHON_FALLTHROUGH;
15753         case  1:
15754         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
15755         else {
15756           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FileArrayTreeDict", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
15757         }
15758         CYTHON_FALLTHROUGH;
15759         case  2:
15760         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
15761         else {
15762           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FileArrayTreeDict", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
15763         }
15764       }
15765       if (unlikely(kw_args > 0)) {
15766         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_FileArrayTreeDict") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
15767       }
15768     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
15769       goto __pyx_L5_argtuple_error;
15770     } else {
15771       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15772       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15773       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15774     }
15775     __pyx_v___pyx_type = values[0];
15776     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
15777     __pyx_v___pyx_state = values[2];
15778   }
15779   goto __pyx_L4_argument_unpacking_done;
15780   __pyx_L5_argtuple_error:;
15781   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FileArrayTreeDict", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
15782   __pyx_L3_error:;
15783   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_FileArrayTreeDict", __pyx_clineno, __pyx_lineno, __pyx_filename);
15784   __Pyx_RefNannyFinishContext();
15785   return NULL;
15786   __pyx_L4_argument_unpacking_done:;
15787   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_2__pyx_unpickle_FileArrayTreeDict(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
15788 
15789   /* function exit code */
15790   __Pyx_RefNannyFinishContext();
15791   return __pyx_r;
15792 }
15793 
__pyx_pf_2bx_6arrays_10array_tree_2__pyx_unpickle_FileArrayTreeDict(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)15794 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_2__pyx_unpickle_FileArrayTreeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
15795   PyObject *__pyx_v___pyx_PickleError = 0;
15796   PyObject *__pyx_v___pyx_result = 0;
15797   PyObject *__pyx_r = NULL;
15798   __Pyx_RefNannyDeclarations
15799   int __pyx_t_1;
15800   PyObject *__pyx_t_2 = NULL;
15801   PyObject *__pyx_t_3 = NULL;
15802   PyObject *__pyx_t_4 = NULL;
15803   PyObject *__pyx_t_5 = NULL;
15804   int __pyx_t_6;
15805   int __pyx_lineno = 0;
15806   const char *__pyx_filename = NULL;
15807   int __pyx_clineno = 0;
15808   __Pyx_RefNannySetupContext("__pyx_unpickle_FileArrayTreeDict", 0);
15809 
15810   /* "(tree fragment)":4
15811  *     cdef object __pyx_PickleError
15812  *     cdef object __pyx_result
15813  *     if __pyx_checksum != 0xcf117d0:             # <<<<<<<<<<<<<<
15814  *         from pickle import PickleError as __pyx_PickleError
15815  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcf117d0 = (cdb_dict, io))" % __pyx_checksum)
15816  */
15817   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xcf117d0) != 0);
15818   if (__pyx_t_1) {
15819 
15820     /* "(tree fragment)":5
15821  *     cdef object __pyx_result
15822  *     if __pyx_checksum != 0xcf117d0:
15823  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
15824  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcf117d0 = (cdb_dict, io))" % __pyx_checksum)
15825  *     __pyx_result = FileArrayTreeDict.__new__(__pyx_type)
15826  */
15827     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
15828     __Pyx_GOTREF(__pyx_t_2);
15829     __Pyx_INCREF(__pyx_n_s_PickleError);
15830     __Pyx_GIVEREF(__pyx_n_s_PickleError);
15831     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
15832     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
15833     __Pyx_GOTREF(__pyx_t_3);
15834     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15835     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
15836     __Pyx_GOTREF(__pyx_t_2);
15837     __Pyx_INCREF(__pyx_t_2);
15838     __pyx_v___pyx_PickleError = __pyx_t_2;
15839     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15840     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15841 
15842     /* "(tree fragment)":6
15843  *     if __pyx_checksum != 0xcf117d0:
15844  *         from pickle import PickleError as __pyx_PickleError
15845  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcf117d0 = (cdb_dict, io))" % __pyx_checksum)             # <<<<<<<<<<<<<<
15846  *     __pyx_result = FileArrayTreeDict.__new__(__pyx_type)
15847  *     if __pyx_state is not None:
15848  */
15849     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
15850     __Pyx_GOTREF(__pyx_t_2);
15851     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xcf, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
15852     __Pyx_GOTREF(__pyx_t_4);
15853     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15854     __Pyx_INCREF(__pyx_v___pyx_PickleError);
15855     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
15856     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
15857       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
15858       if (likely(__pyx_t_5)) {
15859         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
15860         __Pyx_INCREF(__pyx_t_5);
15861         __Pyx_INCREF(function);
15862         __Pyx_DECREF_SET(__pyx_t_2, function);
15863       }
15864     }
15865     __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);
15866     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15867     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15868     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
15869     __Pyx_GOTREF(__pyx_t_3);
15870     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15871     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15872     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15873     __PYX_ERR(1, 6, __pyx_L1_error)
15874 
15875     /* "(tree fragment)":4
15876  *     cdef object __pyx_PickleError
15877  *     cdef object __pyx_result
15878  *     if __pyx_checksum != 0xcf117d0:             # <<<<<<<<<<<<<<
15879  *         from pickle import PickleError as __pyx_PickleError
15880  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcf117d0 = (cdb_dict, io))" % __pyx_checksum)
15881  */
15882   }
15883 
15884   /* "(tree fragment)":7
15885  *         from pickle import PickleError as __pyx_PickleError
15886  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcf117d0 = (cdb_dict, io))" % __pyx_checksum)
15887  *     __pyx_result = FileArrayTreeDict.__new__(__pyx_type)             # <<<<<<<<<<<<<<
15888  *     if __pyx_state is not None:
15889  *         __pyx_unpickle_FileArrayTreeDict__set_state(<FileArrayTreeDict> __pyx_result, __pyx_state)
15890  */
15891   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_FileArrayTreeDict), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
15892   __Pyx_GOTREF(__pyx_t_2);
15893   __pyx_t_4 = NULL;
15894   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
15895     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
15896     if (likely(__pyx_t_4)) {
15897       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
15898       __Pyx_INCREF(__pyx_t_4);
15899       __Pyx_INCREF(function);
15900       __Pyx_DECREF_SET(__pyx_t_2, function);
15901     }
15902   }
15903   __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);
15904   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15905   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
15906   __Pyx_GOTREF(__pyx_t_3);
15907   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15908   __pyx_v___pyx_result = __pyx_t_3;
15909   __pyx_t_3 = 0;
15910 
15911   /* "(tree fragment)":8
15912  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcf117d0 = (cdb_dict, io))" % __pyx_checksum)
15913  *     __pyx_result = FileArrayTreeDict.__new__(__pyx_type)
15914  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
15915  *         __pyx_unpickle_FileArrayTreeDict__set_state(<FileArrayTreeDict> __pyx_result, __pyx_state)
15916  *     return __pyx_result
15917  */
15918   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
15919   __pyx_t_6 = (__pyx_t_1 != 0);
15920   if (__pyx_t_6) {
15921 
15922     /* "(tree fragment)":9
15923  *     __pyx_result = FileArrayTreeDict.__new__(__pyx_type)
15924  *     if __pyx_state is not None:
15925  *         __pyx_unpickle_FileArrayTreeDict__set_state(<FileArrayTreeDict> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
15926  *     return __pyx_result
15927  * cdef __pyx_unpickle_FileArrayTreeDict__set_state(FileArrayTreeDict __pyx_result, tuple __pyx_state):
15928  */
15929     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
15930     __pyx_t_3 = __pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_FileArrayTreeDict__set_state(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
15931     __Pyx_GOTREF(__pyx_t_3);
15932     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15933 
15934     /* "(tree fragment)":8
15935  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcf117d0 = (cdb_dict, io))" % __pyx_checksum)
15936  *     __pyx_result = FileArrayTreeDict.__new__(__pyx_type)
15937  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
15938  *         __pyx_unpickle_FileArrayTreeDict__set_state(<FileArrayTreeDict> __pyx_result, __pyx_state)
15939  *     return __pyx_result
15940  */
15941   }
15942 
15943   /* "(tree fragment)":10
15944  *     if __pyx_state is not None:
15945  *         __pyx_unpickle_FileArrayTreeDict__set_state(<FileArrayTreeDict> __pyx_result, __pyx_state)
15946  *     return __pyx_result             # <<<<<<<<<<<<<<
15947  * cdef __pyx_unpickle_FileArrayTreeDict__set_state(FileArrayTreeDict __pyx_result, tuple __pyx_state):
15948  *     __pyx_result.cdb_dict = __pyx_state[0]; __pyx_result.io = __pyx_state[1]
15949  */
15950   __Pyx_XDECREF(__pyx_r);
15951   __Pyx_INCREF(__pyx_v___pyx_result);
15952   __pyx_r = __pyx_v___pyx_result;
15953   goto __pyx_L0;
15954 
15955   /* "(tree fragment)":1
15956  * def __pyx_unpickle_FileArrayTreeDict(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
15957  *     cdef object __pyx_PickleError
15958  *     cdef object __pyx_result
15959  */
15960 
15961   /* function exit code */
15962   __pyx_L1_error:;
15963   __Pyx_XDECREF(__pyx_t_2);
15964   __Pyx_XDECREF(__pyx_t_3);
15965   __Pyx_XDECREF(__pyx_t_4);
15966   __Pyx_XDECREF(__pyx_t_5);
15967   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_FileArrayTreeDict", __pyx_clineno, __pyx_lineno, __pyx_filename);
15968   __pyx_r = NULL;
15969   __pyx_L0:;
15970   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
15971   __Pyx_XDECREF(__pyx_v___pyx_result);
15972   __Pyx_XGIVEREF(__pyx_r);
15973   __Pyx_RefNannyFinishContext();
15974   return __pyx_r;
15975 }
15976 
15977 /* "(tree fragment)":11
15978  *         __pyx_unpickle_FileArrayTreeDict__set_state(<FileArrayTreeDict> __pyx_result, __pyx_state)
15979  *     return __pyx_result
15980  * cdef __pyx_unpickle_FileArrayTreeDict__set_state(FileArrayTreeDict __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
15981  *     __pyx_result.cdb_dict = __pyx_state[0]; __pyx_result.io = __pyx_state[1]
15982  *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
15983  */
15984 
__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_FileArrayTreeDict__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)15985 static PyObject *__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_FileArrayTreeDict__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
15986   PyObject *__pyx_r = NULL;
15987   __Pyx_RefNannyDeclarations
15988   PyObject *__pyx_t_1 = NULL;
15989   int __pyx_t_2;
15990   Py_ssize_t __pyx_t_3;
15991   int __pyx_t_4;
15992   int __pyx_t_5;
15993   PyObject *__pyx_t_6 = NULL;
15994   PyObject *__pyx_t_7 = NULL;
15995   PyObject *__pyx_t_8 = NULL;
15996   int __pyx_lineno = 0;
15997   const char *__pyx_filename = NULL;
15998   int __pyx_clineno = 0;
15999   __Pyx_RefNannySetupContext("__pyx_unpickle_FileArrayTreeDict__set_state", 0);
16000 
16001   /* "(tree fragment)":12
16002  *     return __pyx_result
16003  * cdef __pyx_unpickle_FileArrayTreeDict__set_state(FileArrayTreeDict __pyx_result, tuple __pyx_state):
16004  *     __pyx_result.cdb_dict = __pyx_state[0]; __pyx_result.io = __pyx_state[1]             # <<<<<<<<<<<<<<
16005  *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
16006  *         __pyx_result.__dict__.update(__pyx_state[2])
16007  */
16008   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16009     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16010     __PYX_ERR(1, 12, __pyx_L1_error)
16011   }
16012   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
16013   __Pyx_GOTREF(__pyx_t_1);
16014   __Pyx_GIVEREF(__pyx_t_1);
16015   __Pyx_GOTREF(__pyx_v___pyx_result->cdb_dict);
16016   __Pyx_DECREF(__pyx_v___pyx_result->cdb_dict);
16017   __pyx_v___pyx_result->cdb_dict = __pyx_t_1;
16018   __pyx_t_1 = 0;
16019   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16020     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16021     __PYX_ERR(1, 12, __pyx_L1_error)
16022   }
16023   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
16024   __Pyx_GOTREF(__pyx_t_1);
16025   __Pyx_GIVEREF(__pyx_t_1);
16026   __Pyx_GOTREF(__pyx_v___pyx_result->io);
16027   __Pyx_DECREF(__pyx_v___pyx_result->io);
16028   __pyx_v___pyx_result->io = __pyx_t_1;
16029   __pyx_t_1 = 0;
16030 
16031   /* "(tree fragment)":13
16032  * cdef __pyx_unpickle_FileArrayTreeDict__set_state(FileArrayTreeDict __pyx_result, tuple __pyx_state):
16033  *     __pyx_result.cdb_dict = __pyx_state[0]; __pyx_result.io = __pyx_state[1]
16034  *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
16035  *         __pyx_result.__dict__.update(__pyx_state[2])
16036  */
16037   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16038     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
16039     __PYX_ERR(1, 13, __pyx_L1_error)
16040   }
16041   __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
16042   __pyx_t_4 = ((__pyx_t_3 > 2) != 0);
16043   if (__pyx_t_4) {
16044   } else {
16045     __pyx_t_2 = __pyx_t_4;
16046     goto __pyx_L4_bool_binop_done;
16047   }
16048   __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
16049   __pyx_t_5 = (__pyx_t_4 != 0);
16050   __pyx_t_2 = __pyx_t_5;
16051   __pyx_L4_bool_binop_done:;
16052   if (__pyx_t_2) {
16053 
16054     /* "(tree fragment)":14
16055  *     __pyx_result.cdb_dict = __pyx_state[0]; __pyx_result.io = __pyx_state[1]
16056  *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
16057  *         __pyx_result.__dict__.update(__pyx_state[2])             # <<<<<<<<<<<<<<
16058  */
16059     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
16060     __Pyx_GOTREF(__pyx_t_6);
16061     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
16062     __Pyx_GOTREF(__pyx_t_7);
16063     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16064     if (unlikely(__pyx_v___pyx_state == Py_None)) {
16065       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16066       __PYX_ERR(1, 14, __pyx_L1_error)
16067     }
16068     __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
16069     __Pyx_GOTREF(__pyx_t_6);
16070     __pyx_t_8 = NULL;
16071     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
16072       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
16073       if (likely(__pyx_t_8)) {
16074         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
16075         __Pyx_INCREF(__pyx_t_8);
16076         __Pyx_INCREF(function);
16077         __Pyx_DECREF_SET(__pyx_t_7, function);
16078       }
16079     }
16080     __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
16081     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16082     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16083     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
16084     __Pyx_GOTREF(__pyx_t_1);
16085     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16086     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16087 
16088     /* "(tree fragment)":13
16089  * cdef __pyx_unpickle_FileArrayTreeDict__set_state(FileArrayTreeDict __pyx_result, tuple __pyx_state):
16090  *     __pyx_result.cdb_dict = __pyx_state[0]; __pyx_result.io = __pyx_state[1]
16091  *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
16092  *         __pyx_result.__dict__.update(__pyx_state[2])
16093  */
16094   }
16095 
16096   /* "(tree fragment)":11
16097  *         __pyx_unpickle_FileArrayTreeDict__set_state(<FileArrayTreeDict> __pyx_result, __pyx_state)
16098  *     return __pyx_result
16099  * cdef __pyx_unpickle_FileArrayTreeDict__set_state(FileArrayTreeDict __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
16100  *     __pyx_result.cdb_dict = __pyx_state[0]; __pyx_result.io = __pyx_state[1]
16101  *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
16102  */
16103 
16104   /* function exit code */
16105   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16106   goto __pyx_L0;
16107   __pyx_L1_error:;
16108   __Pyx_XDECREF(__pyx_t_1);
16109   __Pyx_XDECREF(__pyx_t_6);
16110   __Pyx_XDECREF(__pyx_t_7);
16111   __Pyx_XDECREF(__pyx_t_8);
16112   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_FileArrayTreeDict__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
16113   __pyx_r = 0;
16114   __pyx_L0:;
16115   __Pyx_XGIVEREF(__pyx_r);
16116   __Pyx_RefNannyFinishContext();
16117   return __pyx_r;
16118 }
16119 
16120 /* "(tree fragment)":1
16121  * def __pyx_unpickle_FileArrayTree(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
16122  *     cdef object __pyx_PickleError
16123  *     cdef object __pyx_result
16124  */
16125 
16126 /* Python wrapper */
16127 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_5__pyx_unpickle_FileArrayTree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
16128 static PyMethodDef __pyx_mdef_2bx_6arrays_10array_tree_5__pyx_unpickle_FileArrayTree = {"__pyx_unpickle_FileArrayTree", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_5__pyx_unpickle_FileArrayTree, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2bx_6arrays_10array_tree_5__pyx_unpickle_FileArrayTree(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)16129 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_5__pyx_unpickle_FileArrayTree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16130   PyObject *__pyx_v___pyx_type = 0;
16131   long __pyx_v___pyx_checksum;
16132   PyObject *__pyx_v___pyx_state = 0;
16133   int __pyx_lineno = 0;
16134   const char *__pyx_filename = NULL;
16135   int __pyx_clineno = 0;
16136   PyObject *__pyx_r = 0;
16137   __Pyx_RefNannyDeclarations
16138   __Pyx_RefNannySetupContext("__pyx_unpickle_FileArrayTree (wrapper)", 0);
16139   {
16140     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
16141     PyObject* values[3] = {0,0,0};
16142     if (unlikely(__pyx_kwds)) {
16143       Py_ssize_t kw_args;
16144       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16145       switch (pos_args) {
16146         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16147         CYTHON_FALLTHROUGH;
16148         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16149         CYTHON_FALLTHROUGH;
16150         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16151         CYTHON_FALLTHROUGH;
16152         case  0: break;
16153         default: goto __pyx_L5_argtuple_error;
16154       }
16155       kw_args = PyDict_Size(__pyx_kwds);
16156       switch (pos_args) {
16157         case  0:
16158         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
16159         else goto __pyx_L5_argtuple_error;
16160         CYTHON_FALLTHROUGH;
16161         case  1:
16162         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
16163         else {
16164           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FileArrayTree", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
16165         }
16166         CYTHON_FALLTHROUGH;
16167         case  2:
16168         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
16169         else {
16170           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FileArrayTree", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
16171         }
16172       }
16173       if (unlikely(kw_args > 0)) {
16174         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_FileArrayTree") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
16175       }
16176     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
16177       goto __pyx_L5_argtuple_error;
16178     } else {
16179       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16180       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16181       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16182     }
16183     __pyx_v___pyx_type = values[0];
16184     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
16185     __pyx_v___pyx_state = values[2];
16186   }
16187   goto __pyx_L4_argument_unpacking_done;
16188   __pyx_L5_argtuple_error:;
16189   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FileArrayTree", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
16190   __pyx_L3_error:;
16191   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_FileArrayTree", __pyx_clineno, __pyx_lineno, __pyx_filename);
16192   __Pyx_RefNannyFinishContext();
16193   return NULL;
16194   __pyx_L4_argument_unpacking_done:;
16195   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_4__pyx_unpickle_FileArrayTree(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
16196 
16197   /* function exit code */
16198   __Pyx_RefNannyFinishContext();
16199   return __pyx_r;
16200 }
16201 
__pyx_pf_2bx_6arrays_10array_tree_4__pyx_unpickle_FileArrayTree(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)16202 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_4__pyx_unpickle_FileArrayTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
16203   PyObject *__pyx_v___pyx_PickleError = 0;
16204   PyObject *__pyx_v___pyx_result = 0;
16205   PyObject *__pyx_r = NULL;
16206   __Pyx_RefNannyDeclarations
16207   int __pyx_t_1;
16208   PyObject *__pyx_t_2 = NULL;
16209   PyObject *__pyx_t_3 = NULL;
16210   PyObject *__pyx_t_4 = NULL;
16211   PyObject *__pyx_t_5 = NULL;
16212   int __pyx_t_6;
16213   int __pyx_lineno = 0;
16214   const char *__pyx_filename = NULL;
16215   int __pyx_clineno = 0;
16216   __Pyx_RefNannySetupContext("__pyx_unpickle_FileArrayTree", 0);
16217 
16218   /* "(tree fragment)":4
16219  *     cdef object __pyx_PickleError
16220  *     cdef object __pyx_result
16221  *     if __pyx_checksum != 0xeabeaf7:             # <<<<<<<<<<<<<<
16222  *         from pickle import PickleError as __pyx_PickleError
16223  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xeabeaf7 = (block_size, dtype, io, levels, max, offset, root_offset))" % __pyx_checksum)
16224  */
16225   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xeabeaf7) != 0);
16226   if (__pyx_t_1) {
16227 
16228     /* "(tree fragment)":5
16229  *     cdef object __pyx_result
16230  *     if __pyx_checksum != 0xeabeaf7:
16231  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
16232  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xeabeaf7 = (block_size, dtype, io, levels, max, offset, root_offset))" % __pyx_checksum)
16233  *     __pyx_result = FileArrayTree.__new__(__pyx_type)
16234  */
16235     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
16236     __Pyx_GOTREF(__pyx_t_2);
16237     __Pyx_INCREF(__pyx_n_s_PickleError);
16238     __Pyx_GIVEREF(__pyx_n_s_PickleError);
16239     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
16240     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
16241     __Pyx_GOTREF(__pyx_t_3);
16242     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16243     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
16244     __Pyx_GOTREF(__pyx_t_2);
16245     __Pyx_INCREF(__pyx_t_2);
16246     __pyx_v___pyx_PickleError = __pyx_t_2;
16247     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16248     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16249 
16250     /* "(tree fragment)":6
16251  *     if __pyx_checksum != 0xeabeaf7:
16252  *         from pickle import PickleError as __pyx_PickleError
16253  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xeabeaf7 = (block_size, dtype, io, levels, max, offset, root_offset))" % __pyx_checksum)             # <<<<<<<<<<<<<<
16254  *     __pyx_result = FileArrayTree.__new__(__pyx_type)
16255  *     if __pyx_state is not None:
16256  */
16257     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
16258     __Pyx_GOTREF(__pyx_t_2);
16259     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xea, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
16260     __Pyx_GOTREF(__pyx_t_4);
16261     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16262     __Pyx_INCREF(__pyx_v___pyx_PickleError);
16263     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
16264     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
16265       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
16266       if (likely(__pyx_t_5)) {
16267         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
16268         __Pyx_INCREF(__pyx_t_5);
16269         __Pyx_INCREF(function);
16270         __Pyx_DECREF_SET(__pyx_t_2, function);
16271       }
16272     }
16273     __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);
16274     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16275     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16276     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
16277     __Pyx_GOTREF(__pyx_t_3);
16278     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16279     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16280     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16281     __PYX_ERR(1, 6, __pyx_L1_error)
16282 
16283     /* "(tree fragment)":4
16284  *     cdef object __pyx_PickleError
16285  *     cdef object __pyx_result
16286  *     if __pyx_checksum != 0xeabeaf7:             # <<<<<<<<<<<<<<
16287  *         from pickle import PickleError as __pyx_PickleError
16288  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xeabeaf7 = (block_size, dtype, io, levels, max, offset, root_offset))" % __pyx_checksum)
16289  */
16290   }
16291 
16292   /* "(tree fragment)":7
16293  *         from pickle import PickleError as __pyx_PickleError
16294  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xeabeaf7 = (block_size, dtype, io, levels, max, offset, root_offset))" % __pyx_checksum)
16295  *     __pyx_result = FileArrayTree.__new__(__pyx_type)             # <<<<<<<<<<<<<<
16296  *     if __pyx_state is not None:
16297  *         __pyx_unpickle_FileArrayTree__set_state(<FileArrayTree> __pyx_result, __pyx_state)
16298  */
16299   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_FileArrayTree), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
16300   __Pyx_GOTREF(__pyx_t_2);
16301   __pyx_t_4 = NULL;
16302   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
16303     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
16304     if (likely(__pyx_t_4)) {
16305       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
16306       __Pyx_INCREF(__pyx_t_4);
16307       __Pyx_INCREF(function);
16308       __Pyx_DECREF_SET(__pyx_t_2, function);
16309     }
16310   }
16311   __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);
16312   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16313   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
16314   __Pyx_GOTREF(__pyx_t_3);
16315   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16316   __pyx_v___pyx_result = __pyx_t_3;
16317   __pyx_t_3 = 0;
16318 
16319   /* "(tree fragment)":8
16320  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xeabeaf7 = (block_size, dtype, io, levels, max, offset, root_offset))" % __pyx_checksum)
16321  *     __pyx_result = FileArrayTree.__new__(__pyx_type)
16322  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
16323  *         __pyx_unpickle_FileArrayTree__set_state(<FileArrayTree> __pyx_result, __pyx_state)
16324  *     return __pyx_result
16325  */
16326   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
16327   __pyx_t_6 = (__pyx_t_1 != 0);
16328   if (__pyx_t_6) {
16329 
16330     /* "(tree fragment)":9
16331  *     __pyx_result = FileArrayTree.__new__(__pyx_type)
16332  *     if __pyx_state is not None:
16333  *         __pyx_unpickle_FileArrayTree__set_state(<FileArrayTree> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
16334  *     return __pyx_result
16335  * cdef __pyx_unpickle_FileArrayTree__set_state(FileArrayTree __pyx_result, tuple __pyx_state):
16336  */
16337     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
16338     __pyx_t_3 = __pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_FileArrayTree__set_state(((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
16339     __Pyx_GOTREF(__pyx_t_3);
16340     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16341 
16342     /* "(tree fragment)":8
16343  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xeabeaf7 = (block_size, dtype, io, levels, max, offset, root_offset))" % __pyx_checksum)
16344  *     __pyx_result = FileArrayTree.__new__(__pyx_type)
16345  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
16346  *         __pyx_unpickle_FileArrayTree__set_state(<FileArrayTree> __pyx_result, __pyx_state)
16347  *     return __pyx_result
16348  */
16349   }
16350 
16351   /* "(tree fragment)":10
16352  *     if __pyx_state is not None:
16353  *         __pyx_unpickle_FileArrayTree__set_state(<FileArrayTree> __pyx_result, __pyx_state)
16354  *     return __pyx_result             # <<<<<<<<<<<<<<
16355  * cdef __pyx_unpickle_FileArrayTree__set_state(FileArrayTree __pyx_result, tuple __pyx_state):
16356  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.dtype = __pyx_state[1]; __pyx_result.io = __pyx_state[2]; __pyx_result.levels = __pyx_state[3]; __pyx_result.max = __pyx_state[4]; __pyx_result.offset = __pyx_state[5]; __pyx_result.root_offset = __pyx_state[6]
16357  */
16358   __Pyx_XDECREF(__pyx_r);
16359   __Pyx_INCREF(__pyx_v___pyx_result);
16360   __pyx_r = __pyx_v___pyx_result;
16361   goto __pyx_L0;
16362 
16363   /* "(tree fragment)":1
16364  * def __pyx_unpickle_FileArrayTree(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
16365  *     cdef object __pyx_PickleError
16366  *     cdef object __pyx_result
16367  */
16368 
16369   /* function exit code */
16370   __pyx_L1_error:;
16371   __Pyx_XDECREF(__pyx_t_2);
16372   __Pyx_XDECREF(__pyx_t_3);
16373   __Pyx_XDECREF(__pyx_t_4);
16374   __Pyx_XDECREF(__pyx_t_5);
16375   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_FileArrayTree", __pyx_clineno, __pyx_lineno, __pyx_filename);
16376   __pyx_r = NULL;
16377   __pyx_L0:;
16378   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
16379   __Pyx_XDECREF(__pyx_v___pyx_result);
16380   __Pyx_XGIVEREF(__pyx_r);
16381   __Pyx_RefNannyFinishContext();
16382   return __pyx_r;
16383 }
16384 
16385 /* "(tree fragment)":11
16386  *         __pyx_unpickle_FileArrayTree__set_state(<FileArrayTree> __pyx_result, __pyx_state)
16387  *     return __pyx_result
16388  * cdef __pyx_unpickle_FileArrayTree__set_state(FileArrayTree __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
16389  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.dtype = __pyx_state[1]; __pyx_result.io = __pyx_state[2]; __pyx_result.levels = __pyx_state[3]; __pyx_result.max = __pyx_state[4]; __pyx_result.offset = __pyx_state[5]; __pyx_result.root_offset = __pyx_state[6]
16390  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
16391  */
16392 
__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_FileArrayTree__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)16393 static PyObject *__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_FileArrayTree__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
16394   PyObject *__pyx_r = NULL;
16395   __Pyx_RefNannyDeclarations
16396   PyObject *__pyx_t_1 = NULL;
16397   int __pyx_t_2;
16398   int __pyx_t_3;
16399   Py_ssize_t __pyx_t_4;
16400   int __pyx_t_5;
16401   int __pyx_t_6;
16402   PyObject *__pyx_t_7 = NULL;
16403   PyObject *__pyx_t_8 = NULL;
16404   PyObject *__pyx_t_9 = NULL;
16405   int __pyx_lineno = 0;
16406   const char *__pyx_filename = NULL;
16407   int __pyx_clineno = 0;
16408   __Pyx_RefNannySetupContext("__pyx_unpickle_FileArrayTree__set_state", 0);
16409 
16410   /* "(tree fragment)":12
16411  *     return __pyx_result
16412  * cdef __pyx_unpickle_FileArrayTree__set_state(FileArrayTree __pyx_result, tuple __pyx_state):
16413  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.dtype = __pyx_state[1]; __pyx_result.io = __pyx_state[2]; __pyx_result.levels = __pyx_state[3]; __pyx_result.max = __pyx_state[4]; __pyx_result.offset = __pyx_state[5]; __pyx_result.root_offset = __pyx_state[6]             # <<<<<<<<<<<<<<
16414  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
16415  *         __pyx_result.__dict__.update(__pyx_state[7])
16416  */
16417   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16418     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16419     __PYX_ERR(1, 12, __pyx_L1_error)
16420   }
16421   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
16422   __Pyx_GOTREF(__pyx_t_1);
16423   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
16424   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16425   __pyx_v___pyx_result->block_size = __pyx_t_2;
16426   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16427     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16428     __PYX_ERR(1, 12, __pyx_L1_error)
16429   }
16430   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
16431   __Pyx_GOTREF(__pyx_t_1);
16432   __Pyx_GIVEREF(__pyx_t_1);
16433   __Pyx_GOTREF(__pyx_v___pyx_result->dtype);
16434   __Pyx_DECREF(__pyx_v___pyx_result->dtype);
16435   __pyx_v___pyx_result->dtype = __pyx_t_1;
16436   __pyx_t_1 = 0;
16437   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16438     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16439     __PYX_ERR(1, 12, __pyx_L1_error)
16440   }
16441   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
16442   __Pyx_GOTREF(__pyx_t_1);
16443   __Pyx_GIVEREF(__pyx_t_1);
16444   __Pyx_GOTREF(__pyx_v___pyx_result->io);
16445   __Pyx_DECREF(__pyx_v___pyx_result->io);
16446   __pyx_v___pyx_result->io = __pyx_t_1;
16447   __pyx_t_1 = 0;
16448   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16449     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16450     __PYX_ERR(1, 12, __pyx_L1_error)
16451   }
16452   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
16453   __Pyx_GOTREF(__pyx_t_1);
16454   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
16455   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16456   __pyx_v___pyx_result->levels = __pyx_t_2;
16457   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16458     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16459     __PYX_ERR(1, 12, __pyx_L1_error)
16460   }
16461   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
16462   __Pyx_GOTREF(__pyx_t_1);
16463   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
16464   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16465   __pyx_v___pyx_result->max = __pyx_t_2;
16466   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16467     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16468     __PYX_ERR(1, 12, __pyx_L1_error)
16469   }
16470   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
16471   __Pyx_GOTREF(__pyx_t_1);
16472   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
16473   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16474   __pyx_v___pyx_result->offset = __pyx_t_2;
16475   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16476     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16477     __PYX_ERR(1, 12, __pyx_L1_error)
16478   }
16479   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
16480   __Pyx_GOTREF(__pyx_t_1);
16481   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
16482   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16483   __pyx_v___pyx_result->root_offset = __pyx_t_2;
16484 
16485   /* "(tree fragment)":13
16486  * cdef __pyx_unpickle_FileArrayTree__set_state(FileArrayTree __pyx_result, tuple __pyx_state):
16487  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.dtype = __pyx_state[1]; __pyx_result.io = __pyx_state[2]; __pyx_result.levels = __pyx_state[3]; __pyx_result.max = __pyx_state[4]; __pyx_result.offset = __pyx_state[5]; __pyx_result.root_offset = __pyx_state[6]
16488  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
16489  *         __pyx_result.__dict__.update(__pyx_state[7])
16490  */
16491   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16492     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
16493     __PYX_ERR(1, 13, __pyx_L1_error)
16494   }
16495   __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
16496   __pyx_t_5 = ((__pyx_t_4 > 7) != 0);
16497   if (__pyx_t_5) {
16498   } else {
16499     __pyx_t_3 = __pyx_t_5;
16500     goto __pyx_L4_bool_binop_done;
16501   }
16502   __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
16503   __pyx_t_6 = (__pyx_t_5 != 0);
16504   __pyx_t_3 = __pyx_t_6;
16505   __pyx_L4_bool_binop_done:;
16506   if (__pyx_t_3) {
16507 
16508     /* "(tree fragment)":14
16509  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.dtype = __pyx_state[1]; __pyx_result.io = __pyx_state[2]; __pyx_result.levels = __pyx_state[3]; __pyx_result.max = __pyx_state[4]; __pyx_result.offset = __pyx_state[5]; __pyx_result.root_offset = __pyx_state[6]
16510  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
16511  *         __pyx_result.__dict__.update(__pyx_state[7])             # <<<<<<<<<<<<<<
16512  */
16513     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
16514     __Pyx_GOTREF(__pyx_t_7);
16515     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
16516     __Pyx_GOTREF(__pyx_t_8);
16517     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16518     if (unlikely(__pyx_v___pyx_state == Py_None)) {
16519       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16520       __PYX_ERR(1, 14, __pyx_L1_error)
16521     }
16522     __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
16523     __Pyx_GOTREF(__pyx_t_7);
16524     __pyx_t_9 = NULL;
16525     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
16526       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
16527       if (likely(__pyx_t_9)) {
16528         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
16529         __Pyx_INCREF(__pyx_t_9);
16530         __Pyx_INCREF(function);
16531         __Pyx_DECREF_SET(__pyx_t_8, function);
16532       }
16533     }
16534     __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
16535     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16536     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16537     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
16538     __Pyx_GOTREF(__pyx_t_1);
16539     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16540     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16541 
16542     /* "(tree fragment)":13
16543  * cdef __pyx_unpickle_FileArrayTree__set_state(FileArrayTree __pyx_result, tuple __pyx_state):
16544  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.dtype = __pyx_state[1]; __pyx_result.io = __pyx_state[2]; __pyx_result.levels = __pyx_state[3]; __pyx_result.max = __pyx_state[4]; __pyx_result.offset = __pyx_state[5]; __pyx_result.root_offset = __pyx_state[6]
16545  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
16546  *         __pyx_result.__dict__.update(__pyx_state[7])
16547  */
16548   }
16549 
16550   /* "(tree fragment)":11
16551  *         __pyx_unpickle_FileArrayTree__set_state(<FileArrayTree> __pyx_result, __pyx_state)
16552  *     return __pyx_result
16553  * cdef __pyx_unpickle_FileArrayTree__set_state(FileArrayTree __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
16554  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.dtype = __pyx_state[1]; __pyx_result.io = __pyx_state[2]; __pyx_result.levels = __pyx_state[3]; __pyx_result.max = __pyx_state[4]; __pyx_result.offset = __pyx_state[5]; __pyx_result.root_offset = __pyx_state[6]
16555  *     if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'):
16556  */
16557 
16558   /* function exit code */
16559   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16560   goto __pyx_L0;
16561   __pyx_L1_error:;
16562   __Pyx_XDECREF(__pyx_t_1);
16563   __Pyx_XDECREF(__pyx_t_7);
16564   __Pyx_XDECREF(__pyx_t_8);
16565   __Pyx_XDECREF(__pyx_t_9);
16566   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_FileArrayTree__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
16567   __pyx_r = 0;
16568   __pyx_L0:;
16569   __Pyx_XGIVEREF(__pyx_r);
16570   __Pyx_RefNannyFinishContext();
16571   return __pyx_r;
16572 }
16573 
16574 /* "(tree fragment)":1
16575  * def __pyx_unpickle_Summary(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
16576  *     cdef object __pyx_PickleError
16577  *     cdef object __pyx_result
16578  */
16579 
16580 /* Python wrapper */
16581 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7__pyx_unpickle_Summary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
16582 static PyMethodDef __pyx_mdef_2bx_6arrays_10array_tree_7__pyx_unpickle_Summary = {"__pyx_unpickle_Summary", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_7__pyx_unpickle_Summary, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2bx_6arrays_10array_tree_7__pyx_unpickle_Summary(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)16583 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_7__pyx_unpickle_Summary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16584   PyObject *__pyx_v___pyx_type = 0;
16585   long __pyx_v___pyx_checksum;
16586   PyObject *__pyx_v___pyx_state = 0;
16587   int __pyx_lineno = 0;
16588   const char *__pyx_filename = NULL;
16589   int __pyx_clineno = 0;
16590   PyObject *__pyx_r = 0;
16591   __Pyx_RefNannyDeclarations
16592   __Pyx_RefNannySetupContext("__pyx_unpickle_Summary (wrapper)", 0);
16593   {
16594     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
16595     PyObject* values[3] = {0,0,0};
16596     if (unlikely(__pyx_kwds)) {
16597       Py_ssize_t kw_args;
16598       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16599       switch (pos_args) {
16600         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16601         CYTHON_FALLTHROUGH;
16602         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16603         CYTHON_FALLTHROUGH;
16604         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16605         CYTHON_FALLTHROUGH;
16606         case  0: break;
16607         default: goto __pyx_L5_argtuple_error;
16608       }
16609       kw_args = PyDict_Size(__pyx_kwds);
16610       switch (pos_args) {
16611         case  0:
16612         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
16613         else goto __pyx_L5_argtuple_error;
16614         CYTHON_FALLTHROUGH;
16615         case  1:
16616         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
16617         else {
16618           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Summary", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
16619         }
16620         CYTHON_FALLTHROUGH;
16621         case  2:
16622         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
16623         else {
16624           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Summary", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
16625         }
16626       }
16627       if (unlikely(kw_args > 0)) {
16628         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Summary") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
16629       }
16630     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
16631       goto __pyx_L5_argtuple_error;
16632     } else {
16633       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16634       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16635       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16636     }
16637     __pyx_v___pyx_type = values[0];
16638     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
16639     __pyx_v___pyx_state = values[2];
16640   }
16641   goto __pyx_L4_argument_unpacking_done;
16642   __pyx_L5_argtuple_error:;
16643   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Summary", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
16644   __pyx_L3_error:;
16645   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_Summary", __pyx_clineno, __pyx_lineno, __pyx_filename);
16646   __Pyx_RefNannyFinishContext();
16647   return NULL;
16648   __pyx_L4_argument_unpacking_done:;
16649   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_6__pyx_unpickle_Summary(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
16650 
16651   /* function exit code */
16652   __Pyx_RefNannyFinishContext();
16653   return __pyx_r;
16654 }
16655 
__pyx_pf_2bx_6arrays_10array_tree_6__pyx_unpickle_Summary(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)16656 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_6__pyx_unpickle_Summary(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
16657   PyObject *__pyx_v___pyx_PickleError = 0;
16658   PyObject *__pyx_v___pyx_result = 0;
16659   PyObject *__pyx_r = NULL;
16660   __Pyx_RefNannyDeclarations
16661   int __pyx_t_1;
16662   PyObject *__pyx_t_2 = NULL;
16663   PyObject *__pyx_t_3 = NULL;
16664   PyObject *__pyx_t_4 = NULL;
16665   PyObject *__pyx_t_5 = NULL;
16666   int __pyx_t_6;
16667   int __pyx_lineno = 0;
16668   const char *__pyx_filename = NULL;
16669   int __pyx_clineno = 0;
16670   __Pyx_RefNannySetupContext("__pyx_unpickle_Summary", 0);
16671 
16672   /* "(tree fragment)":4
16673  *     cdef object __pyx_PickleError
16674  *     cdef object __pyx_result
16675  *     if __pyx_checksum != 0x0f4bfc5:             # <<<<<<<<<<<<<<
16676  *         from pickle import PickleError as __pyx_PickleError
16677  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0f4bfc5 = (counts, frequencies, maxs, mins, sums, sumsquares))" % __pyx_checksum)
16678  */
16679   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x0f4bfc5) != 0);
16680   if (__pyx_t_1) {
16681 
16682     /* "(tree fragment)":5
16683  *     cdef object __pyx_result
16684  *     if __pyx_checksum != 0x0f4bfc5:
16685  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
16686  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0f4bfc5 = (counts, frequencies, maxs, mins, sums, sumsquares))" % __pyx_checksum)
16687  *     __pyx_result = Summary.__new__(__pyx_type)
16688  */
16689     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
16690     __Pyx_GOTREF(__pyx_t_2);
16691     __Pyx_INCREF(__pyx_n_s_PickleError);
16692     __Pyx_GIVEREF(__pyx_n_s_PickleError);
16693     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
16694     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
16695     __Pyx_GOTREF(__pyx_t_3);
16696     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16697     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
16698     __Pyx_GOTREF(__pyx_t_2);
16699     __Pyx_INCREF(__pyx_t_2);
16700     __pyx_v___pyx_PickleError = __pyx_t_2;
16701     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16702     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16703 
16704     /* "(tree fragment)":6
16705  *     if __pyx_checksum != 0x0f4bfc5:
16706  *         from pickle import PickleError as __pyx_PickleError
16707  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0f4bfc5 = (counts, frequencies, maxs, mins, sums, sumsquares))" % __pyx_checksum)             # <<<<<<<<<<<<<<
16708  *     __pyx_result = Summary.__new__(__pyx_type)
16709  *     if __pyx_state is not None:
16710  */
16711     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
16712     __Pyx_GOTREF(__pyx_t_2);
16713     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x0f, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
16714     __Pyx_GOTREF(__pyx_t_4);
16715     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16716     __Pyx_INCREF(__pyx_v___pyx_PickleError);
16717     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
16718     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
16719       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
16720       if (likely(__pyx_t_5)) {
16721         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
16722         __Pyx_INCREF(__pyx_t_5);
16723         __Pyx_INCREF(function);
16724         __Pyx_DECREF_SET(__pyx_t_2, function);
16725       }
16726     }
16727     __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);
16728     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16729     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16730     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
16731     __Pyx_GOTREF(__pyx_t_3);
16732     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16733     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16734     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16735     __PYX_ERR(1, 6, __pyx_L1_error)
16736 
16737     /* "(tree fragment)":4
16738  *     cdef object __pyx_PickleError
16739  *     cdef object __pyx_result
16740  *     if __pyx_checksum != 0x0f4bfc5:             # <<<<<<<<<<<<<<
16741  *         from pickle import PickleError as __pyx_PickleError
16742  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0f4bfc5 = (counts, frequencies, maxs, mins, sums, sumsquares))" % __pyx_checksum)
16743  */
16744   }
16745 
16746   /* "(tree fragment)":7
16747  *         from pickle import PickleError as __pyx_PickleError
16748  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0f4bfc5 = (counts, frequencies, maxs, mins, sums, sumsquares))" % __pyx_checksum)
16749  *     __pyx_result = Summary.__new__(__pyx_type)             # <<<<<<<<<<<<<<
16750  *     if __pyx_state is not None:
16751  *         __pyx_unpickle_Summary__set_state(<Summary> __pyx_result, __pyx_state)
16752  */
16753   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_Summary), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
16754   __Pyx_GOTREF(__pyx_t_2);
16755   __pyx_t_4 = NULL;
16756   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
16757     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
16758     if (likely(__pyx_t_4)) {
16759       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
16760       __Pyx_INCREF(__pyx_t_4);
16761       __Pyx_INCREF(function);
16762       __Pyx_DECREF_SET(__pyx_t_2, function);
16763     }
16764   }
16765   __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);
16766   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16767   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
16768   __Pyx_GOTREF(__pyx_t_3);
16769   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16770   __pyx_v___pyx_result = __pyx_t_3;
16771   __pyx_t_3 = 0;
16772 
16773   /* "(tree fragment)":8
16774  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0f4bfc5 = (counts, frequencies, maxs, mins, sums, sumsquares))" % __pyx_checksum)
16775  *     __pyx_result = Summary.__new__(__pyx_type)
16776  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
16777  *         __pyx_unpickle_Summary__set_state(<Summary> __pyx_result, __pyx_state)
16778  *     return __pyx_result
16779  */
16780   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
16781   __pyx_t_6 = (__pyx_t_1 != 0);
16782   if (__pyx_t_6) {
16783 
16784     /* "(tree fragment)":9
16785  *     __pyx_result = Summary.__new__(__pyx_type)
16786  *     if __pyx_state is not None:
16787  *         __pyx_unpickle_Summary__set_state(<Summary> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
16788  *     return __pyx_result
16789  * cdef __pyx_unpickle_Summary__set_state(Summary __pyx_result, tuple __pyx_state):
16790  */
16791     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
16792     __pyx_t_3 = __pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_Summary__set_state(((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
16793     __Pyx_GOTREF(__pyx_t_3);
16794     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16795 
16796     /* "(tree fragment)":8
16797  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0f4bfc5 = (counts, frequencies, maxs, mins, sums, sumsquares))" % __pyx_checksum)
16798  *     __pyx_result = Summary.__new__(__pyx_type)
16799  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
16800  *         __pyx_unpickle_Summary__set_state(<Summary> __pyx_result, __pyx_state)
16801  *     return __pyx_result
16802  */
16803   }
16804 
16805   /* "(tree fragment)":10
16806  *     if __pyx_state is not None:
16807  *         __pyx_unpickle_Summary__set_state(<Summary> __pyx_result, __pyx_state)
16808  *     return __pyx_result             # <<<<<<<<<<<<<<
16809  * cdef __pyx_unpickle_Summary__set_state(Summary __pyx_result, tuple __pyx_state):
16810  *     __pyx_result.counts = __pyx_state[0]; __pyx_result.frequencies = __pyx_state[1]; __pyx_result.maxs = __pyx_state[2]; __pyx_result.mins = __pyx_state[3]; __pyx_result.sums = __pyx_state[4]; __pyx_result.sumsquares = __pyx_state[5]
16811  */
16812   __Pyx_XDECREF(__pyx_r);
16813   __Pyx_INCREF(__pyx_v___pyx_result);
16814   __pyx_r = __pyx_v___pyx_result;
16815   goto __pyx_L0;
16816 
16817   /* "(tree fragment)":1
16818  * def __pyx_unpickle_Summary(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
16819  *     cdef object __pyx_PickleError
16820  *     cdef object __pyx_result
16821  */
16822 
16823   /* function exit code */
16824   __pyx_L1_error:;
16825   __Pyx_XDECREF(__pyx_t_2);
16826   __Pyx_XDECREF(__pyx_t_3);
16827   __Pyx_XDECREF(__pyx_t_4);
16828   __Pyx_XDECREF(__pyx_t_5);
16829   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_Summary", __pyx_clineno, __pyx_lineno, __pyx_filename);
16830   __pyx_r = NULL;
16831   __pyx_L0:;
16832   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
16833   __Pyx_XDECREF(__pyx_v___pyx_result);
16834   __Pyx_XGIVEREF(__pyx_r);
16835   __Pyx_RefNannyFinishContext();
16836   return __pyx_r;
16837 }
16838 
16839 /* "(tree fragment)":11
16840  *         __pyx_unpickle_Summary__set_state(<Summary> __pyx_result, __pyx_state)
16841  *     return __pyx_result
16842  * cdef __pyx_unpickle_Summary__set_state(Summary __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
16843  *     __pyx_result.counts = __pyx_state[0]; __pyx_result.frequencies = __pyx_state[1]; __pyx_result.maxs = __pyx_state[2]; __pyx_result.mins = __pyx_state[3]; __pyx_result.sums = __pyx_state[4]; __pyx_result.sumsquares = __pyx_state[5]
16844  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
16845  */
16846 
__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_Summary__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_Summary * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)16847 static PyObject *__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_Summary__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_Summary *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
16848   PyObject *__pyx_r = NULL;
16849   __Pyx_RefNannyDeclarations
16850   PyObject *__pyx_t_1 = NULL;
16851   int __pyx_t_2;
16852   Py_ssize_t __pyx_t_3;
16853   int __pyx_t_4;
16854   int __pyx_t_5;
16855   PyObject *__pyx_t_6 = NULL;
16856   PyObject *__pyx_t_7 = NULL;
16857   PyObject *__pyx_t_8 = NULL;
16858   int __pyx_lineno = 0;
16859   const char *__pyx_filename = NULL;
16860   int __pyx_clineno = 0;
16861   __Pyx_RefNannySetupContext("__pyx_unpickle_Summary__set_state", 0);
16862 
16863   /* "(tree fragment)":12
16864  *     return __pyx_result
16865  * cdef __pyx_unpickle_Summary__set_state(Summary __pyx_result, tuple __pyx_state):
16866  *     __pyx_result.counts = __pyx_state[0]; __pyx_result.frequencies = __pyx_state[1]; __pyx_result.maxs = __pyx_state[2]; __pyx_result.mins = __pyx_state[3]; __pyx_result.sums = __pyx_state[4]; __pyx_result.sumsquares = __pyx_state[5]             # <<<<<<<<<<<<<<
16867  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
16868  *         __pyx_result.__dict__.update(__pyx_state[6])
16869  */
16870   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16871     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16872     __PYX_ERR(1, 12, __pyx_L1_error)
16873   }
16874   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
16875   __Pyx_GOTREF(__pyx_t_1);
16876   __Pyx_GIVEREF(__pyx_t_1);
16877   __Pyx_GOTREF(__pyx_v___pyx_result->counts);
16878   __Pyx_DECREF(__pyx_v___pyx_result->counts);
16879   __pyx_v___pyx_result->counts = __pyx_t_1;
16880   __pyx_t_1 = 0;
16881   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16882     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16883     __PYX_ERR(1, 12, __pyx_L1_error)
16884   }
16885   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
16886   __Pyx_GOTREF(__pyx_t_1);
16887   __Pyx_GIVEREF(__pyx_t_1);
16888   __Pyx_GOTREF(__pyx_v___pyx_result->frequencies);
16889   __Pyx_DECREF(__pyx_v___pyx_result->frequencies);
16890   __pyx_v___pyx_result->frequencies = __pyx_t_1;
16891   __pyx_t_1 = 0;
16892   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16893     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16894     __PYX_ERR(1, 12, __pyx_L1_error)
16895   }
16896   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
16897   __Pyx_GOTREF(__pyx_t_1);
16898   __Pyx_GIVEREF(__pyx_t_1);
16899   __Pyx_GOTREF(__pyx_v___pyx_result->maxs);
16900   __Pyx_DECREF(__pyx_v___pyx_result->maxs);
16901   __pyx_v___pyx_result->maxs = __pyx_t_1;
16902   __pyx_t_1 = 0;
16903   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16904     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16905     __PYX_ERR(1, 12, __pyx_L1_error)
16906   }
16907   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
16908   __Pyx_GOTREF(__pyx_t_1);
16909   __Pyx_GIVEREF(__pyx_t_1);
16910   __Pyx_GOTREF(__pyx_v___pyx_result->mins);
16911   __Pyx_DECREF(__pyx_v___pyx_result->mins);
16912   __pyx_v___pyx_result->mins = __pyx_t_1;
16913   __pyx_t_1 = 0;
16914   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16915     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16916     __PYX_ERR(1, 12, __pyx_L1_error)
16917   }
16918   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
16919   __Pyx_GOTREF(__pyx_t_1);
16920   __Pyx_GIVEREF(__pyx_t_1);
16921   __Pyx_GOTREF(__pyx_v___pyx_result->sums);
16922   __Pyx_DECREF(__pyx_v___pyx_result->sums);
16923   __pyx_v___pyx_result->sums = __pyx_t_1;
16924   __pyx_t_1 = 0;
16925   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16926     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16927     __PYX_ERR(1, 12, __pyx_L1_error)
16928   }
16929   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
16930   __Pyx_GOTREF(__pyx_t_1);
16931   __Pyx_GIVEREF(__pyx_t_1);
16932   __Pyx_GOTREF(__pyx_v___pyx_result->sumsquares);
16933   __Pyx_DECREF(__pyx_v___pyx_result->sumsquares);
16934   __pyx_v___pyx_result->sumsquares = __pyx_t_1;
16935   __pyx_t_1 = 0;
16936 
16937   /* "(tree fragment)":13
16938  * cdef __pyx_unpickle_Summary__set_state(Summary __pyx_result, tuple __pyx_state):
16939  *     __pyx_result.counts = __pyx_state[0]; __pyx_result.frequencies = __pyx_state[1]; __pyx_result.maxs = __pyx_state[2]; __pyx_result.mins = __pyx_state[3]; __pyx_result.sums = __pyx_state[4]; __pyx_result.sumsquares = __pyx_state[5]
16940  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
16941  *         __pyx_result.__dict__.update(__pyx_state[6])
16942  */
16943   if (unlikely(__pyx_v___pyx_state == Py_None)) {
16944     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
16945     __PYX_ERR(1, 13, __pyx_L1_error)
16946   }
16947   __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
16948   __pyx_t_4 = ((__pyx_t_3 > 6) != 0);
16949   if (__pyx_t_4) {
16950   } else {
16951     __pyx_t_2 = __pyx_t_4;
16952     goto __pyx_L4_bool_binop_done;
16953   }
16954   __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
16955   __pyx_t_5 = (__pyx_t_4 != 0);
16956   __pyx_t_2 = __pyx_t_5;
16957   __pyx_L4_bool_binop_done:;
16958   if (__pyx_t_2) {
16959 
16960     /* "(tree fragment)":14
16961  *     __pyx_result.counts = __pyx_state[0]; __pyx_result.frequencies = __pyx_state[1]; __pyx_result.maxs = __pyx_state[2]; __pyx_result.mins = __pyx_state[3]; __pyx_result.sums = __pyx_state[4]; __pyx_result.sumsquares = __pyx_state[5]
16962  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
16963  *         __pyx_result.__dict__.update(__pyx_state[6])             # <<<<<<<<<<<<<<
16964  */
16965     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
16966     __Pyx_GOTREF(__pyx_t_6);
16967     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
16968     __Pyx_GOTREF(__pyx_t_7);
16969     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16970     if (unlikely(__pyx_v___pyx_state == Py_None)) {
16971       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16972       __PYX_ERR(1, 14, __pyx_L1_error)
16973     }
16974     __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
16975     __Pyx_GOTREF(__pyx_t_6);
16976     __pyx_t_8 = NULL;
16977     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
16978       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
16979       if (likely(__pyx_t_8)) {
16980         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
16981         __Pyx_INCREF(__pyx_t_8);
16982         __Pyx_INCREF(function);
16983         __Pyx_DECREF_SET(__pyx_t_7, function);
16984       }
16985     }
16986     __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
16987     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16988     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16989     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
16990     __Pyx_GOTREF(__pyx_t_1);
16991     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16992     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16993 
16994     /* "(tree fragment)":13
16995  * cdef __pyx_unpickle_Summary__set_state(Summary __pyx_result, tuple __pyx_state):
16996  *     __pyx_result.counts = __pyx_state[0]; __pyx_result.frequencies = __pyx_state[1]; __pyx_result.maxs = __pyx_state[2]; __pyx_result.mins = __pyx_state[3]; __pyx_result.sums = __pyx_state[4]; __pyx_result.sumsquares = __pyx_state[5]
16997  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
16998  *         __pyx_result.__dict__.update(__pyx_state[6])
16999  */
17000   }
17001 
17002   /* "(tree fragment)":11
17003  *         __pyx_unpickle_Summary__set_state(<Summary> __pyx_result, __pyx_state)
17004  *     return __pyx_result
17005  * cdef __pyx_unpickle_Summary__set_state(Summary __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
17006  *     __pyx_result.counts = __pyx_state[0]; __pyx_result.frequencies = __pyx_state[1]; __pyx_result.maxs = __pyx_state[2]; __pyx_result.mins = __pyx_state[3]; __pyx_result.sums = __pyx_state[4]; __pyx_result.sumsquares = __pyx_state[5]
17007  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
17008  */
17009 
17010   /* function exit code */
17011   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17012   goto __pyx_L0;
17013   __pyx_L1_error:;
17014   __Pyx_XDECREF(__pyx_t_1);
17015   __Pyx_XDECREF(__pyx_t_6);
17016   __Pyx_XDECREF(__pyx_t_7);
17017   __Pyx_XDECREF(__pyx_t_8);
17018   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_Summary__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
17019   __pyx_r = 0;
17020   __pyx_L0:;
17021   __Pyx_XGIVEREF(__pyx_r);
17022   __Pyx_RefNannyFinishContext();
17023   return __pyx_r;
17024 }
17025 
17026 /* "(tree fragment)":1
17027  * def __pyx_unpickle_ArrayTree(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
17028  *     cdef object __pyx_PickleError
17029  *     cdef object __pyx_result
17030  */
17031 
17032 /* Python wrapper */
17033 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9__pyx_unpickle_ArrayTree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17034 static PyMethodDef __pyx_mdef_2bx_6arrays_10array_tree_9__pyx_unpickle_ArrayTree = {"__pyx_unpickle_ArrayTree", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_9__pyx_unpickle_ArrayTree, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2bx_6arrays_10array_tree_9__pyx_unpickle_ArrayTree(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)17035 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_9__pyx_unpickle_ArrayTree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17036   PyObject *__pyx_v___pyx_type = 0;
17037   long __pyx_v___pyx_checksum;
17038   PyObject *__pyx_v___pyx_state = 0;
17039   int __pyx_lineno = 0;
17040   const char *__pyx_filename = NULL;
17041   int __pyx_clineno = 0;
17042   PyObject *__pyx_r = 0;
17043   __Pyx_RefNannyDeclarations
17044   __Pyx_RefNannySetupContext("__pyx_unpickle_ArrayTree (wrapper)", 0);
17045   {
17046     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
17047     PyObject* values[3] = {0,0,0};
17048     if (unlikely(__pyx_kwds)) {
17049       Py_ssize_t kw_args;
17050       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17051       switch (pos_args) {
17052         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17053         CYTHON_FALLTHROUGH;
17054         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17055         CYTHON_FALLTHROUGH;
17056         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17057         CYTHON_FALLTHROUGH;
17058         case  0: break;
17059         default: goto __pyx_L5_argtuple_error;
17060       }
17061       kw_args = PyDict_Size(__pyx_kwds);
17062       switch (pos_args) {
17063         case  0:
17064         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
17065         else goto __pyx_L5_argtuple_error;
17066         CYTHON_FALLTHROUGH;
17067         case  1:
17068         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
17069         else {
17070           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ArrayTree", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
17071         }
17072         CYTHON_FALLTHROUGH;
17073         case  2:
17074         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
17075         else {
17076           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ArrayTree", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
17077         }
17078       }
17079       if (unlikely(kw_args > 0)) {
17080         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_ArrayTree") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
17081       }
17082     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
17083       goto __pyx_L5_argtuple_error;
17084     } else {
17085       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17086       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17087       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17088     }
17089     __pyx_v___pyx_type = values[0];
17090     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
17091     __pyx_v___pyx_state = values[2];
17092   }
17093   goto __pyx_L4_argument_unpacking_done;
17094   __pyx_L5_argtuple_error:;
17095   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ArrayTree", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
17096   __pyx_L3_error:;
17097   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_ArrayTree", __pyx_clineno, __pyx_lineno, __pyx_filename);
17098   __Pyx_RefNannyFinishContext();
17099   return NULL;
17100   __pyx_L4_argument_unpacking_done:;
17101   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_8__pyx_unpickle_ArrayTree(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
17102 
17103   /* function exit code */
17104   __Pyx_RefNannyFinishContext();
17105   return __pyx_r;
17106 }
17107 
__pyx_pf_2bx_6arrays_10array_tree_8__pyx_unpickle_ArrayTree(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)17108 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_8__pyx_unpickle_ArrayTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
17109   PyObject *__pyx_v___pyx_PickleError = 0;
17110   PyObject *__pyx_v___pyx_result = 0;
17111   PyObject *__pyx_r = NULL;
17112   __Pyx_RefNannyDeclarations
17113   int __pyx_t_1;
17114   PyObject *__pyx_t_2 = NULL;
17115   PyObject *__pyx_t_3 = NULL;
17116   PyObject *__pyx_t_4 = NULL;
17117   PyObject *__pyx_t_5 = NULL;
17118   int __pyx_t_6;
17119   int __pyx_lineno = 0;
17120   const char *__pyx_filename = NULL;
17121   int __pyx_clineno = 0;
17122   __Pyx_RefNannySetupContext("__pyx_unpickle_ArrayTree", 0);
17123 
17124   /* "(tree fragment)":4
17125  *     cdef object __pyx_PickleError
17126  *     cdef object __pyx_result
17127  *     if __pyx_checksum != 0x69195cf:             # <<<<<<<<<<<<<<
17128  *         from pickle import PickleError as __pyx_PickleError
17129  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x69195cf = (block_size, dtype, levels, max, no_leaves, root))" % __pyx_checksum)
17130  */
17131   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x69195cf) != 0);
17132   if (__pyx_t_1) {
17133 
17134     /* "(tree fragment)":5
17135  *     cdef object __pyx_result
17136  *     if __pyx_checksum != 0x69195cf:
17137  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
17138  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x69195cf = (block_size, dtype, levels, max, no_leaves, root))" % __pyx_checksum)
17139  *     __pyx_result = ArrayTree.__new__(__pyx_type)
17140  */
17141     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
17142     __Pyx_GOTREF(__pyx_t_2);
17143     __Pyx_INCREF(__pyx_n_s_PickleError);
17144     __Pyx_GIVEREF(__pyx_n_s_PickleError);
17145     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
17146     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
17147     __Pyx_GOTREF(__pyx_t_3);
17148     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17149     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
17150     __Pyx_GOTREF(__pyx_t_2);
17151     __Pyx_INCREF(__pyx_t_2);
17152     __pyx_v___pyx_PickleError = __pyx_t_2;
17153     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17154     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17155 
17156     /* "(tree fragment)":6
17157  *     if __pyx_checksum != 0x69195cf:
17158  *         from pickle import PickleError as __pyx_PickleError
17159  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x69195cf = (block_size, dtype, levels, max, no_leaves, root))" % __pyx_checksum)             # <<<<<<<<<<<<<<
17160  *     __pyx_result = ArrayTree.__new__(__pyx_type)
17161  *     if __pyx_state is not None:
17162  */
17163     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
17164     __Pyx_GOTREF(__pyx_t_2);
17165     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x69, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
17166     __Pyx_GOTREF(__pyx_t_4);
17167     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17168     __Pyx_INCREF(__pyx_v___pyx_PickleError);
17169     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
17170     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
17171       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
17172       if (likely(__pyx_t_5)) {
17173         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
17174         __Pyx_INCREF(__pyx_t_5);
17175         __Pyx_INCREF(function);
17176         __Pyx_DECREF_SET(__pyx_t_2, function);
17177       }
17178     }
17179     __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);
17180     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17181     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17182     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
17183     __Pyx_GOTREF(__pyx_t_3);
17184     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17185     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17186     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17187     __PYX_ERR(1, 6, __pyx_L1_error)
17188 
17189     /* "(tree fragment)":4
17190  *     cdef object __pyx_PickleError
17191  *     cdef object __pyx_result
17192  *     if __pyx_checksum != 0x69195cf:             # <<<<<<<<<<<<<<
17193  *         from pickle import PickleError as __pyx_PickleError
17194  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x69195cf = (block_size, dtype, levels, max, no_leaves, root))" % __pyx_checksum)
17195  */
17196   }
17197 
17198   /* "(tree fragment)":7
17199  *         from pickle import PickleError as __pyx_PickleError
17200  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x69195cf = (block_size, dtype, levels, max, no_leaves, root))" % __pyx_checksum)
17201  *     __pyx_result = ArrayTree.__new__(__pyx_type)             # <<<<<<<<<<<<<<
17202  *     if __pyx_state is not None:
17203  *         __pyx_unpickle_ArrayTree__set_state(<ArrayTree> __pyx_result, __pyx_state)
17204  */
17205   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_ArrayTree), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
17206   __Pyx_GOTREF(__pyx_t_2);
17207   __pyx_t_4 = NULL;
17208   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
17209     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
17210     if (likely(__pyx_t_4)) {
17211       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
17212       __Pyx_INCREF(__pyx_t_4);
17213       __Pyx_INCREF(function);
17214       __Pyx_DECREF_SET(__pyx_t_2, function);
17215     }
17216   }
17217   __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);
17218   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
17219   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
17220   __Pyx_GOTREF(__pyx_t_3);
17221   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17222   __pyx_v___pyx_result = __pyx_t_3;
17223   __pyx_t_3 = 0;
17224 
17225   /* "(tree fragment)":8
17226  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x69195cf = (block_size, dtype, levels, max, no_leaves, root))" % __pyx_checksum)
17227  *     __pyx_result = ArrayTree.__new__(__pyx_type)
17228  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
17229  *         __pyx_unpickle_ArrayTree__set_state(<ArrayTree> __pyx_result, __pyx_state)
17230  *     return __pyx_result
17231  */
17232   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
17233   __pyx_t_6 = (__pyx_t_1 != 0);
17234   if (__pyx_t_6) {
17235 
17236     /* "(tree fragment)":9
17237  *     __pyx_result = ArrayTree.__new__(__pyx_type)
17238  *     if __pyx_state is not None:
17239  *         __pyx_unpickle_ArrayTree__set_state(<ArrayTree> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
17240  *     return __pyx_result
17241  * cdef __pyx_unpickle_ArrayTree__set_state(ArrayTree __pyx_result, tuple __pyx_state):
17242  */
17243     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
17244     __pyx_t_3 = __pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_ArrayTree__set_state(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
17245     __Pyx_GOTREF(__pyx_t_3);
17246     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17247 
17248     /* "(tree fragment)":8
17249  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x69195cf = (block_size, dtype, levels, max, no_leaves, root))" % __pyx_checksum)
17250  *     __pyx_result = ArrayTree.__new__(__pyx_type)
17251  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
17252  *         __pyx_unpickle_ArrayTree__set_state(<ArrayTree> __pyx_result, __pyx_state)
17253  *     return __pyx_result
17254  */
17255   }
17256 
17257   /* "(tree fragment)":10
17258  *     if __pyx_state is not None:
17259  *         __pyx_unpickle_ArrayTree__set_state(<ArrayTree> __pyx_result, __pyx_state)
17260  *     return __pyx_result             # <<<<<<<<<<<<<<
17261  * cdef __pyx_unpickle_ArrayTree__set_state(ArrayTree __pyx_result, tuple __pyx_state):
17262  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.dtype = __pyx_state[1]; __pyx_result.levels = __pyx_state[2]; __pyx_result.max = __pyx_state[3]; __pyx_result.no_leaves = __pyx_state[4]; __pyx_result.root = __pyx_state[5]
17263  */
17264   __Pyx_XDECREF(__pyx_r);
17265   __Pyx_INCREF(__pyx_v___pyx_result);
17266   __pyx_r = __pyx_v___pyx_result;
17267   goto __pyx_L0;
17268 
17269   /* "(tree fragment)":1
17270  * def __pyx_unpickle_ArrayTree(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
17271  *     cdef object __pyx_PickleError
17272  *     cdef object __pyx_result
17273  */
17274 
17275   /* function exit code */
17276   __pyx_L1_error:;
17277   __Pyx_XDECREF(__pyx_t_2);
17278   __Pyx_XDECREF(__pyx_t_3);
17279   __Pyx_XDECREF(__pyx_t_4);
17280   __Pyx_XDECREF(__pyx_t_5);
17281   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_ArrayTree", __pyx_clineno, __pyx_lineno, __pyx_filename);
17282   __pyx_r = NULL;
17283   __pyx_L0:;
17284   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
17285   __Pyx_XDECREF(__pyx_v___pyx_result);
17286   __Pyx_XGIVEREF(__pyx_r);
17287   __Pyx_RefNannyFinishContext();
17288   return __pyx_r;
17289 }
17290 
17291 /* "(tree fragment)":11
17292  *         __pyx_unpickle_ArrayTree__set_state(<ArrayTree> __pyx_result, __pyx_state)
17293  *     return __pyx_result
17294  * cdef __pyx_unpickle_ArrayTree__set_state(ArrayTree __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
17295  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.dtype = __pyx_state[1]; __pyx_result.levels = __pyx_state[2]; __pyx_result.max = __pyx_state[3]; __pyx_result.no_leaves = __pyx_state[4]; __pyx_result.root = __pyx_state[5]
17296  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
17297  */
17298 
__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_ArrayTree__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)17299 static PyObject *__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_ArrayTree__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
17300   PyObject *__pyx_r = NULL;
17301   __Pyx_RefNannyDeclarations
17302   PyObject *__pyx_t_1 = NULL;
17303   int __pyx_t_2;
17304   int __pyx_t_3;
17305   Py_ssize_t __pyx_t_4;
17306   int __pyx_t_5;
17307   int __pyx_t_6;
17308   PyObject *__pyx_t_7 = NULL;
17309   PyObject *__pyx_t_8 = NULL;
17310   PyObject *__pyx_t_9 = NULL;
17311   int __pyx_lineno = 0;
17312   const char *__pyx_filename = NULL;
17313   int __pyx_clineno = 0;
17314   __Pyx_RefNannySetupContext("__pyx_unpickle_ArrayTree__set_state", 0);
17315 
17316   /* "(tree fragment)":12
17317  *     return __pyx_result
17318  * cdef __pyx_unpickle_ArrayTree__set_state(ArrayTree __pyx_result, tuple __pyx_state):
17319  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.dtype = __pyx_state[1]; __pyx_result.levels = __pyx_state[2]; __pyx_result.max = __pyx_state[3]; __pyx_result.no_leaves = __pyx_state[4]; __pyx_result.root = __pyx_state[5]             # <<<<<<<<<<<<<<
17320  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
17321  *         __pyx_result.__dict__.update(__pyx_state[6])
17322  */
17323   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17324     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17325     __PYX_ERR(1, 12, __pyx_L1_error)
17326   }
17327   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
17328   __Pyx_GOTREF(__pyx_t_1);
17329   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
17330   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17331   __pyx_v___pyx_result->block_size = __pyx_t_2;
17332   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17333     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17334     __PYX_ERR(1, 12, __pyx_L1_error)
17335   }
17336   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
17337   __Pyx_GOTREF(__pyx_t_1);
17338   __Pyx_GIVEREF(__pyx_t_1);
17339   __Pyx_GOTREF(__pyx_v___pyx_result->dtype);
17340   __Pyx_DECREF(__pyx_v___pyx_result->dtype);
17341   __pyx_v___pyx_result->dtype = __pyx_t_1;
17342   __pyx_t_1 = 0;
17343   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17344     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17345     __PYX_ERR(1, 12, __pyx_L1_error)
17346   }
17347   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
17348   __Pyx_GOTREF(__pyx_t_1);
17349   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
17350   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17351   __pyx_v___pyx_result->levels = __pyx_t_2;
17352   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17353     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17354     __PYX_ERR(1, 12, __pyx_L1_error)
17355   }
17356   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
17357   __Pyx_GOTREF(__pyx_t_1);
17358   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
17359   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17360   __pyx_v___pyx_result->max = __pyx_t_2;
17361   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17362     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17363     __PYX_ERR(1, 12, __pyx_L1_error)
17364   }
17365   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
17366   __Pyx_GOTREF(__pyx_t_1);
17367   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
17368   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17369   __pyx_v___pyx_result->no_leaves = __pyx_t_2;
17370   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17371     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17372     __PYX_ERR(1, 12, __pyx_L1_error)
17373   }
17374   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
17375   __Pyx_GOTREF(__pyx_t_1);
17376   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2bx_6arrays_10array_tree_ArrayTreeNode))))) __PYX_ERR(1, 12, __pyx_L1_error)
17377   __Pyx_GIVEREF(__pyx_t_1);
17378   __Pyx_GOTREF(__pyx_v___pyx_result->root);
17379   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->root));
17380   __pyx_v___pyx_result->root = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_t_1);
17381   __pyx_t_1 = 0;
17382 
17383   /* "(tree fragment)":13
17384  * cdef __pyx_unpickle_ArrayTree__set_state(ArrayTree __pyx_result, tuple __pyx_state):
17385  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.dtype = __pyx_state[1]; __pyx_result.levels = __pyx_state[2]; __pyx_result.max = __pyx_state[3]; __pyx_result.no_leaves = __pyx_state[4]; __pyx_result.root = __pyx_state[5]
17386  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
17387  *         __pyx_result.__dict__.update(__pyx_state[6])
17388  */
17389   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17390     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
17391     __PYX_ERR(1, 13, __pyx_L1_error)
17392   }
17393   __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
17394   __pyx_t_5 = ((__pyx_t_4 > 6) != 0);
17395   if (__pyx_t_5) {
17396   } else {
17397     __pyx_t_3 = __pyx_t_5;
17398     goto __pyx_L4_bool_binop_done;
17399   }
17400   __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
17401   __pyx_t_6 = (__pyx_t_5 != 0);
17402   __pyx_t_3 = __pyx_t_6;
17403   __pyx_L4_bool_binop_done:;
17404   if (__pyx_t_3) {
17405 
17406     /* "(tree fragment)":14
17407  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.dtype = __pyx_state[1]; __pyx_result.levels = __pyx_state[2]; __pyx_result.max = __pyx_state[3]; __pyx_result.no_leaves = __pyx_state[4]; __pyx_result.root = __pyx_state[5]
17408  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
17409  *         __pyx_result.__dict__.update(__pyx_state[6])             # <<<<<<<<<<<<<<
17410  */
17411     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
17412     __Pyx_GOTREF(__pyx_t_7);
17413     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
17414     __Pyx_GOTREF(__pyx_t_8);
17415     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17416     if (unlikely(__pyx_v___pyx_state == Py_None)) {
17417       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17418       __PYX_ERR(1, 14, __pyx_L1_error)
17419     }
17420     __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
17421     __Pyx_GOTREF(__pyx_t_7);
17422     __pyx_t_9 = NULL;
17423     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
17424       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
17425       if (likely(__pyx_t_9)) {
17426         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
17427         __Pyx_INCREF(__pyx_t_9);
17428         __Pyx_INCREF(function);
17429         __Pyx_DECREF_SET(__pyx_t_8, function);
17430       }
17431     }
17432     __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
17433     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17434     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17435     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
17436     __Pyx_GOTREF(__pyx_t_1);
17437     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17438     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17439 
17440     /* "(tree fragment)":13
17441  * cdef __pyx_unpickle_ArrayTree__set_state(ArrayTree __pyx_result, tuple __pyx_state):
17442  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.dtype = __pyx_state[1]; __pyx_result.levels = __pyx_state[2]; __pyx_result.max = __pyx_state[3]; __pyx_result.no_leaves = __pyx_state[4]; __pyx_result.root = __pyx_state[5]
17443  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
17444  *         __pyx_result.__dict__.update(__pyx_state[6])
17445  */
17446   }
17447 
17448   /* "(tree fragment)":11
17449  *         __pyx_unpickle_ArrayTree__set_state(<ArrayTree> __pyx_result, __pyx_state)
17450  *     return __pyx_result
17451  * cdef __pyx_unpickle_ArrayTree__set_state(ArrayTree __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
17452  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.dtype = __pyx_state[1]; __pyx_result.levels = __pyx_state[2]; __pyx_result.max = __pyx_state[3]; __pyx_result.no_leaves = __pyx_state[4]; __pyx_result.root = __pyx_state[5]
17453  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
17454  */
17455 
17456   /* function exit code */
17457   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17458   goto __pyx_L0;
17459   __pyx_L1_error:;
17460   __Pyx_XDECREF(__pyx_t_1);
17461   __Pyx_XDECREF(__pyx_t_7);
17462   __Pyx_XDECREF(__pyx_t_8);
17463   __Pyx_XDECREF(__pyx_t_9);
17464   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_ArrayTree__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
17465   __pyx_r = 0;
17466   __pyx_L0:;
17467   __Pyx_XGIVEREF(__pyx_r);
17468   __Pyx_RefNannyFinishContext();
17469   return __pyx_r;
17470 }
17471 
17472 /* "(tree fragment)":1
17473  * def __pyx_unpickle_ArrayTreeNode(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
17474  *     cdef object __pyx_PickleError
17475  *     cdef object __pyx_result
17476  */
17477 
17478 /* Python wrapper */
17479 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_11__pyx_unpickle_ArrayTreeNode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17480 static PyMethodDef __pyx_mdef_2bx_6arrays_10array_tree_11__pyx_unpickle_ArrayTreeNode = {"__pyx_unpickle_ArrayTreeNode", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_11__pyx_unpickle_ArrayTreeNode, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2bx_6arrays_10array_tree_11__pyx_unpickle_ArrayTreeNode(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)17481 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_11__pyx_unpickle_ArrayTreeNode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17482   PyObject *__pyx_v___pyx_type = 0;
17483   long __pyx_v___pyx_checksum;
17484   PyObject *__pyx_v___pyx_state = 0;
17485   int __pyx_lineno = 0;
17486   const char *__pyx_filename = NULL;
17487   int __pyx_clineno = 0;
17488   PyObject *__pyx_r = 0;
17489   __Pyx_RefNannyDeclarations
17490   __Pyx_RefNannySetupContext("__pyx_unpickle_ArrayTreeNode (wrapper)", 0);
17491   {
17492     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
17493     PyObject* values[3] = {0,0,0};
17494     if (unlikely(__pyx_kwds)) {
17495       Py_ssize_t kw_args;
17496       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17497       switch (pos_args) {
17498         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17499         CYTHON_FALLTHROUGH;
17500         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17501         CYTHON_FALLTHROUGH;
17502         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17503         CYTHON_FALLTHROUGH;
17504         case  0: break;
17505         default: goto __pyx_L5_argtuple_error;
17506       }
17507       kw_args = PyDict_Size(__pyx_kwds);
17508       switch (pos_args) {
17509         case  0:
17510         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
17511         else goto __pyx_L5_argtuple_error;
17512         CYTHON_FALLTHROUGH;
17513         case  1:
17514         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
17515         else {
17516           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ArrayTreeNode", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
17517         }
17518         CYTHON_FALLTHROUGH;
17519         case  2:
17520         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
17521         else {
17522           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ArrayTreeNode", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
17523         }
17524       }
17525       if (unlikely(kw_args > 0)) {
17526         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_ArrayTreeNode") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
17527       }
17528     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
17529       goto __pyx_L5_argtuple_error;
17530     } else {
17531       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17532       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17533       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17534     }
17535     __pyx_v___pyx_type = values[0];
17536     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
17537     __pyx_v___pyx_state = values[2];
17538   }
17539   goto __pyx_L4_argument_unpacking_done;
17540   __pyx_L5_argtuple_error:;
17541   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ArrayTreeNode", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
17542   __pyx_L3_error:;
17543   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_ArrayTreeNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
17544   __Pyx_RefNannyFinishContext();
17545   return NULL;
17546   __pyx_L4_argument_unpacking_done:;
17547   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_10__pyx_unpickle_ArrayTreeNode(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
17548 
17549   /* function exit code */
17550   __Pyx_RefNannyFinishContext();
17551   return __pyx_r;
17552 }
17553 
__pyx_pf_2bx_6arrays_10array_tree_10__pyx_unpickle_ArrayTreeNode(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)17554 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_10__pyx_unpickle_ArrayTreeNode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
17555   PyObject *__pyx_v___pyx_PickleError = 0;
17556   PyObject *__pyx_v___pyx_result = 0;
17557   PyObject *__pyx_r = NULL;
17558   __Pyx_RefNannyDeclarations
17559   int __pyx_t_1;
17560   PyObject *__pyx_t_2 = NULL;
17561   PyObject *__pyx_t_3 = NULL;
17562   PyObject *__pyx_t_4 = NULL;
17563   PyObject *__pyx_t_5 = NULL;
17564   int __pyx_t_6;
17565   int __pyx_lineno = 0;
17566   const char *__pyx_filename = NULL;
17567   int __pyx_clineno = 0;
17568   __Pyx_RefNannySetupContext("__pyx_unpickle_ArrayTreeNode", 0);
17569 
17570   /* "(tree fragment)":4
17571  *     cdef object __pyx_PickleError
17572  *     cdef object __pyx_result
17573  *     if __pyx_checksum != 0xebb9478:             # <<<<<<<<<<<<<<
17574  *         from pickle import PickleError as __pyx_PickleError
17575  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xebb9478 = (block_size, child_size, children, level, max, min, start_offset, summary, tree))" % __pyx_checksum)
17576  */
17577   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xebb9478) != 0);
17578   if (__pyx_t_1) {
17579 
17580     /* "(tree fragment)":5
17581  *     cdef object __pyx_result
17582  *     if __pyx_checksum != 0xebb9478:
17583  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
17584  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xebb9478 = (block_size, child_size, children, level, max, min, start_offset, summary, tree))" % __pyx_checksum)
17585  *     __pyx_result = ArrayTreeNode.__new__(__pyx_type)
17586  */
17587     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
17588     __Pyx_GOTREF(__pyx_t_2);
17589     __Pyx_INCREF(__pyx_n_s_PickleError);
17590     __Pyx_GIVEREF(__pyx_n_s_PickleError);
17591     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
17592     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
17593     __Pyx_GOTREF(__pyx_t_3);
17594     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17595     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
17596     __Pyx_GOTREF(__pyx_t_2);
17597     __Pyx_INCREF(__pyx_t_2);
17598     __pyx_v___pyx_PickleError = __pyx_t_2;
17599     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17600     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17601 
17602     /* "(tree fragment)":6
17603  *     if __pyx_checksum != 0xebb9478:
17604  *         from pickle import PickleError as __pyx_PickleError
17605  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xebb9478 = (block_size, child_size, children, level, max, min, start_offset, summary, tree))" % __pyx_checksum)             # <<<<<<<<<<<<<<
17606  *     __pyx_result = ArrayTreeNode.__new__(__pyx_type)
17607  *     if __pyx_state is not None:
17608  */
17609     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
17610     __Pyx_GOTREF(__pyx_t_2);
17611     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xeb, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
17612     __Pyx_GOTREF(__pyx_t_4);
17613     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17614     __Pyx_INCREF(__pyx_v___pyx_PickleError);
17615     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
17616     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
17617       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
17618       if (likely(__pyx_t_5)) {
17619         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
17620         __Pyx_INCREF(__pyx_t_5);
17621         __Pyx_INCREF(function);
17622         __Pyx_DECREF_SET(__pyx_t_2, function);
17623       }
17624     }
17625     __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);
17626     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17627     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17628     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
17629     __Pyx_GOTREF(__pyx_t_3);
17630     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17631     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17632     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17633     __PYX_ERR(1, 6, __pyx_L1_error)
17634 
17635     /* "(tree fragment)":4
17636  *     cdef object __pyx_PickleError
17637  *     cdef object __pyx_result
17638  *     if __pyx_checksum != 0xebb9478:             # <<<<<<<<<<<<<<
17639  *         from pickle import PickleError as __pyx_PickleError
17640  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xebb9478 = (block_size, child_size, children, level, max, min, start_offset, summary, tree))" % __pyx_checksum)
17641  */
17642   }
17643 
17644   /* "(tree fragment)":7
17645  *         from pickle import PickleError as __pyx_PickleError
17646  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xebb9478 = (block_size, child_size, children, level, max, min, start_offset, summary, tree))" % __pyx_checksum)
17647  *     __pyx_result = ArrayTreeNode.__new__(__pyx_type)             # <<<<<<<<<<<<<<
17648  *     if __pyx_state is not None:
17649  *         __pyx_unpickle_ArrayTreeNode__set_state(<ArrayTreeNode> __pyx_result, __pyx_state)
17650  */
17651   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_ArrayTreeNode), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
17652   __Pyx_GOTREF(__pyx_t_2);
17653   __pyx_t_4 = NULL;
17654   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
17655     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
17656     if (likely(__pyx_t_4)) {
17657       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
17658       __Pyx_INCREF(__pyx_t_4);
17659       __Pyx_INCREF(function);
17660       __Pyx_DECREF_SET(__pyx_t_2, function);
17661     }
17662   }
17663   __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);
17664   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
17665   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
17666   __Pyx_GOTREF(__pyx_t_3);
17667   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17668   __pyx_v___pyx_result = __pyx_t_3;
17669   __pyx_t_3 = 0;
17670 
17671   /* "(tree fragment)":8
17672  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xebb9478 = (block_size, child_size, children, level, max, min, start_offset, summary, tree))" % __pyx_checksum)
17673  *     __pyx_result = ArrayTreeNode.__new__(__pyx_type)
17674  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
17675  *         __pyx_unpickle_ArrayTreeNode__set_state(<ArrayTreeNode> __pyx_result, __pyx_state)
17676  *     return __pyx_result
17677  */
17678   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
17679   __pyx_t_6 = (__pyx_t_1 != 0);
17680   if (__pyx_t_6) {
17681 
17682     /* "(tree fragment)":9
17683  *     __pyx_result = ArrayTreeNode.__new__(__pyx_type)
17684  *     if __pyx_state is not None:
17685  *         __pyx_unpickle_ArrayTreeNode__set_state(<ArrayTreeNode> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
17686  *     return __pyx_result
17687  * cdef __pyx_unpickle_ArrayTreeNode__set_state(ArrayTreeNode __pyx_result, tuple __pyx_state):
17688  */
17689     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
17690     __pyx_t_3 = __pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_ArrayTreeNode__set_state(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
17691     __Pyx_GOTREF(__pyx_t_3);
17692     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17693 
17694     /* "(tree fragment)":8
17695  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xebb9478 = (block_size, child_size, children, level, max, min, start_offset, summary, tree))" % __pyx_checksum)
17696  *     __pyx_result = ArrayTreeNode.__new__(__pyx_type)
17697  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
17698  *         __pyx_unpickle_ArrayTreeNode__set_state(<ArrayTreeNode> __pyx_result, __pyx_state)
17699  *     return __pyx_result
17700  */
17701   }
17702 
17703   /* "(tree fragment)":10
17704  *     if __pyx_state is not None:
17705  *         __pyx_unpickle_ArrayTreeNode__set_state(<ArrayTreeNode> __pyx_result, __pyx_state)
17706  *     return __pyx_result             # <<<<<<<<<<<<<<
17707  * cdef __pyx_unpickle_ArrayTreeNode__set_state(ArrayTreeNode __pyx_result, tuple __pyx_state):
17708  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.child_size = __pyx_state[1]; __pyx_result.children = __pyx_state[2]; __pyx_result.level = __pyx_state[3]; __pyx_result.max = __pyx_state[4]; __pyx_result.min = __pyx_state[5]; __pyx_result.start_offset = __pyx_state[6]; __pyx_result.summary = __pyx_state[7]; __pyx_result.tree = __pyx_state[8]
17709  */
17710   __Pyx_XDECREF(__pyx_r);
17711   __Pyx_INCREF(__pyx_v___pyx_result);
17712   __pyx_r = __pyx_v___pyx_result;
17713   goto __pyx_L0;
17714 
17715   /* "(tree fragment)":1
17716  * def __pyx_unpickle_ArrayTreeNode(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
17717  *     cdef object __pyx_PickleError
17718  *     cdef object __pyx_result
17719  */
17720 
17721   /* function exit code */
17722   __pyx_L1_error:;
17723   __Pyx_XDECREF(__pyx_t_2);
17724   __Pyx_XDECREF(__pyx_t_3);
17725   __Pyx_XDECREF(__pyx_t_4);
17726   __Pyx_XDECREF(__pyx_t_5);
17727   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_ArrayTreeNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
17728   __pyx_r = NULL;
17729   __pyx_L0:;
17730   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
17731   __Pyx_XDECREF(__pyx_v___pyx_result);
17732   __Pyx_XGIVEREF(__pyx_r);
17733   __Pyx_RefNannyFinishContext();
17734   return __pyx_r;
17735 }
17736 
17737 /* "(tree fragment)":11
17738  *         __pyx_unpickle_ArrayTreeNode__set_state(<ArrayTreeNode> __pyx_result, __pyx_state)
17739  *     return __pyx_result
17740  * cdef __pyx_unpickle_ArrayTreeNode__set_state(ArrayTreeNode __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
17741  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.child_size = __pyx_state[1]; __pyx_result.children = __pyx_state[2]; __pyx_result.level = __pyx_state[3]; __pyx_result.max = __pyx_state[4]; __pyx_result.min = __pyx_state[5]; __pyx_result.start_offset = __pyx_state[6]; __pyx_result.summary = __pyx_state[7]; __pyx_result.tree = __pyx_state[8]
17742  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
17743  */
17744 
__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_ArrayTreeNode__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)17745 static PyObject *__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_ArrayTreeNode__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
17746   PyObject *__pyx_r = NULL;
17747   __Pyx_RefNannyDeclarations
17748   PyObject *__pyx_t_1 = NULL;
17749   int __pyx_t_2;
17750   long __pyx_t_3;
17751   int __pyx_t_4;
17752   Py_ssize_t __pyx_t_5;
17753   int __pyx_t_6;
17754   int __pyx_t_7;
17755   PyObject *__pyx_t_8 = NULL;
17756   PyObject *__pyx_t_9 = NULL;
17757   PyObject *__pyx_t_10 = NULL;
17758   int __pyx_lineno = 0;
17759   const char *__pyx_filename = NULL;
17760   int __pyx_clineno = 0;
17761   __Pyx_RefNannySetupContext("__pyx_unpickle_ArrayTreeNode__set_state", 0);
17762 
17763   /* "(tree fragment)":12
17764  *     return __pyx_result
17765  * cdef __pyx_unpickle_ArrayTreeNode__set_state(ArrayTreeNode __pyx_result, tuple __pyx_state):
17766  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.child_size = __pyx_state[1]; __pyx_result.children = __pyx_state[2]; __pyx_result.level = __pyx_state[3]; __pyx_result.max = __pyx_state[4]; __pyx_result.min = __pyx_state[5]; __pyx_result.start_offset = __pyx_state[6]; __pyx_result.summary = __pyx_state[7]; __pyx_result.tree = __pyx_state[8]             # <<<<<<<<<<<<<<
17767  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
17768  *         __pyx_result.__dict__.update(__pyx_state[9])
17769  */
17770   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17771     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17772     __PYX_ERR(1, 12, __pyx_L1_error)
17773   }
17774   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
17775   __Pyx_GOTREF(__pyx_t_1);
17776   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
17777   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17778   __pyx_v___pyx_result->block_size = __pyx_t_2;
17779   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17780     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17781     __PYX_ERR(1, 12, __pyx_L1_error)
17782   }
17783   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
17784   __Pyx_GOTREF(__pyx_t_1);
17785   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
17786   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17787   __pyx_v___pyx_result->child_size = __pyx_t_2;
17788   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17789     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17790     __PYX_ERR(1, 12, __pyx_L1_error)
17791   }
17792   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
17793   __Pyx_GOTREF(__pyx_t_1);
17794   __Pyx_GIVEREF(__pyx_t_1);
17795   __Pyx_GOTREF(__pyx_v___pyx_result->children);
17796   __Pyx_DECREF(__pyx_v___pyx_result->children);
17797   __pyx_v___pyx_result->children = __pyx_t_1;
17798   __pyx_t_1 = 0;
17799   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17800     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17801     __PYX_ERR(1, 12, __pyx_L1_error)
17802   }
17803   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
17804   __Pyx_GOTREF(__pyx_t_1);
17805   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
17806   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17807   __pyx_v___pyx_result->level = __pyx_t_2;
17808   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17809     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17810     __PYX_ERR(1, 12, __pyx_L1_error)
17811   }
17812   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
17813   __Pyx_GOTREF(__pyx_t_1);
17814   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
17815   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17816   __pyx_v___pyx_result->max = __pyx_t_2;
17817   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17818     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17819     __PYX_ERR(1, 12, __pyx_L1_error)
17820   }
17821   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
17822   __Pyx_GOTREF(__pyx_t_1);
17823   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
17824   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17825   __pyx_v___pyx_result->min = __pyx_t_2;
17826   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17827     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17828     __PYX_ERR(1, 12, __pyx_L1_error)
17829   }
17830   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
17831   __Pyx_GOTREF(__pyx_t_1);
17832   __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
17833   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17834   __pyx_v___pyx_result->start_offset = __pyx_t_3;
17835   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17836     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17837     __PYX_ERR(1, 12, __pyx_L1_error)
17838   }
17839   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
17840   __Pyx_GOTREF(__pyx_t_1);
17841   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2bx_6arrays_10array_tree_Summary))))) __PYX_ERR(1, 12, __pyx_L1_error)
17842   __Pyx_GIVEREF(__pyx_t_1);
17843   __Pyx_GOTREF(__pyx_v___pyx_result->summary);
17844   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->summary));
17845   __pyx_v___pyx_result->summary = ((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)__pyx_t_1);
17846   __pyx_t_1 = 0;
17847   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17848     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17849     __PYX_ERR(1, 12, __pyx_L1_error)
17850   }
17851   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
17852   __Pyx_GOTREF(__pyx_t_1);
17853   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2bx_6arrays_10array_tree_ArrayTree))))) __PYX_ERR(1, 12, __pyx_L1_error)
17854   __Pyx_GIVEREF(__pyx_t_1);
17855   __Pyx_GOTREF(__pyx_v___pyx_result->tree);
17856   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->tree));
17857   __pyx_v___pyx_result->tree = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_t_1);
17858   __pyx_t_1 = 0;
17859 
17860   /* "(tree fragment)":13
17861  * cdef __pyx_unpickle_ArrayTreeNode__set_state(ArrayTreeNode __pyx_result, tuple __pyx_state):
17862  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.child_size = __pyx_state[1]; __pyx_result.children = __pyx_state[2]; __pyx_result.level = __pyx_state[3]; __pyx_result.max = __pyx_state[4]; __pyx_result.min = __pyx_state[5]; __pyx_result.start_offset = __pyx_state[6]; __pyx_result.summary = __pyx_state[7]; __pyx_result.tree = __pyx_state[8]
17863  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
17864  *         __pyx_result.__dict__.update(__pyx_state[9])
17865  */
17866   if (unlikely(__pyx_v___pyx_state == Py_None)) {
17867     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
17868     __PYX_ERR(1, 13, __pyx_L1_error)
17869   }
17870   __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
17871   __pyx_t_6 = ((__pyx_t_5 > 9) != 0);
17872   if (__pyx_t_6) {
17873   } else {
17874     __pyx_t_4 = __pyx_t_6;
17875     goto __pyx_L4_bool_binop_done;
17876   }
17877   __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict_2); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
17878   __pyx_t_7 = (__pyx_t_6 != 0);
17879   __pyx_t_4 = __pyx_t_7;
17880   __pyx_L4_bool_binop_done:;
17881   if (__pyx_t_4) {
17882 
17883     /* "(tree fragment)":14
17884  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.child_size = __pyx_state[1]; __pyx_result.children = __pyx_state[2]; __pyx_result.level = __pyx_state[3]; __pyx_result.max = __pyx_state[4]; __pyx_result.min = __pyx_state[5]; __pyx_result.start_offset = __pyx_state[6]; __pyx_result.summary = __pyx_state[7]; __pyx_result.tree = __pyx_state[8]
17885  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
17886  *         __pyx_result.__dict__.update(__pyx_state[9])             # <<<<<<<<<<<<<<
17887  */
17888     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
17889     __Pyx_GOTREF(__pyx_t_8);
17890     __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
17891     __Pyx_GOTREF(__pyx_t_9);
17892     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17893     if (unlikely(__pyx_v___pyx_state == Py_None)) {
17894       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17895       __PYX_ERR(1, 14, __pyx_L1_error)
17896     }
17897     __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
17898     __Pyx_GOTREF(__pyx_t_8);
17899     __pyx_t_10 = NULL;
17900     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
17901       __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
17902       if (likely(__pyx_t_10)) {
17903         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
17904         __Pyx_INCREF(__pyx_t_10);
17905         __Pyx_INCREF(function);
17906         __Pyx_DECREF_SET(__pyx_t_9, function);
17907       }
17908     }
17909     __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);
17910     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
17911     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17912     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
17913     __Pyx_GOTREF(__pyx_t_1);
17914     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17915     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17916 
17917     /* "(tree fragment)":13
17918  * cdef __pyx_unpickle_ArrayTreeNode__set_state(ArrayTreeNode __pyx_result, tuple __pyx_state):
17919  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.child_size = __pyx_state[1]; __pyx_result.children = __pyx_state[2]; __pyx_result.level = __pyx_state[3]; __pyx_result.max = __pyx_state[4]; __pyx_result.min = __pyx_state[5]; __pyx_result.start_offset = __pyx_state[6]; __pyx_result.summary = __pyx_state[7]; __pyx_result.tree = __pyx_state[8]
17920  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
17921  *         __pyx_result.__dict__.update(__pyx_state[9])
17922  */
17923   }
17924 
17925   /* "(tree fragment)":11
17926  *         __pyx_unpickle_ArrayTreeNode__set_state(<ArrayTreeNode> __pyx_result, __pyx_state)
17927  *     return __pyx_result
17928  * cdef __pyx_unpickle_ArrayTreeNode__set_state(ArrayTreeNode __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
17929  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.child_size = __pyx_state[1]; __pyx_result.children = __pyx_state[2]; __pyx_result.level = __pyx_state[3]; __pyx_result.max = __pyx_state[4]; __pyx_result.min = __pyx_state[5]; __pyx_result.start_offset = __pyx_state[6]; __pyx_result.summary = __pyx_state[7]; __pyx_result.tree = __pyx_state[8]
17930  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
17931  */
17932 
17933   /* function exit code */
17934   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17935   goto __pyx_L0;
17936   __pyx_L1_error:;
17937   __Pyx_XDECREF(__pyx_t_1);
17938   __Pyx_XDECREF(__pyx_t_8);
17939   __Pyx_XDECREF(__pyx_t_9);
17940   __Pyx_XDECREF(__pyx_t_10);
17941   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_ArrayTreeNode__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
17942   __pyx_r = 0;
17943   __pyx_L0:;
17944   __Pyx_XGIVEREF(__pyx_r);
17945   __Pyx_RefNannyFinishContext();
17946   return __pyx_r;
17947 }
17948 
17949 /* "(tree fragment)":1
17950  * def __pyx_unpickle_ArrayTreeLeaf(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
17951  *     cdef object __pyx_PickleError
17952  *     cdef object __pyx_result
17953  */
17954 
17955 /* Python wrapper */
17956 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13__pyx_unpickle_ArrayTreeLeaf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17957 static PyMethodDef __pyx_mdef_2bx_6arrays_10array_tree_13__pyx_unpickle_ArrayTreeLeaf = {"__pyx_unpickle_ArrayTreeLeaf", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_13__pyx_unpickle_ArrayTreeLeaf, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2bx_6arrays_10array_tree_13__pyx_unpickle_ArrayTreeLeaf(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)17958 static PyObject *__pyx_pw_2bx_6arrays_10array_tree_13__pyx_unpickle_ArrayTreeLeaf(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17959   PyObject *__pyx_v___pyx_type = 0;
17960   long __pyx_v___pyx_checksum;
17961   PyObject *__pyx_v___pyx_state = 0;
17962   int __pyx_lineno = 0;
17963   const char *__pyx_filename = NULL;
17964   int __pyx_clineno = 0;
17965   PyObject *__pyx_r = 0;
17966   __Pyx_RefNannyDeclarations
17967   __Pyx_RefNannySetupContext("__pyx_unpickle_ArrayTreeLeaf (wrapper)", 0);
17968   {
17969     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
17970     PyObject* values[3] = {0,0,0};
17971     if (unlikely(__pyx_kwds)) {
17972       Py_ssize_t kw_args;
17973       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17974       switch (pos_args) {
17975         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17976         CYTHON_FALLTHROUGH;
17977         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17978         CYTHON_FALLTHROUGH;
17979         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17980         CYTHON_FALLTHROUGH;
17981         case  0: break;
17982         default: goto __pyx_L5_argtuple_error;
17983       }
17984       kw_args = PyDict_Size(__pyx_kwds);
17985       switch (pos_args) {
17986         case  0:
17987         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
17988         else goto __pyx_L5_argtuple_error;
17989         CYTHON_FALLTHROUGH;
17990         case  1:
17991         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
17992         else {
17993           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ArrayTreeLeaf", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
17994         }
17995         CYTHON_FALLTHROUGH;
17996         case  2:
17997         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
17998         else {
17999           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ArrayTreeLeaf", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
18000         }
18001       }
18002       if (unlikely(kw_args > 0)) {
18003         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_ArrayTreeLeaf") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
18004       }
18005     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
18006       goto __pyx_L5_argtuple_error;
18007     } else {
18008       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18009       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18010       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18011     }
18012     __pyx_v___pyx_type = values[0];
18013     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18014     __pyx_v___pyx_state = values[2];
18015   }
18016   goto __pyx_L4_argument_unpacking_done;
18017   __pyx_L5_argtuple_error:;
18018   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ArrayTreeLeaf", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
18019   __pyx_L3_error:;
18020   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_ArrayTreeLeaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
18021   __Pyx_RefNannyFinishContext();
18022   return NULL;
18023   __pyx_L4_argument_unpacking_done:;
18024   __pyx_r = __pyx_pf_2bx_6arrays_10array_tree_12__pyx_unpickle_ArrayTreeLeaf(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18025 
18026   /* function exit code */
18027   __Pyx_RefNannyFinishContext();
18028   return __pyx_r;
18029 }
18030 
__pyx_pf_2bx_6arrays_10array_tree_12__pyx_unpickle_ArrayTreeLeaf(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)18031 static PyObject *__pyx_pf_2bx_6arrays_10array_tree_12__pyx_unpickle_ArrayTreeLeaf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
18032   PyObject *__pyx_v___pyx_PickleError = 0;
18033   PyObject *__pyx_v___pyx_result = 0;
18034   PyObject *__pyx_r = NULL;
18035   __Pyx_RefNannyDeclarations
18036   int __pyx_t_1;
18037   PyObject *__pyx_t_2 = NULL;
18038   PyObject *__pyx_t_3 = NULL;
18039   PyObject *__pyx_t_4 = NULL;
18040   PyObject *__pyx_t_5 = NULL;
18041   int __pyx_t_6;
18042   int __pyx_lineno = 0;
18043   const char *__pyx_filename = NULL;
18044   int __pyx_clineno = 0;
18045   __Pyx_RefNannySetupContext("__pyx_unpickle_ArrayTreeLeaf", 0);
18046 
18047   /* "(tree fragment)":4
18048  *     cdef object __pyx_PickleError
18049  *     cdef object __pyx_result
18050  *     if __pyx_checksum != 0xc1230b0:             # <<<<<<<<<<<<<<
18051  *         from pickle import PickleError as __pyx_PickleError
18052  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc1230b0 = (frequency, max, min, start_offset, tree, values))" % __pyx_checksum)
18053  */
18054   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xc1230b0) != 0);
18055   if (__pyx_t_1) {
18056 
18057     /* "(tree fragment)":5
18058  *     cdef object __pyx_result
18059  *     if __pyx_checksum != 0xc1230b0:
18060  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
18061  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc1230b0 = (frequency, max, min, start_offset, tree, values))" % __pyx_checksum)
18062  *     __pyx_result = ArrayTreeLeaf.__new__(__pyx_type)
18063  */
18064     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
18065     __Pyx_GOTREF(__pyx_t_2);
18066     __Pyx_INCREF(__pyx_n_s_PickleError);
18067     __Pyx_GIVEREF(__pyx_n_s_PickleError);
18068     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
18069     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
18070     __Pyx_GOTREF(__pyx_t_3);
18071     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18072     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
18073     __Pyx_GOTREF(__pyx_t_2);
18074     __Pyx_INCREF(__pyx_t_2);
18075     __pyx_v___pyx_PickleError = __pyx_t_2;
18076     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18077     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18078 
18079     /* "(tree fragment)":6
18080  *     if __pyx_checksum != 0xc1230b0:
18081  *         from pickle import PickleError as __pyx_PickleError
18082  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc1230b0 = (frequency, max, min, start_offset, tree, values))" % __pyx_checksum)             # <<<<<<<<<<<<<<
18083  *     __pyx_result = ArrayTreeLeaf.__new__(__pyx_type)
18084  *     if __pyx_state is not None:
18085  */
18086     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
18087     __Pyx_GOTREF(__pyx_t_2);
18088     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xc1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
18089     __Pyx_GOTREF(__pyx_t_4);
18090     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18091     __Pyx_INCREF(__pyx_v___pyx_PickleError);
18092     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
18093     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
18094       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
18095       if (likely(__pyx_t_5)) {
18096         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
18097         __Pyx_INCREF(__pyx_t_5);
18098         __Pyx_INCREF(function);
18099         __Pyx_DECREF_SET(__pyx_t_2, function);
18100       }
18101     }
18102     __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);
18103     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18104     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18105     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
18106     __Pyx_GOTREF(__pyx_t_3);
18107     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18108     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
18109     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18110     __PYX_ERR(1, 6, __pyx_L1_error)
18111 
18112     /* "(tree fragment)":4
18113  *     cdef object __pyx_PickleError
18114  *     cdef object __pyx_result
18115  *     if __pyx_checksum != 0xc1230b0:             # <<<<<<<<<<<<<<
18116  *         from pickle import PickleError as __pyx_PickleError
18117  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc1230b0 = (frequency, max, min, start_offset, tree, values))" % __pyx_checksum)
18118  */
18119   }
18120 
18121   /* "(tree fragment)":7
18122  *         from pickle import PickleError as __pyx_PickleError
18123  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc1230b0 = (frequency, max, min, start_offset, tree, values))" % __pyx_checksum)
18124  *     __pyx_result = ArrayTreeLeaf.__new__(__pyx_type)             # <<<<<<<<<<<<<<
18125  *     if __pyx_state is not None:
18126  *         __pyx_unpickle_ArrayTreeLeaf__set_state(<ArrayTreeLeaf> __pyx_result, __pyx_state)
18127  */
18128   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_ArrayTreeLeaf), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
18129   __Pyx_GOTREF(__pyx_t_2);
18130   __pyx_t_4 = NULL;
18131   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
18132     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
18133     if (likely(__pyx_t_4)) {
18134       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
18135       __Pyx_INCREF(__pyx_t_4);
18136       __Pyx_INCREF(function);
18137       __Pyx_DECREF_SET(__pyx_t_2, function);
18138     }
18139   }
18140   __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);
18141   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
18142   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
18143   __Pyx_GOTREF(__pyx_t_3);
18144   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18145   __pyx_v___pyx_result = __pyx_t_3;
18146   __pyx_t_3 = 0;
18147 
18148   /* "(tree fragment)":8
18149  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc1230b0 = (frequency, max, min, start_offset, tree, values))" % __pyx_checksum)
18150  *     __pyx_result = ArrayTreeLeaf.__new__(__pyx_type)
18151  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
18152  *         __pyx_unpickle_ArrayTreeLeaf__set_state(<ArrayTreeLeaf> __pyx_result, __pyx_state)
18153  *     return __pyx_result
18154  */
18155   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
18156   __pyx_t_6 = (__pyx_t_1 != 0);
18157   if (__pyx_t_6) {
18158 
18159     /* "(tree fragment)":9
18160  *     __pyx_result = ArrayTreeLeaf.__new__(__pyx_type)
18161  *     if __pyx_state is not None:
18162  *         __pyx_unpickle_ArrayTreeLeaf__set_state(<ArrayTreeLeaf> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
18163  *     return __pyx_result
18164  * cdef __pyx_unpickle_ArrayTreeLeaf__set_state(ArrayTreeLeaf __pyx_result, tuple __pyx_state):
18165  */
18166     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
18167     __pyx_t_3 = __pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_ArrayTreeLeaf__set_state(((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
18168     __Pyx_GOTREF(__pyx_t_3);
18169     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18170 
18171     /* "(tree fragment)":8
18172  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xc1230b0 = (frequency, max, min, start_offset, tree, values))" % __pyx_checksum)
18173  *     __pyx_result = ArrayTreeLeaf.__new__(__pyx_type)
18174  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
18175  *         __pyx_unpickle_ArrayTreeLeaf__set_state(<ArrayTreeLeaf> __pyx_result, __pyx_state)
18176  *     return __pyx_result
18177  */
18178   }
18179 
18180   /* "(tree fragment)":10
18181  *     if __pyx_state is not None:
18182  *         __pyx_unpickle_ArrayTreeLeaf__set_state(<ArrayTreeLeaf> __pyx_result, __pyx_state)
18183  *     return __pyx_result             # <<<<<<<<<<<<<<
18184  * cdef __pyx_unpickle_ArrayTreeLeaf__set_state(ArrayTreeLeaf __pyx_result, tuple __pyx_state):
18185  *     __pyx_result.frequency = __pyx_state[0]; __pyx_result.max = __pyx_state[1]; __pyx_result.min = __pyx_state[2]; __pyx_result.start_offset = __pyx_state[3]; __pyx_result.tree = __pyx_state[4]; __pyx_result.values = __pyx_state[5]
18186  */
18187   __Pyx_XDECREF(__pyx_r);
18188   __Pyx_INCREF(__pyx_v___pyx_result);
18189   __pyx_r = __pyx_v___pyx_result;
18190   goto __pyx_L0;
18191 
18192   /* "(tree fragment)":1
18193  * def __pyx_unpickle_ArrayTreeLeaf(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
18194  *     cdef object __pyx_PickleError
18195  *     cdef object __pyx_result
18196  */
18197 
18198   /* function exit code */
18199   __pyx_L1_error:;
18200   __Pyx_XDECREF(__pyx_t_2);
18201   __Pyx_XDECREF(__pyx_t_3);
18202   __Pyx_XDECREF(__pyx_t_4);
18203   __Pyx_XDECREF(__pyx_t_5);
18204   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_ArrayTreeLeaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
18205   __pyx_r = NULL;
18206   __pyx_L0:;
18207   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
18208   __Pyx_XDECREF(__pyx_v___pyx_result);
18209   __Pyx_XGIVEREF(__pyx_r);
18210   __Pyx_RefNannyFinishContext();
18211   return __pyx_r;
18212 }
18213 
18214 /* "(tree fragment)":11
18215  *         __pyx_unpickle_ArrayTreeLeaf__set_state(<ArrayTreeLeaf> __pyx_result, __pyx_state)
18216  *     return __pyx_result
18217  * cdef __pyx_unpickle_ArrayTreeLeaf__set_state(ArrayTreeLeaf __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
18218  *     __pyx_result.frequency = __pyx_state[0]; __pyx_result.max = __pyx_state[1]; __pyx_result.min = __pyx_state[2]; __pyx_result.start_offset = __pyx_state[3]; __pyx_result.tree = __pyx_state[4]; __pyx_result.values = __pyx_state[5]
18219  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
18220  */
18221 
__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_ArrayTreeLeaf__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)18222 static PyObject *__pyx_f_2bx_6arrays_10array_tree___pyx_unpickle_ArrayTreeLeaf__set_state(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
18223   PyObject *__pyx_r = NULL;
18224   __Pyx_RefNannyDeclarations
18225   PyObject *__pyx_t_1 = NULL;
18226   int __pyx_t_2;
18227   long __pyx_t_3;
18228   int __pyx_t_4;
18229   Py_ssize_t __pyx_t_5;
18230   int __pyx_t_6;
18231   int __pyx_t_7;
18232   PyObject *__pyx_t_8 = NULL;
18233   PyObject *__pyx_t_9 = NULL;
18234   PyObject *__pyx_t_10 = NULL;
18235   int __pyx_lineno = 0;
18236   const char *__pyx_filename = NULL;
18237   int __pyx_clineno = 0;
18238   __Pyx_RefNannySetupContext("__pyx_unpickle_ArrayTreeLeaf__set_state", 0);
18239 
18240   /* "(tree fragment)":12
18241  *     return __pyx_result
18242  * cdef __pyx_unpickle_ArrayTreeLeaf__set_state(ArrayTreeLeaf __pyx_result, tuple __pyx_state):
18243  *     __pyx_result.frequency = __pyx_state[0]; __pyx_result.max = __pyx_state[1]; __pyx_result.min = __pyx_state[2]; __pyx_result.start_offset = __pyx_state[3]; __pyx_result.tree = __pyx_state[4]; __pyx_result.values = __pyx_state[5]             # <<<<<<<<<<<<<<
18244  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
18245  *         __pyx_result.__dict__.update(__pyx_state[6])
18246  */
18247   if (unlikely(__pyx_v___pyx_state == Py_None)) {
18248     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18249     __PYX_ERR(1, 12, __pyx_L1_error)
18250   }
18251   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
18252   __Pyx_GOTREF(__pyx_t_1);
18253   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
18254   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18255   __pyx_v___pyx_result->frequency = __pyx_t_2;
18256   if (unlikely(__pyx_v___pyx_state == Py_None)) {
18257     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18258     __PYX_ERR(1, 12, __pyx_L1_error)
18259   }
18260   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
18261   __Pyx_GOTREF(__pyx_t_1);
18262   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
18263   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18264   __pyx_v___pyx_result->max = __pyx_t_2;
18265   if (unlikely(__pyx_v___pyx_state == Py_None)) {
18266     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18267     __PYX_ERR(1, 12, __pyx_L1_error)
18268   }
18269   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
18270   __Pyx_GOTREF(__pyx_t_1);
18271   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
18272   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18273   __pyx_v___pyx_result->min = __pyx_t_2;
18274   if (unlikely(__pyx_v___pyx_state == Py_None)) {
18275     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18276     __PYX_ERR(1, 12, __pyx_L1_error)
18277   }
18278   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
18279   __Pyx_GOTREF(__pyx_t_1);
18280   __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
18281   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18282   __pyx_v___pyx_result->start_offset = __pyx_t_3;
18283   if (unlikely(__pyx_v___pyx_state == Py_None)) {
18284     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18285     __PYX_ERR(1, 12, __pyx_L1_error)
18286   }
18287   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
18288   __Pyx_GOTREF(__pyx_t_1);
18289   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2bx_6arrays_10array_tree_ArrayTree))))) __PYX_ERR(1, 12, __pyx_L1_error)
18290   __Pyx_GIVEREF(__pyx_t_1);
18291   __Pyx_GOTREF(__pyx_v___pyx_result->tree);
18292   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->tree));
18293   __pyx_v___pyx_result->tree = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)__pyx_t_1);
18294   __pyx_t_1 = 0;
18295   if (unlikely(__pyx_v___pyx_state == Py_None)) {
18296     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18297     __PYX_ERR(1, 12, __pyx_L1_error)
18298   }
18299   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
18300   __Pyx_GOTREF(__pyx_t_1);
18301   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
18302   __Pyx_GIVEREF(__pyx_t_1);
18303   __Pyx_GOTREF(__pyx_v___pyx_result->values);
18304   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->values));
18305   __pyx_v___pyx_result->values = ((PyArrayObject *)__pyx_t_1);
18306   __pyx_t_1 = 0;
18307 
18308   /* "(tree fragment)":13
18309  * cdef __pyx_unpickle_ArrayTreeLeaf__set_state(ArrayTreeLeaf __pyx_result, tuple __pyx_state):
18310  *     __pyx_result.frequency = __pyx_state[0]; __pyx_result.max = __pyx_state[1]; __pyx_result.min = __pyx_state[2]; __pyx_result.start_offset = __pyx_state[3]; __pyx_result.tree = __pyx_state[4]; __pyx_result.values = __pyx_state[5]
18311  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
18312  *         __pyx_result.__dict__.update(__pyx_state[6])
18313  */
18314   if (unlikely(__pyx_v___pyx_state == Py_None)) {
18315     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
18316     __PYX_ERR(1, 13, __pyx_L1_error)
18317   }
18318   __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
18319   __pyx_t_6 = ((__pyx_t_5 > 6) != 0);
18320   if (__pyx_t_6) {
18321   } else {
18322     __pyx_t_4 = __pyx_t_6;
18323     goto __pyx_L4_bool_binop_done;
18324   }
18325   __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict_2); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
18326   __pyx_t_7 = (__pyx_t_6 != 0);
18327   __pyx_t_4 = __pyx_t_7;
18328   __pyx_L4_bool_binop_done:;
18329   if (__pyx_t_4) {
18330 
18331     /* "(tree fragment)":14
18332  *     __pyx_result.frequency = __pyx_state[0]; __pyx_result.max = __pyx_state[1]; __pyx_result.min = __pyx_state[2]; __pyx_result.start_offset = __pyx_state[3]; __pyx_result.tree = __pyx_state[4]; __pyx_result.values = __pyx_state[5]
18333  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
18334  *         __pyx_result.__dict__.update(__pyx_state[6])             # <<<<<<<<<<<<<<
18335  */
18336     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
18337     __Pyx_GOTREF(__pyx_t_8);
18338     __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
18339     __Pyx_GOTREF(__pyx_t_9);
18340     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18341     if (unlikely(__pyx_v___pyx_state == Py_None)) {
18342       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18343       __PYX_ERR(1, 14, __pyx_L1_error)
18344     }
18345     __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
18346     __Pyx_GOTREF(__pyx_t_8);
18347     __pyx_t_10 = NULL;
18348     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
18349       __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
18350       if (likely(__pyx_t_10)) {
18351         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
18352         __Pyx_INCREF(__pyx_t_10);
18353         __Pyx_INCREF(function);
18354         __Pyx_DECREF_SET(__pyx_t_9, function);
18355       }
18356     }
18357     __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);
18358     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
18359     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18360     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
18361     __Pyx_GOTREF(__pyx_t_1);
18362     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18363     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18364 
18365     /* "(tree fragment)":13
18366  * cdef __pyx_unpickle_ArrayTreeLeaf__set_state(ArrayTreeLeaf __pyx_result, tuple __pyx_state):
18367  *     __pyx_result.frequency = __pyx_state[0]; __pyx_result.max = __pyx_state[1]; __pyx_result.min = __pyx_state[2]; __pyx_result.start_offset = __pyx_state[3]; __pyx_result.tree = __pyx_state[4]; __pyx_result.values = __pyx_state[5]
18368  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
18369  *         __pyx_result.__dict__.update(__pyx_state[6])
18370  */
18371   }
18372 
18373   /* "(tree fragment)":11
18374  *         __pyx_unpickle_ArrayTreeLeaf__set_state(<ArrayTreeLeaf> __pyx_result, __pyx_state)
18375  *     return __pyx_result
18376  * cdef __pyx_unpickle_ArrayTreeLeaf__set_state(ArrayTreeLeaf __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
18377  *     __pyx_result.frequency = __pyx_state[0]; __pyx_result.max = __pyx_state[1]; __pyx_result.min = __pyx_state[2]; __pyx_result.start_offset = __pyx_state[3]; __pyx_result.tree = __pyx_state[4]; __pyx_result.values = __pyx_state[5]
18378  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
18379  */
18380 
18381   /* function exit code */
18382   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18383   goto __pyx_L0;
18384   __pyx_L1_error:;
18385   __Pyx_XDECREF(__pyx_t_1);
18386   __Pyx_XDECREF(__pyx_t_8);
18387   __Pyx_XDECREF(__pyx_t_9);
18388   __Pyx_XDECREF(__pyx_t_10);
18389   __Pyx_AddTraceback("bx.arrays.array_tree.__pyx_unpickle_ArrayTreeLeaf__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
18390   __pyx_r = 0;
18391   __pyx_L0:;
18392   __Pyx_XGIVEREF(__pyx_r);
18393   __Pyx_RefNannyFinishContext();
18394   return __pyx_r;
18395 }
18396 
18397 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":735
18398  * ctypedef npy_cdouble     complex_t
18399  *
18400  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
18401  *     return PyArray_MultiIterNew(1, <void*>a)
18402  *
18403  */
18404 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)18405 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
18406   PyObject *__pyx_r = NULL;
18407   __Pyx_RefNannyDeclarations
18408   PyObject *__pyx_t_1 = NULL;
18409   int __pyx_lineno = 0;
18410   const char *__pyx_filename = NULL;
18411   int __pyx_clineno = 0;
18412   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
18413 
18414   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":736
18415  *
18416  * cdef inline object PyArray_MultiIterNew1(a):
18417  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
18418  *
18419  * cdef inline object PyArray_MultiIterNew2(a, b):
18420  */
18421   __Pyx_XDECREF(__pyx_r);
18422   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
18423   __Pyx_GOTREF(__pyx_t_1);
18424   __pyx_r = __pyx_t_1;
18425   __pyx_t_1 = 0;
18426   goto __pyx_L0;
18427 
18428   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":735
18429  * ctypedef npy_cdouble     complex_t
18430  *
18431  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
18432  *     return PyArray_MultiIterNew(1, <void*>a)
18433  *
18434  */
18435 
18436   /* function exit code */
18437   __pyx_L1_error:;
18438   __Pyx_XDECREF(__pyx_t_1);
18439   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
18440   __pyx_r = 0;
18441   __pyx_L0:;
18442   __Pyx_XGIVEREF(__pyx_r);
18443   __Pyx_RefNannyFinishContext();
18444   return __pyx_r;
18445 }
18446 
18447 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":738
18448  *     return PyArray_MultiIterNew(1, <void*>a)
18449  *
18450  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
18451  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
18452  *
18453  */
18454 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)18455 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
18456   PyObject *__pyx_r = NULL;
18457   __Pyx_RefNannyDeclarations
18458   PyObject *__pyx_t_1 = NULL;
18459   int __pyx_lineno = 0;
18460   const char *__pyx_filename = NULL;
18461   int __pyx_clineno = 0;
18462   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
18463 
18464   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":739
18465  *
18466  * cdef inline object PyArray_MultiIterNew2(a, b):
18467  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
18468  *
18469  * cdef inline object PyArray_MultiIterNew3(a, b, c):
18470  */
18471   __Pyx_XDECREF(__pyx_r);
18472   __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error)
18473   __Pyx_GOTREF(__pyx_t_1);
18474   __pyx_r = __pyx_t_1;
18475   __pyx_t_1 = 0;
18476   goto __pyx_L0;
18477 
18478   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":738
18479  *     return PyArray_MultiIterNew(1, <void*>a)
18480  *
18481  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
18482  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
18483  *
18484  */
18485 
18486   /* function exit code */
18487   __pyx_L1_error:;
18488   __Pyx_XDECREF(__pyx_t_1);
18489   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
18490   __pyx_r = 0;
18491   __pyx_L0:;
18492   __Pyx_XGIVEREF(__pyx_r);
18493   __Pyx_RefNannyFinishContext();
18494   return __pyx_r;
18495 }
18496 
18497 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":741
18498  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
18499  *
18500  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
18501  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
18502  *
18503  */
18504 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)18505 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
18506   PyObject *__pyx_r = NULL;
18507   __Pyx_RefNannyDeclarations
18508   PyObject *__pyx_t_1 = NULL;
18509   int __pyx_lineno = 0;
18510   const char *__pyx_filename = NULL;
18511   int __pyx_clineno = 0;
18512   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
18513 
18514   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":742
18515  *
18516  * cdef inline object PyArray_MultiIterNew3(a, b, c):
18517  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
18518  *
18519  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
18520  */
18521   __Pyx_XDECREF(__pyx_r);
18522   __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error)
18523   __Pyx_GOTREF(__pyx_t_1);
18524   __pyx_r = __pyx_t_1;
18525   __pyx_t_1 = 0;
18526   goto __pyx_L0;
18527 
18528   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":741
18529  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
18530  *
18531  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
18532  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
18533  *
18534  */
18535 
18536   /* function exit code */
18537   __pyx_L1_error:;
18538   __Pyx_XDECREF(__pyx_t_1);
18539   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18540   __pyx_r = 0;
18541   __pyx_L0:;
18542   __Pyx_XGIVEREF(__pyx_r);
18543   __Pyx_RefNannyFinishContext();
18544   return __pyx_r;
18545 }
18546 
18547 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":744
18548  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
18549  *
18550  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
18551  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
18552  *
18553  */
18554 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)18555 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) {
18556   PyObject *__pyx_r = NULL;
18557   __Pyx_RefNannyDeclarations
18558   PyObject *__pyx_t_1 = NULL;
18559   int __pyx_lineno = 0;
18560   const char *__pyx_filename = NULL;
18561   int __pyx_clineno = 0;
18562   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
18563 
18564   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":745
18565  *
18566  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
18567  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
18568  *
18569  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
18570  */
18571   __Pyx_XDECREF(__pyx_r);
18572   __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error)
18573   __Pyx_GOTREF(__pyx_t_1);
18574   __pyx_r = __pyx_t_1;
18575   __pyx_t_1 = 0;
18576   goto __pyx_L0;
18577 
18578   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":744
18579  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
18580  *
18581  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
18582  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
18583  *
18584  */
18585 
18586   /* function exit code */
18587   __pyx_L1_error:;
18588   __Pyx_XDECREF(__pyx_t_1);
18589   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
18590   __pyx_r = 0;
18591   __pyx_L0:;
18592   __Pyx_XGIVEREF(__pyx_r);
18593   __Pyx_RefNannyFinishContext();
18594   return __pyx_r;
18595 }
18596 
18597 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":747
18598  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
18599  *
18600  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
18601  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
18602  *
18603  */
18604 
__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)18605 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) {
18606   PyObject *__pyx_r = NULL;
18607   __Pyx_RefNannyDeclarations
18608   PyObject *__pyx_t_1 = NULL;
18609   int __pyx_lineno = 0;
18610   const char *__pyx_filename = NULL;
18611   int __pyx_clineno = 0;
18612   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
18613 
18614   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":748
18615  *
18616  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
18617  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
18618  *
18619  * cdef inline tuple PyDataType_SHAPE(dtype d):
18620  */
18621   __Pyx_XDECREF(__pyx_r);
18622   __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error)
18623   __Pyx_GOTREF(__pyx_t_1);
18624   __pyx_r = __pyx_t_1;
18625   __pyx_t_1 = 0;
18626   goto __pyx_L0;
18627 
18628   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":747
18629  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
18630  *
18631  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
18632  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
18633  *
18634  */
18635 
18636   /* function exit code */
18637   __pyx_L1_error:;
18638   __Pyx_XDECREF(__pyx_t_1);
18639   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
18640   __pyx_r = 0;
18641   __pyx_L0:;
18642   __Pyx_XGIVEREF(__pyx_r);
18643   __Pyx_RefNannyFinishContext();
18644   return __pyx_r;
18645 }
18646 
18647 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":750
18648  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
18649  *
18650  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
18651  *     if PyDataType_HASSUBARRAY(d):
18652  *         return <tuple>d.subarray.shape
18653  */
18654 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)18655 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
18656   PyObject *__pyx_r = NULL;
18657   __Pyx_RefNannyDeclarations
18658   int __pyx_t_1;
18659   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
18660 
18661   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":751
18662  *
18663  * cdef inline tuple PyDataType_SHAPE(dtype d):
18664  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
18665  *         return <tuple>d.subarray.shape
18666  *     else:
18667  */
18668   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
18669   if (__pyx_t_1) {
18670 
18671     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":752
18672  * cdef inline tuple PyDataType_SHAPE(dtype d):
18673  *     if PyDataType_HASSUBARRAY(d):
18674  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
18675  *     else:
18676  *         return ()
18677  */
18678     __Pyx_XDECREF(__pyx_r);
18679     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
18680     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
18681     goto __pyx_L0;
18682 
18683     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":751
18684  *
18685  * cdef inline tuple PyDataType_SHAPE(dtype d):
18686  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
18687  *         return <tuple>d.subarray.shape
18688  *     else:
18689  */
18690   }
18691 
18692   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":754
18693  *         return <tuple>d.subarray.shape
18694  *     else:
18695  *         return ()             # <<<<<<<<<<<<<<
18696  *
18697  *
18698  */
18699   /*else*/ {
18700     __Pyx_XDECREF(__pyx_r);
18701     __Pyx_INCREF(__pyx_empty_tuple);
18702     __pyx_r = __pyx_empty_tuple;
18703     goto __pyx_L0;
18704   }
18705 
18706   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":750
18707  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
18708  *
18709  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
18710  *     if PyDataType_HASSUBARRAY(d):
18711  *         return <tuple>d.subarray.shape
18712  */
18713 
18714   /* function exit code */
18715   __pyx_L0:;
18716   __Pyx_XGIVEREF(__pyx_r);
18717   __Pyx_RefNannyFinishContext();
18718   return __pyx_r;
18719 }
18720 
18721 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":929
18722  *     int _import_umath() except -1
18723  *
18724  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
18725  *     Py_INCREF(base) # important to do this before stealing the reference below!
18726  *     PyArray_SetBaseObject(arr, base)
18727  */
18728 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)18729 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
18730   __Pyx_RefNannyDeclarations
18731   __Pyx_RefNannySetupContext("set_array_base", 0);
18732 
18733   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":930
18734  *
18735  * cdef inline void set_array_base(ndarray arr, object base):
18736  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
18737  *     PyArray_SetBaseObject(arr, base)
18738  *
18739  */
18740   Py_INCREF(__pyx_v_base);
18741 
18742   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":931
18743  * cdef inline void set_array_base(ndarray arr, object base):
18744  *     Py_INCREF(base) # important to do this before stealing the reference below!
18745  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
18746  *
18747  * cdef inline object get_array_base(ndarray arr):
18748  */
18749   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
18750 
18751   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":929
18752  *     int _import_umath() except -1
18753  *
18754  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
18755  *     Py_INCREF(base) # important to do this before stealing the reference below!
18756  *     PyArray_SetBaseObject(arr, base)
18757  */
18758 
18759   /* function exit code */
18760   __Pyx_RefNannyFinishContext();
18761 }
18762 
18763 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":933
18764  *     PyArray_SetBaseObject(arr, base)
18765  *
18766  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
18767  *     base = PyArray_BASE(arr)
18768  *     if base is NULL:
18769  */
18770 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)18771 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
18772   PyObject *__pyx_v_base;
18773   PyObject *__pyx_r = NULL;
18774   __Pyx_RefNannyDeclarations
18775   int __pyx_t_1;
18776   __Pyx_RefNannySetupContext("get_array_base", 0);
18777 
18778   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":934
18779  *
18780  * cdef inline object get_array_base(ndarray arr):
18781  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
18782  *     if base is NULL:
18783  *         return None
18784  */
18785   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
18786 
18787   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":935
18788  * cdef inline object get_array_base(ndarray arr):
18789  *     base = PyArray_BASE(arr)
18790  *     if base is NULL:             # <<<<<<<<<<<<<<
18791  *         return None
18792  *     return <object>base
18793  */
18794   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
18795   if (__pyx_t_1) {
18796 
18797     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":936
18798  *     base = PyArray_BASE(arr)
18799  *     if base is NULL:
18800  *         return None             # <<<<<<<<<<<<<<
18801  *     return <object>base
18802  *
18803  */
18804     __Pyx_XDECREF(__pyx_r);
18805     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18806     goto __pyx_L0;
18807 
18808     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":935
18809  * cdef inline object get_array_base(ndarray arr):
18810  *     base = PyArray_BASE(arr)
18811  *     if base is NULL:             # <<<<<<<<<<<<<<
18812  *         return None
18813  *     return <object>base
18814  */
18815   }
18816 
18817   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":937
18818  *     if base is NULL:
18819  *         return None
18820  *     return <object>base             # <<<<<<<<<<<<<<
18821  *
18822  * # Versions of the import_* functions which are more suitable for
18823  */
18824   __Pyx_XDECREF(__pyx_r);
18825   __Pyx_INCREF(((PyObject *)__pyx_v_base));
18826   __pyx_r = ((PyObject *)__pyx_v_base);
18827   goto __pyx_L0;
18828 
18829   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":933
18830  *     PyArray_SetBaseObject(arr, base)
18831  *
18832  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
18833  *     base = PyArray_BASE(arr)
18834  *     if base is NULL:
18835  */
18836 
18837   /* function exit code */
18838   __pyx_L0:;
18839   __Pyx_XGIVEREF(__pyx_r);
18840   __Pyx_RefNannyFinishContext();
18841   return __pyx_r;
18842 }
18843 
18844 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":941
18845  * # Versions of the import_* functions which are more suitable for
18846  * # Cython code.
18847  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
18848  *     try:
18849  *         __pyx_import_array()
18850  */
18851 
__pyx_f_5numpy_import_array(void)18852 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
18853   int __pyx_r;
18854   __Pyx_RefNannyDeclarations
18855   PyObject *__pyx_t_1 = NULL;
18856   PyObject *__pyx_t_2 = NULL;
18857   PyObject *__pyx_t_3 = NULL;
18858   int __pyx_t_4;
18859   PyObject *__pyx_t_5 = NULL;
18860   PyObject *__pyx_t_6 = NULL;
18861   PyObject *__pyx_t_7 = NULL;
18862   PyObject *__pyx_t_8 = NULL;
18863   int __pyx_lineno = 0;
18864   const char *__pyx_filename = NULL;
18865   int __pyx_clineno = 0;
18866   __Pyx_RefNannySetupContext("import_array", 0);
18867 
18868   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":942
18869  * # Cython code.
18870  * cdef inline int import_array() except -1:
18871  *     try:             # <<<<<<<<<<<<<<
18872  *         __pyx_import_array()
18873  *     except Exception:
18874  */
18875   {
18876     __Pyx_PyThreadState_declare
18877     __Pyx_PyThreadState_assign
18878     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
18879     __Pyx_XGOTREF(__pyx_t_1);
18880     __Pyx_XGOTREF(__pyx_t_2);
18881     __Pyx_XGOTREF(__pyx_t_3);
18882     /*try:*/ {
18883 
18884       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":943
18885  * cdef inline int import_array() except -1:
18886  *     try:
18887  *         __pyx_import_array()             # <<<<<<<<<<<<<<
18888  *     except Exception:
18889  *         raise ImportError("numpy.core.multiarray failed to import")
18890  */
18891       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
18892 
18893       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":942
18894  * # Cython code.
18895  * cdef inline int import_array() except -1:
18896  *     try:             # <<<<<<<<<<<<<<
18897  *         __pyx_import_array()
18898  *     except Exception:
18899  */
18900     }
18901     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
18902     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18903     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18904     goto __pyx_L8_try_end;
18905     __pyx_L3_error:;
18906 
18907     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":944
18908  *     try:
18909  *         __pyx_import_array()
18910  *     except Exception:             # <<<<<<<<<<<<<<
18911  *         raise ImportError("numpy.core.multiarray failed to import")
18912  *
18913  */
18914     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
18915     if (__pyx_t_4) {
18916       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
18917       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
18918       __Pyx_GOTREF(__pyx_t_5);
18919       __Pyx_GOTREF(__pyx_t_6);
18920       __Pyx_GOTREF(__pyx_t_7);
18921 
18922       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":945
18923  *         __pyx_import_array()
18924  *     except Exception:
18925  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
18926  *
18927  * cdef inline int import_umath() except -1:
18928  */
18929       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
18930       __Pyx_GOTREF(__pyx_t_8);
18931       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
18932       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18933       __PYX_ERR(2, 945, __pyx_L5_except_error)
18934     }
18935     goto __pyx_L5_except_error;
18936     __pyx_L5_except_error:;
18937 
18938     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":942
18939  * # Cython code.
18940  * cdef inline int import_array() except -1:
18941  *     try:             # <<<<<<<<<<<<<<
18942  *         __pyx_import_array()
18943  *     except Exception:
18944  */
18945     __Pyx_XGIVEREF(__pyx_t_1);
18946     __Pyx_XGIVEREF(__pyx_t_2);
18947     __Pyx_XGIVEREF(__pyx_t_3);
18948     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
18949     goto __pyx_L1_error;
18950     __pyx_L8_try_end:;
18951   }
18952 
18953   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":941
18954  * # Versions of the import_* functions which are more suitable for
18955  * # Cython code.
18956  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
18957  *     try:
18958  *         __pyx_import_array()
18959  */
18960 
18961   /* function exit code */
18962   __pyx_r = 0;
18963   goto __pyx_L0;
18964   __pyx_L1_error:;
18965   __Pyx_XDECREF(__pyx_t_5);
18966   __Pyx_XDECREF(__pyx_t_6);
18967   __Pyx_XDECREF(__pyx_t_7);
18968   __Pyx_XDECREF(__pyx_t_8);
18969   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
18970   __pyx_r = -1;
18971   __pyx_L0:;
18972   __Pyx_RefNannyFinishContext();
18973   return __pyx_r;
18974 }
18975 
18976 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":947
18977  *         raise ImportError("numpy.core.multiarray failed to import")
18978  *
18979  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
18980  *     try:
18981  *         _import_umath()
18982  */
18983 
__pyx_f_5numpy_import_umath(void)18984 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
18985   int __pyx_r;
18986   __Pyx_RefNannyDeclarations
18987   PyObject *__pyx_t_1 = NULL;
18988   PyObject *__pyx_t_2 = NULL;
18989   PyObject *__pyx_t_3 = NULL;
18990   int __pyx_t_4;
18991   PyObject *__pyx_t_5 = NULL;
18992   PyObject *__pyx_t_6 = NULL;
18993   PyObject *__pyx_t_7 = NULL;
18994   PyObject *__pyx_t_8 = NULL;
18995   int __pyx_lineno = 0;
18996   const char *__pyx_filename = NULL;
18997   int __pyx_clineno = 0;
18998   __Pyx_RefNannySetupContext("import_umath", 0);
18999 
19000   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":948
19001  *
19002  * cdef inline int import_umath() except -1:
19003  *     try:             # <<<<<<<<<<<<<<
19004  *         _import_umath()
19005  *     except Exception:
19006  */
19007   {
19008     __Pyx_PyThreadState_declare
19009     __Pyx_PyThreadState_assign
19010     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
19011     __Pyx_XGOTREF(__pyx_t_1);
19012     __Pyx_XGOTREF(__pyx_t_2);
19013     __Pyx_XGOTREF(__pyx_t_3);
19014     /*try:*/ {
19015 
19016       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":949
19017  * cdef inline int import_umath() except -1:
19018  *     try:
19019  *         _import_umath()             # <<<<<<<<<<<<<<
19020  *     except Exception:
19021  *         raise ImportError("numpy.core.umath failed to import")
19022  */
19023       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
19024 
19025       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":948
19026  *
19027  * cdef inline int import_umath() except -1:
19028  *     try:             # <<<<<<<<<<<<<<
19029  *         _import_umath()
19030  *     except Exception:
19031  */
19032     }
19033     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
19034     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19035     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19036     goto __pyx_L8_try_end;
19037     __pyx_L3_error:;
19038 
19039     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":950
19040  *     try:
19041  *         _import_umath()
19042  *     except Exception:             # <<<<<<<<<<<<<<
19043  *         raise ImportError("numpy.core.umath failed to import")
19044  *
19045  */
19046     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
19047     if (__pyx_t_4) {
19048       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
19049       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
19050       __Pyx_GOTREF(__pyx_t_5);
19051       __Pyx_GOTREF(__pyx_t_6);
19052       __Pyx_GOTREF(__pyx_t_7);
19053 
19054       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":951
19055  *         _import_umath()
19056  *     except Exception:
19057  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
19058  *
19059  * cdef inline int import_ufunc() except -1:
19060  */
19061       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
19062       __Pyx_GOTREF(__pyx_t_8);
19063       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
19064       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19065       __PYX_ERR(2, 951, __pyx_L5_except_error)
19066     }
19067     goto __pyx_L5_except_error;
19068     __pyx_L5_except_error:;
19069 
19070     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":948
19071  *
19072  * cdef inline int import_umath() except -1:
19073  *     try:             # <<<<<<<<<<<<<<
19074  *         _import_umath()
19075  *     except Exception:
19076  */
19077     __Pyx_XGIVEREF(__pyx_t_1);
19078     __Pyx_XGIVEREF(__pyx_t_2);
19079     __Pyx_XGIVEREF(__pyx_t_3);
19080     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
19081     goto __pyx_L1_error;
19082     __pyx_L8_try_end:;
19083   }
19084 
19085   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":947
19086  *         raise ImportError("numpy.core.multiarray failed to import")
19087  *
19088  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
19089  *     try:
19090  *         _import_umath()
19091  */
19092 
19093   /* function exit code */
19094   __pyx_r = 0;
19095   goto __pyx_L0;
19096   __pyx_L1_error:;
19097   __Pyx_XDECREF(__pyx_t_5);
19098   __Pyx_XDECREF(__pyx_t_6);
19099   __Pyx_XDECREF(__pyx_t_7);
19100   __Pyx_XDECREF(__pyx_t_8);
19101   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
19102   __pyx_r = -1;
19103   __pyx_L0:;
19104   __Pyx_RefNannyFinishContext();
19105   return __pyx_r;
19106 }
19107 
19108 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":953
19109  *         raise ImportError("numpy.core.umath failed to import")
19110  *
19111  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
19112  *     try:
19113  *         _import_umath()
19114  */
19115 
__pyx_f_5numpy_import_ufunc(void)19116 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
19117   int __pyx_r;
19118   __Pyx_RefNannyDeclarations
19119   PyObject *__pyx_t_1 = NULL;
19120   PyObject *__pyx_t_2 = NULL;
19121   PyObject *__pyx_t_3 = NULL;
19122   int __pyx_t_4;
19123   PyObject *__pyx_t_5 = NULL;
19124   PyObject *__pyx_t_6 = NULL;
19125   PyObject *__pyx_t_7 = NULL;
19126   PyObject *__pyx_t_8 = NULL;
19127   int __pyx_lineno = 0;
19128   const char *__pyx_filename = NULL;
19129   int __pyx_clineno = 0;
19130   __Pyx_RefNannySetupContext("import_ufunc", 0);
19131 
19132   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":954
19133  *
19134  * cdef inline int import_ufunc() except -1:
19135  *     try:             # <<<<<<<<<<<<<<
19136  *         _import_umath()
19137  *     except Exception:
19138  */
19139   {
19140     __Pyx_PyThreadState_declare
19141     __Pyx_PyThreadState_assign
19142     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
19143     __Pyx_XGOTREF(__pyx_t_1);
19144     __Pyx_XGOTREF(__pyx_t_2);
19145     __Pyx_XGOTREF(__pyx_t_3);
19146     /*try:*/ {
19147 
19148       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":955
19149  * cdef inline int import_ufunc() except -1:
19150  *     try:
19151  *         _import_umath()             # <<<<<<<<<<<<<<
19152  *     except Exception:
19153  *         raise ImportError("numpy.core.umath failed to import")
19154  */
19155       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
19156 
19157       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":954
19158  *
19159  * cdef inline int import_ufunc() except -1:
19160  *     try:             # <<<<<<<<<<<<<<
19161  *         _import_umath()
19162  *     except Exception:
19163  */
19164     }
19165     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
19166     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19167     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19168     goto __pyx_L8_try_end;
19169     __pyx_L3_error:;
19170 
19171     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":956
19172  *     try:
19173  *         _import_umath()
19174  *     except Exception:             # <<<<<<<<<<<<<<
19175  *         raise ImportError("numpy.core.umath failed to import")
19176  *
19177  */
19178     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
19179     if (__pyx_t_4) {
19180       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
19181       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
19182       __Pyx_GOTREF(__pyx_t_5);
19183       __Pyx_GOTREF(__pyx_t_6);
19184       __Pyx_GOTREF(__pyx_t_7);
19185 
19186       /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":957
19187  *         _import_umath()
19188  *     except Exception:
19189  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
19190  *
19191  * cdef extern from *:
19192  */
19193       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
19194       __Pyx_GOTREF(__pyx_t_8);
19195       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
19196       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19197       __PYX_ERR(2, 957, __pyx_L5_except_error)
19198     }
19199     goto __pyx_L5_except_error;
19200     __pyx_L5_except_error:;
19201 
19202     /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":954
19203  *
19204  * cdef inline int import_ufunc() except -1:
19205  *     try:             # <<<<<<<<<<<<<<
19206  *         _import_umath()
19207  *     except Exception:
19208  */
19209     __Pyx_XGIVEREF(__pyx_t_1);
19210     __Pyx_XGIVEREF(__pyx_t_2);
19211     __Pyx_XGIVEREF(__pyx_t_3);
19212     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
19213     goto __pyx_L1_error;
19214     __pyx_L8_try_end:;
19215   }
19216 
19217   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":953
19218  *         raise ImportError("numpy.core.umath failed to import")
19219  *
19220  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
19221  *     try:
19222  *         _import_umath()
19223  */
19224 
19225   /* function exit code */
19226   __pyx_r = 0;
19227   goto __pyx_L0;
19228   __pyx_L1_error:;
19229   __Pyx_XDECREF(__pyx_t_5);
19230   __Pyx_XDECREF(__pyx_t_6);
19231   __Pyx_XDECREF(__pyx_t_7);
19232   __Pyx_XDECREF(__pyx_t_8);
19233   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
19234   __pyx_r = -1;
19235   __pyx_L0:;
19236   __Pyx_RefNannyFinishContext();
19237   return __pyx_r;
19238 }
19239 
19240 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":967
19241  *
19242  *
19243  * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
19244  *     """
19245  *     Cython equivalent of `isinstance(obj, np.timedelta64)`
19246  */
19247 
__pyx_f_5numpy_is_timedelta64_object(PyObject * __pyx_v_obj)19248 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
19249   int __pyx_r;
19250   __Pyx_RefNannyDeclarations
19251   __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
19252 
19253   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":979
19254  *     bool
19255  *     """
19256  *     return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type)             # <<<<<<<<<<<<<<
19257  *
19258  *
19259  */
19260   __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
19261   goto __pyx_L0;
19262 
19263   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":967
19264  *
19265  *
19266  * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
19267  *     """
19268  *     Cython equivalent of `isinstance(obj, np.timedelta64)`
19269  */
19270 
19271   /* function exit code */
19272   __pyx_L0:;
19273   __Pyx_RefNannyFinishContext();
19274   return __pyx_r;
19275 }
19276 
19277 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":982
19278  *
19279  *
19280  * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
19281  *     """
19282  *     Cython equivalent of `isinstance(obj, np.datetime64)`
19283  */
19284 
__pyx_f_5numpy_is_datetime64_object(PyObject * __pyx_v_obj)19285 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
19286   int __pyx_r;
19287   __Pyx_RefNannyDeclarations
19288   __Pyx_RefNannySetupContext("is_datetime64_object", 0);
19289 
19290   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":994
19291  *     bool
19292  *     """
19293  *     return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type)             # <<<<<<<<<<<<<<
19294  *
19295  *
19296  */
19297   __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
19298   goto __pyx_L0;
19299 
19300   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":982
19301  *
19302  *
19303  * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
19304  *     """
19305  *     Cython equivalent of `isinstance(obj, np.datetime64)`
19306  */
19307 
19308   /* function exit code */
19309   __pyx_L0:;
19310   __Pyx_RefNannyFinishContext();
19311   return __pyx_r;
19312 }
19313 
19314 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":997
19315  *
19316  *
19317  * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
19318  *     """
19319  *     returns the int64 value underlying scalar numpy datetime64 object
19320  */
19321 
__pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_v_obj)19322 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
19323   npy_datetime __pyx_r;
19324 
19325   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1004
19326  *     also needed.  That can be found using `get_datetime64_unit`.
19327  *     """
19328  *     return (<PyDatetimeScalarObject*>obj).obval             # <<<<<<<<<<<<<<
19329  *
19330  *
19331  */
19332   __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
19333   goto __pyx_L0;
19334 
19335   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":997
19336  *
19337  *
19338  * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
19339  *     """
19340  *     returns the int64 value underlying scalar numpy datetime64 object
19341  */
19342 
19343   /* function exit code */
19344   __pyx_L0:;
19345   return __pyx_r;
19346 }
19347 
19348 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1007
19349  *
19350  *
19351  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
19352  *     """
19353  *     returns the int64 value underlying scalar numpy timedelta64 object
19354  */
19355 
__pyx_f_5numpy_get_timedelta64_value(PyObject * __pyx_v_obj)19356 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
19357   npy_timedelta __pyx_r;
19358 
19359   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1011
19360  *     returns the int64 value underlying scalar numpy timedelta64 object
19361  *     """
19362  *     return (<PyTimedeltaScalarObject*>obj).obval             # <<<<<<<<<<<<<<
19363  *
19364  *
19365  */
19366   __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
19367   goto __pyx_L0;
19368 
19369   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1007
19370  *
19371  *
19372  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
19373  *     """
19374  *     returns the int64 value underlying scalar numpy timedelta64 object
19375  */
19376 
19377   /* function exit code */
19378   __pyx_L0:;
19379   return __pyx_r;
19380 }
19381 
19382 /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1014
19383  *
19384  *
19385  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
19386  *     """
19387  *     returns the unit part of the dtype for a numpy datetime64 object.
19388  */
19389 
__pyx_f_5numpy_get_datetime64_unit(PyObject * __pyx_v_obj)19390 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
19391   NPY_DATETIMEUNIT __pyx_r;
19392 
19393   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1018
19394  *     returns the unit part of the dtype for a numpy datetime64 object.
19395  *     """
19396  *     return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base             # <<<<<<<<<<<<<<
19397  */
19398   __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
19399   goto __pyx_L0;
19400 
19401   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1014
19402  *
19403  *
19404  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
19405  *     """
19406  *     returns the unit part of the dtype for a numpy datetime64 object.
19407  */
19408 
19409   /* function exit code */
19410   __pyx_L0:;
19411   return __pyx_r;
19412 }
19413 
__pyx_tp_new_2bx_6arrays_10array_tree_FileArrayTreeDict(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)19414 static PyObject *__pyx_tp_new_2bx_6arrays_10array_tree_FileArrayTreeDict(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
19415   struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *p;
19416   PyObject *o;
19417   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19418     o = (*t->tp_alloc)(t, 0);
19419   } else {
19420     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19421   }
19422   if (unlikely(!o)) return 0;
19423   p = ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)o);
19424   p->io = Py_None; Py_INCREF(Py_None);
19425   p->cdb_dict = Py_None; Py_INCREF(Py_None);
19426   return o;
19427 }
19428 
__pyx_tp_dealloc_2bx_6arrays_10array_tree_FileArrayTreeDict(PyObject * o)19429 static void __pyx_tp_dealloc_2bx_6arrays_10array_tree_FileArrayTreeDict(PyObject *o) {
19430   struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *p = (struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)o;
19431   #if CYTHON_USE_TP_FINALIZE
19432   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
19433     if (PyObject_CallFinalizerFromDealloc(o)) return;
19434   }
19435   #endif
19436   PyObject_GC_UnTrack(o);
19437   Py_CLEAR(p->io);
19438   Py_CLEAR(p->cdb_dict);
19439   (*Py_TYPE(o)->tp_free)(o);
19440 }
19441 
__pyx_tp_traverse_2bx_6arrays_10array_tree_FileArrayTreeDict(PyObject * o,visitproc v,void * a)19442 static int __pyx_tp_traverse_2bx_6arrays_10array_tree_FileArrayTreeDict(PyObject *o, visitproc v, void *a) {
19443   int e;
19444   struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *p = (struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)o;
19445   if (p->io) {
19446     e = (*v)(p->io, a); if (e) return e;
19447   }
19448   if (p->cdb_dict) {
19449     e = (*v)(p->cdb_dict, a); if (e) return e;
19450   }
19451   return 0;
19452 }
19453 
__pyx_tp_clear_2bx_6arrays_10array_tree_FileArrayTreeDict(PyObject * o)19454 static int __pyx_tp_clear_2bx_6arrays_10array_tree_FileArrayTreeDict(PyObject *o) {
19455   PyObject* tmp;
19456   struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *p = (struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict *)o;
19457   tmp = ((PyObject*)p->io);
19458   p->io = Py_None; Py_INCREF(Py_None);
19459   Py_XDECREF(tmp);
19460   tmp = ((PyObject*)p->cdb_dict);
19461   p->cdb_dict = Py_None; Py_INCREF(Py_None);
19462   Py_XDECREF(tmp);
19463   return 0;
19464 }
__pyx_sq_item_2bx_6arrays_10array_tree_FileArrayTreeDict(PyObject * o,Py_ssize_t i)19465 static PyObject *__pyx_sq_item_2bx_6arrays_10array_tree_FileArrayTreeDict(PyObject *o, Py_ssize_t i) {
19466   PyObject *r;
19467   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
19468   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
19469   Py_DECREF(x);
19470   return r;
19471 }
19472 
19473 static PyMethodDef __pyx_methods_2bx_6arrays_10array_tree_FileArrayTreeDict[] = {
19474   {"dict_to_file", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_5dict_to_file, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2bx_6arrays_10array_tree_17FileArrayTreeDict_4dict_to_file},
19475   {"__reduce_cython__", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_7__reduce_cython__, METH_NOARGS, 0},
19476   {"__setstate_cython__", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_9__setstate_cython__, METH_O, 0},
19477   {0, 0, 0, 0}
19478 };
19479 
19480 static PySequenceMethods __pyx_tp_as_sequence_FileArrayTreeDict = {
19481   0, /*sq_length*/
19482   0, /*sq_concat*/
19483   0, /*sq_repeat*/
19484   __pyx_sq_item_2bx_6arrays_10array_tree_FileArrayTreeDict, /*sq_item*/
19485   0, /*sq_slice*/
19486   0, /*sq_ass_item*/
19487   0, /*sq_ass_slice*/
19488   0, /*sq_contains*/
19489   0, /*sq_inplace_concat*/
19490   0, /*sq_inplace_repeat*/
19491 };
19492 
19493 static PyMappingMethods __pyx_tp_as_mapping_FileArrayTreeDict = {
19494   0, /*mp_length*/
19495   __pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_3__getitem__, /*mp_subscript*/
19496   0, /*mp_ass_subscript*/
19497 };
19498 
19499 static PyTypeObject __pyx_type_2bx_6arrays_10array_tree_FileArrayTreeDict = {
19500   PyVarObject_HEAD_INIT(0, 0)
19501   "bx.arrays.array_tree.FileArrayTreeDict", /*tp_name*/
19502   sizeof(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTreeDict), /*tp_basicsize*/
19503   0, /*tp_itemsize*/
19504   __pyx_tp_dealloc_2bx_6arrays_10array_tree_FileArrayTreeDict, /*tp_dealloc*/
19505   #if PY_VERSION_HEX < 0x030800b4
19506   0, /*tp_print*/
19507   #endif
19508   #if PY_VERSION_HEX >= 0x030800b4
19509   0, /*tp_vectorcall_offset*/
19510   #endif
19511   0, /*tp_getattr*/
19512   0, /*tp_setattr*/
19513   #if PY_MAJOR_VERSION < 3
19514   0, /*tp_compare*/
19515   #endif
19516   #if PY_MAJOR_VERSION >= 3
19517   0, /*tp_as_async*/
19518   #endif
19519   0, /*tp_repr*/
19520   0, /*tp_as_number*/
19521   &__pyx_tp_as_sequence_FileArrayTreeDict, /*tp_as_sequence*/
19522   &__pyx_tp_as_mapping_FileArrayTreeDict, /*tp_as_mapping*/
19523   0, /*tp_hash*/
19524   0, /*tp_call*/
19525   0, /*tp_str*/
19526   0, /*tp_getattro*/
19527   0, /*tp_setattro*/
19528   0, /*tp_as_buffer*/
19529   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
19530   "\n    Access to a file containing multiple array trees indexed by a string key.\n    ", /*tp_doc*/
19531   __pyx_tp_traverse_2bx_6arrays_10array_tree_FileArrayTreeDict, /*tp_traverse*/
19532   __pyx_tp_clear_2bx_6arrays_10array_tree_FileArrayTreeDict, /*tp_clear*/
19533   0, /*tp_richcompare*/
19534   0, /*tp_weaklistoffset*/
19535   0, /*tp_iter*/
19536   0, /*tp_iternext*/
19537   __pyx_methods_2bx_6arrays_10array_tree_FileArrayTreeDict, /*tp_methods*/
19538   0, /*tp_members*/
19539   0, /*tp_getset*/
19540   0, /*tp_base*/
19541   0, /*tp_dict*/
19542   0, /*tp_descr_get*/
19543   0, /*tp_descr_set*/
19544   0, /*tp_dictoffset*/
19545   __pyx_pw_2bx_6arrays_10array_tree_17FileArrayTreeDict_1__init__, /*tp_init*/
19546   0, /*tp_alloc*/
19547   __pyx_tp_new_2bx_6arrays_10array_tree_FileArrayTreeDict, /*tp_new*/
19548   0, /*tp_free*/
19549   0, /*tp_is_gc*/
19550   0, /*tp_bases*/
19551   0, /*tp_mro*/
19552   0, /*tp_cache*/
19553   0, /*tp_subclasses*/
19554   0, /*tp_weaklist*/
19555   0, /*tp_del*/
19556   0, /*tp_version_tag*/
19557   #if PY_VERSION_HEX >= 0x030400a1
19558   0, /*tp_finalize*/
19559   #endif
19560   #if PY_VERSION_HEX >= 0x030800b1
19561   0, /*tp_vectorcall*/
19562   #endif
19563   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19564   0, /*tp_print*/
19565   #endif
19566   #if PY_VERSION_HEX >= 0x030B00A2
19567   0, /*tp_inline_values_offset*/
19568   #endif
19569 };
19570 static struct __pyx_vtabstruct_2bx_6arrays_10array_tree_FileArrayTree __pyx_vtable_2bx_6arrays_10array_tree_FileArrayTree;
19571 
__pyx_tp_new_2bx_6arrays_10array_tree_FileArrayTree(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)19572 static PyObject *__pyx_tp_new_2bx_6arrays_10array_tree_FileArrayTree(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
19573   struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *p;
19574   PyObject *o;
19575   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19576     o = (*t->tp_alloc)(t, 0);
19577   } else {
19578     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19579   }
19580   if (unlikely(!o)) return 0;
19581   p = ((struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)o);
19582   p->__pyx_vtab = __pyx_vtabptr_2bx_6arrays_10array_tree_FileArrayTree;
19583   p->dtype = Py_None; Py_INCREF(Py_None);
19584   p->io = Py_None; Py_INCREF(Py_None);
19585   return o;
19586 }
19587 
__pyx_tp_dealloc_2bx_6arrays_10array_tree_FileArrayTree(PyObject * o)19588 static void __pyx_tp_dealloc_2bx_6arrays_10array_tree_FileArrayTree(PyObject *o) {
19589   struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *p = (struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)o;
19590   #if CYTHON_USE_TP_FINALIZE
19591   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
19592     if (PyObject_CallFinalizerFromDealloc(o)) return;
19593   }
19594   #endif
19595   PyObject_GC_UnTrack(o);
19596   Py_CLEAR(p->dtype);
19597   Py_CLEAR(p->io);
19598   (*Py_TYPE(o)->tp_free)(o);
19599 }
19600 
__pyx_tp_traverse_2bx_6arrays_10array_tree_FileArrayTree(PyObject * o,visitproc v,void * a)19601 static int __pyx_tp_traverse_2bx_6arrays_10array_tree_FileArrayTree(PyObject *o, visitproc v, void *a) {
19602   int e;
19603   struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *p = (struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)o;
19604   if (p->dtype) {
19605     e = (*v)(p->dtype, a); if (e) return e;
19606   }
19607   if (p->io) {
19608     e = (*v)(p->io, a); if (e) return e;
19609   }
19610   return 0;
19611 }
19612 
__pyx_tp_clear_2bx_6arrays_10array_tree_FileArrayTree(PyObject * o)19613 static int __pyx_tp_clear_2bx_6arrays_10array_tree_FileArrayTree(PyObject *o) {
19614   PyObject* tmp;
19615   struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *p = (struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *)o;
19616   tmp = ((PyObject*)p->dtype);
19617   p->dtype = Py_None; Py_INCREF(Py_None);
19618   Py_XDECREF(tmp);
19619   tmp = ((PyObject*)p->io);
19620   p->io = Py_None; Py_INCREF(Py_None);
19621   Py_XDECREF(tmp);
19622   return 0;
19623 }
__pyx_sq_item_2bx_6arrays_10array_tree_FileArrayTree(PyObject * o,Py_ssize_t i)19624 static PyObject *__pyx_sq_item_2bx_6arrays_10array_tree_FileArrayTree(PyObject *o, Py_ssize_t i) {
19625   PyObject *r;
19626   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
19627   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
19628   Py_DECREF(x);
19629   return r;
19630 }
19631 
__pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_max(PyObject * o,CYTHON_UNUSED void * x)19632 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_max(PyObject *o, CYTHON_UNUSED void *x) {
19633   return __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_3max_1__get__(o);
19634 }
19635 
__pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_max(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)19636 static int __pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_max(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
19637   if (v) {
19638     return __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_3max_3__set__(o, v);
19639   }
19640   else {
19641     PyErr_SetString(PyExc_NotImplementedError, "__del__");
19642     return -1;
19643   }
19644 }
19645 
__pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_block_size(PyObject * o,CYTHON_UNUSED void * x)19646 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_block_size(PyObject *o, CYTHON_UNUSED void *x) {
19647   return __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_10block_size_1__get__(o);
19648 }
19649 
__pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_block_size(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)19650 static int __pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_block_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
19651   if (v) {
19652     return __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_10block_size_3__set__(o, v);
19653   }
19654   else {
19655     PyErr_SetString(PyExc_NotImplementedError, "__del__");
19656     return -1;
19657   }
19658 }
19659 
__pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_dtype(PyObject * o,CYTHON_UNUSED void * x)19660 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_dtype(PyObject *o, CYTHON_UNUSED void *x) {
19661   return __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_1__get__(o);
19662 }
19663 
__pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_dtype(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)19664 static int __pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_dtype(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
19665   if (v) {
19666     return __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_3__set__(o, v);
19667   }
19668   else {
19669     return __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_5dtype_5__del__(o);
19670   }
19671 }
19672 
__pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_levels(PyObject * o,CYTHON_UNUSED void * x)19673 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_levels(PyObject *o, CYTHON_UNUSED void *x) {
19674   return __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_6levels_1__get__(o);
19675 }
19676 
__pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_levels(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)19677 static int __pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_levels(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
19678   if (v) {
19679     return __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_6levels_3__set__(o, v);
19680   }
19681   else {
19682     PyErr_SetString(PyExc_NotImplementedError, "__del__");
19683     return -1;
19684   }
19685 }
19686 
__pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_offset(PyObject * o,CYTHON_UNUSED void * x)19687 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_offset(PyObject *o, CYTHON_UNUSED void *x) {
19688   return __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_6offset_1__get__(o);
19689 }
19690 
__pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_offset(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)19691 static int __pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_offset(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
19692   if (v) {
19693     return __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_6offset_3__set__(o, v);
19694   }
19695   else {
19696     PyErr_SetString(PyExc_NotImplementedError, "__del__");
19697     return -1;
19698   }
19699 }
19700 
__pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_root_offset(PyObject * o,CYTHON_UNUSED void * x)19701 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_root_offset(PyObject *o, CYTHON_UNUSED void *x) {
19702   return __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_11root_offset_1__get__(o);
19703 }
19704 
__pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_root_offset(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)19705 static int __pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_root_offset(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
19706   if (v) {
19707     return __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_11root_offset_3__set__(o, v);
19708   }
19709   else {
19710     PyErr_SetString(PyExc_NotImplementedError, "__del__");
19711     return -1;
19712   }
19713 }
19714 
19715 static PyMethodDef __pyx_methods_2bx_6arrays_10array_tree_FileArrayTree[] = {
19716   {"get_summary", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_5get_summary, METH_VARARGS|METH_KEYWORDS, 0},
19717   {"get_leaf", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_7get_leaf, METH_O, 0},
19718   {"__reduce_cython__", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_9__reduce_cython__, METH_NOARGS, 0},
19719   {"__setstate_cython__", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_11__setstate_cython__, METH_O, 0},
19720   {0, 0, 0, 0}
19721 };
19722 
19723 static struct PyGetSetDef __pyx_getsets_2bx_6arrays_10array_tree_FileArrayTree[] = {
19724   {(char *)"max", __pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_max, __pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_max, (char *)0, 0},
19725   {(char *)"block_size", __pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_block_size, __pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_block_size, (char *)0, 0},
19726   {(char *)"dtype", __pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_dtype, __pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_dtype, (char *)0, 0},
19727   {(char *)"levels", __pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_levels, __pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_levels, (char *)0, 0},
19728   {(char *)"offset", __pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_offset, __pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_offset, (char *)0, 0},
19729   {(char *)"root_offset", __pyx_getprop_2bx_6arrays_10array_tree_13FileArrayTree_root_offset, __pyx_setprop_2bx_6arrays_10array_tree_13FileArrayTree_root_offset, (char *)0, 0},
19730   {0, 0, 0, 0, 0}
19731 };
19732 
19733 static PySequenceMethods __pyx_tp_as_sequence_FileArrayTree = {
19734   0, /*sq_length*/
19735   0, /*sq_concat*/
19736   0, /*sq_repeat*/
19737   __pyx_sq_item_2bx_6arrays_10array_tree_FileArrayTree, /*sq_item*/
19738   0, /*sq_slice*/
19739   0, /*sq_ass_item*/
19740   0, /*sq_ass_slice*/
19741   0, /*sq_contains*/
19742   0, /*sq_inplace_concat*/
19743   0, /*sq_inplace_repeat*/
19744 };
19745 
19746 static PyMappingMethods __pyx_tp_as_mapping_FileArrayTree = {
19747   0, /*mp_length*/
19748   __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_3__getitem__, /*mp_subscript*/
19749   0, /*mp_ass_subscript*/
19750 };
19751 
19752 static PyTypeObject __pyx_type_2bx_6arrays_10array_tree_FileArrayTree = {
19753   PyVarObject_HEAD_INIT(0, 0)
19754   "bx.arrays.array_tree.FileArrayTree", /*tp_name*/
19755   sizeof(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree), /*tp_basicsize*/
19756   0, /*tp_itemsize*/
19757   __pyx_tp_dealloc_2bx_6arrays_10array_tree_FileArrayTree, /*tp_dealloc*/
19758   #if PY_VERSION_HEX < 0x030800b4
19759   0, /*tp_print*/
19760   #endif
19761   #if PY_VERSION_HEX >= 0x030800b4
19762   0, /*tp_vectorcall_offset*/
19763   #endif
19764   0, /*tp_getattr*/
19765   0, /*tp_setattr*/
19766   #if PY_MAJOR_VERSION < 3
19767   0, /*tp_compare*/
19768   #endif
19769   #if PY_MAJOR_VERSION >= 3
19770   0, /*tp_as_async*/
19771   #endif
19772   0, /*tp_repr*/
19773   0, /*tp_as_number*/
19774   &__pyx_tp_as_sequence_FileArrayTree, /*tp_as_sequence*/
19775   &__pyx_tp_as_mapping_FileArrayTree, /*tp_as_mapping*/
19776   0, /*tp_hash*/
19777   0, /*tp_call*/
19778   0, /*tp_str*/
19779   0, /*tp_getattro*/
19780   0, /*tp_setattro*/
19781   0, /*tp_as_buffer*/
19782   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
19783   "\n    Wrapper for ArrayTree stored in file that reads as little as possible\n    ", /*tp_doc*/
19784   __pyx_tp_traverse_2bx_6arrays_10array_tree_FileArrayTree, /*tp_traverse*/
19785   __pyx_tp_clear_2bx_6arrays_10array_tree_FileArrayTree, /*tp_clear*/
19786   0, /*tp_richcompare*/
19787   0, /*tp_weaklistoffset*/
19788   0, /*tp_iter*/
19789   0, /*tp_iternext*/
19790   __pyx_methods_2bx_6arrays_10array_tree_FileArrayTree, /*tp_methods*/
19791   0, /*tp_members*/
19792   __pyx_getsets_2bx_6arrays_10array_tree_FileArrayTree, /*tp_getset*/
19793   0, /*tp_base*/
19794   0, /*tp_dict*/
19795   0, /*tp_descr_get*/
19796   0, /*tp_descr_set*/
19797   0, /*tp_dictoffset*/
19798   __pyx_pw_2bx_6arrays_10array_tree_13FileArrayTree_1__init__, /*tp_init*/
19799   0, /*tp_alloc*/
19800   __pyx_tp_new_2bx_6arrays_10array_tree_FileArrayTree, /*tp_new*/
19801   0, /*tp_free*/
19802   0, /*tp_is_gc*/
19803   0, /*tp_bases*/
19804   0, /*tp_mro*/
19805   0, /*tp_cache*/
19806   0, /*tp_subclasses*/
19807   0, /*tp_weaklist*/
19808   0, /*tp_del*/
19809   0, /*tp_version_tag*/
19810   #if PY_VERSION_HEX >= 0x030400a1
19811   0, /*tp_finalize*/
19812   #endif
19813   #if PY_VERSION_HEX >= 0x030800b1
19814   0, /*tp_vectorcall*/
19815   #endif
19816   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19817   0, /*tp_print*/
19818   #endif
19819   #if PY_VERSION_HEX >= 0x030B00A2
19820   0, /*tp_inline_values_offset*/
19821   #endif
19822 };
19823 
__pyx_tp_new_2bx_6arrays_10array_tree_Summary(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)19824 static PyObject *__pyx_tp_new_2bx_6arrays_10array_tree_Summary(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
19825   struct __pyx_obj_2bx_6arrays_10array_tree_Summary *p;
19826   PyObject *o;
19827   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19828     o = (*t->tp_alloc)(t, 0);
19829   } else {
19830     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19831   }
19832   if (unlikely(!o)) return 0;
19833   p = ((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)o);
19834   p->counts = Py_None; Py_INCREF(Py_None);
19835   p->frequencies = Py_None; Py_INCREF(Py_None);
19836   p->mins = Py_None; Py_INCREF(Py_None);
19837   p->maxs = Py_None; Py_INCREF(Py_None);
19838   p->sums = Py_None; Py_INCREF(Py_None);
19839   p->sumsquares = Py_None; Py_INCREF(Py_None);
19840   return o;
19841 }
19842 
__pyx_tp_dealloc_2bx_6arrays_10array_tree_Summary(PyObject * o)19843 static void __pyx_tp_dealloc_2bx_6arrays_10array_tree_Summary(PyObject *o) {
19844   struct __pyx_obj_2bx_6arrays_10array_tree_Summary *p = (struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)o;
19845   #if CYTHON_USE_TP_FINALIZE
19846   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
19847     if (PyObject_CallFinalizerFromDealloc(o)) return;
19848   }
19849   #endif
19850   PyObject_GC_UnTrack(o);
19851   Py_CLEAR(p->counts);
19852   Py_CLEAR(p->frequencies);
19853   Py_CLEAR(p->mins);
19854   Py_CLEAR(p->maxs);
19855   Py_CLEAR(p->sums);
19856   Py_CLEAR(p->sumsquares);
19857   (*Py_TYPE(o)->tp_free)(o);
19858 }
19859 
__pyx_tp_traverse_2bx_6arrays_10array_tree_Summary(PyObject * o,visitproc v,void * a)19860 static int __pyx_tp_traverse_2bx_6arrays_10array_tree_Summary(PyObject *o, visitproc v, void *a) {
19861   int e;
19862   struct __pyx_obj_2bx_6arrays_10array_tree_Summary *p = (struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)o;
19863   if (p->counts) {
19864     e = (*v)(p->counts, a); if (e) return e;
19865   }
19866   if (p->frequencies) {
19867     e = (*v)(p->frequencies, a); if (e) return e;
19868   }
19869   if (p->mins) {
19870     e = (*v)(p->mins, a); if (e) return e;
19871   }
19872   if (p->maxs) {
19873     e = (*v)(p->maxs, a); if (e) return e;
19874   }
19875   if (p->sums) {
19876     e = (*v)(p->sums, a); if (e) return e;
19877   }
19878   if (p->sumsquares) {
19879     e = (*v)(p->sumsquares, a); if (e) return e;
19880   }
19881   return 0;
19882 }
19883 
__pyx_tp_clear_2bx_6arrays_10array_tree_Summary(PyObject * o)19884 static int __pyx_tp_clear_2bx_6arrays_10array_tree_Summary(PyObject *o) {
19885   PyObject* tmp;
19886   struct __pyx_obj_2bx_6arrays_10array_tree_Summary *p = (struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)o;
19887   tmp = ((PyObject*)p->counts);
19888   p->counts = Py_None; Py_INCREF(Py_None);
19889   Py_XDECREF(tmp);
19890   tmp = ((PyObject*)p->frequencies);
19891   p->frequencies = Py_None; Py_INCREF(Py_None);
19892   Py_XDECREF(tmp);
19893   tmp = ((PyObject*)p->mins);
19894   p->mins = Py_None; Py_INCREF(Py_None);
19895   Py_XDECREF(tmp);
19896   tmp = ((PyObject*)p->maxs);
19897   p->maxs = Py_None; Py_INCREF(Py_None);
19898   Py_XDECREF(tmp);
19899   tmp = ((PyObject*)p->sums);
19900   p->sums = Py_None; Py_INCREF(Py_None);
19901   Py_XDECREF(tmp);
19902   tmp = ((PyObject*)p->sumsquares);
19903   p->sumsquares = Py_None; Py_INCREF(Py_None);
19904   Py_XDECREF(tmp);
19905   return 0;
19906 }
19907 
__pyx_getprop_2bx_6arrays_10array_tree_7Summary_counts(PyObject * o,CYTHON_UNUSED void * x)19908 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_7Summary_counts(PyObject *o, CYTHON_UNUSED void *x) {
19909   return __pyx_pw_2bx_6arrays_10array_tree_7Summary_6counts_1__get__(o);
19910 }
19911 
__pyx_setprop_2bx_6arrays_10array_tree_7Summary_counts(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)19912 static int __pyx_setprop_2bx_6arrays_10array_tree_7Summary_counts(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
19913   if (v) {
19914     return __pyx_pw_2bx_6arrays_10array_tree_7Summary_6counts_3__set__(o, v);
19915   }
19916   else {
19917     return __pyx_pw_2bx_6arrays_10array_tree_7Summary_6counts_5__del__(o);
19918   }
19919 }
19920 
__pyx_getprop_2bx_6arrays_10array_tree_7Summary_frequencies(PyObject * o,CYTHON_UNUSED void * x)19921 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_7Summary_frequencies(PyObject *o, CYTHON_UNUSED void *x) {
19922   return __pyx_pw_2bx_6arrays_10array_tree_7Summary_11frequencies_1__get__(o);
19923 }
19924 
__pyx_setprop_2bx_6arrays_10array_tree_7Summary_frequencies(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)19925 static int __pyx_setprop_2bx_6arrays_10array_tree_7Summary_frequencies(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
19926   if (v) {
19927     return __pyx_pw_2bx_6arrays_10array_tree_7Summary_11frequencies_3__set__(o, v);
19928   }
19929   else {
19930     return __pyx_pw_2bx_6arrays_10array_tree_7Summary_11frequencies_5__del__(o);
19931   }
19932 }
19933 
__pyx_getprop_2bx_6arrays_10array_tree_7Summary_mins(PyObject * o,CYTHON_UNUSED void * x)19934 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_7Summary_mins(PyObject *o, CYTHON_UNUSED void *x) {
19935   return __pyx_pw_2bx_6arrays_10array_tree_7Summary_4mins_1__get__(o);
19936 }
19937 
__pyx_setprop_2bx_6arrays_10array_tree_7Summary_mins(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)19938 static int __pyx_setprop_2bx_6arrays_10array_tree_7Summary_mins(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
19939   if (v) {
19940     return __pyx_pw_2bx_6arrays_10array_tree_7Summary_4mins_3__set__(o, v);
19941   }
19942   else {
19943     return __pyx_pw_2bx_6arrays_10array_tree_7Summary_4mins_5__del__(o);
19944   }
19945 }
19946 
__pyx_getprop_2bx_6arrays_10array_tree_7Summary_maxs(PyObject * o,CYTHON_UNUSED void * x)19947 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_7Summary_maxs(PyObject *o, CYTHON_UNUSED void *x) {
19948   return __pyx_pw_2bx_6arrays_10array_tree_7Summary_4maxs_1__get__(o);
19949 }
19950 
__pyx_setprop_2bx_6arrays_10array_tree_7Summary_maxs(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)19951 static int __pyx_setprop_2bx_6arrays_10array_tree_7Summary_maxs(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
19952   if (v) {
19953     return __pyx_pw_2bx_6arrays_10array_tree_7Summary_4maxs_3__set__(o, v);
19954   }
19955   else {
19956     return __pyx_pw_2bx_6arrays_10array_tree_7Summary_4maxs_5__del__(o);
19957   }
19958 }
19959 
__pyx_getprop_2bx_6arrays_10array_tree_7Summary_sums(PyObject * o,CYTHON_UNUSED void * x)19960 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_7Summary_sums(PyObject *o, CYTHON_UNUSED void *x) {
19961   return __pyx_pw_2bx_6arrays_10array_tree_7Summary_4sums_1__get__(o);
19962 }
19963 
__pyx_setprop_2bx_6arrays_10array_tree_7Summary_sums(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)19964 static int __pyx_setprop_2bx_6arrays_10array_tree_7Summary_sums(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
19965   if (v) {
19966     return __pyx_pw_2bx_6arrays_10array_tree_7Summary_4sums_3__set__(o, v);
19967   }
19968   else {
19969     return __pyx_pw_2bx_6arrays_10array_tree_7Summary_4sums_5__del__(o);
19970   }
19971 }
19972 
__pyx_getprop_2bx_6arrays_10array_tree_7Summary_sumsquares(PyObject * o,CYTHON_UNUSED void * x)19973 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_7Summary_sumsquares(PyObject *o, CYTHON_UNUSED void *x) {
19974   return __pyx_pw_2bx_6arrays_10array_tree_7Summary_10sumsquares_1__get__(o);
19975 }
19976 
__pyx_setprop_2bx_6arrays_10array_tree_7Summary_sumsquares(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)19977 static int __pyx_setprop_2bx_6arrays_10array_tree_7Summary_sumsquares(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
19978   if (v) {
19979     return __pyx_pw_2bx_6arrays_10array_tree_7Summary_10sumsquares_3__set__(o, v);
19980   }
19981   else {
19982     return __pyx_pw_2bx_6arrays_10array_tree_7Summary_10sumsquares_5__del__(o);
19983   }
19984 }
19985 
19986 static PyMethodDef __pyx_methods_2bx_6arrays_10array_tree_Summary[] = {
19987   {"__reduce_cython__", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_7Summary_1__reduce_cython__, METH_NOARGS, 0},
19988   {"__setstate_cython__", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_7Summary_3__setstate_cython__, METH_O, 0},
19989   {0, 0, 0, 0}
19990 };
19991 
19992 static struct PyGetSetDef __pyx_getsets_2bx_6arrays_10array_tree_Summary[] = {
19993   {(char *)"counts", __pyx_getprop_2bx_6arrays_10array_tree_7Summary_counts, __pyx_setprop_2bx_6arrays_10array_tree_7Summary_counts, (char *)0, 0},
19994   {(char *)"frequencies", __pyx_getprop_2bx_6arrays_10array_tree_7Summary_frequencies, __pyx_setprop_2bx_6arrays_10array_tree_7Summary_frequencies, (char *)0, 0},
19995   {(char *)"mins", __pyx_getprop_2bx_6arrays_10array_tree_7Summary_mins, __pyx_setprop_2bx_6arrays_10array_tree_7Summary_mins, (char *)0, 0},
19996   {(char *)"maxs", __pyx_getprop_2bx_6arrays_10array_tree_7Summary_maxs, __pyx_setprop_2bx_6arrays_10array_tree_7Summary_maxs, (char *)0, 0},
19997   {(char *)"sums", __pyx_getprop_2bx_6arrays_10array_tree_7Summary_sums, __pyx_setprop_2bx_6arrays_10array_tree_7Summary_sums, (char *)0, 0},
19998   {(char *)"sumsquares", __pyx_getprop_2bx_6arrays_10array_tree_7Summary_sumsquares, __pyx_setprop_2bx_6arrays_10array_tree_7Summary_sumsquares, (char *)0, 0},
19999   {0, 0, 0, 0, 0}
20000 };
20001 
20002 static PyTypeObject __pyx_type_2bx_6arrays_10array_tree_Summary = {
20003   PyVarObject_HEAD_INIT(0, 0)
20004   "bx.arrays.array_tree.Summary", /*tp_name*/
20005   sizeof(struct __pyx_obj_2bx_6arrays_10array_tree_Summary), /*tp_basicsize*/
20006   0, /*tp_itemsize*/
20007   __pyx_tp_dealloc_2bx_6arrays_10array_tree_Summary, /*tp_dealloc*/
20008   #if PY_VERSION_HEX < 0x030800b4
20009   0, /*tp_print*/
20010   #endif
20011   #if PY_VERSION_HEX >= 0x030800b4
20012   0, /*tp_vectorcall_offset*/
20013   #endif
20014   0, /*tp_getattr*/
20015   0, /*tp_setattr*/
20016   #if PY_MAJOR_VERSION < 3
20017   0, /*tp_compare*/
20018   #endif
20019   #if PY_MAJOR_VERSION >= 3
20020   0, /*tp_as_async*/
20021   #endif
20022   0, /*tp_repr*/
20023   0, /*tp_as_number*/
20024   0, /*tp_as_sequence*/
20025   0, /*tp_as_mapping*/
20026   0, /*tp_hash*/
20027   0, /*tp_call*/
20028   0, /*tp_str*/
20029   0, /*tp_getattro*/
20030   0, /*tp_setattro*/
20031   0, /*tp_as_buffer*/
20032   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20033   "\n    Summary for a non-leaf level of the tree, contains arrays of the min, max,\n    valid count, sum, and sum-of-squares for each child.\n    ", /*tp_doc*/
20034   __pyx_tp_traverse_2bx_6arrays_10array_tree_Summary, /*tp_traverse*/
20035   __pyx_tp_clear_2bx_6arrays_10array_tree_Summary, /*tp_clear*/
20036   0, /*tp_richcompare*/
20037   0, /*tp_weaklistoffset*/
20038   0, /*tp_iter*/
20039   0, /*tp_iternext*/
20040   __pyx_methods_2bx_6arrays_10array_tree_Summary, /*tp_methods*/
20041   0, /*tp_members*/
20042   __pyx_getsets_2bx_6arrays_10array_tree_Summary, /*tp_getset*/
20043   0, /*tp_base*/
20044   0, /*tp_dict*/
20045   0, /*tp_descr_get*/
20046   0, /*tp_descr_set*/
20047   0, /*tp_dictoffset*/
20048   0, /*tp_init*/
20049   0, /*tp_alloc*/
20050   __pyx_tp_new_2bx_6arrays_10array_tree_Summary, /*tp_new*/
20051   0, /*tp_free*/
20052   0, /*tp_is_gc*/
20053   0, /*tp_bases*/
20054   0, /*tp_mro*/
20055   0, /*tp_cache*/
20056   0, /*tp_subclasses*/
20057   0, /*tp_weaklist*/
20058   0, /*tp_del*/
20059   0, /*tp_version_tag*/
20060   #if PY_VERSION_HEX >= 0x030400a1
20061   0, /*tp_finalize*/
20062   #endif
20063   #if PY_VERSION_HEX >= 0x030800b1
20064   0, /*tp_vectorcall*/
20065   #endif
20066   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20067   0, /*tp_print*/
20068   #endif
20069   #if PY_VERSION_HEX >= 0x030B00A2
20070   0, /*tp_inline_values_offset*/
20071   #endif
20072 };
20073 static struct __pyx_vtabstruct_2bx_6arrays_10array_tree_ArrayTreeNode __pyx_vtable_2bx_6arrays_10array_tree_ArrayTreeNode;
20074 
__pyx_tp_new_2bx_6arrays_10array_tree_ArrayTreeNode(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)20075 static PyObject *__pyx_tp_new_2bx_6arrays_10array_tree_ArrayTreeNode(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20076   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *p;
20077   PyObject *o;
20078   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20079     o = (*t->tp_alloc)(t, 0);
20080   } else {
20081     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20082   }
20083   if (unlikely(!o)) return 0;
20084   p = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)o);
20085   p->__pyx_vtab = __pyx_vtabptr_2bx_6arrays_10array_tree_ArrayTreeNode;
20086   p->tree = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)Py_None); Py_INCREF(Py_None);
20087   p->children = Py_None; Py_INCREF(Py_None);
20088   p->summary = ((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)Py_None); Py_INCREF(Py_None);
20089   return o;
20090 }
20091 
__pyx_tp_dealloc_2bx_6arrays_10array_tree_ArrayTreeNode(PyObject * o)20092 static void __pyx_tp_dealloc_2bx_6arrays_10array_tree_ArrayTreeNode(PyObject *o) {
20093   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *p = (struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)o;
20094   #if CYTHON_USE_TP_FINALIZE
20095   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20096     if (PyObject_CallFinalizerFromDealloc(o)) return;
20097   }
20098   #endif
20099   PyObject_GC_UnTrack(o);
20100   Py_CLEAR(p->tree);
20101   Py_CLEAR(p->children);
20102   Py_CLEAR(p->summary);
20103   (*Py_TYPE(o)->tp_free)(o);
20104 }
20105 
__pyx_tp_traverse_2bx_6arrays_10array_tree_ArrayTreeNode(PyObject * o,visitproc v,void * a)20106 static int __pyx_tp_traverse_2bx_6arrays_10array_tree_ArrayTreeNode(PyObject *o, visitproc v, void *a) {
20107   int e;
20108   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *p = (struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)o;
20109   if (p->tree) {
20110     e = (*v)(((PyObject *)p->tree), a); if (e) return e;
20111   }
20112   if (p->children) {
20113     e = (*v)(p->children, a); if (e) return e;
20114   }
20115   if (p->summary) {
20116     e = (*v)(((PyObject *)p->summary), a); if (e) return e;
20117   }
20118   return 0;
20119 }
20120 
__pyx_tp_clear_2bx_6arrays_10array_tree_ArrayTreeNode(PyObject * o)20121 static int __pyx_tp_clear_2bx_6arrays_10array_tree_ArrayTreeNode(PyObject *o) {
20122   PyObject* tmp;
20123   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *p = (struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)o;
20124   tmp = ((PyObject*)p->tree);
20125   p->tree = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)Py_None); Py_INCREF(Py_None);
20126   Py_XDECREF(tmp);
20127   tmp = ((PyObject*)p->children);
20128   p->children = Py_None; Py_INCREF(Py_None);
20129   Py_XDECREF(tmp);
20130   tmp = ((PyObject*)p->summary);
20131   p->summary = ((struct __pyx_obj_2bx_6arrays_10array_tree_Summary *)Py_None); Py_INCREF(Py_None);
20132   Py_XDECREF(tmp);
20133   return 0;
20134 }
20135 
__pyx_getprop_2bx_6arrays_10array_tree_13ArrayTreeNode_summary(PyObject * o,CYTHON_UNUSED void * x)20136 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_13ArrayTreeNode_summary(PyObject *o, CYTHON_UNUSED void *x) {
20137   return __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_1__get__(o);
20138 }
20139 
__pyx_setprop_2bx_6arrays_10array_tree_13ArrayTreeNode_summary(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)20140 static int __pyx_setprop_2bx_6arrays_10array_tree_13ArrayTreeNode_summary(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20141   if (v) {
20142     return __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_3__set__(o, v);
20143   }
20144   else {
20145     return __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7summary_5__del__(o);
20146   }
20147 }
20148 
__pyx_getprop_2bx_6arrays_10array_tree_13ArrayTreeNode_start_offset(PyObject * o,CYTHON_UNUSED void * x)20149 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_13ArrayTreeNode_start_offset(PyObject *o, CYTHON_UNUSED void *x) {
20150   return __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_12start_offset_1__get__(o);
20151 }
20152 
__pyx_setprop_2bx_6arrays_10array_tree_13ArrayTreeNode_start_offset(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)20153 static int __pyx_setprop_2bx_6arrays_10array_tree_13ArrayTreeNode_start_offset(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20154   if (v) {
20155     return __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_12start_offset_3__set__(o, v);
20156   }
20157   else {
20158     PyErr_SetString(PyExc_NotImplementedError, "__del__");
20159     return -1;
20160   }
20161 }
20162 
20163 static PyMethodDef __pyx_methods_2bx_6arrays_10array_tree_ArrayTreeNode[] = {
20164   {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_3set, METH_VARARGS|METH_KEYWORDS, 0},
20165   {"get", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_5get, METH_O, 0},
20166   {"build_summary", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_7build_summary, METH_NOARGS, __pyx_doc_2bx_6arrays_10array_tree_13ArrayTreeNode_6build_summary},
20167   {"to_file_data_pass", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_9to_file_data_pass, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2bx_6arrays_10array_tree_13ArrayTreeNode_8to_file_data_pass},
20168   {"to_file_offset_pass", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_11to_file_offset_pass, METH_O, __pyx_doc_2bx_6arrays_10array_tree_13ArrayTreeNode_10to_file_offset_pass},
20169   {"from_file", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_13from_file, METH_O, __pyx_doc_2bx_6arrays_10array_tree_13ArrayTreeNode_12from_file},
20170   {"get_from_file", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_15get_from_file, METH_VARARGS|METH_KEYWORDS, 0},
20171   {"__reduce_cython__", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_17__reduce_cython__, METH_NOARGS, 0},
20172   {"__setstate_cython__", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_19__setstate_cython__, METH_O, 0},
20173   {0, 0, 0, 0}
20174 };
20175 
20176 static struct PyGetSetDef __pyx_getsets_2bx_6arrays_10array_tree_ArrayTreeNode[] = {
20177   {(char *)"summary", __pyx_getprop_2bx_6arrays_10array_tree_13ArrayTreeNode_summary, __pyx_setprop_2bx_6arrays_10array_tree_13ArrayTreeNode_summary, (char *)0, 0},
20178   {(char *)"start_offset", __pyx_getprop_2bx_6arrays_10array_tree_13ArrayTreeNode_start_offset, __pyx_setprop_2bx_6arrays_10array_tree_13ArrayTreeNode_start_offset, (char *)0, 0},
20179   {0, 0, 0, 0, 0}
20180 };
20181 
20182 static PyTypeObject __pyx_type_2bx_6arrays_10array_tree_ArrayTreeNode = {
20183   PyVarObject_HEAD_INIT(0, 0)
20184   "bx.arrays.array_tree.ArrayTreeNode", /*tp_name*/
20185   sizeof(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode), /*tp_basicsize*/
20186   0, /*tp_itemsize*/
20187   __pyx_tp_dealloc_2bx_6arrays_10array_tree_ArrayTreeNode, /*tp_dealloc*/
20188   #if PY_VERSION_HEX < 0x030800b4
20189   0, /*tp_print*/
20190   #endif
20191   #if PY_VERSION_HEX >= 0x030800b4
20192   0, /*tp_vectorcall_offset*/
20193   #endif
20194   0, /*tp_getattr*/
20195   0, /*tp_setattr*/
20196   #if PY_MAJOR_VERSION < 3
20197   0, /*tp_compare*/
20198   #endif
20199   #if PY_MAJOR_VERSION >= 3
20200   0, /*tp_as_async*/
20201   #endif
20202   0, /*tp_repr*/
20203   0, /*tp_as_number*/
20204   0, /*tp_as_sequence*/
20205   0, /*tp_as_mapping*/
20206   0, /*tp_hash*/
20207   0, /*tp_call*/
20208   0, /*tp_str*/
20209   0, /*tp_getattro*/
20210   0, /*tp_setattro*/
20211   0, /*tp_as_buffer*/
20212   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20213   "\n    Internal node of an ArrayTree. Contains summary data and pointers to\n    subtrees.\n    ", /*tp_doc*/
20214   __pyx_tp_traverse_2bx_6arrays_10array_tree_ArrayTreeNode, /*tp_traverse*/
20215   __pyx_tp_clear_2bx_6arrays_10array_tree_ArrayTreeNode, /*tp_clear*/
20216   0, /*tp_richcompare*/
20217   0, /*tp_weaklistoffset*/
20218   0, /*tp_iter*/
20219   0, /*tp_iternext*/
20220   __pyx_methods_2bx_6arrays_10array_tree_ArrayTreeNode, /*tp_methods*/
20221   0, /*tp_members*/
20222   __pyx_getsets_2bx_6arrays_10array_tree_ArrayTreeNode, /*tp_getset*/
20223   0, /*tp_base*/
20224   0, /*tp_dict*/
20225   0, /*tp_descr_get*/
20226   0, /*tp_descr_set*/
20227   0, /*tp_dictoffset*/
20228   __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeNode_1__init__, /*tp_init*/
20229   0, /*tp_alloc*/
20230   __pyx_tp_new_2bx_6arrays_10array_tree_ArrayTreeNode, /*tp_new*/
20231   0, /*tp_free*/
20232   0, /*tp_is_gc*/
20233   0, /*tp_bases*/
20234   0, /*tp_mro*/
20235   0, /*tp_cache*/
20236   0, /*tp_subclasses*/
20237   0, /*tp_weaklist*/
20238   0, /*tp_del*/
20239   0, /*tp_version_tag*/
20240   #if PY_VERSION_HEX >= 0x030400a1
20241   0, /*tp_finalize*/
20242   #endif
20243   #if PY_VERSION_HEX >= 0x030800b1
20244   0, /*tp_vectorcall*/
20245   #endif
20246   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20247   0, /*tp_print*/
20248   #endif
20249   #if PY_VERSION_HEX >= 0x030B00A2
20250   0, /*tp_inline_values_offset*/
20251   #endif
20252 };
20253 
__pyx_tp_new_2bx_6arrays_10array_tree_ArrayTreeLeaf(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)20254 static PyObject *__pyx_tp_new_2bx_6arrays_10array_tree_ArrayTreeLeaf(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20255   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *p;
20256   PyObject *o;
20257   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20258     o = (*t->tp_alloc)(t, 0);
20259   } else {
20260     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20261   }
20262   if (unlikely(!o)) return 0;
20263   p = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)o);
20264   p->tree = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)Py_None); Py_INCREF(Py_None);
20265   p->values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
20266   return o;
20267 }
20268 
__pyx_tp_dealloc_2bx_6arrays_10array_tree_ArrayTreeLeaf(PyObject * o)20269 static void __pyx_tp_dealloc_2bx_6arrays_10array_tree_ArrayTreeLeaf(PyObject *o) {
20270   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *p = (struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)o;
20271   #if CYTHON_USE_TP_FINALIZE
20272   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20273     if (PyObject_CallFinalizerFromDealloc(o)) return;
20274   }
20275   #endif
20276   PyObject_GC_UnTrack(o);
20277   Py_CLEAR(p->tree);
20278   Py_CLEAR(p->values);
20279   (*Py_TYPE(o)->tp_free)(o);
20280 }
20281 
__pyx_tp_traverse_2bx_6arrays_10array_tree_ArrayTreeLeaf(PyObject * o,visitproc v,void * a)20282 static int __pyx_tp_traverse_2bx_6arrays_10array_tree_ArrayTreeLeaf(PyObject *o, visitproc v, void *a) {
20283   int e;
20284   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *p = (struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)o;
20285   if (p->tree) {
20286     e = (*v)(((PyObject *)p->tree), a); if (e) return e;
20287   }
20288   if (p->values) {
20289     e = (*v)(((PyObject *)p->values), a); if (e) return e;
20290   }
20291   return 0;
20292 }
20293 
__pyx_tp_clear_2bx_6arrays_10array_tree_ArrayTreeLeaf(PyObject * o)20294 static int __pyx_tp_clear_2bx_6arrays_10array_tree_ArrayTreeLeaf(PyObject *o) {
20295   PyObject* tmp;
20296   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *p = (struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf *)o;
20297   tmp = ((PyObject*)p->tree);
20298   p->tree = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)Py_None); Py_INCREF(Py_None);
20299   Py_XDECREF(tmp);
20300   tmp = ((PyObject*)p->values);
20301   p->values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
20302   Py_XDECREF(tmp);
20303   return 0;
20304 }
20305 
__pyx_getprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_frequency(PyObject * o,CYTHON_UNUSED void * x)20306 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_frequency(PyObject *o, CYTHON_UNUSED void *x) {
20307   return __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9frequency_1__get__(o);
20308 }
20309 
__pyx_setprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_frequency(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)20310 static int __pyx_setprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_frequency(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20311   if (v) {
20312     return __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9frequency_3__set__(o, v);
20313   }
20314   else {
20315     PyErr_SetString(PyExc_NotImplementedError, "__del__");
20316     return -1;
20317   }
20318 }
20319 
__pyx_getprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_values(PyObject * o,CYTHON_UNUSED void * x)20320 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_values(PyObject *o, CYTHON_UNUSED void *x) {
20321   return __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_1__get__(o);
20322 }
20323 
__pyx_setprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_values(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)20324 static int __pyx_setprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20325   if (v) {
20326     return __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_3__set__(o, v);
20327   }
20328   else {
20329     return __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_6values_5__del__(o);
20330   }
20331 }
20332 
__pyx_getprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_start_offset(PyObject * o,CYTHON_UNUSED void * x)20333 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_start_offset(PyObject *o, CYTHON_UNUSED void *x) {
20334   return __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12start_offset_1__get__(o);
20335 }
20336 
__pyx_setprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_start_offset(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)20337 static int __pyx_setprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_start_offset(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20338   if (v) {
20339     return __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_12start_offset_3__set__(o, v);
20340   }
20341   else {
20342     PyErr_SetString(PyExc_NotImplementedError, "__del__");
20343     return -1;
20344   }
20345 }
20346 
20347 static PyMethodDef __pyx_methods_2bx_6arrays_10array_tree_ArrayTreeLeaf[] = {
20348   {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_3set, METH_VARARGS|METH_KEYWORDS, 0},
20349   {"get", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_5get, METH_O, 0},
20350   {"to_file_data_pass", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_7to_file_data_pass, METH_VARARGS|METH_KEYWORDS, 0},
20351   {"to_file_offset_pass", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_9to_file_offset_pass, METH_O, 0},
20352   {"from_file", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_11from_file, METH_O, 0},
20353   {"__reduce_cython__", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_13__reduce_cython__, METH_NOARGS, 0},
20354   {"__setstate_cython__", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_15__setstate_cython__, METH_O, 0},
20355   {0, 0, 0, 0}
20356 };
20357 
20358 static struct PyGetSetDef __pyx_getsets_2bx_6arrays_10array_tree_ArrayTreeLeaf[] = {
20359   {(char *)"frequency", __pyx_getprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_frequency, __pyx_setprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_frequency, (char *)0, 0},
20360   {(char *)"values", __pyx_getprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_values, __pyx_setprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_values, (char *)0, 0},
20361   {(char *)"start_offset", __pyx_getprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_start_offset, __pyx_setprop_2bx_6arrays_10array_tree_13ArrayTreeLeaf_start_offset, (char *)0, 0},
20362   {0, 0, 0, 0, 0}
20363 };
20364 
20365 static PyTypeObject __pyx_type_2bx_6arrays_10array_tree_ArrayTreeLeaf = {
20366   PyVarObject_HEAD_INIT(0, 0)
20367   "bx.arrays.array_tree.ArrayTreeLeaf", /*tp_name*/
20368   sizeof(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeLeaf), /*tp_basicsize*/
20369   0, /*tp_itemsize*/
20370   __pyx_tp_dealloc_2bx_6arrays_10array_tree_ArrayTreeLeaf, /*tp_dealloc*/
20371   #if PY_VERSION_HEX < 0x030800b4
20372   0, /*tp_print*/
20373   #endif
20374   #if PY_VERSION_HEX >= 0x030800b4
20375   0, /*tp_vectorcall_offset*/
20376   #endif
20377   0, /*tp_getattr*/
20378   0, /*tp_setattr*/
20379   #if PY_MAJOR_VERSION < 3
20380   0, /*tp_compare*/
20381   #endif
20382   #if PY_MAJOR_VERSION >= 3
20383   0, /*tp_as_async*/
20384   #endif
20385   0, /*tp_repr*/
20386   0, /*tp_as_number*/
20387   0, /*tp_as_sequence*/
20388   0, /*tp_as_mapping*/
20389   0, /*tp_hash*/
20390   0, /*tp_call*/
20391   0, /*tp_str*/
20392   0, /*tp_getattro*/
20393   0, /*tp_setattro*/
20394   0, /*tp_as_buffer*/
20395   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20396   "\n    Leaf node of an ArrayTree, contains data values.\n    ", /*tp_doc*/
20397   __pyx_tp_traverse_2bx_6arrays_10array_tree_ArrayTreeLeaf, /*tp_traverse*/
20398   __pyx_tp_clear_2bx_6arrays_10array_tree_ArrayTreeLeaf, /*tp_clear*/
20399   0, /*tp_richcompare*/
20400   0, /*tp_weaklistoffset*/
20401   0, /*tp_iter*/
20402   0, /*tp_iternext*/
20403   __pyx_methods_2bx_6arrays_10array_tree_ArrayTreeLeaf, /*tp_methods*/
20404   0, /*tp_members*/
20405   __pyx_getsets_2bx_6arrays_10array_tree_ArrayTreeLeaf, /*tp_getset*/
20406   0, /*tp_base*/
20407   0, /*tp_dict*/
20408   0, /*tp_descr_get*/
20409   0, /*tp_descr_set*/
20410   0, /*tp_dictoffset*/
20411   __pyx_pw_2bx_6arrays_10array_tree_13ArrayTreeLeaf_1__init__, /*tp_init*/
20412   0, /*tp_alloc*/
20413   __pyx_tp_new_2bx_6arrays_10array_tree_ArrayTreeLeaf, /*tp_new*/
20414   0, /*tp_free*/
20415   0, /*tp_is_gc*/
20416   0, /*tp_bases*/
20417   0, /*tp_mro*/
20418   0, /*tp_cache*/
20419   0, /*tp_subclasses*/
20420   0, /*tp_weaklist*/
20421   0, /*tp_del*/
20422   0, /*tp_version_tag*/
20423   #if PY_VERSION_HEX >= 0x030400a1
20424   0, /*tp_finalize*/
20425   #endif
20426   #if PY_VERSION_HEX >= 0x030800b1
20427   0, /*tp_vectorcall*/
20428   #endif
20429   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20430   0, /*tp_print*/
20431   #endif
20432   #if PY_VERSION_HEX >= 0x030B00A2
20433   0, /*tp_inline_values_offset*/
20434   #endif
20435 };
20436 
__pyx_tp_new_2bx_6arrays_10array_tree_ArrayTree(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)20437 static PyObject *__pyx_tp_new_2bx_6arrays_10array_tree_ArrayTree(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20438   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *p;
20439   PyObject *o;
20440   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20441     o = (*t->tp_alloc)(t, 0);
20442   } else {
20443     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20444   }
20445   if (unlikely(!o)) return 0;
20446   p = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)o);
20447   p->dtype = Py_None; Py_INCREF(Py_None);
20448   p->root = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)Py_None); Py_INCREF(Py_None);
20449   return o;
20450 }
20451 
__pyx_tp_dealloc_2bx_6arrays_10array_tree_ArrayTree(PyObject * o)20452 static void __pyx_tp_dealloc_2bx_6arrays_10array_tree_ArrayTree(PyObject *o) {
20453   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *p = (struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)o;
20454   #if CYTHON_USE_TP_FINALIZE
20455   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20456     if (PyObject_CallFinalizerFromDealloc(o)) return;
20457   }
20458   #endif
20459   PyObject_GC_UnTrack(o);
20460   Py_CLEAR(p->dtype);
20461   Py_CLEAR(p->root);
20462   (*Py_TYPE(o)->tp_free)(o);
20463 }
20464 
__pyx_tp_traverse_2bx_6arrays_10array_tree_ArrayTree(PyObject * o,visitproc v,void * a)20465 static int __pyx_tp_traverse_2bx_6arrays_10array_tree_ArrayTree(PyObject *o, visitproc v, void *a) {
20466   int e;
20467   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *p = (struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)o;
20468   if (p->dtype) {
20469     e = (*v)(p->dtype, a); if (e) return e;
20470   }
20471   if (p->root) {
20472     e = (*v)(((PyObject *)p->root), a); if (e) return e;
20473   }
20474   return 0;
20475 }
20476 
__pyx_tp_clear_2bx_6arrays_10array_tree_ArrayTree(PyObject * o)20477 static int __pyx_tp_clear_2bx_6arrays_10array_tree_ArrayTree(PyObject *o) {
20478   PyObject* tmp;
20479   struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *p = (struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree *)o;
20480   tmp = ((PyObject*)p->dtype);
20481   p->dtype = Py_None; Py_INCREF(Py_None);
20482   Py_XDECREF(tmp);
20483   tmp = ((PyObject*)p->root);
20484   p->root = ((struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *)Py_None); Py_INCREF(Py_None);
20485   Py_XDECREF(tmp);
20486   return 0;
20487 }
__pyx_sq_item_2bx_6arrays_10array_tree_ArrayTree(PyObject * o,Py_ssize_t i)20488 static PyObject *__pyx_sq_item_2bx_6arrays_10array_tree_ArrayTree(PyObject *o, Py_ssize_t i) {
20489   PyObject *r;
20490   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
20491   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20492   Py_DECREF(x);
20493   return r;
20494 }
20495 
__pyx_mp_ass_subscript_2bx_6arrays_10array_tree_ArrayTree(PyObject * o,PyObject * i,PyObject * v)20496 static int __pyx_mp_ass_subscript_2bx_6arrays_10array_tree_ArrayTree(PyObject *o, PyObject *i, PyObject *v) {
20497   if (v) {
20498     return __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_3__setitem__(o, i, v);
20499   }
20500   else {
20501     PyErr_Format(PyExc_NotImplementedError,
20502       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20503     return -1;
20504   }
20505 }
20506 
__pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_max(PyObject * o,CYTHON_UNUSED void * x)20507 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_max(PyObject *o, CYTHON_UNUSED void *x) {
20508   return __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_3max_1__get__(o);
20509 }
20510 
__pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_max(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)20511 static int __pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_max(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20512   if (v) {
20513     return __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_3max_3__set__(o, v);
20514   }
20515   else {
20516     PyErr_SetString(PyExc_NotImplementedError, "__del__");
20517     return -1;
20518   }
20519 }
20520 
__pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_block_size(PyObject * o,CYTHON_UNUSED void * x)20521 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_block_size(PyObject *o, CYTHON_UNUSED void *x) {
20522   return __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_10block_size_1__get__(o);
20523 }
20524 
__pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_block_size(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)20525 static int __pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_block_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20526   if (v) {
20527     return __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_10block_size_3__set__(o, v);
20528   }
20529   else {
20530     PyErr_SetString(PyExc_NotImplementedError, "__del__");
20531     return -1;
20532   }
20533 }
20534 
__pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_dtype(PyObject * o,CYTHON_UNUSED void * x)20535 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_dtype(PyObject *o, CYTHON_UNUSED void *x) {
20536   return __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_5dtype_1__get__(o);
20537 }
20538 
__pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_dtype(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)20539 static int __pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_dtype(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20540   if (v) {
20541     return __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_5dtype_3__set__(o, v);
20542   }
20543   else {
20544     return __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_5dtype_5__del__(o);
20545   }
20546 }
20547 
__pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_levels(PyObject * o,CYTHON_UNUSED void * x)20548 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_levels(PyObject *o, CYTHON_UNUSED void *x) {
20549   return __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_6levels_1__get__(o);
20550 }
20551 
__pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_levels(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)20552 static int __pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_levels(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20553   if (v) {
20554     return __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_6levels_3__set__(o, v);
20555   }
20556   else {
20557     PyErr_SetString(PyExc_NotImplementedError, "__del__");
20558     return -1;
20559   }
20560 }
20561 
__pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_no_leaves(PyObject * o,CYTHON_UNUSED void * x)20562 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_no_leaves(PyObject *o, CYTHON_UNUSED void *x) {
20563   return __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_9no_leaves_1__get__(o);
20564 }
20565 
__pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_no_leaves(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)20566 static int __pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_no_leaves(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20567   if (v) {
20568     return __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_9no_leaves_3__set__(o, v);
20569   }
20570   else {
20571     PyErr_SetString(PyExc_NotImplementedError, "__del__");
20572     return -1;
20573   }
20574 }
20575 
__pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_root(PyObject * o,CYTHON_UNUSED void * x)20576 static PyObject *__pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_root(PyObject *o, CYTHON_UNUSED void *x) {
20577   return __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_4root_1__get__(o);
20578 }
20579 
__pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_root(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)20580 static int __pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_root(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20581   if (v) {
20582     return __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_4root_3__set__(o, v);
20583   }
20584   else {
20585     return __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_4root_5__del__(o);
20586   }
20587 }
20588 
20589 static PyMethodDef __pyx_methods_2bx_6arrays_10array_tree_ArrayTree[] = {
20590   {"set_range", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_5set_range, METH_VARARGS|METH_KEYWORDS, 0},
20591   {"to_file", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_9to_file, METH_VARARGS|METH_KEYWORDS, 0},
20592   {"from_file", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_11from_file, METH_VARARGS|METH_KEYWORDS, 0},
20593   {"from_sequence", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_13from_sequence, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2bx_6arrays_10array_tree_9ArrayTree_12from_sequence},
20594   {"__reduce_cython__", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_15__reduce_cython__, METH_NOARGS, 0},
20595   {"__setstate_cython__", (PyCFunction)__pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_17__setstate_cython__, METH_O, 0},
20596   {0, 0, 0, 0}
20597 };
20598 
20599 static struct PyGetSetDef __pyx_getsets_2bx_6arrays_10array_tree_ArrayTree[] = {
20600   {(char *)"max", __pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_max, __pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_max, (char *)0, 0},
20601   {(char *)"block_size", __pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_block_size, __pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_block_size, (char *)0, 0},
20602   {(char *)"dtype", __pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_dtype, __pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_dtype, (char *)0, 0},
20603   {(char *)"levels", __pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_levels, __pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_levels, (char *)0, 0},
20604   {(char *)"no_leaves", __pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_no_leaves, __pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_no_leaves, (char *)0, 0},
20605   {(char *)"root", __pyx_getprop_2bx_6arrays_10array_tree_9ArrayTree_root, __pyx_setprop_2bx_6arrays_10array_tree_9ArrayTree_root, (char *)0, 0},
20606   {0, 0, 0, 0, 0}
20607 };
20608 
20609 static PySequenceMethods __pyx_tp_as_sequence_ArrayTree = {
20610   0, /*sq_length*/
20611   0, /*sq_concat*/
20612   0, /*sq_repeat*/
20613   __pyx_sq_item_2bx_6arrays_10array_tree_ArrayTree, /*sq_item*/
20614   0, /*sq_slice*/
20615   0, /*sq_ass_item*/
20616   0, /*sq_ass_slice*/
20617   0, /*sq_contains*/
20618   0, /*sq_inplace_concat*/
20619   0, /*sq_inplace_repeat*/
20620 };
20621 
20622 static PyMappingMethods __pyx_tp_as_mapping_ArrayTree = {
20623   0, /*mp_length*/
20624   __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_7__getitem__, /*mp_subscript*/
20625   __pyx_mp_ass_subscript_2bx_6arrays_10array_tree_ArrayTree, /*mp_ass_subscript*/
20626 };
20627 
20628 static PyTypeObject __pyx_type_2bx_6arrays_10array_tree_ArrayTree = {
20629   PyVarObject_HEAD_INIT(0, 0)
20630   "bx.arrays.array_tree.ArrayTree", /*tp_name*/
20631   sizeof(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTree), /*tp_basicsize*/
20632   0, /*tp_itemsize*/
20633   __pyx_tp_dealloc_2bx_6arrays_10array_tree_ArrayTree, /*tp_dealloc*/
20634   #if PY_VERSION_HEX < 0x030800b4
20635   0, /*tp_print*/
20636   #endif
20637   #if PY_VERSION_HEX >= 0x030800b4
20638   0, /*tp_vectorcall_offset*/
20639   #endif
20640   0, /*tp_getattr*/
20641   0, /*tp_setattr*/
20642   #if PY_MAJOR_VERSION < 3
20643   0, /*tp_compare*/
20644   #endif
20645   #if PY_MAJOR_VERSION >= 3
20646   0, /*tp_as_async*/
20647   #endif
20648   0, /*tp_repr*/
20649   0, /*tp_as_number*/
20650   &__pyx_tp_as_sequence_ArrayTree, /*tp_as_sequence*/
20651   &__pyx_tp_as_mapping_ArrayTree, /*tp_as_mapping*/
20652   0, /*tp_hash*/
20653   0, /*tp_call*/
20654   0, /*tp_str*/
20655   0, /*tp_getattro*/
20656   0, /*tp_setattro*/
20657   0, /*tp_as_buffer*/
20658   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20659   "\n    Stores a sparse array of data as a tree.\n    \n    An array of `self.max` values is stored in a tree in which each leaf\n    contains `self.block_size` values and each internal node contains\n    `self.block_size` children.\n    \n    Entirely empty subtrees are not stored. Thus, the storage is efficient for\n    data that is block sparse -- having contiguous chunks of `self.block_size` or\n    larger data. Currently it is not efficient if the data is strided (e.g.\n    one or two data points in every interval of length `self.block_size`).\n    \n    Internal nodes store `Summary` instances for their subtrees. \n    ", /*tp_doc*/
20660   __pyx_tp_traverse_2bx_6arrays_10array_tree_ArrayTree, /*tp_traverse*/
20661   __pyx_tp_clear_2bx_6arrays_10array_tree_ArrayTree, /*tp_clear*/
20662   0, /*tp_richcompare*/
20663   0, /*tp_weaklistoffset*/
20664   0, /*tp_iter*/
20665   0, /*tp_iternext*/
20666   __pyx_methods_2bx_6arrays_10array_tree_ArrayTree, /*tp_methods*/
20667   0, /*tp_members*/
20668   __pyx_getsets_2bx_6arrays_10array_tree_ArrayTree, /*tp_getset*/
20669   0, /*tp_base*/
20670   0, /*tp_dict*/
20671   0, /*tp_descr_get*/
20672   0, /*tp_descr_set*/
20673   0, /*tp_dictoffset*/
20674   __pyx_pw_2bx_6arrays_10array_tree_9ArrayTree_1__init__, /*tp_init*/
20675   0, /*tp_alloc*/
20676   __pyx_tp_new_2bx_6arrays_10array_tree_ArrayTree, /*tp_new*/
20677   0, /*tp_free*/
20678   0, /*tp_is_gc*/
20679   0, /*tp_bases*/
20680   0, /*tp_mro*/
20681   0, /*tp_cache*/
20682   0, /*tp_subclasses*/
20683   0, /*tp_weaklist*/
20684   0, /*tp_del*/
20685   0, /*tp_version_tag*/
20686   #if PY_VERSION_HEX >= 0x030400a1
20687   0, /*tp_finalize*/
20688   #endif
20689   #if PY_VERSION_HEX >= 0x030800b1
20690   0, /*tp_vectorcall*/
20691   #endif
20692   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20693   0, /*tp_print*/
20694   #endif
20695   #if PY_VERSION_HEX >= 0x030B00A2
20696   0, /*tp_inline_values_offset*/
20697   #endif
20698 };
20699 
20700 static PyMethodDef __pyx_methods[] = {
20701   {0, 0, 0, 0}
20702 };
20703 
__pyx_import_star_set(PyObject * o,PyObject * py_name,char * name)20704 static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) {
20705   static const char* internal_type_names[] = {
20706     "ArrayTree",
20707     "ArrayTreeLeaf",
20708     "ArrayTreeNode",
20709     "FileArrayTree",
20710     "FileArrayTreeDict",
20711     "Summary",
20712     "__pyx_ctuple_PY_LONG_LONG",
20713     "__pyx_ctuple_PY_LONG_LONG_struct",
20714     "__pyx_ctuple_Py_ssize_t",
20715     "__pyx_ctuple_Py_ssize_t_struct",
20716     "__pyx_ctuple_int",
20717     "__pyx_ctuple_int__and_long__and_long",
20718     "__pyx_ctuple_int__and_long__and_long_struct",
20719     "__pyx_ctuple_int_struct",
20720     "__pyx_ctuple_long",
20721     "__pyx_ctuple_long_struct",
20722     0
20723   };
20724   const char** type_name = internal_type_names;
20725   while (*type_name) {
20726     if (__Pyx_StrEq(name, *type_name)) {
20727       PyErr_Format(PyExc_TypeError, "Cannot overwrite C type %s", name);
20728       goto bad;
20729     }
20730     type_name++;
20731   }
20732   if (0);
20733   else {
20734     if (PyObject_SetAttr(__pyx_m, py_name, o) < 0) goto bad;
20735   }
20736   return 0;
20737   bad:
20738   return -1;
20739 }
20740 
20741 static int
__Pyx_import_all_from(PyObject * locals,PyObject * v)20742 __Pyx_import_all_from(PyObject *locals, PyObject *v)
20743 {
20744     PyObject *all = PyObject_GetAttrString(v, "__all__");
20745     PyObject *dict, *name, *value;
20746     int skip_leading_underscores = 0;
20747     int pos, err;
20748     if (all == NULL) {
20749         if (!PyErr_ExceptionMatches(PyExc_AttributeError))
20750             return -1;
20751         PyErr_Clear();
20752         dict = PyObject_GetAttrString(v, "__dict__");
20753         if (dict == NULL) {
20754             if (!PyErr_ExceptionMatches(PyExc_AttributeError))
20755                 return -1;
20756             PyErr_SetString(PyExc_ImportError,
20757             "from-import-* object has no __dict__ and no __all__");
20758             return -1;
20759         }
20760 #if PY_MAJOR_VERSION < 3
20761         all = PyObject_CallMethod(dict, (char *)"keys", NULL);
20762 #else
20763         all = PyMapping_Keys(dict);
20764 #endif
20765         Py_DECREF(dict);
20766         if (all == NULL)
20767             return -1;
20768         skip_leading_underscores = 1;
20769     }
20770     for (pos = 0, err = 0; ; pos++) {
20771         name = PySequence_GetItem(all, pos);
20772         if (name == NULL) {
20773             if (!PyErr_ExceptionMatches(PyExc_IndexError))
20774                 err = -1;
20775             else
20776                 PyErr_Clear();
20777             break;
20778         }
20779         if (skip_leading_underscores &&
20780 #if PY_MAJOR_VERSION < 3
20781             likely(PyString_Check(name)) &&
20782             PyString_AS_STRING(name)[0] == '_')
20783 #else
20784             likely(PyUnicode_Check(name)) &&
20785             likely(__Pyx_PyUnicode_GET_LENGTH(name)) &&
20786             __Pyx_PyUnicode_READ_CHAR(name, 0) == '_')
20787 #endif
20788         {
20789             Py_DECREF(name);
20790             continue;
20791         }
20792         value = PyObject_GetAttr(v, name);
20793         if (value == NULL)
20794             err = -1;
20795         else if (PyDict_CheckExact(locals))
20796             err = PyDict_SetItem(locals, name, value);
20797         else
20798             err = PyObject_SetItem(locals, name, value);
20799         Py_DECREF(name);
20800         Py_XDECREF(value);
20801         if (err != 0)
20802             break;
20803     }
20804     Py_DECREF(all);
20805     return err;
20806 }
__pyx_import_star(PyObject * m)20807 static int __pyx_import_star(PyObject* m) {
20808     int i;
20809     int ret = -1;
20810     char* s;
20811     PyObject *locals = 0;
20812     PyObject *list = 0;
20813 #if PY_MAJOR_VERSION >= 3
20814     PyObject *utf8_name = 0;
20815 #endif
20816     PyObject *name;
20817     PyObject *item;
20818     locals = PyDict_New();              if (!locals) goto bad;
20819     if (__Pyx_import_all_from(locals, m) < 0) goto bad;
20820     list = PyDict_Items(locals);        if (!list) goto bad;
20821     for(i=0; i<PyList_GET_SIZE(list); i++) {
20822         name = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 0);
20823         item = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 1);
20824 #if PY_MAJOR_VERSION >= 3
20825         utf8_name = PyUnicode_AsUTF8String(name);
20826         if (!utf8_name) goto bad;
20827         s = PyBytes_AS_STRING(utf8_name);
20828         if (__pyx_import_star_set(item, name, s) < 0) goto bad;
20829         Py_DECREF(utf8_name); utf8_name = 0;
20830 #else
20831         s = PyString_AsString(name);
20832         if (!s) goto bad;
20833         if (__pyx_import_star_set(item, name, s) < 0) goto bad;
20834 #endif
20835     }
20836     ret = 0;
20837 bad:
20838     Py_XDECREF(locals);
20839     Py_XDECREF(list);
20840 #if PY_MAJOR_VERSION >= 3
20841     Py_XDECREF(utf8_name);
20842 #endif
20843     return ret;
20844 }
20845 
20846 
20847 
20848 #if PY_MAJOR_VERSION >= 3
20849 #if CYTHON_PEP489_MULTI_PHASE_INIT
20850 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
20851 static int __pyx_pymod_exec_array_tree(PyObject* module); /*proto*/
20852 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
20853   {Py_mod_create, (void*)__pyx_pymod_create},
20854   {Py_mod_exec, (void*)__pyx_pymod_exec_array_tree},
20855   {0, NULL}
20856 };
20857 #endif
20858 
20859 static struct PyModuleDef __pyx_moduledef = {
20860     PyModuleDef_HEAD_INIT,
20861     "array_tree",
20862     0, /* m_doc */
20863   #if CYTHON_PEP489_MULTI_PHASE_INIT
20864     0, /* m_size */
20865   #else
20866     -1, /* m_size */
20867   #endif
20868     __pyx_methods /* m_methods */,
20869   #if CYTHON_PEP489_MULTI_PHASE_INIT
20870     __pyx_moduledef_slots, /* m_slots */
20871   #else
20872     NULL, /* m_reload */
20873   #endif
20874     NULL, /* m_traverse */
20875     NULL, /* m_clear */
20876     NULL /* m_free */
20877 };
20878 #endif
20879 #ifndef CYTHON_SMALL_CODE
20880 #if defined(__clang__)
20881     #define CYTHON_SMALL_CODE
20882 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
20883     #define CYTHON_SMALL_CODE __attribute__((cold))
20884 #else
20885     #define CYTHON_SMALL_CODE
20886 #endif
20887 #endif
20888 
20889 static __Pyx_StringTabEntry __pyx_string_tab[] = {
20890   {&__pyx_n_s_ArrayTree, __pyx_k_ArrayTree, sizeof(__pyx_k_ArrayTree), 0, 0, 1, 1},
20891   {&__pyx_n_s_ArrayTreeLeaf, __pyx_k_ArrayTreeLeaf, sizeof(__pyx_k_ArrayTreeLeaf), 0, 0, 1, 1},
20892   {&__pyx_n_s_ArrayTreeNode, __pyx_k_ArrayTreeNode, sizeof(__pyx_k_ArrayTreeNode), 0, 0, 1, 1},
20893   {&__pyx_n_s_BinaryFileReader, __pyx_k_BinaryFileReader, sizeof(__pyx_k_BinaryFileReader), 0, 0, 1, 1},
20894   {&__pyx_n_s_BinaryFileWriter, __pyx_k_BinaryFileWriter, sizeof(__pyx_k_BinaryFileWriter), 0, 0, 1, 1},
20895   {&__pyx_n_s_FileArrayTree, __pyx_k_FileArrayTree, sizeof(__pyx_k_FileArrayTree), 0, 0, 1, 1},
20896   {&__pyx_n_s_FileArrayTreeDict, __pyx_k_FileArrayTreeDict, sizeof(__pyx_k_FileArrayTreeDict), 0, 0, 1, 1},
20897   {&__pyx_n_s_FileCDBDict, __pyx_k_FileCDBDict, sizeof(__pyx_k_FileCDBDict), 0, 0, 1, 1},
20898   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
20899   {&__pyx_kp_s_Incompatible_checksums_s_vs_0x0f, __pyx_k_Incompatible_checksums_s_vs_0x0f, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x0f), 0, 0, 1, 0},
20900   {&__pyx_kp_s_Incompatible_checksums_s_vs_0x69, __pyx_k_Incompatible_checksums_s_vs_0x69, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x69), 0, 0, 1, 0},
20901   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xc1, __pyx_k_Incompatible_checksums_s_vs_0xc1, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xc1), 0, 0, 1, 0},
20902   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xcf, __pyx_k_Incompatible_checksums_s_vs_0xcf, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xcf), 0, 0, 1, 0},
20903   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xea, __pyx_k_Incompatible_checksums_s_vs_0xea, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xea), 0, 0, 1, 0},
20904   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xeb, __pyx_k_Incompatible_checksums_s_vs_0xeb, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xeb), 0, 0, 1, 0},
20905   {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1},
20906   {&__pyx_n_s_MAGIC, __pyx_k_MAGIC, sizeof(__pyx_k_MAGIC), 0, 0, 1, 1},
20907   {&__pyx_n_s_NUM_SUMMARY_ARRAYS, __pyx_k_NUM_SUMMARY_ARRAYS, sizeof(__pyx_k_NUM_SUMMARY_ARRAYS), 0, 0, 1, 1},
20908   {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
20909   {&__pyx_n_s_Summary, __pyx_k_Summary, sizeof(__pyx_k_Summary), 0, 0, 1, 1},
20910   {&__pyx_n_s_VERSION, __pyx_k_VERSION, sizeof(__pyx_k_VERSION), 0, 0, 1, 1},
20911   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
20912   {&__pyx_kp_s_Writing_without_summaries_is_cur, __pyx_k_Writing_without_summaries_is_cur, sizeof(__pyx_k_Writing_without_summaries_is_cur), 0, 0, 1, 0},
20913   {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0},
20914   {&__pyx_n_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 1},
20915   {&__pyx_n_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 1},
20916   {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
20917   {&__pyx_n_s_array_tree_dict_from_reader, __pyx_k_array_tree_dict_from_reader, sizeof(__pyx_k_array_tree_dict_from_reader), 0, 0, 1, 1},
20918   {&__pyx_n_s_block_size, __pyx_k_block_size, sizeof(__pyx_k_block_size), 0, 0, 1, 1},
20919   {&__pyx_n_s_build_summary, __pyx_k_build_summary, sizeof(__pyx_k_build_summary), 0, 0, 1, 1},
20920   {&__pyx_n_s_bx_arrays_array_tree, __pyx_k_bx_arrays_array_tree, sizeof(__pyx_k_bx_arrays_array_tree), 0, 0, 1, 1},
20921   {&__pyx_n_s_bx_misc_binary_file, __pyx_k_bx_misc_binary_file, sizeof(__pyx_k_bx_misc_binary_file), 0, 0, 1, 1},
20922   {&__pyx_n_s_bx_misc_cdb, __pyx_k_bx_misc_cdb, sizeof(__pyx_k_bx_misc_cdb), 0, 0, 1, 1},
20923   {&__pyx_n_s_char, __pyx_k_char, sizeof(__pyx_k_char), 0, 0, 1, 1},
20924   {&__pyx_n_s_chrom, __pyx_k_chrom, sizeof(__pyx_k_chrom), 0, 0, 1, 1},
20925   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
20926   {&__pyx_n_s_counts, __pyx_k_counts, sizeof(__pyx_k_counts), 0, 0, 1, 1},
20927   {&__pyx_n_s_default_size, __pyx_k_default_size, sizeof(__pyx_k_default_size), 0, 0, 1, 1},
20928   {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
20929   {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
20930   {&__pyx_n_s_dict_to_file, __pyx_k_dict_to_file, sizeof(__pyx_k_dict_to_file), 0, 0, 1, 1},
20931   {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
20932   {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
20933   {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
20934   {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
20935   {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
20936   {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
20937   {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1},
20938   {&__pyx_n_s_frequencies, __pyx_k_frequencies, sizeof(__pyx_k_frequencies), 0, 0, 1, 1},
20939   {&__pyx_n_s_frequency, __pyx_k_frequency, sizeof(__pyx_k_frequency), 0, 0, 1, 1},
20940   {&__pyx_n_s_from_file, __pyx_k_from_file, sizeof(__pyx_k_from_file), 0, 0, 1, 1},
20941   {&__pyx_n_s_from_sequence, __pyx_k_from_sequence, sizeof(__pyx_k_from_sequence), 0, 0, 1, 1},
20942   {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
20943   {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
20944   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
20945   {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
20946   {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
20947   {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1},
20948   {&__pyx_n_s_is_little_endian, __pyx_k_is_little_endian, sizeof(__pyx_k_is_little_endian), 0, 0, 1, 1},
20949   {&__pyx_n_s_isnan, __pyx_k_isnan, sizeof(__pyx_k_isnan), 0, 0, 1, 1},
20950   {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
20951   {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
20952   {&__pyx_n_s_iterkeys, __pyx_k_iterkeys, sizeof(__pyx_k_iterkeys), 0, 0, 1, 1},
20953   {&__pyx_n_s_last_array_tree, __pyx_k_last_array_tree, sizeof(__pyx_k_last_array_tree), 0, 0, 1, 1},
20954   {&__pyx_n_s_last_chrom, __pyx_k_last_chrom, sizeof(__pyx_k_last_chrom), 0, 0, 1, 1},
20955   {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1},
20956   {&__pyx_kp_s_level_must_be_self_levels, __pyx_k_level_must_be_self_levels, sizeof(__pyx_k_level_must_be_self_levels), 0, 0, 1, 0},
20957   {&__pyx_kp_s_lib_bx_arrays_array_tree_pyx, __pyx_k_lib_bx_arrays_array_tree_pyx, sizeof(__pyx_k_lib_bx_arrays_array_tree_pyx), 0, 0, 1, 0},
20958   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
20959   {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
20960   {&__pyx_kp_s_max_block_size_not_yet_handled, __pyx_k_max_block_size_not_yet_handled, sizeof(__pyx_k_max_block_size_not_yet_handled), 0, 0, 1, 0},
20961   {&__pyx_n_s_maxs, __pyx_k_maxs, sizeof(__pyx_k_maxs), 0, 0, 1, 1},
20962   {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1},
20963   {&__pyx_n_s_mins, __pyx_k_mins, sizeof(__pyx_k_mins), 0, 0, 1, 1},
20964   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
20965   {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1},
20966   {&__pyx_n_s_nanmax, __pyx_k_nanmax, sizeof(__pyx_k_nanmax), 0, 0, 1, 1},
20967   {&__pyx_n_s_nanmin, __pyx_k_nanmin, sizeof(__pyx_k_nanmin), 0, 0, 1, 1},
20968   {&__pyx_n_s_nansum, __pyx_k_nansum, sizeof(__pyx_k_nansum), 0, 0, 1, 1},
20969   {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
20970   {&__pyx_n_s_no_leaves, __pyx_k_no_leaves, sizeof(__pyx_k_no_leaves), 0, 0, 1, 1},
20971   {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
20972   {&__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},
20973   {&__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},
20974   {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
20975   {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
20976   {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
20977   {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
20978   {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
20979   {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
20980   {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
20981   {&__pyx_n_s_pyx_unpickle_ArrayTree, __pyx_k_pyx_unpickle_ArrayTree, sizeof(__pyx_k_pyx_unpickle_ArrayTree), 0, 0, 1, 1},
20982   {&__pyx_n_s_pyx_unpickle_ArrayTreeLeaf, __pyx_k_pyx_unpickle_ArrayTreeLeaf, sizeof(__pyx_k_pyx_unpickle_ArrayTreeLeaf), 0, 0, 1, 1},
20983   {&__pyx_n_s_pyx_unpickle_ArrayTreeNode, __pyx_k_pyx_unpickle_ArrayTreeNode, sizeof(__pyx_k_pyx_unpickle_ArrayTreeNode), 0, 0, 1, 1},
20984   {&__pyx_n_s_pyx_unpickle_FileArrayTree, __pyx_k_pyx_unpickle_FileArrayTree, sizeof(__pyx_k_pyx_unpickle_FileArrayTree), 0, 0, 1, 1},
20985   {&__pyx_n_s_pyx_unpickle_FileArrayTreeDict, __pyx_k_pyx_unpickle_FileArrayTreeDict, sizeof(__pyx_k_pyx_unpickle_FileArrayTreeDict), 0, 0, 1, 1},
20986   {&__pyx_n_s_pyx_unpickle_Summary, __pyx_k_pyx_unpickle_Summary, sizeof(__pyx_k_pyx_unpickle_Summary), 0, 0, 1, 1},
20987   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
20988   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
20989   {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
20990   {&__pyx_n_s_read_raw_array, __pyx_k_read_raw_array, sizeof(__pyx_k_read_raw_array), 0, 0, 1, 1},
20991   {&__pyx_n_s_read_uint32, __pyx_k_read_uint32, sizeof(__pyx_k_read_uint32), 0, 0, 1, 1},
20992   {&__pyx_n_s_read_uint64, __pyx_k_read_uint64, sizeof(__pyx_k_read_uint64), 0, 0, 1, 1},
20993   {&__pyx_n_s_reader, __pyx_k_reader, sizeof(__pyx_k_reader), 0, 0, 1, 1},
20994   {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
20995   {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
20996   {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
20997   {&__pyx_n_s_root, __pyx_k_root, sizeof(__pyx_k_root), 0, 0, 1, 1},
20998   {&__pyx_n_s_rval, __pyx_k_rval, sizeof(__pyx_k_rval), 0, 0, 1, 1},
20999   {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
21000   {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1},
21001   {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1},
21002   {&__pyx_n_s_set_range, __pyx_k_set_range, sizeof(__pyx_k_set_range), 0, 0, 1, 1},
21003   {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
21004   {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
21005   {&__pyx_n_s_sizes, __pyx_k_sizes, sizeof(__pyx_k_sizes), 0, 0, 1, 1},
21006   {&__pyx_n_s_skip, __pyx_k_skip, sizeof(__pyx_k_skip), 0, 0, 1, 1},
21007   {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
21008   {&__pyx_n_s_start_offset, __pyx_k_start_offset, sizeof(__pyx_k_start_offset), 0, 0, 1, 1},
21009   {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
21010   {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
21011   {&__pyx_n_s_summary, __pyx_k_summary, sizeof(__pyx_k_summary), 0, 0, 1, 1},
21012   {&__pyx_n_s_sums, __pyx_k_sums, sizeof(__pyx_k_sums), 0, 0, 1, 1},
21013   {&__pyx_n_s_sumsquares, __pyx_k_sumsquares, sizeof(__pyx_k_sumsquares), 0, 0, 1, 1},
21014   {&__pyx_n_s_tell, __pyx_k_tell, sizeof(__pyx_k_tell), 0, 0, 1, 1},
21015   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
21016   {&__pyx_n_s_to_file, __pyx_k_to_file, sizeof(__pyx_k_to_file), 0, 0, 1, 1},
21017   {&__pyx_n_s_to_file_data_pass, __pyx_k_to_file_data_pass, sizeof(__pyx_k_to_file_data_pass), 0, 0, 1, 1},
21018   {&__pyx_n_s_to_file_offset_pass, __pyx_k_to_file_offset_pass, sizeof(__pyx_k_to_file_offset_pass), 0, 0, 1, 1},
21019   {&__pyx_n_s_tree, __pyx_k_tree, sizeof(__pyx_k_tree), 0, 0, 1, 1},
21020   {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
21021   {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
21022   {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
21023   {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
21024   {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
21025   {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
21026   {&__pyx_n_s_write_raw_array, __pyx_k_write_raw_array, sizeof(__pyx_k_write_raw_array), 0, 0, 1, 1},
21027   {&__pyx_n_s_write_uint32, __pyx_k_write_uint32, sizeof(__pyx_k_write_uint32), 0, 0, 1, 1},
21028   {&__pyx_n_s_write_uint64, __pyx_k_write_uint64, sizeof(__pyx_k_write_uint64), 0, 0, 1, 1},
21029   {0, 0, 0, 0, 0, 0, 0}
21030 };
__Pyx_InitCachedBuiltins(void)21031 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
21032   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 160, __pyx_L1_error)
21033   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 281, __pyx_L1_error)
21034   __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 372, __pyx_L1_error)
21035   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
21036   return 0;
21037   __pyx_L1_error:;
21038   return -1;
21039 }
21040 
__Pyx_InitCachedConstants(void)21041 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
21042   __Pyx_RefNannyDeclarations
21043   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
21044 
21045   /* "bx/arrays/array_tree.pyx":108
21046  *         cdb_dict = {}
21047  *         for key in dict.iterkeys():
21048  *             cdb_dict[ key ] = io.pack( "L", 0 )             # <<<<<<<<<<<<<<
21049  *         cdb_offset = io.tell()
21050  *         FileCDBDict.to_file( cdb_dict, file, is_little_endian=is_little_endian )
21051  */
21052   __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_s_L, __pyx_int_0); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 108, __pyx_L1_error)
21053   __Pyx_GOTREF(__pyx_tuple_);
21054   __Pyx_GIVEREF(__pyx_tuple_);
21055 
21056   /* "bx/arrays/array_tree.pyx":495
21057  *         self.frequency = 0
21058  *         self.values = empty( max - min, self.tree.dtype )
21059  *         self.values[:] = nan             # <<<<<<<<<<<<<<
21060  *         self.start_offset = 0
21061  *
21062  */
21063   __pyx_slice__4 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 495, __pyx_L1_error)
21064   __Pyx_GOTREF(__pyx_slice__4);
21065   __Pyx_GIVEREF(__pyx_slice__4);
21066 
21067   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":945
21068  *         __pyx_import_array()
21069  *     except Exception:
21070  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
21071  *
21072  * cdef inline int import_umath() except -1:
21073  */
21074   __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 945, __pyx_L1_error)
21075   __Pyx_GOTREF(__pyx_tuple__5);
21076   __Pyx_GIVEREF(__pyx_tuple__5);
21077 
21078   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":951
21079  *         _import_umath()
21080  *     except Exception:
21081  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
21082  *
21083  * cdef inline int import_ufunc() except -1:
21084  */
21085   __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 951, __pyx_L1_error)
21086   __Pyx_GOTREF(__pyx_tuple__6);
21087   __Pyx_GIVEREF(__pyx_tuple__6);
21088 
21089   /* "bx/arrays/array_tree.pyx":62
21090  * NUM_SUMMARY_ARRAYS = 6
21091  *
21092  * def array_tree_dict_from_reader( reader, sizes, default_size=2147483647, block_size=1000, no_leaves=False ):             # <<<<<<<<<<<<<<
21093  *     # Create empty array trees
21094  *     rval = {}
21095  */
21096   __pyx_tuple__9 = PyTuple_Pack(13, __pyx_n_s_reader, __pyx_n_s_sizes, __pyx_n_s_default_size, __pyx_n_s_block_size, __pyx_n_s_no_leaves, __pyx_n_s_rval, __pyx_n_s_last_chrom, __pyx_n_s_last_array_tree, __pyx_n_s_chrom, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s__8, __pyx_n_s_val); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 62, __pyx_L1_error)
21097   __Pyx_GOTREF(__pyx_tuple__9);
21098   __Pyx_GIVEREF(__pyx_tuple__9);
21099   __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_bx_arrays_array_tree_pyx, __pyx_n_s_array_tree_dict_from_reader, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 62, __pyx_L1_error)
21100 
21101   /* "(tree fragment)":1
21102  * def __pyx_unpickle_FileArrayTreeDict(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
21103  *     cdef object __pyx_PickleError
21104  *     cdef object __pyx_result
21105  */
21106   __pyx_tuple__11 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 1, __pyx_L1_error)
21107   __Pyx_GOTREF(__pyx_tuple__11);
21108   __Pyx_GIVEREF(__pyx_tuple__11);
21109   __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_FileArrayTreeDict, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 1, __pyx_L1_error)
21110   __pyx_tuple__13 = 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__13)) __PYX_ERR(1, 1, __pyx_L1_error)
21111   __Pyx_GOTREF(__pyx_tuple__13);
21112   __Pyx_GIVEREF(__pyx_tuple__13);
21113   __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_FileArrayTree, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
21114   __pyx_tuple__15 = 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__15)) __PYX_ERR(1, 1, __pyx_L1_error)
21115   __Pyx_GOTREF(__pyx_tuple__15);
21116   __Pyx_GIVEREF(__pyx_tuple__15);
21117   __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Summary, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 1, __pyx_L1_error)
21118   __pyx_tuple__17 = 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__17)) __PYX_ERR(1, 1, __pyx_L1_error)
21119   __Pyx_GOTREF(__pyx_tuple__17);
21120   __Pyx_GIVEREF(__pyx_tuple__17);
21121   __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_ArrayTree, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 1, __pyx_L1_error)
21122   __pyx_tuple__19 = 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__19)) __PYX_ERR(1, 1, __pyx_L1_error)
21123   __Pyx_GOTREF(__pyx_tuple__19);
21124   __Pyx_GIVEREF(__pyx_tuple__19);
21125   __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_ArrayTreeNode, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 1, __pyx_L1_error)
21126   __pyx_tuple__21 = 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__21)) __PYX_ERR(1, 1, __pyx_L1_error)
21127   __Pyx_GOTREF(__pyx_tuple__21);
21128   __Pyx_GIVEREF(__pyx_tuple__21);
21129   __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_ArrayTreeLeaf, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(1, 1, __pyx_L1_error)
21130   __Pyx_RefNannyFinishContext();
21131   return 0;
21132   __pyx_L1_error:;
21133   __Pyx_RefNannyFinishContext();
21134   return -1;
21135 }
21136 
__Pyx_InitGlobals(void)21137 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
21138   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
21139   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
21140   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21141   __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
21142   __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
21143   __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error)
21144   __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error)
21145   __pyx_int_16039877 = PyInt_FromLong(16039877L); if (unlikely(!__pyx_int_16039877)) __PYX_ERR(0, 1, __pyx_L1_error)
21146   __pyx_int_110204367 = PyInt_FromLong(110204367L); if (unlikely(!__pyx_int_110204367)) __PYX_ERR(0, 1, __pyx_L1_error)
21147   __pyx_int_202518704 = PyInt_FromLong(202518704L); if (unlikely(!__pyx_int_202518704)) __PYX_ERR(0, 1, __pyx_L1_error)
21148   __pyx_int_217126864 = PyInt_FromLong(217126864L); if (unlikely(!__pyx_int_217126864)) __PYX_ERR(0, 1, __pyx_L1_error)
21149   __pyx_int_246147831 = PyInt_FromLong(246147831L); if (unlikely(!__pyx_int_246147831)) __PYX_ERR(0, 1, __pyx_L1_error)
21150   __pyx_int_247174264 = PyInt_FromLong(247174264L); if (unlikely(!__pyx_int_247174264)) __PYX_ERR(0, 1, __pyx_L1_error)
21151   __pyx_int_823052252 = PyInt_FromLong(823052252L); if (unlikely(!__pyx_int_823052252)) __PYX_ERR(0, 1, __pyx_L1_error)
21152   __pyx_int_2147483647 = PyInt_FromLong(2147483647L); if (unlikely(!__pyx_int_2147483647)) __PYX_ERR(0, 1, __pyx_L1_error)
21153   return 0;
21154   __pyx_L1_error:;
21155   return -1;
21156 }
21157 
21158 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
21159 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
21160 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
21161 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
21162 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
21163 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
21164 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
21165 
__Pyx_modinit_global_init_code(void)21166 static int __Pyx_modinit_global_init_code(void) {
21167   __Pyx_RefNannyDeclarations
21168   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
21169   /*--- Global init code ---*/
21170   __Pyx_RefNannyFinishContext();
21171   return 0;
21172 }
21173 
__Pyx_modinit_variable_export_code(void)21174 static int __Pyx_modinit_variable_export_code(void) {
21175   __Pyx_RefNannyDeclarations
21176   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
21177   /*--- Variable export code ---*/
21178   __Pyx_RefNannyFinishContext();
21179   return 0;
21180 }
21181 
__Pyx_modinit_function_export_code(void)21182 static int __Pyx_modinit_function_export_code(void) {
21183   __Pyx_RefNannyDeclarations
21184   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
21185   /*--- Function export code ---*/
21186   __Pyx_RefNannyFinishContext();
21187   return 0;
21188 }
21189 
__Pyx_modinit_type_init_code(void)21190 static int __Pyx_modinit_type_init_code(void) {
21191   __Pyx_RefNannyDeclarations
21192   int __pyx_lineno = 0;
21193   const char *__pyx_filename = NULL;
21194   int __pyx_clineno = 0;
21195   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
21196   /*--- Type init code ---*/
21197   if (PyType_Ready(&__pyx_type_2bx_6arrays_10array_tree_FileArrayTreeDict) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
21198   #if PY_VERSION_HEX < 0x030800B1
21199   __pyx_type_2bx_6arrays_10array_tree_FileArrayTreeDict.tp_print = 0;
21200   #endif
21201   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2bx_6arrays_10array_tree_FileArrayTreeDict.tp_dictoffset && __pyx_type_2bx_6arrays_10array_tree_FileArrayTreeDict.tp_getattro == PyObject_GenericGetAttr)) {
21202     __pyx_type_2bx_6arrays_10array_tree_FileArrayTreeDict.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21203   }
21204   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FileArrayTreeDict, (PyObject *)&__pyx_type_2bx_6arrays_10array_tree_FileArrayTreeDict) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
21205   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2bx_6arrays_10array_tree_FileArrayTreeDict) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
21206   __pyx_ptype_2bx_6arrays_10array_tree_FileArrayTreeDict = &__pyx_type_2bx_6arrays_10array_tree_FileArrayTreeDict;
21207   __pyx_vtabptr_2bx_6arrays_10array_tree_FileArrayTree = &__pyx_vtable_2bx_6arrays_10array_tree_FileArrayTree;
21208   __pyx_vtable_2bx_6arrays_10array_tree_FileArrayTree.r_seek_to_node = (int (*)(struct __pyx_obj_2bx_6arrays_10array_tree_FileArrayTree *, int, int, PY_LONG_LONG, int, int))__pyx_f_2bx_6arrays_10array_tree_13FileArrayTree_r_seek_to_node;
21209   if (PyType_Ready(&__pyx_type_2bx_6arrays_10array_tree_FileArrayTree) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
21210   #if PY_VERSION_HEX < 0x030800B1
21211   __pyx_type_2bx_6arrays_10array_tree_FileArrayTree.tp_print = 0;
21212   #endif
21213   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2bx_6arrays_10array_tree_FileArrayTree.tp_dictoffset && __pyx_type_2bx_6arrays_10array_tree_FileArrayTree.tp_getattro == PyObject_GenericGetAttr)) {
21214     __pyx_type_2bx_6arrays_10array_tree_FileArrayTree.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21215   }
21216   if (__Pyx_SetVtable(__pyx_type_2bx_6arrays_10array_tree_FileArrayTree.tp_dict, __pyx_vtabptr_2bx_6arrays_10array_tree_FileArrayTree) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
21217   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FileArrayTree, (PyObject *)&__pyx_type_2bx_6arrays_10array_tree_FileArrayTree) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
21218   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2bx_6arrays_10array_tree_FileArrayTree) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
21219   __pyx_ptype_2bx_6arrays_10array_tree_FileArrayTree = &__pyx_type_2bx_6arrays_10array_tree_FileArrayTree;
21220   if (PyType_Ready(&__pyx_type_2bx_6arrays_10array_tree_Summary) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
21221   #if PY_VERSION_HEX < 0x030800B1
21222   __pyx_type_2bx_6arrays_10array_tree_Summary.tp_print = 0;
21223   #endif
21224   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2bx_6arrays_10array_tree_Summary.tp_dictoffset && __pyx_type_2bx_6arrays_10array_tree_Summary.tp_getattro == PyObject_GenericGetAttr)) {
21225     __pyx_type_2bx_6arrays_10array_tree_Summary.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21226   }
21227   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Summary, (PyObject *)&__pyx_type_2bx_6arrays_10array_tree_Summary) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
21228   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2bx_6arrays_10array_tree_Summary) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
21229   __pyx_ptype_2bx_6arrays_10array_tree_Summary = &__pyx_type_2bx_6arrays_10array_tree_Summary;
21230   __pyx_vtabptr_2bx_6arrays_10array_tree_ArrayTreeNode = &__pyx_vtable_2bx_6arrays_10array_tree_ArrayTreeNode;
21231   __pyx_vtable_2bx_6arrays_10array_tree_ArrayTreeNode.init_bin = (PyObject *(*)(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *, int))__pyx_f_2bx_6arrays_10array_tree_13ArrayTreeNode_init_bin;
21232   __pyx_vtable_2bx_6arrays_10array_tree_ArrayTreeNode.build_summary = (PyObject *(*)(struct __pyx_obj_2bx_6arrays_10array_tree_ArrayTreeNode *, int __pyx_skip_dispatch))__pyx_f_2bx_6arrays_10array_tree_13ArrayTreeNode_build_summary;
21233   if (PyType_Ready(&__pyx_type_2bx_6arrays_10array_tree_ArrayTreeNode) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
21234   #if PY_VERSION_HEX < 0x030800B1
21235   __pyx_type_2bx_6arrays_10array_tree_ArrayTreeNode.tp_print = 0;
21236   #endif
21237   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2bx_6arrays_10array_tree_ArrayTreeNode.tp_dictoffset && __pyx_type_2bx_6arrays_10array_tree_ArrayTreeNode.tp_getattro == PyObject_GenericGetAttr)) {
21238     __pyx_type_2bx_6arrays_10array_tree_ArrayTreeNode.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21239   }
21240   if (__Pyx_SetVtable(__pyx_type_2bx_6arrays_10array_tree_ArrayTreeNode.tp_dict, __pyx_vtabptr_2bx_6arrays_10array_tree_ArrayTreeNode) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
21241   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ArrayTreeNode, (PyObject *)&__pyx_type_2bx_6arrays_10array_tree_ArrayTreeNode) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
21242   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2bx_6arrays_10array_tree_ArrayTreeNode) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
21243   __pyx_ptype_2bx_6arrays_10array_tree_ArrayTreeNode = &__pyx_type_2bx_6arrays_10array_tree_ArrayTreeNode;
21244   if (PyType_Ready(&__pyx_type_2bx_6arrays_10array_tree_ArrayTreeLeaf) < 0) __PYX_ERR(0, 477, __pyx_L1_error)
21245   #if PY_VERSION_HEX < 0x030800B1
21246   __pyx_type_2bx_6arrays_10array_tree_ArrayTreeLeaf.tp_print = 0;
21247   #endif
21248   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2bx_6arrays_10array_tree_ArrayTreeLeaf.tp_dictoffset && __pyx_type_2bx_6arrays_10array_tree_ArrayTreeLeaf.tp_getattro == PyObject_GenericGetAttr)) {
21249     __pyx_type_2bx_6arrays_10array_tree_ArrayTreeLeaf.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21250   }
21251   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ArrayTreeLeaf, (PyObject *)&__pyx_type_2bx_6arrays_10array_tree_ArrayTreeLeaf) < 0) __PYX_ERR(0, 477, __pyx_L1_error)
21252   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2bx_6arrays_10array_tree_ArrayTreeLeaf) < 0) __PYX_ERR(0, 477, __pyx_L1_error)
21253   __pyx_ptype_2bx_6arrays_10array_tree_ArrayTreeLeaf = &__pyx_type_2bx_6arrays_10array_tree_ArrayTreeLeaf;
21254   if (PyType_Ready(&__pyx_type_2bx_6arrays_10array_tree_ArrayTree) < 0) __PYX_ERR(0, 218, __pyx_L1_error)
21255   #if PY_VERSION_HEX < 0x030800B1
21256   __pyx_type_2bx_6arrays_10array_tree_ArrayTree.tp_print = 0;
21257   #endif
21258   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2bx_6arrays_10array_tree_ArrayTree.tp_dictoffset && __pyx_type_2bx_6arrays_10array_tree_ArrayTree.tp_getattro == PyObject_GenericGetAttr)) {
21259     __pyx_type_2bx_6arrays_10array_tree_ArrayTree.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21260   }
21261   #if CYTHON_COMPILING_IN_CPYTHON
21262   {
21263     PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_2bx_6arrays_10array_tree_ArrayTree, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 218, __pyx_L1_error)
21264     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
21265       __pyx_wrapperbase_2bx_6arrays_10array_tree_9ArrayTree___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
21266       __pyx_wrapperbase_2bx_6arrays_10array_tree_9ArrayTree___init__.doc = __pyx_doc_2bx_6arrays_10array_tree_9ArrayTree___init__;
21267       ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_2bx_6arrays_10array_tree_9ArrayTree___init__;
21268     }
21269   }
21270   #endif
21271   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ArrayTree, (PyObject *)&__pyx_type_2bx_6arrays_10array_tree_ArrayTree) < 0) __PYX_ERR(0, 218, __pyx_L1_error)
21272   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2bx_6arrays_10array_tree_ArrayTree) < 0) __PYX_ERR(0, 218, __pyx_L1_error)
21273   __pyx_ptype_2bx_6arrays_10array_tree_ArrayTree = &__pyx_type_2bx_6arrays_10array_tree_ArrayTree;
21274   __Pyx_RefNannyFinishContext();
21275   return 0;
21276   __pyx_L1_error:;
21277   __Pyx_RefNannyFinishContext();
21278   return -1;
21279 }
21280 
__Pyx_modinit_type_import_code(void)21281 static int __Pyx_modinit_type_import_code(void) {
21282   __Pyx_RefNannyDeclarations
21283   PyObject *__pyx_t_1 = NULL;
21284   int __pyx_lineno = 0;
21285   const char *__pyx_filename = NULL;
21286   int __pyx_clineno = 0;
21287   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
21288   /*--- Type import code ---*/
21289   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
21290   __Pyx_GOTREF(__pyx_t_1);
21291   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
21292   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
21293   sizeof(PyTypeObject),
21294   #else
21295   sizeof(PyHeapTypeObject),
21296   #endif
21297   __Pyx_ImportType_CheckSize_Warn);
21298    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
21299   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21300   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
21301   __Pyx_GOTREF(__pyx_t_1);
21302   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
21303    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
21304   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
21305    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
21306   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
21307    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
21308   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
21309    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
21310   __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21311    if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
21312   __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21313    if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
21314   __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21315    if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
21316   __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21317    if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
21318   __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21319    if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
21320   __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21321    if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
21322   __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21323    if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
21324   __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21325    if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
21326   __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21327    if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
21328   __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21329    if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
21330   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
21331    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
21332   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21333   __pyx_t_1 = PyImport_ImportModule("bx.arrays.wiggle"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 6, __pyx_L1_error)
21334   __Pyx_GOTREF(__pyx_t_1);
21335   __pyx_ptype_2bx_6arrays_6wiggle_WiggleReader = __Pyx_ImportType(__pyx_t_1, "bx.arrays.wiggle", "WiggleReader", sizeof(struct __pyx_obj_2bx_6arrays_6wiggle_WiggleReader), __Pyx_ImportType_CheckSize_Warn);
21336    if (!__pyx_ptype_2bx_6arrays_6wiggle_WiggleReader) __PYX_ERR(4, 6, __pyx_L1_error)
21337   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21338   __Pyx_RefNannyFinishContext();
21339   return 0;
21340   __pyx_L1_error:;
21341   __Pyx_XDECREF(__pyx_t_1);
21342   __Pyx_RefNannyFinishContext();
21343   return -1;
21344 }
21345 
__Pyx_modinit_variable_import_code(void)21346 static int __Pyx_modinit_variable_import_code(void) {
21347   __Pyx_RefNannyDeclarations
21348   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
21349   /*--- Variable import code ---*/
21350   __Pyx_RefNannyFinishContext();
21351   return 0;
21352 }
21353 
__Pyx_modinit_function_import_code(void)21354 static int __Pyx_modinit_function_import_code(void) {
21355   __Pyx_RefNannyDeclarations
21356   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
21357   /*--- Function import code ---*/
21358   __Pyx_RefNannyFinishContext();
21359   return 0;
21360 }
21361 
21362 
21363 #ifndef CYTHON_NO_PYINIT_EXPORT
21364 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
21365 #elif PY_MAJOR_VERSION < 3
21366 #ifdef __cplusplus
21367 #define __Pyx_PyMODINIT_FUNC extern "C" void
21368 #else
21369 #define __Pyx_PyMODINIT_FUNC void
21370 #endif
21371 #else
21372 #ifdef __cplusplus
21373 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
21374 #else
21375 #define __Pyx_PyMODINIT_FUNC PyObject *
21376 #endif
21377 #endif
21378 
21379 
21380 #if PY_MAJOR_VERSION < 3
21381 __Pyx_PyMODINIT_FUNC initarray_tree(void) CYTHON_SMALL_CODE; /*proto*/
initarray_tree(void)21382 __Pyx_PyMODINIT_FUNC initarray_tree(void)
21383 #else
21384 __Pyx_PyMODINIT_FUNC PyInit_array_tree(void) CYTHON_SMALL_CODE; /*proto*/
21385 __Pyx_PyMODINIT_FUNC PyInit_array_tree(void)
21386 #if CYTHON_PEP489_MULTI_PHASE_INIT
21387 {
21388   return PyModuleDef_Init(&__pyx_moduledef);
21389 }
21390 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
21391     #if PY_VERSION_HEX >= 0x030700A1
21392     static PY_INT64_T main_interpreter_id = -1;
21393     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
21394     if (main_interpreter_id == -1) {
21395         main_interpreter_id = current_id;
21396         return (unlikely(current_id == -1)) ? -1 : 0;
21397     } else if (unlikely(main_interpreter_id != current_id))
21398     #else
21399     static PyInterpreterState *main_interpreter = NULL;
21400     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
21401     if (!main_interpreter) {
21402         main_interpreter = current_interpreter;
21403     } else if (unlikely(main_interpreter != current_interpreter))
21404     #endif
21405     {
21406         PyErr_SetString(
21407             PyExc_ImportError,
21408             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
21409         return -1;
21410     }
21411     return 0;
21412 }
21413 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) {
21414     PyObject *value = PyObject_GetAttrString(spec, from_name);
21415     int result = 0;
21416     if (likely(value)) {
21417         if (allow_none || value != Py_None) {
21418             result = PyDict_SetItemString(moddict, to_name, value);
21419         }
21420         Py_DECREF(value);
21421     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
21422         PyErr_Clear();
21423     } else {
21424         result = -1;
21425     }
21426     return result;
21427 }
21428 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
21429     PyObject *module = NULL, *moddict, *modname;
21430     if (__Pyx_check_single_interpreter())
21431         return NULL;
21432     if (__pyx_m)
21433         return __Pyx_NewRef(__pyx_m);
21434     modname = PyObject_GetAttrString(spec, "name");
21435     if (unlikely(!modname)) goto bad;
21436     module = PyModule_NewObject(modname);
21437     Py_DECREF(modname);
21438     if (unlikely(!module)) goto bad;
21439     moddict = PyModule_GetDict(module);
21440     if (unlikely(!moddict)) goto bad;
21441     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
21442     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
21443     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
21444     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
21445     return module;
21446 bad:
21447     Py_XDECREF(module);
21448     return NULL;
21449 }
21450 
21451 
21452 static CYTHON_SMALL_CODE int __pyx_pymod_exec_array_tree(PyObject *__pyx_pyinit_module)
21453 #endif
21454 #endif
21455 {
21456   PyObject *__pyx_t_1 = NULL;
21457   PyObject *__pyx_t_2 = NULL;
21458   int __pyx_lineno = 0;
21459   const char *__pyx_filename = NULL;
21460   int __pyx_clineno = 0;
21461   __Pyx_RefNannyDeclarations
21462   #if CYTHON_PEP489_MULTI_PHASE_INIT
21463   if (__pyx_m) {
21464     if (__pyx_m == __pyx_pyinit_module) return 0;
21465     PyErr_SetString(PyExc_RuntimeError, "Module 'array_tree' has already been imported. Re-initialisation is not supported.");
21466     return -1;
21467   }
21468   #elif PY_MAJOR_VERSION >= 3
21469   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
21470   #endif
21471   #if CYTHON_REFNANNY
21472 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
21473 if (!__Pyx_RefNanny) {
21474   PyErr_Clear();
21475   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
21476   if (!__Pyx_RefNanny)
21477       Py_FatalError("failed to import 'refnanny' module");
21478 }
21479 #endif
21480   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_array_tree(void)", 0);
21481   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21482   #ifdef __Pxy_PyFrame_Initialize_Offsets
21483   __Pxy_PyFrame_Initialize_Offsets();
21484   #endif
21485   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
21486   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
21487   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
21488   #ifdef __Pyx_CyFunction_USED
21489   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21490   #endif
21491   #ifdef __Pyx_FusedFunction_USED
21492   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21493   #endif
21494   #ifdef __Pyx_Coroutine_USED
21495   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21496   #endif
21497   #ifdef __Pyx_Generator_USED
21498   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21499   #endif
21500   #ifdef __Pyx_AsyncGen_USED
21501   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21502   #endif
21503   #ifdef __Pyx_StopAsyncIteration_USED
21504   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21505   #endif
21506   /*--- Library function declarations ---*/
21507   /*--- Threads initialization code ---*/
21508   #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
21509   PyEval_InitThreads();
21510   #endif
21511   /*--- Module creation code ---*/
21512   #if CYTHON_PEP489_MULTI_PHASE_INIT
21513   __pyx_m = __pyx_pyinit_module;
21514   Py_INCREF(__pyx_m);
21515   #else
21516   #if PY_MAJOR_VERSION < 3
21517   __pyx_m = Py_InitModule4("array_tree", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
21518   #else
21519   __pyx_m = PyModule_Create(&__pyx_moduledef);
21520   #endif
21521   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
21522   #endif
21523   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
21524   Py_INCREF(__pyx_d);
21525   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
21526   Py_INCREF(__pyx_b);
21527   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
21528   Py_INCREF(__pyx_cython_runtime);
21529   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
21530   /*--- Initialize various global constants etc. ---*/
21531   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21532   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
21533   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21534   #endif
21535   if (__pyx_module_is_main_bx__arrays__array_tree) {
21536     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21537   }
21538   #if PY_MAJOR_VERSION >= 3
21539   {
21540     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
21541     if (!PyDict_GetItemString(modules, "bx.arrays.array_tree")) {
21542       if (unlikely(PyDict_SetItemString(modules, "bx.arrays.array_tree", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21543     }
21544   }
21545   #endif
21546   /*--- Builtin init code ---*/
21547   if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21548   /*--- Constants init code ---*/
21549   if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21550   /*--- Global type/function init code ---*/
21551   (void)__Pyx_modinit_global_init_code();
21552   (void)__Pyx_modinit_variable_export_code();
21553   (void)__Pyx_modinit_function_export_code();
21554   if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21555   if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
21556   (void)__Pyx_modinit_variable_import_code();
21557   (void)__Pyx_modinit_function_import_code();
21558   /*--- Execution code ---*/
21559   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
21560   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21561   #endif
21562 
21563   /* "bx/arrays/array_tree.pyx":3
21564  * from __future__ import division
21565  *
21566  * __all__ = [ 'ArrayTree', 'FileArrayTreeDict', 'array_tree_dict_from_reader' ]             # <<<<<<<<<<<<<<
21567  *
21568  * import numpy
21569  */
21570   __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
21571   __Pyx_GOTREF(__pyx_t_1);
21572   __Pyx_INCREF(__pyx_n_s_ArrayTree);
21573   __Pyx_GIVEREF(__pyx_n_s_ArrayTree);
21574   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ArrayTree);
21575   __Pyx_INCREF(__pyx_n_s_FileArrayTreeDict);
21576   __Pyx_GIVEREF(__pyx_n_s_FileArrayTreeDict);
21577   PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_FileArrayTreeDict);
21578   __Pyx_INCREF(__pyx_n_s_array_tree_dict_from_reader);
21579   __Pyx_GIVEREF(__pyx_n_s_array_tree_dict_from_reader);
21580   PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_array_tree_dict_from_reader);
21581   if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
21582   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21583 
21584   /* "bx/arrays/array_tree.pyx":5
21585  * __all__ = [ 'ArrayTree', 'FileArrayTreeDict', 'array_tree_dict_from_reader' ]
21586  *
21587  * import numpy             # <<<<<<<<<<<<<<
21588  * from numpy import *
21589  * cimport numpy
21590  */
21591   __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
21592   __Pyx_GOTREF(__pyx_t_1);
21593   if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
21594   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21595 
21596   /* "bx/arrays/array_tree.pyx":6
21597  *
21598  * import numpy
21599  * from numpy import *             # <<<<<<<<<<<<<<
21600  * cimport numpy
21601  *
21602  */
21603   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
21604   __Pyx_GOTREF(__pyx_t_1);
21605   __Pyx_INCREF(__pyx_n_s__7);
21606   __Pyx_GIVEREF(__pyx_n_s__7);
21607   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__7);
21608   __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
21609   __Pyx_GOTREF(__pyx_t_2);
21610   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21611   if (__pyx_import_star(__pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error);
21612   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21613 
21614   /* "bx/arrays/array_tree.pyx":11
21615  * cimport bx.arrays.wiggle
21616  *
21617  * from bx.misc.binary_file import BinaryFileWriter, BinaryFileReader             # <<<<<<<<<<<<<<
21618  * from bx.misc.cdb import FileCDBDict
21619  *
21620  */
21621   __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
21622   __Pyx_GOTREF(__pyx_t_2);
21623   __Pyx_INCREF(__pyx_n_s_BinaryFileWriter);
21624   __Pyx_GIVEREF(__pyx_n_s_BinaryFileWriter);
21625   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BinaryFileWriter);
21626   __Pyx_INCREF(__pyx_n_s_BinaryFileReader);
21627   __Pyx_GIVEREF(__pyx_n_s_BinaryFileReader);
21628   PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_BinaryFileReader);
21629   __pyx_t_1 = __Pyx_Import(__pyx_n_s_bx_misc_binary_file, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
21630   __Pyx_GOTREF(__pyx_t_1);
21631   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21632   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_BinaryFileWriter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
21633   __Pyx_GOTREF(__pyx_t_2);
21634   if (PyDict_SetItem(__pyx_d, __pyx_n_s_BinaryFileWriter, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
21635   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21636   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_BinaryFileReader); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
21637   __Pyx_GOTREF(__pyx_t_2);
21638   if (PyDict_SetItem(__pyx_d, __pyx_n_s_BinaryFileReader, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
21639   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21640   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21641 
21642   /* "bx/arrays/array_tree.pyx":12
21643  *
21644  * from bx.misc.binary_file import BinaryFileWriter, BinaryFileReader
21645  * from bx.misc.cdb import FileCDBDict             # <<<<<<<<<<<<<<
21646  *
21647  * """
21648  */
21649   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
21650   __Pyx_GOTREF(__pyx_t_1);
21651   __Pyx_INCREF(__pyx_n_s_FileCDBDict);
21652   __Pyx_GIVEREF(__pyx_n_s_FileCDBDict);
21653   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_FileCDBDict);
21654   __pyx_t_2 = __Pyx_Import(__pyx_n_s_bx_misc_cdb, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
21655   __Pyx_GOTREF(__pyx_t_2);
21656   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21657   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_FileCDBDict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
21658   __Pyx_GOTREF(__pyx_t_1);
21659   if (PyDict_SetItem(__pyx_d, __pyx_n_s_FileCDBDict, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
21660   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21661   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21662 
21663   /* "bx/arrays/array_tree.pyx":58
21664  * ##   - Compression for blocks?
21665  *
21666  * MAGIC = 0x310ec7dc             # <<<<<<<<<<<<<<
21667  * VERSION = 1
21668  * NUM_SUMMARY_ARRAYS = 6
21669  */
21670   if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAGIC, __pyx_int_823052252) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
21671 
21672   /* "bx/arrays/array_tree.pyx":59
21673  *
21674  * MAGIC = 0x310ec7dc
21675  * VERSION = 1             # <<<<<<<<<<<<<<
21676  * NUM_SUMMARY_ARRAYS = 6
21677  *
21678  */
21679   if (PyDict_SetItem(__pyx_d, __pyx_n_s_VERSION, __pyx_int_1) < 0) __PYX_ERR(0, 59, __pyx_L1_error)
21680 
21681   /* "bx/arrays/array_tree.pyx":60
21682  * MAGIC = 0x310ec7dc
21683  * VERSION = 1
21684  * NUM_SUMMARY_ARRAYS = 6             # <<<<<<<<<<<<<<
21685  *
21686  * def array_tree_dict_from_reader( reader, sizes, default_size=2147483647, block_size=1000, no_leaves=False ):
21687  */
21688   if (PyDict_SetItem(__pyx_d, __pyx_n_s_NUM_SUMMARY_ARRAYS, __pyx_int_6) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
21689 
21690   /* "bx/arrays/array_tree.pyx":62
21691  * NUM_SUMMARY_ARRAYS = 6
21692  *
21693  * def array_tree_dict_from_reader( reader, sizes, default_size=2147483647, block_size=1000, no_leaves=False ):             # <<<<<<<<<<<<<<
21694  *     # Create empty array trees
21695  *     rval = {}
21696  */
21697   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2bx_6arrays_10array_tree_1array_tree_dict_from_reader, NULL, __pyx_n_s_bx_arrays_array_tree); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
21698   __Pyx_GOTREF(__pyx_t_2);
21699   if (PyDict_SetItem(__pyx_d, __pyx_n_s_array_tree_dict_from_reader, __pyx_t_2) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
21700   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21701 
21702   /* "bx/arrays/array_tree.pyx":96
21703  *
21704  *     @classmethod
21705  *     def dict_to_file( Class, dict, file, is_little_endian=True, no_leaves=False ):             # <<<<<<<<<<<<<<
21706  *         """
21707  *         Writes a dictionary of array trees to a file that can then be
21708  */
21709   __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_FileArrayTreeDict, __pyx_n_s_dict_to_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
21710   __Pyx_GOTREF(__pyx_t_2);
21711 
21712   /* "bx/arrays/array_tree.pyx":95
21713  *         return FileArrayTree( self.io.file, self.io.is_little_endian )
21714  *
21715  *     @classmethod             # <<<<<<<<<<<<<<
21716  *     def dict_to_file( Class, dict, file, is_little_endian=True, no_leaves=False ):
21717  *         """
21718  */
21719   __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
21720   __Pyx_GOTREF(__pyx_t_1);
21721   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21722   if (PyDict_SetItem((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_FileArrayTreeDict->tp_dict, __pyx_n_s_dict_to_file, __pyx_t_1) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
21723   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21724   PyType_Modified(__pyx_ptype_2bx_6arrays_10array_tree_FileArrayTreeDict);
21725 
21726   /* "bx/arrays/array_tree.pyx":241
21727  *     cdef public ArrayTreeNode root
21728  *
21729  *     def __init__( self, int max, int block_size, dtype=float32, no_leaves=False ):             # <<<<<<<<<<<<<<
21730  *         """
21731  *         Create a new array tree of size `max`
21732  */
21733   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
21734   __Pyx_GOTREF(__pyx_t_1);
21735   __pyx_k__2 = __pyx_t_1;
21736   __Pyx_GIVEREF(__pyx_t_1);
21737   __pyx_t_1 = 0;
21738 
21739   /* "bx/arrays/array_tree.pyx":287
21740  *
21741  *     @classmethod
21742  *     def from_file( Class, f, is_little_endian=True ):             # <<<<<<<<<<<<<<
21743  *         io = BinaryFileReader( f, is_little_endian=is_little_endian )
21744  *         ## assert io.read_uint32() == VERSION
21745  */
21746   __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_ArrayTree, __pyx_n_s_from_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
21747   __Pyx_GOTREF(__pyx_t_1);
21748 
21749   /* "bx/arrays/array_tree.pyx":286
21750  *         self.root.to_file_offset_pass( io )
21751  *
21752  *     @classmethod             # <<<<<<<<<<<<<<
21753  *     def from_file( Class, f, is_little_endian=True ):
21754  *         io = BinaryFileReader( f, is_little_endian=is_little_endian )
21755  */
21756   __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
21757   __Pyx_GOTREF(__pyx_t_2);
21758   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21759   if (PyDict_SetItem((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_ArrayTree->tp_dict, __pyx_n_s_from_file, __pyx_t_2) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
21760   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21761   PyType_Modified(__pyx_ptype_2bx_6arrays_10array_tree_ArrayTree);
21762 
21763   /* "bx/arrays/array_tree.pyx":299
21764  *
21765  *     @classmethod
21766  *     def from_sequence( Class, s, block_size=1000 ):             # <<<<<<<<<<<<<<
21767  *         """
21768  *         Build an ArrayTree from a sequence like object (must have at least
21769  */
21770   __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_ArrayTree, __pyx_n_s_from_sequence); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error)
21771   __Pyx_GOTREF(__pyx_t_2);
21772 
21773   /* "bx/arrays/array_tree.pyx":298
21774  *         return tree
21775  *
21776  *     @classmethod             # <<<<<<<<<<<<<<
21777  *     def from_sequence( Class, s, block_size=1000 ):
21778  *         """
21779  */
21780   __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
21781   __Pyx_GOTREF(__pyx_t_1);
21782   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21783   if (PyDict_SetItem((PyObject *)__pyx_ptype_2bx_6arrays_10array_tree_ArrayTree->tp_dict, __pyx_n_s_from_sequence, __pyx_t_1) < 0) __PYX_ERR(0, 299, __pyx_L1_error)
21784   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21785   PyType_Modified(__pyx_ptype_2bx_6arrays_10array_tree_ArrayTree);
21786 
21787   /* "(tree fragment)":1
21788  * def __pyx_unpickle_FileArrayTreeDict(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
21789  *     cdef object __pyx_PickleError
21790  *     cdef object __pyx_result
21791  */
21792   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2bx_6arrays_10array_tree_3__pyx_unpickle_FileArrayTreeDict, NULL, __pyx_n_s_bx_arrays_array_tree); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
21793   __Pyx_GOTREF(__pyx_t_1);
21794   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_FileArrayTreeDict, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21795   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21796 
21797   /* "(tree fragment)":11
21798  *         __pyx_unpickle_FileArrayTreeDict__set_state(<FileArrayTreeDict> __pyx_result, __pyx_state)
21799  *     return __pyx_result
21800  * cdef __pyx_unpickle_FileArrayTreeDict__set_state(FileArrayTreeDict __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
21801  *     __pyx_result.cdb_dict = __pyx_state[0]; __pyx_result.io = __pyx_state[1]
21802  *     if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
21803  */
21804   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2bx_6arrays_10array_tree_5__pyx_unpickle_FileArrayTree, NULL, __pyx_n_s_bx_arrays_array_tree); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
21805   __Pyx_GOTREF(__pyx_t_1);
21806   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_FileArrayTree, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21807   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21808 
21809   /* "(tree fragment)":1
21810  * def __pyx_unpickle_Summary(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
21811  *     cdef object __pyx_PickleError
21812  *     cdef object __pyx_result
21813  */
21814   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2bx_6arrays_10array_tree_7__pyx_unpickle_Summary, NULL, __pyx_n_s_bx_arrays_array_tree); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
21815   __Pyx_GOTREF(__pyx_t_1);
21816   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Summary, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21817   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21818 
21819   /* "(tree fragment)":11
21820  *         __pyx_unpickle_Summary__set_state(<Summary> __pyx_result, __pyx_state)
21821  *     return __pyx_result
21822  * cdef __pyx_unpickle_Summary__set_state(Summary __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
21823  *     __pyx_result.counts = __pyx_state[0]; __pyx_result.frequencies = __pyx_state[1]; __pyx_result.maxs = __pyx_state[2]; __pyx_result.mins = __pyx_state[3]; __pyx_result.sums = __pyx_state[4]; __pyx_result.sumsquares = __pyx_state[5]
21824  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
21825  */
21826   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2bx_6arrays_10array_tree_9__pyx_unpickle_ArrayTree, NULL, __pyx_n_s_bx_arrays_array_tree); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
21827   __Pyx_GOTREF(__pyx_t_1);
21828   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_ArrayTree, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21829   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21830 
21831   /* "(tree fragment)":1
21832  * def __pyx_unpickle_ArrayTreeNode(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
21833  *     cdef object __pyx_PickleError
21834  *     cdef object __pyx_result
21835  */
21836   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2bx_6arrays_10array_tree_11__pyx_unpickle_ArrayTreeNode, NULL, __pyx_n_s_bx_arrays_array_tree); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
21837   __Pyx_GOTREF(__pyx_t_1);
21838   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_ArrayTreeNode, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21839   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21840 
21841   /* "(tree fragment)":11
21842  *         __pyx_unpickle_ArrayTreeNode__set_state(<ArrayTreeNode> __pyx_result, __pyx_state)
21843  *     return __pyx_result
21844  * cdef __pyx_unpickle_ArrayTreeNode__set_state(ArrayTreeNode __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
21845  *     __pyx_result.block_size = __pyx_state[0]; __pyx_result.child_size = __pyx_state[1]; __pyx_result.children = __pyx_state[2]; __pyx_result.level = __pyx_state[3]; __pyx_result.max = __pyx_state[4]; __pyx_result.min = __pyx_state[5]; __pyx_result.start_offset = __pyx_state[6]; __pyx_result.summary = __pyx_state[7]; __pyx_result.tree = __pyx_state[8]
21846  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
21847  */
21848   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_2bx_6arrays_10array_tree_13__pyx_unpickle_ArrayTreeLeaf, NULL, __pyx_n_s_bx_arrays_array_tree); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
21849   __Pyx_GOTREF(__pyx_t_1);
21850   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_ArrayTreeLeaf, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21851   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21852 
21853   /* "bx/arrays/array_tree.pyx":1
21854  * from __future__ import division             # <<<<<<<<<<<<<<
21855  *
21856  * __all__ = [ 'ArrayTree', 'FileArrayTreeDict', 'array_tree_dict_from_reader' ]
21857  */
21858   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21859   __Pyx_GOTREF(__pyx_t_1);
21860   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21861   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21862 
21863   /* "../../../../../tmp/build-env-5vvax6c8/lib/python3.10/site-packages/numpy/__init__.pxd":1014
21864  *
21865  *
21866  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
21867  *     """
21868  *     returns the unit part of the dtype for a numpy datetime64 object.
21869  */
21870 
21871   /*--- Wrapped vars code ---*/
21872 
21873   goto __pyx_L0;
21874   __pyx_L1_error:;
21875   __Pyx_XDECREF(__pyx_t_1);
21876   __Pyx_XDECREF(__pyx_t_2);
21877   if (__pyx_m) {
21878     if (__pyx_d) {
21879       __Pyx_AddTraceback("init bx.arrays.array_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
21880     }
21881     Py_CLEAR(__pyx_m);
21882   } else if (!PyErr_Occurred()) {
21883     PyErr_SetString(PyExc_ImportError, "init bx.arrays.array_tree");
21884   }
21885   __pyx_L0:;
21886   __Pyx_RefNannyFinishContext();
21887   #if CYTHON_PEP489_MULTI_PHASE_INIT
21888   return (__pyx_m != NULL) ? 0 : -1;
21889   #elif PY_MAJOR_VERSION >= 3
21890   return __pyx_m;
21891   #else
21892   return;
21893   #endif
21894 }
21895 
21896 /* --- Runtime support code --- */
21897 /* Refnanny */
21898 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)21899 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
21900     PyObject *m = NULL, *p = NULL;
21901     void *r = NULL;
21902     m = PyImport_ImportModule(modname);
21903     if (!m) goto end;
21904     p = PyObject_GetAttrString(m, "RefNannyAPI");
21905     if (!p) goto end;
21906     r = PyLong_AsVoidPtr(p);
21907 end:
21908     Py_XDECREF(p);
21909     Py_XDECREF(m);
21910     return (__Pyx_RefNannyAPIStruct *)r;
21911 }
21912 #endif
21913 
21914 /* PyObjectGetAttrStr */
21915 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)21916 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
21917     PyTypeObject* tp = Py_TYPE(obj);
21918     if (likely(tp->tp_getattro))
21919         return tp->tp_getattro(obj, attr_name);
21920 #if PY_MAJOR_VERSION < 3
21921     if (likely(tp->tp_getattr))
21922         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
21923 #endif
21924     return PyObject_GetAttr(obj, attr_name);
21925 }
21926 #endif
21927 
21928 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)21929 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
21930     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
21931     if (unlikely(!result)) {
21932         PyErr_Format(PyExc_NameError,
21933 #if PY_MAJOR_VERSION >= 3
21934             "name '%U' is not defined", name);
21935 #else
21936             "name '%.200s' is not defined", PyString_AS_STRING(name));
21937 #endif
21938     }
21939     return result;
21940 }
21941 
21942 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)21943 static void __Pyx_RaiseArgtupleInvalid(
21944     const char* func_name,
21945     int exact,
21946     Py_ssize_t num_min,
21947     Py_ssize_t num_max,
21948     Py_ssize_t num_found)
21949 {
21950     Py_ssize_t num_expected;
21951     const char *more_or_less;
21952     if (num_found < num_min) {
21953         num_expected = num_min;
21954         more_or_less = "at least";
21955     } else {
21956         num_expected = num_max;
21957         more_or_less = "at most";
21958     }
21959     if (exact) {
21960         more_or_less = "exactly";
21961     }
21962     PyErr_Format(PyExc_TypeError,
21963                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
21964                  func_name, more_or_less, num_expected,
21965                  (num_expected == 1) ? "" : "s", num_found);
21966 }
21967 
21968 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)21969 static void __Pyx_RaiseDoubleKeywordsError(
21970     const char* func_name,
21971     PyObject* kw_name)
21972 {
21973     PyErr_Format(PyExc_TypeError,
21974         #if PY_MAJOR_VERSION >= 3
21975         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
21976         #else
21977         "%s() got multiple values for keyword argument '%s'", func_name,
21978         PyString_AsString(kw_name));
21979         #endif
21980 }
21981 
21982 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)21983 static int __Pyx_ParseOptionalKeywords(
21984     PyObject *kwds,
21985     PyObject **argnames[],
21986     PyObject *kwds2,
21987     PyObject *values[],
21988     Py_ssize_t num_pos_args,
21989     const char* function_name)
21990 {
21991     PyObject *key = 0, *value = 0;
21992     Py_ssize_t pos = 0;
21993     PyObject*** name;
21994     PyObject*** first_kw_arg = argnames + num_pos_args;
21995     while (PyDict_Next(kwds, &pos, &key, &value)) {
21996         name = first_kw_arg;
21997         while (*name && (**name != key)) name++;
21998         if (*name) {
21999             values[name-argnames] = value;
22000             continue;
22001         }
22002         name = first_kw_arg;
22003         #if PY_MAJOR_VERSION < 3
22004         if (likely(PyString_Check(key))) {
22005             while (*name) {
22006                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
22007                         && _PyString_Eq(**name, key)) {
22008                     values[name-argnames] = value;
22009                     break;
22010                 }
22011                 name++;
22012             }
22013             if (*name) continue;
22014             else {
22015                 PyObject*** argname = argnames;
22016                 while (argname != first_kw_arg) {
22017                     if ((**argname == key) || (
22018                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
22019                              && _PyString_Eq(**argname, key))) {
22020                         goto arg_passed_twice;
22021                     }
22022                     argname++;
22023                 }
22024             }
22025         } else
22026         #endif
22027         if (likely(PyUnicode_Check(key))) {
22028             while (*name) {
22029                 int cmp = (**name == key) ? 0 :
22030                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
22031                     (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
22032                 #endif
22033                     PyUnicode_Compare(**name, key);
22034                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
22035                 if (cmp == 0) {
22036                     values[name-argnames] = value;
22037                     break;
22038                 }
22039                 name++;
22040             }
22041             if (*name) continue;
22042             else {
22043                 PyObject*** argname = argnames;
22044                 while (argname != first_kw_arg) {
22045                     int cmp = (**argname == key) ? 0 :
22046                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
22047                         (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
22048                     #endif
22049                         PyUnicode_Compare(**argname, key);
22050                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
22051                     if (cmp == 0) goto arg_passed_twice;
22052                     argname++;
22053                 }
22054             }
22055         } else
22056             goto invalid_keyword_type;
22057         if (kwds2) {
22058             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
22059         } else {
22060             goto invalid_keyword;
22061         }
22062     }
22063     return 0;
22064 arg_passed_twice:
22065     __Pyx_RaiseDoubleKeywordsError(function_name, key);
22066     goto bad;
22067 invalid_keyword_type:
22068     PyErr_Format(PyExc_TypeError,
22069         "%.200s() keywords must be strings", function_name);
22070     goto bad;
22071 invalid_keyword:
22072     PyErr_Format(PyExc_TypeError,
22073     #if PY_MAJOR_VERSION < 3
22074         "%.200s() got an unexpected keyword argument '%.200s'",
22075         function_name, PyString_AsString(key));
22076     #else
22077         "%s() got an unexpected keyword argument '%U'",
22078         function_name, key);
22079     #endif
22080 bad:
22081     return -1;
22082 }
22083 
22084 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)22085 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
22086     PyErr_Format(PyExc_ValueError,
22087                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
22088 }
22089 
22090 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)22091 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
22092     PyErr_Format(PyExc_ValueError,
22093                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
22094                  index, (index == 1) ? "" : "s");
22095 }
22096 
22097 /* IterFinish */
__Pyx_IterFinish(void)22098 static CYTHON_INLINE int __Pyx_IterFinish(void) {
22099 #if CYTHON_FAST_THREAD_STATE
22100     PyThreadState *tstate = __Pyx_PyThreadState_Current;
22101     PyObject* exc_type = tstate->curexc_type;
22102     if (unlikely(exc_type)) {
22103         if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
22104             PyObject *exc_value, *exc_tb;
22105             exc_value = tstate->curexc_value;
22106             exc_tb = tstate->curexc_traceback;
22107             tstate->curexc_type = 0;
22108             tstate->curexc_value = 0;
22109             tstate->curexc_traceback = 0;
22110             Py_DECREF(exc_type);
22111             Py_XDECREF(exc_value);
22112             Py_XDECREF(exc_tb);
22113             return 0;
22114         } else {
22115             return -1;
22116         }
22117     }
22118     return 0;
22119 #else
22120     if (unlikely(PyErr_Occurred())) {
22121         if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
22122             PyErr_Clear();
22123             return 0;
22124         } else {
22125             return -1;
22126         }
22127     }
22128     return 0;
22129 #endif
22130 }
22131 
22132 /* UnpackItemEndCheck */
__Pyx_IternextUnpackEndCheck(PyObject * retval,Py_ssize_t expected)22133 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
22134     if (unlikely(retval)) {
22135         Py_DECREF(retval);
22136         __Pyx_RaiseTooManyValuesError(expected);
22137         return -1;
22138     } else {
22139         return __Pyx_IterFinish();
22140     }
22141     return 0;
22142 }
22143 
22144 /* PyFunctionFastCall */
22145 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)22146 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
22147                                                PyObject *globals) {
22148     PyFrameObject *f;
22149     PyThreadState *tstate = __Pyx_PyThreadState_Current;
22150     PyObject **fastlocals;
22151     Py_ssize_t i;
22152     PyObject *result;
22153     assert(globals != NULL);
22154     /* XXX Perhaps we should create a specialized
22155        PyFrame_New() that doesn't take locals, but does
22156        take builtins without sanity checking them.
22157        */
22158     assert(tstate != NULL);
22159     f = PyFrame_New(tstate, co, globals, NULL);
22160     if (f == NULL) {
22161         return NULL;
22162     }
22163     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
22164     for (i = 0; i < na; i++) {
22165         Py_INCREF(*args);
22166         fastlocals[i] = *args++;
22167     }
22168     result = PyEval_EvalFrameEx(f,0);
22169     ++tstate->recursion_depth;
22170     Py_DECREF(f);
22171     --tstate->recursion_depth;
22172     return result;
22173 }
22174 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)22175 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
22176     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
22177     PyObject *globals = PyFunction_GET_GLOBALS(func);
22178     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
22179     PyObject *closure;
22180 #if PY_MAJOR_VERSION >= 3
22181     PyObject *kwdefs;
22182 #endif
22183     PyObject *kwtuple, **k;
22184     PyObject **d;
22185     Py_ssize_t nd;
22186     Py_ssize_t nk;
22187     PyObject *result;
22188     assert(kwargs == NULL || PyDict_Check(kwargs));
22189     nk = kwargs ? PyDict_Size(kwargs) : 0;
22190     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
22191         return NULL;
22192     }
22193     if (
22194 #if PY_MAJOR_VERSION >= 3
22195             co->co_kwonlyargcount == 0 &&
22196 #endif
22197             likely(kwargs == NULL || nk == 0) &&
22198             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
22199         if (argdefs == NULL && co->co_argcount == nargs) {
22200             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
22201             goto done;
22202         }
22203         else if (nargs == 0 && argdefs != NULL
22204                  && co->co_argcount == Py_SIZE(argdefs)) {
22205             /* function called with no arguments, but all parameters have
22206                a default value: use default values as arguments .*/
22207             args = &PyTuple_GET_ITEM(argdefs, 0);
22208             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
22209             goto done;
22210         }
22211     }
22212     if (kwargs != NULL) {
22213         Py_ssize_t pos, i;
22214         kwtuple = PyTuple_New(2 * nk);
22215         if (kwtuple == NULL) {
22216             result = NULL;
22217             goto done;
22218         }
22219         k = &PyTuple_GET_ITEM(kwtuple, 0);
22220         pos = i = 0;
22221         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
22222             Py_INCREF(k[i]);
22223             Py_INCREF(k[i+1]);
22224             i += 2;
22225         }
22226         nk = i / 2;
22227     }
22228     else {
22229         kwtuple = NULL;
22230         k = NULL;
22231     }
22232     closure = PyFunction_GET_CLOSURE(func);
22233 #if PY_MAJOR_VERSION >= 3
22234     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
22235 #endif
22236     if (argdefs != NULL) {
22237         d = &PyTuple_GET_ITEM(argdefs, 0);
22238         nd = Py_SIZE(argdefs);
22239     }
22240     else {
22241         d = NULL;
22242         nd = 0;
22243     }
22244 #if PY_MAJOR_VERSION >= 3
22245     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
22246                                args, (int)nargs,
22247                                k, (int)nk,
22248                                d, (int)nd, kwdefs, closure);
22249 #else
22250     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
22251                                args, (int)nargs,
22252                                k, (int)nk,
22253                                d, (int)nd, closure);
22254 #endif
22255     Py_XDECREF(kwtuple);
22256 done:
22257     Py_LeaveRecursiveCall();
22258     return result;
22259 }
22260 #endif
22261 #endif
22262 
22263 /* PyCFunctionFastCall */
22264 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)22265 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
22266     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
22267     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
22268     PyObject *self = PyCFunction_GET_SELF(func);
22269     int flags = PyCFunction_GET_FLAGS(func);
22270     assert(PyCFunction_Check(func));
22271     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
22272     assert(nargs >= 0);
22273     assert(nargs == 0 || args != NULL);
22274     /* _PyCFunction_FastCallDict() must not be called with an exception set,
22275        because it may clear it (directly or indirectly) and so the
22276        caller loses its exception */
22277     assert(!PyErr_Occurred());
22278     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
22279         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
22280     } else {
22281         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
22282     }
22283 }
22284 #endif
22285 
22286 /* PyObjectCall */
22287 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)22288 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
22289     PyObject *result;
22290     ternaryfunc call = Py_TYPE(func)->tp_call;
22291     if (unlikely(!call))
22292         return PyObject_Call(func, arg, kw);
22293     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
22294         return NULL;
22295     result = (*call)(func, arg, kw);
22296     Py_LeaveRecursiveCall();
22297     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
22298         PyErr_SetString(
22299             PyExc_SystemError,
22300             "NULL result without error in PyObject_Call");
22301     }
22302     return result;
22303 }
22304 #endif
22305 
22306 /* DictGetItem */
22307 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)22308 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
22309     PyObject *value;
22310     value = PyDict_GetItemWithError(d, key);
22311     if (unlikely(!value)) {
22312         if (!PyErr_Occurred()) {
22313             if (unlikely(PyTuple_Check(key))) {
22314                 PyObject* args = PyTuple_Pack(1, key);
22315                 if (likely(args)) {
22316                     PyErr_SetObject(PyExc_KeyError, args);
22317                     Py_DECREF(args);
22318                 }
22319             } else {
22320                 PyErr_SetObject(PyExc_KeyError, key);
22321             }
22322         }
22323         return NULL;
22324     }
22325     Py_INCREF(value);
22326     return value;
22327 }
22328 #endif
22329 
22330 /* PyDictVersioning */
22331 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)22332 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
22333     PyObject *dict = Py_TYPE(obj)->tp_dict;
22334     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
22335 }
__Pyx_get_object_dict_version(PyObject * obj)22336 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
22337     PyObject **dictptr = NULL;
22338     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
22339     if (offset) {
22340 #if CYTHON_COMPILING_IN_CPYTHON
22341         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
22342 #else
22343         dictptr = _PyObject_GetDictPtr(obj);
22344 #endif
22345     }
22346     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
22347 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)22348 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
22349     PyObject *dict = Py_TYPE(obj)->tp_dict;
22350     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
22351         return 0;
22352     return obj_dict_version == __Pyx_get_object_dict_version(obj);
22353 }
22354 #endif
22355 
22356 /* GetModuleGlobalName */
22357 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)22358 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
22359 #else
22360 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
22361 #endif
22362 {
22363     PyObject *result;
22364 #if !CYTHON_AVOID_BORROWED_REFS
22365 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
22366     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
22367     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
22368     if (likely(result)) {
22369         return __Pyx_NewRef(result);
22370     } else if (unlikely(PyErr_Occurred())) {
22371         return NULL;
22372     }
22373 #else
22374     result = PyDict_GetItem(__pyx_d, name);
22375     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
22376     if (likely(result)) {
22377         return __Pyx_NewRef(result);
22378     }
22379 #endif
22380 #else
22381     result = PyObject_GetItem(__pyx_d, name);
22382     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
22383     if (likely(result)) {
22384         return __Pyx_NewRef(result);
22385     }
22386     PyErr_Clear();
22387 #endif
22388     return __Pyx_GetBuiltinName(name);
22389 }
22390 
22391 /* PyObjectCallMethO */
22392 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)22393 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
22394     PyObject *self, *result;
22395     PyCFunction cfunc;
22396     cfunc = PyCFunction_GET_FUNCTION(func);
22397     self = PyCFunction_GET_SELF(func);
22398     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
22399         return NULL;
22400     result = cfunc(self, arg);
22401     Py_LeaveRecursiveCall();
22402     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
22403         PyErr_SetString(
22404             PyExc_SystemError,
22405             "NULL result without error in PyObject_Call");
22406     }
22407     return result;
22408 }
22409 #endif
22410 
22411 /* PyObjectCallNoArg */
22412 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallNoArg(PyObject * func)22413 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
22414 #if CYTHON_FAST_PYCALL
22415     if (PyFunction_Check(func)) {
22416         return __Pyx_PyFunction_FastCall(func, NULL, 0);
22417     }
22418 #endif
22419 #ifdef __Pyx_CyFunction_USED
22420     if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
22421 #else
22422     if (likely(PyCFunction_Check(func)))
22423 #endif
22424     {
22425         if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
22426             return __Pyx_PyObject_CallMethO(func, NULL);
22427         }
22428     }
22429     return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
22430 }
22431 #endif
22432 
22433 /* PyObjectCallOneArg */
22434 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)22435 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22436     PyObject *result;
22437     PyObject *args = PyTuple_New(1);
22438     if (unlikely(!args)) return NULL;
22439     Py_INCREF(arg);
22440     PyTuple_SET_ITEM(args, 0, arg);
22441     result = __Pyx_PyObject_Call(func, args, NULL);
22442     Py_DECREF(args);
22443     return result;
22444 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)22445 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22446 #if CYTHON_FAST_PYCALL
22447     if (PyFunction_Check(func)) {
22448         return __Pyx_PyFunction_FastCall(func, &arg, 1);
22449     }
22450 #endif
22451     if (likely(PyCFunction_Check(func))) {
22452         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
22453             return __Pyx_PyObject_CallMethO(func, arg);
22454 #if CYTHON_FAST_PYCCALL
22455         } else if (__Pyx_PyFastCFunction_Check(func)) {
22456             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
22457 #endif
22458         }
22459     }
22460     return __Pyx__PyObject_CallOneArg(func, arg);
22461 }
22462 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)22463 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22464     PyObject *result;
22465     PyObject *args = PyTuple_Pack(1, arg);
22466     if (unlikely(!args)) return NULL;
22467     result = __Pyx_PyObject_Call(func, args, NULL);
22468     Py_DECREF(args);
22469     return result;
22470 }
22471 #endif
22472 
22473 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)22474 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
22475     PyObject *r;
22476     if (!j) return NULL;
22477     r = PyObject_GetItem(o, j);
22478     Py_DECREF(j);
22479     return r;
22480 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)22481 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
22482                                                               CYTHON_NCP_UNUSED int wraparound,
22483                                                               CYTHON_NCP_UNUSED int boundscheck) {
22484 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22485     Py_ssize_t wrapped_i = i;
22486     if (wraparound & unlikely(i < 0)) {
22487         wrapped_i += PyList_GET_SIZE(o);
22488     }
22489     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
22490         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
22491         Py_INCREF(r);
22492         return r;
22493     }
22494     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
22495 #else
22496     return PySequence_GetItem(o, i);
22497 #endif
22498 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)22499 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
22500                                                               CYTHON_NCP_UNUSED int wraparound,
22501                                                               CYTHON_NCP_UNUSED int boundscheck) {
22502 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22503     Py_ssize_t wrapped_i = i;
22504     if (wraparound & unlikely(i < 0)) {
22505         wrapped_i += PyTuple_GET_SIZE(o);
22506     }
22507     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
22508         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
22509         Py_INCREF(r);
22510         return r;
22511     }
22512     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
22513 #else
22514     return PySequence_GetItem(o, i);
22515 #endif
22516 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)22517 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
22518                                                      CYTHON_NCP_UNUSED int wraparound,
22519                                                      CYTHON_NCP_UNUSED int boundscheck) {
22520 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
22521     if (is_list || PyList_CheckExact(o)) {
22522         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
22523         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
22524             PyObject *r = PyList_GET_ITEM(o, n);
22525             Py_INCREF(r);
22526             return r;
22527         }
22528     }
22529     else if (PyTuple_CheckExact(o)) {
22530         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
22531         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
22532             PyObject *r = PyTuple_GET_ITEM(o, n);
22533             Py_INCREF(r);
22534             return r;
22535         }
22536     } else {
22537         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
22538         if (likely(m && m->sq_item)) {
22539             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
22540                 Py_ssize_t l = m->sq_length(o);
22541                 if (likely(l >= 0)) {
22542                     i += l;
22543                 } else {
22544                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
22545                         return NULL;
22546                     PyErr_Clear();
22547                 }
22548             }
22549             return m->sq_item(o, i);
22550         }
22551     }
22552 #else
22553     if (is_list || PySequence_Check(o)) {
22554         return PySequence_GetItem(o, i);
22555     }
22556 #endif
22557     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
22558 }
22559 
22560 /* ObjectGetItem */
22561 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)22562 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
22563     PyObject *runerr;
22564     Py_ssize_t key_value;
22565     PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
22566     if (unlikely(!(m && m->sq_item))) {
22567         PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
22568         return NULL;
22569     }
22570     key_value = __Pyx_PyIndex_AsSsize_t(index);
22571     if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
22572         return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
22573     }
22574     if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
22575         PyErr_Clear();
22576         PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
22577     }
22578     return NULL;
22579 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)22580 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
22581     PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
22582     if (likely(m && m->mp_subscript)) {
22583         return m->mp_subscript(obj, key);
22584     }
22585     return __Pyx_PyObject_GetIndex(obj, key);
22586 }
22587 #endif
22588 
22589 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)22590 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
22591     PyObject *args, *result = NULL;
22592     #if CYTHON_FAST_PYCALL
22593     if (PyFunction_Check(function)) {
22594         PyObject *args[2] = {arg1, arg2};
22595         return __Pyx_PyFunction_FastCall(function, args, 2);
22596     }
22597     #endif
22598     #if CYTHON_FAST_PYCCALL
22599     if (__Pyx_PyFastCFunction_Check(function)) {
22600         PyObject *args[2] = {arg1, arg2};
22601         return __Pyx_PyCFunction_FastCall(function, args, 2);
22602     }
22603     #endif
22604     args = PyTuple_New(2);
22605     if (unlikely(!args)) goto done;
22606     Py_INCREF(arg1);
22607     PyTuple_SET_ITEM(args, 0, arg1);
22608     Py_INCREF(arg2);
22609     PyTuple_SET_ITEM(args, 1, arg2);
22610     Py_INCREF(function);
22611     result = __Pyx_PyObject_Call(function, args, NULL);
22612     Py_DECREF(args);
22613     Py_DECREF(function);
22614 done:
22615     return result;
22616 }
22617 
22618 /* PyObjectGetMethod */
__Pyx_PyObject_GetMethod(PyObject * obj,PyObject * name,PyObject ** method)22619 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
22620     PyObject *attr;
22621 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
22622     PyTypeObject *tp = Py_TYPE(obj);
22623     PyObject *descr;
22624     descrgetfunc f = NULL;
22625     PyObject **dictptr, *dict;
22626     int meth_found = 0;
22627     assert (*method == NULL);
22628     if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
22629         attr = __Pyx_PyObject_GetAttrStr(obj, name);
22630         goto try_unpack;
22631     }
22632     if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
22633         return 0;
22634     }
22635     descr = _PyType_Lookup(tp, name);
22636     if (likely(descr != NULL)) {
22637         Py_INCREF(descr);
22638 #if PY_MAJOR_VERSION >= 3
22639         #ifdef __Pyx_CyFunction_USED
22640         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
22641         #else
22642         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
22643         #endif
22644 #else
22645         #ifdef __Pyx_CyFunction_USED
22646         if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
22647         #else
22648         if (likely(PyFunction_Check(descr)))
22649         #endif
22650 #endif
22651         {
22652             meth_found = 1;
22653         } else {
22654             f = Py_TYPE(descr)->tp_descr_get;
22655             if (f != NULL && PyDescr_IsData(descr)) {
22656                 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
22657                 Py_DECREF(descr);
22658                 goto try_unpack;
22659             }
22660         }
22661     }
22662     dictptr = _PyObject_GetDictPtr(obj);
22663     if (dictptr != NULL && (dict = *dictptr) != NULL) {
22664         Py_INCREF(dict);
22665         attr = __Pyx_PyDict_GetItemStr(dict, name);
22666         if (attr != NULL) {
22667             Py_INCREF(attr);
22668             Py_DECREF(dict);
22669             Py_XDECREF(descr);
22670             goto try_unpack;
22671         }
22672         Py_DECREF(dict);
22673     }
22674     if (meth_found) {
22675         *method = descr;
22676         return 1;
22677     }
22678     if (f != NULL) {
22679         attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
22680         Py_DECREF(descr);
22681         goto try_unpack;
22682     }
22683     if (descr != NULL) {
22684         *method = descr;
22685         return 0;
22686     }
22687     PyErr_Format(PyExc_AttributeError,
22688 #if PY_MAJOR_VERSION >= 3
22689                  "'%.50s' object has no attribute '%U'",
22690                  tp->tp_name, name);
22691 #else
22692                  "'%.50s' object has no attribute '%.400s'",
22693                  tp->tp_name, PyString_AS_STRING(name));
22694 #endif
22695     return 0;
22696 #else
22697     attr = __Pyx_PyObject_GetAttrStr(obj, name);
22698     goto try_unpack;
22699 #endif
22700 try_unpack:
22701 #if CYTHON_UNPACK_METHODS
22702     if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
22703         PyObject *function = PyMethod_GET_FUNCTION(attr);
22704         Py_INCREF(function);
22705         Py_DECREF(attr);
22706         *method = function;
22707         return 1;
22708     }
22709 #endif
22710     *method = attr;
22711     return 0;
22712 }
22713 
22714 /* PyObjectCallMethod0 */
__Pyx_PyObject_CallMethod0(PyObject * obj,PyObject * method_name)22715 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
22716     PyObject *method = NULL, *result = NULL;
22717     int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
22718     if (likely(is_method)) {
22719         result = __Pyx_PyObject_CallOneArg(method, obj);
22720         Py_DECREF(method);
22721         return result;
22722     }
22723     if (unlikely(!method)) goto bad;
22724     result = __Pyx_PyObject_CallNoArg(method);
22725     Py_DECREF(method);
22726 bad:
22727     return result;
22728 }
22729 
22730 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)22731 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
22732     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
22733 }
22734 
22735 /* UnpackTupleError */
__Pyx_UnpackTupleError(PyObject * t,Py_ssize_t index)22736 static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
22737     if (t == Py_None) {
22738       __Pyx_RaiseNoneNotIterableError();
22739     } else if (PyTuple_GET_SIZE(t) < index) {
22740       __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
22741     } else {
22742       __Pyx_RaiseTooManyValuesError(index);
22743     }
22744 }
22745 
22746 /* UnpackTuple2 */
__Pyx_unpack_tuple2_exact(PyObject * tuple,PyObject ** pvalue1,PyObject ** pvalue2,int decref_tuple)22747 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
22748         PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
22749     PyObject *value1 = NULL, *value2 = NULL;
22750 #if CYTHON_COMPILING_IN_PYPY
22751     value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
22752     value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
22753 #else
22754     value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
22755     value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
22756 #endif
22757     if (decref_tuple) {
22758         Py_DECREF(tuple);
22759     }
22760     *pvalue1 = value1;
22761     *pvalue2 = value2;
22762     return 0;
22763 #if CYTHON_COMPILING_IN_PYPY
22764 bad:
22765     Py_XDECREF(value1);
22766     Py_XDECREF(value2);
22767     if (decref_tuple) { Py_XDECREF(tuple); }
22768     return -1;
22769 #endif
22770 }
__Pyx_unpack_tuple2_generic(PyObject * tuple,PyObject ** pvalue1,PyObject ** pvalue2,int has_known_size,int decref_tuple)22771 static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
22772                                        int has_known_size, int decref_tuple) {
22773     Py_ssize_t index;
22774     PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
22775     iternextfunc iternext;
22776     iter = PyObject_GetIter(tuple);
22777     if (unlikely(!iter)) goto bad;
22778     if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
22779     iternext = Py_TYPE(iter)->tp_iternext;
22780     value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
22781     value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
22782     if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
22783     Py_DECREF(iter);
22784     *pvalue1 = value1;
22785     *pvalue2 = value2;
22786     return 0;
22787 unpacking_failed:
22788     if (!has_known_size && __Pyx_IterFinish() == 0)
22789         __Pyx_RaiseNeedMoreValuesError(index);
22790 bad:
22791     Py_XDECREF(iter);
22792     Py_XDECREF(value1);
22793     Py_XDECREF(value2);
22794     if (decref_tuple) { Py_XDECREF(tuple); }
22795     return -1;
22796 }
22797 
22798 /* dict_iter */
__Pyx_dict_iterator(PyObject * iterable,int is_dict,PyObject * method_name,Py_ssize_t * p_orig_length,int * p_source_is_dict)22799 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
22800                                                    Py_ssize_t* p_orig_length, int* p_source_is_dict) {
22801     is_dict = is_dict || likely(PyDict_CheckExact(iterable));
22802     *p_source_is_dict = is_dict;
22803     if (is_dict) {
22804 #if !CYTHON_COMPILING_IN_PYPY
22805         *p_orig_length = PyDict_Size(iterable);
22806         Py_INCREF(iterable);
22807         return iterable;
22808 #elif PY_MAJOR_VERSION >= 3
22809         static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
22810         PyObject **pp = NULL;
22811         if (method_name) {
22812             const char *name = PyUnicode_AsUTF8(method_name);
22813             if (strcmp(name, "iteritems") == 0) pp = &py_items;
22814             else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
22815             else if (strcmp(name, "itervalues") == 0) pp = &py_values;
22816             if (pp) {
22817                 if (!*pp) {
22818                     *pp = PyUnicode_FromString(name + 4);
22819                     if (!*pp)
22820                         return NULL;
22821                 }
22822                 method_name = *pp;
22823             }
22824         }
22825 #endif
22826     }
22827     *p_orig_length = 0;
22828     if (method_name) {
22829         PyObject* iter;
22830         iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
22831         if (!iterable)
22832             return NULL;
22833 #if !CYTHON_COMPILING_IN_PYPY
22834         if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
22835             return iterable;
22836 #endif
22837         iter = PyObject_GetIter(iterable);
22838         Py_DECREF(iterable);
22839         return iter;
22840     }
22841     return PyObject_GetIter(iterable);
22842 }
__Pyx_dict_iter_next(PyObject * iter_obj,CYTHON_NCP_UNUSED Py_ssize_t orig_length,CYTHON_NCP_UNUSED Py_ssize_t * ppos,PyObject ** pkey,PyObject ** pvalue,PyObject ** pitem,int source_is_dict)22843 static CYTHON_INLINE int __Pyx_dict_iter_next(
22844         PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
22845         PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
22846     PyObject* next_item;
22847 #if !CYTHON_COMPILING_IN_PYPY
22848     if (source_is_dict) {
22849         PyObject *key, *value;
22850         if (unlikely(orig_length != PyDict_Size(iter_obj))) {
22851             PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
22852             return -1;
22853         }
22854         if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
22855             return 0;
22856         }
22857         if (pitem) {
22858             PyObject* tuple = PyTuple_New(2);
22859             if (unlikely(!tuple)) {
22860                 return -1;
22861             }
22862             Py_INCREF(key);
22863             Py_INCREF(value);
22864             PyTuple_SET_ITEM(tuple, 0, key);
22865             PyTuple_SET_ITEM(tuple, 1, value);
22866             *pitem = tuple;
22867         } else {
22868             if (pkey) {
22869                 Py_INCREF(key);
22870                 *pkey = key;
22871             }
22872             if (pvalue) {
22873                 Py_INCREF(value);
22874                 *pvalue = value;
22875             }
22876         }
22877         return 1;
22878     } else if (PyTuple_CheckExact(iter_obj)) {
22879         Py_ssize_t pos = *ppos;
22880         if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
22881         *ppos = pos + 1;
22882         next_item = PyTuple_GET_ITEM(iter_obj, pos);
22883         Py_INCREF(next_item);
22884     } else if (PyList_CheckExact(iter_obj)) {
22885         Py_ssize_t pos = *ppos;
22886         if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
22887         *ppos = pos + 1;
22888         next_item = PyList_GET_ITEM(iter_obj, pos);
22889         Py_INCREF(next_item);
22890     } else
22891 #endif
22892     {
22893         next_item = PyIter_Next(iter_obj);
22894         if (unlikely(!next_item)) {
22895             return __Pyx_IterFinish();
22896         }
22897     }
22898     if (pitem) {
22899         *pitem = next_item;
22900     } else if (pkey && pvalue) {
22901         if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
22902             return -1;
22903     } else if (pkey) {
22904         *pkey = next_item;
22905     } else {
22906         *pvalue = next_item;
22907     }
22908     return 1;
22909 }
22910 
22911 /* PyErrExceptionMatches */
22912 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)22913 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
22914     Py_ssize_t i, n;
22915     n = PyTuple_GET_SIZE(tuple);
22916 #if PY_MAJOR_VERSION >= 3
22917     for (i=0; i<n; i++) {
22918         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
22919     }
22920 #endif
22921     for (i=0; i<n; i++) {
22922         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
22923     }
22924     return 0;
22925 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)22926 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
22927     PyObject *exc_type = tstate->curexc_type;
22928     if (exc_type == err) return 1;
22929     if (unlikely(!exc_type)) return 0;
22930     if (unlikely(PyTuple_Check(err)))
22931         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
22932     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
22933 }
22934 #endif
22935 
22936 /* PyErrFetchRestore */
22937 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)22938 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
22939     PyObject *tmp_type, *tmp_value, *tmp_tb;
22940     tmp_type = tstate->curexc_type;
22941     tmp_value = tstate->curexc_value;
22942     tmp_tb = tstate->curexc_traceback;
22943     tstate->curexc_type = type;
22944     tstate->curexc_value = value;
22945     tstate->curexc_traceback = tb;
22946     Py_XDECREF(tmp_type);
22947     Py_XDECREF(tmp_value);
22948     Py_XDECREF(tmp_tb);
22949 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)22950 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22951     *type = tstate->curexc_type;
22952     *value = tstate->curexc_value;
22953     *tb = tstate->curexc_traceback;
22954     tstate->curexc_type = 0;
22955     tstate->curexc_value = 0;
22956     tstate->curexc_traceback = 0;
22957 }
22958 #endif
22959 
22960 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)22961 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
22962 #if CYTHON_USE_TYPE_SLOTS
22963 #if PY_MAJOR_VERSION >= 3
22964     if (likely(PyUnicode_Check(n)))
22965 #else
22966     if (likely(PyString_Check(n)))
22967 #endif
22968         return __Pyx_PyObject_GetAttrStr(o, n);
22969 #endif
22970     return PyObject_GetAttr(o, n);
22971 }
22972 
22973 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)22974 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
22975     __Pyx_PyThreadState_declare
22976     __Pyx_PyThreadState_assign
22977     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
22978         return NULL;
22979     __Pyx_PyErr_Clear();
22980     Py_INCREF(d);
22981     return d;
22982 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)22983 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
22984     PyObject *r = __Pyx_GetAttr(o, n);
22985     return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
22986 }
22987 
22988 /* RaiseException */
22989 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)22990 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
22991                         CYTHON_UNUSED PyObject *cause) {
22992     __Pyx_PyThreadState_declare
22993     Py_XINCREF(type);
22994     if (!value || value == Py_None)
22995         value = NULL;
22996     else
22997         Py_INCREF(value);
22998     if (!tb || tb == Py_None)
22999         tb = NULL;
23000     else {
23001         Py_INCREF(tb);
23002         if (!PyTraceBack_Check(tb)) {
23003             PyErr_SetString(PyExc_TypeError,
23004                 "raise: arg 3 must be a traceback or None");
23005             goto raise_error;
23006         }
23007     }
23008     if (PyType_Check(type)) {
23009 #if CYTHON_COMPILING_IN_PYPY
23010         if (!value) {
23011             Py_INCREF(Py_None);
23012             value = Py_None;
23013         }
23014 #endif
23015         PyErr_NormalizeException(&type, &value, &tb);
23016     } else {
23017         if (value) {
23018             PyErr_SetString(PyExc_TypeError,
23019                 "instance exception may not have a separate value");
23020             goto raise_error;
23021         }
23022         value = type;
23023         type = (PyObject*) Py_TYPE(type);
23024         Py_INCREF(type);
23025         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
23026             PyErr_SetString(PyExc_TypeError,
23027                 "raise: exception class must be a subclass of BaseException");
23028             goto raise_error;
23029         }
23030     }
23031     __Pyx_PyThreadState_assign
23032     __Pyx_ErrRestore(type, value, tb);
23033     return;
23034 raise_error:
23035     Py_XDECREF(value);
23036     Py_XDECREF(type);
23037     Py_XDECREF(tb);
23038     return;
23039 }
23040 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)23041 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
23042     PyObject* owned_instance = NULL;
23043     if (tb == Py_None) {
23044         tb = 0;
23045     } else if (tb && !PyTraceBack_Check(tb)) {
23046         PyErr_SetString(PyExc_TypeError,
23047             "raise: arg 3 must be a traceback or None");
23048         goto bad;
23049     }
23050     if (value == Py_None)
23051         value = 0;
23052     if (PyExceptionInstance_Check(type)) {
23053         if (value) {
23054             PyErr_SetString(PyExc_TypeError,
23055                 "instance exception may not have a separate value");
23056             goto bad;
23057         }
23058         value = type;
23059         type = (PyObject*) Py_TYPE(value);
23060     } else if (PyExceptionClass_Check(type)) {
23061         PyObject *instance_class = NULL;
23062         if (value && PyExceptionInstance_Check(value)) {
23063             instance_class = (PyObject*) Py_TYPE(value);
23064             if (instance_class != type) {
23065                 int is_subclass = PyObject_IsSubclass(instance_class, type);
23066                 if (!is_subclass) {
23067                     instance_class = NULL;
23068                 } else if (unlikely(is_subclass == -1)) {
23069                     goto bad;
23070                 } else {
23071                     type = instance_class;
23072                 }
23073             }
23074         }
23075         if (!instance_class) {
23076             PyObject *args;
23077             if (!value)
23078                 args = PyTuple_New(0);
23079             else if (PyTuple_Check(value)) {
23080                 Py_INCREF(value);
23081                 args = value;
23082             } else
23083                 args = PyTuple_Pack(1, value);
23084             if (!args)
23085                 goto bad;
23086             owned_instance = PyObject_Call(type, args, NULL);
23087             Py_DECREF(args);
23088             if (!owned_instance)
23089                 goto bad;
23090             value = owned_instance;
23091             if (!PyExceptionInstance_Check(value)) {
23092                 PyErr_Format(PyExc_TypeError,
23093                              "calling %R should have returned an instance of "
23094                              "BaseException, not %R",
23095                              type, Py_TYPE(value));
23096                 goto bad;
23097             }
23098         }
23099     } else {
23100         PyErr_SetString(PyExc_TypeError,
23101             "raise: exception class must be a subclass of BaseException");
23102         goto bad;
23103     }
23104     if (cause) {
23105         PyObject *fixed_cause;
23106         if (cause == Py_None) {
23107             fixed_cause = NULL;
23108         } else if (PyExceptionClass_Check(cause)) {
23109             fixed_cause = PyObject_CallObject(cause, NULL);
23110             if (fixed_cause == NULL)
23111                 goto bad;
23112         } else if (PyExceptionInstance_Check(cause)) {
23113             fixed_cause = cause;
23114             Py_INCREF(fixed_cause);
23115         } else {
23116             PyErr_SetString(PyExc_TypeError,
23117                             "exception causes must derive from "
23118                             "BaseException");
23119             goto bad;
23120         }
23121         PyException_SetCause(value, fixed_cause);
23122     }
23123     PyErr_SetObject(type, value);
23124     if (tb) {
23125 #if CYTHON_COMPILING_IN_PYPY
23126         PyObject *tmp_type, *tmp_value, *tmp_tb;
23127         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
23128         Py_INCREF(tb);
23129         PyErr_Restore(tmp_type, tmp_value, tb);
23130         Py_XDECREF(tmp_tb);
23131 #else
23132         PyThreadState *tstate = __Pyx_PyThreadState_Current;
23133         PyObject* tmp_tb = tstate->curexc_traceback;
23134         if (tb != tmp_tb) {
23135             Py_INCREF(tb);
23136             tstate->curexc_traceback = tb;
23137             Py_XDECREF(tmp_tb);
23138         }
23139 #endif
23140     }
23141 bad:
23142     Py_XDECREF(owned_instance);
23143     return;
23144 }
23145 #endif
23146 
23147 /* None */
__Pyx_div_int(int a,int b)23148 static CYTHON_INLINE int __Pyx_div_int(int a, int b) {
23149     int q = a / b;
23150     int r = a - q*b;
23151     q -= ((r != 0) & ((r ^ b) < 0));
23152     return q;
23153 }
23154 
23155 /* PyIntCompare */
__Pyx_PyInt_EqObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,CYTHON_UNUSED long inplace)23156 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
23157     if (op1 == op2) {
23158         Py_RETURN_TRUE;
23159     }
23160     #if PY_MAJOR_VERSION < 3
23161     if (likely(PyInt_CheckExact(op1))) {
23162         const long b = intval;
23163         long a = PyInt_AS_LONG(op1);
23164         if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
23165     }
23166     #endif
23167     #if CYTHON_USE_PYLONG_INTERNALS
23168     if (likely(PyLong_CheckExact(op1))) {
23169         int unequal;
23170         unsigned long uintval;
23171         Py_ssize_t size = Py_SIZE(op1);
23172         const digit* digits = ((PyLongObject*)op1)->ob_digit;
23173         if (intval == 0) {
23174             if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
23175         } else if (intval < 0) {
23176             if (size >= 0)
23177                 Py_RETURN_FALSE;
23178             intval = -intval;
23179             size = -size;
23180         } else {
23181             if (size <= 0)
23182                 Py_RETURN_FALSE;
23183         }
23184         uintval = (unsigned long) intval;
23185 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
23186         if (uintval >> (PyLong_SHIFT * 4)) {
23187             unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
23188                  | (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));
23189         } else
23190 #endif
23191 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
23192         if (uintval >> (PyLong_SHIFT * 3)) {
23193             unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
23194                  | (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));
23195         } else
23196 #endif
23197 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
23198         if (uintval >> (PyLong_SHIFT * 2)) {
23199             unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
23200                  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
23201         } else
23202 #endif
23203 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
23204         if (uintval >> (PyLong_SHIFT * 1)) {
23205             unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
23206                  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
23207         } else
23208 #endif
23209             unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
23210         if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
23211     }
23212     #endif
23213     if (PyFloat_CheckExact(op1)) {
23214         const long b = intval;
23215         double a = PyFloat_AS_DOUBLE(op1);
23216         if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
23217     }
23218     return (
23219         PyObject_RichCompare(op1, op2, Py_EQ));
23220 }
23221 
23222 /* WriteUnraisableException */
__Pyx_WriteUnraisable(const char * name,CYTHON_UNUSED int clineno,CYTHON_UNUSED int lineno,CYTHON_UNUSED const char * filename,int full_traceback,CYTHON_UNUSED int nogil)23223 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
23224                                   CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
23225                                   int full_traceback, CYTHON_UNUSED int nogil) {
23226     PyObject *old_exc, *old_val, *old_tb;
23227     PyObject *ctx;
23228     __Pyx_PyThreadState_declare
23229 #ifdef WITH_THREAD
23230     PyGILState_STATE state;
23231     if (nogil)
23232         state = PyGILState_Ensure();
23233 #ifdef _MSC_VER
23234     else state = (PyGILState_STATE)-1;
23235 #endif
23236 #endif
23237     __Pyx_PyThreadState_assign
23238     __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
23239     if (full_traceback) {
23240         Py_XINCREF(old_exc);
23241         Py_XINCREF(old_val);
23242         Py_XINCREF(old_tb);
23243         __Pyx_ErrRestore(old_exc, old_val, old_tb);
23244         PyErr_PrintEx(1);
23245     }
23246     #if PY_MAJOR_VERSION < 3
23247     ctx = PyString_FromString(name);
23248     #else
23249     ctx = PyUnicode_FromString(name);
23250     #endif
23251     __Pyx_ErrRestore(old_exc, old_val, old_tb);
23252     if (!ctx) {
23253         PyErr_WriteUnraisable(Py_None);
23254     } else {
23255         PyErr_WriteUnraisable(ctx);
23256         Py_DECREF(ctx);
23257     }
23258 #ifdef WITH_THREAD
23259     if (nogil)
23260         PyGILState_Release(state);
23261 #endif
23262 }
23263 
23264 /* SetItemInt */
__Pyx_SetItemInt_Generic(PyObject * o,PyObject * j,PyObject * v)23265 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
23266     int r;
23267     if (!j) return -1;
23268     r = PyObject_SetItem(o, j, v);
23269     Py_DECREF(j);
23270     return r;
23271 }
__Pyx_SetItemInt_Fast(PyObject * o,Py_ssize_t i,PyObject * v,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)23272 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
23273                                                CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
23274 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
23275     if (is_list || PyList_CheckExact(o)) {
23276         Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
23277         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
23278             PyObject* old = PyList_GET_ITEM(o, n);
23279             Py_INCREF(v);
23280             PyList_SET_ITEM(o, n, v);
23281             Py_DECREF(old);
23282             return 1;
23283         }
23284     } else {
23285         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
23286         if (likely(m && m->sq_ass_item)) {
23287             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
23288                 Py_ssize_t l = m->sq_length(o);
23289                 if (likely(l >= 0)) {
23290                     i += l;
23291                 } else {
23292                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23293                         return -1;
23294                     PyErr_Clear();
23295                 }
23296             }
23297             return m->sq_ass_item(o, i, v);
23298         }
23299     }
23300 #else
23301 #if CYTHON_COMPILING_IN_PYPY
23302     if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
23303 #else
23304     if (is_list || PySequence_Check(o))
23305 #endif
23306     {
23307         return PySequence_SetItem(o, i, v);
23308     }
23309 #endif
23310     return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
23311 }
23312 
23313 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)23314 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
23315     if (unlikely(!type)) {
23316         PyErr_SetString(PyExc_SystemError, "Missing type object");
23317         return 0;
23318     }
23319     if (likely(__Pyx_TypeCheck(obj, type)))
23320         return 1;
23321     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
23322                  Py_TYPE(obj)->tp_name, type->tp_name);
23323     return 0;
23324 }
23325 
23326 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)23327 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
23328 {
23329     if (unlikely(!type)) {
23330         PyErr_SetString(PyExc_SystemError, "Missing type object");
23331         return 0;
23332     }
23333     else if (exact) {
23334         #if PY_MAJOR_VERSION == 2
23335         if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
23336         #endif
23337     }
23338     else {
23339         if (likely(__Pyx_TypeCheck(obj, type))) return 1;
23340     }
23341     PyErr_Format(PyExc_TypeError,
23342         "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
23343         name, type->tp_name, Py_TYPE(obj)->tp_name);
23344     return 0;
23345 }
23346 
23347 /* SliceObject */
__Pyx_PyObject_SetSlice(PyObject * obj,PyObject * value,Py_ssize_t cstart,Py_ssize_t cstop,PyObject ** _py_start,PyObject ** _py_stop,PyObject ** _py_slice,int has_cstart,int has_cstop,CYTHON_UNUSED int wraparound)23348 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
23349         Py_ssize_t cstart, Py_ssize_t cstop,
23350         PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
23351         int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
23352 #if CYTHON_USE_TYPE_SLOTS
23353     PyMappingMethods* mp;
23354 #if PY_MAJOR_VERSION < 3
23355     PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
23356     if (likely(ms && ms->sq_ass_slice)) {
23357         if (!has_cstart) {
23358             if (_py_start && (*_py_start != Py_None)) {
23359                 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
23360                 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
23361             } else
23362                 cstart = 0;
23363         }
23364         if (!has_cstop) {
23365             if (_py_stop && (*_py_stop != Py_None)) {
23366                 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
23367                 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
23368             } else
23369                 cstop = PY_SSIZE_T_MAX;
23370         }
23371         if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
23372             Py_ssize_t l = ms->sq_length(obj);
23373             if (likely(l >= 0)) {
23374                 if (cstop < 0) {
23375                     cstop += l;
23376                     if (cstop < 0) cstop = 0;
23377                 }
23378                 if (cstart < 0) {
23379                     cstart += l;
23380                     if (cstart < 0) cstart = 0;
23381                 }
23382             } else {
23383                 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23384                     goto bad;
23385                 PyErr_Clear();
23386             }
23387         }
23388         return ms->sq_ass_slice(obj, cstart, cstop, value);
23389     }
23390 #endif
23391     mp = Py_TYPE(obj)->tp_as_mapping;
23392     if (likely(mp && mp->mp_ass_subscript))
23393 #endif
23394     {
23395         int result;
23396         PyObject *py_slice, *py_start, *py_stop;
23397         if (_py_slice) {
23398             py_slice = *_py_slice;
23399         } else {
23400             PyObject* owned_start = NULL;
23401             PyObject* owned_stop = NULL;
23402             if (_py_start) {
23403                 py_start = *_py_start;
23404             } else {
23405                 if (has_cstart) {
23406                     owned_start = py_start = PyInt_FromSsize_t(cstart);
23407                     if (unlikely(!py_start)) goto bad;
23408                 } else
23409                     py_start = Py_None;
23410             }
23411             if (_py_stop) {
23412                 py_stop = *_py_stop;
23413             } else {
23414                 if (has_cstop) {
23415                     owned_stop = py_stop = PyInt_FromSsize_t(cstop);
23416                     if (unlikely(!py_stop)) {
23417                         Py_XDECREF(owned_start);
23418                         goto bad;
23419                     }
23420                 } else
23421                     py_stop = Py_None;
23422             }
23423             py_slice = PySlice_New(py_start, py_stop, Py_None);
23424             Py_XDECREF(owned_start);
23425             Py_XDECREF(owned_stop);
23426             if (unlikely(!py_slice)) goto bad;
23427         }
23428 #if CYTHON_USE_TYPE_SLOTS
23429         result = mp->mp_ass_subscript(obj, py_slice, value);
23430 #else
23431         result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
23432 #endif
23433         if (!_py_slice) {
23434             Py_DECREF(py_slice);
23435         }
23436         return result;
23437     }
23438     PyErr_Format(PyExc_TypeError,
23439         "'%.200s' object does not support slice %.10s",
23440         Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
23441 bad:
23442     return -1;
23443 }
23444 
23445 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)23446 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
23447     PyObject *empty_list = 0;
23448     PyObject *module = 0;
23449     PyObject *global_dict = 0;
23450     PyObject *empty_dict = 0;
23451     PyObject *list;
23452     #if PY_MAJOR_VERSION < 3
23453     PyObject *py_import;
23454     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
23455     if (!py_import)
23456         goto bad;
23457     #endif
23458     if (from_list)
23459         list = from_list;
23460     else {
23461         empty_list = PyList_New(0);
23462         if (!empty_list)
23463             goto bad;
23464         list = empty_list;
23465     }
23466     global_dict = PyModule_GetDict(__pyx_m);
23467     if (!global_dict)
23468         goto bad;
23469     empty_dict = PyDict_New();
23470     if (!empty_dict)
23471         goto bad;
23472     {
23473         #if PY_MAJOR_VERSION >= 3
23474         if (level == -1) {
23475             if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
23476                 module = PyImport_ImportModuleLevelObject(
23477                     name, global_dict, empty_dict, list, 1);
23478                 if (!module) {
23479                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
23480                         goto bad;
23481                     PyErr_Clear();
23482                 }
23483             }
23484             level = 0;
23485         }
23486         #endif
23487         if (!module) {
23488             #if PY_MAJOR_VERSION < 3
23489             PyObject *py_level = PyInt_FromLong(level);
23490             if (!py_level)
23491                 goto bad;
23492             module = PyObject_CallFunctionObjArgs(py_import,
23493                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
23494             Py_DECREF(py_level);
23495             #else
23496             module = PyImport_ImportModuleLevelObject(
23497                 name, global_dict, empty_dict, list, level);
23498             #endif
23499         }
23500     }
23501 bad:
23502     #if PY_MAJOR_VERSION < 3
23503     Py_XDECREF(py_import);
23504     #endif
23505     Py_XDECREF(empty_list);
23506     Py_XDECREF(empty_dict);
23507     return module;
23508 }
23509 
23510 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)23511 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
23512     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
23513     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
23514         PyErr_Format(PyExc_ImportError,
23515         #if PY_MAJOR_VERSION < 3
23516             "cannot import name %.230s", PyString_AS_STRING(name));
23517         #else
23518             "cannot import name %S", name);
23519         #endif
23520     }
23521     return value;
23522 }
23523 
23524 /* HasAttr */
__Pyx_HasAttr(PyObject * o,PyObject * n)23525 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
23526     PyObject *r;
23527     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
23528         PyErr_SetString(PyExc_TypeError,
23529                         "hasattr(): attribute name must be string");
23530         return -1;
23531     }
23532     r = __Pyx_GetAttr(o, n);
23533     if (unlikely(!r)) {
23534         PyErr_Clear();
23535         return 0;
23536     } else {
23537         Py_DECREF(r);
23538         return 1;
23539     }
23540 }
23541 
23542 /* GetTopmostException */
23543 #if CYTHON_USE_EXC_INFO_STACK
23544 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)23545 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
23546 {
23547     _PyErr_StackItem *exc_info = tstate->exc_info;
23548     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
23549            exc_info->previous_item != NULL)
23550     {
23551         exc_info = exc_info->previous_item;
23552     }
23553     return exc_info;
23554 }
23555 #endif
23556 
23557 /* SaveResetException */
23558 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)23559 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23560     #if CYTHON_USE_EXC_INFO_STACK
23561     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
23562     *type = exc_info->exc_type;
23563     *value = exc_info->exc_value;
23564     *tb = exc_info->exc_traceback;
23565     #else
23566     *type = tstate->exc_type;
23567     *value = tstate->exc_value;
23568     *tb = tstate->exc_traceback;
23569     #endif
23570     Py_XINCREF(*type);
23571     Py_XINCREF(*value);
23572     Py_XINCREF(*tb);
23573 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)23574 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
23575     PyObject *tmp_type, *tmp_value, *tmp_tb;
23576     #if CYTHON_USE_EXC_INFO_STACK
23577     _PyErr_StackItem *exc_info = tstate->exc_info;
23578     tmp_type = exc_info->exc_type;
23579     tmp_value = exc_info->exc_value;
23580     tmp_tb = exc_info->exc_traceback;
23581     exc_info->exc_type = type;
23582     exc_info->exc_value = value;
23583     exc_info->exc_traceback = tb;
23584     #else
23585     tmp_type = tstate->exc_type;
23586     tmp_value = tstate->exc_value;
23587     tmp_tb = tstate->exc_traceback;
23588     tstate->exc_type = type;
23589     tstate->exc_value = value;
23590     tstate->exc_traceback = tb;
23591     #endif
23592     Py_XDECREF(tmp_type);
23593     Py_XDECREF(tmp_value);
23594     Py_XDECREF(tmp_tb);
23595 }
23596 #endif
23597 
23598 /* GetException */
23599 #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)23600 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
23601 #else
23602 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
23603 #endif
23604 {
23605     PyObject *local_type, *local_value, *local_tb;
23606 #if CYTHON_FAST_THREAD_STATE
23607     PyObject *tmp_type, *tmp_value, *tmp_tb;
23608     local_type = tstate->curexc_type;
23609     local_value = tstate->curexc_value;
23610     local_tb = tstate->curexc_traceback;
23611     tstate->curexc_type = 0;
23612     tstate->curexc_value = 0;
23613     tstate->curexc_traceback = 0;
23614 #else
23615     PyErr_Fetch(&local_type, &local_value, &local_tb);
23616 #endif
23617     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
23618 #if CYTHON_FAST_THREAD_STATE
23619     if (unlikely(tstate->curexc_type))
23620 #else
23621     if (unlikely(PyErr_Occurred()))
23622 #endif
23623         goto bad;
23624     #if PY_MAJOR_VERSION >= 3
23625     if (local_tb) {
23626         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
23627             goto bad;
23628     }
23629     #endif
23630     Py_XINCREF(local_tb);
23631     Py_XINCREF(local_type);
23632     Py_XINCREF(local_value);
23633     *type = local_type;
23634     *value = local_value;
23635     *tb = local_tb;
23636 #if CYTHON_FAST_THREAD_STATE
23637     #if CYTHON_USE_EXC_INFO_STACK
23638     {
23639         _PyErr_StackItem *exc_info = tstate->exc_info;
23640         tmp_type = exc_info->exc_type;
23641         tmp_value = exc_info->exc_value;
23642         tmp_tb = exc_info->exc_traceback;
23643         exc_info->exc_type = local_type;
23644         exc_info->exc_value = local_value;
23645         exc_info->exc_traceback = local_tb;
23646     }
23647     #else
23648     tmp_type = tstate->exc_type;
23649     tmp_value = tstate->exc_value;
23650     tmp_tb = tstate->exc_traceback;
23651     tstate->exc_type = local_type;
23652     tstate->exc_value = local_value;
23653     tstate->exc_traceback = local_tb;
23654     #endif
23655     Py_XDECREF(tmp_type);
23656     Py_XDECREF(tmp_value);
23657     Py_XDECREF(tmp_tb);
23658 #else
23659     PyErr_SetExcInfo(local_type, local_value, local_tb);
23660 #endif
23661     return 0;
23662 bad:
23663     *type = 0;
23664     *value = 0;
23665     *tb = 0;
23666     Py_XDECREF(local_type);
23667     Py_XDECREF(local_value);
23668     Py_XDECREF(local_tb);
23669     return -1;
23670 }
23671 
23672 /* PyObject_GenericGetAttrNoDict */
23673 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)23674 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
23675     PyErr_Format(PyExc_AttributeError,
23676 #if PY_MAJOR_VERSION >= 3
23677                  "'%.50s' object has no attribute '%U'",
23678                  tp->tp_name, attr_name);
23679 #else
23680                  "'%.50s' object has no attribute '%.400s'",
23681                  tp->tp_name, PyString_AS_STRING(attr_name));
23682 #endif
23683     return NULL;
23684 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)23685 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
23686     PyObject *descr;
23687     PyTypeObject *tp = Py_TYPE(obj);
23688     if (unlikely(!PyString_Check(attr_name))) {
23689         return PyObject_GenericGetAttr(obj, attr_name);
23690     }
23691     assert(!tp->tp_dictoffset);
23692     descr = _PyType_Lookup(tp, attr_name);
23693     if (unlikely(!descr)) {
23694         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
23695     }
23696     Py_INCREF(descr);
23697     #if PY_MAJOR_VERSION < 3
23698     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
23699     #endif
23700     {
23701         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
23702         if (unlikely(f)) {
23703             PyObject *res = f(descr, obj, (PyObject *)tp);
23704             Py_DECREF(descr);
23705             return res;
23706         }
23707     }
23708     return descr;
23709 }
23710 #endif
23711 
23712 /* PyObject_GenericGetAttr */
23713 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)23714 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
23715     if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
23716         return PyObject_GenericGetAttr(obj, attr_name);
23717     }
23718     return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
23719 }
23720 #endif
23721 
23722 /* PyObjectGetAttrStrNoError */
__Pyx_PyObject_GetAttrStr_ClearAttributeError(void)23723 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
23724     __Pyx_PyThreadState_declare
23725     __Pyx_PyThreadState_assign
23726     if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
23727         __Pyx_PyErr_Clear();
23728 }
__Pyx_PyObject_GetAttrStrNoError(PyObject * obj,PyObject * attr_name)23729 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
23730     PyObject *result;
23731 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
23732     PyTypeObject* tp = Py_TYPE(obj);
23733     if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
23734         return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
23735     }
23736 #endif
23737     result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
23738     if (unlikely(!result)) {
23739         __Pyx_PyObject_GetAttrStr_ClearAttributeError();
23740     }
23741     return result;
23742 }
23743 
23744 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)23745 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
23746   int ret;
23747   PyObject *name_attr;
23748   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
23749   if (likely(name_attr)) {
23750       ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
23751   } else {
23752       ret = -1;
23753   }
23754   if (unlikely(ret < 0)) {
23755       PyErr_Clear();
23756       ret = 0;
23757   }
23758   Py_XDECREF(name_attr);
23759   return ret;
23760 }
__Pyx_setup_reduce(PyObject * type_obj)23761 static int __Pyx_setup_reduce(PyObject* type_obj) {
23762     int ret = 0;
23763     PyObject *object_reduce = NULL;
23764     PyObject *object_reduce_ex = NULL;
23765     PyObject *reduce = NULL;
23766     PyObject *reduce_ex = NULL;
23767     PyObject *reduce_cython = NULL;
23768     PyObject *setstate = NULL;
23769     PyObject *setstate_cython = NULL;
23770 #if CYTHON_USE_PYTYPE_LOOKUP
23771     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
23772 #else
23773     if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
23774 #endif
23775 #if CYTHON_USE_PYTYPE_LOOKUP
23776     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
23777 #else
23778     object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
23779 #endif
23780     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
23781     if (reduce_ex == object_reduce_ex) {
23782 #if CYTHON_USE_PYTYPE_LOOKUP
23783         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
23784 #else
23785         object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
23786 #endif
23787         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
23788         if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
23789             reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
23790             if (likely(reduce_cython)) {
23791                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
23792                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
23793             } else if (reduce == object_reduce || PyErr_Occurred()) {
23794                 goto __PYX_BAD;
23795             }
23796             setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
23797             if (!setstate) PyErr_Clear();
23798             if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
23799                 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
23800                 if (likely(setstate_cython)) {
23801                     ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
23802                     ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
23803                 } else if (!setstate || PyErr_Occurred()) {
23804                     goto __PYX_BAD;
23805                 }
23806             }
23807             PyType_Modified((PyTypeObject*)type_obj);
23808         }
23809     }
23810     goto __PYX_GOOD;
23811 __PYX_BAD:
23812     if (!PyErr_Occurred())
23813         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
23814     ret = -1;
23815 __PYX_GOOD:
23816 #if !CYTHON_USE_PYTYPE_LOOKUP
23817     Py_XDECREF(object_reduce);
23818     Py_XDECREF(object_reduce_ex);
23819 #endif
23820     Py_XDECREF(reduce);
23821     Py_XDECREF(reduce_ex);
23822     Py_XDECREF(reduce_cython);
23823     Py_XDECREF(setstate);
23824     Py_XDECREF(setstate_cython);
23825     return ret;
23826 }
23827 
23828 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)23829 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
23830 #if PY_VERSION_HEX >= 0x02070000
23831     PyObject *ob = PyCapsule_New(vtable, 0, 0);
23832 #else
23833     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
23834 #endif
23835     if (!ob)
23836         goto bad;
23837     if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
23838         goto bad;
23839     Py_DECREF(ob);
23840     return 0;
23841 bad:
23842     Py_XDECREF(ob);
23843     return -1;
23844 }
23845 
23846 /* TypeImport */
23847 #ifndef __PYX_HAVE_RT_ImportType
23848 #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)23849 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
23850     size_t size, enum __Pyx_ImportType_CheckSize check_size)
23851 {
23852     PyObject *result = 0;
23853     char warning[200];
23854     Py_ssize_t basicsize;
23855 #ifdef Py_LIMITED_API
23856     PyObject *py_basicsize;
23857 #endif
23858     result = PyObject_GetAttrString(module, class_name);
23859     if (!result)
23860         goto bad;
23861     if (!PyType_Check(result)) {
23862         PyErr_Format(PyExc_TypeError,
23863             "%.200s.%.200s is not a type object",
23864             module_name, class_name);
23865         goto bad;
23866     }
23867 #ifndef Py_LIMITED_API
23868     basicsize = ((PyTypeObject *)result)->tp_basicsize;
23869 #else
23870     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
23871     if (!py_basicsize)
23872         goto bad;
23873     basicsize = PyLong_AsSsize_t(py_basicsize);
23874     Py_DECREF(py_basicsize);
23875     py_basicsize = 0;
23876     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
23877         goto bad;
23878 #endif
23879     if ((size_t)basicsize < size) {
23880         PyErr_Format(PyExc_ValueError,
23881             "%.200s.%.200s size changed, may indicate binary incompatibility. "
23882             "Expected %zd from C header, got %zd from PyObject",
23883             module_name, class_name, size, basicsize);
23884         goto bad;
23885     }
23886     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
23887         PyErr_Format(PyExc_ValueError,
23888             "%.200s.%.200s size changed, may indicate binary incompatibility. "
23889             "Expected %zd from C header, got %zd from PyObject",
23890             module_name, class_name, size, basicsize);
23891         goto bad;
23892     }
23893     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
23894         PyOS_snprintf(warning, sizeof(warning),
23895             "%s.%s size changed, may indicate binary incompatibility. "
23896             "Expected %zd from C header, got %zd from PyObject",
23897             module_name, class_name, size, basicsize);
23898         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
23899     }
23900     return (PyTypeObject *)result;
23901 bad:
23902     Py_XDECREF(result);
23903     return NULL;
23904 }
23905 #endif
23906 
23907 /* ClassMethod */
__Pyx_Method_ClassMethod(PyObject * method)23908 static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
23909 #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
23910     if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
23911         return PyClassMethod_New(method);
23912     }
23913 #else
23914 #if CYTHON_COMPILING_IN_PYSTON || CYTHON_COMPILING_IN_PYPY
23915     if (PyMethodDescr_Check(method))
23916 #else
23917     #if PY_MAJOR_VERSION == 2
23918     static PyTypeObject *methoddescr_type = NULL;
23919     if (methoddescr_type == NULL) {
23920        PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
23921        if (!meth) return NULL;
23922        methoddescr_type = Py_TYPE(meth);
23923        Py_DECREF(meth);
23924     }
23925     #else
23926     PyTypeObject *methoddescr_type = &PyMethodDescr_Type;
23927     #endif
23928     if (__Pyx_TypeCheck(method, methoddescr_type))
23929 #endif
23930     {
23931         PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
23932         #if PY_VERSION_HEX < 0x03020000
23933         PyTypeObject *d_type = descr->d_type;
23934         #else
23935         PyTypeObject *d_type = descr->d_common.d_type;
23936         #endif
23937         return PyDescr_NewClassMethod(d_type, descr->d_method);
23938     }
23939 #endif
23940     else if (PyMethod_Check(method)) {
23941         return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
23942     }
23943     else {
23944         return PyClassMethod_New(method);
23945     }
23946 }
23947 
23948 /* GetNameInClass */
__Pyx_GetGlobalNameAfterAttributeLookup(PyObject * name)23949 static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) {
23950     PyObject *result;
23951     __Pyx_PyThreadState_declare
23952     __Pyx_PyThreadState_assign
23953     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
23954         return NULL;
23955     __Pyx_PyErr_Clear();
23956     __Pyx_GetModuleGlobalNameUncached(result, name);
23957     return result;
23958 }
__Pyx__GetNameInClass(PyObject * nmspace,PyObject * name)23959 static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
23960     PyObject *result;
23961     result = __Pyx_PyObject_GetAttrStr(nmspace, name);
23962     if (!result) {
23963         result = __Pyx_GetGlobalNameAfterAttributeLookup(name);
23964     }
23965     return result;
23966 }
23967 
23968 /* CLineInTraceback */
23969 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)23970 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
23971     PyObject *use_cline;
23972     PyObject *ptype, *pvalue, *ptraceback;
23973 #if CYTHON_COMPILING_IN_CPYTHON
23974     PyObject **cython_runtime_dict;
23975 #endif
23976     if (unlikely(!__pyx_cython_runtime)) {
23977         return c_line;
23978     }
23979     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
23980 #if CYTHON_COMPILING_IN_CPYTHON
23981     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
23982     if (likely(cython_runtime_dict)) {
23983         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
23984             use_cline, *cython_runtime_dict,
23985             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
23986     } else
23987 #endif
23988     {
23989       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
23990       if (use_cline_obj) {
23991         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
23992         Py_DECREF(use_cline_obj);
23993       } else {
23994         PyErr_Clear();
23995         use_cline = NULL;
23996       }
23997     }
23998     if (!use_cline) {
23999         c_line = 0;
24000         (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
24001     }
24002     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
24003         c_line = 0;
24004     }
24005     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
24006     return c_line;
24007 }
24008 #endif
24009 
24010 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)24011 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
24012     int start = 0, mid = 0, end = count - 1;
24013     if (end >= 0 && code_line > entries[end].code_line) {
24014         return count;
24015     }
24016     while (start < end) {
24017         mid = start + (end - start) / 2;
24018         if (code_line < entries[mid].code_line) {
24019             end = mid;
24020         } else if (code_line > entries[mid].code_line) {
24021              start = mid + 1;
24022         } else {
24023             return mid;
24024         }
24025     }
24026     if (code_line <= entries[mid].code_line) {
24027         return mid;
24028     } else {
24029         return mid + 1;
24030     }
24031 }
__pyx_find_code_object(int code_line)24032 static PyCodeObject *__pyx_find_code_object(int code_line) {
24033     PyCodeObject* code_object;
24034     int pos;
24035     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
24036         return NULL;
24037     }
24038     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
24039     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
24040         return NULL;
24041     }
24042     code_object = __pyx_code_cache.entries[pos].code_object;
24043     Py_INCREF(code_object);
24044     return code_object;
24045 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)24046 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
24047     int pos, i;
24048     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
24049     if (unlikely(!code_line)) {
24050         return;
24051     }
24052     if (unlikely(!entries)) {
24053         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
24054         if (likely(entries)) {
24055             __pyx_code_cache.entries = entries;
24056             __pyx_code_cache.max_count = 64;
24057             __pyx_code_cache.count = 1;
24058             entries[0].code_line = code_line;
24059             entries[0].code_object = code_object;
24060             Py_INCREF(code_object);
24061         }
24062         return;
24063     }
24064     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
24065     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
24066         PyCodeObject* tmp = entries[pos].code_object;
24067         entries[pos].code_object = code_object;
24068         Py_DECREF(tmp);
24069         return;
24070     }
24071     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
24072         int new_max = __pyx_code_cache.max_count + 64;
24073         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
24074             __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
24075         if (unlikely(!entries)) {
24076             return;
24077         }
24078         __pyx_code_cache.entries = entries;
24079         __pyx_code_cache.max_count = new_max;
24080     }
24081     for (i=__pyx_code_cache.count; i>pos; i--) {
24082         entries[i] = entries[i-1];
24083     }
24084     entries[pos].code_line = code_line;
24085     entries[pos].code_object = code_object;
24086     __pyx_code_cache.count++;
24087     Py_INCREF(code_object);
24088 }
24089 
24090 /* AddTraceback */
24091 #include "compile.h"
24092 #include "frameobject.h"
24093 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)24094 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
24095             const char *funcname, int c_line,
24096             int py_line, const char *filename) {
24097     PyCodeObject *py_code = NULL;
24098     PyObject *py_funcname = NULL;
24099     #if PY_MAJOR_VERSION < 3
24100     PyObject *py_srcfile = NULL;
24101     py_srcfile = PyString_FromString(filename);
24102     if (!py_srcfile) goto bad;
24103     #endif
24104     if (c_line) {
24105         #if PY_MAJOR_VERSION < 3
24106         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
24107         if (!py_funcname) goto bad;
24108         #else
24109         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
24110         if (!py_funcname) goto bad;
24111         funcname = PyUnicode_AsUTF8(py_funcname);
24112         if (!funcname) goto bad;
24113         #endif
24114     }
24115     else {
24116         #if PY_MAJOR_VERSION < 3
24117         py_funcname = PyString_FromString(funcname);
24118         if (!py_funcname) goto bad;
24119         #endif
24120     }
24121     #if PY_MAJOR_VERSION < 3
24122     py_code = __Pyx_PyCode_New(
24123         0,
24124         0,
24125         0,
24126         0,
24127         0,
24128         __pyx_empty_bytes, /*PyObject *code,*/
24129         __pyx_empty_tuple, /*PyObject *consts,*/
24130         __pyx_empty_tuple, /*PyObject *names,*/
24131         __pyx_empty_tuple, /*PyObject *varnames,*/
24132         __pyx_empty_tuple, /*PyObject *freevars,*/
24133         __pyx_empty_tuple, /*PyObject *cellvars,*/
24134         py_srcfile,   /*PyObject *filename,*/
24135         py_funcname,  /*PyObject *name,*/
24136         py_line,
24137         __pyx_empty_bytes  /*PyObject *lnotab*/
24138     );
24139     Py_DECREF(py_srcfile);
24140     #else
24141     py_code = PyCode_NewEmpty(filename, funcname, py_line);
24142     #endif
24143     Py_XDECREF(py_funcname);  // XDECREF since it's only set on Py3 if cline
24144     return py_code;
24145 bad:
24146     Py_XDECREF(py_funcname);
24147     #if PY_MAJOR_VERSION < 3
24148     Py_XDECREF(py_srcfile);
24149     #endif
24150     return NULL;
24151 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)24152 static void __Pyx_AddTraceback(const char *funcname, int c_line,
24153                                int py_line, const char *filename) {
24154     PyCodeObject *py_code = 0;
24155     PyFrameObject *py_frame = 0;
24156     PyThreadState *tstate = __Pyx_PyThreadState_Current;
24157     if (c_line) {
24158         c_line = __Pyx_CLineForTraceback(tstate, c_line);
24159     }
24160     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
24161     if (!py_code) {
24162         py_code = __Pyx_CreateCodeObjectForTraceback(
24163             funcname, c_line, py_line, filename);
24164         if (!py_code) goto bad;
24165         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
24166     }
24167     py_frame = PyFrame_New(
24168         tstate,            /*PyThreadState *tstate,*/
24169         py_code,           /*PyCodeObject *code,*/
24170         __pyx_d,    /*PyObject *globals,*/
24171         0                  /*PyObject *locals*/
24172     );
24173     if (!py_frame) goto bad;
24174     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
24175     PyTraceBack_Here(py_frame);
24176 bad:
24177     Py_XDECREF(py_code);
24178     Py_XDECREF(py_frame);
24179 }
24180 
24181 /* CIntFromPyVerify */
24182 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
24183     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
24184 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
24185     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
24186 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
24187     {\
24188         func_type value = func_value;\
24189         if (sizeof(target_type) < sizeof(func_type)) {\
24190             if (unlikely(value != (func_type) (target_type) value)) {\
24191                 func_type zero = 0;\
24192                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
24193                     return (target_type) -1;\
24194                 if (is_unsigned && unlikely(value < zero))\
24195                     goto raise_neg_overflow;\
24196                 else\
24197                     goto raise_overflow;\
24198             }\
24199         }\
24200         return (target_type) value;\
24201     }
24202 
24203 /* None */
__Pyx_pow_PY_LONG_LONG(PY_LONG_LONG b,PY_LONG_LONG e)24204 static CYTHON_INLINE PY_LONG_LONG __Pyx_pow_PY_LONG_LONG(PY_LONG_LONG b, PY_LONG_LONG e) {
24205     PY_LONG_LONG t = b;
24206     switch (e) {
24207         case 3:
24208             t *= b;
24209         CYTHON_FALLTHROUGH;
24210         case 2:
24211             t *= b;
24212         CYTHON_FALLTHROUGH;
24213         case 1:
24214             return t;
24215         case 0:
24216             return 1;
24217     }
24218     #if 1
24219     if (unlikely(e<0)) return 0;
24220     #endif
24221     t = 1;
24222     while (likely(e)) {
24223         t *= (b * (e&1)) | ((~e)&1);
24224         b *= b;
24225         e >>= 1;
24226     }
24227     return t;
24228 }
24229 
24230 /* None */
__Pyx_pow_int(int b,int e)24231 static CYTHON_INLINE int __Pyx_pow_int(int b, int e) {
24232     int t = b;
24233     switch (e) {
24234         case 3:
24235             t *= b;
24236         CYTHON_FALLTHROUGH;
24237         case 2:
24238             t *= b;
24239         CYTHON_FALLTHROUGH;
24240         case 1:
24241             return t;
24242         case 0:
24243             return 1;
24244     }
24245     #if 1
24246     if (unlikely(e<0)) return 0;
24247     #endif
24248     t = 1;
24249     while (likely(e)) {
24250         t *= (b * (e&1)) | ((~e)&1);
24251         b *= b;
24252         e >>= 1;
24253     }
24254     return t;
24255 }
24256 
24257 /* Declarations */
24258 #if CYTHON_CCOMPLEX
24259   #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)24260     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
24261       return ::std::complex< float >(x, y);
24262     }
24263   #else
__pyx_t_float_complex_from_parts(float x,float y)24264     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
24265       return x + y*(__pyx_t_float_complex)_Complex_I;
24266     }
24267   #endif
24268 #else
__pyx_t_float_complex_from_parts(float x,float y)24269     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
24270       __pyx_t_float_complex z;
24271       z.real = x;
24272       z.imag = y;
24273       return z;
24274     }
24275 #endif
24276 
24277 /* Arithmetic */
24278 #if CYTHON_CCOMPLEX
24279 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24280     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24281        return (a.real == b.real) && (a.imag == b.imag);
24282     }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24283     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24284         __pyx_t_float_complex z;
24285         z.real = a.real + b.real;
24286         z.imag = a.imag + b.imag;
24287         return z;
24288     }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24289     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24290         __pyx_t_float_complex z;
24291         z.real = a.real - b.real;
24292         z.imag = a.imag - b.imag;
24293         return z;
24294     }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24295     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24296         __pyx_t_float_complex z;
24297         z.real = a.real * b.real - a.imag * b.imag;
24298         z.imag = a.real * b.imag + a.imag * b.real;
24299         return z;
24300     }
24301     #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24302     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24303         if (b.imag == 0) {
24304             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
24305         } else if (fabsf(b.real) >= fabsf(b.imag)) {
24306             if (b.real == 0 && b.imag == 0) {
24307                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
24308             } else {
24309                 float r = b.imag / b.real;
24310                 float s = (float)(1.0) / (b.real + b.imag * r);
24311                 return __pyx_t_float_complex_from_parts(
24312                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
24313             }
24314         } else {
24315             float r = b.real / b.imag;
24316             float s = (float)(1.0) / (b.imag + b.real * r);
24317             return __pyx_t_float_complex_from_parts(
24318                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
24319         }
24320     }
24321     #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24322     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24323         if (b.imag == 0) {
24324             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
24325         } else {
24326             float denom = b.real * b.real + b.imag * b.imag;
24327             return __pyx_t_float_complex_from_parts(
24328                 (a.real * b.real + a.imag * b.imag) / denom,
24329                 (a.imag * b.real - a.real * b.imag) / denom);
24330         }
24331     }
24332     #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)24333     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
24334         __pyx_t_float_complex z;
24335         z.real = -a.real;
24336         z.imag = -a.imag;
24337         return z;
24338     }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)24339     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
24340        return (a.real == 0) && (a.imag == 0);
24341     }
__Pyx_c_conj_float(__pyx_t_float_complex a)24342     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
24343         __pyx_t_float_complex z;
24344         z.real =  a.real;
24345         z.imag = -a.imag;
24346         return z;
24347     }
24348     #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)24349         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
24350           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
24351             return sqrtf(z.real*z.real + z.imag*z.imag);
24352           #else
24353             return hypotf(z.real, z.imag);
24354           #endif
24355         }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)24356         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24357             __pyx_t_float_complex z;
24358             float r, lnr, theta, z_r, z_theta;
24359             if (b.imag == 0 && b.real == (int)b.real) {
24360                 if (b.real < 0) {
24361                     float denom = a.real * a.real + a.imag * a.imag;
24362                     a.real = a.real / denom;
24363                     a.imag = -a.imag / denom;
24364                     b.real = -b.real;
24365                 }
24366                 switch ((int)b.real) {
24367                     case 0:
24368                         z.real = 1;
24369                         z.imag = 0;
24370                         return z;
24371                     case 1:
24372                         return a;
24373                     case 2:
24374                         return __Pyx_c_prod_float(a, a);
24375                     case 3:
24376                         z = __Pyx_c_prod_float(a, a);
24377                         return __Pyx_c_prod_float(z, a);
24378                     case 4:
24379                         z = __Pyx_c_prod_float(a, a);
24380                         return __Pyx_c_prod_float(z, z);
24381                 }
24382             }
24383             if (a.imag == 0) {
24384                 if (a.real == 0) {
24385                     return a;
24386                 } else if (b.imag == 0) {
24387                     z.real = powf(a.real, b.real);
24388                     z.imag = 0;
24389                     return z;
24390                 } else if (a.real > 0) {
24391                     r = a.real;
24392                     theta = 0;
24393                 } else {
24394                     r = -a.real;
24395                     theta = atan2f(0.0, -1.0);
24396                 }
24397             } else {
24398                 r = __Pyx_c_abs_float(a);
24399                 theta = atan2f(a.imag, a.real);
24400             }
24401             lnr = logf(r);
24402             z_r = expf(lnr * b.real - theta * b.imag);
24403             z_theta = theta * b.real + lnr * b.imag;
24404             z.real = z_r * cosf(z_theta);
24405             z.imag = z_r * sinf(z_theta);
24406             return z;
24407         }
24408     #endif
24409 #endif
24410 
24411 /* Declarations */
24412 #if CYTHON_CCOMPLEX
24413   #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)24414     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
24415       return ::std::complex< double >(x, y);
24416     }
24417   #else
__pyx_t_double_complex_from_parts(double x,double y)24418     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
24419       return x + y*(__pyx_t_double_complex)_Complex_I;
24420     }
24421   #endif
24422 #else
__pyx_t_double_complex_from_parts(double x,double y)24423     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
24424       __pyx_t_double_complex z;
24425       z.real = x;
24426       z.imag = y;
24427       return z;
24428     }
24429 #endif
24430 
24431 /* Arithmetic */
24432 #if CYTHON_CCOMPLEX
24433 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)24434     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24435        return (a.real == b.real) && (a.imag == b.imag);
24436     }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)24437     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24438         __pyx_t_double_complex z;
24439         z.real = a.real + b.real;
24440         z.imag = a.imag + b.imag;
24441         return z;
24442     }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)24443     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24444         __pyx_t_double_complex z;
24445         z.real = a.real - b.real;
24446         z.imag = a.imag - b.imag;
24447         return z;
24448     }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)24449     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24450         __pyx_t_double_complex z;
24451         z.real = a.real * b.real - a.imag * b.imag;
24452         z.imag = a.real * b.imag + a.imag * b.real;
24453         return z;
24454     }
24455     #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)24456     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24457         if (b.imag == 0) {
24458             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
24459         } else if (fabs(b.real) >= fabs(b.imag)) {
24460             if (b.real == 0 && b.imag == 0) {
24461                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
24462             } else {
24463                 double r = b.imag / b.real;
24464                 double s = (double)(1.0) / (b.real + b.imag * r);
24465                 return __pyx_t_double_complex_from_parts(
24466                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
24467             }
24468         } else {
24469             double r = b.real / b.imag;
24470             double s = (double)(1.0) / (b.imag + b.real * r);
24471             return __pyx_t_double_complex_from_parts(
24472                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
24473         }
24474     }
24475     #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)24476     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24477         if (b.imag == 0) {
24478             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
24479         } else {
24480             double denom = b.real * b.real + b.imag * b.imag;
24481             return __pyx_t_double_complex_from_parts(
24482                 (a.real * b.real + a.imag * b.imag) / denom,
24483                 (a.imag * b.real - a.real * b.imag) / denom);
24484         }
24485     }
24486     #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)24487     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
24488         __pyx_t_double_complex z;
24489         z.real = -a.real;
24490         z.imag = -a.imag;
24491         return z;
24492     }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)24493     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
24494        return (a.real == 0) && (a.imag == 0);
24495     }
__Pyx_c_conj_double(__pyx_t_double_complex a)24496     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
24497         __pyx_t_double_complex z;
24498         z.real =  a.real;
24499         z.imag = -a.imag;
24500         return z;
24501     }
24502     #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)24503         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
24504           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
24505             return sqrt(z.real*z.real + z.imag*z.imag);
24506           #else
24507             return hypot(z.real, z.imag);
24508           #endif
24509         }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)24510         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24511             __pyx_t_double_complex z;
24512             double r, lnr, theta, z_r, z_theta;
24513             if (b.imag == 0 && b.real == (int)b.real) {
24514                 if (b.real < 0) {
24515                     double denom = a.real * a.real + a.imag * a.imag;
24516                     a.real = a.real / denom;
24517                     a.imag = -a.imag / denom;
24518                     b.real = -b.real;
24519                 }
24520                 switch ((int)b.real) {
24521                     case 0:
24522                         z.real = 1;
24523                         z.imag = 0;
24524                         return z;
24525                     case 1:
24526                         return a;
24527                     case 2:
24528                         return __Pyx_c_prod_double(a, a);
24529                     case 3:
24530                         z = __Pyx_c_prod_double(a, a);
24531                         return __Pyx_c_prod_double(z, a);
24532                     case 4:
24533                         z = __Pyx_c_prod_double(a, a);
24534                         return __Pyx_c_prod_double(z, z);
24535                 }
24536             }
24537             if (a.imag == 0) {
24538                 if (a.real == 0) {
24539                     return a;
24540                 } else if (b.imag == 0) {
24541                     z.real = pow(a.real, b.real);
24542                     z.imag = 0;
24543                     return z;
24544                 } else if (a.real > 0) {
24545                     r = a.real;
24546                     theta = 0;
24547                 } else {
24548                     r = -a.real;
24549                     theta = atan2(0.0, -1.0);
24550                 }
24551             } else {
24552                 r = __Pyx_c_abs_double(a);
24553                 theta = atan2(a.imag, a.real);
24554             }
24555             lnr = log(r);
24556             z_r = exp(lnr * b.real - theta * b.imag);
24557             z_theta = theta * b.real + lnr * b.imag;
24558             z.real = z_r * cos(z_theta);
24559             z.imag = z_r * sin(z_theta);
24560             return z;
24561         }
24562     #endif
24563 #endif
24564 
24565 /* CIntToPy */
__Pyx_PyInt_From_int(int value)24566 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
24567 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24568 #pragma GCC diagnostic push
24569 #pragma GCC diagnostic ignored "-Wconversion"
24570 #endif
24571     const int neg_one = (int) -1, const_zero = (int) 0;
24572 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24573 #pragma GCC diagnostic pop
24574 #endif
24575     const int is_unsigned = neg_one > const_zero;
24576     if (is_unsigned) {
24577         if (sizeof(int) < sizeof(long)) {
24578             return PyInt_FromLong((long) value);
24579         } else if (sizeof(int) <= sizeof(unsigned long)) {
24580             return PyLong_FromUnsignedLong((unsigned long) value);
24581 #ifdef HAVE_LONG_LONG
24582         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
24583             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
24584 #endif
24585         }
24586     } else {
24587         if (sizeof(int) <= sizeof(long)) {
24588             return PyInt_FromLong((long) value);
24589 #ifdef HAVE_LONG_LONG
24590         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
24591             return PyLong_FromLongLong((PY_LONG_LONG) value);
24592 #endif
24593         }
24594     }
24595     {
24596         int one = 1; int little = (int)*(unsigned char *)&one;
24597         unsigned char *bytes = (unsigned char *)&value;
24598         return _PyLong_FromByteArray(bytes, sizeof(int),
24599                                      little, !is_unsigned);
24600     }
24601 }
24602 
24603 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)24604 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
24605 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24606 #pragma GCC diagnostic push
24607 #pragma GCC diagnostic ignored "-Wconversion"
24608 #endif
24609     const int neg_one = (int) -1, const_zero = (int) 0;
24610 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24611 #pragma GCC diagnostic pop
24612 #endif
24613     const int is_unsigned = neg_one > const_zero;
24614 #if PY_MAJOR_VERSION < 3
24615     if (likely(PyInt_Check(x))) {
24616         if (sizeof(int) < sizeof(long)) {
24617             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
24618         } else {
24619             long val = PyInt_AS_LONG(x);
24620             if (is_unsigned && unlikely(val < 0)) {
24621                 goto raise_neg_overflow;
24622             }
24623             return (int) val;
24624         }
24625     } else
24626 #endif
24627     if (likely(PyLong_Check(x))) {
24628         if (is_unsigned) {
24629 #if CYTHON_USE_PYLONG_INTERNALS
24630             const digit* digits = ((PyLongObject*)x)->ob_digit;
24631             switch (Py_SIZE(x)) {
24632                 case  0: return (int) 0;
24633                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
24634                 case 2:
24635                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
24636                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24637                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24638                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
24639                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24640                         }
24641                     }
24642                     break;
24643                 case 3:
24644                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
24645                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24646                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24647                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
24648                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24649                         }
24650                     }
24651                     break;
24652                 case 4:
24653                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
24654                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24655                             __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])))
24656                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
24657                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24658                         }
24659                     }
24660                     break;
24661             }
24662 #endif
24663 #if CYTHON_COMPILING_IN_CPYTHON
24664             if (unlikely(Py_SIZE(x) < 0)) {
24665                 goto raise_neg_overflow;
24666             }
24667 #else
24668             {
24669                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
24670                 if (unlikely(result < 0))
24671                     return (int) -1;
24672                 if (unlikely(result == 1))
24673                     goto raise_neg_overflow;
24674             }
24675 #endif
24676             if (sizeof(int) <= sizeof(unsigned long)) {
24677                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
24678 #ifdef HAVE_LONG_LONG
24679             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
24680                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
24681 #endif
24682             }
24683         } else {
24684 #if CYTHON_USE_PYLONG_INTERNALS
24685             const digit* digits = ((PyLongObject*)x)->ob_digit;
24686             switch (Py_SIZE(x)) {
24687                 case  0: return (int) 0;
24688                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
24689                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
24690                 case -2:
24691                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
24692                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24693                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24694                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
24695                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24696                         }
24697                     }
24698                     break;
24699                 case 2:
24700                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
24701                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24702                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24703                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
24704                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24705                         }
24706                     }
24707                     break;
24708                 case -3:
24709                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
24710                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24711                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24712                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
24713                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24714                         }
24715                     }
24716                     break;
24717                 case 3:
24718                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
24719                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24720                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24721                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
24722                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24723                         }
24724                     }
24725                     break;
24726                 case -4:
24727                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
24728                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24729                             __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])))
24730                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
24731                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24732                         }
24733                     }
24734                     break;
24735                 case 4:
24736                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
24737                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24738                             __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])))
24739                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
24740                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24741                         }
24742                     }
24743                     break;
24744             }
24745 #endif
24746             if (sizeof(int) <= sizeof(long)) {
24747                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
24748 #ifdef HAVE_LONG_LONG
24749             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
24750                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
24751 #endif
24752             }
24753         }
24754         {
24755 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
24756             PyErr_SetString(PyExc_RuntimeError,
24757                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
24758 #else
24759             int val;
24760             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
24761  #if PY_MAJOR_VERSION < 3
24762             if (likely(v) && !PyLong_Check(v)) {
24763                 PyObject *tmp = v;
24764                 v = PyNumber_Long(tmp);
24765                 Py_DECREF(tmp);
24766             }
24767  #endif
24768             if (likely(v)) {
24769                 int one = 1; int is_little = (int)*(unsigned char *)&one;
24770                 unsigned char *bytes = (unsigned char *)&val;
24771                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
24772                                               bytes, sizeof(val),
24773                                               is_little, !is_unsigned);
24774                 Py_DECREF(v);
24775                 if (likely(!ret))
24776                     return val;
24777             }
24778 #endif
24779             return (int) -1;
24780         }
24781     } else {
24782         int val;
24783         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
24784         if (!tmp) return (int) -1;
24785         val = __Pyx_PyInt_As_int(tmp);
24786         Py_DECREF(tmp);
24787         return val;
24788     }
24789 raise_overflow:
24790     PyErr_SetString(PyExc_OverflowError,
24791         "value too large to convert to int");
24792     return (int) -1;
24793 raise_neg_overflow:
24794     PyErr_SetString(PyExc_OverflowError,
24795         "can't convert negative value to int");
24796     return (int) -1;
24797 }
24798 
24799 /* CIntToPy */
__Pyx_PyInt_From_long(long value)24800 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
24801 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24802 #pragma GCC diagnostic push
24803 #pragma GCC diagnostic ignored "-Wconversion"
24804 #endif
24805     const long neg_one = (long) -1, const_zero = (long) 0;
24806 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24807 #pragma GCC diagnostic pop
24808 #endif
24809     const int is_unsigned = neg_one > const_zero;
24810     if (is_unsigned) {
24811         if (sizeof(long) < sizeof(long)) {
24812             return PyInt_FromLong((long) value);
24813         } else if (sizeof(long) <= sizeof(unsigned long)) {
24814             return PyLong_FromUnsignedLong((unsigned long) value);
24815 #ifdef HAVE_LONG_LONG
24816         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
24817             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
24818 #endif
24819         }
24820     } else {
24821         if (sizeof(long) <= sizeof(long)) {
24822             return PyInt_FromLong((long) value);
24823 #ifdef HAVE_LONG_LONG
24824         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
24825             return PyLong_FromLongLong((PY_LONG_LONG) value);
24826 #endif
24827         }
24828     }
24829     {
24830         int one = 1; int little = (int)*(unsigned char *)&one;
24831         unsigned char *bytes = (unsigned char *)&value;
24832         return _PyLong_FromByteArray(bytes, sizeof(long),
24833                                      little, !is_unsigned);
24834     }
24835 }
24836 
24837 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)24838 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
24839 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24840 #pragma GCC diagnostic push
24841 #pragma GCC diagnostic ignored "-Wconversion"
24842 #endif
24843     const long neg_one = (long) -1, const_zero = (long) 0;
24844 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24845 #pragma GCC diagnostic pop
24846 #endif
24847     const int is_unsigned = neg_one > const_zero;
24848 #if PY_MAJOR_VERSION < 3
24849     if (likely(PyInt_Check(x))) {
24850         if (sizeof(long) < sizeof(long)) {
24851             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
24852         } else {
24853             long val = PyInt_AS_LONG(x);
24854             if (is_unsigned && unlikely(val < 0)) {
24855                 goto raise_neg_overflow;
24856             }
24857             return (long) val;
24858         }
24859     } else
24860 #endif
24861     if (likely(PyLong_Check(x))) {
24862         if (is_unsigned) {
24863 #if CYTHON_USE_PYLONG_INTERNALS
24864             const digit* digits = ((PyLongObject*)x)->ob_digit;
24865             switch (Py_SIZE(x)) {
24866                 case  0: return (long) 0;
24867                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
24868                 case 2:
24869                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
24870                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24871                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24872                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
24873                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
24874                         }
24875                     }
24876                     break;
24877                 case 3:
24878                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
24879                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24880                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24881                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
24882                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
24883                         }
24884                     }
24885                     break;
24886                 case 4:
24887                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
24888                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24889                             __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])))
24890                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
24891                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
24892                         }
24893                     }
24894                     break;
24895             }
24896 #endif
24897 #if CYTHON_COMPILING_IN_CPYTHON
24898             if (unlikely(Py_SIZE(x) < 0)) {
24899                 goto raise_neg_overflow;
24900             }
24901 #else
24902             {
24903                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
24904                 if (unlikely(result < 0))
24905                     return (long) -1;
24906                 if (unlikely(result == 1))
24907                     goto raise_neg_overflow;
24908             }
24909 #endif
24910             if (sizeof(long) <= sizeof(unsigned long)) {
24911                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
24912 #ifdef HAVE_LONG_LONG
24913             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
24914                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
24915 #endif
24916             }
24917         } else {
24918 #if CYTHON_USE_PYLONG_INTERNALS
24919             const digit* digits = ((PyLongObject*)x)->ob_digit;
24920             switch (Py_SIZE(x)) {
24921                 case  0: return (long) 0;
24922                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
24923                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
24924                 case -2:
24925                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
24926                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24927                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24928                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24929                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24930                         }
24931                     }
24932                     break;
24933                 case 2:
24934                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
24935                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24936                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24937                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24938                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24939                         }
24940                     }
24941                     break;
24942                 case -3:
24943                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24944                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24945                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24946                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24947                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24948                         }
24949                     }
24950                     break;
24951                 case 3:
24952                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
24953                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24954                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24955                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24956                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24957                         }
24958                     }
24959                     break;
24960                 case -4:
24961                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24962                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24963                             __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])))
24964                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24965                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24966                         }
24967                     }
24968                     break;
24969                 case 4:
24970                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
24971                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24972                             __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])))
24973                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24974                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24975                         }
24976                     }
24977                     break;
24978             }
24979 #endif
24980             if (sizeof(long) <= sizeof(long)) {
24981                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
24982 #ifdef HAVE_LONG_LONG
24983             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
24984                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
24985 #endif
24986             }
24987         }
24988         {
24989 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
24990             PyErr_SetString(PyExc_RuntimeError,
24991                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
24992 #else
24993             long val;
24994             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
24995  #if PY_MAJOR_VERSION < 3
24996             if (likely(v) && !PyLong_Check(v)) {
24997                 PyObject *tmp = v;
24998                 v = PyNumber_Long(tmp);
24999                 Py_DECREF(tmp);
25000             }
25001  #endif
25002             if (likely(v)) {
25003                 int one = 1; int is_little = (int)*(unsigned char *)&one;
25004                 unsigned char *bytes = (unsigned char *)&val;
25005                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
25006                                               bytes, sizeof(val),
25007                                               is_little, !is_unsigned);
25008                 Py_DECREF(v);
25009                 if (likely(!ret))
25010                     return val;
25011             }
25012 #endif
25013             return (long) -1;
25014         }
25015     } else {
25016         long val;
25017         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
25018         if (!tmp) return (long) -1;
25019         val = __Pyx_PyInt_As_long(tmp);
25020         Py_DECREF(tmp);
25021         return val;
25022     }
25023 raise_overflow:
25024     PyErr_SetString(PyExc_OverflowError,
25025         "value too large to convert to long");
25026     return (long) -1;
25027 raise_neg_overflow:
25028     PyErr_SetString(PyExc_OverflowError,
25029         "can't convert negative value to long");
25030     return (long) -1;
25031 }
25032 
25033 /* CIntToPy */
__Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value)25034 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value) {
25035 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
25036 #pragma GCC diagnostic push
25037 #pragma GCC diagnostic ignored "-Wconversion"
25038 #endif
25039     const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
25040 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
25041 #pragma GCC diagnostic pop
25042 #endif
25043     const int is_unsigned = neg_one > const_zero;
25044     if (is_unsigned) {
25045         if (sizeof(PY_LONG_LONG) < sizeof(long)) {
25046             return PyInt_FromLong((long) value);
25047         } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
25048             return PyLong_FromUnsignedLong((unsigned long) value);
25049 #ifdef HAVE_LONG_LONG
25050         } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
25051             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
25052 #endif
25053         }
25054     } else {
25055         if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
25056             return PyInt_FromLong((long) value);
25057 #ifdef HAVE_LONG_LONG
25058         } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
25059             return PyLong_FromLongLong((PY_LONG_LONG) value);
25060 #endif
25061         }
25062     }
25063     {
25064         int one = 1; int little = (int)*(unsigned char *)&one;
25065         unsigned char *bytes = (unsigned char *)&value;
25066         return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG),
25067                                      little, !is_unsigned);
25068     }
25069 }
25070 
25071 /* CIntFromPy */
__Pyx_PyInt_As_PY_LONG_LONG(PyObject * x)25072 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *x) {
25073 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
25074 #pragma GCC diagnostic push
25075 #pragma GCC diagnostic ignored "-Wconversion"
25076 #endif
25077     const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
25078 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
25079 #pragma GCC diagnostic pop
25080 #endif
25081     const int is_unsigned = neg_one > const_zero;
25082 #if PY_MAJOR_VERSION < 3
25083     if (likely(PyInt_Check(x))) {
25084         if (sizeof(PY_LONG_LONG) < sizeof(long)) {
25085             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyInt_AS_LONG(x))
25086         } else {
25087             long val = PyInt_AS_LONG(x);
25088             if (is_unsigned && unlikely(val < 0)) {
25089                 goto raise_neg_overflow;
25090             }
25091             return (PY_LONG_LONG) val;
25092         }
25093     } else
25094 #endif
25095     if (likely(PyLong_Check(x))) {
25096         if (is_unsigned) {
25097 #if CYTHON_USE_PYLONG_INTERNALS
25098             const digit* digits = ((PyLongObject*)x)->ob_digit;
25099             switch (Py_SIZE(x)) {
25100                 case  0: return (PY_LONG_LONG) 0;
25101                 case  1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, digit, digits[0])
25102                 case 2:
25103                     if (8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT) {
25104                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
25105                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25106                         } else if (8 * sizeof(PY_LONG_LONG) >= 2 * PyLong_SHIFT) {
25107                             return (PY_LONG_LONG) (((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
25108                         }
25109                     }
25110                     break;
25111                 case 3:
25112                     if (8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT) {
25113                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
25114                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25115                         } else if (8 * sizeof(PY_LONG_LONG) >= 3 * PyLong_SHIFT) {
25116                             return (PY_LONG_LONG) (((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
25117                         }
25118                     }
25119                     break;
25120                 case 4:
25121                     if (8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT) {
25122                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
25123                             __PYX_VERIFY_RETURN_INT(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])))
25124                         } else if (8 * sizeof(PY_LONG_LONG) >= 4 * PyLong_SHIFT) {
25125                             return (PY_LONG_LONG) (((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
25126                         }
25127                     }
25128                     break;
25129             }
25130 #endif
25131 #if CYTHON_COMPILING_IN_CPYTHON
25132             if (unlikely(Py_SIZE(x) < 0)) {
25133                 goto raise_neg_overflow;
25134             }
25135 #else
25136             {
25137                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
25138                 if (unlikely(result < 0))
25139                     return (PY_LONG_LONG) -1;
25140                 if (unlikely(result == 1))
25141                     goto raise_neg_overflow;
25142             }
25143 #endif
25144             if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
25145                 __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x))
25146 #ifdef HAVE_LONG_LONG
25147             } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
25148                 __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
25149 #endif
25150             }
25151         } else {
25152 #if CYTHON_USE_PYLONG_INTERNALS
25153             const digit* digits = ((PyLongObject*)x)->ob_digit;
25154             switch (Py_SIZE(x)) {
25155                 case  0: return (PY_LONG_LONG) 0;
25156                 case -1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, sdigit, (sdigit) (-(sdigit)digits[0]))
25157                 case  1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG,  digit, +digits[0])
25158                 case -2:
25159                     if (8 * sizeof(PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT) {
25160                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
25161                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25162                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25163                             return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
25164                         }
25165                     }
25166                     break;
25167                 case 2:
25168                     if (8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT) {
25169                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
25170                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25171                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25172                             return (PY_LONG_LONG) ((((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
25173                         }
25174                     }
25175                     break;
25176                 case -3:
25177                     if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25178                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
25179                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25180                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25181                             return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
25182                         }
25183                     }
25184                     break;
25185                 case 3:
25186                     if (8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT) {
25187                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
25188                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25189                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25190                             return (PY_LONG_LONG) ((((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
25191                         }
25192                     }
25193                     break;
25194                 case -4:
25195                     if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25196                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
25197                             __PYX_VERIFY_RETURN_INT(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])))
25198                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25199                             return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
25200                         }
25201                     }
25202                     break;
25203                 case 4:
25204                     if (8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT) {
25205                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
25206                             __PYX_VERIFY_RETURN_INT(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])))
25207                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25208                             return (PY_LONG_LONG) ((((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
25209                         }
25210                     }
25211                     break;
25212             }
25213 #endif
25214             if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
25215                 __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, long, PyLong_AsLong(x))
25216 #ifdef HAVE_LONG_LONG
25217             } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
25218                 __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x))
25219 #endif
25220             }
25221         }
25222         {
25223 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
25224             PyErr_SetString(PyExc_RuntimeError,
25225                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
25226 #else
25227             PY_LONG_LONG val;
25228             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
25229  #if PY_MAJOR_VERSION < 3
25230             if (likely(v) && !PyLong_Check(v)) {
25231                 PyObject *tmp = v;
25232                 v = PyNumber_Long(tmp);
25233                 Py_DECREF(tmp);
25234             }
25235  #endif
25236             if (likely(v)) {
25237                 int one = 1; int is_little = (int)*(unsigned char *)&one;
25238                 unsigned char *bytes = (unsigned char *)&val;
25239                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
25240                                               bytes, sizeof(val),
25241                                               is_little, !is_unsigned);
25242                 Py_DECREF(v);
25243                 if (likely(!ret))
25244                     return val;
25245             }
25246 #endif
25247             return (PY_LONG_LONG) -1;
25248         }
25249     } else {
25250         PY_LONG_LONG val;
25251         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
25252         if (!tmp) return (PY_LONG_LONG) -1;
25253         val = __Pyx_PyInt_As_PY_LONG_LONG(tmp);
25254         Py_DECREF(tmp);
25255         return val;
25256     }
25257 raise_overflow:
25258     PyErr_SetString(PyExc_OverflowError,
25259         "value too large to convert to PY_LONG_LONG");
25260     return (PY_LONG_LONG) -1;
25261 raise_neg_overflow:
25262     PyErr_SetString(PyExc_OverflowError,
25263         "can't convert negative value to PY_LONG_LONG");
25264     return (PY_LONG_LONG) -1;
25265 }
25266 
25267 /* FastTypeChecks */
25268 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)25269 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25270     while (a) {
25271         a = a->tp_base;
25272         if (a == b)
25273             return 1;
25274     }
25275     return b == &PyBaseObject_Type;
25276 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)25277 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25278     PyObject *mro;
25279     if (a == b) return 1;
25280     mro = a->tp_mro;
25281     if (likely(mro)) {
25282         Py_ssize_t i, n;
25283         n = PyTuple_GET_SIZE(mro);
25284         for (i = 0; i < n; i++) {
25285             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25286                 return 1;
25287         }
25288         return 0;
25289     }
25290     return __Pyx_InBases(a, b);
25291 }
25292 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)25293 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25294     PyObject *exception, *value, *tb;
25295     int res;
25296     __Pyx_PyThreadState_declare
25297     __Pyx_PyThreadState_assign
25298     __Pyx_ErrFetch(&exception, &value, &tb);
25299     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25300     if (unlikely(res == -1)) {
25301         PyErr_WriteUnraisable(err);
25302         res = 0;
25303     }
25304     if (!res) {
25305         res = PyObject_IsSubclass(err, exc_type2);
25306         if (unlikely(res == -1)) {
25307             PyErr_WriteUnraisable(err);
25308             res = 0;
25309         }
25310     }
25311     __Pyx_ErrRestore(exception, value, tb);
25312     return res;
25313 }
25314 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)25315 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25316     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25317     if (!res) {
25318         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25319     }
25320     return res;
25321 }
25322 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)25323 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25324     Py_ssize_t i, n;
25325     assert(PyExceptionClass_Check(exc_type));
25326     n = PyTuple_GET_SIZE(tuple);
25327 #if PY_MAJOR_VERSION >= 3
25328     for (i=0; i<n; i++) {
25329         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25330     }
25331 #endif
25332     for (i=0; i<n; i++) {
25333         PyObject *t = PyTuple_GET_ITEM(tuple, i);
25334         #if PY_MAJOR_VERSION < 3
25335         if (likely(exc_type == t)) return 1;
25336         #endif
25337         if (likely(PyExceptionClass_Check(t))) {
25338             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
25339         } else {
25340         }
25341     }
25342     return 0;
25343 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)25344 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25345     if (likely(err == exc_type)) return 1;
25346     if (likely(PyExceptionClass_Check(err))) {
25347         if (likely(PyExceptionClass_Check(exc_type))) {
25348             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25349         } else if (likely(PyTuple_Check(exc_type))) {
25350             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25351         } else {
25352         }
25353     }
25354     return PyErr_GivenExceptionMatches(err, exc_type);
25355 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)25356 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25357     assert(PyExceptionClass_Check(exc_type1));
25358     assert(PyExceptionClass_Check(exc_type2));
25359     if (likely(err == exc_type1 || err == exc_type2)) return 1;
25360     if (likely(PyExceptionClass_Check(err))) {
25361         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25362     }
25363     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25364 }
25365 #endif
25366 
25367 /* CStringEquals */
__Pyx_StrEq(const char * s1,const char * s2)25368 static CYTHON_INLINE int __Pyx_StrEq(const char *s1, const char *s2) {
25369     while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
25370     return *s1 == *s2;
25371 }
25372 
25373 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)25374 static int __Pyx_check_binary_version(void) {
25375     char ctversion[4], rtversion[4];
25376     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
25377     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
25378     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
25379         char message[200];
25380         PyOS_snprintf(message, sizeof(message),
25381                       "compiletime version %s of module '%.100s' "
25382                       "does not match runtime version %s",
25383                       ctversion, __Pyx_MODULE_NAME, rtversion);
25384         return PyErr_WarnEx(NULL, message, 1);
25385     }
25386     return 0;
25387 }
25388 
25389 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)25390 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
25391     while (t->p) {
25392         #if PY_MAJOR_VERSION < 3
25393         if (t->is_unicode) {
25394             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
25395         } else if (t->intern) {
25396             *t->p = PyString_InternFromString(t->s);
25397         } else {
25398             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
25399         }
25400         #else
25401         if (t->is_unicode | t->is_str) {
25402             if (t->intern) {
25403                 *t->p = PyUnicode_InternFromString(t->s);
25404             } else if (t->encoding) {
25405                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
25406             } else {
25407                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
25408             }
25409         } else {
25410             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
25411         }
25412         #endif
25413         if (!*t->p)
25414             return -1;
25415         if (PyObject_Hash(*t->p) == -1)
25416             return -1;
25417         ++t;
25418     }
25419     return 0;
25420 }
25421 
__Pyx_PyUnicode_FromString(const char * c_str)25422 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
25423     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
25424 }
__Pyx_PyObject_AsString(PyObject * o)25425 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
25426     Py_ssize_t ignore;
25427     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
25428 }
25429 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
25430 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)25431 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25432     char* defenc_c;
25433     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
25434     if (!defenc) return NULL;
25435     defenc_c = PyBytes_AS_STRING(defenc);
25436 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25437     {
25438         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
25439         char* c;
25440         for (c = defenc_c; c < end; c++) {
25441             if ((unsigned char) (*c) >= 128) {
25442                 PyUnicode_AsASCIIString(o);
25443                 return NULL;
25444             }
25445         }
25446     }
25447 #endif
25448     *length = PyBytes_GET_SIZE(defenc);
25449     return defenc_c;
25450 }
25451 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)25452 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25453     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
25454 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25455     if (likely(PyUnicode_IS_ASCII(o))) {
25456         *length = PyUnicode_GET_LENGTH(o);
25457         return PyUnicode_AsUTF8(o);
25458     } else {
25459         PyUnicode_AsASCIIString(o);
25460         return NULL;
25461     }
25462 #else
25463     return PyUnicode_AsUTF8AndSize(o, length);
25464 #endif
25465 }
25466 #endif
25467 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)25468 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25469 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
25470     if (
25471 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25472             __Pyx_sys_getdefaultencoding_not_ascii &&
25473 #endif
25474             PyUnicode_Check(o)) {
25475         return __Pyx_PyUnicode_AsStringAndSize(o, length);
25476     } else
25477 #endif
25478 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
25479     if (PyByteArray_Check(o)) {
25480         *length = PyByteArray_GET_SIZE(o);
25481         return PyByteArray_AS_STRING(o);
25482     } else
25483 #endif
25484     {
25485         char* result;
25486         int r = PyBytes_AsStringAndSize(o, &result, length);
25487         if (unlikely(r < 0)) {
25488             return NULL;
25489         } else {
25490             return result;
25491         }
25492     }
25493 }
__Pyx_PyObject_IsTrue(PyObject * x)25494 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
25495    int is_true = x == Py_True;
25496    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
25497    else return PyObject_IsTrue(x);
25498 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)25499 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
25500     int retval;
25501     if (unlikely(!x)) return -1;
25502     retval = __Pyx_PyObject_IsTrue(x);
25503     Py_DECREF(x);
25504     return retval;
25505 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)25506 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
25507 #if PY_MAJOR_VERSION >= 3
25508     if (PyLong_Check(result)) {
25509         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
25510                 "__int__ returned non-int (type %.200s).  "
25511                 "The ability to return an instance of a strict subclass of int "
25512                 "is deprecated, and may be removed in a future version of Python.",
25513                 Py_TYPE(result)->tp_name)) {
25514             Py_DECREF(result);
25515             return NULL;
25516         }
25517         return result;
25518     }
25519 #endif
25520     PyErr_Format(PyExc_TypeError,
25521                  "__%.4s__ returned non-%.4s (type %.200s)",
25522                  type_name, type_name, Py_TYPE(result)->tp_name);
25523     Py_DECREF(result);
25524     return NULL;
25525 }
__Pyx_PyNumber_IntOrLong(PyObject * x)25526 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
25527 #if CYTHON_USE_TYPE_SLOTS
25528   PyNumberMethods *m;
25529 #endif
25530   const char *name = NULL;
25531   PyObject *res = NULL;
25532 #if PY_MAJOR_VERSION < 3
25533   if (likely(PyInt_Check(x) || PyLong_Check(x)))
25534 #else
25535   if (likely(PyLong_Check(x)))
25536 #endif
25537     return __Pyx_NewRef(x);
25538 #if CYTHON_USE_TYPE_SLOTS
25539   m = Py_TYPE(x)->tp_as_number;
25540   #if PY_MAJOR_VERSION < 3
25541   if (m && m->nb_int) {
25542     name = "int";
25543     res = m->nb_int(x);
25544   }
25545   else if (m && m->nb_long) {
25546     name = "long";
25547     res = m->nb_long(x);
25548   }
25549   #else
25550   if (likely(m && m->nb_int)) {
25551     name = "int";
25552     res = m->nb_int(x);
25553   }
25554   #endif
25555 #else
25556   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
25557     res = PyNumber_Int(x);
25558   }
25559 #endif
25560   if (likely(res)) {
25561 #if PY_MAJOR_VERSION < 3
25562     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
25563 #else
25564     if (unlikely(!PyLong_CheckExact(res))) {
25565 #endif
25566         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
25567     }
25568   }
25569   else if (!PyErr_Occurred()) {
25570     PyErr_SetString(PyExc_TypeError,
25571                     "an integer is required");
25572   }
25573   return res;
25574 }
25575 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
25576   Py_ssize_t ival;
25577   PyObject *x;
25578 #if PY_MAJOR_VERSION < 3
25579   if (likely(PyInt_CheckExact(b))) {
25580     if (sizeof(Py_ssize_t) >= sizeof(long))
25581         return PyInt_AS_LONG(b);
25582     else
25583         return PyInt_AsSsize_t(b);
25584   }
25585 #endif
25586   if (likely(PyLong_CheckExact(b))) {
25587     #if CYTHON_USE_PYLONG_INTERNALS
25588     const digit* digits = ((PyLongObject*)b)->ob_digit;
25589     const Py_ssize_t size = Py_SIZE(b);
25590     if (likely(__Pyx_sst_abs(size) <= 1)) {
25591         ival = likely(size) ? digits[0] : 0;
25592         if (size == -1) ival = -ival;
25593         return ival;
25594     } else {
25595       switch (size) {
25596          case 2:
25597            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
25598              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25599            }
25600            break;
25601          case -2:
25602            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
25603              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25604            }
25605            break;
25606          case 3:
25607            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
25608              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25609            }
25610            break;
25611          case -3:
25612            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
25613              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25614            }
25615            break;
25616          case 4:
25617            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
25618              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]));
25619            }
25620            break;
25621          case -4:
25622            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
25623              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]));
25624            }
25625            break;
25626       }
25627     }
25628     #endif
25629     return PyLong_AsSsize_t(b);
25630   }
25631   x = PyNumber_Index(b);
25632   if (!x) return -1;
25633   ival = PyInt_AsSsize_t(x);
25634   Py_DECREF(x);
25635   return ival;
25636 }
25637 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
25638   if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
25639     return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
25640 #if PY_MAJOR_VERSION < 3
25641   } else if (likely(PyInt_CheckExact(o))) {
25642     return PyInt_AS_LONG(o);
25643 #endif
25644   } else {
25645     Py_ssize_t ival;
25646     PyObject *x;
25647     x = PyNumber_Index(o);
25648     if (!x) return -1;
25649     ival = PyInt_AsLong(x);
25650     Py_DECREF(x);
25651     return ival;
25652   }
25653 }
25654 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
25655   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
25656 }
25657 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
25658     return PyInt_FromSize_t(ival);
25659 }
25660 
25661 
25662 #endif /* Py_PYTHON_H */
25663