1 /* Generated by Cython 0.29.13 */
2 
3 /* BEGIN: Cython Metadata
4 {
5     "distutils": {
6         "depends": [
7             "/home/evan/.conda/envs/skbio/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h",
8             "/home/evan/.conda/envs/skbio/lib/python3.7/site-packages/numpy/core/include/numpy/ufuncobject.h"
9         ],
10         "include_dirs": [
11             "/home/evan/.conda/envs/skbio/lib/python3.7/site-packages/numpy/core/include"
12         ],
13         "name": "skbio.stats.__subsample",
14         "sources": [
15             "skbio/stats/__subsample.pyx"
16         ]
17     },
18     "module_name": "skbio.stats.__subsample"
19 }
20 END: Cython Metadata */
21 
22 #define PY_SSIZE_T_CLEAN
23 #include "Python.h"
24 #ifndef Py_PYTHON_H
25     #error Python headers needed to compile C extensions, please install development version of Python.
26 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
27     #error Cython requires Python 2.6+ or Python 3.3+.
28 #else
29 #define CYTHON_ABI "0_29_13"
30 #define CYTHON_HEX_VERSION 0x001D0DF0
31 #define CYTHON_FUTURE_DIVISION 0
32 #include <stddef.h>
33 #ifndef offsetof
34   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
35 #endif
36 #if !defined(WIN32) && !defined(MS_WINDOWS)
37   #ifndef __stdcall
38     #define __stdcall
39   #endif
40   #ifndef __cdecl
41     #define __cdecl
42   #endif
43   #ifndef __fastcall
44     #define __fastcall
45   #endif
46 #endif
47 #ifndef DL_IMPORT
48   #define DL_IMPORT(t) t
49 #endif
50 #ifndef DL_EXPORT
51   #define DL_EXPORT(t) t
52 #endif
53 #define __PYX_COMMA ,
54 #ifndef HAVE_LONG_LONG
55   #if PY_VERSION_HEX >= 0x02070000
56     #define HAVE_LONG_LONG
57   #endif
58 #endif
59 #ifndef PY_LONG_LONG
60   #define PY_LONG_LONG LONG_LONG
61 #endif
62 #ifndef Py_HUGE_VAL
63   #define Py_HUGE_VAL HUGE_VAL
64 #endif
65 #ifdef PYPY_VERSION
66   #define CYTHON_COMPILING_IN_PYPY 1
67   #define CYTHON_COMPILING_IN_PYSTON 0
68   #define CYTHON_COMPILING_IN_CPYTHON 0
69   #undef CYTHON_USE_TYPE_SLOTS
70   #define CYTHON_USE_TYPE_SLOTS 0
71   #undef CYTHON_USE_PYTYPE_LOOKUP
72   #define CYTHON_USE_PYTYPE_LOOKUP 0
73   #if PY_VERSION_HEX < 0x03050000
74     #undef CYTHON_USE_ASYNC_SLOTS
75     #define CYTHON_USE_ASYNC_SLOTS 0
76   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
77     #define CYTHON_USE_ASYNC_SLOTS 1
78   #endif
79   #undef CYTHON_USE_PYLIST_INTERNALS
80   #define CYTHON_USE_PYLIST_INTERNALS 0
81   #undef CYTHON_USE_UNICODE_INTERNALS
82   #define CYTHON_USE_UNICODE_INTERNALS 0
83   #undef CYTHON_USE_UNICODE_WRITER
84   #define CYTHON_USE_UNICODE_WRITER 0
85   #undef CYTHON_USE_PYLONG_INTERNALS
86   #define CYTHON_USE_PYLONG_INTERNALS 0
87   #undef CYTHON_AVOID_BORROWED_REFS
88   #define CYTHON_AVOID_BORROWED_REFS 1
89   #undef CYTHON_ASSUME_SAFE_MACROS
90   #define CYTHON_ASSUME_SAFE_MACROS 0
91   #undef CYTHON_UNPACK_METHODS
92   #define CYTHON_UNPACK_METHODS 0
93   #undef CYTHON_FAST_THREAD_STATE
94   #define CYTHON_FAST_THREAD_STATE 0
95   #undef CYTHON_FAST_PYCALL
96   #define CYTHON_FAST_PYCALL 0
97   #undef CYTHON_PEP489_MULTI_PHASE_INIT
98   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
99   #undef CYTHON_USE_TP_FINALIZE
100   #define CYTHON_USE_TP_FINALIZE 0
101   #undef CYTHON_USE_DICT_VERSIONS
102   #define CYTHON_USE_DICT_VERSIONS 0
103   #undef CYTHON_USE_EXC_INFO_STACK
104   #define CYTHON_USE_EXC_INFO_STACK 0
105 #elif defined(PYSTON_VERSION)
106   #define CYTHON_COMPILING_IN_PYPY 0
107   #define CYTHON_COMPILING_IN_PYSTON 1
108   #define CYTHON_COMPILING_IN_CPYTHON 0
109   #ifndef CYTHON_USE_TYPE_SLOTS
110     #define CYTHON_USE_TYPE_SLOTS 1
111   #endif
112   #undef CYTHON_USE_PYTYPE_LOOKUP
113   #define CYTHON_USE_PYTYPE_LOOKUP 0
114   #undef CYTHON_USE_ASYNC_SLOTS
115   #define CYTHON_USE_ASYNC_SLOTS 0
116   #undef CYTHON_USE_PYLIST_INTERNALS
117   #define CYTHON_USE_PYLIST_INTERNALS 0
118   #ifndef CYTHON_USE_UNICODE_INTERNALS
119     #define CYTHON_USE_UNICODE_INTERNALS 1
120   #endif
121   #undef CYTHON_USE_UNICODE_WRITER
122   #define CYTHON_USE_UNICODE_WRITER 0
123   #undef CYTHON_USE_PYLONG_INTERNALS
124   #define CYTHON_USE_PYLONG_INTERNALS 0
125   #ifndef CYTHON_AVOID_BORROWED_REFS
126     #define CYTHON_AVOID_BORROWED_REFS 0
127   #endif
128   #ifndef CYTHON_ASSUME_SAFE_MACROS
129     #define CYTHON_ASSUME_SAFE_MACROS 1
130   #endif
131   #ifndef CYTHON_UNPACK_METHODS
132     #define CYTHON_UNPACK_METHODS 1
133   #endif
134   #undef CYTHON_FAST_THREAD_STATE
135   #define CYTHON_FAST_THREAD_STATE 0
136   #undef CYTHON_FAST_PYCALL
137   #define CYTHON_FAST_PYCALL 0
138   #undef CYTHON_PEP489_MULTI_PHASE_INIT
139   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
140   #undef CYTHON_USE_TP_FINALIZE
141   #define CYTHON_USE_TP_FINALIZE 0
142   #undef CYTHON_USE_DICT_VERSIONS
143   #define CYTHON_USE_DICT_VERSIONS 0
144   #undef CYTHON_USE_EXC_INFO_STACK
145   #define CYTHON_USE_EXC_INFO_STACK 0
146 #else
147   #define CYTHON_COMPILING_IN_PYPY 0
148   #define CYTHON_COMPILING_IN_PYSTON 0
149   #define CYTHON_COMPILING_IN_CPYTHON 1
150   #ifndef CYTHON_USE_TYPE_SLOTS
151     #define CYTHON_USE_TYPE_SLOTS 1
152   #endif
153   #if PY_VERSION_HEX < 0x02070000
154     #undef CYTHON_USE_PYTYPE_LOOKUP
155     #define CYTHON_USE_PYTYPE_LOOKUP 0
156   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
157     #define CYTHON_USE_PYTYPE_LOOKUP 1
158   #endif
159   #if PY_MAJOR_VERSION < 3
160     #undef CYTHON_USE_ASYNC_SLOTS
161     #define CYTHON_USE_ASYNC_SLOTS 0
162   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
163     #define CYTHON_USE_ASYNC_SLOTS 1
164   #endif
165   #if PY_VERSION_HEX < 0x02070000
166     #undef CYTHON_USE_PYLONG_INTERNALS
167     #define CYTHON_USE_PYLONG_INTERNALS 0
168   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
169     #define CYTHON_USE_PYLONG_INTERNALS 1
170   #endif
171   #ifndef CYTHON_USE_PYLIST_INTERNALS
172     #define CYTHON_USE_PYLIST_INTERNALS 1
173   #endif
174   #ifndef CYTHON_USE_UNICODE_INTERNALS
175     #define CYTHON_USE_UNICODE_INTERNALS 1
176   #endif
177   #if PY_VERSION_HEX < 0x030300F0
178     #undef CYTHON_USE_UNICODE_WRITER
179     #define CYTHON_USE_UNICODE_WRITER 0
180   #elif !defined(CYTHON_USE_UNICODE_WRITER)
181     #define CYTHON_USE_UNICODE_WRITER 1
182   #endif
183   #ifndef CYTHON_AVOID_BORROWED_REFS
184     #define CYTHON_AVOID_BORROWED_REFS 0
185   #endif
186   #ifndef CYTHON_ASSUME_SAFE_MACROS
187     #define CYTHON_ASSUME_SAFE_MACROS 1
188   #endif
189   #ifndef CYTHON_UNPACK_METHODS
190     #define CYTHON_UNPACK_METHODS 1
191   #endif
192   #ifndef CYTHON_FAST_THREAD_STATE
193     #define CYTHON_FAST_THREAD_STATE 1
194   #endif
195   #ifndef CYTHON_FAST_PYCALL
196     #define CYTHON_FAST_PYCALL 1
197   #endif
198   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
199     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
200   #endif
201   #ifndef CYTHON_USE_TP_FINALIZE
202     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
203   #endif
204   #ifndef CYTHON_USE_DICT_VERSIONS
205     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
206   #endif
207   #ifndef CYTHON_USE_EXC_INFO_STACK
208     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
209   #endif
210 #endif
211 #if !defined(CYTHON_FAST_PYCCALL)
212 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
213 #endif
214 #if CYTHON_USE_PYLONG_INTERNALS
215   #include "longintrepr.h"
216   #undef SHIFT
217   #undef BASE
218   #undef MASK
219   #ifdef SIZEOF_VOID_P
220     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
221   #endif
222 #endif
223 #ifndef __has_attribute
224   #define __has_attribute(x) 0
225 #endif
226 #ifndef __has_cpp_attribute
227   #define __has_cpp_attribute(x) 0
228 #endif
229 #ifndef CYTHON_RESTRICT
230   #if defined(__GNUC__)
231     #define CYTHON_RESTRICT __restrict__
232   #elif defined(_MSC_VER) && _MSC_VER >= 1400
233     #define CYTHON_RESTRICT __restrict
234   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235     #define CYTHON_RESTRICT restrict
236   #else
237     #define CYTHON_RESTRICT
238   #endif
239 #endif
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 #     define CYTHON_UNUSED __attribute__ ((__unused__))
244 #   else
245 #     define CYTHON_UNUSED
246 #   endif
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 #   define CYTHON_UNUSED __attribute__ ((__unused__))
249 # else
250 #   define CYTHON_UNUSED
251 # endif
252 #endif
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)255      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
256 #  else
257 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
258 #  endif
259 #endif
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 #  define CYTHON_NCP_UNUSED
263 # else
264 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
265 # endif
266 #endif
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
268 #ifdef _MSC_VER
269     #ifndef _MSC_STDINT_H_
270         #if _MSC_VER < 1300
271            typedef unsigned char     uint8_t;
272            typedef unsigned int      uint32_t;
273         #else
274            typedef unsigned __int8   uint8_t;
275            typedef unsigned __int32  uint32_t;
276         #endif
277     #endif
278 #else
279    #include <stdint.h>
280 #endif
281 #ifndef CYTHON_FALLTHROUGH
282   #if defined(__cplusplus) && __cplusplus >= 201103L
283     #if __has_cpp_attribute(fallthrough)
284       #define CYTHON_FALLTHROUGH [[fallthrough]]
285     #elif __has_cpp_attribute(clang::fallthrough)
286       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287     #elif __has_cpp_attribute(gnu::fallthrough)
288       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
289     #endif
290   #endif
291   #ifndef CYTHON_FALLTHROUGH
292     #if __has_attribute(fallthrough)
293       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
294     #else
295       #define CYTHON_FALLTHROUGH
296     #endif
297   #endif
298   #if defined(__clang__ ) && defined(__apple_build_version__)
299     #if __apple_build_version__ < 7000000
300       #undef  CYTHON_FALLTHROUGH
301       #define CYTHON_FALLTHROUGH
302     #endif
303   #endif
304 #endif
305 
306 #ifndef CYTHON_INLINE
307   #if defined(__clang__)
308     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
309   #elif defined(__GNUC__)
310     #define CYTHON_INLINE __inline__
311   #elif defined(_MSC_VER)
312     #define CYTHON_INLINE __inline
313   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
314     #define CYTHON_INLINE inline
315   #else
316     #define CYTHON_INLINE
317   #endif
318 #endif
319 
320 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
321   #define Py_OptimizeFlag 0
322 #endif
323 #define __PYX_BUILD_PY_SSIZE_T "n"
324 #define CYTHON_FORMAT_SSIZE_T "z"
325 #if PY_MAJOR_VERSION < 3
326   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
327   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
328           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
329   #define __Pyx_DefaultClassType PyClass_Type
330 #else
331   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
332 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
333   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
334           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
335 #else
336   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
337           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
338 #endif
339   #define __Pyx_DefaultClassType PyType_Type
340 #endif
341 #ifndef Py_TPFLAGS_CHECKTYPES
342   #define Py_TPFLAGS_CHECKTYPES 0
343 #endif
344 #ifndef Py_TPFLAGS_HAVE_INDEX
345   #define Py_TPFLAGS_HAVE_INDEX 0
346 #endif
347 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
348   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
349 #endif
350 #ifndef Py_TPFLAGS_HAVE_FINALIZE
351   #define Py_TPFLAGS_HAVE_FINALIZE 0
352 #endif
353 #ifndef METH_STACKLESS
354   #define METH_STACKLESS 0
355 #endif
356 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
357   #ifndef METH_FASTCALL
358      #define METH_FASTCALL 0x80
359   #endif
360   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
361   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
362                                                           Py_ssize_t nargs, PyObject *kwnames);
363 #else
364   #define __Pyx_PyCFunctionFast _PyCFunctionFast
365   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
366 #endif
367 #if CYTHON_FAST_PYCCALL
368 #define __Pyx_PyFastCFunction_Check(func)\
369     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
370 #else
371 #define __Pyx_PyFastCFunction_Check(func) 0
372 #endif
373 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
374   #define PyObject_Malloc(s)   PyMem_Malloc(s)
375   #define PyObject_Free(p)     PyMem_Free(p)
376   #define PyObject_Realloc(p)  PyMem_Realloc(p)
377 #endif
378 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
379   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
380   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
381   #define PyMem_RawFree(p)             PyMem_Free(p)
382 #endif
383 #if CYTHON_COMPILING_IN_PYSTON
384   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
385   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
386 #else
387   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
388   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
389 #endif
390 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
391   #define __Pyx_PyThreadState_Current PyThreadState_GET()
392 #elif PY_VERSION_HEX >= 0x03060000
393   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
394 #elif PY_VERSION_HEX >= 0x03000000
395   #define __Pyx_PyThreadState_Current PyThreadState_GET()
396 #else
397   #define __Pyx_PyThreadState_Current _PyThreadState_Current
398 #endif
399 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
400 #include "pythread.h"
401 #define Py_tss_NEEDS_INIT 0
402 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)403 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
404   *key = PyThread_create_key();
405   return 0;
406 }
PyThread_tss_alloc(void)407 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
408   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
409   *key = Py_tss_NEEDS_INIT;
410   return key;
411 }
PyThread_tss_free(Py_tss_t * key)412 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
413   PyObject_Free(key);
414 }
PyThread_tss_is_created(Py_tss_t * key)415 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
416   return *key != Py_tss_NEEDS_INIT;
417 }
PyThread_tss_delete(Py_tss_t * key)418 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
419   PyThread_delete_key(*key);
420   *key = Py_tss_NEEDS_INIT;
421 }
PyThread_tss_set(Py_tss_t * key,void * value)422 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
423   return PyThread_set_key_value(*key, value);
424 }
PyThread_tss_get(Py_tss_t * key)425 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
426   return PyThread_get_key_value(*key);
427 }
428 #endif
429 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
430 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
431 #else
432 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
433 #endif
434 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
435   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
436   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
437 #else
438   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
439   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
440 #endif
441 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
442 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
443 #else
444 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
445 #endif
446 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
447   #define CYTHON_PEP393_ENABLED 1
448   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
449                                               0 : _PyUnicode_Ready((PyObject *)(op)))
450   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
451   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
452   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
453   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
454   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
455   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
456   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
457   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
458 #else
459   #define CYTHON_PEP393_ENABLED 0
460   #define PyUnicode_1BYTE_KIND  1
461   #define PyUnicode_2BYTE_KIND  2
462   #define PyUnicode_4BYTE_KIND  4
463   #define __Pyx_PyUnicode_READY(op)       (0)
464   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
465   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
466   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
467   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
468   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
469   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
470   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
471   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
472 #endif
473 #if CYTHON_COMPILING_IN_PYPY
474   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
475   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
476 #else
477   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
478   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
479       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
480 #endif
481 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
482   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
483 #endif
484 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
485   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
486 #endif
487 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
488   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
489 #endif
490 #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))
491 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
492 #if PY_MAJOR_VERSION >= 3
493   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
494 #else
495   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
496 #endif
497 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
498   #define PyObject_ASCII(o)            PyObject_Repr(o)
499 #endif
500 #if PY_MAJOR_VERSION >= 3
501   #define PyBaseString_Type            PyUnicode_Type
502   #define PyStringObject               PyUnicodeObject
503   #define PyString_Type                PyUnicode_Type
504   #define PyString_Check               PyUnicode_Check
505   #define PyString_CheckExact          PyUnicode_CheckExact
506   #define PyObject_Unicode             PyObject_Str
507 #endif
508 #if PY_MAJOR_VERSION >= 3
509   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
510   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
511 #else
512   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
513   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
514 #endif
515 #ifndef PySet_CheckExact
516   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
517 #endif
518 #if CYTHON_ASSUME_SAFE_MACROS
519   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
520 #else
521   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
522 #endif
523 #if PY_MAJOR_VERSION >= 3
524   #define PyIntObject                  PyLongObject
525   #define PyInt_Type                   PyLong_Type
526   #define PyInt_Check(op)              PyLong_Check(op)
527   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
528   #define PyInt_FromString             PyLong_FromString
529   #define PyInt_FromUnicode            PyLong_FromUnicode
530   #define PyInt_FromLong               PyLong_FromLong
531   #define PyInt_FromSize_t             PyLong_FromSize_t
532   #define PyInt_FromSsize_t            PyLong_FromSsize_t
533   #define PyInt_AsLong                 PyLong_AsLong
534   #define PyInt_AS_LONG                PyLong_AS_LONG
535   #define PyInt_AsSsize_t              PyLong_AsSsize_t
536   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
537   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
538   #define PyNumber_Int                 PyNumber_Long
539 #endif
540 #if PY_MAJOR_VERSION >= 3
541   #define PyBoolObject                 PyLongObject
542 #endif
543 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
544   #ifndef PyUnicode_InternFromString
545     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
546   #endif
547 #endif
548 #if PY_VERSION_HEX < 0x030200A4
549   typedef long Py_hash_t;
550   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
551   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
552 #else
553   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
554   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
555 #endif
556 #if PY_MAJOR_VERSION >= 3
557   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
558 #else
559   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
560 #endif
561 #if CYTHON_USE_ASYNC_SLOTS
562   #if PY_VERSION_HEX >= 0x030500B1
563     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
564     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
565   #else
566     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
567   #endif
568 #else
569   #define __Pyx_PyType_AsAsync(obj) NULL
570 #endif
571 #ifndef __Pyx_PyAsyncMethodsStruct
572     typedef struct {
573         unaryfunc am_await;
574         unaryfunc am_aiter;
575         unaryfunc am_anext;
576     } __Pyx_PyAsyncMethodsStruct;
577 #endif
578 
579 #if defined(WIN32) || defined(MS_WINDOWS)
580   #define _USE_MATH_DEFINES
581 #endif
582 #include <math.h>
583 #ifdef NAN
584 #define __PYX_NAN() ((float) NAN)
585 #else
__PYX_NAN()586 static CYTHON_INLINE float __PYX_NAN() {
587   float value;
588   memset(&value, 0xFF, sizeof(value));
589   return value;
590 }
591 #endif
592 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
593 #define __Pyx_truncl trunc
594 #else
595 #define __Pyx_truncl truncl
596 #endif
597 
598 
599 #define __PYX_ERR(f_index, lineno, Ln_error) \
600 { \
601   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
602 }
603 
604 #ifndef __PYX_EXTERN_C
605   #ifdef __cplusplus
606     #define __PYX_EXTERN_C extern "C"
607   #else
608     #define __PYX_EXTERN_C extern
609   #endif
610 #endif
611 
612 #define __PYX_HAVE__skbio__stats____subsample
613 #define __PYX_HAVE_API__skbio__stats____subsample
614 /* Early includes */
615 #include <string.h>
616 #include <stdio.h>
617 #include "numpy/arrayobject.h"
618 #include "numpy/ufuncobject.h"
619 #ifdef _OPENMP
620 #include <omp.h>
621 #endif /* _OPENMP */
622 
623 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
624 #define CYTHON_WITHOUT_ASSERTIONS
625 #endif
626 
627 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
628                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
629 
630 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
631 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
632 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
633 #define __PYX_DEFAULT_STRING_ENCODING ""
634 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
635 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
636 #define __Pyx_uchar_cast(c) ((unsigned char)c)
637 #define __Pyx_long_cast(x) ((long)x)
638 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
639     (sizeof(type) < sizeof(Py_ssize_t))  ||\
640     (sizeof(type) > sizeof(Py_ssize_t) &&\
641           likely(v < (type)PY_SSIZE_T_MAX ||\
642                  v == (type)PY_SSIZE_T_MAX)  &&\
643           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
644                                 v == (type)PY_SSIZE_T_MIN)))  ||\
645     (sizeof(type) == sizeof(Py_ssize_t) &&\
646           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
647                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)648 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
649     return (size_t) i < (size_t) limit;
650 }
651 #if defined (__cplusplus) && __cplusplus >= 201103L
652     #include <cstdlib>
653     #define __Pyx_sst_abs(value) std::abs(value)
654 #elif SIZEOF_INT >= SIZEOF_SIZE_T
655     #define __Pyx_sst_abs(value) abs(value)
656 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
657     #define __Pyx_sst_abs(value) labs(value)
658 #elif defined (_MSC_VER)
659     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
660 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
661     #define __Pyx_sst_abs(value) llabs(value)
662 #elif defined (__GNUC__)
663     #define __Pyx_sst_abs(value) __builtin_llabs(value)
664 #else
665     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
666 #endif
667 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
668 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
669 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
670 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
671 #define __Pyx_PyBytes_FromString        PyBytes_FromString
672 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
673 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
674 #if PY_MAJOR_VERSION < 3
675     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
676     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
677 #else
678     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
679     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
680 #endif
681 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
682 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
683 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
684 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
685 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
686 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
687 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
688 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
689 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
690 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
691 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
692 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
693 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
694 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
695 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
696 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)697 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
698     const Py_UNICODE *u_end = u;
699     while (*u_end++) ;
700     return (size_t)(u_end - u - 1);
701 }
702 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
703 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
704 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
705 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
706 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
707 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
708 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
709 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
710 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
711 #define __Pyx_PySequence_Tuple(obj)\
712     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
713 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
714 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
715 #if CYTHON_ASSUME_SAFE_MACROS
716 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
717 #else
718 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
719 #endif
720 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
721 #if PY_MAJOR_VERSION >= 3
722 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
723 #else
724 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
725 #endif
726 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
727 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
728 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)729 static int __Pyx_init_sys_getdefaultencoding_params(void) {
730     PyObject* sys;
731     PyObject* default_encoding = NULL;
732     PyObject* ascii_chars_u = NULL;
733     PyObject* ascii_chars_b = NULL;
734     const char* default_encoding_c;
735     sys = PyImport_ImportModule("sys");
736     if (!sys) goto bad;
737     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
738     Py_DECREF(sys);
739     if (!default_encoding) goto bad;
740     default_encoding_c = PyBytes_AsString(default_encoding);
741     if (!default_encoding_c) goto bad;
742     if (strcmp(default_encoding_c, "ascii") == 0) {
743         __Pyx_sys_getdefaultencoding_not_ascii = 0;
744     } else {
745         char ascii_chars[128];
746         int c;
747         for (c = 0; c < 128; c++) {
748             ascii_chars[c] = c;
749         }
750         __Pyx_sys_getdefaultencoding_not_ascii = 1;
751         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
752         if (!ascii_chars_u) goto bad;
753         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
754         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
755             PyErr_Format(
756                 PyExc_ValueError,
757                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
758                 default_encoding_c);
759             goto bad;
760         }
761         Py_DECREF(ascii_chars_u);
762         Py_DECREF(ascii_chars_b);
763     }
764     Py_DECREF(default_encoding);
765     return 0;
766 bad:
767     Py_XDECREF(default_encoding);
768     Py_XDECREF(ascii_chars_u);
769     Py_XDECREF(ascii_chars_b);
770     return -1;
771 }
772 #endif
773 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
774 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
775 #else
776 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
777 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
778 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)779 static int __Pyx_init_sys_getdefaultencoding_params(void) {
780     PyObject* sys;
781     PyObject* default_encoding = NULL;
782     char* default_encoding_c;
783     sys = PyImport_ImportModule("sys");
784     if (!sys) goto bad;
785     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
786     Py_DECREF(sys);
787     if (!default_encoding) goto bad;
788     default_encoding_c = PyBytes_AsString(default_encoding);
789     if (!default_encoding_c) goto bad;
790     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
791     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
792     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
793     Py_DECREF(default_encoding);
794     return 0;
795 bad:
796     Py_XDECREF(default_encoding);
797     return -1;
798 }
799 #endif
800 #endif
801 
802 
803 /* Test for GCC > 2.95 */
804 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
805   #define likely(x)   __builtin_expect(!!(x), 1)
806   #define unlikely(x) __builtin_expect(!!(x), 0)
807 #else /* !__GNUC__ or GCC < 2.95 */
808   #define likely(x)   (x)
809   #define unlikely(x) (x)
810 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)811 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
812 
813 static PyObject *__pyx_m = NULL;
814 static PyObject *__pyx_d;
815 static PyObject *__pyx_b;
816 static PyObject *__pyx_cython_runtime = NULL;
817 static PyObject *__pyx_empty_tuple;
818 static PyObject *__pyx_empty_bytes;
819 static PyObject *__pyx_empty_unicode;
820 static int __pyx_lineno;
821 static int __pyx_clineno = 0;
822 static const char * __pyx_cfilenm= __FILE__;
823 static const char *__pyx_filename;
824 
825 /* Header.proto */
826 #if !defined(CYTHON_CCOMPLEX)
827   #if defined(__cplusplus)
828     #define CYTHON_CCOMPLEX 1
829   #elif defined(_Complex_I)
830     #define CYTHON_CCOMPLEX 1
831   #else
832     #define CYTHON_CCOMPLEX 0
833   #endif
834 #endif
835 #if CYTHON_CCOMPLEX
836   #ifdef __cplusplus
837     #include <complex>
838   #else
839     #include <complex.h>
840   #endif
841 #endif
842 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
843   #undef _Complex_I
844   #define _Complex_I 1.0fj
845 #endif
846 
847 
848 static const char *__pyx_f[] = {
849   "skbio/stats/__subsample.pyx",
850   "__init__.pxd",
851   "type.pxd",
852 };
853 /* BufferFormatStructs.proto */
854 #define IS_UNSIGNED(type) (((type) -1) > 0)
855 struct __Pyx_StructField_;
856 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
857 typedef struct {
858   const char* name;
859   struct __Pyx_StructField_* fields;
860   size_t size;
861   size_t arraysize[8];
862   int ndim;
863   char typegroup;
864   char is_unsigned;
865   int flags;
866 } __Pyx_TypeInfo;
867 typedef struct __Pyx_StructField_ {
868   __Pyx_TypeInfo* type;
869   const char* name;
870   size_t offset;
871 } __Pyx_StructField;
872 typedef struct {
873   __Pyx_StructField* field;
874   size_t parent_offset;
875 } __Pyx_BufFmt_StackElem;
876 typedef struct {
877   __Pyx_StructField root;
878   __Pyx_BufFmt_StackElem* head;
879   size_t fmt_offset;
880   size_t new_count, enc_count;
881   size_t struct_alignment;
882   int is_complex;
883   char enc_type;
884   char new_packmode;
885   char enc_packmode;
886   char is_valid_array;
887 } __Pyx_BufFmt_Context;
888 
889 
890 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
891  * # in Cython to enable them only on the right systems.
892  *
893  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
894  * ctypedef npy_int16      int16_t
895  * ctypedef npy_int32      int32_t
896  */
897 typedef npy_int8 __pyx_t_5numpy_int8_t;
898 
899 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
900  *
901  * ctypedef npy_int8       int8_t
902  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
903  * ctypedef npy_int32      int32_t
904  * ctypedef npy_int64      int64_t
905  */
906 typedef npy_int16 __pyx_t_5numpy_int16_t;
907 
908 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
909  * ctypedef npy_int8       int8_t
910  * ctypedef npy_int16      int16_t
911  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
912  * ctypedef npy_int64      int64_t
913  * #ctypedef npy_int96      int96_t
914  */
915 typedef npy_int32 __pyx_t_5numpy_int32_t;
916 
917 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
918  * ctypedef npy_int16      int16_t
919  * ctypedef npy_int32      int32_t
920  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
921  * #ctypedef npy_int96      int96_t
922  * #ctypedef npy_int128     int128_t
923  */
924 typedef npy_int64 __pyx_t_5numpy_int64_t;
925 
926 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
927  * #ctypedef npy_int128     int128_t
928  *
929  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
930  * ctypedef npy_uint16     uint16_t
931  * ctypedef npy_uint32     uint32_t
932  */
933 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
934 
935 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
936  *
937  * ctypedef npy_uint8      uint8_t
938  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
939  * ctypedef npy_uint32     uint32_t
940  * ctypedef npy_uint64     uint64_t
941  */
942 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
943 
944 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
945  * ctypedef npy_uint8      uint8_t
946  * ctypedef npy_uint16     uint16_t
947  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
948  * ctypedef npy_uint64     uint64_t
949  * #ctypedef npy_uint96     uint96_t
950  */
951 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
952 
953 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":786
954  * ctypedef npy_uint16     uint16_t
955  * ctypedef npy_uint32     uint32_t
956  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
957  * #ctypedef npy_uint96     uint96_t
958  * #ctypedef npy_uint128    uint128_t
959  */
960 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
961 
962 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
963  * #ctypedef npy_uint128    uint128_t
964  *
965  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
966  * ctypedef npy_float64    float64_t
967  * #ctypedef npy_float80    float80_t
968  */
969 typedef npy_float32 __pyx_t_5numpy_float32_t;
970 
971 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
972  *
973  * ctypedef npy_float32    float32_t
974  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
975  * #ctypedef npy_float80    float80_t
976  * #ctypedef npy_float128   float128_t
977  */
978 typedef npy_float64 __pyx_t_5numpy_float64_t;
979 
980 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":800
981  * # The int types are mapped a bit surprising --
982  * # numpy.int corresponds to 'l' and numpy.long to 'q'
983  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
984  * ctypedef npy_longlong   long_t
985  * ctypedef npy_longlong   longlong_t
986  */
987 typedef npy_long __pyx_t_5numpy_int_t;
988 
989 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
990  * # numpy.int corresponds to 'l' and numpy.long to 'q'
991  * ctypedef npy_long       int_t
992  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
993  * ctypedef npy_longlong   longlong_t
994  *
995  */
996 typedef npy_longlong __pyx_t_5numpy_long_t;
997 
998 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
999  * ctypedef npy_long       int_t
1000  * ctypedef npy_longlong   long_t
1001  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
1002  *
1003  * ctypedef npy_ulong      uint_t
1004  */
1005 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1006 
1007 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":804
1008  * ctypedef npy_longlong   longlong_t
1009  *
1010  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
1011  * ctypedef npy_ulonglong  ulong_t
1012  * ctypedef npy_ulonglong  ulonglong_t
1013  */
1014 typedef npy_ulong __pyx_t_5numpy_uint_t;
1015 
1016 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
1017  *
1018  * ctypedef npy_ulong      uint_t
1019  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
1020  * ctypedef npy_ulonglong  ulonglong_t
1021  *
1022  */
1023 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1024 
1025 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":806
1026  * ctypedef npy_ulong      uint_t
1027  * ctypedef npy_ulonglong  ulong_t
1028  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
1029  *
1030  * ctypedef npy_intp       intp_t
1031  */
1032 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1033 
1034 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":808
1035  * ctypedef npy_ulonglong  ulonglong_t
1036  *
1037  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1038  * ctypedef npy_uintp      uintp_t
1039  *
1040  */
1041 typedef npy_intp __pyx_t_5numpy_intp_t;
1042 
1043 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
1044  *
1045  * ctypedef npy_intp       intp_t
1046  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1047  *
1048  * ctypedef npy_double     float_t
1049  */
1050 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1051 
1052 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":811
1053  * ctypedef npy_uintp      uintp_t
1054  *
1055  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1056  * ctypedef npy_double     double_t
1057  * ctypedef npy_longdouble longdouble_t
1058  */
1059 typedef npy_double __pyx_t_5numpy_float_t;
1060 
1061 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
1062  *
1063  * ctypedef npy_double     float_t
1064  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1065  * ctypedef npy_longdouble longdouble_t
1066  *
1067  */
1068 typedef npy_double __pyx_t_5numpy_double_t;
1069 
1070 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
1071  * ctypedef npy_double     float_t
1072  * ctypedef npy_double     double_t
1073  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1074  *
1075  * ctypedef npy_cfloat      cfloat_t
1076  */
1077 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1078 /* Declarations.proto */
1079 #if CYTHON_CCOMPLEX
1080   #ifdef __cplusplus
1081     typedef ::std::complex< float > __pyx_t_float_complex;
1082   #else
1083     typedef float _Complex __pyx_t_float_complex;
1084   #endif
1085 #else
1086     typedef struct { float real, imag; } __pyx_t_float_complex;
1087 #endif
1088 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1089 
1090 /* Declarations.proto */
1091 #if CYTHON_CCOMPLEX
1092   #ifdef __cplusplus
1093     typedef ::std::complex< double > __pyx_t_double_complex;
1094   #else
1095     typedef double _Complex __pyx_t_double_complex;
1096   #endif
1097 #else
1098     typedef struct { double real, imag; } __pyx_t_double_complex;
1099 #endif
1100 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1101 
1102 
1103 /*--- Type declarations ---*/
1104 
1105 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
1106  * ctypedef npy_longdouble longdouble_t
1107  *
1108  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1109  * ctypedef npy_cdouble     cdouble_t
1110  * ctypedef npy_clongdouble clongdouble_t
1111  */
1112 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1113 
1114 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
1115  *
1116  * ctypedef npy_cfloat      cfloat_t
1117  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1118  * ctypedef npy_clongdouble clongdouble_t
1119  *
1120  */
1121 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1122 
1123 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":817
1124  * ctypedef npy_cfloat      cfloat_t
1125  * ctypedef npy_cdouble     cdouble_t
1126  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1127  *
1128  * ctypedef npy_cdouble     complex_t
1129  */
1130 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1131 
1132 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":819
1133  * ctypedef npy_clongdouble clongdouble_t
1134  *
1135  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1136  *
1137  * cdef inline object PyArray_MultiIterNew1(a):
1138  */
1139 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1140 
1141 /* --- Runtime support code (head) --- */
1142 /* Refnanny.proto */
1143 #ifndef CYTHON_REFNANNY
1144   #define CYTHON_REFNANNY 0
1145 #endif
1146 #if CYTHON_REFNANNY
1147   typedef struct {
1148     void (*INCREF)(void*, PyObject*, int);
1149     void (*DECREF)(void*, PyObject*, int);
1150     void (*GOTREF)(void*, PyObject*, int);
1151     void (*GIVEREF)(void*, PyObject*, int);
1152     void* (*SetupContext)(const char*, int, const char*);
1153     void (*FinishContext)(void**);
1154   } __Pyx_RefNannyAPIStruct;
1155   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1156   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1157   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1158 #ifdef WITH_THREAD
1159   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1160           if (acquire_gil) {\
1161               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1162               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1163               PyGILState_Release(__pyx_gilstate_save);\
1164           } else {\
1165               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1166           }
1167 #else
1168   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1169           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1170 #endif
1171   #define __Pyx_RefNannyFinishContext()\
1172           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1173   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1174   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1175   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1176   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1177   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1178   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1179   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1180   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1181 #else
1182   #define __Pyx_RefNannyDeclarations
1183   #define __Pyx_RefNannySetupContext(name, acquire_gil)
1184   #define __Pyx_RefNannyFinishContext()
1185   #define __Pyx_INCREF(r) Py_INCREF(r)
1186   #define __Pyx_DECREF(r) Py_DECREF(r)
1187   #define __Pyx_GOTREF(r)
1188   #define __Pyx_GIVEREF(r)
1189   #define __Pyx_XINCREF(r) Py_XINCREF(r)
1190   #define __Pyx_XDECREF(r) Py_XDECREF(r)
1191   #define __Pyx_XGOTREF(r)
1192   #define __Pyx_XGIVEREF(r)
1193 #endif
1194 #define __Pyx_XDECREF_SET(r, v) do {\
1195         PyObject *tmp = (PyObject *) r;\
1196         r = v; __Pyx_XDECREF(tmp);\
1197     } while (0)
1198 #define __Pyx_DECREF_SET(r, v) do {\
1199         PyObject *tmp = (PyObject *) r;\
1200         r = v; __Pyx_DECREF(tmp);\
1201     } while (0)
1202 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1203 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1204 
1205 /* PyObjectGetAttrStr.proto */
1206 #if CYTHON_USE_TYPE_SLOTS
1207 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1208 #else
1209 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1210 #endif
1211 
1212 /* GetBuiltinName.proto */
1213 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1214 
1215 /* RaiseArgTupleInvalid.proto */
1216 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1217     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1218 
1219 /* RaiseDoubleKeywords.proto */
1220 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1221 
1222 /* ParseKeywords.proto */
1223 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1224     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1225     const char* function_name);
1226 
1227 /* ArgTypeTest.proto */
1228 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1229     ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1230         __Pyx__ArgTypeTest(obj, type, name, exact))
1231 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1232 
1233 /* IsLittleEndian.proto */
1234 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
1235 
1236 /* BufferFormatCheck.proto */
1237 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
1238 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1239                               __Pyx_BufFmt_StackElem* stack,
1240                               __Pyx_TypeInfo* type);
1241 
1242 /* BufferGetAndValidate.proto */
1243 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
1244     ((obj == Py_None || obj == NULL) ?\
1245     (__Pyx_ZeroBuffer(buf), 0) :\
1246     __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
1247 static int  __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1248     __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
1249 static void __Pyx_ZeroBuffer(Py_buffer* buf);
1250 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1251 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
1252 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
1253 
1254 /* PyDictVersioning.proto */
1255 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1256 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
1257 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
1258 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1259     (version_var) = __PYX_GET_DICT_VERSION(dict);\
1260     (cache_var) = (value);
1261 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1262     static PY_UINT64_T __pyx_dict_version = 0;\
1263     static PyObject *__pyx_dict_cached_value = NULL;\
1264     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1265         (VAR) = __pyx_dict_cached_value;\
1266     } else {\
1267         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1268         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1269     }\
1270 }
1271 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1272 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1273 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1274 #else
1275 #define __PYX_GET_DICT_VERSION(dict)  (0)
1276 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1277 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
1278 #endif
1279 
1280 /* GetModuleGlobalName.proto */
1281 #if CYTHON_USE_DICT_VERSIONS
1282 #define __Pyx_GetModuleGlobalName(var, name)  {\
1283     static PY_UINT64_T __pyx_dict_version = 0;\
1284     static PyObject *__pyx_dict_cached_value = NULL;\
1285     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1286         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1287         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1288 }
1289 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
1290     PY_UINT64_T __pyx_dict_version;\
1291     PyObject *__pyx_dict_cached_value;\
1292     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1293 }
1294 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1295 #else
1296 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1297 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1298 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1299 #endif
1300 
1301 /* PyObjectCall.proto */
1302 #if CYTHON_COMPILING_IN_CPYTHON
1303 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1304 #else
1305 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1306 #endif
1307 
1308 /* ExtTypeTest.proto */
1309 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1310 
1311 /* BufferFallbackError.proto */
1312 static void __Pyx_RaiseBufferFallbackError(void);
1313 
1314 /* BufferIndexError.proto */
1315 static void __Pyx_RaiseBufferIndexError(int axis);
1316 
1317 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
1318 /* PyCFunctionFastCall.proto */
1319 #if CYTHON_FAST_PYCCALL
1320 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1321 #else
1322 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
1323 #endif
1324 
1325 /* PyFunctionFastCall.proto */
1326 #if CYTHON_FAST_PYCALL
1327 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1328     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1329 #if 1 || PY_VERSION_HEX < 0x030600B1
1330 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1331 #else
1332 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1333 #endif
1334 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1335     (sizeof(char [1 - 2*!(cond)]) - 1)
1336 #ifndef Py_MEMBER_SIZE
1337 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1338 #endif
1339   static size_t __pyx_pyframe_localsplus_offset = 0;
1340   #include "frameobject.h"
1341   #define __Pxy_PyFrame_Initialize_Offsets()\
1342     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1343      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1344   #define __Pyx_PyFrame_GetLocalsplus(frame)\
1345     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1346 #endif
1347 
1348 /* PyObjectCall2Args.proto */
1349 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1350 
1351 /* PyObjectCallMethO.proto */
1352 #if CYTHON_COMPILING_IN_CPYTHON
1353 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1354 #endif
1355 
1356 /* PyObjectCallOneArg.proto */
1357 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1358 
1359 /* SliceObject.proto */
1360 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1361         PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1362         PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1363         int has_cstart, int has_cstop, int wraparound);
1364 
1365 /* PyThreadStateGet.proto */
1366 #if CYTHON_FAST_THREAD_STATE
1367 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
1368 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
1369 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
1370 #else
1371 #define __Pyx_PyThreadState_declare
1372 #define __Pyx_PyThreadState_assign
1373 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
1374 #endif
1375 
1376 /* PyErrFetchRestore.proto */
1377 #if CYTHON_FAST_THREAD_STATE
1378 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1379 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1380 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1381 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1382 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1383 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1384 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1385 #if CYTHON_COMPILING_IN_CPYTHON
1386 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1387 #else
1388 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1389 #endif
1390 #else
1391 #define __Pyx_PyErr_Clear() PyErr_Clear()
1392 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1393 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
1394 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
1395 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
1396 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
1397 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
1398 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
1399 #endif
1400 
1401 /* RaiseException.proto */
1402 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1403 
1404 /* DictGetItem.proto */
1405 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1406 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1407 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1408     (likely(PyDict_CheckExact(obj)) ?\
1409      __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1410 #else
1411 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1412 #define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
1413 #endif
1414 
1415 /* RaiseTooManyValuesToUnpack.proto */
1416 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1417 
1418 /* RaiseNeedMoreValuesToUnpack.proto */
1419 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1420 
1421 /* RaiseNoneIterError.proto */
1422 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1423 
1424 /* GetTopmostException.proto */
1425 #if CYTHON_USE_EXC_INFO_STACK
1426 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1427 #endif
1428 
1429 /* SaveResetException.proto */
1430 #if CYTHON_FAST_THREAD_STATE
1431 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1432 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1433 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1434 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1435 #else
1436 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
1437 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
1438 #endif
1439 
1440 /* PyErrExceptionMatches.proto */
1441 #if CYTHON_FAST_THREAD_STATE
1442 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1443 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1444 #else
1445 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
1446 #endif
1447 
1448 /* GetException.proto */
1449 #if CYTHON_FAST_THREAD_STATE
1450 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
1451 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1452 #else
1453 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1454 #endif
1455 
1456 /* TypeImport.proto */
1457 #ifndef __PYX_HAVE_RT_ImportType_proto
1458 #define __PYX_HAVE_RT_ImportType_proto
1459 enum __Pyx_ImportType_CheckSize {
1460    __Pyx_ImportType_CheckSize_Error = 0,
1461    __Pyx_ImportType_CheckSize_Warn = 1,
1462    __Pyx_ImportType_CheckSize_Ignore = 2
1463 };
1464 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1465 #endif
1466 
1467 /* Import.proto */
1468 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1469 
1470 /* CLineInTraceback.proto */
1471 #ifdef CYTHON_CLINE_IN_TRACEBACK
1472 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1473 #else
1474 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1475 #endif
1476 
1477 /* CodeObjectCache.proto */
1478 typedef struct {
1479     PyCodeObject* code_object;
1480     int code_line;
1481 } __Pyx_CodeObjectCacheEntry;
1482 struct __Pyx_CodeObjectCache {
1483     int count;
1484     int max_count;
1485     __Pyx_CodeObjectCacheEntry* entries;
1486 };
1487 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1488 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1489 static PyCodeObject *__pyx_find_code_object(int code_line);
1490 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1491 
1492 /* AddTraceback.proto */
1493 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1494                                int py_line, const char *filename);
1495 
1496 /* BufferStructDeclare.proto */
1497 typedef struct {
1498   Py_ssize_t shape, strides, suboffsets;
1499 } __Pyx_Buf_DimInfo;
1500 typedef struct {
1501   size_t refcount;
1502   Py_buffer pybuffer;
1503 } __Pyx_Buffer;
1504 typedef struct {
1505   __Pyx_Buffer *rcbuffer;
1506   char *data;
1507   __Pyx_Buf_DimInfo diminfo[8];
1508 } __Pyx_LocalBuf_ND;
1509 
1510 #if PY_MAJOR_VERSION < 3
1511     static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
1512     static void __Pyx_ReleaseBuffer(Py_buffer *view);
1513 #else
1514     #define __Pyx_GetBuffer PyObject_GetBuffer
1515     #define __Pyx_ReleaseBuffer PyBuffer_Release
1516 #endif
1517 
1518 
1519 /* CIntToPy.proto */
1520 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
1521 
1522 /* CIntToPy.proto */
1523 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value);
1524 
1525 /* RealImag.proto */
1526 #if CYTHON_CCOMPLEX
1527   #ifdef __cplusplus
1528     #define __Pyx_CREAL(z) ((z).real())
1529     #define __Pyx_CIMAG(z) ((z).imag())
1530   #else
1531     #define __Pyx_CREAL(z) (__real__(z))
1532     #define __Pyx_CIMAG(z) (__imag__(z))
1533   #endif
1534 #else
1535     #define __Pyx_CREAL(z) ((z).real)
1536     #define __Pyx_CIMAG(z) ((z).imag)
1537 #endif
1538 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1539         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1540     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1541     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1542 #else
1543     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1544     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1545 #endif
1546 
1547 /* Arithmetic.proto */
1548 #if CYTHON_CCOMPLEX
1549     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
1550     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
1551     #define __Pyx_c_diff_float(a, b) ((a)-(b))
1552     #define __Pyx_c_prod_float(a, b) ((a)*(b))
1553     #define __Pyx_c_quot_float(a, b) ((a)/(b))
1554     #define __Pyx_c_neg_float(a)     (-(a))
1555   #ifdef __cplusplus
1556     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1557     #define __Pyx_c_conj_float(z)    (::std::conj(z))
1558     #if 1
1559         #define __Pyx_c_abs_float(z)     (::std::abs(z))
1560         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
1561     #endif
1562   #else
1563     #define __Pyx_c_is_zero_float(z) ((z)==0)
1564     #define __Pyx_c_conj_float(z)    (conjf(z))
1565     #if 1
1566         #define __Pyx_c_abs_float(z)     (cabsf(z))
1567         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
1568     #endif
1569  #endif
1570 #else
1571     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1572     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1573     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1574     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1575     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1576     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1577     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1578     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1579     #if 1
1580         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
1581         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1582     #endif
1583 #endif
1584 
1585 /* Arithmetic.proto */
1586 #if CYTHON_CCOMPLEX
1587     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
1588     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
1589     #define __Pyx_c_diff_double(a, b) ((a)-(b))
1590     #define __Pyx_c_prod_double(a, b) ((a)*(b))
1591     #define __Pyx_c_quot_double(a, b) ((a)/(b))
1592     #define __Pyx_c_neg_double(a)     (-(a))
1593   #ifdef __cplusplus
1594     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1595     #define __Pyx_c_conj_double(z)    (::std::conj(z))
1596     #if 1
1597         #define __Pyx_c_abs_double(z)     (::std::abs(z))
1598         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
1599     #endif
1600   #else
1601     #define __Pyx_c_is_zero_double(z) ((z)==0)
1602     #define __Pyx_c_conj_double(z)    (conj(z))
1603     #if 1
1604         #define __Pyx_c_abs_double(z)     (cabs(z))
1605         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
1606     #endif
1607  #endif
1608 #else
1609     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1610     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1611     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1612     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1613     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1614     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1615     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1616     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1617     #if 1
1618         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
1619         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1620     #endif
1621 #endif
1622 
1623 /* CIntToPy.proto */
1624 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1625 
1626 /* CIntToPy.proto */
1627 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
1628 
1629 /* CIntFromPy.proto */
1630 static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *);
1631 
1632 /* CIntFromPy.proto */
1633 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1634 
1635 /* CIntToPy.proto */
1636 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1637 
1638 /* CIntFromPy.proto */
1639 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1640 
1641 /* FastTypeChecks.proto */
1642 #if CYTHON_COMPILING_IN_CPYTHON
1643 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1644 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1645 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1646 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1647 #else
1648 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1649 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1650 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1651 #endif
1652 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1653 
1654 /* CheckBinaryVersion.proto */
1655 static int __Pyx_check_binary_version(void);
1656 
1657 /* InitStrings.proto */
1658 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1659 
1660 
1661 /* Module declarations from 'cpython.buffer' */
1662 
1663 /* Module declarations from 'libc.string' */
1664 
1665 /* Module declarations from 'libc.stdio' */
1666 
1667 /* Module declarations from '__builtin__' */
1668 
1669 /* Module declarations from 'cpython.type' */
1670 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1671 
1672 /* Module declarations from 'cpython' */
1673 
1674 /* Module declarations from 'cpython.object' */
1675 
1676 /* Module declarations from 'cpython.ref' */
1677 
1678 /* Module declarations from 'cpython.mem' */
1679 
1680 /* Module declarations from 'numpy' */
1681 
1682 /* Module declarations from 'numpy' */
1683 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1684 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1685 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1686 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1687 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1688 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
1689 
1690 /* Module declarations from 'skbio.stats.__subsample' */
1691 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 };
1692 #define __Pyx_MODULE_NAME "skbio.stats.__subsample"
1693 extern int __pyx_module_is_main_skbio__stats____subsample;
1694 int __pyx_module_is_main_skbio__stats____subsample = 0;
1695 
1696 /* Implementation of 'skbio.stats.__subsample' */
1697 static PyObject *__pyx_builtin_range;
1698 static PyObject *__pyx_builtin_ValueError;
1699 static PyObject *__pyx_builtin_RuntimeError;
1700 static PyObject *__pyx_builtin_ImportError;
1701 static const char __pyx_k_i[] = "i";
1702 static const char __pyx_k_j[] = "j";
1703 static const char __pyx_k_n[] = "n";
1704 static const char __pyx_k_np[] = "np";
1705 static const char __pyx_k_cnt[] = "cnt";
1706 static const char __pyx_k_idx[] = "idx";
1707 static const char __pyx_k_main[] = "__main__";
1708 static const char __pyx_k_name[] = "__name__";
1709 static const char __pyx_k_test[] = "__test__";
1710 static const char __pyx_k_dtype[] = "dtype";
1711 static const char __pyx_k_empty[] = "empty";
1712 static const char __pyx_k_numpy[] = "numpy";
1713 static const char __pyx_k_range[] = "range";
1714 static const char __pyx_k_counts[] = "counts";
1715 static const char __pyx_k_import[] = "__import__";
1716 static const char __pyx_k_random[] = "random";
1717 static const char __pyx_k_result[] = "result";
1718 static const char __pyx_k_permuted[] = "permuted";
1719 static const char __pyx_k_unpacked[] = "unpacked";
1720 static const char __pyx_k_ValueError[] = "ValueError";
1721 static const char __pyx_k_counts_sum[] = "counts_sum";
1722 static const char __pyx_k_zeros_like[] = "zeros_like";
1723 static const char __pyx_k_ImportError[] = "ImportError";
1724 static const char __pyx_k_permutation[] = "permutation";
1725 static const char __pyx_k_RuntimeError[] = "RuntimeError";
1726 static const char __pyx_k_unpacked_idx[] = "unpacked_idx";
1727 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1728 static const char __pyx_k_skbio_stats___subsample[] = "skbio.stats.__subsample";
1729 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
1730 static const char __pyx_k_skbio_stats___subsample_pyx[] = "skbio/stats/__subsample.pyx";
1731 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
1732 static const char __pyx_k_subsample_counts_without_replac[] = "_subsample_counts_without_replacement";
1733 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
1734 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
1735 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
1736 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
1737 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
1738 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
1739 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
1740 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
1741 static PyObject *__pyx_n_s_ImportError;
1742 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
1743 static PyObject *__pyx_n_s_RuntimeError;
1744 static PyObject *__pyx_n_s_ValueError;
1745 static PyObject *__pyx_n_s_cline_in_traceback;
1746 static PyObject *__pyx_n_s_cnt;
1747 static PyObject *__pyx_n_s_counts;
1748 static PyObject *__pyx_n_s_counts_sum;
1749 static PyObject *__pyx_n_s_dtype;
1750 static PyObject *__pyx_n_s_empty;
1751 static PyObject *__pyx_n_s_i;
1752 static PyObject *__pyx_n_s_idx;
1753 static PyObject *__pyx_n_s_import;
1754 static PyObject *__pyx_n_s_j;
1755 static PyObject *__pyx_n_s_main;
1756 static PyObject *__pyx_n_s_n;
1757 static PyObject *__pyx_n_s_name;
1758 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
1759 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
1760 static PyObject *__pyx_n_s_np;
1761 static PyObject *__pyx_n_s_numpy;
1762 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1763 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1764 static PyObject *__pyx_n_s_permutation;
1765 static PyObject *__pyx_n_s_permuted;
1766 static PyObject *__pyx_n_s_random;
1767 static PyObject *__pyx_n_s_range;
1768 static PyObject *__pyx_n_s_result;
1769 static PyObject *__pyx_n_s_skbio_stats___subsample;
1770 static PyObject *__pyx_kp_s_skbio_stats___subsample_pyx;
1771 static PyObject *__pyx_n_s_subsample_counts_without_replac;
1772 static PyObject *__pyx_n_s_test;
1773 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
1774 static PyObject *__pyx_n_s_unpacked;
1775 static PyObject *__pyx_n_s_unpacked_idx;
1776 static PyObject *__pyx_n_s_zeros_like;
1777 static PyObject *__pyx_pf_5skbio_5stats_11__subsample__subsample_counts_without_replacement(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_counts, PyObject *__pyx_v_n, PyObject *__pyx_v_counts_sum); /* proto */
1778 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
1779 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
1780 static PyObject *__pyx_tuple_;
1781 static PyObject *__pyx_tuple__2;
1782 static PyObject *__pyx_tuple__3;
1783 static PyObject *__pyx_tuple__4;
1784 static PyObject *__pyx_tuple__5;
1785 static PyObject *__pyx_tuple__6;
1786 static PyObject *__pyx_tuple__7;
1787 static PyObject *__pyx_tuple__8;
1788 static PyObject *__pyx_codeobj__9;
1789 /* Late includes */
1790 
1791 /* "skbio/stats/__subsample.pyx":13
1792  *
1793  *
1794  * def _subsample_counts_without_replacement(             # <<<<<<<<<<<<<<
1795  *     cnp.ndarray[cnp.int64_t, ndim=1] counts, n, counts_sum):
1796  *     cdef:
1797  */
1798 
1799 /* Python wrapper */
1800 static PyObject *__pyx_pw_5skbio_5stats_11__subsample_1_subsample_counts_without_replacement(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1801 static PyMethodDef __pyx_mdef_5skbio_5stats_11__subsample_1_subsample_counts_without_replacement = {"_subsample_counts_without_replacement", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5skbio_5stats_11__subsample_1_subsample_counts_without_replacement, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_5skbio_5stats_11__subsample_1_subsample_counts_without_replacement(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)1802 static PyObject *__pyx_pw_5skbio_5stats_11__subsample_1_subsample_counts_without_replacement(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1803   PyArrayObject *__pyx_v_counts = 0;
1804   PyObject *__pyx_v_n = 0;
1805   PyObject *__pyx_v_counts_sum = 0;
1806   PyObject *__pyx_r = 0;
1807   __Pyx_RefNannyDeclarations
1808   __Pyx_RefNannySetupContext("_subsample_counts_without_replacement (wrapper)", 0);
1809   {
1810     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_counts,&__pyx_n_s_n,&__pyx_n_s_counts_sum,0};
1811     PyObject* values[3] = {0,0,0};
1812     if (unlikely(__pyx_kwds)) {
1813       Py_ssize_t kw_args;
1814       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1815       switch (pos_args) {
1816         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1817         CYTHON_FALLTHROUGH;
1818         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1819         CYTHON_FALLTHROUGH;
1820         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1821         CYTHON_FALLTHROUGH;
1822         case  0: break;
1823         default: goto __pyx_L5_argtuple_error;
1824       }
1825       kw_args = PyDict_Size(__pyx_kwds);
1826       switch (pos_args) {
1827         case  0:
1828         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
1829         else goto __pyx_L5_argtuple_error;
1830         CYTHON_FALLTHROUGH;
1831         case  1:
1832         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
1833         else {
1834           __Pyx_RaiseArgtupleInvalid("_subsample_counts_without_replacement", 1, 3, 3, 1); __PYX_ERR(0, 13, __pyx_L3_error)
1835         }
1836         CYTHON_FALLTHROUGH;
1837         case  2:
1838         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_counts_sum)) != 0)) kw_args--;
1839         else {
1840           __Pyx_RaiseArgtupleInvalid("_subsample_counts_without_replacement", 1, 3, 3, 2); __PYX_ERR(0, 13, __pyx_L3_error)
1841         }
1842       }
1843       if (unlikely(kw_args > 0)) {
1844         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_subsample_counts_without_replacement") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
1845       }
1846     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
1847       goto __pyx_L5_argtuple_error;
1848     } else {
1849       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1850       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1851       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1852     }
1853     __pyx_v_counts = ((PyArrayObject *)values[0]);
1854     __pyx_v_n = values[1];
1855     __pyx_v_counts_sum = values[2];
1856   }
1857   goto __pyx_L4_argument_unpacking_done;
1858   __pyx_L5_argtuple_error:;
1859   __Pyx_RaiseArgtupleInvalid("_subsample_counts_without_replacement", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
1860   __pyx_L3_error:;
1861   __Pyx_AddTraceback("skbio.stats.__subsample._subsample_counts_without_replacement", __pyx_clineno, __pyx_lineno, __pyx_filename);
1862   __Pyx_RefNannyFinishContext();
1863   return NULL;
1864   __pyx_L4_argument_unpacking_done:;
1865   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) __PYX_ERR(0, 14, __pyx_L1_error)
1866   __pyx_r = __pyx_pf_5skbio_5stats_11__subsample__subsample_counts_without_replacement(__pyx_self, __pyx_v_counts, __pyx_v_n, __pyx_v_counts_sum);
1867 
1868   /* function exit code */
1869   goto __pyx_L0;
1870   __pyx_L1_error:;
1871   __pyx_r = NULL;
1872   __pyx_L0:;
1873   __Pyx_RefNannyFinishContext();
1874   return __pyx_r;
1875 }
1876 
__pyx_pf_5skbio_5stats_11__subsample__subsample_counts_without_replacement(CYTHON_UNUSED PyObject * __pyx_self,PyArrayObject * __pyx_v_counts,PyObject * __pyx_v_n,PyObject * __pyx_v_counts_sum)1877 static PyObject *__pyx_pf_5skbio_5stats_11__subsample__subsample_counts_without_replacement(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_counts, PyObject *__pyx_v_n, PyObject *__pyx_v_counts_sum) {
1878   PyArrayObject *__pyx_v_result = 0;
1879   PyArrayObject *__pyx_v_permuted = 0;
1880   PyArrayObject *__pyx_v_unpacked = 0;
1881   __pyx_t_5numpy_int64_t __pyx_v_cnt;
1882   Py_ssize_t __pyx_v_unpacked_idx;
1883   Py_ssize_t __pyx_v_i;
1884   CYTHON_UNUSED Py_ssize_t __pyx_v_j;
1885   npy_intp __pyx_v_idx;
1886   __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
1887   __Pyx_Buffer __pyx_pybuffer_counts;
1888   __Pyx_LocalBuf_ND __pyx_pybuffernd_permuted;
1889   __Pyx_Buffer __pyx_pybuffer_permuted;
1890   __Pyx_LocalBuf_ND __pyx_pybuffernd_result;
1891   __Pyx_Buffer __pyx_pybuffer_result;
1892   __Pyx_LocalBuf_ND __pyx_pybuffernd_unpacked;
1893   __Pyx_Buffer __pyx_pybuffer_unpacked;
1894   PyObject *__pyx_r = NULL;
1895   __Pyx_RefNannyDeclarations
1896   PyObject *__pyx_t_1 = NULL;
1897   PyObject *__pyx_t_2 = NULL;
1898   PyObject *__pyx_t_3 = NULL;
1899   PyObject *__pyx_t_4 = NULL;
1900   PyArrayObject *__pyx_t_5 = NULL;
1901   int __pyx_t_6;
1902   PyObject *__pyx_t_7 = NULL;
1903   PyObject *__pyx_t_8 = NULL;
1904   PyObject *__pyx_t_9 = NULL;
1905   npy_intp __pyx_t_10;
1906   npy_intp __pyx_t_11;
1907   Py_ssize_t __pyx_t_12;
1908   Py_ssize_t __pyx_t_13;
1909   __pyx_t_5numpy_int64_t __pyx_t_14;
1910   __pyx_t_5numpy_int64_t __pyx_t_15;
1911   Py_ssize_t __pyx_t_16;
1912   Py_ssize_t __pyx_t_17;
1913   npy_intp __pyx_t_18;
1914   Py_ssize_t __pyx_t_19;
1915   __Pyx_RefNannySetupContext("_subsample_counts_without_replacement", 0);
1916   __pyx_pybuffer_result.pybuffer.buf = NULL;
1917   __pyx_pybuffer_result.refcount = 0;
1918   __pyx_pybuffernd_result.data = NULL;
1919   __pyx_pybuffernd_result.rcbuffer = &__pyx_pybuffer_result;
1920   __pyx_pybuffer_permuted.pybuffer.buf = NULL;
1921   __pyx_pybuffer_permuted.refcount = 0;
1922   __pyx_pybuffernd_permuted.data = NULL;
1923   __pyx_pybuffernd_permuted.rcbuffer = &__pyx_pybuffer_permuted;
1924   __pyx_pybuffer_unpacked.pybuffer.buf = NULL;
1925   __pyx_pybuffer_unpacked.refcount = 0;
1926   __pyx_pybuffernd_unpacked.data = NULL;
1927   __pyx_pybuffernd_unpacked.rcbuffer = &__pyx_pybuffer_unpacked;
1928   __pyx_pybuffer_counts.pybuffer.buf = NULL;
1929   __pyx_pybuffer_counts.refcount = 0;
1930   __pyx_pybuffernd_counts.data = NULL;
1931   __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
1932   {
1933     __Pyx_BufFmt_StackElem __pyx_stack[1];
1934     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 13, __pyx_L1_error)
1935   }
1936   __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
1937 
1938   /* "skbio/stats/__subsample.pyx":20
1939  *         Py_ssize_t unpacked_idx, i, j
1940  *
1941  *     unpacked = np.empty(counts_sum, dtype=int)             # <<<<<<<<<<<<<<
1942  *     unpacked_idx = 0
1943  *     for i in range(counts.shape[0]):
1944  */
1945   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
1946   __Pyx_GOTREF(__pyx_t_1);
1947   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
1948   __Pyx_GOTREF(__pyx_t_2);
1949   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1950   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
1951   __Pyx_GOTREF(__pyx_t_1);
1952   __Pyx_INCREF(__pyx_v_counts_sum);
1953   __Pyx_GIVEREF(__pyx_v_counts_sum);
1954   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_counts_sum);
1955   __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error)
1956   __Pyx_GOTREF(__pyx_t_3);
1957   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
1958   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error)
1959   __Pyx_GOTREF(__pyx_t_4);
1960   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1961   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1962   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1963   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 20, __pyx_L1_error)
1964   __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
1965   {
1966     __Pyx_BufFmt_StackElem __pyx_stack[1];
1967     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unpacked.rcbuffer->pybuffer);
1968     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_unpacked.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
1969     if (unlikely(__pyx_t_6 < 0)) {
1970       PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
1971       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_unpacked.rcbuffer->pybuffer, (PyObject*)__pyx_v_unpacked, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
1972         Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
1973         __Pyx_RaiseBufferFallbackError();
1974       } else {
1975         PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
1976       }
1977       __pyx_t_7 = __pyx_t_8 = __pyx_t_9 = 0;
1978     }
1979     __pyx_pybuffernd_unpacked.diminfo[0].strides = __pyx_pybuffernd_unpacked.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_unpacked.diminfo[0].shape = __pyx_pybuffernd_unpacked.rcbuffer->pybuffer.shape[0];
1980     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 20, __pyx_L1_error)
1981   }
1982   __pyx_t_5 = 0;
1983   __pyx_v_unpacked = ((PyArrayObject *)__pyx_t_4);
1984   __pyx_t_4 = 0;
1985 
1986   /* "skbio/stats/__subsample.pyx":21
1987  *
1988  *     unpacked = np.empty(counts_sum, dtype=int)
1989  *     unpacked_idx = 0             # <<<<<<<<<<<<<<
1990  *     for i in range(counts.shape[0]):
1991  *         cnt = counts[i]
1992  */
1993   __pyx_v_unpacked_idx = 0;
1994 
1995   /* "skbio/stats/__subsample.pyx":22
1996  *     unpacked = np.empty(counts_sum, dtype=int)
1997  *     unpacked_idx = 0
1998  *     for i in range(counts.shape[0]):             # <<<<<<<<<<<<<<
1999  *         cnt = counts[i]
2000  *         for j in range(cnt):
2001  */
2002   __pyx_t_10 = (__pyx_v_counts->dimensions[0]);
2003   __pyx_t_11 = __pyx_t_10;
2004   for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
2005     __pyx_v_i = __pyx_t_12;
2006 
2007     /* "skbio/stats/__subsample.pyx":23
2008  *     unpacked_idx = 0
2009  *     for i in range(counts.shape[0]):
2010  *         cnt = counts[i]             # <<<<<<<<<<<<<<
2011  *         for j in range(cnt):
2012  *             unpacked[unpacked_idx] = i
2013  */
2014     __pyx_t_13 = __pyx_v_i;
2015     __pyx_t_6 = -1;
2016     if (__pyx_t_13 < 0) {
2017       __pyx_t_13 += __pyx_pybuffernd_counts.diminfo[0].shape;
2018       if (unlikely(__pyx_t_13 < 0)) __pyx_t_6 = 0;
2019     } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_counts.diminfo[0].shape)) __pyx_t_6 = 0;
2020     if (unlikely(__pyx_t_6 != -1)) {
2021       __Pyx_RaiseBufferIndexError(__pyx_t_6);
2022       __PYX_ERR(0, 23, __pyx_L1_error)
2023     }
2024     __pyx_v_cnt = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_counts.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_counts.diminfo[0].strides));
2025 
2026     /* "skbio/stats/__subsample.pyx":24
2027  *     for i in range(counts.shape[0]):
2028  *         cnt = counts[i]
2029  *         for j in range(cnt):             # <<<<<<<<<<<<<<
2030  *             unpacked[unpacked_idx] = i
2031  *             unpacked_idx += 1
2032  */
2033     __pyx_t_14 = __pyx_v_cnt;
2034     __pyx_t_15 = __pyx_t_14;
2035     for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
2036       __pyx_v_j = __pyx_t_16;
2037 
2038       /* "skbio/stats/__subsample.pyx":25
2039  *         cnt = counts[i]
2040  *         for j in range(cnt):
2041  *             unpacked[unpacked_idx] = i             # <<<<<<<<<<<<<<
2042  *             unpacked_idx += 1
2043  *
2044  */
2045       __pyx_t_17 = __pyx_v_unpacked_idx;
2046       __pyx_t_6 = -1;
2047       if (__pyx_t_17 < 0) {
2048         __pyx_t_17 += __pyx_pybuffernd_unpacked.diminfo[0].shape;
2049         if (unlikely(__pyx_t_17 < 0)) __pyx_t_6 = 0;
2050       } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_unpacked.diminfo[0].shape)) __pyx_t_6 = 0;
2051       if (unlikely(__pyx_t_6 != -1)) {
2052         __Pyx_RaiseBufferIndexError(__pyx_t_6);
2053         __PYX_ERR(0, 25, __pyx_L1_error)
2054       }
2055       *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_unpacked.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_unpacked.diminfo[0].strides) = __pyx_v_i;
2056 
2057       /* "skbio/stats/__subsample.pyx":26
2058  *         for j in range(cnt):
2059  *             unpacked[unpacked_idx] = i
2060  *             unpacked_idx += 1             # <<<<<<<<<<<<<<
2061  *
2062  *     permuted = np.random.permutation(unpacked)[:n]
2063  */
2064       __pyx_v_unpacked_idx = (__pyx_v_unpacked_idx + 1);
2065     }
2066   }
2067 
2068   /* "skbio/stats/__subsample.pyx":28
2069  *             unpacked_idx += 1
2070  *
2071  *     permuted = np.random.permutation(unpacked)[:n]             # <<<<<<<<<<<<<<
2072  *
2073  *     result = np.zeros_like(counts)
2074  */
2075   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
2076   __Pyx_GOTREF(__pyx_t_3);
2077   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_random); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
2078   __Pyx_GOTREF(__pyx_t_1);
2079   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2080   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_permutation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
2081   __Pyx_GOTREF(__pyx_t_3);
2082   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2083   __pyx_t_1 = NULL;
2084   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
2085     __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
2086     if (likely(__pyx_t_1)) {
2087       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2088       __Pyx_INCREF(__pyx_t_1);
2089       __Pyx_INCREF(function);
2090       __Pyx_DECREF_SET(__pyx_t_3, function);
2091     }
2092   }
2093   __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_v_unpacked)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_unpacked));
2094   __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
2095   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error)
2096   __Pyx_GOTREF(__pyx_t_4);
2097   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2098   __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, NULL, &__pyx_v_n, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
2099   __Pyx_GOTREF(__pyx_t_3);
2100   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2101   if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 28, __pyx_L1_error)
2102   __pyx_t_5 = ((PyArrayObject *)__pyx_t_3);
2103   {
2104     __Pyx_BufFmt_StackElem __pyx_stack[1];
2105     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_permuted.rcbuffer->pybuffer);
2106     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_permuted.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
2107     if (unlikely(__pyx_t_6 < 0)) {
2108       PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
2109       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_permuted.rcbuffer->pybuffer, (PyObject*)__pyx_v_permuted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
2110         Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
2111         __Pyx_RaiseBufferFallbackError();
2112       } else {
2113         PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
2114       }
2115       __pyx_t_9 = __pyx_t_8 = __pyx_t_7 = 0;
2116     }
2117     __pyx_pybuffernd_permuted.diminfo[0].strides = __pyx_pybuffernd_permuted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_permuted.diminfo[0].shape = __pyx_pybuffernd_permuted.rcbuffer->pybuffer.shape[0];
2118     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 28, __pyx_L1_error)
2119   }
2120   __pyx_t_5 = 0;
2121   __pyx_v_permuted = ((PyArrayObject *)__pyx_t_3);
2122   __pyx_t_3 = 0;
2123 
2124   /* "skbio/stats/__subsample.pyx":30
2125  *     permuted = np.random.permutation(unpacked)[:n]
2126  *
2127  *     result = np.zeros_like(counts)             # <<<<<<<<<<<<<<
2128  *     for idx in range(permuted.shape[0]):
2129  *         result[permuted[idx]] += 1
2130  */
2131   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error)
2132   __Pyx_GOTREF(__pyx_t_4);
2133   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
2134   __Pyx_GOTREF(__pyx_t_1);
2135   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2136   __pyx_t_4 = NULL;
2137   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
2138     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
2139     if (likely(__pyx_t_4)) {
2140       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
2141       __Pyx_INCREF(__pyx_t_4);
2142       __Pyx_INCREF(function);
2143       __Pyx_DECREF_SET(__pyx_t_1, function);
2144     }
2145   }
2146   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, ((PyObject *)__pyx_v_counts)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_counts));
2147   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2148   if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
2149   __Pyx_GOTREF(__pyx_t_3);
2150   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2151   if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 30, __pyx_L1_error)
2152   __pyx_t_5 = ((PyArrayObject *)__pyx_t_3);
2153   {
2154     __Pyx_BufFmt_StackElem __pyx_stack[1];
2155     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
2156     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
2157     if (unlikely(__pyx_t_6 < 0)) {
2158       PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
2159       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_result.rcbuffer->pybuffer, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
2160         Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
2161         __Pyx_RaiseBufferFallbackError();
2162       } else {
2163         PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
2164       }
2165       __pyx_t_7 = __pyx_t_8 = __pyx_t_9 = 0;
2166     }
2167     __pyx_pybuffernd_result.diminfo[0].strides = __pyx_pybuffernd_result.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_result.diminfo[0].shape = __pyx_pybuffernd_result.rcbuffer->pybuffer.shape[0];
2168     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 30, __pyx_L1_error)
2169   }
2170   __pyx_t_5 = 0;
2171   __pyx_v_result = ((PyArrayObject *)__pyx_t_3);
2172   __pyx_t_3 = 0;
2173 
2174   /* "skbio/stats/__subsample.pyx":31
2175  *
2176  *     result = np.zeros_like(counts)
2177  *     for idx in range(permuted.shape[0]):             # <<<<<<<<<<<<<<
2178  *         result[permuted[idx]] += 1
2179  *
2180  */
2181   __pyx_t_10 = (__pyx_v_permuted->dimensions[0]);
2182   __pyx_t_11 = __pyx_t_10;
2183   for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_11; __pyx_t_18+=1) {
2184     __pyx_v_idx = __pyx_t_18;
2185 
2186     /* "skbio/stats/__subsample.pyx":32
2187  *     result = np.zeros_like(counts)
2188  *     for idx in range(permuted.shape[0]):
2189  *         result[permuted[idx]] += 1             # <<<<<<<<<<<<<<
2190  *
2191  *     return result
2192  */
2193     __pyx_t_19 = __pyx_v_idx;
2194     __pyx_t_6 = -1;
2195     if (__pyx_t_19 < 0) {
2196       __pyx_t_19 += __pyx_pybuffernd_permuted.diminfo[0].shape;
2197       if (unlikely(__pyx_t_19 < 0)) __pyx_t_6 = 0;
2198     } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_permuted.diminfo[0].shape)) __pyx_t_6 = 0;
2199     if (unlikely(__pyx_t_6 != -1)) {
2200       __Pyx_RaiseBufferIndexError(__pyx_t_6);
2201       __PYX_ERR(0, 32, __pyx_L1_error)
2202     }
2203     __pyx_t_14 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_permuted.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_permuted.diminfo[0].strides));
2204     __pyx_t_6 = -1;
2205     if (__pyx_t_14 < 0) {
2206       __pyx_t_14 += __pyx_pybuffernd_result.diminfo[0].shape;
2207       if (unlikely(__pyx_t_14 < 0)) __pyx_t_6 = 0;
2208     } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_result.diminfo[0].shape)) __pyx_t_6 = 0;
2209     if (unlikely(__pyx_t_6 != -1)) {
2210       __Pyx_RaiseBufferIndexError(__pyx_t_6);
2211       __PYX_ERR(0, 32, __pyx_L1_error)
2212     }
2213     *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_result.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_result.diminfo[0].strides) += 1;
2214   }
2215 
2216   /* "skbio/stats/__subsample.pyx":34
2217  *         result[permuted[idx]] += 1
2218  *
2219  *     return result             # <<<<<<<<<<<<<<
2220  */
2221   __Pyx_XDECREF(__pyx_r);
2222   __Pyx_INCREF(((PyObject *)__pyx_v_result));
2223   __pyx_r = ((PyObject *)__pyx_v_result);
2224   goto __pyx_L0;
2225 
2226   /* "skbio/stats/__subsample.pyx":13
2227  *
2228  *
2229  * def _subsample_counts_without_replacement(             # <<<<<<<<<<<<<<
2230  *     cnp.ndarray[cnp.int64_t, ndim=1] counts, n, counts_sum):
2231  *     cdef:
2232  */
2233 
2234   /* function exit code */
2235   __pyx_L1_error:;
2236   __Pyx_XDECREF(__pyx_t_1);
2237   __Pyx_XDECREF(__pyx_t_2);
2238   __Pyx_XDECREF(__pyx_t_3);
2239   __Pyx_XDECREF(__pyx_t_4);
2240   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2241     __Pyx_PyThreadState_declare
2242     __Pyx_PyThreadState_assign
2243     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2244     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
2245     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_permuted.rcbuffer->pybuffer);
2246     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
2247     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unpacked.rcbuffer->pybuffer);
2248   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2249   __Pyx_AddTraceback("skbio.stats.__subsample._subsample_counts_without_replacement", __pyx_clineno, __pyx_lineno, __pyx_filename);
2250   __pyx_r = NULL;
2251   goto __pyx_L2;
2252   __pyx_L0:;
2253   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
2254   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_permuted.rcbuffer->pybuffer);
2255   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_result.rcbuffer->pybuffer);
2256   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_unpacked.rcbuffer->pybuffer);
2257   __pyx_L2:;
2258   __Pyx_XDECREF((PyObject *)__pyx_v_result);
2259   __Pyx_XDECREF((PyObject *)__pyx_v_permuted);
2260   __Pyx_XDECREF((PyObject *)__pyx_v_unpacked);
2261   __Pyx_XGIVEREF(__pyx_r);
2262   __Pyx_RefNannyFinishContext();
2263   return __pyx_r;
2264 }
2265 
2266 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
2267  *         # experimental exception made for __getbuffer__ and __releasebuffer__
2268  *         # -- the details of this may change.
2269  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
2270  *             # This implementation of getbuffer is geared towards Cython
2271  *             # requirements, and does not yet fulfill the PEP.
2272  */
2273 
2274 /* Python wrapper */
2275 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)2276 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
2277   int __pyx_r;
2278   __Pyx_RefNannyDeclarations
2279   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
2280   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
2281 
2282   /* function exit code */
2283   __Pyx_RefNannyFinishContext();
2284   return __pyx_r;
2285 }
2286 
__pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)2287 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
2288   int __pyx_v_i;
2289   int __pyx_v_ndim;
2290   int __pyx_v_endian_detector;
2291   int __pyx_v_little_endian;
2292   int __pyx_v_t;
2293   char *__pyx_v_f;
2294   PyArray_Descr *__pyx_v_descr = 0;
2295   int __pyx_v_offset;
2296   int __pyx_r;
2297   __Pyx_RefNannyDeclarations
2298   int __pyx_t_1;
2299   int __pyx_t_2;
2300   PyObject *__pyx_t_3 = NULL;
2301   int __pyx_t_4;
2302   int __pyx_t_5;
2303   int __pyx_t_6;
2304   PyArray_Descr *__pyx_t_7;
2305   PyObject *__pyx_t_8 = NULL;
2306   char *__pyx_t_9;
2307   if (__pyx_v_info == NULL) {
2308     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
2309     return -1;
2310   }
2311   __Pyx_RefNannySetupContext("__getbuffer__", 0);
2312   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
2313   __Pyx_GIVEREF(__pyx_v_info->obj);
2314 
2315   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
2316  *
2317  *             cdef int i, ndim
2318  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
2319  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
2320  *
2321  */
2322   __pyx_v_endian_detector = 1;
2323 
2324   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
2325  *             cdef int i, ndim
2326  *             cdef int endian_detector = 1
2327  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
2328  *
2329  *             ndim = PyArray_NDIM(self)
2330  */
2331   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
2332 
2333   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
2334  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
2335  *
2336  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
2337  *
2338  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
2339  */
2340   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
2341 
2342   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
2343  *             ndim = PyArray_NDIM(self)
2344  *
2345  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
2346  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
2347  *                 raise ValueError(u"ndarray is not C contiguous")
2348  */
2349   __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
2350   if (__pyx_t_2) {
2351   } else {
2352     __pyx_t_1 = __pyx_t_2;
2353     goto __pyx_L4_bool_binop_done;
2354   }
2355 
2356   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
2357  *
2358  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
2359  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
2360  *                 raise ValueError(u"ndarray is not C contiguous")
2361  *
2362  */
2363   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
2364   __pyx_t_1 = __pyx_t_2;
2365   __pyx_L4_bool_binop_done:;
2366 
2367   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
2368  *             ndim = PyArray_NDIM(self)
2369  *
2370  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
2371  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
2372  *                 raise ValueError(u"ndarray is not C contiguous")
2373  */
2374   if (unlikely(__pyx_t_1)) {
2375 
2376     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
2377  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
2378  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
2379  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
2380  *
2381  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
2382  */
2383     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 272, __pyx_L1_error)
2384     __Pyx_GOTREF(__pyx_t_3);
2385     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2386     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2387     __PYX_ERR(1, 272, __pyx_L1_error)
2388 
2389     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
2390  *             ndim = PyArray_NDIM(self)
2391  *
2392  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
2393  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
2394  *                 raise ValueError(u"ndarray is not C contiguous")
2395  */
2396   }
2397 
2398   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
2399  *                 raise ValueError(u"ndarray is not C contiguous")
2400  *
2401  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
2402  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
2403  *                 raise ValueError(u"ndarray is not Fortran contiguous")
2404  */
2405   __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
2406   if (__pyx_t_2) {
2407   } else {
2408     __pyx_t_1 = __pyx_t_2;
2409     goto __pyx_L7_bool_binop_done;
2410   }
2411 
2412   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
2413  *
2414  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
2415  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
2416  *                 raise ValueError(u"ndarray is not Fortran contiguous")
2417  *
2418  */
2419   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
2420   __pyx_t_1 = __pyx_t_2;
2421   __pyx_L7_bool_binop_done:;
2422 
2423   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
2424  *                 raise ValueError(u"ndarray is not C contiguous")
2425  *
2426  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
2427  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
2428  *                 raise ValueError(u"ndarray is not Fortran contiguous")
2429  */
2430   if (unlikely(__pyx_t_1)) {
2431 
2432     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
2433  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
2434  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
2435  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
2436  *
2437  *             info.buf = PyArray_DATA(self)
2438  */
2439     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 276, __pyx_L1_error)
2440     __Pyx_GOTREF(__pyx_t_3);
2441     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2442     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2443     __PYX_ERR(1, 276, __pyx_L1_error)
2444 
2445     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
2446  *                 raise ValueError(u"ndarray is not C contiguous")
2447  *
2448  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
2449  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
2450  *                 raise ValueError(u"ndarray is not Fortran contiguous")
2451  */
2452   }
2453 
2454   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
2455  *                 raise ValueError(u"ndarray is not Fortran contiguous")
2456  *
2457  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
2458  *             info.ndim = ndim
2459  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
2460  */
2461   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
2462 
2463   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
2464  *
2465  *             info.buf = PyArray_DATA(self)
2466  *             info.ndim = ndim             # <<<<<<<<<<<<<<
2467  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
2468  *                 # Allocate new buffer for strides and shape info.
2469  */
2470   __pyx_v_info->ndim = __pyx_v_ndim;
2471 
2472   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
2473  *             info.buf = PyArray_DATA(self)
2474  *             info.ndim = ndim
2475  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
2476  *                 # Allocate new buffer for strides and shape info.
2477  *                 # This is allocated as one block, strides first.
2478  */
2479   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
2480   if (__pyx_t_1) {
2481 
2482     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
2483  *                 # Allocate new buffer for strides and shape info.
2484  *                 # This is allocated as one block, strides first.
2485  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)             # <<<<<<<<<<<<<<
2486  *                 info.shape = info.strides + ndim
2487  *                 for i in range(ndim):
2488  */
2489     __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
2490 
2491     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
2492  *                 # This is allocated as one block, strides first.
2493  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
2494  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
2495  *                 for i in range(ndim):
2496  *                     info.strides[i] = PyArray_STRIDES(self)[i]
2497  */
2498     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
2499 
2500     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":285
2501  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
2502  *                 info.shape = info.strides + ndim
2503  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
2504  *                     info.strides[i] = PyArray_STRIDES(self)[i]
2505  *                     info.shape[i] = PyArray_DIMS(self)[i]
2506  */
2507     __pyx_t_4 = __pyx_v_ndim;
2508     __pyx_t_5 = __pyx_t_4;
2509     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
2510       __pyx_v_i = __pyx_t_6;
2511 
2512       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
2513  *                 info.shape = info.strides + ndim
2514  *                 for i in range(ndim):
2515  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
2516  *                     info.shape[i] = PyArray_DIMS(self)[i]
2517  *             else:
2518  */
2519       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
2520 
2521       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":287
2522  *                 for i in range(ndim):
2523  *                     info.strides[i] = PyArray_STRIDES(self)[i]
2524  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
2525  *             else:
2526  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
2527  */
2528       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
2529     }
2530 
2531     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
2532  *             info.buf = PyArray_DATA(self)
2533  *             info.ndim = ndim
2534  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
2535  *                 # Allocate new buffer for strides and shape info.
2536  *                 # This is allocated as one block, strides first.
2537  */
2538     goto __pyx_L9;
2539   }
2540 
2541   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
2542  *                     info.shape[i] = PyArray_DIMS(self)[i]
2543  *             else:
2544  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
2545  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
2546  *             info.suboffsets = NULL
2547  */
2548   /*else*/ {
2549     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
2550 
2551     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
2552  *             else:
2553  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
2554  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
2555  *             info.suboffsets = NULL
2556  *             info.itemsize = PyArray_ITEMSIZE(self)
2557  */
2558     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
2559   }
2560   __pyx_L9:;
2561 
2562   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
2563  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
2564  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
2565  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
2566  *             info.itemsize = PyArray_ITEMSIZE(self)
2567  *             info.readonly = not PyArray_ISWRITEABLE(self)
2568  */
2569   __pyx_v_info->suboffsets = NULL;
2570 
2571   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
2572  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
2573  *             info.suboffsets = NULL
2574  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
2575  *             info.readonly = not PyArray_ISWRITEABLE(self)
2576  *
2577  */
2578   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
2579 
2580   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
2581  *             info.suboffsets = NULL
2582  *             info.itemsize = PyArray_ITEMSIZE(self)
2583  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
2584  *
2585  *             cdef int t
2586  */
2587   __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
2588 
2589   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":296
2590  *
2591  *             cdef int t
2592  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
2593  *             cdef dtype descr = <dtype>PyArray_DESCR(self)
2594  *             cdef int offset
2595  */
2596   __pyx_v_f = NULL;
2597 
2598   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
2599  *             cdef int t
2600  *             cdef char* f = NULL
2601  *             cdef dtype descr = <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
2602  *             cdef int offset
2603  *
2604  */
2605   __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
2606   __pyx_t_3 = ((PyObject *)__pyx_t_7);
2607   __Pyx_INCREF(__pyx_t_3);
2608   __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
2609   __pyx_t_3 = 0;
2610 
2611   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":300
2612  *             cdef int offset
2613  *
2614  *             info.obj = self             # <<<<<<<<<<<<<<
2615  *
2616  *             if not PyDataType_HASFIELDS(descr):
2617  */
2618   __Pyx_INCREF(((PyObject *)__pyx_v_self));
2619   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
2620   __Pyx_GOTREF(__pyx_v_info->obj);
2621   __Pyx_DECREF(__pyx_v_info->obj);
2622   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
2623 
2624   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
2625  *             info.obj = self
2626  *
2627  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
2628  *                 t = descr.type_num
2629  *                 if ((descr.byteorder == c'>' and little_endian) or
2630  */
2631   __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
2632   if (__pyx_t_1) {
2633 
2634     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":303
2635  *
2636  *             if not PyDataType_HASFIELDS(descr):
2637  *                 t = descr.type_num             # <<<<<<<<<<<<<<
2638  *                 if ((descr.byteorder == c'>' and little_endian) or
2639  *                     (descr.byteorder == c'<' and not little_endian)):
2640  */
2641     __pyx_t_4 = __pyx_v_descr->type_num;
2642     __pyx_v_t = __pyx_t_4;
2643 
2644     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
2645  *             if not PyDataType_HASFIELDS(descr):
2646  *                 t = descr.type_num
2647  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
2648  *                     (descr.byteorder == c'<' and not little_endian)):
2649  *                     raise ValueError(u"Non-native byte order not supported")
2650  */
2651     __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
2652     if (!__pyx_t_2) {
2653       goto __pyx_L15_next_or;
2654     } else {
2655     }
2656     __pyx_t_2 = (__pyx_v_little_endian != 0);
2657     if (!__pyx_t_2) {
2658     } else {
2659       __pyx_t_1 = __pyx_t_2;
2660       goto __pyx_L14_bool_binop_done;
2661     }
2662     __pyx_L15_next_or:;
2663 
2664     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":305
2665  *                 t = descr.type_num
2666  *                 if ((descr.byteorder == c'>' and little_endian) or
2667  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
2668  *                     raise ValueError(u"Non-native byte order not supported")
2669  *                 if   t == NPY_BYTE:        f = "b"
2670  */
2671     __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
2672     if (__pyx_t_2) {
2673     } else {
2674       __pyx_t_1 = __pyx_t_2;
2675       goto __pyx_L14_bool_binop_done;
2676     }
2677     __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
2678     __pyx_t_1 = __pyx_t_2;
2679     __pyx_L14_bool_binop_done:;
2680 
2681     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
2682  *             if not PyDataType_HASFIELDS(descr):
2683  *                 t = descr.type_num
2684  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
2685  *                     (descr.byteorder == c'<' and not little_endian)):
2686  *                     raise ValueError(u"Non-native byte order not supported")
2687  */
2688     if (unlikely(__pyx_t_1)) {
2689 
2690       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
2691  *                 if ((descr.byteorder == c'>' and little_endian) or
2692  *                     (descr.byteorder == c'<' and not little_endian)):
2693  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
2694  *                 if   t == NPY_BYTE:        f = "b"
2695  *                 elif t == NPY_UBYTE:       f = "B"
2696  */
2697       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 306, __pyx_L1_error)
2698       __Pyx_GOTREF(__pyx_t_3);
2699       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2700       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2701       __PYX_ERR(1, 306, __pyx_L1_error)
2702 
2703       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
2704  *             if not PyDataType_HASFIELDS(descr):
2705  *                 t = descr.type_num
2706  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
2707  *                     (descr.byteorder == c'<' and not little_endian)):
2708  *                     raise ValueError(u"Non-native byte order not supported")
2709  */
2710     }
2711 
2712     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":307
2713  *                     (descr.byteorder == c'<' and not little_endian)):
2714  *                     raise ValueError(u"Non-native byte order not supported")
2715  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
2716  *                 elif t == NPY_UBYTE:       f = "B"
2717  *                 elif t == NPY_SHORT:       f = "h"
2718  */
2719     switch (__pyx_v_t) {
2720       case NPY_BYTE:
2721       __pyx_v_f = ((char *)"b");
2722       break;
2723       case NPY_UBYTE:
2724 
2725       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":308
2726  *                     raise ValueError(u"Non-native byte order not supported")
2727  *                 if   t == NPY_BYTE:        f = "b"
2728  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
2729  *                 elif t == NPY_SHORT:       f = "h"
2730  *                 elif t == NPY_USHORT:      f = "H"
2731  */
2732       __pyx_v_f = ((char *)"B");
2733       break;
2734       case NPY_SHORT:
2735 
2736       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":309
2737  *                 if   t == NPY_BYTE:        f = "b"
2738  *                 elif t == NPY_UBYTE:       f = "B"
2739  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
2740  *                 elif t == NPY_USHORT:      f = "H"
2741  *                 elif t == NPY_INT:         f = "i"
2742  */
2743       __pyx_v_f = ((char *)"h");
2744       break;
2745       case NPY_USHORT:
2746 
2747       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":310
2748  *                 elif t == NPY_UBYTE:       f = "B"
2749  *                 elif t == NPY_SHORT:       f = "h"
2750  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
2751  *                 elif t == NPY_INT:         f = "i"
2752  *                 elif t == NPY_UINT:        f = "I"
2753  */
2754       __pyx_v_f = ((char *)"H");
2755       break;
2756       case NPY_INT:
2757 
2758       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":311
2759  *                 elif t == NPY_SHORT:       f = "h"
2760  *                 elif t == NPY_USHORT:      f = "H"
2761  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
2762  *                 elif t == NPY_UINT:        f = "I"
2763  *                 elif t == NPY_LONG:        f = "l"
2764  */
2765       __pyx_v_f = ((char *)"i");
2766       break;
2767       case NPY_UINT:
2768 
2769       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":312
2770  *                 elif t == NPY_USHORT:      f = "H"
2771  *                 elif t == NPY_INT:         f = "i"
2772  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
2773  *                 elif t == NPY_LONG:        f = "l"
2774  *                 elif t == NPY_ULONG:       f = "L"
2775  */
2776       __pyx_v_f = ((char *)"I");
2777       break;
2778       case NPY_LONG:
2779 
2780       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":313
2781  *                 elif t == NPY_INT:         f = "i"
2782  *                 elif t == NPY_UINT:        f = "I"
2783  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
2784  *                 elif t == NPY_ULONG:       f = "L"
2785  *                 elif t == NPY_LONGLONG:    f = "q"
2786  */
2787       __pyx_v_f = ((char *)"l");
2788       break;
2789       case NPY_ULONG:
2790 
2791       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":314
2792  *                 elif t == NPY_UINT:        f = "I"
2793  *                 elif t == NPY_LONG:        f = "l"
2794  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
2795  *                 elif t == NPY_LONGLONG:    f = "q"
2796  *                 elif t == NPY_ULONGLONG:   f = "Q"
2797  */
2798       __pyx_v_f = ((char *)"L");
2799       break;
2800       case NPY_LONGLONG:
2801 
2802       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":315
2803  *                 elif t == NPY_LONG:        f = "l"
2804  *                 elif t == NPY_ULONG:       f = "L"
2805  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
2806  *                 elif t == NPY_ULONGLONG:   f = "Q"
2807  *                 elif t == NPY_FLOAT:       f = "f"
2808  */
2809       __pyx_v_f = ((char *)"q");
2810       break;
2811       case NPY_ULONGLONG:
2812 
2813       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":316
2814  *                 elif t == NPY_ULONG:       f = "L"
2815  *                 elif t == NPY_LONGLONG:    f = "q"
2816  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
2817  *                 elif t == NPY_FLOAT:       f = "f"
2818  *                 elif t == NPY_DOUBLE:      f = "d"
2819  */
2820       __pyx_v_f = ((char *)"Q");
2821       break;
2822       case NPY_FLOAT:
2823 
2824       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":317
2825  *                 elif t == NPY_LONGLONG:    f = "q"
2826  *                 elif t == NPY_ULONGLONG:   f = "Q"
2827  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
2828  *                 elif t == NPY_DOUBLE:      f = "d"
2829  *                 elif t == NPY_LONGDOUBLE:  f = "g"
2830  */
2831       __pyx_v_f = ((char *)"f");
2832       break;
2833       case NPY_DOUBLE:
2834 
2835       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":318
2836  *                 elif t == NPY_ULONGLONG:   f = "Q"
2837  *                 elif t == NPY_FLOAT:       f = "f"
2838  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
2839  *                 elif t == NPY_LONGDOUBLE:  f = "g"
2840  *                 elif t == NPY_CFLOAT:      f = "Zf"
2841  */
2842       __pyx_v_f = ((char *)"d");
2843       break;
2844       case NPY_LONGDOUBLE:
2845 
2846       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":319
2847  *                 elif t == NPY_FLOAT:       f = "f"
2848  *                 elif t == NPY_DOUBLE:      f = "d"
2849  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
2850  *                 elif t == NPY_CFLOAT:      f = "Zf"
2851  *                 elif t == NPY_CDOUBLE:     f = "Zd"
2852  */
2853       __pyx_v_f = ((char *)"g");
2854       break;
2855       case NPY_CFLOAT:
2856 
2857       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":320
2858  *                 elif t == NPY_DOUBLE:      f = "d"
2859  *                 elif t == NPY_LONGDOUBLE:  f = "g"
2860  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
2861  *                 elif t == NPY_CDOUBLE:     f = "Zd"
2862  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
2863  */
2864       __pyx_v_f = ((char *)"Zf");
2865       break;
2866       case NPY_CDOUBLE:
2867 
2868       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":321
2869  *                 elif t == NPY_LONGDOUBLE:  f = "g"
2870  *                 elif t == NPY_CFLOAT:      f = "Zf"
2871  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
2872  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
2873  *                 elif t == NPY_OBJECT:      f = "O"
2874  */
2875       __pyx_v_f = ((char *)"Zd");
2876       break;
2877       case NPY_CLONGDOUBLE:
2878 
2879       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":322
2880  *                 elif t == NPY_CFLOAT:      f = "Zf"
2881  *                 elif t == NPY_CDOUBLE:     f = "Zd"
2882  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
2883  *                 elif t == NPY_OBJECT:      f = "O"
2884  *                 else:
2885  */
2886       __pyx_v_f = ((char *)"Zg");
2887       break;
2888       case NPY_OBJECT:
2889 
2890       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":323
2891  *                 elif t == NPY_CDOUBLE:     f = "Zd"
2892  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
2893  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
2894  *                 else:
2895  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
2896  */
2897       __pyx_v_f = ((char *)"O");
2898       break;
2899       default:
2900 
2901       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":325
2902  *                 elif t == NPY_OBJECT:      f = "O"
2903  *                 else:
2904  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
2905  *                 info.format = f
2906  *                 return
2907  */
2908       __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
2909       __Pyx_GOTREF(__pyx_t_3);
2910       __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 325, __pyx_L1_error)
2911       __Pyx_GOTREF(__pyx_t_8);
2912       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2913       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
2914       __Pyx_GOTREF(__pyx_t_3);
2915       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2916       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2917       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2918       __PYX_ERR(1, 325, __pyx_L1_error)
2919       break;
2920     }
2921 
2922     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":326
2923  *                 else:
2924  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
2925  *                 info.format = f             # <<<<<<<<<<<<<<
2926  *                 return
2927  *             else:
2928  */
2929     __pyx_v_info->format = __pyx_v_f;
2930 
2931     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":327
2932  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
2933  *                 info.format = f
2934  *                 return             # <<<<<<<<<<<<<<
2935  *             else:
2936  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
2937  */
2938     __pyx_r = 0;
2939     goto __pyx_L0;
2940 
2941     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
2942  *             info.obj = self
2943  *
2944  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
2945  *                 t = descr.type_num
2946  *                 if ((descr.byteorder == c'>' and little_endian) or
2947  */
2948   }
2949 
2950   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":329
2951  *                 return
2952  *             else:
2953  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
2954  *                 info.format[0] = c'^' # Native data types, manual alignment
2955  *                 offset = 0
2956  */
2957   /*else*/ {
2958     __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
2959 
2960     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":330
2961  *             else:
2962  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
2963  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
2964  *                 offset = 0
2965  *                 f = _util_dtypestring(descr, info.format + 1,
2966  */
2967     (__pyx_v_info->format[0]) = '^';
2968 
2969     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":331
2970  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
2971  *                 info.format[0] = c'^' # Native data types, manual alignment
2972  *                 offset = 0             # <<<<<<<<<<<<<<
2973  *                 f = _util_dtypestring(descr, info.format + 1,
2974  *                                       info.format + _buffer_format_string_len,
2975  */
2976     __pyx_v_offset = 0;
2977 
2978     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":332
2979  *                 info.format[0] = c'^' # Native data types, manual alignment
2980  *                 offset = 0
2981  *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
2982  *                                       info.format + _buffer_format_string_len,
2983  *                                       &offset)
2984  */
2985     __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 332, __pyx_L1_error)
2986     __pyx_v_f = __pyx_t_9;
2987 
2988     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":335
2989  *                                       info.format + _buffer_format_string_len,
2990  *                                       &offset)
2991  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
2992  *
2993  *         def __releasebuffer__(ndarray self, Py_buffer* info):
2994  */
2995     (__pyx_v_f[0]) = '\x00';
2996   }
2997 
2998   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
2999  *         # experimental exception made for __getbuffer__ and __releasebuffer__
3000  *         # -- the details of this may change.
3001  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
3002  *             # This implementation of getbuffer is geared towards Cython
3003  *             # requirements, and does not yet fulfill the PEP.
3004  */
3005 
3006   /* function exit code */
3007   __pyx_r = 0;
3008   goto __pyx_L0;
3009   __pyx_L1_error:;
3010   __Pyx_XDECREF(__pyx_t_3);
3011   __Pyx_XDECREF(__pyx_t_8);
3012   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3013   __pyx_r = -1;
3014   if (__pyx_v_info->obj != NULL) {
3015     __Pyx_GOTREF(__pyx_v_info->obj);
3016     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
3017   }
3018   goto __pyx_L2;
3019   __pyx_L0:;
3020   if (__pyx_v_info->obj == Py_None) {
3021     __Pyx_GOTREF(__pyx_v_info->obj);
3022     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
3023   }
3024   __pyx_L2:;
3025   __Pyx_XDECREF((PyObject *)__pyx_v_descr);
3026   __Pyx_RefNannyFinishContext();
3027   return __pyx_r;
3028 }
3029 
3030 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
3031  *                 f[0] = c'\0' # Terminate format string
3032  *
3033  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
3034  *             if PyArray_HASFIELDS(self):
3035  *                 PyObject_Free(info.format)
3036  */
3037 
3038 /* Python wrapper */
3039 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
__pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info)3040 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
3041   __Pyx_RefNannyDeclarations
3042   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
3043   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
3044 
3045   /* function exit code */
3046   __Pyx_RefNannyFinishContext();
3047 }
3048 
__pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info)3049 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
3050   __Pyx_RefNannyDeclarations
3051   int __pyx_t_1;
3052   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
3053 
3054   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
3055  *
3056  *         def __releasebuffer__(ndarray self, Py_buffer* info):
3057  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
3058  *                 PyObject_Free(info.format)
3059  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
3060  */
3061   __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
3062   if (__pyx_t_1) {
3063 
3064     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":339
3065  *         def __releasebuffer__(ndarray self, Py_buffer* info):
3066  *             if PyArray_HASFIELDS(self):
3067  *                 PyObject_Free(info.format)             # <<<<<<<<<<<<<<
3068  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
3069  *                 PyObject_Free(info.strides)
3070  */
3071     PyObject_Free(__pyx_v_info->format);
3072 
3073     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
3074  *
3075  *         def __releasebuffer__(ndarray self, Py_buffer* info):
3076  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
3077  *                 PyObject_Free(info.format)
3078  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
3079  */
3080   }
3081 
3082   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
3083  *             if PyArray_HASFIELDS(self):
3084  *                 PyObject_Free(info.format)
3085  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
3086  *                 PyObject_Free(info.strides)
3087  *                 # info.shape was stored after info.strides in the same block
3088  */
3089   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
3090   if (__pyx_t_1) {
3091 
3092     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":341
3093  *                 PyObject_Free(info.format)
3094  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
3095  *                 PyObject_Free(info.strides)             # <<<<<<<<<<<<<<
3096  *                 # info.shape was stored after info.strides in the same block
3097  *
3098  */
3099     PyObject_Free(__pyx_v_info->strides);
3100 
3101     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
3102  *             if PyArray_HASFIELDS(self):
3103  *                 PyObject_Free(info.format)
3104  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
3105  *                 PyObject_Free(info.strides)
3106  *                 # info.shape was stored after info.strides in the same block
3107  */
3108   }
3109 
3110   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
3111  *                 f[0] = c'\0' # Terminate format string
3112  *
3113  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
3114  *             if PyArray_HASFIELDS(self):
3115  *                 PyObject_Free(info.format)
3116  */
3117 
3118   /* function exit code */
3119   __Pyx_RefNannyFinishContext();
3120 }
3121 
3122 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
3123  * ctypedef npy_cdouble     complex_t
3124  *
3125  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
3126  *     return PyArray_MultiIterNew(1, <void*>a)
3127  *
3128  */
3129 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)3130 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
3131   PyObject *__pyx_r = NULL;
3132   __Pyx_RefNannyDeclarations
3133   PyObject *__pyx_t_1 = NULL;
3134   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
3135 
3136   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
3137  *
3138  * cdef inline object PyArray_MultiIterNew1(a):
3139  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
3140  *
3141  * cdef inline object PyArray_MultiIterNew2(a, b):
3142  */
3143   __Pyx_XDECREF(__pyx_r);
3144   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 822, __pyx_L1_error)
3145   __Pyx_GOTREF(__pyx_t_1);
3146   __pyx_r = __pyx_t_1;
3147   __pyx_t_1 = 0;
3148   goto __pyx_L0;
3149 
3150   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
3151  * ctypedef npy_cdouble     complex_t
3152  *
3153  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
3154  *     return PyArray_MultiIterNew(1, <void*>a)
3155  *
3156  */
3157 
3158   /* function exit code */
3159   __pyx_L1_error:;
3160   __Pyx_XDECREF(__pyx_t_1);
3161   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
3162   __pyx_r = 0;
3163   __pyx_L0:;
3164   __Pyx_XGIVEREF(__pyx_r);
3165   __Pyx_RefNannyFinishContext();
3166   return __pyx_r;
3167 }
3168 
3169 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
3170  *     return PyArray_MultiIterNew(1, <void*>a)
3171  *
3172  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
3173  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
3174  *
3175  */
3176 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)3177 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
3178   PyObject *__pyx_r = NULL;
3179   __Pyx_RefNannyDeclarations
3180   PyObject *__pyx_t_1 = NULL;
3181   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
3182 
3183   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":825
3184  *
3185  * cdef inline object PyArray_MultiIterNew2(a, b):
3186  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
3187  *
3188  * cdef inline object PyArray_MultiIterNew3(a, b, c):
3189  */
3190   __Pyx_XDECREF(__pyx_r);
3191   __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 825, __pyx_L1_error)
3192   __Pyx_GOTREF(__pyx_t_1);
3193   __pyx_r = __pyx_t_1;
3194   __pyx_t_1 = 0;
3195   goto __pyx_L0;
3196 
3197   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
3198  *     return PyArray_MultiIterNew(1, <void*>a)
3199  *
3200  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
3201  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
3202  *
3203  */
3204 
3205   /* function exit code */
3206   __pyx_L1_error:;
3207   __Pyx_XDECREF(__pyx_t_1);
3208   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
3209   __pyx_r = 0;
3210   __pyx_L0:;
3211   __Pyx_XGIVEREF(__pyx_r);
3212   __Pyx_RefNannyFinishContext();
3213   return __pyx_r;
3214 }
3215 
3216 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
3217  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
3218  *
3219  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
3220  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
3221  *
3222  */
3223 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)3224 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
3225   PyObject *__pyx_r = NULL;
3226   __Pyx_RefNannyDeclarations
3227   PyObject *__pyx_t_1 = NULL;
3228   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
3229 
3230   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
3231  *
3232  * cdef inline object PyArray_MultiIterNew3(a, b, c):
3233  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
3234  *
3235  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
3236  */
3237   __Pyx_XDECREF(__pyx_r);
3238   __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(1, 828, __pyx_L1_error)
3239   __Pyx_GOTREF(__pyx_t_1);
3240   __pyx_r = __pyx_t_1;
3241   __pyx_t_1 = 0;
3242   goto __pyx_L0;
3243 
3244   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
3245  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
3246  *
3247  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
3248  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
3249  *
3250  */
3251 
3252   /* function exit code */
3253   __pyx_L1_error:;
3254   __Pyx_XDECREF(__pyx_t_1);
3255   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
3256   __pyx_r = 0;
3257   __pyx_L0:;
3258   __Pyx_XGIVEREF(__pyx_r);
3259   __Pyx_RefNannyFinishContext();
3260   return __pyx_r;
3261 }
3262 
3263 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
3264  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
3265  *
3266  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
3267  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
3268  *
3269  */
3270 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)3271 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) {
3272   PyObject *__pyx_r = NULL;
3273   __Pyx_RefNannyDeclarations
3274   PyObject *__pyx_t_1 = NULL;
3275   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
3276 
3277   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
3278  *
3279  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
3280  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
3281  *
3282  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
3283  */
3284   __Pyx_XDECREF(__pyx_r);
3285   __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(1, 831, __pyx_L1_error)
3286   __Pyx_GOTREF(__pyx_t_1);
3287   __pyx_r = __pyx_t_1;
3288   __pyx_t_1 = 0;
3289   goto __pyx_L0;
3290 
3291   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
3292  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
3293  *
3294  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
3295  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
3296  *
3297  */
3298 
3299   /* function exit code */
3300   __pyx_L1_error:;
3301   __Pyx_XDECREF(__pyx_t_1);
3302   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
3303   __pyx_r = 0;
3304   __pyx_L0:;
3305   __Pyx_XGIVEREF(__pyx_r);
3306   __Pyx_RefNannyFinishContext();
3307   return __pyx_r;
3308 }
3309 
3310 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
3311  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
3312  *
3313  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
3314  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
3315  *
3316  */
3317 
__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)3318 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) {
3319   PyObject *__pyx_r = NULL;
3320   __Pyx_RefNannyDeclarations
3321   PyObject *__pyx_t_1 = NULL;
3322   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
3323 
3324   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
3325  *
3326  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
3327  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
3328  *
3329  * cdef inline tuple PyDataType_SHAPE(dtype d):
3330  */
3331   __Pyx_XDECREF(__pyx_r);
3332   __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(1, 834, __pyx_L1_error)
3333   __Pyx_GOTREF(__pyx_t_1);
3334   __pyx_r = __pyx_t_1;
3335   __pyx_t_1 = 0;
3336   goto __pyx_L0;
3337 
3338   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
3339  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
3340  *
3341  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
3342  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
3343  *
3344  */
3345 
3346   /* function exit code */
3347   __pyx_L1_error:;
3348   __Pyx_XDECREF(__pyx_t_1);
3349   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
3350   __pyx_r = 0;
3351   __pyx_L0:;
3352   __Pyx_XGIVEREF(__pyx_r);
3353   __Pyx_RefNannyFinishContext();
3354   return __pyx_r;
3355 }
3356 
3357 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
3358  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
3359  *
3360  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
3361  *     if PyDataType_HASSUBARRAY(d):
3362  *         return <tuple>d.subarray.shape
3363  */
3364 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)3365 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
3366   PyObject *__pyx_r = NULL;
3367   __Pyx_RefNannyDeclarations
3368   int __pyx_t_1;
3369   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
3370 
3371   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
3372  *
3373  * cdef inline tuple PyDataType_SHAPE(dtype d):
3374  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
3375  *         return <tuple>d.subarray.shape
3376  *     else:
3377  */
3378   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
3379   if (__pyx_t_1) {
3380 
3381     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
3382  * cdef inline tuple PyDataType_SHAPE(dtype d):
3383  *     if PyDataType_HASSUBARRAY(d):
3384  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
3385  *     else:
3386  *         return ()
3387  */
3388     __Pyx_XDECREF(__pyx_r);
3389     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
3390     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
3391     goto __pyx_L0;
3392 
3393     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
3394  *
3395  * cdef inline tuple PyDataType_SHAPE(dtype d):
3396  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
3397  *         return <tuple>d.subarray.shape
3398  *     else:
3399  */
3400   }
3401 
3402   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
3403  *         return <tuple>d.subarray.shape
3404  *     else:
3405  *         return ()             # <<<<<<<<<<<<<<
3406  *
3407  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
3408  */
3409   /*else*/ {
3410     __Pyx_XDECREF(__pyx_r);
3411     __Pyx_INCREF(__pyx_empty_tuple);
3412     __pyx_r = __pyx_empty_tuple;
3413     goto __pyx_L0;
3414   }
3415 
3416   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
3417  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
3418  *
3419  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
3420  *     if PyDataType_HASSUBARRAY(d):
3421  *         return <tuple>d.subarray.shape
3422  */
3423 
3424   /* function exit code */
3425   __pyx_L0:;
3426   __Pyx_XGIVEREF(__pyx_r);
3427   __Pyx_RefNannyFinishContext();
3428   return __pyx_r;
3429 }
3430 
3431 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
3432  *         return ()
3433  *
3434  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
3435  *     # Recursive utility function used in __getbuffer__ to get format
3436  *     # string. The new location in the format string is returned.
3437  */
3438 
__pyx_f_5numpy__util_dtypestring(PyArray_Descr * __pyx_v_descr,char * __pyx_v_f,char * __pyx_v_end,int * __pyx_v_offset)3439 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
3440   PyArray_Descr *__pyx_v_child = 0;
3441   int __pyx_v_endian_detector;
3442   int __pyx_v_little_endian;
3443   PyObject *__pyx_v_fields = 0;
3444   PyObject *__pyx_v_childname = NULL;
3445   PyObject *__pyx_v_new_offset = NULL;
3446   PyObject *__pyx_v_t = NULL;
3447   char *__pyx_r;
3448   __Pyx_RefNannyDeclarations
3449   PyObject *__pyx_t_1 = NULL;
3450   Py_ssize_t __pyx_t_2;
3451   PyObject *__pyx_t_3 = NULL;
3452   PyObject *__pyx_t_4 = NULL;
3453   int __pyx_t_5;
3454   int __pyx_t_6;
3455   int __pyx_t_7;
3456   long __pyx_t_8;
3457   char *__pyx_t_9;
3458   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
3459 
3460   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":847
3461  *
3462  *     cdef dtype child
3463  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
3464  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
3465  *     cdef tuple fields
3466  */
3467   __pyx_v_endian_detector = 1;
3468 
3469   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":848
3470  *     cdef dtype child
3471  *     cdef int endian_detector = 1
3472  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
3473  *     cdef tuple fields
3474  *
3475  */
3476   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
3477 
3478   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
3479  *     cdef tuple fields
3480  *
3481  *     for childname in descr.names:             # <<<<<<<<<<<<<<
3482  *         fields = descr.fields[childname]
3483  *         child, new_offset = fields
3484  */
3485   if (unlikely(__pyx_v_descr->names == Py_None)) {
3486     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
3487     __PYX_ERR(1, 851, __pyx_L1_error)
3488   }
3489   __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
3490   for (;;) {
3491     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
3492     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3493     __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 851, __pyx_L1_error)
3494     #else
3495     __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error)
3496     __Pyx_GOTREF(__pyx_t_3);
3497     #endif
3498     __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
3499     __pyx_t_3 = 0;
3500 
3501     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":852
3502  *
3503  *     for childname in descr.names:
3504  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
3505  *         child, new_offset = fields
3506  *
3507  */
3508     if (unlikely(__pyx_v_descr->fields == Py_None)) {
3509       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
3510       __PYX_ERR(1, 852, __pyx_L1_error)
3511     }
3512     __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error)
3513     __Pyx_GOTREF(__pyx_t_3);
3514     if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 852, __pyx_L1_error)
3515     __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
3516     __pyx_t_3 = 0;
3517 
3518     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":853
3519  *     for childname in descr.names:
3520  *         fields = descr.fields[childname]
3521  *         child, new_offset = fields             # <<<<<<<<<<<<<<
3522  *
3523  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
3524  */
3525     if (likely(__pyx_v_fields != Py_None)) {
3526       PyObject* sequence = __pyx_v_fields;
3527       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
3528       if (unlikely(size != 2)) {
3529         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
3530         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
3531         __PYX_ERR(1, 853, __pyx_L1_error)
3532       }
3533       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3534       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
3535       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
3536       __Pyx_INCREF(__pyx_t_3);
3537       __Pyx_INCREF(__pyx_t_4);
3538       #else
3539       __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 853, __pyx_L1_error)
3540       __Pyx_GOTREF(__pyx_t_3);
3541       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 853, __pyx_L1_error)
3542       __Pyx_GOTREF(__pyx_t_4);
3543       #endif
3544     } else {
3545       __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 853, __pyx_L1_error)
3546     }
3547     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 853, __pyx_L1_error)
3548     __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
3549     __pyx_t_3 = 0;
3550     __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
3551     __pyx_t_4 = 0;
3552 
3553     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
3554  *         child, new_offset = fields
3555  *
3556  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
3557  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
3558  *
3559  */
3560     __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 855, __pyx_L1_error)
3561     __Pyx_GOTREF(__pyx_t_4);
3562     __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error)
3563     __Pyx_GOTREF(__pyx_t_3);
3564     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3565     __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 855, __pyx_L1_error)
3566     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3567     __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
3568     if (unlikely(__pyx_t_6)) {
3569 
3570       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
3571  *
3572  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
3573  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
3574  *
3575  *         if ((child.byteorder == c'>' and little_endian) or
3576  */
3577       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 856, __pyx_L1_error)
3578       __Pyx_GOTREF(__pyx_t_3);
3579       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3580       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3581       __PYX_ERR(1, 856, __pyx_L1_error)
3582 
3583       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
3584  *         child, new_offset = fields
3585  *
3586  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
3587  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
3588  *
3589  */
3590     }
3591 
3592     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
3593  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
3594  *
3595  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
3596  *             (child.byteorder == c'<' and not little_endian)):
3597  *             raise ValueError(u"Non-native byte order not supported")
3598  */
3599     __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
3600     if (!__pyx_t_7) {
3601       goto __pyx_L8_next_or;
3602     } else {
3603     }
3604     __pyx_t_7 = (__pyx_v_little_endian != 0);
3605     if (!__pyx_t_7) {
3606     } else {
3607       __pyx_t_6 = __pyx_t_7;
3608       goto __pyx_L7_bool_binop_done;
3609     }
3610     __pyx_L8_next_or:;
3611 
3612     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":859
3613  *
3614  *         if ((child.byteorder == c'>' and little_endian) or
3615  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
3616  *             raise ValueError(u"Non-native byte order not supported")
3617  *             # One could encode it in the format string and have Cython
3618  */
3619     __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
3620     if (__pyx_t_7) {
3621     } else {
3622       __pyx_t_6 = __pyx_t_7;
3623       goto __pyx_L7_bool_binop_done;
3624     }
3625     __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
3626     __pyx_t_6 = __pyx_t_7;
3627     __pyx_L7_bool_binop_done:;
3628 
3629     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
3630  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
3631  *
3632  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
3633  *             (child.byteorder == c'<' and not little_endian)):
3634  *             raise ValueError(u"Non-native byte order not supported")
3635  */
3636     if (unlikely(__pyx_t_6)) {
3637 
3638       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":860
3639  *         if ((child.byteorder == c'>' and little_endian) or
3640  *             (child.byteorder == c'<' and not little_endian)):
3641  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
3642  *             # One could encode it in the format string and have Cython
3643  *             # complain instead, BUT: < and > in format strings also imply
3644  */
3645       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 860, __pyx_L1_error)
3646       __Pyx_GOTREF(__pyx_t_3);
3647       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3648       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3649       __PYX_ERR(1, 860, __pyx_L1_error)
3650 
3651       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
3652  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
3653  *
3654  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
3655  *             (child.byteorder == c'<' and not little_endian)):
3656  *             raise ValueError(u"Non-native byte order not supported")
3657  */
3658     }
3659 
3660     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":870
3661  *
3662  *         # Output padding bytes
3663  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
3664  *             f[0] = 120 # "x"; pad byte
3665  *             f += 1
3666  */
3667     while (1) {
3668       __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 870, __pyx_L1_error)
3669       __Pyx_GOTREF(__pyx_t_3);
3670       __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 870, __pyx_L1_error)
3671       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3672       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 870, __pyx_L1_error)
3673       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3674       if (!__pyx_t_6) break;
3675 
3676       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":871
3677  *         # Output padding bytes
3678  *         while offset[0] < new_offset:
3679  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
3680  *             f += 1
3681  *             offset[0] += 1
3682  */
3683       (__pyx_v_f[0]) = 0x78;
3684 
3685       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":872
3686  *         while offset[0] < new_offset:
3687  *             f[0] = 120 # "x"; pad byte
3688  *             f += 1             # <<<<<<<<<<<<<<
3689  *             offset[0] += 1
3690  *
3691  */
3692       __pyx_v_f = (__pyx_v_f + 1);
3693 
3694       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":873
3695  *             f[0] = 120 # "x"; pad byte
3696  *             f += 1
3697  *             offset[0] += 1             # <<<<<<<<<<<<<<
3698  *
3699  *         offset[0] += child.itemsize
3700  */
3701       __pyx_t_8 = 0;
3702       (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
3703     }
3704 
3705     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":875
3706  *             offset[0] += 1
3707  *
3708  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
3709  *
3710  *         if not PyDataType_HASFIELDS(child):
3711  */
3712     __pyx_t_8 = 0;
3713     (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
3714 
3715     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
3716  *         offset[0] += child.itemsize
3717  *
3718  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
3719  *             t = child.type_num
3720  *             if end - f < 5:
3721  */
3722     __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
3723     if (__pyx_t_6) {
3724 
3725       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":878
3726  *
3727  *         if not PyDataType_HASFIELDS(child):
3728  *             t = child.type_num             # <<<<<<<<<<<<<<
3729  *             if end - f < 5:
3730  *                 raise RuntimeError(u"Format string allocated too short.")
3731  */
3732       __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 878, __pyx_L1_error)
3733       __Pyx_GOTREF(__pyx_t_4);
3734       __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
3735       __pyx_t_4 = 0;
3736 
3737       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
3738  *         if not PyDataType_HASFIELDS(child):
3739  *             t = child.type_num
3740  *             if end - f < 5:             # <<<<<<<<<<<<<<
3741  *                 raise RuntimeError(u"Format string allocated too short.")
3742  *
3743  */
3744       __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
3745       if (unlikely(__pyx_t_6)) {
3746 
3747         /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
3748  *             t = child.type_num
3749  *             if end - f < 5:
3750  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
3751  *
3752  *             # Until ticket #99 is fixed, use integers to avoid warnings
3753  */
3754         __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 880, __pyx_L1_error)
3755         __Pyx_GOTREF(__pyx_t_4);
3756         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3757         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3758         __PYX_ERR(1, 880, __pyx_L1_error)
3759 
3760         /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
3761  *         if not PyDataType_HASFIELDS(child):
3762  *             t = child.type_num
3763  *             if end - f < 5:             # <<<<<<<<<<<<<<
3764  *                 raise RuntimeError(u"Format string allocated too short.")
3765  *
3766  */
3767       }
3768 
3769       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":883
3770  *
3771  *             # Until ticket #99 is fixed, use integers to avoid warnings
3772  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
3773  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
3774  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
3775  */
3776       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 883, __pyx_L1_error)
3777       __Pyx_GOTREF(__pyx_t_4);
3778       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 883, __pyx_L1_error)
3779       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3780       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 883, __pyx_L1_error)
3781       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3782       if (__pyx_t_6) {
3783         (__pyx_v_f[0]) = 98;
3784         goto __pyx_L15;
3785       }
3786 
3787       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":884
3788  *             # Until ticket #99 is fixed, use integers to avoid warnings
3789  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
3790  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
3791  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
3792  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
3793  */
3794       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 884, __pyx_L1_error)
3795       __Pyx_GOTREF(__pyx_t_3);
3796       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 884, __pyx_L1_error)
3797       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3798       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 884, __pyx_L1_error)
3799       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3800       if (__pyx_t_6) {
3801         (__pyx_v_f[0]) = 66;
3802         goto __pyx_L15;
3803       }
3804 
3805       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":885
3806  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
3807  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
3808  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
3809  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
3810  *             elif t == NPY_INT:         f[0] = 105 #"i"
3811  */
3812       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 885, __pyx_L1_error)
3813       __Pyx_GOTREF(__pyx_t_4);
3814       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 885, __pyx_L1_error)
3815       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3816       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 885, __pyx_L1_error)
3817       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3818       if (__pyx_t_6) {
3819         (__pyx_v_f[0]) = 0x68;
3820         goto __pyx_L15;
3821       }
3822 
3823       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":886
3824  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
3825  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
3826  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
3827  *             elif t == NPY_INT:         f[0] = 105 #"i"
3828  *             elif t == NPY_UINT:        f[0] =  73 #"I"
3829  */
3830       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 886, __pyx_L1_error)
3831       __Pyx_GOTREF(__pyx_t_3);
3832       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 886, __pyx_L1_error)
3833       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3834       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 886, __pyx_L1_error)
3835       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3836       if (__pyx_t_6) {
3837         (__pyx_v_f[0]) = 72;
3838         goto __pyx_L15;
3839       }
3840 
3841       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":887
3842  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
3843  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
3844  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
3845  *             elif t == NPY_UINT:        f[0] =  73 #"I"
3846  *             elif t == NPY_LONG:        f[0] = 108 #"l"
3847  */
3848       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 887, __pyx_L1_error)
3849       __Pyx_GOTREF(__pyx_t_4);
3850       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 887, __pyx_L1_error)
3851       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3852       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 887, __pyx_L1_error)
3853       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3854       if (__pyx_t_6) {
3855         (__pyx_v_f[0]) = 0x69;
3856         goto __pyx_L15;
3857       }
3858 
3859       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":888
3860  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
3861  *             elif t == NPY_INT:         f[0] = 105 #"i"
3862  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
3863  *             elif t == NPY_LONG:        f[0] = 108 #"l"
3864  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
3865  */
3866       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 888, __pyx_L1_error)
3867       __Pyx_GOTREF(__pyx_t_3);
3868       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 888, __pyx_L1_error)
3869       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3870       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 888, __pyx_L1_error)
3871       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3872       if (__pyx_t_6) {
3873         (__pyx_v_f[0]) = 73;
3874         goto __pyx_L15;
3875       }
3876 
3877       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":889
3878  *             elif t == NPY_INT:         f[0] = 105 #"i"
3879  *             elif t == NPY_UINT:        f[0] =  73 #"I"
3880  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
3881  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
3882  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
3883  */
3884       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 889, __pyx_L1_error)
3885       __Pyx_GOTREF(__pyx_t_4);
3886       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 889, __pyx_L1_error)
3887       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3888       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 889, __pyx_L1_error)
3889       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3890       if (__pyx_t_6) {
3891         (__pyx_v_f[0]) = 0x6C;
3892         goto __pyx_L15;
3893       }
3894 
3895       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":890
3896  *             elif t == NPY_UINT:        f[0] =  73 #"I"
3897  *             elif t == NPY_LONG:        f[0] = 108 #"l"
3898  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
3899  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
3900  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
3901  */
3902       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 890, __pyx_L1_error)
3903       __Pyx_GOTREF(__pyx_t_3);
3904       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 890, __pyx_L1_error)
3905       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3906       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 890, __pyx_L1_error)
3907       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3908       if (__pyx_t_6) {
3909         (__pyx_v_f[0]) = 76;
3910         goto __pyx_L15;
3911       }
3912 
3913       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":891
3914  *             elif t == NPY_LONG:        f[0] = 108 #"l"
3915  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
3916  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
3917  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
3918  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
3919  */
3920       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 891, __pyx_L1_error)
3921       __Pyx_GOTREF(__pyx_t_4);
3922       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 891, __pyx_L1_error)
3923       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3924       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 891, __pyx_L1_error)
3925       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3926       if (__pyx_t_6) {
3927         (__pyx_v_f[0]) = 0x71;
3928         goto __pyx_L15;
3929       }
3930 
3931       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":892
3932  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
3933  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
3934  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
3935  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
3936  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
3937  */
3938       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 892, __pyx_L1_error)
3939       __Pyx_GOTREF(__pyx_t_3);
3940       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 892, __pyx_L1_error)
3941       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3942       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 892, __pyx_L1_error)
3943       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3944       if (__pyx_t_6) {
3945         (__pyx_v_f[0]) = 81;
3946         goto __pyx_L15;
3947       }
3948 
3949       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":893
3950  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
3951  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
3952  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
3953  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
3954  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
3955  */
3956       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 893, __pyx_L1_error)
3957       __Pyx_GOTREF(__pyx_t_4);
3958       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 893, __pyx_L1_error)
3959       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3960       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 893, __pyx_L1_error)
3961       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3962       if (__pyx_t_6) {
3963         (__pyx_v_f[0]) = 0x66;
3964         goto __pyx_L15;
3965       }
3966 
3967       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":894
3968  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
3969  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
3970  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
3971  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
3972  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
3973  */
3974       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 894, __pyx_L1_error)
3975       __Pyx_GOTREF(__pyx_t_3);
3976       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 894, __pyx_L1_error)
3977       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3978       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 894, __pyx_L1_error)
3979       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3980       if (__pyx_t_6) {
3981         (__pyx_v_f[0]) = 0x64;
3982         goto __pyx_L15;
3983       }
3984 
3985       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":895
3986  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
3987  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
3988  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
3989  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
3990  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
3991  */
3992       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 895, __pyx_L1_error)
3993       __Pyx_GOTREF(__pyx_t_4);
3994       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 895, __pyx_L1_error)
3995       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3996       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 895, __pyx_L1_error)
3997       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3998       if (__pyx_t_6) {
3999         (__pyx_v_f[0]) = 0x67;
4000         goto __pyx_L15;
4001       }
4002 
4003       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":896
4004  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
4005  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
4006  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
4007  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
4008  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
4009  */
4010       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 896, __pyx_L1_error)
4011       __Pyx_GOTREF(__pyx_t_3);
4012       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 896, __pyx_L1_error)
4013       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4014       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 896, __pyx_L1_error)
4015       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4016       if (__pyx_t_6) {
4017         (__pyx_v_f[0]) = 90;
4018         (__pyx_v_f[1]) = 0x66;
4019         __pyx_v_f = (__pyx_v_f + 1);
4020         goto __pyx_L15;
4021       }
4022 
4023       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":897
4024  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
4025  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
4026  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
4027  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
4028  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
4029  */
4030       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 897, __pyx_L1_error)
4031       __Pyx_GOTREF(__pyx_t_4);
4032       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 897, __pyx_L1_error)
4033       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4034       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 897, __pyx_L1_error)
4035       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4036       if (__pyx_t_6) {
4037         (__pyx_v_f[0]) = 90;
4038         (__pyx_v_f[1]) = 0x64;
4039         __pyx_v_f = (__pyx_v_f + 1);
4040         goto __pyx_L15;
4041       }
4042 
4043       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":898
4044  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
4045  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
4046  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
4047  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
4048  *             else:
4049  */
4050       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 898, __pyx_L1_error)
4051       __Pyx_GOTREF(__pyx_t_3);
4052       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 898, __pyx_L1_error)
4053       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4054       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 898, __pyx_L1_error)
4055       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4056       if (__pyx_t_6) {
4057         (__pyx_v_f[0]) = 90;
4058         (__pyx_v_f[1]) = 0x67;
4059         __pyx_v_f = (__pyx_v_f + 1);
4060         goto __pyx_L15;
4061       }
4062 
4063       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":899
4064  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
4065  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
4066  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
4067  *             else:
4068  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4069  */
4070       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 899, __pyx_L1_error)
4071       __Pyx_GOTREF(__pyx_t_4);
4072       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 899, __pyx_L1_error)
4073       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4074       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 899, __pyx_L1_error)
4075       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4076       if (likely(__pyx_t_6)) {
4077         (__pyx_v_f[0]) = 79;
4078         goto __pyx_L15;
4079       }
4080 
4081       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":901
4082  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
4083  *             else:
4084  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
4085  *             f += 1
4086  *         else:
4087  */
4088       /*else*/ {
4089         __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 901, __pyx_L1_error)
4090         __Pyx_GOTREF(__pyx_t_3);
4091         __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 901, __pyx_L1_error)
4092         __Pyx_GOTREF(__pyx_t_4);
4093         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4094         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
4095         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4096         __PYX_ERR(1, 901, __pyx_L1_error)
4097       }
4098       __pyx_L15:;
4099 
4100       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":902
4101  *             else:
4102  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4103  *             f += 1             # <<<<<<<<<<<<<<
4104  *         else:
4105  *             # Cython ignores struct boundary information ("T{...}"),
4106  */
4107       __pyx_v_f = (__pyx_v_f + 1);
4108 
4109       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
4110  *         offset[0] += child.itemsize
4111  *
4112  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
4113  *             t = child.type_num
4114  *             if end - f < 5:
4115  */
4116       goto __pyx_L13;
4117     }
4118 
4119     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":906
4120  *             # Cython ignores struct boundary information ("T{...}"),
4121  *             # so don't output it
4122  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
4123  *     return f
4124  *
4125  */
4126     /*else*/ {
4127       __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 906, __pyx_L1_error)
4128       __pyx_v_f = __pyx_t_9;
4129     }
4130     __pyx_L13:;
4131 
4132     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
4133  *     cdef tuple fields
4134  *
4135  *     for childname in descr.names:             # <<<<<<<<<<<<<<
4136  *         fields = descr.fields[childname]
4137  *         child, new_offset = fields
4138  */
4139   }
4140   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4141 
4142   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":907
4143  *             # so don't output it
4144  *             f = _util_dtypestring(child, f, end, offset)
4145  *     return f             # <<<<<<<<<<<<<<
4146  *
4147  *
4148  */
4149   __pyx_r = __pyx_v_f;
4150   goto __pyx_L0;
4151 
4152   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
4153  *         return ()
4154  *
4155  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
4156  *     # Recursive utility function used in __getbuffer__ to get format
4157  *     # string. The new location in the format string is returned.
4158  */
4159 
4160   /* function exit code */
4161   __pyx_L1_error:;
4162   __Pyx_XDECREF(__pyx_t_1);
4163   __Pyx_XDECREF(__pyx_t_3);
4164   __Pyx_XDECREF(__pyx_t_4);
4165   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
4166   __pyx_r = NULL;
4167   __pyx_L0:;
4168   __Pyx_XDECREF((PyObject *)__pyx_v_child);
4169   __Pyx_XDECREF(__pyx_v_fields);
4170   __Pyx_XDECREF(__pyx_v_childname);
4171   __Pyx_XDECREF(__pyx_v_new_offset);
4172   __Pyx_XDECREF(__pyx_v_t);
4173   __Pyx_RefNannyFinishContext();
4174   return __pyx_r;
4175 }
4176 
4177 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
4178  *     int _import_umath() except -1
4179  *
4180  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
4181  *     Py_INCREF(base) # important to do this before stealing the reference below!
4182  *     PyArray_SetBaseObject(arr, base)
4183  */
4184 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)4185 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
4186   __Pyx_RefNannyDeclarations
4187   __Pyx_RefNannySetupContext("set_array_base", 0);
4188 
4189   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1023
4190  *
4191  * cdef inline void set_array_base(ndarray arr, object base):
4192  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
4193  *     PyArray_SetBaseObject(arr, base)
4194  *
4195  */
4196   Py_INCREF(__pyx_v_base);
4197 
4198   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1024
4199  * cdef inline void set_array_base(ndarray arr, object base):
4200  *     Py_INCREF(base) # important to do this before stealing the reference below!
4201  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
4202  *
4203  * cdef inline object get_array_base(ndarray arr):
4204  */
4205   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
4206 
4207   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
4208  *     int _import_umath() except -1
4209  *
4210  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
4211  *     Py_INCREF(base) # important to do this before stealing the reference below!
4212  *     PyArray_SetBaseObject(arr, base)
4213  */
4214 
4215   /* function exit code */
4216   __Pyx_RefNannyFinishContext();
4217 }
4218 
4219 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
4220  *     PyArray_SetBaseObject(arr, base)
4221  *
4222  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
4223  *     base = PyArray_BASE(arr)
4224  *     if base is NULL:
4225  */
4226 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)4227 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
4228   PyObject *__pyx_v_base;
4229   PyObject *__pyx_r = NULL;
4230   __Pyx_RefNannyDeclarations
4231   int __pyx_t_1;
4232   __Pyx_RefNannySetupContext("get_array_base", 0);
4233 
4234   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1027
4235  *
4236  * cdef inline object get_array_base(ndarray arr):
4237  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
4238  *     if base is NULL:
4239  *         return None
4240  */
4241   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
4242 
4243   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
4244  * cdef inline object get_array_base(ndarray arr):
4245  *     base = PyArray_BASE(arr)
4246  *     if base is NULL:             # <<<<<<<<<<<<<<
4247  *         return None
4248  *     return <object>base
4249  */
4250   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
4251   if (__pyx_t_1) {
4252 
4253     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1029
4254  *     base = PyArray_BASE(arr)
4255  *     if base is NULL:
4256  *         return None             # <<<<<<<<<<<<<<
4257  *     return <object>base
4258  *
4259  */
4260     __Pyx_XDECREF(__pyx_r);
4261     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4262     goto __pyx_L0;
4263 
4264     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
4265  * cdef inline object get_array_base(ndarray arr):
4266  *     base = PyArray_BASE(arr)
4267  *     if base is NULL:             # <<<<<<<<<<<<<<
4268  *         return None
4269  *     return <object>base
4270  */
4271   }
4272 
4273   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1030
4274  *     if base is NULL:
4275  *         return None
4276  *     return <object>base             # <<<<<<<<<<<<<<
4277  *
4278  * # Versions of the import_* functions which are more suitable for
4279  */
4280   __Pyx_XDECREF(__pyx_r);
4281   __Pyx_INCREF(((PyObject *)__pyx_v_base));
4282   __pyx_r = ((PyObject *)__pyx_v_base);
4283   goto __pyx_L0;
4284 
4285   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
4286  *     PyArray_SetBaseObject(arr, base)
4287  *
4288  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
4289  *     base = PyArray_BASE(arr)
4290  *     if base is NULL:
4291  */
4292 
4293   /* function exit code */
4294   __pyx_L0:;
4295   __Pyx_XGIVEREF(__pyx_r);
4296   __Pyx_RefNannyFinishContext();
4297   return __pyx_r;
4298 }
4299 
4300 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
4301  * # Versions of the import_* functions which are more suitable for
4302  * # Cython code.
4303  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
4304  *     try:
4305  *         _import_array()
4306  */
4307 
__pyx_f_5numpy_import_array(void)4308 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
4309   int __pyx_r;
4310   __Pyx_RefNannyDeclarations
4311   PyObject *__pyx_t_1 = NULL;
4312   PyObject *__pyx_t_2 = NULL;
4313   PyObject *__pyx_t_3 = NULL;
4314   int __pyx_t_4;
4315   PyObject *__pyx_t_5 = NULL;
4316   PyObject *__pyx_t_6 = NULL;
4317   PyObject *__pyx_t_7 = NULL;
4318   PyObject *__pyx_t_8 = NULL;
4319   __Pyx_RefNannySetupContext("import_array", 0);
4320 
4321   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
4322  * # Cython code.
4323  * cdef inline int import_array() except -1:
4324  *     try:             # <<<<<<<<<<<<<<
4325  *         _import_array()
4326  *     except Exception:
4327  */
4328   {
4329     __Pyx_PyThreadState_declare
4330     __Pyx_PyThreadState_assign
4331     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4332     __Pyx_XGOTREF(__pyx_t_1);
4333     __Pyx_XGOTREF(__pyx_t_2);
4334     __Pyx_XGOTREF(__pyx_t_3);
4335     /*try:*/ {
4336 
4337       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1036
4338  * cdef inline int import_array() except -1:
4339  *     try:
4340  *         _import_array()             # <<<<<<<<<<<<<<
4341  *     except Exception:
4342  *         raise ImportError("numpy.core.multiarray failed to import")
4343  */
4344       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1036, __pyx_L3_error)
4345 
4346       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
4347  * # Cython code.
4348  * cdef inline int import_array() except -1:
4349  *     try:             # <<<<<<<<<<<<<<
4350  *         _import_array()
4351  *     except Exception:
4352  */
4353     }
4354     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4355     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4356     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4357     goto __pyx_L8_try_end;
4358     __pyx_L3_error:;
4359 
4360     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1037
4361  *     try:
4362  *         _import_array()
4363  *     except Exception:             # <<<<<<<<<<<<<<
4364  *         raise ImportError("numpy.core.multiarray failed to import")
4365  *
4366  */
4367     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
4368     if (__pyx_t_4) {
4369       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
4370       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1037, __pyx_L5_except_error)
4371       __Pyx_GOTREF(__pyx_t_5);
4372       __Pyx_GOTREF(__pyx_t_6);
4373       __Pyx_GOTREF(__pyx_t_7);
4374 
4375       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
4376  *         _import_array()
4377  *     except Exception:
4378  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
4379  *
4380  * cdef inline int import_umath() except -1:
4381  */
4382       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1038, __pyx_L5_except_error)
4383       __Pyx_GOTREF(__pyx_t_8);
4384       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
4385       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4386       __PYX_ERR(1, 1038, __pyx_L5_except_error)
4387     }
4388     goto __pyx_L5_except_error;
4389     __pyx_L5_except_error:;
4390 
4391     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
4392  * # Cython code.
4393  * cdef inline int import_array() except -1:
4394  *     try:             # <<<<<<<<<<<<<<
4395  *         _import_array()
4396  *     except Exception:
4397  */
4398     __Pyx_XGIVEREF(__pyx_t_1);
4399     __Pyx_XGIVEREF(__pyx_t_2);
4400     __Pyx_XGIVEREF(__pyx_t_3);
4401     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4402     goto __pyx_L1_error;
4403     __pyx_L8_try_end:;
4404   }
4405 
4406   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
4407  * # Versions of the import_* functions which are more suitable for
4408  * # Cython code.
4409  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
4410  *     try:
4411  *         _import_array()
4412  */
4413 
4414   /* function exit code */
4415   __pyx_r = 0;
4416   goto __pyx_L0;
4417   __pyx_L1_error:;
4418   __Pyx_XDECREF(__pyx_t_5);
4419   __Pyx_XDECREF(__pyx_t_6);
4420   __Pyx_XDECREF(__pyx_t_7);
4421   __Pyx_XDECREF(__pyx_t_8);
4422   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
4423   __pyx_r = -1;
4424   __pyx_L0:;
4425   __Pyx_RefNannyFinishContext();
4426   return __pyx_r;
4427 }
4428 
4429 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
4430  *         raise ImportError("numpy.core.multiarray failed to import")
4431  *
4432  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
4433  *     try:
4434  *         _import_umath()
4435  */
4436 
__pyx_f_5numpy_import_umath(void)4437 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
4438   int __pyx_r;
4439   __Pyx_RefNannyDeclarations
4440   PyObject *__pyx_t_1 = NULL;
4441   PyObject *__pyx_t_2 = NULL;
4442   PyObject *__pyx_t_3 = NULL;
4443   int __pyx_t_4;
4444   PyObject *__pyx_t_5 = NULL;
4445   PyObject *__pyx_t_6 = NULL;
4446   PyObject *__pyx_t_7 = NULL;
4447   PyObject *__pyx_t_8 = NULL;
4448   __Pyx_RefNannySetupContext("import_umath", 0);
4449 
4450   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
4451  *
4452  * cdef inline int import_umath() except -1:
4453  *     try:             # <<<<<<<<<<<<<<
4454  *         _import_umath()
4455  *     except Exception:
4456  */
4457   {
4458     __Pyx_PyThreadState_declare
4459     __Pyx_PyThreadState_assign
4460     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4461     __Pyx_XGOTREF(__pyx_t_1);
4462     __Pyx_XGOTREF(__pyx_t_2);
4463     __Pyx_XGOTREF(__pyx_t_3);
4464     /*try:*/ {
4465 
4466       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1042
4467  * cdef inline int import_umath() except -1:
4468  *     try:
4469  *         _import_umath()             # <<<<<<<<<<<<<<
4470  *     except Exception:
4471  *         raise ImportError("numpy.core.umath failed to import")
4472  */
4473       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1042, __pyx_L3_error)
4474 
4475       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
4476  *
4477  * cdef inline int import_umath() except -1:
4478  *     try:             # <<<<<<<<<<<<<<
4479  *         _import_umath()
4480  *     except Exception:
4481  */
4482     }
4483     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4484     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4485     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4486     goto __pyx_L8_try_end;
4487     __pyx_L3_error:;
4488 
4489     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1043
4490  *     try:
4491  *         _import_umath()
4492  *     except Exception:             # <<<<<<<<<<<<<<
4493  *         raise ImportError("numpy.core.umath failed to import")
4494  *
4495  */
4496     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
4497     if (__pyx_t_4) {
4498       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
4499       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1043, __pyx_L5_except_error)
4500       __Pyx_GOTREF(__pyx_t_5);
4501       __Pyx_GOTREF(__pyx_t_6);
4502       __Pyx_GOTREF(__pyx_t_7);
4503 
4504       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
4505  *         _import_umath()
4506  *     except Exception:
4507  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
4508  *
4509  * cdef inline int import_ufunc() except -1:
4510  */
4511       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1044, __pyx_L5_except_error)
4512       __Pyx_GOTREF(__pyx_t_8);
4513       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
4514       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4515       __PYX_ERR(1, 1044, __pyx_L5_except_error)
4516     }
4517     goto __pyx_L5_except_error;
4518     __pyx_L5_except_error:;
4519 
4520     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
4521  *
4522  * cdef inline int import_umath() except -1:
4523  *     try:             # <<<<<<<<<<<<<<
4524  *         _import_umath()
4525  *     except Exception:
4526  */
4527     __Pyx_XGIVEREF(__pyx_t_1);
4528     __Pyx_XGIVEREF(__pyx_t_2);
4529     __Pyx_XGIVEREF(__pyx_t_3);
4530     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4531     goto __pyx_L1_error;
4532     __pyx_L8_try_end:;
4533   }
4534 
4535   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
4536  *         raise ImportError("numpy.core.multiarray failed to import")
4537  *
4538  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
4539  *     try:
4540  *         _import_umath()
4541  */
4542 
4543   /* function exit code */
4544   __pyx_r = 0;
4545   goto __pyx_L0;
4546   __pyx_L1_error:;
4547   __Pyx_XDECREF(__pyx_t_5);
4548   __Pyx_XDECREF(__pyx_t_6);
4549   __Pyx_XDECREF(__pyx_t_7);
4550   __Pyx_XDECREF(__pyx_t_8);
4551   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
4552   __pyx_r = -1;
4553   __pyx_L0:;
4554   __Pyx_RefNannyFinishContext();
4555   return __pyx_r;
4556 }
4557 
4558 /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
4559  *         raise ImportError("numpy.core.umath failed to import")
4560  *
4561  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
4562  *     try:
4563  *         _import_umath()
4564  */
4565 
__pyx_f_5numpy_import_ufunc(void)4566 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
4567   int __pyx_r;
4568   __Pyx_RefNannyDeclarations
4569   PyObject *__pyx_t_1 = NULL;
4570   PyObject *__pyx_t_2 = NULL;
4571   PyObject *__pyx_t_3 = NULL;
4572   int __pyx_t_4;
4573   PyObject *__pyx_t_5 = NULL;
4574   PyObject *__pyx_t_6 = NULL;
4575   PyObject *__pyx_t_7 = NULL;
4576   PyObject *__pyx_t_8 = NULL;
4577   __Pyx_RefNannySetupContext("import_ufunc", 0);
4578 
4579   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
4580  *
4581  * cdef inline int import_ufunc() except -1:
4582  *     try:             # <<<<<<<<<<<<<<
4583  *         _import_umath()
4584  *     except Exception:
4585  */
4586   {
4587     __Pyx_PyThreadState_declare
4588     __Pyx_PyThreadState_assign
4589     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4590     __Pyx_XGOTREF(__pyx_t_1);
4591     __Pyx_XGOTREF(__pyx_t_2);
4592     __Pyx_XGOTREF(__pyx_t_3);
4593     /*try:*/ {
4594 
4595       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1048
4596  * cdef inline int import_ufunc() except -1:
4597  *     try:
4598  *         _import_umath()             # <<<<<<<<<<<<<<
4599  *     except Exception:
4600  *         raise ImportError("numpy.core.umath failed to import")
4601  */
4602       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1048, __pyx_L3_error)
4603 
4604       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
4605  *
4606  * cdef inline int import_ufunc() except -1:
4607  *     try:             # <<<<<<<<<<<<<<
4608  *         _import_umath()
4609  *     except Exception:
4610  */
4611     }
4612     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4613     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4614     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4615     goto __pyx_L8_try_end;
4616     __pyx_L3_error:;
4617 
4618     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1049
4619  *     try:
4620  *         _import_umath()
4621  *     except Exception:             # <<<<<<<<<<<<<<
4622  *         raise ImportError("numpy.core.umath failed to import")
4623  */
4624     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
4625     if (__pyx_t_4) {
4626       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
4627       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1049, __pyx_L5_except_error)
4628       __Pyx_GOTREF(__pyx_t_5);
4629       __Pyx_GOTREF(__pyx_t_6);
4630       __Pyx_GOTREF(__pyx_t_7);
4631 
4632       /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1050
4633  *         _import_umath()
4634  *     except Exception:
4635  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
4636  */
4637       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1050, __pyx_L5_except_error)
4638       __Pyx_GOTREF(__pyx_t_8);
4639       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
4640       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4641       __PYX_ERR(1, 1050, __pyx_L5_except_error)
4642     }
4643     goto __pyx_L5_except_error;
4644     __pyx_L5_except_error:;
4645 
4646     /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
4647  *
4648  * cdef inline int import_ufunc() except -1:
4649  *     try:             # <<<<<<<<<<<<<<
4650  *         _import_umath()
4651  *     except Exception:
4652  */
4653     __Pyx_XGIVEREF(__pyx_t_1);
4654     __Pyx_XGIVEREF(__pyx_t_2);
4655     __Pyx_XGIVEREF(__pyx_t_3);
4656     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4657     goto __pyx_L1_error;
4658     __pyx_L8_try_end:;
4659   }
4660 
4661   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
4662  *         raise ImportError("numpy.core.umath failed to import")
4663  *
4664  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
4665  *     try:
4666  *         _import_umath()
4667  */
4668 
4669   /* function exit code */
4670   __pyx_r = 0;
4671   goto __pyx_L0;
4672   __pyx_L1_error:;
4673   __Pyx_XDECREF(__pyx_t_5);
4674   __Pyx_XDECREF(__pyx_t_6);
4675   __Pyx_XDECREF(__pyx_t_7);
4676   __Pyx_XDECREF(__pyx_t_8);
4677   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
4678   __pyx_r = -1;
4679   __pyx_L0:;
4680   __Pyx_RefNannyFinishContext();
4681   return __pyx_r;
4682 }
4683 
4684 static PyMethodDef __pyx_methods[] = {
4685   {0, 0, 0, 0}
4686 };
4687 
4688 #if PY_MAJOR_VERSION >= 3
4689 #if CYTHON_PEP489_MULTI_PHASE_INIT
4690 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
4691 static int __pyx_pymod_exec___subsample(PyObject* module); /*proto*/
4692 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
4693   {Py_mod_create, (void*)__pyx_pymod_create},
4694   {Py_mod_exec, (void*)__pyx_pymod_exec___subsample},
4695   {0, NULL}
4696 };
4697 #endif
4698 
4699 static struct PyModuleDef __pyx_moduledef = {
4700     PyModuleDef_HEAD_INIT,
4701     "__subsample",
4702     0, /* m_doc */
4703   #if CYTHON_PEP489_MULTI_PHASE_INIT
4704     0, /* m_size */
4705   #else
4706     -1, /* m_size */
4707   #endif
4708     __pyx_methods /* m_methods */,
4709   #if CYTHON_PEP489_MULTI_PHASE_INIT
4710     __pyx_moduledef_slots, /* m_slots */
4711   #else
4712     NULL, /* m_reload */
4713   #endif
4714     NULL, /* m_traverse */
4715     NULL, /* m_clear */
4716     NULL /* m_free */
4717 };
4718 #endif
4719 #ifndef CYTHON_SMALL_CODE
4720 #if defined(__clang__)
4721     #define CYTHON_SMALL_CODE
4722 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
4723     #define CYTHON_SMALL_CODE __attribute__((cold))
4724 #else
4725     #define CYTHON_SMALL_CODE
4726 #endif
4727 #endif
4728 
4729 static __Pyx_StringTabEntry __pyx_string_tab[] = {
4730   {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
4731   {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
4732   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
4733   {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
4734   {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
4735   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
4736   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
4737   {&__pyx_n_s_cnt, __pyx_k_cnt, sizeof(__pyx_k_cnt), 0, 0, 1, 1},
4738   {&__pyx_n_s_counts, __pyx_k_counts, sizeof(__pyx_k_counts), 0, 0, 1, 1},
4739   {&__pyx_n_s_counts_sum, __pyx_k_counts_sum, sizeof(__pyx_k_counts_sum), 0, 0, 1, 1},
4740   {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
4741   {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
4742   {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
4743   {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1},
4744   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
4745   {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
4746   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
4747   {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
4748   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
4749   {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
4750   {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
4751   {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
4752   {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
4753   {&__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},
4754   {&__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},
4755   {&__pyx_n_s_permutation, __pyx_k_permutation, sizeof(__pyx_k_permutation), 0, 0, 1, 1},
4756   {&__pyx_n_s_permuted, __pyx_k_permuted, sizeof(__pyx_k_permuted), 0, 0, 1, 1},
4757   {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1},
4758   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
4759   {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
4760   {&__pyx_n_s_skbio_stats___subsample, __pyx_k_skbio_stats___subsample, sizeof(__pyx_k_skbio_stats___subsample), 0, 0, 1, 1},
4761   {&__pyx_kp_s_skbio_stats___subsample_pyx, __pyx_k_skbio_stats___subsample_pyx, sizeof(__pyx_k_skbio_stats___subsample_pyx), 0, 0, 1, 0},
4762   {&__pyx_n_s_subsample_counts_without_replac, __pyx_k_subsample_counts_without_replac, sizeof(__pyx_k_subsample_counts_without_replac), 0, 0, 1, 1},
4763   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
4764   {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
4765   {&__pyx_n_s_unpacked, __pyx_k_unpacked, sizeof(__pyx_k_unpacked), 0, 0, 1, 1},
4766   {&__pyx_n_s_unpacked_idx, __pyx_k_unpacked_idx, sizeof(__pyx_k_unpacked_idx), 0, 0, 1, 1},
4767   {&__pyx_n_s_zeros_like, __pyx_k_zeros_like, sizeof(__pyx_k_zeros_like), 0, 0, 1, 1},
4768   {0, 0, 0, 0, 0, 0, 0}
4769 };
__Pyx_InitCachedBuiltins(void)4770 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
4771   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 22, __pyx_L1_error)
4772   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 272, __pyx_L1_error)
4773   __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 856, __pyx_L1_error)
4774   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1038, __pyx_L1_error)
4775   return 0;
4776   __pyx_L1_error:;
4777   return -1;
4778 }
4779 
__Pyx_InitCachedConstants(void)4780 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
4781   __Pyx_RefNannyDeclarations
4782   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
4783 
4784   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
4785  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
4786  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
4787  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
4788  *
4789  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
4790  */
4791   __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 272, __pyx_L1_error)
4792   __Pyx_GOTREF(__pyx_tuple_);
4793   __Pyx_GIVEREF(__pyx_tuple_);
4794 
4795   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
4796  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
4797  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
4798  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
4799  *
4800  *             info.buf = PyArray_DATA(self)
4801  */
4802   __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 276, __pyx_L1_error)
4803   __Pyx_GOTREF(__pyx_tuple__2);
4804   __Pyx_GIVEREF(__pyx_tuple__2);
4805 
4806   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
4807  *                 if ((descr.byteorder == c'>' and little_endian) or
4808  *                     (descr.byteorder == c'<' and not little_endian)):
4809  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
4810  *                 if   t == NPY_BYTE:        f = "b"
4811  *                 elif t == NPY_UBYTE:       f = "B"
4812  */
4813   __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 306, __pyx_L1_error)
4814   __Pyx_GOTREF(__pyx_tuple__3);
4815   __Pyx_GIVEREF(__pyx_tuple__3);
4816 
4817   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
4818  *
4819  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
4820  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
4821  *
4822  *         if ((child.byteorder == c'>' and little_endian) or
4823  */
4824   __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 856, __pyx_L1_error)
4825   __Pyx_GOTREF(__pyx_tuple__4);
4826   __Pyx_GIVEREF(__pyx_tuple__4);
4827 
4828   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
4829  *             t = child.type_num
4830  *             if end - f < 5:
4831  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
4832  *
4833  *             # Until ticket #99 is fixed, use integers to avoid warnings
4834  */
4835   __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 880, __pyx_L1_error)
4836   __Pyx_GOTREF(__pyx_tuple__5);
4837   __Pyx_GIVEREF(__pyx_tuple__5);
4838 
4839   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
4840  *         _import_array()
4841  *     except Exception:
4842  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
4843  *
4844  * cdef inline int import_umath() except -1:
4845  */
4846   __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 1038, __pyx_L1_error)
4847   __Pyx_GOTREF(__pyx_tuple__6);
4848   __Pyx_GIVEREF(__pyx_tuple__6);
4849 
4850   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
4851  *         _import_umath()
4852  *     except Exception:
4853  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
4854  *
4855  * cdef inline int import_ufunc() except -1:
4856  */
4857   __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 1044, __pyx_L1_error)
4858   __Pyx_GOTREF(__pyx_tuple__7);
4859   __Pyx_GIVEREF(__pyx_tuple__7);
4860 
4861   /* "skbio/stats/__subsample.pyx":13
4862  *
4863  *
4864  * def _subsample_counts_without_replacement(             # <<<<<<<<<<<<<<
4865  *     cnp.ndarray[cnp.int64_t, ndim=1] counts, n, counts_sum):
4866  *     cdef:
4867  */
4868   __pyx_tuple__8 = PyTuple_Pack(11, __pyx_n_s_counts, __pyx_n_s_n, __pyx_n_s_counts_sum, __pyx_n_s_result, __pyx_n_s_permuted, __pyx_n_s_unpacked, __pyx_n_s_cnt, __pyx_n_s_unpacked_idx, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_idx); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 13, __pyx_L1_error)
4869   __Pyx_GOTREF(__pyx_tuple__8);
4870   __Pyx_GIVEREF(__pyx_tuple__8);
4871   __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_skbio_stats___subsample_pyx, __pyx_n_s_subsample_counts_without_replac, 13, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 13, __pyx_L1_error)
4872   __Pyx_RefNannyFinishContext();
4873   return 0;
4874   __pyx_L1_error:;
4875   __Pyx_RefNannyFinishContext();
4876   return -1;
4877 }
4878 
__Pyx_InitGlobals(void)4879 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
4880   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
4881   return 0;
4882   __pyx_L1_error:;
4883   return -1;
4884 }
4885 
4886 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
4887 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
4888 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
4889 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
4890 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
4891 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
4892 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
4893 
__Pyx_modinit_global_init_code(void)4894 static int __Pyx_modinit_global_init_code(void) {
4895   __Pyx_RefNannyDeclarations
4896   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
4897   /*--- Global init code ---*/
4898   __Pyx_RefNannyFinishContext();
4899   return 0;
4900 }
4901 
__Pyx_modinit_variable_export_code(void)4902 static int __Pyx_modinit_variable_export_code(void) {
4903   __Pyx_RefNannyDeclarations
4904   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
4905   /*--- Variable export code ---*/
4906   __Pyx_RefNannyFinishContext();
4907   return 0;
4908 }
4909 
__Pyx_modinit_function_export_code(void)4910 static int __Pyx_modinit_function_export_code(void) {
4911   __Pyx_RefNannyDeclarations
4912   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
4913   /*--- Function export code ---*/
4914   __Pyx_RefNannyFinishContext();
4915   return 0;
4916 }
4917 
__Pyx_modinit_type_init_code(void)4918 static int __Pyx_modinit_type_init_code(void) {
4919   __Pyx_RefNannyDeclarations
4920   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
4921   /*--- Type init code ---*/
4922   __Pyx_RefNannyFinishContext();
4923   return 0;
4924 }
4925 
__Pyx_modinit_type_import_code(void)4926 static int __Pyx_modinit_type_import_code(void) {
4927   __Pyx_RefNannyDeclarations
4928   PyObject *__pyx_t_1 = NULL;
4929   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
4930   /*--- Type import code ---*/
4931   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
4932   __Pyx_GOTREF(__pyx_t_1);
4933   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
4934   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
4935   sizeof(PyTypeObject),
4936   #else
4937   sizeof(PyHeapTypeObject),
4938   #endif
4939   __Pyx_ImportType_CheckSize_Warn);
4940    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
4941   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4942   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __pyx_L1_error)
4943   __Pyx_GOTREF(__pyx_t_1);
4944   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
4945    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 206, __pyx_L1_error)
4946   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
4947    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 229, __pyx_L1_error)
4948   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
4949    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 233, __pyx_L1_error)
4950   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
4951    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 242, __pyx_L1_error)
4952   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
4953    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 918, __pyx_L1_error)
4954   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4955   __Pyx_RefNannyFinishContext();
4956   return 0;
4957   __pyx_L1_error:;
4958   __Pyx_XDECREF(__pyx_t_1);
4959   __Pyx_RefNannyFinishContext();
4960   return -1;
4961 }
4962 
__Pyx_modinit_variable_import_code(void)4963 static int __Pyx_modinit_variable_import_code(void) {
4964   __Pyx_RefNannyDeclarations
4965   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
4966   /*--- Variable import code ---*/
4967   __Pyx_RefNannyFinishContext();
4968   return 0;
4969 }
4970 
__Pyx_modinit_function_import_code(void)4971 static int __Pyx_modinit_function_import_code(void) {
4972   __Pyx_RefNannyDeclarations
4973   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
4974   /*--- Function import code ---*/
4975   __Pyx_RefNannyFinishContext();
4976   return 0;
4977 }
4978 
4979 
4980 #if PY_MAJOR_VERSION < 3
4981 #ifdef CYTHON_NO_PYINIT_EXPORT
4982 #define __Pyx_PyMODINIT_FUNC void
4983 #else
4984 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
4985 #endif
4986 #else
4987 #ifdef CYTHON_NO_PYINIT_EXPORT
4988 #define __Pyx_PyMODINIT_FUNC PyObject *
4989 #else
4990 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
4991 #endif
4992 #endif
4993 
4994 
4995 #if PY_MAJOR_VERSION < 3
4996 __Pyx_PyMODINIT_FUNC init__subsample(void) CYTHON_SMALL_CODE; /*proto*/
init__subsample(void)4997 __Pyx_PyMODINIT_FUNC init__subsample(void)
4998 #else
4999 __Pyx_PyMODINIT_FUNC PyInit___subsample(void) CYTHON_SMALL_CODE; /*proto*/
5000 __Pyx_PyMODINIT_FUNC PyInit___subsample(void)
5001 #if CYTHON_PEP489_MULTI_PHASE_INIT
5002 {
5003   return PyModuleDef_Init(&__pyx_moduledef);
5004 }
5005 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
5006     #if PY_VERSION_HEX >= 0x030700A1
5007     static PY_INT64_T main_interpreter_id = -1;
5008     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
5009     if (main_interpreter_id == -1) {
5010         main_interpreter_id = current_id;
5011         return (unlikely(current_id == -1)) ? -1 : 0;
5012     } else if (unlikely(main_interpreter_id != current_id))
5013     #else
5014     static PyInterpreterState *main_interpreter = NULL;
5015     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
5016     if (!main_interpreter) {
5017         main_interpreter = current_interpreter;
5018     } else if (unlikely(main_interpreter != current_interpreter))
5019     #endif
5020     {
5021         PyErr_SetString(
5022             PyExc_ImportError,
5023             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
5024         return -1;
5025     }
5026     return 0;
5027 }
5028 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) {
5029     PyObject *value = PyObject_GetAttrString(spec, from_name);
5030     int result = 0;
5031     if (likely(value)) {
5032         if (allow_none || value != Py_None) {
5033             result = PyDict_SetItemString(moddict, to_name, value);
5034         }
5035         Py_DECREF(value);
5036     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
5037         PyErr_Clear();
5038     } else {
5039         result = -1;
5040     }
5041     return result;
5042 }
5043 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
5044     PyObject *module = NULL, *moddict, *modname;
5045     if (__Pyx_check_single_interpreter())
5046         return NULL;
5047     if (__pyx_m)
5048         return __Pyx_NewRef(__pyx_m);
5049     modname = PyObject_GetAttrString(spec, "name");
5050     if (unlikely(!modname)) goto bad;
5051     module = PyModule_NewObject(modname);
5052     Py_DECREF(modname);
5053     if (unlikely(!module)) goto bad;
5054     moddict = PyModule_GetDict(module);
5055     if (unlikely(!moddict)) goto bad;
5056     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
5057     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
5058     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
5059     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
5060     return module;
5061 bad:
5062     Py_XDECREF(module);
5063     return NULL;
5064 }
5065 
5066 
5067 static CYTHON_SMALL_CODE int __pyx_pymod_exec___subsample(PyObject *__pyx_pyinit_module)
5068 #endif
5069 #endif
5070 {
5071   PyObject *__pyx_t_1 = NULL;
5072   __Pyx_RefNannyDeclarations
5073   #if CYTHON_PEP489_MULTI_PHASE_INIT
5074   if (__pyx_m) {
5075     if (__pyx_m == __pyx_pyinit_module) return 0;
5076     PyErr_SetString(PyExc_RuntimeError, "Module '__subsample' has already been imported. Re-initialisation is not supported.");
5077     return -1;
5078   }
5079   #elif PY_MAJOR_VERSION >= 3
5080   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
5081   #endif
5082   #if CYTHON_REFNANNY
5083 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
5084 if (!__Pyx_RefNanny) {
5085   PyErr_Clear();
5086   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
5087   if (!__Pyx_RefNanny)
5088       Py_FatalError("failed to import 'refnanny' module");
5089 }
5090 #endif
5091   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___subsample(void)", 0);
5092   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5093   #ifdef __Pxy_PyFrame_Initialize_Offsets
5094   __Pxy_PyFrame_Initialize_Offsets();
5095   #endif
5096   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
5097   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
5098   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
5099   #ifdef __Pyx_CyFunction_USED
5100   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5101   #endif
5102   #ifdef __Pyx_FusedFunction_USED
5103   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5104   #endif
5105   #ifdef __Pyx_Coroutine_USED
5106   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5107   #endif
5108   #ifdef __Pyx_Generator_USED
5109   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5110   #endif
5111   #ifdef __Pyx_AsyncGen_USED
5112   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5113   #endif
5114   #ifdef __Pyx_StopAsyncIteration_USED
5115   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5116   #endif
5117   /*--- Library function declarations ---*/
5118   /*--- Threads initialization code ---*/
5119   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
5120   #ifdef WITH_THREAD /* Python build with threading support? */
5121   PyEval_InitThreads();
5122   #endif
5123   #endif
5124   /*--- Module creation code ---*/
5125   #if CYTHON_PEP489_MULTI_PHASE_INIT
5126   __pyx_m = __pyx_pyinit_module;
5127   Py_INCREF(__pyx_m);
5128   #else
5129   #if PY_MAJOR_VERSION < 3
5130   __pyx_m = Py_InitModule4("__subsample", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
5131   #else
5132   __pyx_m = PyModule_Create(&__pyx_moduledef);
5133   #endif
5134   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
5135   #endif
5136   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
5137   Py_INCREF(__pyx_d);
5138   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
5139   Py_INCREF(__pyx_b);
5140   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
5141   Py_INCREF(__pyx_cython_runtime);
5142   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
5143   /*--- Initialize various global constants etc. ---*/
5144   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5145   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
5146   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5147   #endif
5148   if (__pyx_module_is_main_skbio__stats____subsample) {
5149     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5150   }
5151   #if PY_MAJOR_VERSION >= 3
5152   {
5153     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
5154     if (!PyDict_GetItemString(modules, "skbio.stats.__subsample")) {
5155       if (unlikely(PyDict_SetItemString(modules, "skbio.stats.__subsample", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
5156     }
5157   }
5158   #endif
5159   /*--- Builtin init code ---*/
5160   if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
5161   /*--- Constants init code ---*/
5162   if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
5163   /*--- Global type/function init code ---*/
5164   (void)__Pyx_modinit_global_init_code();
5165   (void)__Pyx_modinit_variable_export_code();
5166   (void)__Pyx_modinit_function_export_code();
5167   (void)__Pyx_modinit_type_init_code();
5168   if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
5169   (void)__Pyx_modinit_variable_import_code();
5170   (void)__Pyx_modinit_function_import_code();
5171   /*--- Execution code ---*/
5172   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
5173   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5174   #endif
5175 
5176   /* "skbio/stats/__subsample.pyx":9
5177  * # ----------------------------------------------------------------------------
5178  *
5179  * import numpy as np             # <<<<<<<<<<<<<<
5180  * cimport numpy as cnp
5181  *
5182  */
5183   __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
5184   __Pyx_GOTREF(__pyx_t_1);
5185   if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
5186   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5187 
5188   /* "skbio/stats/__subsample.pyx":13
5189  *
5190  *
5191  * def _subsample_counts_without_replacement(             # <<<<<<<<<<<<<<
5192  *     cnp.ndarray[cnp.int64_t, ndim=1] counts, n, counts_sum):
5193  *     cdef:
5194  */
5195   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5skbio_5stats_11__subsample_1_subsample_counts_without_replacement, NULL, __pyx_n_s_skbio_stats___subsample); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
5196   __Pyx_GOTREF(__pyx_t_1);
5197   if (PyDict_SetItem(__pyx_d, __pyx_n_s_subsample_counts_without_replac, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
5198   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5199 
5200   /* "skbio/stats/__subsample.pyx":1
5201  * # ----------------------------------------------------------------------------             # <<<<<<<<<<<<<<
5202  * # Copyright (c) 2013--, scikit-bio development team.
5203  * #
5204  */
5205   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
5206   __Pyx_GOTREF(__pyx_t_1);
5207   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5208   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5209 
5210   /* "../../../.conda/envs/skbio/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
5211  *         raise ImportError("numpy.core.umath failed to import")
5212  *
5213  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
5214  *     try:
5215  *         _import_umath()
5216  */
5217 
5218   /*--- Wrapped vars code ---*/
5219 
5220   goto __pyx_L0;
5221   __pyx_L1_error:;
5222   __Pyx_XDECREF(__pyx_t_1);
5223   if (__pyx_m) {
5224     if (__pyx_d) {
5225       __Pyx_AddTraceback("init skbio.stats.__subsample", __pyx_clineno, __pyx_lineno, __pyx_filename);
5226     }
5227     Py_CLEAR(__pyx_m);
5228   } else if (!PyErr_Occurred()) {
5229     PyErr_SetString(PyExc_ImportError, "init skbio.stats.__subsample");
5230   }
5231   __pyx_L0:;
5232   __Pyx_RefNannyFinishContext();
5233   #if CYTHON_PEP489_MULTI_PHASE_INIT
5234   return (__pyx_m != NULL) ? 0 : -1;
5235   #elif PY_MAJOR_VERSION >= 3
5236   return __pyx_m;
5237   #else
5238   return;
5239   #endif
5240 }
5241 
5242 /* --- Runtime support code --- */
5243 /* Refnanny */
5244 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)5245 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
5246     PyObject *m = NULL, *p = NULL;
5247     void *r = NULL;
5248     m = PyImport_ImportModule(modname);
5249     if (!m) goto end;
5250     p = PyObject_GetAttrString(m, "RefNannyAPI");
5251     if (!p) goto end;
5252     r = PyLong_AsVoidPtr(p);
5253 end:
5254     Py_XDECREF(p);
5255     Py_XDECREF(m);
5256     return (__Pyx_RefNannyAPIStruct *)r;
5257 }
5258 #endif
5259 
5260 /* PyObjectGetAttrStr */
5261 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)5262 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
5263     PyTypeObject* tp = Py_TYPE(obj);
5264     if (likely(tp->tp_getattro))
5265         return tp->tp_getattro(obj, attr_name);
5266 #if PY_MAJOR_VERSION < 3
5267     if (likely(tp->tp_getattr))
5268         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
5269 #endif
5270     return PyObject_GetAttr(obj, attr_name);
5271 }
5272 #endif
5273 
5274 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)5275 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
5276     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
5277     if (unlikely(!result)) {
5278         PyErr_Format(PyExc_NameError,
5279 #if PY_MAJOR_VERSION >= 3
5280             "name '%U' is not defined", name);
5281 #else
5282             "name '%.200s' is not defined", PyString_AS_STRING(name));
5283 #endif
5284     }
5285     return result;
5286 }
5287 
5288 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)5289 static void __Pyx_RaiseArgtupleInvalid(
5290     const char* func_name,
5291     int exact,
5292     Py_ssize_t num_min,
5293     Py_ssize_t num_max,
5294     Py_ssize_t num_found)
5295 {
5296     Py_ssize_t num_expected;
5297     const char *more_or_less;
5298     if (num_found < num_min) {
5299         num_expected = num_min;
5300         more_or_less = "at least";
5301     } else {
5302         num_expected = num_max;
5303         more_or_less = "at most";
5304     }
5305     if (exact) {
5306         more_or_less = "exactly";
5307     }
5308     PyErr_Format(PyExc_TypeError,
5309                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
5310                  func_name, more_or_less, num_expected,
5311                  (num_expected == 1) ? "" : "s", num_found);
5312 }
5313 
5314 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)5315 static void __Pyx_RaiseDoubleKeywordsError(
5316     const char* func_name,
5317     PyObject* kw_name)
5318 {
5319     PyErr_Format(PyExc_TypeError,
5320         #if PY_MAJOR_VERSION >= 3
5321         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
5322         #else
5323         "%s() got multiple values for keyword argument '%s'", func_name,
5324         PyString_AsString(kw_name));
5325         #endif
5326 }
5327 
5328 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)5329 static int __Pyx_ParseOptionalKeywords(
5330     PyObject *kwds,
5331     PyObject **argnames[],
5332     PyObject *kwds2,
5333     PyObject *values[],
5334     Py_ssize_t num_pos_args,
5335     const char* function_name)
5336 {
5337     PyObject *key = 0, *value = 0;
5338     Py_ssize_t pos = 0;
5339     PyObject*** name;
5340     PyObject*** first_kw_arg = argnames + num_pos_args;
5341     while (PyDict_Next(kwds, &pos, &key, &value)) {
5342         name = first_kw_arg;
5343         while (*name && (**name != key)) name++;
5344         if (*name) {
5345             values[name-argnames] = value;
5346             continue;
5347         }
5348         name = first_kw_arg;
5349         #if PY_MAJOR_VERSION < 3
5350         if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
5351             while (*name) {
5352                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
5353                         && _PyString_Eq(**name, key)) {
5354                     values[name-argnames] = value;
5355                     break;
5356                 }
5357                 name++;
5358             }
5359             if (*name) continue;
5360             else {
5361                 PyObject*** argname = argnames;
5362                 while (argname != first_kw_arg) {
5363                     if ((**argname == key) || (
5364                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
5365                              && _PyString_Eq(**argname, key))) {
5366                         goto arg_passed_twice;
5367                     }
5368                     argname++;
5369                 }
5370             }
5371         } else
5372         #endif
5373         if (likely(PyUnicode_Check(key))) {
5374             while (*name) {
5375                 int cmp = (**name == key) ? 0 :
5376                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
5377                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
5378                 #endif
5379                     PyUnicode_Compare(**name, key);
5380                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
5381                 if (cmp == 0) {
5382                     values[name-argnames] = value;
5383                     break;
5384                 }
5385                 name++;
5386             }
5387             if (*name) continue;
5388             else {
5389                 PyObject*** argname = argnames;
5390                 while (argname != first_kw_arg) {
5391                     int cmp = (**argname == key) ? 0 :
5392                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
5393                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
5394                     #endif
5395                         PyUnicode_Compare(**argname, key);
5396                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
5397                     if (cmp == 0) goto arg_passed_twice;
5398                     argname++;
5399                 }
5400             }
5401         } else
5402             goto invalid_keyword_type;
5403         if (kwds2) {
5404             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
5405         } else {
5406             goto invalid_keyword;
5407         }
5408     }
5409     return 0;
5410 arg_passed_twice:
5411     __Pyx_RaiseDoubleKeywordsError(function_name, key);
5412     goto bad;
5413 invalid_keyword_type:
5414     PyErr_Format(PyExc_TypeError,
5415         "%.200s() keywords must be strings", function_name);
5416     goto bad;
5417 invalid_keyword:
5418     PyErr_Format(PyExc_TypeError,
5419     #if PY_MAJOR_VERSION < 3
5420         "%.200s() got an unexpected keyword argument '%.200s'",
5421         function_name, PyString_AsString(key));
5422     #else
5423         "%s() got an unexpected keyword argument '%U'",
5424         function_name, key);
5425     #endif
5426 bad:
5427     return -1;
5428 }
5429 
5430 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)5431 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
5432 {
5433     if (unlikely(!type)) {
5434         PyErr_SetString(PyExc_SystemError, "Missing type object");
5435         return 0;
5436     }
5437     else if (exact) {
5438         #if PY_MAJOR_VERSION == 2
5439         if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
5440         #endif
5441     }
5442     else {
5443         if (likely(__Pyx_TypeCheck(obj, type))) return 1;
5444     }
5445     PyErr_Format(PyExc_TypeError,
5446         "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
5447         name, type->tp_name, Py_TYPE(obj)->tp_name);
5448     return 0;
5449 }
5450 
5451 /* IsLittleEndian */
__Pyx_Is_Little_Endian(void)5452 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
5453 {
5454   union {
5455     uint32_t u32;
5456     uint8_t u8[4];
5457   } S;
5458   S.u32 = 0x01020304;
5459   return S.u8[0] == 4;
5460 }
5461 
5462 /* BufferFormatCheck */
__Pyx_BufFmt_Init(__Pyx_BufFmt_Context * ctx,__Pyx_BufFmt_StackElem * stack,__Pyx_TypeInfo * type)5463 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
5464                               __Pyx_BufFmt_StackElem* stack,
5465                               __Pyx_TypeInfo* type) {
5466   stack[0].field = &ctx->root;
5467   stack[0].parent_offset = 0;
5468   ctx->root.type = type;
5469   ctx->root.name = "buffer dtype";
5470   ctx->root.offset = 0;
5471   ctx->head = stack;
5472   ctx->head->field = &ctx->root;
5473   ctx->fmt_offset = 0;
5474   ctx->head->parent_offset = 0;
5475   ctx->new_packmode = '@';
5476   ctx->enc_packmode = '@';
5477   ctx->new_count = 1;
5478   ctx->enc_count = 0;
5479   ctx->enc_type = 0;
5480   ctx->is_complex = 0;
5481   ctx->is_valid_array = 0;
5482   ctx->struct_alignment = 0;
5483   while (type->typegroup == 'S') {
5484     ++ctx->head;
5485     ctx->head->field = type->fields;
5486     ctx->head->parent_offset = 0;
5487     type = type->fields->type;
5488   }
5489 }
__Pyx_BufFmt_ParseNumber(const char ** ts)5490 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
5491     int count;
5492     const char* t = *ts;
5493     if (*t < '0' || *t > '9') {
5494       return -1;
5495     } else {
5496         count = *t++ - '0';
5497         while (*t >= '0' && *t <= '9') {
5498             count *= 10;
5499             count += *t++ - '0';
5500         }
5501     }
5502     *ts = t;
5503     return count;
5504 }
__Pyx_BufFmt_ExpectNumber(const char ** ts)5505 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
5506     int number = __Pyx_BufFmt_ParseNumber(ts);
5507     if (number == -1)
5508         PyErr_Format(PyExc_ValueError,\
5509                      "Does not understand character buffer dtype format string ('%c')", **ts);
5510     return number;
5511 }
__Pyx_BufFmt_RaiseUnexpectedChar(char ch)5512 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
5513   PyErr_Format(PyExc_ValueError,
5514                "Unexpected format string character: '%c'", ch);
5515 }
__Pyx_BufFmt_DescribeTypeChar(char ch,int is_complex)5516 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
5517   switch (ch) {
5518     case 'c': return "'char'";
5519     case 'b': return "'signed char'";
5520     case 'B': return "'unsigned char'";
5521     case 'h': return "'short'";
5522     case 'H': return "'unsigned short'";
5523     case 'i': return "'int'";
5524     case 'I': return "'unsigned int'";
5525     case 'l': return "'long'";
5526     case 'L': return "'unsigned long'";
5527     case 'q': return "'long long'";
5528     case 'Q': return "'unsigned long long'";
5529     case 'f': return (is_complex ? "'complex float'" : "'float'");
5530     case 'd': return (is_complex ? "'complex double'" : "'double'");
5531     case 'g': return (is_complex ? "'complex long double'" : "'long double'");
5532     case 'T': return "a struct";
5533     case 'O': return "Python object";
5534     case 'P': return "a pointer";
5535     case 's': case 'p': return "a string";
5536     case 0: return "end";
5537     default: return "unparseable format string";
5538   }
5539 }
__Pyx_BufFmt_TypeCharToStandardSize(char ch,int is_complex)5540 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
5541   switch (ch) {
5542     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
5543     case 'h': case 'H': return 2;
5544     case 'i': case 'I': case 'l': case 'L': return 4;
5545     case 'q': case 'Q': return 8;
5546     case 'f': return (is_complex ? 8 : 4);
5547     case 'd': return (is_complex ? 16 : 8);
5548     case 'g': {
5549       PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
5550       return 0;
5551     }
5552     case 'O': case 'P': return sizeof(void*);
5553     default:
5554       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
5555       return 0;
5556     }
5557 }
__Pyx_BufFmt_TypeCharToNativeSize(char ch,int is_complex)5558 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
5559   switch (ch) {
5560     case 'c': case 'b': case 'B': case 's': case 'p': return 1;
5561     case 'h': case 'H': return sizeof(short);
5562     case 'i': case 'I': return sizeof(int);
5563     case 'l': case 'L': return sizeof(long);
5564     #ifdef HAVE_LONG_LONG
5565     case 'q': case 'Q': return sizeof(PY_LONG_LONG);
5566     #endif
5567     case 'f': return sizeof(float) * (is_complex ? 2 : 1);
5568     case 'd': return sizeof(double) * (is_complex ? 2 : 1);
5569     case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
5570     case 'O': case 'P': return sizeof(void*);
5571     default: {
5572       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
5573       return 0;
5574     }
5575   }
5576 }
5577 typedef struct { char c; short x; } __Pyx_st_short;
5578 typedef struct { char c; int x; } __Pyx_st_int;
5579 typedef struct { char c; long x; } __Pyx_st_long;
5580 typedef struct { char c; float x; } __Pyx_st_float;
5581 typedef struct { char c; double x; } __Pyx_st_double;
5582 typedef struct { char c; long double x; } __Pyx_st_longdouble;
5583 typedef struct { char c; void *x; } __Pyx_st_void_p;
5584 #ifdef HAVE_LONG_LONG
5585 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
5586 #endif
__Pyx_BufFmt_TypeCharToAlignment(char ch,CYTHON_UNUSED int is_complex)5587 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
5588   switch (ch) {
5589     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
5590     case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
5591     case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
5592     case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
5593 #ifdef HAVE_LONG_LONG
5594     case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
5595 #endif
5596     case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
5597     case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
5598     case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
5599     case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
5600     default:
5601       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
5602       return 0;
5603     }
5604 }
5605 /* These are for computing the padding at the end of the struct to align
5606    on the first member of the struct. This will probably the same as above,
5607    but we don't have any guarantees.
5608  */
5609 typedef struct { short x; char c; } __Pyx_pad_short;
5610 typedef struct { int x; char c; } __Pyx_pad_int;
5611 typedef struct { long x; char c; } __Pyx_pad_long;
5612 typedef struct { float x; char c; } __Pyx_pad_float;
5613 typedef struct { double x; char c; } __Pyx_pad_double;
5614 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
5615 typedef struct { void *x; char c; } __Pyx_pad_void_p;
5616 #ifdef HAVE_LONG_LONG
5617 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
5618 #endif
__Pyx_BufFmt_TypeCharToPadding(char ch,CYTHON_UNUSED int is_complex)5619 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
5620   switch (ch) {
5621     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
5622     case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
5623     case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
5624     case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
5625 #ifdef HAVE_LONG_LONG
5626     case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
5627 #endif
5628     case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
5629     case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
5630     case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
5631     case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
5632     default:
5633       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
5634       return 0;
5635     }
5636 }
__Pyx_BufFmt_TypeCharToGroup(char ch,int is_complex)5637 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
5638   switch (ch) {
5639     case 'c':
5640         return 'H';
5641     case 'b': case 'h': case 'i':
5642     case 'l': case 'q': case 's': case 'p':
5643         return 'I';
5644     case 'B': case 'H': case 'I': case 'L': case 'Q':
5645         return 'U';
5646     case 'f': case 'd': case 'g':
5647         return (is_complex ? 'C' : 'R');
5648     case 'O':
5649         return 'O';
5650     case 'P':
5651         return 'P';
5652     default: {
5653       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
5654       return 0;
5655     }
5656   }
5657 }
__Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context * ctx)5658 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
5659   if (ctx->head == NULL || ctx->head->field == &ctx->root) {
5660     const char* expected;
5661     const char* quote;
5662     if (ctx->head == NULL) {
5663       expected = "end";
5664       quote = "";
5665     } else {
5666       expected = ctx->head->field->type->name;
5667       quote = "'";
5668     }
5669     PyErr_Format(PyExc_ValueError,
5670                  "Buffer dtype mismatch, expected %s%s%s but got %s",
5671                  quote, expected, quote,
5672                  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
5673   } else {
5674     __Pyx_StructField* field = ctx->head->field;
5675     __Pyx_StructField* parent = (ctx->head - 1)->field;
5676     PyErr_Format(PyExc_ValueError,
5677                  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
5678                  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
5679                  parent->type->name, field->name);
5680   }
5681 }
__Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context * ctx)5682 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
5683   char group;
5684   size_t size, offset, arraysize = 1;
5685   if (ctx->enc_type == 0) return 0;
5686   if (ctx->head->field->type->arraysize[0]) {
5687     int i, ndim = 0;
5688     if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
5689         ctx->is_valid_array = ctx->head->field->type->ndim == 1;
5690         ndim = 1;
5691         if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
5692             PyErr_Format(PyExc_ValueError,
5693                          "Expected a dimension of size %zu, got %zu",
5694                          ctx->head->field->type->arraysize[0], ctx->enc_count);
5695             return -1;
5696         }
5697     }
5698     if (!ctx->is_valid_array) {
5699       PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
5700                    ctx->head->field->type->ndim, ndim);
5701       return -1;
5702     }
5703     for (i = 0; i < ctx->head->field->type->ndim; i++) {
5704       arraysize *= ctx->head->field->type->arraysize[i];
5705     }
5706     ctx->is_valid_array = 0;
5707     ctx->enc_count = 1;
5708   }
5709   group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
5710   do {
5711     __Pyx_StructField* field = ctx->head->field;
5712     __Pyx_TypeInfo* type = field->type;
5713     if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
5714       size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
5715     } else {
5716       size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
5717     }
5718     if (ctx->enc_packmode == '@') {
5719       size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
5720       size_t align_mod_offset;
5721       if (align_at == 0) return -1;
5722       align_mod_offset = ctx->fmt_offset % align_at;
5723       if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
5724       if (ctx->struct_alignment == 0)
5725           ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
5726                                                                  ctx->is_complex);
5727     }
5728     if (type->size != size || type->typegroup != group) {
5729       if (type->typegroup == 'C' && type->fields != NULL) {
5730         size_t parent_offset = ctx->head->parent_offset + field->offset;
5731         ++ctx->head;
5732         ctx->head->field = type->fields;
5733         ctx->head->parent_offset = parent_offset;
5734         continue;
5735       }
5736       if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
5737       } else {
5738           __Pyx_BufFmt_RaiseExpected(ctx);
5739           return -1;
5740       }
5741     }
5742     offset = ctx->head->parent_offset + field->offset;
5743     if (ctx->fmt_offset != offset) {
5744       PyErr_Format(PyExc_ValueError,
5745                    "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
5746                    (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
5747       return -1;
5748     }
5749     ctx->fmt_offset += size;
5750     if (arraysize)
5751       ctx->fmt_offset += (arraysize - 1) * size;
5752     --ctx->enc_count;
5753     while (1) {
5754       if (field == &ctx->root) {
5755         ctx->head = NULL;
5756         if (ctx->enc_count != 0) {
5757           __Pyx_BufFmt_RaiseExpected(ctx);
5758           return -1;
5759         }
5760         break;
5761       }
5762       ctx->head->field = ++field;
5763       if (field->type == NULL) {
5764         --ctx->head;
5765         field = ctx->head->field;
5766         continue;
5767       } else if (field->type->typegroup == 'S') {
5768         size_t parent_offset = ctx->head->parent_offset + field->offset;
5769         if (field->type->fields->type == NULL) continue;
5770         field = field->type->fields;
5771         ++ctx->head;
5772         ctx->head->field = field;
5773         ctx->head->parent_offset = parent_offset;
5774         break;
5775       } else {
5776         break;
5777       }
5778     }
5779   } while (ctx->enc_count);
5780   ctx->enc_type = 0;
5781   ctx->is_complex = 0;
5782   return 0;
5783 }
5784 static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context * ctx,const char ** tsp)5785 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
5786 {
5787     const char *ts = *tsp;
5788     int i = 0, number;
5789     int ndim = ctx->head->field->type->ndim;
5790 ;
5791     ++ts;
5792     if (ctx->new_count != 1) {
5793         PyErr_SetString(PyExc_ValueError,
5794                         "Cannot handle repeated arrays in format string");
5795         return NULL;
5796     }
5797     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
5798     while (*ts && *ts != ')') {
5799         switch (*ts) {
5800             case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
5801             default:  break;
5802         }
5803         number = __Pyx_BufFmt_ExpectNumber(&ts);
5804         if (number == -1) return NULL;
5805         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
5806             return PyErr_Format(PyExc_ValueError,
5807                         "Expected a dimension of size %zu, got %d",
5808                         ctx->head->field->type->arraysize[i], number);
5809         if (*ts != ',' && *ts != ')')
5810             return PyErr_Format(PyExc_ValueError,
5811                                 "Expected a comma in format string, got '%c'", *ts);
5812         if (*ts == ',') ts++;
5813         i++;
5814     }
5815     if (i != ndim)
5816         return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
5817                             ctx->head->field->type->ndim, i);
5818     if (!*ts) {
5819         PyErr_SetString(PyExc_ValueError,
5820                         "Unexpected end of format string, expected ')'");
5821         return NULL;
5822     }
5823     ctx->is_valid_array = 1;
5824     ctx->new_count = 1;
5825     *tsp = ++ts;
5826     return Py_None;
5827 }
__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context * ctx,const char * ts)5828 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
5829   int got_Z = 0;
5830   while (1) {
5831     switch(*ts) {
5832       case 0:
5833         if (ctx->enc_type != 0 && ctx->head == NULL) {
5834           __Pyx_BufFmt_RaiseExpected(ctx);
5835           return NULL;
5836         }
5837         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
5838         if (ctx->head != NULL) {
5839           __Pyx_BufFmt_RaiseExpected(ctx);
5840           return NULL;
5841         }
5842         return ts;
5843       case ' ':
5844       case '\r':
5845       case '\n':
5846         ++ts;
5847         break;
5848       case '<':
5849         if (!__Pyx_Is_Little_Endian()) {
5850           PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
5851           return NULL;
5852         }
5853         ctx->new_packmode = '=';
5854         ++ts;
5855         break;
5856       case '>':
5857       case '!':
5858         if (__Pyx_Is_Little_Endian()) {
5859           PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
5860           return NULL;
5861         }
5862         ctx->new_packmode = '=';
5863         ++ts;
5864         break;
5865       case '=':
5866       case '@':
5867       case '^':
5868         ctx->new_packmode = *ts++;
5869         break;
5870       case 'T':
5871         {
5872           const char* ts_after_sub;
5873           size_t i, struct_count = ctx->new_count;
5874           size_t struct_alignment = ctx->struct_alignment;
5875           ctx->new_count = 1;
5876           ++ts;
5877           if (*ts != '{') {
5878             PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
5879             return NULL;
5880           }
5881           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
5882           ctx->enc_type = 0;
5883           ctx->enc_count = 0;
5884           ctx->struct_alignment = 0;
5885           ++ts;
5886           ts_after_sub = ts;
5887           for (i = 0; i != struct_count; ++i) {
5888             ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
5889             if (!ts_after_sub) return NULL;
5890           }
5891           ts = ts_after_sub;
5892           if (struct_alignment) ctx->struct_alignment = struct_alignment;
5893         }
5894         break;
5895       case '}':
5896         {
5897           size_t alignment = ctx->struct_alignment;
5898           ++ts;
5899           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
5900           ctx->enc_type = 0;
5901           if (alignment && ctx->fmt_offset % alignment) {
5902             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
5903           }
5904         }
5905         return ts;
5906       case 'x':
5907         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
5908         ctx->fmt_offset += ctx->new_count;
5909         ctx->new_count = 1;
5910         ctx->enc_count = 0;
5911         ctx->enc_type = 0;
5912         ctx->enc_packmode = ctx->new_packmode;
5913         ++ts;
5914         break;
5915       case 'Z':
5916         got_Z = 1;
5917         ++ts;
5918         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
5919           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
5920           return NULL;
5921         }
5922         CYTHON_FALLTHROUGH;
5923       case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
5924       case 'l': case 'L': case 'q': case 'Q':
5925       case 'f': case 'd': case 'g':
5926       case 'O': case 'p':
5927         if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
5928             ctx->enc_packmode == ctx->new_packmode) {
5929           ctx->enc_count += ctx->new_count;
5930           ctx->new_count = 1;
5931           got_Z = 0;
5932           ++ts;
5933           break;
5934         }
5935         CYTHON_FALLTHROUGH;
5936       case 's':
5937         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
5938         ctx->enc_count = ctx->new_count;
5939         ctx->enc_packmode = ctx->new_packmode;
5940         ctx->enc_type = *ts;
5941         ctx->is_complex = got_Z;
5942         ++ts;
5943         ctx->new_count = 1;
5944         got_Z = 0;
5945         break;
5946       case ':':
5947         ++ts;
5948         while(*ts != ':') ++ts;
5949         ++ts;
5950         break;
5951       case '(':
5952         if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
5953         break;
5954       default:
5955         {
5956           int number = __Pyx_BufFmt_ExpectNumber(&ts);
5957           if (number == -1) return NULL;
5958           ctx->new_count = (size_t)number;
5959         }
5960     }
5961   }
5962 }
5963 
5964 /* BufferGetAndValidate */
__Pyx_SafeReleaseBuffer(Py_buffer * info)5965   static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
5966   if (unlikely(info->buf == NULL)) return;
5967   if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
5968   __Pyx_ReleaseBuffer(info);
5969 }
__Pyx_ZeroBuffer(Py_buffer * buf)5970 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
5971   buf->buf = NULL;
5972   buf->obj = NULL;
5973   buf->strides = __Pyx_zeros;
5974   buf->shape = __Pyx_zeros;
5975   buf->suboffsets = __Pyx_minusones;
5976 }
__Pyx__GetBufferAndValidate(Py_buffer * buf,PyObject * obj,__Pyx_TypeInfo * dtype,int flags,int nd,int cast,__Pyx_BufFmt_StackElem * stack)5977 static int __Pyx__GetBufferAndValidate(
5978         Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
5979         int nd, int cast, __Pyx_BufFmt_StackElem* stack)
5980 {
5981   buf->buf = NULL;
5982   if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
5983     __Pyx_ZeroBuffer(buf);
5984     return -1;
5985   }
5986   if (unlikely(buf->ndim != nd)) {
5987     PyErr_Format(PyExc_ValueError,
5988                  "Buffer has wrong number of dimensions (expected %d, got %d)",
5989                  nd, buf->ndim);
5990     goto fail;
5991   }
5992   if (!cast) {
5993     __Pyx_BufFmt_Context ctx;
5994     __Pyx_BufFmt_Init(&ctx, stack, dtype);
5995     if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
5996   }
5997   if (unlikely((size_t)buf->itemsize != dtype->size)) {
5998     PyErr_Format(PyExc_ValueError,
5999       "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
6000       buf->itemsize, (buf->itemsize > 1) ? "s" : "",
6001       dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
6002     goto fail;
6003   }
6004   if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
6005   return 0;
6006 fail:;
6007   __Pyx_SafeReleaseBuffer(buf);
6008   return -1;
6009 }
6010 
6011 /* PyDictVersioning */
6012   #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)6013 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
6014     PyObject *dict = Py_TYPE(obj)->tp_dict;
6015     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
6016 }
__Pyx_get_object_dict_version(PyObject * obj)6017 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
6018     PyObject **dictptr = NULL;
6019     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
6020     if (offset) {
6021 #if CYTHON_COMPILING_IN_CPYTHON
6022         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
6023 #else
6024         dictptr = _PyObject_GetDictPtr(obj);
6025 #endif
6026     }
6027     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
6028 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)6029 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
6030     PyObject *dict = Py_TYPE(obj)->tp_dict;
6031     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
6032         return 0;
6033     return obj_dict_version == __Pyx_get_object_dict_version(obj);
6034 }
6035 #endif
6036 
6037 /* GetModuleGlobalName */
6038   #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)6039 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
6040 #else
6041 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
6042 #endif
6043 {
6044     PyObject *result;
6045 #if !CYTHON_AVOID_BORROWED_REFS
6046 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
6047     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
6048     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
6049     if (likely(result)) {
6050         return __Pyx_NewRef(result);
6051     } else if (unlikely(PyErr_Occurred())) {
6052         return NULL;
6053     }
6054 #else
6055     result = PyDict_GetItem(__pyx_d, name);
6056     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
6057     if (likely(result)) {
6058         return __Pyx_NewRef(result);
6059     }
6060 #endif
6061 #else
6062     result = PyObject_GetItem(__pyx_d, name);
6063     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
6064     if (likely(result)) {
6065         return __Pyx_NewRef(result);
6066     }
6067     PyErr_Clear();
6068 #endif
6069     return __Pyx_GetBuiltinName(name);
6070 }
6071 
6072 /* PyObjectCall */
6073   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)6074 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
6075     PyObject *result;
6076     ternaryfunc call = func->ob_type->tp_call;
6077     if (unlikely(!call))
6078         return PyObject_Call(func, arg, kw);
6079     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
6080         return NULL;
6081     result = (*call)(func, arg, kw);
6082     Py_LeaveRecursiveCall();
6083     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
6084         PyErr_SetString(
6085             PyExc_SystemError,
6086             "NULL result without error in PyObject_Call");
6087     }
6088     return result;
6089 }
6090 #endif
6091 
6092 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)6093   static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
6094     if (unlikely(!type)) {
6095         PyErr_SetString(PyExc_SystemError, "Missing type object");
6096         return 0;
6097     }
6098     if (likely(__Pyx_TypeCheck(obj, type)))
6099         return 1;
6100     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
6101                  Py_TYPE(obj)->tp_name, type->tp_name);
6102     return 0;
6103 }
6104 
6105 /* BufferFallbackError */
__Pyx_RaiseBufferFallbackError(void)6106   static void __Pyx_RaiseBufferFallbackError(void) {
6107   PyErr_SetString(PyExc_ValueError,
6108      "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
6109 }
6110 
6111 /* BufferIndexError */
__Pyx_RaiseBufferIndexError(int axis)6112   static void __Pyx_RaiseBufferIndexError(int axis) {
6113   PyErr_Format(PyExc_IndexError,
6114      "Out of bounds on buffer access (axis %d)", axis);
6115 }
6116 
6117 /* PyCFunctionFastCall */
6118   #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)6119 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
6120     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
6121     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
6122     PyObject *self = PyCFunction_GET_SELF(func);
6123     int flags = PyCFunction_GET_FLAGS(func);
6124     assert(PyCFunction_Check(func));
6125     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
6126     assert(nargs >= 0);
6127     assert(nargs == 0 || args != NULL);
6128     /* _PyCFunction_FastCallDict() must not be called with an exception set,
6129        because it may clear it (directly or indirectly) and so the
6130        caller loses its exception */
6131     assert(!PyErr_Occurred());
6132     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
6133         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
6134     } else {
6135         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
6136     }
6137 }
6138 #endif
6139 
6140 /* PyFunctionFastCall */
6141   #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)6142 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
6143                                                PyObject *globals) {
6144     PyFrameObject *f;
6145     PyThreadState *tstate = __Pyx_PyThreadState_Current;
6146     PyObject **fastlocals;
6147     Py_ssize_t i;
6148     PyObject *result;
6149     assert(globals != NULL);
6150     /* XXX Perhaps we should create a specialized
6151        PyFrame_New() that doesn't take locals, but does
6152        take builtins without sanity checking them.
6153        */
6154     assert(tstate != NULL);
6155     f = PyFrame_New(tstate, co, globals, NULL);
6156     if (f == NULL) {
6157         return NULL;
6158     }
6159     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
6160     for (i = 0; i < na; i++) {
6161         Py_INCREF(*args);
6162         fastlocals[i] = *args++;
6163     }
6164     result = PyEval_EvalFrameEx(f,0);
6165     ++tstate->recursion_depth;
6166     Py_DECREF(f);
6167     --tstate->recursion_depth;
6168     return result;
6169 }
6170 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)6171 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
6172     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
6173     PyObject *globals = PyFunction_GET_GLOBALS(func);
6174     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
6175     PyObject *closure;
6176 #if PY_MAJOR_VERSION >= 3
6177     PyObject *kwdefs;
6178 #endif
6179     PyObject *kwtuple, **k;
6180     PyObject **d;
6181     Py_ssize_t nd;
6182     Py_ssize_t nk;
6183     PyObject *result;
6184     assert(kwargs == NULL || PyDict_Check(kwargs));
6185     nk = kwargs ? PyDict_Size(kwargs) : 0;
6186     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
6187         return NULL;
6188     }
6189     if (
6190 #if PY_MAJOR_VERSION >= 3
6191             co->co_kwonlyargcount == 0 &&
6192 #endif
6193             likely(kwargs == NULL || nk == 0) &&
6194             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
6195         if (argdefs == NULL && co->co_argcount == nargs) {
6196             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
6197             goto done;
6198         }
6199         else if (nargs == 0 && argdefs != NULL
6200                  && co->co_argcount == Py_SIZE(argdefs)) {
6201             /* function called with no arguments, but all parameters have
6202                a default value: use default values as arguments .*/
6203             args = &PyTuple_GET_ITEM(argdefs, 0);
6204             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
6205             goto done;
6206         }
6207     }
6208     if (kwargs != NULL) {
6209         Py_ssize_t pos, i;
6210         kwtuple = PyTuple_New(2 * nk);
6211         if (kwtuple == NULL) {
6212             result = NULL;
6213             goto done;
6214         }
6215         k = &PyTuple_GET_ITEM(kwtuple, 0);
6216         pos = i = 0;
6217         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
6218             Py_INCREF(k[i]);
6219             Py_INCREF(k[i+1]);
6220             i += 2;
6221         }
6222         nk = i / 2;
6223     }
6224     else {
6225         kwtuple = NULL;
6226         k = NULL;
6227     }
6228     closure = PyFunction_GET_CLOSURE(func);
6229 #if PY_MAJOR_VERSION >= 3
6230     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
6231 #endif
6232     if (argdefs != NULL) {
6233         d = &PyTuple_GET_ITEM(argdefs, 0);
6234         nd = Py_SIZE(argdefs);
6235     }
6236     else {
6237         d = NULL;
6238         nd = 0;
6239     }
6240 #if PY_MAJOR_VERSION >= 3
6241     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
6242                                args, (int)nargs,
6243                                k, (int)nk,
6244                                d, (int)nd, kwdefs, closure);
6245 #else
6246     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
6247                                args, (int)nargs,
6248                                k, (int)nk,
6249                                d, (int)nd, closure);
6250 #endif
6251     Py_XDECREF(kwtuple);
6252 done:
6253     Py_LeaveRecursiveCall();
6254     return result;
6255 }
6256 #endif
6257 #endif
6258 
6259 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)6260   static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
6261     PyObject *args, *result = NULL;
6262     #if CYTHON_FAST_PYCALL
6263     if (PyFunction_Check(function)) {
6264         PyObject *args[2] = {arg1, arg2};
6265         return __Pyx_PyFunction_FastCall(function, args, 2);
6266     }
6267     #endif
6268     #if CYTHON_FAST_PYCCALL
6269     if (__Pyx_PyFastCFunction_Check(function)) {
6270         PyObject *args[2] = {arg1, arg2};
6271         return __Pyx_PyCFunction_FastCall(function, args, 2);
6272     }
6273     #endif
6274     args = PyTuple_New(2);
6275     if (unlikely(!args)) goto done;
6276     Py_INCREF(arg1);
6277     PyTuple_SET_ITEM(args, 0, arg1);
6278     Py_INCREF(arg2);
6279     PyTuple_SET_ITEM(args, 1, arg2);
6280     Py_INCREF(function);
6281     result = __Pyx_PyObject_Call(function, args, NULL);
6282     Py_DECREF(args);
6283     Py_DECREF(function);
6284 done:
6285     return result;
6286 }
6287 
6288 /* PyObjectCallMethO */
6289   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)6290 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
6291     PyObject *self, *result;
6292     PyCFunction cfunc;
6293     cfunc = PyCFunction_GET_FUNCTION(func);
6294     self = PyCFunction_GET_SELF(func);
6295     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
6296         return NULL;
6297     result = cfunc(self, arg);
6298     Py_LeaveRecursiveCall();
6299     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
6300         PyErr_SetString(
6301             PyExc_SystemError,
6302             "NULL result without error in PyObject_Call");
6303     }
6304     return result;
6305 }
6306 #endif
6307 
6308 /* PyObjectCallOneArg */
6309   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)6310 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
6311     PyObject *result;
6312     PyObject *args = PyTuple_New(1);
6313     if (unlikely(!args)) return NULL;
6314     Py_INCREF(arg);
6315     PyTuple_SET_ITEM(args, 0, arg);
6316     result = __Pyx_PyObject_Call(func, args, NULL);
6317     Py_DECREF(args);
6318     return result;
6319 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)6320 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
6321 #if CYTHON_FAST_PYCALL
6322     if (PyFunction_Check(func)) {
6323         return __Pyx_PyFunction_FastCall(func, &arg, 1);
6324     }
6325 #endif
6326     if (likely(PyCFunction_Check(func))) {
6327         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
6328             return __Pyx_PyObject_CallMethO(func, arg);
6329 #if CYTHON_FAST_PYCCALL
6330         } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
6331             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
6332 #endif
6333         }
6334     }
6335     return __Pyx__PyObject_CallOneArg(func, arg);
6336 }
6337 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)6338 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
6339     PyObject *result;
6340     PyObject *args = PyTuple_Pack(1, arg);
6341     if (unlikely(!args)) return NULL;
6342     result = __Pyx_PyObject_Call(func, args, NULL);
6343     Py_DECREF(args);
6344     return result;
6345 }
6346 #endif
6347 
6348 /* SliceObject */
__Pyx_PyObject_GetSlice(PyObject * obj,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)6349   static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
6350         Py_ssize_t cstart, Py_ssize_t cstop,
6351         PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
6352         int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
6353 #if CYTHON_USE_TYPE_SLOTS
6354     PyMappingMethods* mp;
6355 #if PY_MAJOR_VERSION < 3
6356     PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
6357     if (likely(ms && ms->sq_slice)) {
6358         if (!has_cstart) {
6359             if (_py_start && (*_py_start != Py_None)) {
6360                 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
6361                 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
6362             } else
6363                 cstart = 0;
6364         }
6365         if (!has_cstop) {
6366             if (_py_stop && (*_py_stop != Py_None)) {
6367                 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
6368                 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
6369             } else
6370                 cstop = PY_SSIZE_T_MAX;
6371         }
6372         if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
6373             Py_ssize_t l = ms->sq_length(obj);
6374             if (likely(l >= 0)) {
6375                 if (cstop < 0) {
6376                     cstop += l;
6377                     if (cstop < 0) cstop = 0;
6378                 }
6379                 if (cstart < 0) {
6380                     cstart += l;
6381                     if (cstart < 0) cstart = 0;
6382                 }
6383             } else {
6384                 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
6385                     goto bad;
6386                 PyErr_Clear();
6387             }
6388         }
6389         return ms->sq_slice(obj, cstart, cstop);
6390     }
6391 #endif
6392     mp = Py_TYPE(obj)->tp_as_mapping;
6393     if (likely(mp && mp->mp_subscript))
6394 #endif
6395     {
6396         PyObject* result;
6397         PyObject *py_slice, *py_start, *py_stop;
6398         if (_py_slice) {
6399             py_slice = *_py_slice;
6400         } else {
6401             PyObject* owned_start = NULL;
6402             PyObject* owned_stop = NULL;
6403             if (_py_start) {
6404                 py_start = *_py_start;
6405             } else {
6406                 if (has_cstart) {
6407                     owned_start = py_start = PyInt_FromSsize_t(cstart);
6408                     if (unlikely(!py_start)) goto bad;
6409                 } else
6410                     py_start = Py_None;
6411             }
6412             if (_py_stop) {
6413                 py_stop = *_py_stop;
6414             } else {
6415                 if (has_cstop) {
6416                     owned_stop = py_stop = PyInt_FromSsize_t(cstop);
6417                     if (unlikely(!py_stop)) {
6418                         Py_XDECREF(owned_start);
6419                         goto bad;
6420                     }
6421                 } else
6422                     py_stop = Py_None;
6423             }
6424             py_slice = PySlice_New(py_start, py_stop, Py_None);
6425             Py_XDECREF(owned_start);
6426             Py_XDECREF(owned_stop);
6427             if (unlikely(!py_slice)) goto bad;
6428         }
6429 #if CYTHON_USE_TYPE_SLOTS
6430         result = mp->mp_subscript(obj, py_slice);
6431 #else
6432         result = PyObject_GetItem(obj, py_slice);
6433 #endif
6434         if (!_py_slice) {
6435             Py_DECREF(py_slice);
6436         }
6437         return result;
6438     }
6439     PyErr_Format(PyExc_TypeError,
6440         "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
6441 bad:
6442     return NULL;
6443 }
6444 
6445 /* PyErrFetchRestore */
6446   #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)6447 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
6448     PyObject *tmp_type, *tmp_value, *tmp_tb;
6449     tmp_type = tstate->curexc_type;
6450     tmp_value = tstate->curexc_value;
6451     tmp_tb = tstate->curexc_traceback;
6452     tstate->curexc_type = type;
6453     tstate->curexc_value = value;
6454     tstate->curexc_traceback = tb;
6455     Py_XDECREF(tmp_type);
6456     Py_XDECREF(tmp_value);
6457     Py_XDECREF(tmp_tb);
6458 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)6459 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
6460     *type = tstate->curexc_type;
6461     *value = tstate->curexc_value;
6462     *tb = tstate->curexc_traceback;
6463     tstate->curexc_type = 0;
6464     tstate->curexc_value = 0;
6465     tstate->curexc_traceback = 0;
6466 }
6467 #endif
6468 
6469 /* RaiseException */
6470   #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)6471 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
6472                         CYTHON_UNUSED PyObject *cause) {
6473     __Pyx_PyThreadState_declare
6474     Py_XINCREF(type);
6475     if (!value || value == Py_None)
6476         value = NULL;
6477     else
6478         Py_INCREF(value);
6479     if (!tb || tb == Py_None)
6480         tb = NULL;
6481     else {
6482         Py_INCREF(tb);
6483         if (!PyTraceBack_Check(tb)) {
6484             PyErr_SetString(PyExc_TypeError,
6485                 "raise: arg 3 must be a traceback or None");
6486             goto raise_error;
6487         }
6488     }
6489     if (PyType_Check(type)) {
6490 #if CYTHON_COMPILING_IN_PYPY
6491         if (!value) {
6492             Py_INCREF(Py_None);
6493             value = Py_None;
6494         }
6495 #endif
6496         PyErr_NormalizeException(&type, &value, &tb);
6497     } else {
6498         if (value) {
6499             PyErr_SetString(PyExc_TypeError,
6500                 "instance exception may not have a separate value");
6501             goto raise_error;
6502         }
6503         value = type;
6504         type = (PyObject*) Py_TYPE(type);
6505         Py_INCREF(type);
6506         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
6507             PyErr_SetString(PyExc_TypeError,
6508                 "raise: exception class must be a subclass of BaseException");
6509             goto raise_error;
6510         }
6511     }
6512     __Pyx_PyThreadState_assign
6513     __Pyx_ErrRestore(type, value, tb);
6514     return;
6515 raise_error:
6516     Py_XDECREF(value);
6517     Py_XDECREF(type);
6518     Py_XDECREF(tb);
6519     return;
6520 }
6521 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)6522 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
6523     PyObject* owned_instance = NULL;
6524     if (tb == Py_None) {
6525         tb = 0;
6526     } else if (tb && !PyTraceBack_Check(tb)) {
6527         PyErr_SetString(PyExc_TypeError,
6528             "raise: arg 3 must be a traceback or None");
6529         goto bad;
6530     }
6531     if (value == Py_None)
6532         value = 0;
6533     if (PyExceptionInstance_Check(type)) {
6534         if (value) {
6535             PyErr_SetString(PyExc_TypeError,
6536                 "instance exception may not have a separate value");
6537             goto bad;
6538         }
6539         value = type;
6540         type = (PyObject*) Py_TYPE(value);
6541     } else if (PyExceptionClass_Check(type)) {
6542         PyObject *instance_class = NULL;
6543         if (value && PyExceptionInstance_Check(value)) {
6544             instance_class = (PyObject*) Py_TYPE(value);
6545             if (instance_class != type) {
6546                 int is_subclass = PyObject_IsSubclass(instance_class, type);
6547                 if (!is_subclass) {
6548                     instance_class = NULL;
6549                 } else if (unlikely(is_subclass == -1)) {
6550                     goto bad;
6551                 } else {
6552                     type = instance_class;
6553                 }
6554             }
6555         }
6556         if (!instance_class) {
6557             PyObject *args;
6558             if (!value)
6559                 args = PyTuple_New(0);
6560             else if (PyTuple_Check(value)) {
6561                 Py_INCREF(value);
6562                 args = value;
6563             } else
6564                 args = PyTuple_Pack(1, value);
6565             if (!args)
6566                 goto bad;
6567             owned_instance = PyObject_Call(type, args, NULL);
6568             Py_DECREF(args);
6569             if (!owned_instance)
6570                 goto bad;
6571             value = owned_instance;
6572             if (!PyExceptionInstance_Check(value)) {
6573                 PyErr_Format(PyExc_TypeError,
6574                              "calling %R should have returned an instance of "
6575                              "BaseException, not %R",
6576                              type, Py_TYPE(value));
6577                 goto bad;
6578             }
6579         }
6580     } else {
6581         PyErr_SetString(PyExc_TypeError,
6582             "raise: exception class must be a subclass of BaseException");
6583         goto bad;
6584     }
6585     if (cause) {
6586         PyObject *fixed_cause;
6587         if (cause == Py_None) {
6588             fixed_cause = NULL;
6589         } else if (PyExceptionClass_Check(cause)) {
6590             fixed_cause = PyObject_CallObject(cause, NULL);
6591             if (fixed_cause == NULL)
6592                 goto bad;
6593         } else if (PyExceptionInstance_Check(cause)) {
6594             fixed_cause = cause;
6595             Py_INCREF(fixed_cause);
6596         } else {
6597             PyErr_SetString(PyExc_TypeError,
6598                             "exception causes must derive from "
6599                             "BaseException");
6600             goto bad;
6601         }
6602         PyException_SetCause(value, fixed_cause);
6603     }
6604     PyErr_SetObject(type, value);
6605     if (tb) {
6606 #if CYTHON_COMPILING_IN_PYPY
6607         PyObject *tmp_type, *tmp_value, *tmp_tb;
6608         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
6609         Py_INCREF(tb);
6610         PyErr_Restore(tmp_type, tmp_value, tb);
6611         Py_XDECREF(tmp_tb);
6612 #else
6613         PyThreadState *tstate = __Pyx_PyThreadState_Current;
6614         PyObject* tmp_tb = tstate->curexc_traceback;
6615         if (tb != tmp_tb) {
6616             Py_INCREF(tb);
6617             tstate->curexc_traceback = tb;
6618             Py_XDECREF(tmp_tb);
6619         }
6620 #endif
6621     }
6622 bad:
6623     Py_XDECREF(owned_instance);
6624     return;
6625 }
6626 #endif
6627 
6628 /* DictGetItem */
6629   #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)6630 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
6631     PyObject *value;
6632     value = PyDict_GetItemWithError(d, key);
6633     if (unlikely(!value)) {
6634         if (!PyErr_Occurred()) {
6635             if (unlikely(PyTuple_Check(key))) {
6636                 PyObject* args = PyTuple_Pack(1, key);
6637                 if (likely(args)) {
6638                     PyErr_SetObject(PyExc_KeyError, args);
6639                     Py_DECREF(args);
6640                 }
6641             } else {
6642                 PyErr_SetObject(PyExc_KeyError, key);
6643             }
6644         }
6645         return NULL;
6646     }
6647     Py_INCREF(value);
6648     return value;
6649 }
6650 #endif
6651 
6652 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)6653   static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
6654     PyErr_Format(PyExc_ValueError,
6655                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
6656 }
6657 
6658 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)6659   static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
6660     PyErr_Format(PyExc_ValueError,
6661                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
6662                  index, (index == 1) ? "" : "s");
6663 }
6664 
6665 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)6666   static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
6667     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
6668 }
6669 
6670 /* GetTopmostException */
6671   #if CYTHON_USE_EXC_INFO_STACK
6672 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)6673 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
6674 {
6675     _PyErr_StackItem *exc_info = tstate->exc_info;
6676     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
6677            exc_info->previous_item != NULL)
6678     {
6679         exc_info = exc_info->previous_item;
6680     }
6681     return exc_info;
6682 }
6683 #endif
6684 
6685 /* SaveResetException */
6686   #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)6687 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
6688     #if CYTHON_USE_EXC_INFO_STACK
6689     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
6690     *type = exc_info->exc_type;
6691     *value = exc_info->exc_value;
6692     *tb = exc_info->exc_traceback;
6693     #else
6694     *type = tstate->exc_type;
6695     *value = tstate->exc_value;
6696     *tb = tstate->exc_traceback;
6697     #endif
6698     Py_XINCREF(*type);
6699     Py_XINCREF(*value);
6700     Py_XINCREF(*tb);
6701 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)6702 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
6703     PyObject *tmp_type, *tmp_value, *tmp_tb;
6704     #if CYTHON_USE_EXC_INFO_STACK
6705     _PyErr_StackItem *exc_info = tstate->exc_info;
6706     tmp_type = exc_info->exc_type;
6707     tmp_value = exc_info->exc_value;
6708     tmp_tb = exc_info->exc_traceback;
6709     exc_info->exc_type = type;
6710     exc_info->exc_value = value;
6711     exc_info->exc_traceback = tb;
6712     #else
6713     tmp_type = tstate->exc_type;
6714     tmp_value = tstate->exc_value;
6715     tmp_tb = tstate->exc_traceback;
6716     tstate->exc_type = type;
6717     tstate->exc_value = value;
6718     tstate->exc_traceback = tb;
6719     #endif
6720     Py_XDECREF(tmp_type);
6721     Py_XDECREF(tmp_value);
6722     Py_XDECREF(tmp_tb);
6723 }
6724 #endif
6725 
6726 /* PyErrExceptionMatches */
6727   #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)6728 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
6729     Py_ssize_t i, n;
6730     n = PyTuple_GET_SIZE(tuple);
6731 #if PY_MAJOR_VERSION >= 3
6732     for (i=0; i<n; i++) {
6733         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
6734     }
6735 #endif
6736     for (i=0; i<n; i++) {
6737         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
6738     }
6739     return 0;
6740 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)6741 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
6742     PyObject *exc_type = tstate->curexc_type;
6743     if (exc_type == err) return 1;
6744     if (unlikely(!exc_type)) return 0;
6745     if (unlikely(PyTuple_Check(err)))
6746         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
6747     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
6748 }
6749 #endif
6750 
6751 /* GetException */
6752   #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)6753 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
6754 #else
6755 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
6756 #endif
6757 {
6758     PyObject *local_type, *local_value, *local_tb;
6759 #if CYTHON_FAST_THREAD_STATE
6760     PyObject *tmp_type, *tmp_value, *tmp_tb;
6761     local_type = tstate->curexc_type;
6762     local_value = tstate->curexc_value;
6763     local_tb = tstate->curexc_traceback;
6764     tstate->curexc_type = 0;
6765     tstate->curexc_value = 0;
6766     tstate->curexc_traceback = 0;
6767 #else
6768     PyErr_Fetch(&local_type, &local_value, &local_tb);
6769 #endif
6770     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
6771 #if CYTHON_FAST_THREAD_STATE
6772     if (unlikely(tstate->curexc_type))
6773 #else
6774     if (unlikely(PyErr_Occurred()))
6775 #endif
6776         goto bad;
6777     #if PY_MAJOR_VERSION >= 3
6778     if (local_tb) {
6779         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
6780             goto bad;
6781     }
6782     #endif
6783     Py_XINCREF(local_tb);
6784     Py_XINCREF(local_type);
6785     Py_XINCREF(local_value);
6786     *type = local_type;
6787     *value = local_value;
6788     *tb = local_tb;
6789 #if CYTHON_FAST_THREAD_STATE
6790     #if CYTHON_USE_EXC_INFO_STACK
6791     {
6792         _PyErr_StackItem *exc_info = tstate->exc_info;
6793         tmp_type = exc_info->exc_type;
6794         tmp_value = exc_info->exc_value;
6795         tmp_tb = exc_info->exc_traceback;
6796         exc_info->exc_type = local_type;
6797         exc_info->exc_value = local_value;
6798         exc_info->exc_traceback = local_tb;
6799     }
6800     #else
6801     tmp_type = tstate->exc_type;
6802     tmp_value = tstate->exc_value;
6803     tmp_tb = tstate->exc_traceback;
6804     tstate->exc_type = local_type;
6805     tstate->exc_value = local_value;
6806     tstate->exc_traceback = local_tb;
6807     #endif
6808     Py_XDECREF(tmp_type);
6809     Py_XDECREF(tmp_value);
6810     Py_XDECREF(tmp_tb);
6811 #else
6812     PyErr_SetExcInfo(local_type, local_value, local_tb);
6813 #endif
6814     return 0;
6815 bad:
6816     *type = 0;
6817     *value = 0;
6818     *tb = 0;
6819     Py_XDECREF(local_type);
6820     Py_XDECREF(local_value);
6821     Py_XDECREF(local_tb);
6822     return -1;
6823 }
6824 
6825 /* TypeImport */
6826   #ifndef __PYX_HAVE_RT_ImportType
6827 #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)6828 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
6829     size_t size, enum __Pyx_ImportType_CheckSize check_size)
6830 {
6831     PyObject *result = 0;
6832     char warning[200];
6833     Py_ssize_t basicsize;
6834 #ifdef Py_LIMITED_API
6835     PyObject *py_basicsize;
6836 #endif
6837     result = PyObject_GetAttrString(module, class_name);
6838     if (!result)
6839         goto bad;
6840     if (!PyType_Check(result)) {
6841         PyErr_Format(PyExc_TypeError,
6842             "%.200s.%.200s is not a type object",
6843             module_name, class_name);
6844         goto bad;
6845     }
6846 #ifndef Py_LIMITED_API
6847     basicsize = ((PyTypeObject *)result)->tp_basicsize;
6848 #else
6849     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
6850     if (!py_basicsize)
6851         goto bad;
6852     basicsize = PyLong_AsSsize_t(py_basicsize);
6853     Py_DECREF(py_basicsize);
6854     py_basicsize = 0;
6855     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
6856         goto bad;
6857 #endif
6858     if ((size_t)basicsize < size) {
6859         PyErr_Format(PyExc_ValueError,
6860             "%.200s.%.200s size changed, may indicate binary incompatibility. "
6861             "Expected %zd from C header, got %zd from PyObject",
6862             module_name, class_name, size, basicsize);
6863         goto bad;
6864     }
6865     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
6866         PyErr_Format(PyExc_ValueError,
6867             "%.200s.%.200s size changed, may indicate binary incompatibility. "
6868             "Expected %zd from C header, got %zd from PyObject",
6869             module_name, class_name, size, basicsize);
6870         goto bad;
6871     }
6872     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
6873         PyOS_snprintf(warning, sizeof(warning),
6874             "%s.%s size changed, may indicate binary incompatibility. "
6875             "Expected %zd from C header, got %zd from PyObject",
6876             module_name, class_name, size, basicsize);
6877         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
6878     }
6879     return (PyTypeObject *)result;
6880 bad:
6881     Py_XDECREF(result);
6882     return NULL;
6883 }
6884 #endif
6885 
6886 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)6887   static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
6888     PyObject *empty_list = 0;
6889     PyObject *module = 0;
6890     PyObject *global_dict = 0;
6891     PyObject *empty_dict = 0;
6892     PyObject *list;
6893     #if PY_MAJOR_VERSION < 3
6894     PyObject *py_import;
6895     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
6896     if (!py_import)
6897         goto bad;
6898     #endif
6899     if (from_list)
6900         list = from_list;
6901     else {
6902         empty_list = PyList_New(0);
6903         if (!empty_list)
6904             goto bad;
6905         list = empty_list;
6906     }
6907     global_dict = PyModule_GetDict(__pyx_m);
6908     if (!global_dict)
6909         goto bad;
6910     empty_dict = PyDict_New();
6911     if (!empty_dict)
6912         goto bad;
6913     {
6914         #if PY_MAJOR_VERSION >= 3
6915         if (level == -1) {
6916             if (strchr(__Pyx_MODULE_NAME, '.')) {
6917                 module = PyImport_ImportModuleLevelObject(
6918                     name, global_dict, empty_dict, list, 1);
6919                 if (!module) {
6920                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
6921                         goto bad;
6922                     PyErr_Clear();
6923                 }
6924             }
6925             level = 0;
6926         }
6927         #endif
6928         if (!module) {
6929             #if PY_MAJOR_VERSION < 3
6930             PyObject *py_level = PyInt_FromLong(level);
6931             if (!py_level)
6932                 goto bad;
6933             module = PyObject_CallFunctionObjArgs(py_import,
6934                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
6935             Py_DECREF(py_level);
6936             #else
6937             module = PyImport_ImportModuleLevelObject(
6938                 name, global_dict, empty_dict, list, level);
6939             #endif
6940         }
6941     }
6942 bad:
6943     #if PY_MAJOR_VERSION < 3
6944     Py_XDECREF(py_import);
6945     #endif
6946     Py_XDECREF(empty_list);
6947     Py_XDECREF(empty_dict);
6948     return module;
6949 }
6950 
6951 /* CLineInTraceback */
6952   #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(PyThreadState * tstate,int c_line)6953 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
6954     PyObject *use_cline;
6955     PyObject *ptype, *pvalue, *ptraceback;
6956 #if CYTHON_COMPILING_IN_CPYTHON
6957     PyObject **cython_runtime_dict;
6958 #endif
6959     if (unlikely(!__pyx_cython_runtime)) {
6960         return c_line;
6961     }
6962     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
6963 #if CYTHON_COMPILING_IN_CPYTHON
6964     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
6965     if (likely(cython_runtime_dict)) {
6966         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
6967             use_cline, *cython_runtime_dict,
6968             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
6969     } else
6970 #endif
6971     {
6972       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
6973       if (use_cline_obj) {
6974         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
6975         Py_DECREF(use_cline_obj);
6976       } else {
6977         PyErr_Clear();
6978         use_cline = NULL;
6979       }
6980     }
6981     if (!use_cline) {
6982         c_line = 0;
6983         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
6984     }
6985     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
6986         c_line = 0;
6987     }
6988     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
6989     return c_line;
6990 }
6991 #endif
6992 
6993 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)6994   static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
6995     int start = 0, mid = 0, end = count - 1;
6996     if (end >= 0 && code_line > entries[end].code_line) {
6997         return count;
6998     }
6999     while (start < end) {
7000         mid = start + (end - start) / 2;
7001         if (code_line < entries[mid].code_line) {
7002             end = mid;
7003         } else if (code_line > entries[mid].code_line) {
7004              start = mid + 1;
7005         } else {
7006             return mid;
7007         }
7008     }
7009     if (code_line <= entries[mid].code_line) {
7010         return mid;
7011     } else {
7012         return mid + 1;
7013     }
7014 }
__pyx_find_code_object(int code_line)7015 static PyCodeObject *__pyx_find_code_object(int code_line) {
7016     PyCodeObject* code_object;
7017     int pos;
7018     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
7019         return NULL;
7020     }
7021     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
7022     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
7023         return NULL;
7024     }
7025     code_object = __pyx_code_cache.entries[pos].code_object;
7026     Py_INCREF(code_object);
7027     return code_object;
7028 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)7029 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
7030     int pos, i;
7031     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
7032     if (unlikely(!code_line)) {
7033         return;
7034     }
7035     if (unlikely(!entries)) {
7036         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
7037         if (likely(entries)) {
7038             __pyx_code_cache.entries = entries;
7039             __pyx_code_cache.max_count = 64;
7040             __pyx_code_cache.count = 1;
7041             entries[0].code_line = code_line;
7042             entries[0].code_object = code_object;
7043             Py_INCREF(code_object);
7044         }
7045         return;
7046     }
7047     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
7048     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
7049         PyCodeObject* tmp = entries[pos].code_object;
7050         entries[pos].code_object = code_object;
7051         Py_DECREF(tmp);
7052         return;
7053     }
7054     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
7055         int new_max = __pyx_code_cache.max_count + 64;
7056         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
7057             __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
7058         if (unlikely(!entries)) {
7059             return;
7060         }
7061         __pyx_code_cache.entries = entries;
7062         __pyx_code_cache.max_count = new_max;
7063     }
7064     for (i=__pyx_code_cache.count; i>pos; i--) {
7065         entries[i] = entries[i-1];
7066     }
7067     entries[pos].code_line = code_line;
7068     entries[pos].code_object = code_object;
7069     __pyx_code_cache.count++;
7070     Py_INCREF(code_object);
7071 }
7072 
7073 /* AddTraceback */
7074   #include "compile.h"
7075 #include "frameobject.h"
7076 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)7077 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
7078             const char *funcname, int c_line,
7079             int py_line, const char *filename) {
7080     PyCodeObject *py_code = 0;
7081     PyObject *py_srcfile = 0;
7082     PyObject *py_funcname = 0;
7083     #if PY_MAJOR_VERSION < 3
7084     py_srcfile = PyString_FromString(filename);
7085     #else
7086     py_srcfile = PyUnicode_FromString(filename);
7087     #endif
7088     if (!py_srcfile) goto bad;
7089     if (c_line) {
7090         #if PY_MAJOR_VERSION < 3
7091         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
7092         #else
7093         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
7094         #endif
7095     }
7096     else {
7097         #if PY_MAJOR_VERSION < 3
7098         py_funcname = PyString_FromString(funcname);
7099         #else
7100         py_funcname = PyUnicode_FromString(funcname);
7101         #endif
7102     }
7103     if (!py_funcname) goto bad;
7104     py_code = __Pyx_PyCode_New(
7105         0,
7106         0,
7107         0,
7108         0,
7109         0,
7110         __pyx_empty_bytes, /*PyObject *code,*/
7111         __pyx_empty_tuple, /*PyObject *consts,*/
7112         __pyx_empty_tuple, /*PyObject *names,*/
7113         __pyx_empty_tuple, /*PyObject *varnames,*/
7114         __pyx_empty_tuple, /*PyObject *freevars,*/
7115         __pyx_empty_tuple, /*PyObject *cellvars,*/
7116         py_srcfile,   /*PyObject *filename,*/
7117         py_funcname,  /*PyObject *name,*/
7118         py_line,
7119         __pyx_empty_bytes  /*PyObject *lnotab*/
7120     );
7121     Py_DECREF(py_srcfile);
7122     Py_DECREF(py_funcname);
7123     return py_code;
7124 bad:
7125     Py_XDECREF(py_srcfile);
7126     Py_XDECREF(py_funcname);
7127     return NULL;
7128 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)7129 static void __Pyx_AddTraceback(const char *funcname, int c_line,
7130                                int py_line, const char *filename) {
7131     PyCodeObject *py_code = 0;
7132     PyFrameObject *py_frame = 0;
7133     PyThreadState *tstate = __Pyx_PyThreadState_Current;
7134     if (c_line) {
7135         c_line = __Pyx_CLineForTraceback(tstate, c_line);
7136     }
7137     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
7138     if (!py_code) {
7139         py_code = __Pyx_CreateCodeObjectForTraceback(
7140             funcname, c_line, py_line, filename);
7141         if (!py_code) goto bad;
7142         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
7143     }
7144     py_frame = PyFrame_New(
7145         tstate,            /*PyThreadState *tstate,*/
7146         py_code,           /*PyCodeObject *code,*/
7147         __pyx_d,    /*PyObject *globals,*/
7148         0                  /*PyObject *locals*/
7149     );
7150     if (!py_frame) goto bad;
7151     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
7152     PyTraceBack_Here(py_frame);
7153 bad:
7154     Py_XDECREF(py_code);
7155     Py_XDECREF(py_frame);
7156 }
7157 
7158 #if PY_MAJOR_VERSION < 3
__Pyx_GetBuffer(PyObject * obj,Py_buffer * view,int flags)7159 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
7160     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
7161         if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
7162     PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
7163     return -1;
7164 }
__Pyx_ReleaseBuffer(Py_buffer * view)7165 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
7166     PyObject *obj = view->obj;
7167     if (!obj) return;
7168     if (PyObject_CheckBuffer(obj)) {
7169         PyBuffer_Release(view);
7170         return;
7171     }
7172     if ((0)) {}
7173         else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
7174     view->obj = NULL;
7175     Py_DECREF(obj);
7176 }
7177 #endif
7178 
7179 
7180   /* CIntToPy */
__Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value)7181   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
7182     const Py_intptr_t neg_one = (Py_intptr_t) ((Py_intptr_t) 0 - (Py_intptr_t) 1), const_zero = (Py_intptr_t) 0;
7183     const int is_unsigned = neg_one > const_zero;
7184     if (is_unsigned) {
7185         if (sizeof(Py_intptr_t) < sizeof(long)) {
7186             return PyInt_FromLong((long) value);
7187         } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
7188             return PyLong_FromUnsignedLong((unsigned long) value);
7189 #ifdef HAVE_LONG_LONG
7190         } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
7191             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
7192 #endif
7193         }
7194     } else {
7195         if (sizeof(Py_intptr_t) <= sizeof(long)) {
7196             return PyInt_FromLong((long) value);
7197 #ifdef HAVE_LONG_LONG
7198         } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
7199             return PyLong_FromLongLong((PY_LONG_LONG) value);
7200 #endif
7201         }
7202     }
7203     {
7204         int one = 1; int little = (int)*(unsigned char *)&one;
7205         unsigned char *bytes = (unsigned char *)&value;
7206         return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
7207                                      little, !is_unsigned);
7208     }
7209 }
7210 
7211 /* CIntToPy */
__Pyx_PyInt_From_npy_int64(npy_int64 value)7212   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) {
7213     const npy_int64 neg_one = (npy_int64) ((npy_int64) 0 - (npy_int64) 1), const_zero = (npy_int64) 0;
7214     const int is_unsigned = neg_one > const_zero;
7215     if (is_unsigned) {
7216         if (sizeof(npy_int64) < sizeof(long)) {
7217             return PyInt_FromLong((long) value);
7218         } else if (sizeof(npy_int64) <= sizeof(unsigned long)) {
7219             return PyLong_FromUnsignedLong((unsigned long) value);
7220 #ifdef HAVE_LONG_LONG
7221         } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
7222             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
7223 #endif
7224         }
7225     } else {
7226         if (sizeof(npy_int64) <= sizeof(long)) {
7227             return PyInt_FromLong((long) value);
7228 #ifdef HAVE_LONG_LONG
7229         } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
7230             return PyLong_FromLongLong((PY_LONG_LONG) value);
7231 #endif
7232         }
7233     }
7234     {
7235         int one = 1; int little = (int)*(unsigned char *)&one;
7236         unsigned char *bytes = (unsigned char *)&value;
7237         return _PyLong_FromByteArray(bytes, sizeof(npy_int64),
7238                                      little, !is_unsigned);
7239     }
7240 }
7241 
7242 /* CIntFromPyVerify */
7243   #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
7244     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
7245 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
7246     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
7247 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
7248     {\
7249         func_type value = func_value;\
7250         if (sizeof(target_type) < sizeof(func_type)) {\
7251             if (unlikely(value != (func_type) (target_type) value)) {\
7252                 func_type zero = 0;\
7253                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
7254                     return (target_type) -1;\
7255                 if (is_unsigned && unlikely(value < zero))\
7256                     goto raise_neg_overflow;\
7257                 else\
7258                     goto raise_overflow;\
7259             }\
7260         }\
7261         return (target_type) value;\
7262     }
7263 
7264 /* Declarations */
7265   #if CYTHON_CCOMPLEX
7266   #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)7267     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
7268       return ::std::complex< float >(x, y);
7269     }
7270   #else
__pyx_t_float_complex_from_parts(float x,float y)7271     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
7272       return x + y*(__pyx_t_float_complex)_Complex_I;
7273     }
7274   #endif
7275 #else
__pyx_t_float_complex_from_parts(float x,float y)7276     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
7277       __pyx_t_float_complex z;
7278       z.real = x;
7279       z.imag = y;
7280       return z;
7281     }
7282 #endif
7283 
7284 /* Arithmetic */
7285   #if CYTHON_CCOMPLEX
7286 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)7287     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7288        return (a.real == b.real) && (a.imag == b.imag);
7289     }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)7290     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7291         __pyx_t_float_complex z;
7292         z.real = a.real + b.real;
7293         z.imag = a.imag + b.imag;
7294         return z;
7295     }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)7296     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7297         __pyx_t_float_complex z;
7298         z.real = a.real - b.real;
7299         z.imag = a.imag - b.imag;
7300         return z;
7301     }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)7302     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7303         __pyx_t_float_complex z;
7304         z.real = a.real * b.real - a.imag * b.imag;
7305         z.imag = a.real * b.imag + a.imag * b.real;
7306         return z;
7307     }
7308     #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)7309     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7310         if (b.imag == 0) {
7311             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
7312         } else if (fabsf(b.real) >= fabsf(b.imag)) {
7313             if (b.real == 0 && b.imag == 0) {
7314                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
7315             } else {
7316                 float r = b.imag / b.real;
7317                 float s = (float)(1.0) / (b.real + b.imag * r);
7318                 return __pyx_t_float_complex_from_parts(
7319                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
7320             }
7321         } else {
7322             float r = b.real / b.imag;
7323             float s = (float)(1.0) / (b.imag + b.real * r);
7324             return __pyx_t_float_complex_from_parts(
7325                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
7326         }
7327     }
7328     #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)7329     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7330         if (b.imag == 0) {
7331             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
7332         } else {
7333             float denom = b.real * b.real + b.imag * b.imag;
7334             return __pyx_t_float_complex_from_parts(
7335                 (a.real * b.real + a.imag * b.imag) / denom,
7336                 (a.imag * b.real - a.real * b.imag) / denom);
7337         }
7338     }
7339     #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)7340     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
7341         __pyx_t_float_complex z;
7342         z.real = -a.real;
7343         z.imag = -a.imag;
7344         return z;
7345     }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)7346     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
7347        return (a.real == 0) && (a.imag == 0);
7348     }
__Pyx_c_conj_float(__pyx_t_float_complex a)7349     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
7350         __pyx_t_float_complex z;
7351         z.real =  a.real;
7352         z.imag = -a.imag;
7353         return z;
7354     }
7355     #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)7356         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
7357           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
7358             return sqrtf(z.real*z.real + z.imag*z.imag);
7359           #else
7360             return hypotf(z.real, z.imag);
7361           #endif
7362         }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)7363         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7364             __pyx_t_float_complex z;
7365             float r, lnr, theta, z_r, z_theta;
7366             if (b.imag == 0 && b.real == (int)b.real) {
7367                 if (b.real < 0) {
7368                     float denom = a.real * a.real + a.imag * a.imag;
7369                     a.real = a.real / denom;
7370                     a.imag = -a.imag / denom;
7371                     b.real = -b.real;
7372                 }
7373                 switch ((int)b.real) {
7374                     case 0:
7375                         z.real = 1;
7376                         z.imag = 0;
7377                         return z;
7378                     case 1:
7379                         return a;
7380                     case 2:
7381                         z = __Pyx_c_prod_float(a, a);
7382                         return __Pyx_c_prod_float(a, a);
7383                     case 3:
7384                         z = __Pyx_c_prod_float(a, a);
7385                         return __Pyx_c_prod_float(z, a);
7386                     case 4:
7387                         z = __Pyx_c_prod_float(a, a);
7388                         return __Pyx_c_prod_float(z, z);
7389                 }
7390             }
7391             if (a.imag == 0) {
7392                 if (a.real == 0) {
7393                     return a;
7394                 } else if (b.imag == 0) {
7395                     z.real = powf(a.real, b.real);
7396                     z.imag = 0;
7397                     return z;
7398                 } else if (a.real > 0) {
7399                     r = a.real;
7400                     theta = 0;
7401                 } else {
7402                     r = -a.real;
7403                     theta = atan2f(0.0, -1.0);
7404                 }
7405             } else {
7406                 r = __Pyx_c_abs_float(a);
7407                 theta = atan2f(a.imag, a.real);
7408             }
7409             lnr = logf(r);
7410             z_r = expf(lnr * b.real - theta * b.imag);
7411             z_theta = theta * b.real + lnr * b.imag;
7412             z.real = z_r * cosf(z_theta);
7413             z.imag = z_r * sinf(z_theta);
7414             return z;
7415         }
7416     #endif
7417 #endif
7418 
7419 /* Declarations */
7420   #if CYTHON_CCOMPLEX
7421   #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)7422     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
7423       return ::std::complex< double >(x, y);
7424     }
7425   #else
__pyx_t_double_complex_from_parts(double x,double y)7426     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
7427       return x + y*(__pyx_t_double_complex)_Complex_I;
7428     }
7429   #endif
7430 #else
__pyx_t_double_complex_from_parts(double x,double y)7431     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
7432       __pyx_t_double_complex z;
7433       z.real = x;
7434       z.imag = y;
7435       return z;
7436     }
7437 #endif
7438 
7439 /* Arithmetic */
7440   #if CYTHON_CCOMPLEX
7441 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)7442     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7443        return (a.real == b.real) && (a.imag == b.imag);
7444     }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)7445     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7446         __pyx_t_double_complex z;
7447         z.real = a.real + b.real;
7448         z.imag = a.imag + b.imag;
7449         return z;
7450     }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)7451     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7452         __pyx_t_double_complex z;
7453         z.real = a.real - b.real;
7454         z.imag = a.imag - b.imag;
7455         return z;
7456     }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)7457     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7458         __pyx_t_double_complex z;
7459         z.real = a.real * b.real - a.imag * b.imag;
7460         z.imag = a.real * b.imag + a.imag * b.real;
7461         return z;
7462     }
7463     #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)7464     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7465         if (b.imag == 0) {
7466             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
7467         } else if (fabs(b.real) >= fabs(b.imag)) {
7468             if (b.real == 0 && b.imag == 0) {
7469                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
7470             } else {
7471                 double r = b.imag / b.real;
7472                 double s = (double)(1.0) / (b.real + b.imag * r);
7473                 return __pyx_t_double_complex_from_parts(
7474                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
7475             }
7476         } else {
7477             double r = b.real / b.imag;
7478             double s = (double)(1.0) / (b.imag + b.real * r);
7479             return __pyx_t_double_complex_from_parts(
7480                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
7481         }
7482     }
7483     #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)7484     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7485         if (b.imag == 0) {
7486             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
7487         } else {
7488             double denom = b.real * b.real + b.imag * b.imag;
7489             return __pyx_t_double_complex_from_parts(
7490                 (a.real * b.real + a.imag * b.imag) / denom,
7491                 (a.imag * b.real - a.real * b.imag) / denom);
7492         }
7493     }
7494     #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)7495     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
7496         __pyx_t_double_complex z;
7497         z.real = -a.real;
7498         z.imag = -a.imag;
7499         return z;
7500     }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)7501     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
7502        return (a.real == 0) && (a.imag == 0);
7503     }
__Pyx_c_conj_double(__pyx_t_double_complex a)7504     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
7505         __pyx_t_double_complex z;
7506         z.real =  a.real;
7507         z.imag = -a.imag;
7508         return z;
7509     }
7510     #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)7511         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
7512           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
7513             return sqrt(z.real*z.real + z.imag*z.imag);
7514           #else
7515             return hypot(z.real, z.imag);
7516           #endif
7517         }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)7518         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7519             __pyx_t_double_complex z;
7520             double r, lnr, theta, z_r, z_theta;
7521             if (b.imag == 0 && b.real == (int)b.real) {
7522                 if (b.real < 0) {
7523                     double denom = a.real * a.real + a.imag * a.imag;
7524                     a.real = a.real / denom;
7525                     a.imag = -a.imag / denom;
7526                     b.real = -b.real;
7527                 }
7528                 switch ((int)b.real) {
7529                     case 0:
7530                         z.real = 1;
7531                         z.imag = 0;
7532                         return z;
7533                     case 1:
7534                         return a;
7535                     case 2:
7536                         z = __Pyx_c_prod_double(a, a);
7537                         return __Pyx_c_prod_double(a, a);
7538                     case 3:
7539                         z = __Pyx_c_prod_double(a, a);
7540                         return __Pyx_c_prod_double(z, a);
7541                     case 4:
7542                         z = __Pyx_c_prod_double(a, a);
7543                         return __Pyx_c_prod_double(z, z);
7544                 }
7545             }
7546             if (a.imag == 0) {
7547                 if (a.real == 0) {
7548                     return a;
7549                 } else if (b.imag == 0) {
7550                     z.real = pow(a.real, b.real);
7551                     z.imag = 0;
7552                     return z;
7553                 } else if (a.real > 0) {
7554                     r = a.real;
7555                     theta = 0;
7556                 } else {
7557                     r = -a.real;
7558                     theta = atan2(0.0, -1.0);
7559                 }
7560             } else {
7561                 r = __Pyx_c_abs_double(a);
7562                 theta = atan2(a.imag, a.real);
7563             }
7564             lnr = log(r);
7565             z_r = exp(lnr * b.real - theta * b.imag);
7566             z_theta = theta * b.real + lnr * b.imag;
7567             z.real = z_r * cos(z_theta);
7568             z.imag = z_r * sin(z_theta);
7569             return z;
7570         }
7571     #endif
7572 #endif
7573 
7574 /* CIntToPy */
__Pyx_PyInt_From_int(int value)7575   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
7576     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
7577     const int is_unsigned = neg_one > const_zero;
7578     if (is_unsigned) {
7579         if (sizeof(int) < sizeof(long)) {
7580             return PyInt_FromLong((long) value);
7581         } else if (sizeof(int) <= sizeof(unsigned long)) {
7582             return PyLong_FromUnsignedLong((unsigned long) value);
7583 #ifdef HAVE_LONG_LONG
7584         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
7585             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
7586 #endif
7587         }
7588     } else {
7589         if (sizeof(int) <= sizeof(long)) {
7590             return PyInt_FromLong((long) value);
7591 #ifdef HAVE_LONG_LONG
7592         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
7593             return PyLong_FromLongLong((PY_LONG_LONG) value);
7594 #endif
7595         }
7596     }
7597     {
7598         int one = 1; int little = (int)*(unsigned char *)&one;
7599         unsigned char *bytes = (unsigned char *)&value;
7600         return _PyLong_FromByteArray(bytes, sizeof(int),
7601                                      little, !is_unsigned);
7602     }
7603 }
7604 
7605 /* CIntToPy */
__Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value)7606   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
7607     const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
7608     const int is_unsigned = neg_one > const_zero;
7609     if (is_unsigned) {
7610         if (sizeof(enum NPY_TYPES) < sizeof(long)) {
7611             return PyInt_FromLong((long) value);
7612         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
7613             return PyLong_FromUnsignedLong((unsigned long) value);
7614 #ifdef HAVE_LONG_LONG
7615         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
7616             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
7617 #endif
7618         }
7619     } else {
7620         if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
7621             return PyInt_FromLong((long) value);
7622 #ifdef HAVE_LONG_LONG
7623         } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
7624             return PyLong_FromLongLong((PY_LONG_LONG) value);
7625 #endif
7626         }
7627     }
7628     {
7629         int one = 1; int little = (int)*(unsigned char *)&one;
7630         unsigned char *bytes = (unsigned char *)&value;
7631         return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
7632                                      little, !is_unsigned);
7633     }
7634 }
7635 
7636 /* CIntFromPy */
__Pyx_PyInt_As_Py_intptr_t(PyObject * x)7637   static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) {
7638     const Py_intptr_t neg_one = (Py_intptr_t) ((Py_intptr_t) 0 - (Py_intptr_t) 1), const_zero = (Py_intptr_t) 0;
7639     const int is_unsigned = neg_one > const_zero;
7640 #if PY_MAJOR_VERSION < 3
7641     if (likely(PyInt_Check(x))) {
7642         if (sizeof(Py_intptr_t) < sizeof(long)) {
7643             __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, PyInt_AS_LONG(x))
7644         } else {
7645             long val = PyInt_AS_LONG(x);
7646             if (is_unsigned && unlikely(val < 0)) {
7647                 goto raise_neg_overflow;
7648             }
7649             return (Py_intptr_t) val;
7650         }
7651     } else
7652 #endif
7653     if (likely(PyLong_Check(x))) {
7654         if (is_unsigned) {
7655 #if CYTHON_USE_PYLONG_INTERNALS
7656             const digit* digits = ((PyLongObject*)x)->ob_digit;
7657             switch (Py_SIZE(x)) {
7658                 case  0: return (Py_intptr_t) 0;
7659                 case  1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0])
7660                 case 2:
7661                     if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
7662                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7663                             __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7664                         } else if (8 * sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) {
7665                             return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
7666                         }
7667                     }
7668                     break;
7669                 case 3:
7670                     if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
7671                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7672                             __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7673                         } else if (8 * sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) {
7674                             return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
7675                         }
7676                     }
7677                     break;
7678                 case 4:
7679                     if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
7680                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
7681                             __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7682                         } else if (8 * sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT) {
7683                             return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
7684                         }
7685                     }
7686                     break;
7687             }
7688 #endif
7689 #if CYTHON_COMPILING_IN_CPYTHON
7690             if (unlikely(Py_SIZE(x) < 0)) {
7691                 goto raise_neg_overflow;
7692             }
7693 #else
7694             {
7695                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
7696                 if (unlikely(result < 0))
7697                     return (Py_intptr_t) -1;
7698                 if (unlikely(result == 1))
7699                     goto raise_neg_overflow;
7700             }
7701 #endif
7702             if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
7703                 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x))
7704 #ifdef HAVE_LONG_LONG
7705             } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
7706                 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
7707 #endif
7708             }
7709         } else {
7710 #if CYTHON_USE_PYLONG_INTERNALS
7711             const digit* digits = ((PyLongObject*)x)->ob_digit;
7712             switch (Py_SIZE(x)) {
7713                 case  0: return (Py_intptr_t) 0;
7714                 case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, (sdigit) (-(sdigit)digits[0]))
7715                 case  1: __PYX_VERIFY_RETURN_INT(Py_intptr_t,  digit, +digits[0])
7716                 case -2:
7717                     if (8 * sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT) {
7718                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7719                             __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7720                         } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
7721                             return (Py_intptr_t) (((Py_intptr_t)-1)*(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
7722                         }
7723                     }
7724                     break;
7725                 case 2:
7726                     if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
7727                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7728                             __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7729                         } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
7730                             return (Py_intptr_t) ((((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
7731                         }
7732                     }
7733                     break;
7734                 case -3:
7735                     if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
7736                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7737                             __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7738                         } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
7739                             return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
7740                         }
7741                     }
7742                     break;
7743                 case 3:
7744                     if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
7745                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7746                             __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7747                         } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
7748                             return (Py_intptr_t) ((((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
7749                         }
7750                     }
7751                     break;
7752                 case -4:
7753                     if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
7754                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
7755                             __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7756                         } else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
7757                             return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
7758                         }
7759                     }
7760                     break;
7761                 case 4:
7762                     if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
7763                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
7764                             __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7765                         } else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
7766                             return (Py_intptr_t) ((((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
7767                         }
7768                     }
7769                     break;
7770             }
7771 #endif
7772             if (sizeof(Py_intptr_t) <= sizeof(long)) {
7773                 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, long, PyLong_AsLong(x))
7774 #ifdef HAVE_LONG_LONG
7775             } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
7776                 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x))
7777 #endif
7778             }
7779         }
7780         {
7781 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
7782             PyErr_SetString(PyExc_RuntimeError,
7783                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
7784 #else
7785             Py_intptr_t val;
7786             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
7787  #if PY_MAJOR_VERSION < 3
7788             if (likely(v) && !PyLong_Check(v)) {
7789                 PyObject *tmp = v;
7790                 v = PyNumber_Long(tmp);
7791                 Py_DECREF(tmp);
7792             }
7793  #endif
7794             if (likely(v)) {
7795                 int one = 1; int is_little = (int)*(unsigned char *)&one;
7796                 unsigned char *bytes = (unsigned char *)&val;
7797                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
7798                                               bytes, sizeof(val),
7799                                               is_little, !is_unsigned);
7800                 Py_DECREF(v);
7801                 if (likely(!ret))
7802                     return val;
7803             }
7804 #endif
7805             return (Py_intptr_t) -1;
7806         }
7807     } else {
7808         Py_intptr_t val;
7809         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
7810         if (!tmp) return (Py_intptr_t) -1;
7811         val = __Pyx_PyInt_As_Py_intptr_t(tmp);
7812         Py_DECREF(tmp);
7813         return val;
7814     }
7815 raise_overflow:
7816     PyErr_SetString(PyExc_OverflowError,
7817         "value too large to convert to Py_intptr_t");
7818     return (Py_intptr_t) -1;
7819 raise_neg_overflow:
7820     PyErr_SetString(PyExc_OverflowError,
7821         "can't convert negative value to Py_intptr_t");
7822     return (Py_intptr_t) -1;
7823 }
7824 
7825 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)7826   static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
7827     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
7828     const int is_unsigned = neg_one > const_zero;
7829 #if PY_MAJOR_VERSION < 3
7830     if (likely(PyInt_Check(x))) {
7831         if (sizeof(int) < sizeof(long)) {
7832             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
7833         } else {
7834             long val = PyInt_AS_LONG(x);
7835             if (is_unsigned && unlikely(val < 0)) {
7836                 goto raise_neg_overflow;
7837             }
7838             return (int) val;
7839         }
7840     } else
7841 #endif
7842     if (likely(PyLong_Check(x))) {
7843         if (is_unsigned) {
7844 #if CYTHON_USE_PYLONG_INTERNALS
7845             const digit* digits = ((PyLongObject*)x)->ob_digit;
7846             switch (Py_SIZE(x)) {
7847                 case  0: return (int) 0;
7848                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
7849                 case 2:
7850                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
7851                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7852                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7853                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
7854                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
7855                         }
7856                     }
7857                     break;
7858                 case 3:
7859                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
7860                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7861                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7862                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
7863                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
7864                         }
7865                     }
7866                     break;
7867                 case 4:
7868                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
7869                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
7870                             __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])))
7871                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
7872                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
7873                         }
7874                     }
7875                     break;
7876             }
7877 #endif
7878 #if CYTHON_COMPILING_IN_CPYTHON
7879             if (unlikely(Py_SIZE(x) < 0)) {
7880                 goto raise_neg_overflow;
7881             }
7882 #else
7883             {
7884                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
7885                 if (unlikely(result < 0))
7886                     return (int) -1;
7887                 if (unlikely(result == 1))
7888                     goto raise_neg_overflow;
7889             }
7890 #endif
7891             if (sizeof(int) <= sizeof(unsigned long)) {
7892                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
7893 #ifdef HAVE_LONG_LONG
7894             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
7895                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
7896 #endif
7897             }
7898         } else {
7899 #if CYTHON_USE_PYLONG_INTERNALS
7900             const digit* digits = ((PyLongObject*)x)->ob_digit;
7901             switch (Py_SIZE(x)) {
7902                 case  0: return (int) 0;
7903                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
7904                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
7905                 case -2:
7906                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
7907                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7908                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7909                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
7910                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7911                         }
7912                     }
7913                     break;
7914                 case 2:
7915                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
7916                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7917                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7918                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
7919                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7920                         }
7921                     }
7922                     break;
7923                 case -3:
7924                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
7925                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7926                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7927                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
7928                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7929                         }
7930                     }
7931                     break;
7932                 case 3:
7933                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
7934                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7935                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7936                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
7937                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7938                         }
7939                     }
7940                     break;
7941                 case -4:
7942                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
7943                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
7944                             __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])))
7945                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
7946                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7947                         }
7948                     }
7949                     break;
7950                 case 4:
7951                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
7952                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
7953                             __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])))
7954                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
7955                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7956                         }
7957                     }
7958                     break;
7959             }
7960 #endif
7961             if (sizeof(int) <= sizeof(long)) {
7962                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
7963 #ifdef HAVE_LONG_LONG
7964             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
7965                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
7966 #endif
7967             }
7968         }
7969         {
7970 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
7971             PyErr_SetString(PyExc_RuntimeError,
7972                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
7973 #else
7974             int val;
7975             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
7976  #if PY_MAJOR_VERSION < 3
7977             if (likely(v) && !PyLong_Check(v)) {
7978                 PyObject *tmp = v;
7979                 v = PyNumber_Long(tmp);
7980                 Py_DECREF(tmp);
7981             }
7982  #endif
7983             if (likely(v)) {
7984                 int one = 1; int is_little = (int)*(unsigned char *)&one;
7985                 unsigned char *bytes = (unsigned char *)&val;
7986                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
7987                                               bytes, sizeof(val),
7988                                               is_little, !is_unsigned);
7989                 Py_DECREF(v);
7990                 if (likely(!ret))
7991                     return val;
7992             }
7993 #endif
7994             return (int) -1;
7995         }
7996     } else {
7997         int val;
7998         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
7999         if (!tmp) return (int) -1;
8000         val = __Pyx_PyInt_As_int(tmp);
8001         Py_DECREF(tmp);
8002         return val;
8003     }
8004 raise_overflow:
8005     PyErr_SetString(PyExc_OverflowError,
8006         "value too large to convert to int");
8007     return (int) -1;
8008 raise_neg_overflow:
8009     PyErr_SetString(PyExc_OverflowError,
8010         "can't convert negative value to int");
8011     return (int) -1;
8012 }
8013 
8014 /* CIntToPy */
__Pyx_PyInt_From_long(long value)8015   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
8016     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
8017     const int is_unsigned = neg_one > const_zero;
8018     if (is_unsigned) {
8019         if (sizeof(long) < sizeof(long)) {
8020             return PyInt_FromLong((long) value);
8021         } else if (sizeof(long) <= sizeof(unsigned long)) {
8022             return PyLong_FromUnsignedLong((unsigned long) value);
8023 #ifdef HAVE_LONG_LONG
8024         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
8025             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
8026 #endif
8027         }
8028     } else {
8029         if (sizeof(long) <= sizeof(long)) {
8030             return PyInt_FromLong((long) value);
8031 #ifdef HAVE_LONG_LONG
8032         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
8033             return PyLong_FromLongLong((PY_LONG_LONG) value);
8034 #endif
8035         }
8036     }
8037     {
8038         int one = 1; int little = (int)*(unsigned char *)&one;
8039         unsigned char *bytes = (unsigned char *)&value;
8040         return _PyLong_FromByteArray(bytes, sizeof(long),
8041                                      little, !is_unsigned);
8042     }
8043 }
8044 
8045 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)8046   static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
8047     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
8048     const int is_unsigned = neg_one > const_zero;
8049 #if PY_MAJOR_VERSION < 3
8050     if (likely(PyInt_Check(x))) {
8051         if (sizeof(long) < sizeof(long)) {
8052             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
8053         } else {
8054             long val = PyInt_AS_LONG(x);
8055             if (is_unsigned && unlikely(val < 0)) {
8056                 goto raise_neg_overflow;
8057             }
8058             return (long) val;
8059         }
8060     } else
8061 #endif
8062     if (likely(PyLong_Check(x))) {
8063         if (is_unsigned) {
8064 #if CYTHON_USE_PYLONG_INTERNALS
8065             const digit* digits = ((PyLongObject*)x)->ob_digit;
8066             switch (Py_SIZE(x)) {
8067                 case  0: return (long) 0;
8068                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
8069                 case 2:
8070                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
8071                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
8072                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8073                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
8074                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
8075                         }
8076                     }
8077                     break;
8078                 case 3:
8079                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
8080                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
8081                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8082                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
8083                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
8084                         }
8085                     }
8086                     break;
8087                 case 4:
8088                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
8089                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
8090                             __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])))
8091                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
8092                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
8093                         }
8094                     }
8095                     break;
8096             }
8097 #endif
8098 #if CYTHON_COMPILING_IN_CPYTHON
8099             if (unlikely(Py_SIZE(x) < 0)) {
8100                 goto raise_neg_overflow;
8101             }
8102 #else
8103             {
8104                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
8105                 if (unlikely(result < 0))
8106                     return (long) -1;
8107                 if (unlikely(result == 1))
8108                     goto raise_neg_overflow;
8109             }
8110 #endif
8111             if (sizeof(long) <= sizeof(unsigned long)) {
8112                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
8113 #ifdef HAVE_LONG_LONG
8114             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
8115                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
8116 #endif
8117             }
8118         } else {
8119 #if CYTHON_USE_PYLONG_INTERNALS
8120             const digit* digits = ((PyLongObject*)x)->ob_digit;
8121             switch (Py_SIZE(x)) {
8122                 case  0: return (long) 0;
8123                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
8124                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
8125                 case -2:
8126                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
8127                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
8128                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8129                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
8130                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8131                         }
8132                     }
8133                     break;
8134                 case 2:
8135                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
8136                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
8137                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8138                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
8139                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8140                         }
8141                     }
8142                     break;
8143                 case -3:
8144                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
8145                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
8146                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8147                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
8148                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8149                         }
8150                     }
8151                     break;
8152                 case 3:
8153                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
8154                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
8155                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8156                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
8157                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8158                         }
8159                     }
8160                     break;
8161                 case -4:
8162                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
8163                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
8164                             __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])))
8165                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
8166                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8167                         }
8168                     }
8169                     break;
8170                 case 4:
8171                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
8172                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
8173                             __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])))
8174                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
8175                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8176                         }
8177                     }
8178                     break;
8179             }
8180 #endif
8181             if (sizeof(long) <= sizeof(long)) {
8182                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
8183 #ifdef HAVE_LONG_LONG
8184             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
8185                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
8186 #endif
8187             }
8188         }
8189         {
8190 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
8191             PyErr_SetString(PyExc_RuntimeError,
8192                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
8193 #else
8194             long val;
8195             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
8196  #if PY_MAJOR_VERSION < 3
8197             if (likely(v) && !PyLong_Check(v)) {
8198                 PyObject *tmp = v;
8199                 v = PyNumber_Long(tmp);
8200                 Py_DECREF(tmp);
8201             }
8202  #endif
8203             if (likely(v)) {
8204                 int one = 1; int is_little = (int)*(unsigned char *)&one;
8205                 unsigned char *bytes = (unsigned char *)&val;
8206                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
8207                                               bytes, sizeof(val),
8208                                               is_little, !is_unsigned);
8209                 Py_DECREF(v);
8210                 if (likely(!ret))
8211                     return val;
8212             }
8213 #endif
8214             return (long) -1;
8215         }
8216     } else {
8217         long val;
8218         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
8219         if (!tmp) return (long) -1;
8220         val = __Pyx_PyInt_As_long(tmp);
8221         Py_DECREF(tmp);
8222         return val;
8223     }
8224 raise_overflow:
8225     PyErr_SetString(PyExc_OverflowError,
8226         "value too large to convert to long");
8227     return (long) -1;
8228 raise_neg_overflow:
8229     PyErr_SetString(PyExc_OverflowError,
8230         "can't convert negative value to long");
8231     return (long) -1;
8232 }
8233 
8234 /* FastTypeChecks */
8235   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)8236 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
8237     while (a) {
8238         a = a->tp_base;
8239         if (a == b)
8240             return 1;
8241     }
8242     return b == &PyBaseObject_Type;
8243 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)8244 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
8245     PyObject *mro;
8246     if (a == b) return 1;
8247     mro = a->tp_mro;
8248     if (likely(mro)) {
8249         Py_ssize_t i, n;
8250         n = PyTuple_GET_SIZE(mro);
8251         for (i = 0; i < n; i++) {
8252             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
8253                 return 1;
8254         }
8255         return 0;
8256     }
8257     return __Pyx_InBases(a, b);
8258 }
8259 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)8260 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
8261     PyObject *exception, *value, *tb;
8262     int res;
8263     __Pyx_PyThreadState_declare
8264     __Pyx_PyThreadState_assign
8265     __Pyx_ErrFetch(&exception, &value, &tb);
8266     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
8267     if (unlikely(res == -1)) {
8268         PyErr_WriteUnraisable(err);
8269         res = 0;
8270     }
8271     if (!res) {
8272         res = PyObject_IsSubclass(err, exc_type2);
8273         if (unlikely(res == -1)) {
8274             PyErr_WriteUnraisable(err);
8275             res = 0;
8276         }
8277     }
8278     __Pyx_ErrRestore(exception, value, tb);
8279     return res;
8280 }
8281 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)8282 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
8283     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
8284     if (!res) {
8285         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
8286     }
8287     return res;
8288 }
8289 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)8290 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
8291     Py_ssize_t i, n;
8292     assert(PyExceptionClass_Check(exc_type));
8293     n = PyTuple_GET_SIZE(tuple);
8294 #if PY_MAJOR_VERSION >= 3
8295     for (i=0; i<n; i++) {
8296         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
8297     }
8298 #endif
8299     for (i=0; i<n; i++) {
8300         PyObject *t = PyTuple_GET_ITEM(tuple, i);
8301         #if PY_MAJOR_VERSION < 3
8302         if (likely(exc_type == t)) return 1;
8303         #endif
8304         if (likely(PyExceptionClass_Check(t))) {
8305             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
8306         } else {
8307         }
8308     }
8309     return 0;
8310 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)8311 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
8312     if (likely(err == exc_type)) return 1;
8313     if (likely(PyExceptionClass_Check(err))) {
8314         if (likely(PyExceptionClass_Check(exc_type))) {
8315             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
8316         } else if (likely(PyTuple_Check(exc_type))) {
8317             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
8318         } else {
8319         }
8320     }
8321     return PyErr_GivenExceptionMatches(err, exc_type);
8322 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)8323 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
8324     assert(PyExceptionClass_Check(exc_type1));
8325     assert(PyExceptionClass_Check(exc_type2));
8326     if (likely(err == exc_type1 || err == exc_type2)) return 1;
8327     if (likely(PyExceptionClass_Check(err))) {
8328         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
8329     }
8330     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
8331 }
8332 #endif
8333 
8334 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)8335   static int __Pyx_check_binary_version(void) {
8336     char ctversion[4], rtversion[4];
8337     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
8338     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
8339     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
8340         char message[200];
8341         PyOS_snprintf(message, sizeof(message),
8342                       "compiletime version %s of module '%.100s' "
8343                       "does not match runtime version %s",
8344                       ctversion, __Pyx_MODULE_NAME, rtversion);
8345         return PyErr_WarnEx(NULL, message, 1);
8346     }
8347     return 0;
8348 }
8349 
8350 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)8351   static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
8352     while (t->p) {
8353         #if PY_MAJOR_VERSION < 3
8354         if (t->is_unicode) {
8355             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
8356         } else if (t->intern) {
8357             *t->p = PyString_InternFromString(t->s);
8358         } else {
8359             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
8360         }
8361         #else
8362         if (t->is_unicode | t->is_str) {
8363             if (t->intern) {
8364                 *t->p = PyUnicode_InternFromString(t->s);
8365             } else if (t->encoding) {
8366                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
8367             } else {
8368                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
8369             }
8370         } else {
8371             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
8372         }
8373         #endif
8374         if (!*t->p)
8375             return -1;
8376         if (PyObject_Hash(*t->p) == -1)
8377             return -1;
8378         ++t;
8379     }
8380     return 0;
8381 }
8382 
__Pyx_PyUnicode_FromString(const char * c_str)8383 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
8384     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
8385 }
__Pyx_PyObject_AsString(PyObject * o)8386 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
8387     Py_ssize_t ignore;
8388     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
8389 }
8390 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
8391 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)8392 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
8393     char* defenc_c;
8394     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
8395     if (!defenc) return NULL;
8396     defenc_c = PyBytes_AS_STRING(defenc);
8397 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
8398     {
8399         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
8400         char* c;
8401         for (c = defenc_c; c < end; c++) {
8402             if ((unsigned char) (*c) >= 128) {
8403                 PyUnicode_AsASCIIString(o);
8404                 return NULL;
8405             }
8406         }
8407     }
8408 #endif
8409     *length = PyBytes_GET_SIZE(defenc);
8410     return defenc_c;
8411 }
8412 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)8413 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
8414     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
8415 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
8416     if (likely(PyUnicode_IS_ASCII(o))) {
8417         *length = PyUnicode_GET_LENGTH(o);
8418         return PyUnicode_AsUTF8(o);
8419     } else {
8420         PyUnicode_AsASCIIString(o);
8421         return NULL;
8422     }
8423 #else
8424     return PyUnicode_AsUTF8AndSize(o, length);
8425 #endif
8426 }
8427 #endif
8428 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)8429 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
8430 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
8431     if (
8432 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
8433             __Pyx_sys_getdefaultencoding_not_ascii &&
8434 #endif
8435             PyUnicode_Check(o)) {
8436         return __Pyx_PyUnicode_AsStringAndSize(o, length);
8437     } else
8438 #endif
8439 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
8440     if (PyByteArray_Check(o)) {
8441         *length = PyByteArray_GET_SIZE(o);
8442         return PyByteArray_AS_STRING(o);
8443     } else
8444 #endif
8445     {
8446         char* result;
8447         int r = PyBytes_AsStringAndSize(o, &result, length);
8448         if (unlikely(r < 0)) {
8449             return NULL;
8450         } else {
8451             return result;
8452         }
8453     }
8454 }
__Pyx_PyObject_IsTrue(PyObject * x)8455 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
8456    int is_true = x == Py_True;
8457    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
8458    else return PyObject_IsTrue(x);
8459 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)8460 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
8461     int retval;
8462     if (unlikely(!x)) return -1;
8463     retval = __Pyx_PyObject_IsTrue(x);
8464     Py_DECREF(x);
8465     return retval;
8466 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)8467 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
8468 #if PY_MAJOR_VERSION >= 3
8469     if (PyLong_Check(result)) {
8470         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
8471                 "__int__ returned non-int (type %.200s).  "
8472                 "The ability to return an instance of a strict subclass of int "
8473                 "is deprecated, and may be removed in a future version of Python.",
8474                 Py_TYPE(result)->tp_name)) {
8475             Py_DECREF(result);
8476             return NULL;
8477         }
8478         return result;
8479     }
8480 #endif
8481     PyErr_Format(PyExc_TypeError,
8482                  "__%.4s__ returned non-%.4s (type %.200s)",
8483                  type_name, type_name, Py_TYPE(result)->tp_name);
8484     Py_DECREF(result);
8485     return NULL;
8486 }
__Pyx_PyNumber_IntOrLong(PyObject * x)8487 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
8488 #if CYTHON_USE_TYPE_SLOTS
8489   PyNumberMethods *m;
8490 #endif
8491   const char *name = NULL;
8492   PyObject *res = NULL;
8493 #if PY_MAJOR_VERSION < 3
8494   if (likely(PyInt_Check(x) || PyLong_Check(x)))
8495 #else
8496   if (likely(PyLong_Check(x)))
8497 #endif
8498     return __Pyx_NewRef(x);
8499 #if CYTHON_USE_TYPE_SLOTS
8500   m = Py_TYPE(x)->tp_as_number;
8501   #if PY_MAJOR_VERSION < 3
8502   if (m && m->nb_int) {
8503     name = "int";
8504     res = m->nb_int(x);
8505   }
8506   else if (m && m->nb_long) {
8507     name = "long";
8508     res = m->nb_long(x);
8509   }
8510   #else
8511   if (likely(m && m->nb_int)) {
8512     name = "int";
8513     res = m->nb_int(x);
8514   }
8515   #endif
8516 #else
8517   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
8518     res = PyNumber_Int(x);
8519   }
8520 #endif
8521   if (likely(res)) {
8522 #if PY_MAJOR_VERSION < 3
8523     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
8524 #else
8525     if (unlikely(!PyLong_CheckExact(res))) {
8526 #endif
8527         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
8528     }
8529   }
8530   else if (!PyErr_Occurred()) {
8531     PyErr_SetString(PyExc_TypeError,
8532                     "an integer is required");
8533   }
8534   return res;
8535 }
8536 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
8537   Py_ssize_t ival;
8538   PyObject *x;
8539 #if PY_MAJOR_VERSION < 3
8540   if (likely(PyInt_CheckExact(b))) {
8541     if (sizeof(Py_ssize_t) >= sizeof(long))
8542         return PyInt_AS_LONG(b);
8543     else
8544         return PyInt_AsSsize_t(b);
8545   }
8546 #endif
8547   if (likely(PyLong_CheckExact(b))) {
8548     #if CYTHON_USE_PYLONG_INTERNALS
8549     const digit* digits = ((PyLongObject*)b)->ob_digit;
8550     const Py_ssize_t size = Py_SIZE(b);
8551     if (likely(__Pyx_sst_abs(size) <= 1)) {
8552         ival = likely(size) ? digits[0] : 0;
8553         if (size == -1) ival = -ival;
8554         return ival;
8555     } else {
8556       switch (size) {
8557          case 2:
8558            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
8559              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
8560            }
8561            break;
8562          case -2:
8563            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
8564              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
8565            }
8566            break;
8567          case 3:
8568            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
8569              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
8570            }
8571            break;
8572          case -3:
8573            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
8574              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
8575            }
8576            break;
8577          case 4:
8578            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
8579              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]));
8580            }
8581            break;
8582          case -4:
8583            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
8584              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]));
8585            }
8586            break;
8587       }
8588     }
8589     #endif
8590     return PyLong_AsSsize_t(b);
8591   }
8592   x = PyNumber_Index(b);
8593   if (!x) return -1;
8594   ival = PyInt_AsSsize_t(x);
8595   Py_DECREF(x);
8596   return ival;
8597 }
8598 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
8599   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
8600 }
8601 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
8602     return PyInt_FromSize_t(ival);
8603 }
8604 
8605 
8606 #endif /* Py_PYTHON_H */
8607